vectis-ui 0.10.1 → 0.10.3

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 (330) hide show
  1. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  2. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  3. package/dist/components/VAccordion/VAccordionItem.d.ts +6 -21
  4. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/VAccordion/context.js.map +1 -1
  7. package/dist/components/VAvatar/VAvatar.d.ts +2 -12
  8. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  9. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/components/VAvatar/VAvatarGroup.d.ts +2 -2
  11. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  12. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +6 -6
  13. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/components/VAvatar/context.d.ts +1 -5
  15. package/dist/components/VAvatar/context.js.map +1 -1
  16. package/dist/components/VBadge/VBadge.d.ts +13 -27
  17. package/dist/components/VBadge/VBadge.js.map +1 -1
  18. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +3 -9
  20. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  21. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/VButton/VButton.d.ts +10 -17
  23. package/dist/components/VButton/VButton.js.map +1 -1
  24. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/VButton/VButtonGroup.d.ts +6 -15
  26. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  27. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/VButton/context.d.ts +1 -9
  29. package/dist/components/VButton/context.js.map +1 -1
  30. package/dist/components/VCalendar/VCalendar.d.ts +9 -24
  31. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  32. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/VCalendar/VCalendarEvent.d.ts +4 -13
  34. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  37. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +1 -5
  39. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  42. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/VCalendar/color.d.ts +1 -7
  44. package/dist/components/VCalendar/color.js.map +1 -1
  45. package/dist/components/VCalendar/edgeStep.d.ts +5 -15
  46. package/dist/components/VCalendar/edgeStep.js.map +1 -1
  47. package/dist/components/VCalendar/gesture.d.ts +12 -36
  48. package/dist/components/VCalendar/gesture.js.map +1 -1
  49. package/dist/components/VCalendar/keyboard.d.ts +5 -42
  50. package/dist/components/VCalendar/keyboard.js.map +1 -1
  51. package/dist/components/VCalendar/layout.d.ts +38 -199
  52. package/dist/components/VCalendar/layout.js.map +1 -1
  53. package/dist/components/VCalendar/timeGrid.d.ts +3 -25
  54. package/dist/components/VCalendar/timeGrid.js.map +1 -1
  55. package/dist/components/VCalendar/types.d.ts +6 -23
  56. package/dist/components/VCarousel/VCarousel.d.ts +25 -96
  57. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  58. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +6 -6
  59. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  60. package/dist/components/VCarousel/VCarouselItem.d.ts +1 -6
  61. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  62. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/VCarousel/context.js.map +1 -1
  64. package/dist/components/VCheckbox/VCheckbox.d.ts +1 -5
  65. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  66. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/VChip/VChip.d.ts +2 -8
  68. package/dist/components/VChip/VChip.js.map +1 -1
  69. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/components/VCombobox/VCombobox.d.ts +21 -59
  71. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  72. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +117 -119
  73. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  74. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  75. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  76. package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
  77. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
  79. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/components/VCombobox/infiniteScroll.d.ts +4 -10
  81. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  82. package/dist/components/VDataTable/VDataTable.d.ts +11 -36
  83. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  84. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +23 -20
  85. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  86. package/dist/components/VDateInput/VDateInput.d.ts +12 -21
  87. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  88. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  89. package/dist/components/VDateInput/mask.d.ts +14 -59
  90. package/dist/components/VDateInput/mask.js.map +1 -1
  91. package/dist/components/VDatePicker/VDatePicker.d.ts +6 -12
  92. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  93. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  94. package/dist/components/VDatePicker/keyboard.d.ts +10 -42
  95. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  96. package/dist/components/VDatePicker/names.d.ts +8 -22
  97. package/dist/components/VDatePicker/names.js.map +1 -1
  98. package/dist/components/VDialog/VDialog.d.ts +5 -10
  99. package/dist/components/VDialog/VDialog.js.map +1 -1
  100. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +51 -53
  101. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/VDialog/VDialogAlert.d.ts +2 -3
  103. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  104. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/VFileInput/VFileInput.d.ts +11 -37
  106. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  107. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/components/VFileInput/truncate.d.ts +3 -23
  109. package/dist/components/VFileInput/truncate.js.map +1 -1
  110. package/dist/components/VFilePicker/VFilePicker.d.ts +15 -65
  111. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  112. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  113. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  114. package/dist/components/VHotkeys/VHotkeys.d.ts +6 -15
  115. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  116. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/components/VHotkeys/platform.d.ts +10 -49
  118. package/dist/components/VHotkeys/platform.js.map +1 -1
  119. package/dist/components/VIcon/VIcon.d.ts +7 -19
  120. package/dist/components/VIcon/VIcon.js.map +1 -1
  121. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VIcon/iconProps.d.ts +5 -19
  123. package/dist/components/VIcon/iconProps.js.map +1 -1
  124. package/dist/components/VIcon/resolver.d.ts +15 -43
  125. package/dist/components/VIcon/resolver.js.map +1 -1
  126. package/dist/components/VIcon/types.d.ts +7 -34
  127. package/dist/components/VIconButton/VIconButton.d.ts +2 -3
  128. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  129. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  130. package/dist/components/VInput/VInput.d.ts +14 -29
  131. package/dist/components/VInput/VInput.js.map +1 -1
  132. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/components/VInput/VInputGroup.js.map +1 -1
  134. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +34 -50
  135. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  136. package/dist/components/VInput/context.js.map +1 -1
  137. package/dist/components/VInputOTP/VInputOTP.d.ts +8 -16
  138. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  139. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +55 -63
  140. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  141. package/dist/components/VMenu/VMenu.js.map +1 -1
  142. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/VMenu/VMenuGroup.d.ts +1 -6
  144. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  145. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  146. package/dist/components/VMenu/VMenuItem.d.ts +0 -5
  147. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  148. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  149. package/dist/components/VMenu/VMenuPanel.d.ts +1 -6
  150. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  151. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +2 -2
  152. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  153. package/dist/components/VMenu/VMenuSeparator.js.map +1 -1
  154. package/dist/components/VMenu/VMenuSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/VMenu/context.d.ts +3 -11
  156. package/dist/components/VMenu/context.js.map +1 -1
  157. package/dist/components/VPagination/VPagination.d.ts +9 -20
  158. package/dist/components/VPagination/VPagination.js.map +1 -1
  159. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  160. package/dist/components/VPopover/VPopover.d.ts +7 -18
  161. package/dist/components/VPopover/VPopover.js.map +1 -1
  162. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +23 -27
  163. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  164. package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -6
  165. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  166. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  167. package/dist/components/VProgressLinear/VProgressLinear.d.ts +4 -15
  168. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  169. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/components/VRadio/VRadio.d.ts +1 -5
  171. package/dist/components/VRadio/VRadio.js.map +1 -1
  172. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  173. package/dist/components/VSeparator/VSeparator.d.ts +2 -15
  174. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  175. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  176. package/dist/components/VSideNavigation/VSideNavigation.d.ts +1 -1
  177. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  178. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +1 -5
  180. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  181. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  182. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +1 -5
  183. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  184. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +80 -75
  185. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  186. package/dist/components/VSideNavigation/VSideNavigationSeparator.js.map +1 -1
  187. package/dist/components/VSideNavigation/context.js.map +1 -1
  188. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +6 -19
  189. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  190. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/components/VSlider/VSlider.d.ts +5 -13
  192. package/dist/components/VSlider/VSlider.js.map +1 -1
  193. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  194. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  195. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  196. package/dist/components/VSnackbar/state.d.ts +4 -17
  197. package/dist/components/VSnackbar/state.js.map +1 -1
  198. package/dist/components/VSpinner/VSpinner.d.ts +3 -5
  199. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  200. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  201. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  202. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/VTabs/VTab.d.ts +1 -5
  204. package/dist/components/VTabs/VTab.js.map +1 -1
  205. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  206. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  207. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  208. package/dist/components/VTabs/VTabs.d.ts +5 -17
  209. package/dist/components/VTabs/VTabs.js.map +1 -1
  210. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  211. package/dist/components/VTabs/context.js.map +1 -1
  212. package/dist/components/VTextarea/VTextarea.d.ts +13 -20
  213. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  214. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  215. package/dist/components/VTimeInput/VTimeInput.d.ts +8 -21
  216. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  217. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  218. package/dist/components/VTimeInput/search.d.ts +3 -34
  219. package/dist/components/VTimeInput/search.js.map +1 -1
  220. package/dist/components/VTimePicker/VTimePicker.d.ts +9 -31
  221. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  222. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  223. package/dist/components/VTimePicker/limits.d.ts +18 -45
  224. package/dist/components/VTimePicker/limits.js.map +1 -1
  225. package/dist/components/VToast/VToast.js.map +1 -1
  226. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  227. package/dist/components/VToast/VToaster.js.map +1 -1
  228. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  229. package/dist/components/VToast/state.d.ts +2 -7
  230. package/dist/components/VToast/state.js.map +1 -1
  231. package/dist/components/VToggle/VToggle.d.ts +5 -9
  232. package/dist/components/VToggle/VToggle.js.map +1 -1
  233. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  234. package/dist/components/VToggle/VToggleItem.d.ts +1 -9
  235. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  236. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  237. package/dist/components/VToggle/context.js.map +1 -1
  238. package/dist/components/VTooltip/VTooltip.d.ts +3 -16
  239. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  240. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +2 -2
  241. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  242. package/dist/components/VTypography/VTypography.d.ts +4 -8
  243. package/dist/components/VTypography/VTypography.js.map +1 -1
  244. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  245. package/dist/composables/useAriaLabel.js.map +1 -1
  246. package/dist/composables/useClearable.d.ts +2 -8
  247. package/dist/composables/useClearable.js.map +1 -1
  248. package/dist/composables/useControlShape.js.map +1 -1
  249. package/dist/composables/useDetailsOpen.d.ts +2 -10
  250. package/dist/composables/useDetailsOpen.js.map +1 -1
  251. package/dist/composables/useFieldIds.js.map +1 -1
  252. package/dist/composables/useFieldPanel.d.ts +4 -17
  253. package/dist/composables/useFieldPanel.js.map +1 -1
  254. package/dist/composables/useFileDrop.js.map +1 -1
  255. package/dist/composables/useFileField.d.ts +1 -5
  256. package/dist/composables/useFileField.js.map +1 -1
  257. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  258. package/dist/composables/useIconClickHandlers.d.ts +4 -19
  259. package/dist/composables/useIconClickHandlers.js.map +1 -1
  260. package/dist/composables/useInertLink.d.ts +1 -1
  261. package/dist/composables/useInertLink.js.map +1 -1
  262. package/dist/composables/useLiveAnnouncer.js.map +1 -1
  263. package/dist/composables/useMaskedField.d.ts +12 -27
  264. package/dist/composables/useMaskedField.js.map +1 -1
  265. package/dist/composables/usePopover.d.ts +3 -11
  266. package/dist/composables/usePopover.js.map +1 -1
  267. package/dist/composables/useProgressValue.js.map +1 -1
  268. package/dist/composables/useRootAttrs.d.ts +0 -9
  269. package/dist/composables/useRootAttrs.js +11 -4
  270. package/dist/composables/useRootAttrs.js.map +1 -1
  271. package/dist/composables/useSlotNodes.d.ts +3 -14
  272. package/dist/composables/useSlotNodes.js.map +1 -1
  273. package/dist/composables/useTextLimit.d.ts +4 -16
  274. package/dist/composables/useTextLimit.js.map +1 -1
  275. package/dist/composables/useTimer.d.ts +2 -15
  276. package/dist/composables/useTimer.js.map +1 -1
  277. package/dist/i18n/en.js.map +1 -1
  278. package/dist/i18n/fr.js.map +1 -1
  279. package/dist/i18n/state.d.ts +9 -38
  280. package/dist/i18n/state.js.map +1 -1
  281. package/dist/i18n/types.d.ts +19 -81
  282. package/dist/icons.d.ts +2 -12
  283. package/dist/tokens/css.d.ts +3 -16
  284. package/dist/tokens/css.js.map +1 -1
  285. package/dist/tokens/index.js.map +1 -1
  286. package/dist/tokens/primitives.js.map +1 -1
  287. package/dist/tokens/semantic.d.ts +1 -23
  288. package/dist/tokens/semantic.js.map +1 -1
  289. package/dist/tokens/themes/dark.js.map +1 -1
  290. package/dist/tokens/types.d.ts +2 -12
  291. package/dist/tokens/types.js.map +1 -1
  292. package/dist/types.d.ts +3 -21
  293. package/dist/utils/array.d.ts +2 -4
  294. package/dist/utils/array.js.map +1 -1
  295. package/dist/utils/arrowNav.d.ts +2 -26
  296. package/dist/utils/arrowNav.js.map +1 -1
  297. package/dist/utils/chip.d.ts +1 -8
  298. package/dist/utils/chip.js.map +1 -1
  299. package/dist/utils/clock.d.ts +16 -39
  300. package/dist/utils/clock.js.map +1 -1
  301. package/dist/utils/css.d.ts +5 -16
  302. package/dist/utils/css.js.map +1 -1
  303. package/dist/utils/date.d.ts +17 -60
  304. package/dist/utils/date.js.map +1 -1
  305. package/dist/utils/direction.d.ts +2 -9
  306. package/dist/utils/direction.js.map +1 -1
  307. package/dist/utils/env.d.ts +2 -15
  308. package/dist/utils/env.js.map +1 -1
  309. package/dist/utils/file.d.ts +8 -46
  310. package/dist/utils/file.js.map +1 -1
  311. package/dist/utils/focus.d.ts +1 -14
  312. package/dist/utils/focus.js +1 -6
  313. package/dist/utils/focus.js.map +1 -1
  314. package/dist/utils/hostWarns.d.ts +3 -8
  315. package/dist/utils/hostWarns.js.map +1 -1
  316. package/dist/utils/ids.d.ts +2 -7
  317. package/dist/utils/ids.js.map +1 -1
  318. package/dist/utils/matcher.d.ts +1 -8
  319. package/dist/utils/matcher.js.map +1 -1
  320. package/dist/utils/memo.d.ts +1 -11
  321. package/dist/utils/memo.js.map +1 -1
  322. package/dist/utils/number.d.ts +1 -7
  323. package/dist/utils/number.js.map +1 -1
  324. package/dist/utils/text.d.ts +4 -23
  325. package/dist/utils/text.js.map +1 -1
  326. package/dist/utils/time.d.ts +4 -12
  327. package/dist/utils/time.js.map +1 -1
  328. package/dist/utils/vnode.d.ts +0 -10
  329. package/dist/utils/vnode.js.map +1 -1
  330. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","names":[],"sources":["../../src/utils/array.ts"],"sourcesContent":["// @core\n/**\n * Adds a value to a selection, or takes it out again if it is already there.\n *\n * ALWAYS returns a new list rather than mutating the one it was given: it is the new\n * reference, not a change made inside the old list, that wakes a consumer's v-model.\n */\nexport function toggleValue<T>(list: readonly T[], value: T): T[] {\n return list.includes(value) ? list.filter((v) => v !== value) : [...list, value]\n}\n"],"mappings":";AAOA,SAAgB,EAAe,GAAoB,GAAe;CAChE,OAAO,EAAK,SAAS,CAAK,IAAI,EAAK,QAAQ,MAAM,MAAM,CAAK,IAAI,CAAC,GAAG,GAAM,CAAK;AACjF"}
1
+ {"version":3,"file":"array.js","names":[],"sources":["../../src/utils/array.ts"],"sourcesContent":["// @core\n/**\n * Toggle membership without mutating the input; returning a new reference propagates selection\n * changes through v-model.\n */\nexport function toggleValue<T>(list: readonly T[], value: T): T[] {\n return list.includes(value) ? list.filter((v) => v !== value) : [...list, value]\n}\n"],"mappings":";AAKA,SAAgB,EAAe,GAAoB,GAAe;CAChE,OAAO,EAAK,SAAS,CAAK,IAAI,EAAK,QAAQ,MAAM,MAAM,CAAK,IAAI,CAAC,GAAG,GAAM,CAAK;AACjF"}
@@ -1,30 +1,6 @@
1
- /**
2
- * The elements the arrows may land on, discovered from the DOM rather than a registry. The
3
- * selector is the caller's, and it is what excludes anything disabled.
4
- *
5
- * `display: none` is filtered here because it has to be: VPagination hides its neighbours
6
- * through container queries as the bar narrows, and a consumer may hide a tab outright.
7
- * Focus must not land on an element nobody can see. The read costs a style recalculation
8
- * per element, which is why `arrowNavigate` asks for the list only once it knows the key is
9
- * one it handles.
10
- */
1
+ /** The elements the arrows may land on, discovered from the DOM rather than a registry. */
11
2
  export declare function navigableItems(container: HTMLElement, selector: string): HTMLElement[];
12
- /**
13
- * Moves focus for the arrows and Home/End, and reports whether it took the key.
14
- * `preventDefault` is applied only when it did, leaving the caller free otherwise.
15
- *
16
- * The ends wrap. With nothing in the list focused, any arrow starts at the beginning.
17
- * Left and Right name a physical side, so RTL swaps them: Right must reach the NEXT item,
18
- * which is then on the left. The block axis needs no such treatment, no language
19
- * reversing it.
20
- *
21
- * A key held with Alt, Ctrl or Meta is never taken: those are the browser's and the system's
22
- * shortcuts (Alt+Left goes back a page), and cancelling one to move a focus would break it.
23
- *
24
- * `items` is a FUNCTION, called only once the key is known to be one of the four. A keydown
25
- * handler on a container sees every key typed inside it (Tab, Enter, letters), and collecting
26
- * the list costs a query plus, for most callers, one style read per element.
27
- */
3
+ /** Moves focus for the arrows and Home/End, and reports whether it took the key. */
28
4
  export declare function arrowNavigate(event: KeyboardEvent, container: HTMLElement, items: () => HTMLElement[], options?: {
29
5
  vertical?: boolean;
30
6
  }): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"arrowNav.js","names":[],"sources":["../../src/utils/arrowNav.ts"],"sourcesContent":["// @keyboard @a11y — module-wide: the browser walks focus out of a group with Tab, never\n// from one control to the next, which is what the arrows are expected to do.\n/**\n * Arrow-key navigation over a row or column of controls, in one place: VPagination, VTabs,\n * VToggle, VMenuPanel and VSideNavigation all use it.\n *\n * CONTRACT — the arrows and Home/End MOVE focus and never activate what they land on.\n * Activating on arrival would navigate somewhere the reader did not ask to go, or select a\n * value merely passed over. A component that wants selection on focus (VTabs'\n * `activation: 'automatic'`) arranges it in its own `@focus`.\n */\nimport { isRtl } from './direction'\n\n/**\n * The elements the arrows may land on, discovered from the DOM rather than a registry. The\n * selector is the caller's, and it is what excludes anything disabled.\n *\n * `display: none` is filtered here because it has to be: VPagination hides its neighbours\n * through container queries as the bar narrows, and a consumer may hide a tab outright.\n * Focus must not land on an element nobody can see. The read costs a style recalculation\n * per element, which is why `arrowNavigate` asks for the list only once it knows the key is\n * one it handles.\n */\nexport function navigableItems(container: HTMLElement, selector: string): HTMLElement[] {\n return [...container.querySelectorAll<HTMLElement>(selector)].filter(\n (el) => getComputedStyle(el).display !== 'none',\n )\n}\n\n/**\n * Moves focus for the arrows and Home/End, and reports whether it took the key.\n * `preventDefault` is applied only when it did, leaving the caller free otherwise.\n *\n * The ends wrap. With nothing in the list focused, any arrow starts at the beginning.\n * Left and Right name a physical side, so RTL swaps them: Right must reach the NEXT item,\n * which is then on the left. The block axis needs no such treatment, no language\n * reversing it.\n *\n * A key held with Alt, Ctrl or Meta is never taken: those are the browser's and the system's\n * shortcuts (Alt+Left goes back a page), and cancelling one to move a focus would break it.\n *\n * `items` is a FUNCTION, called only once the key is known to be one of the four. A keydown\n * handler on a container sees every key typed inside it (Tab, Enter, letters), and collecting\n * the list costs a query plus, for most callers, one style read per element.\n */\nexport function arrowNavigate(\n event: KeyboardEvent,\n container: HTMLElement,\n items: () => HTMLElement[],\n options: { vertical?: boolean } = {},\n): boolean {\n const vertical = options.vertical ?? false\n const keys = vertical\n ? ['ArrowDown', 'ArrowUp', 'Home', 'End']\n : ['ArrowRight', 'ArrowLeft', 'Home', 'End']\n if (event.altKey || event.ctrlKey || event.metaKey || !keys.includes(event.key)) return false\n const list = items()\n if (list.length === 0) return false\n event.preventDefault()\n\n // A function, not a value: only the arrow branch asks, so Home and End are spared the\n // style recalculation that reading the direction forces.\n const forward = () =>\n vertical ? event.key === 'ArrowDown' : (event.key === 'ArrowRight') !== isRtl(container)\n const current = list.indexOf(document.activeElement as HTMLElement)\n const next =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? list.length - 1\n : current === -1\n ? 0\n : (current + (forward() ? 1 : -1) + list.length) % list.length\n list[next]?.focus()\n return true\n}\n"],"mappings":";;AAuBA,SAAgB,EAAe,GAAwB,GAAiC;CACtF,OAAO,CAAC,GAAG,EAAU,iBAA8B,CAAQ,CAAC,CAAC,CAAC,QAC3D,MAAO,iBAAiB,CAAE,CAAC,CAAC,YAAY,MAC3C;AACF;AAkBA,SAAgB,EACd,GACA,GACA,GACA,IAAkC,CAAC,GAC1B;CACT,IAAM,IAAW,EAAQ,YAAY,IAC/B,IAAO,IACT;EAAC;EAAa;EAAW;EAAQ;CAAK,IACtC;EAAC;EAAc;EAAa;EAAQ;CAAK;CAC7C,IAAI,EAAM,UAAU,EAAM,WAAW,EAAM,WAAW,CAAC,EAAK,SAAS,EAAM,GAAG,GAAG,OAAO;CACxF,IAAM,IAAO,EAAM;CACnB,IAAI,EAAK,WAAW,GAAG,OAAO;CAC9B,EAAM,eAAe;CAIrB,IAAM,UACJ,IAAW,EAAM,QAAQ,cAAe,EAAM,QAAQ,iBAAkB,EAAM,CAAS,GACnF,IAAU,EAAK,QAAQ,SAAS,aAA4B;CAUlE,OADA,EAPE,EAAM,QAAQ,SACV,IACA,EAAM,QAAQ,QACZ,EAAK,SAAS,IACd,MAAY,KACV,KACC,KAAW,EAAQ,IAAI,IAAI,MAAM,EAAK,UAAU,EAAK,OACtD,EAAE,MAAM,GACX;AACT"}
1
+ {"version":3,"file":"arrowNav.js","names":[],"sources":["../../src/utils/arrowNav.ts"],"sourcesContent":["// @keyboard @a11y\n/**\n * Arrow-key navigation over a row or column of controls, in one place: VPagination, VTabs,\n * VToggle, VMenuPanel and VSideNavigation all use it.\n */\nimport { isRtl } from './direction'\n\n/** The elements the arrows may land on, discovered from the DOM rather than a registry. */\nexport function navigableItems(container: HTMLElement, selector: string): HTMLElement[] {\n return [...container.querySelectorAll<HTMLElement>(selector)].filter(\n (el) => getComputedStyle(el).display !== 'none',\n )\n}\n\n/** Moves focus for the arrows and Home/End, and reports whether it took the key. */\nexport function arrowNavigate(\n event: KeyboardEvent,\n container: HTMLElement,\n items: () => HTMLElement[],\n options: { vertical?: boolean } = {},\n): boolean {\n const vertical = options.vertical ?? false\n const keys = vertical\n ? ['ArrowDown', 'ArrowUp', 'Home', 'End']\n : ['ArrowRight', 'ArrowLeft', 'Home', 'End']\n if (event.altKey || event.ctrlKey || event.metaKey || !keys.includes(event.key)) return false\n const list = items()\n if (list.length === 0) return false\n event.preventDefault()\n\n // A function, not a value: only the arrow branch asks, so Home and End are spared the\n // style recalculation that reading the direction forces.\n const forward = () =>\n vertical ? event.key === 'ArrowDown' : (event.key === 'ArrowRight') !== isRtl(container)\n const current = list.indexOf(document.activeElement as HTMLElement)\n const next =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? list.length - 1\n : current === -1\n ? 0\n : (current + (forward() ? 1 : -1) + list.length) % list.length\n list[next]?.focus()\n return true\n}\n"],"mappings":";;AAQA,SAAgB,EAAe,GAAwB,GAAiC;CACtF,OAAO,CAAC,GAAG,EAAU,iBAA8B,CAAQ,CAAC,CAAC,CAAC,QAC3D,MAAO,iBAAiB,CAAE,CAAC,CAAC,YAAY,MAC3C;AACF;AAGA,SAAgB,EACd,GACA,GACA,GACA,IAAkC,CAAC,GAC1B;CACT,IAAM,IAAW,EAAQ,YAAY,IAC/B,IAAO,IACT;EAAC;EAAa;EAAW;EAAQ;CAAK,IACtC;EAAC;EAAc;EAAa;EAAQ;CAAK;CAC7C,IAAI,EAAM,UAAU,EAAM,WAAW,EAAM,WAAW,CAAC,EAAK,SAAS,EAAM,GAAG,GAAG,OAAO;CACxF,IAAM,IAAO,EAAM;CACnB,IAAI,EAAK,WAAW,GAAG,OAAO;CAC9B,EAAM,eAAe;CAIrB,IAAM,UACJ,IAAW,EAAM,QAAQ,cAAe,EAAM,QAAQ,iBAAkB,EAAM,CAAS,GACnF,IAAU,EAAK,QAAQ,SAAS,aAA4B;CAUlE,OADA,EAPE,EAAM,QAAQ,SACV,IACA,EAAM,QAAQ,QACZ,EAAK,SAAS,IACd,MAAY,KACV,KACC,KAAW,EAAQ,IAAI,IAAI,MAAM,EAAK,UAAU,EAAK,OACtD,EAAE,MAAM,GACX;AACT"}
@@ -1,16 +1,9 @@
1
1
  import { ChipSize } from '../components/VChip/VChip.js';
2
2
  /**
3
3
  * The scale of a VChip rendered INSIDE a text field: VCombobox's values, VFileInput's files.
4
- *
5
- * A chip is one step below its field, so a row of them does not push the field taller. Below
6
- * the lowest step of each pair there is no smaller size left, and `compact` makes up the
4
+ * Below the lowest step of each pair there is no smaller size left, and `compact` makes up the
7
5
  * difference instead, which is why an `sm` field forces it and an `md` one, already having
8
6
  * room, does not pass its own through.
9
- *
10
- * The HEIGHT is what earns the module its place. The field must force its `<input>` to the
11
- * chips' height or it grows on focus, and that height is decided inside the VChip subtree,
12
- * out of the field's reach. Deriving it from the same pair that picks the size makes the two
13
- * incapable of drifting.
14
7
  */
15
8
  export type ChipFieldSize = 'sm' | 'md' | 'lg';
16
9
  export interface ChipScale {
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","names":[],"sources":["../../src/utils/chip.ts"],"sourcesContent":["import type { ChipSize } from '../components/VChip/VChip.vue'\n\n// @core\n/**\n * The scale of a VChip rendered INSIDE a text field: VCombobox's values, VFileInput's files.\n *\n * A chip is one step below its field, so a row of them does not push the field taller. Below\n * the lowest step of each pair there is no smaller size left, and `compact` makes up the\n * difference instead, which is why an `sm` field forces it and an `md` one, already having\n * room, does not pass its own through.\n *\n * The HEIGHT is what earns the module its place. The field must force its `<input>` to the\n * chips' height or it grows on focus, and that height is decided inside the VChip subtree,\n * out of the field's reach. Deriving it from the same pair that picks the size makes the two\n * incapable of drifting.\n */\nexport type ChipFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipScale {\n size: ChipSize\n compact: boolean\n /** The chips' height, ready to be set on the field so it can match its own text to it. */\n height: string\n}\n\nexport function chipScaleFor(size: ChipFieldSize, compact: boolean): ChipScale {\n const chipSize = size === 'lg' ? 'sm' : 'xs'\n const chipCompact = size === 'lg' ? compact : size === 'sm'\n const base = `var(--vectis-control-height-${chipSize})`\n return {\n size: chipSize,\n compact: chipCompact,\n height: chipCompact ? `calc(${base} - var(--vectis-space-1))` : base,\n }\n}\n"],"mappings":";AAyBA,SAAgB,EAAa,GAAqB,GAA6B;CAC7E,IAAM,IAAW,MAAS,OAAO,OAAO,MAClC,IAAc,MAAS,OAAO,IAAU,MAAS,MACjD,IAAO,+BAA+B,EAAS;CACrD,OAAO;EACL,MAAM;EACN,SAAS;EACT,QAAQ,IAAc,QAAQ,EAAK,6BAA6B;CAClE;AACF"}
1
+ {"version":3,"file":"chip.js","names":[],"sources":["../../src/utils/chip.ts"],"sourcesContent":["import type { ChipSize } from '../components/VChip/VChip.vue'\n\n// @core\n/**\n * The scale of a VChip rendered INSIDE a text field: VCombobox's values, VFileInput's files.\n * Below the lowest step of each pair there is no smaller size left, and `compact` makes up the\n * difference instead, which is why an `sm` field forces it and an `md` one, already having\n * room, does not pass its own through.\n */\nexport type ChipFieldSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipScale {\n size: ChipSize\n compact: boolean\n /** The chips' height, ready to be set on the field so it can match its own text to it. */\n height: string\n}\n\nexport function chipScaleFor(size: ChipFieldSize, compact: boolean): ChipScale {\n const chipSize = size === 'lg' ? 'sm' : 'xs'\n const chipCompact = size === 'lg' ? compact : size === 'sm'\n const base = `var(--vectis-control-height-${chipSize})`\n return {\n size: chipSize,\n compact: chipCompact,\n height: chipCompact ? `calc(${base} - var(--vectis-space-1))` : base,\n }\n}\n"],"mappings":";AAkBA,SAAgB,EAAa,GAAqB,GAA6B;CAC7E,IAAM,IAAW,MAAS,OAAO,OAAO,MAClC,IAAc,MAAS,OAAO,IAAU,MAAS,MACjD,IAAO,+BAA+B,EAAS;CACrD,OAAO;EACL,MAAM;EACN,SAAS;EACT,QAAQ,IAAc,QAAQ,EAAK,6BAA6B;CAClE;AACF"}
@@ -23,40 +23,24 @@ export declare function hourWithMeridiem(hour24: number, meridiem: Meridiem): nu
23
23
  * not a time at all: `'09:30'` with PM gives `'21:30'`.
24
24
  */
25
25
  export declare function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null;
26
- /**
27
- * Snaps a minute to the nearest allowed step and wraps it back inside the hour.
28
- *
29
- * Both ends need the wrap: 58 snapped to five-minute steps lands on 60, which is 0, and
30
- * stepping back from 0 with the keyboard passes through -1, which is 59.
31
- */
26
+ /** Snaps a minute to the nearest allowed step and wraps it back inside the hour. */
32
27
  export declare function snapMinute(minute: number, step: number): number;
33
28
  /**
34
- * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered
35
- * clockwise from twelve o'clock and the nearest wins. `dy` is negated because screen
36
- * coordinates grow DOWNWARD and the angle is measured from the top.
29
+ * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered clockwise
30
+ * from twelve o'clock and the nearest wins.
37
31
  */
38
32
  export declare function angleToIndex(dx: number, dy: number, segments: number): number;
39
33
  /** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */
40
34
  export declare function distanceFraction(dx: number, dy: number, radius: number): number;
41
35
  /**
42
- * How close to the centre a pointer must land to be aiming at the INNER ring, the one
43
- * holding the small hours of a 24-hour dial: the halfway mark between the two rings.
44
- *
45
- * TRAP: the number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts
46
- * the rings' centres at 104px and 56px from the middle, whose midpoint is 0.625 of the
47
- * radius. Change either token without changing this and the threshold no longer separates
48
- * the two rings: a tap near the boundary quietly sets the wrong hour.
36
+ * The number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts the rings'
37
+ * centres at 104px and 56px from the middle, whose midpoint is 0.625 of the radius.
49
38
  */
50
39
  export declare const DIAL_INNER_THRESHOLD = 0.625;
51
40
  /**
52
- * How close to the centre a pointer lands on NOTHING. At the very centre there is no angle
53
- * at all (`atan2(0, 0)` answers half a turn, which would set six o'clock), and the centre dot
54
- * drawn there is not a numeral.
55
- *
56
- * TRAP: derived from the same tokens as the threshold above: the inner ring's numerals
57
- * start 32px from the middle (56px less half a 48px numeral), 0.25 of the radius, so the
58
- * dead zone stops short of them. Grow it past 0.25 and the inner small hours lose their
59
- * inner half to it.
41
+ * Derived from the same tokens as the threshold above: the inner ring's numerals start 32px
42
+ * from the middle (56px less half a 48px numeral), 0.25 of the radius, so the dead zone stops
43
+ * short of them. Grow it past 0.25 and the inner small hours lose their inner half to it.
60
44
  */
61
45
  export declare const DIAL_DEAD_ZONE = 0.2;
62
46
  /**
@@ -64,25 +48,21 @@ export declare const DIAL_DEAD_ZONE = 0.2;
64
48
  * carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.
65
49
  */
66
50
  export declare function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number;
67
- /** The way back, which is what tells the hand where to point. */
51
+ /** The way back, which tells the hand where to point. */
68
52
  export declare function hour24ToDial(hour: number): {
69
53
  index: number;
70
54
  ring: 'outer' | 'inner';
71
55
  };
72
56
  export interface TimeOption {
73
- /** The canonical time, which is what the component's value will be set to. */
57
+ /** The canonical time, which the component's value will be set to. */
74
58
  value: string;
75
59
  /** The same time written out for the reader: "07:30", or "7:30 AM". */
76
60
  label: string;
77
61
  }
78
62
  /**
79
- * Every time of the day at a given interval, midnight to the last one before the next.
80
- *
81
- * It knows nothing of the restrictions: VTimeInput filters the rows it offers, so the list
82
- * itself stays one table per step and locale.
83
- *
84
- * A nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the
85
- * list stays FINITE even when the component's warning about it was ignored.
63
+ * Every time of the day at a given interval, midnight to the last one before the next. A
64
+ * nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the list
65
+ * stays FINITE even when the component's warning about it was ignored.
86
66
  */
87
67
  export declare function timeList(step: number, locale: string, format: HourFormat): TimeOption[];
88
68
  /**
@@ -91,12 +71,9 @@ export declare function timeList(step: number, locale: string, format: HourForma
91
71
  */
92
72
  export declare function formatTimeMask(digits: string): string;
93
73
  /**
94
- * Where the caret belongs to sit just after `n` digits. A closed formula rather than
95
- * `date.ts`'s scan, the colon always being in the same place.
96
- *
97
- * `skipSeparator` means something was INSERTED, and the caret then steps over the colon
98
- * into the minutes. On a DELETION it stays in front of it, or the next Backspace steps
99
- * over the colon instead of erasing a digit and the key appears to do nothing.
74
+ * Where the caret belongs to sit just after `n` digits. On a DELETION it stays in front of it,
75
+ * or the next Backspace steps over the colon instead of erasing a digit and the key appears to
76
+ * do nothing.
100
77
  */
101
78
  export declare function timeCaret(n: number, skipSeparator?: boolean): number;
102
79
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"clock.js","names":[],"sources":["../../src/utils/clock.ts"],"sourcesContent":["// @ssr @core — module-wide: every export below is @core unless tagged otherwise.\n/**\n * What the CLOCK and the FIELD need of the time domain: the AM/PM arithmetic, the dial's\n * geometry, the typing mask and the list of times. VTimePicker and VTimeInput are its only\n * consumers; `./time` holds what VCalendar reads as well, and this is kept apart so that\n * no calendar pays for a dial it never draws.\n *\n * The dial's geometry lives here rather than in the component for a practical reason: jsdom\n * lays nothing out and measures every element at zero, so a calculation kept inside the\n * component is untestable.\n */\nimport { digitsOf, pad2 } from './text'\nimport { formatTime, parseTime, formatTimeDisplay } from './time'\nimport type { HourFormat, Meridiem } from './time'\n\n/**\n * Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together\n * with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven\n * at night is 11 PM.\n */\nexport function to12h(hour24: number): { hour: number; meridiem: Meridiem } {\n const meridiem: Meridiem = hour24 >= 12 ? 'PM' : 'AM'\n const hour = hour24 % 12 === 0 ? 12 : hour24 % 12\n return { hour, meridiem }\n}\n\n/**\n * The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,\n * gives the hour on the 24-hour clock: 12 in the morning is 0, 12 in the afternoon is 12.\n */\nexport function to24h(hour12: number, meridiem: Meridiem): number {\n const base = hour12 % 12 // Twelve is the zero of the cycle, not its top.\n return meridiem === 'PM' ? base + 12 : base\n}\n\n/**\n * The same hour moved into the other half of the day, or left where it is: 9 with PM gives\n * 21, and 21 with PM stays 21. It is what an AM/PM control does to the hour it qualifies.\n */\nexport function hourWithMeridiem(hour24: number, meridiem: Meridiem): number {\n return to24h(to12h(hour24).hour, meridiem)\n}\n\n/**\n * A canonical time moved into a half of the day, its minutes untouched, or `null` when it is\n * not a time at all: `'09:30'` with PM gives `'21:30'`.\n */\nexport function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null {\n const parts = parseTime(time)\n return parts ? formatTime(hourWithMeridiem(parts.hour, meridiem), parts.minute) : null\n}\n\n/**\n * Snaps a minute to the nearest allowed step and wraps it back inside the hour.\n *\n * Both ends need the wrap: 58 snapped to five-minute steps lands on 60, which is 0, and\n * stepping back from 0 with the keyboard passes through -1, which is 59.\n */\nexport function snapMinute(minute: number, step: number): number {\n // A step is whole minutes: 7.5 divides 60, and wrote `09:7.5` into the model.\n const size = Math.round(step)\n const snapped = size <= 1 ? Math.round(minute) : Math.round(minute / size) * size\n return ((snapped % 60) + 60) % 60\n}\n\n/**\n * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered\n * clockwise from twelve o'clock and the nearest wins. `dy` is negated because screen\n * coordinates grow DOWNWARD and the angle is measured from the top.\n */\nexport function angleToIndex(dx: number, dy: number, segments: number): number {\n // The angle from twelve o'clock, clockwise-positive, as a fraction of a full turn.\n const angle = Math.atan2(dx, -dy)\n const turn = (angle / (2 * Math.PI) + 1) % 1\n return Math.round(turn * segments) % segments\n}\n\n/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */\nexport function distanceFraction(dx: number, dy: number, radius: number): number {\n return radius > 0 ? Math.hypot(dx, dy) / radius : 0\n}\n\n/**\n * How close to the centre a pointer must land to be aiming at the INNER ring, the one\n * holding the small hours of a 24-hour dial: the halfway mark between the two rings.\n *\n * TRAP: the number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts\n * the rings' centres at 104px and 56px from the middle, whose midpoint is 0.625 of the\n * radius. Change either token without changing this and the threshold no longer separates\n * the two rings: a tap near the boundary quietly sets the wrong hour.\n */\nexport const DIAL_INNER_THRESHOLD = 0.625\n\n/**\n * How close to the centre a pointer lands on NOTHING. At the very centre there is no angle\n * at all (`atan2(0, 0)` answers half a turn, which would set six o'clock), and the centre dot\n * drawn there is not a numeral.\n *\n * TRAP: derived from the same tokens as the threshold above: the inner ring's numerals\n * start 32px from the middle (56px less half a 48px numeral), 0.25 of the radius, so the\n * dead zone stops short of them. Grow it past 0.25 and the inner small hours lose their\n * inner half to it.\n */\nexport const DIAL_DEAD_ZONE = 0.2\n\n/**\n * Which hour a mark stands for on the two-ring dial: outer carries 12 then 1-11, inner\n * carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.\n */\nexport function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number {\n if (ring === 'outer') return index === 0 ? 12 : index\n return index === 0 ? 0 : index + 12\n}\n\n/** The way back, which is what tells the hand where to point. */\nexport function hour24ToDial(hour: number): { index: number; ring: 'outer' | 'inner' } {\n if (hour === 0) return { index: 0, ring: 'inner' }\n if (hour === 12) return { index: 0, ring: 'outer' }\n if (hour > 12) return { index: hour - 12, ring: 'inner' }\n return { index: hour, ring: 'outer' }\n}\n\nexport interface TimeOption {\n /** The canonical time, which is what the component's value will be set to. */\n value: string\n /** The same time written out for the reader: \"07:30\", or \"7:30 AM\". */\n label: string\n}\n\n/**\n * Every time of the day at a given interval, midnight to the last one before the next.\n *\n * It knows nothing of the restrictions: VTimeInput filters the rows it offers, so the list\n * itself stays one table per step and locale.\n *\n * A nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the\n * list stays FINITE even when the component's warning about it was ignored.\n */\nexport function timeList(step: number, locale: string, format: HourFormat): TimeOption[] {\n const safe = Number.isInteger(step) && step >= 1 && step <= 60 ? step : 60\n const out: TimeOption[] = []\n for (let m = 0; m < 24 * 60; m += safe) {\n const value = formatTime(Math.floor(m / 60), m % 60)\n out.push({ value, label: formatTimeDisplay(value, locale, format) })\n }\n return out\n}\n\n/*\n * Unlike a date's separator this one is UNIVERSAL: every language writes a time with a\n * colon, and only the 12/24-hour cycle varies. It therefore stays out of the dictionary,\n * where the empty field's `hh:mm` placeholder does belong — that one is made of the\n * initials of words.\n */\nconst TIME_SEPARATOR = ':'\n\n/**\n * Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is\n * complete: typing \"09\" already gives \"09:\", exactly as a date's separators do.\n */\nexport function formatTimeMask(digits: string): string {\n const all = digitsOf(digits).slice(0, 4)\n return all.length >= 2 ? `${all.slice(0, 2)}${TIME_SEPARATOR}${all.slice(2)}` : all\n}\n\n/**\n * Where the caret belongs to sit just after `n` digits. A closed formula rather than\n * `date.ts`'s scan, the colon always being in the same place.\n *\n * `skipSeparator` means something was INSERTED, and the caret then steps over the colon\n * into the minutes. On a DELETION it stays in front of it, or the next Backspace steps\n * over the colon instead of erasing a digit and the key appears to do nothing.\n */\nexport function timeCaret(n: number, skipSeparator = false): number {\n if (n < 2) return n\n if (n === 2) return skipSeparator ? 3 : 2\n return Math.min(n + 1, 5)\n}\n\n/**\n * A canonical time written into the field in whichever form is SHOWN. On a 12-hour clock the\n * hour comes back into 1-12: the meridiem belongs to the toggle beside the field, never to\n * the text.\n */\nexport function timeToMask(time: string | null | undefined, format: HourFormat): string {\n const parts = parseTime(time)\n if (!parts) return ''\n const hour = format === '12h' ? to12h(parts.hour).hour : parts.hour\n return formatTimeMask(pad2(hour) + pad2(parts.minute))\n}\n\n/**\n * What was typed read back into a canonical time, or `null` when it is incomplete, too long\n * or not a real time. On a 12-hour clock this is the ONE place the typed digits and the\n * meridiem toggle meet.\n */\nexport function parseTimeMask(\n text: string,\n format: HourFormat,\n meridiem: Meridiem = 'AM',\n): string | null {\n const digits = digitsOf(text)\n if (digits.length !== 4) return null\n const hour = Number(digits.slice(0, 2))\n const minute = Number(digits.slice(2))\n if (minute > 59) return null\n if (format === '12h')\n return hour >= 1 && hour <= 12 ? formatTime(to24h(hour, meridiem), minute) : null\n return hour <= 23 ? formatTime(hour, minute) : null\n}\n"],"mappings":";;;AAoBA,SAAgB,EAAM,GAAsD;CAC1E,IAAM,IAAqB,KAAU,KAAK,OAAO;CAEjD,OAAO;EAAE,MADI,IAAS,MAAO,IAAI,KAAK,IAAS;EAChC;CAAS;AAC1B;AAMA,SAAgB,EAAM,GAAgB,GAA4B;CAChE,IAAM,IAAO,IAAS;CACtB,OAAO,MAAa,OAAO,IAAO,KAAK;AACzC;AAMA,SAAgB,EAAiB,GAAgB,GAA4B;CAC3E,OAAO,EAAM,EAAM,CAAM,CAAC,CAAC,MAAM,CAAQ;AAC3C;AAMA,SAAgB,EAAa,GAA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AAK;GAAE;GAAO,OAAO,EAAkB,GAAO,GAAQ,CAAM;EAAE,CAAC;CACrE;CACA,OAAO;AACT;AAQA,IAAM,IAAiB;AAMvB,SAAgB,EAAe,GAAwB;CACrD,IAAM,IAAM,EAAS,CAAM,CAAC,CAAC,MAAM,GAAG,CAAC;CACvC,OAAO,EAAI,UAAU,IAAI,GAAG,EAAI,MAAM,GAAG,CAAC,IAAI,IAAiB,EAAI,MAAM,CAAC,MAAM;AAClF;AAUA,SAAgB,EAAU,GAAW,IAAgB,IAAe;CAGlE,OAFI,IAAI,IAAU,IACd,MAAM,IAAU,IAAgB,IAAI,IACjC,KAAK,IAAI,IAAI,GAAG,CAAC;AAC1B;AAOA,SAAgB,EAAW,GAAiC,GAA4B;CACtF,IAAM,IAAQ,EAAU,CAAI;CAG5B,OAFK,IAEE,EAAe,EADT,MAAW,QAAQ,EAAM,EAAM,IAAI,CAAC,CAAC,OAAO,EAAM,IAChC,IAAI,EAAK,EAAM,MAAM,CAAC,IAFlC;AAGrB;AAOA,SAAgB,EACd,GACA,GACA,IAAqB,MACN;CACf,IAAM,IAAS,EAAS,CAAI;CAC5B,IAAI,EAAO,WAAW,GAAG,OAAO;CAChC,IAAM,IAAO,OAAO,EAAO,MAAM,GAAG,CAAC,CAAC,GAChC,IAAS,OAAO,EAAO,MAAM,CAAC,CAAC;CAIrC,OAHI,IAAS,KAAW,OACpB,MAAW,QACN,KAAQ,KAAK,KAAQ,KAAK,EAAW,EAAM,GAAM,CAAQ,GAAG,CAAM,IAAI,OACxE,KAAQ,KAAK,EAAW,GAAM,CAAM,IAAI;AACjD"}
1
+ {"version":3,"file":"clock.js","names":[],"sources":["../../src/utils/clock.ts"],"sourcesContent":["// @ssr @core\n/**\n * Clock- and input-specific time arithmetic stays outside the smaller time module imported by\n * calendar views.\n */\nimport { digitsOf, pad2 } from './text'\nimport { formatTime, parseTime, formatTimeDisplay } from './time'\nimport type { HourFormat, Meridiem } from './time'\n\n/**\n * Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together\n * with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven\n * at night is 11 PM.\n */\nexport function to12h(hour24: number): { hour: number; meridiem: Meridiem } {\n const meridiem: Meridiem = hour24 >= 12 ? 'PM' : 'AM'\n const hour = hour24 % 12 === 0 ? 12 : hour24 % 12\n return { hour, meridiem }\n}\n\n/**\n * The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,\n * gives the hour on the 24-hour clock: 12 in the morning is 0, 12 in the afternoon is 12.\n */\nexport function to24h(hour12: number, meridiem: Meridiem): number {\n const base = hour12 % 12 // Twelve is the zero of the cycle, not its top.\n return meridiem === 'PM' ? base + 12 : base\n}\n\n/**\n * The same hour moved into the other half of the day, or left where it is: 9 with PM gives\n * 21, and 21 with PM stays 21. It is what an AM/PM control does to the hour it qualifies.\n */\nexport function hourWithMeridiem(hour24: number, meridiem: Meridiem): number {\n return to24h(to12h(hour24).hour, meridiem)\n}\n\n/**\n * A canonical time moved into a half of the day, its minutes untouched, or `null` when it is\n * not a time at all: `'09:30'` with PM gives `'21:30'`.\n */\nexport function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null {\n const parts = parseTime(time)\n return parts ? formatTime(hourWithMeridiem(parts.hour, meridiem), parts.minute) : null\n}\n\n/** Snaps a minute to the nearest allowed step and wraps it back inside the hour. */\nexport function snapMinute(minute: number, step: number): number {\n const size = Math.round(step)\n const snapped = size <= 1 ? Math.round(minute) : Math.round(minute / size) * size\n return ((snapped % 60) + 60) % 60\n}\n\n/**\n * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered clockwise\n * from twelve o'clock and the nearest wins.\n */\nexport function angleToIndex(dx: number, dy: number, segments: number): number {\n const angle = Math.atan2(dx, -dy)\n const turn = (angle / (2 * Math.PI) + 1) % 1\n return Math.round(turn * segments) % segments\n}\n\n/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */\nexport function distanceFraction(dx: number, dy: number, radius: number): number {\n return radius > 0 ? Math.hypot(dx, dy) / radius : 0\n}\n\n/**\n * The number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts the rings'\n * centres at 104px and 56px from the middle, whose midpoint is 0.625 of the radius.\n */\nexport const DIAL_INNER_THRESHOLD = 0.625\n\n/**\n * Derived from the same tokens as the threshold above: the inner ring's numerals start 32px\n * from the middle (56px less half a 48px numeral), 0.25 of the radius, so the dead zone stops\n * short of them. Grow it past 0.25 and the inner small hours lose their inner half to it.\n */\nexport const DIAL_DEAD_ZONE = 0.2\n\n/**\n * Which hour a mark stands for on the two-ring dial: outer carries 12 then 1-11, inner\n * carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.\n */\nexport function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number {\n if (ring === 'outer') return index === 0 ? 12 : index\n return index === 0 ? 0 : index + 12\n}\n\n/** The way back, which tells the hand where to point. */\nexport function hour24ToDial(hour: number): { index: number; ring: 'outer' | 'inner' } {\n if (hour === 0) return { index: 0, ring: 'inner' }\n if (hour === 12) return { index: 0, ring: 'outer' }\n if (hour > 12) return { index: hour - 12, ring: 'inner' }\n return { index: hour, ring: 'outer' }\n}\n\nexport interface TimeOption {\n /** The canonical time, which the component's value will be set to. */\n value: string\n /** The same time written out for the reader: \"07:30\", or \"7:30 AM\". */\n label: string\n}\n\n/**\n * Every time of the day at a given interval, midnight to the last one before the next. A\n * nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the list\n * stays FINITE even when the component's warning about it was ignored.\n */\nexport function timeList(step: number, locale: string, format: HourFormat): TimeOption[] {\n const safe = Number.isInteger(step) && step >= 1 && step <= 60 ? step : 60\n const out: TimeOption[] = []\n for (let m = 0; m < 24 * 60; m += safe) {\n const value = formatTime(Math.floor(m / 60), m % 60)\n out.push({ value, label: formatTimeDisplay(value, locale, format) })\n }\n return out\n}\n\n/*\n * Unlike a date's separator this one is UNIVERSAL: every language writes a time with a colon,\n * and only the 12/24-hour cycle varies. It therefore stays out of the dictionary, where the\n * empty field's `hh:mm` placeholder does belong; that one is made of the initials of words.\n */\nconst TIME_SEPARATOR = ':'\n\n/**\n * Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is\n * complete: typing \"09\" already gives \"09:\", exactly as a date's separators do.\n */\nexport function formatTimeMask(digits: string): string {\n const all = digitsOf(digits).slice(0, 4)\n return all.length >= 2 ? `${all.slice(0, 2)}${TIME_SEPARATOR}${all.slice(2)}` : all\n}\n\n/**\n * Where the caret belongs to sit just after `n` digits. On a DELETION it stays in front of it,\n * or the next Backspace steps over the colon instead of erasing a digit and the key appears to\n * do nothing.\n */\nexport function timeCaret(n: number, skipSeparator = false): number {\n if (n < 2) return n\n if (n === 2) return skipSeparator ? 3 : 2\n return Math.min(n + 1, 5)\n}\n\n/**\n * A canonical time written into the field in whichever form is SHOWN. On a 12-hour clock the\n * hour comes back into 1-12: the meridiem belongs to the toggle beside the field, never to\n * the text.\n */\nexport function timeToMask(time: string | null | undefined, format: HourFormat): string {\n const parts = parseTime(time)\n if (!parts) return ''\n const hour = format === '12h' ? to12h(parts.hour).hour : parts.hour\n return formatTimeMask(pad2(hour) + pad2(parts.minute))\n}\n\n/**\n * What was typed read back into a canonical time, or `null` when it is incomplete, too long\n * or not a real time. On a 12-hour clock this is the ONE place the typed digits and the\n * meridiem toggle meet.\n */\nexport function parseTimeMask(\n text: string,\n format: HourFormat,\n meridiem: Meridiem = 'AM',\n): string | null {\n const digits = digitsOf(text)\n if (digits.length !== 4) return null\n const hour = Number(digits.slice(0, 2))\n const minute = Number(digits.slice(2))\n if (minute > 59) return null\n if (format === '12h')\n return hour >= 1 && hour <= 12 ? formatTime(to24h(hour, meridiem), minute) : null\n return hour <= 23 ? formatTime(hour, minute) : null\n}\n"],"mappings":";;;AAcA,SAAgB,EAAM,GAAsD;CAC1E,IAAM,IAAqB,KAAU,KAAK,OAAO;CAEjD,OAAO;EAAE,MADI,IAAS,MAAO,IAAI,KAAK,IAAS;EAChC;CAAS;AAC1B;AAMA,SAAgB,EA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
- * A dimension always in pixels: `12` and `'12'` both give `12px`.
3
- *
4
- * Anything non-numeric, or negative, yields `undefined` rather than a custom property CSS cannot read:
5
- * an invalid value breaks the geometry outright, where nothing at all lets the component's
6
- * own default apply.
7
- *
8
- * TRAP: `Number`, never `parseFloat`: the latter reads a numeric PREFIX, so `'12rem'`
9
- * would come out as `12px`, a wrong size with nothing to say so. `Number('')` being 0, a
10
- * blank string is refused before it gets there.
2
+ * Accept complete numeric strings; parseFloat would silently reinterpret 12rem as 12px. Reject
3
+ * blanks before Number converts them to zero.
11
4
  */
12
5
  export declare function px(v: number | string | undefined): string | undefined;
13
6
  /**
14
- * A dimension in any unit: a bare number is read as pixels, a string passes through
15
- * untouched: `50%`, `20vw`, `max-content`.
16
- *
17
- * Unlike `px` above, the string is deliberately not examined: CSS judges it, and one it
18
- * cannot parse falls back to whatever the component declares for itself. A NUMBER is judged
19
- * here, as `px` judges one: a width computed as `NaN` or below zero, and an empty string,
20
- * give nothing rather than a declaration CSS drops, so the component's own default applies.
7
+ * A dimension in any unit: a bare number is read as pixels, a string passes through untouched:
8
+ * `50%`, `20vw`, `max-content`. Unlike `px` above, the string is deliberately not examined: CSS
9
+ * judges it, and one it cannot parse falls back to whatever the component declares for itself.
21
10
  */
22
11
  export declare function cssSize(v: number | string | undefined): string | undefined;
23
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","names":[],"sources":["../../src/utils/css.ts"],"sourcesContent":["// @core\n/**\n * A dimension always in pixels: `12` and `'12'` both give `12px`.\n *\n * Anything non-numeric, or negative, yields `undefined` rather than a custom property CSS cannot read:\n * an invalid value breaks the geometry outright, where nothing at all lets the component's\n * own default apply.\n *\n * TRAP: `Number`, never `parseFloat`: the latter reads a numeric PREFIX, so `'12rem'`\n * would come out as `12px`, a wrong size with nothing to say so. `Number('')` being 0, a\n * blank string is refused before it gets there.\n */\nexport function px(v: number | string | undefined): string | undefined {\n if (v === undefined) return undefined\n const n = typeof v === 'number' ? v : v.trim() === '' ? Number.NaN : Number(v)\n return Number.isFinite(n) && n >= 0 ? `${n}px` : undefined\n}\n\n// @core\n/**\n * A dimension in any unit: a bare number is read as pixels, a string passes through\n * untouched: `50%`, `20vw`, `max-content`.\n *\n * Unlike `px` above, the string is deliberately not examined: CSS judges it, and one it\n * cannot parse falls back to whatever the component declares for itself. A NUMBER is judged\n * here, as `px` judges one: a width computed as `NaN` or below zero, and an empty string,\n * give nothing rather than a declaration CSS drops, so the component's own default applies.\n */\nexport function cssSize(v: number | string | undefined): string | undefined {\n if (v === undefined || v === '') return undefined\n if (typeof v === 'string') return v\n return Number.isFinite(v) && v >= 0 ? `${v}px` : undefined\n}\n\n// @core\n/**\n * The inline style carrying a consumer's own colour to a component's sheet, which derives\n * every shade from `--custom-color`: VChip, VAvatar and VBadge.\n *\n * `undefined` when no colour was given, so a style array holding it binds nothing and the\n * tone the sheet already paints stays in force.\n */\nexport function customColorStyle(\n color: string | undefined,\n): { '--custom-color': string } | undefined {\n return color === undefined ? undefined : { '--custom-color': color }\n}\n"],"mappings":";AAYA,SAAgB,EAAG,GAAoD;CACrE,IAAI,MAAM,KAAA,GAAW;CACrB,IAAM,IAAI,OAAO,KAAM,WAAW,IAAI,EAAE,KAAK,MAAM,KAAK,MAAa,OAAO,CAAC;CAC7E,OAAO,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAYA,SAAgB,EAAQ,GAAoD;CACtE,YAAM,KAAA,KAAa,MAAM,KAE7B,OADI,OAAO,KAAM,WAAiB,IAC3B,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAUA,SAAgB,EACd,GAC0C;CAC1C,OAAO,MAAU,KAAA,IAAY,KAAA,IAAY,EAAE,kBAAkB,EAAM;AACrE"}
1
+ {"version":3,"file":"css.js","names":[],"sources":["../../src/utils/css.ts"],"sourcesContent":["// @core\n/**\n * Accept complete numeric strings; parseFloat would silently reinterpret 12rem as 12px. Reject\n * blanks before Number converts them to zero.\n */\nexport function px(v: number | string | undefined): string | undefined {\n if (v === undefined) return undefined\n const n = typeof v === 'number' ? v : v.trim() === '' ? Number.NaN : Number(v)\n return Number.isFinite(n) && n >= 0 ? `${n}px` : undefined\n}\n\n// @core\n/**\n * A dimension in any unit: a bare number is read as pixels, a string passes through untouched:\n * `50%`, `20vw`, `max-content`. Unlike `px` above, the string is deliberately not examined: CSS\n * judges it, and one it cannot parse falls back to whatever the component declares for itself.\n */\nexport function cssSize(v: number | string | undefined): string | undefined {\n if (v === undefined || v === '') return undefined\n if (typeof v === 'string') return v\n return Number.isFinite(v) && v >= 0 ? `${v}px` : undefined\n}\n\n// @core\n/**\n * The inline style carrying a consumer's own colour to a component's sheet, which derives\n * every shade from `--custom-color`: VChip, VAvatar and VBadge.\n *\n * `undefined` when no colour was given, so a style array holding it binds nothing and the\n * tone the sheet already paints stays in force.\n */\nexport function customColorStyle(\n color: string | undefined,\n): { '--custom-color': string } | undefined {\n return color === undefined ? undefined : { '--custom-color': color }\n}\n"],"mappings":";AAKA,SAAgB,EAAG,GAAoD;CACrE,IAAI,MAAM,KAAA,GAAW;CACrB,IAAM,IAAI,OAAO,KAAM,WAAW,IAAI,EAAE,KAAK,MAAM,KAAK,MAAa,OAAO,CAAC;CAC7E,OAAO,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAQA,SAAgB,EAAQ,GAAoD;CACtE,YAAM,KAAA,KAAa,MAAM,KAE7B,OADI,OAAO,KAAM,WAAiB,IAC3B,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAUA,SAAgB,EACd,GAC0C;CAC1C,OAAO,MAAU,KAAA,IAAY,KAAA,IAAY,EAAE,kBAAkB,EAAM;AACrE"}
@@ -1,29 +1,9 @@
1
- /**
2
- * The date arithmetic behind VDatePicker and VDateInput, as pure functions. One currency
3
- * throughout: the ISO `YYYY-MM-DD` string, computed in LOCAL time.
4
- *
5
- * Two shortcuts are banned as a result. `new Date('YYYY-MM-DD')` parses as UTC and lands a
6
- * day out depending on the zone, and `toISOString()` formats in UTC for the same reason.
7
- * `Date` exists here only as an intermediate, built with `localDate(y, m, d)` — local
8
- * midnight — and turned back into text by concatenation.
9
- *
10
- * Month and day names come from `Intl` on REFERENCE dates pinned to `timeZone: 'UTC'`, so a
11
- * label never depends on the rendering machine's zone and the server agrees with the browser.
12
- */
13
- /**
14
- * Tells whether a value is a real `YYYY-MM-DD` date. The shape alone is not enough:
15
- * `2026-02-31` matches the pattern, so the check goes through a parse and a
16
- * reformat, and only a value that survives the round trip unchanged is accepted.
17
- */
1
+ /** Pure date arithmetic shared by date inputs, pickers and calendars. */
2
+ /** Tells whether a value is a real `YYYY-MM-DD` date. */
18
3
  export declare function isValidISO(iso: unknown): iso is string;
19
4
  /**
20
- * Turns an ISO string into a `Date` set at local midnight, or returns `null` when
21
- * the string is not one. Every caller here has to handle that `null`: the bounds a
22
- * consumer passes are raw strings and may be anything.
23
- *
24
- * TRAP: the shape is not enough. The `Date` constructor rolls an impossible day over
25
- * rather than refusing it (`2026-02-31` is March 3rd), so the date is written back and
26
- * compared: a day the month does not have reads as no date at all.
5
+ * Parse ISO dates at local midnight, returning null for invalid input. Round-trip the result to
6
+ * reject impossible days that Date silently rolls into the next month.
27
7
  */
28
8
  export declare function parseISO(iso: string | null | undefined): Date | null;
29
9
  /**
@@ -41,24 +21,14 @@ export declare function isoOf(year: number, month0: number, day: number): string
41
21
  * month or year is handled by `Date` itself.
42
22
  */
43
23
  export declare function addDays(iso: string, n: number): string;
44
- /**
45
- * Moves a date by a number of months, keeping the day of the month where possible.
46
- * When the target month is too short the day is brought back to its last one: 31
47
- * January plus one month gives 28 or 29 February, and never spills over into March
48
- * the way a naive addition would.
49
- */
24
+ /** Moves a date by a number of months, keeping the day of the month where possible. */
50
25
  export declare function addMonths(iso: string, n: number): string;
51
26
  /**
52
- * How many days the given month holds, leap years included. Day 0 of the following
53
- * month is the last day of this one, which is what makes the leap year rule the
54
- * language's problem rather than ours.
27
+ * How many days the given month holds, leap years included. Day 0 of the following month is the
28
+ * last day of this one, which makes the leap year rule the language's problem rather than ours.
55
29
  */
56
30
  export declare function daysInMonth(year: number, month0: number): number;
57
- /**
58
- * Compares two dates chronologically, returning the usual -1, 0 or 1. Because the
59
- * `YYYY-MM-DD` format puts its most significant part first, comparing the strings as
60
- * text already gives the chronological order: no parsing is needed.
61
- */
31
+ /** Compares two dates chronologically, returning the usual -1, 0 or 1. */
62
32
  export declare function compareISO(a: string, b: string): number;
63
33
  /**
64
34
  * Whether two dates are the same day, with a null on either side counting as no
@@ -72,11 +42,7 @@ export declare const isSameISO: (a: string | null, b: string | null) => boolean;
72
42
  export declare function clampISO(iso: string, min?: string, max?: string): string;
73
43
  /** Whether a date falls inside the allowed interval, each bound being optional. */
74
44
  export declare function isWithin(iso: string, min?: string, max?: string): boolean;
75
- /**
76
- * Whether a date may be chosen: inside the bounds, and not one the matcher excludes. It is
77
- * the ONE rule behind both a struck-through day in VDatePicker and a typed date VDateInput
78
- * refuses, so the two cannot come to disagree about what "unavailable" means.
79
- */
45
+ /** Whether a date may be chosen: inside the bounds, and not one the matcher excludes. */
80
46
  export declare function isDateAllowed(iso: string, min: string | undefined, max: string | undefined, excluded: (iso: string) => boolean): boolean;
81
47
  /** One square of a month grid. */
82
48
  export interface MonthCell {
@@ -91,21 +57,16 @@ export interface MonthCell {
91
57
  adjacent: 'prev' | 'next' | null;
92
58
  }
93
59
  /**
94
- * Builds the grid of a month: 42 cells, six rows of seven, filled out at both ends
95
- * with the days of the neighbouring months. The count is fixed on purpose, so that
96
- * the calendar keeps the same height from one month to the next instead of jumping
97
- * by a row. `firstDayOfWeek` runs from 0 for Sunday to 6 for Saturday.
60
+ * Builds the grid of a month: 42 cells, six rows of seven, filled out at both ends with the
61
+ * days of the neighbouring months. The count is fixed on purpose, so that the calendar keeps
62
+ * the same height from one month to the next instead of jumping by a row.
98
63
  */
99
64
  export declare function buildMonthGrid(year: number, month0: number, firstDayOfWeek: number): MonthCell[];
100
65
  /**
101
- * The day the week starts on in a given locale, from 0 for Sunday to 6 for Saturday
102
- *: Sunday in the United States, Monday in most of Europe, Saturday in much of the
103
- * Middle East. It comes from `Intl.Locale`, whose own numbering runs from 1 for
104
- * Monday to 7 for Sunday.
105
- *
106
- * That part of `Intl` is not everywhere (some Node builds lack it), so the answer
107
- * falls back to Monday when it is missing. A component can always override the
108
- * result with its `firstDayOfWeek` prop.
66
+ * The day the week starts on in a given locale, from 0 for Sunday to 6 for Saturday : Sunday in
67
+ * the United States, Monday in most of Europe, Saturday in much of the Middle East. That part
68
+ * of `Intl` is not everywhere (some Node builds lack it), so the answer falls back to Monday
69
+ * when it is missing.
109
70
  */
110
71
  export declare function firstDayOfWeekFor(locale: string): number;
111
72
  /**
@@ -119,9 +80,5 @@ export declare function weekdayNames(locale: string, firstDayOfWeek: number, wee
119
80
  * rather than a broken one.
120
81
  */
121
82
  export declare function formatDateDisplay(iso: string, locale: string, options: Intl.DateTimeFormatOptions): string;
122
- /**
123
- * A period written out for the reader. `Intl`'s own `formatRange` is what factors
124
- * out the parts the two dates share, giving "19–26 June 2026" rather than the two
125
- * full dates side by side. A period of a single day is formatted as that one date.
126
- */
83
+ /** A period written out for the reader. */
127
84
  export declare function formatDisplayRange(start: string, end: string, locale: string, options: Intl.DateTimeFormatOptions): string;
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","names":[],"sources":["../../src/utils/date.ts"],"sourcesContent":["// @ssr @core — module-wide: every export below is @core unless tagged otherwise.\n/**\n * The date arithmetic behind VDatePicker and VDateInput, as pure functions. One currency\n * throughout: the ISO `YYYY-MM-DD` string, computed in LOCAL time.\n *\n * Two shortcuts are banned as a result. `new Date('YYYY-MM-DD')` parses as UTC and lands a\n * day out depending on the zone, and `toISOString()` formats in UTC for the same reason.\n * `Date` exists here only as an intermediate, built with `localDate(y, m, d)` — local\n * midnight — and turned back into text by concatenation.\n *\n * Month and day names come from `Intl` on REFERENCE dates pinned to `timeZone: 'UTC'`, so a\n * label never depends on the rendering machine's zone and the server agrees with the browser.\n */\n\nimport { memo } from './memo'\nimport { pad2 } from './text'\n\n/**\n * A local-midnight `Date`, rolling over at either end the way `new Date(y, m, d)` does.\n *\n * TRAP — not `new Date(y, m, d)` itself, which reads a year from 0 to 99 as 1900 to 1999:\n * `0050-01-01` would come back as 1950, and a `min` in the first century would open the\n * years view nineteen centuries late. `setFullYear` takes the year as it is.\n */\nfunction localDate(year: number, month0: number, day: number): Date {\n const date = new Date(year, month0, day)\n if (year >= 0 && year < 100) date.setFullYear(year, month0, day)\n return date\n}\n\nconst ISO_RE = /^\\d{4}-\\d{2}-\\d{2}$/\n\n/**\n * Tells whether a value is a real `YYYY-MM-DD` date. The shape alone is not enough:\n * `2026-02-31` matches the pattern, so the check goes through a parse and a\n * reformat, and only a value that survives the round trip unchanged is accepted.\n */\nexport function isValidISO(iso: unknown): iso is string {\n return typeof iso === 'string' && parseISO(iso) !== null\n}\n\n/**\n * Turns an ISO string into a `Date` set at local midnight, or returns `null` when\n * the string is not one. Every caller here has to handle that `null`: the bounds a\n * consumer passes are raw strings and may be anything.\n *\n * TRAP: the shape is not enough. The `Date` constructor rolls an impossible day over\n * rather than refusing it (`2026-02-31` is March 3rd), so the date is written back and\n * compared: a day the month does not have reads as no date at all.\n */\nexport function parseISO(iso: string | null | undefined): Date | null {\n if (typeof iso !== 'string' || !ISO_RE.test(iso)) return null\n const parts = iso.split('-')\n const date = localDate(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]))\n return Number.isNaN(date.getTime()) || formatISO(date) !== iso ? null : date\n}\n\n/**\n * Writes a `Date` as an ISO string, reading its LOCAL components. This manual\n * concatenation is what `toISOString()` cannot do, since that one formats in UTC.\n */\nexport function formatISO(date: Date): string {\n // The year is padded to four digits: `999-01-10` would sort after `2026-…` as text.\n const year = String(date.getFullYear()).padStart(4, '0')\n return `${year}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`\n}\n\n/**\n * Builds an ISO string from separate values. The month is 0-indexed, as everywhere\n * in the language: 0 is January.\n */\nexport function isoOf(year: number, month0: number, day: number): string {\n return formatISO(localDate(year, month0, day))\n}\n\n/**\n * Moves a date by a number of days, forwards or backwards. Crossing into another\n * month or year is handled by `Date` itself.\n */\nexport function addDays(iso: string, n: number): string {\n const d = parseISO(iso)\n if (!d) return iso\n d.setDate(d.getDate() + n)\n return formatISO(d)\n}\n\n/**\n * Moves a date by a number of months, keeping the day of the month where possible.\n * When the target month is too short the day is brought back to its last one: 31\n * January plus one month gives 28 or 29 February, and never spills over into March\n * the way a naive addition would.\n */\nexport function addMonths(iso: string, n: number): string {\n const d = parseISO(iso)\n if (!d) return iso\n const day = d.getDate()\n d.setDate(1)\n d.setMonth(d.getMonth() + n)\n d.setDate(Math.min(day, daysInMonth(d.getFullYear(), d.getMonth())))\n return formatISO(d)\n}\n\n/**\n * How many days the given month holds, leap years included. Day 0 of the following\n * month is the last day of this one, which is what makes the leap year rule the\n * language's problem rather than ours.\n */\nexport function daysInMonth(year: number, month0: number): number {\n return localDate(year, month0 + 1, 0).getDate()\n}\n\n/**\n * Compares two dates chronologically, returning the usual -1, 0 or 1. Because the\n * `YYYY-MM-DD` format puts its most significant part first, comparing the strings as\n * text already gives the chronological order: no parsing is needed.\n */\nexport function compareISO(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n/**\n * Whether two dates are the same day, with a null on either side counting as no\n * date at all rather than as a match.\n */\nexport const isSameISO = (a: string | null, b: string | null) => !!a && a === b\n\n/**\n * Brings a date back inside the allowed interval, returning the bound it exceeded.\n * Both bounds are optional, and an absent one means unbounded on that side.\n */\nexport function clampISO(iso: string, min?: string, max?: string): string {\n if (min && compareISO(iso, min) < 0) return min\n if (max && compareISO(iso, max) > 0) return max\n return iso\n}\n\n/** Whether a date falls inside the allowed interval, each bound being optional. */\nexport function isWithin(iso: string, min?: string, max?: string): boolean {\n if (min && compareISO(iso, min) < 0) return false\n if (max && compareISO(iso, max) > 0) return false\n return true\n}\n\n/**\n * Whether a date may be chosen: inside the bounds, and not one the matcher excludes. It is\n * the ONE rule behind both a struck-through day in VDatePicker and a typed date VDateInput\n * refuses, so the two cannot come to disagree about what \"unavailable\" means.\n */\nexport function isDateAllowed(\n iso: string,\n min: string | undefined,\n max: string | undefined,\n excluded: (iso: string) => boolean,\n): boolean {\n return isWithin(iso, min, max) && !excluded(iso)\n}\n\n/** One square of a month grid. */\nexport interface MonthCell {\n /** The day it stands for, as an ISO `YYYY-MM-DD` string. */\n iso: string\n /** The day of the month, carried so a caller does not parse back what was just formatted. */\n day: number\n /**\n * Which side of the displayed month this day belongs to when it is not part of it,\n * and `null` when it is.\n */\n adjacent: 'prev' | 'next' | null\n}\n\n/**\n * Builds the grid of a month: 42 cells, six rows of seven, filled out at both ends\n * with the days of the neighbouring months. The count is fixed on purpose, so that\n * the calendar keeps the same height from one month to the next instead of jumping\n * by a row. `firstDayOfWeek` runs from 0 for Sunday to 6 for Saturday.\n */\nexport function buildMonthGrid(year: number, month0: number, firstDayOfWeek: number): MonthCell[] {\n const first = localDate(year, month0, 1)\n // How many cells the 1st of the month sits after the start of its row, which is\n // exactly how many days of the previous month the grid has to open with.\n const offset = (first.getDay() - firstDayOfWeek + 7) % 7\n const cells: MonthCell[] = []\n for (let i = 0; i < 42; i++) {\n // Built from the 1st rather than stepped from a start date, so the month and year\n // rolling over at either end is `Date`'s arithmetic and not ours.\n const d = localDate(year, month0, 1 - offset + i)\n const adjacent =\n d.getMonth() === month0 && d.getFullYear() === year ? null : d < first ? 'prev' : 'next'\n cells.push({ iso: formatISO(d), day: d.getDate(), adjacent })\n }\n return cells\n}\n\nconst firstDayCache = new Map<string, number>()\n\n// @fallback @ssr\n/**\n * The day the week starts on in a given locale, from 0 for Sunday to 6 for Saturday\n *: Sunday in the United States, Monday in most of Europe, Saturday in much of the\n * Middle East. It comes from `Intl.Locale`, whose own numbering runs from 1 for\n * Monday to 7 for Sunday.\n *\n * That part of `Intl` is not everywhere (some Node builds lack it), so the answer\n * falls back to Monday when it is missing. A component can always override the\n * result with its `firstDayOfWeek` prop.\n */\nexport function firstDayOfWeekFor(locale: string): number {\n return memo(firstDayCache, locale, () => resolveFirstDayOfWeek(locale))\n}\n\nfunction resolveFirstDayOfWeek(locale: string): number {\n try {\n // Implementations disagree on the shape: Chrome and Safari expose `weekInfo` as\n // a getter, others a `getWeekInfo()` method. Both are tried.\n const loc = new Intl.Locale(locale) as Intl.Locale & {\n weekInfo?: { firstDay: number }\n getWeekInfo?: () => { firstDay: number }\n }\n const info = loc.getWeekInfo?.() ?? loc.weekInfo\n if (info?.firstDay) return info.firstDay % 7 // brings Sunday, their 7, back to 0\n } catch {\n /* an invalid locale throws a RangeError: fall through to the fallback */\n }\n return 1 // Monday\n}\n\n// The reference instants the names are formatted from. Any Sunday will do for the\n// weekdays, and any year for the months; combined with `timeZone: 'UTC'` at every\n// call site, they pin the output whatever zone the machine is in.\nconst REF_SUNDAY = Date.UTC(2021, 7, 1) // 1 August 2021 fell on a Sunday\nconst MS_DAY = 86_400_000\n\n/**\n * The names of the seven days, starting from `firstDayOfWeek` so the list can be\n * dropped straight into a calendar header.\n */\nexport function weekdayNames(\n locale: string,\n firstDayOfWeek: number,\n weekday: 'short' | 'long' = 'short',\n): string[] {\n const fmt = new Intl.DateTimeFormat(locale, { weekday, timeZone: 'UTC' })\n return Array.from({ length: 7 }, (_, i) =>\n fmt.format(REF_SUNDAY + ((firstDayOfWeek + i) % 7) * MS_DAY),\n )\n}\n\n/**\n * One formatter kept per locale and set of options, for the lifetime of the module —\n * the same `formatterFor` idiom as in `utils/file.ts` and `utils/time.ts`.\n *\n * Building an `Intl.DateTimeFormat` costs one to two orders of magnitude more than\n * using one, and the two functions below are called ONE VALUE AT A TIME: VDateInput\n * formats a multiple selection inside a `.map`, so a fresh formatter would be built\n * for every date. `weekdayNames` already hoists its own out of its loop; this cache\n * gives the per-call functions the same property.\n *\n * The options object is part of the cache key. `JSON.stringify` is stable enough\n * here — these objects are literals written by the components, not data coming from\n * a user — and costs a fraction of a construction.\n */\nconst formatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction formatterFor(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n return memo(\n formatters,\n `${locale}|${JSON.stringify(options)}`,\n () => new Intl.DateTimeFormat(locale, options),\n )\n}\n\n/**\n * A date written out for the reader, in the conventions of their locale: this is\n * what VDateInput shows in its field. An unparsable date yields an empty string\n * rather than a broken one.\n */\nexport function formatDateDisplay(\n iso: string,\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): string {\n const d = parseISO(iso)\n return d ? formatterFor(locale, options).format(d) : ''\n}\n\n/**\n * A period written out for the reader. `Intl`'s own `formatRange` is what factors\n * out the parts the two dates share, giving \"19–26 June 2026\" rather than the two\n * full dates side by side. A period of a single day is formatted as that one date.\n */\nexport function formatDisplayRange(\n start: string,\n end: string,\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): string {\n const a = parseISO(start)\n const b = parseISO(end)\n if (!a || !b) return ''\n const fmt = formatterFor(locale, options)\n const order = compareISO(start, end)\n if (order === 0) return fmt.format(a)\n // A range handed over the wrong way round is written in order rather than as \"26 – 19\".\n return order < 0 ? fmt.formatRange(a, b) : fmt.formatRange(b, a)\n}\n"],"mappings":";;;AAwBA,SAAS,EAAU,GAAc,GAAgB,GAAmB;CAClE,IAAM,IAAO,IAAI,KAAK,GAAM,GAAQ,CAAG;CAEvC,OADI,KAAQ,KAAK,IAAO,OAAK,EAAK,YAAY,GAAM,GAAQ,CAAG,GACxD;AACT;AAEA,IAAM,IAAS;AAOf,SAAgB,EAAW,GAA6B;CACtD,OAAO,OAAO,KAAQ,YAAY,EAAS,CAAG,MAAM;AACtD;AAWA,SAAgB,EAAS,GAA6C;CACpE,IAAI,OAAO,KAAQ,YAAY,CAAC,EAAO,KAAK,CAAG,GAAG,OAAO;CACzD,IAA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AAQ;EAAE;EAAS,UAAU;CAAM,CAAC;CACxE,OAAO,MAAM,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAG,MACnC,EAAI,OAAO,KAAe,IAAiB,KAAK,IAAK,CAAM,CAC7D;AACF;AAgBA,IAAM,oBAAa,IAAI,IAAiC;AAExD,SAAS,EAAa,GAAgB,GAA0D;CAC9F,OAAO,EACL,GACA,GAAG,EAAO,GAAG,KAAK,UAAU,CAAO,WAC7B,IAAI,KAAK,eAAe,GAAQ,CAAO,CAC/C;AACF;AAOA,SAAgB,EACd,GACA,GACA,GACQ;CACR,IAAM,IAAI,EAAS,CAAG;CACtB,OAAO,IAAI,EAAa,GAAQ,CAAO,CAAC,CAAC,OAAO,CAAC,IAAI;AACvD;AAOA,SAAgB,EACd,GACA,GACA,GACA,GACQ;CACR,IAAM,IAAI,EAAS,CAAK,GAClB,IAAI,EAAS,CAAG;CACtB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,IAAM,IAAM,EAAa,GAAQ,CAAO,GAClC,IAAQ,EAAW,GAAO,CAAG;CAGnC,OAFI,MAAU,IAAU,EAAI,OAAO,CAAC,IAE7B,IAAQ,IAAI,EAAI,YAAY,GAAG,CAAC,IAAI,EAAI,YAAY,GAAG,CAAC;AACjE"}
1
+ {"version":3,"file":"date.js","names":[],"sources":["../../src/utils/date.ts"],"sourcesContent":["// @ssr @core\n/** Pure date arithmetic shared by date inputs, pickers and calendars. */\n\nimport { memo } from './memo'\nimport { pad2 } from './text'\n\n/**\n * Not `new Date(y, m, d)` itself, which reads a year from 0 to 99 as 1900 to 1999: `0050-01-01`\n * would come back as 1950, and a `min` in the first century would open the years view nineteen\n * centuries late. `setFullYear` takes the year as it is.\n */\nfunction localDate(year: number, month0: number, day: number): Date {\n const date = new Date(year, month0, day)\n if (year >= 0 && year < 100) date.setFullYear(year, month0, day)\n return date\n}\n\nconst ISO_RE = /^\\d{4}-\\d{2}-\\d{2}$/\n\n/** Tells whether a value is a real `YYYY-MM-DD` date. */\nexport function isValidISO(iso: unknown): iso is string {\n return typeof iso === 'string' && parseISO(iso) !== null\n}\n\n/**\n * Parse ISO dates at local midnight, returning null for invalid input. Round-trip the result to\n * reject impossible days that Date silently rolls into the next month.\n */\nexport function parseISO(iso: string | null | undefined): Date | null {\n if (typeof iso !== 'string' || !ISO_RE.test(iso)) return null\n const parts = iso.split('-')\n const date = localDate(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]))\n return Number.isNaN(date.getTime()) || formatISO(date) !== iso ? null : date\n}\n\n/**\n * Writes a `Date` as an ISO string, reading its LOCAL components. This manual\n * concatenation is what `toISOString()` cannot do, since that one formats in UTC.\n */\nexport function formatISO(date: Date): string {\n const year = String(date.getFullYear()).padStart(4, '0')\n return `${year}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`\n}\n\n/**\n * Builds an ISO string from separate values. The month is 0-indexed, as everywhere\n * in the language: 0 is January.\n */\nexport function isoOf(year: number, month0: number, day: number): string {\n return formatISO(localDate(year, month0, day))\n}\n\n/**\n * Moves a date by a number of days, forwards or backwards. Crossing into another\n * month or year is handled by `Date` itself.\n */\nexport function addDays(iso: string, n: number): string {\n const d = parseISO(iso)\n if (!d) return iso\n d.setDate(d.getDate() + n)\n return formatISO(d)\n}\n\n/** Moves a date by a number of months, keeping the day of the month where possible. */\nexport function addMonths(iso: string, n: number): string {\n const d = parseISO(iso)\n if (!d) return iso\n const day = d.getDate()\n d.setDate(1)\n d.setMonth(d.getMonth() + n)\n d.setDate(Math.min(day, daysInMonth(d.getFullYear(), d.getMonth())))\n return formatISO(d)\n}\n\n/**\n * How many days the given month holds, leap years included. Day 0 of the following month is the\n * last day of this one, which makes the leap year rule the language's problem rather than ours.\n */\nexport function daysInMonth(year: number, month0: number): number {\n return localDate(year, month0 + 1, 0).getDate()\n}\n\n/** Compares two dates chronologically, returning the usual -1, 0 or 1. */\nexport function compareISO(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n/**\n * Whether two dates are the same day, with a null on either side counting as no\n * date at all rather than as a match.\n */\nexport const isSameISO = (a: string | null, b: string | null) => !!a && a === b\n\n/**\n * Brings a date back inside the allowed interval, returning the bound it exceeded.\n * Both bounds are optional, and an absent one means unbounded on that side.\n */\nexport function clampISO(iso: string, min?: string, max?: string): string {\n if (min && compareISO(iso, min) < 0) return min\n if (max && compareISO(iso, max) > 0) return max\n return iso\n}\n\n/** Whether a date falls inside the allowed interval, each bound being optional. */\nexport function isWithin(iso: string, min?: string, max?: string): boolean {\n if (min && compareISO(iso, min) < 0) return false\n if (max && compareISO(iso, max) > 0) return false\n return true\n}\n\n/** Whether a date may be chosen: inside the bounds, and not one the matcher excludes. */\nexport function isDateAllowed(\n iso: string,\n min: string | undefined,\n max: string | undefined,\n excluded: (iso: string) => boolean,\n): boolean {\n return isWithin(iso, min, max) && !excluded(iso)\n}\n\n/** One square of a month grid. */\nexport interface MonthCell {\n /** The day it stands for, as an ISO `YYYY-MM-DD` string. */\n iso: string\n /** The day of the month, carried so a caller does not parse back what was just formatted. */\n day: number\n /**\n * Which side of the displayed month this day belongs to when it is not part of it,\n * and `null` when it is.\n */\n adjacent: 'prev' | 'next' | null\n}\n\n/**\n * Builds the grid of a month: 42 cells, six rows of seven, filled out at both ends with the\n * days of the neighbouring months. The count is fixed on purpose, so that the calendar keeps\n * the same height from one month to the next instead of jumping by a row.\n */\nexport function buildMonthGrid(year: number, month0: number, firstDayOfWeek: number): MonthCell[] {\n const first = localDate(year, month0, 1)\n // How many cells the 1st of the month sits after the start of its row, which is\n // exactly how many days of the previous month the grid has to open with.\n const offset = (first.getDay() - firstDayOfWeek + 7) % 7\n const cells: MonthCell[] = []\n for (let i = 0; i < 42; i++) {\n // Built from the 1st rather than stepped from a start date, so the month and year\n // rolling over at either end is `Date`'s arithmetic and not ours.\n const d = localDate(year, month0, 1 - offset + i)\n const adjacent =\n d.getMonth() === month0 && d.getFullYear() === year ? null : d < first ? 'prev' : 'next'\n cells.push({ iso: formatISO(d), day: d.getDate(), adjacent })\n }\n return cells\n}\n\nconst firstDayCache = new Map<string, number>()\n\n// @fallback @ssr\n/**\n * The day the week starts on in a given locale, from 0 for Sunday to 6 for Saturday : Sunday in\n * the United States, Monday in most of Europe, Saturday in much of the Middle East. That part\n * of `Intl` is not everywhere (some Node builds lack it), so the answer falls back to Monday\n * when it is missing.\n */\nexport function firstDayOfWeekFor(locale: string): number {\n return memo(firstDayCache, locale, () => resolveFirstDayOfWeek(locale))\n}\n\nfunction resolveFirstDayOfWeek(locale: string): number {\n try {\n // Implementations disagree on the shape: Chrome and Safari expose `weekInfo` as\n // a getter, others a `getWeekInfo()` method. Both are tried.\n const loc = new Intl.Locale(locale) as Intl.Locale & {\n weekInfo?: { firstDay: number }\n getWeekInfo?: () => { firstDay: number }\n }\n const info = loc.getWeekInfo?.() ?? loc.weekInfo\n if (info?.firstDay) return info.firstDay % 7\n } catch {\n /* An invalid locale throws a RangeError: fall through to the fallback */\n }\n return 1\n}\n\n// The reference instants the names are formatted from. Any Sunday will do for the\n// weekdays, and any year for the months; combined with `timeZone: 'UTC'` at every\n// call site, they pin the output whatever zone the machine is in.\nconst REF_SUNDAY = Date.UTC(2021, 7, 1)\nconst MS_DAY = 86_400_000\n\n/**\n * The names of the seven days, starting from `firstDayOfWeek` so the list can be\n * dropped straight into a calendar header.\n */\nexport function weekdayNames(\n locale: string,\n firstDayOfWeek: number,\n weekday: 'short' | 'long' = 'short',\n): string[] {\n const fmt = new Intl.DateTimeFormat(locale, { weekday, timeZone: 'UTC' })\n return Array.from({ length: 7 }, (_, i) =>\n fmt.format(REF_SUNDAY + ((firstDayOfWeek + i) % 7) * MS_DAY),\n )\n}\n\n/**\n * One formatter kept per locale and set of options, for the lifetime of the module; the same\n * `formatterFor` idiom as in `utils/file.ts` and `utils/time.ts`.\n */\nconst formatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction formatterFor(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n return memo(\n formatters,\n `${locale}|${JSON.stringify(options)}`,\n () => new Intl.DateTimeFormat(locale, options),\n )\n}\n\n/**\n * A date written out for the reader, in the conventions of their locale: this is\n * what VDateInput shows in its field. An unparsable date yields an empty string\n * rather than a broken one.\n */\nexport function formatDateDisplay(\n iso: string,\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): string {\n const d = parseISO(iso)\n return d ? formatterFor(locale, options).format(d) : ''\n}\n\n/** A period written out for the reader. */\nexport function formatDisplayRange(\n start: string,\n end: string,\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): string {\n const a = parseISO(start)\n const b = parseISO(end)\n if (!a || !b) return ''\n const fmt = formatterFor(locale, options)\n const order = compareISO(start, end)\n if (order === 0) return fmt.format(a)\n return order < 0 ? fmt.formatRange(a, b) : fmt.formatRange(b, a)\n}\n"],"mappings":";;;AAWA,SAAS,EAAU,GAAc,GAAgB,GAAmB;CAClE,IAAM,IAAO,IAAI,KAAK,GAAM,GAAQ,CAAG;CAEvC,OADI,KAAQ,KAAK,IAAO,OAAK,EAAK,YAAY,GAAM,GAAQ,CAAG,GACxD;AACT;AAEA,IAAM,IAAS;AAGf,SAAgB,EAAW,GAA6B;CACtD,OAAO,OAAO,KAAQ,YAAY,EAAS,CAAG,MAAM;AACtD;AAMA,SAAgB,EAAS,GAA6C;CACpE,IAAI,OAAO,KAAQ,YAAY,CAAC,EAAO,KAAK,CAAG,GAAG,OAAO;CACzD,IAAM,IAAQ,EAAI,MAAM,GAAG,GACrB,IAAO,EAAU,OAAO,EAAM,EAAE,GAAG,OAAO,EAAM,EAAE,IAAI,GAAG,OAAO,EAAM,EAAE,CAAC;CAC/E,OAAO,OAAO,MAAM,EAAK,QAAQ,CAAC,KAAK,EAAU,CAAI,MAAM,IAAM,OAAO;AAC1E;AAMA,SAAgB,EAAU,GAAoB;CAE5C,OAAO,GADM,OAAO,EAAK,YAAY,CAAC,CAAC,CAAC,SAAS,GAAG,GAC1C,EAAK,GAAG,EAAK,EAAK,SAAS,I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d,GACA,GACA,GACQ;CACR,IAAM,IAAI,EAAS,CAAG;CACtB,OAAO,IAAI,EAAa,GAAQ,CAAO,CAAC,CAAC,OAAO,CAAC,IAAI;AACvD;AAGA,SAAgB,EACd,GACA,GACA,GACA,GACQ;CACR,IAAM,IAAI,EAAS,CAAK,GAClB,IAAI,EAAS,CAAG;CACtB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,IAAM,IAAM,EAAa,GAAQ,CAAO,GAClC,IAAQ,EAAW,GAAO,CAAG;CAEnC,OADI,MAAU,IAAU,EAAI,OAAO,CAAC,IAC7B,IAAQ,IAAI,EAAI,YAAY,GAAG,CAAC,IAAI,EAAI,YAAY,GAAG,CAAC;AACjE"}
@@ -1,12 +1,5 @@
1
1
  /**
2
- * Whether an element is laid out right to left.
3
- *
4
- * Logical properties mirror themselves, so this exists only for what cannot: key names
5
- * (`ArrowRight`), pointer coordinates and scroll deltas are physical, and the code reading
6
- * them has to know which way the inline axis runs before "forward" means anything.
7
- *
8
- * The COMPUTED direction, not the `dir` attribute, which may sit on any ancestor or come
9
- * from a stylesheet. That read forces a style recalculation. Ask at event time, never in a
10
- * render or a loop. A null element answers `false`, the assumption the rest of the code makes.
2
+ * Read computed direction for physical keys and coordinates; dir may be inherited or supplied
3
+ * through CSS.
11
4
  */
12
5
  export declare function isRtl(el: Element | null | undefined): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"direction.js","names":[],"sources":["../../src/utils/direction.ts"],"sourcesContent":["// @core\n/**\n * Whether an element is laid out right to left.\n *\n * Logical properties mirror themselves, so this exists only for what cannot: key names\n * (`ArrowRight`), pointer coordinates and scroll deltas are physical, and the code reading\n * them has to know which way the inline axis runs before \"forward\" means anything.\n *\n * The COMPUTED direction, not the `dir` attribute, which may sit on any ancestor or come\n * from a stylesheet. That read forces a style recalculation. Ask at event time, never in a\n * render or a loop. A null element answers `false`, the assumption the rest of the code makes.\n */\nexport function isRtl(el: Element | null | undefined): boolean {\n return el != null && getComputedStyle(el).direction === 'rtl'\n}\n"],"mappings":";AAYA,SAAgB,EAAM,GAAyC;CAC7D,OAAO,KAAM,QAAQ,iBAAiB,CAAE,CAAC,CAAC,cAAc;AAC1D"}
1
+ {"version":3,"file":"direction.js","names":[],"sources":["../../src/utils/direction.ts"],"sourcesContent":["// @core\n/**\n * Read computed direction for physical keys and coordinates; dir may be inherited or supplied\n * through CSS.\n */\nexport function isRtl(el: Element | null | undefined): boolean {\n return el != null && getComputedStyle(el).direction === 'rtl'\n}\n"],"mappings":";AAKA,SAAgB,EAAM,GAAyC;CAC7D,OAAO,KAAM,QAAQ,iBAAiB,CAAE,CAAC,CAAC,cAAc;AAC1D"}
@@ -1,18 +1,5 @@
1
1
  /**
2
- * Whether the library is running in a development build. Every integrator-facing warning
3
- * is gated on it, so none reaches a finished application.
4
- *
5
- * TRAP: it is read from `process.env.NODE_ENV`, which the CONSUMER's bundler replaces, and
6
- * never from `import.meta.env`: Vite folds `import.meta.env.*` to constants when it builds
7
- * a library, so such a flag would be `false` in the published package and the minifier
8
- * would delete every guarded warning with it. `process.env.*` is left alone by a library build,
9
- * exactly so the application can decide. It is the contract Vue's own `esm-bundler` build
10
- * relies on, so any bundler that can serve Vue already defines it; the library cannot run
11
- * without a bundler anyway, each component importing its own stylesheet.
12
- * `scripts/check-dev-warnings.ts` guards it on the artefact.
13
- *
14
- * A production build then strips the warnings only where the bundler carries a constant
15
- * across modules: Rolldown and Rollup (Vite, Nuxt) do, esbuild alone does not, and there
16
- * the strings ship inert, costing bytes but never a message.
2
+ * Use process.env.NODE_ENV so the consumer chooses development warnings; import.meta.env would
3
+ * be folded during library build and erase them.
17
4
  */
18
5
  export declare const isDev: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","names":[],"sources":["../../src/utils/env.ts"],"sourcesContent":["/*\n * Typed here rather than through `@types/node`: the library's build compiles with no ambient\n * types, and a `declare global` would leak into the consumer's compilation. Declared in a\n * module, it shadows nothing outside this file.\n */\ndeclare const process: { env: { NODE_ENV?: string } }\n\n// @devwarn\n/**\n * Whether the library is running in a development build. Every integrator-facing warning\n * is gated on it, so none reaches a finished application.\n *\n * TRAP: it is read from `process.env.NODE_ENV`, which the CONSUMER's bundler replaces, and\n * never from `import.meta.env`: Vite folds `import.meta.env.*` to constants when it builds\n * a library, so such a flag would be `false` in the published package and the minifier\n * would delete every guarded warning with it. `process.env.*` is left alone by a library build,\n * exactly so the application can decide. It is the contract Vue's own `esm-bundler` build\n * relies on, so any bundler that can serve Vue already defines it; the library cannot run\n * without a bundler anyway, each component importing its own stylesheet.\n * `scripts/check-dev-warnings.ts` guards it on the artefact.\n *\n * A production build then strips the warnings only where the bundler carries a constant\n * across modules: Rolldown and Rollup (Vite, Nuxt) do, esbuild alone does not, and there\n * the strings ship inert, costing bytes but never a message.\n */\nexport const isDev = process.env.NODE_ENV !== 'production'\n"],"mappings":";AAyBA,IAAa,IAAA,QAAA,IAAA,aAAiC"}
1
+ {"version":3,"file":"env.js","names":[],"sources":["../../src/utils/env.ts"],"sourcesContent":["/*\n * Declare process locally so the consumer's bundler can replace NODE_ENV without leaking Node\n * ambient types into library declarations.\n */\ndeclare const process: { env: { NODE_ENV?: string } }\n\n// @devwarn\n/**\n * Use process.env.NODE_ENV so the consumer chooses development warnings; import.meta.env would\n * be folded during library build and erase them.\n */\nexport const isDev = process.env.NODE_ENV !== 'production'\n"],"mappings":";AAWA,IAAa,IAAA,QAAA,IAAA,aAAiC"}
@@ -9,44 +9,15 @@ export interface FileCandidate {
9
9
  */
10
10
  export declare function parseAccept(accept?: string): string[];
11
11
  /**
12
- * Whether a file matches an `accept` list, written exactly as the HTML attribute is:
13
- * `.pdf` (case-insensitive), `image/*`, or one precise MIME type. An empty list accepts
14
- * everything.
15
- *
16
- * The rule is applied in JS because the ATTRIBUTE only governs the dialog the browser
17
- * opens: a DROPPED file bypasses it entirely. Without this second reading, dropping
18
- * smuggles anything past a restriction the consumer believes is enforced.
19
- *
20
- * The list may be handed over already read by `parseAccept`, which is what a batch does:
21
- * screening a hundred dropped files would otherwise split the same string a hundred times.
22
- *
23
- * TRAP: `file.type` is the browser's GUESS and is often empty (an unknown extension, some
24
- * Linux setups). A list written only in MIME types then turns away a perfectly good file,
25
- * which is why the docs ask for extensions alongside: `image/*,.heic`, not `image/*` alone.
12
+ * `file.type` is the browser's GUESS and is often empty (an unknown extension, some Linux
13
+ * setups). A list written only in MIME types then turns away a perfectly good file, which is
14
+ * why the docs ask for extensions alongside: `image/*,.heic`, not `image/*` alone.
26
15
  */
27
16
  export declare function matchesAccept(file: FileCandidate, accept?: string | readonly string[]): boolean;
28
17
  export declare function fileKey(file: File): number;
29
- /**
30
- * A file size as a reader expects it: 1 200 000 gives "1.2 MB" in English, "1,2 Mo" in
31
- * French. Nothing here is translatable: `Intl` knows the unit names and the decimal mark.
32
- *
33
- * SI base 1000, which is what the unit names `Intl` prints actually mean. The computing
34
- * convention of 1024 would show a 1024-byte file as "1.02 kB", a discrepancy no reader can
35
- * explain to themselves. A negative or non-finite size reads as 0: the number comes straight
36
- * off the file, and a size beside a name must never be the thing that breaks.
37
- */
18
+ /** A file size as a reader expects it: 1 200 000 gives "1.2 MB" in English, "1,2 Mo" in French. */
38
19
  export declare function formatBytes(bytes: number, locale: string): string;
39
- /**
40
- * Why a file was turned away: its kind, its size, how many there already are, or the
41
- * total.
42
- *
43
- * VFileInput and VFilePicker screen a batch through the same `screenFiles` below, so the
44
- * two report the same thing and the type is declared ONCE, here, rather than copied into
45
- * each of them under a name of its own. It is the `TimePickerAllowed` arrangement: the type
46
- * lives beside the rule that produces it, and `index.ts` is what makes it public. The
47
- * MODULE stays internal, and a handler written for one of the two components can be
48
- * handed to the other.
49
- */
20
+ /** Why a file was turned away: its kind, its size, how many there already are, or the total. */
50
21
  export type FileRejectReason = 'type' | 'size' | 'count' | 'total-size';
51
22
  /** One file that was turned away, and the reason it was. */
52
23
  export interface FileRejection {
@@ -64,18 +35,9 @@ export interface FileLimits {
64
35
  maxTotalSize?: number;
65
36
  }
66
37
  /**
67
- * Screens an arriving batch against what is already chosen, returning the accepted files
68
- * and one rejection per refusal.
69
- *
70
- * The order `type → size → count → total-size` is a contract both `.mdx` pages state, and
71
- * it is the order a reader can act on: a file of the wrong KIND is reported as such even
72
- * when it is also too big, since being told to shrink a file that would never be accepted
73
- * is worse than useless.
74
- *
75
- * Duplicates are deliberately NOT a reason: two files in different folders may share a
76
- * name, and there is no reliable way to tell one from another. What is already chosen
77
- * counts towards both the count and the running total, so a second drop obeys the same
78
- * limits as the first instead of starting over.
38
+ * Screens an arriving batch against what is already chosen, returning the accepted files and
39
+ * one rejection per refusal. What is already chosen counts towards both the count and the
40
+ * running total, so a second drop obeys the same limits as the first instead of starting over.
79
41
  */
80
42
  export declare function screenFiles(incoming: readonly File[], current: readonly File[], limits: FileLimits): {
81
43
  accepted: File[];