carousel.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VCarouselBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VCarousel(children ...h.HTMLComponent) (r *VCarouselBuilder) {
  11. r = &VCarouselBuilder{
  12. tag: h.Tag("v-carousel").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VCarouselBuilder) ActiveClass(v string) (r *VCarouselBuilder) {
  17. b.tag.Attr("active-class", v)
  18. return b
  19. }
  20. func (b *VCarouselBuilder) Continuous(v bool) (r *VCarouselBuilder) {
  21. b.tag.Attr(":continuous", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VCarouselBuilder) Cycle(v bool) (r *VCarouselBuilder) {
  25. b.tag.Attr(":cycle", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VCarouselBuilder) Dark(v bool) (r *VCarouselBuilder) {
  29. b.tag.Attr(":dark", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VCarouselBuilder) DelimiterIcon(v string) (r *VCarouselBuilder) {
  33. b.tag.Attr("delimiter-icon", v)
  34. return b
  35. }
  36. func (b *VCarouselBuilder) Height(v int) (r *VCarouselBuilder) {
  37. b.tag.Attr(":height", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VCarouselBuilder) HideDelimiterBackground(v bool) (r *VCarouselBuilder) {
  41. b.tag.Attr(":hide-delimiter-background", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VCarouselBuilder) HideDelimiters(v bool) (r *VCarouselBuilder) {
  45. b.tag.Attr(":hide-delimiters", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VCarouselBuilder) Interval(v int) (r *VCarouselBuilder) {
  49. b.tag.Attr(":interval", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VCarouselBuilder) Light(v bool) (r *VCarouselBuilder) {
  53. b.tag.Attr(":light", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VCarouselBuilder) Mandatory(v bool) (r *VCarouselBuilder) {
  57. b.tag.Attr(":mandatory", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VCarouselBuilder) Max(v int) (r *VCarouselBuilder) {
  61. b.tag.Attr(":max", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VCarouselBuilder) Multiple(v bool) (r *VCarouselBuilder) {
  65. b.tag.Attr(":multiple", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VCarouselBuilder) NextIcon(v bool) (r *VCarouselBuilder) {
  69. b.tag.Attr(":next-icon", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VCarouselBuilder) PrevIcon(v bool) (r *VCarouselBuilder) {
  73. b.tag.Attr(":prev-icon", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VCarouselBuilder) Progress(v bool) (r *VCarouselBuilder) {
  77. b.tag.Attr(":progress", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VCarouselBuilder) ProgressColor(v string) (r *VCarouselBuilder) {
  81. b.tag.Attr("progress-color", v)
  82. return b
  83. }
  84. func (b *VCarouselBuilder) Reverse(v bool) (r *VCarouselBuilder) {
  85. b.tag.Attr(":reverse", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VCarouselBuilder) ShowArrows(v bool) (r *VCarouselBuilder) {
  89. b.tag.Attr(":show-arrows", fmt.Sprint(v))
  90. return b
  91. }
  92. func (b *VCarouselBuilder) ShowArrowsOnHover(v bool) (r *VCarouselBuilder) {
  93. b.tag.Attr(":show-arrows-on-hover", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VCarouselBuilder) Tag(v string) (r *VCarouselBuilder) {
  97. b.tag.Attr("tag", v)
  98. return b
  99. }
  100. func (b *VCarouselBuilder) Touch(v interface{}) (r *VCarouselBuilder) {
  101. b.tag.Attr(":touch", h.JSONString(v))
  102. return b
  103. }
  104. func (b *VCarouselBuilder) Touchless(v bool) (r *VCarouselBuilder) {
  105. b.tag.Attr(":touchless", fmt.Sprint(v))
  106. return b
  107. }
  108. func (b *VCarouselBuilder) Value(v interface{}) (r *VCarouselBuilder) {
  109. b.tag.Attr(":value", h.JSONString(v))
  110. return b
  111. }
  112. func (b *VCarouselBuilder) Vertical(v bool) (r *VCarouselBuilder) {
  113. b.tag.Attr(":vertical", fmt.Sprint(v))
  114. return b
  115. }
  116. func (b *VCarouselBuilder) VerticalDelimiters(v string) (r *VCarouselBuilder) {
  117. b.tag.Attr("vertical-delimiters", v)
  118. return b
  119. }
  120. func (b *VCarouselBuilder) SetAttr(k string, v interface{}) {
  121. b.tag.SetAttr(k, v)
  122. }
  123. func (b *VCarouselBuilder) Attr(vs ...interface{}) (r *VCarouselBuilder) {
  124. b.tag.Attr(vs...)
  125. return b
  126. }
  127. func (b *VCarouselBuilder) Children(children ...h.HTMLComponent) (r *VCarouselBuilder) {
  128. b.tag.Children(children...)
  129. return b
  130. }
  131. func (b *VCarouselBuilder) AppendChildren(children ...h.HTMLComponent) (r *VCarouselBuilder) {
  132. b.tag.AppendChildren(children...)
  133. return b
  134. }
  135. func (b *VCarouselBuilder) PrependChildren(children ...h.HTMLComponent) (r *VCarouselBuilder) {
  136. b.tag.PrependChildren(children...)
  137. return b
  138. }
  139. func (b *VCarouselBuilder) Class(names ...string) (r *VCarouselBuilder) {
  140. b.tag.Class(names...)
  141. return b
  142. }
  143. func (b *VCarouselBuilder) ClassIf(name string, add bool) (r *VCarouselBuilder) {
  144. b.tag.ClassIf(name, add)
  145. return b
  146. }
  147. func (b *VCarouselBuilder) On(name string, value string) (r *VCarouselBuilder) {
  148. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  149. return b
  150. }
  151. func (b *VCarouselBuilder) Bind(name string, value string) (r *VCarouselBuilder) {
  152. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  153. return b
  154. }
  155. func (b *VCarouselBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  156. return b.tag.MarshalHTML(ctx)
  157. }