simple-table.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VSimpleTableBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func (b *VSimpleTableBuilder) Dark(v bool) (r *VSimpleTableBuilder) {
  11. b.tag.Attr(":dark", fmt.Sprint(v))
  12. return b
  13. }
  14. func (b *VSimpleTableBuilder) Dense(v bool) (r *VSimpleTableBuilder) {
  15. b.tag.Attr(":dense", fmt.Sprint(v))
  16. return b
  17. }
  18. func (b *VSimpleTableBuilder) FixedHeader(v bool) (r *VSimpleTableBuilder) {
  19. b.tag.Attr(":fixed-header", fmt.Sprint(v))
  20. return b
  21. }
  22. func (b *VSimpleTableBuilder) Height(v int) (r *VSimpleTableBuilder) {
  23. b.tag.Attr(":height", fmt.Sprint(v))
  24. return b
  25. }
  26. func (b *VSimpleTableBuilder) Light(v bool) (r *VSimpleTableBuilder) {
  27. b.tag.Attr(":light", fmt.Sprint(v))
  28. return b
  29. }
  30. func (b *VSimpleTableBuilder) SetAttr(k string, v interface{}) {
  31. b.tag.SetAttr(k, v)
  32. }
  33. func (b *VSimpleTableBuilder) Attr(vs ...interface{}) (r *VSimpleTableBuilder) {
  34. b.tag.Attr(vs...)
  35. return b
  36. }
  37. func (b *VSimpleTableBuilder) Children(children ...h.HTMLComponent) (r *VSimpleTableBuilder) {
  38. b.tag.Children(children...)
  39. return b
  40. }
  41. func (b *VSimpleTableBuilder) AppendChildren(children ...h.HTMLComponent) (r *VSimpleTableBuilder) {
  42. b.tag.AppendChildren(children...)
  43. return b
  44. }
  45. func (b *VSimpleTableBuilder) PrependChildren(children ...h.HTMLComponent) (r *VSimpleTableBuilder) {
  46. b.tag.PrependChildren(children...)
  47. return b
  48. }
  49. func (b *VSimpleTableBuilder) Class(names ...string) (r *VSimpleTableBuilder) {
  50. b.tag.Class(names...)
  51. return b
  52. }
  53. func (b *VSimpleTableBuilder) ClassIf(name string, add bool) (r *VSimpleTableBuilder) {
  54. b.tag.ClassIf(name, add)
  55. return b
  56. }
  57. func (b *VSimpleTableBuilder) On(name string, value string) (r *VSimpleTableBuilder) {
  58. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  59. return b
  60. }
  61. func (b *VSimpleTableBuilder) Bind(name string, value string) (r *VSimpleTableBuilder) {
  62. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  63. return b
  64. }
  65. func (b *VSimpleTableBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  66. return b.tag.MarshalHTML(ctx)
  67. }