calendar-weekly.go 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VCalendarWeeklyBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VCalendarWeekly(children ...h.HTMLComponent) (r *VCalendarWeeklyBuilder) {
  11. r = &VCalendarWeeklyBuilder{
  12. tag: h.Tag("v-calendar-weekly").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VCalendarWeeklyBuilder) Color(v string) (r *VCalendarWeeklyBuilder) {
  17. b.tag.Attr("color", v)
  18. return b
  19. }
  20. func (b *VCalendarWeeklyBuilder) Dark(v bool) (r *VCalendarWeeklyBuilder) {
  21. b.tag.Attr(":dark", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VCalendarWeeklyBuilder) DayFormat(v interface{}) (r *VCalendarWeeklyBuilder) {
  25. b.tag.Attr(":day-format", h.JSONString(v))
  26. return b
  27. }
  28. func (b *VCalendarWeeklyBuilder) End(v int) (r *VCalendarWeeklyBuilder) {
  29. b.tag.Attr(":end", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VCalendarWeeklyBuilder) HideHeader(v bool) (r *VCalendarWeeklyBuilder) {
  33. b.tag.Attr(":hide-header", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VCalendarWeeklyBuilder) Light(v bool) (r *VCalendarWeeklyBuilder) {
  37. b.tag.Attr(":light", fmt.Sprint(v))
  38. return b
  39. }
  40. func (b *VCalendarWeeklyBuilder) Locale(v string) (r *VCalendarWeeklyBuilder) {
  41. b.tag.Attr("locale", v)
  42. return b
  43. }
  44. func (b *VCalendarWeeklyBuilder) LocaleFirstDayOfYear(v string) (r *VCalendarWeeklyBuilder) {
  45. b.tag.Attr("locale-first-day-of-year", v)
  46. return b
  47. }
  48. func (b *VCalendarWeeklyBuilder) MinWeeks(v interface{}) (r *VCalendarWeeklyBuilder) {
  49. b.tag.Attr(":min-weeks", h.JSONString(v))
  50. return b
  51. }
  52. func (b *VCalendarWeeklyBuilder) MonthFormat(v interface{}) (r *VCalendarWeeklyBuilder) {
  53. b.tag.Attr(":month-format", h.JSONString(v))
  54. return b
  55. }
  56. func (b *VCalendarWeeklyBuilder) Now(v string) (r *VCalendarWeeklyBuilder) {
  57. b.tag.Attr("now", v)
  58. return b
  59. }
  60. func (b *VCalendarWeeklyBuilder) ShortMonths(v bool) (r *VCalendarWeeklyBuilder) {
  61. b.tag.Attr(":short-months", fmt.Sprint(v))
  62. return b
  63. }
  64. func (b *VCalendarWeeklyBuilder) ShortWeekdays(v bool) (r *VCalendarWeeklyBuilder) {
  65. b.tag.Attr(":short-weekdays", fmt.Sprint(v))
  66. return b
  67. }
  68. func (b *VCalendarWeeklyBuilder) ShowMonthOnFirst(v bool) (r *VCalendarWeeklyBuilder) {
  69. b.tag.Attr(":show-month-on-first", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VCalendarWeeklyBuilder) ShowWeek(v bool) (r *VCalendarWeeklyBuilder) {
  73. b.tag.Attr(":show-week", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VCalendarWeeklyBuilder) Start(v int) (r *VCalendarWeeklyBuilder) {
  77. b.tag.Attr(":start", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VCalendarWeeklyBuilder) WeekdayFormat(v interface{}) (r *VCalendarWeeklyBuilder) {
  81. b.tag.Attr(":weekday-format", h.JSONString(v))
  82. return b
  83. }
  84. func (b *VCalendarWeeklyBuilder) Weekdays(v string) (r *VCalendarWeeklyBuilder) {
  85. b.tag.Attr("weekdays", v)
  86. return b
  87. }
  88. func (b *VCalendarWeeklyBuilder) SetAttr(k string, v interface{}) {
  89. b.tag.SetAttr(k, v)
  90. }
  91. func (b *VCalendarWeeklyBuilder) Attr(vs ...interface{}) (r *VCalendarWeeklyBuilder) {
  92. b.tag.Attr(vs...)
  93. return b
  94. }
  95. func (b *VCalendarWeeklyBuilder) Children(children ...h.HTMLComponent) (r *VCalendarWeeklyBuilder) {
  96. b.tag.Children(children...)
  97. return b
  98. }
  99. func (b *VCalendarWeeklyBuilder) AppendChildren(children ...h.HTMLComponent) (r *VCalendarWeeklyBuilder) {
  100. b.tag.AppendChildren(children...)
  101. return b
  102. }
  103. func (b *VCalendarWeeklyBuilder) PrependChildren(children ...h.HTMLComponent) (r *VCalendarWeeklyBuilder) {
  104. b.tag.PrependChildren(children...)
  105. return b
  106. }
  107. func (b *VCalendarWeeklyBuilder) Class(names ...string) (r *VCalendarWeeklyBuilder) {
  108. b.tag.Class(names...)
  109. return b
  110. }
  111. func (b *VCalendarWeeklyBuilder) ClassIf(name string, add bool) (r *VCalendarWeeklyBuilder) {
  112. b.tag.ClassIf(name, add)
  113. return b
  114. }
  115. func (b *VCalendarWeeklyBuilder) On(name string, value string) (r *VCalendarWeeklyBuilder) {
  116. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  117. return b
  118. }
  119. func (b *VCalendarWeeklyBuilder) Bind(name string, value string) (r *VCalendarWeeklyBuilder) {
  120. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  121. return b
  122. }
  123. func (b *VCalendarWeeklyBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  124. return b.tag.MarshalHTML(ctx)
  125. }