vectis-ui 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/components/VAccordion/VAccordionItem.d.ts +4 -6
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +21 -19
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.d.ts +6 -1
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.css +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +5 -3
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +53 -39
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +12 -3
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -20
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +2 -2
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.css +1 -1
- package/dist/components/VBadge/VBadge.d.ts +8 -4
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +5 -4
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +8 -3
- 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 +4 -1
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +8 -7
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- 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/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +15 -6
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +144 -126
- 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 +1 -1
- 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.css +1 -1
- package/dist/components/VCalendar/VCalendarMonth.d.ts +1 -1
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +99 -90
- 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 +3 -3
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +256 -246
- 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.d.ts +8 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +39 -32
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/color.d.ts +1 -1
- package/dist/components/VCalendar/color.js.map +1 -1
- package/dist/components/VCalendar/edgeStep.d.ts +3 -3
- package/dist/components/VCalendar/edgeStep.js +5 -0
- package/dist/components/VCalendar/edgeStep.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +10 -9
- package/dist/components/VCalendar/gesture.js +60 -45
- package/dist/components/VCalendar/gesture.js.map +1 -1
- package/dist/components/VCalendar/keyboard.d.ts +22 -5
- package/dist/components/VCalendar/keyboard.js +17 -16
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +47 -37
- package/dist/components/VCalendar/layout.js +47 -37
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +4 -4
- package/dist/components/VCalendar/timeGrid.js +6 -6
- package/dist/components/VCalendar/timeGrid.js.map +1 -1
- package/dist/components/VCalendar/types.d.ts +5 -5
- package/dist/components/VCarousel/VCarousel.css +1 -1
- package/dist/components/VCarousel/VCarousel.d.ts +59 -38
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +161 -132
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +1 -1
- 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 +1 -1
- package/dist/components/VCarousel/context.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +2 -2
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +10 -8
- 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 +7 -2
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +69 -55
- 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 +50 -36
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +167 -161
- 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.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/infiniteScroll.d.ts +12 -3
- package/dist/components/VCombobox/infiniteScroll.js +18 -12
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +55 -24
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +192 -155
- 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 +15 -12
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +180 -160
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/mask.d.ts +95 -0
- package/dist/components/VDateInput/mask.js +118 -0
- package/dist/components/VDateInput/mask.js.map +1 -0
- package/dist/components/VDatePicker/VDatePicker.css +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +6 -5
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +204 -173
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/keyboard.d.ts +3 -3
- package/dist/components/VDatePicker/keyboard.js.map +1 -1
- package/dist/components/VDatePicker/names.d.ts +34 -0
- package/dist/components/VDatePicker/names.js +42 -0
- package/dist/components/VDatePicker/names.js.map +1 -0
- package/dist/components/VDialog/VDialog.css +1 -1
- package/dist/components/VDialog/VDialog.d.ts +2 -2
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +63 -41
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +38 -25
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +74 -71
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/truncate.d.ts +4 -4
- package/dist/components/VFileInput/truncate.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.css +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +54 -37
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +152 -135
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.d.ts +2 -2
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +10 -8
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +22 -20
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.d.ts +9 -7
- package/dist/components/VHotkeys/platform.js +41 -30
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.css +1 -1
- package/dist/components/VIcon/VIcon.d.ts +6 -6
- 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 +4 -4
- 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 +23 -20
- package/dist/components/VIcon/resolver.js.map +1 -1
- package/dist/components/VIcon/types.d.ts +4 -4
- package/dist/components/VIconButton/VIconButton.d.ts +4 -4
- 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 +16 -8
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +22 -16
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +1 -1
- package/dist/components/VInput/VInputGroup.js.map +1 -1
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +3 -3
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +152 -85
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.d.ts +4 -4
- 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.css +1 -1
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +18 -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 +6 -6
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +83 -69
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.css +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +2 -2
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.css +1 -1
- package/dist/components/VPagination/VPagination.d.ts +22 -9
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +67 -57
- 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 +1 -1
- package/dist/components/VPopover/VPopover.js.map +1 -1
- 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 +12 -7
- 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.css +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +15 -10
- 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.css +1 -1
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +1 -1
- 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 +2 -2
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +1 -1
- 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.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- 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 +12 -13
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +87 -68
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +10 -7
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +5 -5
- 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 +21 -7
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +159 -140
- 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 +4 -4
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +85 -59
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +7 -7
- package/dist/components/VSnackbar/state.js +13 -11
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.css +1 -1
- 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.css +1 -1
- package/dist/components/VSwitch/VSwitch.d.ts +1 -1
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +4 -4
- 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 +4 -0
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/VTabs/VTab.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 +17 -7
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +84 -77
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +8 -8
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +71 -69
- 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 +21 -12
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +230 -206
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +17 -2
- package/dist/components/VTimeInput/search.js +19 -9
- package/dist/components/VTimeInput/search.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.css +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +8 -7
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +128 -106
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +11 -4
- package/dist/components/VTimePicker/limits.js +3 -2
- package/dist/components/VTimePicker/limits.js.map +1 -1
- package/dist/components/VToast/VToast.css +1 -1
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +33 -37
- 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 +91 -61
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +8 -6
- package/dist/components/VToast/state.js +15 -13
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.css +1 -1
- package/dist/components/VToggle/VToggle.d.ts +9 -4
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +4 -0
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.css +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +17 -10
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +46 -26
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTypography/VTypography.css +1 -1
- package/dist/components/VTypography/VTypography.d.ts +6 -4
- 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 +1 -1
- package/dist/composables/useAriaLabel.js.map +1 -1
- package/dist/composables/useClearable.d.ts +2 -2
- package/dist/composables/useClearable.js.map +1 -1
- package/dist/composables/useDetailsOpen.d.ts +3 -3
- package/dist/composables/useDetailsOpen.js +14 -12
- package/dist/composables/useDetailsOpen.js.map +1 -1
- package/dist/composables/useFieldIds.d.ts +2 -1
- package/dist/composables/useFieldIds.js +6 -5
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +2 -2
- package/dist/composables/useFieldPanel.js +47 -37
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.js +3 -3
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +1 -1
- package/dist/composables/useFileField.js +62 -41
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +3 -3
- package/dist/composables/useIconClickHandlers.js +14 -13
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.js +12 -10
- package/dist/composables/useInertLink.js.map +1 -1
- package/dist/composables/useLiveAnnouncer.d.ts +5 -0
- package/dist/composables/useLiveAnnouncer.js +23 -0
- package/dist/composables/useLiveAnnouncer.js.map +1 -0
- package/dist/composables/useMaskedField.d.ts +5 -5
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +3 -3
- package/dist/composables/usePopover.js +6 -4
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.js +11 -2
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +1 -1
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useSlotNodes.d.ts +18 -0
- package/dist/composables/useSlotNodes.js +13 -0
- package/dist/composables/useSlotNodes.js.map +1 -0
- package/dist/composables/useTextLimit.d.ts +2 -1
- package/dist/composables/useTextLimit.js +2 -2
- package/dist/composables/useTextLimit.js.map +1 -1
- package/dist/composables/useTimer.d.ts +5 -0
- package/dist/composables/useTimer.js +22 -11
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.js +1 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.js +14 -14
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +7 -7
- package/dist/i18n/state.js +37 -28
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +12 -12
- package/dist/icons.d.ts +2 -2
- package/dist/index.d.ts +12 -11
- package/dist/styles.css +1 -1
- package/dist/tokens/css.d.ts +1 -1
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/semantic.d.ts +6 -0
- package/dist/tokens/semantic.js +66 -60
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js +3 -3
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens.json +130 -66
- package/dist/types.d.ts +1 -1
- package/dist/utils/arrowNav.d.ts +4 -1
- package/dist/utils/arrowNav.js +7 -7
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +1 -1
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/clock.d.ts +113 -0
- package/dist/utils/clock.js +84 -0
- package/dist/utils/clock.js.map +1 -0
- package/dist/utils/css.d.ts +6 -4
- package/dist/utils/css.js +2 -2
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +7 -102
- package/dist/utils/date.js +33 -160
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +1 -1
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +12 -3
- package/dist/utils/env.js +6 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/file.d.ts +3 -3
- package/dist/utils/file.js +1 -1
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +1 -1
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +1 -1
- package/dist/utils/hostWarns.js.map +1 -1
- package/dist/utils/ids.d.ts +1 -1
- package/dist/utils/ids.js.map +1 -1
- package/dist/utils/matcher.d.ts +2 -2
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +1 -1
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/text.d.ts +3 -3
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +2 -101
- package/dist/utils/time.js +22 -98
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +5 -3
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { HourFormat, Meridiem } from './time.js';
|
|
2
|
+
/**
|
|
3
|
+
* Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together
|
|
4
|
+
* with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven
|
|
5
|
+
* at night is 11 PM.
|
|
6
|
+
*/
|
|
7
|
+
export declare function to12h(hour24: number): {
|
|
8
|
+
hour: number;
|
|
9
|
+
meridiem: Meridiem;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,
|
|
13
|
+
* gives the hour on the 24-hour clock: 12 in the morning is 0, 12 in the afternoon is 12.
|
|
14
|
+
*/
|
|
15
|
+
export declare function to24h(hour12: number, meridiem: Meridiem): number;
|
|
16
|
+
/**
|
|
17
|
+
* The same hour moved into the other half of the day, or left where it is: 9 with PM gives
|
|
18
|
+
* 21, and 21 with PM stays 21. It is what an AM/PM control does to the hour it qualifies.
|
|
19
|
+
*/
|
|
20
|
+
export declare function hourWithMeridiem(hour24: number, meridiem: Meridiem): number;
|
|
21
|
+
/**
|
|
22
|
+
* A canonical time moved into a half of the day, its minutes untouched, or `null` when it is
|
|
23
|
+
* not a time at all: `'09:30'` with PM gives `'21:30'`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Snaps a minute to the nearest allowed step and wraps it back inside the hour.
|
|
28
|
+
*
|
|
29
|
+
* Both ends need the wrap: 58 snapped to five-minute steps lands on 60, which is 0, and
|
|
30
|
+
* stepping back from 0 with the keyboard passes through -1, which is 59.
|
|
31
|
+
*/
|
|
32
|
+
export declare function snapMinute(minute: number, step: number): number;
|
|
33
|
+
/**
|
|
34
|
+
* Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered
|
|
35
|
+
* clockwise from twelve o'clock and the nearest wins. `dy` is negated because screen
|
|
36
|
+
* coordinates grow DOWNWARD and the angle is measured from the top.
|
|
37
|
+
*/
|
|
38
|
+
export declare function angleToIndex(dx: number, dy: number, segments: number): number;
|
|
39
|
+
/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */
|
|
40
|
+
export declare function distanceFraction(dx: number, dy: number, radius: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* How close to the centre a pointer must land to be aiming at the INNER ring, the one
|
|
43
|
+
* holding the small hours of a 24-hour dial: the halfway mark between the two rings.
|
|
44
|
+
*
|
|
45
|
+
* TRAP: the number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts
|
|
46
|
+
* the rings' centres at 104px and 56px from the middle, whose midpoint is 0.625 of the
|
|
47
|
+
* radius. Change either token without changing this and the threshold no longer separates
|
|
48
|
+
* the two rings: a tap near the boundary quietly sets the wrong hour.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DIAL_INNER_THRESHOLD = 0.625;
|
|
51
|
+
/**
|
|
52
|
+
* How close to the centre a pointer lands on NOTHING. At the very centre there is no angle
|
|
53
|
+
* at all (`atan2(0, 0)` answers half a turn, which would set six o'clock), and the centre dot
|
|
54
|
+
* drawn there is not a numeral.
|
|
55
|
+
*
|
|
56
|
+
* TRAP: derived from the same tokens as the threshold above: the inner ring's numerals
|
|
57
|
+
* start 32px from the middle (56px less half a 48px numeral), 0.25 of the radius, so the
|
|
58
|
+
* dead zone stops short of them. Grow it past 0.25 and the inner small hours lose their
|
|
59
|
+
* inner half to it.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DIAL_DEAD_ZONE = 0.2;
|
|
62
|
+
/**
|
|
63
|
+
* Which hour a mark stands for on the two-ring dial: outer carries 12 then 1-11, inner
|
|
64
|
+
* carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.
|
|
65
|
+
*/
|
|
66
|
+
export declare function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number;
|
|
67
|
+
/** The way back, which is what tells the hand where to point. */
|
|
68
|
+
export declare function hour24ToDial(hour: number): {
|
|
69
|
+
index: number;
|
|
70
|
+
ring: 'outer' | 'inner';
|
|
71
|
+
};
|
|
72
|
+
export interface TimeOption {
|
|
73
|
+
/** The canonical time, which is what the component's value will be set to. */
|
|
74
|
+
value: string;
|
|
75
|
+
/** The same time written out for the reader: "07:30", or "7:30 AM". */
|
|
76
|
+
label: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Every time of the day at a given interval, midnight to the last one before the next.
|
|
80
|
+
*
|
|
81
|
+
* It knows nothing of the restrictions: VTimeInput filters the rows it offers, so the list
|
|
82
|
+
* itself stays one table per step and locale.
|
|
83
|
+
*
|
|
84
|
+
* A nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the
|
|
85
|
+
* list stays FINITE even when the component's warning about it was ignored.
|
|
86
|
+
*/
|
|
87
|
+
export declare function timeList(step: number, locale: string, format: HourFormat): TimeOption[];
|
|
88
|
+
/**
|
|
89
|
+
* Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is
|
|
90
|
+
* complete: typing "09" already gives "09:", exactly as a date's separators do.
|
|
91
|
+
*/
|
|
92
|
+
export declare function formatTimeMask(digits: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* Where the caret belongs to sit just after `n` digits. A closed formula rather than
|
|
95
|
+
* `date.ts`'s scan, the colon always being in the same place.
|
|
96
|
+
*
|
|
97
|
+
* `skipSeparator` means something was INSERTED, and the caret then steps over the colon
|
|
98
|
+
* into the minutes. On a DELETION it stays in front of it, or the next Backspace steps
|
|
99
|
+
* over the colon instead of erasing a digit and the key appears to do nothing.
|
|
100
|
+
*/
|
|
101
|
+
export declare function timeCaret(n: number, skipSeparator?: boolean): number;
|
|
102
|
+
/**
|
|
103
|
+
* A canonical time written into the field in whichever form is SHOWN. On a 12-hour clock the
|
|
104
|
+
* hour comes back into 1-12: the meridiem belongs to the toggle beside the field, never to
|
|
105
|
+
* the text.
|
|
106
|
+
*/
|
|
107
|
+
export declare function timeToMask(time: string | null | undefined, format: HourFormat): string;
|
|
108
|
+
/**
|
|
109
|
+
* What was typed read back into a canonical time, or `null` when it is incomplete, too long
|
|
110
|
+
* or not a real time. On a 12-hour clock this is the ONE place the typed digits and the
|
|
111
|
+
* meridiem toggle meet.
|
|
112
|
+
*/
|
|
113
|
+
export declare function parseTimeMask(text: string, format: HourFormat, meridiem?: Meridiem): string | null;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { digitsOf as e, pad2 as t } from "./text.js";
|
|
2
|
+
import { formatTime as n, formatTimeDisplay as r, parseTime as i } from "./time.js";
|
|
3
|
+
//#region src/utils/clock.ts
|
|
4
|
+
function a(e) {
|
|
5
|
+
let t = e >= 12 ? "PM" : "AM";
|
|
6
|
+
return {
|
|
7
|
+
hour: e % 12 == 0 ? 12 : e % 12,
|
|
8
|
+
meridiem: t
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function o(e, t) {
|
|
12
|
+
let n = e % 12;
|
|
13
|
+
return t === "PM" ? n + 12 : n;
|
|
14
|
+
}
|
|
15
|
+
function s(e, t) {
|
|
16
|
+
return o(a(e).hour, t);
|
|
17
|
+
}
|
|
18
|
+
function c(e, t) {
|
|
19
|
+
let r = i(e);
|
|
20
|
+
return r ? n(s(r.hour, t), r.minute) : null;
|
|
21
|
+
}
|
|
22
|
+
function l(e, t) {
|
|
23
|
+
let n = Math.round(t);
|
|
24
|
+
return ((n <= 1 ? Math.round(e) : Math.round(e / n) * n) % 60 + 60) % 60;
|
|
25
|
+
}
|
|
26
|
+
function u(e, t, n) {
|
|
27
|
+
let r = (Math.atan2(e, -t) / (2 * Math.PI) + 1) % 1;
|
|
28
|
+
return Math.round(r * n) % n;
|
|
29
|
+
}
|
|
30
|
+
function d(e, t, n) {
|
|
31
|
+
return n > 0 ? Math.hypot(e, t) / n : 0;
|
|
32
|
+
}
|
|
33
|
+
var f = .625, p = .2;
|
|
34
|
+
function m(e, t) {
|
|
35
|
+
return t === "outer" ? e === 0 ? 12 : e : e === 0 ? 0 : e + 12;
|
|
36
|
+
}
|
|
37
|
+
function h(e) {
|
|
38
|
+
return e === 0 ? {
|
|
39
|
+
index: 0,
|
|
40
|
+
ring: "inner"
|
|
41
|
+
} : e === 12 ? {
|
|
42
|
+
index: 0,
|
|
43
|
+
ring: "outer"
|
|
44
|
+
} : e > 12 ? {
|
|
45
|
+
index: e - 12,
|
|
46
|
+
ring: "inner"
|
|
47
|
+
} : {
|
|
48
|
+
index: e,
|
|
49
|
+
ring: "outer"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function g(e, t, i) {
|
|
53
|
+
let a = Number.isInteger(e) && e >= 1 && e <= 60 ? e : 60, o = [];
|
|
54
|
+
for (let e = 0; e < 1440; e += a) {
|
|
55
|
+
let a = n(Math.floor(e / 60), e % 60);
|
|
56
|
+
o.push({
|
|
57
|
+
value: a,
|
|
58
|
+
label: r(a, t, i)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return o;
|
|
62
|
+
}
|
|
63
|
+
var _ = ":";
|
|
64
|
+
function v(t) {
|
|
65
|
+
let n = e(t).slice(0, 4);
|
|
66
|
+
return n.length >= 2 ? `${n.slice(0, 2)}${_}${n.slice(2)}` : n;
|
|
67
|
+
}
|
|
68
|
+
function y(e, t = !1) {
|
|
69
|
+
return e < 2 ? e : e === 2 ? t ? 3 : 2 : Math.min(e + 1, 5);
|
|
70
|
+
}
|
|
71
|
+
function b(e, n) {
|
|
72
|
+
let r = i(e);
|
|
73
|
+
return r ? v(t(n === "12h" ? a(r.hour).hour : r.hour) + t(r.minute)) : "";
|
|
74
|
+
}
|
|
75
|
+
function x(t, r, i = "AM") {
|
|
76
|
+
let a = e(t);
|
|
77
|
+
if (a.length !== 4) return null;
|
|
78
|
+
let s = Number(a.slice(0, 2)), c = Number(a.slice(2));
|
|
79
|
+
return c > 59 ? null : r === "12h" ? s >= 1 && s <= 12 ? n(o(s, i), c) : null : s <= 23 ? n(s, c) : null;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { p as DIAL_DEAD_ZONE, f as DIAL_INNER_THRESHOLD, u as angleToIndex, m as dialIndexToHour24, d as distanceFraction, v as formatTimeMask, h as hour24ToDial, s as hourWithMeridiem, x as parseTimeMask, l as snapMinute, y as timeCaret, g as timeList, b as timeToMask, a as to12h, o as to24h, c as withMeridiem };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","names":[],"sources":["../../src/utils/clock.ts"],"sourcesContent":["// @ssr @core — module-wide: every export below is @core unless tagged otherwise.\n/**\n * What the CLOCK and the FIELD need of the time domain: the AM/PM arithmetic, the dial's\n * geometry, the typing mask and the list of times. VTimePicker and VTimeInput are its only\n * consumers; `./time` holds what VCalendar reads as well, and this is kept apart so that\n * no calendar pays for a dial it never draws.\n *\n * The dial's geometry lives here rather than in the component for a practical reason: jsdom\n * lays nothing out and measures every element at zero, so a calculation kept inside the\n * component is untestable.\n */\nimport { digitsOf, pad2 } from './text'\nimport { formatTime, parseTime, formatTimeDisplay } from './time'\nimport type { HourFormat, Meridiem } from './time'\n\n/**\n * Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together\n * with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven\n * at night is 11 PM.\n */\nexport function to12h(hour24: number): { hour: number; meridiem: Meridiem } {\n const meridiem: Meridiem = hour24 >= 12 ? 'PM' : 'AM'\n const hour = hour24 % 12 === 0 ? 12 : hour24 % 12\n return { hour, meridiem }\n}\n\n/**\n * The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,\n * gives the hour on the 24-hour clock: 12 in the morning is 0, 12 in the afternoon is 12.\n */\nexport function to24h(hour12: number, meridiem: Meridiem): number {\n const base = hour12 % 12 // Twelve is the zero of the cycle, not its top.\n return meridiem === 'PM' ? base + 12 : base\n}\n\n/**\n * The same hour moved into the other half of the day, or left where it is: 9 with PM gives\n * 21, and 21 with PM stays 21. It is what an AM/PM control does to the hour it qualifies.\n */\nexport function hourWithMeridiem(hour24: number, meridiem: Meridiem): number {\n return to24h(to12h(hour24).hour, meridiem)\n}\n\n/**\n * A canonical time moved into a half of the day, its minutes untouched, or `null` when it is\n * not a time at all: `'09:30'` with PM gives `'21:30'`.\n */\nexport function withMeridiem(time: string | null | undefined, meridiem: Meridiem): string | null {\n const parts = parseTime(time)\n return parts ? formatTime(hourWithMeridiem(parts.hour, meridiem), parts.minute) : null\n}\n\n/**\n * Snaps a minute to the nearest allowed step and wraps it back inside the hour.\n *\n * Both ends need the wrap: 58 snapped to five-minute steps lands on 60, which is 0, and\n * stepping back from 0 with the keyboard passes through -1, which is 59.\n */\nexport function snapMinute(minute: number, step: number): number {\n // A step is whole minutes: 7.5 divides 60, and wrote `09:7.5` into the model.\n const size = Math.round(step)\n const snapped = size <= 1 ? Math.round(minute) : Math.round(minute / size) * size\n return ((snapped % 60) + 60) % 60\n}\n\n/**\n * Which mark a pointer offset from the dial's centre is aiming at. Marks are numbered\n * clockwise from twelve o'clock and the nearest wins. `dy` is negated because screen\n * coordinates grow DOWNWARD and the angle is measured from the top.\n */\nexport function angleToIndex(dx: number, dy: number, segments: number): number {\n // The angle from twelve o'clock, clockwise-positive, as a fraction of a full turn.\n const angle = Math.atan2(dx, -dy)\n const turn = (angle / (2 * Math.PI) + 1) % 1\n return Math.round(turn * segments) % segments\n}\n\n/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */\nexport function distanceFraction(dx: number, dy: number, radius: number): number {\n return radius > 0 ? Math.hypot(dx, dy) / radius : 0\n}\n\n/**\n * How close to the centre a pointer must land to be aiming at the INNER ring, the one\n * holding the small hours of a 24-hour dial: the halfway mark between the two rings.\n *\n * TRAP: the number is DERIVED from the dial tokens. A 256px dial with 48px numerals puts\n * the rings' centres at 104px and 56px from the middle, whose midpoint is 0.625 of the\n * radius. Change either token without changing this and the threshold no longer separates\n * the two rings: a tap near the boundary quietly sets the wrong hour.\n */\nexport const DIAL_INNER_THRESHOLD = 0.625\n\n/**\n * How close to the centre a pointer lands on NOTHING. At the very centre there is no angle\n * at all (`atan2(0, 0)` answers half a turn, which would set six o'clock), and the centre dot\n * drawn there is not a numeral.\n *\n * TRAP: derived from the same tokens as the threshold above: the inner ring's numerals\n * start 32px from the middle (56px less half a 48px numeral), 0.25 of the radius, so the\n * dead zone stops short of them. Grow it past 0.25 and the inner small hours lose their\n * inner half to it.\n */\nexport const DIAL_DEAD_ZONE = 0.2\n\n/**\n * Which hour a mark stands for on the two-ring dial: outer carries 12 then 1-11, inner\n * carries 00 then 13-23. Index 0 of each is the mark at twelve o'clock.\n */\nexport function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number {\n if (ring === 'outer') return index === 0 ? 12 : index\n return index === 0 ? 0 : index + 12\n}\n\n/** The way back, which is what tells the hand where to point. */\nexport function hour24ToDial(hour: number): { index: number; ring: 'outer' | 'inner' } {\n if (hour === 0) return { index: 0, ring: 'inner' }\n if (hour === 12) return { index: 0, ring: 'outer' }\n if (hour > 12) return { index: hour - 12, ring: 'inner' }\n return { index: hour, ring: 'outer' }\n}\n\nexport interface TimeOption {\n /** The canonical time, which is what the component's value will be set to. */\n value: string\n /** The same time written out for the reader: \"07:30\", or \"7:30 AM\". */\n label: string\n}\n\n/**\n * Every time of the day at a given interval, midnight to the last one before the next.\n *\n * It knows nothing of the restrictions: VTimeInput filters the rows it offers, so the list\n * itself stays one table per step and locale.\n *\n * A nonsensical step (zero, a fraction, more than an hour) falls back to hourly, so the\n * list stays FINITE even when the component's warning about it was ignored.\n */\nexport function timeList(step: number, locale: string, format: HourFormat): TimeOption[] {\n const safe = Number.isInteger(step) && step >= 1 && step <= 60 ? step : 60\n const out: TimeOption[] = []\n for (let m = 0; m < 24 * 60; m += safe) {\n const value = formatTime(Math.floor(m / 60), m % 60)\n out.push({ value, label: formatTimeDisplay(value, locale, format) })\n }\n return out\n}\n\n/*\n * Unlike a date's separator this one is UNIVERSAL: every language writes a time with a\n * colon, and only the 12/24-hour cycle varies. It therefore stays out of the dictionary,\n * where the empty field's `hh:mm` placeholder does belong — that one is made of the\n * initials of words.\n */\nconst TIME_SEPARATOR = ':'\n\n/**\n * Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is\n * complete: typing \"09\" already gives \"09:\", exactly as a date's separators do.\n */\nexport function formatTimeMask(digits: string): string {\n const all = digitsOf(digits).slice(0, 4)\n return all.length >= 2 ? `${all.slice(0, 2)}${TIME_SEPARATOR}${all.slice(2)}` : all\n}\n\n/**\n * Where the caret belongs to sit just after `n` digits. A closed formula rather than\n * `date.ts`'s scan, the colon always being in the same place.\n *\n * `skipSeparator` means something was INSERTED, and the caret then steps over the colon\n * into the minutes. On a DELETION it stays in front of it, or the next Backspace steps\n * over the colon instead of erasing a digit and the key appears to do nothing.\n */\nexport function timeCaret(n: number, skipSeparator = false): number {\n if (n < 2) return n\n if (n === 2) return skipSeparator ? 3 : 2\n return Math.min(n + 1, 5)\n}\n\n/**\n * A canonical time written into the field in whichever form is SHOWN. On a 12-hour clock the\n * hour comes back into 1-12: the meridiem belongs to the toggle beside the field, never to\n * the text.\n */\nexport function timeToMask(time: string | null | undefined, format: HourFormat): string {\n const parts = parseTime(time)\n if (!parts) return ''\n const hour = format === '12h' ? to12h(parts.hour).hour : parts.hour\n return formatTimeMask(pad2(hour) + pad2(parts.minute))\n}\n\n/**\n * What was typed read back into a canonical time, or `null` when it is incomplete, too long\n * or not a real time. On a 12-hour clock this is the ONE place the typed digits and the\n * meridiem toggle meet.\n */\nexport function parseTimeMask(\n text: string,\n format: HourFormat,\n meridiem: Meridiem = 'AM',\n): string | null {\n const digits = digitsOf(text)\n if (digits.length !== 4) return null\n const hour = Number(digits.slice(0, 2))\n const minute = Number(digits.slice(2))\n if (minute > 59) return null\n if (format === '12h')\n return hour >= 1 && hour <= 12 ? formatTime(to24h(hour, meridiem), minute) : null\n return hour <= 23 ? formatTime(hour, minute) : null\n}\n"],"mappings":";;;AAoBA,SAAgB,EAAM,GAAsD;CAC1E,IAAM,IAAqB,KAAU,KAAK,OAAO;CAEjD,OAAO;EAAE,MADI,IAAS,MAAO,IAAI,KAAK,IAAS;EAChC;CAAS;AAC1B;AAMA,SAAgB,EAAM,GAAgB,GAA4B;CAChE,IAAM,IAAO,IAAS;CACtB,OAAO,MAAa,OAAO,IAAO,KAAK;AACzC;AAMA,SAAgB,EAAiB,GAAgB,GAA4B;CAC3E,OAAO,EAAM,EAAM,CAAM,CAAC,CAAC,MAAM,CAAQ;AAC3C;AAMA,SAAgB,EAAa,GAAiC,GAAmC;CAC/F,IAAM,IAAQ,EAAU,CAAI;CAC5B,OAAO,IAAQ,EAAW,EAAiB,EAAM,MAAM,CAAQ,GAAG,EAAM,MAAM,IAAI;AACpF;AAQA,SAAgB,EAAW,GAAgB,GAAsB;CAE/D,IAAM,IAAO,KAAK,MAAM,CAAI;CAE5B,SADgB,KAAQ,IAAI,KAAK,MAAM,CAAM,IAAI,KAAK,MAAM,IAAS,CAAI,IAAI,KAC1D,KAAM,MAAM;AACjC;AAOA,SAAgB,EAAa,GAAY,GAAY,GAA0B;CAG7E,IAAM,KADQ,KAAK,MAAM,GAAI,CAAC,CAChB,KAAS,IAAI,KAAK,MAAM,KAAK;CAC3C,OAAO,KAAK,MAAM,IAAO,CAAQ,IAAI;AACvC;AAGA,SAAgB,EAAiB,GAAY,GAAY,GAAwB;CAC/E,OAAO,IAAS,IAAI,KAAK,MAAM,GAAI,CAAE,IAAI,IAAS;AACpD;AAWA,IAAa,IAAuB,MAYvB,IAAiB;AAM9B,SAAgB,EAAkB,GAAe,GAAiC;CAEhF,OADI,MAAS,UAAgB,MAAU,IAAI,KAAK,IACzC,MAAU,IAAI,IAAI,IAAQ;AACnC;AAGA,SAAgB,EAAa,GAA0D;CAIrF,OAHI,MAAS,IAAU;EAAE,OAAO;EAAG,MAAM;CAAQ,IAC7C,MAAS,KAAW;EAAE,OAAO;EAAG,MAAM;CAAQ,IAC9C,IAAO,KAAW;EAAE,OAAO,IAAO;EAAI,MAAM;CAAQ,IACjD;EAAE,OAAO;EAAM,MAAM;CAAQ;AACtC;AAkBA,SAAgB,EAAS,GAAc,GAAgB,GAAkC;CACvF,IAAM,IAAO,OAAO,UAAU,CAAI,KAAK,KAAQ,KAAK,KAAQ,KAAK,IAAO,IAClE,IAAoB,CAAC;CAC3B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAS,KAAK,GAAM;EACtC,IAAM,IAAQ,EAAW,KAAK,MAAM,IAAI,EAAE,GAAG,IAAI,EAAE;EACnD,EAAI,KAAK;GAAE;GAAO,OAAO,EAAkB,GAAO,GAAQ,CAAM;EAAE,CAAC;CACrE;CACA,OAAO;AACT;AAQA,IAAM,IAAiB;AAMvB,SAAgB,EAAe,GAAwB;CACrD,IAAM,IAAM,EAAS,CAAM,CAAC,CAAC,MAAM,GAAG,CAAC;CACvC,OAAO,EAAI,UAAU,IAAI,GAAG,EAAI,MAAM,GAAG,CAAC,IAAI,IAAiB,EAAI,MAAM,CAAC,MAAM;AAClF;AAUA,SAAgB,EAAU,GAAW,IAAgB,IAAe;CAGlE,OAFI,IAAI,IAAU,IACd,MAAM,IAAU,IAAgB,IAAI,IACjC,KAAK,IAAI,IAAI,GAAG,CAAC;AAC1B;AAOA,SAAgB,EAAW,GAAiC,GAA4B;CACtF,IAAM,IAAQ,EAAU,CAAI;CAG5B,OAFK,IAEE,EAAe,EADT,MAAW,QAAQ,EAAM,EAAM,IAAI,CAAC,CAAC,OAAO,EAAM,IAChC,IAAI,EAAK,EAAM,MAAM,CAAC,IAFlC;AAGrB;AAOA,SAAgB,EACd,GACA,GACA,IAAqB,MACN;CACf,IAAM,IAAS,EAAS,CAAI;CAC5B,IAAI,EAAO,WAAW,GAAG,OAAO;CAChC,IAAM,IAAO,OAAO,EAAO,MAAM,GAAG,CAAC,CAAC,GAChC,IAAS,OAAO,EAAO,MAAM,CAAC,CAAC;CAIrC,OAHI,IAAS,KAAW,OACpB,MAAW,QACN,KAAQ,KAAK,KAAQ,KAAK,EAAW,EAAM,GAAM,CAAQ,GAAG,CAAM,IAAI,OACxE,KAAQ,KAAK,EAAW,GAAM,CAAM,IAAI;AACjD"}
|
package/dist/utils/css.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A dimension always in pixels: `12` and `'12'` both give `12px`.
|
|
3
3
|
*
|
|
4
|
-
* Anything non-numeric yields `undefined` rather than a custom property CSS cannot read
|
|
4
|
+
* Anything non-numeric, or negative, yields `undefined` rather than a custom property CSS cannot read:
|
|
5
5
|
* an invalid value breaks the geometry outright, where nothing at all lets the component's
|
|
6
6
|
* own default apply.
|
|
7
7
|
*
|
|
8
|
-
* TRAP
|
|
8
|
+
* TRAP: `Number`, never `parseFloat`: the latter reads a numeric PREFIX, so `'12rem'`
|
|
9
9
|
* would come out as `12px`, a wrong size with nothing to say so. `Number('')` being 0, a
|
|
10
10
|
* blank string is refused before it gets there.
|
|
11
11
|
*/
|
|
12
12
|
export declare function px(v: number | string | undefined): string | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* A dimension in any unit: a bare number is read as pixels, a string passes through
|
|
15
|
-
* untouched
|
|
15
|
+
* untouched: `50%`, `20vw`, `max-content`.
|
|
16
16
|
*
|
|
17
17
|
* Unlike `px` above, the string is deliberately not examined: CSS judges it, and one it
|
|
18
|
-
* cannot parse falls back to whatever the component declares for itself.
|
|
18
|
+
* cannot parse falls back to whatever the component declares for itself. A NUMBER is judged
|
|
19
|
+
* here, as `px` judges one: a width computed as `NaN` or below zero, and an empty string,
|
|
20
|
+
* give nothing rather than a declaration CSS drops, so the component's own default applies.
|
|
19
21
|
*/
|
|
20
22
|
export declare function cssSize(v: number | string | undefined): string | undefined;
|
|
21
23
|
/**
|
package/dist/utils/css.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
function e(e) {
|
|
3
3
|
if (e === void 0) return;
|
|
4
4
|
let t = typeof e == "number" ? e : e.trim() === "" ? NaN : Number(e);
|
|
5
|
-
return Number.isFinite(t) ? `${t}px` : void 0;
|
|
5
|
+
return Number.isFinite(t) && t >= 0 ? `${t}px` : void 0;
|
|
6
6
|
}
|
|
7
7
|
function t(e) {
|
|
8
|
-
if (e
|
|
8
|
+
if (!(e === void 0 || e === "")) return typeof e == "string" ? e : Number.isFinite(e) && e >= 0 ? `${e}px` : void 0;
|
|
9
9
|
}
|
|
10
10
|
function n(e) {
|
|
11
11
|
return e === void 0 ? void 0 : { "--custom-color": e };
|
package/dist/utils/css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["../../src/utils/css.ts"],"sourcesContent":["// @core\n/**\n * A dimension always in pixels: `12` and `'12'` both give `12px`.\n *\n * Anything non-numeric yields `undefined` rather than a custom property CSS cannot read
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["../../src/utils/css.ts"],"sourcesContent":["// @core\n/**\n * A dimension always in pixels: `12` and `'12'` both give `12px`.\n *\n * Anything non-numeric, or negative, yields `undefined` rather than a custom property CSS cannot read:\n * an invalid value breaks the geometry outright, where nothing at all lets the component's\n * own default apply.\n *\n * TRAP: `Number`, never `parseFloat`: the latter reads a numeric PREFIX, so `'12rem'`\n * would come out as `12px`, a wrong size with nothing to say so. `Number('')` being 0, a\n * blank string is refused before it gets there.\n */\nexport function px(v: number | string | undefined): string | undefined {\n if (v === undefined) return undefined\n const n = typeof v === 'number' ? v : v.trim() === '' ? Number.NaN : Number(v)\n return Number.isFinite(n) && n >= 0 ? `${n}px` : undefined\n}\n\n// @core\n/**\n * A dimension in any unit: a bare number is read as pixels, a string passes through\n * untouched: `50%`, `20vw`, `max-content`.\n *\n * Unlike `px` above, the string is deliberately not examined: CSS judges it, and one it\n * cannot parse falls back to whatever the component declares for itself. A NUMBER is judged\n * here, as `px` judges one: a width computed as `NaN` or below zero, and an empty string,\n * give nothing rather than a declaration CSS drops, so the component's own default applies.\n */\nexport function cssSize(v: number | string | undefined): string | undefined {\n if (v === undefined || v === '') return undefined\n if (typeof v === 'string') return v\n return Number.isFinite(v) && v >= 0 ? `${v}px` : undefined\n}\n\n// @core\n/**\n * The inline style carrying a consumer's own colour to a component's sheet, which derives\n * every shade from `--custom-color`: VChip, VAvatar and VBadge.\n *\n * `undefined` when no colour was given, so a style array holding it binds nothing and the\n * tone the sheet already paints stays in force.\n */\nexport function customColorStyle(\n color: string | undefined,\n): { '--custom-color': string } | undefined {\n return color === undefined ? undefined : { '--custom-color': color }\n}\n"],"mappings":";AAYA,SAAgB,EAAG,GAAoD;CACrE,IAAI,MAAM,KAAA,GAAW;CACrB,IAAM,IAAI,OAAO,KAAM,WAAW,IAAI,EAAE,KAAK,MAAM,KAAK,MAAa,OAAO,CAAC;CAC7E,OAAO,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAYA,SAAgB,EAAQ,GAAoD;CACtE,YAAM,KAAA,KAAa,MAAM,KAE7B,OADI,OAAO,KAAM,WAAiB,IAC3B,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,EAAE,MAAM,KAAA;AACnD;AAUA,SAAgB,EACd,GAC0C;CAC1C,OAAO,MAAU,KAAA,IAAY,KAAA,IAAY,EAAE,kBAAkB,EAAM;AACrE"}
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Two shortcuts are banned as a result. `new Date('YYYY-MM-DD')` parses as UTC and lands a
|
|
6
6
|
* day out depending on the zone, and `toISOString()` formats in UTC for the same reason.
|
|
7
|
-
* `Date` exists here only as an intermediate, built with `
|
|
7
|
+
* `Date` exists here only as an intermediate, built with `localDate(y, m, d)` — local
|
|
8
8
|
* midnight — and turned back into text by concatenation.
|
|
9
9
|
*
|
|
10
10
|
* Month and day names come from `Intl` on REFERENCE dates pinned to `timeZone: 'UTC'`, so a
|
|
@@ -20,6 +20,10 @@ export declare function isValidISO(iso: unknown): iso is string;
|
|
|
20
20
|
* Turns an ISO string into a `Date` set at local midnight, or returns `null` when
|
|
21
21
|
* the string is not one. Every caller here has to handle that `null`: the bounds a
|
|
22
22
|
* consumer passes are raw strings and may be anything.
|
|
23
|
+
*
|
|
24
|
+
* TRAP: the shape is not enough. The `Date` constructor rolls an impossible day over
|
|
25
|
+
* rather than refusing it (`2026-02-31` is March 3rd), so the date is written back and
|
|
26
|
+
* compared: a day the month does not have reads as no date at all.
|
|
23
27
|
*/
|
|
24
28
|
export declare function parseISO(iso: string | null | undefined): Date | null;
|
|
25
29
|
/**
|
|
@@ -95,7 +99,7 @@ export interface MonthCell {
|
|
|
95
99
|
export declare function buildMonthGrid(year: number, month0: number, firstDayOfWeek: number): MonthCell[];
|
|
96
100
|
/**
|
|
97
101
|
* The day the week starts on in a given locale, from 0 for Sunday to 6 for Saturday
|
|
98
|
-
|
|
102
|
+
*: Sunday in the United States, Monday in most of Europe, Saturday in much of the
|
|
99
103
|
* Middle East. It comes from `Intl.Locale`, whose own numbering runs from 1 for
|
|
100
104
|
* Monday to 7 for Sunday.
|
|
101
105
|
*
|
|
@@ -109,20 +113,8 @@ export declare function firstDayOfWeekFor(locale: string): number;
|
|
|
109
113
|
* dropped straight into a calendar header.
|
|
110
114
|
*/
|
|
111
115
|
export declare function weekdayNames(locale: string, firstDayOfWeek: number, weekday?: 'short' | 'long'): string[];
|
|
112
|
-
/** The full names of the twelve months, in January-to-December order. */
|
|
113
|
-
export declare function monthNames(locale: string): string[];
|
|
114
|
-
/**
|
|
115
|
-
* Month names shortened for the picker's narrow cells: a name of four characters or
|
|
116
|
-
* fewer is kept whole ("May", "June", "July"), a longer one is cut to three
|
|
117
|
-
* characters followed by a dot ("January" becomes "Jan."). The name is spread with
|
|
118
|
-
* `[...n]` rather than indexed, so that an accented or non-Latin character counts as
|
|
119
|
-
* one character and is never cut in half.
|
|
120
|
-
*/
|
|
121
|
-
export declare function monthNamesCompact(locale: string): string[];
|
|
122
|
-
/** The full name of one month, 0 being January. */
|
|
123
|
-
export declare function monthName(locale: string, month0: number): string;
|
|
124
116
|
/**
|
|
125
|
-
* A date written out for the reader, in the conventions of their locale
|
|
117
|
+
* A date written out for the reader, in the conventions of their locale: this is
|
|
126
118
|
* what VDateInput shows in its field. An unparsable date yields an empty string
|
|
127
119
|
* rather than a broken one.
|
|
128
120
|
*/
|
|
@@ -133,90 +125,3 @@ export declare function formatDateDisplay(iso: string, locale: string, options:
|
|
|
133
125
|
* full dates side by side. A period of a single day is formatted as that one date.
|
|
134
126
|
*/
|
|
135
127
|
export declare function formatDisplayRange(start: string, end: string, locale: string, options: Intl.DateTimeFormatOptions): string;
|
|
136
|
-
export type DateMaskField = 'day' | 'month' | 'year';
|
|
137
|
-
/** Everything a locale decides about how a date is typed. */
|
|
138
|
-
export interface DateMask {
|
|
139
|
-
/**
|
|
140
|
-
* The order the three fields appear in: day, month, year in the United Kingdom,
|
|
141
|
-
* month, day, year in the United States, year, month, day in Japan.
|
|
142
|
-
*/
|
|
143
|
-
order: readonly DateMaskField[];
|
|
144
|
-
/** The single character between two fields, stripped of bidi marks and spaces. */
|
|
145
|
-
separator: string;
|
|
146
|
-
/** How many digits each field takes, in the same order: 4 for the year, 2 otherwise. */
|
|
147
|
-
lengths: readonly number[];
|
|
148
|
-
/** How many digits the complete mask holds, which is always 8. */
|
|
149
|
-
size: number;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Works out how a date is typed in a given locale, by formatting a known date and
|
|
153
|
-
* looking at what came out.
|
|
154
|
-
*
|
|
155
|
-
* The calendar and the numbering system are FORCED to Gregorian and Latin digits.
|
|
156
|
-
* Without that, `fa-IR` answers with a Persian year (1400 rather than 2021) and
|
|
157
|
-
* `ar-EG` with Arabic-Indic digits — two things a numeric field could neither
|
|
158
|
-
* display nor read back. An invalid locale throws, and the answer then falls back to
|
|
159
|
-
* day/month/year separated by "/".
|
|
160
|
-
*/
|
|
161
|
-
export declare function dateMaskFor(locale: string): DateMask;
|
|
162
|
-
/**
|
|
163
|
-
* Lays a run of digits out as masked text. The separator appears AS SOON AS the field
|
|
164
|
-
* before it is full — typing "22" already gives "22/" — so the reader sees their
|
|
165
|
-
* progress without ever having to type a separator themselves.
|
|
166
|
-
*
|
|
167
|
-
* This has a consequence the component must honour: pressing Backspace on such a
|
|
168
|
-
* separator has to delete the DIGIT before it. Deleting the separator alone would
|
|
169
|
-
* see the mask write it straight back, and the key would look dead.
|
|
170
|
-
*/
|
|
171
|
-
export declare function formatDateMask(digits: string, mask: DateMask): string;
|
|
172
|
-
/**
|
|
173
|
-
* Writes an ISO date in the mask of the locale, ready to be put in the field: the
|
|
174
|
-
* same day reads "10/06/2026" in London and "06/10/2026" in Chicago.
|
|
175
|
-
*/
|
|
176
|
-
export declare function isoToMask(iso: string, mask: DateMask): string;
|
|
177
|
-
export interface ParseMaskOptions {
|
|
178
|
-
/**
|
|
179
|
-
* The century a two-digit year is expanded into: with 2000, "10/06/26" is read as
|
|
180
|
-
* 2026. It is only accepted when the year is the LAST field of the mask, since
|
|
181
|
-
* elsewhere the following separator already tells the two apart.
|
|
182
|
-
*
|
|
183
|
-
* Leaving it out refuses any year shorter than four digits, and that is the mode
|
|
184
|
-
* used while the reader types — so that "26", passed through on the way to "2026",
|
|
185
|
-
* is never committed as a year of its own.
|
|
186
|
-
*/
|
|
187
|
-
yearPivot?: number;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Reads masked text back into an ISO date, or returns `null` when the text is
|
|
191
|
-
* incomplete, holds too many digits, or names a day that does not exist — 31
|
|
192
|
-
* February passes every length check and is caught by the round trip `isValidISO`
|
|
193
|
-
* performs.
|
|
194
|
-
*
|
|
195
|
-
* Whether the resulting date is allowed is a different question: the `min`/`max`
|
|
196
|
-
* bounds and the disabled dates belong to the component, and this function knows
|
|
197
|
-
* nothing about props.
|
|
198
|
-
*/
|
|
199
|
-
export declare function parseDateMask(text: string, mask: DateMask, options?: ParseMaskOptions): string | null;
|
|
200
|
-
/**
|
|
201
|
-
* Where the caret has to go to sit just after the nth digit. Counting digits is the
|
|
202
|
-
* only landmark that survives a reformat: an absolute position jumps by one the
|
|
203
|
-
* moment a separator appears or disappears, so restoring it would leave the caret in
|
|
204
|
-
* the wrong place on exactly the keystrokes that matter.
|
|
205
|
-
*
|
|
206
|
-
* When a separator is passed and it directly follows that position, the caret steps
|
|
207
|
-
* over it: while typing, it must land in the NEXT field rather than in front of a
|
|
208
|
-
* separator that has just been written. On deletion the argument is omitted, so the
|
|
209
|
-
* caret stays before it and the next Backspace reaches the digit.
|
|
210
|
-
*/
|
|
211
|
-
export declare function caretAfterDigits(text: string, n: number, separator?: string): number;
|
|
212
|
-
/**
|
|
213
|
-
* The empty template shown in the field: "dd/mm/yyyy" in English, "jj/mm/aaaa" in
|
|
214
|
-
* French, "tt.mm.jjjj" in German, "дд/мм/гггг" in Russian.
|
|
215
|
-
*
|
|
216
|
-
* Each letter is the first letter of the field's own name in that language, taken
|
|
217
|
-
* from `Intl.DisplayNames` — which lands on the attested convention of every
|
|
218
|
-
* alphabetic script without a table to maintain. It falls back to the Latin letters
|
|
219
|
-
* when that part of `Intl` is missing, or when the script is ideographic and the
|
|
220
|
-
* repetition would mean nothing.
|
|
221
|
-
*/
|
|
222
|
-
export declare function maskPlaceholder(locale: string, mask: DateMask): string;
|
package/dist/utils/date.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { memo as
|
|
1
|
+
import { pad2 as e } from "./text.js";
|
|
2
|
+
import { memo as t } from "./memo.js";
|
|
3
3
|
//#region src/utils/date.ts
|
|
4
|
+
function n(e, t, n) {
|
|
5
|
+
let r = new Date(e, t, n);
|
|
6
|
+
return e >= 0 && e < 100 && r.setFullYear(e, t, n), r;
|
|
7
|
+
}
|
|
4
8
|
var r = /^\d{4}-\d{2}-\d{2}$/;
|
|
5
9
|
function i(e) {
|
|
6
|
-
|
|
7
|
-
let t = a(e);
|
|
8
|
-
return t !== null && o(t) === e;
|
|
10
|
+
return typeof e == "string" && a(e) !== null;
|
|
9
11
|
}
|
|
10
12
|
function a(e) {
|
|
11
13
|
if (typeof e != "string" || !r.test(e)) return null;
|
|
12
|
-
let t = e.split("-"),
|
|
13
|
-
return Number.isNaN(
|
|
14
|
+
let t = e.split("-"), i = n(Number(t[0]), Number(t[1]) - 1, Number(t[2]));
|
|
15
|
+
return Number.isNaN(i.getTime()) || o(i) !== e ? null : i;
|
|
14
16
|
}
|
|
15
|
-
function o(
|
|
16
|
-
return `${
|
|
17
|
+
function o(t) {
|
|
18
|
+
return `${String(t.getFullYear()).padStart(4, "0")}-${e(t.getMonth() + 1)}-${e(t.getDate())}`;
|
|
17
19
|
}
|
|
18
|
-
function s(e, t,
|
|
19
|
-
return o(
|
|
20
|
+
function s(e, t, r) {
|
|
21
|
+
return o(n(e, t, r));
|
|
20
22
|
}
|
|
21
23
|
function c(e, t) {
|
|
22
24
|
let n = a(e);
|
|
@@ -29,7 +31,7 @@ function l(e, t) {
|
|
|
29
31
|
return n.setDate(1), n.setMonth(n.getMonth() + t), n.setDate(Math.min(r, u(n.getFullYear(), n.getMonth()))), o(n);
|
|
30
32
|
}
|
|
31
33
|
function u(e, t) {
|
|
32
|
-
return
|
|
34
|
+
return n(e, t + 1, 0).getDate();
|
|
33
35
|
}
|
|
34
36
|
function d(e, t) {
|
|
35
37
|
return e < t ? -1 : +(e > t);
|
|
@@ -44,21 +46,21 @@ function m(e, t, n) {
|
|
|
44
46
|
function h(e, t, n, r) {
|
|
45
47
|
return m(e, t, n) && !r(e);
|
|
46
48
|
}
|
|
47
|
-
function g(e, t,
|
|
48
|
-
let
|
|
49
|
-
for (let
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
iso: o(
|
|
53
|
-
day:
|
|
54
|
-
adjacent:
|
|
49
|
+
function g(e, t, r) {
|
|
50
|
+
let i = n(e, t, 1), a = (i.getDay() - r + 7) % 7, s = [];
|
|
51
|
+
for (let r = 0; r < 42; r++) {
|
|
52
|
+
let c = n(e, t, 1 - a + r), l = c.getMonth() === t && c.getFullYear() === e ? null : c < i ? "prev" : "next";
|
|
53
|
+
s.push({
|
|
54
|
+
iso: o(c),
|
|
55
|
+
day: c.getDate(),
|
|
56
|
+
adjacent: l
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
|
-
return
|
|
59
|
+
return s;
|
|
58
60
|
}
|
|
59
61
|
var _ = /* @__PURE__ */ new Map();
|
|
60
62
|
function v(e) {
|
|
61
|
-
return
|
|
63
|
+
return t(_, e, () => y(e));
|
|
62
64
|
}
|
|
63
65
|
function y(e) {
|
|
64
66
|
try {
|
|
@@ -75,150 +77,21 @@ function S(e, t, n = "short") {
|
|
|
75
77
|
});
|
|
76
78
|
return Array.from({ length: 7 }, (e, n) => r.format(b + (t + n) % 7 * x));
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
timeZone: "UTC"
|
|
82
|
-
});
|
|
83
|
-
return Array.from({ length: 12 }, (e, n) => t.format(Date.UTC(2021, n, 1)));
|
|
84
|
-
}
|
|
85
|
-
function w(e) {
|
|
86
|
-
return C(e).map((e) => {
|
|
87
|
-
let t = [...e];
|
|
88
|
-
return t.length <= 4 ? e : t.slice(0, 3).join("") + ".";
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
var T = /* @__PURE__ */ new Map();
|
|
92
|
-
function E(e, t) {
|
|
93
|
-
return n(T, `${e}|${JSON.stringify(t)}`, () => new Intl.DateTimeFormat(e, t));
|
|
94
|
-
}
|
|
95
|
-
function D(e, t) {
|
|
96
|
-
return E(e, {
|
|
97
|
-
month: "long",
|
|
98
|
-
timeZone: "UTC"
|
|
99
|
-
}).format(Date.UTC(2021, t, 1));
|
|
80
|
+
var C = /* @__PURE__ */ new Map();
|
|
81
|
+
function w(e, n) {
|
|
82
|
+
return t(C, `${e}|${JSON.stringify(n)}`, () => new Intl.DateTimeFormat(e, n));
|
|
100
83
|
}
|
|
101
|
-
function
|
|
84
|
+
function T(e, t, n) {
|
|
102
85
|
let r = a(e);
|
|
103
|
-
return r ?
|
|
86
|
+
return r ? w(t, n).format(r) : "";
|
|
104
87
|
}
|
|
105
|
-
function
|
|
88
|
+
function E(e, t, n, r) {
|
|
106
89
|
let i = a(e), o = a(t);
|
|
107
90
|
if (!i || !o) return "";
|
|
108
|
-
let s =
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
var A = {
|
|
112
|
-
order: [
|
|
113
|
-
"day",
|
|
114
|
-
"month",
|
|
115
|
-
"year"
|
|
116
|
-
],
|
|
117
|
-
separator: "/",
|
|
118
|
-
lengths: [
|
|
119
|
-
2,
|
|
120
|
-
2,
|
|
121
|
-
4
|
|
122
|
-
],
|
|
123
|
-
size: 8
|
|
124
|
-
}, j = Date.UTC(2021, 10, 22), M = /[]/g, N = /* @__PURE__ */ new Map();
|
|
125
|
-
function P(e) {
|
|
126
|
-
return n(N, e, () => F(e));
|
|
127
|
-
}
|
|
128
|
-
function F(e) {
|
|
129
|
-
try {
|
|
130
|
-
let t = new Intl.DateTimeFormat(e, {
|
|
131
|
-
day: "2-digit",
|
|
132
|
-
month: "2-digit",
|
|
133
|
-
year: "numeric",
|
|
134
|
-
timeZone: "UTC",
|
|
135
|
-
calendar: "gregory",
|
|
136
|
-
numberingSystem: "latn"
|
|
137
|
-
}).formatToParts(j), n = t.map((e) => e.type).filter((e) => e === "day" || e === "month" || e === "year"), r = t.findIndex((e) => e.type !== "literal"), i = t.slice(r).find((e) => e.type === "literal")?.value.replace(M, "").trim();
|
|
138
|
-
if (n.length === 3 && i) return {
|
|
139
|
-
order: n,
|
|
140
|
-
separator: i,
|
|
141
|
-
lengths: n.map((e) => e === "year" ? 4 : 2),
|
|
142
|
-
size: 8
|
|
143
|
-
};
|
|
144
|
-
} catch {}
|
|
145
|
-
return A;
|
|
146
|
-
}
|
|
147
|
-
function I(t, n) {
|
|
148
|
-
let r = e(t).slice(0, n.size), i = "", a = 0;
|
|
149
|
-
for (let e = 0; e < n.lengths.length; e++) {
|
|
150
|
-
let t = n.lengths[e], o = r.slice(a, a + t);
|
|
151
|
-
if (!o || (i += o, a += t, o.length < t)) break;
|
|
152
|
-
e < n.lengths.length - 1 && (i += n.separator);
|
|
153
|
-
}
|
|
154
|
-
return i;
|
|
155
|
-
}
|
|
156
|
-
function L(e, t) {
|
|
157
|
-
if (!i(e)) return "";
|
|
158
|
-
let [n, r, a] = e.split("-"), o = {
|
|
159
|
-
year: n,
|
|
160
|
-
month: r,
|
|
161
|
-
day: a
|
|
162
|
-
};
|
|
163
|
-
return I(t.order.map((e) => o[e]).join(""), t);
|
|
164
|
-
}
|
|
165
|
-
function R(t, n, r = {}) {
|
|
166
|
-
let a = e(t), o = {}, s = 0;
|
|
167
|
-
for (let e = 0; e < n.order.length; e++) {
|
|
168
|
-
let t = n.order[e], i = n.lengths[e], c = a.slice(s, s + i);
|
|
169
|
-
if (c.length === i) s += i;
|
|
170
|
-
else if (t === "year" && r.yearPivot !== void 0 && e === n.order.length - 1 && c.length === 2) s += 2;
|
|
171
|
-
else return null;
|
|
172
|
-
o[t] = c;
|
|
173
|
-
}
|
|
174
|
-
if (s !== a.length) return null;
|
|
175
|
-
let c = `${o.year.length === 2 ? String(r.yearPivot + Number(o.year)) : o.year}-${o.month}-${o.day}`;
|
|
176
|
-
return i(c) ? c : null;
|
|
177
|
-
}
|
|
178
|
-
function z(e, t, n) {
|
|
179
|
-
let r = 0;
|
|
180
|
-
if (t > 0) {
|
|
181
|
-
r = e.length;
|
|
182
|
-
let n = 0;
|
|
183
|
-
for (let i = 0; i < e.length; i++) {
|
|
184
|
-
let a = e.charCodeAt(i);
|
|
185
|
-
if (a >= 48 && a <= 57 && ++n === t) {
|
|
186
|
-
r = i + 1;
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return n && e.startsWith(n, r) && (r += n.length), r;
|
|
192
|
-
}
|
|
193
|
-
var B = {
|
|
194
|
-
day: "d",
|
|
195
|
-
month: "m",
|
|
196
|
-
year: "y"
|
|
197
|
-
}, V = /[\p{sc=Han}\p{sc=Hangul}\p{sc=Hiragana}\p{sc=Katakana}]/u;
|
|
198
|
-
function H(e, t) {
|
|
199
|
-
let n = W(e);
|
|
200
|
-
return t.order.map((e, r) => n[e].repeat(t.lengths[r])).join(t.separator);
|
|
201
|
-
}
|
|
202
|
-
var U = /* @__PURE__ */ new Map();
|
|
203
|
-
function W(e) {
|
|
204
|
-
return n(U, e, () => G(e));
|
|
205
|
-
}
|
|
206
|
-
function G(e) {
|
|
207
|
-
let t = { ...B };
|
|
208
|
-
try {
|
|
209
|
-
let n = new Intl.DisplayNames(e, { type: "dateTimeField" });
|
|
210
|
-
for (let r of [
|
|
211
|
-
"day",
|
|
212
|
-
"month",
|
|
213
|
-
"year"
|
|
214
|
-
]) {
|
|
215
|
-
let i = [...n.of(r) ?? ""][0];
|
|
216
|
-
i && /\p{L}/u.test(i) && !V.test(i) && (t[r] = i.toLocaleLowerCase(e));
|
|
217
|
-
}
|
|
218
|
-
} catch {}
|
|
219
|
-
return t;
|
|
91
|
+
let s = w(n, r), c = d(e, t);
|
|
92
|
+
return c === 0 ? s.format(i) : c < 0 ? s.formatRange(i, o) : s.formatRange(o, i);
|
|
220
93
|
}
|
|
221
94
|
//#endregion
|
|
222
|
-
export { c as addDays, l as addMonths, g as buildMonthGrid,
|
|
95
|
+
export { c as addDays, l as addMonths, g as buildMonthGrid, p as clampISO, d as compareISO, u as daysInMonth, v as firstDayOfWeekFor, T as formatDateDisplay, E as formatDisplayRange, o as formatISO, h as isDateAllowed, f as isSameISO, i as isValidISO, m as isWithin, s as isoOf, a as parseISO, S as weekdayNames };
|
|
223
96
|
|
|
224
97
|
//# sourceMappingURL=date.js.map
|