vectis-ui 0.1.0 → 0.8.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 (475) hide show
  1. package/README.md +40 -6
  2. package/dist/components/VAccordion/VAccordion.css +1 -1
  3. package/dist/components/VAccordion/VAccordion.d.ts +9 -16
  4. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
  6. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
  9. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  10. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
  11. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VAccordion/context.d.ts +1 -8
  13. package/dist/components/VAccordion/context.js.map +1 -1
  14. package/dist/components/VAvatar/VAvatar.css +1 -1
  15. package/dist/components/VAvatar/VAvatar.d.ts +44 -29
  16. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  17. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
  18. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
  20. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  21. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
  22. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/VAvatar/context.d.ts +6 -10
  24. package/dist/components/VAvatar/context.js.map +1 -1
  25. package/dist/components/VBadge/VBadge.css +1 -1
  26. package/dist/components/VBadge/VBadge.d.ts +31 -10
  27. package/dist/components/VBadge/VBadge.js.map +1 -1
  28. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
  29. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
  31. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
  32. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  33. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
  34. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VButton/VButton.css +1 -1
  36. package/dist/components/VButton/VButton.d.ts +30 -10
  37. package/dist/components/VButton/VButton.js.map +1 -1
  38. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
  39. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VButton/VButtonGroup.css +1 -1
  41. package/dist/components/VButton/VButtonGroup.d.ts +76 -13
  42. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  43. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
  44. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/VButton/context.d.ts +30 -0
  46. package/dist/components/VButton/context.js +6 -0
  47. package/dist/components/VButton/context.js.map +1 -0
  48. package/dist/components/VCalendar/VCalendar.css +1 -1
  49. package/dist/components/VCalendar/VCalendar.d.ts +50 -36
  50. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  51. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
  52. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  54. package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
  55. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  56. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
  57. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  59. package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
  60. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  61. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
  62. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  64. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
  65. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  66. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
  67. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  69. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  70. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
  71. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/VCalendar/gesture.d.ts +158 -0
  73. package/dist/components/VCalendar/gesture.js +170 -0
  74. package/dist/components/VCalendar/gesture.js.map +1 -0
  75. package/dist/components/VCalendar/keyboard.d.ts +9 -3
  76. package/dist/components/VCalendar/keyboard.js +2 -6
  77. package/dist/components/VCalendar/keyboard.js.map +1 -1
  78. package/dist/components/VCalendar/layout.d.ts +67 -54
  79. package/dist/components/VCalendar/layout.js +77 -69
  80. package/dist/components/VCalendar/layout.js.map +1 -1
  81. package/dist/components/VCalendar/timeGrid.d.ts +55 -0
  82. package/dist/components/VCalendar/timeGrid.js +71 -0
  83. package/dist/components/VCalendar/timeGrid.js.map +1 -0
  84. package/dist/components/VCalendar/types.d.ts +41 -16
  85. package/dist/components/VCarousel/VCarousel.css +1 -1
  86. package/dist/components/VCarousel/VCarousel.d.ts +21 -41
  87. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  88. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
  89. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
  91. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  92. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/VCarousel/context.d.ts +0 -12
  94. package/dist/components/VCarousel/context.js.map +1 -1
  95. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  96. package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
  97. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  98. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
  99. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/VChip/VChip.css +1 -1
  101. package/dist/components/VChip/VChip.d.ts +36 -26
  102. package/dist/components/VChip/VChip.js.map +1 -1
  103. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
  104. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/VCombobox/VCombobox.css +1 -1
  106. package/dist/components/VCombobox/VCombobox.d.ts +127 -31
  107. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  108. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
  109. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  111. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
  112. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  113. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  114. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/VCombobox/VComboboxOption.css +1 -1
  116. package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
  117. package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
  118. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
  119. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
  121. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  123. package/dist/components/VDataTable/VDataTable.css +1 -1
  124. package/dist/components/VDataTable/VDataTable.d.ts +50 -28
  125. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  126. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
  127. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/components/VDateInput/VDateInput.css +1 -1
  129. package/dist/components/VDateInput/VDateInput.d.ts +90 -42
  130. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  131. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
  132. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  134. package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
  135. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  136. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
  137. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/components/VDialog/VDialog.css +1 -1
  139. package/dist/components/VDialog/VDialog.d.ts +45 -33
  140. package/dist/components/VDialog/VDialog.js.map +1 -1
  141. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
  142. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
  144. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  145. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
  146. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  147. package/dist/components/VFileInput/VFileInput.css +1 -1
  148. package/dist/components/VFileInput/VFileInput.d.ts +78 -26
  149. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  150. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
  151. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  153. package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
  154. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  155. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
  156. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/components/VFilePicker/fileKind.d.ts +2 -27
  158. package/dist/components/VFilePicker/fileKind.js +9 -8
  159. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  160. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  161. package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
  162. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  163. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
  164. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/VHotkeys/platform.js.map +1 -1
  166. package/dist/components/VIcon/VIcon.css +1 -1
  167. package/dist/components/VIcon/VIcon.d.ts +15 -6
  168. package/dist/components/VIcon/VIcon.js.map +1 -1
  169. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
  170. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/VIcon/iconProps.js.map +1 -1
  172. package/dist/components/VIcon/icons/index.d.ts +1 -1
  173. package/dist/components/VIcon/icons/index.js.map +1 -1
  174. package/dist/components/VIcon/icons/names.d.ts +1 -1
  175. package/dist/components/VIcon/icons/names.js.map +1 -1
  176. package/dist/components/VIcon/resolver.d.ts +3 -3
  177. package/dist/components/VIcon/resolver.js.map +1 -1
  178. package/dist/components/VIcon/types.d.ts +12 -12
  179. package/dist/components/VIconButton/VIconButton.css +1 -1
  180. package/dist/components/VIconButton/VIconButton.d.ts +28 -11
  181. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  182. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
  183. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/VInput/VInput.css +1 -1
  185. package/dist/components/VInput/VInput.d.ts +26 -7
  186. package/dist/components/VInput/VInput.js.map +1 -1
  187. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
  188. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/components/VInput/VInputGroup.css +2 -0
  190. package/dist/components/VInput/VInputGroup.d.ts +47 -0
  191. package/dist/components/VInput/VInputGroup.js +9 -0
  192. package/dist/components/VInput/VInputGroup.js.map +1 -0
  193. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
  194. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  195. package/dist/components/VInput/context.d.ts +11 -0
  196. package/dist/components/VInput/context.js +6 -0
  197. package/dist/components/VInput/context.js.map +1 -0
  198. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  199. package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
  200. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  201. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
  202. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/VMenu/VMenu.d.ts +23 -30
  204. package/dist/components/VMenu/VMenu.js.map +1 -1
  205. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
  206. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/VMenu/VMenuGroup.css +1 -1
  208. package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
  209. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  210. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
  211. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VMenu/VMenuItem.css +1 -1
  213. package/dist/components/VMenu/VMenuItem.d.ts +11 -19
  214. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  215. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
  216. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  217. package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
  218. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  219. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
  220. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  221. package/dist/components/VMenu/context.d.ts +2 -6
  222. package/dist/components/VMenu/context.js.map +1 -1
  223. package/dist/components/VPagination/VPagination.css +1 -1
  224. package/dist/components/VPagination/VPagination.d.ts +60 -22
  225. package/dist/components/VPagination/VPagination.js.map +1 -1
  226. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
  227. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VPopover/VPopover.css +1 -1
  229. package/dist/components/VPopover/VPopover.d.ts +26 -7
  230. package/dist/components/VPopover/VPopover.js.map +1 -1
  231. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
  232. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  234. package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
  235. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  236. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
  237. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  239. package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
  240. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  241. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
  242. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  243. package/dist/components/VRadio/VRadio.css +1 -1
  244. package/dist/components/VRadio/VRadio.d.ts +36 -18
  245. package/dist/components/VRadio/VRadio.js.map +1 -1
  246. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
  247. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  248. package/dist/components/VSeparator/VSeparator.d.ts +4 -2
  249. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  250. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  251. package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
  252. package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
  253. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  254. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
  255. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  257. package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
  258. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  259. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  260. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  261. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  262. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
  263. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  264. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
  265. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/components/VSideNavigation/context.d.ts +0 -14
  267. package/dist/components/VSideNavigation/context.js.map +1 -1
  268. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  269. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
  270. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  271. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/components/VSlider/VSlider.css +1 -1
  273. package/dist/components/VSlider/VSlider.d.ts +52 -27
  274. package/dist/components/VSlider/VSlider.js.map +1 -1
  275. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
  276. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  277. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  278. package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
  279. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  280. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
  281. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/components/VSnackbar/state.d.ts +0 -27
  283. package/dist/components/VSnackbar/state.js.map +1 -1
  284. package/dist/components/VSpinner/VSpinner.css +1 -1
  285. package/dist/components/VSpinner/VSpinner.d.ts +6 -6
  286. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  287. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
  288. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VSwitch/VSwitch.css +1 -1
  290. package/dist/components/VSwitch/VSwitch.d.ts +35 -13
  291. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  292. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
  293. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  294. package/dist/components/VTabs/VTab.css +1 -1
  295. package/dist/components/VTabs/VTab.d.ts +12 -12
  296. package/dist/components/VTabs/VTab.js.map +1 -1
  297. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
  298. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  299. package/dist/components/VTabs/VTabPanel.d.ts +2 -10
  300. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  301. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
  302. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/components/VTabs/VTabs.css +1 -1
  304. package/dist/components/VTabs/VTabs.d.ts +27 -18
  305. package/dist/components/VTabs/VTabs.js.map +1 -1
  306. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
  307. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/components/VTabs/context.d.ts +9 -19
  309. package/dist/components/VTabs/context.js +1 -1
  310. package/dist/components/VTabs/context.js.map +1 -1
  311. package/dist/components/VTextarea/VTextarea.css +1 -1
  312. package/dist/components/VTextarea/VTextarea.d.ts +34 -6
  313. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  314. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
  315. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  317. package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
  318. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  319. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
  320. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  321. package/dist/components/VTimeInput/search.d.ts +24 -0
  322. package/dist/components/VTimeInput/search.js +22 -0
  323. package/dist/components/VTimeInput/search.js.map +1 -0
  324. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  325. package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
  326. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  327. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
  328. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  329. package/dist/components/VTimePicker/limits.d.ts +88 -0
  330. package/dist/components/VTimePicker/limits.js +70 -0
  331. package/dist/components/VTimePicker/limits.js.map +1 -0
  332. package/dist/components/VToast/VToast.css +1 -1
  333. package/dist/components/VToast/VToast.d.ts +0 -10
  334. package/dist/components/VToast/VToast.js.map +1 -1
  335. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
  336. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/components/VToast/VToaster.css +1 -1
  338. package/dist/components/VToast/VToaster.d.ts +0 -17
  339. package/dist/components/VToast/VToaster.js.map +1 -1
  340. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
  341. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VToast/state.d.ts +10 -19
  343. package/dist/components/VToast/state.js +1 -1
  344. package/dist/components/VToast/state.js.map +1 -1
  345. package/dist/components/VToggle/VToggle.css +1 -1
  346. package/dist/components/VToggle/VToggle.d.ts +56 -11
  347. package/dist/components/VToggle/VToggle.js.map +1 -1
  348. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
  349. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/components/VToggle/VToggleItem.d.ts +16 -2
  351. package/dist/components/VToggle/VToggleItem.js +0 -2
  352. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  353. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
  354. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/components/VToggle/context.d.ts +4 -24
  356. package/dist/components/VToggle/context.js.map +1 -1
  357. package/dist/components/VTooltip/VTooltip.css +1 -1
  358. package/dist/components/VTooltip/VTooltip.d.ts +9 -33
  359. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  360. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
  361. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/dist/components/VTypography/VTypography.js.map +1 -1
  363. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  364. package/dist/composables/useAriaLabel.d.ts +0 -17
  365. package/dist/composables/useAriaLabel.js.map +1 -1
  366. package/dist/composables/useClearable.d.ts +42 -0
  367. package/dist/composables/useClearable.js +19 -0
  368. package/dist/composables/useClearable.js.map +1 -0
  369. package/dist/composables/useControlShape.d.ts +22 -0
  370. package/dist/composables/useControlShape.js +13 -0
  371. package/dist/composables/useControlShape.js.map +1 -0
  372. package/dist/composables/useDetailsOpen.d.ts +22 -0
  373. package/dist/composables/useDetailsOpen.js +21 -0
  374. package/dist/composables/useDetailsOpen.js.map +1 -0
  375. package/dist/composables/useFieldIds.d.ts +0 -15
  376. package/dist/composables/useFieldIds.js +8 -7
  377. package/dist/composables/useFieldIds.js.map +1 -1
  378. package/dist/composables/useFieldPanel.d.ts +21 -18
  379. package/dist/composables/useFieldPanel.js +43 -23
  380. package/dist/composables/useFieldPanel.js.map +1 -1
  381. package/dist/composables/useFileDrop.d.ts +0 -22
  382. package/dist/composables/useFileDrop.js.map +1 -1
  383. package/dist/composables/useFileField.d.ts +45 -17
  384. package/dist/composables/useFileField.js +40 -20
  385. package/dist/composables/useFileField.js.map +1 -1
  386. package/dist/composables/useFocusoutDismiss.d.ts +0 -15
  387. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  388. package/dist/composables/useIconClickHandlers.d.ts +29 -14
  389. package/dist/composables/useIconClickHandlers.js +15 -5
  390. package/dist/composables/useIconClickHandlers.js.map +1 -1
  391. package/dist/composables/useInertLink.d.ts +20 -0
  392. package/dist/composables/useInertLink.js +23 -0
  393. package/dist/composables/useInertLink.js.map +1 -0
  394. package/dist/composables/useMaskedField.d.ts +33 -10
  395. package/dist/composables/useMaskedField.js +45 -1
  396. package/dist/composables/useMaskedField.js.map +1 -1
  397. package/dist/composables/usePopover.d.ts +15 -1
  398. package/dist/composables/usePopover.js +23 -8
  399. package/dist/composables/usePopover.js.map +1 -1
  400. package/dist/composables/useProgressValue.d.ts +5 -8
  401. package/dist/composables/useProgressValue.js +6 -3
  402. package/dist/composables/useProgressValue.js.map +1 -1
  403. package/dist/composables/useRootAttrs.d.ts +12 -19
  404. package/dist/composables/useRootAttrs.js.map +1 -1
  405. package/dist/composables/useTimer.d.ts +8 -10
  406. package/dist/composables/useTimer.js.map +1 -1
  407. package/dist/i18n/en.d.ts +2 -10
  408. package/dist/i18n/en.js +18 -19
  409. package/dist/i18n/en.js.map +1 -1
  410. package/dist/i18n/fr.d.ts +2 -18
  411. package/dist/i18n/fr.js +18 -19
  412. package/dist/i18n/fr.js.map +1 -1
  413. package/dist/i18n/state.d.ts +44 -47
  414. package/dist/i18n/state.js +20 -17
  415. package/dist/i18n/state.js.map +1 -1
  416. package/dist/i18n/types.d.ts +53 -44
  417. package/dist/icons.d.ts +3 -3
  418. package/dist/index.d.ts +43 -17
  419. package/dist/index.js +45 -44
  420. package/dist/styles.css +1 -1
  421. package/dist/tokens/css.js.map +1 -1
  422. package/dist/tokens/index.d.ts +5 -1
  423. package/dist/tokens/primitives.js.map +1 -1
  424. package/dist/tokens/semantic.d.ts +5 -1
  425. package/dist/tokens/semantic.js +6 -2
  426. package/dist/tokens/semantic.js.map +1 -1
  427. package/dist/tokens/themes/dark.js.map +1 -1
  428. package/dist/tokens/types.d.ts +7 -15
  429. package/dist/tokens/types.js.map +1 -1
  430. package/dist/tokens.json +25 -5
  431. package/dist/types.d.ts +24 -0
  432. package/dist/utils/array.d.ts +3 -6
  433. package/dist/utils/array.js.map +1 -1
  434. package/dist/utils/arrowNav.d.ts +17 -17
  435. package/dist/utils/arrowNav.js +5 -3
  436. package/dist/utils/arrowNav.js.map +1 -1
  437. package/dist/utils/chip.d.ts +11 -15
  438. package/dist/utils/chip.js.map +1 -1
  439. package/dist/utils/css.d.ts +22 -11
  440. package/dist/utils/css.js +5 -2
  441. package/dist/utils/css.js.map +1 -1
  442. package/dist/utils/date.d.ts +42 -19
  443. package/dist/utils/date.js +97 -98
  444. package/dist/utils/date.js.map +1 -1
  445. package/dist/utils/direction.d.ts +6 -12
  446. package/dist/utils/direction.js.map +1 -1
  447. package/dist/utils/env.d.ts +5 -6
  448. package/dist/utils/file.d.ts +46 -58
  449. package/dist/utils/file.js +43 -36
  450. package/dist/utils/file.js.map +1 -1
  451. package/dist/utils/focus.d.ts +8 -17
  452. package/dist/utils/focus.js.map +1 -1
  453. package/dist/utils/hostWarns.d.ts +12 -0
  454. package/dist/utils/hostWarns.js +6 -0
  455. package/dist/utils/hostWarns.js.map +1 -0
  456. package/dist/utils/ids.d.ts +10 -0
  457. package/dist/utils/ids.js +8 -0
  458. package/dist/utils/ids.js.map +1 -0
  459. package/dist/utils/matcher.d.ts +5 -9
  460. package/dist/utils/matcher.js.map +1 -1
  461. package/dist/utils/memo.d.ts +12 -0
  462. package/dist/utils/memo.js +9 -0
  463. package/dist/utils/memo.js.map +1 -0
  464. package/dist/utils/number.d.ts +3 -4
  465. package/dist/utils/number.js.map +1 -1
  466. package/dist/utils/text.d.ts +20 -9
  467. package/dist/utils/text.js +17 -3
  468. package/dist/utils/text.js.map +1 -1
  469. package/dist/utils/time.d.ts +53 -61
  470. package/dist/utils/time.js +49 -45
  471. package/dist/utils/time.js.map +1 -1
  472. package/dist/utils/vnode.d.ts +8 -15
  473. package/dist/utils/vnode.js.map +1 -1
  474. package/package.json +6 -6
  475. package/dist/components/VToggle/VToggleItem.css +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"VDateInput.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VDateInput/VDateInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, useId, watchEffect } from 'vue'\n\nimport VDatePicker from '../VDatePicker/VDatePicker.vue'\nimport type {\n DatePickerEvent,\n DatePickerSelection,\n DatePickerValue,\n DateMatcher,\n DateRange,\n} from '../VDatePicker/VDatePicker.vue'\nimport {\n caretAfterDigits,\n dateMaskFor,\n formatDateMask,\n formatDisplay,\n formatDisplayRange,\n isValidISO,\n isWithin,\n isoToMask,\n maskPlaceholder,\n parseDateMask,\n} from '../../utils/date'\nimport { digitsOf } from '../../utils/text'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { isDev } from '../../utils/env'\nimport { calendar_today as calendarTodayIcon } from '../VIcon/icons/calendar_today'\nimport type { IconSource } from '../VIcon/types'\nimport VInput from '../VInput/VInput.vue'\nimport VPopover from '../VPopover/VPopover.vue'\n\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\nimport { useFieldPanel } from '../../composables/useFieldPanel'\nimport { useMaskedField } from '../../composables/useMaskedField'\nimport { useLocale, useMessages } from '../../i18n/state'\n\n// @a11y @core\n/**\n * A field for choosing a date: a text field, and a calendar in a panel below it.\n *\n * The panel is opened from code rather than by the browser, and that is not a detail: a\n * text input cannot be declared as the thing that opens a popover, and opening it\n * ourselves is also what lets the focus be moved INTO the calendar's grid, so the\n * keyboard lands where the dates are. Closing is ours too — the focus leaving the\n * component, or Escape.\n *\n * The field itself comes in two forms. It can be TYPED into, which is the default: the\n * reader types digits only and the separators appear as they go, in the order and with\n * the punctuation their language uses. Or it can be read-only, in which case the calendar\n * is the only way in.\n *\n * That is a different question from WHAT is being chosen — one date, a period, or several\n * dates — which is passed straight through to the calendar.\n */\ntype Placement = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end'\n\n/** Whether the field can be typed into, or only filled from the calendar. */\nexport type DateInputMode = 'readonly' | 'input'\n\nconst MODES: DateInputMode[] = ['readonly', 'input']\n\n/**\n * The century a two-digit year is expanded into — \"10/06/26\" becomes 2026 — applied only\n * when the reader leaves the field.\n *\n * It is FIXED and never derived from the current year. A sliding rule would make the\n * component's behaviour depend on when it runs, which is the same objection that keeps\n * today's date out of VDatePicker's setup, and it would give the tests a shelf life.\n */\nconst YEAR_PIVOT = 2000\n\nconst DEFAULT_DISPLAY_FORMAT: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n}\n\ninterface DateInputProps {\n // Everything from here to `events` is handed straight to the calendar.\n /** What is being chosen: one date, a period between two, or several separate dates. */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names, the first day of the week and\n * the order the field is typed in. It TAKES PRECEDENCE over the design system's global\n * locale and falls back to it — which is why it has no literal default: `undefined` has\n * to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /** Forces the day the weeks start on, from 0 for Sunday to 6 for Saturday. */\n firstDayOfWeek?: number\n /** The earliest date that can be chosen, as an ISO string. */\n min?: string\n /** The latest date that can be chosen, as an ISO string. */\n max?: string\n /** Dates that cannot be chosen, as a list or as a function. */\n disabledDates?: DateMatcher\n /** Fills the corners of the grid with the greyed days of the neighbouring months. */\n showAdjacentDays?: boolean\n /** Lets those neighbouring days be clicked, which implies showing them. */\n selectAdjacentDays?: boolean\n /** Events to mark under the days they fall on. */\n events?: DatePickerEvent[]\n // From here on: the field.\n /**\n * Whether the field can be TYPED into — the default, using the numeric form of the\n * reader's language — or is read-only, the calendar then being the only way in.\n *\n * Typing is reserved for choosing a SINGLE date: a period or a list falls back to\n * read-only, there being no sensible way to type either.\n */\n mode?: DateInputMode\n /**\n * Offers the date picker alongside a field that can be typed into: an icon at the end of\n * the field, and a panel that opens on focus. It means nothing in read-only mode, where\n * the picker is already the only way to choose.\n */\n showPicker?: boolean\n /** The label above the field. */\n label?: string\n /** A line of help under the field. */\n hint?: string\n /** What the field says while empty. */\n placeholder?: string\n /** The height of the field: 32, 40 or 48 pixels. */\n size?: 'sm' | 'md' | 'lg'\n /** Takes 4px off the height. */\n compact?: boolean\n /** Makes the field unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /** Marks the field as invalid — for a rule of your own. */\n invalid?: boolean\n /** Offers a cross that empties the value, shown before the end icon. */\n clearable?: boolean\n /**\n * The icon that opens the date picker, at the end of the field. The clear cross appears\n * to its left rather than in its place, and no icon is rendered at all when there is no\n * panel to open.\n */\n pickerIcon?: IconSource\n /**\n * How the date is WRITTEN OUT in the field. It has no effect on a field being typed\n * into, which necessarily shows the numeric form one types — so it concerns the\n * read-only mode, and the period and list selections, which fall back to it.\n */\n displayFormat?: Intl.DateTimeFormatOptions\n /** Where the panel opens relative to the field. */\n placement?: Placement\n}\n\nconst props = withDefaults(defineProps<DateInputProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n // Deliberately left undefined rather than defaulted to the typed mode: that is what\n // distinguishes \"the prop was not given\" from \"the prop was given this value\", and\n // therefore what allows warning ONLY the consumer who explicitly asked for something\n // that cannot work.\n mode: undefined,\n showPicker: false,\n label: undefined,\n hint: undefined,\n placeholder: undefined,\n size: 'md',\n compact: false,\n disabled: false,\n invalid: false,\n clearable: true,\n pickerIcon: () => calendarTodayIcon,\n // Left undefined rather than defaulted to the format object, for the same reason: it is\n // what lets the component notice that a consumer has asked for a display format in a\n // mode where it has no effect, and say so.\n displayFormat: undefined,\n placement: 'bottom-start',\n})\n\nconst model = defineModel<DatePickerValue>({ default: null })\n\ndefineSlots<{\n /** What a day cell shows, handed straight to the calendar. */\n day?(props: {\n iso: string\n day: number\n inMonth: boolean\n disabled: boolean\n selected: boolean\n today: boolean\n inRange: boolean\n events: DatePickerEvent[]\n }): unknown\n /**\n * The strip at the foot of the panel — actions, or preset dates such as \"today\". It\n * receives `close`, which is what lets one of those buttons dismiss the panel.\n */\n footer?(props: { close: () => void }): unknown\n}>()\n\n// `class` and `style` stay on the wrapper; everything else goes down to the text field,\n// which is what a consumer's label points at and what assistive technology deals with.\ndefineOptions({ inheritAttrs: false })\nconst { rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\nconst rootEl = ref<HTMLElement | null>(null)\nconst panelRef = ref<InstanceType<typeof VPopover> | null>(null)\nconst inputRef = ref<InstanceType<typeof VInput> | null>(null)\nconst pickerRef = ref<InstanceType<typeof VDatePicker> | null>(null)\nconst panelId = useId()\n\n/** The real input inside the field, which the mask and the caret work on. */\nconst fieldEl = computed<HTMLInputElement | null>(() => inputRef.value?.el ?? null)\n\n/** What was asked for, falling back to the default when nothing or nonsense was given. */\nconst requestedMode = computed<DateInputMode>(() =>\n props.mode !== undefined && MODES.includes(props.mode) ? props.mode : 'input',\n)\n/**\n * What is actually used. Typing is only possible for a single date: a period or a list\n * has no form one could type into a single field.\n */\nconst resolvedMode = computed<DateInputMode>(() =>\n requestedMode.value === 'input' && props.selection === 'single' ? 'input' : 'readonly',\n)\nconst typing = computed(() => resolvedMode.value === 'input')\n\n/**\n * Whether there is a panel at all. The calendar is only optional beside a field one can\n * type into: read-only, it is the only way to choose anything.\n */\nconst hasPanel = computed(() => !typing.value || props.showPicker)\n\n// @devwarn\nif (isDev) {\n watchEffect(() => {\n if (props.mode !== undefined && !MODES.includes(props.mode))\n console.warn(\n `[VDateInput] unknown mode \"${props.mode}\": use \"input\" (the default) or \"readonly\".`,\n )\n // Tested on the PROP and not on what was resolved from it: typing being the default,\n // a period or a list falls back on its own with nobody having asked for anything.\n // Only a consumer who explicitly asked to type deserves to be told it cannot work.\n if (props.mode === 'input' && props.selection !== 'single')\n console.warn(\n `[VDateInput] mode=\"input\" ignored in \"${props.selection}\" selection: a range or a list of dates cannot be typed on the keyboard.`,\n )\n // Here it is the RESOLVED mode that matters: the format really was supplied, and it\n // really will have no effect, whichever route led to a typed field. The warning stays\n // something the consumer can act on.\n if (props.displayFormat && typing.value)\n console.warn(\n '[VDateInput] displayFormat is ignored in \"input\" mode (the default): the field displays the locale\\'s numeric mask, the only typeable format. Pass mode=\"readonly\" for a formatted display.',\n )\n })\n}\n\n// The whole \"field plus panel\" shell, shared with VTimeInput: opening and closing, the\n// focus leaving the component, a click on the field, and the Escape, ArrowDown and Enter\n// keys.\nconst { open, openPanel, closePanel, onControlClick, onFocusout, onKeydown, onPanelMousedown } =\n useFieldPanel({\n rootEl,\n panelRef,\n fieldEl: inputRef,\n // With no panel there is nothing to open. This is the composable's SINGLE cut-off\n // point, and every way in passes through it — clicking the field, focusing it, the\n // down arrow, Enter, the icon — so the condition never has to be repeated in a\n // handler.\n disabled: () => props.disabled || !hasPanel.value,\n focusInPanel: () => pickerRef.value?.focus(),\n // Beside a field one types into, the panel opens WITHOUT taking the focus: typing\n // carries on in the field, and the down arrow remains the way into the grid.\n focusOnOpen: () => !typing.value,\n })\n\nconst hasValue = computed(() => {\n if (props.selection === 'multiple') return Array.isArray(model.value) && model.value.length > 0\n if (props.selection === 'range') {\n const r = model.value as DateRange | null\n return !!(r && (r.start || r.end))\n }\n return typeof model.value === 'string' && !!model.value\n})\n\nconst vectisLocale = useLocale()\n/* The prop wins, and the design system's global locale is what it falls back to.\n\n TRAP — this component is the SINGLE place that resolution happens: what flows down to\n the calendar is the RESULT, never the prop, which would usually be undefined and would\n have the calendar resolve the language a second time — with every chance of the two\n disagreeing after a later change. */\nconst resolvedLocale = computed(() => props.locale ?? vectisLocale.value)\n\nconst displayText = computed(() => {\n const locale = resolvedLocale.value\n const displayFormat = props.displayFormat ?? DEFAULT_DISPLAY_FORMAT\n if (props.selection === 'single') {\n return typeof model.value === 'string' && isValidISO(model.value)\n ? formatDisplay(model.value, locale, displayFormat)\n : ''\n }\n if (props.selection === 'range') {\n const r = model.value as DateRange | null\n if (!r?.start) return ''\n if (!r.end) return formatDisplay(r.start, locale, displayFormat)\n return formatDisplayRange(r.start, r.end, locale, displayFormat)\n }\n const list = Array.isArray(model.value) ? model.value : []\n return list.map((iso) => formatDisplay(iso, locale, displayFormat)).join(', ')\n})\n\n/* From here on: everything the typed field needs. */\n\nconst mask = computed(() => dateMaskFor(resolvedLocale.value))\nconst maskHint = computed(() => maskPlaceholder(resolvedLocale.value, mask.value))\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\n/**\n * Whether a date the reader has finished typing may actually be taken: it has to fall\n * within the allowed bounds and not be one of the excluded days.\n */\nconst acceptable = (iso: string) =>\n isWithin(iso, props.min, props.max) && !isDisabledDate.value(iso)\n\n/*\n * The mask machinery — the text being typed, the bridge to the value, the reformatting\n * that preserves the caret, the commit as soon as the date is complete and the silent\n * revert when it is not — is shared with VTimeInput and lives in `useMaskedField`.\n *\n * What is injected here is the date VOCABULARY alone: the order of the fields, the\n * separator between them and their widths, all derived from the reader's language.\n */\nconst { draft, fieldModel, writeField, commitLive, commitOrRevert, onFieldInput } = useMaskedField({\n fieldEl,\n typing: () => typing.value,\n displayText: () => displayText.value,\n readValue: () =>\n typeof model.value === 'string' && isValidISO(model.value) ? model.value : null,\n writeValue: (iso) => {\n model.value = iso\n },\n maxDigits: () => mask.value.size,\n format: (digits) => formatDateMask(digits, mask.value),\n caret: (text, digitsBefore, inserting) =>\n caretAfterDigits(text, digitsBefore, inserting ? mask.value.separator : undefined),\n // A two-digit year is only expanded on the FINAL commit, when the reader leaves the\n // field — never while they are still typing, where \"26\" may well be on its way to\n // becoming \"2026\".\n parse: (text, final) =>\n parseDateMask(text, mask.value, final ? { yearPivot: YEAR_PIVOT } : undefined),\n toMask: (iso) => (iso ? isoToMask(iso, mask.value) : ''),\n acceptable,\n})\n\n/**\n * Typing anything that is not a digit — a slash, a dot, a space — completes the field\n * being typed with a leading zero and moves on to the next. It is what lets someone type\n * \"5/6/2026\" and get the same result as typing all eight digits.\n *\n * It applies to the day and the month only: a year cut short has no such convention, \"26\"\n * being neither 0026 nor 2026 until the reader has finished.\n */\nfunction padCurrentField(el: HTMLInputElement) {\n const start = el.selectionStart ?? el.value.length\n const before = digitsOf(el.value.slice(0, start)).length\n const digits = digitsOf(el.value)\n let offset = 0\n for (let k = 0; k < mask.value.order.length; k++) {\n const len = mask.value.lengths[k] as number\n if (before < offset + len) {\n const filled = before - offset\n if (mask.value.order[k] === 'year' || filled !== len - 1) return\n const next = digits.slice(0, offset) + '0'.repeat(len - filled) + digits.slice(offset)\n const text = formatDateMask(next.slice(0, mask.value.size), mask.value)\n writeField(text, caretAfterDigits(text, offset + len, mask.value.separator))\n return\n }\n offset += len\n }\n}\n\n// @keyboard @core — the keys the mask itself needs: completing a field with a separator,\n// erasing across one, and the down arrow, which is the one explicit way from the field\n// into the calendar.\nfunction onFieldKeydown(event: KeyboardEvent) {\n if (!typing.value) return\n const el = fieldEl.value\n if (!el) return\n\n if (event.key === 'Enter') {\n // Cancelling the default does two things at once: it stops the surrounding form from\n // being submitted, and it stops the panel this keystroke has just closed from being\n // reopened as the event travels up to the root.\n event.preventDefault()\n commitOrRevert()\n if (open.value) closeAndFocus()\n return\n }\n if (event.key === 'ArrowDown' && open.value) {\n // The one explicit route from the field into the grid of days.\n event.preventDefault()\n pickerRef.value?.focus()\n return\n }\n if (event.key === 'Backspace') {\n const start = el.selectionStart\n if (\n start !== null &&\n start === el.selectionEnd &&\n start > 0 &&\n !/\\d/.test(el.value[start - 1] ?? '')\n ) {\n // TRAP — a separator is PLACED by the mask and never typed, so erasing one has to\n // erase the DIGIT before it, which is what the reader believes they are erasing.\n // Left alone, the mask would write the separator straight back and the key would\n // look dead.\n event.preventDefault()\n const n = digitsOf(el.value.slice(0, start)).length\n const digits = digitsOf(el.value)\n const text = formatDateMask(digits.slice(0, n - 1) + digits.slice(n), mask.value)\n writeField(text, caretAfterDigits(text, n - 1))\n commitLive()\n }\n return\n }\n if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n !/\\d/.test(event.key)\n ) {\n event.preventDefault()\n padCurrentField(el)\n }\n}\n\n/**\n * Pasting. A date recognizable as a whole — in the ISO form, or already written the way\n * this field writes them — is adopted as it stands; anything else contributes its digits\n * alone.\n *\n * Without this, pasting \"2026-06-10\" into a field expecting day, month, year would\n * produce \"20/26/0610\": the digits would be taken in order and the separators ignored.\n */\nfunction onFieldPaste(event: ClipboardEvent) {\n if (!typing.value) return\n const el = fieldEl.value\n if (!el) return\n event.preventDefault()\n const pasted = (event.clipboardData?.getData('text') ?? '').trim()\n const iso = isValidISO(pasted)\n ? pasted\n : parseDateMask(pasted, mask.value, { yearPivot: YEAR_PIVOT })\n if (iso) {\n const text = isoToMask(iso, mask.value)\n writeField(text, text.length)\n commitLive()\n return\n }\n const start = el.selectionStart ?? el.value.length\n const end = el.selectionEnd ?? start\n const digits = digitsOf(el.value)\n const from = digitsOf(el.value.slice(0, start)).length\n const to = digitsOf(el.value.slice(0, end)).length\n const inserted = digitsOf(pasted)\n const next = (digits.slice(0, from) + inserted + digits.slice(to)).slice(0, mask.value.size)\n const text = formatDateMask(next, mask.value)\n writeField(text, caretAfterDigits(text, Math.min(from + inserted.length, next.length)))\n commitLive()\n}\n\n// @a11y\n/**\n * TRAP — closing the panel hands the focus back to the field, and beside a field one\n * types into the panel opens ON FOCUS: the two would chase each other and the panel would\n * never close.\n *\n * This lock covers the focus call, which is synchronous. EVERY close that returns the\n * focus must go through here; closing directly brings the loop straight back.\n */\nlet refocusing = false\nfunction closeAndFocus() {\n refocusing = true\n closePanel(true)\n refocusing = false\n}\n\nfunction onFieldFocus() {\n if (!typing.value || refocusing) return\n openPanel(false)\n}\n\n// @keyboard @a11y\nfunction onRootKeydown(event: KeyboardEvent) {\n if (typing.value && event.key === 'Escape' && open.value) {\n event.preventDefault()\n closeAndFocus()\n return\n }\n onKeydown(event)\n}\n\n/*\n * The clear cross is the field's own, which renders it BEFORE the end icon rather than in\n * its place — the convention every field in the design system follows, so the two live\n * side by side.\n *\n * Whether it is shown has to be answered explicitly here: outside the typed mode the field\n * is read-only, and a read-only field hides its cross by default, rightly so — but here\n * the value comes from the panel, so there is something to clear all the same.\n */\nconst canClear = computed(\n () => props.clearable && !props.disabled && (hasValue.value || (typing.value && !!draft.value)),\n)\nconst endIcon = computed<IconSource | undefined>(() =>\n hasPanel.value ? props.pickerIcon : undefined,\n)\n// @a11y @devwarn\n/*\n * TRAP — the LABEL is defined at all times, even when no icon is rendered at all.\n *\n * The helper detecting a click handler on an icon warns AT SETUP if one is attached\n * without a label, and it has no way of knowing whether an icon exists. Since the\n * listener here is attached permanently and that detection is static, making the label\n * conditional would produce a false warning every time a field without a calendar is\n * mounted.\n *\n * The wording itself has no prop: the dictionary is where it is changed — see `src/i18n/`.\n */\nconst m = useMessages()\n\nconst endIconLabel = computed(() => m.value.dateInput.open)\n\nfunction onEndIcon() {\n if (open.value) closeAndFocus()\n // Clicking the icon is an explicit request for the calendar, and the focus has already\n // left the field for the button — so carrying it into the grid is right in both modes.\n else openPanel(true)\n}\n// @a11y\n/*\n * Emptying the value, called by the field as it emits its clear event.\n *\n * TRAP — the focus is taken here, under the lock, on purpose: the field focuses itself\n * immediately afterwards, and focusing an element that ALREADY has the focus emits no\n * event at all. That is what stops the panel reopening. Taking the lock away from this\n * function brings the reopening straight back.\n */\nfunction clearValue() {\n model.value =\n props.selection === 'multiple'\n ? []\n : props.selection === 'range'\n ? { start: null, end: null }\n : null\n // The typed text is emptied EXPLICITLY: when the value was already empty, nothing\n // changes, and the guard that keeps the field and the value from chasing each other\n // would leave the text where it was.\n if (typing.value) writeField('')\n refocusing = true\n inputRef.value?.focus()\n refocusing = false\n}\n\n/**\n * A date was chosen in the calendar. Choosing ONE date finishes the job, so the panel\n * closes; a period or a list is still being built and it stays open.\n */\nfunction onSelect() {\n if (props.selection === 'single') closeAndFocus()\n}\n\nconst close = () => closeAndFocus()\n</script>\n\n<template>\n <div\n ref=\"rootEl\"\n class=\"v-date-input\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-open=\"open ? '' : undefined\"\n :data-mode=\"resolvedMode\"\n @focusout=\"onFocusout\"\n @keydown=\"onRootKeydown\"\n >\n <div class=\"v-date-input-control\" @click=\"onControlClick\">\n <!-- The field is declared a combobox rather than left as the plain text box it\n implicitly is, because a text box may not carry the attribute saying whether\n something is expanded — and a text field with a panel attached IS the combobox\n pattern, the same role VCombobox gives its own field.\n\n The role and the three attributes are all conditioned on the SAME thing, so the\n role never appears without the expanded state it requires, and nothing ever\n points at a panel that was not rendered. -->\n <VInput\n ref=\"inputRef\"\n v-model=\"fieldModel\"\n :inputmode=\"typing ? 'numeric' : undefined\"\n :autocomplete=\"typing ? 'off' : undefined\"\n v-bind=\"forwardedAttrs\"\n :readonly=\"!typing\"\n :label=\"label\"\n :hint=\"hint\"\n :placeholder=\"placeholder ?? (typing ? maskHint : undefined)\"\n :size=\"size\"\n :compact=\"compact\"\n :disabled=\"disabled\"\n :invalid=\"invalid\"\n :clearable=\"clearable\"\n :clear-visible=\"canClear\"\n :clear-label=\"m.dateInput.clear\"\n :icon-end=\"endIcon\"\n :icon-end-label=\"endIconLabel\"\n :role=\"hasPanel ? 'combobox' : undefined\"\n :aria-haspopup=\"hasPanel ? 'dialog' : undefined\"\n :aria-expanded=\"hasPanel ? open : undefined\"\n :aria-controls=\"hasPanel ? panelId : undefined\"\n @click:icon-end=\"onEndIcon\"\n @clear=\"clearValue\"\n @focus=\"onFieldFocus\"\n @input=\"onFieldInput\"\n @change=\"commitOrRevert\"\n @blur=\"commitOrRevert\"\n @keydown=\"onFieldKeydown\"\n @paste=\"onFieldPaste\"\n />\n </div>\n\n <!-- With no panel rendered there is nothing to hold a reference to, and the open state\n — which is fed by the panel's own events — can no longer become true. The absence\n of a panel is therefore self-enforcing. -->\n <VPopover\n v-if=\"hasPanel\"\n :id=\"panelId\"\n ref=\"panelRef\"\n v-model:open=\"open\"\n mode=\"manual\"\n anchor=\"--date-input-anchor\"\n :placement=\"placement\"\n surface\n role=\"dialog\"\n :aria-label=\"label ?? m.dateInput.label\"\n class=\"v-date-input-panel\"\n @mousedown=\"onPanelMousedown\"\n >\n <VDatePicker\n ref=\"pickerRef\"\n v-model=\"model\"\n :selection=\"selection\"\n :locale=\"resolvedLocale\"\n :first-day-of-week=\"firstDayOfWeek\"\n :min=\"min\"\n :max=\"max\"\n :disabled-dates=\"disabledDates\"\n :show-adjacent-days=\"showAdjacentDays\"\n :select-adjacent-days=\"selectAdjacentDays\"\n :events=\"events\"\n @select=\"onSelect\"\n >\n <template v-if=\"$slots.day\" #day=\"slotProps\">\n <slot name=\"day\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" :close=\"close\" />\n </template>\n </VDatePicker>\n </VPopover>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-input {\n /* Confines the anchor to this instance (the root = the common ancestor of the\n control and the panel) */\n anchor-scope: --date-input-anchor;\n display: block;\n width: 100%;\n font-family: var(--vectis-text-family);\n }\n\n .v-date-input-control {\n anchor-name: --date-input-anchor;\n display: block;\n cursor: pointer;\n }\n\n /* Input mode: the field is editable, and the <input>'s text caret takes over from the\n control's `pointer` (which signals \"this opens a panel\"). The mask has a fixed width:\n tabular figures, otherwise the caret jitters from one digit to the next. */\n .v-date-input[data-mode='input'] .v-date-input-control {\n cursor: text;\n }\n\n .v-date-input[data-mode='input'] .v-input-control {\n font-variant-numeric: tabular-nums;\n }\n\n /* `position-anchor` and the chrome come from VPopover (the `anchor` and `surface`\n props, the latter setting `.v-panel`): only the dimensions are left here, which\n `panel.css` deliberately does not carry. The padding is cancelled — VDatePicker handles\n its own breathing room; compounded with `.v-popover-panel` (VPopover puts both\n classes on the same element) because `.v-panel` declares `padding` too, and at\n equal specificity the winner would depend on the order in which the consumer's\n bundler concatenates the CSS. */\n .v-popover-panel.v-date-input-panel {\n width: max-content;\n padding: 0;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;qCAsEM,IAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAVnB,IAAM,IAAyB,CAAC,YAAY,OAAO,GAY7C,IAAqD;GACzD,KAAK;GACL,OAAO;GACP,MAAM;EACR,GA0EM,IAAQ,GAgCR,IAAQ,GAA4B,GAAA,YAAkB,GAwBtD,EAAE,eAAW,eAAW,uBAAmB,EAAa,GAExD,IAAS,EAAwB,IAAI,GACrC,IAAW,EAA0C,IAAI,GACzD,IAAW,EAAwC,IAAI,GACvD,IAAY,EA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AA,QAAA,OAAA,GAAA,GAAb,CAAS,CAAA,CAAA,CAAA,CAAA;;eAEpBA,EAAAA,OAAO,SAAA;UAAS;gBACO,CAArC,EAAqC,EAAA,QAAA,UAAA,EAAT,UAAK,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"VDateInput.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VDateInput/VDateInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @core\n/**\n * A field for choosing a date: a VInput, and a VDatePicker in a panel below it.\n *\n * The panel is `mode=\"manual\"` and driven imperatively, which is not a detail — `popovertarget`\n * is invalid on a text `<input>`, and opening it ourselves is also what lets focus be moved\n * INTO the grid so the keyboard lands on the dates. Closing is ours too: `focusout`, or Escape.\n *\n * Two FIELD modes, `mode`: `input` (the default) types digits only, the separators appearing\n * as they go in the order and punctuation of the reader's locale; `picker` makes the calendar\n * the only way in. What the field is FOR is a different question from the `readonly` prop,\n * which freezes whatever it holds by every route at once.\n *\n * That is a different question from WHAT is chosen — one date, a range, or several — which is\n * `selection`, passed straight through to the picker.\n */\n\nimport { computed, inject, provide, ref, watchEffect } from 'vue'\n\nimport { inputGroupKey } from '../VInput/context'\n\nimport VDatePicker from '../VDatePicker/VDatePicker.vue'\nimport type {\n DatePickerDaySlotProps,\n DatePickerEvent,\n DatePickerSelection,\n DatePickerValue,\n DatePickerMatcher,\n DatePickerRange,\n} from '../VDatePicker/VDatePicker.vue'\nimport {\n caretAfterDigits,\n compareISO,\n dateMaskFor,\n formatDateDisplay,\n formatDateMask,\n formatDisplayRange,\n isDateAllowed,\n isValidISO,\n isoToMask,\n maskPlaceholder,\n parseDateMask,\n} from '../../utils/date'\nimport { digitsOf } from '../../utils/text'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { isDev } from '../../utils/env'\nimport { hostWarnsKey } from '../../utils/hostWarns'\nimport { calendar_today as calendarTodayIcon } from '../VIcon/icons/calendar_today'\nimport type { IconSource } from '../VIcon/types'\nimport VInput from '../VInput/VInput.vue'\nimport VPopover from '../VPopover/VPopover.vue'\n\nimport { useControlShape } from '../../composables/useControlShape'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\nimport { useFieldPanel } from '../../composables/useFieldPanel'\nimport { canClear } from '../../composables/useClearable'\nimport { iconStartListener } from '../../composables/useIconClickHandlers'\nimport { useMaskedField } from '../../composables/useMaskedField'\nimport { useMessages, useResolvedLocale } from '../../i18n/state'\n\n/** Where the calendar opens relative to the field. */\nexport type DateInputPlacement =\n 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end'\n\n/** Whether the field can be typed into, or only filled from the calendar. */\nexport type DateInputMode = 'picker' | 'input'\n\nconst MODES: DateInputMode[] = ['picker', 'input']\n\n/**\n * The century a two-digit year is expanded into — \"10/06/26\" becomes 2026 — applied only\n * when the reader leaves the field.\n *\n * It is FIXED and never derived from the current year. A sliding rule would make the\n * component's behaviour depend on when it runs, which is the same objection that keeps\n * today's date out of VDatePicker's setup, and it would give the tests a shelf life.\n */\nconst YEAR_PIVOT = 2000\n\nconst DEFAULT_DISPLAY_FORMAT: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n}\n\n/** The height of the field: 32, 40 or 48 pixels. */\nexport type DateInputSize = 'sm' | 'md' | 'lg'\n\ninterface DateInputProps {\n // Everything from here to `events` is handed straight to the calendar.\n /** What is being chosen: one date, a period between two, or several separate dates. */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names, the first day of the week and\n * the order the field is typed in. It TAKES PRECEDENCE over the design system's global\n * locale and falls back to it — which is why it has no literal default: `undefined` has\n * to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /** Forces the day the weeks start on, from 0 for Sunday to 6 for Saturday. */\n firstDayOfWeek?: number\n /** The earliest date that can be chosen, as an ISO string. */\n min?: string\n /** The latest date that can be chosen, as an ISO string. */\n max?: string\n /** Dates that cannot be chosen, as a list or as a function. */\n disabledDates?: DatePickerMatcher\n /** Fills the corners of the grid with the greyed days of the neighbouring months. */\n showAdjacentDays?: boolean\n /** Lets those neighbouring days be clicked, which implies showing them. */\n selectAdjacentDays?: boolean\n /** Events to mark under the days they fall on. */\n events?: DatePickerEvent[]\n // From here on: the field.\n /**\n * Whether the field can be TYPED into — the default, using the numeric form of the\n * reader's language — or is filled from the calendar alone, which is `picker`.\n *\n * Typing is reserved for choosing a SINGLE date: a period or a list falls back to\n * `picker`, there being no sensible way to type either.\n */\n mode?: DateInputMode\n /**\n * Offers the date picker alongside a field that can be typed into: an icon at the end of\n * the field, and a panel that opens on focus. It means nothing in `picker` mode, where\n * the calendar is already the only way to choose.\n */\n showPicker?: boolean\n /** The label above the field. */\n label?: string\n /** A line of help under the field. */\n hint?: string\n /** What the field says while empty. */\n placeholder?: string\n /** The height of the field: 32, 40 or 48 pixels. */\n size?: DateInputSize\n /** Takes 4px off the height. */\n compact?: boolean\n /** Makes the field unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the date without letting it be changed: nothing can be typed, there is no\n * calendar and no clear cross. The field stays focusable and can be copied from,\n * which is what separates it from `disabled`, and it is a different question from\n * `mode`, which says how a field that CAN be changed is filled in.\n */\n readonly?: boolean\n /** Marks the field as invalid — for a rule of your own. */\n invalid?: boolean\n /**\n * An icon inside the field, at the start. It is decorative by default and becomes a\n * real button as soon as a `@click:icon-start` listener is attached, in which case it\n * needs `iconStartLabel`.\n */\n iconStart?: IconSource\n /** What the start icon does, in words, once it is clickable. */\n iconStartLabel?: string\n /**\n * What the calendar button does, in words. It names the button `pickerIcon` renders,\n * and falls back to the design system dictionary.\n */\n pickerIconLabel?: string\n /**\n * Shows a spinner at the end of the field, in place of the calendar icon. It says\n * that something is being loaded and changes nothing else: the field can still be\n * typed into and the panel still opens.\n */\n loading?: boolean\n /**\n * What screen readers announce while the spinner turns. It falls back to the design\n * system dictionary.\n */\n loadingLabel?: string\n /** Offers a cross that empties the value, shown before the end icon. */\n clearable?: boolean\n /** What that cross does, in words. It falls back to the design system dictionary. */\n clearLabel?: string\n /**\n * The icon that opens the date picker, at the end of the field. The clear cross appears\n * to its left rather than in its place, and no icon is rendered at all when there is no\n * panel to open.\n */\n pickerIcon?: IconSource\n /**\n * How the date is WRITTEN OUT in the field. It has no effect on a field being typed\n * into, which necessarily shows the numeric form one types — so it concerns the\n * `picker` mode, and the period and list selections, which fall back to it.\n */\n displayFormat?: Intl.DateTimeFormatOptions\n /** Where the panel opens relative to the field. */\n placement?: DateInputPlacement\n}\n\nconst props = withDefaults(defineProps<DateInputProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n // Deliberately left undefined rather than defaulted to the typed mode: that is what\n // distinguishes \"the prop was not given\" from \"the prop was given this value\", and\n // therefore what allows warning ONLY the consumer who explicitly asked for something\n // that cannot work.\n mode: undefined,\n showPicker: false,\n label: undefined,\n hint: undefined,\n placeholder: undefined,\n size: 'md',\n compact: false,\n disabled: false,\n readonly: false,\n invalid: false,\n iconStart: undefined,\n iconStartLabel: undefined,\n pickerIconLabel: undefined,\n loading: false,\n loadingLabel: undefined,\n clearable: false,\n clearLabel: undefined,\n pickerIcon: () => calendarTodayIcon,\n // Left undefined rather than defaulted to the format object, for the same reason: it is\n // what lets the component notice that a consumer has asked for a display format in a\n // mode where it has no effect, and say so.\n displayFormat: undefined,\n placement: 'bottom-start',\n})\n\n/**\n * The date or dates chosen, in the shape `selection` calls for: an ISO `YYYY-MM-DD` string\n * for `single`, a `{ start, end }` pair for `range`, an array for `multiple`. Nothing is\n * selected to begin with.\n *\n * While the reader types, it is only written once what they have entered is a complete and\n * acceptable date; an unfinished or refused entry leaves it untouched and is reverted when\n * they leave the field.\n */\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /** The clear cross emptied the field. The value has already been reset. */\n clear: []\n /** The start icon was clicked. Attaching this listener is what makes it a button. */\n 'click:icon-start': [event: MouseEvent]\n}>()\n\ndefineSlots<{\n /**\n * Content at the start of the field, rendered after `iconStart` rather than in its place,\n * as in VInput.\n */\n start?(): unknown\n /**\n * Controls of your own inside the field, placed before the ones the field owns — the clear\n * cross and the icon that opens the panel. Those two are this component's own affordance,\n * which is why there is no `#end` here: it would replace them.\n */\n 'value-end'?(): unknown\n /** What a day cell shows, handed straight to the calendar. */\n day?(props: DatePickerDaySlotProps): unknown\n /**\n * The strip at the foot of the panel — actions, or preset dates such as \"today\". It\n * receives `close`, which is what lets one of those buttons dismiss the panel.\n */\n footer?(props: { close: () => void }): unknown\n}>()\n\n// `class` and `style` stay on the wrapper; everything else goes down to the text field,\n// which is what a consumer's label points at and what assistive technology deals with.\ndefineOptions({ inheritAttrs: false })\nconst { rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\n// Declared as this component's own event, `click:icon-start` is out of `$attrs`, so the\n// listener is relayed to the field by hand — and only when the consumer wrote one.\nconst iconStartClick = iconStartListener((event) => emit('click:icon-start', event))\n\n/** What reaches the field: the consumer's own attributes, plus that listener. */\nconst fieldAttrs = computed(() => ({ ...forwardedAttrs.value, ...iconStartClick }))\n\nconst rootEl = ref<HTMLElement | null>(null)\nconst panelRef = ref<InstanceType<typeof VPopover> | null>(null)\nconst inputRef = ref<InstanceType<typeof VInput> | null>(null)\nconst pickerRef = ref<InstanceType<typeof VDatePicker> | null>(null)\n\n/** The real input inside the field, which the mask and the caret work on. */\nconst fieldEl = computed<HTMLInputElement | null>(() => inputRef.value?.el ?? null)\n\n/** What was asked for, falling back to the default when nothing or nonsense was given. */\nconst requestedMode = computed<DateInputMode>(() =>\n props.mode !== undefined && MODES.includes(props.mode) ? props.mode : 'input',\n)\n/**\n * What is actually used. Typing is only possible for a single date: a period or a list\n * has no form one could type into a single field.\n */\nconst resolvedMode = computed<DateInputMode>(() =>\n requestedMode.value === 'input' && props.selection === 'single' ? 'input' : 'picker',\n)\nconst typing = computed(() => resolvedMode.value === 'input')\n\n/**\n * Whether there is a panel at all. The calendar is only optional beside a field one can\n * type into: in `picker` mode it is the only way to choose anything, and a frozen field\n * has none at all.\n */\nconst hasPanel = computed(() => !props.readonly && (!typing.value || props.showPicker))\n\n// @devwarn\nif (isDev) {\n // The calendar receives `min` and `max` as they stand, so what it would say about them is\n // said here, under the name the consumer wrote (utils/hostWarns).\n provide(hostWarnsKey, true)\n watchEffect(() => {\n if (props.min && props.max && compareISO(props.min, props.max) > 0)\n console.warn(\n `[VDateInput] min \"${props.min}\" falls after max \"${props.max}\", so no date can be chosen.`,\n )\n // Without a panel there is no icon to draw and no button to name. A read-only field is\n // left out: it is a state that comes and goes, not a configuration to correct.\n if (typing.value && !props.showPicker) {\n const inert = ([] as string[]).concat(\n props.pickerIcon !== calendarTodayIcon ? 'pickerIcon' : [],\n props.pickerIconLabel ? 'pickerIconLabel' : [],\n )\n if (inert.length > 0)\n console.warn(\n `[VDateInput] ${inert.join(', ')} ${inert.length > 1 ? 'are' : 'is'} ignored without showPicker: a field one types into has no calendar icon unless it offers the calendar.`,\n )\n }\n if (props.mode !== undefined && !MODES.includes(props.mode))\n console.warn(\n `[VDateInput] unknown mode \"${props.mode}\": use \"input\" (the default) or \"picker\".`,\n )\n // Tested on the PROP and not on what was resolved from it: typing being the default,\n // a period or a list falls back on its own with nobody having asked for anything.\n // Only a consumer who explicitly asked to type deserves to be told it cannot work.\n if (props.mode === 'input' && props.selection !== 'single')\n console.warn(\n `[VDateInput] mode=\"input\" ignored in \"${props.selection}\" selection: a range or a list of dates cannot be typed on the keyboard.`,\n )\n // Here it is the RESOLVED mode that matters: the format really was supplied, and it\n // really will have no effect, whichever route led to a typed field. The warning stays\n // something the consumer can act on.\n if (props.displayFormat && typing.value)\n console.warn(\n '[VDateInput] displayFormat is ignored in \"input\" mode (the default): the field displays the locale\\'s numeric mask, the only typeable format. Pass mode=\"picker\" for a formatted display.',\n )\n })\n}\n\n// A VInputGroup joins several controls into one object, so the shape of this field is the\n// row's decision rather than its own (VInput/context.ts).\nconst group = inject(inputGroupKey, null)\nconst {\n size: resolvedSize,\n compact: resolvedCompact,\n disabled: resolvedDisabled,\n} = useControlShape(props, group)\n\n// The whole \"field plus panel\" shell, shared with VTimeInput: opening and closing, the\n// focus leaving the component and coming back to the field, a click on the field or its\n// icon, and the Escape, ArrowDown and Enter keys.\nconst {\n open,\n panelId,\n closeAndFocus,\n focusField,\n onFieldFocus,\n toggleFromIcon,\n onControlClick,\n onFocusout,\n onKeydown,\n onPanelMousedown,\n} = useFieldPanel({\n rootEl,\n panelRef,\n field: inputRef,\n // With no panel there is nothing to open. This is the composable's SINGLE cut-off\n // point, and every way in passes through it — clicking the field, focusing it, the\n // down arrow, Enter, the icon — so the condition never has to be repeated in a\n // handler.\n disabled: () => resolvedDisabled.value || !hasPanel.value,\n focusInPanel: () => pickerRef.value?.focus(),\n // The calendar stays mounted while the panel is closed, so it is put back on the days\n // view both ways: a field that opens on focus never goes through `focus()`.\n onOpen: () => pickerRef.value?.reset(),\n onClose: () => pickerRef.value?.reset(),\n // Beside a field one types into, the panel opens on focus WITHOUT taking it: typing\n // carries on in the field, and the down arrow remains the way into the grid.\n openOnFocus: () => typing.value,\n})\n\nconst hasValue = computed(() => {\n if (props.selection === 'multiple') return Array.isArray(model.value) && model.value.length > 0\n if (props.selection === 'range') {\n const r = model.value as DatePickerRange | null\n return !!(r && (r.start || r.end))\n }\n return typeof model.value === 'string' && !!model.value\n})\n\n/* TRAP — this component is the SINGLE place the locale is resolved: what flows down to the\n calendar is the RESULT, never the prop, which would usually be undefined and would have\n the calendar resolve the language a second time — with every chance of the two\n disagreeing after a later change. */\nconst resolvedLocale = useResolvedLocale(() => props.locale)\n\nconst displayText = computed(() => {\n const locale = resolvedLocale.value\n const displayFormat = props.displayFormat ?? DEFAULT_DISPLAY_FORMAT\n if (props.selection === 'single') {\n return typeof model.value === 'string' && isValidISO(model.value)\n ? formatDateDisplay(model.value, locale, displayFormat)\n : ''\n }\n if (props.selection === 'range') {\n const r = model.value as DatePickerRange | null\n if (!r?.start) return ''\n if (!r.end) return formatDateDisplay(r.start, locale, displayFormat)\n return formatDisplayRange(r.start, r.end, locale, displayFormat)\n }\n const list = Array.isArray(model.value) ? model.value : []\n return list.map((iso) => formatDateDisplay(iso, locale, displayFormat)).join(', ')\n})\n\n/* From here on: everything the typed field needs. */\n\nconst mask = computed(() => dateMaskFor(resolvedLocale.value))\nconst maskHint = computed(() => maskPlaceholder(resolvedLocale.value, mask.value))\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\n/**\n * Whether a date the reader has finished typing may actually be taken: it has to fall\n * within the allowed bounds and not be one of the excluded days.\n */\nconst acceptable = (iso: string) => isDateAllowed(iso, props.min, props.max, isDisabledDate.value)\n\n/*\n * The mask machinery — the text being typed, the bridge to the value, the reformatting\n * that preserves the caret, the commit as soon as the date is complete and the silent\n * revert when it is not — is shared with VTimeInput and lives in `useMaskedField`.\n *\n * What is injected here is the date VOCABULARY alone: the order of the fields, the\n * separator between them and their widths, all derived from the reader's language.\n */\nconst {\n draft,\n fieldModel,\n writeField,\n commitOrRevert,\n onFieldInput,\n onKeydown: onMaskKeydown,\n onPaste,\n} = useMaskedField({\n fieldEl,\n typing: () => typing.value,\n displayText: () => displayText.value,\n readValue: () =>\n typeof model.value === 'string' && isValidISO(model.value) ? model.value : null,\n writeValue: (iso) => {\n model.value = iso\n },\n maxDigits: () => mask.value.size,\n format: (digits) => formatDateMask(digits, mask.value),\n caret: (text, digitsBefore, inserting) =>\n caretAfterDigits(text, digitsBefore, inserting ? mask.value.separator : undefined),\n // A two-digit year is only expanded on the FINAL commit, when the reader leaves the\n // field — never while they are still typing, where \"26\" may well be on its way to\n // becoming \"2026\".\n parse: (text, final) =>\n parseDateMask(text, mask.value, final ? { yearPivot: YEAR_PIVOT } : undefined),\n toMask: (iso) => (iso ? isoToMask(iso, mask.value) : ''),\n acceptable,\n})\n\n/**\n * Typing anything that is not a digit — a slash, a dot, a space — completes the field\n * being typed with a leading zero and moves on to the next. It is what lets someone type\n * \"5/6/2026\" and get the same result as typing all eight digits.\n *\n * It applies to the day and the month only: a year cut short has no such convention, \"26\"\n * being neither 0026 nor 2026 until the reader has finished.\n */\nfunction padCurrentField(el: HTMLInputElement) {\n const start = el.selectionStart ?? el.value.length\n const before = digitsOf(el.value.slice(0, start)).length\n const digits = digitsOf(el.value)\n let offset = 0\n for (let k = 0; k < mask.value.order.length; k++) {\n const len = mask.value.lengths[k] as number\n if (before < offset + len) {\n const filled = before - offset\n if (mask.value.order[k] === 'year' || filled !== len - 1) return\n const next = digits.slice(0, offset) + '0'.repeat(len - filled) + digits.slice(offset)\n const text = formatDateMask(next.slice(0, mask.value.size), mask.value)\n writeField(text, caretAfterDigits(text, offset + len, mask.value.separator))\n return\n }\n offset += len\n }\n}\n\n// @keyboard — what the mask's keys mean for a date: a separator completes the field being\n// typed, and the down arrow is the one explicit way from the field into the calendar.\nfunction onFieldKeydown(event: KeyboardEvent) {\n onMaskKeydown(event, {\n onSeparator: padCurrentField,\n onArrowDown: () => {\n if (!open.value) return false\n pickerRef.value?.focus()\n return true\n },\n onEnter: closeAndFocus,\n })\n}\n\n/**\n * Pasting. A date recognizable as a whole — in the ISO form, or already written the way\n * this field writes them — is adopted as it stands; anything else contributes its digits\n * alone.\n */\nfunction onFieldPaste(event: ClipboardEvent) {\n onPaste(event, (pasted) =>\n isValidISO(pasted) ? pasted : parseDateMask(pasted, mask.value, { yearPivot: YEAR_PIVOT }),\n )\n}\n\n/*\n * The clear cross is the field's own, which renders it BEFORE the end icon rather than in\n * its place — the convention every field in the design system follows, so the two live\n * side by side.\n *\n * Whether it is shown has to be answered explicitly here: outside the typed mode the field\n * is read-only, and a read-only field hides its cross by default, rightly so — but here\n * the value comes from the panel, so there is something to clear all the same. The\n * `readonly` PROP is the one case where the default answer was right: frozen, the field\n * offers no route to a new value, so it offers no route to none either.\n */\nconst clearVisible = computed(() =>\n canClear(props, resolvedDisabled.value, hasValue.value || (typing.value && !!draft.value)),\n)\nconst endIcon = computed<IconSource | undefined>(() =>\n hasPanel.value ? props.pickerIcon : undefined,\n)\n// @a11y @devwarn\n/*\n * TRAP — the LABEL is defined at all times, even when no icon is rendered at all.\n *\n * The helper detecting a click handler on an icon warns AT SETUP if one is attached\n * without a label, and it has no way of knowing whether an icon exists. Since the\n * listener here is attached permanently and that detection is static, making the label\n * conditional would produce a false warning every time a field without a calendar is\n * mounted.\n *\n * The wording itself has no prop: the dictionary is where it is changed — see `src/i18n/`.\n */\nconst m = useMessages()\n\nconst endIconLabel = computed(() => props.pickerIconLabel ?? m.value.dateInput.openPicker)\nconst resolvedClearLabel = computed(() => props.clearLabel ?? m.value.dateInput.clear)\n\n/*\n * Emptying the value, called by the field as it emits its clear event. The focus is taken\n * through `focusField`, whose note says why that stops the panel reopening.\n */\nfunction clearValue() {\n model.value =\n props.selection === 'multiple'\n ? []\n : props.selection === 'range'\n ? { start: null, end: null }\n : null\n // The typed text is emptied EXPLICITLY: when the value was already empty, nothing\n // changes, and the guard that keeps the field and the value from chasing each other\n // would leave the text where it was.\n if (typing.value) writeField('')\n focusField()\n emit('clear')\n}\n\n/**\n * A date was chosen in the calendar. Choosing ONE date finishes the job, so the panel\n * closes; a period or a list is still being built and it stays open.\n */\nfunction onSelect() {\n if (props.selection === 'single') closeAndFocus()\n}\n\ndefineExpose({\n /** Moves the focus to the text field. */\n focus: (options?: FocusOptions) => inputRef.value?.focus(options),\n /** Selects what the field is showing. */\n select: () => inputRef.value?.select(),\n /** The real `<input>` behind the field, for what neither of the two above covers. */\n el: computed(() => inputRef.value?.el ?? null),\n})\n</script>\n\n<template>\n <div\n ref=\"rootEl\"\n class=\"v-date-input\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-open=\"open ? '' : undefined\"\n :data-mode=\"resolvedMode\"\n @focusout=\"onFocusout\"\n @keydown=\"onKeydown\"\n >\n <div class=\"v-date-input-control\" @click=\"onControlClick\">\n <!-- The field is declared a combobox rather than left as the plain text box it\n implicitly is, because a text box may not carry the attribute saying whether\n something is expanded — and a text field with a panel attached IS the combobox\n pattern, the same role VCombobox gives its own field.\n\n The role and the three attributes are all conditioned on the SAME thing, so the\n role never appears without the expanded state it requires, and nothing ever\n points at a panel that was not rendered. -->\n <VInput\n ref=\"inputRef\"\n v-model=\"fieldModel\"\n :inputmode=\"typing ? 'numeric' : undefined\"\n :autocomplete=\"typing ? 'off' : undefined\"\n v-bind=\"fieldAttrs\"\n :readonly=\"!typing || readonly\"\n :label=\"label\"\n :hint=\"hint\"\n :placeholder=\"placeholder ?? (typing ? maskHint : undefined)\"\n :size=\"resolvedSize\"\n :compact=\"resolvedCompact\"\n :disabled=\"resolvedDisabled\"\n :invalid=\"invalid\"\n :clearable=\"clearable\"\n :clear-visible=\"clearVisible\"\n :clear-label=\"resolvedClearLabel\"\n :icon-start=\"iconStart\"\n :icon-start-label=\"iconStartLabel\"\n :loading=\"loading\"\n :loading-label=\"loadingLabel\"\n :icon-end=\"endIcon\"\n :icon-end-label=\"endIconLabel\"\n :role=\"hasPanel ? 'combobox' : undefined\"\n :aria-haspopup=\"hasPanel ? 'dialog' : undefined\"\n :aria-expanded=\"hasPanel ? open : undefined\"\n :aria-controls=\"hasPanel ? panelId : undefined\"\n @click:icon-end=\"toggleFromIcon\"\n @clear=\"clearValue\"\n @focus=\"onFieldFocus\"\n @input=\"onFieldInput\"\n @change=\"commitOrRevert\"\n @blur=\"commitOrRevert\"\n @keydown=\"onFieldKeydown\"\n @paste=\"onFieldPaste\"\n >\n <template v-if=\"$slots.start\" #start><slot name=\"start\" /></template>\n <template v-if=\"$slots['value-end']\" #value-end><slot name=\"value-end\" /></template>\n </VInput>\n </div>\n\n <!-- With no panel rendered there is nothing to hold a reference to, and the open state\n — which is fed by the panel's own events — can no longer become true. The absence\n of a panel is therefore self-enforcing. -->\n <VPopover\n v-if=\"hasPanel\"\n :id=\"panelId\"\n ref=\"panelRef\"\n v-model:open=\"open\"\n mode=\"manual\"\n anchor=\"--date-input-anchor\"\n :placement=\"placement\"\n role=\"dialog\"\n :aria-label=\"label ?? m.dateInput.pickerLabel\"\n class=\"v-date-input-panel\"\n @mousedown=\"onPanelMousedown\"\n >\n <VDatePicker\n ref=\"pickerRef\"\n v-model=\"model\"\n :selection=\"selection\"\n :locale=\"resolvedLocale\"\n :first-day-of-week=\"firstDayOfWeek\"\n :min=\"min\"\n :max=\"max\"\n :disabled-dates=\"disabledDates\"\n :show-adjacent-days=\"showAdjacentDays\"\n :select-adjacent-days=\"selectAdjacentDays\"\n :events=\"events\"\n @select=\"onSelect\"\n >\n <template v-if=\"$slots.day\" #day=\"slotProps\">\n <slot name=\"day\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" :close=\"closeAndFocus\" />\n </template>\n </VDatePicker>\n </VPopover>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-input {\n /* Confines the anchor to this instance (the root = the common ancestor of the\n control and the panel) */\n anchor-scope: --date-input-anchor;\n display: block;\n width: 100%;\n font-family: var(--vectis-text-family);\n }\n\n .v-date-input-control {\n display: block;\n cursor: pointer;\n }\n\n /* The anchor is the FIELD's box and not this wrapper's, which also holds the label and\n the hint: anchored to the wrapper, the calendar opens a hint's height below the field,\n and a label's height above it once there is no room below and `flip-block` turns it\n over. Against the field it covers whichever of the two it lands on, which is what a\n panel belonging to a control is supposed to do. */\n .v-date-input-control .v-input-field {\n anchor-name: --date-input-anchor;\n }\n\n /* Input mode: the field is editable, and the <input>'s text caret takes over from the\n control's `pointer` (which signals \"this opens a panel\"). The mask has a fixed width:\n tabular figures, otherwise the caret jitters from one digit to the next. */\n .v-date-input[data-mode='input'] .v-date-input-control {\n cursor: text;\n }\n\n .v-date-input[data-mode='input'] .v-input-control {\n font-variant-numeric: tabular-nums;\n }\n\n /* `position-anchor` and the chrome come from VPopover (the `anchor` prop, and the\n `.v-panel` it sets on any panel that is not `bare`): only the dimensions are left here,\n which `panel.css` deliberately does not carry. The panel's OWN padding is cancelled,\n VDatePicker padding itself as VTimePicker does, so both pickers keep the same room\n on a page and in a panel. Compounded with `.v-popover-panel` (VPopover puts both\n classes on the same element) because `.v-panel` declares `padding` too, and at\n equal specificity the winner would depend on the order in which the consumer's\n bundler concatenates the CSS. */\n .v-popover-panel.v-date-input-panel {\n width: max-content;\n padding: 0;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;qCA+EM,IAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAVnB,IAAM,IAAyB,CAAC,UAAU,OAAO,GAY3C,KAAqD;GACzD,KAAK;GACL,OAAO;GACP,MAAM;EACR,GA8GM,IAAQ,GAgDR,IAAQ,GAA4B,GAAA,YAAkB,GAEtD,IAAO,GA+BP,EAAE,cAAW,eAAW,uBAAmB,EAAa,GAIxD,KAAiB,GAAmB,MAAU,EAAK,oBAAoB,CAAK,CAAC,GAG7E,KAAa,SAAgB;GAAE,GAAG,GAAe;GAAO,GAAG;EAAe,EAAE,GAE5E,IAAS,EAAwB,IAAI,GACrC,IAAW,EAA0C,IAAI,GACzD,IAAW,EAAwC,IAAI,GACvD,IAAY,EAA6C,IAAI,GAG7D,KAAU,QAAwC,EAAS,OAAO,MAAM,IAAI,GAG5E,KAAgB,QACpB,EAAM,SAAS,KAAA,KAAa,EAAM,SAAS,EAAM,IAAI,IAAI,EAAM,OAAO,OACxE,GAKM,IAAe,QACnB,GAAc,UAAU,WAAW,EAAM,cAAc,WAAW,UAAU,QAC9E,GACM,IAAS,QAAe,EAAa,UAAU,OAAO,GAOtD,IAAW,QAAe,CAAC,EAAM,aAAa,CAAC,EAAO,SAAS,EAAM,WAAW,GAgDhF,EACJ,MAAM,IACN,SAAS,IACT,UAAU,MACR,EAAgB,GALN,GAAO,GAAe,IAKT,CAAK,GAK1B,EACJ,SACA,YACA,kBACA,gBACA,kBACA,oB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AAA,CAAA;;cAC1CA,EAAAA,OAAM,eAAA;SAAgB;eAAmC,CAAzB,EAAyB,EAAA,QAAA,WAAA,CAAA,CAAA;;oWAQrE,EAAA,SAAA,EAAA,GADR,GAkCW,GAAA;;GAhCR,IAAI,EAAA,CAAA;YACD;GAAJ,KAAI;GACI,MAAM,EAAA,CAAA;6CAAI,QAAA,IAAA;GAClB,MAAK;GACL,QAAO;GACN,WAAW,EAAA;GACZ,MAAK;GACJ,cAAY,EAAA,SAAS,EAAA,CAAA,CAAC,CAAC,UAAU;GAClC,OAAM;GACL,aAAW,EAAA,EAAA;;oBAsBE,CApBd,EAoBc,IAAA;aAnBR;IAAJ,KAAI;gBACK,EAAA;6CAAK,QAAA;IACb,WAAW,EAAA;IACX,QAAQ,EAAA,CAAA;IACR,qBAAmB,EAAA;IACnB,KAAK,EAAA;IACL,KAAK,EAAA;IACL,kBAAgB,EAAA;IAChB,sBAAoB,EAAA;IACpB,wBAAsB,EAAA;IACtB,QAAQ,EAAA;IACA;mBAEOA,EAAAA,OAAO,MAAA;UAAM;WAAK,MAAS,CACzC,EAAsC,EAAA,QAAA,OAAA,EAAA,GAAb,CAAS,CAAA,CAAA,CAAA,CAAA;;eAEpBA,EAAAA,OAAO,SAAA;UAAS;gBACe,CAA7C,EAA6C,EAAA,QAAA,UAAA,EAAxB,OAAO,EAAA,CAAA,EAAa,CAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-date-picker{--date-picker-day-size:var(--vectis-date-picker-day-size,var(--vectis-control-height-md));--date-picker-cell:max(var(--vectis-control-size-date-picker-cell), calc(var(--date-picker-day-size) + var(--vectis-space-1)));gap:var(--vectis-space-2);padding:var(--vectis-space-3);font-family:var(--vectis-text-family);color:var(--vectis-color-text);flex-direction:column;display:inline-flex}.v-date-picker-header{justify-content:space-between;align-items:center;gap:var(--vectis-space-2);display:flex}.v-date-picker-nav{align-items:center;display:flex}.v-date-picker-view-toggle{min-inline-size:var(--vectis-control-size-date-picker-nav-min);font-weight:var(--vectis-font-weight-semibold);text-transform:capitalize}.v-date-picker-grid{min-inline-size:calc(7 * var(--date-picker-cell))}.v-date-picker-weekdays,.v-date-picker-week{grid-template-columns:repeat(7,1fr);display:grid}.v-date-picker-weekday{height:var(--vectis-control-height-sm);font-size:var(--vectis-text-overline-size);font-weight:var(--vectis-text-overline-weight);letter-spacing:var(--vectis-text-overline-tracking);color:var(--vectis-color-text-muted);text-transform:capitalize;justify-content:center;align-items:center;display:flex}.v-date-picker-cell{height:var(--date-picker-cell);justify-content:center;align-items:center;display:flex;position:relative}.v-date-picker-cell[data-in-range]:before{content:"";inset-block:calc((100% - var(--date-picker-day-size)) / 2);background:var(--vectis-color-accent-surface);z-index:0;position:absolute;inset-inline:0}.v-date-picker-cell[data-range-start]:before{border-start-start-radius:var(--vectis-radius-pill);border-end-start-radius:var(--vectis-radius-pill);inset-inline-start:calc((100% - var(--date-picker-day-size)) / 2)}.v-date-picker-cell[data-range-end]:before{border-start-end-radius:var(--vectis-radius-pill);border-end-end-radius:var(--vectis-radius-pill);inset-inline-end:calc((100% - var(--date-picker-day-size)) / 2)}.v-date-picker-cell[data-range-start][data-range-end]:before{content:none}.v-date-picker-day{z-index:1;inline-size:var(--date-picker-day-size);block-size:var(--date-picker-day-size);border-radius:var(--vectis-radius-pill);color:inherit;font:inherit;font-size:var(--vectis-text-body-md-size);cursor:pointer;transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default), color var(--vectis-duration-fast) var(--vectis-ease-default);background:0 0;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.v-date-picker-day:hover:not([aria-disabled=true]):not([data-selected]):not(.v-date-picker-day--static){background:var(--vectis-color-surface-muted)}.v-date-picker-day[data-outside]{color:var(--vectis-color-text-subtle)}.v-date-picker-day[data-today]:not([data-selected]){box-shadow:inset 0 0 0 1px var(--vectis-color-accent-border);color:var(--vectis-color-accent-text);font-weight:var(--vectis-font-weight-semibold)}.v-date-picker-day[data-selected]{background:var(--vectis-color-accent);color:var(--vectis-color-text-on-accent);font-weight:var(--vectis-font-weight-semibold)}.v-date-picker-day[aria-disabled=true]{color:var(--vectis-color-text-subtle);cursor:not-allowed;text-decoration:line-through}.v-date-picker-day--static{color:var(--vectis-color-text-subtle);cursor:default}.v-date-picker-day--static[data-disabled]{cursor:not-allowed;text-decoration:line-through}.v-date-picker-day:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:var(--vectis-focus-ring-offset)}.v-date-picker-day-num{line-height:var(--vectis-text-control-leading)}.v-date-picker-dots{gap:2px;display:flex;position:absolute;inset-block-end:calc(var(--vectis-space-1) * .5)}.v-date-picker-dot{inline-size:var(--vectis-control-size-date-picker-dot);block-size:var(--vectis-control-size-date-picker-dot);border-radius:var(--vectis-radius-pill);background:var(--date-picker-dot-color,var(--vectis-color-accent))}.v-date-picker-day[data-selected] .v-date-picker-dot{background:var(--vectis-color-text-on-accent)}.v-date-picker-view{gap:var(--vectis-space-1);min-inline-size:calc(7 * var(--date-picker-cell));grid-template-columns:repeat(3,1fr);display:grid}.v-date-picker-view-row{display:contents}.v-date-picker-view--years{max-block-size:calc(6 * var(--date-picker-cell));overflow-y:auto}.v-date-picker-view-cell{block-size:var(--vectis-control-height-lg);border-radius:var(--vectis-radius-pill);color:inherit;font:inherit;font-size:var(--vectis-text-body-md-size);text-transform:capitalize;cursor:pointer;transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default);background:0 0;border:none;justify-content:center;align-items:center;display:flex}.v-date-picker-view-cell:hover:not(:disabled):not([data-selected]){background:var(--vectis-color-surface-muted)}.v-date-picker-view-cell[data-selected]{background:var(--vectis-color-accent);color:var(--vectis-color-text-on-accent);font-weight:var(--vectis-font-weight-semibold)}.v-date-picker-view-cell:disabled{color:var(--vectis-color-text-subtle);cursor:not-allowed}.v-date-picker-view-cell:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:calc(-1 * var(--vectis-focus-ring-width))}.v-date-picker-footer{justify-content:flex-end;align-items:center;gap:var(--vectis-space-2);border-block-start:1px solid var(--vectis-color-border);padding-block-start:var(--vectis-space-2);display:flex}@media (prefers-reduced-motion:reduce){.v-date-picker-day,.v-date-picker-view-cell{transition:none}}}
2
+ @layer vectis.components{.v-date-picker{--date-picker-cell:max(var(--vectis-control-size-date-picker-cell), calc(var(--vectis-control-size-date-picker-day) + var(--vectis-space-1)));gap:var(--vectis-space-2);padding:var(--vectis-space-3);font-family:var(--vectis-text-family);color:var(--vectis-color-text);flex-direction:column;display:inline-flex}.v-date-picker-header{justify-content:space-between;align-items:center;gap:var(--vectis-space-2);display:flex}.v-date-picker-nav{align-items:center;display:flex}.v-date-picker-view-toggle{min-inline-size:var(--vectis-control-size-date-picker-nav-min);font-weight:var(--vectis-font-weight-semibold);text-transform:capitalize}.v-date-picker-grid{min-inline-size:calc(7 * var(--date-picker-cell))}.v-date-picker-weekdays,.v-date-picker-week{grid-template-columns:repeat(7,1fr);display:grid}.v-date-picker-weekday{height:var(--vectis-control-height-sm);font-size:var(--vectis-text-overline-size);font-weight:var(--vectis-text-overline-weight);letter-spacing:var(--vectis-text-overline-tracking);color:var(--vectis-color-text-muted);text-transform:capitalize;justify-content:center;align-items:center;display:flex}.v-date-picker-cell{height:var(--date-picker-cell);justify-content:center;align-items:center;display:flex;position:relative}.v-date-picker-cell[data-in-range]:before{content:"";inset-block:calc((100% - var(--vectis-control-size-date-picker-day)) / 2);background:var(--vectis-color-accent-surface);z-index:0;position:absolute;inset-inline:0}.v-date-picker-cell[data-range-start]:before{border-start-start-radius:var(--vectis-radius-pill);border-end-start-radius:var(--vectis-radius-pill);inset-inline-start:calc((100% - var(--vectis-control-size-date-picker-day)) / 2)}.v-date-picker-cell[data-range-end]:before{border-start-end-radius:var(--vectis-radius-pill);border-end-end-radius:var(--vectis-radius-pill);inset-inline-end:calc((100% - var(--vectis-control-size-date-picker-day)) / 2)}.v-date-picker-cell[data-range-start][data-range-end]:before{content:none}.v-date-picker-day{z-index:1;inline-size:var(--vectis-control-size-date-picker-day);block-size:var(--vectis-control-size-date-picker-day);border-radius:var(--vectis-radius-pill);color:inherit;font:inherit;font-size:var(--vectis-text-body-md-size);cursor:pointer;transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default), color var(--vectis-duration-fast) var(--vectis-ease-default);background:0 0;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.v-date-picker-day:hover:not([aria-disabled=true]):not([data-selected]):not(.v-date-picker-day--static){background:var(--vectis-color-surface-muted)}.v-date-picker-day[data-outside]{color:var(--vectis-color-text-subtle)}.v-date-picker-day[data-today]:not([data-selected]){box-shadow:inset 0 0 0 1px var(--vectis-color-accent-border);color:var(--vectis-color-accent-text);font-weight:var(--vectis-font-weight-semibold)}.v-date-picker-day[data-selected]{background:var(--vectis-color-accent);color:var(--vectis-color-text-on-accent);font-weight:var(--vectis-font-weight-semibold)}.v-date-picker-day[data-unavailable]{color:var(--vectis-color-text-subtle);cursor:not-allowed;text-decoration:line-through}.v-date-picker[data-readonly] .v-date-picker-day:not([data-unavailable]){cursor:default}.v-date-picker-day:disabled{color:var(--vectis-color-text-subtle);cursor:not-allowed}.v-date-picker[data-disabled] .v-date-picker-day[data-selected]{background:var(--vectis-color-surface-muted);color:var(--vectis-color-text-subtle)}.v-date-picker-day--static{color:var(--vectis-color-text-subtle);cursor:default}.v-date-picker-day--static[data-disabled]{cursor:not-allowed;text-decoration:line-through}.v-date-picker-day:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:var(--vectis-focus-ring-offset)}.v-date-picker-day-num{line-height:var(--vectis-text-control-leading)}.v-date-picker-dots{gap:2px;display:flex;position:absolute;inset-block-end:calc(var(--vectis-space-1) * .5)}.v-date-picker-dot{inline-size:var(--vectis-control-size-date-picker-dot);block-size:var(--vectis-control-size-date-picker-dot);border-radius:var(--vectis-radius-pill);background:var(--date-picker-dot-color,var(--vectis-color-accent))}.v-date-picker-day[data-selected] .v-date-picker-dot{background:var(--vectis-color-text-on-accent)}.v-date-picker-view{gap:var(--vectis-space-1);min-inline-size:calc(7 * var(--date-picker-cell));grid-template-columns:repeat(3,1fr);display:grid}.v-date-picker-view-row{display:contents}.v-date-picker-view--years{max-block-size:calc(6 * var(--date-picker-cell));overflow-y:auto}.v-date-picker-view-cell{block-size:var(--vectis-control-height-lg);border-radius:var(--vectis-radius-pill);color:inherit;font:inherit;font-size:var(--vectis-text-body-md-size);text-transform:capitalize;cursor:pointer;transition:background-color var(--vectis-duration-fast) var(--vectis-ease-default);background:0 0;border:none;justify-content:center;align-items:center;display:flex}.v-date-picker-view-cell:hover:not(:disabled):not([data-selected]){background:var(--vectis-color-surface-muted)}.v-date-picker-view-cell[data-selected]{background:var(--vectis-color-accent);color:var(--vectis-color-text-on-accent);font-weight:var(--vectis-font-weight-semibold)}.v-date-picker-view-cell:disabled{color:var(--vectis-color-text-subtle);cursor:not-allowed}.v-date-picker-view-cell:focus-visible{outline:var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);outline-offset:calc(-1 * var(--vectis-focus-ring-width))}.v-date-picker-footer{justify-content:flex-end;align-items:center;gap:var(--vectis-space-2);border-block-start:1px solid var(--vectis-color-border);padding-block-start:var(--vectis-space-2);display:flex}@media (prefers-reduced-motion:reduce){.v-date-picker-day,.v-date-picker-view-cell{transition:none}}}
@@ -1,23 +1,9 @@
1
- /**
2
- * A calendar shown directly in the page, as a grid of days, with a month view and a
3
- * year view behind it. It holds ALL the date, view and keyboard logic of the design
4
- * system; VDateInput does no more than dress it in a text field and a popover.
5
- *
6
- * The platform offers no accessible date grid to build on — `<input type="date">`
7
- * can be neither styled nor composed — so the JavaScript here implements the ARIA
8
- * "grid" pattern by hand: a single cell in the tab order at a time, arrow and
9
- * page keys to move between dates, and selection of one date, a range or a list.
10
- * None of that can be expressed in HTML and CSS alone.
11
- *
12
- * Every date is handled in local time as an ISO `YYYY-MM-DD` string (see
13
- * `utils/date`), which is what keeps the server and the browser in agreement.
14
- */
15
1
  export type DatePickerSelection = 'single' | 'range' | 'multiple';
16
2
  /**
17
3
  * A period between two dates, the value of a `range` selection. Either bound may be
18
4
  * null: between the first and the second click, a range has a start and no end yet.
19
5
  */
20
- export interface DateRange {
6
+ export interface DatePickerRange {
21
7
  /** The first day of the period, as an ISO `YYYY-MM-DD` string. */
22
8
  start: string | null;
23
9
  /** The last day of the period, as an ISO `YYYY-MM-DD` string. */
@@ -36,9 +22,28 @@ export interface DatePickerEvent {
36
22
  * Which dates cannot be selected, given either as a list of ISO strings or as a
37
23
  * function answering that question for a date.
38
24
  */
39
- export type DateMatcher = string[] | ((iso: string) => boolean);
25
+ export type DatePickerMatcher = string[] | ((iso: string) => boolean);
40
26
  /** The shape of the v-model, which follows whichever `selection` is in use. */
41
- export type DatePickerValue = string | null | DateRange | string[];
27
+ export type DatePickerValue = string | null | DatePickerRange | string[];
28
+ /** Everything the `#day` slot is told about the day it draws. */
29
+ export interface DatePickerDaySlotProps {
30
+ /** The day, as an ISO `YYYY-MM-DD` string. */
31
+ iso: string;
32
+ /** The day of the month. */
33
+ day: number;
34
+ /** Whether it belongs to the month on display rather than to a neighbouring one. */
35
+ inMonth: boolean;
36
+ /** Whether it cannot be chosen: outside the bounds, or excluded by `disabledDates`. */
37
+ disabled: boolean;
38
+ /** Whether it is selected. */
39
+ selected: boolean;
40
+ /** Whether it is today. */
41
+ today: boolean;
42
+ /** Whether it falls inside the selected period, both ends included. */
43
+ inRange: boolean;
44
+ /** The events that fall on it. */
45
+ events: DatePickerEvent[];
46
+ }
42
47
  interface DatePickerProps {
43
48
  /**
44
49
  * What the reader is picking: a single date, a period between two dates, or any
@@ -71,7 +76,7 @@ interface DatePickerProps {
71
76
  * Dates that cannot be chosen, given as a list of ISO strings or as a function.
72
77
  * They stay visible, struck through, and can still be reached with the keyboard.
73
78
  */
74
- disabledDates?: DateMatcher;
79
+ disabledDates?: DatePickerMatcher;
75
80
  /**
76
81
  * Also fills the empty corners of the grid with the greyed days of the neighbouring
77
82
  * months. It is off by default.
@@ -84,6 +89,23 @@ interface DatePickerProps {
84
89
  selectAdjacentDays?: boolean;
85
90
  /** The events to mark, as up to three coloured dots under the day they fall on. */
86
91
  events?: DatePickerEvent[];
92
+ /**
93
+ * Makes the whole calendar unusable: no date can be chosen, no month reached, and
94
+ * everything greys out through the colour tokens.
95
+ */
96
+ disabled?: boolean;
97
+ /**
98
+ * Shows what is selected without letting it be changed. The calendar can still be
99
+ * read and walked through — another month, another year — which is what separates it
100
+ * from `disabled`.
101
+ */
102
+ readonly?: boolean;
103
+ /**
104
+ * The accessible name of the whole picker, its header and its grid together. A range
105
+ * shown as two calendars side by side needs one each, or a screen reader announces the
106
+ * same group twice. It falls back to the dictionary, and a consumer `aria-label` wins.
107
+ */
108
+ label?: string;
87
109
  }
88
110
  type __VLS_Props = DatePickerProps;
89
111
  type __VLS_Slots = {
@@ -92,16 +114,7 @@ type __VLS_Slots = {
92
114
  * number, for instance. It receives everything known about that day, including
93
115
  * whether it belongs to the displayed month.
94
116
  */
95
- day?(props: {
96
- iso: string;
97
- day: number;
98
- inMonth: boolean;
99
- disabled: boolean;
100
- selected: boolean;
101
- today: boolean;
102
- inRange: boolean;
103
- events: DatePickerEvent[];
104
- }): unknown;
117
+ day?(props: DatePickerDaySlotProps): unknown;
105
118
  /** The strip under the grid, for actions such as Close or Save, or for preset dates. */
106
119
  footer?(): unknown;
107
120
  };
@@ -109,13 +122,28 @@ type __VLS_Slots = {
109
122
  * Brings the focus into the grid, on the day the calendar is currently showing. This
110
123
  * is what VDateInput calls when it opens its panel.
111
124
  */
112
- declare function focus(): void;
125
+ declare function focus(options?: FocusOptions): void;
126
+ declare function reset(): void;
113
127
  type __VLS_ModelProps = {
128
+ /**
129
+ * What is selected, and its SHAPE follows `selection`: an ISO `YYYY-MM-DD` string for
130
+ * `single`, a `{ start, end }` pair for `range`, an array of strings for `multiple`. Nothing
131
+ * is selected to begin with.
132
+ *
133
+ * Every date is a plain local-time string, never a `Date`, so the value a consumer receives
134
+ * cannot shift a day across time zones.
135
+ */
114
136
  modelValue?: DatePickerValue;
115
137
  };
116
138
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
117
139
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
140
+ /** Brings the focus into the grid, onto the day the calendar is showing. */
118
141
  focus: typeof focus;
142
+ /**
143
+ * Returns to the days view, on the selected date or today, without moving the focus.
144
+ * VDateInput calls it each time its panel opens and closes.
145
+ */
146
+ reset: typeof reset;
119
147
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
120
148
  select: (value: DatePickerValue) => any;
121
149
  "update:modelValue": (value: DatePickerValue) => any;
@@ -123,12 +151,15 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
123
151
  onSelect?: ((value: DatePickerValue) => any) | undefined;
124
152
  "onUpdate:modelValue"?: ((value: DatePickerValue) => any) | undefined;
125
153
  }>, {
154
+ label: string;
126
155
  selection: DatePickerSelection;
156
+ disabled: boolean;
157
+ readonly: boolean;
127
158
  max: string;
128
159
  min: string;
129
160
  locale: string;
130
161
  firstDayOfWeek: number;
131
- disabledDates: DateMatcher;
162
+ disabledDates: DatePickerMatcher;
132
163
  showAdjacentDays: boolean;
133
164
  selectAdjacentDays: boolean;
134
165
  events: DatePickerEvent[];
@@ -1 +1 @@
1
- {"version":3,"file":"VDatePicker.js","names":[],"sources":["../../../src/components/VDatePicker/VDatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, useId, watch } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { arrow_drop_down as arrowDropDownIcon } from '../VIcon/icons/arrow_drop_down'\nimport { arrow_drop_up as arrowDropUpIcon } from '../VIcon/icons/arrow_drop_up'\nimport { chevron_left as chevronLeftIcon } from '../VIcon/icons/chevron_left'\nimport { chevron_right as chevronRightIcon } from '../VIcon/icons/chevron_right'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport {\n addDays,\n addMonths,\n buildMonthGrid,\n clampISO,\n compareISO,\n daysInMonth,\n firstDayOfWeekFor,\n formatISO,\n isoOf,\n isSameISO,\n isValidISO,\n isWithin,\n monthName,\n monthNamesCompact,\n parseISO,\n weekdayNames,\n} from '../../utils/date'\n\nimport { PICKER_COLUMNS, dayStep, gridDelta } from './keyboard'\n\nimport { toggleValue } from '../../utils/array'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { clamp } from '../../utils/number'\nimport { useLocale, useMessages } from '../../i18n/state'\n\n// @a11y @keyboard @core\n/**\n * A calendar shown directly in the page, as a grid of days, with a month view and a\n * year view behind it. It holds ALL the date, view and keyboard logic of the design\n * system; VDateInput does no more than dress it in a text field and a popover.\n *\n * The platform offers no accessible date grid to build on — `<input type=\"date\">`\n * can be neither styled nor composed — so the JavaScript here implements the ARIA\n * \"grid\" pattern by hand: a single cell in the tab order at a time, arrow and\n * page keys to move between dates, and selection of one date, a range or a list.\n * None of that can be expressed in HTML and CSS alone.\n *\n * Every date is handled in local time as an ISO `YYYY-MM-DD` string (see\n * `utils/date`), which is what keeps the server and the browser in agreement.\n */\nexport type DatePickerSelection = 'single' | 'range' | 'multiple'\n\n/**\n * A period between two dates, the value of a `range` selection. Either bound may be\n * null: between the first and the second click, a range has a start and no end yet.\n */\nexport interface DateRange {\n /** The first day of the period, as an ISO `YYYY-MM-DD` string. */\n start: string | null\n /** The last day of the period, as an ISO `YYYY-MM-DD` string. */\n end: string | null\n}\n\n/** Something happening on a given day, shown as a coloured dot under its number. */\nexport interface DatePickerEvent {\n /** The day it falls on, as an ISO `YYYY-MM-DD` string. */\n date: string\n /** The colour of the dot, as any CSS colour. It is the accent colour by default. */\n color?: string\n /** A description of the event for assistive technology. */\n label?: string\n}\n\n/**\n * Which dates cannot be selected, given either as a list of ISO strings or as a\n * function answering that question for a date.\n */\nexport type DateMatcher = string[] | ((iso: string) => boolean)\n\n/** The shape of the v-model, which follows whichever `selection` is in use. */\nexport type DatePickerValue = string | null | DateRange | string[]\n\ninterface DatePickerProps {\n /**\n * What the reader is picking: a single date, a period between two dates, or any\n * number of separate dates. It determines the shape of the v-model.\n */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names and the first day of the\n * week. It TAKES PRECEDENCE over the design system's global locale (`setLocale`)\n * and falls back to it — which is why it has no literal default here: `undefined`\n * has to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /**\n * Forces the day the weeks start on (0 for Sunday through 6 for Saturday). Left\n * out, the locale decides.\n */\n firstDayOfWeek?: number\n /**\n * The earliest selectable date, as an ISO string. Neither navigation nor selection\n * goes back beyond it.\n */\n min?: string\n /**\n * The latest selectable date, as an ISO string. Neither navigation nor selection\n * goes past it.\n */\n max?: string\n /**\n * Dates that cannot be chosen, given as a list of ISO strings or as a function.\n * They stay visible, struck through, and can still be reached with the keyboard.\n */\n disabledDates?: DateMatcher\n /**\n * Also fills the empty corners of the grid with the greyed days of the neighbouring\n * months. It is off by default.\n */\n showAdjacentDays?: boolean\n /**\n * Lets those neighbouring days be clicked, which moves the calendar to their month.\n * A clickable day has to be visible, so this implies showing them.\n */\n selectAdjacentDays?: boolean\n /** The events to mark, as up to three coloured dots under the day they fall on. */\n events?: DatePickerEvent[]\n}\n\nconst props = withDefaults(defineProps<DatePickerProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n})\n\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /**\n * Emitted every time a date is chosen, carrying the complete value as it now\n * stands. VDateInput listens to it to close its panel on a single selection.\n */\n select: [value: DatePickerValue]\n}>()\n\ndefineSlots<{\n /**\n * Replaces the content of a day cell — to show a price or an availability under the\n * number, for instance. It receives everything known about that day, including\n * whether it belongs to the displayed month.\n */\n day?(props: {\n iso: string\n day: number\n inMonth: boolean\n disabled: boolean\n selected: boolean\n today: boolean\n inRange: boolean\n events: DatePickerEvent[]\n }): unknown\n /** The strip under the grid, for actions such as Close or Save, or for preset dates. */\n footer?(): unknown\n}>()\n\nconst gridLabelId = useId()\n\n// The navigation labels have no prop of their own: the dictionary is the single\n// place to change them, globally or per language — see `src/i18n/`.\nconst m = useMessages()\nconst vectisLocale = useLocale()\n/*\n * The prop 'locale' wins, and the design system's global locale is what it falls back to.\n * Every read below goes through this one derivation, so the two sources can never be consulted\n * in a different order somewhere else.\n */\nconst resolvedLocale = computed(() => props.locale ?? vectisLocale.value)\n\nconst resolvedFirstDay = computed(\n () => props.firstDayOfWeek ?? firstDayOfWeekFor(resolvedLocale.value),\n)\nconst weekdays = computed(() => weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'short'))\nconst weekdaysLong = computed(() =>\n weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'long'),\n)\nconst monthLabels = computed(() => monthNamesCompact(resolvedLocale.value))\n\nconst singleValue = computed(() =>\n props.selection === 'single' && typeof model.value === 'string' && isValidISO(model.value)\n ? model.value\n : null,\n)\nconst rangeValue = computed<DateRange>(() => {\n if (\n props.selection === 'range' &&\n model.value &&\n typeof model.value === 'object' &&\n !Array.isArray(model.value)\n ) {\n return model.value as DateRange\n }\n return { start: null, end: null }\n})\nconst multipleValues = computed<string[]>(() =>\n props.selection === 'multiple' && Array.isArray(model.value) ? model.value : [],\n)\n\n// `focusedISO` is the single source of truth for the view: the month on display is\n// derived from it, never stored separately, so the two cannot drift apart.\nfunction initialFocus(): string {\n if (singleValue.value) return singleValue.value\n if (rangeValue.value.start) return rangeValue.value.start\n if (multipleValues.value[0]) return multipleValues.value[0]\n // With nothing selected, the calendar opens on today, brought back inside the\n // allowed bounds.\n return clampISO(formatISO(new Date()), props.min, props.max)\n}\nconst focusedISO = ref(initialFocus())\nconst view = ref<'days' | 'months' | 'years'>('days')\n\nconst viewYear = computed(\n () => parseISO(focusedISO.value)?.getFullYear() ?? new Date().getFullYear(),\n)\nconst viewMonth0 = computed(() => parseISO(focusedISO.value)?.getMonth() ?? 0)\nconst monthLabel = computed(() => monthName(resolvedLocale.value, viewMonth0.value, 'long'))\nconst gridLabel = computed(() => `${monthLabel.value} ${viewYear.value}`)\n\n// @ssr\n// Today's date is only read once the component is mounted, hence on the client: the\n// server has no way to know it, and rendering it during setup would make the two\n// markups differ and break hydration.\nconst today = ref<string | null>(null)\nonMounted(() => {\n today.value = formatISO(new Date())\n})\n\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\nconst eventsByDate = computed(() => {\n const map = new Map<string, DatePickerEvent[]>()\n for (const ev of props.events ?? []) {\n const list = map.get(ev.date) ?? []\n list.push(ev)\n map.set(ev.date, list)\n }\n return map\n})\n\nconst hoverISO = ref<string | null>(null)\nfunction orderRange(a: string, b: string): DateRange {\n return compareISO(a, b) <= 0 ? { start: a, end: b } : { start: b, end: a }\n}\nconst effectiveRange = computed<DateRange>(() => {\n if (props.selection !== 'range') return { start: null, end: null }\n const r = rangeValue.value\n if (r.start && r.end) return orderRange(r.start, r.end)\n // A start is set but the end is still pending: the range is previewed up to\n // whichever day the pointer or the focus is currently on.\n const preview = hoverISO.value ?? focusedISO.value\n if (r.start && preview) return orderRange(r.start, preview)\n return { start: r.start, end: r.end }\n})\n\nfunction isSelected(iso: string): boolean {\n if (props.selection === 'single') return isSameISO(iso, singleValue.value)\n if (props.selection === 'multiple') return multipleValues.value.includes(iso)\n // In range selection, the two ends of the period count as selected — including the\n // provisional end shown during the preview.\n return isSameISO(iso, effectiveRange.value.start) || isSameISO(iso, effectiveRange.value.end)\n}\nfunction isInRange(iso: string): boolean {\n const { start, end } = effectiveRange.value\n return !!start && !!end && compareISO(iso, start) >= 0 && compareISO(iso, end) <= 0\n}\n\ntype DayCell = {\n iso: string\n day: number\n kind: 'empty' | 'static' | 'button'\n inMonth: boolean\n disabled: boolean\n selected: boolean\n rangeStart: boolean\n rangeEnd: boolean\n inRange: boolean\n today: boolean\n events: DatePickerEvent[]\n}\n\nconst days = computed<DayCell[]>(() =>\n buildMonthGrid(viewYear.value, viewMonth0.value, resolvedFirstDay.value).map((cell) => {\n const inMonth = cell.adjacent === null\n // Making the neighbouring days clickable implies showing them: a day nobody can\n // see cannot be clicked.\n const show = inMonth || props.showAdjacentDays || props.selectAdjacentDays\n const selectable = inMonth || props.selectAdjacentDays\n const disabled = !isWithin(cell.iso, props.min, props.max) || isDisabledDate.value(cell.iso)\n const kind: DayCell['kind'] = !show ? 'empty' : selectable ? 'button' : 'static'\n return {\n iso: cell.iso,\n day: parseISO(cell.iso)?.getDate() ?? 0,\n kind,\n inMonth,\n disabled,\n selected: kind === 'button' && !disabled && isSelected(cell.iso),\n rangeStart: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.start),\n rangeEnd: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.end),\n inRange: props.selection === 'range' && isInRange(cell.iso),\n today: isSameISO(cell.iso, today.value),\n events: eventsByDate.value.get(cell.iso) ?? [],\n }\n }),\n)\nconst weeks = computed(() => {\n const rows: DayCell[][] = []\n for (let i = 0; i < days.value.length; i += 7) rows.push(days.value.slice(i, i + 7))\n return rows\n})\n\nfunction monthHasSelectable(year: number, month0: number): boolean {\n const first = isoOf(year, month0, 1)\n const last = isoOf(year, month0, daysInMonth(year, month0))\n return (\n (!props.max || compareISO(first, props.max) <= 0) &&\n (!props.min || compareISO(last, props.min) >= 0)\n )\n}\nconst canPrevMonth = computed(() => {\n const prev = addMonths(focusedISO.value, -1)\n const d = parseISO(prev)!\n return monthHasSelectable(d.getFullYear(), d.getMonth())\n})\nconst canNextMonth = computed(() => {\n const next = addMonths(focusedISO.value, 1)\n const d = parseISO(next)!\n return monthHasSelectable(d.getFullYear(), d.getMonth())\n})\nconst canPrevYear = computed(\n () => !props.min || compareISO(isoOf(viewYear.value - 1, 11, 31), props.min) >= 0,\n)\nconst canNextYear = computed(\n () => !props.max || compareISO(isoOf(viewYear.value + 1, 0, 1), props.max) <= 0,\n)\n\n// @a11y\n// Moves the real DOM focus onto a day cell. The grid keeps exactly one cell in the\n// tab order, so navigating means focusing another one.\nconst dayId = (iso: string) => `${gridLabelId}-d-${iso}`\nfunction focusDay(iso: string) {\n nextTick(() => document.getElementById(dayId(iso))?.focus())\n}\n\nfunction goTo(iso: string, moveFocus = false) {\n focusedISO.value = clampISO(iso, props.min, props.max)\n if (moveFocus && view.value === 'days') focusDay(focusedISO.value)\n}\nfunction stepMonth(delta: number) {\n goTo(addMonths(focusedISO.value, delta))\n}\nfunction stepYear(delta: number) {\n goTo(addMonths(focusedISO.value, delta * 12))\n}\n\n// @a11y @core — changing view has to carry the focus onto the cell the new view\n// opens on. Without that move the focus would stay on a button the view has just\n// removed from the document, and the keyboard would have nowhere to go.\nfunction toggleView(target: 'months' | 'years') {\n const next = view.value === target ? 'days' : target\n view.value = next\n if (next === 'months') {\n focusedMonth.value = viewMonth0.value\n nextTick(() => monthCellEl(viewMonth0.value)?.focus())\n } else if (next === 'years') {\n focusedYear.value = viewYear.value\n nextTick(() => {\n const cell = yearCellEl(viewYear.value)\n // Called optionally because jsdom does not implement scrollIntoView (the same\n // guard as VTimeInput's list). Centring the year is a nicety; the focus call\n // below is not, so it must not be taken down with it.\n cell?.scrollIntoView?.({ block: 'center' })\n cell?.focus()\n })\n } else if (view.value === 'days') {\n focusDay(focusedISO.value)\n }\n}\n\nfunction selectDay(cell: DayCell) {\n if (cell.kind !== 'button' || cell.disabled) return\n focusedISO.value = cell.iso\n if (props.selection === 'single') {\n model.value = cell.iso\n } else if (props.selection === 'multiple') {\n model.value = toggleValue(multipleValues.value, cell.iso).sort(compareISO)\n } else {\n // Range selection reads three clicks: the first sets the start, the second the\n // end (reordered if it comes before the start), and the third starts a new\n // period.\n const r = rangeValue.value\n if (!r.start || (r.start && r.end)) {\n model.value = { start: cell.iso, end: null }\n } else {\n model.value = orderRange(r.start, cell.iso)\n }\n }\n emit('select', model.value)\n}\n\n// @keyboard @a11y\n// The keyboard of the days view. The table turning a key into a step is pure and\n// lives in `./keyboard`; what stays here is the date that step is applied to, and\n// the focus move that follows.\nfunction onDaysKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n const cell = days.value.find((c) => c.iso === focusedISO.value)\n if (cell) selectDay(cell)\n return\n }\n const d = parseISO(focusedISO.value)!\n // How far the focused day sits from the start of its week, which is exactly what\n // Home and End have to step back and forward by.\n const offset = (d.getDay() - resolvedFirstDay.value + 7) % 7\n const step = dayStep(event.key, event.shiftKey, offset)\n if (!step) return\n event.preventDefault()\n goTo(\n 'days' in step\n ? addDays(focusedISO.value, step.days)\n : addMonths(focusedISO.value, step.months),\n true,\n )\n}\n\n// The months view, opened from the month button in the header.\nconst focusedMonth = ref(viewMonth0.value)\nconst monthCellEl = (i: number) =>\n document.getElementById(`${gridLabelId}-m-${i}`) as HTMLElement | null\nfunction monthSelectable(i: number) {\n return monthHasSelectable(viewYear.value, i)\n}\nfunction chooseMonth(i: number) {\n if (!monthSelectable(i)) return\n const day = Math.min(parseISO(focusedISO.value)!.getDate(), daysInMonth(viewYear.value, i))\n goTo(isoOf(viewYear.value, i, day))\n view.value = 'days'\n focusDay(focusedISO.value)\n}\n// @keyboard @a11y\nfunction onMonthsKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n chooseMonth(focusedMonth.value)\n return\n }\n const delta = gridDelta(event.key)\n if (delta === undefined) return\n event.preventDefault()\n focusedMonth.value = clamp(focusedMonth.value + delta, 0, 11)\n monthCellEl(focusedMonth.value)?.focus()\n}\n\n// @a11y\n/*\n * Both pickers are a `role=\"grid\"`, and a grid owns ROWS, not cells: a gridcell\n * placed straight under the grid fails aria-required-children and\n * aria-required-parent at the same time. The cells are therefore cut into rows of\n * PICKER_COLUMNS, matching the `grid-template-columns` of the stylesheet — the row\n * element itself is `display: contents`, so the CSS grid never sees it.\n *\n * Keyboard navigation is unaffected by this extra level: it moves by index and\n * refocuses cells through their ids, never by walking the DOM.\n */\nconst chunk = <T,>(list: T[]) =>\n Array.from({ length: Math.ceil(list.length / PICKER_COLUMNS) }, (_, r) =>\n list.slice(r * PICKER_COLUMNS, r * PICKER_COLUMNS + PICKER_COLUMNS),\n )\n\nconst monthRows = computed(() => chunk(monthLabels.value.map((name, i) => ({ name, i }))))\n\n// The years view, opened from the year button in the header.\nconst yearRange = computed(() => {\n /*\n * `min` and `max` come straight from the consumer, and this is the ONLY place\n * where they are turned into a Date instead of being compared as ISO text —\n * `compareISO`, `isWithin` and `clampISO` all tolerate a malformed bound. A value\n * that is not a valid ISO date therefore has to fall back to the open range here:\n * asserting the parse would throw and take the whole render down the moment the\n * years view is opened.\n */\n const minY = parseISO(props.min)?.getFullYear() ?? viewYear.value - 100\n const maxY = parseISO(props.max)?.getFullYear() ?? viewYear.value + 100\n const list: number[] = []\n for (let y = minY; y <= maxY; y++) list.push(y)\n return list\n})\nconst yearRows = computed(() => chunk(yearRange.value))\nconst focusedYear = ref(viewYear.value)\nconst yearCellEl = (y: number) =>\n document.getElementById(`${gridLabelId}-y-${y}`) as HTMLElement | null\nfunction chooseYear(y: number) {\n const month = viewMonth0.value\n const day = Math.min(parseISO(focusedISO.value)!.getDate(), daysInMonth(y, month))\n goTo(isoOf(y, month, day))\n view.value = 'days'\n focusDay(focusedISO.value)\n}\n// @keyboard @a11y\nfunction onYearsKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n chooseYear(focusedYear.value)\n return\n }\n const delta = gridDelta(event.key)\n if (delta === undefined) return\n event.preventDefault()\n const list = yearRange.value\n const idx = list.indexOf(focusedYear.value)\n const nextIdx = clamp(idx + delta, 0, list.length - 1)\n focusedYear.value = list[nextIdx] ?? focusedYear.value\n yearCellEl(focusedYear.value)?.focus()\n}\n\n// Follows a selection changed from the outside: when the leading value lands in\n// another month, the calendar moves to it rather than leaving the reader in front of\n// a grid where nothing is selected.\nwatch(\n () => [singleValue.value, rangeValue.value.start, multipleValues.value[0]],\n () => {\n const primary = singleValue.value ?? rangeValue.value.start ?? multipleValues.value[0]\n if (primary && isValidISO(primary)) {\n const d = parseISO(primary)!\n if (d.getFullYear() !== viewYear.value || d.getMonth() !== viewMonth0.value) {\n focusedISO.value = primary\n }\n }\n },\n)\n\n// @a11y\n/**\n * Brings the focus into the grid, on the day the calendar is currently showing. This\n * is what VDateInput calls when it opens its panel.\n */\nfunction focus() {\n view.value = 'days'\n focusDay(focusedISO.value)\n}\ndefineExpose({ focus })\n</script>\n\n<template>\n <div\n class=\"v-date-picker\"\n :data-view=\"view\"\n :data-selection=\"selection\"\n @pointerleave=\"hoverISO = null\"\n >\n <!-- The header: the month and the year, each between two chevrons that step it,\n and each opening its own picker view when clicked -->\n <div class=\"v-date-picker-header\">\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :icon=\"chevronLeftIcon\"\n :label=\"m.datePicker.previousMonth\"\n size=\"sm\"\n :disabled=\"!canPrevMonth\"\n @click=\"stepMonth(-1)\"\n />\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :aria-expanded=\"view === 'months'\"\n :aria-label=\"monthLabel\"\n @click=\"toggleView('months')\"\n >\n {{ monthLabels[viewMonth0] }}\n <VIcon\n :name=\"view === 'months' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :icon=\"chevronRightIcon\"\n :label=\"m.datePicker.nextMonth\"\n size=\"sm\"\n :disabled=\"!canNextMonth\"\n @click=\"stepMonth(1)\"\n />\n </div>\n\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :icon=\"chevronLeftIcon\"\n :label=\"m.datePicker.previousYear\"\n size=\"sm\"\n :disabled=\"!canPrevYear\"\n @click=\"stepYear(-1)\"\n />\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :aria-expanded=\"view === 'years'\"\n @click=\"toggleView('years')\"\n >\n {{ viewYear }}\n <VIcon\n :name=\"view === 'years' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :icon=\"chevronRightIcon\"\n :label=\"m.datePicker.nextYear\"\n size=\"sm\"\n :disabled=\"!canNextYear\"\n @click=\"stepYear(1)\"\n />\n </div>\n </div>\n\n <!-- Days view -->\n <div\n v-show=\"view === 'days'\"\n class=\"v-date-picker-grid\"\n role=\"grid\"\n :aria-label=\"gridLabel\"\n :aria-multiselectable=\"selection === 'multiple' ? 'true' : undefined\"\n @keydown=\"onDaysKeydown\"\n >\n <div class=\"v-date-picker-weekdays\" role=\"row\">\n <span\n v-for=\"(w, i) in weekdays\"\n :key=\"w\"\n class=\"v-date-picker-weekday\"\n role=\"columnheader\"\n :aria-label=\"weekdaysLong[i]\"\n >{{ w }}</span\n >\n </div>\n <div v-for=\"(week, wi) in weeks\" :key=\"wi\" class=\"v-date-picker-week\" role=\"row\">\n <div\n v-for=\"cell in week\"\n :key=\"cell.iso\"\n class=\"v-date-picker-cell\"\n role=\"gridcell\"\n :aria-selected=\"cell.kind === 'button' ? cell.selected : undefined\"\n :data-in-range=\"cell.inRange ? '' : undefined\"\n :data-range-start=\"cell.rangeStart ? '' : undefined\"\n :data-range-end=\"cell.rangeEnd ? '' : undefined\"\n >\n <button\n v-if=\"cell.kind === 'button'\"\n :id=\"dayId(cell.iso)\"\n type=\"button\"\n class=\"v-date-picker-day\"\n :tabindex=\"cell.iso === focusedISO ? 0 : -1\"\n :data-outside=\"!cell.inMonth ? '' : undefined\"\n :data-selected=\"cell.selected ? '' : undefined\"\n :data-today=\"cell.today ? '' : undefined\"\n :aria-disabled=\"cell.disabled ? 'true' : undefined\"\n :aria-current=\"cell.today ? 'date' : undefined\"\n @click=\"selectDay(cell)\"\n @pointerenter=\"hoverISO = cell.iso\"\n @focus=\"hoverISO = cell.iso\"\n >\n <slot\n name=\"day\"\n :iso=\"cell.iso\"\n :day=\"cell.day\"\n :in-month=\"cell.inMonth\"\n :disabled=\"cell.disabled\"\n :selected=\"cell.selected\"\n :today=\"cell.today\"\n :in-range=\"cell.inRange\"\n :events=\"cell.events\"\n >\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n <span v-if=\"cell.events.length\" class=\"v-date-picker-dots\" aria-hidden=\"true\">\n <span\n v-for=\"(ev, ei) in cell.events.slice(0, 3)\"\n :key=\"ei\"\n class=\"v-date-picker-dot\"\n :style=\"ev.color ? { '--date-picker-dot-color': ev.color } : undefined\"\n />\n </span>\n </button>\n <!-- A day of a neighbouring month that cannot be selected. It renders the\n very same slot as the clickable days: were it left with the bare\n number, custom content taking several lines would apply to this month's\n days only, and the numbers would stop lining up from one cell to the\n next. The slot receives `inMonth`, which is how it can still tell the\n two apart. -->\n <span\n v-else-if=\"cell.kind === 'static'\"\n class=\"v-date-picker-day v-date-picker-day--static\"\n :data-disabled=\"cell.disabled ? '' : undefined\"\n >\n <slot\n name=\"day\"\n :iso=\"cell.iso\"\n :day=\"cell.day\"\n :in-month=\"cell.inMonth\"\n :disabled=\"cell.disabled\"\n :selected=\"cell.selected\"\n :today=\"cell.today\"\n :in-range=\"cell.inRange\"\n :events=\"cell.events\"\n >\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Months view -->\n <div\n v-if=\"view === 'months'\"\n class=\"v-date-picker-view\"\n role=\"grid\"\n :aria-label=\"m.datePicker.monthPicker\"\n @keydown=\"onMonthsKeydown\"\n >\n <div v-for=\"(row, r) in monthRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"{ name, i } in row\"\n :id=\"`${gridLabelId}-m-${i}`\"\n :key=\"name\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"i === focusedMonth ? 0 : -1\"\n :data-selected=\"i === viewMonth0 ? '' : undefined\"\n :aria-selected=\"i === viewMonth0 ? 'true' : undefined\"\n :disabled=\"!monthSelectable(i)\"\n @click=\"chooseMonth(i)\"\n >\n {{ name }}\n </button>\n </div>\n </div>\n\n <!-- Years view -->\n <div\n v-if=\"view === 'years'\"\n class=\"v-date-picker-view v-date-picker-view--years\"\n role=\"grid\"\n :aria-label=\"m.datePicker.yearPicker\"\n @keydown=\"onYearsKeydown\"\n >\n <div v-for=\"(row, r) in yearRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"y in row\"\n :id=\"`${gridLabelId}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"y === focusedYear ? 0 : -1\"\n :data-selected=\"y === viewYear ? '' : undefined\"\n :aria-selected=\"y === viewYear ? 'true' : undefined\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"v-date-picker-footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-picker {\n /* The consumer sets the size of the day disc; the cell around it — the hover area\n and the width of the column — grows to follow, and never falls below the size\n the token sets. */\n --date-picker-day-size: var(--vectis-date-picker-day-size, var(--vectis-control-height-md));\n --date-picker-cell: max(\n var(--vectis-control-size-date-picker-cell),\n calc(var(--date-picker-day-size) + var(--vectis-space-1))\n );\n display: inline-flex;\n flex-direction: column;\n gap: var(--vectis-space-2);\n padding: var(--vectis-space-3);\n font-family: var(--vectis-text-family);\n color: var(--vectis-color-text);\n }\n\n /* The calendar is a flex column, so every block stretches to its full width by\n default. The days grid then fills that width through its 1fr columns, and never\n goes below the seven cells its own floor guarantees. */\n .v-date-picker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--vectis-space-2);\n }\n\n .v-date-picker-nav {\n display: flex;\n align-items: center;\n }\n\n /* A minimum width holds this button steady, so the chevrons on either side do not\n shift as the month or year label changes length. */\n .v-date-picker-view-toggle {\n min-inline-size: var(--vectis-control-size-date-picker-nav-min);\n /* The semibold is state emphasis on the grid's main landmark, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n text-transform: capitalize;\n }\n\n /* The days grid can never be narrower than seven cells. Above that floor it takes\n whatever width the calendar has — set by the header — and the 1fr columns share\n it out equally. */\n .v-date-picker-grid {\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n\n .v-date-picker-weekdays,\n .v-date-picker-week {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n }\n\n .v-date-picker-weekday {\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--vectis-control-height-sm);\n /* A column micro-header, which takes the overline type role. The casing stays\n `capitalize`, the calendar convention, rather than the full capitals the\n VTypography overline variant would apply. */\n font-size: var(--vectis-text-overline-size);\n font-weight: var(--vectis-text-overline-weight);\n letter-spacing: var(--vectis-text-overline-tracking);\n color: var(--vectis-color-text-muted);\n text-transform: capitalize;\n }\n\n .v-date-picker-cell {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--date-picker-cell);\n }\n\n /* The band joining the days of a selected range: a tinted background laid behind\n the day, at the HEIGHT of the disc rather than of the whole cell. Its vertical\n inset is half the gap between cell and disc, expressed in `%` so it follows the\n real width of a 1fr column whatever the calendar measures.\n\n At either end the band stops exactly at the edge of the disc — hence the inset on\n the outer side — and that corner is rounded with the pill radius, which a box\n this height caps at half its height, i.e. precisely the disc's own radius, so it\n cannot overshoot. */\n .v-date-picker-cell[data-in-range]::before {\n content: '';\n position: absolute;\n inset-block: calc((100% - var(--date-picker-day-size)) / 2);\n inset-inline: 0;\n background: var(--vectis-color-accent-surface);\n z-index: 0;\n }\n .v-date-picker-cell[data-range-start]::before {\n inset-inline-start: calc((100% - var(--date-picker-day-size)) / 2);\n border-start-start-radius: var(--vectis-radius-pill);\n border-end-start-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-end]::before {\n inset-inline-end: calc((100% - var(--date-picker-day-size)) / 2);\n border-start-end-radius: var(--vectis-radius-pill);\n border-end-end-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-start][data-range-end]::before {\n content: none;\n }\n\n .v-date-picker-day {\n position: relative;\n z-index: 1;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: var(--date-picker-day-size);\n block-size: var(--date-picker-day-size);\n padding: 0;\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n cursor: pointer;\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /* Hover belongs to the days one can actually click: not the disabled ones, not the\n already selected ones, and not the neighbouring days rendered as plain spans. */\n .v-date-picker-day:hover:not([aria-disabled='true']):not([data-selected]):not(\n .v-date-picker-day--static\n ) {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-date-picker-day[data-outside] {\n color: var(--vectis-color-text-subtle);\n }\n\n /* The semibold in the two rules below marks a state — today, and the selection —\n and is not a typographic role, which is why it reads a font token directly. */\n .v-date-picker-day[data-today]:not([data-selected]) {\n box-shadow: inset 0 0 0 1px var(--vectis-color-accent-border);\n color: var(--vectis-color-accent-text);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-date-picker-day[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-date-picker-day[aria-disabled='true'] {\n color: var(--vectis-color-text-subtle);\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker-day--static {\n color: var(--vectis-color-text-subtle);\n cursor: default;\n }\n\n /* A neighbouring day that falls outside the bounds, or is disabled, is struck\n through like any other unavailable date. */\n .v-date-picker-day--static[data-disabled] {\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker-day:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-date-picker-day-num {\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-date-picker-dots {\n position: absolute;\n inset-block-end: calc(var(--vectis-space-1) * 0.5);\n display: flex;\n gap: 2px;\n }\n .v-date-picker-dot {\n inline-size: var(--vectis-control-size-date-picker-dot);\n block-size: var(--vectis-control-size-date-picker-dot);\n border-radius: var(--vectis-radius-pill);\n background: var(--date-picker-dot-color, var(--vectis-color-accent));\n }\n .v-date-picker-day[data-selected] .v-date-picker-dot {\n background: var(--vectis-color-text-on-accent);\n }\n\n /* The months and years views. They fill the calendar's width exactly like the days\n grid does: stretched by the flex column, then shared out by 1fr columns. */\n .v-date-picker-view {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--vectis-space-1);\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n /* The rows ARIA requires inside a grid, made invisible to the layout: with\n `display: contents` the cells remain direct grid items of `.v-date-picker-view`,\n so the columns line up as if the rows were not there. */\n .v-date-picker-view-row {\n display: contents;\n }\n\n .v-date-picker-view--years {\n max-block-size: calc(6 * var(--date-picker-cell));\n overflow-y: auto;\n }\n\n .v-date-picker-view-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n block-size: var(--vectis-control-height-lg);\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n text-transform: capitalize;\n cursor: pointer;\n transition: background-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n .v-date-picker-view-cell:hover:not(:disabled):not([data-selected]) {\n background: var(--vectis-color-surface-muted);\n }\n .v-date-picker-view-cell[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n /* Again state emphasis, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n }\n .v-date-picker-view-cell:disabled {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n .v-date-picker-view-cell:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n .v-date-picker-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-2);\n padding-block-start: var(--vectis-space-2);\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-date-picker-day,\n .v-date-picker-view-cell {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VDatePicker.js","names":[],"sources":["../../../src/components/VDatePicker/VDatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @keyboard @core\n/**\n * A calendar shown directly in the page, as a grid of days, with a month view and a\n * year view behind it. It holds ALL the date, view and keyboard logic of the design\n * system; VDateInput does no more than dress it in a text field and a popover.\n *\n * The platform offers no accessible date grid to build on — `<input type=\"date\">`\n * can be neither styled nor composed — so the JavaScript here implements the ARIA\n * \"grid\" pattern by hand: a single cell in the tab order at a time, arrow and\n * page keys to move between dates, and selection of one date, a range or a list.\n * None of that can be expressed in HTML and CSS alone.\n *\n * Every date is handled in local time as an ISO `YYYY-MM-DD` string (see\n * `utils/date`), which is what keeps the server and the browser in agreement.\n */\n\nimport { computed, inject, nextTick, onMounted, ref, useId, watch, watchEffect } from 'vue'\nimport type { Ref } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { arrow_drop_down as arrowDropDownIcon } from '../VIcon/icons/arrow_drop_down'\nimport { arrow_drop_up as arrowDropUpIcon } from '../VIcon/icons/arrow_drop_up'\nimport { chevron_left as chevronLeftIcon } from '../VIcon/icons/chevron_left'\nimport { chevron_right as chevronRightIcon } from '../VIcon/icons/chevron_right'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport {\n addDays,\n addMonths,\n buildMonthGrid,\n clampISO,\n compareISO,\n daysInMonth,\n firstDayOfWeekFor,\n formatISO,\n isDateAllowed,\n isoOf,\n isSameISO,\n isValidISO,\n monthName,\n monthNamesCompact,\n parseISO,\n weekdayNames,\n} from '../../utils/date'\n\nimport { PICKER_COLUMNS, dayStep, gridDelta } from './keyboard'\n\nimport { toggleValue } from '../../utils/array'\nimport { isDev } from '../../utils/env'\nimport { hostWarnsKey } from '../../utils/hostWarns'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { clamp } from '../../utils/number'\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useMessages, useResolvedLocale } from '../../i18n/state'\n\nexport type DatePickerSelection = 'single' | 'range' | 'multiple'\n\n/**\n * A period between two dates, the value of a `range` selection. Either bound may be\n * null: between the first and the second click, a range has a start and no end yet.\n */\nexport interface DatePickerRange {\n /** The first day of the period, as an ISO `YYYY-MM-DD` string. */\n start: string | null\n /** The last day of the period, as an ISO `YYYY-MM-DD` string. */\n end: string | null\n}\n\n/** Something happening on a given day, shown as a coloured dot under its number. */\nexport interface DatePickerEvent {\n /** The day it falls on, as an ISO `YYYY-MM-DD` string. */\n date: string\n /** The colour of the dot, as any CSS colour. It is the accent colour by default. */\n color?: string\n /** A description of the event for assistive technology. */\n label?: string\n}\n\n/**\n * Which dates cannot be selected, given either as a list of ISO strings or as a\n * function answering that question for a date.\n */\nexport type DatePickerMatcher = string[] | ((iso: string) => boolean)\n\n/** The shape of the v-model, which follows whichever `selection` is in use. */\nexport type DatePickerValue = string | null | DatePickerRange | string[]\n\n/** Everything the `#day` slot is told about the day it draws. */\nexport interface DatePickerDaySlotProps {\n /** The day, as an ISO `YYYY-MM-DD` string. */\n iso: string\n /** The day of the month. */\n day: number\n /** Whether it belongs to the month on display rather than to a neighbouring one. */\n inMonth: boolean\n /** Whether it cannot be chosen: outside the bounds, or excluded by `disabledDates`. */\n disabled: boolean\n /** Whether it is selected. */\n selected: boolean\n /** Whether it is today. */\n today: boolean\n /** Whether it falls inside the selected period, both ends included. */\n inRange: boolean\n /** The events that fall on it. */\n events: DatePickerEvent[]\n}\n\ninterface DatePickerProps {\n /**\n * What the reader is picking: a single date, a period between two dates, or any\n * number of separate dates. It determines the shape of the v-model.\n */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names and the first day of the\n * week. It TAKES PRECEDENCE over the design system's global locale (`setLocale`)\n * and falls back to it — which is why it has no literal default here: `undefined`\n * has to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /**\n * Forces the day the weeks start on (0 for Sunday through 6 for Saturday). Left\n * out, the locale decides.\n */\n firstDayOfWeek?: number\n /**\n * The earliest selectable date, as an ISO string. Neither navigation nor selection\n * goes back beyond it.\n */\n min?: string\n /**\n * The latest selectable date, as an ISO string. Neither navigation nor selection\n * goes past it.\n */\n max?: string\n /**\n * Dates that cannot be chosen, given as a list of ISO strings or as a function.\n * They stay visible, struck through, and can still be reached with the keyboard.\n */\n disabledDates?: DatePickerMatcher\n /**\n * Also fills the empty corners of the grid with the greyed days of the neighbouring\n * months. It is off by default.\n */\n showAdjacentDays?: boolean\n /**\n * Lets those neighbouring days be clicked, which moves the calendar to their month.\n * A clickable day has to be visible, so this implies showing them.\n */\n selectAdjacentDays?: boolean\n /** The events to mark, as up to three coloured dots under the day they fall on. */\n events?: DatePickerEvent[]\n /**\n * Makes the whole calendar unusable: no date can be chosen, no month reached, and\n * everything greys out through the colour tokens.\n */\n disabled?: boolean\n /**\n * Shows what is selected without letting it be changed. The calendar can still be\n * read and walked through — another month, another year — which is what separates it\n * from `disabled`.\n */\n readonly?: boolean\n /**\n * The accessible name of the whole picker, its header and its grid together. A range\n * shown as two calendars side by side needs one each, or a screen reader announces the\n * same group twice. It falls back to the dictionary, and a consumer `aria-label` wins.\n */\n label?: string\n}\n\nconst props = withDefaults(defineProps<DatePickerProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n disabled: false,\n readonly: false,\n label: undefined,\n})\n\n/**\n * What is selected, and its SHAPE follows `selection`: an ISO `YYYY-MM-DD` string for\n * `single`, a `{ start, end }` pair for `range`, an array of strings for `multiple`. Nothing\n * is selected to begin with.\n *\n * Every date is a plain local-time string, never a `Date`, so the value a consumer receives\n * cannot shift a day across time zones.\n */\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /**\n * Emitted every time a date is chosen, carrying the complete value as it now\n * stands. VDateInput listens to it to close its panel on a single selection.\n */\n select: [value: DatePickerValue]\n}>()\n\ndefineSlots<{\n /**\n * Replaces the content of a day cell — to show a price or an availability under the\n * number, for instance. It receives everything known about that day, including\n * whether it belongs to the displayed month.\n */\n day?(props: DatePickerDaySlotProps): unknown\n /** The strip under the grid, for actions such as Close or Save, or for preset dates. */\n footer?(): unknown\n}>()\n\nconst gridLabelId = useId()\n\n// The navigation labels have no prop of their own: the dictionary is the single\n// place to change them, globally or per language — see `src/i18n/`.\nconst m = useMessages()\n// @a11y — a roleless box cannot carry an accessible name (axe: aria-prohibited-attr),\n// so the root is a named group: the VCarousel viewport arrangement.\nconst ariaLabel = useAriaLabel(() => props.label ?? m.value.datePicker.label)\nconst resolvedLocale = useResolvedLocale(() => props.locale)\n\n// @devwarn\n// Silent inside a host that forwards these props and reports on them itself (utils/hostWarns).\nif (isDev && !inject(hostWarnsKey, false)) {\n watchEffect(() => {\n if (props.min && props.max && compareISO(props.min, props.max) > 0)\n console.warn(\n `[VDatePicker] min \"${props.min}\" falls after max \"${props.max}\", so no date can be chosen.`,\n )\n })\n}\n\nconst resolvedFirstDay = computed(\n () => props.firstDayOfWeek ?? firstDayOfWeekFor(resolvedLocale.value),\n)\nconst weekdays = computed(() => weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'short'))\nconst weekdaysLong = computed(() =>\n weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'long'),\n)\nconst monthLabels = computed(() => monthNamesCompact(resolvedLocale.value))\n\nconst singleValue = computed(() =>\n props.selection === 'single' && typeof model.value === 'string' && isValidISO(model.value)\n ? model.value\n : null,\n)\nconst rangeValue = computed<DatePickerRange>(() => {\n if (\n props.selection === 'range' &&\n model.value &&\n typeof model.value === 'object' &&\n !Array.isArray(model.value)\n ) {\n return model.value as DatePickerRange\n }\n return { start: null, end: null }\n})\nconst multipleValues = computed<string[]>(() =>\n props.selection === 'multiple' && Array.isArray(model.value) ? model.value : [],\n)\n\n// `focusedISO` is the single source of truth for the view: the month on display is\n// derived from it, never stored separately, so the two cannot drift apart.\n//\n// TRAP — a range start or a list entry is validated HERE, the way the single value is\n// validated upstream. Those two reach this component exactly as the consumer wrote them,\n// and a malformed one (`{ start: 'foo' }`) made the focused date unparseable: the month\n// arrows assert that parse, so the first render threw.\nfunction initialFocus(): string {\n if (singleValue.value) return singleValue.value\n const start = rangeValue.value.start\n if (start && isValidISO(start)) return start\n const listed = multipleValues.value.find(isValidISO)\n if (listed) return listed\n // With nothing selected, the calendar opens on today, brought back inside the\n // allowed bounds.\n return clampISO(formatISO(new Date()), props.min, props.max)\n}\nconst focusedISO = ref(initialFocus())\nconst view = ref<'days' | 'months' | 'years'>('days')\n\nconst viewYear = computed(\n () => parseISO(focusedISO.value)?.getFullYear() ?? new Date().getFullYear(),\n)\nconst viewMonth0 = computed(() => parseISO(focusedISO.value)?.getMonth() ?? 0)\nconst monthLabel = computed(() => monthName(resolvedLocale.value, viewMonth0.value))\nconst gridLabel = computed(() => `${monthLabel.value} ${viewYear.value}`)\n\n// @ssr\n// Today's date is only read once the component is mounted, hence on the client: the\n// server has no way to know it, and rendering it during setup would make the two\n// markups differ and break hydration.\nconst today = ref<string | null>(null)\nonMounted(() => {\n today.value = formatISO(new Date())\n})\n\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\nconst eventsByDate = computed(() => {\n const map = new Map<string, DatePickerEvent[]>()\n for (const ev of props.events ?? []) {\n const list = map.get(ev.date) ?? []\n list.push(ev)\n map.set(ev.date, list)\n }\n return map\n})\n\nconst hoverISO = ref<string | null>(null)\nfunction orderRange(a: string, b: string): DatePickerRange {\n return compareISO(a, b) <= 0 ? { start: a, end: b } : { start: b, end: a }\n}\nconst effectiveRange = computed<DatePickerRange>(() => {\n if (props.selection !== 'range') return { start: null, end: null }\n const r = rangeValue.value\n if (r.start && r.end) return orderRange(r.start, r.end)\n // A start is set but the end is still pending: the range is previewed up to\n // whichever day the pointer or the focus is currently on.\n const preview = hoverISO.value ?? focusedISO.value\n if (r.start && preview) return orderRange(r.start, preview)\n return { start: r.start, end: r.end }\n})\n\nfunction isSelected(iso: string): boolean {\n if (props.selection === 'single') return isSameISO(iso, singleValue.value)\n if (props.selection === 'multiple') return multipleValues.value.includes(iso)\n // In range selection, the two ends of the period count as selected — including the\n // provisional end shown during the preview.\n return isSameISO(iso, effectiveRange.value.start) || isSameISO(iso, effectiveRange.value.end)\n}\n/**\n * Whether a day falls inside the selected period, BOTH ends included.\n *\n * The inclusiveness is a contract with the stylesheet, not a detail: `[data-in-range]` is\n * what draws the band's pseudo-element, and the two end rules only round a corner of one\n * that already exists. Narrowing this to the days strictly between would leave each end\n * with nothing to cap and silently square off every range.\n */\nfunction isInRange(iso: string): boolean {\n const { start, end } = effectiveRange.value\n return !!start && !!end && compareISO(iso, start) >= 0 && compareISO(iso, end) <= 0\n}\n\ntype DayCell = {\n iso: string\n day: number\n kind: 'empty' | 'static' | 'button'\n inMonth: boolean\n disabled: boolean\n selected: boolean\n rangeStart: boolean\n rangeEnd: boolean\n inRange: boolean\n today: boolean\n events: DatePickerEvent[]\n /** The events drawn as dots under the number, three at most. */\n dots: DatePickerEvent[]\n}\n\n/**\n * The 42 squares of the month on display, rebuilt only when the MONTH changes. The two\n * computeds are split on purpose: a range being previewed changes `hoverISO` on every\n * `pointerenter`, and that has to repaint the decoration below without building 42 dates\n * again. `viewYear` and `viewMonth0` are numbers, so moving the focus inside the month\n * leaves them — and this — untouched.\n */\nconst grid = computed(() =>\n buildMonthGrid(viewYear.value, viewMonth0.value, resolvedFirstDay.value),\n)\n\nconst NO_EVENTS: DatePickerEvent[] = []\n\nconst days = computed<DayCell[]>(() =>\n grid.value.map((cell) => {\n const inMonth = cell.adjacent === null\n // Making the neighbouring days clickable implies showing them: a day nobody can\n // see cannot be clicked.\n const show = inMonth || props.showAdjacentDays || props.selectAdjacentDays\n const selectable = inMonth || props.selectAdjacentDays\n const disabled = !isDateAllowed(cell.iso, props.min, props.max, isDisabledDate.value)\n const kind: DayCell['kind'] = !show ? 'empty' : selectable ? 'button' : 'static'\n const events = eventsByDate.value.get(cell.iso) ?? NO_EVENTS\n return {\n iso: cell.iso,\n day: cell.day,\n kind,\n inMonth,\n disabled,\n selected: kind === 'button' && !disabled && isSelected(cell.iso),\n rangeStart: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.start),\n rangeEnd: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.end),\n inRange: props.selection === 'range' && isInRange(cell.iso),\n today: isSameISO(cell.iso, today.value),\n events,\n dots: events.length > 3 ? events.slice(0, 3) : events,\n }\n }),\n)\n\n/** What the `#day` slot receives for a square: the same object for both kinds of cell. */\nfunction daySlotProps(cell: DayCell): DatePickerDaySlotProps {\n return {\n iso: cell.iso,\n day: cell.day,\n inMonth: cell.inMonth,\n disabled: cell.disabled,\n selected: cell.selected,\n today: cell.today,\n inRange: cell.inRange,\n events: cell.events,\n }\n}\nconst weeks = computed(() => {\n const rows: DayCell[][] = []\n for (let i = 0; i < days.value.length; i += 7) rows.push(days.value.slice(i, i + 7))\n return rows\n})\n\nfunction monthHasSelectable(year: number, month0: number): boolean {\n const first = isoOf(year, month0, 1)\n const last = isoOf(year, month0, daysInMonth(year, month0))\n return (\n (!props.max || compareISO(first, props.max) <= 0) &&\n (!props.min || compareISO(last, props.min) >= 0)\n )\n}\n// Derived from the month on display, not from the focused day, so an arrow key moving the\n// focus inside the month does not recompute them.\nconst canPrevMonth = computed(() =>\n viewMonth0.value === 0\n ? monthHasSelectable(viewYear.value - 1, 11)\n : monthHasSelectable(viewYear.value, viewMonth0.value - 1),\n)\nconst canNextMonth = computed(() =>\n viewMonth0.value === 11\n ? monthHasSelectable(viewYear.value + 1, 0)\n : monthHasSelectable(viewYear.value, viewMonth0.value + 1),\n)\nconst canPrevYear = computed(\n () => !props.min || compareISO(isoOf(viewYear.value - 1, 11, 31), props.min) >= 0,\n)\nconst canNextYear = computed(\n () => !props.max || compareISO(isoOf(viewYear.value + 1, 0, 1), props.max) <= 0,\n)\n\n// @a11y\n// Moves the real DOM focus onto a day cell. The grid keeps exactly one cell in the\n// tab order, so navigating means focusing another one.\nconst dayId = (iso: string) => `${gridLabelId}-d-${iso}`\nfunction focusDay(iso: string, options?: FocusOptions) {\n nextTick(() => document.getElementById(dayId(iso))?.focus(options))\n}\n\nfunction goTo(iso: string, moveFocus = false) {\n // Every move through the calendar comes here, so one guard covers the arrows, the\n // month and year cells and the keyboard's own steps. Only `disabled` stops it:\n // `readonly` leaves the reader free to look around.\n if (props.disabled) return\n focusedISO.value = clampISO(iso, props.min, props.max)\n if (moveFocus && view.value === 'days') focusDay(focusedISO.value)\n}\nfunction stepMonth(delta: number) {\n goTo(addMonths(focusedISO.value, delta))\n}\nfunction stepYear(delta: number) {\n goTo(addMonths(focusedISO.value, delta * 12))\n}\n\n// @a11y @core — changing view has to carry the focus onto the cell the new view\n// opens on. Without that move the focus would stay on a button the view has just\n// removed from the document, and the keyboard would have nowhere to go.\nfunction toggleView(target: 'months' | 'years') {\n const next = view.value === target ? 'days' : target\n view.value = next\n if (next === 'months') {\n focusedMonth.value = viewMonth0.value\n nextTick(() => monthCellEl(viewMonth0.value)?.focus())\n } else if (next === 'years') {\n focusedYear.value = viewYear.value\n nextTick(() => {\n const cell = yearCellEl(viewYear.value)\n // Called optionally because jsdom does not implement scrollIntoView (the same\n // guard as VTimeInput's list). Centring the year is a nicety; the focus call\n // below is not, so it must not be taken down with it.\n cell?.scrollIntoView?.({ block: 'center' })\n cell?.focus()\n })\n } else if (view.value === 'days') {\n focusDay(focusedISO.value)\n }\n}\n\nfunction selectDay(cell: DayCell) {\n // The single choke point of the selection, so the two states are refused here rather\n // than in each of the routes that lead to it — a click, Enter and Space all pass\n // through. Navigation is deliberately NOT guarded by `readonly`: a calendar one may\n // read is a calendar one may leaf through.\n if (props.disabled || props.readonly) return\n if (cell.kind !== 'button' || cell.disabled) return\n focusedISO.value = cell.iso\n let next: DatePickerValue\n if (props.selection === 'single') {\n next = cell.iso\n } else if (props.selection === 'multiple') {\n next = toggleValue(multipleValues.value, cell.iso).sort(compareISO)\n } else {\n // Range selection reads three clicks: the first sets the start, the second the\n // end (reordered if it comes before the start), and the third starts a new\n // period.\n const r = rangeValue.value\n next = !r.start || r.end ? { start: cell.iso, end: null } : orderRange(r.start, cell.iso)\n }\n model.value = next\n // TRAP: emit what was just computed, never `model.value` read back. Under a parent\n // `v-model`, `defineModel` does not update its local copy on write — it waits for the\n // parent to re-render — so the read would hand `select` the PREVIOUS value.\n emit('select', next)\n}\n\n// @keyboard @a11y\n// The keyboard of the days view. The table turning a key into a step is pure and\n// lives in `./keyboard`; what stays here is the date that step is applied to, and\n// the focus move that follows.\nfunction onDaysKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n const cell = days.value.find((c) => c.iso === focusedISO.value)\n if (cell) selectDay(cell)\n return\n }\n const d = parseISO(focusedISO.value)!\n // How far the focused day sits from the start of its week, which is exactly what\n // Home and End have to step back and forward by.\n const offset = (d.getDay() - resolvedFirstDay.value + 7) % 7\n const step = dayStep(event.key, event.shiftKey, offset)\n if (!step) return\n event.preventDefault()\n goTo(\n 'days' in step\n ? addDays(focusedISO.value, step.days)\n : addMonths(focusedISO.value, step.months),\n true,\n )\n}\n\n/**\n * Leaving the months or the years view for the days of the month chosen, keeping the day of\n * the month where the new month has one — the 31st becoming the 30th, say.\n */\nfunction chooseYearMonth(year: number, month0: number) {\n const day = Math.min(parseISO(focusedISO.value)!.getDate(), daysInMonth(year, month0))\n goTo(isoOf(year, month0, day))\n view.value = 'days'\n focusDay(focusedISO.value)\n}\n\n// @keyboard @a11y\n/**\n * The keyboard of the months and the years views, which differ only in what their cells\n * hold: Enter or Space chooses the focused cell, and the arrows walk the list of cells a row\n * or a column at a time, stopping at either end.\n */\nfunction onViewKeydown(\n event: KeyboardEvent,\n cells: readonly number[],\n focused: Ref<number>,\n cellEl: (value: number) => HTMLElement | null,\n choose: (value: number) => void,\n) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n choose(focused.value)\n return\n }\n const delta = gridDelta(event.key)\n if (delta === undefined) return\n event.preventDefault()\n const next = clamp(cells.indexOf(focused.value) + delta, 0, cells.length - 1)\n focused.value = cells[next] ?? focused.value\n cellEl(focused.value)?.focus()\n}\n\n// The months view, opened from the month button in the header.\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i)\nconst focusedMonth = ref(viewMonth0.value)\nconst monthCellEl = (i: number) =>\n document.getElementById(`${gridLabelId}-m-${i}`) as HTMLElement | null\nfunction monthSelectable(i: number) {\n return monthHasSelectable(viewYear.value, i)\n}\nfunction chooseMonth(i: number) {\n if (monthSelectable(i)) chooseYearMonth(viewYear.value, i)\n}\nconst onMonthsKeydown = (event: KeyboardEvent) =>\n onViewKeydown(event, MONTHS, focusedMonth, monthCellEl, chooseMonth)\n\n// @a11y\n/*\n * Both pickers are a `role=\"grid\"`, and a grid owns ROWS, not cells: a gridcell\n * placed straight under the grid fails aria-required-children and\n * aria-required-parent at the same time. The cells are therefore cut into rows of\n * PICKER_COLUMNS, matching the `grid-template-columns` of the stylesheet — the row\n * element itself is `display: contents`, so the CSS grid never sees it.\n *\n * Keyboard navigation is unaffected by this extra level: it moves by index and\n * refocuses cells through their ids, never by walking the DOM.\n */\nconst chunk = <T,>(list: T[]) =>\n Array.from({ length: Math.ceil(list.length / PICKER_COLUMNS) }, (_, r) =>\n list.slice(r * PICKER_COLUMNS, r * PICKER_COLUMNS + PICKER_COLUMNS),\n )\n\nconst monthRows = computed(() => chunk(monthLabels.value.map((name, i) => ({ name, i }))))\n\n// The years view, opened from the year button in the header.\nconst yearRange = computed(() => {\n /*\n * `min` and `max` come straight from the consumer, and this is the ONLY place\n * where they are turned into a Date instead of being compared as ISO text —\n * `compareISO`, `isWithin` and `clampISO` all tolerate a malformed bound. A value\n * that is not a valid ISO date therefore has to fall back to the open range here:\n * asserting the parse would throw and take the whole render down the moment the\n * years view is opened.\n */\n const minY = parseISO(props.min)?.getFullYear() ?? viewYear.value - 100\n const maxY = parseISO(props.max)?.getFullYear() ?? viewYear.value + 100\n const list: number[] = []\n for (let y = minY; y <= maxY; y++) list.push(y)\n return list\n})\nconst yearRows = computed(() => chunk(yearRange.value))\nconst focusedYear = ref(viewYear.value)\nconst yearCellEl = (y: number) =>\n document.getElementById(`${gridLabelId}-y-${y}`) as HTMLElement | null\nconst chooseYear = (y: number) => chooseYearMonth(y, viewMonth0.value)\nconst onYearsKeydown = (event: KeyboardEvent) =>\n onViewKeydown(event, yearRange.value, focusedYear, yearCellEl, chooseYear)\n\n// Follows a selection changed from the outside: when the leading value lands in\n// another month, the calendar moves to it rather than leaving the reader in front of\n// a grid where nothing is selected.\nwatch(\n () => [singleValue.value, rangeValue.value.start, multipleValues.value[0]],\n () => {\n const primary = singleValue.value ?? rangeValue.value.start ?? multipleValues.value[0]\n if (primary && isValidISO(primary)) {\n const d = parseISO(primary)!\n if (d.getFullYear() !== viewYear.value || d.getMonth() !== viewMonth0.value) {\n focusedISO.value = primary\n }\n }\n },\n)\n\n// @a11y\n/**\n * Brings the focus into the grid, on the day the calendar is currently showing. This\n * is what VDateInput calls when it opens its panel.\n */\nfunction focus(options?: FocusOptions) {\n view.value = 'days'\n focusDay(focusedISO.value, options)\n}\n\n// @core\n/*\n * Puts the calendar back the way it opens: the days view, on the selected date (today\n * failing that), with no range preview pending. It moves no focus and announces nothing,\n * a panel reopening not being something the reader did.\n *\n * TRAP — a panel's content stays MOUNTED while the panel is closed, so without this the\n * months or years view a reader left open is what the next opening shows — and a field\n * that opens its panel on focus never calls `focus()`, the one place that reset the view.\n */\nfunction reset() {\n view.value = 'days'\n hoverISO.value = null\n focusedISO.value = initialFocus()\n}\n\ndefineExpose({\n /** Brings the focus into the grid, onto the day the calendar is showing. */\n focus,\n /**\n * Returns to the days view, on the selected date or today, without moving the focus.\n * VDateInput calls it each time its panel opens and closes.\n */\n reset,\n})\n</script>\n\n<template>\n <div\n class=\"v-date-picker\"\n role=\"group\"\n :aria-label=\"ariaLabel\"\n :data-view=\"view\"\n :data-selection=\"selection\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n @pointerleave=\"hoverISO = null\"\n >\n <!-- The header: the month and the year, each between two chevrons that step it,\n and each opening its own picker view when clicked -->\n <div class=\"v-date-picker-header\">\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :label=\"m.datePicker.previousMonth\"\n size=\"sm\"\n :disabled=\"disabled || !canPrevMonth\"\n @click=\"stepMonth(-1)\"\n >\n <VIcon :name=\"chevronLeftIcon\" mirrored />\n </VIconButton>\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :disabled=\"disabled\"\n :aria-expanded=\"view === 'months'\"\n :aria-label=\"monthLabel\"\n @click=\"toggleView('months')\"\n >\n {{ monthLabels[viewMonth0] }}\n <VIcon\n :name=\"view === 'months' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :label=\"m.datePicker.nextMonth\"\n size=\"sm\"\n :disabled=\"disabled || !canNextMonth\"\n @click=\"stepMonth(1)\"\n >\n <VIcon :name=\"chevronRightIcon\" mirrored />\n </VIconButton>\n </div>\n\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :label=\"m.datePicker.previousYear\"\n size=\"sm\"\n :disabled=\"disabled || !canPrevYear\"\n @click=\"stepYear(-1)\"\n >\n <VIcon :name=\"chevronLeftIcon\" mirrored />\n </VIconButton>\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :disabled=\"disabled\"\n :aria-expanded=\"view === 'years'\"\n @click=\"toggleView('years')\"\n >\n {{ viewYear }}\n <VIcon\n :name=\"view === 'years' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :label=\"m.datePicker.nextYear\"\n size=\"sm\"\n :disabled=\"disabled || !canNextYear\"\n @click=\"stepYear(1)\"\n >\n <VIcon :name=\"chevronRightIcon\" mirrored />\n </VIconButton>\n </div>\n </div>\n\n <!-- Days view -->\n <div\n v-show=\"view === 'days'\"\n class=\"v-date-picker-grid\"\n role=\"grid\"\n :aria-label=\"gridLabel\"\n :aria-multiselectable=\"selection === 'multiple' ? 'true' : undefined\"\n @keydown=\"onDaysKeydown\"\n >\n <div class=\"v-date-picker-weekdays\" role=\"row\">\n <span\n v-for=\"(w, i) in weekdays\"\n :key=\"w\"\n class=\"v-date-picker-weekday\"\n role=\"columnheader\"\n :aria-label=\"weekdaysLong[i]\"\n >{{ w }}</span\n >\n </div>\n <div v-for=\"(week, wi) in weeks\" :key=\"wi\" class=\"v-date-picker-week\" role=\"row\">\n <div\n v-for=\"cell in week\"\n :key=\"cell.iso\"\n class=\"v-date-picker-cell\"\n role=\"gridcell\"\n :aria-selected=\"cell.kind === 'button' ? cell.selected : undefined\"\n :data-in-range=\"cell.inRange ? '' : undefined\"\n :data-range-start=\"cell.rangeStart ? '' : undefined\"\n :data-range-end=\"cell.rangeEnd ? '' : undefined\"\n >\n <button\n v-if=\"cell.kind === 'button'\"\n :id=\"dayId(cell.iso)\"\n type=\"button\"\n class=\"v-date-picker-day\"\n :tabindex=\"cell.iso === focusedISO ? 0 : -1\"\n :data-outside=\"!cell.inMonth ? '' : undefined\"\n :data-selected=\"cell.selected ? '' : undefined\"\n :data-today=\"cell.today ? '' : undefined\"\n :data-unavailable=\"cell.disabled ? '' : undefined\"\n :disabled=\"disabled\"\n :aria-disabled=\"cell.disabled || readonly ? 'true' : undefined\"\n :aria-current=\"cell.today ? 'date' : undefined\"\n @click=\"selectDay(cell)\"\n @pointerenter=\"hoverISO = cell.iso\"\n @focus=\"hoverISO = cell.iso\"\n >\n <slot name=\"day\" v-bind=\"daySlotProps(cell)\">\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n <span v-if=\"cell.dots.length\" class=\"v-date-picker-dots\" aria-hidden=\"true\">\n <span\n v-for=\"(ev, ei) in cell.dots\"\n :key=\"ei\"\n class=\"v-date-picker-dot\"\n :style=\"ev.color ? { '--date-picker-dot-color': ev.color } : undefined\"\n />\n </span>\n </button>\n <!-- A day of a neighbouring month that cannot be selected. It renders the\n very same slot as the clickable days: were it left with the bare\n number, custom content taking several lines would apply to this month's\n days only, and the numbers would stop lining up from one cell to the\n next. The slot receives `inMonth`, which is how it can still tell the\n two apart. -->\n <span\n v-else-if=\"cell.kind === 'static'\"\n class=\"v-date-picker-day v-date-picker-day--static\"\n :data-disabled=\"cell.disabled ? '' : undefined\"\n >\n <slot name=\"day\" v-bind=\"daySlotProps(cell)\">\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Months view -->\n <div\n v-if=\"view === 'months'\"\n class=\"v-date-picker-view\"\n role=\"grid\"\n :aria-label=\"m.datePicker.monthPicker\"\n @keydown=\"onMonthsKeydown\"\n >\n <div v-for=\"(row, r) in monthRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"{ name, i } in row\"\n :id=\"`${gridLabelId}-m-${i}`\"\n :key=\"name\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"i === focusedMonth ? 0 : -1\"\n :data-selected=\"i === viewMonth0 ? '' : undefined\"\n :aria-selected=\"i === viewMonth0 ? 'true' : undefined\"\n :disabled=\"disabled || !monthSelectable(i)\"\n @click=\"chooseMonth(i)\"\n >\n {{ name }}\n </button>\n </div>\n </div>\n\n <!-- Years view -->\n <div\n v-if=\"view === 'years'\"\n class=\"v-date-picker-view v-date-picker-view--years\"\n role=\"grid\"\n :aria-label=\"m.datePicker.yearPicker\"\n @keydown=\"onYearsKeydown\"\n >\n <div v-for=\"(row, r) in yearRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"y in row\"\n :id=\"`${gridLabelId}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"y === focusedYear ? 0 : -1\"\n :data-selected=\"y === viewYear ? '' : undefined\"\n :aria-selected=\"y === viewYear ? 'true' : undefined\"\n :disabled=\"disabled\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"v-date-picker-footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-picker {\n /* The consumer sets the size of the day disc through its token; the cell around it —\n the hover area and the width of the column — grows to follow, and never falls below\n the size the cell token sets. */\n --date-picker-cell: max(\n var(--vectis-control-size-date-picker-cell),\n calc(var(--vectis-control-size-date-picker-day) + var(--vectis-space-1))\n );\n display: inline-flex;\n flex-direction: column;\n gap: var(--vectis-space-2);\n padding: var(--vectis-space-3);\n font-family: var(--vectis-text-family);\n color: var(--vectis-color-text);\n }\n\n /* The calendar is a flex column, so every block stretches to its full width by\n default. The days grid then fills that width through its 1fr columns, and never\n goes below the seven cells its own floor guarantees. */\n .v-date-picker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--vectis-space-2);\n }\n\n .v-date-picker-nav {\n display: flex;\n align-items: center;\n }\n\n /* A minimum width holds this button steady, so the chevrons on either side do not\n shift as the month or year label changes length. */\n .v-date-picker-view-toggle {\n min-inline-size: var(--vectis-control-size-date-picker-nav-min);\n /* The semibold is state emphasis on the grid's main landmark, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n text-transform: capitalize;\n }\n\n /* The days grid can never be narrower than seven cells. Above that floor it takes\n whatever width the calendar has — set by the header — and the 1fr columns share\n it out equally. */\n .v-date-picker-grid {\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n\n .v-date-picker-weekdays,\n .v-date-picker-week {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n }\n\n .v-date-picker-weekday {\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--vectis-control-height-sm);\n /* A column micro-header, which takes the overline type role. The casing stays\n `capitalize`, the calendar convention, rather than the full capitals the\n VTypography overline variant would apply. */\n font-size: var(--vectis-text-overline-size);\n font-weight: var(--vectis-text-overline-weight);\n letter-spacing: var(--vectis-text-overline-tracking);\n color: var(--vectis-color-text-muted);\n text-transform: capitalize;\n }\n\n .v-date-picker-cell {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--date-picker-cell);\n }\n\n /* The band joining the days of a selected range: a tinted background laid behind\n the day, at the HEIGHT of the disc rather than of the whole cell. Its vertical\n inset is half the gap between cell and disc, expressed in `%` so it follows the\n real width of a 1fr column whatever the calendar measures.\n\n At either end the band stops exactly at the edge of the disc — hence the inset on\n the outer side — and that corner is rounded with the pill radius, which a box\n this height caps at half its height, i.e. precisely the disc's own radius, so it\n cannot overshoot.\n\n TRAP — the two cap rules below only shape a pseudo-element that `[data-in-range]`\n has already created, so they depend on `isInRange` counting BOTH ends of the period\n as inside it. Make it exclusive and there is no `::before` to cap: both rounded ends\n of every range vanish, leaving a band that stops square one cell short at each side,\n with nothing in the console. The last rule is the single-day case, where the two caps\n would meet and draw a disc behind the disc. */\n .v-date-picker-cell[data-in-range]::before {\n content: '';\n position: absolute;\n inset-block: calc((100% - var(--vectis-control-size-date-picker-day)) / 2);\n inset-inline: 0;\n background: var(--vectis-color-accent-surface);\n z-index: 0;\n }\n .v-date-picker-cell[data-range-start]::before {\n inset-inline-start: calc((100% - var(--vectis-control-size-date-picker-day)) / 2);\n border-start-start-radius: var(--vectis-radius-pill);\n border-end-start-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-end]::before {\n inset-inline-end: calc((100% - var(--vectis-control-size-date-picker-day)) / 2);\n border-start-end-radius: var(--vectis-radius-pill);\n border-end-end-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-start][data-range-end]::before {\n content: none;\n }\n\n .v-date-picker-day {\n position: relative;\n z-index: 1;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: var(--vectis-control-size-date-picker-day);\n block-size: var(--vectis-control-size-date-picker-day);\n padding: 0;\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n cursor: pointer;\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /* Hover belongs to the days one can actually click: not the disabled ones, not the\n already selected ones, and not the neighbouring days rendered as plain spans. */\n .v-date-picker-day:hover:not([aria-disabled='true']):not([data-selected]):not(\n .v-date-picker-day--static\n ) {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-date-picker-day[data-outside] {\n color: var(--vectis-color-text-subtle);\n }\n\n /* The semibold in the two rules below marks a state — today, and the selection —\n and is not a typographic role, which is why it reads a font token directly. */\n .v-date-picker-day[data-today]:not([data-selected]) {\n box-shadow: inset 0 0 0 1px var(--vectis-color-accent-border);\n color: var(--vectis-color-accent-text);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-date-picker-day[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n /* The strike-through says the DATE is unavailable — outside the bounds, or listed in\n `disabledDates`. It hangs on its own attribute rather than on `aria-disabled`, which\n a read-only calendar also carries on every day: nothing can be chosen there, but the\n dates themselves are perfectly available and striking them all out would say the\n opposite. The hover rule below still reads `aria-disabled`, so neither highlights. */\n .v-date-picker-day[data-unavailable] {\n color: var(--vectis-color-text-subtle);\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker[data-readonly] .v-date-picker-day:not([data-unavailable]) {\n cursor: default;\n }\n\n /* A disabled calendar greys out through the colour tokens and never through opacity,\n the selection included: left in the accent colour it would go on looking live. */\n .v-date-picker-day:disabled {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n .v-date-picker[data-disabled] .v-date-picker-day[data-selected] {\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n }\n\n .v-date-picker-day--static {\n color: var(--vectis-color-text-subtle);\n cursor: default;\n }\n\n /* A neighbouring day that falls outside the bounds, or is disabled, is struck\n through like any other unavailable date. */\n .v-date-picker-day--static[data-disabled] {\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker-day:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-date-picker-day-num {\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-date-picker-dots {\n position: absolute;\n inset-block-end: calc(var(--vectis-space-1) * 0.5);\n display: flex;\n gap: 2px;\n }\n .v-date-picker-dot {\n inline-size: var(--vectis-control-size-date-picker-dot);\n block-size: var(--vectis-control-size-date-picker-dot);\n border-radius: var(--vectis-radius-pill);\n background: var(--date-picker-dot-color, var(--vectis-color-accent));\n }\n .v-date-picker-day[data-selected] .v-date-picker-dot {\n background: var(--vectis-color-text-on-accent);\n }\n\n /* The months and years views. They fill the calendar's width exactly like the days\n grid does: stretched by the flex column, then shared out by 1fr columns. */\n .v-date-picker-view {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--vectis-space-1);\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n /* The rows ARIA requires inside a grid, made invisible to the layout: with\n `display: contents` the cells remain direct grid items of `.v-date-picker-view`,\n so the columns line up as if the rows were not there. */\n .v-date-picker-view-row {\n display: contents;\n }\n\n .v-date-picker-view--years {\n max-block-size: calc(6 * var(--date-picker-cell));\n overflow-y: auto;\n }\n\n .v-date-picker-view-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n block-size: var(--vectis-control-height-lg);\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n text-transform: capitalize;\n cursor: pointer;\n transition: background-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n .v-date-picker-view-cell:hover:not(:disabled):not([data-selected]) {\n background: var(--vectis-color-surface-muted);\n }\n .v-date-picker-view-cell[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n /* Again state emphasis, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n }\n .v-date-picker-view-cell:disabled {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n .v-date-picker-view-cell:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n .v-date-picker-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-2);\n padding-block-start: var(--vectis-space-2);\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-date-picker-day,\n .v-date-picker-view-cell {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}