data-footer.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VDataFooterBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VDataFooter(children ...h.HTMLComponent) (r *VDataFooterBuilder) {
  11. r = &VDataFooterBuilder{
  12. tag: h.Tag("v-data-footer").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VDataFooterBuilder) DisableItemsPerPage(v bool) (r *VDataFooterBuilder) {
  17. b.tag.Attr(":disable-items-per-page", fmt.Sprint(v))
  18. return b
  19. }
  20. func (b *VDataFooterBuilder) DisablePagination(v bool) (r *VDataFooterBuilder) {
  21. b.tag.Attr(":disable-pagination", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VDataFooterBuilder) FirstIcon(v string) (r *VDataFooterBuilder) {
  25. b.tag.Attr("first-icon", v)
  26. return b
  27. }
  28. func (b *VDataFooterBuilder) ItemsPerPageAllText(v string) (r *VDataFooterBuilder) {
  29. b.tag.Attr("items-per-page-all-text", v)
  30. return b
  31. }
  32. func (b *VDataFooterBuilder) ItemsPerPageOptions(v interface{}) (r *VDataFooterBuilder) {
  33. b.tag.Attr(":items-per-page-options", h.JSONString(v))
  34. return b
  35. }
  36. func (b *VDataFooterBuilder) ItemsPerPageText(v string) (r *VDataFooterBuilder) {
  37. b.tag.Attr("items-per-page-text", v)
  38. return b
  39. }
  40. func (b *VDataFooterBuilder) LastIcon(v string) (r *VDataFooterBuilder) {
  41. b.tag.Attr("last-icon", v)
  42. return b
  43. }
  44. func (b *VDataFooterBuilder) NextIcon(v string) (r *VDataFooterBuilder) {
  45. b.tag.Attr("next-icon", v)
  46. return b
  47. }
  48. func (b *VDataFooterBuilder) Options(v interface{}) (r *VDataFooterBuilder) {
  49. b.tag.Attr(":options", h.JSONString(v))
  50. return b
  51. }
  52. func (b *VDataFooterBuilder) PageText(v string) (r *VDataFooterBuilder) {
  53. b.tag.Attr("page-text", v)
  54. return b
  55. }
  56. func (b *VDataFooterBuilder) Pagination(v interface{}) (r *VDataFooterBuilder) {
  57. b.tag.Attr(":pagination", h.JSONString(v))
  58. return b
  59. }
  60. func (b *VDataFooterBuilder) PrevIcon(v string) (r *VDataFooterBuilder) {
  61. b.tag.Attr("prev-icon", v)
  62. return b
  63. }
  64. func (b *VDataFooterBuilder) ShowCurrentPage(v bool) (r *VDataFooterBuilder) {
  65. b.tag.Attr(":show-current-page", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VDataFooterBuilder) ShowFirstLastPage(v bool) (r *VDataFooterBuilder) {
  69. b.tag.Attr(":show-first-last-page", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VDataFooterBuilder) SetAttr(k string, v interface{}) {
  73. b.tag.SetAttr(k, v)
  74. }
  75. func (b *VDataFooterBuilder) Attr(vs ...interface{}) (r *VDataFooterBuilder) {
  76. b.tag.Attr(vs...)
  77. return b
  78. }
  79. func (b *VDataFooterBuilder) Children(children ...h.HTMLComponent) (r *VDataFooterBuilder) {
  80. b.tag.Children(children...)
  81. return b
  82. }
  83. func (b *VDataFooterBuilder) AppendChildren(children ...h.HTMLComponent) (r *VDataFooterBuilder) {
  84. b.tag.AppendChildren(children...)
  85. return b
  86. }
  87. func (b *VDataFooterBuilder) PrependChildren(children ...h.HTMLComponent) (r *VDataFooterBuilder) {
  88. b.tag.PrependChildren(children...)
  89. return b
  90. }
  91. func (b *VDataFooterBuilder) Class(names ...string) (r *VDataFooterBuilder) {
  92. b.tag.Class(names...)
  93. return b
  94. }
  95. func (b *VDataFooterBuilder) ClassIf(name string, add bool) (r *VDataFooterBuilder) {
  96. b.tag.ClassIf(name, add)
  97. return b
  98. }
  99. func (b *VDataFooterBuilder) On(name string, value string) (r *VDataFooterBuilder) {
  100. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  101. return b
  102. }
  103. func (b *VDataFooterBuilder) Bind(name string, value string) (r *VDataFooterBuilder) {
  104. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  105. return b
  106. }
  107. func (b *VDataFooterBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  108. return b.tag.MarshalHTML(ctx)
  109. }