icon.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VIconBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func (b *VIconBuilder) Color(v string) (r *VIconBuilder) {
  11. b.tag.Attr("color", v)
  12. return b
  13. }
  14. func (b *VIconBuilder) Dark(v bool) (r *VIconBuilder) {
  15. b.tag.Attr(":dark", fmt.Sprint(v))
  16. return b
  17. }
  18. func (b *VIconBuilder) Dense(v bool) (r *VIconBuilder) {
  19. b.tag.Attr(":dense", fmt.Sprint(v))
  20. return b
  21. }
  22. func (b *VIconBuilder) Disabled(v bool) (r *VIconBuilder) {
  23. b.tag.Attr(":disabled", fmt.Sprint(v))
  24. return b
  25. }
  26. func (b *VIconBuilder) Large(v bool) (r *VIconBuilder) {
  27. b.tag.Attr(":large", fmt.Sprint(v))
  28. return b
  29. }
  30. func (b *VIconBuilder) Left(v bool) (r *VIconBuilder) {
  31. b.tag.Attr(":left", fmt.Sprint(v))
  32. return b
  33. }
  34. func (b *VIconBuilder) Light(v bool) (r *VIconBuilder) {
  35. b.tag.Attr(":light", fmt.Sprint(v))
  36. return b
  37. }
  38. func (b *VIconBuilder) Right(v bool) (r *VIconBuilder) {
  39. b.tag.Attr(":right", fmt.Sprint(v))
  40. return b
  41. }
  42. func (b *VIconBuilder) Size(v int) (r *VIconBuilder) {
  43. b.tag.Attr(":size", fmt.Sprint(v))
  44. return b
  45. }
  46. func (b *VIconBuilder) Small(v bool) (r *VIconBuilder) {
  47. b.tag.Attr(":small", fmt.Sprint(v))
  48. return b
  49. }
  50. func (b *VIconBuilder) Tag(v string) (r *VIconBuilder) {
  51. b.tag.Attr("tag", v)
  52. return b
  53. }
  54. func (b *VIconBuilder) XLarge(v bool) (r *VIconBuilder) {
  55. b.tag.Attr(":x-large", fmt.Sprint(v))
  56. return b
  57. }
  58. func (b *VIconBuilder) XSmall(v bool) (r *VIconBuilder) {
  59. b.tag.Attr(":x-small", fmt.Sprint(v))
  60. return b
  61. }
  62. func (b *VIconBuilder) SetAttr(k string, v interface{}) {
  63. b.tag.SetAttr(k, v)
  64. }
  65. func (b *VIconBuilder) Attr(vs ...interface{}) (r *VIconBuilder) {
  66. b.tag.Attr(vs...)
  67. return b
  68. }
  69. func (b *VIconBuilder) Children(children ...h.HTMLComponent) (r *VIconBuilder) {
  70. b.tag.Children(children...)
  71. return b
  72. }
  73. func (b *VIconBuilder) AppendChildren(children ...h.HTMLComponent) (r *VIconBuilder) {
  74. b.tag.AppendChildren(children...)
  75. return b
  76. }
  77. func (b *VIconBuilder) PrependChildren(children ...h.HTMLComponent) (r *VIconBuilder) {
  78. b.tag.PrependChildren(children...)
  79. return b
  80. }
  81. func (b *VIconBuilder) Class(names ...string) (r *VIconBuilder) {
  82. b.tag.Class(names...)
  83. return b
  84. }
  85. func (b *VIconBuilder) ClassIf(name string, add bool) (r *VIconBuilder) {
  86. b.tag.ClassIf(name, add)
  87. return b
  88. }
  89. func (b *VIconBuilder) On(name string, value string) (r *VIconBuilder) {
  90. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  91. return b
  92. }
  93. func (b *VIconBuilder) Bind(name string, value string) (r *VIconBuilder) {
  94. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  95. return b
  96. }
  97. func (b *VIconBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  98. return b.tag.MarshalHTML(ctx)
  99. }