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.
- package/README.md +40 -6
- package/dist/components/VAccordion/VAccordion.css +1 -1
- package/dist/components/VAccordion/VAccordion.d.ts +9 -16
- package/dist/components/VAccordion/VAccordion.js.map +1 -1
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.css +1 -1
- package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.d.ts +1 -8
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.css +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +44 -29
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +6 -10
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.css +1 -1
- package/dist/components/VBadge/VBadge.d.ts +31 -10
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButton.css +1 -1
- package/dist/components/VButton/VButton.d.ts +30 -10
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.css +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +76 -13
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/context.d.ts +30 -0
- package/dist/components/VButton/context.js +6 -0
- package/dist/components/VButton/context.js.map +1 -0
- package/dist/components/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +50 -36
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.css +1 -1
- package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.css +1 -1
- package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.css +1 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +158 -0
- package/dist/components/VCalendar/gesture.js +170 -0
- package/dist/components/VCalendar/gesture.js.map +1 -0
- package/dist/components/VCalendar/keyboard.d.ts +9 -3
- package/dist/components/VCalendar/keyboard.js +2 -6
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +67 -54
- package/dist/components/VCalendar/layout.js +77 -69
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +55 -0
- package/dist/components/VCalendar/timeGrid.js +71 -0
- package/dist/components/VCalendar/timeGrid.js.map +1 -0
- package/dist/components/VCalendar/types.d.ts +41 -16
- package/dist/components/VCarousel/VCarousel.css +1 -1
- package/dist/components/VCarousel/VCarousel.d.ts +21 -41
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
- package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/context.d.ts +0 -12
- package/dist/components/VCarousel/context.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.css +1 -1
- package/dist/components/VChip/VChip.d.ts +36 -26
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.css +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +127 -31
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.css +1 -1
- package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
- package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.css +1 -1
- package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
- package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +50 -28
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.css +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +90 -42
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.css +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialog.css +1 -1
- package/dist/components/VDialog/VDialog.d.ts +45 -33
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
- package/dist/components/VDialog/VDialogAlert.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.css +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +78 -26
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.css +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.d.ts +2 -27
- package/dist/components/VFilePicker/fileKind.js +9 -8
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.css +1 -1
- package/dist/components/VIcon/VIcon.d.ts +15 -6
- package/dist/components/VIcon/VIcon.js.map +1 -1
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VIcon/iconProps.js.map +1 -1
- package/dist/components/VIcon/icons/index.d.ts +1 -1
- package/dist/components/VIcon/icons/index.js.map +1 -1
- package/dist/components/VIcon/icons/names.d.ts +1 -1
- package/dist/components/VIcon/icons/names.js.map +1 -1
- package/dist/components/VIcon/resolver.d.ts +3 -3
- package/dist/components/VIcon/resolver.js.map +1 -1
- package/dist/components/VIcon/types.d.ts +12 -12
- package/dist/components/VIconButton/VIconButton.css +1 -1
- package/dist/components/VIconButton/VIconButton.d.ts +28 -11
- package/dist/components/VIconButton/VIconButton.js.map +1 -1
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInput.css +1 -1
- package/dist/components/VInput/VInput.d.ts +26 -7
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +2 -0
- package/dist/components/VInput/VInputGroup.d.ts +47 -0
- package/dist/components/VInput/VInputGroup.js +9 -0
- package/dist/components/VInput/VInputGroup.js.map +1 -0
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VInput/context.d.ts +11 -0
- package/dist/components/VInput/context.js +6 -0
- package/dist/components/VInput/context.js.map +1 -0
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.d.ts +23 -30
- package/dist/components/VMenu/VMenu.js.map +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.css +1 -1
- package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.css +1 -1
- package/dist/components/VMenu/VMenuItem.d.ts +11 -19
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +2 -6
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.css +1 -1
- package/dist/components/VPagination/VPagination.d.ts +60 -22
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VPopover/VPopover.css +1 -1
- package/dist/components/VPopover/VPopover.d.ts +26 -7
- package/dist/components/VPopover/VPopover.js.map +1 -1
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.css +1 -1
- package/dist/components/VRadio/VRadio.d.ts +36 -18
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +4 -2
- package/dist/components/VSeparator/VSeparator.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/context.d.ts +0 -14
- package/dist/components/VSideNavigation/context.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSlider/VSlider.css +1 -1
- package/dist/components/VSlider/VSlider.d.ts +52 -27
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.css +1 -1
- package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +0 -27
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.css +1 -1
- package/dist/components/VSpinner/VSpinner.d.ts +6 -6
- package/dist/components/VSpinner/VSpinner.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.css +1 -1
- package/dist/components/VSwitch/VSwitch.d.ts +35 -13
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTab.css +1 -1
- package/dist/components/VTabs/VTab.d.ts +12 -12
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.d.ts +2 -10
- package/dist/components/VTabs/VTabPanel.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.css +1 -1
- package/dist/components/VTabs/VTabs.d.ts +27 -18
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/context.d.ts +9 -19
- package/dist/components/VTabs/context.js +1 -1
- package/dist/components/VTabs/context.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.css +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +34 -6
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.css +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +24 -0
- package/dist/components/VTimeInput/search.js +22 -0
- package/dist/components/VTimeInput/search.js.map +1 -0
- package/dist/components/VTimePicker/VTimePicker.css +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +88 -0
- package/dist/components/VTimePicker/limits.js +70 -0
- package/dist/components/VTimePicker/limits.js.map +1 -0
- package/dist/components/VToast/VToast.css +1 -1
- package/dist/components/VToast/VToast.d.ts +0 -10
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/VToaster.css +1 -1
- package/dist/components/VToast/VToaster.d.ts +0 -17
- package/dist/components/VToast/VToaster.js.map +1 -1
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +10 -19
- package/dist/components/VToast/state.js +1 -1
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.css +1 -1
- package/dist/components/VToggle/VToggle.d.ts +56 -11
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +16 -2
- package/dist/components/VToggle/VToggleItem.js +0 -2
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/context.d.ts +4 -24
- package/dist/components/VToggle/context.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.css +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +9 -33
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTypography/VTypography.js.map +1 -1
- package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useAriaLabel.d.ts +0 -17
- package/dist/composables/useAriaLabel.js.map +1 -1
- package/dist/composables/useClearable.d.ts +42 -0
- package/dist/composables/useClearable.js +19 -0
- package/dist/composables/useClearable.js.map +1 -0
- package/dist/composables/useControlShape.d.ts +22 -0
- package/dist/composables/useControlShape.js +13 -0
- package/dist/composables/useControlShape.js.map +1 -0
- package/dist/composables/useDetailsOpen.d.ts +22 -0
- package/dist/composables/useDetailsOpen.js +21 -0
- package/dist/composables/useDetailsOpen.js.map +1 -0
- package/dist/composables/useFieldIds.d.ts +0 -15
- package/dist/composables/useFieldIds.js +8 -7
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +21 -18
- package/dist/composables/useFieldPanel.js +43 -23
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.d.ts +0 -22
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +45 -17
- package/dist/composables/useFileField.js +40 -20
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useFocusoutDismiss.d.ts +0 -15
- package/dist/composables/useFocusoutDismiss.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +29 -14
- package/dist/composables/useIconClickHandlers.js +15 -5
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.d.ts +20 -0
- package/dist/composables/useInertLink.js +23 -0
- package/dist/composables/useInertLink.js.map +1 -0
- package/dist/composables/useMaskedField.d.ts +33 -10
- package/dist/composables/useMaskedField.js +45 -1
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +15 -1
- package/dist/composables/usePopover.js +23 -8
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.d.ts +5 -8
- package/dist/composables/useProgressValue.js +6 -3
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +12 -19
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useTimer.d.ts +8 -10
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.d.ts +2 -10
- package/dist/i18n/en.js +18 -19
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.d.ts +2 -18
- package/dist/i18n/fr.js +18 -19
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +44 -47
- package/dist/i18n/state.js +20 -17
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +53 -44
- package/dist/icons.d.ts +3 -3
- package/dist/index.d.ts +43 -17
- package/dist/index.js +45 -44
- package/dist/styles.css +1 -1
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.d.ts +5 -1
- package/dist/tokens/primitives.js.map +1 -1
- package/dist/tokens/semantic.d.ts +5 -1
- package/dist/tokens/semantic.js +6 -2
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens/types.d.ts +7 -15
- package/dist/tokens/types.js.map +1 -1
- package/dist/tokens.json +25 -5
- package/dist/types.d.ts +24 -0
- package/dist/utils/array.d.ts +3 -6
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/arrowNav.d.ts +17 -17
- package/dist/utils/arrowNav.js +5 -3
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +11 -15
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/css.d.ts +22 -11
- package/dist/utils/css.js +5 -2
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +42 -19
- package/dist/utils/date.js +97 -98
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +6 -12
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +5 -6
- package/dist/utils/file.d.ts +46 -58
- package/dist/utils/file.js +43 -36
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +8 -17
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +12 -0
- package/dist/utils/hostWarns.js +6 -0
- package/dist/utils/hostWarns.js.map +1 -0
- package/dist/utils/ids.d.ts +10 -0
- package/dist/utils/ids.js +8 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/matcher.d.ts +5 -9
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +12 -0
- package/dist/utils/memo.js +9 -0
- package/dist/utils/memo.js.map +1 -0
- package/dist/utils/number.d.ts +3 -4
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/text.d.ts +20 -9
- package/dist/utils/text.js +17 -3
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +53 -61
- package/dist/utils/time.js +49 -45
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +8 -15
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/VToggle/VToggleItem.css +0 -2
package/dist/utils/file.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
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
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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
|
|
28
|
-
*
|
|
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 —
|
|
34
|
-
*
|
|
35
|
-
*
|
|
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
|
-
*
|
|
42
|
-
*
|
|
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
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
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
|
|
61
|
-
*
|
|
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
|
-
*
|
|
78
|
-
*
|
|
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
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
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
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
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[];
|
package/dist/utils/file.js
CHANGED
|
@@ -1,70 +1,77 @@
|
|
|
1
|
+
import { memo as e } from "./memo.js";
|
|
1
2
|
//#region src/utils/file.ts
|
|
2
|
-
function
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
],
|
|
16
|
-
function
|
|
17
|
-
|
|
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:
|
|
27
|
+
unit: o[n],
|
|
21
28
|
unitDisplay: "short",
|
|
22
|
-
maximumFractionDigits:
|
|
23
|
-
})
|
|
29
|
+
maximumFractionDigits: c(n)
|
|
30
|
+
}));
|
|
24
31
|
}
|
|
25
|
-
function
|
|
26
|
-
let
|
|
27
|
-
return Math.round(
|
|
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
|
|
30
|
-
let
|
|
31
|
-
for (let
|
|
32
|
-
if (!
|
|
33
|
-
|
|
34
|
-
file:
|
|
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 (
|
|
40
|
-
|
|
41
|
-
file:
|
|
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 (
|
|
47
|
-
|
|
48
|
-
file:
|
|
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 (
|
|
54
|
-
|
|
55
|
-
file:
|
|
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
|
-
|
|
67
|
+
a.push(t), s += t.size;
|
|
61
68
|
}
|
|
62
69
|
return {
|
|
63
|
-
accepted:
|
|
64
|
-
rejected:
|
|
70
|
+
accepted: a,
|
|
71
|
+
rejected: o
|
|
65
72
|
};
|
|
66
73
|
}
|
|
67
74
|
//#endregion
|
|
68
|
-
export { a as formatBytes,
|
|
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
|
package/dist/utils/file.js.map
CHANGED
|
@@ -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"}
|
package/dist/utils/focus.d.ts
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Whether this element is focused the way a keyboard user focuses things.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
21
|
-
*
|
|
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;
|
package/dist/utils/focus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","names":[],"sources":["../../src/utils/focus.ts"],"sourcesContent":["/**\n *
|
|
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 @@
|
|
|
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 @@
|
|
|
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"}
|
package/dist/utils/matcher.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Turns
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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
|
-
*
|
|
9
|
-
*
|
|
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
|
|
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 @@
|
|
|
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"}
|
package/dist/utils/number.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Holds a number between a lower and an upper bound.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* from
|
|
6
|
-
*
|
|
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;
|
package/dist/utils/number.js.map
CHANGED
|
@@ -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 *
|
|
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"}
|
package/dist/utils/text.d.ts
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The form of a text used for COMPARING it:
|
|
2
|
+
* The form of a text used for COMPARING it: case and accents no longer count.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
|
25
|
+
* Just the digits of a string, everything else dropped.
|
|
14
26
|
*
|
|
15
|
-
* It knows nothing of dates or
|
|
16
|
-
*
|
|
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;
|
package/dist/utils/text.js
CHANGED
|
@@ -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(
|
|
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
|
|
22
|
+
var r = (e) => e.replace(/\D/g, "");
|
|
9
23
|
//#endregion
|
|
10
|
-
export {
|
|
24
|
+
export { t as createNormalizedCache, r as digitsOf, e as normalizeText, n as pad2 };
|
|
11
25
|
|
|
12
26
|
//# sourceMappingURL=text.js.map
|
package/dist/utils/text.js.map
CHANGED
|
@@ -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:
|
|
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"}
|