list-group.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VListGroupBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VListGroup(children ...h.HTMLComponent) (r *VListGroupBuilder) {
  11. r = &VListGroupBuilder{
  12. tag: h.Tag("v-list-group").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VListGroupBuilder) ActiveClass(v string) (r *VListGroupBuilder) {
  17. b.tag.Attr("active-class", v)
  18. return b
  19. }
  20. func (b *VListGroupBuilder) AppendIcon(v string) (r *VListGroupBuilder) {
  21. b.tag.Attr("append-icon", v)
  22. return b
  23. }
  24. func (b *VListGroupBuilder) Color(v string) (r *VListGroupBuilder) {
  25. b.tag.Attr("color", v)
  26. return b
  27. }
  28. func (b *VListGroupBuilder) Disabled(v bool) (r *VListGroupBuilder) {
  29. b.tag.Attr(":disabled", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VListGroupBuilder) Eager(v bool) (r *VListGroupBuilder) {
  33. b.tag.Attr(":eager", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VListGroupBuilder) Group(v string) (r *VListGroupBuilder) {
  37. b.tag.Attr("group", v)
  38. return b
  39. }
  40. func (b *VListGroupBuilder) NoAction(v bool) (r *VListGroupBuilder) {
  41. b.tag.Attr(":no-action", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VListGroupBuilder) PrependIcon(v string) (r *VListGroupBuilder) {
  45. b.tag.Attr("prepend-icon", v)
  46. return b
  47. }
  48. func (b *VListGroupBuilder) Ripple(v interface{}) (r *VListGroupBuilder) {
  49. b.tag.Attr(":ripple", h.JSONString(v))
  50. return b
  51. }
  52. func (b *VListGroupBuilder) SubGroup(v bool) (r *VListGroupBuilder) {
  53. b.tag.Attr(":sub-group", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VListGroupBuilder) Value(v interface{}) (r *VListGroupBuilder) {
  57. b.tag.Attr(":value", h.JSONString(v))
  58. return b
  59. }
  60. func (b *VListGroupBuilder) SetAttr(k string, v interface{}) {
  61. b.tag.SetAttr(k, v)
  62. }
  63. func (b *VListGroupBuilder) Attr(vs ...interface{}) (r *VListGroupBuilder) {
  64. b.tag.Attr(vs...)
  65. return b
  66. }
  67. func (b *VListGroupBuilder) Children(children ...h.HTMLComponent) (r *VListGroupBuilder) {
  68. b.tag.Children(children...)
  69. return b
  70. }
  71. func (b *VListGroupBuilder) AppendChildren(children ...h.HTMLComponent) (r *VListGroupBuilder) {
  72. b.tag.AppendChildren(children...)
  73. return b
  74. }
  75. func (b *VListGroupBuilder) PrependChildren(children ...h.HTMLComponent) (r *VListGroupBuilder) {
  76. b.tag.PrependChildren(children...)
  77. return b
  78. }
  79. func (b *VListGroupBuilder) Class(names ...string) (r *VListGroupBuilder) {
  80. b.tag.Class(names...)
  81. return b
  82. }
  83. func (b *VListGroupBuilder) ClassIf(name string, add bool) (r *VListGroupBuilder) {
  84. b.tag.ClassIf(name, add)
  85. return b
  86. }
  87. func (b *VListGroupBuilder) On(name string, value string) (r *VListGroupBuilder) {
  88. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  89. return b
  90. }
  91. func (b *VListGroupBuilder) Bind(name string, value string) (r *VListGroupBuilder) {
  92. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  93. return b
  94. }
  95. func (b *VListGroupBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  96. return b.tag.MarshalHTML(ctx)
  97. }