vectis-ui 0.1.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (475) hide show
  1. package/README.md +40 -6
  2. package/dist/components/VAccordion/VAccordion.css +1 -1
  3. package/dist/components/VAccordion/VAccordion.d.ts +9 -16
  4. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
  6. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
  9. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  10. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
  11. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VAccordion/context.d.ts +1 -8
  13. package/dist/components/VAccordion/context.js.map +1 -1
  14. package/dist/components/VAvatar/VAvatar.css +1 -1
  15. package/dist/components/VAvatar/VAvatar.d.ts +44 -29
  16. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  17. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
  18. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
  20. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  21. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
  22. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/VAvatar/context.d.ts +6 -10
  24. package/dist/components/VAvatar/context.js.map +1 -1
  25. package/dist/components/VBadge/VBadge.css +1 -1
  26. package/dist/components/VBadge/VBadge.d.ts +31 -10
  27. package/dist/components/VBadge/VBadge.js.map +1 -1
  28. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
  29. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
  31. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
  32. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  33. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
  34. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VButton/VButton.css +1 -1
  36. package/dist/components/VButton/VButton.d.ts +30 -10
  37. package/dist/components/VButton/VButton.js.map +1 -1
  38. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
  39. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VButton/VButtonGroup.css +1 -1
  41. package/dist/components/VButton/VButtonGroup.d.ts +76 -13
  42. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  43. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
  44. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/VButton/context.d.ts +30 -0
  46. package/dist/components/VButton/context.js +6 -0
  47. package/dist/components/VButton/context.js.map +1 -0
  48. package/dist/components/VCalendar/VCalendar.css +1 -1
  49. package/dist/components/VCalendar/VCalendar.d.ts +50 -36
  50. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  51. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
  52. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  54. package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
  55. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  56. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
  57. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  59. package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
  60. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  61. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
  62. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  64. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
  65. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  66. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
  67. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  69. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  70. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
  71. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/VCalendar/gesture.d.ts +158 -0
  73. package/dist/components/VCalendar/gesture.js +170 -0
  74. package/dist/components/VCalendar/gesture.js.map +1 -0
  75. package/dist/components/VCalendar/keyboard.d.ts +9 -3
  76. package/dist/components/VCalendar/keyboard.js +2 -6
  77. package/dist/components/VCalendar/keyboard.js.map +1 -1
  78. package/dist/components/VCalendar/layout.d.ts +67 -54
  79. package/dist/components/VCalendar/layout.js +77 -69
  80. package/dist/components/VCalendar/layout.js.map +1 -1
  81. package/dist/components/VCalendar/timeGrid.d.ts +55 -0
  82. package/dist/components/VCalendar/timeGrid.js +71 -0
  83. package/dist/components/VCalendar/timeGrid.js.map +1 -0
  84. package/dist/components/VCalendar/types.d.ts +41 -16
  85. package/dist/components/VCarousel/VCarousel.css +1 -1
  86. package/dist/components/VCarousel/VCarousel.d.ts +21 -41
  87. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  88. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
  89. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
  91. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  92. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/VCarousel/context.d.ts +0 -12
  94. package/dist/components/VCarousel/context.js.map +1 -1
  95. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  96. package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
  97. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  98. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
  99. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/VChip/VChip.css +1 -1
  101. package/dist/components/VChip/VChip.d.ts +36 -26
  102. package/dist/components/VChip/VChip.js.map +1 -1
  103. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
  104. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/VCombobox/VCombobox.css +1 -1
  106. package/dist/components/VCombobox/VCombobox.d.ts +127 -31
  107. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  108. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
  109. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  111. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
  112. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  113. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  114. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/VCombobox/VComboboxOption.css +1 -1
  116. package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
  117. package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
  118. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
  119. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
  121. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  123. package/dist/components/VDataTable/VDataTable.css +1 -1
  124. package/dist/components/VDataTable/VDataTable.d.ts +50 -28
  125. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  126. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
  127. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/components/VDateInput/VDateInput.css +1 -1
  129. package/dist/components/VDateInput/VDateInput.d.ts +90 -42
  130. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  131. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
  132. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  134. package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
  135. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  136. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
  137. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/components/VDialog/VDialog.css +1 -1
  139. package/dist/components/VDialog/VDialog.d.ts +45 -33
  140. package/dist/components/VDialog/VDialog.js.map +1 -1
  141. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
  142. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
  144. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  145. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
  146. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  147. package/dist/components/VFileInput/VFileInput.css +1 -1
  148. package/dist/components/VFileInput/VFileInput.d.ts +78 -26
  149. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  150. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
  151. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  153. package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
  154. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  155. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
  156. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/components/VFilePicker/fileKind.d.ts +2 -27
  158. package/dist/components/VFilePicker/fileKind.js +9 -8
  159. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  160. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  161. package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
  162. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  163. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
  164. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/VHotkeys/platform.js.map +1 -1
  166. package/dist/components/VIcon/VIcon.css +1 -1
  167. package/dist/components/VIcon/VIcon.d.ts +15 -6
  168. package/dist/components/VIcon/VIcon.js.map +1 -1
  169. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
  170. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/VIcon/iconProps.js.map +1 -1
  172. package/dist/components/VIcon/icons/index.d.ts +1 -1
  173. package/dist/components/VIcon/icons/index.js.map +1 -1
  174. package/dist/components/VIcon/icons/names.d.ts +1 -1
  175. package/dist/components/VIcon/icons/names.js.map +1 -1
  176. package/dist/components/VIcon/resolver.d.ts +3 -3
  177. package/dist/components/VIcon/resolver.js.map +1 -1
  178. package/dist/components/VIcon/types.d.ts +12 -12
  179. package/dist/components/VIconButton/VIconButton.css +1 -1
  180. package/dist/components/VIconButton/VIconButton.d.ts +28 -11
  181. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  182. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
  183. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/VInput/VInput.css +1 -1
  185. package/dist/components/VInput/VInput.d.ts +26 -7
  186. package/dist/components/VInput/VInput.js.map +1 -1
  187. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
  188. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/components/VInput/VInputGroup.css +2 -0
  190. package/dist/components/VInput/VInputGroup.d.ts +47 -0
  191. package/dist/components/VInput/VInputGroup.js +9 -0
  192. package/dist/components/VInput/VInputGroup.js.map +1 -0
  193. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
  194. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  195. package/dist/components/VInput/context.d.ts +11 -0
  196. package/dist/components/VInput/context.js +6 -0
  197. package/dist/components/VInput/context.js.map +1 -0
  198. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  199. package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
  200. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  201. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
  202. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/VMenu/VMenu.d.ts +23 -30
  204. package/dist/components/VMenu/VMenu.js.map +1 -1
  205. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
  206. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/VMenu/VMenuGroup.css +1 -1
  208. package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
  209. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  210. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
  211. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VMenu/VMenuItem.css +1 -1
  213. package/dist/components/VMenu/VMenuItem.d.ts +11 -19
  214. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  215. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
  216. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  217. package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
  218. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  219. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
  220. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  221. package/dist/components/VMenu/context.d.ts +2 -6
  222. package/dist/components/VMenu/context.js.map +1 -1
  223. package/dist/components/VPagination/VPagination.css +1 -1
  224. package/dist/components/VPagination/VPagination.d.ts +60 -22
  225. package/dist/components/VPagination/VPagination.js.map +1 -1
  226. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
  227. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VPopover/VPopover.css +1 -1
  229. package/dist/components/VPopover/VPopover.d.ts +26 -7
  230. package/dist/components/VPopover/VPopover.js.map +1 -1
  231. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
  232. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  234. package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
  235. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  236. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
  237. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  239. package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
  240. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  241. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
  242. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  243. package/dist/components/VRadio/VRadio.css +1 -1
  244. package/dist/components/VRadio/VRadio.d.ts +36 -18
  245. package/dist/components/VRadio/VRadio.js.map +1 -1
  246. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
  247. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  248. package/dist/components/VSeparator/VSeparator.d.ts +4 -2
  249. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  250. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  251. package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
  252. package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
  253. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  254. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
  255. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  257. package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
  258. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  259. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  260. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  261. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  262. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
  263. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  264. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
  265. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/components/VSideNavigation/context.d.ts +0 -14
  267. package/dist/components/VSideNavigation/context.js.map +1 -1
  268. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  269. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
  270. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  271. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/components/VSlider/VSlider.css +1 -1
  273. package/dist/components/VSlider/VSlider.d.ts +52 -27
  274. package/dist/components/VSlider/VSlider.js.map +1 -1
  275. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
  276. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  277. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  278. package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
  279. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  280. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
  281. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/components/VSnackbar/state.d.ts +0 -27
  283. package/dist/components/VSnackbar/state.js.map +1 -1
  284. package/dist/components/VSpinner/VSpinner.css +1 -1
  285. package/dist/components/VSpinner/VSpinner.d.ts +6 -6
  286. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  287. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
  288. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VSwitch/VSwitch.css +1 -1
  290. package/dist/components/VSwitch/VSwitch.d.ts +35 -13
  291. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  292. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
  293. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  294. package/dist/components/VTabs/VTab.css +1 -1
  295. package/dist/components/VTabs/VTab.d.ts +12 -12
  296. package/dist/components/VTabs/VTab.js.map +1 -1
  297. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
  298. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  299. package/dist/components/VTabs/VTabPanel.d.ts +2 -10
  300. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  301. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
  302. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/components/VTabs/VTabs.css +1 -1
  304. package/dist/components/VTabs/VTabs.d.ts +27 -18
  305. package/dist/components/VTabs/VTabs.js.map +1 -1
  306. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
  307. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/components/VTabs/context.d.ts +9 -19
  309. package/dist/components/VTabs/context.js +1 -1
  310. package/dist/components/VTabs/context.js.map +1 -1
  311. package/dist/components/VTextarea/VTextarea.css +1 -1
  312. package/dist/components/VTextarea/VTextarea.d.ts +34 -6
  313. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  314. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
  315. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  317. package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
  318. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  319. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
  320. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  321. package/dist/components/VTimeInput/search.d.ts +24 -0
  322. package/dist/components/VTimeInput/search.js +22 -0
  323. package/dist/components/VTimeInput/search.js.map +1 -0
  324. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  325. package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
  326. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  327. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
  328. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  329. package/dist/components/VTimePicker/limits.d.ts +88 -0
  330. package/dist/components/VTimePicker/limits.js +70 -0
  331. package/dist/components/VTimePicker/limits.js.map +1 -0
  332. package/dist/components/VToast/VToast.css +1 -1
  333. package/dist/components/VToast/VToast.d.ts +0 -10
  334. package/dist/components/VToast/VToast.js.map +1 -1
  335. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
  336. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/components/VToast/VToaster.css +1 -1
  338. package/dist/components/VToast/VToaster.d.ts +0 -17
  339. package/dist/components/VToast/VToaster.js.map +1 -1
  340. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
  341. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VToast/state.d.ts +10 -19
  343. package/dist/components/VToast/state.js +1 -1
  344. package/dist/components/VToast/state.js.map +1 -1
  345. package/dist/components/VToggle/VToggle.css +1 -1
  346. package/dist/components/VToggle/VToggle.d.ts +56 -11
  347. package/dist/components/VToggle/VToggle.js.map +1 -1
  348. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
  349. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/components/VToggle/VToggleItem.d.ts +16 -2
  351. package/dist/components/VToggle/VToggleItem.js +0 -2
  352. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  353. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
  354. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/components/VToggle/context.d.ts +4 -24
  356. package/dist/components/VToggle/context.js.map +1 -1
  357. package/dist/components/VTooltip/VTooltip.css +1 -1
  358. package/dist/components/VTooltip/VTooltip.d.ts +9 -33
  359. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  360. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
  361. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/dist/components/VTypography/VTypography.js.map +1 -1
  363. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  364. package/dist/composables/useAriaLabel.d.ts +0 -17
  365. package/dist/composables/useAriaLabel.js.map +1 -1
  366. package/dist/composables/useClearable.d.ts +42 -0
  367. package/dist/composables/useClearable.js +19 -0
  368. package/dist/composables/useClearable.js.map +1 -0
  369. package/dist/composables/useControlShape.d.ts +22 -0
  370. package/dist/composables/useControlShape.js +13 -0
  371. package/dist/composables/useControlShape.js.map +1 -0
  372. package/dist/composables/useDetailsOpen.d.ts +22 -0
  373. package/dist/composables/useDetailsOpen.js +21 -0
  374. package/dist/composables/useDetailsOpen.js.map +1 -0
  375. package/dist/composables/useFieldIds.d.ts +0 -15
  376. package/dist/composables/useFieldIds.js +8 -7
  377. package/dist/composables/useFieldIds.js.map +1 -1
  378. package/dist/composables/useFieldPanel.d.ts +21 -18
  379. package/dist/composables/useFieldPanel.js +43 -23
  380. package/dist/composables/useFieldPanel.js.map +1 -1
  381. package/dist/composables/useFileDrop.d.ts +0 -22
  382. package/dist/composables/useFileDrop.js.map +1 -1
  383. package/dist/composables/useFileField.d.ts +45 -17
  384. package/dist/composables/useFileField.js +40 -20
  385. package/dist/composables/useFileField.js.map +1 -1
  386. package/dist/composables/useFocusoutDismiss.d.ts +0 -15
  387. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  388. package/dist/composables/useIconClickHandlers.d.ts +29 -14
  389. package/dist/composables/useIconClickHandlers.js +15 -5
  390. package/dist/composables/useIconClickHandlers.js.map +1 -1
  391. package/dist/composables/useInertLink.d.ts +20 -0
  392. package/dist/composables/useInertLink.js +23 -0
  393. package/dist/composables/useInertLink.js.map +1 -0
  394. package/dist/composables/useMaskedField.d.ts +33 -10
  395. package/dist/composables/useMaskedField.js +45 -1
  396. package/dist/composables/useMaskedField.js.map +1 -1
  397. package/dist/composables/usePopover.d.ts +15 -1
  398. package/dist/composables/usePopover.js +23 -8
  399. package/dist/composables/usePopover.js.map +1 -1
  400. package/dist/composables/useProgressValue.d.ts +5 -8
  401. package/dist/composables/useProgressValue.js +6 -3
  402. package/dist/composables/useProgressValue.js.map +1 -1
  403. package/dist/composables/useRootAttrs.d.ts +12 -19
  404. package/dist/composables/useRootAttrs.js.map +1 -1
  405. package/dist/composables/useTimer.d.ts +8 -10
  406. package/dist/composables/useTimer.js.map +1 -1
  407. package/dist/i18n/en.d.ts +2 -10
  408. package/dist/i18n/en.js +18 -19
  409. package/dist/i18n/en.js.map +1 -1
  410. package/dist/i18n/fr.d.ts +2 -18
  411. package/dist/i18n/fr.js +18 -19
  412. package/dist/i18n/fr.js.map +1 -1
  413. package/dist/i18n/state.d.ts +44 -47
  414. package/dist/i18n/state.js +20 -17
  415. package/dist/i18n/state.js.map +1 -1
  416. package/dist/i18n/types.d.ts +53 -44
  417. package/dist/icons.d.ts +3 -3
  418. package/dist/index.d.ts +43 -17
  419. package/dist/index.js +45 -44
  420. package/dist/styles.css +1 -1
  421. package/dist/tokens/css.js.map +1 -1
  422. package/dist/tokens/index.d.ts +5 -1
  423. package/dist/tokens/primitives.js.map +1 -1
  424. package/dist/tokens/semantic.d.ts +5 -1
  425. package/dist/tokens/semantic.js +6 -2
  426. package/dist/tokens/semantic.js.map +1 -1
  427. package/dist/tokens/themes/dark.js.map +1 -1
  428. package/dist/tokens/types.d.ts +7 -15
  429. package/dist/tokens/types.js.map +1 -1
  430. package/dist/tokens.json +25 -5
  431. package/dist/types.d.ts +24 -0
  432. package/dist/utils/array.d.ts +3 -6
  433. package/dist/utils/array.js.map +1 -1
  434. package/dist/utils/arrowNav.d.ts +17 -17
  435. package/dist/utils/arrowNav.js +5 -3
  436. package/dist/utils/arrowNav.js.map +1 -1
  437. package/dist/utils/chip.d.ts +11 -15
  438. package/dist/utils/chip.js.map +1 -1
  439. package/dist/utils/css.d.ts +22 -11
  440. package/dist/utils/css.js +5 -2
  441. package/dist/utils/css.js.map +1 -1
  442. package/dist/utils/date.d.ts +42 -19
  443. package/dist/utils/date.js +97 -98
  444. package/dist/utils/date.js.map +1 -1
  445. package/dist/utils/direction.d.ts +6 -12
  446. package/dist/utils/direction.js.map +1 -1
  447. package/dist/utils/env.d.ts +5 -6
  448. package/dist/utils/file.d.ts +46 -58
  449. package/dist/utils/file.js +43 -36
  450. package/dist/utils/file.js.map +1 -1
  451. package/dist/utils/focus.d.ts +8 -17
  452. package/dist/utils/focus.js.map +1 -1
  453. package/dist/utils/hostWarns.d.ts +12 -0
  454. package/dist/utils/hostWarns.js +6 -0
  455. package/dist/utils/hostWarns.js.map +1 -0
  456. package/dist/utils/ids.d.ts +10 -0
  457. package/dist/utils/ids.js +8 -0
  458. package/dist/utils/ids.js.map +1 -0
  459. package/dist/utils/matcher.d.ts +5 -9
  460. package/dist/utils/matcher.js.map +1 -1
  461. package/dist/utils/memo.d.ts +12 -0
  462. package/dist/utils/memo.js +9 -0
  463. package/dist/utils/memo.js.map +1 -0
  464. package/dist/utils/number.d.ts +3 -4
  465. package/dist/utils/number.js.map +1 -1
  466. package/dist/utils/text.d.ts +20 -9
  467. package/dist/utils/text.js +17 -3
  468. package/dist/utils/text.js.map +1 -1
  469. package/dist/utils/time.d.ts +53 -61
  470. package/dist/utils/time.js +49 -45
  471. package/dist/utils/time.js.map +1 -1
  472. package/dist/utils/vnode.d.ts +8 -15
  473. package/dist/utils/vnode.js.map +1 -1
  474. package/package.json +6 -6
  475. package/dist/components/VToggle/VToggleItem.css +0 -2
@@ -1,68 +1,58 @@
1
- /**
2
- * Everything the design system has to decide about a file the browser hands it, before
3
- * that file is accepted: is it of a kind we asked for, how do we write its size out, and
4
- * which of a batch may come in.
5
- *
6
- * The three are grouped because they are about the same SUBJECT, not because they share
7
- * any code — the same arrangement as the text helpers.
8
- *
9
- * Nothing here knows anything about components, which is what gives the screening its
10
- * shape: it HANDS BACK the files it refused instead of announcing them. One body then
11
- * serves a component that reports refusals one at a time and a test that reads them all
12
- * as a list.
13
- */
14
1
  /** All the matching needs of a file, so that a test does not have to counterfeit one. */
15
2
  export interface FileCandidate {
16
3
  name: string;
17
4
  type: string;
18
5
  }
19
6
  /**
20
- * Decides whether a file is one of the kinds a component said it would take.
7
+ * An `accept` list read into its tokens: split on commas, trimmed, lowercased, the empty ones
8
+ * dropped. An empty result accepts everything.
9
+ */
10
+ export declare function parseAccept(accept?: string): string[];
11
+ /**
12
+ * Whether a file matches an `accept` list, written exactly as the HTML attribute is:
13
+ * `.pdf` (case-insensitive), `image/*`, or one precise MIME type. An empty list accepts
14
+ * everything.
21
15
  *
22
- * The list of accepted kinds is written exactly as HTML has always written it, and it
23
- * admits three forms: an extension such as ".pdf", regardless of capitals; a whole family
24
- * such as "image/*"; or one precise kind. Saying nothing at all accepts everything, which
25
- * is what saying nothing has always meant.
16
+ * The rule is applied in JS because the ATTRIBUTE only governs the dialog the browser
17
+ * opens: a DROPPED file bypasses it entirely. Without this second reading, dropping
18
+ * smuggles anything past a restriction the consumer believes is enforced.
26
19
  *
27
- * The reason this exists in code rather than being left to the browser is that the
28
- * browser only applies that list to the dialog it opens. A file DROPPED onto the page
29
- * goes around it entirely and arrives untouched. Without this second reading, dropping
30
- * would smuggle in anything at all past a restriction the consumer believes is being
31
- * enforced.
20
+ * The list may be handed over already read by `parseAccept`, which is what a batch does:
21
+ * screening a hundred dropped files would otherwise split the same string a hundred times.
32
22
  *
33
- * TRAP — the kind of a file is the BROWSER's guess, and it is often simply empty: an
34
- * extension it has never heard of, or certain Linux setups. A list written only in terms
35
- * of kinds then turns away a perfectly good file, which is why the documentation asks for
36
- * extensions to be spelled out alongside them — "image/*,.heic" rather than "image/*" on
37
- * its own.
23
+ * TRAP — `file.type` is the browser's GUESS and is often empty (an unknown extension, some
24
+ * Linux setups). A list written only in MIME types then turns away a perfectly good file,
25
+ * which is why the docs ask for extensions alongside: `image/*,.heic`, not `image/*` alone.
38
26
  */
39
- export declare function matchesAccept(file: FileCandidate, accept?: string): boolean;
27
+ export declare function matchesAccept(file: FileCandidate, accept?: string | readonly string[]): boolean;
28
+ export declare function fileKey(file: File): number;
40
29
  /**
41
- * Writes a size out the way a reader expects to see it: 1 200 000 becomes "1.2 MB" in
42
- * English and "1,2 Mo" in French.
43
- *
44
- * The design system's rule about language applies here unchanged. The FORM comes from the
45
- * browser, which already knows the unit in every language and where the decimal mark
46
- * goes; only the WORDS around it come from the dictionary. Nothing in this function is
47
- * translatable.
48
- *
49
- * A kilobyte is a thousand bytes, and each rung of the ladder is a thousand of the one
50
- * below. That is exactly what the unit names the browser prints mean. Using the other,
51
- * computing convention of 1024 would have a file of 1024 bytes shown as "1.02 kB" — a
52
- * discrepancy no reader could explain to themselves.
30
+ * A file size as a reader expects it: 1 200 000 gives "1.2 MB" in English, "1,2 Mo" in
31
+ * French. Nothing here is translatable — `Intl` knows the unit names and the decimal mark.
53
32
  *
54
- * A size that is negative, or not a number at all, is treated as nothing rather than
55
- * producing nonsense. The number comes straight from the file, and a size shown beside a
56
- * name must never be the thing that breaks.
33
+ * SI base 1000, which is what the unit names `Intl` prints actually mean. The computing
34
+ * convention of 1024 would show a 1024-byte file as "1.02 kB", a discrepancy no reader can
35
+ * explain to themselves. A negative or non-finite size reads as 0: the number comes straight
36
+ * off the file, and a size beside a name must never be the thing that breaks.
57
37
  */
58
38
  export declare function formatBytes(bytes: number, locale: string): string;
59
39
  /**
60
- * Why a file was turned away. Each component declares its own public name for this: a
61
- * type belongs to the component that exposes it, and nothing in here is public.
40
+ * Why a file was turned away: its kind, its size, how many there already are, or the
41
+ * total.
42
+ *
43
+ * VFileInput and VFilePicker screen a batch through the same `screenFiles` below, so the
44
+ * two report the same thing and the type is declared ONCE, here, rather than copied into
45
+ * each of them under a name of its own. It is the `TimePickerAllowed` arrangement: the type
46
+ * lives beside the rule that produces it, and `index.ts` is what makes it public — the
47
+ * MODULE stays internal, and a handler written for one of the two components can be
48
+ * handed to the other.
62
49
  */
63
50
  export type FileRejectReason = 'type' | 'size' | 'count' | 'total-size';
51
+ /** One file that was turned away, and the reason it was. */
64
52
  export interface FileRejection {
53
+ /** The file itself, so a message can name it. */
65
54
  file: File;
55
+ /** What it fell foul of. */
66
56
  reason: FileRejectReason;
67
57
  }
68
58
  export interface FileLimits {
@@ -74,20 +64,18 @@ export interface FileLimits {
74
64
  maxTotalSize?: number;
75
65
  }
76
66
  /**
77
- * Sorts an arriving batch of files into those that may come in and those that may not,
78
- * given what has already been chosen.
79
- *
80
- * The checks run in the order a reader can act on. A file of the wrong KIND is reported
81
- * as such even when it is also too big, because being told to shrink a file that would
82
- * never have been accepted anyway is worse than useless.
67
+ * Screens an arriving batch against what is already chosen, returning the accepted files
68
+ * and one rejection per refusal.
83
69
  *
84
- * Nothing is set aside for being chosen twice. There is no reliable way to tell one file
85
- * from another — two files in different folders may perfectly well share a name — so
86
- * "already chosen" is deliberately not one of the reasons a file can be refused.
70
+ * The order `type → size → count → total-size` is a contract both `.mdx` pages state, and
71
+ * it is the order a reader can act on: a file of the wrong KIND is reported as such even
72
+ * when it is also too big, since being told to shrink a file that would never be accepted
73
+ * is worse than useless.
87
74
  *
88
- * What is already chosen counts towards BOTH the number of files and the running total,
89
- * which is what makes a second drop obey the same limits as the first rather than
90
- * starting again from nothing.
75
+ * Duplicates are deliberately NOT a reason: two files in different folders may share a
76
+ * name, and there is no reliable way to tell one from another. What is already chosen
77
+ * counts towards both the count and the running total, so a second drop obeys the same
78
+ * limits as the first instead of starting over.
91
79
  */
92
80
  export declare function screenFiles(incoming: readonly File[], current: readonly File[], limits: FileLimits): {
93
81
  accepted: File[];
@@ -1,70 +1,77 @@
1
+ import { memo as e } from "./memo.js";
1
2
  //#region src/utils/file.ts
2
- function e(e, t) {
3
- if (!t) return !0;
4
- let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
5
- if (n.length === 0) return !0;
6
- let r = e.name.toLowerCase(), i = e.type.toLowerCase();
7
- return n.some((e) => e === "*" || e === "*/*" ? !0 : e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i !== "" && i.startsWith(e.slice(0, -1)) : i === e);
3
+ function t(e) {
4
+ return e ? e.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean) : [];
8
5
  }
9
- var t = [
6
+ function n(e, n) {
7
+ let r = typeof n == "string" || n === void 0 ? t(n) : n;
8
+ if (r.length === 0) return !0;
9
+ let i = e.name.toLowerCase(), a = e.type.toLowerCase();
10
+ return r.some((e) => e === "*" || e === "*/*" ? !0 : e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? a !== "" && a.startsWith(e.slice(0, -1)) : a === e);
11
+ }
12
+ var r = /* @__PURE__ */ new WeakMap(), i = 0;
13
+ function a(e) {
14
+ let t = r.get(e);
15
+ return t === void 0 && (t = i++, r.set(e, t)), t;
16
+ }
17
+ var o = [
10
18
  "byte",
11
19
  "kilobyte",
12
20
  "megabyte",
13
21
  "gigabyte",
14
22
  "terabyte"
15
- ], n = /* @__PURE__ */ new Map(), r = (e) => e === 0 ? 0 : 1;
16
- function i(e, i) {
17
- let a = `${e}|${i}`, o = n.get(a);
18
- return o || (o = new Intl.NumberFormat(e, {
23
+ ], s = /* @__PURE__ */ new Map(), c = (e) => e === 0 ? 0 : 1;
24
+ function l(t, n) {
25
+ return e(s, `${t}|${n}`, () => new Intl.NumberFormat(t, {
19
26
  style: "unit",
20
- unit: t[i],
27
+ unit: o[n],
21
28
  unitDisplay: "short",
22
- maximumFractionDigits: r(i)
23
- }), n.set(a, o)), o;
29
+ maximumFractionDigits: c(n)
30
+ }));
24
31
  }
25
- function a(e, n) {
26
- let a = Number.isFinite(e) && e > 0 ? e : 0, o = a === 0 ? 0 : Math.min(t.length - 1, Math.max(0, Math.floor(Math.log10(a) / 3))), s = a / 1e3 ** o;
27
- return Math.round(s * 10 ** r(o)) / 10 ** r(o) >= 1e3 && o < t.length - 1 && (o += 1, s = a / 1e3 ** o), i(n, o).format(s);
32
+ function u(e, t) {
33
+ let n = Number.isFinite(e) && e > 0 ? e : 0, r = n === 0 ? 0 : Math.min(o.length - 1, Math.max(0, Math.floor(Math.log10(n) / 3))), i = n / 1e3 ** r;
34
+ return Math.round(i * 10 ** c(r)) / 10 ** c(r) >= 1e3 && r < o.length - 1 && (r += 1, i = n / 1e3 ** r), l(t, r).format(i);
28
35
  }
29
- function o(t, n, r) {
30
- let i = [], a = [], o = n.reduce((e, t) => e + t.size, 0);
31
- for (let s of t) {
32
- if (!e(s, r.accept)) {
33
- a.push({
34
- file: s,
36
+ function d(e, r, i) {
37
+ let a = [], o = [], s = r.reduce((e, t) => e + t.size, 0), c = t(i.accept);
38
+ for (let t of e) {
39
+ if (!n(t, c)) {
40
+ o.push({
41
+ file: t,
35
42
  reason: "type"
36
43
  });
37
44
  continue;
38
45
  }
39
- if (r.maxSize !== void 0 && s.size > r.maxSize) {
40
- a.push({
41
- file: s,
46
+ if (i.maxSize !== void 0 && t.size > i.maxSize) {
47
+ o.push({
48
+ file: t,
42
49
  reason: "size"
43
50
  });
44
51
  continue;
45
52
  }
46
- if (r.maxFiles !== void 0 && n.length + i.length >= r.maxFiles) {
47
- a.push({
48
- file: s,
53
+ if (i.maxFiles !== void 0 && r.length + a.length >= i.maxFiles) {
54
+ o.push({
55
+ file: t,
49
56
  reason: "count"
50
57
  });
51
58
  continue;
52
59
  }
53
- if (r.maxTotalSize !== void 0 && o + s.size > r.maxTotalSize) {
54
- a.push({
55
- file: s,
60
+ if (i.maxTotalSize !== void 0 && s + t.size > i.maxTotalSize) {
61
+ o.push({
62
+ file: t,
56
63
  reason: "total-size"
57
64
  });
58
65
  continue;
59
66
  }
60
- i.push(s), o += s.size;
67
+ a.push(t), s += t.size;
61
68
  }
62
69
  return {
63
- accepted: i,
64
- rejected: a
70
+ accepted: a,
71
+ rejected: o
65
72
  };
66
73
  }
67
74
  //#endregion
68
- export { a as formatBytes, e as matchesAccept, o as screenFiles };
75
+ export { a as fileKey, u as formatBytes, n as matchesAccept, t as parseAccept, d as screenFiles };
69
76
 
70
77
  //# sourceMappingURL=file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","names":[],"sources":["../../src/utils/file.ts"],"sourcesContent":["// @core — module-wide: pure domain logic, no a11y, no DOM, no environment guard.\n/**\n * Everything the design system has to decide about a file the browser hands it, before\n * that file is accepted: is it of a kind we asked for, how do we write its size out, and\n * which of a batch may come in.\n *\n * The three are grouped because they are about the same SUBJECT, not because they share\n * any code — the same arrangement as the text helpers.\n *\n * Nothing here knows anything about components, which is what gives the screening its\n * shape: it HANDS BACK the files it refused instead of announcing them. One body then\n * serves a component that reports refusals one at a time and a test that reads them all\n * as a list.\n */\n\n/** All the matching needs of a file, so that a test does not have to counterfeit one. */\nexport interface FileCandidate {\n name: string\n type: string\n}\n\n/**\n * Decides whether a file is one of the kinds a component said it would take.\n *\n * The list of accepted kinds is written exactly as HTML has always written it, and it\n * admits three forms: an extension such as \".pdf\", regardless of capitals; a whole family\n * such as \"image/*\"; or one precise kind. Saying nothing at all accepts everything, which\n * is what saying nothing has always meant.\n *\n * The reason this exists in code rather than being left to the browser is that the\n * browser only applies that list to the dialog it opens. A file DROPPED onto the page\n * goes around it entirely and arrives untouched. Without this second reading, dropping\n * would smuggle in anything at all past a restriction the consumer believes is being\n * enforced.\n *\n * TRAP — the kind of a file is the BROWSER's guess, and it is often simply empty: an\n * extension it has never heard of, or certain Linux setups. A list written only in terms\n * of kinds then turns away a perfectly good file, which is why the documentation asks for\n * extensions to be spelled out alongside them — \"image/*,.heic\" rather than \"image/*\" on\n * its own.\n */\nexport function matchesAccept(file: FileCandidate, accept?: string): boolean {\n if (!accept) return true\n\n const tokens = accept\n .split(',')\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean)\n if (tokens.length === 0) return true\n\n const name = file.name.toLowerCase()\n const type = file.type.toLowerCase()\n\n return tokens.some((token) => {\n if (token === '*' || token === '*/*') return true\n if (token.startsWith('.')) return name.endsWith(token)\n if (token.endsWith('/*')) return type !== '' && type.startsWith(token.slice(0, -1))\n return type === token\n })\n}\n\n/** The units a size can be written in, smallest first — the rungs of the ladder. */\nconst UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte'] as const\n\n/**\n * Building a number formatter costs one to two orders of magnitude more than using one,\n * and a running total is rewritten every time a file is added — so one is built per\n * language and rung, and kept for as long as the page lives.\n */\nconst formatters = new Map<string, Intl.NumberFormat>()\n\n/** Bytes are counted whole; above that, one decimal is what reads as a size. */\nconst digitsFor = (step: number) => (step === 0 ? 0 : 1)\n\nfunction formatterFor(locale: string, step: number): Intl.NumberFormat {\n const key = `${locale}|${step}`\n let formatter = formatters.get(key)\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, {\n style: 'unit',\n unit: UNITS[step]!,\n unitDisplay: 'short',\n maximumFractionDigits: digitsFor(step),\n })\n formatters.set(key, formatter)\n }\n return formatter\n}\n\n/**\n * Writes a size out the way a reader expects to see it: 1 200 000 becomes \"1.2 MB\" in\n * English and \"1,2 Mo\" in French.\n *\n * The design system's rule about language applies here unchanged. The FORM comes from the\n * browser, which already knows the unit in every language and where the decimal mark\n * goes; only the WORDS around it come from the dictionary. Nothing in this function is\n * translatable.\n *\n * A kilobyte is a thousand bytes, and each rung of the ladder is a thousand of the one\n * below. That is exactly what the unit names the browser prints mean. Using the other,\n * computing convention of 1024 would have a file of 1024 bytes shown as \"1.02 kB\" — a\n * discrepancy no reader could explain to themselves.\n *\n * A size that is negative, or not a number at all, is treated as nothing rather than\n * producing nonsense. The number comes straight from the file, and a size shown beside a\n * name must never be the thing that breaks.\n */\nexport function formatBytes(bytes: number, locale: string): string {\n const n = Number.isFinite(bytes) && bytes > 0 ? bytes : 0\n\n let step = n === 0 ? 0 : Math.min(UNITS.length - 1, Math.max(0, Math.floor(Math.log10(n) / 3)))\n let value = n / 1000 ** step\n\n /*\n * The carry. A size of 999 999 bytes belongs on the kilobyte rung, and at one decimal\n * it ROUNDS to 1000 — so the rung and the rounding have to agree, or the reader is\n * shown \"1,000 kB\" where they expect \"1 MB\". The rounding is done first and the step up\n * second: the other order lets exactly the same discrepancy through one rung higher.\n */\n const rounded = Math.round(value * 10 ** digitsFor(step)) / 10 ** digitsFor(step)\n if (rounded >= 1000 && step < UNITS.length - 1) {\n step += 1\n value = n / 1000 ** step\n }\n\n return formatterFor(locale, step).format(value)\n}\n\n/**\n * Why a file was turned away. Each component declares its own public name for this: a\n * type belongs to the component that exposes it, and nothing in here is public.\n */\nexport type FileRejectReason = 'type' | 'size' | 'count' | 'total-size'\n\nexport interface FileRejection {\n file: File\n reason: FileRejectReason\n}\n\nexport interface FileLimits {\n accept?: string\n /** How large ONE file may be, in bytes. */\n maxSize?: number\n /** Already settled by the caller: a field that takes a single file passes one. */\n maxFiles?: number\n maxTotalSize?: number\n}\n\n/**\n * Sorts an arriving batch of files into those that may come in and those that may not,\n * given what has already been chosen.\n *\n * The checks run in the order a reader can act on. A file of the wrong KIND is reported\n * as such even when it is also too big, because being told to shrink a file that would\n * never have been accepted anyway is worse than useless.\n *\n * Nothing is set aside for being chosen twice. There is no reliable way to tell one file\n * from another — two files in different folders may perfectly well share a name — so\n * \"already chosen\" is deliberately not one of the reasons a file can be refused.\n *\n * What is already chosen counts towards BOTH the number of files and the running total,\n * which is what makes a second drop obey the same limits as the first rather than\n * starting again from nothing.\n */\nexport function screenFiles(\n incoming: readonly File[],\n current: readonly File[],\n limits: FileLimits,\n): { accepted: File[]; rejected: FileRejection[] } {\n const accepted: File[] = []\n const rejected: FileRejection[] = []\n let total = current.reduce((sum, file) => sum + file.size, 0)\n\n for (const file of incoming) {\n if (!matchesAccept(file, limits.accept)) {\n rejected.push({ file, reason: 'type' })\n continue\n }\n if (limits.maxSize !== undefined && file.size > limits.maxSize) {\n rejected.push({ file, reason: 'size' })\n continue\n }\n if (limits.maxFiles !== undefined && current.length + accepted.length >= limits.maxFiles) {\n rejected.push({ file, reason: 'count' })\n continue\n }\n if (limits.maxTotalSize !== undefined && total + file.size > limits.maxTotalSize) {\n rejected.push({ file, reason: 'total-size' })\n continue\n }\n accepted.push(file)\n total += file.size\n }\n\n return { accepted, rejected }\n}\n"],"mappings":";AAyCA,SAAgB,EAAc,GAAqB,GAA0B;CAC3E,IAAI,CAAC,GAAQ,OAAO;CAEpB,IAAM,IAAS,EACZ,MAAM,GAAG,CAAC,CACV,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1C,OAAO,OAAO;CACjB,IAAI,EAAO,WAAW,GAAG,OAAO;CAEhC,IAAM,IAAO,EAAK,KAAK,YAAY,GAC7B,IAAO,EAAK,KAAK,YAAY;CAEnC,OAAO,EAAO,MAAM,MACd,MAAU,OAAO,MAAU,QAAc,KACzC,EAAM,WAAW,GAAG,IAAU,EAAK,SAAS,CAAK,IACjD,EAAM,SAAS,IAAI,IAAU,MAAS,MAAM,EAAK,WAAW,EAAM,MAAM,GAAG,EAAE,CAAC,IAC3E,MAAS,CACjB;AACH;AAGA,IAAM,IAAQ;CAAC;CAAQ;CAAY;CAAY;CAAY;AAAU,GAO/D,oBAAa,IAAI,IAA+B,GAGhD,KAAa,MAAkB,MAAS,IAAI,IAAI;AAEtD,SAAS,EAAa,GAAgB,GAAiC;CACrE,IAAM,IAAM,GAAG,EAAO,GAAG,KACrB,IAAY,EAAW,IAAI,CAAG;CAUlC,OATK,MACH,IAAY,IAAI,KAAK,aAAa,GAAQ;EACxC,OAAO;EACP,MAAM,EAAM;EACZ,aAAa;EACb,uBAAuB,EAAU,CAAI;CACvC,CAAC,GACD,EAAW,IAAI,GAAK,CAAS,IAExB;AACT;AAoBA,SAAgB,EAAY,GAAe,GAAwB;CACjE,IAAM,IAAI,OAAO,SAAS,CAAK,KAAK,IAAQ,IAAI,IAAQ,GAEpD,IAAO,MAAM,IAAI,IAAI,KAAK,IAAI,EAAM,SAAS,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAC1F,IAAQ,IAAI,OAAQ;CAcxB,OANgB,KAAK,MAAM,IAAQ,MAAM,EAAU,CAAI,CAAC,IAAI,MAAM,EAAU,CAAI,KACjE,OAAQ,IAAO,EAAM,SAAS,MAC3C,KAAQ,GACR,IAAQ,IAAI,OAAQ,IAGf,EAAa,GAAQ,CAAI,CAAC,CAAC,OAAO,CAAK;AAChD;AAsCA,SAAgB,EACd,GACA,GACA,GACiD;CACjD,IAAM,IAAmB,CAAC,GACpB,IAA4B,CAAC,GAC/B,IAAQ,EAAQ,QAAQ,GAAK,MAAS,IAAM,EAAK,MAAM,CAAC;CAE5D,KAAK,IAAM,KAAQ,GAAU;EAC3B,IAAI,CAAC,EAAc,GAAM,EAAO,MAAM,GAAG;GACvC,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAO,CAAC;GACtC;EACF;EACA,IAAI,EAAO,YAAY,KAAA,KAAa,EAAK,OAAO,EAAO,SAAS;GAC9D,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAO,CAAC;GACtC;EACF;EACA,IAAI,EAAO,aAAa,KAAA,KAAa,EAAQ,SAAS,EAAS,UAAU,EAAO,UAAU;GACxF,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAQ,CAAC;GACvC;EACF;EACA,IAAI,EAAO,iBAAiB,KAAA,KAAa,IAAQ,EAAK,OAAO,EAAO,cAAc;GAChF,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAa,CAAC;GAC5C;EACF;EAEA,AADA,EAAS,KAAK,CAAI,GAClB,KAAS,EAAK;CAChB;CAEA,OAAO;EAAE;EAAU;CAAS;AAC9B"}
1
+ {"version":3,"file":"file.js","names":[],"sources":["../../src/utils/file.ts"],"sourcesContent":["// @core — module-wide: pure domain logic, no a11y, no DOM, no environment guard.\n/**\n * The FILE domain: whether a file is of an accepted kind, how its size is written out, and\n * which of a batch may come in. Grouped by subject rather than by shared code, like `text.ts`.\n *\n * Nothing here knows about components, which is what shapes the screening: it RETURNS its\n * refusals instead of emitting them. One body then serves VFileInput, which reports them one\n * at a time, and a test that reads them all as a list without a mount.\n */\nimport { memo } from './memo'\n\n/** All the matching needs of a file, so that a test does not have to counterfeit one. */\nexport interface FileCandidate {\n name: string\n type: string\n}\n\n/**\n * An `accept` list read into its tokens: split on commas, trimmed, lowercased, the empty ones\n * dropped. An empty result accepts everything.\n */\nexport function parseAccept(accept?: string): string[] {\n if (!accept) return []\n return accept\n .split(',')\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean)\n}\n\n/**\n * Whether a file matches an `accept` list, written exactly as the HTML attribute is:\n * `.pdf` (case-insensitive), `image/*`, or one precise MIME type. An empty list accepts\n * everything.\n *\n * The rule is applied in JS because the ATTRIBUTE only governs the dialog the browser\n * opens: a DROPPED file bypasses it entirely. Without this second reading, dropping\n * smuggles anything past a restriction the consumer believes is enforced.\n *\n * The list may be handed over already read by `parseAccept`, which is what a batch does:\n * screening a hundred dropped files would otherwise split the same string a hundred times.\n *\n * TRAP — `file.type` is the browser's GUESS and is often empty (an unknown extension, some\n * Linux setups). A list written only in MIME types then turns away a perfectly good file,\n * which is why the docs ask for extensions alongside: `image/*,.heic`, not `image/*` alone.\n */\nexport function matchesAccept(file: FileCandidate, accept?: string | readonly string[]): boolean {\n const tokens = typeof accept === 'string' || accept === undefined ? parseAccept(accept) : accept\n if (tokens.length === 0) return true\n\n const name = file.name.toLowerCase()\n const type = file.type.toLowerCase()\n\n return tokens.some((token) => {\n if (token === '*' || token === '*/*') return true\n if (token.startsWith('.')) return name.endsWith(token)\n if (token.endsWith('/*')) return type !== '' && type.startsWith(token.slice(0, -1))\n return type === token\n })\n}\n\n/**\n * A stable key per FILE OBJECT, for the `v-for` of a file list.\n *\n * An index-based key re-keys every row after a removal, which remounts them — a thumbnail's\n * `<img>` included — and a name is not unique across folders. A File travels through a\n * v-model unproxied (reactivity only wraps plain objects and collections), so its identity is\n * a key that survives both. The map is weak, so a file that leaves every list is not held.\n */\nconst fileIds = new WeakMap<File, number>()\nlet nextFileId = 0\n\nexport function fileKey(file: File): number {\n let id = fileIds.get(file)\n if (id === undefined) {\n id = nextFileId++\n fileIds.set(file, id)\n }\n return id\n}\n\n/** The units a size can be written in, smallest first — the rungs of the ladder. */\nconst UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte'] as const\n\n/**\n * Building a number formatter costs one to two orders of magnitude more than using one,\n * and a running total is rewritten every time a file is added — so one is built per\n * language and rung, and kept for as long as the page lives.\n */\nconst formatters = new Map<string, Intl.NumberFormat>()\n\n/** Bytes are counted whole; above that, one decimal is what reads as a size. */\nconst digitsFor = (step: number) => (step === 0 ? 0 : 1)\n\nfunction formatterFor(locale: string, step: number): Intl.NumberFormat {\n return memo(\n formatters,\n `${locale}|${step}`,\n () =>\n new Intl.NumberFormat(locale, {\n style: 'unit',\n unit: UNITS[step]!,\n unitDisplay: 'short',\n maximumFractionDigits: digitsFor(step),\n }),\n )\n}\n\n/**\n * A file size as a reader expects it: 1 200 000 gives \"1.2 MB\" in English, \"1,2 Mo\" in\n * French. Nothing here is translatable — `Intl` knows the unit names and the decimal mark.\n *\n * SI base 1000, which is what the unit names `Intl` prints actually mean. The computing\n * convention of 1024 would show a 1024-byte file as \"1.02 kB\", a discrepancy no reader can\n * explain to themselves. A negative or non-finite size reads as 0: the number comes straight\n * off the file, and a size beside a name must never be the thing that breaks.\n */\nexport function formatBytes(bytes: number, locale: string): string {\n const n = Number.isFinite(bytes) && bytes > 0 ? bytes : 0\n\n let step = n === 0 ? 0 : Math.min(UNITS.length - 1, Math.max(0, Math.floor(Math.log10(n) / 3)))\n let value = n / 1000 ** step\n\n /*\n * The carry. 999 999 bytes belongs on the kB rung and ROUNDS to 1000 at one decimal, so\n * rung and rounding have to agree or the reader is shown \"1,000 kB\" for \"1 MB\". Round\n * first, then step up: the other order lets the same discrepancy through one rung higher.\n */\n const rounded = Math.round(value * 10 ** digitsFor(step)) / 10 ** digitsFor(step)\n if (rounded >= 1000 && step < UNITS.length - 1) {\n step += 1\n value = n / 1000 ** step\n }\n\n return formatterFor(locale, step).format(value)\n}\n\n/**\n * Why a file was turned away: its kind, its size, how many there already are, or the\n * total.\n *\n * VFileInput and VFilePicker screen a batch through the same `screenFiles` below, so the\n * two report the same thing and the type is declared ONCE, here, rather than copied into\n * each of them under a name of its own. It is the `TimePickerAllowed` arrangement: the type\n * lives beside the rule that produces it, and `index.ts` is what makes it public — the\n * MODULE stays internal, and a handler written for one of the two components can be\n * handed to the other.\n */\nexport type FileRejectReason = 'type' | 'size' | 'count' | 'total-size'\n\n/** One file that was turned away, and the reason it was. */\nexport interface FileRejection {\n /** The file itself, so a message can name it. */\n file: File\n /** What it fell foul of. */\n reason: FileRejectReason\n}\n\nexport interface FileLimits {\n accept?: string\n /** How large ONE file may be, in bytes. */\n maxSize?: number\n /** Already settled by the caller: a field that takes a single file passes one. */\n maxFiles?: number\n maxTotalSize?: number\n}\n\n/**\n * Screens an arriving batch against what is already chosen, returning the accepted files\n * and one rejection per refusal.\n *\n * The order `type → size → count → total-size` is a contract both `.mdx` pages state, and\n * it is the order a reader can act on: a file of the wrong KIND is reported as such even\n * when it is also too big, since being told to shrink a file that would never be accepted\n * is worse than useless.\n *\n * Duplicates are deliberately NOT a reason: two files in different folders may share a\n * name, and there is no reliable way to tell one from another. What is already chosen\n * counts towards both the count and the running total, so a second drop obeys the same\n * limits as the first instead of starting over.\n */\nexport function screenFiles(\n incoming: readonly File[],\n current: readonly File[],\n limits: FileLimits,\n): { accepted: File[]; rejected: FileRejection[] } {\n const accepted: File[] = []\n const rejected: FileRejection[] = []\n let total = current.reduce((sum, file) => sum + file.size, 0)\n const accept = parseAccept(limits.accept)\n\n for (const file of incoming) {\n if (!matchesAccept(file, accept)) {\n rejected.push({ file, reason: 'type' })\n continue\n }\n if (limits.maxSize !== undefined && file.size > limits.maxSize) {\n rejected.push({ file, reason: 'size' })\n continue\n }\n if (limits.maxFiles !== undefined && current.length + accepted.length >= limits.maxFiles) {\n rejected.push({ file, reason: 'count' })\n continue\n }\n if (limits.maxTotalSize !== undefined && total + file.size > limits.maxTotalSize) {\n rejected.push({ file, reason: 'total-size' })\n continue\n }\n accepted.push(file)\n total += file.size\n }\n\n return { accepted, rejected }\n}\n"],"mappings":";;AAqBA,SAAgB,EAAY,GAA2B;CAErD,OADK,IACE,EACJ,MAAM,GAAG,CAAC,CACV,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1C,OAAO,OAAO,IAJG,CAAC;AAKvB;AAkBA,SAAgB,EAAc,GAAqB,GAA8C;CAC/F,IAAM,IAAS,OAAO,KAAW,YAAY,MAAW,KAAA,IAAY,EAAY,CAAM,IAAI;CAC1F,IAAI,EAAO,WAAW,GAAG,OAAO;CAEhC,IAAM,IAAO,EAAK,KAAK,YAAY,GAC7B,IAAO,EAAK,KAAK,YAAY;CAEnC,OAAO,EAAO,MAAM,MACd,MAAU,OAAO,MAAU,QAAc,KACzC,EAAM,WAAW,GAAG,IAAU,EAAK,SAAS,CAAK,IACjD,EAAM,SAAS,IAAI,IAAU,MAAS,MAAM,EAAK,WAAW,EAAM,MAAM,GAAG,EAAE,CAAC,IAC3E,MAAS,CACjB;AACH;AAUA,IAAM,oBAAU,IAAI,QAAsB,GACtC,IAAa;AAEjB,SAAgB,EAAQ,GAAoB;CAC1C,IAAI,IAAK,EAAQ,IAAI,CAAI;CAKzB,OAJI,MAAO,KAAA,MACT,IAAK,KACL,EAAQ,IAAI,GAAM,CAAE,IAEf;AACT;AAGA,IAAM,IAAQ;CAAC;CAAQ;CAAY;CAAY;CAAY;AAAU,GAO/D,oBAAa,IAAI,IAA+B,GAGhD,KAAa,MAAkB,MAAS,IAAI,IAAI;AAEtD,SAAS,EAAa,GAAgB,GAAiC;CACrE,OAAO,EACL,GACA,GAAG,EAAO,GAAG,WAEX,IAAI,KAAK,aAAa,GAAQ;EAC5B,OAAO;EACP,MAAM,EAAM;EACZ,aAAa;EACb,uBAAuB,EAAU,CAAI;CACvC,CAAC,CACL;AACF;AAWA,SAAgB,EAAY,GAAe,GAAwB;CACjE,IAAM,IAAI,OAAO,SAAS,CAAK,KAAK,IAAQ,IAAI,IAAQ,GAEpD,IAAO,MAAM,IAAI,IAAI,KAAK,IAAI,EAAM,SAAS,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAC1F,IAAQ,IAAI,OAAQ;CAaxB,OANgB,KAAK,MAAM,IAAQ,MAAM,EAAU,CAAI,CAAC,IAAI,MAAM,EAAU,CAAI,KACjE,OAAQ,IAAO,EAAM,SAAS,MAC3C,KAAQ,GACR,IAAQ,IAAI,OAAQ,IAGf,EAAa,GAAQ,CAAI,CAAC,CAAC,OAAO,CAAK;AAChD;AA8CA,SAAgB,EACd,GACA,GACA,GACiD;CACjD,IAAM,IAAmB,CAAC,GACpB,IAA4B,CAAC,GAC/B,IAAQ,EAAQ,QAAQ,GAAK,MAAS,IAAM,EAAK,MAAM,CAAC,GACtD,IAAS,EAAY,EAAO,MAAM;CAExC,KAAK,IAAM,KAAQ,GAAU;EAC3B,IAAI,CAAC,EAAc,GAAM,CAAM,GAAG;GAChC,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAO,CAAC;GACtC;EACF;EACA,IAAI,EAAO,YAAY,KAAA,KAAa,EAAK,OAAO,EAAO,SAAS;GAC9D,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAO,CAAC;GACtC;EACF;EACA,IAAI,EAAO,aAAa,KAAA,KAAa,EAAQ,SAAS,EAAS,UAAU,EAAO,UAAU;GACxF,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAQ,CAAC;GACvC;EACF;EACA,IAAI,EAAO,iBAAiB,KAAA,KAAa,IAAQ,EAAK,OAAO,EAAO,cAAc;GAChF,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAa,CAAC;GAC5C;EACF;EAEA,AADA,EAAS,KAAK,CAAI,GAClB,KAAS,EAAK;CAChB;CAEA,OAAO;EAAE;EAAU;CAAS;AAC9B"}
@@ -1,24 +1,15 @@
1
1
  /**
2
- * Telling a keyboard focus apart from a pointer one.
2
+ * Whether this element is focused the way a keyboard user focuses things.
3
3
  *
4
- * The distinction is needed because `focus` alone does not carry it: an element focused by a
5
- * mouse click and one reached with the Tab key are in exactly the same state, and a component
6
- * reading a bare focus flag treats a passing click as a reader settling in. The browser already
7
- * makes that judgement for its own focus rings, and `:focus-visible` is where it publishes it —
8
- * a pointer click on a button does not match it, a Tab does.
9
- */
10
- /**
11
- * Whether this element is focused in the way a keyboard user focuses things.
12
- *
13
- * The `try` is for a selector engine that does not know the pseudo-class, and throws on one it
14
- * cannot parse rather than answering false. Every caller treats the keyboard as the careful
15
- * answer — it is the one that keeps a component reachable — so that is what an environment
16
- * unable to be asked returns.
4
+ * A `focus` event does not carry the distinction: a mouse click and a Tab leave an element in
5
+ * the same state. The browser already makes the judgement for its own focus rings and
6
+ * publishes it as `:focus-visible`, so that is what gets asked. The `try` covers a selector
7
+ * engine that throws on a pseudo-class it cannot parse; the keyboard is the careful answer
8
+ * there, being the one that keeps a component reachable.
17
9
  *
18
10
  * TRAP for the tests — jsdom is NOT that environment. It parses `:focus-visible` happily and
19
11
  * answers `false` for everything, a genuinely focused element included, so the `catch` never
20
- * runs there and every test silently takes the pointer branch. A test that means to exercise
21
- * the keyboard one has to stub `matches` on the element being asked; what it then locks is
22
- * that the component ASKS and branches, never what jsdom would have answered.
12
+ * runs and every test silently takes the pointer branch. Stub `matches` on the element being
13
+ * asked; what that locks is that the component ASKS and branches, never jsdom's answer.
23
14
  */
24
15
  export declare function isKeyboardFocus(target: EventTarget | null): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"focus.js","names":[],"sources":["../../src/utils/focus.ts"],"sourcesContent":["/**\n * Telling a keyboard focus apart from a pointer one.\n *\n * The distinction is needed because `focus` alone does not carry it: an element focused by a\n * mouse click and one reached with the Tab key are in exactly the same state, and a component\n * reading a bare focus flag treats a passing click as a reader settling in. The browser already\n * makes that judgement for its own focus rings, and `:focus-visible` is where it publishes it —\n * a pointer click on a button does not match it, a Tab does.\n */\n\n// @a11y @fallback\n/**\n * Whether this element is focused in the way a keyboard user focuses things.\n *\n * The `try` is for a selector engine that does not know the pseudo-class, and throws on one it\n * cannot parse rather than answering false. Every caller treats the keyboard as the careful\n * answer — it is the one that keeps a component reachable — so that is what an environment\n * unable to be asked returns.\n *\n * TRAP for the tests — jsdom is NOT that environment. It parses `:focus-visible` happily and\n * answers `false` for everything, a genuinely focused element included, so the `catch` never\n * runs there and every test silently takes the pointer branch. A test that means to exercise\n * the keyboard one has to stub `matches` on the element being asked; what it then locks is\n * that the component ASKS and branches, never what jsdom would have answered.\n */\nexport function isKeyboardFocus(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n try {\n return target.matches(':focus-visible')\n } catch {\n return true\n }\n}\n"],"mappings":";AAyBA,SAAgB,EAAgB,GAAqC;CACnE,IAAI,EAAE,aAAkB,UAAU,OAAO;CACzC,IAAI;EACF,OAAO,EAAO,QAAQ,gBAAgB;CACxC,QAAQ;EACN,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"focus.js","names":[],"sources":["../../src/utils/focus.ts"],"sourcesContent":["// @a11y @fallback\n/**\n * Whether this element is focused the way a keyboard user focuses things.\n *\n * A `focus` event does not carry the distinction: a mouse click and a Tab leave an element in\n * the same state. The browser already makes the judgement for its own focus rings and\n * publishes it as `:focus-visible`, so that is what gets asked. The `try` covers a selector\n * engine that throws on a pseudo-class it cannot parse; the keyboard is the careful answer\n * there, being the one that keeps a component reachable.\n *\n * TRAP for the tests — jsdom is NOT that environment. It parses `:focus-visible` happily and\n * answers `false` for everything, a genuinely focused element included, so the `catch` never\n * runs and every test silently takes the pointer branch. Stub `matches` on the element being\n * asked; what that locks is that the component ASKS and branches, never jsdom's answer.\n */\nexport function isKeyboardFocus(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n try {\n return target.matches(':focus-visible')\n } catch {\n return true\n }\n}\n"],"mappings":";AAeA,SAAgB,EAAgB,GAAqC;CACnE,IAAI,EAAE,aAAkB,UAAU,OAAO;CACzC,IAAI;EACF,OAAO,EAAO,QAAQ,gBAAgB;CACxC,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -0,0 +1,12 @@
1
+ import { InjectionKey } from 'vue';
2
+ /**
3
+ * Provided by a component that renders another with props it has ALREADY checked and
4
+ * reported on: VDateInput for VDatePicker's bounds, VTimeInput for VTimePicker's step and
5
+ * restrictions, both forwarded as they stand. The component inside then keeps those warnings
6
+ * to itself — the consumer wrote the host, and a second copy of the same sentence under a
7
+ * name they never typed is noise.
8
+ *
9
+ * A module of its own and not a line in `env.ts`: that one is in nearly every closure, where a
10
+ * key only four components read added bytes to all of them.
11
+ */
12
+ export declare const hostWarnsKey: InjectionKey<true>;
@@ -0,0 +1,6 @@
1
+ //#region src/utils/hostWarns.ts
2
+ var e = Symbol("vectisHostWarns");
3
+ //#endregion
4
+ export { e as hostWarnsKey };
5
+
6
+ //# sourceMappingURL=hostWarns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hostWarns.js","names":[],"sources":["../../src/utils/hostWarns.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\n/**\n * Provided by a component that renders another with props it has ALREADY checked and\n * reported on: VDateInput for VDatePicker's bounds, VTimeInput for VTimePicker's step and\n * restrictions, both forwarded as they stand. The component inside then keeps those warnings\n * to itself — the consumer wrote the host, and a second copy of the same sentence under a\n * name they never typed is noise.\n *\n * A module of its own and not a line in `env.ts`: that one is in nearly every closure, where a\n * key only four components read added bytes to all of them.\n */\nexport const hostWarnsKey: InjectionKey<true> = Symbol('vectisHostWarns')\n"],"mappings":";AAYA,IAAa,IAAmC,OAAO,iBAAiB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * An IDREF list — the value of `aria-describedby` or `aria-labelledby` — assembled from
3
+ * references that may each be absent. The empty ones are dropped by TRUTHINESS, so an empty
4
+ * string contributes nothing, and a list left with no reference at all is `undefined`, which
5
+ * removes the attribute instead of writing an empty one.
6
+ *
7
+ * A module of its own rather than a line in `text.ts`: every field loads it, and none of them
8
+ * should pay for the text helpers to get it.
9
+ */
10
+ export declare function joinIds(...ids: (string | false | null | undefined)[]): string | undefined;
@@ -0,0 +1,8 @@
1
+ //#region src/utils/ids.ts
2
+ function e(...e) {
3
+ return e.filter(Boolean).join(" ") || void 0;
4
+ }
5
+ //#endregion
6
+ export { e as joinIds };
7
+
8
+ //# sourceMappingURL=ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.js","names":[],"sources":["../../src/utils/ids.ts"],"sourcesContent":["// @a11y\n/**\n * An IDREF list — the value of `aria-describedby` or `aria-labelledby` — assembled from\n * references that may each be absent. The empty ones are dropped by TRUTHINESS, so an empty\n * string contributes nothing, and a list left with no reference at all is `undefined`, which\n * removes the attribute instead of writing an empty one.\n *\n * A module of its own rather than a line in `text.ts`: every field loads it, and none of them\n * should pay for the text helpers to get it.\n */\nexport function joinIds(...ids: (string | false | null | undefined)[]): string | undefined {\n return ids.filter(Boolean).join(' ') || undefined\n}\n"],"mappings":";AAUA,SAAgB,EAAQ,GAAG,GAAgE;CACzF,OAAO,EAAI,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;AAC1C"}
@@ -1,13 +1,9 @@
1
1
  /**
2
- * Turns any of the design system's "which entries are unavailable" props into a
3
- * single function to ask. Those props — `disabledDates`, `disabledPages` and their
4
- * kind — accept either a LIST of the values concerned or a FUNCTION deciding for
5
- * each one, and this is what lets the components stop caring which of the two they
6
- * were handed.
2
+ * Turns the design system's "which entries are unavailable" props — `disabledDates`,
3
+ * `disabledPages` and their kind, each accepting a list OR a predicate — into one
4
+ * function to ask, so components need not care which they were handed.
7
5
  *
8
- * It is meant to be resolved ONCE, inside a `computed`, and not called afresh for
9
- * every value: a list is converted into a `Set` here, so each lookup is then
10
- * immediate, where an `includes` would walk the whole list again for every cell on
11
- * screen.
6
+ * Resolve it ONCE inside a `computed`, never per value: the list becomes a `Set` here, so
7
+ * each lookup is immediate where an `includes` would rescan it for every cell on screen.
12
8
  */
13
9
  export declare function resolveMatcher<T>(matcher: readonly T[] | ((value: T) => boolean) | undefined): (value: T) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"matcher.js","names":[],"sources":["../../src/utils/matcher.ts"],"sourcesContent":["// @core\n/**\n * Turns any of the design system's \"which entries are unavailable\" props into a\n * single function to ask. Those props — `disabledDates`, `disabledPages` and their\n * kind — accept either a LIST of the values concerned or a FUNCTION deciding for\n * each one, and this is what lets the components stop caring which of the two they\n * were handed.\n *\n * It is meant to be resolved ONCE, inside a `computed`, and not called afresh for\n * every value: a list is converted into a `Set` here, so each lookup is then\n * immediate, where an `includes` would walk the whole list again for every cell on\n * screen.\n */\nexport function resolveMatcher<T>(\n matcher: readonly T[] | ((value: T) => boolean) | undefined,\n): (value: T) => boolean {\n if (!matcher) return () => false\n if (typeof matcher === 'function') return matcher\n const set = new Set(matcher)\n return (value: T) => set.has(value)\n}\n"],"mappings":";AAaA,SAAgB,EACd,GACuB;CACvB,IAAI,CAAC,GAAS,aAAa;CAC3B,IAAI,OAAO,KAAY,YAAY,OAAO;CAC1C,IAAM,IAAM,IAAI,IAAI,CAAO;CAC3B,QAAQ,MAAa,EAAI,IAAI,CAAK;AACpC"}
1
+ {"version":3,"file":"matcher.js","names":[],"sources":["../../src/utils/matcher.ts"],"sourcesContent":["// @core\n/**\n * Turns the design system's \"which entries are unavailable\" props — `disabledDates`,\n * `disabledPages` and their kind, each accepting a list OR a predicate — into one\n * function to ask, so components need not care which they were handed.\n *\n * Resolve it ONCE inside a `computed`, never per value: the list becomes a `Set` here, so\n * each lookup is immediate where an `includes` would rescan it for every cell on screen.\n */\nexport function resolveMatcher<T>(\n matcher: readonly T[] | ((value: T) => boolean) | undefined,\n): (value: T) => boolean {\n if (!matcher) return () => false\n if (typeof matcher === 'function') return matcher\n const set = new Set(matcher)\n return (value: T) => set.has(value)\n}\n"],"mappings":";AASA,SAAgB,EACd,GACuB;CACvB,IAAI,CAAC,GAAS,aAAa;CAC3B,IAAI,OAAO,KAAY,YAAY,OAAO;CAC1C,IAAM,IAAM,IAAI,IAAI,CAAO;CAC3B,QAAQ,MAAa,EAAI,IAAI,CAAK;AACpC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Reads a module-level cache, building the entry on its first miss.
3
+ *
4
+ * The `Intl` helpers in `date.ts`, `time.ts` and `file.ts` all keep one: an `Intl` object
5
+ * costs one to two orders of magnitude more to build than to use, and those helpers are
6
+ * called one value at a time. What each cache holds is the helper's own business; the
7
+ * get-or-build around it is the same everywhere, and written here once.
8
+ *
9
+ * `undefined` is the miss marker, so a builder must never return it — none does, every entry
10
+ * being an object, a string or a number.
11
+ */
12
+ export declare function memo<K, V>(cache: Map<K, V>, key: K, build: () => V): V;
@@ -0,0 +1,9 @@
1
+ //#region src/utils/memo.ts
2
+ function e(e, t, n) {
3
+ let r = e.get(t);
4
+ return r === void 0 && (r = n(), e.set(t, r)), r;
5
+ }
6
+ //#endregion
7
+ export { e as memo };
8
+
9
+ //# sourceMappingURL=memo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memo.js","names":[],"sources":["../../src/utils/memo.ts"],"sourcesContent":["// @core\n/**\n * Reads a module-level cache, building the entry on its first miss.\n *\n * The `Intl` helpers in `date.ts`, `time.ts` and `file.ts` all keep one: an `Intl` object\n * costs one to two orders of magnitude more to build than to use, and those helpers are\n * called one value at a time. What each cache holds is the helper's own business; the\n * get-or-build around it is the same everywhere, and written here once.\n *\n * `undefined` is the miss marker, so a builder must never return it — none does, every entry\n * being an object, a string or a number.\n */\nexport function memo<K, V>(cache: Map<K, V>, key: K, build: () => V): V {\n let value = cache.get(key)\n if (value === undefined) {\n value = build()\n cache.set(key, value)\n }\n return value\n}\n"],"mappings":";AAYA,SAAgB,EAAW,GAAkB,GAAQ,GAAmB;CACtE,IAAI,IAAQ,EAAM,IAAI,CAAG;CAKzB,OAJI,MAAU,KAAA,MACZ,IAAQ,EAAM,GACd,EAAM,IAAI,GAAK,CAAK,IAEf;AACT"}
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Holds a number between a lower and an upper bound.
3
3
  *
4
- * When the two bounds cross over — which happens as soon as the upper one is worked out
5
- * from something empty, the last position of a list with nothing in it being one short of
6
- * the first — the LOWER bound wins. It is the one that is always a position something can
7
- * sit at.
4
+ * On an empty interval the LOWER bound wins, which is deliberate: `max` is often derived
5
+ * from a list, and an empty one puts its last position one short of its first. The lower
6
+ * bound is the one that is always somewhere a value can sit.
8
7
  */
9
8
  export declare function clamp(n: number, min: number, max: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"number.js","names":[],"sources":["../../src/utils/number.ts"],"sourcesContent":["// @core\n/**\n * Holds a number between a lower and an upper bound.\n *\n * When the two bounds cross over — which happens as soon as the upper one is worked out\n * from something empty, the last position of a list with nothing in it being one short of\n * the first — the LOWER bound wins. It is the one that is always a position something can\n * sit at.\n */\nexport function clamp(n: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, n))\n}\n"],"mappings":";AASA,SAAgB,EAAM,GAAW,GAAa,GAAqB;CACjE,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAC,CAAC;AACvC"}
1
+ {"version":3,"file":"number.js","names":[],"sources":["../../src/utils/number.ts"],"sourcesContent":["// @core\n/**\n * Holds a number between a lower and an upper bound.\n *\n * On an empty interval the LOWER bound wins, which is deliberate: `max` is often derived\n * from a list, and an empty one puts its last position one short of its first. The lower\n * bound is the one that is always somewhere a value can sit.\n */\nexport function clamp(n: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, n))\n}\n"],"mappings":";AAQA,SAAgB,EAAM,GAAW,GAAa,GAAqB;CACjE,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAC,CAAC;AACvC"}
@@ -1,19 +1,30 @@
1
1
  /**
2
- * The form of a text used for COMPARING it: capitals and accents no longer count.
2
+ * The form of a text used for COMPARING it: case and accents no longer count.
3
3
  *
4
- * The accents are removed by pulling each letter apart into the plain letter and the mark
5
- * above it, then dropping the marks. This is used wherever the design system matches a
6
- * list against what someone has typed — searching for "e" must find "é", since nobody
7
- * expects to have to reach for the right accent to find a name.
4
+ * NFD splits each letter into the plain letter and its mark, and the marks are dropped.
5
+ * Used wherever the library matches a list against what someone typed: searching "e" has
6
+ * to find "é", nobody reaching for the right accent to find a name.
8
7
  */
9
8
  export declare function normalizeText(s: string): string;
9
+ /**
10
+ * A memory of `normalizeText` results, filed under the object a text belongs to — a table row,
11
+ * a combobox option — and under a field name when one object holds several texts.
12
+ *
13
+ * A filter normalizes the whole list again on every keystroke, and normalizing decomposes,
14
+ * strips and lowercases each string: this is what makes the second keystroke cost a lookup.
15
+ *
16
+ * The raw text is passed on EVERY call and compared with the one remembered, rather than the
17
+ * list being derived once: that is what notices a label edited in place, which a value keyed
18
+ * on the list alone would not. And the memory is a `WeakMap` keyed by the owner, so replacing
19
+ * the list lets the old entries be collected with no invalidation written anywhere.
20
+ */
21
+ export declare function createNormalizedCache<K extends object>(): (owner: K, raw: string, field?: string) => string;
10
22
  /** A whole number written on two digits, so that 7 becomes "07" — as dates and times are. */
11
23
  export declare function pad2(n: number): string;
12
24
  /**
13
- * Just the digits of a text, everything else thrown away.
25
+ * Just the digits of a string, everything else dropped.
14
26
  *
15
- * It knows nothing of dates or of times, and that is why it lives among the text helpers
16
- * rather than with either of them: the fields one types a date or a time into only ever
17
- * deal in the run of digits, and place the separators between them themselves.
27
+ * It knows nothing of dates or times, which is why it lives here rather than with either:
28
+ * the masked fields only ever handle the run of digits and place the separators themselves.
18
29
  */
19
30
  export declare const digitsOf: (text: string) => string;
@@ -2,11 +2,25 @@
2
2
  function e(e) {
3
3
  return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
4
4
  }
5
- function t(e) {
5
+ function t() {
6
+ let t = /* @__PURE__ */ new WeakMap();
7
+ return (n, r, i = "") => {
8
+ let a = t.get(n);
9
+ a || (a = /* @__PURE__ */ new Map(), t.set(n, a));
10
+ let o = a.get(i);
11
+ if (o && o.raw === r) return o.normalized;
12
+ let s = e(r);
13
+ return a.set(i, {
14
+ raw: r,
15
+ normalized: s
16
+ }), s;
17
+ };
18
+ }
19
+ function n(e) {
6
20
  return String(e).padStart(2, "0");
7
21
  }
8
- var n = (e) => e.replace(/\D/g, "");
22
+ var r = (e) => e.replace(/\D/g, "");
9
23
  //#endregion
10
- export { n as digitsOf, e as normalizeText, t as pad2 };
24
+ export { t as createNormalizedCache, r as digitsOf, e as normalizeText, n as pad2 };
11
25
 
12
26
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["// @core\n/**\n * The form of a text used for COMPARING it: capitals and accents no longer count.\n *\n * The accents are removed by pulling each letter apart into the plain letter and the mark\n * above it, then dropping the marks. This is used wherever the design system matches a\n * list against what someone has typed — searching for \"e\" must find \"é\", since nobody\n * expects to have to reach for the right accent to find a name.\n */\nexport function normalizeText(s: string): string {\n return s\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n}\n\n// @core\n/** A whole number written on two digits, so that 7 becomes \"07\" — as dates and times are. */\nexport function pad2(n: number): string {\n return String(n).padStart(2, '0')\n}\n\n// @core\n/**\n * Just the digits of a text, everything else thrown away.\n *\n * It knows nothing of dates or of times, and that is why it lives among the text helpers\n * rather than with either of them: the fields one types a date or a time into only ever\n * deal in the run of digits, and place the separators between them themselves.\n */\nexport const digitsOf = (text: string): string => text.replace(/\\D/g, '')\n"],"mappings":";AASA,SAAgB,EAAc,GAAmB;CAC/C,OAAO,EACJ,UAAU,KAAK,CAAC,CAChB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,YAAY;AACjB;AAIA,SAAgB,EAAK,GAAmB;CACtC,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;AAClC;AAUA,IAAa,KAAY,MAAyB,EAAK,QAAQ,OAAO,EAAE"}
1
+ {"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["// @core\n/**\n * The form of a text used for COMPARING it: case and accents no longer count.\n *\n * NFD splits each letter into the plain letter and its mark, and the marks are dropped.\n * Used wherever the library matches a list against what someone typed: searching \"e\" has\n * to find \"é\", nobody reaching for the right accent to find a name.\n */\nexport function normalizeText(s: string): string {\n return s\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n}\n\n// @core\n/**\n * A memory of `normalizeText` results, filed under the object a text belongs to — a table row,\n * a combobox option — and under a field name when one object holds several texts.\n *\n * A filter normalizes the whole list again on every keystroke, and normalizing decomposes,\n * strips and lowercases each string: this is what makes the second keystroke cost a lookup.\n *\n * The raw text is passed on EVERY call and compared with the one remembered, rather than the\n * list being derived once: that is what notices a label edited in place, which a value keyed\n * on the list alone would not. And the memory is a `WeakMap` keyed by the owner, so replacing\n * the list lets the old entries be collected with no invalidation written anywhere.\n */\nexport function createNormalizedCache<K extends object>() {\n const cache = new WeakMap<K, Map<string, { raw: string; normalized: string }>>()\n return (owner: K, raw: string, field = ''): string => {\n let texts = cache.get(owner)\n if (!texts) {\n texts = new Map()\n cache.set(owner, texts)\n }\n const hit = texts.get(field)\n if (hit && hit.raw === raw) return hit.normalized\n const normalized = normalizeText(raw)\n texts.set(field, { raw, normalized })\n return normalized\n }\n}\n\n// @core\n/** A whole number written on two digits, so that 7 becomes \"07\" — as dates and times are. */\nexport function pad2(n: number): string {\n return String(n).padStart(2, '0')\n}\n\n// @core\n/**\n * Just the digits of a string, everything else dropped.\n *\n * It knows nothing of dates or times, which is why it lives here rather than with either:\n * the masked fields only ever handle the run of digits and place the separators themselves.\n */\nexport const digitsOf = (text: string): string => text.replace(/\\D/g, '')\n"],"mappings":";AAQA,SAAgB,EAAc,GAAmB;CAC/C,OAAO,EACJ,UAAU,KAAK,CAAC,CAChB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,YAAY;AACjB;AAeA,SAAgB,IAA0C;CACxD,IAAM,oBAAQ,IAAI,QAA6D;CAC/E,QAAQ,GAAU,GAAa,IAAQ,OAAe;EACpD,IAAI,IAAQ,EAAM,IAAI,CAAK;EAC3B,AAAK,MACH,oBAAQ,IAAI,IAAI,GAChB,EAAM,IAAI,GAAO,CAAK;EAExB,IAAM,IAAM,EAAM,IAAI,CAAK;EAC3B,IAAI,KAAO,EAAI,QAAQ,GAAK,OAAO,EAAI;EACvC,IAAM,IAAa,EAAc,CAAG;EAEpC,OADA,EAAM,IAAI,GAAO;GAAE;GAAK;EAAW,CAAC,GAC7B;CACT;AACF;AAIA,SAAgB,EAAK,GAAmB;CACtC,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;AAClC;AASA,IAAa,KAAY,MAAyB,EAAK,QAAQ,OAAO,EAAE"}