vectis-ui 0.1.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -6
- package/dist/components/VAccordion/VAccordion.css +1 -1
- package/dist/components/VAccordion/VAccordion.d.ts +9 -16
- package/dist/components/VAccordion/VAccordion.js.map +1 -1
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.css +1 -1
- package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/context.d.ts +1 -8
- package/dist/components/VAccordion/context.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.css +1 -1
- package/dist/components/VAvatar/VAvatar.d.ts +44 -29
- package/dist/components/VAvatar/VAvatar.js.map +1 -1
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAvatar/context.d.ts +6 -10
- package/dist/components/VAvatar/context.js.map +1 -1
- package/dist/components/VBadge/VBadge.css +1 -1
- package/dist/components/VBadge/VBadge.d.ts +31 -10
- package/dist/components/VBadge/VBadge.js.map +1 -1
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButton.css +1 -1
- package/dist/components/VButton/VButton.d.ts +30 -10
- package/dist/components/VButton/VButton.js.map +1 -1
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.css +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +76 -13
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VButton/context.d.ts +30 -0
- package/dist/components/VButton/context.js +6 -0
- package/dist/components/VButton/context.js.map +1 -0
- package/dist/components/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +50 -36
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.css +1 -1
- package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.css +1 -1
- package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.css +1 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +158 -0
- package/dist/components/VCalendar/gesture.js +170 -0
- package/dist/components/VCalendar/gesture.js.map +1 -0
- package/dist/components/VCalendar/keyboard.d.ts +9 -3
- package/dist/components/VCalendar/keyboard.js +2 -6
- package/dist/components/VCalendar/keyboard.js.map +1 -1
- package/dist/components/VCalendar/layout.d.ts +67 -54
- package/dist/components/VCalendar/layout.js +77 -69
- package/dist/components/VCalendar/layout.js.map +1 -1
- package/dist/components/VCalendar/timeGrid.d.ts +55 -0
- package/dist/components/VCalendar/timeGrid.js +71 -0
- package/dist/components/VCalendar/timeGrid.js.map +1 -0
- package/dist/components/VCalendar/types.d.ts +41 -16
- package/dist/components/VCarousel/VCarousel.css +1 -1
- package/dist/components/VCarousel/VCarousel.d.ts +21 -41
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
- package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
- package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCarousel/context.d.ts +0 -12
- package/dist/components/VCarousel/context.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.css +1 -1
- package/dist/components/VChip/VChip.d.ts +36 -26
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.css +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +127 -31
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.css +1 -1
- package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
- package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.css +1 -1
- package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
- package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +50 -28
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.css +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +90 -42
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.css +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialog.css +1 -1
- package/dist/components/VDialog/VDialog.d.ts +45 -33
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
- package/dist/components/VDialog/VDialogAlert.js.map +1 -1
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.css +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +78 -26
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.css +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/fileKind.d.ts +2 -27
- package/dist/components/VFilePicker/fileKind.js +9 -8
- package/dist/components/VFilePicker/fileKind.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VIcon/VIcon.css +1 -1
- package/dist/components/VIcon/VIcon.d.ts +15 -6
- package/dist/components/VIcon/VIcon.js.map +1 -1
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VIcon/iconProps.js.map +1 -1
- package/dist/components/VIcon/icons/index.d.ts +1 -1
- package/dist/components/VIcon/icons/index.js.map +1 -1
- package/dist/components/VIcon/icons/names.d.ts +1 -1
- package/dist/components/VIcon/icons/names.js.map +1 -1
- package/dist/components/VIcon/resolver.d.ts +3 -3
- package/dist/components/VIcon/resolver.js.map +1 -1
- package/dist/components/VIcon/types.d.ts +12 -12
- package/dist/components/VIconButton/VIconButton.css +1 -1
- package/dist/components/VIconButton/VIconButton.d.ts +28 -11
- package/dist/components/VIconButton/VIconButton.js.map +1 -1
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInput.css +1 -1
- package/dist/components/VInput/VInput.d.ts +26 -7
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +2 -0
- package/dist/components/VInput/VInputGroup.d.ts +47 -0
- package/dist/components/VInput/VInputGroup.js +9 -0
- package/dist/components/VInput/VInputGroup.js.map +1 -0
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VInput/context.d.ts +11 -0
- package/dist/components/VInput/context.js +6 -0
- package/dist/components/VInput/context.js.map +1 -0
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenu.d.ts +23 -30
- package/dist/components/VMenu/VMenu.js.map +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.css +1 -1
- package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
- package/dist/components/VMenu/VMenuGroup.js.map +1 -1
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.css +1 -1
- package/dist/components/VMenu/VMenuItem.d.ts +11 -19
- package/dist/components/VMenu/VMenuItem.js.map +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMenu/context.d.ts +2 -6
- package/dist/components/VMenu/context.js.map +1 -1
- package/dist/components/VPagination/VPagination.css +1 -1
- package/dist/components/VPagination/VPagination.d.ts +60 -22
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VPopover/VPopover.css +1 -1
- package/dist/components/VPopover/VPopover.d.ts +26 -7
- package/dist/components/VPopover/VPopover.js.map +1 -1
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.css +1 -1
- package/dist/components/VRadio/VRadio.d.ts +36 -18
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.d.ts +4 -2
- package/dist/components/VSeparator/VSeparator.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/context.d.ts +0 -14
- package/dist/components/VSideNavigation/context.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSlider/VSlider.css +1 -1
- package/dist/components/VSlider/VSlider.d.ts +52 -27
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.css +1 -1
- package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/state.d.ts +0 -27
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.css +1 -1
- package/dist/components/VSpinner/VSpinner.d.ts +6 -6
- package/dist/components/VSpinner/VSpinner.js.map +1 -1
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.css +1 -1
- package/dist/components/VSwitch/VSwitch.d.ts +35 -13
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTab.css +1 -1
- package/dist/components/VTabs/VTab.d.ts +12 -12
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.d.ts +2 -10
- package/dist/components/VTabs/VTabPanel.js.map +1 -1
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.css +1 -1
- package/dist/components/VTabs/VTabs.d.ts +27 -18
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/context.d.ts +9 -19
- package/dist/components/VTabs/context.js +1 -1
- package/dist/components/VTabs/context.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.css +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +34 -6
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.css +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/search.d.ts +24 -0
- package/dist/components/VTimeInput/search.js +22 -0
- package/dist/components/VTimeInput/search.js.map +1 -0
- package/dist/components/VTimePicker/VTimePicker.css +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/limits.d.ts +88 -0
- package/dist/components/VTimePicker/limits.js +70 -0
- package/dist/components/VTimePicker/limits.js.map +1 -0
- package/dist/components/VToast/VToast.css +1 -1
- package/dist/components/VToast/VToast.d.ts +0 -10
- package/dist/components/VToast/VToast.js.map +1 -1
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/VToaster.css +1 -1
- package/dist/components/VToast/VToaster.d.ts +0 -17
- package/dist/components/VToast/VToaster.js.map +1 -1
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToast/state.d.ts +10 -19
- package/dist/components/VToast/state.js +1 -1
- package/dist/components/VToast/state.js.map +1 -1
- package/dist/components/VToggle/VToggle.css +1 -1
- package/dist/components/VToggle/VToggle.d.ts +56 -11
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +16 -2
- package/dist/components/VToggle/VToggleItem.js +0 -2
- package/dist/components/VToggle/VToggleItem.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/context.d.ts +4 -24
- package/dist/components/VToggle/context.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.css +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +9 -33
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTypography/VTypography.js.map +1 -1
- package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useAriaLabel.d.ts +0 -17
- package/dist/composables/useAriaLabel.js.map +1 -1
- package/dist/composables/useClearable.d.ts +42 -0
- package/dist/composables/useClearable.js +19 -0
- package/dist/composables/useClearable.js.map +1 -0
- package/dist/composables/useControlShape.d.ts +22 -0
- package/dist/composables/useControlShape.js +13 -0
- package/dist/composables/useControlShape.js.map +1 -0
- package/dist/composables/useDetailsOpen.d.ts +22 -0
- package/dist/composables/useDetailsOpen.js +21 -0
- package/dist/composables/useDetailsOpen.js.map +1 -0
- package/dist/composables/useFieldIds.d.ts +0 -15
- package/dist/composables/useFieldIds.js +8 -7
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +21 -18
- package/dist/composables/useFieldPanel.js +43 -23
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileDrop.d.ts +0 -22
- package/dist/composables/useFileDrop.js.map +1 -1
- package/dist/composables/useFileField.d.ts +45 -17
- package/dist/composables/useFileField.js +40 -20
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useFocusoutDismiss.d.ts +0 -15
- package/dist/composables/useFocusoutDismiss.js.map +1 -1
- package/dist/composables/useIconClickHandlers.d.ts +29 -14
- package/dist/composables/useIconClickHandlers.js +15 -5
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/composables/useInertLink.d.ts +20 -0
- package/dist/composables/useInertLink.js +23 -0
- package/dist/composables/useInertLink.js.map +1 -0
- package/dist/composables/useMaskedField.d.ts +33 -10
- package/dist/composables/useMaskedField.js +45 -1
- package/dist/composables/useMaskedField.js.map +1 -1
- package/dist/composables/usePopover.d.ts +15 -1
- package/dist/composables/usePopover.js +23 -8
- package/dist/composables/usePopover.js.map +1 -1
- package/dist/composables/useProgressValue.d.ts +5 -8
- package/dist/composables/useProgressValue.js +6 -3
- package/dist/composables/useProgressValue.js.map +1 -1
- package/dist/composables/useRootAttrs.d.ts +12 -19
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useTimer.d.ts +8 -10
- package/dist/composables/useTimer.js.map +1 -1
- package/dist/i18n/en.d.ts +2 -10
- package/dist/i18n/en.js +18 -19
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.d.ts +2 -18
- package/dist/i18n/fr.js +18 -19
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +44 -47
- package/dist/i18n/state.js +20 -17
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +53 -44
- package/dist/icons.d.ts +3 -3
- package/dist/index.d.ts +43 -17
- package/dist/index.js +45 -44
- package/dist/styles.css +1 -1
- package/dist/tokens/css.js.map +1 -1
- package/dist/tokens/index.d.ts +5 -1
- package/dist/tokens/primitives.js.map +1 -1
- package/dist/tokens/semantic.d.ts +5 -1
- package/dist/tokens/semantic.js +6 -2
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens/types.d.ts +7 -15
- package/dist/tokens/types.js.map +1 -1
- package/dist/tokens.json +25 -5
- package/dist/types.d.ts +24 -0
- package/dist/utils/array.d.ts +3 -6
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/arrowNav.d.ts +17 -17
- package/dist/utils/arrowNav.js +5 -3
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/chip.d.ts +11 -15
- package/dist/utils/chip.js.map +1 -1
- package/dist/utils/css.d.ts +22 -11
- package/dist/utils/css.js +5 -2
- package/dist/utils/css.js.map +1 -1
- package/dist/utils/date.d.ts +42 -19
- package/dist/utils/date.js +97 -98
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/direction.d.ts +6 -12
- package/dist/utils/direction.js.map +1 -1
- package/dist/utils/env.d.ts +5 -6
- package/dist/utils/file.d.ts +46 -58
- package/dist/utils/file.js +43 -36
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/focus.d.ts +8 -17
- package/dist/utils/focus.js.map +1 -1
- package/dist/utils/hostWarns.d.ts +12 -0
- package/dist/utils/hostWarns.js +6 -0
- package/dist/utils/hostWarns.js.map +1 -0
- package/dist/utils/ids.d.ts +10 -0
- package/dist/utils/ids.js +8 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/matcher.d.ts +5 -9
- package/dist/utils/matcher.js.map +1 -1
- package/dist/utils/memo.d.ts +12 -0
- package/dist/utils/memo.js +9 -0
- package/dist/utils/memo.js.map +1 -0
- package/dist/utils/number.d.ts +3 -4
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/text.d.ts +20 -9
- package/dist/utils/text.js +17 -3
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time.d.ts +53 -61
- package/dist/utils/time.js +49 -45
- package/dist/utils/time.js.map +1 -1
- package/dist/utils/vnode.d.ts +8 -15
- package/dist/utils/vnode.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/VToggle/VToggleItem.css +0 -2
|
@@ -38,21 +38,36 @@ export interface MaskedFieldOptions<T extends string> {
|
|
|
38
38
|
*/
|
|
39
39
|
acceptable?: (value: T) => boolean;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
/** What a component adds to the mask's own keys. */
|
|
42
|
+
export interface MaskedKeyHooks {
|
|
43
|
+
/**
|
|
44
|
+
* A key that is not a digit was typed — a separator, most often. Its character never
|
|
45
|
+
* reaches the field; what it MEANS is the component's: a date pads the field being typed
|
|
46
|
+
* and moves on to the next, a time pads the hour.
|
|
47
|
+
*/
|
|
48
|
+
onSeparator: (el: HTMLInputElement) => void;
|
|
49
|
+
/**
|
|
50
|
+
* The down arrow, which a component with a panel turns into the way into it. It answers
|
|
51
|
+
* whether it handled the press: only then is the default cancelled, and a press left
|
|
52
|
+
* alone travels on to whatever opens the panel.
|
|
53
|
+
*/
|
|
54
|
+
onArrowDown?: () => boolean;
|
|
55
|
+
/** Runs once Enter has committed or reverted what was typed: closing a panel, say. */
|
|
56
|
+
onEnter?: () => void;
|
|
57
|
+
}
|
|
58
|
+
export interface MaskedField<T extends string> {
|
|
42
59
|
/** The text currently in the field while it is being typed into. */
|
|
43
60
|
draft: Ref<string>;
|
|
44
61
|
/**
|
|
45
|
-
* TRAP — bind
|
|
46
|
-
* listener
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* have a test locking it.
|
|
62
|
+
* TRAP — bind with `v-model` and NEVER `:model-value`. Without an `onUpdate:modelValue`
|
|
63
|
+
* listener, `useModel` keeps an internal copy of the RAW typed text and rewrites it on the
|
|
64
|
+
* next patch, erasing the mask exactly when the masked text did NOT change: a rejected
|
|
65
|
+
* character, or a digit past the last. Both components lock it with a test.
|
|
50
66
|
*/
|
|
51
67
|
fieldModel: WritableComputedRef<string | number>;
|
|
52
68
|
/**
|
|
53
|
-
* Writes
|
|
54
|
-
*
|
|
55
|
-
* often is.
|
|
69
|
+
* Writes into both the draft and the input. Both are needed: Vue does not patch an element
|
|
70
|
+
* whose value it believes unchanged, and after a reformat it often is.
|
|
56
71
|
*/
|
|
57
72
|
writeField: (text: string, caret?: number) => void;
|
|
58
73
|
/** Takes the value as soon as what has been typed is complete and acceptable. */
|
|
@@ -61,5 +76,13 @@ export interface MaskedField {
|
|
|
61
76
|
commitOrRevert: () => void;
|
|
62
77
|
/** The handler to bind to the field's input event. */
|
|
63
78
|
onFieldInput: (event: Event) => void;
|
|
79
|
+
/** The handler for the field's keydown event, with what the component adds to it. */
|
|
80
|
+
onKeydown: (event: KeyboardEvent, hooks: MaskedKeyHooks) => void;
|
|
81
|
+
/**
|
|
82
|
+
* The handler for the field's paste event. `recognize` reads the pasted text as a WHOLE
|
|
83
|
+
* value when it is one — a date in ISO form, a canonical time — and answers nothing
|
|
84
|
+
* otherwise, in which case only the digits of what was pasted are taken.
|
|
85
|
+
*/
|
|
86
|
+
onPaste: (event: ClipboardEvent, recognize: (pasted: string) => T | null) => void;
|
|
64
87
|
}
|
|
65
|
-
export declare function useMaskedField<T extends string>(options: MaskedFieldOptions<T>): MaskedField
|
|
88
|
+
export declare function useMaskedField<T extends string>(options: MaskedFieldOptions<T>): MaskedField<T>;
|
|
@@ -39,13 +39,57 @@ function i(i) {
|
|
|
39
39
|
let n = t.target, r = n.value, a = n.selectionStart ?? r.length, o = e(r.slice(0, a)).length, s = e(r).slice(0, i.maxDigits()), u = !String(t.inputType ?? "").startsWith("delete"), d = i.format(s);
|
|
40
40
|
c(d, i.caret(d, Math.min(o, s.length), u)), l();
|
|
41
41
|
}
|
|
42
|
+
function f(t) {
|
|
43
|
+
let n = t.selectionStart;
|
|
44
|
+
if (n === null || n !== t.selectionEnd || n === 0 || /\d/.test(t.value[n - 1] ?? "")) return !1;
|
|
45
|
+
let r = e(t.value.slice(0, n)).length, a = e(t.value), o = i.format(a.slice(0, r - 1) + a.slice(r));
|
|
46
|
+
return c(o, i.caret(o, r - 1, !1)), l(), !0;
|
|
47
|
+
}
|
|
48
|
+
function p(t, n) {
|
|
49
|
+
let r = t.selectionStart ?? t.value.length, a = t.selectionEnd ?? r, o = e(t.value), s = e(t.value.slice(0, r)).length, u = e(t.value.slice(0, a)).length, d = e(n), f = (o.slice(0, s) + d + o.slice(u)).slice(0, i.maxDigits()), p = i.format(f);
|
|
50
|
+
c(p, i.caret(p, Math.min(s + d.length, f.length), !0)), l();
|
|
51
|
+
}
|
|
52
|
+
function m(e, t) {
|
|
53
|
+
if (!i.typing()) return;
|
|
54
|
+
let n = i.fieldEl.value;
|
|
55
|
+
if (n) {
|
|
56
|
+
if (e.key === "Enter") {
|
|
57
|
+
e.preventDefault(), u(), t.onEnter?.();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (e.key === "ArrowDown") {
|
|
61
|
+
t.onArrowDown?.() && e.preventDefault();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (e.key === "Backspace") {
|
|
65
|
+
f(n) && e.preventDefault();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && !/\d/.test(e.key) && (e.preventDefault(), t.onSeparator(n));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function h(e, t) {
|
|
72
|
+
if (!i.typing()) return;
|
|
73
|
+
let n = i.fieldEl.value;
|
|
74
|
+
if (!n) return;
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
let r = (e.clipboardData?.getData("text") ?? "").trim(), a = t(r);
|
|
77
|
+
if (a) {
|
|
78
|
+
let e = i.toMask(a);
|
|
79
|
+
c(e, e.length), o(a) && a !== i.readValue() && i.writeValue(a);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
p(n, r);
|
|
83
|
+
}
|
|
42
84
|
return {
|
|
43
85
|
draft: a,
|
|
44
86
|
fieldModel: s,
|
|
45
87
|
writeField: c,
|
|
46
88
|
commitLive: l,
|
|
47
89
|
commitOrRevert: u,
|
|
48
|
-
onFieldInput: d
|
|
90
|
+
onFieldInput: d,
|
|
91
|
+
onKeydown: m,
|
|
92
|
+
onPaste: h
|
|
49
93
|
};
|
|
50
94
|
}
|
|
51
95
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMaskedField.js","names":[],"sources":["../../src/composables/useMaskedField.ts"],"sourcesContent":["// @core — module-wide: mask, caret and commit are the field's own behaviour.\n/**\n * A field one types a date or a time into: the reader enters digits, and the separators\n * appear as they go.\n *\n * It is the FIELD half of the date and time pickers, the panel half being shared already.\n * What is injected here is only the vocabulary of the mask itself: how many digits it\n * holds, how those digits become text, where the caret should land, and how the text\n * becomes a value.\n *\n * The two differ in one respect worth knowing: a date's separator depends on the reader's\n * language while a time's is the same everywhere, so they work out the caret differently.\n * Nothing here cares — it only tells them whether the edit was an INSERTION, which is what\n * decides whether the caret steps over a separator.\n */\nimport { computed, ref, watch, type Ref, type WritableComputedRef } from 'vue'\n\nimport { digitsOf } from '../utils/text'\n\nexport interface MaskedFieldOptions<T extends string> {\n /** The real input, which is written to directly — see below. */\n fieldEl: Ref<HTMLInputElement | null>\n /** Whether the field can be typed into at all. Everything here is inert when it cannot. */\n typing: () => boolean\n /** What the field shows when it is NOT being typed into: the value, written out in full. */\n displayText: () => string\n /** The current value, or nothing. */\n readValue: () => T | null\n /** Writes a new value. */\n writeValue: (value: T | null) => void\n /** How many digits the mask holds: eight for a date, four for a time. */\n maxDigits: () => number\n /** Lays a run of digits out as masked text. */\n format: (digits: string) => string\n /**\n * Where the caret goes so as to sit after a given number of digits.\n *\n * The flag says whether something was INSERTED rather than deleted, and it matters: on\n * a deletion the caret must stay IN FRONT of the separator, or the next press of the key\n * would step over it instead of erasing, and the key would appear to do nothing.\n */\n caret: (text: string, digitsBefore: number, inserting: boolean) => number\n /**\n * Reads masked text back into a value, or nothing when it is not one yet.\n *\n * The flag marks the FINAL reading, when the reader leaves the field. A date expands a\n * two-digit year only there: \"26\" must not be committed as 2026 while it may still be on\n * its way to becoming it.\n */\n parse: (text: string, final: boolean) => T | null\n /** Writes a value as masked text, and nothing at all for no value. */\n toMask: (value: T | null) => string\n /**\n * Whether a value the reader has finished typing may be taken — within the bounds, not\n * one of the excluded days. Everything is acceptable by default.\n */\n acceptable?: (value: T) => boolean\n}\n\nexport interface MaskedField {\n /** The text currently in the field while it is being typed into. */\n draft: Ref<string>\n /**\n * TRAP — bind this with `v-model` on the field and NEVER as a one-way value. Without a\n * listener for its updates, the field keeps an internal copy of the RAW text typed and\n * writes it back on the next patch — which erases the mask precisely when the masked\n * text did NOT change: a rejected character, or a digit past the last. Both components\n * have a test locking it.\n */\n fieldModel: WritableComputedRef<string | number>\n /**\n * Writes the text into both the draft and the input itself. Both are needed: Vue does\n * not patch an element whose text it believes is unchanged, and after a reformat it\n * often is.\n */\n writeField: (text: string, caret?: number) => void\n /** Takes the value as soon as what has been typed is complete and acceptable. */\n commitLive: () => void\n /** Called as the reader leaves the field. It is safe to call twice. */\n commitOrRevert: () => void\n /** The handler to bind to the field's input event. */\n onFieldInput: (event: Event) => void\n}\n\nexport function useMaskedField<T extends string>(options: MaskedFieldOptions<T>): MaskedField {\n const draft = ref('')\n const acceptable = options.acceptable ?? (() => true)\n\n /*\n * The current value, written as masked text. Being derived, it also tracks whatever the\n * conversion reads — the language's own mask, the choice of clock — so neither component\n * has to list those dependencies itself.\n */\n const maskedValue = computed(() => options.toMask(options.readValue()))\n\n watch(\n maskedValue,\n (next) => {\n // TRAP — this guard is what stops the field and the value chasing each other. A\n // commit made while typing writes the value, which comes straight back here; without\n // the test, the text being typed and the caret with it would be overwritten by text\n // identical to what is already there.\n if (next !== draft.value) draft.value = next\n },\n { immediate: true },\n )\n\n const fieldModel = computed<string | number>({\n get: () => (options.typing() ? draft.value : options.displayText()),\n set: (value) => {\n if (options.typing()) draft.value = String(value ?? '')\n },\n })\n\n function writeField(text: string, caret?: number) {\n draft.value = text\n const el = options.fieldEl.value\n if (!el) return\n if (el.value !== text) el.value = text\n if (caret !== undefined) el.setSelectionRange(caret, caret)\n }\n\n function commitLive() {\n const value = options.parse(draft.value, false)\n if (value && acceptable(value) && value !== options.readValue()) options.writeValue(value)\n }\n\n /**\n * Tidies up what was typed, or SILENTLY puts back what was there before.\n *\n * An entry that is incomplete, impossible — the 31st of February — outside the allowed\n * bounds or excluded simply disappears in favour of the current value. There is\n * deliberately no error state of our own competing with the `invalid` prop a consumer\n * controls.\n */\n function commitOrRevert() {\n if (!options.typing()) return\n if (!digitsOf(draft.value)) {\n if (options.readValue() !== null) options.writeValue(null)\n writeField('')\n return\n }\n const value = options.parse(draft.value, true)\n if (value && acceptable(value)) {\n if (value !== options.readValue()) options.writeValue(value)\n // Rewritten in full: \"5/6/26\" becomes \"05/06/2026\".\n writeField(options.toMask(value))\n return\n }\n writeField(options.toMask(options.readValue()))\n }\n\n /**\n * Reformats the field on every keystroke.\n *\n * The invariant to keep is that the number of digits to the LEFT of the caret survives\n * the reformatting. Restoring an absolute position instead would misplace the caret on\n * exactly the keystrokes that matter: a position jumps by one the moment a separator\n * appears or disappears.\n */\n function onFieldInput(event: Event) {\n if (!options.typing()) return\n const el = event.target as HTMLInputElement\n const raw = el.value\n const caret = el.selectionStart ?? raw.length\n const before = digitsOf(raw.slice(0, caret)).length\n const digits = digitsOf(raw).slice(0, options.maxDigits())\n const inserting = !String((event as InputEvent).inputType ?? '').startsWith('delete')\n const text = options.format(digits)\n writeField(text, options.caret(text, Math.min(before, digits.length), inserting))\n commitLive()\n }\n\n return { draft, fieldModel, writeField, commitLive, commitOrRevert, onFieldInput }\n}\n"],"mappings":";;;AAoFA,SAAgB,EAAiC,GAA6C;CAC5F,IAAM,IAAQ,EAAI,EAAE,GACd,IAAa,EAAQ,qBAAqB;CAShD,EAFoB,QAAe,EAAQ,OAAO,EAAQ,UAAU,CAAC,CAGnE,IACC,MAAS;EAKR,AAAI,MAAS,EAAM,UAAO,EAAM,QAAQ;CAC1C,GACA,EAAE,WAAW,GAAK,CACpB;CAEA,IAAM,IAAa,EAA0B;EAC3C,WAAY,EAAQ,OAAO,IAAI,EAAM,QAAQ,EAAQ,YAAY;EACjE,MAAM,MAAU;GACd,AAAI,EAAQ,OAAO,MAAG,EAAM,QAAQ,OAAO,KAAS,EAAE;EACxD;CACF,CAAC;CAED,SAAS,EAAW,GAAc,GAAgB;EAChD,EAAM,QAAQ;EACd,IAAM,IAAK,EAAQ,QAAQ;EACtB,MACD,EAAG,U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"useMaskedField.js","names":[],"sources":["../../src/composables/useMaskedField.ts"],"sourcesContent":["// @core — module-wide: mask, caret and commit are the field's own behaviour.\n/**\n * The masked field of VDateInput and VTimeInput: the reader types digits, the separators\n * appear as they go. The FIELD half, `useFieldPanel` being the panel half.\n *\n * Only the mask's vocabulary is injected — how many digits, how they become text, where the\n * caret lands, how the text becomes a value. A date's separator is locale-dependent where a\n * time's is universal, so the two compute the caret differently; nothing here cares beyond\n * telling them whether the edit was an INSERTION.\n */\nimport { computed, ref, watch, type Ref, type WritableComputedRef } from 'vue'\n\nimport { digitsOf } from '../utils/text'\n\nexport interface MaskedFieldOptions<T extends string> {\n /** The real input, which is written to directly — see below. */\n fieldEl: Ref<HTMLInputElement | null>\n /** Whether the field can be typed into at all. Everything here is inert when it cannot. */\n typing: () => boolean\n /** What the field shows when it is NOT being typed into: the value, written out in full. */\n displayText: () => string\n /** The current value, or nothing. */\n readValue: () => T | null\n /** Writes a new value. */\n writeValue: (value: T | null) => void\n /** How many digits the mask holds: eight for a date, four for a time. */\n maxDigits: () => number\n /** Lays a run of digits out as masked text. */\n format: (digits: string) => string\n /**\n * Where the caret goes so as to sit after a given number of digits.\n *\n * The flag says whether something was INSERTED rather than deleted, and it matters: on\n * a deletion the caret must stay IN FRONT of the separator, or the next press of the key\n * would step over it instead of erasing, and the key would appear to do nothing.\n */\n caret: (text: string, digitsBefore: number, inserting: boolean) => number\n /**\n * Reads masked text back into a value, or nothing when it is not one yet.\n *\n * The flag marks the FINAL reading, when the reader leaves the field. A date expands a\n * two-digit year only there: \"26\" must not be committed as 2026 while it may still be on\n * its way to becoming it.\n */\n parse: (text: string, final: boolean) => T | null\n /** Writes a value as masked text, and nothing at all for no value. */\n toMask: (value: T | null) => string\n /**\n * Whether a value the reader has finished typing may be taken — within the bounds, not\n * one of the excluded days. Everything is acceptable by default.\n */\n acceptable?: (value: T) => boolean\n}\n\n/** What a component adds to the mask's own keys. */\nexport interface MaskedKeyHooks {\n /**\n * A key that is not a digit was typed — a separator, most often. Its character never\n * reaches the field; what it MEANS is the component's: a date pads the field being typed\n * and moves on to the next, a time pads the hour.\n */\n onSeparator: (el: HTMLInputElement) => void\n /**\n * The down arrow, which a component with a panel turns into the way into it. It answers\n * whether it handled the press: only then is the default cancelled, and a press left\n * alone travels on to whatever opens the panel.\n */\n onArrowDown?: () => boolean\n /** Runs once Enter has committed or reverted what was typed: closing a panel, say. */\n onEnter?: () => void\n}\n\nexport interface MaskedField<T extends string> {\n /** The text currently in the field while it is being typed into. */\n draft: Ref<string>\n /**\n * TRAP — bind with `v-model` and NEVER `:model-value`. Without an `onUpdate:modelValue`\n * listener, `useModel` keeps an internal copy of the RAW typed text and rewrites it on the\n * next patch, erasing the mask exactly when the masked text did NOT change: a rejected\n * character, or a digit past the last. Both components lock it with a test.\n */\n fieldModel: WritableComputedRef<string | number>\n /**\n * Writes into both the draft and the input. Both are needed: Vue does not patch an element\n * whose value it believes unchanged, and after a reformat it often is.\n */\n writeField: (text: string, caret?: number) => void\n /** Takes the value as soon as what has been typed is complete and acceptable. */\n commitLive: () => void\n /** Called as the reader leaves the field. It is safe to call twice. */\n commitOrRevert: () => void\n /** The handler to bind to the field's input event. */\n onFieldInput: (event: Event) => void\n /** The handler for the field's keydown event, with what the component adds to it. */\n onKeydown: (event: KeyboardEvent, hooks: MaskedKeyHooks) => void\n /**\n * The handler for the field's paste event. `recognize` reads the pasted text as a WHOLE\n * value when it is one — a date in ISO form, a canonical time — and answers nothing\n * otherwise, in which case only the digits of what was pasted are taken.\n */\n onPaste: (event: ClipboardEvent, recognize: (pasted: string) => T | null) => void\n}\n\nexport function useMaskedField<T extends string>(options: MaskedFieldOptions<T>): MaskedField<T> {\n const draft = ref('')\n const acceptable = options.acceptable ?? (() => true)\n\n /*\n * The value as masked text. Being a computed it also tracks what the conversion reads —\n * the locale's mask, the hour cycle — so neither component lists those dependencies.\n */\n const maskedValue = computed(() => options.toMask(options.readValue()))\n\n watch(\n maskedValue,\n (next) => {\n // TRAP — the anti-loop guard. A commit made while typing writes the value, which comes\n // straight back here; without the test, the text being typed and its caret would be\n // overwritten by text identical to what is already there.\n if (next !== draft.value) draft.value = next\n },\n { immediate: true },\n )\n\n const fieldModel = computed<string | number>({\n get: () => (options.typing() ? draft.value : options.displayText()),\n set: (value) => {\n if (options.typing()) draft.value = String(value ?? '')\n },\n })\n\n function writeField(text: string, caret?: number) {\n draft.value = text\n const el = options.fieldEl.value\n if (!el) return\n if (el.value !== text) el.value = text\n if (caret !== undefined) el.setSelectionRange(caret, caret)\n }\n\n function commitLive() {\n const value = options.parse(draft.value, false)\n if (value && acceptable(value) && value !== options.readValue()) options.writeValue(value)\n }\n\n /**\n * Commits what was typed, or SILENTLY reverts to the current value.\n *\n * An entry that is incomplete, impossible (31 February), out of bounds or excluded simply\n * disappears. There is deliberately no error state of our own competing with the `invalid`\n * prop the consumer controls.\n */\n function commitOrRevert() {\n if (!options.typing()) return\n if (!digitsOf(draft.value)) {\n if (options.readValue() !== null) options.writeValue(null)\n writeField('')\n return\n }\n const value = options.parse(draft.value, true)\n if (value && acceptable(value)) {\n if (value !== options.readValue()) options.writeValue(value)\n // Rewritten in full: \"5/6/26\" becomes \"05/06/2026\".\n writeField(options.toMask(value))\n return\n }\n writeField(options.toMask(options.readValue()))\n }\n\n /**\n * Reformats the field on every keystroke.\n *\n * The invariant to keep is that the number of digits to the LEFT of the caret survives\n * the reformatting. Restoring an absolute position instead would misplace the caret on\n * exactly the keystrokes that matter: a position jumps by one the moment a separator\n * appears or disappears.\n */\n function onFieldInput(event: Event) {\n if (!options.typing()) return\n const el = event.target as HTMLInputElement\n const raw = el.value\n const caret = el.selectionStart ?? raw.length\n const before = digitsOf(raw.slice(0, caret)).length\n const digits = digitsOf(raw).slice(0, options.maxDigits())\n const inserting = !String((event as InputEvent).inputType ?? '').startsWith('delete')\n const text = options.format(digits)\n writeField(text, options.caret(text, Math.min(before, digits.length), inserting))\n commitLive()\n }\n\n /*\n * Backspace over a SEPARATOR, which erases the digit in front of it instead.\n *\n * TRAP — a separator is placed by the mask and never typed, so erasing one has to erase\n * the DIGIT before it, which is what the reader believes they are erasing. Left alone, the\n * mask writes the separator straight back and the key looks dead.\n *\n * It answers whether it handled the press: `false` means the caret was not sitting after a\n * separator and the browser's own Backspace should run.\n */\n function backspaceOverSeparator(el: HTMLInputElement) {\n const start = el.selectionStart\n if (\n start === null ||\n start !== el.selectionEnd ||\n start === 0 ||\n /\\d/.test(el.value[start - 1] ?? '')\n ) {\n return false\n }\n const before = digitsOf(el.value.slice(0, start)).length\n const digits = digitsOf(el.value)\n const text = options.format(digits.slice(0, before - 1) + digits.slice(before))\n writeField(text, options.caret(text, before - 1, false))\n commitLive()\n return true\n }\n\n /**\n * Splices a pasted run of digits into the one already in the field, at the selection, and\n * puts the caret after what was inserted.\n */\n function pasteDigits(el: HTMLInputElement, pasted: string) {\n const start = el.selectionStart ?? el.value.length\n const end = el.selectionEnd ?? start\n const digits = digitsOf(el.value)\n const from = digitsOf(el.value.slice(0, start)).length\n const to = digitsOf(el.value.slice(0, end)).length\n const inserted = digitsOf(pasted)\n const next = (digits.slice(0, from) + inserted + digits.slice(to)).slice(0, options.maxDigits())\n const text = options.format(next)\n writeField(text, options.caret(text, Math.min(from + inserted.length, next.length), true))\n commitLive()\n }\n\n // @keyboard\n function onKeydown(event: KeyboardEvent, hooks: MaskedKeyHooks) {\n if (!options.typing()) return\n const el = options.fieldEl.value\n if (!el) return\n\n if (event.key === 'Enter') {\n // Cancelling the default does two things at once: it stops the surrounding form from\n // being submitted, and it stops a panel this keystroke closes from being reopened as\n // the event travels up to the component's root.\n event.preventDefault()\n commitOrRevert()\n hooks.onEnter?.()\n return\n }\n if (event.key === 'ArrowDown') {\n if (hooks.onArrowDown?.()) event.preventDefault()\n return\n }\n if (event.key === 'Backspace') {\n if (backspaceOverSeparator(el)) event.preventDefault()\n return\n }\n if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n !/\\d/.test(event.key)\n ) {\n event.preventDefault()\n hooks.onSeparator(el)\n }\n }\n\n /**\n * Pasting. Without the whole-value path, pasting \"2026-06-10\" into a field expecting day,\n * month, year would produce \"20/26/0610\": the digits would be taken in order and the\n * separators ignored.\n *\n * A whole value is written as it stands rather than read back from the mask, which is not\n * a detail on a 12-hour clock: \"19:05\" shows as \"07:05\", and reading that text back would\n * take the half of the day from the AM/PM button instead of from what was pasted.\n */\n function onPaste(event: ClipboardEvent, recognize: (pasted: string) => T | null) {\n if (!options.typing()) return\n const el = options.fieldEl.value\n if (!el) return\n event.preventDefault()\n const pasted = (event.clipboardData?.getData('text') ?? '').trim()\n const whole = recognize(pasted)\n if (whole) {\n const text = options.toMask(whole)\n writeField(text, text.length)\n if (acceptable(whole) && whole !== options.readValue()) options.writeValue(whole)\n return\n }\n pasteDigits(el, pasted)\n }\n\n return {\n draft,\n fieldModel,\n writeField,\n commitLive,\n commitOrRevert,\n onFieldInput,\n onKeydown,\n onPaste,\n }\n}\n"],"mappings":";;;AAuGA,SAAgB,EAAiC,GAAgD;CAC/F,IAAM,IAAQ,EAAI,EAAE,GACd,IAAa,EAAQ,qBAAqB;CAQhD,EAFoB,QAAe,EAAQ,OAAO,EAAQ,UAAU,CAAC,CAGnE,IACC,MAAS;EAIR,AAAI,MAAS,EAAM,UAAO,EAAM,QAAQ;CAC1C,GACA,EAAE,WAAW,GAAK,CACpB;CAEA,IAAM,IAAa,EAA0B;EAC3C,WAAY,EAAQ,OAAO,IAAI,EAAM,QAAQ,EAAQ,YAAY;EACjE,MAAM,MAAU;GACd,AAAI,EAAQ,OAAO,MAAG,EAAM,QAAQ,OAAO,KAAS,EAAE;EACxD;CACF,CAAC;CAED,SAAS,EAAW,GAAc,GAAgB;EAChD,EAAM,QAAQ;EACd,IAAM,IAAK,EAAQ,QAAQ;EACtB,MACD,EAAG,UAAU,MAAM,EAAG,QAAQ,IAC9B,MAAU,KAAA,KAAW,EAAG,kBAAkB,GAAO,CAAK;CAC5D;C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B,CAAC,EAAM,WACP,CAAC,EAAM,WACP,CAAC,EAAM,UACP,CAAC,KAAK,KAAK,EAAM,GAAG,MAEpB,EAAM,eAAe,GACrB,EAAM,YAAY,CAAE;EAjBtB;CAmBF;CAWA,SAAS,EAAQ,GAAuB,GAAyC;EAC/E,IAAI,CAAC,EAAQ,OAAO,GAAG;EACvB,IAAM,IAAK,EAAQ,QAAQ;EAC3B,IAAI,CAAC,GAAI;EACT,EAAM,eAAe;EACrB,IAAM,KAAU,EAAM,eAAe,QAAQ,MAAM,KAAK,GAAA,CAAI,KAAK,GAC3D,IAAQ,EAAU,CAAM;EAC9B,IAAI,GAAO;GACT,IAAM,IAAO,EAAQ,OAAO,CAAK;GAEjC,AADA,EAAW,GAAM,EAAK,MAAM,GACxB,EAAW,CAAK,KAAK,MAAU,EAAQ,UAAU,KAAG,EAAQ,WAAW,CAAK;GAChF;EACF;EACA,EAAY,GAAI,CAAM;CACxB;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
export declare function usePopover(el: Ref<HTMLElement | null
|
|
2
|
+
export declare function usePopover(el: Readonly<Ref<HTMLElement | null>>): {
|
|
3
3
|
shown: Ref<boolean, boolean>;
|
|
4
4
|
syncShown: (event: Event) => void;
|
|
5
5
|
show: (source?: HTMLElement) => void;
|
|
6
6
|
hide: () => void;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* The model half of a popover's `v-model:open`, for a component that publishes its open
|
|
10
|
+
* state: a change to the model opens or closes the panel. The other half — writing the
|
|
11
|
+
* DOM's state back into the model — stays with the component, in its own toggle handler,
|
|
12
|
+
* because that is where it knows the state has settled.
|
|
13
|
+
*
|
|
14
|
+
* `shown` is a getter so that the state may live in a child: VPopover reads its own
|
|
15
|
+
* `usePopover`, VMenu reads the one VMenuPanel exposes.
|
|
16
|
+
*
|
|
17
|
+
* TRAP — the `value === shown()` guard is what keeps the two directions from chasing each
|
|
18
|
+
* other. A panel the browser has just dismissed writes `false` into the model; without the
|
|
19
|
+
* guard that write would come back here as a request to close a panel already closed.
|
|
20
|
+
*/
|
|
21
|
+
export declare function usePopoverModel(open: Ref<boolean>, shown: () => boolean, show: () => void, hide: () => void): void;
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { onMounted as e, ref as t, watch as n } from "vue";
|
|
2
2
|
//#region src/composables/usePopover.ts
|
|
3
|
-
function
|
|
4
|
-
let n =
|
|
3
|
+
function r(e) {
|
|
4
|
+
let n = t(!1);
|
|
5
5
|
function r(e) {
|
|
6
6
|
n.value = e.newState === "open";
|
|
7
7
|
}
|
|
8
8
|
function i(e) {
|
|
9
|
-
|
|
9
|
+
a(e, !0);
|
|
10
10
|
}
|
|
11
|
-
function a() {
|
|
12
|
-
|
|
11
|
+
function a(t, r) {
|
|
12
|
+
let i = e.value;
|
|
13
|
+
if (!(!i || n.value)) try {
|
|
14
|
+
i.showPopover(t ? { source: t } : void 0);
|
|
15
|
+
} catch {
|
|
16
|
+
r && queueMicrotask(() => a(t, !1));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function o() {
|
|
20
|
+
n.value && e.value?.hidePopover();
|
|
13
21
|
}
|
|
14
22
|
return {
|
|
15
23
|
shown: n,
|
|
16
24
|
syncShown: r,
|
|
17
25
|
show: i,
|
|
18
|
-
hide:
|
|
26
|
+
hide: o
|
|
19
27
|
};
|
|
20
28
|
}
|
|
29
|
+
function i(t, r, i, a) {
|
|
30
|
+
n(t, (e) => {
|
|
31
|
+
e !== r() && (e ? i() : a());
|
|
32
|
+
}), e(() => {
|
|
33
|
+
t.value && i();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
21
36
|
//#endregion
|
|
22
|
-
export {
|
|
37
|
+
export { r as usePopover, i as usePopoverModel };
|
|
23
38
|
|
|
24
39
|
//# sourceMappingURL=usePopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopover.js","names":[],"sources":["../../src/composables/usePopover.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"usePopover.js","names":[],"sources":["../../src/composables/usePopover.ts"],"sourcesContent":["// @core\n/**\n * The state plumbing of a `[popover]`: whether it is open, and how to open or close it.\n * The JS half of `styles/floating.css`, which places the panel.\n *\n * The Popover API is imperative where the rest of the library is declarative, and it sets\n * three traps a plain boolean would fall into. Closing an already-closed panel throws, hence\n * the idempotence guards. Opening one while the browser is busy with another popover throws\n * as well, hence the retry on `show`. And an `auto` panel dismisses itself on a click outside\n * or on Escape, so the state is READ from the DOM: wire `syncShown` to both `beforetoggle`\n * and `toggle`, the first being the only one that catches light dismiss in time and the\n * second the only one the jsdom stub emits.\n *\n * TRAP — never assign `shown` by hand. A panel the browser dismissed would then still read\n * as open, and the guard would swallow the next request to close it.\n */\n\nimport { onMounted, ref, watch, type Ref } from 'vue'\n\n// @fallback\n// The option below is newer than the type definitions shipped with TypeScript, so the\n// element is described locally rather than being cast about at each call site.\ntype PopoverWithSource = HTMLElement & { showPopover(options?: { source?: HTMLElement }): void }\n\nexport function usePopover(el: Readonly<Ref<HTMLElement | null>>) {\n const shown = ref(false)\n\n /**\n * Reads the state back off the panel. Bind it to both `@beforetoggle` and `@toggle`, and\n * on the popover element itself: ToggleEvents do not bubble.\n */\n function syncShown(event: Event) {\n shown.value = (event as ToggleEvent).newState === 'open'\n }\n\n /**\n * Opens the panel.\n *\n * TRAP — opening from code rather than from a click must name the invoker as `source`.\n * That is what recreates the relationship a click would have: the implicit anchor and the\n * panel's place in the popover stack. Without it the panel has nothing to position\n * against and lands at the corner of the viewport.\n */\n function show(source?: HTMLElement) {\n attempt(source, true)\n }\n\n /*\n * TRAP — the browser REFUSES to open a popover while it is in the middle of another\n * popover operation, and it throws rather than queueing the request\n * (\"Invalid to show a popover during another show operation\").\n *\n * The case that reaches it is ordinary: closing a popover that holds the focus hands\n * that focus back to its invoker SYNCHRONOUSLY, inside the hide, and a component\n * listening for that focus opens a panel of its own from the handler — a tooltip on the\n * button a menu has just closed. Nothing in the calling code can see it coming.\n *\n * A microtask runs once the stack has unwound, hence after the operation the browser was\n * in, which is all it takes. A second refusal is left alone: the panel stays closed\n * rather than the page taking an uncaught error.\n */\n function attempt(source: HTMLElement | undefined, retry: boolean) {\n const panel = el.value as PopoverWithSource | null\n if (!panel || shown.value) return\n try {\n panel.showPopover(source ? { source } : undefined)\n } catch {\n if (retry) queueMicrotask(() => attempt(source, false))\n }\n }\n\n /** Closes the panel. */\n function hide() {\n if (shown.value) el.value?.hidePopover()\n }\n\n return { shown, syncShown, show, hide }\n}\n\n// @core\n/**\n * The model half of a popover's `v-model:open`, for a component that publishes its open\n * state: a change to the model opens or closes the panel. The other half — writing the\n * DOM's state back into the model — stays with the component, in its own toggle handler,\n * because that is where it knows the state has settled.\n *\n * `shown` is a getter so that the state may live in a child: VPopover reads its own\n * `usePopover`, VMenu reads the one VMenuPanel exposes.\n *\n * TRAP — the `value === shown()` guard is what keeps the two directions from chasing each\n * other. A panel the browser has just dismissed writes `false` into the model; without the\n * guard that write would come back here as a request to close a panel already closed.\n */\nexport function usePopoverModel(\n open: Ref<boolean>,\n shown: () => boolean,\n show: () => void,\n hide: () => void,\n) {\n watch(open, (value) => {\n if (value === shown()) return\n if (value) show()\n else hide()\n })\n\n // @ssr — a watcher does not run during the server render, so a panel asked to be open\n // from the start would never be told to open. Replaying the initial state on mount is\n // what covers that case.\n onMounted(() => {\n if (open.value) show()\n })\n}\n"],"mappings":";;AAwBA,SAAgB,EAAW,GAAuC;CAChE,IAAM,IAAQ,EAAI,EAAK;CAMvB,SAAS,EAAU,GAAc;EAC/B,EAAM,QAAS,EAAsB,aAAa;CACpD;CAUA,SAAS,EAAK,GAAsB;EAClC,EAAQ,GAAQ,EAAI;CACtB;CAgBA,SAAS,EAAQ,GAAiC,GAAgB;EAChE,IAAM,IAAQ,EAAG;EACb,OAAC,KAAS,EAAM,QACpB,IAAI;GACF,EAAM,YAAY,IAAS,EAAE,UAAO,IAAI,KAAA,CAAS;EACnD,QAAQ;GACN,AAAI,KAAO,qBAAqB,EAAQ,GAAQ,EAAK,CAAC;EACxD;CACF;CAGA,SAAS,IAAO;EACd,AAAI,EAAM,SAAO,EAAG,OAAO,YAAY;CACzC;CAEA,OAAO;EAAE;EAAO;EAAW;EAAM;CAAK;AACxC;AAgBA,SAAgB,EACd,GACA,GACA,GACA,GACA;CAUA,AATA,EAAM,IAAO,MAAU;EACjB,MAAU,EAAM,MAChB,IAAO,EAAK,IACX,EAAK;CACZ,CAAC,GAKD,QAAgB;EACd,AAAI,EAAK,SAAO,EAAK;CACvB,CAAC;AACH"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Brings a progress value into line, for the bar and the ring alike.
|
|
4
|
-
*
|
|
5
|
-
* It returns two things: the value itself, held inside the range it is allowed to take,
|
|
6
|
-
* and how far along that range it sits, as a number between nothing and one. Everything
|
|
7
|
-
* both components draw comes from those two — how much of the bar is filled, how much of
|
|
8
|
-
* the ring is drawn, the percentage written out, and what a screen reader announces.
|
|
9
|
-
*/
|
|
10
2
|
export declare function useProgressValue(value: () => number, max: () => number): {
|
|
3
|
+
max: ComputedRef<number>;
|
|
11
4
|
clamped: ComputedRef<number>;
|
|
12
5
|
fraction: ComputedRef<number>;
|
|
6
|
+
/** The fraction as a percentage, unrounded: what the default slot receives. */
|
|
7
|
+
percent: ComputedRef<number>;
|
|
8
|
+
/** The percentage rounded to a whole number: what the component writes by default. */
|
|
9
|
+
roundedPercent: ComputedRef<number>;
|
|
13
10
|
};
|
|
@@ -2,10 +2,13 @@ import { clamp as e } from "../utils/number.js";
|
|
|
2
2
|
import { computed as t } from "vue";
|
|
3
3
|
//#region src/composables/useProgressValue.ts
|
|
4
4
|
function n(n, r) {
|
|
5
|
-
let i = t(() => e(n(), 0,
|
|
5
|
+
let i = t(() => Math.max(r(), 0)), a = t(() => e(n(), 0, i.value)), o = t(() => a.value / (i.value || 1)), s = t(() => o.value * 100);
|
|
6
6
|
return {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
max: i,
|
|
8
|
+
clamped: a,
|
|
9
|
+
fraction: o,
|
|
10
|
+
percent: s,
|
|
11
|
+
roundedPercent: t(() => Math.round(s.value))
|
|
9
12
|
};
|
|
10
13
|
}
|
|
11
14
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProgressValue.js","names":[],"sources":["../../src/composables/useProgressValue.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useProgressValue.js","names":[],"sources":["../../src/composables/useProgressValue.ts"],"sourcesContent":["// @core\n/**\n * A progress value normalized for VProgressLinear and VProgressCircular: the bound brought\n * back to zero or above, the value clamped into range, and its position in that range as a\n * 0-to-1 fraction and as a percentage. Everything either component draws comes from those —\n * the fill, the arc, the percentage written inside, the ARIA values.\n *\n * The bound is returned rather than left for each component to read off its prop: the value\n * is clamped against the NORMALIZED bound, so announcing the raw one would give assistive\n * technology a `aria-valuenow` above an `aria-valuemax` of -5.\n */\n\nimport { computed, type ComputedRef } from 'vue'\nimport { clamp } from '../utils/number'\n\nexport function useProgressValue(\n value: () => number,\n max: () => number,\n): {\n max: ComputedRef<number>\n clamped: ComputedRef<number>\n fraction: ComputedRef<number>\n /** The fraction as a percentage, unrounded: what the default slot receives. */\n percent: ComputedRef<number>\n /** The percentage rounded to a whole number: what the component writes by default. */\n roundedPercent: ComputedRef<number>\n} {\n const normalizedMax = computed(() => Math.max(max(), 0))\n const clamped = computed(() => clamp(value(), 0, normalizedMax.value))\n\n // The `|| 1` denominator is what keeps a max of 0 from dividing by nothing.\n const fraction = computed(() => clamped.value / (normalizedMax.value || 1))\n const percent = computed(() => fraction.value * 100)\n const roundedPercent = computed(() => Math.round(percent.value))\n\n return { max: normalizedMax, clamped, fraction, percent, roundedPercent }\n}\n"],"mappings":";;;AAeA,SAAgB,EACd,GACA,GASA;CACA,IAAM,IAAgB,QAAe,KAAK,IAAI,EAAI,GAAG,CAAC,CAAC,GACjD,IAAU,QAAe,EAAM,EAAM,GAAG,GAAG,EAAc,KAAK,CAAC,GAG/D,IAAW,QAAe,EAAQ,SAAS,EAAc,SAAS,EAAE,GACpE,IAAU,QAAe,EAAS,QAAQ,GAAG;CAGnD,OAAO;EAAE,KAAK;EAAe;EAAS;EAAU;EAAS,gBAFlC,QAAe,KAAK,MAAM,EAAQ,KAAK,CAEL;CAAe;AAC1E"}
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import { ComputedRef, StyleValue } from 'vue';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* pass it on. Without it the class stays untyped, and a template refuses to bind it.
|
|
3
|
+
* Redeclared locally: `@vue/runtime-dom` exports this as `ClassValue` and the `vue` package
|
|
4
|
+
* does not re-export it. Typed `unknown` instead, a template refuses to bind it.
|
|
6
5
|
*/
|
|
7
6
|
type ClassBinding = false | null | undefined | string | Record<string, unknown> | ClassBinding[];
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* The attribute split of the wrapper-root pattern, for components whose root is only a
|
|
9
|
+
* container: VInput, VTextarea, VTabs, VCombobox, VDataTable, VDateInput, VTimeInput, VSlider,
|
|
10
|
+
* and the three choice controls, whose root holds the <label> and its hint.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* unsplit, the field's name, the fact that it is required and everything describing it
|
|
18
|
-
* for a screen reader all end up on a decorative box, where a form ignores them and a
|
|
19
|
-
* screen reader never finds them.
|
|
12
|
+
* `class`/`style` stay on the root, which is the box the consumer positions; everything
|
|
13
|
+
* else is forwarded to the functional element. Unsplit, `name`, `required` and every
|
|
14
|
+
* `aria-*` land on a decorative wrapper, where the form ignores them and assistive
|
|
15
|
+
* technology never finds them.
|
|
20
16
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* The whole set is handed back as well, for the few components that need to look
|
|
25
|
-
* something up in it — an identifier the consumer supplied, which must win over the
|
|
26
|
-
* generated one, or a description that has to be merged rather than replaced.
|
|
17
|
+
* `defineOptions({ inheritAttrs: false })` stays in the SFC — it is a compilation option.
|
|
18
|
+
* `attrs` is returned whole for the components that need to read one back: a consumer `id`
|
|
19
|
+
* that must beat the generated one, a `describedby` to merge rather than replace.
|
|
27
20
|
*/
|
|
28
21
|
export declare function useRootAttrs(): {
|
|
29
22
|
attrs: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRootAttrs.js","names":[],"sources":["../../src/composables/useRootAttrs.ts"],"sourcesContent":["import { computed, useAttrs, type ComputedRef, type StyleValue } from 'vue'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"useRootAttrs.js","names":[],"sources":["../../src/composables/useRootAttrs.ts"],"sourcesContent":["import { computed, useAttrs, type ComputedRef, type StyleValue } from 'vue'\n\n/**\n * Redeclared locally: `@vue/runtime-dom` exports this as `ClassValue` and the `vue` package\n * does not re-export it. Typed `unknown` instead, a template refuses to bind it.\n */\ntype ClassBinding = false | null | undefined | string | Record<string, unknown> | ClassBinding[]\n\n// @a11y\n/**\n * The attribute split of the wrapper-root pattern, for components whose root is only a\n * container: VInput, VTextarea, VTabs, VCombobox, VDataTable, VDateInput, VTimeInput, VSlider,\n * and the three choice controls, whose root holds the <label> and its hint.\n *\n * `class`/`style` stay on the root, which is the box the consumer positions; everything\n * else is forwarded to the functional element. Unsplit, `name`, `required` and every\n * `aria-*` land on a decorative wrapper, where the form ignores them and assistive\n * technology never finds them.\n *\n * `defineOptions({ inheritAttrs: false })` stays in the SFC — it is a compilation option.\n * `attrs` is returned whole for the components that need to read one back: a consumer `id`\n * that must beat the generated one, a `describedby` to merge rather than replace.\n */\nexport function useRootAttrs(): {\n attrs: Record<string, unknown>\n rootClass: ComputedRef<ClassBinding>\n rootStyle: ComputedRef<StyleValue>\n forwardedAttrs: ComputedRef<Record<string, unknown>>\n} {\n const attrs = useAttrs()\n\n return {\n attrs,\n rootClass: computed(() => attrs.class as ClassBinding),\n rootStyle: computed(() => attrs.style as StyleValue),\n forwardedAttrs: computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== 'class' && key !== 'style'),\n ),\n ),\n }\n}\n"],"mappings":";;AAuBA,SAAgB,IAKd;CACA,IAAM,IAAQ,EAAS;CAEvB,OAAO;EACL;EACA,WAAW,QAAe,EAAM,KAAqB;EACrD,WAAW,QAAe,EAAM,KAAmB;EACnD,gBAAgB,QACd,OAAO,YACL,OAAO,QAAQ,CAAK,CAAC,CAAC,QAAQ,CAAC,OAAS,MAAQ,WAAW,MAAQ,OAAO,CAC5E,CACF;CACF;AACF"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A
|
|
2
|
+
* A re-armable delay, cancelled on unmount.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* one before it, or two would run at once — a tooltip armed twice opens, closes and opens
|
|
8
|
-
* again. And it is cancelled before the component is torn down, or the callback would run
|
|
9
|
-
* against a component that no longer exists.
|
|
4
|
+
* `start` always cancels the pending one, or a tooltip armed twice opens, closes and opens
|
|
5
|
+
* again. The handle is a plain variable: nothing renders it, and making it reactive would
|
|
6
|
+
* cost renders for nothing.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* TRAP — a delay of 0 runs the callback SYNCHRONOUSLY, where `setTimeout(fn, 0)` would not.
|
|
9
|
+
* The library's convention is that zero disarms the deferral, which is what makes a debounce
|
|
10
|
+
* of 0 immediate. Callers for whom 0 means "never" (VSnackbar's duration, VCarousel's
|
|
11
|
+
* autoplay) must guard before calling, or the callback fires in the tick that armed it.
|
|
14
12
|
*/
|
|
15
13
|
export declare function useTimer(): {
|
|
16
14
|
start: (fn: () => void, delay: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTimer.js","names":[],"sources":["../../src/composables/useTimer.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"useTimer.js","names":[],"sources":["../../src/composables/useTimer.ts"],"sourcesContent":["// @core\n/**\n * A re-armable delay, cancelled on unmount.\n *\n * `start` always cancels the pending one, or a tooltip armed twice opens, closes and opens\n * again. The handle is a plain variable: nothing renders it, and making it reactive would\n * cost renders for nothing.\n *\n * TRAP — a delay of 0 runs the callback SYNCHRONOUSLY, where `setTimeout(fn, 0)` would not.\n * The library's convention is that zero disarms the deferral, which is what makes a debounce\n * of 0 immediate. Callers for whom 0 means \"never\" (VSnackbar's duration, VCarousel's\n * autoplay) must guard before calling, or the callback fires in the tick that armed it.\n */\n\nimport { onBeforeUnmount } from 'vue'\n\nexport function useTimer(): { start: (fn: () => void, delay: number) => void; cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined\n\n function cancel() {\n clearTimeout(timer)\n timer = undefined\n }\n\n function start(fn: () => void, delay: number) {\n cancel()\n if (delay <= 0) fn()\n else timer = setTimeout(fn, delay)\n }\n\n onBeforeUnmount(cancel)\n\n return { start, cancel }\n}\n"],"mappings":";;AAgBA,SAAgB,IAAmF;CACjG,IAAI;CAEJ,SAAS,IAAS;EAEhB,AADA,aAAa,CAAK,GAClB,IAAQ,KAAA;CACV;CAEA,SAAS,EAAM,GAAgB,GAAe;EAE5C,AADA,EAAO,GACH,KAAS,IAAG,EAAG,IACd,IAAQ,WAAW,GAAI,CAAK;CACnC;CAIA,OAFA,EAAgB,CAAM,GAEf;EAAE;EAAO;CAAO;AACzB"}
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* English, the dictionary the library always carries. Any language with no dictionary of
|
|
4
|
-
* its own falls back to this one, entry by entry, so nothing is ever left unsaid.
|
|
5
|
-
*
|
|
6
|
-
* Take care changing anything here: these words are checked letter for letter by the
|
|
7
|
-
* tests, and they are the names the browser tests reach for when they look a control up.
|
|
8
|
-
* Changing one means changing what expects it.
|
|
9
|
-
*/
|
|
10
|
-
export declare const en: VectisMessages;
|
|
1
|
+
import { Messages } from './types.js';
|
|
2
|
+
export declare const en: Messages;
|
package/dist/i18n/en.js
CHANGED
|
@@ -5,6 +5,7 @@ var e = {
|
|
|
5
5
|
clear: "Clear",
|
|
6
6
|
close: "Close",
|
|
7
7
|
dismiss: "Remove",
|
|
8
|
+
remove: (e) => `Remove ${e}`,
|
|
8
9
|
cancel: "Cancel",
|
|
9
10
|
confirm: "OK"
|
|
10
11
|
},
|
|
@@ -12,8 +13,7 @@ var e = {
|
|
|
12
13
|
label: "Pagination",
|
|
13
14
|
previous: "Previous page",
|
|
14
15
|
next: "Next page",
|
|
15
|
-
page: (e) => `Page ${e}
|
|
16
|
-
hiddenPages: "Hidden pages"
|
|
16
|
+
page: (e) => `Page ${e}`
|
|
17
17
|
},
|
|
18
18
|
tabs: {
|
|
19
19
|
label: "Tabs",
|
|
@@ -27,8 +27,7 @@ var e = {
|
|
|
27
27
|
sideNavigation: { label: "Navigation" },
|
|
28
28
|
combobox: {
|
|
29
29
|
empty: "No results",
|
|
30
|
-
clear: "Clear selection"
|
|
31
|
-
remove: (e) => `Remove ${e}`
|
|
30
|
+
clear: "Clear selection"
|
|
32
31
|
},
|
|
33
32
|
dataTable: {
|
|
34
33
|
empty: "No data",
|
|
@@ -84,6 +83,7 @@ var e = {
|
|
|
84
83
|
label: (e) => `Keyboard shortcut: ${e}`
|
|
85
84
|
},
|
|
86
85
|
datePicker: {
|
|
86
|
+
label: "Date picker",
|
|
87
87
|
previousMonth: "Previous month",
|
|
88
88
|
nextMonth: "Next month",
|
|
89
89
|
previousYear: "Previous year",
|
|
@@ -93,41 +93,40 @@ var e = {
|
|
|
93
93
|
},
|
|
94
94
|
dateInput: {
|
|
95
95
|
clear: "Clear date",
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
openPicker: "Open calendar",
|
|
97
|
+
pickerLabel: "Choose a date"
|
|
98
98
|
},
|
|
99
99
|
timePicker: {
|
|
100
|
+
label: "Time picker",
|
|
100
101
|
meridiem: "AM or PM",
|
|
101
102
|
am: "AM",
|
|
102
103
|
pm: "PM",
|
|
103
104
|
selectHour: "Select hour",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
selectMinutes: "Select minutes",
|
|
106
|
+
choosingHour: "Selecting the hour",
|
|
107
|
+
choosingMinutes: "Selecting the minutes",
|
|
107
108
|
hour: "Hour",
|
|
108
109
|
minutes: "Minutes",
|
|
109
|
-
|
|
110
|
+
hourValue: (e) => `${e} o'clock`,
|
|
110
111
|
minutesValue: (e) => `${e} minutes`
|
|
111
112
|
},
|
|
112
113
|
timeInput: {
|
|
113
114
|
clear: "Clear time",
|
|
114
|
-
openList: "Open the list of times",
|
|
115
115
|
openPicker: "Open time picker",
|
|
116
|
-
listLabel: "Available times",
|
|
117
116
|
pickerLabel: "Choose a time",
|
|
118
|
-
|
|
117
|
+
meridiemValue: (e) => `AM or PM: ${e}`,
|
|
118
|
+
maskPlaceholder: "hh:mm",
|
|
119
|
+
unavailable: "This time is not available."
|
|
119
120
|
},
|
|
120
121
|
fileInput: {
|
|
121
|
-
|
|
122
|
+
openPicker: "Choose files",
|
|
122
123
|
clear: "Clear files",
|
|
123
|
-
remove: (e) => `Remove ${e}`,
|
|
124
124
|
files: (e) => `${e} file${e === 1 ? "" : "s"}`,
|
|
125
125
|
placeholder: "No file selected"
|
|
126
126
|
},
|
|
127
127
|
filePicker: {
|
|
128
128
|
browse: "Browse files",
|
|
129
129
|
or: "or",
|
|
130
|
-
remove: (e) => `Remove ${e}`,
|
|
131
130
|
list: "Selected files"
|
|
132
131
|
},
|
|
133
132
|
carousel: {
|
|
@@ -164,10 +163,10 @@ var e = {
|
|
|
164
163
|
allDay: "All day",
|
|
165
164
|
moreEvents: (e) => `+${e} more`,
|
|
166
165
|
openDay: (e) => `Open ${e}`,
|
|
167
|
-
|
|
166
|
+
untitled: "(No title)",
|
|
168
167
|
eventRoleDescription: "event",
|
|
169
|
-
eventHint: "Press Enter to take hold of
|
|
170
|
-
grabbed: "Event held. Use the arrow keys to move it, Enter to place it, Escape to cancel.",
|
|
168
|
+
eventHint: "Press Enter to open this event. Press Space to take hold of it, then the arrow keys to move it and Shift with the arrow keys to change when it ends.",
|
|
169
|
+
grabbed: "Event held. Use the arrow keys to move it, Enter or Space to place it, Escape to cancel.",
|
|
171
170
|
dropped: "Event placed.",
|
|
172
171
|
reverted: "Move cancelled. The event is back where it was.",
|
|
173
172
|
movedTo: (e, t) => `${e} moved to ${t}.`
|
package/dist/i18n/en.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","names":[],"sources":["../../src/i18n/en.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"en.js","names":[],"sources":["../../src/i18n/en.ts"],"sourcesContent":["/**\n * English, the dictionary always bundled. Any language without one of its own falls back\n * here entry by entry, so nothing is ever left unsaid.\n *\n * TRAP — these strings are asserted letter for letter by the unit tests, and the play\n * functions query controls BY them (they run with the default globals, so the locale there\n * is deterministically `en-US`). Changing a word means changing what expects it.\n */\n\nimport type { Messages } from './types'\n\nexport const en: Messages = {\n common: {\n loading: 'Loading…',\n clear: 'Clear',\n close: 'Close',\n dismiss: 'Remove',\n remove: (name) => `Remove ${name}`,\n cancel: 'Cancel',\n confirm: 'OK',\n },\n pagination: {\n label: 'Pagination',\n previous: 'Previous page',\n next: 'Next page',\n page: (page) => `Page ${page}`,\n },\n tabs: {\n label: 'Tabs',\n previous: 'Previous tabs',\n next: 'Next tabs',\n },\n breadcrumb: {\n label: 'Breadcrumb',\n ellipsis: 'Show intermediate pages',\n },\n sideNavigation: { label: 'Navigation' },\n combobox: {\n empty: 'No results',\n clear: 'Clear selection',\n },\n dataTable: {\n empty: 'No data',\n loading: 'Loading data…',\n searchLabel: 'Search the table',\n searchPlaceholder: 'Search…',\n perPage: 'Rows per page',\n perPageValue: (label, value) => `${label}: ${value}`,\n selectAll: 'Select all',\n selectRow: (index) => `Select row ${index}`,\n // The plural is chosen right here, in the message itself. That one line is the whole\n // of the design system's handling of plurals, and it is meant to be.\n selection: (count) => `${count} item${count === 1 ? '' : 's'} selected`,\n range: ({ start, end, total }) => `${start}–${end} of ${total}`,\n pagination: 'Table pagination',\n },\n toaster: { label: 'Notifications' },\n snackbar: { label: 'Confirmation', action: 'Undo' },\n inputOTP: {\n label: 'Verification code',\n slot: (index, total) => `Character ${index} of ${total}`,\n },\n slider: {\n value: 'Value',\n start: 'Start',\n end: 'End',\n rangeStart: (label) => `${label} (start)`,\n rangeEnd: (label) => `${label} (end)`,\n },\n field: {\n limitExceeded: (max) => `Exceeds the limit of ${max} characters`,\n },\n progress: { percent: (percent) => `${percent}%`, label: 'Progress' },\n hotkeys: {\n command: 'Command',\n ctrl: 'Ctrl',\n alt: 'Alt',\n shift: 'Shift',\n windows: 'Win',\n super: 'Super',\n enter: 'Enter',\n escape: 'Esc',\n space: 'Space',\n backspace: 'Backspace',\n delete: 'Del',\n tab: 'Tab',\n up: 'Up arrow',\n down: 'Down arrow',\n left: 'Left arrow',\n right: 'Right arrow',\n label: (keys) => `Keyboard shortcut: ${keys}`,\n },\n datePicker: {\n label: 'Date picker',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n monthPicker: 'Choose month',\n yearPicker: 'Choose year',\n },\n dateInput: {\n clear: 'Clear date',\n openPicker: 'Open calendar',\n pickerLabel: 'Choose a date',\n },\n timePicker: {\n label: 'Time picker',\n meridiem: 'AM or PM',\n am: 'AM',\n pm: 'PM',\n selectHour: 'Select hour',\n selectMinutes: 'Select minutes',\n choosingHour: 'Selecting the hour',\n choosingMinutes: 'Selecting the minutes',\n hour: 'Hour',\n minutes: 'Minutes',\n hourValue: (hour) => `${hour} o'clock`,\n minutesValue: (minute) => `${minute} minutes`,\n },\n timeInput: {\n clear: 'Clear time',\n openPicker: 'Open time picker',\n pickerLabel: 'Choose a time',\n meridiemValue: (value) => `AM or PM: ${value}`,\n maskPlaceholder: 'hh:mm',\n unavailable: 'This time is not available.',\n },\n fileInput: {\n openPicker: 'Choose files',\n clear: 'Clear files',\n files: (count) => `${count} file${count === 1 ? '' : 's'}`,\n placeholder: 'No file selected',\n },\n filePicker: {\n browse: 'Browse files',\n or: 'or',\n list: 'Selected files',\n },\n carousel: {\n label: 'Carousel',\n roleDescription: 'carousel',\n slideRoleDescription: 'slide',\n slides: 'Slides',\n slide: (index, total) => `${index} of ${total}`,\n previous: 'Previous slide',\n next: 'Next slide',\n indicators: 'Choose slide to display',\n },\n calendar: {\n label: 'Calendar',\n roleDescription: 'calendar',\n today: 'Today',\n view: 'View',\n viewDay: 'Day',\n view4Days: '4 days',\n viewWeek: 'Week',\n viewMonth: 'Month',\n viewYear: 'Year',\n viewCustom: (days) => `${days} days`,\n previousDay: 'Previous day',\n nextDay: 'Next day',\n previousWeek: 'Previous week',\n nextWeek: 'Next week',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n previousPeriod: 'Previous period',\n nextPeriod: 'Next period',\n allDay: 'All day',\n moreEvents: (count) => `+${count} more`,\n openDay: (day) => `Open ${day}`,\n untitled: '(No title)',\n eventRoleDescription: 'event',\n eventHint:\n 'Press Enter to open this event. Press Space to take hold of it, then the arrow keys to move it and Shift with the arrow keys to change when it ends.',\n grabbed:\n 'Event held. Use the arrow keys to move it, Enter or Space to place it, Escape to cancel.',\n dropped: 'Event placed.',\n reverted: 'Move cancelled. The event is back where it was.',\n movedTo: (title, when) => `${title} moved to ${when}.`,\n },\n}\n"],"mappings":";AAWA,IAAa,IAAe;CAC1B,QAAQ;EACN,SAAS;EACT,OAA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