card.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VCardBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VCard(children ...h.HTMLComponent) (r *VCardBuilder) {
  11. r = &VCardBuilder{
  12. tag: h.Tag("v-card").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VCardBuilder) ActiveClass(v string) (r *VCardBuilder) {
  17. b.tag.Attr("active-class", v)
  18. return b
  19. }
  20. func (b *VCardBuilder) Append(v bool) (r *VCardBuilder) {
  21. b.tag.Attr(":append", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VCardBuilder) Color(v string) (r *VCardBuilder) {
  25. b.tag.Attr("color", v)
  26. return b
  27. }
  28. func (b *VCardBuilder) Dark(v bool) (r *VCardBuilder) {
  29. b.tag.Attr(":dark", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VCardBuilder) Disabled(v bool) (r *VCardBuilder) {
  33. b.tag.Attr(":disabled", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VCardBuilder) Elevation(v int) (r *VCardBuilder) {
  37. b.tag.Attr(":elevation", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VCardBuilder) Exact(v bool) (r *VCardBuilder) {
  41. b.tag.Attr(":exact", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VCardBuilder) ExactActiveClass(v string) (r *VCardBuilder) {
  45. b.tag.Attr("exact-active-class", v)
  46. return b
  47. }
  48. func (b *VCardBuilder) ExactPath(v bool) (r *VCardBuilder) {
  49. b.tag.Attr(":exact-path", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VCardBuilder) Flat(v bool) (r *VCardBuilder) {
  53. b.tag.Attr(":flat", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VCardBuilder) Height(v int) (r *VCardBuilder) {
  57. b.tag.Attr(":height", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VCardBuilder) Hover(v bool) (r *VCardBuilder) {
  61. b.tag.Attr(":hover", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VCardBuilder) Href(v interface{}) (r *VCardBuilder) {
  65. b.tag.Attr(":href", h.JSONString(v))
  66. return b
  67. }
  68. func (b *VCardBuilder) Img(v string) (r *VCardBuilder) {
  69. b.tag.Attr("img", v)
  70. return b
  71. }
  72. func (b *VCardBuilder) Light(v bool) (r *VCardBuilder) {
  73. b.tag.Attr(":light", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VCardBuilder) Link(v bool) (r *VCardBuilder) {
  77. b.tag.Attr(":link", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VCardBuilder) LoaderHeight(v int) (r *VCardBuilder) {
  81. b.tag.Attr(":loader-height", fmt.Sprint(v))
  82. return b
  83. }
  84. func (b *VCardBuilder) Loading(v bool) (r *VCardBuilder) {
  85. b.tag.Attr(":loading", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VCardBuilder) MaxHeight(v int) (r *VCardBuilder) {
  89. b.tag.Attr(":max-height", fmt.Sprint(v))
  90. return b
  91. }
  92. func (b *VCardBuilder) MaxWidth(v int) (r *VCardBuilder) {
  93. b.tag.Attr(":max-width", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VCardBuilder) MinHeight(v int) (r *VCardBuilder) {
  97. b.tag.Attr(":min-height", fmt.Sprint(v))
  98. return b
  99. }
  100. func (b *VCardBuilder) MinWidth(v int) (r *VCardBuilder) {
  101. b.tag.Attr(":min-width", fmt.Sprint(v))
  102. return b
  103. }
  104. func (b *VCardBuilder) Nuxt(v bool) (r *VCardBuilder) {
  105. b.tag.Attr(":nuxt", fmt.Sprint(v))
  106. return b
  107. }
  108. func (b *VCardBuilder) Outlined(v bool) (r *VCardBuilder) {
  109. b.tag.Attr(":outlined", fmt.Sprint(v))
  110. return b
  111. }
  112. func (b *VCardBuilder) Raised(v bool) (r *VCardBuilder) {
  113. b.tag.Attr(":raised", fmt.Sprint(v))
  114. return b
  115. }
  116. func (b *VCardBuilder) Replace(v bool) (r *VCardBuilder) {
  117. b.tag.Attr(":replace", fmt.Sprint(v))
  118. return b
  119. }
  120. func (b *VCardBuilder) Ripple(v interface{}) (r *VCardBuilder) {
  121. b.tag.Attr(":ripple", h.JSONString(v))
  122. return b
  123. }
  124. func (b *VCardBuilder) Rounded(v bool) (r *VCardBuilder) {
  125. b.tag.Attr(":rounded", fmt.Sprint(v))
  126. return b
  127. }
  128. func (b *VCardBuilder) Shaped(v bool) (r *VCardBuilder) {
  129. b.tag.Attr(":shaped", fmt.Sprint(v))
  130. return b
  131. }
  132. func (b *VCardBuilder) Tag(v string) (r *VCardBuilder) {
  133. b.tag.Attr("tag", v)
  134. return b
  135. }
  136. func (b *VCardBuilder) Target(v string) (r *VCardBuilder) {
  137. b.tag.Attr("target", v)
  138. return b
  139. }
  140. func (b *VCardBuilder) Tile(v bool) (r *VCardBuilder) {
  141. b.tag.Attr(":tile", fmt.Sprint(v))
  142. return b
  143. }
  144. func (b *VCardBuilder) To(v interface{}) (r *VCardBuilder) {
  145. b.tag.Attr(":to", h.JSONString(v))
  146. return b
  147. }
  148. func (b *VCardBuilder) Width(v int) (r *VCardBuilder) {
  149. b.tag.Attr(":width", fmt.Sprint(v))
  150. return b
  151. }
  152. func (b *VCardBuilder) SetAttr(k string, v interface{}) {
  153. b.tag.SetAttr(k, v)
  154. }
  155. func (b *VCardBuilder) Attr(vs ...interface{}) (r *VCardBuilder) {
  156. b.tag.Attr(vs...)
  157. return b
  158. }
  159. func (b *VCardBuilder) Children(children ...h.HTMLComponent) (r *VCardBuilder) {
  160. b.tag.Children(children...)
  161. return b
  162. }
  163. func (b *VCardBuilder) AppendChildren(children ...h.HTMLComponent) (r *VCardBuilder) {
  164. b.tag.AppendChildren(children...)
  165. return b
  166. }
  167. func (b *VCardBuilder) PrependChildren(children ...h.HTMLComponent) (r *VCardBuilder) {
  168. b.tag.PrependChildren(children...)
  169. return b
  170. }
  171. func (b *VCardBuilder) Class(names ...string) (r *VCardBuilder) {
  172. b.tag.Class(names...)
  173. return b
  174. }
  175. func (b *VCardBuilder) ClassIf(name string, add bool) (r *VCardBuilder) {
  176. b.tag.ClassIf(name, add)
  177. return b
  178. }
  179. func (b *VCardBuilder) On(name string, value string) (r *VCardBuilder) {
  180. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  181. return b
  182. }
  183. func (b *VCardBuilder) Bind(name string, value string) (r *VCardBuilder) {
  184. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  185. return b
  186. }
  187. func (b *VCardBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  188. return b.tag.MarshalHTML(ctx)
  189. }