bottom-navigation.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VBottomNavigationBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VBottomNavigation(children ...h.HTMLComponent) (r *VBottomNavigationBuilder) {
  11. r = &VBottomNavigationBuilder{
  12. tag: h.Tag("v-bottom-navigation").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VBottomNavigationBuilder) Absolute(v bool) (r *VBottomNavigationBuilder) {
  17. b.tag.Attr(":absolute", fmt.Sprint(v))
  18. return b
  19. }
  20. func (b *VBottomNavigationBuilder) ActiveClass(v string) (r *VBottomNavigationBuilder) {
  21. b.tag.Attr("active-class", v)
  22. return b
  23. }
  24. func (b *VBottomNavigationBuilder) App(v bool) (r *VBottomNavigationBuilder) {
  25. b.tag.Attr(":app", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VBottomNavigationBuilder) BackgroundColor(v string) (r *VBottomNavigationBuilder) {
  29. b.tag.Attr("background-color", v)
  30. return b
  31. }
  32. func (b *VBottomNavigationBuilder) Color(v string) (r *VBottomNavigationBuilder) {
  33. b.tag.Attr("color", v)
  34. return b
  35. }
  36. func (b *VBottomNavigationBuilder) Dark(v bool) (r *VBottomNavigationBuilder) {
  37. b.tag.Attr(":dark", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VBottomNavigationBuilder) Fixed(v bool) (r *VBottomNavigationBuilder) {
  41. b.tag.Attr(":fixed", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VBottomNavigationBuilder) Grow(v bool) (r *VBottomNavigationBuilder) {
  45. b.tag.Attr(":grow", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VBottomNavigationBuilder) Height(v int) (r *VBottomNavigationBuilder) {
  49. b.tag.Attr(":height", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VBottomNavigationBuilder) HideOnScroll(v bool) (r *VBottomNavigationBuilder) {
  53. b.tag.Attr(":hide-on-scroll", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VBottomNavigationBuilder) Horizontal(v bool) (r *VBottomNavigationBuilder) {
  57. b.tag.Attr(":horizontal", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VBottomNavigationBuilder) InputValue(v bool) (r *VBottomNavigationBuilder) {
  61. b.tag.Attr(":input-value", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VBottomNavigationBuilder) Light(v bool) (r *VBottomNavigationBuilder) {
  65. b.tag.Attr(":light", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VBottomNavigationBuilder) Mandatory(v bool) (r *VBottomNavigationBuilder) {
  69. b.tag.Attr(":mandatory", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VBottomNavigationBuilder) MaxHeight(v int) (r *VBottomNavigationBuilder) {
  73. b.tag.Attr(":max-height", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VBottomNavigationBuilder) MaxWidth(v int) (r *VBottomNavigationBuilder) {
  77. b.tag.Attr(":max-width", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VBottomNavigationBuilder) MinHeight(v int) (r *VBottomNavigationBuilder) {
  81. b.tag.Attr(":min-height", fmt.Sprint(v))
  82. return b
  83. }
  84. func (b *VBottomNavigationBuilder) MinWidth(v int) (r *VBottomNavigationBuilder) {
  85. b.tag.Attr(":min-width", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VBottomNavigationBuilder) ScrollTarget(v string) (r *VBottomNavigationBuilder) {
  89. b.tag.Attr("scroll-target", v)
  90. return b
  91. }
  92. func (b *VBottomNavigationBuilder) ScrollThreshold(v string) (r *VBottomNavigationBuilder) {
  93. b.tag.Attr("scroll-threshold", v)
  94. return b
  95. }
  96. func (b *VBottomNavigationBuilder) Shift(v bool) (r *VBottomNavigationBuilder) {
  97. b.tag.Attr(":shift", fmt.Sprint(v))
  98. return b
  99. }
  100. func (b *VBottomNavigationBuilder) Tag(v string) (r *VBottomNavigationBuilder) {
  101. b.tag.Attr("tag", v)
  102. return b
  103. }
  104. func (b *VBottomNavigationBuilder) Value(v interface{}) (r *VBottomNavigationBuilder) {
  105. b.tag.Attr(":value", h.JSONString(v))
  106. return b
  107. }
  108. func (b *VBottomNavigationBuilder) Width(v int) (r *VBottomNavigationBuilder) {
  109. b.tag.Attr(":width", fmt.Sprint(v))
  110. return b
  111. }
  112. func (b *VBottomNavigationBuilder) SetAttr(k string, v interface{}) {
  113. b.tag.SetAttr(k, v)
  114. }
  115. func (b *VBottomNavigationBuilder) Attr(vs ...interface{}) (r *VBottomNavigationBuilder) {
  116. b.tag.Attr(vs...)
  117. return b
  118. }
  119. func (b *VBottomNavigationBuilder) Children(children ...h.HTMLComponent) (r *VBottomNavigationBuilder) {
  120. b.tag.Children(children...)
  121. return b
  122. }
  123. func (b *VBottomNavigationBuilder) AppendChildren(children ...h.HTMLComponent) (r *VBottomNavigationBuilder) {
  124. b.tag.AppendChildren(children...)
  125. return b
  126. }
  127. func (b *VBottomNavigationBuilder) PrependChildren(children ...h.HTMLComponent) (r *VBottomNavigationBuilder) {
  128. b.tag.PrependChildren(children...)
  129. return b
  130. }
  131. func (b *VBottomNavigationBuilder) Class(names ...string) (r *VBottomNavigationBuilder) {
  132. b.tag.Class(names...)
  133. return b
  134. }
  135. func (b *VBottomNavigationBuilder) ClassIf(name string, add bool) (r *VBottomNavigationBuilder) {
  136. b.tag.ClassIf(name, add)
  137. return b
  138. }
  139. func (b *VBottomNavigationBuilder) On(name string, value string) (r *VBottomNavigationBuilder) {
  140. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  141. return b
  142. }
  143. func (b *VBottomNavigationBuilder) Bind(name string, value string) (r *VBottomNavigationBuilder) {
  144. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  145. return b
  146. }
  147. func (b *VBottomNavigationBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  148. return b.tag.MarshalHTML(ctx)
  149. }