slider.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VSliderBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VSlider(children ...h.HTMLComponent) (r *VSliderBuilder) {
  11. r = &VSliderBuilder{
  12. tag: h.Tag("v-slider").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VSliderBuilder) AppendIcon(v string) (r *VSliderBuilder) {
  17. b.tag.Attr("append-icon", v)
  18. return b
  19. }
  20. func (b *VSliderBuilder) BackgroundColor(v string) (r *VSliderBuilder) {
  21. b.tag.Attr("background-color", v)
  22. return b
  23. }
  24. func (b *VSliderBuilder) Color(v string) (r *VSliderBuilder) {
  25. b.tag.Attr("color", v)
  26. return b
  27. }
  28. func (b *VSliderBuilder) Dark(v bool) (r *VSliderBuilder) {
  29. b.tag.Attr(":dark", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VSliderBuilder) Dense(v bool) (r *VSliderBuilder) {
  33. b.tag.Attr(":dense", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VSliderBuilder) Disabled(v bool) (r *VSliderBuilder) {
  37. b.tag.Attr(":disabled", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VSliderBuilder) Error(v bool) (r *VSliderBuilder) {
  41. b.tag.Attr(":error", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VSliderBuilder) ErrorCount(v int) (r *VSliderBuilder) {
  45. b.tag.Attr(":error-count", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VSliderBuilder) Height(v int) (r *VSliderBuilder) {
  49. b.tag.Attr(":height", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VSliderBuilder) HideDetails(v bool) (r *VSliderBuilder) {
  53. b.tag.Attr(":hide-details", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VSliderBuilder) Hint(v string) (r *VSliderBuilder) {
  57. b.tag.Attr("hint", v)
  58. return b
  59. }
  60. func (b *VSliderBuilder) Id(v string) (r *VSliderBuilder) {
  61. b.tag.Attr("id", v)
  62. return b
  63. }
  64. func (b *VSliderBuilder) InverseLabel(v bool) (r *VSliderBuilder) {
  65. b.tag.Attr(":inverse-label", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VSliderBuilder) Label(v string) (r *VSliderBuilder) {
  69. b.tag.Attr("label", v)
  70. return b
  71. }
  72. func (b *VSliderBuilder) Light(v bool) (r *VSliderBuilder) {
  73. b.tag.Attr(":light", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VSliderBuilder) LoaderHeight(v int) (r *VSliderBuilder) {
  77. b.tag.Attr(":loader-height", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VSliderBuilder) Loading(v bool) (r *VSliderBuilder) {
  81. b.tag.Attr(":loading", fmt.Sprint(v))
  82. return b
  83. }
  84. func (b *VSliderBuilder) Max(v int) (r *VSliderBuilder) {
  85. b.tag.Attr(":max", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VSliderBuilder) Messages(v string) (r *VSliderBuilder) {
  89. b.tag.Attr("messages", v)
  90. return b
  91. }
  92. func (b *VSliderBuilder) Min(v int) (r *VSliderBuilder) {
  93. b.tag.Attr(":min", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VSliderBuilder) PersistentHint(v bool) (r *VSliderBuilder) {
  97. b.tag.Attr(":persistent-hint", fmt.Sprint(v))
  98. return b
  99. }
  100. func (b *VSliderBuilder) PrependIcon(v string) (r *VSliderBuilder) {
  101. b.tag.Attr("prepend-icon", v)
  102. return b
  103. }
  104. func (b *VSliderBuilder) Readonly(v bool) (r *VSliderBuilder) {
  105. b.tag.Attr(":readonly", fmt.Sprint(v))
  106. return b
  107. }
  108. func (b *VSliderBuilder) Rules(v interface{}) (r *VSliderBuilder) {
  109. b.tag.Attr(":rules", h.JSONString(v))
  110. return b
  111. }
  112. func (b *VSliderBuilder) Step(v int) (r *VSliderBuilder) {
  113. b.tag.Attr(":step", fmt.Sprint(v))
  114. return b
  115. }
  116. func (b *VSliderBuilder) Success(v bool) (r *VSliderBuilder) {
  117. b.tag.Attr(":success", fmt.Sprint(v))
  118. return b
  119. }
  120. func (b *VSliderBuilder) SuccessMessages(v string) (r *VSliderBuilder) {
  121. b.tag.Attr("success-messages", v)
  122. return b
  123. }
  124. func (b *VSliderBuilder) ThumbColor(v string) (r *VSliderBuilder) {
  125. b.tag.Attr("thumb-color", v)
  126. return b
  127. }
  128. func (b *VSliderBuilder) ThumbLabel(v bool) (r *VSliderBuilder) {
  129. b.tag.Attr(":thumb-label", fmt.Sprint(v))
  130. return b
  131. }
  132. func (b *VSliderBuilder) ThumbSize(v int) (r *VSliderBuilder) {
  133. b.tag.Attr(":thumb-size", fmt.Sprint(v))
  134. return b
  135. }
  136. func (b *VSliderBuilder) TickLabels(v interface{}) (r *VSliderBuilder) {
  137. b.tag.Attr(":tick-labels", h.JSONString(v))
  138. return b
  139. }
  140. func (b *VSliderBuilder) TickSize(v int) (r *VSliderBuilder) {
  141. b.tag.Attr(":tick-size", fmt.Sprint(v))
  142. return b
  143. }
  144. func (b *VSliderBuilder) Ticks(v bool) (r *VSliderBuilder) {
  145. b.tag.Attr(":ticks", fmt.Sprint(v))
  146. return b
  147. }
  148. func (b *VSliderBuilder) TrackColor(v string) (r *VSliderBuilder) {
  149. b.tag.Attr("track-color", v)
  150. return b
  151. }
  152. func (b *VSliderBuilder) TrackFillColor(v string) (r *VSliderBuilder) {
  153. b.tag.Attr("track-fill-color", v)
  154. return b
  155. }
  156. func (b *VSliderBuilder) ValidateOnBlur(v bool) (r *VSliderBuilder) {
  157. b.tag.Attr(":validate-on-blur", fmt.Sprint(v))
  158. return b
  159. }
  160. func (b *VSliderBuilder) Value(v interface{}) (r *VSliderBuilder) {
  161. b.tag.Attr(":value", h.JSONString(v))
  162. return b
  163. }
  164. func (b *VSliderBuilder) Vertical(v bool) (r *VSliderBuilder) {
  165. b.tag.Attr(":vertical", fmt.Sprint(v))
  166. return b
  167. }
  168. func (b *VSliderBuilder) SetAttr(k string, v interface{}) {
  169. b.tag.SetAttr(k, v)
  170. }
  171. func (b *VSliderBuilder) Attr(vs ...interface{}) (r *VSliderBuilder) {
  172. b.tag.Attr(vs...)
  173. return b
  174. }
  175. func (b *VSliderBuilder) Children(children ...h.HTMLComponent) (r *VSliderBuilder) {
  176. b.tag.Children(children...)
  177. return b
  178. }
  179. func (b *VSliderBuilder) AppendChildren(children ...h.HTMLComponent) (r *VSliderBuilder) {
  180. b.tag.AppendChildren(children...)
  181. return b
  182. }
  183. func (b *VSliderBuilder) PrependChildren(children ...h.HTMLComponent) (r *VSliderBuilder) {
  184. b.tag.PrependChildren(children...)
  185. return b
  186. }
  187. func (b *VSliderBuilder) Class(names ...string) (r *VSliderBuilder) {
  188. b.tag.Class(names...)
  189. return b
  190. }
  191. func (b *VSliderBuilder) ClassIf(name string, add bool) (r *VSliderBuilder) {
  192. b.tag.ClassIf(name, add)
  193. return b
  194. }
  195. func (b *VSliderBuilder) On(name string, value string) (r *VSliderBuilder) {
  196. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  197. return b
  198. }
  199. func (b *VSliderBuilder) Bind(name string, value string) (r *VSliderBuilder) {
  200. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  201. return b
  202. }
  203. func (b *VSliderBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  204. return b.tag.MarshalHTML(ctx)
  205. }