app-bar.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VAppBarBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VAppBar(children ...h.HTMLComponent) (r *VAppBarBuilder) {
  11. r = &VAppBarBuilder{
  12. tag: h.Tag("v-app-bar").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VAppBarBuilder) Absolute(v bool) (r *VAppBarBuilder) {
  17. b.tag.Attr(":absolute", fmt.Sprint(v))
  18. return b
  19. }
  20. func (b *VAppBarBuilder) App(v bool) (r *VAppBarBuilder) {
  21. b.tag.Attr(":app", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VAppBarBuilder) Bottom(v bool) (r *VAppBarBuilder) {
  25. b.tag.Attr(":bottom", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VAppBarBuilder) ClippedLeft(v bool) (r *VAppBarBuilder) {
  29. b.tag.Attr(":clipped-left", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VAppBarBuilder) ClippedRight(v bool) (r *VAppBarBuilder) {
  33. b.tag.Attr(":clipped-right", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VAppBarBuilder) Collapse(v bool) (r *VAppBarBuilder) {
  37. b.tag.Attr(":collapse", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VAppBarBuilder) CollapseOnScroll(v bool) (r *VAppBarBuilder) {
  41. b.tag.Attr(":collapse-on-scroll", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VAppBarBuilder) Color(v string) (r *VAppBarBuilder) {
  45. b.tag.Attr("color", v)
  46. return b
  47. }
  48. func (b *VAppBarBuilder) Dark(v bool) (r *VAppBarBuilder) {
  49. b.tag.Attr(":dark", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VAppBarBuilder) Dense(v bool) (r *VAppBarBuilder) {
  53. b.tag.Attr(":dense", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VAppBarBuilder) ElevateOnScroll(v bool) (r *VAppBarBuilder) {
  57. b.tag.Attr(":elevate-on-scroll", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VAppBarBuilder) Elevation(v int) (r *VAppBarBuilder) {
  61. b.tag.Attr(":elevation", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VAppBarBuilder) Extended(v bool) (r *VAppBarBuilder) {
  65. b.tag.Attr(":extended", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VAppBarBuilder) ExtensionHeight(v int) (r *VAppBarBuilder) {
  69. b.tag.Attr(":extension-height", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VAppBarBuilder) FadeImgOnScroll(v bool) (r *VAppBarBuilder) {
  73. b.tag.Attr(":fade-img-on-scroll", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VAppBarBuilder) Fixed(v bool) (r *VAppBarBuilder) {
  77. b.tag.Attr(":fixed", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VAppBarBuilder) Flat(v bool) (r *VAppBarBuilder) {
  81. b.tag.Attr(":flat", fmt.Sprint(v))
  82. return b
  83. }
  84. func (b *VAppBarBuilder) Floating(v bool) (r *VAppBarBuilder) {
  85. b.tag.Attr(":floating", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VAppBarBuilder) Height(v int) (r *VAppBarBuilder) {
  89. b.tag.Attr(":height", fmt.Sprint(v))
  90. return b
  91. }
  92. func (b *VAppBarBuilder) HideOnScroll(v bool) (r *VAppBarBuilder) {
  93. b.tag.Attr(":hide-on-scroll", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VAppBarBuilder) InvertedScroll(v bool) (r *VAppBarBuilder) {
  97. b.tag.Attr(":inverted-scroll", fmt.Sprint(v))
  98. return b
  99. }
  100. func (b *VAppBarBuilder) Light(v bool) (r *VAppBarBuilder) {
  101. b.tag.Attr(":light", fmt.Sprint(v))
  102. return b
  103. }
  104. func (b *VAppBarBuilder) MaxHeight(v int) (r *VAppBarBuilder) {
  105. b.tag.Attr(":max-height", fmt.Sprint(v))
  106. return b
  107. }
  108. func (b *VAppBarBuilder) MaxWidth(v int) (r *VAppBarBuilder) {
  109. b.tag.Attr(":max-width", fmt.Sprint(v))
  110. return b
  111. }
  112. func (b *VAppBarBuilder) MinHeight(v int) (r *VAppBarBuilder) {
  113. b.tag.Attr(":min-height", fmt.Sprint(v))
  114. return b
  115. }
  116. func (b *VAppBarBuilder) MinWidth(v int) (r *VAppBarBuilder) {
  117. b.tag.Attr(":min-width", fmt.Sprint(v))
  118. return b
  119. }
  120. func (b *VAppBarBuilder) Outlined(v bool) (r *VAppBarBuilder) {
  121. b.tag.Attr(":outlined", fmt.Sprint(v))
  122. return b
  123. }
  124. func (b *VAppBarBuilder) Prominent(v bool) (r *VAppBarBuilder) {
  125. b.tag.Attr(":prominent", fmt.Sprint(v))
  126. return b
  127. }
  128. func (b *VAppBarBuilder) Rounded(v bool) (r *VAppBarBuilder) {
  129. b.tag.Attr(":rounded", fmt.Sprint(v))
  130. return b
  131. }
  132. func (b *VAppBarBuilder) ScrollOffScreen(v bool) (r *VAppBarBuilder) {
  133. b.tag.Attr(":scroll-off-screen", fmt.Sprint(v))
  134. return b
  135. }
  136. func (b *VAppBarBuilder) ScrollTarget(v string) (r *VAppBarBuilder) {
  137. b.tag.Attr("scroll-target", v)
  138. return b
  139. }
  140. func (b *VAppBarBuilder) ScrollThreshold(v string) (r *VAppBarBuilder) {
  141. b.tag.Attr("scroll-threshold", v)
  142. return b
  143. }
  144. func (b *VAppBarBuilder) Shaped(v bool) (r *VAppBarBuilder) {
  145. b.tag.Attr(":shaped", fmt.Sprint(v))
  146. return b
  147. }
  148. func (b *VAppBarBuilder) Short(v bool) (r *VAppBarBuilder) {
  149. b.tag.Attr(":short", fmt.Sprint(v))
  150. return b
  151. }
  152. func (b *VAppBarBuilder) ShrinkOnScroll(v bool) (r *VAppBarBuilder) {
  153. b.tag.Attr(":shrink-on-scroll", fmt.Sprint(v))
  154. return b
  155. }
  156. func (b *VAppBarBuilder) Src(v interface{}) (r *VAppBarBuilder) {
  157. b.tag.Attr(":src", h.JSONString(v))
  158. return b
  159. }
  160. func (b *VAppBarBuilder) Tag(v string) (r *VAppBarBuilder) {
  161. b.tag.Attr("tag", v)
  162. return b
  163. }
  164. func (b *VAppBarBuilder) Tile(v bool) (r *VAppBarBuilder) {
  165. b.tag.Attr(":tile", fmt.Sprint(v))
  166. return b
  167. }
  168. func (b *VAppBarBuilder) Value(v bool) (r *VAppBarBuilder) {
  169. b.tag.Attr(":value", fmt.Sprint(v))
  170. return b
  171. }
  172. func (b *VAppBarBuilder) Width(v int) (r *VAppBarBuilder) {
  173. b.tag.Attr(":width", fmt.Sprint(v))
  174. return b
  175. }
  176. func (b *VAppBarBuilder) SetAttr(k string, v interface{}) {
  177. b.tag.SetAttr(k, v)
  178. }
  179. func (b *VAppBarBuilder) Attr(vs ...interface{}) (r *VAppBarBuilder) {
  180. b.tag.Attr(vs...)
  181. return b
  182. }
  183. func (b *VAppBarBuilder) Children(children ...h.HTMLComponent) (r *VAppBarBuilder) {
  184. b.tag.Children(children...)
  185. return b
  186. }
  187. func (b *VAppBarBuilder) AppendChildren(children ...h.HTMLComponent) (r *VAppBarBuilder) {
  188. b.tag.AppendChildren(children...)
  189. return b
  190. }
  191. func (b *VAppBarBuilder) PrependChildren(children ...h.HTMLComponent) (r *VAppBarBuilder) {
  192. b.tag.PrependChildren(children...)
  193. return b
  194. }
  195. func (b *VAppBarBuilder) Class(names ...string) (r *VAppBarBuilder) {
  196. b.tag.Class(names...)
  197. return b
  198. }
  199. func (b *VAppBarBuilder) ClassIf(name string, add bool) (r *VAppBarBuilder) {
  200. b.tag.ClassIf(name, add)
  201. return b
  202. }
  203. func (b *VAppBarBuilder) On(name string, value string) (r *VAppBarBuilder) {
  204. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  205. return b
  206. }
  207. func (b *VAppBarBuilder) Bind(name string, value string) (r *VAppBarBuilder) {
  208. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  209. return b
  210. }
  211. func (b *VAppBarBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  212. return b.tag.MarshalHTML(ctx)
  213. }