list-item-group.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VListItemGroupBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VListItemGroup(children ...h.HTMLComponent) (r *VListItemGroupBuilder) {
  11. r = &VListItemGroupBuilder{
  12. tag: h.Tag("v-list-item-group").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VListItemGroupBuilder) ActiveClass(v string) (r *VListItemGroupBuilder) {
  17. b.tag.Attr("active-class", v)
  18. return b
  19. }
  20. func (b *VListItemGroupBuilder) Color(v string) (r *VListItemGroupBuilder) {
  21. b.tag.Attr("color", v)
  22. return b
  23. }
  24. func (b *VListItemGroupBuilder) Dark(v bool) (r *VListItemGroupBuilder) {
  25. b.tag.Attr(":dark", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VListItemGroupBuilder) Light(v bool) (r *VListItemGroupBuilder) {
  29. b.tag.Attr(":light", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VListItemGroupBuilder) Mandatory(v bool) (r *VListItemGroupBuilder) {
  33. b.tag.Attr(":mandatory", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VListItemGroupBuilder) Max(v int) (r *VListItemGroupBuilder) {
  37. b.tag.Attr(":max", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VListItemGroupBuilder) Multiple(v bool) (r *VListItemGroupBuilder) {
  41. b.tag.Attr(":multiple", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VListItemGroupBuilder) Tag(v string) (r *VListItemGroupBuilder) {
  45. b.tag.Attr("tag", v)
  46. return b
  47. }
  48. func (b *VListItemGroupBuilder) Value(v interface{}) (r *VListItemGroupBuilder) {
  49. b.tag.Attr(":value", h.JSONString(v))
  50. return b
  51. }
  52. func (b *VListItemGroupBuilder) SetAttr(k string, v interface{}) {
  53. b.tag.SetAttr(k, v)
  54. }
  55. func (b *VListItemGroupBuilder) Attr(vs ...interface{}) (r *VListItemGroupBuilder) {
  56. b.tag.Attr(vs...)
  57. return b
  58. }
  59. func (b *VListItemGroupBuilder) Children(children ...h.HTMLComponent) (r *VListItemGroupBuilder) {
  60. b.tag.Children(children...)
  61. return b
  62. }
  63. func (b *VListItemGroupBuilder) AppendChildren(children ...h.HTMLComponent) (r *VListItemGroupBuilder) {
  64. b.tag.AppendChildren(children...)
  65. return b
  66. }
  67. func (b *VListItemGroupBuilder) PrependChildren(children ...h.HTMLComponent) (r *VListItemGroupBuilder) {
  68. b.tag.PrependChildren(children...)
  69. return b
  70. }
  71. func (b *VListItemGroupBuilder) Class(names ...string) (r *VListItemGroupBuilder) {
  72. b.tag.Class(names...)
  73. return b
  74. }
  75. func (b *VListItemGroupBuilder) ClassIf(name string, add bool) (r *VListItemGroupBuilder) {
  76. b.tag.ClassIf(name, add)
  77. return b
  78. }
  79. func (b *VListItemGroupBuilder) On(name string, value string) (r *VListItemGroupBuilder) {
  80. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  81. return b
  82. }
  83. func (b *VListItemGroupBuilder) Bind(name string, value string) (r *VListItemGroupBuilder) {
  84. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  85. return b
  86. }
  87. func (b *VListItemGroupBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  88. return b.tag.MarshalHTML(ctx)
  89. }