expansion-panels.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VExpansionPanelsBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VExpansionPanels(children ...h.HTMLComponent) (r *VExpansionPanelsBuilder) {
  11. r = &VExpansionPanelsBuilder{
  12. tag: h.Tag("v-expansion-panels").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VExpansionPanelsBuilder) Accordion(v bool) (r *VExpansionPanelsBuilder) {
  17. b.tag.Attr(":accordion", fmt.Sprint(v))
  18. return b
  19. }
  20. func (b *VExpansionPanelsBuilder) ActiveClass(v string) (r *VExpansionPanelsBuilder) {
  21. b.tag.Attr("active-class", v)
  22. return b
  23. }
  24. func (b *VExpansionPanelsBuilder) Dark(v bool) (r *VExpansionPanelsBuilder) {
  25. b.tag.Attr(":dark", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VExpansionPanelsBuilder) Disabled(v bool) (r *VExpansionPanelsBuilder) {
  29. b.tag.Attr(":disabled", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VExpansionPanelsBuilder) Flat(v bool) (r *VExpansionPanelsBuilder) {
  33. b.tag.Attr(":flat", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VExpansionPanelsBuilder) Focusable(v bool) (r *VExpansionPanelsBuilder) {
  37. b.tag.Attr(":focusable", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VExpansionPanelsBuilder) Hover(v bool) (r *VExpansionPanelsBuilder) {
  41. b.tag.Attr(":hover", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VExpansionPanelsBuilder) Inset(v bool) (r *VExpansionPanelsBuilder) {
  45. b.tag.Attr(":inset", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VExpansionPanelsBuilder) Light(v bool) (r *VExpansionPanelsBuilder) {
  49. b.tag.Attr(":light", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VExpansionPanelsBuilder) Mandatory(v bool) (r *VExpansionPanelsBuilder) {
  53. b.tag.Attr(":mandatory", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VExpansionPanelsBuilder) Max(v int) (r *VExpansionPanelsBuilder) {
  57. b.tag.Attr(":max", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VExpansionPanelsBuilder) Multiple(v bool) (r *VExpansionPanelsBuilder) {
  61. b.tag.Attr(":multiple", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VExpansionPanelsBuilder) Popout(v bool) (r *VExpansionPanelsBuilder) {
  65. b.tag.Attr(":popout", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VExpansionPanelsBuilder) Readonly(v bool) (r *VExpansionPanelsBuilder) {
  69. b.tag.Attr(":readonly", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VExpansionPanelsBuilder) Tag(v string) (r *VExpansionPanelsBuilder) {
  73. b.tag.Attr("tag", v)
  74. return b
  75. }
  76. func (b *VExpansionPanelsBuilder) Tile(v bool) (r *VExpansionPanelsBuilder) {
  77. b.tag.Attr(":tile", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VExpansionPanelsBuilder) Value(v interface{}) (r *VExpansionPanelsBuilder) {
  81. b.tag.Attr(":value", h.JSONString(v))
  82. return b
  83. }
  84. func (b *VExpansionPanelsBuilder) SetAttr(k string, v interface{}) {
  85. b.tag.SetAttr(k, v)
  86. }
  87. func (b *VExpansionPanelsBuilder) Attr(vs ...interface{}) (r *VExpansionPanelsBuilder) {
  88. b.tag.Attr(vs...)
  89. return b
  90. }
  91. func (b *VExpansionPanelsBuilder) Children(children ...h.HTMLComponent) (r *VExpansionPanelsBuilder) {
  92. b.tag.Children(children...)
  93. return b
  94. }
  95. func (b *VExpansionPanelsBuilder) AppendChildren(children ...h.HTMLComponent) (r *VExpansionPanelsBuilder) {
  96. b.tag.AppendChildren(children...)
  97. return b
  98. }
  99. func (b *VExpansionPanelsBuilder) PrependChildren(children ...h.HTMLComponent) (r *VExpansionPanelsBuilder) {
  100. b.tag.PrependChildren(children...)
  101. return b
  102. }
  103. func (b *VExpansionPanelsBuilder) Class(names ...string) (r *VExpansionPanelsBuilder) {
  104. b.tag.Class(names...)
  105. return b
  106. }
  107. func (b *VExpansionPanelsBuilder) ClassIf(name string, add bool) (r *VExpansionPanelsBuilder) {
  108. b.tag.ClassIf(name, add)
  109. return b
  110. }
  111. func (b *VExpansionPanelsBuilder) On(name string, value string) (r *VExpansionPanelsBuilder) {
  112. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  113. return b
  114. }
  115. func (b *VExpansionPanelsBuilder) Bind(name string, value string) (r *VExpansionPanelsBuilder) {
  116. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  117. return b
  118. }
  119. func (b *VExpansionPanelsBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  120. return b.tag.MarshalHTML(ctx)
  121. }