radio-group.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VRadioGroupBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VRadioGroup(children ...h.HTMLComponent) (r *VRadioGroupBuilder) {
  11. r = &VRadioGroupBuilder{
  12. tag: h.Tag("v-radio-group").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VRadioGroupBuilder) ActiveClass(v string) (r *VRadioGroupBuilder) {
  17. b.tag.Attr("active-class", v)
  18. return b
  19. }
  20. func (b *VRadioGroupBuilder) AppendIcon(v string) (r *VRadioGroupBuilder) {
  21. b.tag.Attr("append-icon", v)
  22. return b
  23. }
  24. func (b *VRadioGroupBuilder) BackgroundColor(v string) (r *VRadioGroupBuilder) {
  25. b.tag.Attr("background-color", v)
  26. return b
  27. }
  28. func (b *VRadioGroupBuilder) Column(v bool) (r *VRadioGroupBuilder) {
  29. b.tag.Attr(":column", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VRadioGroupBuilder) Dark(v bool) (r *VRadioGroupBuilder) {
  33. b.tag.Attr(":dark", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VRadioGroupBuilder) Dense(v bool) (r *VRadioGroupBuilder) {
  37. b.tag.Attr(":dense", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VRadioGroupBuilder) Disabled(v bool) (r *VRadioGroupBuilder) {
  41. b.tag.Attr(":disabled", fmt.Sprint(v))
  42. return b
  43. }
  44. func (b *VRadioGroupBuilder) Error(v bool) (r *VRadioGroupBuilder) {
  45. b.tag.Attr(":error", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VRadioGroupBuilder) ErrorCount(v int) (r *VRadioGroupBuilder) {
  49. b.tag.Attr(":error-count", fmt.Sprint(v))
  50. return b
  51. }
  52. func (b *VRadioGroupBuilder) HideDetails(v bool) (r *VRadioGroupBuilder) {
  53. b.tag.Attr(":hide-details", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VRadioGroupBuilder) Hint(v string) (r *VRadioGroupBuilder) {
  57. b.tag.Attr("hint", v)
  58. return b
  59. }
  60. func (b *VRadioGroupBuilder) Id(v string) (r *VRadioGroupBuilder) {
  61. b.tag.Attr("id", v)
  62. return b
  63. }
  64. func (b *VRadioGroupBuilder) Label(v string) (r *VRadioGroupBuilder) {
  65. b.tag.Attr("label", v)
  66. return b
  67. }
  68. func (b *VRadioGroupBuilder) Light(v bool) (r *VRadioGroupBuilder) {
  69. b.tag.Attr(":light", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VRadioGroupBuilder) Mandatory(v bool) (r *VRadioGroupBuilder) {
  73. b.tag.Attr(":mandatory", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VRadioGroupBuilder) Max(v int) (r *VRadioGroupBuilder) {
  77. b.tag.Attr(":max", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VRadioGroupBuilder) Messages(v string) (r *VRadioGroupBuilder) {
  81. b.tag.Attr("messages", v)
  82. return b
  83. }
  84. func (b *VRadioGroupBuilder) Multiple(v bool) (r *VRadioGroupBuilder) {
  85. b.tag.Attr(":multiple", fmt.Sprint(v))
  86. return b
  87. }
  88. func (b *VRadioGroupBuilder) Name(v string) (r *VRadioGroupBuilder) {
  89. b.tag.Attr("name", v)
  90. return b
  91. }
  92. func (b *VRadioGroupBuilder) PersistentHint(v bool) (r *VRadioGroupBuilder) {
  93. b.tag.Attr(":persistent-hint", fmt.Sprint(v))
  94. return b
  95. }
  96. func (b *VRadioGroupBuilder) PrependIcon(v string) (r *VRadioGroupBuilder) {
  97. b.tag.Attr("prepend-icon", v)
  98. return b
  99. }
  100. func (b *VRadioGroupBuilder) Readonly(v bool) (r *VRadioGroupBuilder) {
  101. b.tag.Attr(":readonly", fmt.Sprint(v))
  102. return b
  103. }
  104. func (b *VRadioGroupBuilder) Row(v bool) (r *VRadioGroupBuilder) {
  105. b.tag.Attr(":row", fmt.Sprint(v))
  106. return b
  107. }
  108. func (b *VRadioGroupBuilder) Rules(v interface{}) (r *VRadioGroupBuilder) {
  109. b.tag.Attr(":rules", h.JSONString(v))
  110. return b
  111. }
  112. func (b *VRadioGroupBuilder) Success(v bool) (r *VRadioGroupBuilder) {
  113. b.tag.Attr(":success", fmt.Sprint(v))
  114. return b
  115. }
  116. func (b *VRadioGroupBuilder) SuccessMessages(v string) (r *VRadioGroupBuilder) {
  117. b.tag.Attr("success-messages", v)
  118. return b
  119. }
  120. func (b *VRadioGroupBuilder) Tag(v string) (r *VRadioGroupBuilder) {
  121. b.tag.Attr("tag", v)
  122. return b
  123. }
  124. func (b *VRadioGroupBuilder) ValidateOnBlur(v bool) (r *VRadioGroupBuilder) {
  125. b.tag.Attr(":validate-on-blur", fmt.Sprint(v))
  126. return b
  127. }
  128. func (b *VRadioGroupBuilder) Value(v interface{}) (r *VRadioGroupBuilder) {
  129. b.tag.Attr(":value", h.JSONString(v))
  130. return b
  131. }
  132. func (b *VRadioGroupBuilder) ValueComparator(v interface{}) (r *VRadioGroupBuilder) {
  133. b.tag.Attr(":value-comparator", h.JSONString(v))
  134. return b
  135. }
  136. func (b *VRadioGroupBuilder) SetAttr(k string, v interface{}) {
  137. b.tag.SetAttr(k, v)
  138. }
  139. func (b *VRadioGroupBuilder) Attr(vs ...interface{}) (r *VRadioGroupBuilder) {
  140. b.tag.Attr(vs...)
  141. return b
  142. }
  143. func (b *VRadioGroupBuilder) Children(children ...h.HTMLComponent) (r *VRadioGroupBuilder) {
  144. b.tag.Children(children...)
  145. return b
  146. }
  147. func (b *VRadioGroupBuilder) AppendChildren(children ...h.HTMLComponent) (r *VRadioGroupBuilder) {
  148. b.tag.AppendChildren(children...)
  149. return b
  150. }
  151. func (b *VRadioGroupBuilder) PrependChildren(children ...h.HTMLComponent) (r *VRadioGroupBuilder) {
  152. b.tag.PrependChildren(children...)
  153. return b
  154. }
  155. func (b *VRadioGroupBuilder) Class(names ...string) (r *VRadioGroupBuilder) {
  156. b.tag.Class(names...)
  157. return b
  158. }
  159. func (b *VRadioGroupBuilder) ClassIf(name string, add bool) (r *VRadioGroupBuilder) {
  160. b.tag.ClassIf(name, add)
  161. return b
  162. }
  163. func (b *VRadioGroupBuilder) On(name string, value string) (r *VRadioGroupBuilder) {
  164. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  165. return b
  166. }
  167. func (b *VRadioGroupBuilder) Bind(name string, value string) (r *VRadioGroupBuilder) {
  168. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  169. return b
  170. }
  171. func (b *VRadioGroupBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  172. return b.tag.MarshalHTML(ctx)
  173. }