vectis-ui 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/README.md +3 -3
  2. package/dist/components/VAccordion/VAccordionItem.d.ts +4 -6
  3. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +21 -19
  5. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/VAccordion/context.d.ts +6 -1
  7. package/dist/components/VAccordion/context.js.map +1 -1
  8. package/dist/components/VAvatar/VAvatar.css +1 -1
  9. package/dist/components/VAvatar/VAvatar.d.ts +5 -3
  10. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  11. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +53 -39
  12. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/VAvatar/VAvatarGroup.d.ts +12 -3
  14. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  15. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -20
  16. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/VAvatar/context.d.ts +2 -2
  18. package/dist/components/VAvatar/context.js.map +1 -1
  19. package/dist/components/VBadge/VBadge.css +1 -1
  20. package/dist/components/VBadge/VBadge.d.ts +8 -4
  21. package/dist/components/VBadge/VBadge.js.map +1 -1
  22. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +6 -3
  23. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +5 -4
  25. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  26. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +8 -3
  27. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/VButton/VButton.css +1 -1
  29. package/dist/components/VButton/VButton.d.ts +4 -1
  30. package/dist/components/VButton/VButton.js.map +1 -1
  31. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +8 -7
  32. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  34. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendar.css +1 -1
  36. package/dist/components/VCalendar/VCalendar.d.ts +15 -6
  37. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  38. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +144 -126
  39. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  41. package/dist/components/VCalendar/VCalendarEvent.d.ts +1 -1
  42. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  43. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  44. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  45. package/dist/components/VCalendar/VCalendarMonth.d.ts +1 -1
  46. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  47. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +99 -90
  48. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  50. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
  51. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  52. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +256 -246
  53. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  55. package/dist/components/VCalendar/VCalendarYear.d.ts +8 -1
  56. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  57. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +39 -32
  58. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/VCalendar/color.d.ts +1 -1
  60. package/dist/components/VCalendar/color.js.map +1 -1
  61. package/dist/components/VCalendar/edgeStep.d.ts +3 -3
  62. package/dist/components/VCalendar/edgeStep.js +5 -0
  63. package/dist/components/VCalendar/edgeStep.js.map +1 -1
  64. package/dist/components/VCalendar/gesture.d.ts +10 -9
  65. package/dist/components/VCalendar/gesture.js +60 -45
  66. package/dist/components/VCalendar/gesture.js.map +1 -1
  67. package/dist/components/VCalendar/keyboard.d.ts +22 -5
  68. package/dist/components/VCalendar/keyboard.js +17 -16
  69. package/dist/components/VCalendar/keyboard.js.map +1 -1
  70. package/dist/components/VCalendar/layout.d.ts +47 -37
  71. package/dist/components/VCalendar/layout.js +47 -37
  72. package/dist/components/VCalendar/layout.js.map +1 -1
  73. package/dist/components/VCalendar/timeGrid.d.ts +4 -4
  74. package/dist/components/VCalendar/timeGrid.js +6 -6
  75. package/dist/components/VCalendar/timeGrid.js.map +1 -1
  76. package/dist/components/VCalendar/types.d.ts +5 -5
  77. package/dist/components/VCarousel/VCarousel.css +1 -1
  78. package/dist/components/VCarousel/VCarousel.d.ts +59 -38
  79. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  80. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +161 -132
  81. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/components/VCarousel/VCarouselItem.d.ts +1 -1
  83. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  84. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/components/VCarousel/context.d.ts +1 -1
  86. package/dist/components/VCarousel/context.js.map +1 -1
  87. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  88. package/dist/components/VCheckbox/VCheckbox.d.ts +2 -2
  89. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  90. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +10 -8
  91. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/components/VChip/VChip.css +1 -1
  93. package/dist/components/VChip/VChip.d.ts +7 -2
  94. package/dist/components/VChip/VChip.js.map +1 -1
  95. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +69 -55
  96. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  97. package/dist/components/VCombobox/VCombobox.css +1 -1
  98. package/dist/components/VCombobox/VCombobox.d.ts +50 -36
  99. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  100. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +167 -161
  101. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  103. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  104. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  105. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/components/VCombobox/infiniteScroll.d.ts +12 -3
  107. package/dist/components/VCombobox/infiniteScroll.js +18 -12
  108. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  109. package/dist/components/VDataTable/VDataTable.css +1 -1
  110. package/dist/components/VDataTable/VDataTable.d.ts +55 -24
  111. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  112. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +192 -155
  113. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDateInput/VDateInput.css +1 -1
  115. package/dist/components/VDateInput/VDateInput.d.ts +15 -12
  116. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  117. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +180 -160
  118. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/components/VDateInput/mask.d.ts +95 -0
  120. package/dist/components/VDateInput/mask.js +118 -0
  121. package/dist/components/VDateInput/mask.js.map +1 -0
  122. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  123. package/dist/components/VDatePicker/VDatePicker.d.ts +6 -5
  124. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  125. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +204 -173
  126. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/components/VDatePicker/keyboard.d.ts +3 -3
  128. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  129. package/dist/components/VDatePicker/names.d.ts +34 -0
  130. package/dist/components/VDatePicker/names.js +42 -0
  131. package/dist/components/VDatePicker/names.js.map +1 -0
  132. package/dist/components/VDialog/VDialog.css +1 -1
  133. package/dist/components/VDialog/VDialog.d.ts +2 -2
  134. package/dist/components/VDialog/VDialog.js.map +1 -1
  135. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +63 -41
  136. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/components/VFileInput/VFileInput.d.ts +38 -25
  138. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  139. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +74 -71
  140. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  141. package/dist/components/VFileInput/truncate.d.ts +4 -4
  142. package/dist/components/VFileInput/truncate.js.map +1 -1
  143. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  144. package/dist/components/VFilePicker/VFilePicker.d.ts +54 -37
  145. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  146. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +152 -135
  147. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  148. package/dist/components/VFilePicker/fileKind.d.ts +2 -2
  149. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  150. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  151. package/dist/components/VHotkeys/VHotkeys.d.ts +10 -8
  152. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  153. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +22 -20
  154. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/VHotkeys/platform.d.ts +9 -7
  156. package/dist/components/VHotkeys/platform.js +41 -30
  157. package/dist/components/VHotkeys/platform.js.map +1 -1
  158. package/dist/components/VIcon/VIcon.css +1 -1
  159. package/dist/components/VIcon/VIcon.d.ts +6 -6
  160. package/dist/components/VIcon/VIcon.js.map +1 -1
  161. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/VIcon/iconProps.d.ts +4 -4
  163. package/dist/components/VIcon/iconProps.js.map +1 -1
  164. package/dist/components/VIcon/icons/index.d.ts +1 -1
  165. package/dist/components/VIcon/icons/index.js.map +1 -1
  166. package/dist/components/VIcon/icons/names.d.ts +1 -1
  167. package/dist/components/VIcon/icons/names.js.map +1 -1
  168. package/dist/components/VIcon/resolver.d.ts +3 -3
  169. package/dist/components/VIcon/resolver.js +23 -20
  170. package/dist/components/VIcon/resolver.js.map +1 -1
  171. package/dist/components/VIcon/types.d.ts +4 -4
  172. package/dist/components/VIconButton/VIconButton.d.ts +4 -4
  173. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  174. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/VInput/VInput.d.ts +16 -8
  176. package/dist/components/VInput/VInput.js.map +1 -1
  177. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +22 -16
  178. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/components/VInput/VInputGroup.css +1 -1
  180. package/dist/components/VInput/VInputGroup.js.map +1 -1
  181. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +43 -28
  182. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  183. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  184. package/dist/components/VInputOTP/VInputOTP.d.ts +3 -3
  185. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  186. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +152 -85
  187. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  188. package/dist/components/VMenu/VMenu.d.ts +4 -4
  189. package/dist/components/VMenu/VMenu.js.map +1 -1
  190. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/components/VMenu/VMenuGroup.css +1 -1
  192. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  193. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +18 -11
  194. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/components/VMenu/VMenuItem.css +1 -1
  196. package/dist/components/VMenu/VMenuItem.d.ts +6 -6
  197. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  198. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +83 -69
  199. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/components/VMenu/VMenuPanel.css +1 -1
  201. package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
  202. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  203. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +56 -55
  204. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/components/VMenu/context.d.ts +2 -2
  206. package/dist/components/VMenu/context.js.map +1 -1
  207. package/dist/components/VPagination/VPagination.css +1 -1
  208. package/dist/components/VPagination/VPagination.d.ts +22 -9
  209. package/dist/components/VPagination/VPagination.js.map +1 -1
  210. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +67 -57
  211. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VPopover/VPopover.css +1 -1
  213. package/dist/components/VPopover/VPopover.d.ts +1 -1
  214. package/dist/components/VPopover/VPopover.js.map +1 -1
  215. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  217. package/dist/components/VProgressCircular/VProgressCircular.d.ts +12 -7
  218. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  219. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  221. package/dist/components/VProgressLinear/VProgressLinear.d.ts +15 -10
  222. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  223. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  224. package/dist/components/VRadio/VRadio.css +1 -1
  225. package/dist/components/VRadio/VRadio.js.map +1 -1
  226. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +3 -3
  227. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VSeparator/VSeparator.d.ts +1 -1
  229. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  230. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/components/VSideNavigation/VSideNavigation.d.ts +2 -2
  232. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  233. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +1 -1
  234. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  235. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  236. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  237. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  238. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  239. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  240. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +12 -13
  241. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  242. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +87 -68
  243. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  244. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  245. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +10 -7
  246. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  247. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +5 -5
  248. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  249. package/dist/components/VSlider/VSlider.css +1 -1
  250. package/dist/components/VSlider/VSlider.d.ts +21 -7
  251. package/dist/components/VSlider/VSlider.js.map +1 -1
  252. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +159 -140
  253. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  255. package/dist/components/VSnackbar/VSnackbar.d.ts +4 -4
  256. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  257. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +85 -59
  258. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  259. package/dist/components/VSnackbar/state.d.ts +7 -7
  260. package/dist/components/VSnackbar/state.js +13 -11
  261. package/dist/components/VSnackbar/state.js.map +1 -1
  262. package/dist/components/VSpinner/VSpinner.css +1 -1
  263. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  264. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  265. package/dist/components/VSwitch/VSwitch.css +1 -1
  266. package/dist/components/VSwitch/VSwitch.d.ts +1 -1
  267. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  268. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +4 -4
  269. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  270. package/dist/components/VTabs/VTab.css +1 -1
  271. package/dist/components/VTabs/VTab.d.ts +4 -0
  272. package/dist/components/VTabs/VTab.js.map +1 -1
  273. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +9 -8
  274. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  275. package/dist/components/VTabs/VTabs.css +1 -1
  276. package/dist/components/VTabs/VTabs.d.ts +17 -7
  277. package/dist/components/VTabs/VTabs.js.map +1 -1
  278. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +84 -77
  279. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/components/VTextarea/VTextarea.d.ts +8 -8
  281. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  282. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +71 -69
  283. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  284. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  285. package/dist/components/VTimeInput/VTimeInput.d.ts +21 -12
  286. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  287. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +230 -206
  288. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VTimeInput/search.d.ts +17 -2
  290. package/dist/components/VTimeInput/search.js +19 -9
  291. package/dist/components/VTimeInput/search.js.map +1 -1
  292. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  293. package/dist/components/VTimePicker/VTimePicker.d.ts +8 -7
  294. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  295. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +128 -106
  296. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  297. package/dist/components/VTimePicker/limits.d.ts +11 -4
  298. package/dist/components/VTimePicker/limits.js +3 -2
  299. package/dist/components/VTimePicker/limits.js.map +1 -1
  300. package/dist/components/VToast/VToast.css +1 -1
  301. package/dist/components/VToast/VToast.js.map +1 -1
  302. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +33 -37
  303. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  304. package/dist/components/VToast/VToaster.js.map +1 -1
  305. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +91 -61
  306. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  307. package/dist/components/VToast/state.d.ts +8 -6
  308. package/dist/components/VToast/state.js +15 -13
  309. package/dist/components/VToast/state.js.map +1 -1
  310. package/dist/components/VToggle/VToggle.css +1 -1
  311. package/dist/components/VToggle/VToggle.d.ts +9 -4
  312. package/dist/components/VToggle/VToggle.js.map +1 -1
  313. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +2 -1
  314. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/dist/components/VToggle/VToggleItem.d.ts +4 -0
  316. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  317. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +5 -5
  318. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  319. package/dist/components/VTooltip/VTooltip.css +1 -1
  320. package/dist/components/VTooltip/VTooltip.d.ts +17 -10
  321. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  322. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +46 -26
  323. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  324. package/dist/components/VTypography/VTypography.css +1 -1
  325. package/dist/components/VTypography/VTypography.d.ts +6 -4
  326. package/dist/components/VTypography/VTypography.js.map +1 -1
  327. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  328. package/dist/composables/useAriaLabel.js +1 -1
  329. package/dist/composables/useAriaLabel.js.map +1 -1
  330. package/dist/composables/useClearable.d.ts +2 -2
  331. package/dist/composables/useClearable.js.map +1 -1
  332. package/dist/composables/useDetailsOpen.d.ts +3 -3
  333. package/dist/composables/useDetailsOpen.js +14 -12
  334. package/dist/composables/useDetailsOpen.js.map +1 -1
  335. package/dist/composables/useFieldIds.d.ts +2 -1
  336. package/dist/composables/useFieldIds.js +6 -5
  337. package/dist/composables/useFieldIds.js.map +1 -1
  338. package/dist/composables/useFieldPanel.d.ts +2 -2
  339. package/dist/composables/useFieldPanel.js +47 -37
  340. package/dist/composables/useFieldPanel.js.map +1 -1
  341. package/dist/composables/useFileDrop.js +3 -3
  342. package/dist/composables/useFileDrop.js.map +1 -1
  343. package/dist/composables/useFileField.d.ts +1 -1
  344. package/dist/composables/useFileField.js +62 -41
  345. package/dist/composables/useFileField.js.map +1 -1
  346. package/dist/composables/useIconClickHandlers.d.ts +3 -3
  347. package/dist/composables/useIconClickHandlers.js +14 -13
  348. package/dist/composables/useIconClickHandlers.js.map +1 -1
  349. package/dist/composables/useInertLink.js +12 -10
  350. package/dist/composables/useInertLink.js.map +1 -1
  351. package/dist/composables/useLiveAnnouncer.d.ts +5 -0
  352. package/dist/composables/useLiveAnnouncer.js +23 -0
  353. package/dist/composables/useLiveAnnouncer.js.map +1 -0
  354. package/dist/composables/useMaskedField.d.ts +5 -5
  355. package/dist/composables/useMaskedField.js.map +1 -1
  356. package/dist/composables/usePopover.d.ts +3 -3
  357. package/dist/composables/usePopover.js +6 -4
  358. package/dist/composables/usePopover.js.map +1 -1
  359. package/dist/composables/useProgressValue.js +11 -2
  360. package/dist/composables/useProgressValue.js.map +1 -1
  361. package/dist/composables/useRootAttrs.d.ts +1 -1
  362. package/dist/composables/useRootAttrs.js.map +1 -1
  363. package/dist/composables/useSlotNodes.d.ts +18 -0
  364. package/dist/composables/useSlotNodes.js +13 -0
  365. package/dist/composables/useSlotNodes.js.map +1 -0
  366. package/dist/composables/useTextLimit.d.ts +2 -1
  367. package/dist/composables/useTextLimit.js +2 -2
  368. package/dist/composables/useTextLimit.js.map +1 -1
  369. package/dist/composables/useTimer.d.ts +5 -0
  370. package/dist/composables/useTimer.js +22 -11
  371. package/dist/composables/useTimer.js.map +1 -1
  372. package/dist/i18n/en.js +1 -1
  373. package/dist/i18n/en.js.map +1 -1
  374. package/dist/i18n/fr.js +14 -14
  375. package/dist/i18n/fr.js.map +1 -1
  376. package/dist/i18n/state.d.ts +7 -7
  377. package/dist/i18n/state.js +37 -28
  378. package/dist/i18n/state.js.map +1 -1
  379. package/dist/i18n/types.d.ts +12 -12
  380. package/dist/icons.d.ts +2 -2
  381. package/dist/index.d.ts +12 -11
  382. package/dist/styles.css +1 -1
  383. package/dist/tokens/css.d.ts +1 -1
  384. package/dist/tokens/css.js.map +1 -1
  385. package/dist/tokens/index.d.ts +6 -0
  386. package/dist/tokens/semantic.d.ts +6 -0
  387. package/dist/tokens/semantic.js +66 -60
  388. package/dist/tokens/semantic.js.map +1 -1
  389. package/dist/tokens/themes/dark.js +3 -3
  390. package/dist/tokens/themes/dark.js.map +1 -1
  391. package/dist/tokens.json +130 -66
  392. package/dist/types.d.ts +1 -1
  393. package/dist/utils/arrowNav.d.ts +4 -1
  394. package/dist/utils/arrowNav.js +7 -7
  395. package/dist/utils/arrowNav.js.map +1 -1
  396. package/dist/utils/chip.d.ts +1 -1
  397. package/dist/utils/chip.js.map +1 -1
  398. package/dist/utils/clock.d.ts +113 -0
  399. package/dist/utils/clock.js +84 -0
  400. package/dist/utils/clock.js.map +1 -0
  401. package/dist/utils/css.d.ts +6 -4
  402. package/dist/utils/css.js +2 -2
  403. package/dist/utils/css.js.map +1 -1
  404. package/dist/utils/date.d.ts +7 -102
  405. package/dist/utils/date.js +33 -160
  406. package/dist/utils/date.js.map +1 -1
  407. package/dist/utils/direction.d.ts +1 -1
  408. package/dist/utils/direction.js.map +1 -1
  409. package/dist/utils/env.d.ts +12 -3
  410. package/dist/utils/env.js +6 -0
  411. package/dist/utils/env.js.map +1 -0
  412. package/dist/utils/file.d.ts +3 -3
  413. package/dist/utils/file.js +1 -1
  414. package/dist/utils/file.js.map +1 -1
  415. package/dist/utils/focus.d.ts +1 -1
  416. package/dist/utils/focus.js.map +1 -1
  417. package/dist/utils/hostWarns.d.ts +1 -1
  418. package/dist/utils/hostWarns.js.map +1 -1
  419. package/dist/utils/ids.d.ts +1 -1
  420. package/dist/utils/ids.js.map +1 -1
  421. package/dist/utils/matcher.d.ts +2 -2
  422. package/dist/utils/matcher.js.map +1 -1
  423. package/dist/utils/memo.d.ts +1 -1
  424. package/dist/utils/memo.js.map +1 -1
  425. package/dist/utils/text.d.ts +3 -3
  426. package/dist/utils/text.js.map +1 -1
  427. package/dist/utils/time.d.ts +2 -101
  428. package/dist/utils/time.js +22 -98
  429. package/dist/utils/time.js.map +1 -1
  430. package/dist/utils/vnode.d.ts +5 -3
  431. package/dist/utils/vnode.js.map +1 -1
  432. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"useRootAttrs.js","names":[],"sources":["../../src/composables/useRootAttrs.ts"],"sourcesContent":["import { computed, useAttrs, type ComputedRef, type StyleValue } from 'vue'\n\n/**\n * Redeclared locally: `@vue/runtime-dom` exports this as `ClassValue` and the `vue` package\n * does not re-export it. Typed `unknown` instead, a template refuses to bind it.\n */\ntype ClassBinding = false | null | undefined | string | Record<string, unknown> | ClassBinding[]\n\n// @a11y\n/**\n * The attribute split of the wrapper-root pattern, for components whose root is only a\n * container: VInput, VTextarea, VTabs, VCombobox, VDataTable, VDateInput, VTimeInput, VSlider,\n * and the three choice controls, whose root holds the <label> and its hint.\n *\n * `class`/`style` stay on the root, which is the box the consumer positions; everything\n * else is forwarded to the functional element. Unsplit, `name`, `required` and every\n * `aria-*` land on a decorative wrapper, where the form ignores them and assistive\n * technology never finds them.\n *\n * `defineOptions({ inheritAttrs: false })` stays in the SFC — it is a compilation option.\n * `attrs` is returned whole for the components that need to read one back: a consumer `id`\n * that must beat the generated one, a `describedby` to merge rather than replace.\n */\nexport function useRootAttrs(): {\n attrs: Record<string, unknown>\n rootClass: ComputedRef<ClassBinding>\n rootStyle: ComputedRef<StyleValue>\n forwardedAttrs: ComputedRef<Record<string, unknown>>\n} {\n const attrs = useAttrs()\n\n return {\n attrs,\n rootClass: computed(() => attrs.class as ClassBinding),\n rootStyle: computed(() => attrs.style as StyleValue),\n forwardedAttrs: computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== 'class' && key !== 'style'),\n ),\n ),\n }\n}\n"],"mappings":";;AAuBA,SAAgB,IAKd;CACA,IAAM,IAAQ,EAAS;CAEvB,OAAO;EACL;EACA,WAAW,QAAe,EAAM,KAAqB;EACrD,WAAW,QAAe,EAAM,KAAmB;EACnD,gBAAgB,QACd,OAAO,YACL,OAAO,QAAQ,CAAK,CAAC,CAAC,QAAQ,CAAC,OAAS,MAAQ,WAAW,MAAQ,OAAO,CAC5E,CACF;CACF;AACF"}
1
+ {"version":3,"file":"useRootAttrs.js","names":[],"sources":["../../src/composables/useRootAttrs.ts"],"sourcesContent":["import { computed, useAttrs, type ComputedRef, type StyleValue } from 'vue'\n\n/**\n * Redeclared locally: `@vue/runtime-dom` exports this as `ClassValue` and the `vue` package\n * does not re-export it. Typed `unknown` instead, a template refuses to bind it.\n */\ntype ClassBinding = false | null | undefined | string | Record<string, unknown> | ClassBinding[]\n\n// @a11y\n/**\n * The attribute split of the wrapper-root pattern, for components whose root is only a\n * container: VInput, VTextarea, VTabs, VCombobox, VDataTable, VDateInput, VTimeInput, VSlider,\n * and the three choice controls, whose root holds the <label> and its hint.\n *\n * `class`/`style` stay on the root, which is the box the consumer positions; everything\n * else is forwarded to the functional element. Unsplit, `name`, `required` and every\n * `aria-*` land on a decorative wrapper, where the form ignores them and assistive\n * technology never finds them.\n *\n * `defineOptions({ inheritAttrs: false })` stays in the SFC: it is a compilation option.\n * `attrs` is returned whole for the components that need to read one back: a consumer `id`\n * that must beat the generated one, a `describedby` to merge rather than replace.\n */\nexport function useRootAttrs(): {\n attrs: Record<string, unknown>\n rootClass: ComputedRef<ClassBinding>\n rootStyle: ComputedRef<StyleValue>\n forwardedAttrs: ComputedRef<Record<string, unknown>>\n} {\n const attrs = useAttrs()\n\n return {\n attrs,\n rootClass: computed(() => attrs.class as ClassBinding),\n rootStyle: computed(() => attrs.style as StyleValue),\n forwardedAttrs: computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== 'class' && key !== 'style'),\n ),\n ),\n }\n}\n"],"mappings":";;AAuBA,SAAgB,IAKd;CACA,IAAM,IAAQ,EAAS;CAEvB,OAAO;EACL;EACA,WAAW,QAAe,EAAM,KAAqB;EACrD,WAAW,QAAe,EAAM,KAAmB;EACnD,gBAAgB,QACd,OAAO,YACL,OAAO,QAAQ,CAAK,CAAC,CAAC,QAAQ,CAAC,OAAS,MAAQ,WAAW,MAAQ,OAAO,CAC5E,CACF;CACF;AACF"}
@@ -0,0 +1,18 @@
1
+ import { ComputedRef, VNode } from 'vue';
2
+ /**
3
+ * The VNodes a slot renders, flattened by `flattenSlot`, for a component that has to KNOW
4
+ * its children (how many, which kind) rather than merely render them. Reading the slot
5
+ * instead of keeping a registry the children feed at mount is what keeps the server and
6
+ * the client in agreement.
7
+ *
8
+ * TRAP: a bare `computed(() => flattenSlot(slots.default?.()))` goes stale. `slots` is not
9
+ * reactive: the computed only tracks what the slot READS while it runs, so a parent handing
10
+ * down a NEW slot function leaves it cached. That is the case of a render function whose
11
+ * slot captures a local, of a `v-for` whose array is replaced wholesale, and of a `v-if`
12
+ * between two slot templates: the old children stay on screen with no warning. The tick
13
+ * below is bumped before every re-render of the component, which is exactly when a new slot
14
+ * can have arrived, so the read is redone then; computeds derived from it keep their cache
15
+ * as long as their own value does not change. Bumping it there schedules nothing: Vue does
16
+ * not let an update re-queue itself while it runs.
17
+ */
18
+ export declare function useSlotNodes(name?: string): ComputedRef<VNode[]>;
@@ -0,0 +1,13 @@
1
+ import { flattenSlot as e } from "../utils/vnode.js";
2
+ import { computed as t, onBeforeUpdate as n, ref as r, useSlots as i } from "vue";
3
+ //#region src/composables/useSlotNodes.ts
4
+ function a(a = "default") {
5
+ let o = i(), s = r(0);
6
+ return n(() => {
7
+ s.value++;
8
+ }), t(() => (s.value, e(o[a]?.())));
9
+ }
10
+ //#endregion
11
+ export { a as useSlotNodes };
12
+
13
+ //# sourceMappingURL=useSlotNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSlotNodes.js","names":[],"sources":["../../src/composables/useSlotNodes.ts"],"sourcesContent":["import { computed, onBeforeUpdate, ref, useSlots, type ComputedRef, type VNode } from 'vue'\n\nimport { flattenSlot } from '../utils/vnode'\n\n// @ssr @core\n/**\n * The VNodes a slot renders, flattened by `flattenSlot`, for a component that has to KNOW\n * its children (how many, which kind) rather than merely render them. Reading the slot\n * instead of keeping a registry the children feed at mount is what keeps the server and\n * the client in agreement.\n *\n * TRAP: a bare `computed(() => flattenSlot(slots.default?.()))` goes stale. `slots` is not\n * reactive: the computed only tracks what the slot READS while it runs, so a parent handing\n * down a NEW slot function leaves it cached. That is the case of a render function whose\n * slot captures a local, of a `v-for` whose array is replaced wholesale, and of a `v-if`\n * between two slot templates: the old children stay on screen with no warning. The tick\n * below is bumped before every re-render of the component, which is exactly when a new slot\n * can have arrived, so the read is redone then; computeds derived from it keep their cache\n * as long as their own value does not change. Bumping it there schedules nothing: Vue does\n * not let an update re-queue itself while it runs.\n */\nexport function useSlotNodes(name = 'default'): ComputedRef<VNode[]> {\n const slots = useSlots()\n const tick = ref(0)\n onBeforeUpdate(() => {\n tick.value++\n })\n return computed(() => {\n void tick.value\n return flattenSlot(slots[name]?.())\n })\n}\n"],"mappings":";;;AAqBA,SAAgB,EAAa,IAAO,WAAiC;CACnE,IAAM,IAAQ,EAAS,GACjB,IAAO,EAAI,CAAC;CAIlB,OAHA,QAAqB;EACnB,EAAK;CACP,CAAC,GACM,SACL,EAAU,OACH,EAAY,EAAM,EAAK,GAAG,CAAC,EACnC;AACH"}
@@ -13,7 +13,8 @@ interface ValidatableControl {
13
13
  * turns red once the reader has actually interacted with it, exactly as a native error
14
14
  * does; the form refuses to submit; and anyone inspecting the field finds the error where
15
15
  * they would look for any other. The price is that the component then owns that error
16
- * outright for as long as the soft limit is on.
16
+ * for as long as it is standing, and only then. A message the consumer set (a server
17
+ * verdict) is left alone whenever the soft limit has nothing to say.
17
18
  *
18
19
  * The effect runs AFTER the render rather than before it, because the reference to the
19
20
  * real element is not filled in yet at the earlier point. It does nothing at all during a
@@ -2,12 +2,12 @@ import { useMessages as e } from "../i18n/state.js";
2
2
  import { computed as t, watchEffect as n } from "vue";
3
3
  //#region src/composables/useTextLimit.ts
4
4
  function r(r) {
5
- let i = t(() => r.text().length), a = t(() => r.maxlength()), o = e();
5
+ let i = t(() => r.text().length), a = t(() => r.maxlength()), o = e(), s = !1;
6
6
  return n(() => {
7
7
  let e = r.el.value;
8
8
  if (!e) return;
9
9
  let t = a.value;
10
- r.softLimit() && t != null && i.value > t ? e.setCustomValidity(o.value.field.limitExceeded(t)) : e.setCustomValidity("");
10
+ r.softLimit() && t != null && i.value > t ? (e.setCustomValidity(o.value.field.limitExceeded(t)), s = !0) : s &&= (e.setCustomValidity(""), !1);
11
11
  }, { flush: "post" }), {
12
12
  counterText: t(() => a.value == null ? `${i.value}` : `${i.value}/${a.value}`),
13
13
  over: t(() => a.value != null && i.value > a.value)
@@ -1 +1 @@
1
- {"version":3,"file":"useTextLimit.js","names":[],"sources":["../../src/composables/useTextLimit.ts"],"sourcesContent":["import { computed, watchEffect, type ComputedRef, type Ref } from 'vue'\n\nimport { useMessages } from '../i18n/state'\n\n/** The least this needs of the real control — the two kinds of field both offer it. */\ninterface ValidatableControl {\n setCustomValidity: (message: string) => void\n}\n\n// @core\n/**\n * How much has been typed against how much is allowed: the \"12/80\" counter under a\n * field, whether the allowance has been passed, and the SOFT limit.\n *\n * A soft limit lets the reader keep typing past the allowance and puts the field in\n * error instead of cutting them off mid-word. That error is declared to the BROWSER\n * rather than invented here, and three things follow from it for free: the field only\n * turns red once the reader has actually interacted with it, exactly as a native error\n * does; the form refuses to submit; and anyone inspecting the field finds the error where\n * they would look for any other. The price is that the component then owns that error\n * outright for as long as the soft limit is on.\n *\n * The effect runs AFTER the render rather than before it, because the reference to the\n * real element is not filled in yet at the earlier point. It does nothing at all during a\n * server render, where there is no element to speak to.\n */\nexport function useTextLimit(options: {\n el: Ref<ValidatableControl | null>\n text: () => string\n maxlength: () => number | undefined\n softLimit: () => boolean\n}): { counterText: ComputedRef<string>; over: ComputedRef<boolean> } {\n const length = computed(() => options.text().length)\n const max = computed(() => options.maxlength())\n const m = useMessages()\n\n // The dictionary is read INSIDE the effect, which is what makes the error message\n // rewrite itself when the language is changed after the component is on screen. The\n // branches are spelled out rather than written as a ternary so that TypeScript can\n // narrow the limit to a number.\n watchEffect(\n () => {\n const el = options.el.value\n if (!el) return\n const limit = max.value\n if (options.softLimit() && limit != null && length.value > limit) {\n el.setCustomValidity(m.value.field.limitExceeded(limit))\n } else {\n el.setCustomValidity('')\n }\n },\n { flush: 'post' },\n )\n\n return {\n counterText: computed(() =>\n max.value != null ? `${length.value}/${max.value}` : `${length.value}`,\n ),\n over: computed(() => max.value != null && length.value > max.value),\n }\n}\n"],"mappings":";;;AA0BA,SAAgB,EAAa,GAKwC;CACnE,IAAM,IAAS,QAAe,EAAQ,KAAK,CAAC,CAAC,MAAM,GAC7C,IAAM,QAAe,EAAQ,UAAU,CAAC,GACxC,IAAI,EAAY;CAoBtB,OAdA,QACQ;EACJ,IAAM,IAAK,EAAQ,GAAG;EACtB,IAAI,CAAC,GAAI;EACT,IAAM,IAAQ,EAAI;EAClB,AAAI,EAAQ,UAAU,KAAK,KAAS,QAAQ,EAAO,QAAQ,IACzD,EAAG,kBAAkB,EAAE,MAAM,MAAM,cAAc,CAAK,CAAC,IAEvD,EAAG,kBAAkB,EAAE;CAE3B,GACA,EAAE,OAAO,OAAO,CAClB,GAEO;EACL,aAAa,QACX,EAAI,SAAS,OAAwC,GAAG,EAAO,UAA3C,GAAG,EAAO,MAAM,GAAG,EAAI,OAC7C;EACA,MAAM,QAAe,EAAI,SAAS,QAAQ,EAAO,QAAQ,EAAI,KAAK;CACpE;AACF"}
1
+ {"version":3,"file":"useTextLimit.js","names":[],"sources":["../../src/composables/useTextLimit.ts"],"sourcesContent":["import { computed, watchEffect, type ComputedRef, type Ref } from 'vue'\n\nimport { useMessages } from '../i18n/state'\n\n/** The least this needs of the real control — the two kinds of field both offer it. */\ninterface ValidatableControl {\n setCustomValidity: (message: string) => void\n}\n\n// @core\n/**\n * How much has been typed against how much is allowed: the \"12/80\" counter under a\n * field, whether the allowance has been passed, and the SOFT limit.\n *\n * A soft limit lets the reader keep typing past the allowance and puts the field in\n * error instead of cutting them off mid-word. That error is declared to the BROWSER\n * rather than invented here, and three things follow from it for free: the field only\n * turns red once the reader has actually interacted with it, exactly as a native error\n * does; the form refuses to submit; and anyone inspecting the field finds the error where\n * they would look for any other. The price is that the component then owns that error\n * for as long as it is standing, and only then. A message the consumer set (a server\n * verdict) is left alone whenever the soft limit has nothing to say.\n *\n * The effect runs AFTER the render rather than before it, because the reference to the\n * real element is not filled in yet at the earlier point. It does nothing at all during a\n * server render, where there is no element to speak to.\n */\nexport function useTextLimit(options: {\n el: Ref<ValidatableControl | null>\n text: () => string\n maxlength: () => number | undefined\n softLimit: () => boolean\n}): { counterText: ComputedRef<string>; over: ComputedRef<boolean> } {\n const length = computed(() => options.text().length)\n const max = computed(() => options.maxlength())\n const m = useMessages()\n\n // Whether the message on the element is ours. Without it the effect would clear the\n // validity on every re-run, erasing a consumer's own `setCustomValidity` the moment an\n // unrelated prop such as `maxlength` changed, and letting the form submit.\n let owned = false\n\n // The dictionary is read INSIDE the effect, which is what makes the error message\n // rewrite itself when the language is changed after the component is on screen. The\n // branches are spelled out rather than written as a ternary so that TypeScript can\n // narrow the limit to a number.\n watchEffect(\n () => {\n const el = options.el.value\n if (!el) return\n const limit = max.value\n if (options.softLimit() && limit != null && length.value > limit) {\n el.setCustomValidity(m.value.field.limitExceeded(limit))\n owned = true\n } else if (owned) {\n el.setCustomValidity('')\n owned = false\n }\n },\n { flush: 'post' },\n )\n\n return {\n counterText: computed(() =>\n max.value != null ? `${length.value}/${max.value}` : `${length.value}`,\n ),\n over: computed(() => max.value != null && length.value > max.value),\n }\n}\n"],"mappings":";;;AA2BA,SAAgB,EAAa,GAKwC;CACnE,IAAM,IAAS,QAAe,EAAQ,KAAK,CAAC,CAAC,MAAM,GAC7C,IAAM,QAAe,EAAQ,UAAU,CAAC,GACxC,IAAI,EAAY,GAKlB,IAAQ;CAsBZ,OAhBA,QACQ;EACJ,IAAM,IAAK,EAAQ,GAAG;EACtB,IAAI,CAAC,GAAI;EACT,IAAM,IAAQ,EAAI;EAClB,AAAI,EAAQ,UAAU,KAAK,KAAS,QAAQ,EAAO,QAAQ,KACzD,EAAG,kBAAkB,EAAE,MAAM,MAAM,cAAc,CAAK,CAAC,GACvD,IAAQ,MACH,AAEL,OADA,EAAG,kBAAkB,EAAE,GACf;CAEZ,GACA,EAAE,OAAO,OAAO,CAClB,GAEO;EACL,aAAa,QACX,EAAI,SAAS,OAAwC,GAAG,EAAO,UAA3C,GAAG,EAAO,MAAM,GAAG,EAAI,OAC7C;EACA,MAAM,QAAe,EAAI,SAAS,QAAQ,EAAO,QAAQ,EAAI,KAAK;CACpE;AACF"}
@@ -9,6 +9,11 @@
9
9
  * The library's convention is that zero disarms the deferral, which is what makes a debounce
10
10
  * of 0 immediate. Callers for whom 0 means "never" (VSnackbar's duration, VCarousel's
11
11
  * autoplay) must guard before calling, or the callback fires in the tick that armed it.
12
+ *
13
+ * Inside `<KeepAlive>` a component is deactivated rather than unmounted: a pending delay is
14
+ * held while it is away and armed again, in full, when it comes back. Cancelled on unmount
15
+ * alone, it went on firing off screen, and a carousel kept turning on a page the reader had
16
+ * left.
12
17
  */
13
18
  export declare function useTimer(): {
14
19
  start: (fn: () => void, delay: number) => void;
@@ -1,19 +1,30 @@
1
- import { onBeforeUnmount as e } from "vue";
1
+ import { onActivated as e, onBeforeUnmount as t, onDeactivated as n } from "vue";
2
2
  //#region src/composables/useTimer.ts
3
- function t() {
4
- let t;
5
- function n() {
6
- clearTimeout(t), t = void 0;
3
+ function r() {
4
+ let r, i, a;
5
+ function o() {
6
+ clearTimeout(r), r = void 0, i = void 0, a = void 0;
7
7
  }
8
- function r(e, r) {
9
- n(), r <= 0 ? e() : t = setTimeout(e, r);
8
+ function s(e, t) {
9
+ if (o(), t <= 0) return e();
10
+ i = {
11
+ fn: e,
12
+ delay: t
13
+ }, r = setTimeout(() => {
14
+ r = void 0, i = void 0, e();
15
+ }, t);
10
16
  }
11
- return e(n), {
12
- start: r,
13
- cancel: n
17
+ return t(o), n(() => {
18
+ let e = i;
19
+ o(), a = e;
20
+ }), e(() => {
21
+ a && s(a.fn, a.delay);
22
+ }), {
23
+ start: s,
24
+ cancel: o
14
25
  };
15
26
  }
16
27
  //#endregion
17
- export { t as useTimer };
28
+ export { r as useTimer };
18
29
 
19
30
  //# sourceMappingURL=useTimer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTimer.js","names":[],"sources":["../../src/composables/useTimer.ts"],"sourcesContent":["// @core\n/**\n * A re-armable delay, cancelled on unmount.\n *\n * `start` always cancels the pending one, or a tooltip armed twice opens, closes and opens\n * again. The handle is a plain variable: nothing renders it, and making it reactive would\n * cost renders for nothing.\n *\n * TRAP — a delay of 0 runs the callback SYNCHRONOUSLY, where `setTimeout(fn, 0)` would not.\n * The library's convention is that zero disarms the deferral, which is what makes a debounce\n * of 0 immediate. Callers for whom 0 means \"never\" (VSnackbar's duration, VCarousel's\n * autoplay) must guard before calling, or the callback fires in the tick that armed it.\n */\n\nimport { onBeforeUnmount } from 'vue'\n\nexport function useTimer(): { start: (fn: () => void, delay: number) => void; cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined\n\n function cancel() {\n clearTimeout(timer)\n timer = undefined\n }\n\n function start(fn: () => void, delay: number) {\n cancel()\n if (delay <= 0) fn()\n else timer = setTimeout(fn, delay)\n }\n\n onBeforeUnmount(cancel)\n\n return { start, cancel }\n}\n"],"mappings":";;AAgBA,SAAgB,IAAmF;CACjG,IAAI;CAEJ,SAAS,IAAS;EAEhB,AADA,aAAa,CAAK,GAClB,IAAQ,KAAA;CACV;CAEA,SAAS,EAAM,GAAgB,GAAe;EAE5C,AADA,EAAO,GACH,KAAS,IAAG,EAAG,IACd,IAAQ,WAAW,GAAI,CAAK;CACnC;CAIA,OAFA,EAAgB,CAAM,GAEf;EAAE;EAAO;CAAO;AACzB"}
1
+ {"version":3,"file":"useTimer.js","names":[],"sources":["../../src/composables/useTimer.ts"],"sourcesContent":["// @core\n/**\n * A re-armable delay, cancelled on unmount.\n *\n * `start` always cancels the pending one, or a tooltip armed twice opens, closes and opens\n * again. The handle is a plain variable: nothing renders it, and making it reactive would\n * cost renders for nothing.\n *\n * TRAP — a delay of 0 runs the callback SYNCHRONOUSLY, where `setTimeout(fn, 0)` would not.\n * The library's convention is that zero disarms the deferral, which is what makes a debounce\n * of 0 immediate. Callers for whom 0 means \"never\" (VSnackbar's duration, VCarousel's\n * autoplay) must guard before calling, or the callback fires in the tick that armed it.\n *\n * Inside `<KeepAlive>` a component is deactivated rather than unmounted: a pending delay is\n * held while it is away and armed again, in full, when it comes back. Cancelled on unmount\n * alone, it went on firing off screen, and a carousel kept turning on a page the reader had\n * left.\n */\n\nimport { onActivated, onBeforeUnmount, onDeactivated } from 'vue'\n\nexport function useTimer(): { start: (fn: () => void, delay: number) => void; cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined\n let armed: { fn: () => void; delay: number } | undefined\n let held: typeof armed\n\n function cancel() {\n clearTimeout(timer)\n timer = undefined\n armed = undefined\n held = undefined\n }\n\n function start(fn: () => void, delay: number) {\n cancel()\n if (delay <= 0) return fn()\n armed = { fn, delay }\n timer = setTimeout(() => {\n timer = undefined\n armed = undefined\n fn()\n }, delay)\n }\n\n onBeforeUnmount(cancel)\n onDeactivated(() => {\n const pending = armed\n cancel()\n held = pending\n })\n onActivated(() => {\n if (held) start(held.fn, held.delay)\n })\n\n return { start, cancel }\n}\n"],"mappings":";;AAqBA,SAAgB,IAAmF;CACjG,IAAI,GACA,GACA;CAEJ,SAAS,IAAS;EAIhB,AAHA,aAAa,CAAK,GAClB,IAAQ,KAAA,GACR,IAAQ,KAAA,GACR,IAAO,KAAA;CACT;CAEA,SAAS,EAAM,GAAgB,GAAe;EAE5C,IADA,EAAO,GACH,KAAS,GAAG,OAAO,EAAG;EAE1B,AADA,IAAQ;GAAE;GAAI;EAAM,GACpB,IAAQ,iBAAiB;GAGvB,AAFA,IAAQ,KAAA,GACR,IAAQ,KAAA,GACR,EAAG;EACL,GAAG,CAAK;CACV;CAYA,OAVA,EAAgB,CAAM,GACtB,QAAoB;EAClB,IAAM,IAAU;EAEhB,AADA,EAAO,GACP,IAAO;CACT,CAAC,GACD,QAAkB;EAChB,AAAI,KAAM,EAAM,EAAK,IAAI,EAAK,KAAK;CACrC,CAAC,GAEM;EAAE;EAAO;CAAO;AACzB"}
package/dist/i18n/en.js CHANGED
@@ -108,7 +108,7 @@ var e = {
108
108
  hour: "Hour",
109
109
  minutes: "Minutes",
110
110
  hourValue: (e) => `${e} o'clock`,
111
- minutesValue: (e) => `${e} minutes`
111
+ minutesValue: (e) => e === 1 ? "1 minute" : `${e} minutes`
112
112
  },
113
113
  timeInput: {
114
114
  clear: "Clear time",
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","names":[],"sources":["../../src/i18n/en.ts"],"sourcesContent":["/**\n * English, the dictionary always bundled. Any language without one of its own falls back\n * here entry by entry, so nothing is ever left unsaid.\n *\n * TRAP — these strings are asserted letter for letter by the unit tests, and the play\n * functions query controls BY them (they run with the default globals, so the locale there\n * is deterministically `en-US`). Changing a word means changing what expects it.\n */\n\nimport type { Messages } from './types'\n\nexport const en: Messages = {\n common: {\n loading: 'Loading…',\n clear: 'Clear',\n close: 'Close',\n dismiss: 'Remove',\n remove: (name) => `Remove ${name}`,\n cancel: 'Cancel',\n confirm: 'OK',\n },\n pagination: {\n label: 'Pagination',\n previous: 'Previous page',\n next: 'Next page',\n page: (page) => `Page ${page}`,\n },\n tabs: {\n label: 'Tabs',\n previous: 'Previous tabs',\n next: 'Next tabs',\n },\n breadcrumb: {\n label: 'Breadcrumb',\n ellipsis: 'Show intermediate pages',\n },\n sideNavigation: { label: 'Navigation' },\n combobox: {\n empty: 'No results',\n clear: 'Clear selection',\n },\n dataTable: {\n empty: 'No data',\n loading: 'Loading data…',\n searchLabel: 'Search the table',\n searchPlaceholder: 'Search…',\n perPage: 'Rows per page',\n perPageValue: (label, value) => `${label}: ${value}`,\n selectAll: 'Select all',\n selectRow: (index) => `Select row ${index}`,\n // The plural is chosen right here, in the message itself. That one line is the whole\n // of the design system's handling of plurals, and it is meant to be.\n selection: (count) => `${count} item${count === 1 ? '' : 's'} selected`,\n range: ({ start, end, total }) => `${start}–${end} of ${total}`,\n pagination: 'Table pagination',\n },\n toaster: { label: 'Notifications' },\n snackbar: { label: 'Confirmation', action: 'Undo' },\n inputOTP: {\n label: 'Verification code',\n slot: (index, total) => `Character ${index} of ${total}`,\n },\n slider: {\n value: 'Value',\n start: 'Start',\n end: 'End',\n rangeStart: (label) => `${label} (start)`,\n rangeEnd: (label) => `${label} (end)`,\n },\n field: {\n limitExceeded: (max) => `Exceeds the limit of ${max} characters`,\n },\n progress: { percent: (percent) => `${percent}%`, label: 'Progress' },\n hotkeys: {\n command: 'Command',\n ctrl: 'Ctrl',\n alt: 'Alt',\n shift: 'Shift',\n windows: 'Win',\n super: 'Super',\n enter: 'Enter',\n escape: 'Esc',\n space: 'Space',\n backspace: 'Backspace',\n delete: 'Del',\n tab: 'Tab',\n up: 'Up arrow',\n down: 'Down arrow',\n left: 'Left arrow',\n right: 'Right arrow',\n label: (keys) => `Keyboard shortcut: ${keys}`,\n },\n datePicker: {\n label: 'Date picker',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n monthPicker: 'Choose month',\n yearPicker: 'Choose year',\n },\n dateInput: {\n clear: 'Clear date',\n openPicker: 'Open calendar',\n pickerLabel: 'Choose a date',\n },\n timePicker: {\n label: 'Time picker',\n meridiem: 'AM or PM',\n am: 'AM',\n pm: 'PM',\n selectHour: 'Select hour',\n selectMinutes: 'Select minutes',\n choosingHour: 'Selecting the hour',\n choosingMinutes: 'Selecting the minutes',\n hour: 'Hour',\n minutes: 'Minutes',\n hourValue: (hour) => `${hour} o'clock`,\n minutesValue: (minute) => `${minute} minutes`,\n },\n timeInput: {\n clear: 'Clear time',\n openPicker: 'Open time picker',\n pickerLabel: 'Choose a time',\n meridiemValue: (value) => `AM or PM: ${value}`,\n maskPlaceholder: 'hh:mm',\n unavailable: 'This time is not available.',\n },\n fileInput: {\n openPicker: 'Choose files',\n clear: 'Clear files',\n files: (count) => `${count} file${count === 1 ? '' : 's'}`,\n placeholder: 'No file selected',\n },\n filePicker: {\n browse: 'Browse files',\n or: 'or',\n list: 'Selected files',\n },\n carousel: {\n label: 'Carousel',\n roleDescription: 'carousel',\n slideRoleDescription: 'slide',\n slides: 'Slides',\n slide: (index, total) => `${index} of ${total}`,\n previous: 'Previous slide',\n next: 'Next slide',\n indicators: 'Choose slide to display',\n },\n calendar: {\n label: 'Calendar',\n roleDescription: 'calendar',\n today: 'Today',\n view: 'View',\n viewDay: 'Day',\n view4Days: '4 days',\n viewWeek: 'Week',\n viewMonth: 'Month',\n viewYear: 'Year',\n viewCustom: (days) => `${days} days`,\n previousDay: 'Previous day',\n nextDay: 'Next day',\n previousWeek: 'Previous week',\n nextWeek: 'Next week',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n previousPeriod: 'Previous period',\n nextPeriod: 'Next period',\n allDay: 'All day',\n moreEvents: (count) => `+${count} more`,\n openDay: (day) => `Open ${day}`,\n untitled: '(No title)',\n eventRoleDescription: 'event',\n eventHint:\n 'Press Enter to open this event. Press Space to take hold of it, then the arrow keys to move it and Shift with the arrow keys to change when it ends.',\n grabbed:\n 'Event held. Use the arrow keys to move it, Enter or Space to place it, Escape to cancel.',\n dropped: 'Event placed.',\n reverted: 'Move cancelled. The event is back where it was.',\n movedTo: (title, when) => `${title} moved to ${when}.`,\n },\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"en.js","names":[],"sources":["../../src/i18n/en.ts"],"sourcesContent":["/**\n * English, the dictionary always bundled. Any language without one of its own falls back\n * here entry by entry, so nothing is ever left unsaid.\n *\n * TRAP — these strings are asserted letter for letter by the unit tests, and the play\n * functions query controls BY them (they run with the default globals, so the locale there\n * is deterministically `en-US`). Changing a word means changing what expects it.\n */\n\nimport type { Messages } from './types'\n\nexport const en: Messages = {\n common: {\n loading: 'Loading…',\n clear: 'Clear',\n close: 'Close',\n dismiss: 'Remove',\n remove: (name) => `Remove ${name}`,\n cancel: 'Cancel',\n confirm: 'OK',\n },\n pagination: {\n label: 'Pagination',\n previous: 'Previous page',\n next: 'Next page',\n page: (page) => `Page ${page}`,\n },\n tabs: {\n label: 'Tabs',\n previous: 'Previous tabs',\n next: 'Next tabs',\n },\n breadcrumb: {\n label: 'Breadcrumb',\n ellipsis: 'Show intermediate pages',\n },\n sideNavigation: { label: 'Navigation' },\n combobox: {\n empty: 'No results',\n clear: 'Clear selection',\n },\n dataTable: {\n empty: 'No data',\n loading: 'Loading data…',\n searchLabel: 'Search the table',\n searchPlaceholder: 'Search…',\n perPage: 'Rows per page',\n perPageValue: (label, value) => `${label}: ${value}`,\n selectAll: 'Select all',\n selectRow: (index) => `Select row ${index}`,\n // The plural is chosen right here, in the message itself. That one line is the whole\n // of the design system's handling of plurals, and it is meant to be.\n selection: (count) => `${count} item${count === 1 ? '' : 's'} selected`,\n range: ({ start, end, total }) => `${start}–${end} of ${total}`,\n pagination: 'Table pagination',\n },\n toaster: { label: 'Notifications' },\n snackbar: { label: 'Confirmation', action: 'Undo' },\n inputOTP: {\n label: 'Verification code',\n slot: (index, total) => `Character ${index} of ${total}`,\n },\n slider: {\n value: 'Value',\n start: 'Start',\n end: 'End',\n rangeStart: (label) => `${label} (start)`,\n rangeEnd: (label) => `${label} (end)`,\n },\n field: {\n limitExceeded: (max) => `Exceeds the limit of ${max} characters`,\n },\n progress: { percent: (percent) => `${percent}%`, label: 'Progress' },\n hotkeys: {\n command: 'Command',\n ctrl: 'Ctrl',\n alt: 'Alt',\n shift: 'Shift',\n windows: 'Win',\n super: 'Super',\n enter: 'Enter',\n escape: 'Esc',\n space: 'Space',\n backspace: 'Backspace',\n delete: 'Del',\n tab: 'Tab',\n up: 'Up arrow',\n down: 'Down arrow',\n left: 'Left arrow',\n right: 'Right arrow',\n label: (keys) => `Keyboard shortcut: ${keys}`,\n },\n datePicker: {\n label: 'Date picker',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n monthPicker: 'Choose month',\n yearPicker: 'Choose year',\n },\n dateInput: {\n clear: 'Clear date',\n openPicker: 'Open calendar',\n pickerLabel: 'Choose a date',\n },\n timePicker: {\n label: 'Time picker',\n meridiem: 'AM or PM',\n am: 'AM',\n pm: 'PM',\n selectHour: 'Select hour',\n selectMinutes: 'Select minutes',\n choosingHour: 'Selecting the hour',\n choosingMinutes: 'Selecting the minutes',\n hour: 'Hour',\n minutes: 'Minutes',\n hourValue: (hour) => `${hour} o'clock`,\n minutesValue: (minute) => (minute === 1 ? '1 minute' : `${minute} minutes`),\n },\n timeInput: {\n clear: 'Clear time',\n openPicker: 'Open time picker',\n pickerLabel: 'Choose a time',\n meridiemValue: (value) => `AM or PM: ${value}`,\n maskPlaceholder: 'hh:mm',\n unavailable: 'This time is not available.',\n },\n fileInput: {\n openPicker: 'Choose files',\n clear: 'Clear files',\n files: (count) => `${count} file${count === 1 ? '' : 's'}`,\n placeholder: 'No file selected',\n },\n filePicker: {\n browse: 'Browse files',\n or: 'or',\n list: 'Selected files',\n },\n carousel: {\n label: 'Carousel',\n roleDescription: 'carousel',\n slideRoleDescription: 'slide',\n slides: 'Slides',\n slide: (index, total) => `${index} of ${total}`,\n previous: 'Previous slide',\n next: 'Next slide',\n indicators: 'Choose slide to display',\n },\n calendar: {\n label: 'Calendar',\n roleDescription: 'calendar',\n today: 'Today',\n view: 'View',\n viewDay: 'Day',\n view4Days: '4 days',\n viewWeek: 'Week',\n viewMonth: 'Month',\n viewYear: 'Year',\n viewCustom: (days) => `${days} days`,\n previousDay: 'Previous day',\n nextDay: 'Next day',\n previousWeek: 'Previous week',\n nextWeek: 'Next week',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n previousPeriod: 'Previous period',\n nextPeriod: 'Next period',\n allDay: 'All day',\n moreEvents: (count) => `+${count} more`,\n openDay: (day) => `Open ${day}`,\n untitled: '(No title)',\n eventRoleDescription: 'event',\n eventHint:\n 'Press Enter to open this event. Press Space to take hold of it, then the arrow keys to move it and Shift with the arrow keys to change when it ends.',\n grabbed:\n 'Event held. Use the arrow keys to move it, Enter or Space to place it, Escape to cancel.',\n dropped: 'Event placed.',\n reverted: 'Move cancelled. The event is back where it was.',\n movedTo: (title, when) => `${title} moved to ${when}.`,\n },\n}\n"],"mappings":"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"}
package/dist/i18n/fr.js CHANGED
@@ -21,7 +21,7 @@ var e = {
21
21
  next: "Onglets suivants"
22
22
  },
23
23
  breadcrumb: {
24
- label: "Fil d'Ariane",
24
+ label: "Fil d’Ariane",
25
25
  ellipsis: "Afficher les pages intermédiaires"
26
26
  },
27
27
  sideNavigation: { label: "Navigation" },
@@ -35,7 +35,7 @@ var e = {
35
35
  searchLabel: "Rechercher dans le tableau",
36
36
  searchPlaceholder: "Rechercher…",
37
37
  perPage: "Lignes par page",
38
- perPageValue: (e, t) => `${e} : ${t}`,
38
+ perPageValue: (e, t) => `${e}\u00A0: ${t}`,
39
39
  selectAll: "Tout sélectionner",
40
40
  selectRow: (e) => `Sélectionner la ligne ${e}`,
41
41
  selection: (e) => `${e} élément${e > 1 ? "s" : ""} sélectionné${e > 1 ? "s" : ""}`,
@@ -80,7 +80,7 @@ var e = {
80
80
  down: "Flèche bas",
81
81
  left: "Flèche gauche",
82
82
  right: "Flèche droite",
83
- label: (e) => `Raccourci clavier : ${e}`
83
+ label: (e) => `Raccourci clavier\u00A0: ${e}`
84
84
  },
85
85
  datePicker: {
86
86
  label: "Sélecteur de date",
@@ -89,7 +89,7 @@ var e = {
89
89
  previousYear: "Année précédente",
90
90
  nextYear: "Année suivante",
91
91
  monthPicker: "Choix du mois",
92
- yearPicker: "Choix de l'année"
92
+ yearPicker: "Choix de l’année"
93
93
  },
94
94
  dateInput: {
95
95
  clear: "Effacer la date",
@@ -97,7 +97,7 @@ var e = {
97
97
  pickerLabel: "Choisir une date"
98
98
  },
99
99
  timePicker: {
100
- label: "Sélecteur d'heure",
100
+ label: "Sélecteur d’heure",
101
101
  meridiem: "AM ou PM",
102
102
  am: "AM",
103
103
  pm: "PM",
@@ -107,16 +107,16 @@ var e = {
107
107
  choosingMinutes: "Sélection des minutes",
108
108
  hour: "Heure",
109
109
  minutes: "Minutes",
110
- hourValue: (e) => `${e} heures`,
111
- minutesValue: (e) => `${e} minutes`
110
+ hourValue: (e) => `${e} ${e < 2 ? "heure" : "heures"}`,
111
+ minutesValue: (e) => `${e} ${e < 2 ? "minute" : "minutes"}`
112
112
  },
113
113
  timeInput: {
114
- clear: "Effacer l'heure",
114
+ clear: "Effacer l’heure",
115
115
  openPicker: "Ouvrir le sélecteur d’heure",
116
116
  pickerLabel: "Choisir une heure",
117
- meridiemValue: (e) => `AM ou PM : ${e}`,
117
+ meridiemValue: (e) => `AM ou PM\u00A0: ${e}`,
118
118
  maskPlaceholder: "hh:mm",
119
- unavailable: "Cette heure n'est pas disponible."
119
+ unavailable: "Cette heure n’est pas disponible."
120
120
  },
121
121
  fileInput: {
122
122
  openPicker: "Choisir des fichiers",
@@ -142,7 +142,7 @@ var e = {
142
142
  calendar: {
143
143
  label: "Calendrier",
144
144
  roleDescription: "calendrier",
145
- today: "Aujourd'hui",
145
+ today: "Aujourd’hui",
146
146
  view: "Affichage",
147
147
  viewDay: "Jour",
148
148
  view4Days: "4 jours",
@@ -160,7 +160,7 @@ var e = {
160
160
  nextYear: "Année suivante",
161
161
  previousPeriod: "Période précédente",
162
162
  nextPeriod: "Période suivante",
163
- allDay: "Journée",
163
+ allDay: "Toute la journée",
164
164
  moreEvents: (e) => `+${e} autre${e > 1 ? "s" : ""}`,
165
165
  openDay: (e) => `Ouvrir le ${e}`,
166
166
  untitled: "(Sans titre)",
@@ -168,8 +168,8 @@ var e = {
168
168
  eventHint: "Appuyez sur Entrée pour ouvrir cet évènement. Appuyez sur Espace pour le saisir, puis sur les flèches pour le déplacer et sur Maj avec les flèches pour changer son heure de fin.",
169
169
  grabbed: "Évènement saisi. Utilisez les flèches pour le déplacer, Entrée ou Espace pour le poser, Échap pour annuler.",
170
170
  dropped: "Évènement posé.",
171
- reverted: "Déplacement annulé. L'évènement est revenu à sa place.",
172
- movedTo: (e, t) => `${e} déplacé au ${t}.`
171
+ reverted: "Déplacement annulé. L’évènement est revenu à sa place.",
172
+ movedTo: (e, t) => `Déplacement de ${e}\u00A0: ${t}.`
173
173
  }
174
174
  };
175
175
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"fr.js","names":[],"sources":["../../src/i18n/fr.ts"],"sourcesContent":["/**\n * French, opt-in by import: the package ships one module per file, so a project that never\n * imports this one never carries it.\n *\n * Enabling it and adding a language the library does not ship are the SAME gesture — there\n * are deliberately not two kinds of dictionary, one blessed and one hand-added:\n *\n * import { fr, registerMessages, setLocale } from 'vectis-ui'\n * registerMessages('fr', fr)\n * setLocale('fr-FR')\n *\n * TRAP — the curly apostrophes below are part of the text. Some tests assert these strings\n * letter for letter, and a straight apostrophe is a different character.\n */\n\nimport type { Messages } from './types'\n\nexport const fr: Messages = {\n common: {\n loading: 'Chargement…',\n clear: 'Effacer',\n close: 'Fermer',\n dismiss: 'Retirer',\n remove: (name) => `Retirer ${name}`,\n cancel: 'Annuler',\n confirm: 'OK',\n },\n pagination: {\n label: 'Pagination',\n previous: 'Page précédente',\n next: 'Page suivante',\n page: (page) => `Page ${page}`,\n },\n tabs: {\n label: 'Onglets',\n previous: 'Onglets précédents',\n next: 'Onglets suivants',\n },\n breadcrumb: {\n label: \"Fil d'Ariane\",\n ellipsis: 'Afficher les pages intermédiaires',\n },\n sideNavigation: { label: 'Navigation' },\n combobox: {\n empty: 'Aucun résultat',\n clear: 'Effacer la sélection',\n },\n dataTable: {\n empty: 'Aucune donnée',\n loading: 'Chargement des données…',\n searchLabel: 'Rechercher dans le tableau',\n searchPlaceholder: 'Rechercher…',\n perPage: 'Lignes par page',\n perPageValue: (label, value) => `${label} : ${value}`,\n selectAll: 'Tout sélectionner',\n selectRow: (index) => `Sélectionner la ligne ${index}`,\n selection: (count) =>\n `${count} élément${count > 1 ? 's' : ''} sélectionné${count > 1 ? 's' : ''}`,\n range: ({ start, end, total }) => `${start}–${end} sur ${total}`,\n pagination: 'Pagination du tableau',\n },\n toaster: { label: 'Notifications' },\n snackbar: { label: 'Confirmation', action: 'Annuler' },\n inputOTP: {\n label: 'Code de vérification',\n slot: (index, total) => `Caractère ${index} sur ${total}`,\n },\n slider: {\n value: 'Valeur',\n start: 'Début',\n end: 'Fin',\n rangeStart: (label) => `${label} (début)`,\n rangeEnd: (label) => `${label} (fin)`,\n },\n field: {\n limitExceeded: (max) => `Dépasse la limite de ${max} caractères`,\n },\n // The space before the sign is a NON-BREAKING one, as French typography requires and\n // English does not. It is written as an escape rather than typed in: the linter refuses\n // the character itself, and it would be indistinguishable from an ordinary space in a\n // review.\n progress: { percent: (percent) => `${percent}\\u00A0%`, label: 'Progression' },\n hotkeys: {\n command: 'Commande',\n ctrl: 'Ctrl',\n alt: 'Alt',\n shift: 'Maj',\n windows: 'Win',\n super: 'Super',\n enter: 'Entrée',\n escape: 'Échap',\n space: 'Espace',\n backspace: 'Retour arrière',\n delete: 'Suppr',\n tab: 'Tab',\n up: 'Flèche haut',\n down: 'Flèche bas',\n left: 'Flèche gauche',\n right: 'Flèche droite',\n label: (keys) => `Raccourci clavier : ${keys}`,\n },\n datePicker: {\n label: 'Sélecteur de date',\n previousMonth: 'Mois précédent',\n nextMonth: 'Mois suivant',\n previousYear: 'Année précédente',\n nextYear: 'Année suivante',\n monthPicker: 'Choix du mois',\n yearPicker: \"Choix de l'année\",\n },\n dateInput: {\n clear: 'Effacer la date',\n openPicker: 'Ouvrir le calendrier',\n pickerLabel: 'Choisir une date',\n },\n timePicker: {\n label: \"Sélecteur d'heure\",\n meridiem: 'AM ou PM',\n am: 'AM',\n pm: 'PM',\n selectHour: 'Sélectionner l’heure',\n selectMinutes: 'Sélectionner les minutes',\n choosingHour: 'Sélection de l’heure',\n choosingMinutes: 'Sélection des minutes',\n hour: 'Heure',\n minutes: 'Minutes',\n hourValue: (hour) => `${hour} heures`,\n minutesValue: (minute) => `${minute} minutes`,\n },\n timeInput: {\n clear: \"Effacer l'heure\",\n openPicker: 'Ouvrir le sélecteur d’heure',\n pickerLabel: 'Choisir une heure',\n meridiemValue: (value) => `AM ou PM : ${value}`,\n maskPlaceholder: 'hh:mm',\n unavailable: \"Cette heure n'est pas disponible.\",\n },\n fileInput: {\n openPicker: 'Choisir des fichiers',\n clear: 'Effacer les fichiers',\n // The French plural starts at two, the English one at zero — \"0 fichier\" against\n // \"0 files\". Each language therefore makes the choice on its own, and there is no\n // shared rule for either to inherit.\n files: (count) => `${count} fichier${count > 1 ? 's' : ''}`,\n placeholder: 'Aucun fichier sélectionné',\n },\n filePicker: {\n browse: 'Parcourir les fichiers',\n or: 'ou',\n list: 'Fichiers sélectionnés',\n },\n carousel: {\n label: 'Carrousel',\n roleDescription: 'carrousel',\n slideRoleDescription: 'diapositive',\n slides: 'Diapositives',\n slide: (index, total) => `${index} sur ${total}`,\n previous: 'Diapositive précédente',\n next: 'Diapositive suivante',\n indicators: 'Choisir la diapositive à afficher',\n },\n calendar: {\n label: 'Calendrier',\n roleDescription: 'calendrier',\n today: \"Aujourd'hui\",\n view: 'Affichage',\n viewDay: 'Jour',\n view4Days: '4 jours',\n viewWeek: 'Semaine',\n viewMonth: 'Mois',\n viewYear: 'Année',\n viewCustom: (days) => `${days} jours`,\n previousDay: 'Jour précédent',\n nextDay: 'Jour suivant',\n previousWeek: 'Semaine précédente',\n nextWeek: 'Semaine suivante',\n previousMonth: 'Mois précédent',\n nextMonth: 'Mois suivant',\n previousYear: 'Année précédente',\n nextYear: 'Année suivante',\n previousPeriod: 'Période précédente',\n nextPeriod: 'Période suivante',\n allDay: 'Journée',\n moreEvents: (count) => `+${count} autre${count > 1 ? 's' : ''}`,\n openDay: (day) => `Ouvrir le ${day}`,\n untitled: '(Sans titre)',\n eventRoleDescription: 'évènement',\n eventHint:\n 'Appuyez sur Entrée pour ouvrir cet évènement. Appuyez sur Espace pour le saisir, puis sur les flèches pour le déplacer et sur Maj avec les flèches pour changer son heure de fin.',\n grabbed:\n 'Évènement saisi. Utilisez les flèches pour le déplacer, Entrée ou Espace pour le poser, Échap pour annuler.',\n dropped: 'Évènement posé.',\n reverted: \"Déplacement annulé. L'évènement est revenu à sa place.\",\n movedTo: (title, when) => `${title} déplacé au ${when}.`,\n },\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"fr.js","names":[],"sources":["../../src/i18n/fr.ts"],"sourcesContent":["/**\n * French, opt-in by import: the package ships one module per file, so a project that never\n * imports this one never carries it.\n *\n * Enabling it and adding a language the library does not ship are the SAME gesture — there\n * are deliberately not two kinds of dictionary, one blessed and one hand-added:\n *\n * import { fr, registerMessages, setLocale } from 'vectis-ui'\n * registerMessages('fr', fr)\n * setLocale('fr-FR')\n *\n * TRAP — the curly apostrophes below are part of the text. Some tests assert these strings\n * letter for letter, and a straight apostrophe is a different character. The same goes for\n * the no-break space (`\\u00A0`) before a colon or a percent sign, which French typography\n * requires; `i18n.test.ts` checks both over the whole dictionary.\n */\n\nimport type { Messages } from './types'\n\nexport const fr: Messages = {\n common: {\n loading: 'Chargement…',\n clear: 'Effacer',\n close: 'Fermer',\n dismiss: 'Retirer',\n remove: (name) => `Retirer ${name}`,\n cancel: 'Annuler',\n confirm: 'OK',\n },\n pagination: {\n label: 'Pagination',\n previous: 'Page précédente',\n next: 'Page suivante',\n page: (page) => `Page ${page}`,\n },\n tabs: {\n label: 'Onglets',\n previous: 'Onglets précédents',\n next: 'Onglets suivants',\n },\n breadcrumb: {\n label: 'Fil d’Ariane',\n ellipsis: 'Afficher les pages intermédiaires',\n },\n sideNavigation: { label: 'Navigation' },\n combobox: {\n empty: 'Aucun résultat',\n clear: 'Effacer la sélection',\n },\n dataTable: {\n empty: 'Aucune donnée',\n loading: 'Chargement des données…',\n searchLabel: 'Rechercher dans le tableau',\n searchPlaceholder: 'Rechercher…',\n perPage: 'Lignes par page',\n perPageValue: (label, value) => `${label}\\u00A0: ${value}`,\n selectAll: 'Tout sélectionner',\n selectRow: (index) => `Sélectionner la ligne ${index}`,\n selection: (count) =>\n `${count} élément${count > 1 ? 's' : ''} sélectionné${count > 1 ? 's' : ''}`,\n range: ({ start, end, total }) => `${start}–${end} sur ${total}`,\n pagination: 'Pagination du tableau',\n },\n toaster: { label: 'Notifications' },\n snackbar: { label: 'Confirmation', action: 'Annuler' },\n inputOTP: {\n label: 'Code de vérification',\n slot: (index, total) => `Caractère ${index} sur ${total}`,\n },\n slider: {\n value: 'Valeur',\n start: 'Début',\n end: 'Fin',\n rangeStart: (label) => `${label} (début)`,\n rangeEnd: (label) => `${label} (fin)`,\n },\n field: {\n limitExceeded: (max) => `Dépasse la limite de ${max} caractères`,\n },\n // The space before the sign is a NON-BREAKING one, as French typography requires and\n // English does not. It is written as an escape rather than typed in: the linter refuses\n // the character itself, and it would be indistinguishable from an ordinary space in a\n // review.\n progress: { percent: (percent) => `${percent}\\u00A0%`, label: 'Progression' },\n hotkeys: {\n command: 'Commande',\n ctrl: 'Ctrl',\n alt: 'Alt',\n shift: 'Maj',\n windows: 'Win',\n super: 'Super',\n enter: 'Entrée',\n escape: 'Échap',\n space: 'Espace',\n backspace: 'Retour arrière',\n delete: 'Suppr',\n tab: 'Tab',\n up: 'Flèche haut',\n down: 'Flèche bas',\n left: 'Flèche gauche',\n right: 'Flèche droite',\n label: (keys) => `Raccourci clavier\\u00A0: ${keys}`,\n },\n datePicker: {\n label: 'Sélecteur de date',\n previousMonth: 'Mois précédent',\n nextMonth: 'Mois suivant',\n previousYear: 'Année précédente',\n nextYear: 'Année suivante',\n monthPicker: 'Choix du mois',\n yearPicker: 'Choix de l’année',\n },\n dateInput: {\n clear: 'Effacer la date',\n openPicker: 'Ouvrir le calendrier',\n pickerLabel: 'Choisir une date',\n },\n timePicker: {\n label: 'Sélecteur d’heure',\n meridiem: 'AM ou PM',\n am: 'AM',\n pm: 'PM',\n selectHour: 'Sélectionner l’heure',\n selectMinutes: 'Sélectionner les minutes',\n choosingHour: 'Sélection de l’heure',\n choosingMinutes: 'Sélection des minutes',\n hour: 'Heure',\n minutes: 'Minutes',\n // Singular below two, as French counts: 0 heure, 1 minute, 2 minutes.\n hourValue: (hour) => `${hour} ${hour < 2 ? 'heure' : 'heures'}`,\n minutesValue: (minute) => `${minute} ${minute < 2 ? 'minute' : 'minutes'}`,\n },\n timeInput: {\n clear: 'Effacer l’heure',\n openPicker: 'Ouvrir le sélecteur d’heure',\n pickerLabel: 'Choisir une heure',\n meridiemValue: (value) => `AM ou PM\\u00A0: ${value}`,\n maskPlaceholder: 'hh:mm',\n unavailable: 'Cette heure n’est pas disponible.',\n },\n fileInput: {\n openPicker: 'Choisir des fichiers',\n clear: 'Effacer les fichiers',\n // The French plural starts at two, the English one at zero — \"0 fichier\" against\n // \"0 files\". Each language therefore makes the choice on its own, and there is no\n // shared rule for either to inherit.\n files: (count) => `${count} fichier${count > 1 ? 's' : ''}`,\n placeholder: 'Aucun fichier sélectionné',\n },\n filePicker: {\n browse: 'Parcourir les fichiers',\n or: 'ou',\n list: 'Fichiers sélectionnés',\n },\n carousel: {\n label: 'Carrousel',\n roleDescription: 'carrousel',\n slideRoleDescription: 'diapositive',\n slides: 'Diapositives',\n slide: (index, total) => `${index} sur ${total}`,\n previous: 'Diapositive précédente',\n next: 'Diapositive suivante',\n indicators: 'Choisir la diapositive à afficher',\n },\n calendar: {\n label: 'Calendrier',\n roleDescription: 'calendrier',\n today: 'Aujourd’hui',\n view: 'Affichage',\n viewDay: 'Jour',\n view4Days: '4 jours',\n viewWeek: 'Semaine',\n viewMonth: 'Mois',\n viewYear: 'Année',\n viewCustom: (days) => `${days} jours`,\n previousDay: 'Jour précédent',\n nextDay: 'Jour suivant',\n previousWeek: 'Semaine précédente',\n nextWeek: 'Semaine suivante',\n previousMonth: 'Mois précédent',\n nextMonth: 'Mois suivant',\n previousYear: 'Année précédente',\n nextYear: 'Année suivante',\n previousPeriod: 'Période précédente',\n nextPeriod: 'Période suivante',\n allDay: 'Toute la journée',\n moreEvents: (count) => `+${count} autre${count > 1 ? 's' : ''}`,\n openDay: (day) => `Ouvrir le ${day}`,\n untitled: '(Sans titre)',\n eventRoleDescription: 'évènement',\n eventHint:\n 'Appuyez sur Entrée pour ouvrir cet évènement. Appuyez sur Espace pour le saisir, puis sur les flèches pour le déplacer et sur Maj avec les flèches pour changer son heure de fin.',\n grabbed:\n 'Évènement saisi. Utilisez les flèches pour le déplacer, Entrée ou Espace pour le poser, Échap pour annuler.',\n dropped: 'Évènement posé.',\n reverted: 'Déplacement annulé. L’évènement est revenu à sa place.',\n // A noun rather than a participle, which would agree with a title of any gender.\n movedTo: (title, when) => `Déplacement de ${title}\\u00A0: ${when}.`,\n },\n}\n"],"mappings":"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"}
@@ -5,37 +5,37 @@ export declare const DEFAULT_LOCALE = "en-US";
5
5
  /**
6
6
  * Chooses the locale the library speaks.
7
7
  *
8
- * Pass a COMPLETE tag — `fr-FR`, `en-GB`, `de-DE` — never a bare language, because it is put
8
+ * Pass a COMPLETE tag (`fr-FR`, `en-GB`, `de-DE`), never a bare language, because it is put
9
9
  * to two uses: it picks the dictionary, where only the subtag matters, and it is what the
10
10
  * calendar and the pickers hand to `Intl`, where the region matters a great deal. A bare
11
- * `en` resolves to no region in particular — a 12-hour clock and weeks starting on Sunday,
11
+ * `en` resolves to no region in particular: a 12-hour clock and weeks starting on Sunday,
12
12
  * which is not British English. Those components also take their own `locale`, which wins.
13
13
  *
14
- * Call it from a module — a Nuxt plugin, `main.ts` — never inside a `setup()`. On a server
14
+ * Call it from a module such as a Nuxt plugin or `main.ts`, never inside a `setup()`. On a server
15
15
  * the choice lives as long as the process, which is right for configuration and wrong for
16
16
  * anything belonging to one visitor; setting it client-only makes the server and the client
17
17
  * render different languages, and hydration then visibly fails to line up.
18
18
  */
19
19
  export declare function setLocale(locale: string): void;
20
20
  /**
21
- * Adds or adjusts the words of a LANGUAGE, filed under the subtag alone — `fr`, not `fr-FR`.
21
+ * Adds or adjusts the words of a LANGUAGE, filed under the subtag alone: `fr`, not `fr-FR`.
22
22
  *
23
23
  * The one way in, deliberately: enabling the French the library ships and adding a language
24
24
  * it does not ship are the SAME gesture.
25
25
  *
26
26
  * A partial dictionary is fine. What is left out falls back to whatever was registered
27
- * before, then to the English always carried — never to an empty string. Successive calls
27
+ * before, then to the English always carried, never to an empty string. Successive calls
28
28
  * for one language ADD UP, so registering `fr` then correcting one word keeps the rest.
29
29
  * Passing `undefined` removes the override and puts English back as it came.
30
30
  */
31
31
  export declare function registerMessages(lang: string, messages: MessagesInput | undefined): void;
32
32
  /**
33
- * The dictionary in force. Internal — components read it, it is not public API.
33
+ * The dictionary in force. Internal: components read it, it is not public API.
34
34
  *
35
35
  * It hands back the `shallowRef` rather than its contents, which is what makes components
36
36
  * ALREADY mounted re-render when `setLocale` is called later.
37
37
  *
38
- * TRAP — reading `.value.x` once in a `setup()` body FREEZES that word. Read it where the
38
+ * TRAP: reading `.value.x` once in a `setup()` body FREEZES that word. Read it where the
39
39
  * read repeats: inside a `computed`, or in the template.
40
40
  *
41
41
  * The composable shape is deliberate. The day a locale per subtree or per request is needed,
@@ -1,43 +1,52 @@
1
- import { en as e } from "./en.js";
2
- import { computed as t, shallowRef as n } from "vue";
1
+ import { isDev as e } from "../utils/env.js";
2
+ import { en as t } from "./en.js";
3
+ import { computed as n, shallowRef as r } from "vue";
3
4
  //#region src/i18n/state.ts
4
- var r = "en-US", i = "en", a = /* @__PURE__ */ new Map([[i, e]]), o = n(r), s = n(e);
5
- function c(e) {
5
+ var i = "en-US", a = "en", o = /* @__PURE__ */ new Map([[a, t]]), s = r(i), c = r(t);
6
+ function l(e) {
6
7
  return e.toLowerCase().split("-")[0] ?? e;
7
8
  }
8
- function l(t) {
9
- return a.get(c(t)) ?? a.get(i) ?? e;
9
+ function u(e) {
10
+ return o.get(l(e)) ?? o.get(a) ?? t;
10
11
  }
11
- var u = /* @__PURE__ */ new Set([
12
+ var d = /* @__PURE__ */ new Set([
12
13
  "__proto__",
13
14
  "constructor",
14
15
  "prototype"
15
16
  ]);
16
- function d(e, t) {
17
- let n = { ...e };
18
- for (let [e, r] of Object.entries(t)) u.has(e) || r && (n[e] = {
19
- ...n[e],
20
- ...r
21
- });
22
- return n;
23
- }
24
- function f(e) {
25
- c(e), o.value = e, s.value = l(e);
26
- }
27
- function p(t, n) {
28
- let r = c(t);
29
- n === void 0 ? r === i ? a.set(i, e) : a.delete(r) : a.set(r, d(a.get(r) ?? e, n)), s.value = l(o.value);
30
- }
31
- function m() {
32
- return s;
17
+ function f(t, n) {
18
+ let r = { ...t };
19
+ for (let [t, i] of Object.entries(n)) {
20
+ if (d.has(t) || !i) continue;
21
+ let n = Object.entries(i).filter(([n, r]) => {
22
+ let i = r == null || r === "";
23
+ return i && e && console.warn(`[vectis] registerMessages: “${t}.${n}” is empty and was ignored.`), !i;
24
+ });
25
+ r[t] = {
26
+ ...r[t],
27
+ ...Object.fromEntries(n)
28
+ };
29
+ }
30
+ return r;
31
+ }
32
+ function p(t) {
33
+ let n = l(t);
34
+ e && !o.has(n) && console.warn(`[vectis] No dictionary registered for “${n}”: the text stays in “${a}”. French is shipped — import { fr } from 'vectis-ui' then registerMessages('fr', fr). For another language: registerMessages('${n}', { … }).`), s.value = t, c.value = u(t);
35
+ }
36
+ function m(n, r) {
37
+ let i = l(n);
38
+ e && i !== n.toLowerCase() && console.warn(`[vectis] registerMessages('${n}', …): the expected key is a language subtag alone — registered under “${i}”, which covers all its regional variants.`), r === void 0 ? i === a ? o.set(a, t) : o.delete(i) : o.set(i, f(o.get(i) ?? t, r)), c.value = u(s.value);
33
39
  }
34
40
  function h() {
35
- return o;
41
+ return c;
42
+ }
43
+ function g() {
44
+ return s;
36
45
  }
37
- function g(e) {
38
- return t(() => e() ?? o.value);
46
+ function _(e) {
47
+ return n(() => e() || s.value);
39
48
  }
40
49
  //#endregion
41
- export { r as DEFAULT_LOCALE, p as registerMessages, f as setLocale, h as useLocale, m as useMessages, g as useResolvedLocale };
50
+ export { i as DEFAULT_LOCALE, m as registerMessages, p as setLocale, g as useLocale, h as useMessages, _ as useResolvedLocale };
42
51
 
43
52
  //# sourceMappingURL=state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","names":[],"sources":["../../src/i18n/state.ts"],"sourcesContent":["/**\n * The locale the library speaks and the words it says. No user-facing text is written in a\n * component; all of it comes from here.\n *\n * Module-level state rather than provide/inject, because this is CONFIGURATION: the same\n * for every visitor, and settable from any `.ts` — a plugin, an entry file — with no\n * component involved.\n *\n * ACCEPTED LIMIT — one locale per process. A single Node process serving /en and /fr cannot\n * let the two disagree here; it passes the text props explicitly instead. Lifting the limit\n * would change only the body of `useMessages` below, and no component at all.\n */\nimport { computed, shallowRef, type ComputedRef, type ShallowRef } from 'vue'\n\nimport { isDev } from '../utils/env'\n\nimport { en } from './en'\nimport type { Messages, MessagesInput } from './types'\n\n/** The language tag assumed until one is chosen. */\nexport const DEFAULT_LOCALE = 'en-US'\nconst DEFAULT_LANG = 'en'\n\n/**\n * The dictionaries, filed under the LANGUAGE subtag alone — `en`, `fr`, `de`. `en-GB` and\n * `en-US` share every word; what separates them (field order, first day of week, hour cycle)\n * comes from `Intl` on the full tag and is never a matter of translation.\n *\n * The Map is deliberately inert: what components track is `currentMessages` below, which is\n * recomputed whenever it changes.\n */\nconst registry = new Map<string, Messages>([[DEFAULT_LANG, en]])\n\nconst currentLocale = shallowRef<string>(DEFAULT_LOCALE)\nconst currentMessages = shallowRef<Messages>(en)\n\n/**\n * The language part of a tag: British English is filed under English. A tag that makes no\n * sense comes back untouched, and will simply match no dictionary.\n */\nfunction langOf(locale: string): string {\n return locale.toLowerCase().split('-')[0] ?? locale\n}\n\n/**\n * The dictionary a tag resolves to, falling back to the default language.\n *\n * The last `?? en` never fires: `registry` is seeded with `DEFAULT_LANG` and the only path\n * that could remove it — `registerMessages` passing `undefined` — puts `en` straight back\n * instead of deleting. It stays because `Map.get` is typed `T | undefined`, so the compiler\n * demands an exhaustive expression; the alternative is a non-null assertion, which would\n * hide the reasoning rather than record it. Do not read it as a live third case.\n */\nfunction resolve(locale: string): Messages {\n return registry.get(langOf(locale)) ?? registry.get(DEFAULT_LANG) ?? en\n}\n\n/** Names that would reach into an object's own machinery instead of naming a section. */\nconst FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype'])\n\n/**\n * Lays a partial override over a complete dictionary.\n *\n * Depth EXACTLY 2, which the dictionary's shape guarantees is enough: below a namespace\n * there are only leaves, a string or a function returning one. Nothing recurses, so a\n * FUNCTION can never be mistaken for an object and taken apart — which would leave `{}`\n * behind and a message that renders as nothing.\n */\nfunction mergeMessages(base: Messages, patch: MessagesInput): Messages {\n const out: Record<string, object> = { ...base }\n for (const [namespace, section] of Object.entries(patch)) {\n // A dictionary parsed from a file can carry one of these as a namespace, and assigning\n // to it would replace the copy's own machinery instead of adding a section. Nothing\n // outside is affected, the object being fresh — but every lookup in it is then wrong,\n // and nothing says so.\n if (FORBIDDEN_KEYS.has(namespace)) continue\n if (section) out[namespace] = { ...out[namespace], ...section }\n }\n return out as unknown as Messages\n}\n\n/**\n * Chooses the locale the library speaks.\n *\n * Pass a COMPLETE tag — `fr-FR`, `en-GB`, `de-DE` — never a bare language, because it is put\n * to two uses: it picks the dictionary, where only the subtag matters, and it is what the\n * calendar and the pickers hand to `Intl`, where the region matters a great deal. A bare\n * `en` resolves to no region in particular — a 12-hour clock and weeks starting on Sunday,\n * which is not British English. Those components also take their own `locale`, which wins.\n *\n * Call it from a module — a Nuxt plugin, `main.ts` — never inside a `setup()`. On a server\n * the choice lives as long as the process, which is right for configuration and wrong for\n * anything belonging to one visitor; setting it client-only makes the server and the client\n * render different languages, and hydration then visibly fails to line up.\n */\nexport function setLocale(locale: string): void {\n const lang = langOf(locale)\n if (isDev && !registry.has(lang)) {\n console.warn(\n `[vectis] No dictionary registered for “${lang}”: the text stays in ` +\n `“${DEFAULT_LANG}”. French is shipped — import { fr } from 'vectis-ui' then ` +\n `registerMessages('fr', fr). For another language: registerMessages('${lang}', { … }).`,\n )\n }\n currentLocale.value = locale\n currentMessages.value = resolve(locale)\n}\n\n/**\n * Adds or adjusts the words of a LANGUAGE, filed under the subtag alone — `fr`, not `fr-FR`.\n *\n * The one way in, deliberately: enabling the French the library ships and adding a language\n * it does not ship are the SAME gesture.\n *\n * A partial dictionary is fine. What is left out falls back to whatever was registered\n * before, then to the English always carried — never to an empty string. Successive calls\n * for one language ADD UP, so registering `fr` then correcting one word keeps the rest.\n * Passing `undefined` removes the override and puts English back as it came.\n */\nexport function registerMessages(lang: string, messages: MessagesInput | undefined): void {\n const key = langOf(lang)\n if (isDev && key !== lang.toLowerCase()) {\n console.warn(\n `[vectis] registerMessages('${lang}', …): the expected key is a language subtag ` +\n `alone — registered under “${key}”, which covers all its regional variants.`,\n )\n }\n if (messages === undefined) {\n if (key === DEFAULT_LANG) registry.set(DEFAULT_LANG, en)\n else registry.delete(key)\n } else {\n registry.set(key, mergeMessages(registry.get(key) ?? en, messages))\n }\n currentMessages.value = resolve(currentLocale.value)\n}\n\n/**\n * The dictionary in force. Internal — components read it, it is not public API.\n *\n * It hands back the `shallowRef` rather than its contents, which is what makes components\n * ALREADY mounted re-render when `setLocale` is called later.\n *\n * TRAP — reading `.value.x` once in a `setup()` body FREEZES that word. Read it where the\n * read repeats: inside a `computed`, or in the template.\n *\n * The composable shape is deliberate. The day a locale per subtree or per request is needed,\n * only this BODY becomes `inject(messagesKey, null) ?? currentMessages` and no component is\n * touched. It also stays callable outside a component, since all it does is return a ref;\n * a version that looked up the tree would need a `getCurrentInstance()` guard.\n */\nexport function useMessages(): ShallowRef<Messages> {\n return currentMessages\n}\n\n/**\n * The locale tag in force. Internal: what the calendar and the pickers fall back on with no\n * `locale` of their own, and what VDataTable passes to `localeCompare` when it sorts.\n */\nexport function useLocale(): ShallowRef<string> {\n return currentLocale\n}\n\n/**\n * The locale a component with a `locale` prop of its own actually uses: the prop when it is\n * given, the locale in force otherwise. Internal, like the two above.\n *\n * The prop has no literal default in any of the components that read it, and that is what\n * this relies on: `undefined` is the \"not given\" that lets the global locale have its\n * chance. Every read of the language inside such a component goes through the one computed\n * returned here, so the two sources are never consulted in a different order somewhere else.\n */\nexport function useResolvedLocale(locale: () => string | undefined): ComputedRef<string> {\n return computed(() => locale() ?? currentLocale.value)\n}\n"],"mappings":";;;AAoBA,IAAa,IAAiB,SACxB,IAAe,MAUf,oBAAW,IAAI,IAAsB,CAAC,CAAC,GAAc,CAAE,CAAC,CAAC,GAEzD,IAAgB,EAAmB,CAAc,GACjD,IAAkB,EAAqB,CAAE;AAM/C,SAAS,EAAO,GAAwB;CACtC,OAAO,EAAO,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM;AAC/C;AAWA,SAAS,EAAQ,GAA0B;CACzC,OAAO,EAAS,IAAI,EAAO,CAAM,CAAC,KAAK,EAAS,IAAI,CAAY,KAAK;AACvE;AAGA,IAAM,oBAAiB,IAAI,IAAI;CAAC;CAAa;CAAe;AAAW,CAAC;AAUxE,SAAS,EAAc,GAAgB,GAAgC;CACrE,IAAM,IAA8B,EAAE,GAAG,EAAK;CAC9C,KAAK,IAAM,CAAC,GAAW,MAAY,OAAO,QAAQ,CAAK,GAKjD,EAAe,IAAI,CAAS,KAC5B,MAAS,EAAI,KAAa;EAAE,GAAG,EAAI;EAAY,GAAG;CAAQ;CAEhE,OAAO;AACT;AAgBA,SAAgB,EAAU,GAAsB;CAU9C,AATa,EAAO,CAAM,GAQ1B,EAAc,QAAQ,GACtB,EAAgB,QAAQ,EAAQ,CAAM;AACxC;AAaA,SAAgB,EAAiB,GAAc,GAA2C;CACxF,IAAM,IAAM,EAAO,CAAI;CAavB,AANI,MAAa,KAAA,IACX,MAAQ,IAAc,EAAS,IAAI,GAAc,CAAE,IAClD,EAAS,OAAO,CAAG,IAExB,EAAS,IAAI,GAAK,EAAc,EAAS,IAAI,CAAG,KAAK,GAAI,CAAQ,CAAC,GAEpE,EAAgB,QAAQ,EAAQ,EAAc,KAAK;AACrD;AAgBA,SAAgB,IAAoC;CAClD,OAAO;AACT;AAMA,SAAgB,IAAgC;CAC9C,OAAO;AACT;AAWA,SAAgB,EAAkB,GAAuD;CACvF,OAAO,QAAe,EAAO,KAAK,EAAc,KAAK;AACvD"}
1
+ {"version":3,"file":"state.js","names":[],"sources":["../../src/i18n/state.ts"],"sourcesContent":["/**\n * The locale the library speaks and the words it says. No user-facing text is written in a\n * component; all of it comes from here.\n *\n * Module-level state rather than provide/inject, because this is CONFIGURATION: the same\n * for every visitor, and settable from any `.ts` — a plugin, an entry file — with no\n * component involved.\n *\n * ACCEPTED LIMIT — one locale per process. A single Node process serving /en and /fr cannot\n * let the two disagree here; it passes the text props explicitly instead. Lifting the limit\n * would change only the body of `useMessages` below, and no component at all.\n */\nimport { computed, shallowRef, type ComputedRef, type ShallowRef } from 'vue'\n\nimport { isDev } from '../utils/env'\n\nimport { en } from './en'\nimport type { Messages, MessagesInput } from './types'\n\n/** The language tag assumed until one is chosen. */\nexport const DEFAULT_LOCALE = 'en-US'\nconst DEFAULT_LANG = 'en'\n\n/**\n * The dictionaries, filed under the LANGUAGE subtag alone — `en`, `fr`, `de`. `en-GB` and\n * `en-US` share every word; what separates them (field order, first day of week, hour cycle)\n * comes from `Intl` on the full tag and is never a matter of translation.\n *\n * The Map is deliberately inert: what components track is `currentMessages` below, which is\n * recomputed whenever it changes.\n */\nconst registry = new Map<string, Messages>([[DEFAULT_LANG, en]])\n\nconst currentLocale = shallowRef<string>(DEFAULT_LOCALE)\nconst currentMessages = shallowRef<Messages>(en)\n\n/**\n * The language part of a tag: British English is filed under English. A tag that makes no\n * sense comes back untouched, and will simply match no dictionary.\n */\nfunction langOf(locale: string): string {\n return locale.toLowerCase().split('-')[0] ?? locale\n}\n\n/**\n * The dictionary a tag resolves to, falling back to the default language.\n *\n * The last `?? en` never fires: `registry` is seeded with `DEFAULT_LANG` and the only path\n * that could remove it — `registerMessages` passing `undefined` — puts `en` straight back\n * instead of deleting. It stays because `Map.get` is typed `T | undefined`, so the compiler\n * demands an exhaustive expression; the alternative is a non-null assertion, which would\n * hide the reasoning rather than record it. Do not read it as a live third case.\n */\nfunction resolve(locale: string): Messages {\n return registry.get(langOf(locale)) ?? registry.get(DEFAULT_LANG) ?? en\n}\n\n/** Names that would reach into an object's own machinery instead of naming a section. */\nconst FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype'])\n\n/**\n * Lays a partial override over a complete dictionary.\n *\n * Depth EXACTLY 2, which the dictionary's shape guarantees is enough: below a namespace\n * there are only leaves, a string or a function returning one. Nothing recurses, so a\n * FUNCTION can never be mistaken for an object and taken apart — which would leave `{}`\n * behind and a message that renders as nothing.\n */\nfunction mergeMessages(base: Messages, patch: MessagesInput): Messages {\n const out: Record<string, object> = { ...base }\n for (const [namespace, section] of Object.entries(patch)) {\n // A dictionary parsed from a file can carry one of these as a namespace, and assigning\n // to it would replace the copy's own machinery instead of adding a section. Nothing\n // outside is affected, the object being fresh — but every lookup in it is then wrong,\n // and nothing says so.\n if (FORBIDDEN_KEYS.has(namespace)) continue\n if (!section) continue\n /*\n * A leaf with no word in it is left out, so the one underneath stays. A dictionary read\n * from JSON can carry a `null`, and one built with `x ?? undefined` an `undefined`:\n * spread as they stood, they replaced the English and a control was named by nothing.\n */\n const words = Object.entries(section).filter(([key, value]) => {\n const empty = value === undefined || value === null || value === ''\n if (empty && isDev) {\n console.warn(`[vectis] registerMessages: “${namespace}.${key}” is empty and was ignored.`)\n }\n return !empty\n })\n out[namespace] = { ...out[namespace], ...Object.fromEntries(words) }\n }\n return out as unknown as Messages\n}\n\n/**\n * Chooses the locale the library speaks.\n *\n * Pass a COMPLETE tag (`fr-FR`, `en-GB`, `de-DE`), never a bare language, because it is put\n * to two uses: it picks the dictionary, where only the subtag matters, and it is what the\n * calendar and the pickers hand to `Intl`, where the region matters a great deal. A bare\n * `en` resolves to no region in particular: a 12-hour clock and weeks starting on Sunday,\n * which is not British English. Those components also take their own `locale`, which wins.\n *\n * Call it from a module such as a Nuxt plugin or `main.ts`, never inside a `setup()`. On a server\n * the choice lives as long as the process, which is right for configuration and wrong for\n * anything belonging to one visitor; setting it client-only makes the server and the client\n * render different languages, and hydration then visibly fails to line up.\n */\nexport function setLocale(locale: string): void {\n const lang = langOf(locale)\n if (isDev && !registry.has(lang)) {\n console.warn(\n `[vectis] No dictionary registered for “${lang}”: the text stays in ` +\n `“${DEFAULT_LANG}”. French is shipped — import { fr } from 'vectis-ui' then ` +\n `registerMessages('fr', fr). For another language: registerMessages('${lang}', { … }).`,\n )\n }\n currentLocale.value = locale\n currentMessages.value = resolve(locale)\n}\n\n/**\n * Adds or adjusts the words of a LANGUAGE, filed under the subtag alone: `fr`, not `fr-FR`.\n *\n * The one way in, deliberately: enabling the French the library ships and adding a language\n * it does not ship are the SAME gesture.\n *\n * A partial dictionary is fine. What is left out falls back to whatever was registered\n * before, then to the English always carried, never to an empty string. Successive calls\n * for one language ADD UP, so registering `fr` then correcting one word keeps the rest.\n * Passing `undefined` removes the override and puts English back as it came.\n */\nexport function registerMessages(lang: string, messages: MessagesInput | undefined): void {\n const key = langOf(lang)\n if (isDev && key !== lang.toLowerCase()) {\n console.warn(\n `[vectis] registerMessages('${lang}', …): the expected key is a language subtag ` +\n `alone — registered under “${key}”, which covers all its regional variants.`,\n )\n }\n if (messages === undefined) {\n if (key === DEFAULT_LANG) registry.set(DEFAULT_LANG, en)\n else registry.delete(key)\n } else {\n registry.set(key, mergeMessages(registry.get(key) ?? en, messages))\n }\n currentMessages.value = resolve(currentLocale.value)\n}\n\n/**\n * The dictionary in force. Internal: components read it, it is not public API.\n *\n * It hands back the `shallowRef` rather than its contents, which is what makes components\n * ALREADY mounted re-render when `setLocale` is called later.\n *\n * TRAP: reading `.value.x` once in a `setup()` body FREEZES that word. Read it where the\n * read repeats: inside a `computed`, or in the template.\n *\n * The composable shape is deliberate. The day a locale per subtree or per request is needed,\n * only this BODY becomes `inject(messagesKey, null) ?? currentMessages` and no component is\n * touched. It also stays callable outside a component, since all it does is return a ref;\n * a version that looked up the tree would need a `getCurrentInstance()` guard.\n */\nexport function useMessages(): ShallowRef<Messages> {\n return currentMessages\n}\n\n/**\n * The locale tag in force. Internal: what the calendar and the pickers fall back on with no\n * `locale` of their own, and what VDataTable passes to `localeCompare` when it sorts.\n */\nexport function useLocale(): ShallowRef<string> {\n return currentLocale\n}\n\n/**\n * The locale a component with a `locale` prop of its own actually uses: the prop when it is\n * given, the locale in force otherwise. Internal, like the two above.\n *\n * The prop has no literal default in any of the components that read it, and that is what\n * this relies on: `undefined` is the \"not given\" that lets the global locale have its\n * chance. Every read of the language inside such a component goes through the one computed\n * returned here, so the two sources are never consulted in a different order somewhere else.\n */\nexport function useResolvedLocale(locale: () => string | undefined): ComputedRef<string> {\n // An empty tag is no tag: handed to `Intl` as it stands, it throws a RangeError.\n return computed(() => locale() || currentLocale.value)\n}\n"],"mappings":";;;;AAoBA,IAAa,IAAiB,SACxB,IAAe,MAUf,oBAAW,IAAI,IAAsB,CAAC,CAAC,GAAc,CAAE,CAAC,CAAC,GAEzD,IAAgB,EAAmB,CAAc,GACjD,IAAkB,EAAqB,CAAE;AAM/C,SAAS,EAAO,GAAwB;CACtC,OAAO,EAAO,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM;AAC/C;AAWA,SAAS,EAAQ,GAA0B;CACzC,OAAO,EAAS,IAAI,EAAO,CAAM,CAAC,KAAK,EAAS,IAAI,CAAY,KAAK;AACvE;AAGA,IAAM,oBAAiB,IAAI,IAAI;CAAC;CAAa;CAAe;AAAW,CAAC;AAUxE,SAAS,EAAc,GAAgB,GAAgC;CACrE,IAAM,IAA8B,EAAE,GAAG,EAAK;CAC9C,KAAK,IAAM,CAAC,GAAW,MAAY,OAAO,QAAQ,CAAK,GAAG;EAMxD,IADI,EAAe,IAAI,CAAS,KAC5B,CAAC,GAAS;EAMd,IAAM,IAAQ,OAAO,QAAQ,CAAO,CAAC,CAAC,QAAQ,CAAC,GAAK,OAAW;GAC7D,IAAM,IAAQ,KAAiC,QAAQ,MAAU;GAIjE,OAHI,KAAS,KACX,QAAQ,KAAK,+BAA+B,EAAU,GAAG,EAAI,4BAA4B,GAEpF,CAAC;EACV,CAAC;EACD,EAAI,KAAa;GAAE,GAAG,EAAI;GAAY,GAAG,OAAO,YAAY,CAAK;EAAE;CACrE;CACA,OAAO;AACT;AAgBA,SAAgB,EAAU,GAAsB;CAC9C,IAAM,IAAO,EAAO,CAAM;CAS1B,AARI,KAAS,CAAC,EAAS,IAAI,CAAI,KAC7B,QAAQ,KACN,0CAA0C,EAAK,wBACzC,EAAa,iIACsD,EAAK,WAChF,GAEF,EAAc,QAAQ,GACtB,EAAgB,QAAQ,EAAQ,CAAM;AACxC;AAaA,SAAgB,EAAiB,GAAc,GAA2C;CACxF,IAAM,IAAM,EAAO,CAAI;CAavB,AAZI,KAAS,MAAQ,EAAK,YAAY,KACpC,QAAQ,KACN,8BAA8B,EAAK,yEACJ,EAAI,2CACrC,GAEE,MAAa,KAAA,IACX,MAAQ,IAAc,EAAS,IAAI,GAAc,CAAE,IAClD,EAAS,OAAO,CAAG,IAExB,EAAS,IAAI,GAAK,EAAc,EAAS,IAAI,CAAG,KAAK,GAAI,CAAQ,CAAC,GAEpE,EAAgB,QAAQ,EAAQ,EAAc,KAAK;AACrD;AAgBA,SAAgB,IAAoC;CAClD,OAAO;AACT;AAMA,SAAgB,IAAgC;CAC9C,OAAO;AACT;AAWA,SAAgB,EAAkB,GAAuD;CAEvF,OAAO,QAAe,EAAO,KAAK,EAAc,KAAK;AACvD"}