bottom-sheet.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VBottomSheetBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VBottomSheet(children ...h.HTMLComponent) (r *VBottomSheetBuilder) {
  11. r = &VBottomSheetBuilder{
  12. tag: h.Tag("v-bottom-sheet").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VBottomSheetBuilder) Activator(v interface{}) (r *VBottomSheetBuilder) {
  17. b.tag.Attr(":activator", h.JSONString(v))
  18. return b
  19. }
  20. func (b *VBottomSheetBuilder) Attach(v interface{}) (r *VBottomSheetBuilder) {
  21. b.tag.Attr(":attach", h.JSONString(v))
  22. return b
  23. }
  24. func (b *VBottomSheetBuilder) CloseDelay(v int) (r *VBottomSheetBuilder) {
  25. b.tag.Attr(":close-delay", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VBottomSheetBuilder) ContentClass(v string) (r *VBottomSheetBuilder) {
  29. b.tag.Attr("content-class", v)
  30. return b
  31. }
  32. func (b *VBottomSheetBuilder) Dark(v bool) (r *VBottomSheetBuilder) {
  33. b.tag.Attr(":dark", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VBottomSheetBuilder) Disabled(v bool) (r *VBottomSheetBuilder) {
  37. b.tag.Attr(":disabled", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VBottomSheetBuilder) Eager(v bool) (r *VBottomSheetBuilder) {
  41. b.tag.Attr(":eager", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VBottomSheetBuilder) Fullscreen(v bool) (r *VBottomSheetBuilder) {
  45. b.tag.Attr(":fullscreen", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VBottomSheetBuilder) HideOverlay(v bool) (r *VBottomSheetBuilder) {
  49. b.tag.Attr(":hide-overlay", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VBottomSheetBuilder) Inset(v bool) (r *VBottomSheetBuilder) {
  53. b.tag.Attr(":inset", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VBottomSheetBuilder) InternalActivator(v bool) (r *VBottomSheetBuilder) {
  57. b.tag.Attr(":internal-activator", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VBottomSheetBuilder) Light(v bool) (r *VBottomSheetBuilder) {
  61. b.tag.Attr(":light", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VBottomSheetBuilder) MaxWidth(v string) (r *VBottomSheetBuilder) {
  65. b.tag.Attr("max-width", v)
  66. return b
  67. }
  68. func (b *VBottomSheetBuilder) NoClickAnimation(v bool) (r *VBottomSheetBuilder) {
  69. b.tag.Attr(":no-click-animation", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VBottomSheetBuilder) OpenDelay(v int) (r *VBottomSheetBuilder) {
  73. b.tag.Attr(":open-delay", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VBottomSheetBuilder) OpenOnFocus(v bool) (r *VBottomSheetBuilder) {
  77. b.tag.Attr(":open-on-focus", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VBottomSheetBuilder) OpenOnHover(v bool) (r *VBottomSheetBuilder) {
  81. b.tag.Attr(":open-on-hover", fmt.Sprint(v))
  82. return b
  83. }
  84. func (b *VBottomSheetBuilder) Origin(v string) (r *VBottomSheetBuilder) {
  85. b.tag.Attr("origin", v)
  86. return b
  87. }
  88. func (b *VBottomSheetBuilder) OverlayColor(v string) (r *VBottomSheetBuilder) {
  89. b.tag.Attr("overlay-color", v)
  90. return b
  91. }
  92. func (b *VBottomSheetBuilder) OverlayOpacity(v int) (r *VBottomSheetBuilder) {
  93. b.tag.Attr(":overlay-opacity", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VBottomSheetBuilder) Persistent(v bool) (r *VBottomSheetBuilder) {
  97. b.tag.Attr(":persistent", fmt.Sprint(v))
  98. return b
  99. }
  100. func (b *VBottomSheetBuilder) RetainFocus(v bool) (r *VBottomSheetBuilder) {
  101. b.tag.Attr(":retain-focus", fmt.Sprint(v))
  102. return b
  103. }
  104. func (b *VBottomSheetBuilder) ReturnValue(v interface{}) (r *VBottomSheetBuilder) {
  105. b.tag.Attr(":return-value", h.JSONString(v))
  106. return b
  107. }
  108. func (b *VBottomSheetBuilder) Scrollable(v bool) (r *VBottomSheetBuilder) {
  109. b.tag.Attr(":scrollable", fmt.Sprint(v))
  110. return b
  111. }
  112. func (b *VBottomSheetBuilder) Transition(v string) (r *VBottomSheetBuilder) {
  113. b.tag.Attr("transition", v)
  114. return b
  115. }
  116. func (b *VBottomSheetBuilder) Value(v interface{}) (r *VBottomSheetBuilder) {
  117. b.tag.Attr(":value", h.JSONString(v))
  118. return b
  119. }
  120. func (b *VBottomSheetBuilder) Width(v string) (r *VBottomSheetBuilder) {
  121. b.tag.Attr("width", v)
  122. return b
  123. }
  124. func (b *VBottomSheetBuilder) SetAttr(k string, v interface{}) {
  125. b.tag.SetAttr(k, v)
  126. }
  127. func (b *VBottomSheetBuilder) Attr(vs ...interface{}) (r *VBottomSheetBuilder) {
  128. b.tag.Attr(vs...)
  129. return b
  130. }
  131. func (b *VBottomSheetBuilder) Children(children ...h.HTMLComponent) (r *VBottomSheetBuilder) {
  132. b.tag.Children(children...)
  133. return b
  134. }
  135. func (b *VBottomSheetBuilder) AppendChildren(children ...h.HTMLComponent) (r *VBottomSheetBuilder) {
  136. b.tag.AppendChildren(children...)
  137. return b
  138. }
  139. func (b *VBottomSheetBuilder) PrependChildren(children ...h.HTMLComponent) (r *VBottomSheetBuilder) {
  140. b.tag.PrependChildren(children...)
  141. return b
  142. }
  143. func (b *VBottomSheetBuilder) Class(names ...string) (r *VBottomSheetBuilder) {
  144. b.tag.Class(names...)
  145. return b
  146. }
  147. func (b *VBottomSheetBuilder) ClassIf(name string, add bool) (r *VBottomSheetBuilder) {
  148. b.tag.ClassIf(name, add)
  149. return b
  150. }
  151. func (b *VBottomSheetBuilder) On(name string, value string) (r *VBottomSheetBuilder) {
  152. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  153. return b
  154. }
  155. func (b *VBottomSheetBuilder) Bind(name string, value string) (r *VBottomSheetBuilder) {
  156. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  157. return b
  158. }
  159. func (b *VBottomSheetBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  160. return b.tag.MarshalHTML(ctx)
  161. }