@sdata/web-vue 1.19.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (683) hide show
  1. package/README.md +3 -7
  2. package/dist/sd.css +4083 -2512
  3. package/dist/sd.min.css +1 -1
  4. package/es/_components/feedback-icon.js +1 -1
  5. package/es/_components/icon-hover.js +1 -1
  6. package/es/_components/icon-hover.vue.d.ts +1 -1
  7. package/es/_components/input-label/input-label.d.ts +1 -1
  8. package/es/_components/input-label/style/index.css +27 -27
  9. package/es/_components/picker/input-range.js +1 -1
  10. package/es/_components/picker/input-range.vue.d.ts +2 -2
  11. package/es/_components/picker/input.js +1 -1
  12. package/es/_components/picker/input.vue.d.ts +2 -2
  13. package/es/_components/resize-trigger.js +1 -1
  14. package/es/_components/select-view/select-view.d.ts +3 -3
  15. package/es/_components/select-view/style/index.css +199 -199
  16. package/es/_components/transition/expand-transition.js +1 -1
  17. package/es/_components/virtual-list/virtual-list.js +1 -1
  18. package/es/_components/virtual-list/virtual-list.vue.d.ts +8 -5
  19. package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +9 -16
  20. package/es/_hooks/use-form-item.d.ts +1 -1
  21. package/es/_hooks/use-scrollbar.d.ts +2 -3
  22. package/es/_hooks/use-scrollbar.js +4 -8
  23. package/es/_hooks/use-size.d.ts +1 -1
  24. package/es/_utils/color.d.ts +9 -0
  25. package/es/_utils/color.js +38 -2
  26. package/es/_utils/date.d.ts +1 -2
  27. package/es/_utils/date.js +74 -25
  28. package/es/_utils/global-config.d.ts +4 -0
  29. package/es/_utils/global-config.js +10 -2
  30. package/es/_utils/omit.js +1 -1
  31. package/es/_utils/responsive-observe.js +1 -1
  32. package/es/_utils/virtual-dropdown.js +1 -1
  33. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/asyncToGenerator.js +1 -1
  34. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/defineProperty.js +1 -1
  35. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/extends.js +1 -1
  36. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectDestructuringEmpty.js +1 -1
  37. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectSpread2.js +1 -1
  38. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectWithoutProperties.js +1 -1
  39. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/objectWithoutPropertiesLoose.js +1 -1
  40. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/toPrimitive.js +1 -1
  41. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/toPropertyKey.js +1 -1
  42. package/es/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/typeof.js +1 -1
  43. package/es/affix/affix.js +1 -1
  44. package/es/affix/affix.vue_vue_type_script_lang.js +1 -1
  45. package/es/alert/alert.js +1 -1
  46. package/es/alert/alert.vue.d.ts +1 -1
  47. package/es/alert/index.d.ts +2 -2
  48. package/es/alert/style/index.css +28 -28
  49. package/es/anchor/anchor-link.js +1 -1
  50. package/es/anchor/anchor.js +1 -1
  51. package/es/anchor/style/index.css +9 -9
  52. package/es/auto-complete/auto-complete.d.ts +3 -3
  53. package/es/auto-complete/auto-complete.js +23 -9
  54. package/es/auto-complete/index.d.ts +9 -9
  55. package/es/auto-complete/style/index.css +3 -3
  56. package/es/avatar/avatar.js +1 -1
  57. package/es/avatar/avatar.vue_vue_type_script_lang.js +1 -1
  58. package/es/avatar/style/index.css +15 -15
  59. package/es/back-top/back-top.js +1 -1
  60. package/es/back-top/style/index.css +4 -4
  61. package/es/badge/badge.d.ts +1 -1
  62. package/es/badge/badge.js +1 -1
  63. package/es/badge/index.d.ts +3 -3
  64. package/es/badge/style/index.css +25 -25
  65. package/es/breadcrumb/style/index.css +12 -12
  66. package/es/button/button-group.js +1 -1
  67. package/es/button/button.js +1 -1
  68. package/es/button/button.vue.d.ts +2 -2
  69. package/es/button/index.d.ts +6 -6
  70. package/es/button/style/index.css +37 -37
  71. package/es/calendar/components/body.js +5 -0
  72. package/es/calendar/components/body.vue.d.ts +100 -0
  73. package/es/calendar/components/body.vue_vue_type_script_setup_true_lang.js +158 -0
  74. package/es/calendar/components/cell.js +5 -0
  75. package/es/calendar/components/cell.vue.d.ts +220 -0
  76. package/es/calendar/components/cell.vue_vue_type_script_setup_true_lang.js +813 -0
  77. package/es/calendar/components/event.js +5 -0
  78. package/es/calendar/components/event.vue.d.ts +73 -0
  79. package/es/calendar/components/event.vue_vue_type_script_setup_true_lang.js +290 -0
  80. package/es/calendar/components/header.js +5 -0
  81. package/es/calendar/components/header.vue.d.ts +34 -0
  82. package/es/calendar/components/header.vue_vue_type_script_setup_true_lang.js +84 -0
  83. package/es/calendar/components/headings-bar.js +5 -0
  84. package/es/calendar/components/headings-bar.vue.d.ts +40 -0
  85. package/es/calendar/components/headings-bar.vue_vue_type_script_setup_true_lang.js +201 -0
  86. package/es/calendar/components/index.js +5 -0
  87. package/es/calendar/components/index.vue.d.ts +616 -0
  88. package/es/calendar/components/index.vue_vue_type_script_setup_true_lang.js +314 -0
  89. package/es/calendar/components/time-column.js +5 -0
  90. package/es/calendar/components/time-column.vue.d.ts +27 -0
  91. package/es/calendar/components/time-column.vue_vue_type_script_setup_true_lang.js +66 -0
  92. package/es/calendar/context.d.ts +16 -0
  93. package/es/calendar/context.js +5 -0
  94. package/es/calendar/core/config.d.ts +126 -0
  95. package/es/calendar/core/config.js +522 -0
  96. package/es/calendar/core/events.d.ts +1 -0
  97. package/es/calendar/core/events.js +921 -0
  98. package/es/calendar/core/i18n.d.ts +1 -0
  99. package/es/calendar/core/i18n.js +72 -0
  100. package/es/calendar/core/index.d.ts +112 -0
  101. package/es/calendar/core/index.js +66 -0
  102. package/es/calendar/core/props-definitions.d.ts +263 -0
  103. package/es/calendar/core/props-definitions.js +70 -0
  104. package/es/calendar/core/view.d.ts +60 -0
  105. package/es/calendar/core/view.js +761 -0
  106. package/es/calendar/default-theme.scss +1012 -0
  107. package/es/calendar/hooks/use-calendar-theme.d.ts +4 -0
  108. package/es/calendar/hooks/use-calendar-theme.js +32 -0
  109. package/es/calendar/index.d.ts +836 -98
  110. package/es/calendar/index.js +3 -3
  111. package/es/calendar/index.scss +331 -0
  112. package/es/calendar/modules/drag-and-drop.d.ts +8 -0
  113. package/es/calendar/modules/drag-and-drop.js +442 -0
  114. package/es/calendar/style/body.scss +51 -0
  115. package/es/calendar/style/cell.scss +153 -0
  116. package/es/calendar/style/css.js +0 -1
  117. package/es/calendar/style/event.scss +69 -0
  118. package/es/calendar/style/header.scss +104 -0
  119. package/es/calendar/style/headings-bar.scss +94 -0
  120. package/es/calendar/style/index.css +1514 -264
  121. package/es/calendar/style/index.d.ts +1 -3
  122. package/es/calendar/style/index.js +0 -1
  123. package/es/calendar/style/index.scss +9 -496
  124. package/es/calendar/style/time-column.scss +109 -0
  125. package/es/calendar/style/token.scss +64 -60
  126. package/es/calendar/utils/conversions.d.ts +3 -0
  127. package/es/calendar/utils/conversions.js +31 -0
  128. package/es/calendar/utils/date.d.ts +26 -0
  129. package/es/calendar/utils/date.js +253 -0
  130. package/es/calendar/utils/special-hours-allow-events.d.ts +28 -0
  131. package/es/calendar/utils/special-hours-allow-events.js +230 -0
  132. package/es/card/card-grid.js +1 -1
  133. package/es/card/style/index.css +16 -16
  134. package/es/carousel/carousel-arrow.js +1 -1
  135. package/es/carousel/carousel-indicator.js +1 -1
  136. package/es/carousel/carousel-indicator.vue.d.ts +1 -1
  137. package/es/carousel/carousel-item.js +1 -1
  138. package/es/carousel/carousel.js +1 -1
  139. package/es/carousel/style/index.css +11 -11
  140. package/es/cascader/cascader-option.d.ts +1 -1
  141. package/es/cascader/cascader-option.js +1 -1
  142. package/es/cascader/cascader-panel.vue.d.ts +1 -1
  143. package/es/cascader/cascader-panel.vue_vue_type_script_setup_true_lang.js +2 -2
  144. package/es/cascader/cascader.vue.d.ts +5 -5
  145. package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +5 -5
  146. package/es/cascader/style/index.css +36 -36
  147. package/es/checkbox/checkbox.d.ts +1 -1
  148. package/es/checkbox/index.d.ts +2 -2
  149. package/es/checkbox/style/index.css +18 -18
  150. package/es/collapse/collapse-item.d.ts +1 -1
  151. package/es/collapse/collapse.js +1 -1
  152. package/es/collapse/index.d.ts +1 -1
  153. package/es/collapse/style/index.css +15 -15
  154. package/es/color-picker/color-picker.d.ts +1 -1
  155. package/es/color-picker/color-picker.js +1 -1
  156. package/es/color-picker/index.d.ts +3 -3
  157. package/es/color-picker/palette.js +1 -1
  158. package/es/color-picker/panel.d.ts +1 -1
  159. package/es/color-picker/panel.js +2 -2
  160. package/es/color-picker/style/index.css +13 -13
  161. package/es/color-picker/utils.js +1 -1
  162. package/es/comment/comment.js +2 -2
  163. package/es/comment/style/index.css +5 -5
  164. package/es/components.d.ts +2 -2
  165. package/es/config-provider/config-provider.js +1 -1
  166. package/es/config-provider/config-provider.vue.d.ts +1 -1
  167. package/es/config-provider/context.d.ts +3 -0
  168. package/es/config-provider/index.d.ts +3 -3
  169. package/es/config-provider/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -2
  170. package/es/config-provider/theme.js +1 -1
  171. package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +3 -3
  172. package/es/cropper/cropper.vue_vue_type_script_setup_true_lang.js +3 -3
  173. package/es/cropper/style/index.css +3 -3
  174. package/es/date-picker/hooks/use-range-time-picker-value.js +1 -1
  175. package/es/date-picker/index.d.ts +48 -48
  176. package/es/date-picker/panels/body.js +1 -1
  177. package/es/date-picker/panels/date/index.js +2 -2
  178. package/es/date-picker/panels/date/index.vue.d.ts +6 -6
  179. package/es/date-picker/panels/date/index.vue_vue_type_script_lang.js +1 -1
  180. package/es/date-picker/panels/footer.js +1 -1
  181. package/es/date-picker/panels/footer.vue.d.ts +9 -9
  182. package/es/date-picker/panels/header.js +1 -1
  183. package/es/date-picker/panels/month/index.js +2 -2
  184. package/es/date-picker/panels/quarter/index.js +2 -2
  185. package/es/date-picker/panels/shortcuts.js +1 -1
  186. package/es/date-picker/panels/shortcuts.vue.d.ts +6 -6
  187. package/es/date-picker/panels/week/index.js +1 -1
  188. package/es/date-picker/panels/week/index.vue.d.ts +6 -6
  189. package/es/date-picker/panels/week-list.js +1 -1
  190. package/es/date-picker/panels/year/index.js +2 -2
  191. package/es/date-picker/picker-panel.js +1 -1
  192. package/es/date-picker/picker-panel.vue.d.ts +28 -28
  193. package/es/date-picker/picker.js +2 -2
  194. package/es/date-picker/picker.vue.d.ts +46 -46
  195. package/es/date-picker/picker.vue_vue_type_script_lang.js +1 -1
  196. package/es/date-picker/range-picker-panel.js +1 -1
  197. package/es/date-picker/range-picker-panel.vue.d.ts +29 -29
  198. package/es/date-picker/range-picker-panel.vue_vue_type_script_lang.js +1 -1
  199. package/es/date-picker/range-picker.js +2 -2
  200. package/es/date-picker/range-picker.vue.d.ts +48 -48
  201. package/es/date-picker/range-picker.vue_vue_type_script_lang.js +1 -1
  202. package/es/date-picker/style/index.css +72 -72
  203. package/es/descriptions/descriptions-item.js +1 -1
  204. package/es/descriptions/descriptions.d.ts +2 -2
  205. package/es/descriptions/descriptions.js +1 -1
  206. package/es/descriptions/index.d.ts +6 -6
  207. package/es/descriptions/style/index.css +10 -10
  208. package/es/divider/divider.d.ts +1 -1
  209. package/es/divider/index.d.ts +3 -3
  210. package/es/divider/style/index.css +4 -4
  211. package/es/drawer/drawer.js +9 -2
  212. package/es/drawer/drawer.vue.d.ts +2905 -10
  213. package/es/drawer/drawer.vue_vue_type_script_lang.js +26 -7
  214. package/es/drawer/index.d.ts +6550 -764
  215. package/es/drawer/index.js +2 -2
  216. package/es/drawer/style/index.css +12 -7
  217. package/es/drawer/style/index.scss +6 -0
  218. package/es/dropdown/dropdown-button.js +1 -1
  219. package/es/dropdown/dropdown-button.vue.d.ts +24 -21
  220. package/es/dropdown/dropdown-group.js +1 -1
  221. package/es/dropdown/dropdown-option.js +1 -1
  222. package/es/dropdown/dropdown-option.vue.d.ts +1 -1
  223. package/es/dropdown/dropdown-panel.js +1 -1
  224. package/es/dropdown/dropdown-panel.vue.d.ts +6 -3
  225. package/es/dropdown/dropdown-submenu.js +1 -1
  226. package/es/dropdown/dropdown-submenu.vue.d.ts +18 -15
  227. package/es/dropdown/dropdown.js +1 -1
  228. package/es/dropdown/dropdown.vue.d.ts +16 -13
  229. package/es/dropdown/index.d.ts +78 -66
  230. package/es/dropdown/style/index.css +1 -1
  231. package/es/ellipsis/ellipsis.js +1 -1
  232. package/es/ellipsis/ellipsis.vue.d.ts +24 -24
  233. package/es/ellipsis/ellipsis.vue_vue_type_script_lang.js +2 -2
  234. package/es/ellipsis/index.d.ts +96 -96
  235. package/es/ellipsis/performant-ellipsis.js +1 -1
  236. package/es/ellipsis/performant-ellipsis.vue.d.ts +24 -24
  237. package/es/ellipsis/performant-ellipsis.vue_vue_type_script_lang.js +1 -1
  238. package/es/empty/style/index.css +2 -2
  239. package/es/form/form-item-label.js +1 -1
  240. package/es/form/form-item-label.vue.d.ts +24 -24
  241. package/es/form/form-item-message.js +1 -1
  242. package/es/form/form-item.js +1 -1
  243. package/es/form/form-item.vue.d.ts +29 -29
  244. package/es/form/form-item.vue_vue_type_script_lang.js +3 -3
  245. package/es/form/form.js +1 -1
  246. package/es/form/form.vue.d.ts +1 -1
  247. package/es/form/index.d.ts +35 -35
  248. package/es/form/style/index.css +6 -6
  249. package/es/grid/grid-col.js +1 -1
  250. package/es/grid/grid-col.vue_vue_type_script_lang.js +1 -1
  251. package/es/grid/grid-item.js +1 -1
  252. package/es/grid/grid-item.vue_vue_type_script_lang.js +1 -1
  253. package/es/grid/grid-row.js +1 -1
  254. package/es/grid/grid-row.vue.d.ts +4 -4
  255. package/es/grid/grid.js +1 -1
  256. package/es/grid/index.d.ts +4 -4
  257. package/es/icon/icon-calendar/icon-calendar.js +1 -1
  258. package/es/icon/icon-caret-down/icon-caret-down.js +1 -1
  259. package/es/icon/icon-caret-left/icon-caret-left.js +1 -1
  260. package/es/icon/icon-caret-right/icon-caret-right.js +1 -1
  261. package/es/icon/icon-caret-up/icon-caret-up.js +1 -1
  262. package/es/icon/icon-check/icon-check.js +1 -1
  263. package/es/icon/icon-check-circle-fill/icon-check-circle-fill.js +1 -1
  264. package/es/icon/icon-clock-circle/icon-clock-circle.js +1 -1
  265. package/es/icon/icon-close/icon-close.js +1 -1
  266. package/es/icon/icon-close-circle-fill/icon-close-circle-fill.js +1 -1
  267. package/es/icon/icon-copy/icon-copy.js +1 -1
  268. package/es/icon/icon-delete/icon-delete.js +1 -1
  269. package/es/icon/icon-double-left/icon-double-left.js +1 -1
  270. package/es/icon/icon-double-right/icon-double-right.js +1 -1
  271. package/es/icon/icon-down/icon-down.js +1 -1
  272. package/es/icon/icon-drag-dot/icon-drag-dot.js +1 -1
  273. package/es/icon/icon-drag-dot-vertical/icon-drag-dot-vertical.js +1 -1
  274. package/es/icon/icon-edit/icon-edit.js +1 -1
  275. package/es/icon/icon-empty/icon-empty.js +1 -1
  276. package/es/icon/icon-exclamation/icon-exclamation.js +1 -1
  277. package/es/icon/icon-exclamation-circle-fill/icon-exclamation-circle-fill.js +1 -1
  278. package/es/icon/icon-eye/icon-eye.js +1 -1
  279. package/es/icon/icon-eye-invisible/icon-eye-invisible.js +1 -1
  280. package/es/icon/icon-face-frown-fill/icon-face-frown-fill.js +1 -1
  281. package/es/icon/icon-face-meh-fill/icon-face-meh-fill.js +1 -1
  282. package/es/icon/icon-face-smile-fill/icon-face-smile-fill.js +1 -1
  283. package/es/icon/icon-file/icon-file.js +1 -1
  284. package/es/icon/icon-file-audio/icon-file-audio.js +1 -1
  285. package/es/icon/icon-file-image/icon-file-image.js +1 -1
  286. package/es/icon/icon-file-pdf/icon-file-pdf.js +1 -1
  287. package/es/icon/icon-file-video/icon-file-video.js +1 -1
  288. package/es/icon/icon-filter/icon-filter.js +1 -1
  289. package/es/icon/icon-fullscreen/icon-fullscreen.js +1 -1
  290. package/es/icon/icon-image-close/icon-image-close.js +1 -1
  291. package/es/icon/icon-info/icon-info.js +1 -1
  292. package/es/icon/icon-info-circle-fill/icon-info-circle-fill.js +1 -1
  293. package/es/icon/icon-left/icon-left.js +1 -1
  294. package/es/icon/icon-link/icon-link.js +1 -1
  295. package/es/icon/icon-loading/icon-loading.js +1 -1
  296. package/es/icon/icon-menu-fold/icon-menu-fold.js +1 -1
  297. package/es/icon/icon-menu-unfold/icon-menu-unfold.js +1 -1
  298. package/es/icon/icon-minus/icon-minus.js +1 -1
  299. package/es/icon/icon-more/icon-more.js +1 -1
  300. package/es/icon/icon-oblique-line/icon-oblique-line.js +1 -1
  301. package/es/icon/icon-original-size/icon-original-size.js +1 -1
  302. package/es/icon/icon-pause/icon-pause.js +1 -1
  303. package/es/icon/icon-play-arrow-fill/icon-play-arrow-fill.js +1 -1
  304. package/es/icon/icon-plus/icon-plus.js +1 -1
  305. package/es/icon/icon-question-circle/icon-question-circle.js +1 -1
  306. package/es/icon/icon-right/icon-right.js +1 -1
  307. package/es/icon/icon-rotate-left/icon-rotate-left.js +1 -1
  308. package/es/icon/icon-rotate-right/icon-rotate-right.js +1 -1
  309. package/es/icon/icon-search/icon-search.js +1 -1
  310. package/es/icon/icon-star-fill/icon-star-fill.js +1 -1
  311. package/es/icon/icon-to-top/icon-to-top.js +1 -1
  312. package/es/icon/icon-up/icon-up.js +1 -1
  313. package/es/icon/icon-upload/icon-upload.js +1 -1
  314. package/es/icon/icon-zoom-in/icon-zoom-in.js +1 -1
  315. package/es/icon/icon-zoom-out/icon-zoom-out.js +1 -1
  316. package/es/icon-component/icon.js +1 -1
  317. package/es/icon.js +292 -292
  318. package/es/image/image-footer.js +1 -1
  319. package/es/image/image.js +2 -2
  320. package/es/image/image.vue.d.ts +24 -24
  321. package/es/image/preview-action.d.ts +24 -24
  322. package/es/image/preview-arrow.js +1 -1
  323. package/es/image/preview-group.js +2 -2
  324. package/es/image/preview-group.vue.d.ts +25 -25
  325. package/es/image/preview-toolbar.js +1 -1
  326. package/es/image/preview-toolbar.vue.d.ts +24 -24
  327. package/es/image/preview.js +1 -1
  328. package/es/image/preview.vue.d.ts +24 -24
  329. package/es/image/preview.vue_vue_type_script_lang.js +1 -1
  330. package/es/image/style/index.css +32 -32
  331. package/es/index.css +4083 -2512
  332. package/es/index.d.ts +8 -2
  333. package/es/index.js +11 -10
  334. package/es/index.scss +3 -1
  335. package/es/input/index.d.ts +9 -9
  336. package/es/input/input-group.js +1 -1
  337. package/es/input/input-password.js +1 -1
  338. package/es/input/input-password.vue.d.ts +3 -3
  339. package/es/input/input.d.ts +2 -2
  340. package/es/input/input.js +1 -1
  341. package/es/input/style/index.css +50 -50
  342. package/es/input-number/index.d.ts +6 -6
  343. package/es/input-number/input-number.d.ts +2 -2
  344. package/es/input-number/input-number.js +1 -1
  345. package/es/input-number/style/index.css +16 -16
  346. package/es/input-tag/index.d.ts +6 -6
  347. package/es/input-tag/input-tag.d.ts +2 -2
  348. package/es/input-tag/input-tag.js +1 -1
  349. package/es/input-tag/style/index.css +172 -172
  350. package/es/input-tag/utils.js +1 -1
  351. package/es/json-form/json-form-component.vue_vue_type_script_setup_true_lang.js +3 -3
  352. package/es/json-form/json-form-item.vue_vue_type_script_setup_true_lang.js +3 -3
  353. package/es/json-form/json-form.vue_vue_type_script_setup_true_lang.js +3 -3
  354. package/es/json-form/utils.js +3 -3
  355. package/es/layout/content.js +1 -1
  356. package/es/layout/footer.js +1 -1
  357. package/es/layout/header.vue.d.ts +1 -1
  358. package/es/layout/header.vue_vue_type_script_setup_true_lang.js +2 -2
  359. package/es/layout/index.d.ts +21 -21
  360. package/es/layout/layout.js +1 -1
  361. package/es/layout/sider.js +1 -1
  362. package/es/layout/sider.vue.d.ts +16 -16
  363. package/es/layout/sider.vue_vue_type_script_lang.js +1 -1
  364. package/es/layout/style/index.css +12 -12
  365. package/es/link/index.d.ts +3 -3
  366. package/es/link/link.vue.d.ts +1 -1
  367. package/es/link/link.vue_vue_type_script_setup_true_lang.js +2 -2
  368. package/es/link/style/index.css +23 -23
  369. package/es/list/index.d.ts +9 -9
  370. package/es/list/list-item-meta.js +1 -1
  371. package/es/list/list.d.ts +3 -3
  372. package/es/list/list.js +4 -4
  373. package/es/list/style/index.css +9 -9
  374. package/es/locale/interface.d.ts +6 -0
  375. package/es/locale/lang/ar-eg.js +7 -1
  376. package/es/locale/lang/de-de.js +7 -1
  377. package/es/locale/lang/en-us.js +7 -1
  378. package/es/locale/lang/es-es.js +7 -1
  379. package/es/locale/lang/fr-fr.js +7 -1
  380. package/es/locale/lang/id-id.js +7 -1
  381. package/es/locale/lang/it-it.js +7 -1
  382. package/es/locale/lang/ja-jp.js +7 -1
  383. package/es/locale/lang/km-kh.js +7 -1
  384. package/es/locale/lang/ko-kr.js +7 -1
  385. package/es/locale/lang/ms-my.js +7 -1
  386. package/es/locale/lang/nl-nl.js +7 -1
  387. package/es/locale/lang/pt-pt.js +7 -1
  388. package/es/locale/lang/ru-ru.js +7 -1
  389. package/es/locale/lang/th-th.js +7 -1
  390. package/es/locale/lang/vi-vn.js +7 -1
  391. package/es/locale/lang/zh-cn.js +7 -1
  392. package/es/locale/lang/zh-tw.js +7 -1
  393. package/es/mention/index.d.ts +9 -9
  394. package/es/mention/mention.d.ts +3 -3
  395. package/es/mention/mention.js +24 -10
  396. package/es/menu/base-menu.js +1 -1
  397. package/es/menu/indent.js +1 -1
  398. package/es/menu/item-group.js +1 -1
  399. package/es/menu/item-group.vue.d.ts +48 -48
  400. package/es/menu/item.js +1 -1
  401. package/es/menu/menu.js +1 -1
  402. package/es/menu/style/index.css +62 -62
  403. package/es/menu/sub-menu-inline.js +1 -1
  404. package/es/menu/sub-menu-inline.vue.d.ts +48 -48
  405. package/es/menu/sub-menu-pop.js +1 -1
  406. package/es/menu/sub-menu-pop.vue.d.ts +57 -57
  407. package/es/menu/sub-menu.js +1 -1
  408. package/es/message/index.js +1 -1
  409. package/es/message/message-list.d.ts +1 -1
  410. package/es/message/message.js +1 -1
  411. package/es/message/message.vue.d.ts +1 -1
  412. package/es/message/style/index.css +26 -26
  413. package/es/modal/index.d.ts +6368 -570
  414. package/es/modal/index.js +2 -2
  415. package/es/modal/modal.js +15 -4
  416. package/es/modal/modal.vue.d.ts +2907 -8
  417. package/es/modal/modal.vue_vue_type_script_lang.js +28 -5
  418. package/es/modal/style/index.css +28 -12
  419. package/es/modal/style/index.scss +23 -0
  420. package/es/notification/index.js +1 -1
  421. package/es/notification/notification.js +1 -1
  422. package/es/notification/notification.vue.d.ts +1 -1
  423. package/es/notification/style/index.css +26 -26
  424. package/es/page-header/index.d.ts +2 -2
  425. package/es/page-header/page-header.js +1 -1
  426. package/es/page-header/page-header.vue.d.ts +1 -1
  427. package/es/page-header/style/index.css +6 -6
  428. package/es/pagination/page-item-ellipsis.js +1 -1
  429. package/es/pagination/page-item-step.js +1 -1
  430. package/es/pagination/page-item.js +1 -1
  431. package/es/pagination/page-jumper.js +1 -1
  432. package/es/pagination/page-jumper.vue.d.ts +6 -6
  433. package/es/pagination/page-options.js +1 -1
  434. package/es/pagination/page-options.vue.d.ts +647 -469
  435. package/es/pagination/style/index.css +21 -21
  436. package/es/popconfirm/index.d.ts +33 -33
  437. package/es/popconfirm/popconfirm.js +1 -1
  438. package/es/popconfirm/popconfirm.vue.d.ts +16 -16
  439. package/es/popconfirm/popconfirm.vue_vue_type_script_lang.js +1 -1
  440. package/es/popconfirm/style/index.css +11 -11
  441. package/es/popover/index.d.ts +899 -21
  442. package/es/popover/popover.js +7 -3
  443. package/es/popover/popover.vue.d.ts +451 -10
  444. package/es/popover/popover.vue_vue_type_script_lang.js +15 -3
  445. package/es/popover/style/index.css +7 -7
  446. package/es/popover/style/index.d.ts +1 -0
  447. package/es/progress/circle.js +1 -1
  448. package/es/progress/circle.vue.d.ts +1 -1
  449. package/es/progress/index.d.ts +7 -7
  450. package/es/progress/line.js +1 -1
  451. package/es/progress/line.vue.d.ts +1 -1
  452. package/es/progress/line.vue_vue_type_script_lang.js +1 -1
  453. package/es/progress/progress.js +1 -1
  454. package/es/progress/progress.vue.d.ts +3 -3
  455. package/es/progress/steps.js +1 -1
  456. package/es/progress/style/index.css +32 -32
  457. package/es/qr-code/index.d.ts +294 -0
  458. package/es/qr-code/index.js +10 -0
  459. package/es/qr-code/qr-code-status.js +5 -0
  460. package/es/qr-code/qr-code-status.vue.d.ts +8 -0
  461. package/es/qr-code/qr-code-status.vue_vue_type_script_setup_true_lang.js +30 -0
  462. package/es/qr-code/qr-code.js +5 -0
  463. package/es/qr-code/qr-code.vue.d.ts +167 -0
  464. package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +313 -0
  465. package/es/qr-code/style/css.js +2 -0
  466. package/es/qr-code/style/index.css +106 -0
  467. package/es/qr-code/style/index.d.ts +2 -0
  468. package/es/qr-code/style/index.js +2 -0
  469. package/es/qr-code/style/index.scss +111 -0
  470. package/es/qr-code/style/token.scss +36 -0
  471. package/es/qr-code/types.d.ts +19 -0
  472. package/es/radio/index.d.ts +5 -5
  473. package/es/radio/radio.d.ts +2 -2
  474. package/es/radio/style/index.css +33 -33
  475. package/es/rate/index.d.ts +3 -3
  476. package/es/rate/rate.d.ts +1 -1
  477. package/es/rate/style/index.css +3 -3
  478. package/es/resize-box/index.d.ts +6 -6
  479. package/es/resize-box/resize-box.js +1 -1
  480. package/es/resize-box/resize-box.vue.d.ts +2 -2
  481. package/es/resize-box/resize-box.vue_vue_type_script_lang.js +1 -1
  482. package/es/resize-box/style/index.css +2 -2
  483. package/es/result/result.js +1 -1
  484. package/es/result/style/index.css +2 -2
  485. package/es/scrollbar/index.d.ts +6 -3
  486. package/es/scrollbar/scrollbar.js +2 -1
  487. package/es/scrollbar/scrollbar.vue.d.ts +2 -1
  488. package/es/scrollbar/scrollbar.vue_vue_type_script_lang.js +52 -2
  489. package/es/scrollbar/style/index.css +13 -13
  490. package/es/sd-vue.js +13 -12
  491. package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +3 -3
  492. package/es/secret/style/index.css +4 -4
  493. package/es/select/context.d.ts +1 -4
  494. package/es/select/hooks/use-options.d.ts +1 -4
  495. package/es/select/hooks/use-options.js +2 -23
  496. package/es/select/hooks/use-select.d.ts +1 -3
  497. package/es/select/hooks/use-select.js +2 -7
  498. package/es/select/index.d.ts +647 -474
  499. package/es/select/index.js +5 -13
  500. package/es/select/interface.d.ts +1 -1
  501. package/es/select/select-dropdown.js +3 -2
  502. package/es/select/select-dropdown.vue.d.ts +56 -54
  503. package/es/select/select-dropdown.vue_vue_type_script_lang.js +2 -3
  504. package/es/select/select.d.ts +260 -18
  505. package/es/select/select.js +44 -23
  506. package/es/select/style/index.css +14 -14
  507. package/es/select/utils.d.ts +1 -1
  508. package/es/select/utils.js +1 -1
  509. package/es/skeleton/line.js +1 -1
  510. package/es/skeleton/shape.js +1 -1
  511. package/es/skeleton/skeleton.js +1 -1
  512. package/es/skeleton/style/index.css +4 -4
  513. package/es/slider/index.d.ts +67 -67
  514. package/es/slider/slider-button.js +1 -1
  515. package/es/slider/slider-button.vue.d.ts +25 -25
  516. package/es/slider/slider-dots.js +1 -1
  517. package/es/slider/slider-input.js +1 -1
  518. package/es/slider/slider-input.vue.d.ts +7 -7
  519. package/es/slider/slider-marks.js +1 -1
  520. package/es/slider/slider-ticks.js +1 -1
  521. package/es/slider/slider.js +1 -1
  522. package/es/slider/slider.vue.d.ts +33 -33
  523. package/es/slider/style/index.css +18 -18
  524. package/es/space/index.d.ts +9 -9
  525. package/es/space/space.d.ts +2 -2
  526. package/es/spin/index.d.ts +1 -0
  527. package/es/spin/style/index.css +9 -9
  528. package/es/split/split.js +1 -1
  529. package/es/split/split.vue_vue_type_script_lang.js +1 -1
  530. package/es/split/style/index.css +2 -2
  531. package/es/statistic/countdown.js +1 -1
  532. package/es/statistic/countdown.vue.d.ts +1 -1
  533. package/es/statistic/countdown.vue_vue_type_script_lang.js +5 -5
  534. package/es/statistic/index.d.ts +1 -1
  535. package/es/statistic/statistic.js +1 -1
  536. package/es/statistic/statistic.vue_vue_type_script_lang.js +2 -2
  537. package/es/statistic/style/index.css +4 -4
  538. package/es/steps/index.d.ts +4 -4
  539. package/es/steps/step.js +1 -1
  540. package/es/steps/step.vue.d.ts +1 -1
  541. package/es/steps/steps.js +1 -1
  542. package/es/steps/steps.vue.d.ts +1 -1
  543. package/es/steps/style/index.css +79 -79
  544. package/es/style/color/colors.scss +1 -1
  545. package/es/style/theme/global.scss +8 -8
  546. package/es/style/theme/index.scss +4 -12
  547. package/es/style/theme/z-index.js +1 -2
  548. package/es/switch/style/index.css +30 -30
  549. package/es/switch/switch.js +1 -1
  550. package/es/switch/switch.vue_vue_type_script_lang.js +1 -1
  551. package/es/table/index.d.ts +14 -14
  552. package/es/table/style/index.css +65 -65
  553. package/es/table/table-operation-td.d.ts +7 -7
  554. package/es/table/table-operation-td.js +1 -1
  555. package/es/table/table-operation-th.js +1 -1
  556. package/es/table/table-td.d.ts +1 -1
  557. package/es/table/table-td.js +1 -1
  558. package/es/table/table-th.d.ts +1 -1
  559. package/es/table/table-th.js +2 -2
  560. package/es/table/table.d.ts +5 -5
  561. package/es/table/table.js +12 -14
  562. package/es/table/utils.js +1 -1
  563. package/es/tabs/index.d.ts +9 -9
  564. package/es/tabs/style/index.css +56 -56
  565. package/es/tabs/tab-pane.js +1 -1
  566. package/es/tabs/tab-pane.vue_vue_type_script_lang.js +1 -1
  567. package/es/tabs/tabs-nav-ink.js +1 -1
  568. package/es/tabs/tabs-nav.d.ts +1 -1
  569. package/es/tabs/tabs-tab.js +1 -1
  570. package/es/tabs/tabs-tab.vue.d.ts +1 -1
  571. package/es/tabs/tabs.d.ts +3 -3
  572. package/es/tag/index.d.ts +66 -29688
  573. package/es/tag/interface.d.ts +2 -0
  574. package/es/tag/style/index.css +134 -134
  575. package/es/tag/style/index.scss +33 -13
  576. package/es/tag/tag.js +2 -64
  577. package/es/tag/tag.vue.d.ts +53 -11936
  578. package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +368 -0
  579. package/es/tag-group/tag-group.vue_vue_type_script_setup_true_lang.js +4 -4
  580. package/es/textarea/index.d.ts +8 -8
  581. package/es/textarea/style/index.css +28 -28
  582. package/es/textarea/textarea.js +1 -1
  583. package/es/textarea/textarea.vue.d.ts +3 -3
  584. package/es/textarea/textarea.vue_vue_type_script_lang.js +1 -1
  585. package/es/time-picker/hooks/use-time-list.js +1 -1
  586. package/es/time-picker/index.d.ts +56 -56
  587. package/es/time-picker/panel.js +1 -1
  588. package/es/time-picker/panel.vue.d.ts +6 -6
  589. package/es/time-picker/range-panel.d.ts +6 -6
  590. package/es/time-picker/range-panel.js +1 -1
  591. package/es/time-picker/style/index.css +11 -11
  592. package/es/time-picker/time-column.js +1 -1
  593. package/es/time-picker/time-picker.js +2 -2
  594. package/es/time-picker/time-picker.vue.d.ts +27 -27
  595. package/es/timeline/item.js +1 -1
  596. package/es/timeline/item.vue_vue_type_script_lang.js +1 -1
  597. package/es/timeline/style/index.css +11 -11
  598. package/es/tooltip/index.d.ts +24 -24
  599. package/es/tooltip/style/index.css +3 -3
  600. package/es/tooltip/tooltip.js +1 -1
  601. package/es/tooltip/tooltip.vue.d.ts +11 -11
  602. package/es/tooltip/tooltip.vue_vue_type_script_lang.js +1 -1
  603. package/es/tour/index.d.ts +664 -0
  604. package/es/tour/index.js +10 -0
  605. package/es/tour/style/css.js +1 -0
  606. package/es/tour/style/index.css +226 -0
  607. package/es/tour/style/index.d.ts +1 -0
  608. package/es/tour/style/index.js +1 -0
  609. package/es/tour/style/index.scss +218 -0
  610. package/es/tour/style/token.scss +27 -0
  611. package/es/tour/tour.js +5 -0
  612. package/es/tour/tour.vue.d.ts +411 -0
  613. package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +1219 -0
  614. package/es/tour/types.d.ts +143 -0
  615. package/es/transfer/index.d.ts +51 -45
  616. package/es/transfer/style/index.css +20 -20
  617. package/es/transfer/transfer-view.js +2 -3
  618. package/es/transfer/transfer-view.vue.d.ts +18 -15
  619. package/es/transfer/transfer-view.vue_vue_type_script_lang.js +1 -1
  620. package/es/transfer/transfer.js +1 -1
  621. package/es/transfer/transfer.vue.d.ts +25 -22
  622. package/es/tree/base-node.js +1 -1
  623. package/es/tree/base-node.vue.d.ts +2 -2
  624. package/es/tree/expand-transition.js +1 -1
  625. package/es/tree/node.js +1 -1
  626. package/es/tree/style/index.css +25 -25
  627. package/es/tree/transition-node-list.js +1 -1
  628. package/es/tree/transition-node-list.vue.d.ts +2 -2
  629. package/es/tree/tree.js +1 -1
  630. package/es/tree/tree.vue.d.ts +12 -9
  631. package/es/tree/tree.vue_vue_type_script_lang.js +2 -2
  632. package/es/tree/utils/tree-data.js +1 -1
  633. package/es/tree-select/hooks/use-selected-state.js +1 -1
  634. package/es/tree-select/panel.js +4 -7
  635. package/es/tree-select/style/index.css +5 -5
  636. package/es/tree-select/tree-select.js +2 -2
  637. package/es/tree-select/tree-select.vue.d.ts +21 -21
  638. package/es/tree-select/tree-select.vue_vue_type_script_lang.js +1 -1
  639. package/es/trigger/index.d.ts +9 -9
  640. package/es/trigger/style/index.css +5 -5
  641. package/es/trigger/trigger.d.ts +3 -3
  642. package/es/trigger/trigger.js +1 -1
  643. package/es/trigger/utils.js +1 -1
  644. package/es/typography/base.d.ts +4 -4
  645. package/es/typography/base.js +1 -1
  646. package/es/typography/edit-content.js +1 -1
  647. package/es/typography/edit-content.vue.d.ts +28 -28
  648. package/es/typography/operations.js +1 -1
  649. package/es/typography/operations.vue.d.ts +24 -24
  650. package/es/typography/style/index.css +22 -22
  651. package/es/typography/typography.js +1 -1
  652. package/es/upload/index.d.ts +6 -6
  653. package/es/upload/style/index.css +51 -51
  654. package/es/upload/upload-button.d.ts +1 -1
  655. package/es/upload/upload.d.ts +2 -2
  656. package/es/upload/upload.js +2 -2
  657. package/es/verification-code/index.d.ts +3 -3
  658. package/es/verification-code/verification-code.d.ts +1 -1
  659. package/es/watermark/hooks/use-mutation-observer.js +1 -1
  660. package/es/watermark/watermark.js +1 -1
  661. package/json/vetur-attributes.json +125 -107
  662. package/json/vetur-tags.json +39 -36
  663. package/json/web-types.json +181 -162
  664. package/package.json +19 -15
  665. package/es/calendar/calendar.d.ts +0 -104
  666. package/es/calendar/calendar.js +0 -207
  667. package/es/calendar/header.d.ts +0 -104
  668. package/es/calendar/header.js +0 -131
  669. package/es/calendar/hooks/useCellClassName.d.ts +0 -19
  670. package/es/calendar/hooks/useCellClassName.js +0 -43
  671. package/es/calendar/month.d.ts +0 -83
  672. package/es/calendar/month.js +0 -149
  673. package/es/calendar/week.d.ts +0 -61
  674. package/es/calendar/week.js +0 -45
  675. package/es/calendar/year.d.ts +0 -69
  676. package/es/calendar/year.js +0 -101
  677. package/es/select/optgroup.js +0 -10
  678. package/es/select/optgroup.vue.d.ts +0 -13
  679. package/es/select/optgroup.vue_vue_type_script_lang.js +0 -23
  680. package/es/select/option.js +0 -51
  681. package/es/select/option.vue.d.ts +0 -299
  682. package/es/select/option.vue_vue_type_script_lang.js +0 -149
  683. package/es/tag/tag.vue_vue_type_script_lang.js +0 -264
@@ -0,0 +1,761 @@
1
+ import { ref, computed, watch, onBeforeUnmount, nextTick, reactive } from 'vue';
2
+
3
+ import { minutesToPercentage } from '../utils/conversions';
4
+
5
+ export const useView = (
6
+ { config, dateUtils, emit, texts, eventsManager },
7
+ calendarEl,
8
+ scrollbarRef,
9
+ ) => {
10
+ const { availableViews } = config;
11
+ const viewId = ref(config.view && availableViews[config.view] ? config.view : config.defaultView);
12
+ const selectedDate = ref(config.selectedDate || null);
13
+
14
+ // Dates.
15
+ // ------------------------------------------------------
16
+ // Preset at now date on load, but updated every minute if watchRealTime,
17
+ // or updated at least on each cells rerender, in order to keep Today's date accurate.
18
+ const now = ref(new Date());
19
+
20
+ // The view date is the one given in prop. It can be any date within the view that will be
21
+ // computed around it - not necessarily the first day of the view range.
22
+ // E.g. [start, ..., viewDate, ..., end]
23
+ const viewDate = ref(new Date(config.viewDate || now.value));
24
+ viewDate.value.setHours(0, 0, 0, 0);
25
+ // The starting point of all the calculations.
26
+ // on created and on navigation, two date ranges are computed:
27
+ // [start-end]: the common date range to use.
28
+ // [firstCellDate-endCellDate]: the full visible range including out-of-scope days in month view.
29
+ const startTheoretical = ref(new Date(viewDate));
30
+
31
+ // For the now line when watchRealTime is true. 2 timeouts: 1 to snap to round minutes, then 1 every minute.
32
+ let timeTickerId = null;
33
+
34
+ const start = computed(() => {
35
+ if (viewId.value === 'month') return startTheoretical.value;
36
+ return firstCellDate.value;
37
+ });
38
+ const end = computed(() => {
39
+ if (viewId.value === 'month')
40
+ return new Date(
41
+ startTheoretical.value.getFullYear(),
42
+ startTheoretical.value.getMonth() + 1,
43
+ 0,
44
+ 23,
45
+ 59,
46
+ 59,
47
+ 999,
48
+ );
49
+ return lastCellDate.value;
50
+ });
51
+
52
+ const extendedStart = computed(() => {
53
+ if (viewId.value === 'week')
54
+ return dateUtils.getPreviousFirstDayOfWeek(firstCellDate.value, config.startWeekOnSunday);
55
+ if (viewId.value === 'month') return firstCellDate.value;
56
+ return start.value;
57
+ });
58
+ const extendedEnd = computed(() => {
59
+ if (viewId.value === 'week') {
60
+ const endWeek = dateUtils.addDays(extendedStart.value, 7);
61
+ endWeek.setMilliseconds(-1);
62
+ return endWeek;
63
+ }
64
+ if (viewId.value === 'month') return lastCellDate.value;
65
+ return end.value;
66
+ });
67
+
68
+ const containsToday = computed(() => {
69
+ const nowTime = now.value.getTime();
70
+
71
+ if (viewId.value === 'week') {
72
+ return extendedStart.value.getTime() <= nowTime && nowTime <= extendedEnd.value.getTime();
73
+ }
74
+
75
+ const firstCellTime = firstCellDate.value.getTime();
76
+ const lastCellTime = lastCellDate.value.getTime();
77
+ return firstCellTime <= nowTime && nowTime <= lastCellTime;
78
+ });
79
+
80
+ // Draw a line in today's cell at the exact current time.
81
+ // Also used in the time column if the option is enabled.
82
+ const nowLine = reactive({
83
+ show: computed(() => {
84
+ if (!['day', 'days', 'week'].includes(viewId.value)) return;
85
+ if (!containsToday.value || !config.time || config.allDay) return;
86
+ if (config.timeFrom > dateUtils.dateToMinutes(now.value)) return;
87
+ if (dateUtils.dateToMinutes(now.value) > config.timeTo) return;
88
+
89
+ return true;
90
+ }),
91
+ nowInMinutes: computed(() => dateUtils.dateToMinutes(now.value)),
92
+ todaysTimePosition: computed(() => minutesToPercentage(nowLine.nowInMinutes, config)),
93
+ style: computed(() => `${config.horizontal ? 'left' : 'top'}: ${nowLine.todaysTimePosition}%`),
94
+ currentTime: computed(() =>
95
+ dateUtils.formatTime(now.value, config.twelveHour ? 'h:mm {am}' : 'HH:mm'),
96
+ ),
97
+ });
98
+
99
+ /**
100
+ * Only if watchRealTime is true.
101
+ * Pull the current time from user machine every minute to keep cal accurate even when idle.
102
+ * This will redraw the now line every minute and ensure that Today's date is always accurate.
103
+ */
104
+ function timeTick() {
105
+ // Updating `now` will re-trigger the computed `todaysTimePosition` in cell.vue.
106
+ now.value = new Date();
107
+ timeTickerId = setTimeout(timeTick, 60 * 1000); // Every minute.
108
+ }
109
+
110
+ function initTimeTicker() {
111
+ // Snap the time ticker on round minutes (when seconds = 0), so that we can set
112
+ // the time ticker interval to 60 seconds and spare some function calls.
113
+ timeTickerId = setTimeout(timeTick, (60 - new Date().getSeconds()) * 1000);
114
+
115
+ timeTick();
116
+ }
117
+ // ------------------------------------------------------
118
+
119
+ // Cells.
120
+ // ------------------------------------------------------
121
+ const cols = computed(() => {
122
+ // When switching to date-picker from week view, the first computation is done before the
123
+ // availableViews object is updated, so we need to check if the view is available.
124
+ if (!config.availableViews[viewId.value]) return 1;
125
+
126
+ // Includes all the weekdays, but some may need to be hidden.
127
+ let cols = config.availableViews[viewId.value].cols;
128
+ // In Week and month views only, the grid rows must be decreased from 7 to `7 - all hidden weekdays`.
129
+ if (config.hasHiddenDays && ['week', 'month'].includes(viewId.value))
130
+ cols -= config.hasHiddenDays;
131
+ return cols;
132
+ });
133
+ const rows = computed(() => config.availableViews[viewId.value]?.rows || 1);
134
+
135
+ // Create as many grid cells as defined in the availableViews map (cols * rows).
136
+ const cellsCount = computed(() => cols.value * rows.value);
137
+
138
+ const firstCellDate = computed(() => {
139
+ if (viewId.value === 'month') {
140
+ // By default, the month view has 6 rows of 7 days. If the first day of the month is not
141
+ // a Monday (or Sunday if startWeekOnSunday), then pad the preceding cells with days from the
142
+ // previous month. E.g.
143
+ // M T W T F S S
144
+ // 28 29 30 1 2 3 4
145
+ let weekday = startTheoretical.value.getDay() || 7; // 1-7, starting from Monday.
146
+
147
+ if (config.startWeekOnSunday && !config.hideWeekdays[7]) weekday += 1;
148
+ if (config.viewDayOffset) weekday -= config.viewDayOffset;
149
+ return dateUtils.subtractDays(startTheoretical.value, weekday - 1);
150
+ }
151
+ if (viewId.value === 'week') {
152
+ const visibleDays = '1234567'
153
+ .split('')
154
+ .filter((day) => !Object.keys(config.hideWeekdays).includes(day));
155
+ let firstVisibleDay = Math.min(...visibleDays);
156
+ if (config.startWeekOnSunday && !config.hideWeekdays[7]) firstVisibleDay = 1;
157
+ if (config.viewDayOffset) firstVisibleDay += config.viewDayOffset;
158
+
159
+ return dateUtils.addDays(startTheoretical.value, firstVisibleDay - 1);
160
+ }
161
+
162
+ return startTheoretical.value;
163
+ });
164
+
165
+ // Generates an array of dates for each cell in the view: 1 cell = 1 date range [start, end].
166
+ // IMPORTANT NOTES:
167
+ // - Better performance here than in each cell.
168
+ // - This computed should only manage pure dates: no text, no event, nothing likely to be
169
+ // triggering recomputing due to a change in the reactivity chain.
170
+ // Every recomputing can become very expensive when handling a large amount of cells per view
171
+ // with a large amount of calendar events.
172
+ const cellDates = computed(() => {
173
+ const dates = [];
174
+ const isDaysWeekOrMonthView = ['days', 'week', 'month'].includes(viewId.value);
175
+
176
+ // Every time a weekday is removed from the generated array of cells dates, this modifier is
177
+ // incremented so we always keep the number of cells specified in the availableViews object if the
178
+ // view is days, or month.
179
+ let modifier = 0;
180
+
181
+ for (let i = 0; i < cellsCount.value + modifier; i++) {
182
+ switch (viewId.value) {
183
+ case 'day':
184
+ case 'days':
185
+ case 'week':
186
+ case 'month': {
187
+ const start = dateUtils.addDays(firstCellDate.value, i);
188
+ const weekday = start.getDay() || 7; // 1-7, starting from Monday.
189
+
190
+ // If hiding specific weekday or weekend and the current cell is one of these hidden days skip
191
+ // it and add one more date at the end to fill up the cells.
192
+ if (isDaysWeekOrMonthView && config.hasHiddenDays && config.hideWeekdays[weekday]) {
193
+ modifier++;
194
+ continue;
195
+ }
196
+
197
+ const end = new Date(start);
198
+ end.setHours(23, 59, 59, 999);
199
+ dates.push({ start, startFormatted: dateUtils.formatDate(start), end });
200
+ break;
201
+ }
202
+ case 'year':
203
+ dates.push({
204
+ start: new Date(firstCellDate.value.getFullYear(), i, 1, 0, 0, 0, 0),
205
+ end: new Date(firstCellDate.value.getFullYear(), i + 1, 0, 23, 59, 59, 999),
206
+ });
207
+ break;
208
+ case 'years':
209
+ dates.push({
210
+ start: new Date(firstCellDate.value.getFullYear() + i, 0, 1, 0, 0, 0, 0),
211
+ end: new Date(firstCellDate.value.getFullYear() + i + 1, 0, 0, 23, 59, 59, 999),
212
+ });
213
+ break;
214
+ }
215
+ }
216
+
217
+ return dates;
218
+ });
219
+
220
+ const lastCellDate = computed(() => cellDates.value[cellDates.value.length - 1].end);
221
+ // ------------------------------------------------------
222
+
223
+ // Navigation.
224
+ // ------------------------------------------------------
225
+ // Transition when switching view. Left when going toward the past, right when going toward future.
226
+ const transitionDirection = ref('right');
227
+
228
+ /**
229
+ * {String|undefined} The next available broader view from the current view.
230
+ */
231
+ const broaderView = computed(() => {
232
+ const availableViews = Object.keys(config.availableViews);
233
+ return availableViews[availableViews.indexOf(viewId.value) + 1];
234
+ });
235
+
236
+ /**
237
+ * {String|undefined} The next available narrower view from the current view.
238
+ */
239
+ const narrowerView = computed(() => {
240
+ const availableViews = Object.keys(config.availableViews);
241
+ return availableViews[availableViews.indexOf(viewId.value) - 1];
242
+ });
243
+
244
+ /**
245
+ * Gets a month name with optional truncation.
246
+ *
247
+ * @param {number} monthIndex - The 0-based month index.
248
+ * @param {Array} monthsArray - Array of month names.
249
+ * @param {boolean} shouldTruncate - Whether to truncate the month name.
250
+ * @returns {string} The formatted month name.
251
+ */
252
+ function getMonthName(monthIndex, monthsArray, shouldTruncate = false) {
253
+ if (!monthsArray || !monthsArray[monthIndex]) return monthIndex + 1; // Numeric fallback.
254
+
255
+ const name = monthsArray[monthIndex];
256
+ return shouldTruncate && typeof name === 'string' ? name.substring(0, 3) : name;
257
+ }
258
+
259
+ /**
260
+ * Formats a date range between two dates.
261
+ *
262
+ * @param {Date} start - The start date.
263
+ * @param {Date} end - The end date.
264
+ * @param {Object} options - Formatting options.
265
+ * @returns {string} The formatted date range.
266
+ */
267
+ function formatDateRange(start, end, options) {
268
+ const { monthsArray, monthBeforeDay, canTruncate, xs } = options;
269
+
270
+ const startMonth = start.getMonth();
271
+ const startYear = start.getFullYear();
272
+ const endMonth = end.getMonth();
273
+ const endYear = end.getFullYear();
274
+ const crossingMonth = startMonth !== endMonth;
275
+ const crossingYear = startYear !== endYear;
276
+
277
+ // Should we truncate month names?.
278
+ const shouldTruncate = canTruncate && (xs || crossingMonth);
279
+
280
+ // Get day numbers directly.
281
+ const startDay = start.getDate();
282
+ const endDay = end.getDate();
283
+
284
+ if (crossingYear) {
285
+ // Different years.
286
+ if (monthBeforeDay)
287
+ return `${getMonthName(startMonth, monthsArray, shouldTruncate)} ${startDay}, ${startYear} - ${getMonthName(endMonth, monthsArray, shouldTruncate)} ${endDay}, ${endYear}`;
288
+ return `${startDay} ${getMonthName(startMonth, monthsArray, shouldTruncate)} ${startYear} - ${endDay} ${getMonthName(endMonth, monthsArray, shouldTruncate)} ${endYear}`;
289
+ }
290
+ if (crossingMonth) {
291
+ // Same year, different months.
292
+ if (monthBeforeDay)
293
+ return `${getMonthName(startMonth, monthsArray, shouldTruncate)} ${startDay} - ${getMonthName(endMonth, monthsArray, shouldTruncate)} ${endDay}, ${startYear}`;
294
+ return `${startDay} ${getMonthName(startMonth, monthsArray, shouldTruncate)} - ${endDay} ${getMonthName(endMonth, monthsArray, shouldTruncate)} ${startYear}`;
295
+ }
296
+ // Same month and year.
297
+ if (monthBeforeDay)
298
+ return `${getMonthName(startMonth, monthsArray, shouldTruncate)} ${startDay}-${endDay}, ${startYear}`;
299
+ return `${startDay}-${endDay} ${getMonthName(startMonth, monthsArray, shouldTruncate)} ${startYear}`;
300
+ }
301
+
302
+ const titleWeekInfo = computed(() => {
303
+ if (viewId.value !== 'week') return null;
304
+ const weekNumber = dateUtils.getWeek(
305
+ firstCellDate.value,
306
+ config.startWeekOnSunday && !config.hideWeekdays[7],
307
+ );
308
+ return { text: texts.week, number: weekNumber };
309
+ });
310
+
311
+ const title = computed(() => {
312
+ const { dateFormat, months, monthsGenitive, week: weekText, truncations } = texts;
313
+ const locale = config.locale;
314
+ const canTruncate = truncations !== false;
315
+
316
+ // Determine date format style (month-first or day-first).
317
+ const monthBeforeDay = dateFormat.indexOf('M') < dateFormat.indexOf('D');
318
+
319
+ // Use genitive case for Greek if available and appropriate.
320
+ const monthsArray = monthsGenitive && locale === 'el' ? monthsGenitive : months;
321
+
322
+ switch (viewId.value) {
323
+ case 'day':
324
+ return dateUtils.formatDate(firstCellDate.value, dateFormat);
325
+
326
+ case 'days':
327
+ case 'week': {
328
+ const options = {
329
+ monthsArray,
330
+ monthBeforeDay,
331
+ canTruncate,
332
+ xs: config.xs,
333
+ };
334
+
335
+ return formatDateRange(firstCellDate.value, lastCellDate.value, options);
336
+ }
337
+
338
+ case 'month': {
339
+ // Shorten month if xs and the locale doesn't forbid it.
340
+ const format = `${config.xs && canTruncate ? 'MMM' : 'MMMM'} YYYY`;
341
+ return dateUtils.formatDate(start.value, format);
342
+ }
343
+
344
+ case 'year':
345
+ return firstCellDate.value.getFullYear();
346
+
347
+ case 'years':
348
+ return `${firstCellDate.value.getFullYear()} - ${end.value.getFullYear()}`;
349
+ }
350
+ });
351
+
352
+ /**
353
+ * This function is called after each view variable update and will recompute the theoretical view
354
+ * [start-end] date range.
355
+ * `startTheoretical` is updated
356
+ * > triggers a recomputation of `firstCellDate`
357
+ * > triggers a recomputation of `cellDates`
358
+ * > triggers a recomputation of `events`.
359
+ * The practical view date range may differ when hiding weekdays, or on month view due to out of
360
+ * scope dates.
361
+ */
362
+ async function updateView() {
363
+ startTheoretical.value = new Date(viewDate.value || now.value);
364
+ startTheoretical.value.setHours(0, 0, 0, 0);
365
+
366
+ switch (viewId.value) {
367
+ case 'day':
368
+ break;
369
+ case 'days':
370
+ break;
371
+ case 'week':
372
+ startTheoretical.value = dateUtils.getPreviousFirstDayOfWeek(
373
+ startTheoretical.value,
374
+ config.startWeekOnSunday && !config.hideWeekdays[7],
375
+ );
376
+ break;
377
+ case 'month':
378
+ startTheoretical.value = new Date(
379
+ startTheoretical.value.getFullYear(),
380
+ startTheoretical.value.getMonth(),
381
+ 1,
382
+ 0,
383
+ 0,
384
+ 0,
385
+ 0,
386
+ );
387
+ break;
388
+ case 'year':
389
+ startTheoretical.value = new Date(startTheoretical.value.getFullYear(), 0, 1, 0, 0, 0, 0);
390
+ break;
391
+ case 'years':
392
+ // The modulo is only here to always cut off at the same years regardless of the current year.
393
+ // E.g. always [1975-1999], [2000-2024], [2025-2099] for the default 5*5 grid.
394
+ startTheoretical.value = new Date(
395
+ startTheoretical.value.getFullYear() -
396
+ (startTheoretical.value.getFullYear() % cellsCount.value),
397
+ 0,
398
+ 1,
399
+ 0,
400
+ 0,
401
+ 0,
402
+ 0,
403
+ );
404
+ break;
405
+ }
406
+
407
+ // Updating `now` will re-trigger the computed `todaysTimePosition` in cell.vue.
408
+ // Does not cost much to update when not watching real time as it is only computed when the view
409
+ // is updated.
410
+ now.value = new Date();
411
+
412
+ if (config.ready) {
413
+ // Use nextTick to emit after the current update cycle is complete,
414
+ // to ensure all computed values are up to date and to prevent cascading updates.
415
+ await nextTick();
416
+ emit('view-change', {
417
+ id: viewId.value,
418
+ title: title.value,
419
+ start: start.value,
420
+ end: end.value,
421
+ extendedStart: extendedStart.value,
422
+ extendedEnd: extendedEnd.value,
423
+ cellDates: cellDates.value,
424
+ containsToday: containsToday.value,
425
+ events: events.value,
426
+ });
427
+ }
428
+ }
429
+
430
+ /**
431
+ * Only call the updateView function (which redraws the cells) if the current view changes.
432
+ *
433
+ * @param {Object} views the new available views object.
434
+ */
435
+ function updateViewIfNeeded(views) {
436
+ const currView = viewId.value;
437
+ const currViewLayout = config.availableViews[currView]; // cols * rows.
438
+ if (!(views[currView] && JSON.stringify(views[currView]) === JSON.stringify(currViewLayout))) {
439
+ updateView();
440
+ }
441
+ }
442
+
443
+ function switchView(id, emitUpdate = true, date = null) {
444
+ const availableViews = Object.keys(config.availableViews);
445
+
446
+ if (viewId.value === id && !date) return;
447
+ if (availableViews.includes(id)) {
448
+ transitionDirection.value =
449
+ availableViews.indexOf(id) < availableViews.indexOf(viewId.value) ? 'left' : 'right';
450
+
451
+ if (emitUpdate && viewId.value !== id) emit('update:view', id); // Emit the view change only if the view is actually changing.
452
+ viewId.value = id;
453
+ if (date)
454
+ updateViewDate(date); // Then calls updateView().
455
+ else updateView();
456
+ } else !!console.warn(`Calendar: the \`${id}\` view is not available.`);
457
+ }
458
+
459
+ function switchToBroaderView() {
460
+ if (broaderView.value) switchView(broaderView.value);
461
+ else console.warn('Calendar: no broader view is available.');
462
+ }
463
+
464
+ function switchToNarrowerView() {
465
+ if (narrowerView.value) switchView(narrowerView.value);
466
+ else console.warn('Calendar: no narrower view is available.');
467
+ }
468
+
469
+ function previous() {
470
+ navigate(false);
471
+ }
472
+
473
+ function next() {
474
+ navigate(true);
475
+ }
476
+
477
+ /**
478
+ * Navigate to the next or previous similar view.
479
+ *
480
+ * @param {bool} forward
481
+ */
482
+ function navigate(forward = true) {
483
+ let newViewDate = new Date(viewDate.value);
484
+
485
+ switch (viewId.value) {
486
+ case 'day':
487
+ case 'days':
488
+ // In days view, hiding weekdays will extend the date range of as many skipped days, so
489
+ // navigating to the next range should take in account the last calculated cell date.
490
+ if (forward) newViewDate = dateUtils.addDays(lastCellDate.value, 1);
491
+ else newViewDate = dateUtils.subtractDays(firstCellDate.value, cellsCount.value);
492
+ break;
493
+ case 'week': {
494
+ if (forward) {
495
+ // Advance by one calendar week from the first visible cell (not extendedEnd + 1).
496
+ // When weekends are hidden and the week starts on Sunday, extendedEnd + 1 can land on a
497
+ // hidden Sunday; updateView then snaps back to the same week (#67).
498
+ newViewDate = dateUtils.addDays(firstCellDate.value, 7);
499
+ newViewDate.setHours(0, 0, 0, 0);
500
+ } else newViewDate = dateUtils.subtractDays(extendedStart.value, cellsCount.value);
501
+ break;
502
+ }
503
+ case 'month': {
504
+ const increment = forward ? 1 : -1;
505
+ newViewDate = new Date(
506
+ newViewDate.getFullYear(),
507
+ newViewDate.getMonth() + increment,
508
+ 1,
509
+ 0,
510
+ 0,
511
+ 0,
512
+ 0,
513
+ );
514
+ break;
515
+ }
516
+ case 'year': {
517
+ const increment = forward ? 1 : -1;
518
+ newViewDate = new Date(newViewDate.getFullYear() + increment, 1, 1, 0, 0, 0, 0);
519
+ break;
520
+ }
521
+ case 'years': {
522
+ const increment = forward ? cellsCount.value : -cellsCount.value;
523
+ newViewDate = new Date(newViewDate.getFullYear() + increment, 1, 1, 0, 0, 0, 0);
524
+ break;
525
+ }
526
+ }
527
+
528
+ updateViewDate(newViewDate);
529
+ }
530
+
531
+ function goToToday() {
532
+ const today = new Date();
533
+ today.setHours(0, 0, 0, 0);
534
+ updateViewDate(today);
535
+ }
536
+
537
+ /**
538
+ * Takes the view to a given date.
539
+ * If the date is already in the view range, nothing will
540
+ * happen, unless the forceUpdate bool is set to true. For instance, when switching the
541
+ * startWeekOnSunday, we want to update the view and force the first day of the view to
542
+ * switch between Sunday and Monday, even if it may already be in view.
543
+ *
544
+ * @param {Date} date the new Date to bring to the view.
545
+ * @param {Boolean} emitUpdate emits the update:viewDate event (not wanted from watcher)
546
+ * @param {Boolean} forceUpdate By default if the date is in view range, nothing happens.
547
+ * @returns void
548
+ */
549
+ function updateViewDate(date, emitUpdate = true, forceUpdate = false) {
550
+ if (!dateUtils.isValid(date))
551
+ return console.warn(
552
+ "Calendar: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.",
553
+ );
554
+
555
+ // Before checking if the date is in view range, use the firstCellDate and lastCellDate unless on month view
556
+ // (where we still want to navigate when clicking a cell that is out of range).
557
+ let [viewStart, viewEnd] = [firstCellDate.value, lastCellDate.value];
558
+ if (viewId.value === 'month') [viewStart, viewEnd] = [start.value, end.value];
559
+
560
+ date.setHours(0, 0, 0, 0);
561
+ // Always update viewDate so that switching to a narrower view (e.g. month → day) after setting
562
+ // a specific date within the current range correctly lands on that date. Only skip the expensive
563
+ // cell recomputation (updateView) when the date is already in range and no force is requested.
564
+ viewDate.value = date;
565
+ if (emitUpdate) emit('update:viewDate', date);
566
+
567
+ if (!dateUtils.isInRange(date, viewStart, viewEnd) || forceUpdate) {
568
+ transitionDirection.value = date.getTime() < viewStart.getTime() ? 'left' : 'right';
569
+ updateView();
570
+ }
571
+ }
572
+
573
+ function updateSelectedDate(date, emitUpdate = true) {
574
+ if (!dateUtils.isValid(date))
575
+ return console.warn(
576
+ "Calendar: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.",
577
+ );
578
+
579
+ const { isValid, isSameDate } = dateUtils;
580
+ if (
581
+ !selectedDate.value ||
582
+ !isValid(selectedDate.value) ||
583
+ !isSameDate(date, selectedDate.value)
584
+ ) {
585
+ date.setHours(0, 0, 0, 0);
586
+ selectedDate.value = date;
587
+ if (emitUpdate) emit('update:selectedDate', date);
588
+ }
589
+ }
590
+
591
+ /**
592
+ * When switching the startWeekOnSunday prop, update the view.
593
+ *
594
+ * @param {Boolean} bool start the week on Sunday or not.
595
+ */
596
+ function switchWeekStart(bool) {
597
+ if (!bool && !startTheoretical.value.getDay())
598
+ updateViewDate(dateUtils.addDays(startTheoretical.value, 1), true, true);
599
+ else {
600
+ transitionDirection.value = 'left';
601
+ updateView();
602
+ }
603
+ }
604
+
605
+ /**
606
+ * When toggling the hideWeekends prop, update the view.
607
+ *
608
+ * @param {Boolean} hide hide weekends or not.
609
+ */
610
+ function toggleWeekends(hide) {
611
+ if (hide && config.startWeekOnSunday && !startTheoretical.value.getDay())
612
+ updateViewDate(dateUtils.addDays(startTheoretical.value, 1), true, true);
613
+ else if (!hide && config.startWeekOnSunday && startTheoretical.value.getDay() === 1)
614
+ updateViewDate(dateUtils.subtractDays(startTheoretical.value, 1), true, true);
615
+ }
616
+
617
+ /**
618
+ * When toggling weekdays, update the view.
619
+ */
620
+ function toggleWeekdays() {
621
+ updateView();
622
+ }
623
+
624
+ function scrollToTime(minutes) {
625
+ const adjustedMinutes = minutes - config.timeFrom;
626
+ const anchor =
627
+ adjustedMinutes > 0 ? (adjustedMinutes * config.timeCellHeight) / config.timeStep : 0;
628
+ scrollbarRef.value?.scrollTop(anchor);
629
+ }
630
+
631
+ function scrollToCurrentTime() {
632
+ const now = new Date();
633
+ scrollToTime(now.getHours() * 60 + now.getMinutes());
634
+ }
635
+
636
+ function scrollTop() {
637
+ scrollToTime(0);
638
+ }
639
+ // ------------------------------------------------------
640
+
641
+ // Array of IDs inside an object indexed by cell dates.
642
+ const events = computed(() => eventsManager.getViewEvents(cellDates.value));
643
+
644
+ const createEvent = eventsManager.createEvent;
645
+
646
+ const deleteEvent = eventsManager.deleteEvent;
647
+ // ------------------------------------------------------
648
+
649
+ watch(
650
+ () => config.view,
651
+ (view) => switchView(view, false),
652
+ );
653
+ watch(() => config.availableViews, updateViewIfNeeded);
654
+ watch(
655
+ () => config.datePicker,
656
+ () => switchView('month'),
657
+ );
658
+ watch(
659
+ () => config.viewDate,
660
+ (date) => updateViewDate(date, false),
661
+ );
662
+ watch(
663
+ () => config.selectedDate,
664
+ (date) => updateSelectedDate(date, false),
665
+ );
666
+ watch(
667
+ () => config.startWeekOnSunday,
668
+ (bool) => switchWeekStart(bool),
669
+ );
670
+ watch(
671
+ () => config.hideWeekends,
672
+ (bool) => toggleWeekends(bool),
673
+ );
674
+ watch(() => config.hideWeekdays, toggleWeekdays);
675
+ watch(
676
+ () => cellsCount.value,
677
+ () => {
678
+ if (cellsCount.value > 90)
679
+ console.warn(
680
+ 'Calendar: high cell count detected. Performance may degrade when interactions are enabled.',
681
+ );
682
+ },
683
+ );
684
+ watch(
685
+ () => config.watchRealTime,
686
+ (watchRealTime) => {
687
+ if (watchRealTime && config.time) initTimeTicker();
688
+ else timeTickerId = clearTimeout(timeTickerId);
689
+ },
690
+ );
691
+
692
+ updateView();
693
+
694
+ // Timers are expensive, this should only trigger on demand.
695
+ if (config.time && config.watchRealTime) initTimeTicker();
696
+
697
+ onBeforeUnmount(() => (timeTickerId = clearTimeout(timeTickerId))); // Stop the time ticker.
698
+
699
+ // ! \ IMPORTANT NOTE:
700
+ // If the selectedDate prop would be added to the view, any click on any cell (triggering an emit
701
+ // of the selectedDate), would trigger a re-rendering of all the cells of the view.
702
+ return {
703
+ now,
704
+ id: viewId,
705
+ broaderView,
706
+ narrowerView,
707
+ title,
708
+ titleWeekInfo,
709
+ viewDate,
710
+ start,
711
+ end,
712
+ extendedStart, // Full range, including out of scope month days, and hidden leading/trailing days.
713
+ extendedEnd, // Full range, including out of scope month days, and hidden leading/trailing days.
714
+ firstCellDate,
715
+ lastCellDate,
716
+ containsToday,
717
+ nowLine,
718
+ selectedDate,
719
+ cellDates,
720
+ cols,
721
+ rows,
722
+ // All the events are stored and indexed in the events object of the eventsManager.
723
+ // The following events array is only a subset of visible ones, plus any potential recurring
724
+ // and multi-day events.
725
+ events,
726
+ transitionDirection,
727
+ switch: (id, date) => switchView(id, true, date),
728
+ broader: switchToBroaderView,
729
+ narrower: switchToNarrowerView,
730
+ previous,
731
+ next,
732
+ navigate,
733
+ goToToday,
734
+ updateViewDate,
735
+ updateSelectedDate,
736
+ scrollToCurrentTime,
737
+ scrollToTime,
738
+ scrollTop,
739
+ createEvent,
740
+ deleteEvent,
741
+ // Getters.
742
+ get isDay() {
743
+ return viewId.value === 'day';
744
+ },
745
+ get isDays() {
746
+ return viewId.value === 'days';
747
+ },
748
+ get isWeek() {
749
+ return viewId.value === 'week';
750
+ },
751
+ get isMonth() {
752
+ return viewId.value === 'month';
753
+ },
754
+ get isYear() {
755
+ return viewId.value === 'year';
756
+ },
757
+ get isYears() {
758
+ return viewId.value === 'years';
759
+ },
760
+ };
761
+ };