textarea.go 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VTextareaBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VTextarea(children ...h.HTMLComponent) (r *VTextareaBuilder) {
  11. r = &VTextareaBuilder{
  12. tag: h.Tag("v-textarea").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VTextareaBuilder) AppendIcon(v string) (r *VTextareaBuilder) {
  17. b.tag.Attr("append-icon", v)
  18. return b
  19. }
  20. func (b *VTextareaBuilder) AppendOuterIcon(v string) (r *VTextareaBuilder) {
  21. b.tag.Attr("append-outer-icon", v)
  22. return b
  23. }
  24. func (b *VTextareaBuilder) AutoGrow(v bool) (r *VTextareaBuilder) {
  25. b.tag.Attr(":auto-grow", fmt.Sprint(v))
  26. return b
  27. }
  28. func (b *VTextareaBuilder) Autofocus(v bool) (r *VTextareaBuilder) {
  29. b.tag.Attr(":autofocus", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VTextareaBuilder) BackgroundColor(v string) (r *VTextareaBuilder) {
  33. b.tag.Attr("background-color", v)
  34. return b
  35. }
  36. func (b *VTextareaBuilder) ClearIcon(v string) (r *VTextareaBuilder) {
  37. b.tag.Attr("clear-icon", v)
  38. return b
  39. }
  40. func (b *VTextareaBuilder) Clearable(v bool) (r *VTextareaBuilder) {
  41. b.tag.Attr(":clearable", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VTextareaBuilder) Color(v string) (r *VTextareaBuilder) {
  45. b.tag.Attr("color", v)
  46. return b
  47. }
  48. func (b *VTextareaBuilder) Counter(v int) (r *VTextareaBuilder) {
  49. b.tag.Attr(":counter", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VTextareaBuilder) CounterValue(v interface{}) (r *VTextareaBuilder) {
  53. b.tag.Attr(":counter-value", h.JSONString(v))
  54. return b
  55. }
  56. func (b *VTextareaBuilder) Dark(v bool) (r *VTextareaBuilder) {
  57. b.tag.Attr(":dark", fmt.Sprint(v))
  58. return b
  59. }
  60. func (b *VTextareaBuilder) Dense(v bool) (r *VTextareaBuilder) {
  61. b.tag.Attr(":dense", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VTextareaBuilder) Disabled(v bool) (r *VTextareaBuilder) {
  65. b.tag.Attr(":disabled", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VTextareaBuilder) Error(v bool) (r *VTextareaBuilder) {
  69. b.tag.Attr(":error", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VTextareaBuilder) ErrorCount(v int) (r *VTextareaBuilder) {
  73. b.tag.Attr(":error-count", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VTextareaBuilder) Filled(v bool) (r *VTextareaBuilder) {
  77. b.tag.Attr(":filled", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VTextareaBuilder) Flat(v bool) (r *VTextareaBuilder) {
  81. b.tag.Attr(":flat", fmt.Sprint(v))
  82. return b
  83. }
  84. func (b *VTextareaBuilder) FullWidth(v bool) (r *VTextareaBuilder) {
  85. b.tag.Attr(":full-width", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VTextareaBuilder) Height(v int) (r *VTextareaBuilder) {
  89. b.tag.Attr(":height", fmt.Sprint(v))
  90. return b
  91. }
  92. func (b *VTextareaBuilder) HideDetails(v bool) (r *VTextareaBuilder) {
  93. b.tag.Attr(":hide-details", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VTextareaBuilder) Hint(v string) (r *VTextareaBuilder) {
  97. b.tag.Attr("hint", v)
  98. return b
  99. }
  100. func (b *VTextareaBuilder) Id(v string) (r *VTextareaBuilder) {
  101. b.tag.Attr("id", v)
  102. return b
  103. }
  104. func (b *VTextareaBuilder) Label(v string) (r *VTextareaBuilder) {
  105. b.tag.Attr("label", v)
  106. return b
  107. }
  108. func (b *VTextareaBuilder) Light(v bool) (r *VTextareaBuilder) {
  109. b.tag.Attr(":light", fmt.Sprint(v))
  110. return b
  111. }
  112. func (b *VTextareaBuilder) LoaderHeight(v int) (r *VTextareaBuilder) {
  113. b.tag.Attr(":loader-height", fmt.Sprint(v))
  114. return b
  115. }
  116. func (b *VTextareaBuilder) Loading(v bool) (r *VTextareaBuilder) {
  117. b.tag.Attr(":loading", fmt.Sprint(v))
  118. return b
  119. }
  120. func (b *VTextareaBuilder) Messages(v string) (r *VTextareaBuilder) {
  121. b.tag.Attr("messages", v)
  122. return b
  123. }
  124. func (b *VTextareaBuilder) NoResize(v bool) (r *VTextareaBuilder) {
  125. b.tag.Attr(":no-resize", fmt.Sprint(v))
  126. return b
  127. }
  128. func (b *VTextareaBuilder) Outlined(v bool) (r *VTextareaBuilder) {
  129. b.tag.Attr(":outlined", fmt.Sprint(v))
  130. return b
  131. }
  132. func (b *VTextareaBuilder) PersistentHint(v bool) (r *VTextareaBuilder) {
  133. b.tag.Attr(":persistent-hint", fmt.Sprint(v))
  134. return b
  135. }
  136. func (b *VTextareaBuilder) PersistentPlaceholder(v bool) (r *VTextareaBuilder) {
  137. b.tag.Attr(":persistent-placeholder", fmt.Sprint(v))
  138. return b
  139. }
  140. func (b *VTextareaBuilder) Placeholder(v string) (r *VTextareaBuilder) {
  141. b.tag.Attr("placeholder", v)
  142. return b
  143. }
  144. func (b *VTextareaBuilder) Prefix(v string) (r *VTextareaBuilder) {
  145. b.tag.Attr("prefix", v)
  146. return b
  147. }
  148. func (b *VTextareaBuilder) PrependIcon(v string) (r *VTextareaBuilder) {
  149. b.tag.Attr("prepend-icon", v)
  150. return b
  151. }
  152. func (b *VTextareaBuilder) PrependInnerIcon(v string) (r *VTextareaBuilder) {
  153. b.tag.Attr("prepend-inner-icon", v)
  154. return b
  155. }
  156. func (b *VTextareaBuilder) Readonly(v bool) (r *VTextareaBuilder) {
  157. b.tag.Attr(":readonly", fmt.Sprint(v))
  158. return b
  159. }
  160. func (b *VTextareaBuilder) Reverse(v bool) (r *VTextareaBuilder) {
  161. b.tag.Attr(":reverse", fmt.Sprint(v))
  162. return b
  163. }
  164. func (b *VTextareaBuilder) Rounded(v bool) (r *VTextareaBuilder) {
  165. b.tag.Attr(":rounded", fmt.Sprint(v))
  166. return b
  167. }
  168. func (b *VTextareaBuilder) RowHeight(v int) (r *VTextareaBuilder) {
  169. b.tag.Attr(":row-height", fmt.Sprint(v))
  170. return b
  171. }
  172. func (b *VTextareaBuilder) Rows(v int) (r *VTextareaBuilder) {
  173. b.tag.Attr(":rows", fmt.Sprint(v))
  174. return b
  175. }
  176. func (b *VTextareaBuilder) Rules(v interface{}) (r *VTextareaBuilder) {
  177. b.tag.Attr(":rules", h.JSONString(v))
  178. return b
  179. }
  180. func (b *VTextareaBuilder) Shaped(v bool) (r *VTextareaBuilder) {
  181. b.tag.Attr(":shaped", fmt.Sprint(v))
  182. return b
  183. }
  184. func (b *VTextareaBuilder) SingleLine(v bool) (r *VTextareaBuilder) {
  185. b.tag.Attr(":single-line", fmt.Sprint(v))
  186. return b
  187. }
  188. func (b *VTextareaBuilder) Solo(v bool) (r *VTextareaBuilder) {
  189. b.tag.Attr(":solo", fmt.Sprint(v))
  190. return b
  191. }
  192. func (b *VTextareaBuilder) SoloInverted(v bool) (r *VTextareaBuilder) {
  193. b.tag.Attr(":solo-inverted", fmt.Sprint(v))
  194. return b
  195. }
  196. func (b *VTextareaBuilder) Success(v bool) (r *VTextareaBuilder) {
  197. b.tag.Attr(":success", fmt.Sprint(v))
  198. return b
  199. }
  200. func (b *VTextareaBuilder) SuccessMessages(v string) (r *VTextareaBuilder) {
  201. b.tag.Attr("success-messages", v)
  202. return b
  203. }
  204. func (b *VTextareaBuilder) Suffix(v string) (r *VTextareaBuilder) {
  205. b.tag.Attr("suffix", v)
  206. return b
  207. }
  208. func (b *VTextareaBuilder) Type(v string) (r *VTextareaBuilder) {
  209. b.tag.Attr("type", v)
  210. return b
  211. }
  212. func (b *VTextareaBuilder) ValidateOnBlur(v bool) (r *VTextareaBuilder) {
  213. b.tag.Attr(":validate-on-blur", fmt.Sprint(v))
  214. return b
  215. }
  216. func (b *VTextareaBuilder) Value(v interface{}) (r *VTextareaBuilder) {
  217. b.tag.Attr(":value", h.JSONString(v))
  218. return b
  219. }
  220. func (b *VTextareaBuilder) SetAttr(k string, v interface{}) {
  221. b.tag.SetAttr(k, v)
  222. }
  223. func (b *VTextareaBuilder) Attr(vs ...interface{}) (r *VTextareaBuilder) {
  224. b.tag.Attr(vs...)
  225. return b
  226. }
  227. func (b *VTextareaBuilder) Children(children ...h.HTMLComponent) (r *VTextareaBuilder) {
  228. b.tag.Children(children...)
  229. return b
  230. }
  231. func (b *VTextareaBuilder) AppendChildren(children ...h.HTMLComponent) (r *VTextareaBuilder) {
  232. b.tag.AppendChildren(children...)
  233. return b
  234. }
  235. func (b *VTextareaBuilder) PrependChildren(children ...h.HTMLComponent) (r *VTextareaBuilder) {
  236. b.tag.PrependChildren(children...)
  237. return b
  238. }
  239. func (b *VTextareaBuilder) Class(names ...string) (r *VTextareaBuilder) {
  240. b.tag.Class(names...)
  241. return b
  242. }
  243. func (b *VTextareaBuilder) ClassIf(name string, add bool) (r *VTextareaBuilder) {
  244. b.tag.ClassIf(name, add)
  245. return b
  246. }
  247. func (b *VTextareaBuilder) On(name string, value string) (r *VTextareaBuilder) {
  248. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  249. return b
  250. }
  251. func (b *VTextareaBuilder) Bind(name string, value string) (r *VTextareaBuilder) {
  252. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  253. return b
  254. }
  255. func (b *VTextareaBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  256. return b.tag.MarshalHTML(ctx)
  257. }