vectis-ui 0.10.1 → 0.10.2
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/dist/components/VAccordion/VAccordion.js.map +1 -1
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.d.ts +6 -21
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +2 -12
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +2 -2
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +1 -5
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.d.ts +13 -27
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +3 -9
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButton.d.ts +10 -17
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +6 -15
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/context.d.ts +1 -9
- package/dist/components/VButton/context.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +9 -24
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.d.ts +4 -13
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +1 -5
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/color.d.ts +1 -7
- package/dist/components/VCalendar/color.js.map +1 -1
- package/dist/components/VCalendar/edgeStep.d.ts +5 -15
- package/dist/components/VCalendar/edgeStep.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +12 -36
- package/dist/components/VCalendar/gesture.js.map +1 -1
- package/dist/components/VCalendar/keyboard.d.ts +5 -42
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +38 -199
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +3 -25
- package/dist/components/VCalendar/timeGrid.js.map +1 -1
- package/dist/components/VCalendar/types.d.ts +6 -23
- package/dist/components/VCarousel/VCarousel.d.ts +25 -96
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +1 -6
- 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.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +1 -5
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.d.ts +2 -8
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +21 -59
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +117 -119
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
- 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.d.ts +4 -10
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +11 -36
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +23 -20
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +12 -21
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/mask.d.ts +14 -59
- package/dist/components/VDateInput/mask.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +6 -12
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/keyboard.d.ts +10 -42
- package/dist/components/VDatePicker/keyboard.js.map +1 -1
- package/dist/components/VDatePicker/names.d.ts +8 -22
- package/dist/components/VDatePicker/names.js.map +1 -1
- package/dist/components/VDialog/VDialog.d.ts +5 -10
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +51 -53
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.d.ts +2 -3
- package/dist/components/VDialog/VDialogAlert.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +11 -37
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/truncate.d.ts +3 -23
- package/dist/components/VFileInput/truncate.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +15 -65
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +6 -15
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.d.ts +10 -49
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.d.ts +7 -19
- package/dist/components/VIcon/VIcon.js.map +1 -1
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VIcon/iconProps.d.ts +5 -19
- package/dist/components/VIcon/iconProps.js.map +1 -1
- package/dist/components/VIcon/resolver.d.ts +15 -43
- package/dist/components/VIcon/resolver.js.map +1 -1
- package/dist/components/VIcon/types.d.ts +7 -34
- package/dist/components/VIconButton/VIconButton.d.ts +2 -3
- package/dist/components/VIconButton/VIconButton.js.map +1 -1
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInput.d.ts +14 -29
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.js.map +1 -1
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +34 -50
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/context.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +8 -16
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +55 -63
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.js.map +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.d.ts +1 -6
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.d.ts +0 -5
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +1 -6
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuSeparator.js.map +1 -1
- package/dist/components/VMenu/VMenuSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +3 -11
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.d.ts +9 -20
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VPopover/VPopover.d.ts +7 -18
- package/dist/components/VPopover/VPopover.js.map +1 -1
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +23 -27
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -6
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +4 -15
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.d.ts +1 -5
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +2 -15
- 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.d.ts +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +1 -5
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +1 -5
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +80 -75
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationSeparator.js.map +1 -1
- package/dist/components/VSideNavigation/context.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +6 -19
- 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.d.ts +5 -13
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +4 -17
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.d.ts +3 -5
- package/dist/components/VSpinner/VSpinner.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTab.d.ts +1 -5
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.d.ts +5 -17
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/context.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +13 -20
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +8 -21
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +3 -34
- package/dist/components/VTimeInput/search.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +9 -31
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +18 -45
- package/dist/components/VTimePicker/limits.js.map +1 -1
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/VToaster.js.map +1 -1
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +2 -7
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.d.ts +5 -9
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +1 -9
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/context.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +3 -16
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTypography/VTypography.d.ts +4 -8
- 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.js.map +1 -1
- package/dist/composables/useClearable.d.ts +2 -8
- package/dist/composables/useClearable.js.map +1 -1
- package/dist/composables/useControlShape.js.map +1 -1
- package/dist/composables/useDetailsOpen.d.ts +2 -10
- package/dist/composables/useDetailsOpen.js.map +1 -1
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +4 -17
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +1 -5
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useFocusoutDismiss.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +4 -19
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.d.ts +1 -1
- package/dist/composables/useInertLink.js.map +1 -1
- package/dist/composables/useLiveAnnouncer.js.map +1 -1
- package/dist/composables/useMaskedField.d.ts +12 -27
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +3 -11
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +0 -9
- package/dist/composables/useRootAttrs.js +11 -4
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useSlotNodes.d.ts +3 -14
- package/dist/composables/useSlotNodes.js.map +1 -1
- package/dist/composables/useTextLimit.d.ts +4 -16
- package/dist/composables/useTextLimit.js.map +1 -1
- package/dist/composables/useTimer.d.ts +2 -15
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +9 -38
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +19 -81
- package/dist/icons.d.ts +2 -12
- package/dist/tokens/css.d.ts +3 -16
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/primitives.js.map +1 -1
- package/dist/tokens/semantic.d.ts +1 -23
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens/types.d.ts +2 -12
- package/dist/tokens/types.js.map +1 -1
- package/dist/types.d.ts +3 -21
- package/dist/utils/array.d.ts +2 -4
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/arrowNav.d.ts +2 -26
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +1 -8
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/clock.d.ts +16 -39
- package/dist/utils/clock.js.map +1 -1
- package/dist/utils/css.d.ts +5 -16
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +17 -60
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +2 -9
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +2 -15
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/file.d.ts +8 -46
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +1 -14
- package/dist/utils/focus.js +1 -6
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +3 -8
- package/dist/utils/hostWarns.js.map +1 -1
- package/dist/utils/ids.d.ts +2 -7
- package/dist/utils/ids.js.map +1 -1
- package/dist/utils/matcher.d.ts +1 -8
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +1 -11
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/number.d.ts +1 -7
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/text.d.ts +4 -23
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +4 -12
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +0 -10
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +1 -1
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 * 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 // The byte rung is spelled out, plural included: CLDR's short English name for a\n // byte is the word \"byte\" itself, which printed \"999 byte\".\n unitDisplay: step === 0 ? 'long' : '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;EAGZ,aAAa,MAAS,IAAI,SAAS;EACnC,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
|
+
{"version":3,"file":"file.js","names":[],"sources":["../../src/utils/file.ts"],"sourcesContent":["// @core\n/**\n * Pure file screening and formatting; return accepted files and rejection reasons for\n * components to emit.\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 * `file.type` is the browser's GUESS and is often empty (an unknown extension, some Linux\n * setups). A list written only in MIME types then turns away a perfectly good file, which is\n * 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/** A stable key per FILE OBJECT, for the `v-for` of a file list. */\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, and a\n * running total is rewritten every time a file is added; so one is built per language and rung,\n * 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 // The byte rung is spelled out, plural included: CLDR's short English name for a\n // byte is the word \"byte\" itself, which printed \"999 byte\".\n unitDisplay: step === 0 ? 'long' : 'short',\n maximumFractionDigits: digitsFor(step),\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 French. */\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/** Why a file was turned away: its kind, its size, how many there already are, or the total. */\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 and\n * one rejection per refusal. What is already chosen counts towards both the count and the\n * running total, so a second drop obeys the same 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":";;AAiBA,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;AAOA,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;AAGA,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;EAGZ,aAAa,MAAS,IAAI,SAAS;EACnC,uBAAuB,EAAU,CAAI;CACvC,CAAC,CACL;AACF;AAGA,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;AA2BA,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,15 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Whether this element is focused the way a keyboard user focuses things.
|
|
3
|
-
*
|
|
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.
|
|
9
|
-
*
|
|
10
|
-
* TRAP for the tests: jsdom is NOT that environment. It parses `:focus-visible` happily and
|
|
11
|
-
* answers `false` for everything, a genuinely focused element included, so the `catch` never
|
|
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.
|
|
14
|
-
*/
|
|
1
|
+
/** Use the browser's focus-visible heuristic to distinguish keyboard focus. */
|
|
15
2
|
export declare function isKeyboardFocus(target: EventTarget | null): boolean;
|
package/dist/utils/focus.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
//#region src/utils/focus.ts
|
|
2
2
|
function e(e) {
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
return e.matches(":focus-visible");
|
|
6
|
-
} catch {
|
|
7
|
-
return !0;
|
|
8
|
-
}
|
|
3
|
+
return e instanceof Element && e.matches(":focus-visible");
|
|
9
4
|
}
|
|
10
5
|
//#endregion
|
|
11
6
|
export { e as isKeyboardFocus };
|
package/dist/utils/focus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","names":[],"sources":["../../src/utils/focus.ts"],"sourcesContent":["// @a11y
|
|
1
|
+
{"version":3,"file":"focus.js","names":[],"sources":["../../src/utils/focus.ts"],"sourcesContent":["// @a11y\n/** Use the browser's focus-visible heuristic to distinguish keyboard focus. */\nexport function isKeyboardFocus(target: EventTarget | null): boolean {\n return target instanceof Element && target.matches(':focus-visible')\n}\n"],"mappings":";AAEA,SAAgB,EAAgB,GAAqC;CACnE,OAAO,aAAkB,WAAW,EAAO,QAAQ,gBAAgB;AACrE"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { InjectionKey } from 'vue';
|
|
2
2
|
/**
|
|
3
|
-
* Provided by a component that renders another with props it has ALREADY checked and
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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.
|
|
3
|
+
* Provided by a component that renders another with props it has ALREADY checked and reported
|
|
4
|
+
* on: VDateInput for VDatePicker's bounds, VTimeInput for VTimePicker's step and restrictions,
|
|
5
|
+
* both forwarded as they stand.
|
|
11
6
|
*/
|
|
12
7
|
export declare const hostWarnsKey: InjectionKey<true>;
|
|
@@ -1 +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 *
|
|
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 reported\n * on: VDateInput for VDatePicker's bounds, VTimeInput for VTimePicker's step and restrictions,\n * both forwarded as they stand.\n */\nexport const hostWarnsKey: InjectionKey<true> = Symbol('vectisHostWarns')\n"],"mappings":";AAOA,IAAa,IAAmC,OAAO,iBAAiB"}
|
package/dist/utils/ids.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
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.
|
|
2
|
+
* Omit empty ID references and return undefined for an empty list so ARIA attributes are
|
|
3
|
+
* removed rather than left blank.
|
|
9
4
|
*/
|
|
10
5
|
export declare function joinIds(...ids: (string | false | null | undefined)[]): string | undefined;
|
package/dist/utils/ids.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","names":[],"sources":["../../src/utils/ids.ts"],"sourcesContent":["// @a11y\n/**\n *
|
|
1
|
+
{"version":3,"file":"ids.js","names":[],"sources":["../../src/utils/ids.ts"],"sourcesContent":["// @a11y\n/**\n * Omit empty ID references and return undefined for an empty list so ARIA attributes are\n * removed rather than left blank.\n */\nexport function joinIds(...ids: (string | false | null | undefined)[]): string | undefined {\n return ids.filter(Boolean).join(' ') || undefined\n}\n"],"mappings":";AAKA,SAAgB,EAAQ,GAAG,GAAgE;CACzF,OAAO,EAAI,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;AAC1C"}
|
package/dist/utils/matcher.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
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.
|
|
5
|
-
*
|
|
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.
|
|
8
|
-
*/
|
|
1
|
+
/** Resolve matchers once in a computed value so repeated cell lookups reuse the compiled Set. */
|
|
9
2
|
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
|
|
1
|
+
{"version":3,"file":"matcher.js","names":[],"sources":["../../src/utils/matcher.ts"],"sourcesContent":["// @core\n/** Resolve matchers once in a computed value so repeated cell lookups reuse the compiled Set. */\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":";AAEA,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"}
|
package/dist/utils/memo.d.ts
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
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
|
-
*/
|
|
1
|
+
/** undefined marks a cache miss; builders must return a defined value. */
|
|
12
2
|
export declare function memo<K, V>(cache: Map<K, V>, key: K, build: () => V): V;
|
package/dist/utils/memo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memo.js","names":[],"sources":["../../src/utils/memo.ts"],"sourcesContent":["// @core\n
|
|
1
|
+
{"version":3,"file":"memo.js","names":[],"sources":["../../src/utils/memo.ts"],"sourcesContent":["// @core\n/** undefined marks a cache miss; builders must return a defined value. */\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":";AAEA,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,8 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Holds a number between a lower and an upper bound.
|
|
3
|
-
*
|
|
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.
|
|
7
|
-
*/
|
|
1
|
+
/** Clamp to the lower bound when the interval is empty, as with the last index of an empty list. */
|
|
8
2
|
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
|
|
1
|
+
{"version":3,"file":"number.js","names":[],"sources":["../../src/utils/number.ts"],"sourcesContent":["// @core\n/** Clamp to the lower bound when the interval is empty, as with the last index of an empty list. */\nexport function clamp(n: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, n))\n}\n"],"mappings":";AAEA,SAAgB,EAAM,GAAW,GAAa,GAAqB;CACjE,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAC,CAAC;AACvC"}
|
package/dist/utils/text.d.ts
CHANGED
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The form of a text used for COMPARING it: case and accents no longer count.
|
|
3
|
-
*
|
|
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.
|
|
7
|
-
*/
|
|
1
|
+
/** Remove NFD combining marks for accent-insensitive matching. */
|
|
8
2
|
export declare function normalizeText(s: string): string;
|
|
9
3
|
/**
|
|
10
|
-
* A memory of `normalizeText` results, filed under the object a text belongs to: a table row,
|
|
11
|
-
*
|
|
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.
|
|
4
|
+
* A memory of `normalizeText` results, filed under the object a text belongs to: a table row, a
|
|
5
|
+
* combobox option, and under a field name when one object holds several texts.
|
|
20
6
|
*/
|
|
21
7
|
export declare function createNormalizedCache<K extends object>(): (owner: K, raw: string, field?: string) => string;
|
|
22
8
|
/** A whole number written on two digits, so that 7 becomes "07": as dates and times are. */
|
|
23
9
|
export declare function pad2(n: number): string;
|
|
24
|
-
/**
|
|
25
|
-
* Just the digits of a string, everything else dropped.
|
|
26
|
-
*
|
|
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.
|
|
29
|
-
*/
|
|
10
|
+
/** Just the digits of a string, everything else dropped. */
|
|
30
11
|
export declare const digitsOf: (text: string) => string;
|
package/dist/utils/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["// @core\n
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["// @core\n/** Remove NFD combining marks for accent-insensitive matching. */\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, a\n * combobox option, and under a field name when one object holds several texts.\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/** Just the digits of a string, everything else dropped. */\nexport const digitsOf = (text: string): string => text.replace(/\\D/g, '')\n"],"mappings":";AAEA,SAAgB,EAAc,GAAmB;CAC/C,OAAO,EACJ,UAAU,KAAK,CAAC,CAChB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,YAAY;AACjB;AAOA,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;AAIA,IAAa,KAAY,MAAyB,EAAK,QAAQ,OAAO,EAAE"}
|
package/dist/utils/time.d.ts
CHANGED
|
@@ -12,20 +12,12 @@ export declare function parseTime(value: string | null | undefined): TimeParts |
|
|
|
12
12
|
/** Writes an hour and a minute back into the canonical form, both on two digits. */
|
|
13
13
|
export declare function formatTime(hour: number, minute: number): string;
|
|
14
14
|
/**
|
|
15
|
-
* Whether a language counts the hours to twelve, with a morning and an afternoon, or
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* A language tag it cannot make sense of falls back to the 24-hour clock rather than
|
|
19
|
-
* failing.
|
|
15
|
+
* Whether a language counts the hours to twelve, with a morning and an afternoon, or straight
|
|
16
|
+
* to twenty-four. A language tag it cannot make sense of falls back to the 24-hour clock rather
|
|
17
|
+
* than failing.
|
|
20
18
|
*/
|
|
21
19
|
export declare function hourCycleFor(locale: string): HourFormat;
|
|
22
|
-
/**
|
|
23
|
-
* A time written out for a reader: "19:05", or "7:05 PM".
|
|
24
|
-
*
|
|
25
|
-
* `hourCycle` is imposed rather than left to `Intl`, so the text follows what the component
|
|
26
|
-
* settled on: a consumer asking for a 24-hour clock in a locale that would choose otherwise
|
|
27
|
-
* must get theirs.
|
|
28
|
-
*/
|
|
20
|
+
/** A time written out for a reader: "19:05", or "7:05 PM". */
|
|
29
21
|
export declare function formatTimeDisplay(time: string, locale: string, format: HourFormat): string;
|
|
30
22
|
/** A time as minutes since midnight, `null` if it is not one: its position in a list. */
|
|
31
23
|
export declare function minutesOf(time: string | null | undefined): number | null;
|
package/dist/utils/time.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.js","names":[],"sources":["../../src/utils/time.ts"],"sourcesContent":["// @ssr @core
|
|
1
|
+
{"version":3,"file":"time.js","names":[],"sources":["../../src/utils/time.ts"],"sourcesContent":["// @ssr @core\n/**\n * Keep this shared time module small: calendar views import it, while clock and field-specific\n * helpers belong in clock.ts.\n */\nimport { memo } from './memo'\nimport { pad2 } from './text'\n\nexport type HourFormat = '12h' | '24h'\nexport type Meridiem = 'AM' | 'PM'\n\nexport interface TimeParts {\n /** The hour on the 24-hour clock, from 0 to 23. */\n hour: number\n minute: number\n}\n\nconst TIME_RE = /^([01]\\d|2[0-3]):([0-5]\\d)$/\n\n/** Whether something is a time in the canonical form: two digits, a colon, two digits. */\nexport function isValidTime(value: unknown): value is string {\n return typeof value === 'string' && TIME_RE.test(value)\n}\n\n/** Reads a canonical time into its two numbers, or nothing at all if it is not one. */\nexport function parseTime(value: string | null | undefined): TimeParts | null {\n if (!isValidTime(value)) return null\n const [h, m] = value.split(':')\n return { hour: Number(h), minute: Number(m) }\n}\n\n/** Writes an hour and a minute back into the canonical form, both on two digits. */\nexport function formatTime(hour: number, minute: number): string {\n return `${pad2(hour)}:${pad2(minute)}`\n}\n\nconst hourCycleCache = new Map<string, HourFormat>()\n\n// @fallback\n/**\n * Whether a language counts the hours to twelve, with a morning and an afternoon, or straight\n * to twenty-four. A language tag it cannot make sense of falls back to the 24-hour clock rather\n * than failing.\n */\nexport function hourCycleFor(locale: string): HourFormat {\n return memo(hourCycleCache, locale, () => resolveHourCycle(locale))\n}\n\nfunction resolveHourCycle(locale: string): HourFormat {\n try {\n const { hourCycle } = new Intl.DateTimeFormat(locale, { hour: 'numeric' }).resolvedOptions()\n return hourCycle === 'h11' || hourCycle === 'h12' ? '12h' : '24h'\n } catch {\n return '24h'\n }\n}\n\n/** One formatter per locale and clock, module-lived; the `formatterFor` idiom of `file.ts`. */\nconst displayFormatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction displayFormatterFor(locale: string, format: HourFormat): Intl.DateTimeFormat {\n return memo(\n displayFormatters,\n `${locale}|${format}`,\n () =>\n new Intl.DateTimeFormat(locale, {\n hour: 'numeric',\n minute: '2-digit',\n // A 12-hour clock takes the language's own: Japanese counts it from 0 (h11), English\n // from 12 (h12). Imposing h12 wrote 午前12:05 where 午前0:05 is written.\n ...(format === '12h' ? { hour12: true } : { hourCycle: 'h23' as const }),\n timeZone: 'UTC',\n }),\n )\n}\n\n/** A time written out for a reader: \"19:05\", or \"7:05 PM\". */\nexport function formatTimeDisplay(time: string, locale: string, format: HourFormat): string {\n const parts = parseTime(time)\n if (!parts) return ''\n return displayFormatterFor(locale, format).format(Date.UTC(2021, 0, 1, parts.hour, parts.minute))\n}\n\n/** A time as minutes since midnight, `null` if it is not one: its position in a list. */\nexport function minutesOf(time: string | null | undefined): number | null {\n const parts = parseTime(time)\n return parts ? parts.hour * 60 + parts.minute : null\n}\n"],"mappings":";;;AAiBA,IAAM,IAAU;AAGhB,SAAgB,EAAY,GAAiC;CAC3D,OAAO,OAAO,KAAU,YAAY,EAAQ,KAAK,CAAK;AACxD;AAGA,SAAgB,EAAU,GAAoD;CAC5E,IAAI,CAAC,EAAY,CAAK,GAAG,OAAO;CAChC,IAAM,CAAC,GAAG,KAAK,EAAM,MAAM,GAAG;CAC9B,OAAO;EAAE,MAAM,OAAO,CAAC;EAAG,QAAQ,OAAO,CAAC;CAAE;AAC9C;AAGA,SAAgB,EAAW,GAAc,GAAwB;CAC/D,OAAO,GAAG,EAAK,CAAI,EAAE,GAAG,EAAK,CAAM;AACrC;AAEA,IAAM,oBAAiB,IAAI,IAAwB;AAQnD,SAAgB,EAAa,GAA4B;CACvD,OAAO,EAAK,GAAgB,SAAc,EAAiB,CAAM,CAAC;AACpE;AAEA,SAAS,EAAiB,GAA4B;CACpD,IAAI;EACF,IAAM,EAAE,iBAAc,IAAI,KAAK,eAAe,GAAQ,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,gBAAgB;EAC3F,OAAO,MAAc,SAAS,MAAc,QAAQ,QAAQ;CAC9D,QAAQ;EACN,OAAO;CACT;AACF;AAGA,IAAM,oBAAoB,IAAI,IAAiC;AAE/D,SAAS,EAAoB,GAAgB,GAAyC;CACpF,OAAO,EACL,GACA,GAAG,EAAO,GAAG,WAEX,IAAI,KAAK,eAAe,GAAQ;EAC9B,MAAM;EACN,QAAQ;EAGR,GAAI,MAAW,QAAQ,EAAE,QAAQ,GAAK,IAAI,EAAE,WAAW,MAAe;EACtE,UAAU;CACZ,CAAC,CACL;AACF;AAGA,SAAgB,EAAkB,GAAc,GAAgB,GAA4B;CAC1F,IAAM,IAAQ,EAAU,CAAI;CAE5B,OADK,IACE,EAAoB,GAAQ,CAAM,CAAC,CAAC,OAAO,KAAK,IAAI,MAAM,GAAG,GAAG,EAAM,MAAM,EAAM,MAAM,CAAC,IAD7E;AAErB;AAGA,SAAgB,EAAU,GAAgD;CACxE,IAAM,IAAQ,EAAU,CAAI;CAC5B,OAAO,IAAQ,EAAM,OAAO,KAAK,EAAM,SAAS;AAClD"}
|
package/dist/utils/vnode.d.ts
CHANGED
|
@@ -2,15 +2,5 @@ import { VNode } from 'vue';
|
|
|
2
2
|
/**
|
|
3
3
|
* A slot's VNodes reduced to the elements that will actually render: `v-for` Fragments
|
|
4
4
|
* unwrapped, a false `v-if`'s Comment and the source text's whitespace dropped.
|
|
5
|
-
*
|
|
6
|
-
* This is what lets a component count its children without a registry they feed at mount.
|
|
7
|
-
* A registry fills up in the browser and stays empty on the server, so the two renders
|
|
8
|
-
* disagree: VAvatarGroup would say "+0" in one and "+3" in the other. Reading the slot
|
|
9
|
-
* happens while the parent renders, which is the same on both sides.
|
|
10
|
-
*
|
|
11
|
-
* Components never call it on a slot directly: they go through `composables/useSlotNodes`,
|
|
12
|
-
* which redoes the read whenever the parent hands down a new slot. Its consumers are
|
|
13
|
-
* VAvatarGroup for its "+N", VCarousel for its slide count and the index each slide is
|
|
14
|
-
* handed, and VInputGroup for its dev warning on a segment carrying a label.
|
|
15
5
|
*/
|
|
16
6
|
export declare function flattenSlot(nodes: VNode[] | undefined): VNode[];
|
package/dist/utils/vnode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vnode.js","names":[],"sources":["../../src/utils/vnode.ts"],"sourcesContent":["import { Comment, Fragment, Text } from 'vue'\nimport type { VNode } from 'vue'\n\n// @ssr @core\n/**\n * A slot's VNodes reduced to the elements that will actually render: `v-for` Fragments\n * unwrapped, a false `v-if`'s Comment and the source text's whitespace dropped.\n
|
|
1
|
+
{"version":3,"file":"vnode.js","names":[],"sources":["../../src/utils/vnode.ts"],"sourcesContent":["import { Comment, Fragment, Text } from 'vue'\nimport type { VNode } from 'vue'\n\n// @ssr @core\n/**\n * A slot's VNodes reduced to the elements that will actually render: `v-for` Fragments\n * unwrapped, a false `v-if`'s Comment and the source text's whitespace dropped.\n */\nexport function flattenSlot(nodes: VNode[] | undefined): VNode[] {\n const out: VNode[] = []\n for (const node of nodes ?? []) {\n if (node.type === Fragment) out.push(...flattenSlot(node.children as VNode[]))\n else if (node.type === Comment) continue\n else if (node.type === Text && !String(node.children).trim()) continue\n else out.push(node)\n }\n return out\n}\n"],"mappings":";;AAQA,SAAgB,EAAY,GAAqC;CAC/D,IAAM,IAAe,CAAC;CACtB,KAAK,IAAM,KAAQ,KAAS,CAAC,GAC3B,IAAI,EAAK,SAAS,GAAU,EAAI,KAAK,GAAG,EAAY,EAAK,QAAmB,CAAC;MACxE,IAAI,EAAK,SAAS,GAAS;MAC3B,IAAI,EAAK,SAAS,KAAQ,CAAC,OAAO,EAAK,QAAQ,CAAC,CAAC,KAAK,GAAG;MACzD,EAAI,KAAK,CAAI;CAEpB,OAAO;AACT"}
|