calendar.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. package vuetify
  2. import (
  3. "context"
  4. "fmt"
  5. h "github.com/theplant/htmlgo"
  6. )
  7. type VCalendarBuilder struct {
  8. tag *h.HTMLTagBuilder
  9. }
  10. func VCalendar(children ...h.HTMLComponent) (r *VCalendarBuilder) {
  11. r = &VCalendarBuilder{
  12. tag: h.Tag("v-calendar").Children(children...),
  13. }
  14. return
  15. }
  16. func (b *VCalendarBuilder) Categories(v string) (r *VCalendarBuilder) {
  17. b.tag.Attr("categories", v)
  18. return b
  19. }
  20. func (b *VCalendarBuilder) CategoryDays(v int) (r *VCalendarBuilder) {
  21. b.tag.Attr(":category-days", fmt.Sprint(v))
  22. return b
  23. }
  24. func (b *VCalendarBuilder) CategoryForInvalid(v string) (r *VCalendarBuilder) {
  25. b.tag.Attr("category-for-invalid", v)
  26. return b
  27. }
  28. func (b *VCalendarBuilder) CategoryHideDynamic(v bool) (r *VCalendarBuilder) {
  29. b.tag.Attr(":category-hide-dynamic", fmt.Sprint(v))
  30. return b
  31. }
  32. func (b *VCalendarBuilder) CategoryShowAll(v bool) (r *VCalendarBuilder) {
  33. b.tag.Attr(":category-show-all", fmt.Sprint(v))
  34. return b
  35. }
  36. func (b *VCalendarBuilder) CategoryText(v string) (r *VCalendarBuilder) {
  37. b.tag.Attr("category-text", v)
  38. return b
  39. }
  40. func (b *VCalendarBuilder) Color(v string) (r *VCalendarBuilder) {
  41. b.tag.Attr("color", v)
  42. return b
  43. }
  44. func (b *VCalendarBuilder) Dark(v bool) (r *VCalendarBuilder) {
  45. b.tag.Attr(":dark", fmt.Sprint(v))
  46. return b
  47. }
  48. func (b *VCalendarBuilder) DayFormat(v interface{}) (r *VCalendarBuilder) {
  49. b.tag.Attr(":day-format", h.JSONString(v))
  50. return b
  51. }
  52. func (b *VCalendarBuilder) End(v int) (r *VCalendarBuilder) {
  53. b.tag.Attr(":end", fmt.Sprint(v))
  54. return b
  55. }
  56. func (b *VCalendarBuilder) EventCategory(v string) (r *VCalendarBuilder) {
  57. b.tag.Attr("event-category", v)
  58. return b
  59. }
  60. func (b *VCalendarBuilder) EventColor(v string) (r *VCalendarBuilder) {
  61. b.tag.Attr("event-color", v)
  62. return b
  63. }
  64. func (b *VCalendarBuilder) EventEnd(v string) (r *VCalendarBuilder) {
  65. b.tag.Attr("event-end", v)
  66. return b
  67. }
  68. func (b *VCalendarBuilder) EventHeight(v int) (r *VCalendarBuilder) {
  69. b.tag.Attr(":event-height", fmt.Sprint(v))
  70. return b
  71. }
  72. func (b *VCalendarBuilder) EventMarginBottom(v int) (r *VCalendarBuilder) {
  73. b.tag.Attr(":event-margin-bottom", fmt.Sprint(v))
  74. return b
  75. }
  76. func (b *VCalendarBuilder) EventMore(v bool) (r *VCalendarBuilder) {
  77. b.tag.Attr(":event-more", fmt.Sprint(v))
  78. return b
  79. }
  80. func (b *VCalendarBuilder) EventMoreText(v string) (r *VCalendarBuilder) {
  81. b.tag.Attr("event-more-text", v)
  82. return b
  83. }
  84. func (b *VCalendarBuilder) EventName(v string) (r *VCalendarBuilder) {
  85. b.tag.Attr("event-name", v)
  86. return b
  87. }
  88. func (b *VCalendarBuilder) EventOverlapMode(v string) (r *VCalendarBuilder) {
  89. b.tag.Attr("event-overlap-mode", v)
  90. return b
  91. }
  92. func (b *VCalendarBuilder) EventOverlapThreshold(v string) (r *VCalendarBuilder) {
  93. b.tag.Attr("event-overlap-threshold", v)
  94. return b
  95. }
  96. func (b *VCalendarBuilder) EventRipple(v interface{}) (r *VCalendarBuilder) {
  97. b.tag.Attr(":event-ripple", h.JSONString(v))
  98. return b
  99. }
  100. func (b *VCalendarBuilder) EventStart(v string) (r *VCalendarBuilder) {
  101. b.tag.Attr("event-start", v)
  102. return b
  103. }
  104. func (b *VCalendarBuilder) EventTextColor(v string) (r *VCalendarBuilder) {
  105. b.tag.Attr("event-text-color", v)
  106. return b
  107. }
  108. func (b *VCalendarBuilder) EventTimed(v string) (r *VCalendarBuilder) {
  109. b.tag.Attr("event-timed", v)
  110. return b
  111. }
  112. func (b *VCalendarBuilder) Events(v interface{}) (r *VCalendarBuilder) {
  113. b.tag.Attr(":events", h.JSONString(v))
  114. return b
  115. }
  116. func (b *VCalendarBuilder) FirstInterval(v int) (r *VCalendarBuilder) {
  117. b.tag.Attr(":first-interval", fmt.Sprint(v))
  118. return b
  119. }
  120. func (b *VCalendarBuilder) FirstTime(v interface{}) (r *VCalendarBuilder) {
  121. b.tag.Attr(":first-time", h.JSONString(v))
  122. return b
  123. }
  124. func (b *VCalendarBuilder) HideHeader(v bool) (r *VCalendarBuilder) {
  125. b.tag.Attr(":hide-header", fmt.Sprint(v))
  126. return b
  127. }
  128. func (b *VCalendarBuilder) IntervalCount(v int) (r *VCalendarBuilder) {
  129. b.tag.Attr(":interval-count", fmt.Sprint(v))
  130. return b
  131. }
  132. func (b *VCalendarBuilder) IntervalFormat(v interface{}) (r *VCalendarBuilder) {
  133. b.tag.Attr(":interval-format", h.JSONString(v))
  134. return b
  135. }
  136. func (b *VCalendarBuilder) IntervalHeight(v int) (r *VCalendarBuilder) {
  137. b.tag.Attr(":interval-height", fmt.Sprint(v))
  138. return b
  139. }
  140. func (b *VCalendarBuilder) IntervalMinutes(v int) (r *VCalendarBuilder) {
  141. b.tag.Attr(":interval-minutes", fmt.Sprint(v))
  142. return b
  143. }
  144. func (b *VCalendarBuilder) IntervalStyle(v interface{}) (r *VCalendarBuilder) {
  145. b.tag.Attr(":interval-style", h.JSONString(v))
  146. return b
  147. }
  148. func (b *VCalendarBuilder) IntervalWidth(v int) (r *VCalendarBuilder) {
  149. b.tag.Attr(":interval-width", fmt.Sprint(v))
  150. return b
  151. }
  152. func (b *VCalendarBuilder) Light(v bool) (r *VCalendarBuilder) {
  153. b.tag.Attr(":light", fmt.Sprint(v))
  154. return b
  155. }
  156. func (b *VCalendarBuilder) Locale(v string) (r *VCalendarBuilder) {
  157. b.tag.Attr("locale", v)
  158. return b
  159. }
  160. func (b *VCalendarBuilder) LocaleFirstDayOfYear(v string) (r *VCalendarBuilder) {
  161. b.tag.Attr("locale-first-day-of-year", v)
  162. return b
  163. }
  164. func (b *VCalendarBuilder) MaxDays(v int) (r *VCalendarBuilder) {
  165. b.tag.Attr(":max-days", fmt.Sprint(v))
  166. return b
  167. }
  168. func (b *VCalendarBuilder) MinWeeks(v interface{}) (r *VCalendarBuilder) {
  169. b.tag.Attr(":min-weeks", h.JSONString(v))
  170. return b
  171. }
  172. func (b *VCalendarBuilder) MonthFormat(v interface{}) (r *VCalendarBuilder) {
  173. b.tag.Attr(":month-format", h.JSONString(v))
  174. return b
  175. }
  176. func (b *VCalendarBuilder) Now(v string) (r *VCalendarBuilder) {
  177. b.tag.Attr("now", v)
  178. return b
  179. }
  180. func (b *VCalendarBuilder) ShortIntervals(v bool) (r *VCalendarBuilder) {
  181. b.tag.Attr(":short-intervals", fmt.Sprint(v))
  182. return b
  183. }
  184. func (b *VCalendarBuilder) ShortMonths(v bool) (r *VCalendarBuilder) {
  185. b.tag.Attr(":short-months", fmt.Sprint(v))
  186. return b
  187. }
  188. func (b *VCalendarBuilder) ShortWeekdays(v bool) (r *VCalendarBuilder) {
  189. b.tag.Attr(":short-weekdays", fmt.Sprint(v))
  190. return b
  191. }
  192. func (b *VCalendarBuilder) ShowIntervalLabel(v interface{}) (r *VCalendarBuilder) {
  193. b.tag.Attr(":show-interval-label", h.JSONString(v))
  194. return b
  195. }
  196. func (b *VCalendarBuilder) ShowMonthOnFirst(v bool) (r *VCalendarBuilder) {
  197. b.tag.Attr(":show-month-on-first", fmt.Sprint(v))
  198. return b
  199. }
  200. func (b *VCalendarBuilder) ShowWeek(v bool) (r *VCalendarBuilder) {
  201. b.tag.Attr(":show-week", fmt.Sprint(v))
  202. return b
  203. }
  204. func (b *VCalendarBuilder) Start(v int) (r *VCalendarBuilder) {
  205. b.tag.Attr(":start", fmt.Sprint(v))
  206. return b
  207. }
  208. func (b *VCalendarBuilder) Type(v string) (r *VCalendarBuilder) {
  209. b.tag.Attr("type", v)
  210. return b
  211. }
  212. func (b *VCalendarBuilder) Value(v int) (r *VCalendarBuilder) {
  213. b.tag.Attr(":value", fmt.Sprint(v))
  214. return b
  215. }
  216. func (b *VCalendarBuilder) WeekdayFormat(v interface{}) (r *VCalendarBuilder) {
  217. b.tag.Attr(":weekday-format", h.JSONString(v))
  218. return b
  219. }
  220. func (b *VCalendarBuilder) Weekdays(v string) (r *VCalendarBuilder) {
  221. b.tag.Attr("weekdays", v)
  222. return b
  223. }
  224. func (b *VCalendarBuilder) SetAttr(k string, v interface{}) {
  225. b.tag.SetAttr(k, v)
  226. }
  227. func (b *VCalendarBuilder) Attr(vs ...interface{}) (r *VCalendarBuilder) {
  228. b.tag.Attr(vs...)
  229. return b
  230. }
  231. func (b *VCalendarBuilder) Children(children ...h.HTMLComponent) (r *VCalendarBuilder) {
  232. b.tag.Children(children...)
  233. return b
  234. }
  235. func (b *VCalendarBuilder) AppendChildren(children ...h.HTMLComponent) (r *VCalendarBuilder) {
  236. b.tag.AppendChildren(children...)
  237. return b
  238. }
  239. func (b *VCalendarBuilder) PrependChildren(children ...h.HTMLComponent) (r *VCalendarBuilder) {
  240. b.tag.PrependChildren(children...)
  241. return b
  242. }
  243. func (b *VCalendarBuilder) Class(names ...string) (r *VCalendarBuilder) {
  244. b.tag.Class(names...)
  245. return b
  246. }
  247. func (b *VCalendarBuilder) ClassIf(name string, add bool) (r *VCalendarBuilder) {
  248. b.tag.ClassIf(name, add)
  249. return b
  250. }
  251. func (b *VCalendarBuilder) On(name string, value string) (r *VCalendarBuilder) {
  252. b.tag.Attr(fmt.Sprintf("v-on:%s", name), value)
  253. return b
  254. }
  255. func (b *VCalendarBuilder) Bind(name string, value string) (r *VCalendarBuilder) {
  256. b.tag.Attr(fmt.Sprintf("v-bind:%s", name), value)
  257. return b
  258. }
  259. func (b *VCalendarBuilder) MarshalHTML(ctx context.Context) (r []byte, err error) {
  260. return b.tag.MarshalHTML(ctx)
  261. }