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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDatePicker.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VDatePicker/VDatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, useId, watch } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { arrow_drop_down as arrowDropDownIcon } from '../VIcon/icons/arrow_drop_down'\nimport { arrow_drop_up as arrowDropUpIcon } from '../VIcon/icons/arrow_drop_up'\nimport { chevron_left as chevronLeftIcon } from '../VIcon/icons/chevron_left'\nimport { chevron_right as chevronRightIcon } from '../VIcon/icons/chevron_right'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport {\n addDays,\n addMonths,\n buildMonthGrid,\n clampISO,\n compareISO,\n daysInMonth,\n firstDayOfWeekFor,\n formatISO,\n isoOf,\n isSameISO,\n isValidISO,\n isWithin,\n monthName,\n monthNamesCompact,\n parseISO,\n weekdayNames,\n} from '../../utils/date'\n\nimport { PICKER_COLUMNS, dayStep, gridDelta } from './keyboard'\n\nimport { toggleValue } from '../../utils/array'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { clamp } from '../../utils/number'\nimport { useLocale, useMessages } from '../../i18n/state'\n\n// @a11y @keyboard @core\n/**\n * A calendar shown directly in the page, as a grid of days, with a month view and a\n * year view behind it. It holds ALL the date, view and keyboard logic of the design\n * system; VDateInput does no more than dress it in a text field and a popover.\n *\n * The platform offers no accessible date grid to build on — `<input type=\"date\">`\n * can be neither styled nor composed — so the JavaScript here implements the ARIA\n * \"grid\" pattern by hand: a single cell in the tab order at a time, arrow and\n * page keys to move between dates, and selection of one date, a range or a list.\n * None of that can be expressed in HTML and CSS alone.\n *\n * Every date is handled in local time as an ISO `YYYY-MM-DD` string (see\n * `utils/date`), which is what keeps the server and the browser in agreement.\n */\nexport type DatePickerSelection = 'single' | 'range' | 'multiple'\n\n/**\n * A period between two dates, the value of a `range` selection. Either bound may be\n * null: between the first and the second click, a range has a start and no end yet.\n */\nexport interface DateRange {\n /** The first day of the period, as an ISO `YYYY-MM-DD` string. */\n start: string | null\n /** The last day of the period, as an ISO `YYYY-MM-DD` string. */\n end: string | null\n}\n\n/** Something happening on a given day, shown as a coloured dot under its number. */\nexport interface DatePickerEvent {\n /** The day it falls on, as an ISO `YYYY-MM-DD` string. */\n date: string\n /** The colour of the dot, as any CSS colour. It is the accent colour by default. */\n color?: string\n /** A description of the event for assistive technology. */\n label?: string\n}\n\n/**\n * Which dates cannot be selected, given either as a list of ISO strings or as a\n * function answering that question for a date.\n */\nexport type DateMatcher = string[] | ((iso: string) => boolean)\n\n/** The shape of the v-model, which follows whichever `selection` is in use. */\nexport type DatePickerValue = string | null | DateRange | string[]\n\ninterface DatePickerProps {\n /**\n * What the reader is picking: a single date, a period between two dates, or any\n * number of separate dates. It determines the shape of the v-model.\n */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names and the first day of the\n * week. It TAKES PRECEDENCE over the design system's global locale (`setLocale`)\n * and falls back to it — which is why it has no literal default here: `undefined`\n * has to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /**\n * Forces the day the weeks start on (0 for Sunday through 6 for Saturday). Left\n * out, the locale decides.\n */\n firstDayOfWeek?: number\n /**\n * The earliest selectable date, as an ISO string. Neither navigation nor selection\n * goes back beyond it.\n */\n min?: string\n /**\n * The latest selectable date, as an ISO string. Neither navigation nor selection\n * goes past it.\n */\n max?: string\n /**\n * Dates that cannot be chosen, given as a list of ISO strings or as a function.\n * They stay visible, struck through, and can still be reached with the keyboard.\n */\n disabledDates?: DateMatcher\n /**\n * Also fills the empty corners of the grid with the greyed days of the neighbouring\n * months. It is off by default.\n */\n showAdjacentDays?: boolean\n /**\n * Lets those neighbouring days be clicked, which moves the calendar to their month.\n * A clickable day has to be visible, so this implies showing them.\n */\n selectAdjacentDays?: boolean\n /** The events to mark, as up to three coloured dots under the day they fall on. */\n events?: DatePickerEvent[]\n}\n\nconst props = withDefaults(defineProps<DatePickerProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n})\n\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /**\n * Emitted every time a date is chosen, carrying the complete value as it now\n * stands. VDateInput listens to it to close its panel on a single selection.\n */\n select: [value: DatePickerValue]\n}>()\n\ndefineSlots<{\n /**\n * Replaces the content of a day cell — to show a price or an availability under the\n * number, for instance. It receives everything known about that day, including\n * whether it belongs to the displayed month.\n */\n day?(props: {\n iso: string\n day: number\n inMonth: boolean\n disabled: boolean\n selected: boolean\n today: boolean\n inRange: boolean\n events: DatePickerEvent[]\n }): unknown\n /** The strip under the grid, for actions such as Close or Save, or for preset dates. */\n footer?(): unknown\n}>()\n\nconst gridLabelId = useId()\n\n// The navigation labels have no prop of their own: the dictionary is the single\n// place to change them, globally or per language — see `src/i18n/`.\nconst m = useMessages()\nconst vectisLocale = useLocale()\n/*\n * The prop 'locale' wins, and the design system's global locale is what it falls back to.\n * Every read below goes through this one derivation, so the two sources can never be consulted\n * in a different order somewhere else.\n */\nconst resolvedLocale = computed(() => props.locale ?? vectisLocale.value)\n\nconst resolvedFirstDay = computed(\n () => props.firstDayOfWeek ?? firstDayOfWeekFor(resolvedLocale.value),\n)\nconst weekdays = computed(() => weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'short'))\nconst weekdaysLong = computed(() =>\n weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'long'),\n)\nconst monthLabels = computed(() => monthNamesCompact(resolvedLocale.value))\n\nconst singleValue = computed(() =>\n props.selection === 'single' && typeof model.value === 'string' && isValidISO(model.value)\n ? model.value\n : null,\n)\nconst rangeValue = computed<DateRange>(() => {\n if (\n props.selection === 'range' &&\n model.value &&\n typeof model.value === 'object' &&\n !Array.isArray(model.value)\n ) {\n return model.value as DateRange\n }\n return { start: null, end: null }\n})\nconst multipleValues = computed<string[]>(() =>\n props.selection === 'multiple' && Array.isArray(model.value) ? model.value : [],\n)\n\n// `focusedISO` is the single source of truth for the view: the month on display is\n// derived from it, never stored separately, so the two cannot drift apart.\nfunction initialFocus(): string {\n if (singleValue.value) return singleValue.value\n if (rangeValue.value.start) return rangeValue.value.start\n if (multipleValues.value[0]) return multipleValues.value[0]\n // With nothing selected, the calendar opens on today, brought back inside the\n // allowed bounds.\n return clampISO(formatISO(new Date()), props.min, props.max)\n}\nconst focusedISO = ref(initialFocus())\nconst view = ref<'days' | 'months' | 'years'>('days')\n\nconst viewYear = computed(\n () => parseISO(focusedISO.value)?.getFullYear() ?? new Date().getFullYear(),\n)\nconst viewMonth0 = computed(() => parseISO(focusedISO.value)?.getMonth() ?? 0)\nconst monthLabel = computed(() => monthName(resolvedLocale.value, viewMonth0.value, 'long'))\nconst gridLabel = computed(() => `${monthLabel.value} ${viewYear.value}`)\n\n// @ssr\n// Today's date is only read once the component is mounted, hence on the client: the\n// server has no way to know it, and rendering it during setup would make the two\n// markups differ and break hydration.\nconst today = ref<string | null>(null)\nonMounted(() => {\n today.value = formatISO(new Date())\n})\n\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\nconst eventsByDate = computed(() => {\n const map = new Map<string, DatePickerEvent[]>()\n for (const ev of props.events ?? []) {\n const list = map.get(ev.date) ?? []\n list.push(ev)\n map.set(ev.date, list)\n }\n return map\n})\n\nconst hoverISO = ref<string | null>(null)\nfunction orderRange(a: string, b: string): DateRange {\n return compareISO(a, b) <= 0 ? { start: a, end: b } : { start: b, end: a }\n}\nconst effectiveRange = computed<DateRange>(() => {\n if (props.selection !== 'range') return { start: null, end: null }\n const r = rangeValue.value\n if (r.start && r.end) return orderRange(r.start, r.end)\n // A start is set but the end is still pending: the range is previewed up to\n // whichever day the pointer or the focus is currently on.\n const preview = hoverISO.value ?? focusedISO.value\n if (r.start && preview) return orderRange(r.start, preview)\n return { start: r.start, end: r.end }\n})\n\nfunction isSelected(iso: string): boolean {\n if (props.selection === 'single') return isSameISO(iso, singleValue.value)\n if (props.selection === 'multiple') return multipleValues.value.includes(iso)\n // In range selection, the two ends of the period count as selected — including the\n // provisional end shown during the preview.\n return isSameISO(iso, effectiveRange.value.start) || isSameISO(iso, effectiveRange.value.end)\n}\nfunction isInRange(iso: string): boolean {\n const { start, end } = effectiveRange.value\n return !!start && !!end && compareISO(iso, start) >= 0 && compareISO(iso, end) <= 0\n}\n\ntype DayCell = {\n iso: string\n day: number\n kind: 'empty' | 'static' | 'button'\n inMonth: boolean\n disabled: boolean\n selected: boolean\n rangeStart: boolean\n rangeEnd: boolean\n inRange: boolean\n today: boolean\n events: DatePickerEvent[]\n}\n\nconst days = computed<DayCell[]>(() =>\n buildMonthGrid(viewYear.value, viewMonth0.value, resolvedFirstDay.value).map((cell) => {\n const inMonth = cell.adjacent === null\n // Making the neighbouring days clickable implies showing them: a day nobody can\n // see cannot be clicked.\n const show = inMonth || props.showAdjacentDays || props.selectAdjacentDays\n const selectable = inMonth || props.selectAdjacentDays\n const disabled = !isWithin(cell.iso, props.min, props.max) || isDisabledDate.value(cell.iso)\n const kind: DayCell['kind'] = !show ? 'empty' : selectable ? 'button' : 'static'\n return {\n iso: cell.iso,\n day: parseISO(cell.iso)?.getDate() ?? 0,\n kind,\n inMonth,\n disabled,\n selected: kind === 'button' && !disabled && isSelected(cell.iso),\n rangeStart: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.start),\n rangeEnd: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.end),\n inRange: props.selection === 'range' && isInRange(cell.iso),\n today: isSameISO(cell.iso, today.value),\n events: eventsByDate.value.get(cell.iso) ?? [],\n }\n }),\n)\nconst weeks = computed(() => {\n const rows: DayCell[][] = []\n for (let i = 0; i < days.value.length; i += 7) rows.push(days.value.slice(i, i + 7))\n return rows\n})\n\nfunction monthHasSelectable(year: number, month0: number): boolean {\n const first = isoOf(year, month0, 1)\n const last = isoOf(year, month0, daysInMonth(year, month0))\n return (\n (!props.max || compareISO(first, props.max) <= 0) &&\n (!props.min || compareISO(last, props.min) >= 0)\n )\n}\nconst canPrevMonth = computed(() => {\n const prev = addMonths(focusedISO.value, -1)\n const d = parseISO(prev)!\n return monthHasSelectable(d.getFullYear(), d.getMonth())\n})\nconst canNextMonth = computed(() => {\n const next = addMonths(focusedISO.value, 1)\n const d = parseISO(next)!\n return monthHasSelectable(d.getFullYear(), d.getMonth())\n})\nconst canPrevYear = computed(\n () => !props.min || compareISO(isoOf(viewYear.value - 1, 11, 31), props.min) >= 0,\n)\nconst canNextYear = computed(\n () => !props.max || compareISO(isoOf(viewYear.value + 1, 0, 1), props.max) <= 0,\n)\n\n// @a11y\n// Moves the real DOM focus onto a day cell. The grid keeps exactly one cell in the\n// tab order, so navigating means focusing another one.\nconst dayId = (iso: string) => `${gridLabelId}-d-${iso}`\nfunction focusDay(iso: string) {\n nextTick(() => document.getElementById(dayId(iso))?.focus())\n}\n\nfunction goTo(iso: string, moveFocus = false) {\n focusedISO.value = clampISO(iso, props.min, props.max)\n if (moveFocus && view.value === 'days') focusDay(focusedISO.value)\n}\nfunction stepMonth(delta: number) {\n goTo(addMonths(focusedISO.value, delta))\n}\nfunction stepYear(delta: number) {\n goTo(addMonths(focusedISO.value, delta * 12))\n}\n\n// @a11y @core — changing view has to carry the focus onto the cell the new view\n// opens on. Without that move the focus would stay on a button the view has just\n// removed from the document, and the keyboard would have nowhere to go.\nfunction toggleView(target: 'months' | 'years') {\n const next = view.value === target ? 'days' : target\n view.value = next\n if (next === 'months') {\n focusedMonth.value = viewMonth0.value\n nextTick(() => monthCellEl(viewMonth0.value)?.focus())\n } else if (next === 'years') {\n focusedYear.value = viewYear.value\n nextTick(() => {\n const cell = yearCellEl(viewYear.value)\n // Called optionally because jsdom does not implement scrollIntoView (the same\n // guard as VTimeInput's list). Centring the year is a nicety; the focus call\n // below is not, so it must not be taken down with it.\n cell?.scrollIntoView?.({ block: 'center' })\n cell?.focus()\n })\n } else if (view.value === 'days') {\n focusDay(focusedISO.value)\n }\n}\n\nfunction selectDay(cell: DayCell) {\n if (cell.kind !== 'button' || cell.disabled) return\n focusedISO.value = cell.iso\n if (props.selection === 'single') {\n model.value = cell.iso\n } else if (props.selection === 'multiple') {\n model.value = toggleValue(multipleValues.value, cell.iso).sort(compareISO)\n } else {\n // Range selection reads three clicks: the first sets the start, the second the\n // end (reordered if it comes before the start), and the third starts a new\n // period.\n const r = rangeValue.value\n if (!r.start || (r.start && r.end)) {\n model.value = { start: cell.iso, end: null }\n } else {\n model.value = orderRange(r.start, cell.iso)\n }\n }\n emit('select', model.value)\n}\n\n// @keyboard @a11y\n// The keyboard of the days view. The table turning a key into a step is pure and\n// lives in `./keyboard`; what stays here is the date that step is applied to, and\n// the focus move that follows.\nfunction onDaysKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n const cell = days.value.find((c) => c.iso === focusedISO.value)\n if (cell) selectDay(cell)\n return\n }\n const d = parseISO(focusedISO.value)!\n // How far the focused day sits from the start of its week, which is exactly what\n // Home and End have to step back and forward by.\n const offset = (d.getDay() - resolvedFirstDay.value + 7) % 7\n const step = dayStep(event.key, event.shiftKey, offset)\n if (!step) return\n event.preventDefault()\n goTo(\n 'days' in step\n ? addDays(focusedISO.value, step.days)\n : addMonths(focusedISO.value, step.months),\n true,\n )\n}\n\n// The months view, opened from the month button in the header.\nconst focusedMonth = ref(viewMonth0.value)\nconst monthCellEl = (i: number) =>\n document.getElementById(`${gridLabelId}-m-${i}`) as HTMLElement | null\nfunction monthSelectable(i: number) {\n return monthHasSelectable(viewYear.value, i)\n}\nfunction chooseMonth(i: number) {\n if (!monthSelectable(i)) return\n const day = Math.min(parseISO(focusedISO.value)!.getDate(), daysInMonth(viewYear.value, i))\n goTo(isoOf(viewYear.value, i, day))\n view.value = 'days'\n focusDay(focusedISO.value)\n}\n// @keyboard @a11y\nfunction onMonthsKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n chooseMonth(focusedMonth.value)\n return\n }\n const delta = gridDelta(event.key)\n if (delta === undefined) return\n event.preventDefault()\n focusedMonth.value = clamp(focusedMonth.value + delta, 0, 11)\n monthCellEl(focusedMonth.value)?.focus()\n}\n\n// @a11y\n/*\n * Both pickers are a `role=\"grid\"`, and a grid owns ROWS, not cells: a gridcell\n * placed straight under the grid fails aria-required-children and\n * aria-required-parent at the same time. The cells are therefore cut into rows of\n * PICKER_COLUMNS, matching the `grid-template-columns` of the stylesheet — the row\n * element itself is `display: contents`, so the CSS grid never sees it.\n *\n * Keyboard navigation is unaffected by this extra level: it moves by index and\n * refocuses cells through their ids, never by walking the DOM.\n */\nconst chunk = <T,>(list: T[]) =>\n Array.from({ length: Math.ceil(list.length / PICKER_COLUMNS) }, (_, r) =>\n list.slice(r * PICKER_COLUMNS, r * PICKER_COLUMNS + PICKER_COLUMNS),\n )\n\nconst monthRows = computed(() => chunk(monthLabels.value.map((name, i) => ({ name, i }))))\n\n// The years view, opened from the year button in the header.\nconst yearRange = computed(() => {\n /*\n * `min` and `max` come straight from the consumer, and this is the ONLY place\n * where they are turned into a Date instead of being compared as ISO text —\n * `compareISO`, `isWithin` and `clampISO` all tolerate a malformed bound. A value\n * that is not a valid ISO date therefore has to fall back to the open range here:\n * asserting the parse would throw and take the whole render down the moment the\n * years view is opened.\n */\n const minY = parseISO(props.min)?.getFullYear() ?? viewYear.value - 100\n const maxY = parseISO(props.max)?.getFullYear() ?? viewYear.value + 100\n const list: number[] = []\n for (let y = minY; y <= maxY; y++) list.push(y)\n return list\n})\nconst yearRows = computed(() => chunk(yearRange.value))\nconst focusedYear = ref(viewYear.value)\nconst yearCellEl = (y: number) =>\n document.getElementById(`${gridLabelId}-y-${y}`) as HTMLElement | null\nfunction chooseYear(y: number) {\n const month = viewMonth0.value\n const day = Math.min(parseISO(focusedISO.value)!.getDate(), daysInMonth(y, month))\n goTo(isoOf(y, month, day))\n view.value = 'days'\n focusDay(focusedISO.value)\n}\n// @keyboard @a11y\nfunction onYearsKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n chooseYear(focusedYear.value)\n return\n }\n const delta = gridDelta(event.key)\n if (delta === undefined) return\n event.preventDefault()\n const list = yearRange.value\n const idx = list.indexOf(focusedYear.value)\n const nextIdx = clamp(idx + delta, 0, list.length - 1)\n focusedYear.value = list[nextIdx] ?? focusedYear.value\n yearCellEl(focusedYear.value)?.focus()\n}\n\n// Follows a selection changed from the outside: when the leading value lands in\n// another month, the calendar moves to it rather than leaving the reader in front of\n// a grid where nothing is selected.\nwatch(\n () => [singleValue.value, rangeValue.value.start, multipleValues.value[0]],\n () => {\n const primary = singleValue.value ?? rangeValue.value.start ?? multipleValues.value[0]\n if (primary && isValidISO(primary)) {\n const d = parseISO(primary)!\n if (d.getFullYear() !== viewYear.value || d.getMonth() !== viewMonth0.value) {\n focusedISO.value = primary\n }\n }\n },\n)\n\n// @a11y\n/**\n * Brings the focus into the grid, on the day the calendar is currently showing. This\n * is what VDateInput calls when it opens its panel.\n */\nfunction focus() {\n view.value = 'days'\n focusDay(focusedISO.value)\n}\ndefineExpose({ focus })\n</script>\n\n<template>\n <div\n class=\"v-date-picker\"\n :data-view=\"view\"\n :data-selection=\"selection\"\n @pointerleave=\"hoverISO = null\"\n >\n <!-- The header: the month and the year, each between two chevrons that step it,\n and each opening its own picker view when clicked -->\n <div class=\"v-date-picker-header\">\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :icon=\"chevronLeftIcon\"\n :label=\"m.datePicker.previousMonth\"\n size=\"sm\"\n :disabled=\"!canPrevMonth\"\n @click=\"stepMonth(-1)\"\n />\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :aria-expanded=\"view === 'months'\"\n :aria-label=\"monthLabel\"\n @click=\"toggleView('months')\"\n >\n {{ monthLabels[viewMonth0] }}\n <VIcon\n :name=\"view === 'months' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :icon=\"chevronRightIcon\"\n :label=\"m.datePicker.nextMonth\"\n size=\"sm\"\n :disabled=\"!canNextMonth\"\n @click=\"stepMonth(1)\"\n />\n </div>\n\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :icon=\"chevronLeftIcon\"\n :label=\"m.datePicker.previousYear\"\n size=\"sm\"\n :disabled=\"!canPrevYear\"\n @click=\"stepYear(-1)\"\n />\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :aria-expanded=\"view === 'years'\"\n @click=\"toggleView('years')\"\n >\n {{ viewYear }}\n <VIcon\n :name=\"view === 'years' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :icon=\"chevronRightIcon\"\n :label=\"m.datePicker.nextYear\"\n size=\"sm\"\n :disabled=\"!canNextYear\"\n @click=\"stepYear(1)\"\n />\n </div>\n </div>\n\n <!-- Days view -->\n <div\n v-show=\"view === 'days'\"\n class=\"v-date-picker-grid\"\n role=\"grid\"\n :aria-label=\"gridLabel\"\n :aria-multiselectable=\"selection === 'multiple' ? 'true' : undefined\"\n @keydown=\"onDaysKeydown\"\n >\n <div class=\"v-date-picker-weekdays\" role=\"row\">\n <span\n v-for=\"(w, i) in weekdays\"\n :key=\"w\"\n class=\"v-date-picker-weekday\"\n role=\"columnheader\"\n :aria-label=\"weekdaysLong[i]\"\n >{{ w }}</span\n >\n </div>\n <div v-for=\"(week, wi) in weeks\" :key=\"wi\" class=\"v-date-picker-week\" role=\"row\">\n <div\n v-for=\"cell in week\"\n :key=\"cell.iso\"\n class=\"v-date-picker-cell\"\n role=\"gridcell\"\n :aria-selected=\"cell.kind === 'button' ? cell.selected : undefined\"\n :data-in-range=\"cell.inRange ? '' : undefined\"\n :data-range-start=\"cell.rangeStart ? '' : undefined\"\n :data-range-end=\"cell.rangeEnd ? '' : undefined\"\n >\n <button\n v-if=\"cell.kind === 'button'\"\n :id=\"dayId(cell.iso)\"\n type=\"button\"\n class=\"v-date-picker-day\"\n :tabindex=\"cell.iso === focusedISO ? 0 : -1\"\n :data-outside=\"!cell.inMonth ? '' : undefined\"\n :data-selected=\"cell.selected ? '' : undefined\"\n :data-today=\"cell.today ? '' : undefined\"\n :aria-disabled=\"cell.disabled ? 'true' : undefined\"\n :aria-current=\"cell.today ? 'date' : undefined\"\n @click=\"selectDay(cell)\"\n @pointerenter=\"hoverISO = cell.iso\"\n @focus=\"hoverISO = cell.iso\"\n >\n <slot\n name=\"day\"\n :iso=\"cell.iso\"\n :day=\"cell.day\"\n :in-month=\"cell.inMonth\"\n :disabled=\"cell.disabled\"\n :selected=\"cell.selected\"\n :today=\"cell.today\"\n :in-range=\"cell.inRange\"\n :events=\"cell.events\"\n >\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n <span v-if=\"cell.events.length\" class=\"v-date-picker-dots\" aria-hidden=\"true\">\n <span\n v-for=\"(ev, ei) in cell.events.slice(0, 3)\"\n :key=\"ei\"\n class=\"v-date-picker-dot\"\n :style=\"ev.color ? { '--date-picker-dot-color': ev.color } : undefined\"\n />\n </span>\n </button>\n <!-- A day of a neighbouring month that cannot be selected. It renders the\n very same slot as the clickable days: were it left with the bare\n number, custom content taking several lines would apply to this month's\n days only, and the numbers would stop lining up from one cell to the\n next. The slot receives `inMonth`, which is how it can still tell the\n two apart. -->\n <span\n v-else-if=\"cell.kind === 'static'\"\n class=\"v-date-picker-day v-date-picker-day--static\"\n :data-disabled=\"cell.disabled ? '' : undefined\"\n >\n <slot\n name=\"day\"\n :iso=\"cell.iso\"\n :day=\"cell.day\"\n :in-month=\"cell.inMonth\"\n :disabled=\"cell.disabled\"\n :selected=\"cell.selected\"\n :today=\"cell.today\"\n :in-range=\"cell.inRange\"\n :events=\"cell.events\"\n >\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Months view -->\n <div\n v-if=\"view === 'months'\"\n class=\"v-date-picker-view\"\n role=\"grid\"\n :aria-label=\"m.datePicker.monthPicker\"\n @keydown=\"onMonthsKeydown\"\n >\n <div v-for=\"(row, r) in monthRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"{ name, i } in row\"\n :id=\"`${gridLabelId}-m-${i}`\"\n :key=\"name\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"i === focusedMonth ? 0 : -1\"\n :data-selected=\"i === viewMonth0 ? '' : undefined\"\n :aria-selected=\"i === viewMonth0 ? 'true' : undefined\"\n :disabled=\"!monthSelectable(i)\"\n @click=\"chooseMonth(i)\"\n >\n {{ name }}\n </button>\n </div>\n </div>\n\n <!-- Years view -->\n <div\n v-if=\"view === 'years'\"\n class=\"v-date-picker-view v-date-picker-view--years\"\n role=\"grid\"\n :aria-label=\"m.datePicker.yearPicker\"\n @keydown=\"onYearsKeydown\"\n >\n <div v-for=\"(row, r) in yearRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"y in row\"\n :id=\"`${gridLabelId}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"y === focusedYear ? 0 : -1\"\n :data-selected=\"y === viewYear ? '' : undefined\"\n :aria-selected=\"y === viewYear ? 'true' : undefined\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"v-date-picker-footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-picker {\n /* The consumer sets the size of the day disc; the cell around it — the hover area\n and the width of the column — grows to follow, and never falls below the size\n the token sets. */\n --date-picker-day-size: var(--vectis-date-picker-day-size, var(--vectis-control-height-md));\n --date-picker-cell: max(\n var(--vectis-control-size-date-picker-cell),\n calc(var(--date-picker-day-size) + var(--vectis-space-1))\n );\n display: inline-flex;\n flex-direction: column;\n gap: var(--vectis-space-2);\n padding: var(--vectis-space-3);\n font-family: var(--vectis-text-family);\n color: var(--vectis-color-text);\n }\n\n /* The calendar is a flex column, so every block stretches to its full width by\n default. The days grid then fills that width through its 1fr columns, and never\n goes below the seven cells its own floor guarantees. */\n .v-date-picker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--vectis-space-2);\n }\n\n .v-date-picker-nav {\n display: flex;\n align-items: center;\n }\n\n /* A minimum width holds this button steady, so the chevrons on either side do not\n shift as the month or year label changes length. */\n .v-date-picker-view-toggle {\n min-inline-size: var(--vectis-control-size-date-picker-nav-min);\n /* The semibold is state emphasis on the grid's main landmark, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n text-transform: capitalize;\n }\n\n /* The days grid can never be narrower than seven cells. Above that floor it takes\n whatever width the calendar has — set by the header — and the 1fr columns share\n it out equally. */\n .v-date-picker-grid {\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n\n .v-date-picker-weekdays,\n .v-date-picker-week {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n }\n\n .v-date-picker-weekday {\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--vectis-control-height-sm);\n /* A column micro-header, which takes the overline type role. The casing stays\n `capitalize`, the calendar convention, rather than the full capitals the\n VTypography overline variant would apply. */\n font-size: var(--vectis-text-overline-size);\n font-weight: var(--vectis-text-overline-weight);\n letter-spacing: var(--vectis-text-overline-tracking);\n color: var(--vectis-color-text-muted);\n text-transform: capitalize;\n }\n\n .v-date-picker-cell {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--date-picker-cell);\n }\n\n /* The band joining the days of a selected range: a tinted background laid behind\n the day, at the HEIGHT of the disc rather than of the whole cell. Its vertical\n inset is half the gap between cell and disc, expressed in `%` so it follows the\n real width of a 1fr column whatever the calendar measures.\n\n At either end the band stops exactly at the edge of the disc — hence the inset on\n the outer side — and that corner is rounded with the pill radius, which a box\n this height caps at half its height, i.e. precisely the disc's own radius, so it\n cannot overshoot. */\n .v-date-picker-cell[data-in-range]::before {\n content: '';\n position: absolute;\n inset-block: calc((100% - var(--date-picker-day-size)) / 2);\n inset-inline: 0;\n background: var(--vectis-color-accent-surface);\n z-index: 0;\n }\n .v-date-picker-cell[data-range-start]::before {\n inset-inline-start: calc((100% - var(--date-picker-day-size)) / 2);\n border-start-start-radius: var(--vectis-radius-pill);\n border-end-start-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-end]::before {\n inset-inline-end: calc((100% - var(--date-picker-day-size)) / 2);\n border-start-end-radius: var(--vectis-radius-pill);\n border-end-end-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-start][data-range-end]::before {\n content: none;\n }\n\n .v-date-picker-day {\n position: relative;\n z-index: 1;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: var(--date-picker-day-size);\n block-size: var(--date-picker-day-size);\n padding: 0;\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n cursor: pointer;\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /* Hover belongs to the days one can actually click: not the disabled ones, not the\n already selected ones, and not the neighbouring days rendered as plain spans. */\n .v-date-picker-day:hover:not([aria-disabled='true']):not([data-selected]):not(\n .v-date-picker-day--static\n ) {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-date-picker-day[data-outside] {\n color: var(--vectis-color-text-subtle);\n }\n\n /* The semibold in the two rules below marks a state — today, and the selection —\n and is not a typographic role, which is why it reads a font token directly. */\n .v-date-picker-day[data-today]:not([data-selected]) {\n box-shadow: inset 0 0 0 1px var(--vectis-color-accent-border);\n color: var(--vectis-color-accent-text);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-date-picker-day[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-date-picker-day[aria-disabled='true'] {\n color: var(--vectis-color-text-subtle);\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker-day--static {\n color: var(--vectis-color-text-subtle);\n cursor: default;\n }\n\n /* A neighbouring day that falls outside the bounds, or is disabled, is struck\n through like any other unavailable date. */\n .v-date-picker-day--static[data-disabled] {\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker-day:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-date-picker-day-num {\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-date-picker-dots {\n position: absolute;\n inset-block-end: calc(var(--vectis-space-1) * 0.5);\n display: flex;\n gap: 2px;\n }\n .v-date-picker-dot {\n inline-size: var(--vectis-control-size-date-picker-dot);\n block-size: var(--vectis-control-size-date-picker-dot);\n border-radius: var(--vectis-radius-pill);\n background: var(--date-picker-dot-color, var(--vectis-color-accent));\n }\n .v-date-picker-day[data-selected] .v-date-picker-dot {\n background: var(--vectis-color-text-on-accent);\n }\n\n /* The months and years views. They fill the calendar's width exactly like the days\n grid does: stretched by the flex column, then shared out by 1fr columns. */\n .v-date-picker-view {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--vectis-space-1);\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n /* The rows ARIA requires inside a grid, made invisible to the layout: with\n `display: contents` the cells remain direct grid items of `.v-date-picker-view`,\n so the columns line up as if the rows were not there. */\n .v-date-picker-view-row {\n display: contents;\n }\n\n .v-date-picker-view--years {\n max-block-size: calc(6 * var(--date-picker-cell));\n overflow-y: auto;\n }\n\n .v-date-picker-view-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n block-size: var(--vectis-control-height-lg);\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n text-transform: capitalize;\n cursor: pointer;\n transition: background-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n .v-date-picker-view-cell:hover:not(:disabled):not([data-selected]) {\n background: var(--vectis-color-surface-muted);\n }\n .v-date-picker-view-cell[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n /* Again state emphasis, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n }\n .v-date-picker-view-cell:disabled {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n .v-date-picker-view-cell:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n .v-date-picker-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-2);\n padding-block-start: var(--vectis-space-2);\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-date-picker-day,\n .v-date-picker-view-cell {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkIA,IAAM,IAAQ,GAYR,IAAQ,GAA4B,GAAA,YAAkB,GAEtD,KAAO,IA4BP,IAAc,GAAM,GAIpB,IAAI,EAAY,GAChB,KAAe,EAAU,GAMzB,IAAiB,QAAe,EAAM,UAAU,GAAa,KAAK,GAElE,IAAmB,QACjB,EAAM,kBAAkB,GAAkB,EAAe,KAAK,CACtE,GACM,KAAW,QAAe,GAAa,EAAe,OAAO,EAAiB,OAAO,OAAO,CAAC,GAC7F,KAAe,QACnB,GAAa,EAAe,OAAO,EAAiB,OAAO,MAAM,CACnE,GACM,IAAc,QAAe,GAAkB,EAAe,KAAK,CAAC,GAEpE,IAAc,QAClB,EAAM,cAAc,YAAY,OAAO,EAAM,SAAU,YAAY,GAAW,EAAM,KAAK,IACrF,EAAM,QACN,IACN,GACM,IAAa,QAEf,EAAM,cAAc,WACpB,EAAM,SACN,OAAO,EAAM,SAAU,YACvB,CA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,GAAA,QAAX,GAAK,YAAlB,EAeM,OAAA;IAf6B,KAAK;IAAG,OAAM;IAAyB,MAAK;eAC7E,EAaS,GAAA,MAAA,EAZK,IAAL,YADT,EAaS,UAAA;IAXN,IAAE,GAAK,EAAA,CAAA,EAAW,KAAM;IACxB,KAAK;IACN,MAAK;IACL,OAAM;IACN,MAAK;IACJ,UAAU,MAAM,EAAA,QAAW,IAAA;IAC3B,iBAAe,MAAM,EAAA,QAAQ,KAAQ,KAAA;IACrC,iBAAe,MAAM,EAAA,QAAQ,SAAY,KAAA;IACzC,UAAK,MAAE,GAAW,CAAC;QAEjB,CAAC,GAAA,GAAA,EAAA;GAKCA,EAAAA,OAAO,UAAA,EAAA,GAAlB,EAEM,OAFN,IAEM,CADJ,EAAsB,EAAA,QAAA,QAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"VDatePicker.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VDatePicker/VDatePicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @keyboard @core\n/**\n * A calendar shown directly in the page, as a grid of days, with a month view and a\n * year view behind it. It holds ALL the date, view and keyboard logic of the design\n * system; VDateInput does no more than dress it in a text field and a popover.\n *\n * The platform offers no accessible date grid to build on — `<input type=\"date\">`\n * can be neither styled nor composed — so the JavaScript here implements the ARIA\n * \"grid\" pattern by hand: a single cell in the tab order at a time, arrow and\n * page keys to move between dates, and selection of one date, a range or a list.\n * None of that can be expressed in HTML and CSS alone.\n *\n * Every date is handled in local time as an ISO `YYYY-MM-DD` string (see\n * `utils/date`), which is what keeps the server and the browser in agreement.\n */\n\nimport { computed, inject, nextTick, onMounted, ref, useId, watch, watchEffect } from 'vue'\nimport type { Ref } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { arrow_drop_down as arrowDropDownIcon } from '../VIcon/icons/arrow_drop_down'\nimport { arrow_drop_up as arrowDropUpIcon } from '../VIcon/icons/arrow_drop_up'\nimport { chevron_left as chevronLeftIcon } from '../VIcon/icons/chevron_left'\nimport { chevron_right as chevronRightIcon } from '../VIcon/icons/chevron_right'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport {\n addDays,\n addMonths,\n buildMonthGrid,\n clampISO,\n compareISO,\n daysInMonth,\n firstDayOfWeekFor,\n formatISO,\n isDateAllowed,\n isoOf,\n isSameISO,\n isValidISO,\n monthName,\n monthNamesCompact,\n parseISO,\n weekdayNames,\n} from '../../utils/date'\n\nimport { PICKER_COLUMNS, dayStep, gridDelta } from './keyboard'\n\nimport { toggleValue } from '../../utils/array'\nimport { isDev } from '../../utils/env'\nimport { hostWarnsKey } from '../../utils/hostWarns'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { clamp } from '../../utils/number'\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useMessages, useResolvedLocale } from '../../i18n/state'\n\nexport type DatePickerSelection = 'single' | 'range' | 'multiple'\n\n/**\n * A period between two dates, the value of a `range` selection. Either bound may be\n * null: between the first and the second click, a range has a start and no end yet.\n */\nexport interface DatePickerRange {\n /** The first day of the period, as an ISO `YYYY-MM-DD` string. */\n start: string | null\n /** The last day of the period, as an ISO `YYYY-MM-DD` string. */\n end: string | null\n}\n\n/** Something happening on a given day, shown as a coloured dot under its number. */\nexport interface DatePickerEvent {\n /** The day it falls on, as an ISO `YYYY-MM-DD` string. */\n date: string\n /** The colour of the dot, as any CSS colour. It is the accent colour by default. */\n color?: string\n /** A description of the event for assistive technology. */\n label?: string\n}\n\n/**\n * Which dates cannot be selected, given either as a list of ISO strings or as a\n * function answering that question for a date.\n */\nexport type DatePickerMatcher = string[] | ((iso: string) => boolean)\n\n/** The shape of the v-model, which follows whichever `selection` is in use. */\nexport type DatePickerValue = string | null | DatePickerRange | string[]\n\n/** Everything the `#day` slot is told about the day it draws. */\nexport interface DatePickerDaySlotProps {\n /** The day, as an ISO `YYYY-MM-DD` string. */\n iso: string\n /** The day of the month. */\n day: number\n /** Whether it belongs to the month on display rather than to a neighbouring one. */\n inMonth: boolean\n /** Whether it cannot be chosen: outside the bounds, or excluded by `disabledDates`. */\n disabled: boolean\n /** Whether it is selected. */\n selected: boolean\n /** Whether it is today. */\n today: boolean\n /** Whether it falls inside the selected period, both ends included. */\n inRange: boolean\n /** The events that fall on it. */\n events: DatePickerEvent[]\n}\n\ninterface DatePickerProps {\n /**\n * What the reader is picking: a single date, a period between two dates, or any\n * number of separate dates. It determines the shape of the v-model.\n */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names and the first day of the\n * week. It TAKES PRECEDENCE over the design system's global locale (`setLocale`)\n * and falls back to it — which is why it has no literal default here: `undefined`\n * has to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /**\n * Forces the day the weeks start on (0 for Sunday through 6 for Saturday). Left\n * out, the locale decides.\n */\n firstDayOfWeek?: number\n /**\n * The earliest selectable date, as an ISO string. Neither navigation nor selection\n * goes back beyond it.\n */\n min?: string\n /**\n * The latest selectable date, as an ISO string. Neither navigation nor selection\n * goes past it.\n */\n max?: string\n /**\n * Dates that cannot be chosen, given as a list of ISO strings or as a function.\n * They stay visible, struck through, and can still be reached with the keyboard.\n */\n disabledDates?: DatePickerMatcher\n /**\n * Also fills the empty corners of the grid with the greyed days of the neighbouring\n * months. It is off by default.\n */\n showAdjacentDays?: boolean\n /**\n * Lets those neighbouring days be clicked, which moves the calendar to their month.\n * A clickable day has to be visible, so this implies showing them.\n */\n selectAdjacentDays?: boolean\n /** The events to mark, as up to three coloured dots under the day they fall on. */\n events?: DatePickerEvent[]\n /**\n * Makes the whole calendar unusable: no date can be chosen, no month reached, and\n * everything greys out through the colour tokens.\n */\n disabled?: boolean\n /**\n * Shows what is selected without letting it be changed. The calendar can still be\n * read and walked through — another month, another year — which is what separates it\n * from `disabled`.\n */\n readonly?: boolean\n /**\n * The accessible name of the whole picker, its header and its grid together. A range\n * shown as two calendars side by side needs one each, or a screen reader announces the\n * same group twice. It falls back to the dictionary, and a consumer `aria-label` wins.\n */\n label?: string\n}\n\nconst props = withDefaults(defineProps<DatePickerProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n disabled: false,\n readonly: false,\n label: undefined,\n})\n\n/**\n * What is selected, and its SHAPE follows `selection`: an ISO `YYYY-MM-DD` string for\n * `single`, a `{ start, end }` pair for `range`, an array of strings for `multiple`. Nothing\n * is selected to begin with.\n *\n * Every date is a plain local-time string, never a `Date`, so the value a consumer receives\n * cannot shift a day across time zones.\n */\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /**\n * Emitted every time a date is chosen, carrying the complete value as it now\n * stands. VDateInput listens to it to close its panel on a single selection.\n */\n select: [value: DatePickerValue]\n}>()\n\ndefineSlots<{\n /**\n * Replaces the content of a day cell — to show a price or an availability under the\n * number, for instance. It receives everything known about that day, including\n * whether it belongs to the displayed month.\n */\n day?(props: DatePickerDaySlotProps): unknown\n /** The strip under the grid, for actions such as Close or Save, or for preset dates. */\n footer?(): unknown\n}>()\n\nconst gridLabelId = useId()\n\n// The navigation labels have no prop of their own: the dictionary is the single\n// place to change them, globally or per language — see `src/i18n/`.\nconst m = useMessages()\n// @a11y — a roleless box cannot carry an accessible name (axe: aria-prohibited-attr),\n// so the root is a named group: the VCarousel viewport arrangement.\nconst ariaLabel = useAriaLabel(() => props.label ?? m.value.datePicker.label)\nconst resolvedLocale = useResolvedLocale(() => props.locale)\n\n// @devwarn\n// Silent inside a host that forwards these props and reports on them itself (utils/hostWarns).\nif (isDev && !inject(hostWarnsKey, false)) {\n watchEffect(() => {\n if (props.min && props.max && compareISO(props.min, props.max) > 0)\n console.warn(\n `[VDatePicker] min \"${props.min}\" falls after max \"${props.max}\", so no date can be chosen.`,\n )\n })\n}\n\nconst resolvedFirstDay = computed(\n () => props.firstDayOfWeek ?? firstDayOfWeekFor(resolvedLocale.value),\n)\nconst weekdays = computed(() => weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'short'))\nconst weekdaysLong = computed(() =>\n weekdayNames(resolvedLocale.value, resolvedFirstDay.value, 'long'),\n)\nconst monthLabels = computed(() => monthNamesCompact(resolvedLocale.value))\n\nconst singleValue = computed(() =>\n props.selection === 'single' && typeof model.value === 'string' && isValidISO(model.value)\n ? model.value\n : null,\n)\nconst rangeValue = computed<DatePickerRange>(() => {\n if (\n props.selection === 'range' &&\n model.value &&\n typeof model.value === 'object' &&\n !Array.isArray(model.value)\n ) {\n return model.value as DatePickerRange\n }\n return { start: null, end: null }\n})\nconst multipleValues = computed<string[]>(() =>\n props.selection === 'multiple' && Array.isArray(model.value) ? model.value : [],\n)\n\n// `focusedISO` is the single source of truth for the view: the month on display is\n// derived from it, never stored separately, so the two cannot drift apart.\n//\n// TRAP — a range start or a list entry is validated HERE, the way the single value is\n// validated upstream. Those two reach this component exactly as the consumer wrote them,\n// and a malformed one (`{ start: 'foo' }`) made the focused date unparseable: the month\n// arrows assert that parse, so the first render threw.\nfunction initialFocus(): string {\n if (singleValue.value) return singleValue.value\n const start = rangeValue.value.start\n if (start && isValidISO(start)) return start\n const listed = multipleValues.value.find(isValidISO)\n if (listed) return listed\n // With nothing selected, the calendar opens on today, brought back inside the\n // allowed bounds.\n return clampISO(formatISO(new Date()), props.min, props.max)\n}\nconst focusedISO = ref(initialFocus())\nconst view = ref<'days' | 'months' | 'years'>('days')\n\nconst viewYear = computed(\n () => parseISO(focusedISO.value)?.getFullYear() ?? new Date().getFullYear(),\n)\nconst viewMonth0 = computed(() => parseISO(focusedISO.value)?.getMonth() ?? 0)\nconst monthLabel = computed(() => monthName(resolvedLocale.value, viewMonth0.value))\nconst gridLabel = computed(() => `${monthLabel.value} ${viewYear.value}`)\n\n// @ssr\n// Today's date is only read once the component is mounted, hence on the client: the\n// server has no way to know it, and rendering it during setup would make the two\n// markups differ and break hydration.\nconst today = ref<string | null>(null)\nonMounted(() => {\n today.value = formatISO(new Date())\n})\n\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\nconst eventsByDate = computed(() => {\n const map = new Map<string, DatePickerEvent[]>()\n for (const ev of props.events ?? []) {\n const list = map.get(ev.date) ?? []\n list.push(ev)\n map.set(ev.date, list)\n }\n return map\n})\n\nconst hoverISO = ref<string | null>(null)\nfunction orderRange(a: string, b: string): DatePickerRange {\n return compareISO(a, b) <= 0 ? { start: a, end: b } : { start: b, end: a }\n}\nconst effectiveRange = computed<DatePickerRange>(() => {\n if (props.selection !== 'range') return { start: null, end: null }\n const r = rangeValue.value\n if (r.start && r.end) return orderRange(r.start, r.end)\n // A start is set but the end is still pending: the range is previewed up to\n // whichever day the pointer or the focus is currently on.\n const preview = hoverISO.value ?? focusedISO.value\n if (r.start && preview) return orderRange(r.start, preview)\n return { start: r.start, end: r.end }\n})\n\nfunction isSelected(iso: string): boolean {\n if (props.selection === 'single') return isSameISO(iso, singleValue.value)\n if (props.selection === 'multiple') return multipleValues.value.includes(iso)\n // In range selection, the two ends of the period count as selected — including the\n // provisional end shown during the preview.\n return isSameISO(iso, effectiveRange.value.start) || isSameISO(iso, effectiveRange.value.end)\n}\n/**\n * Whether a day falls inside the selected period, BOTH ends included.\n *\n * The inclusiveness is a contract with the stylesheet, not a detail: `[data-in-range]` is\n * what draws the band's pseudo-element, and the two end rules only round a corner of one\n * that already exists. Narrowing this to the days strictly between would leave each end\n * with nothing to cap and silently square off every range.\n */\nfunction isInRange(iso: string): boolean {\n const { start, end } = effectiveRange.value\n return !!start && !!end && compareISO(iso, start) >= 0 && compareISO(iso, end) <= 0\n}\n\ntype DayCell = {\n iso: string\n day: number\n kind: 'empty' | 'static' | 'button'\n inMonth: boolean\n disabled: boolean\n selected: boolean\n rangeStart: boolean\n rangeEnd: boolean\n inRange: boolean\n today: boolean\n events: DatePickerEvent[]\n /** The events drawn as dots under the number, three at most. */\n dots: DatePickerEvent[]\n}\n\n/**\n * The 42 squares of the month on display, rebuilt only when the MONTH changes. The two\n * computeds are split on purpose: a range being previewed changes `hoverISO` on every\n * `pointerenter`, and that has to repaint the decoration below without building 42 dates\n * again. `viewYear` and `viewMonth0` are numbers, so moving the focus inside the month\n * leaves them — and this — untouched.\n */\nconst grid = computed(() =>\n buildMonthGrid(viewYear.value, viewMonth0.value, resolvedFirstDay.value),\n)\n\nconst NO_EVENTS: DatePickerEvent[] = []\n\nconst days = computed<DayCell[]>(() =>\n grid.value.map((cell) => {\n const inMonth = cell.adjacent === null\n // Making the neighbouring days clickable implies showing them: a day nobody can\n // see cannot be clicked.\n const show = inMonth || props.showAdjacentDays || props.selectAdjacentDays\n const selectable = inMonth || props.selectAdjacentDays\n const disabled = !isDateAllowed(cell.iso, props.min, props.max, isDisabledDate.value)\n const kind: DayCell['kind'] = !show ? 'empty' : selectable ? 'button' : 'static'\n const events = eventsByDate.value.get(cell.iso) ?? NO_EVENTS\n return {\n iso: cell.iso,\n day: cell.day,\n kind,\n inMonth,\n disabled,\n selected: kind === 'button' && !disabled && isSelected(cell.iso),\n rangeStart: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.start),\n rangeEnd: props.selection === 'range' && isSameISO(cell.iso, effectiveRange.value.end),\n inRange: props.selection === 'range' && isInRange(cell.iso),\n today: isSameISO(cell.iso, today.value),\n events,\n dots: events.length > 3 ? events.slice(0, 3) : events,\n }\n }),\n)\n\n/** What the `#day` slot receives for a square: the same object for both kinds of cell. */\nfunction daySlotProps(cell: DayCell): DatePickerDaySlotProps {\n return {\n iso: cell.iso,\n day: cell.day,\n inMonth: cell.inMonth,\n disabled: cell.disabled,\n selected: cell.selected,\n today: cell.today,\n inRange: cell.inRange,\n events: cell.events,\n }\n}\nconst weeks = computed(() => {\n const rows: DayCell[][] = []\n for (let i = 0; i < days.value.length; i += 7) rows.push(days.value.slice(i, i + 7))\n return rows\n})\n\nfunction monthHasSelectable(year: number, month0: number): boolean {\n const first = isoOf(year, month0, 1)\n const last = isoOf(year, month0, daysInMonth(year, month0))\n return (\n (!props.max || compareISO(first, props.max) <= 0) &&\n (!props.min || compareISO(last, props.min) >= 0)\n )\n}\n// Derived from the month on display, not from the focused day, so an arrow key moving the\n// focus inside the month does not recompute them.\nconst canPrevMonth = computed(() =>\n viewMonth0.value === 0\n ? monthHasSelectable(viewYear.value - 1, 11)\n : monthHasSelectable(viewYear.value, viewMonth0.value - 1),\n)\nconst canNextMonth = computed(() =>\n viewMonth0.value === 11\n ? monthHasSelectable(viewYear.value + 1, 0)\n : monthHasSelectable(viewYear.value, viewMonth0.value + 1),\n)\nconst canPrevYear = computed(\n () => !props.min || compareISO(isoOf(viewYear.value - 1, 11, 31), props.min) >= 0,\n)\nconst canNextYear = computed(\n () => !props.max || compareISO(isoOf(viewYear.value + 1, 0, 1), props.max) <= 0,\n)\n\n// @a11y\n// Moves the real DOM focus onto a day cell. The grid keeps exactly one cell in the\n// tab order, so navigating means focusing another one.\nconst dayId = (iso: string) => `${gridLabelId}-d-${iso}`\nfunction focusDay(iso: string, options?: FocusOptions) {\n nextTick(() => document.getElementById(dayId(iso))?.focus(options))\n}\n\nfunction goTo(iso: string, moveFocus = false) {\n // Every move through the calendar comes here, so one guard covers the arrows, the\n // month and year cells and the keyboard's own steps. Only `disabled` stops it:\n // `readonly` leaves the reader free to look around.\n if (props.disabled) return\n focusedISO.value = clampISO(iso, props.min, props.max)\n if (moveFocus && view.value === 'days') focusDay(focusedISO.value)\n}\nfunction stepMonth(delta: number) {\n goTo(addMonths(focusedISO.value, delta))\n}\nfunction stepYear(delta: number) {\n goTo(addMonths(focusedISO.value, delta * 12))\n}\n\n// @a11y @core — changing view has to carry the focus onto the cell the new view\n// opens on. Without that move the focus would stay on a button the view has just\n// removed from the document, and the keyboard would have nowhere to go.\nfunction toggleView(target: 'months' | 'years') {\n const next = view.value === target ? 'days' : target\n view.value = next\n if (next === 'months') {\n focusedMonth.value = viewMonth0.value\n nextTick(() => monthCellEl(viewMonth0.value)?.focus())\n } else if (next === 'years') {\n focusedYear.value = viewYear.value\n nextTick(() => {\n const cell = yearCellEl(viewYear.value)\n // Called optionally because jsdom does not implement scrollIntoView (the same\n // guard as VTimeInput's list). Centring the year is a nicety; the focus call\n // below is not, so it must not be taken down with it.\n cell?.scrollIntoView?.({ block: 'center' })\n cell?.focus()\n })\n } else if (view.value === 'days') {\n focusDay(focusedISO.value)\n }\n}\n\nfunction selectDay(cell: DayCell) {\n // The single choke point of the selection, so the two states are refused here rather\n // than in each of the routes that lead to it — a click, Enter and Space all pass\n // through. Navigation is deliberately NOT guarded by `readonly`: a calendar one may\n // read is a calendar one may leaf through.\n if (props.disabled || props.readonly) return\n if (cell.kind !== 'button' || cell.disabled) return\n focusedISO.value = cell.iso\n let next: DatePickerValue\n if (props.selection === 'single') {\n next = cell.iso\n } else if (props.selection === 'multiple') {\n next = toggleValue(multipleValues.value, cell.iso).sort(compareISO)\n } else {\n // Range selection reads three clicks: the first sets the start, the second the\n // end (reordered if it comes before the start), and the third starts a new\n // period.\n const r = rangeValue.value\n next = !r.start || r.end ? { start: cell.iso, end: null } : orderRange(r.start, cell.iso)\n }\n model.value = next\n // TRAP: emit what was just computed, never `model.value` read back. Under a parent\n // `v-model`, `defineModel` does not update its local copy on write — it waits for the\n // parent to re-render — so the read would hand `select` the PREVIOUS value.\n emit('select', next)\n}\n\n// @keyboard @a11y\n// The keyboard of the days view. The table turning a key into a step is pure and\n// lives in `./keyboard`; what stays here is the date that step is applied to, and\n// the focus move that follows.\nfunction onDaysKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n const cell = days.value.find((c) => c.iso === focusedISO.value)\n if (cell) selectDay(cell)\n return\n }\n const d = parseISO(focusedISO.value)!\n // How far the focused day sits from the start of its week, which is exactly what\n // Home and End have to step back and forward by.\n const offset = (d.getDay() - resolvedFirstDay.value + 7) % 7\n const step = dayStep(event.key, event.shiftKey, offset)\n if (!step) return\n event.preventDefault()\n goTo(\n 'days' in step\n ? addDays(focusedISO.value, step.days)\n : addMonths(focusedISO.value, step.months),\n true,\n )\n}\n\n/**\n * Leaving the months or the years view for the days of the month chosen, keeping the day of\n * the month where the new month has one — the 31st becoming the 30th, say.\n */\nfunction chooseYearMonth(year: number, month0: number) {\n const day = Math.min(parseISO(focusedISO.value)!.getDate(), daysInMonth(year, month0))\n goTo(isoOf(year, month0, day))\n view.value = 'days'\n focusDay(focusedISO.value)\n}\n\n// @keyboard @a11y\n/**\n * The keyboard of the months and the years views, which differ only in what their cells\n * hold: Enter or Space chooses the focused cell, and the arrows walk the list of cells a row\n * or a column at a time, stopping at either end.\n */\nfunction onViewKeydown(\n event: KeyboardEvent,\n cells: readonly number[],\n focused: Ref<number>,\n cellEl: (value: number) => HTMLElement | null,\n choose: (value: number) => void,\n) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n choose(focused.value)\n return\n }\n const delta = gridDelta(event.key)\n if (delta === undefined) return\n event.preventDefault()\n const next = clamp(cells.indexOf(focused.value) + delta, 0, cells.length - 1)\n focused.value = cells[next] ?? focused.value\n cellEl(focused.value)?.focus()\n}\n\n// The months view, opened from the month button in the header.\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i)\nconst focusedMonth = ref(viewMonth0.value)\nconst monthCellEl = (i: number) =>\n document.getElementById(`${gridLabelId}-m-${i}`) as HTMLElement | null\nfunction monthSelectable(i: number) {\n return monthHasSelectable(viewYear.value, i)\n}\nfunction chooseMonth(i: number) {\n if (monthSelectable(i)) chooseYearMonth(viewYear.value, i)\n}\nconst onMonthsKeydown = (event: KeyboardEvent) =>\n onViewKeydown(event, MONTHS, focusedMonth, monthCellEl, chooseMonth)\n\n// @a11y\n/*\n * Both pickers are a `role=\"grid\"`, and a grid owns ROWS, not cells: a gridcell\n * placed straight under the grid fails aria-required-children and\n * aria-required-parent at the same time. The cells are therefore cut into rows of\n * PICKER_COLUMNS, matching the `grid-template-columns` of the stylesheet — the row\n * element itself is `display: contents`, so the CSS grid never sees it.\n *\n * Keyboard navigation is unaffected by this extra level: it moves by index and\n * refocuses cells through their ids, never by walking the DOM.\n */\nconst chunk = <T,>(list: T[]) =>\n Array.from({ length: Math.ceil(list.length / PICKER_COLUMNS) }, (_, r) =>\n list.slice(r * PICKER_COLUMNS, r * PICKER_COLUMNS + PICKER_COLUMNS),\n )\n\nconst monthRows = computed(() => chunk(monthLabels.value.map((name, i) => ({ name, i }))))\n\n// The years view, opened from the year button in the header.\nconst yearRange = computed(() => {\n /*\n * `min` and `max` come straight from the consumer, and this is the ONLY place\n * where they are turned into a Date instead of being compared as ISO text —\n * `compareISO`, `isWithin` and `clampISO` all tolerate a malformed bound. A value\n * that is not a valid ISO date therefore has to fall back to the open range here:\n * asserting the parse would throw and take the whole render down the moment the\n * years view is opened.\n */\n const minY = parseISO(props.min)?.getFullYear() ?? viewYear.value - 100\n const maxY = parseISO(props.max)?.getFullYear() ?? viewYear.value + 100\n const list: number[] = []\n for (let y = minY; y <= maxY; y++) list.push(y)\n return list\n})\nconst yearRows = computed(() => chunk(yearRange.value))\nconst focusedYear = ref(viewYear.value)\nconst yearCellEl = (y: number) =>\n document.getElementById(`${gridLabelId}-y-${y}`) as HTMLElement | null\nconst chooseYear = (y: number) => chooseYearMonth(y, viewMonth0.value)\nconst onYearsKeydown = (event: KeyboardEvent) =>\n onViewKeydown(event, yearRange.value, focusedYear, yearCellEl, chooseYear)\n\n// Follows a selection changed from the outside: when the leading value lands in\n// another month, the calendar moves to it rather than leaving the reader in front of\n// a grid where nothing is selected.\nwatch(\n () => [singleValue.value, rangeValue.value.start, multipleValues.value[0]],\n () => {\n const primary = singleValue.value ?? rangeValue.value.start ?? multipleValues.value[0]\n if (primary && isValidISO(primary)) {\n const d = parseISO(primary)!\n if (d.getFullYear() !== viewYear.value || d.getMonth() !== viewMonth0.value) {\n focusedISO.value = primary\n }\n }\n },\n)\n\n// @a11y\n/**\n * Brings the focus into the grid, on the day the calendar is currently showing. This\n * is what VDateInput calls when it opens its panel.\n */\nfunction focus(options?: FocusOptions) {\n view.value = 'days'\n focusDay(focusedISO.value, options)\n}\n\n// @core\n/*\n * Puts the calendar back the way it opens: the days view, on the selected date (today\n * failing that), with no range preview pending. It moves no focus and announces nothing,\n * a panel reopening not being something the reader did.\n *\n * TRAP — a panel's content stays MOUNTED while the panel is closed, so without this the\n * months or years view a reader left open is what the next opening shows — and a field\n * that opens its panel on focus never calls `focus()`, the one place that reset the view.\n */\nfunction reset() {\n view.value = 'days'\n hoverISO.value = null\n focusedISO.value = initialFocus()\n}\n\ndefineExpose({\n /** Brings the focus into the grid, onto the day the calendar is showing. */\n focus,\n /**\n * Returns to the days view, on the selected date or today, without moving the focus.\n * VDateInput calls it each time its panel opens and closes.\n */\n reset,\n})\n</script>\n\n<template>\n <div\n class=\"v-date-picker\"\n role=\"group\"\n :aria-label=\"ariaLabel\"\n :data-view=\"view\"\n :data-selection=\"selection\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n @pointerleave=\"hoverISO = null\"\n >\n <!-- The header: the month and the year, each between two chevrons that step it,\n and each opening its own picker view when clicked -->\n <div class=\"v-date-picker-header\">\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :label=\"m.datePicker.previousMonth\"\n size=\"sm\"\n :disabled=\"disabled || !canPrevMonth\"\n @click=\"stepMonth(-1)\"\n >\n <VIcon :name=\"chevronLeftIcon\" mirrored />\n </VIconButton>\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :disabled=\"disabled\"\n :aria-expanded=\"view === 'months'\"\n :aria-label=\"monthLabel\"\n @click=\"toggleView('months')\"\n >\n {{ monthLabels[viewMonth0] }}\n <VIcon\n :name=\"view === 'months' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :label=\"m.datePicker.nextMonth\"\n size=\"sm\"\n :disabled=\"disabled || !canNextMonth\"\n @click=\"stepMonth(1)\"\n >\n <VIcon :name=\"chevronRightIcon\" mirrored />\n </VIconButton>\n </div>\n\n <div class=\"v-date-picker-nav\">\n <VIconButton\n :label=\"m.datePicker.previousYear\"\n size=\"sm\"\n :disabled=\"disabled || !canPrevYear\"\n @click=\"stepYear(-1)\"\n >\n <VIcon :name=\"chevronLeftIcon\" mirrored />\n </VIconButton>\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n class=\"v-date-picker-view-toggle\"\n :disabled=\"disabled\"\n :aria-expanded=\"view === 'years'\"\n @click=\"toggleView('years')\"\n >\n {{ viewYear }}\n <VIcon\n :name=\"view === 'years' ? arrowDropUpIcon : arrowDropDownIcon\"\n aria-hidden=\"true\"\n />\n </VButton>\n <VIconButton\n :label=\"m.datePicker.nextYear\"\n size=\"sm\"\n :disabled=\"disabled || !canNextYear\"\n @click=\"stepYear(1)\"\n >\n <VIcon :name=\"chevronRightIcon\" mirrored />\n </VIconButton>\n </div>\n </div>\n\n <!-- Days view -->\n <div\n v-show=\"view === 'days'\"\n class=\"v-date-picker-grid\"\n role=\"grid\"\n :aria-label=\"gridLabel\"\n :aria-multiselectable=\"selection === 'multiple' ? 'true' : undefined\"\n @keydown=\"onDaysKeydown\"\n >\n <div class=\"v-date-picker-weekdays\" role=\"row\">\n <span\n v-for=\"(w, i) in weekdays\"\n :key=\"w\"\n class=\"v-date-picker-weekday\"\n role=\"columnheader\"\n :aria-label=\"weekdaysLong[i]\"\n >{{ w }}</span\n >\n </div>\n <div v-for=\"(week, wi) in weeks\" :key=\"wi\" class=\"v-date-picker-week\" role=\"row\">\n <div\n v-for=\"cell in week\"\n :key=\"cell.iso\"\n class=\"v-date-picker-cell\"\n role=\"gridcell\"\n :aria-selected=\"cell.kind === 'button' ? cell.selected : undefined\"\n :data-in-range=\"cell.inRange ? '' : undefined\"\n :data-range-start=\"cell.rangeStart ? '' : undefined\"\n :data-range-end=\"cell.rangeEnd ? '' : undefined\"\n >\n <button\n v-if=\"cell.kind === 'button'\"\n :id=\"dayId(cell.iso)\"\n type=\"button\"\n class=\"v-date-picker-day\"\n :tabindex=\"cell.iso === focusedISO ? 0 : -1\"\n :data-outside=\"!cell.inMonth ? '' : undefined\"\n :data-selected=\"cell.selected ? '' : undefined\"\n :data-today=\"cell.today ? '' : undefined\"\n :data-unavailable=\"cell.disabled ? '' : undefined\"\n :disabled=\"disabled\"\n :aria-disabled=\"cell.disabled || readonly ? 'true' : undefined\"\n :aria-current=\"cell.today ? 'date' : undefined\"\n @click=\"selectDay(cell)\"\n @pointerenter=\"hoverISO = cell.iso\"\n @focus=\"hoverISO = cell.iso\"\n >\n <slot name=\"day\" v-bind=\"daySlotProps(cell)\">\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n <span v-if=\"cell.dots.length\" class=\"v-date-picker-dots\" aria-hidden=\"true\">\n <span\n v-for=\"(ev, ei) in cell.dots\"\n :key=\"ei\"\n class=\"v-date-picker-dot\"\n :style=\"ev.color ? { '--date-picker-dot-color': ev.color } : undefined\"\n />\n </span>\n </button>\n <!-- A day of a neighbouring month that cannot be selected. It renders the\n very same slot as the clickable days: were it left with the bare\n number, custom content taking several lines would apply to this month's\n days only, and the numbers would stop lining up from one cell to the\n next. The slot receives `inMonth`, which is how it can still tell the\n two apart. -->\n <span\n v-else-if=\"cell.kind === 'static'\"\n class=\"v-date-picker-day v-date-picker-day--static\"\n :data-disabled=\"cell.disabled ? '' : undefined\"\n >\n <slot name=\"day\" v-bind=\"daySlotProps(cell)\">\n <span class=\"v-date-picker-day-num\">{{ cell.day }}</span>\n </slot>\n </span>\n </div>\n </div>\n </div>\n\n <!-- Months view -->\n <div\n v-if=\"view === 'months'\"\n class=\"v-date-picker-view\"\n role=\"grid\"\n :aria-label=\"m.datePicker.monthPicker\"\n @keydown=\"onMonthsKeydown\"\n >\n <div v-for=\"(row, r) in monthRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"{ name, i } in row\"\n :id=\"`${gridLabelId}-m-${i}`\"\n :key=\"name\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"i === focusedMonth ? 0 : -1\"\n :data-selected=\"i === viewMonth0 ? '' : undefined\"\n :aria-selected=\"i === viewMonth0 ? 'true' : undefined\"\n :disabled=\"disabled || !monthSelectable(i)\"\n @click=\"chooseMonth(i)\"\n >\n {{ name }}\n </button>\n </div>\n </div>\n\n <!-- Years view -->\n <div\n v-if=\"view === 'years'\"\n class=\"v-date-picker-view v-date-picker-view--years\"\n role=\"grid\"\n :aria-label=\"m.datePicker.yearPicker\"\n @keydown=\"onYearsKeydown\"\n >\n <div v-for=\"(row, r) in yearRows\" :key=\"r\" class=\"v-date-picker-view-row\" role=\"row\">\n <button\n v-for=\"y in row\"\n :id=\"`${gridLabelId}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"v-date-picker-view-cell\"\n role=\"gridcell\"\n :tabindex=\"y === focusedYear ? 0 : -1\"\n :data-selected=\"y === viewYear ? '' : undefined\"\n :aria-selected=\"y === viewYear ? 'true' : undefined\"\n :disabled=\"disabled\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"v-date-picker-footer\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-picker {\n /* The consumer sets the size of the day disc through its token; the cell around it —\n the hover area and the width of the column — grows to follow, and never falls below\n the size the cell token sets. */\n --date-picker-cell: max(\n var(--vectis-control-size-date-picker-cell),\n calc(var(--vectis-control-size-date-picker-day) + var(--vectis-space-1))\n );\n display: inline-flex;\n flex-direction: column;\n gap: var(--vectis-space-2);\n padding: var(--vectis-space-3);\n font-family: var(--vectis-text-family);\n color: var(--vectis-color-text);\n }\n\n /* The calendar is a flex column, so every block stretches to its full width by\n default. The days grid then fills that width through its 1fr columns, and never\n goes below the seven cells its own floor guarantees. */\n .v-date-picker-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--vectis-space-2);\n }\n\n .v-date-picker-nav {\n display: flex;\n align-items: center;\n }\n\n /* A minimum width holds this button steady, so the chevrons on either side do not\n shift as the month or year label changes length. */\n .v-date-picker-view-toggle {\n min-inline-size: var(--vectis-control-size-date-picker-nav-min);\n /* The semibold is state emphasis on the grid's main landmark, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n text-transform: capitalize;\n }\n\n /* The days grid can never be narrower than seven cells. Above that floor it takes\n whatever width the calendar has — set by the header — and the 1fr columns share\n it out equally. */\n .v-date-picker-grid {\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n\n .v-date-picker-weekdays,\n .v-date-picker-week {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n }\n\n .v-date-picker-weekday {\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--vectis-control-height-sm);\n /* A column micro-header, which takes the overline type role. The casing stays\n `capitalize`, the calendar convention, rather than the full capitals the\n VTypography overline variant would apply. */\n font-size: var(--vectis-text-overline-size);\n font-weight: var(--vectis-text-overline-weight);\n letter-spacing: var(--vectis-text-overline-tracking);\n color: var(--vectis-color-text-muted);\n text-transform: capitalize;\n }\n\n .v-date-picker-cell {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--date-picker-cell);\n }\n\n /* The band joining the days of a selected range: a tinted background laid behind\n the day, at the HEIGHT of the disc rather than of the whole cell. Its vertical\n inset is half the gap between cell and disc, expressed in `%` so it follows the\n real width of a 1fr column whatever the calendar measures.\n\n At either end the band stops exactly at the edge of the disc — hence the inset on\n the outer side — and that corner is rounded with the pill radius, which a box\n this height caps at half its height, i.e. precisely the disc's own radius, so it\n cannot overshoot.\n\n TRAP — the two cap rules below only shape a pseudo-element that `[data-in-range]`\n has already created, so they depend on `isInRange` counting BOTH ends of the period\n as inside it. Make it exclusive and there is no `::before` to cap: both rounded ends\n of every range vanish, leaving a band that stops square one cell short at each side,\n with nothing in the console. The last rule is the single-day case, where the two caps\n would meet and draw a disc behind the disc. */\n .v-date-picker-cell[data-in-range]::before {\n content: '';\n position: absolute;\n inset-block: calc((100% - var(--vectis-control-size-date-picker-day)) / 2);\n inset-inline: 0;\n background: var(--vectis-color-accent-surface);\n z-index: 0;\n }\n .v-date-picker-cell[data-range-start]::before {\n inset-inline-start: calc((100% - var(--vectis-control-size-date-picker-day)) / 2);\n border-start-start-radius: var(--vectis-radius-pill);\n border-end-start-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-end]::before {\n inset-inline-end: calc((100% - var(--vectis-control-size-date-picker-day)) / 2);\n border-start-end-radius: var(--vectis-radius-pill);\n border-end-end-radius: var(--vectis-radius-pill);\n }\n .v-date-picker-cell[data-range-start][data-range-end]::before {\n content: none;\n }\n\n .v-date-picker-day {\n position: relative;\n z-index: 1;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: var(--vectis-control-size-date-picker-day);\n block-size: var(--vectis-control-size-date-picker-day);\n padding: 0;\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n cursor: pointer;\n transition:\n background-color var(--vectis-duration-fast) var(--vectis-ease-default),\n color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n\n /* Hover belongs to the days one can actually click: not the disabled ones, not the\n already selected ones, and not the neighbouring days rendered as plain spans. */\n .v-date-picker-day:hover:not([aria-disabled='true']):not([data-selected]):not(\n .v-date-picker-day--static\n ) {\n background: var(--vectis-color-surface-muted);\n }\n\n .v-date-picker-day[data-outside] {\n color: var(--vectis-color-text-subtle);\n }\n\n /* The semibold in the two rules below marks a state — today, and the selection —\n and is not a typographic role, which is why it reads a font token directly. */\n .v-date-picker-day[data-today]:not([data-selected]) {\n box-shadow: inset 0 0 0 1px var(--vectis-color-accent-border);\n color: var(--vectis-color-accent-text);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n .v-date-picker-day[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n font-weight: var(--vectis-font-weight-semibold);\n }\n\n /* The strike-through says the DATE is unavailable — outside the bounds, or listed in\n `disabledDates`. It hangs on its own attribute rather than on `aria-disabled`, which\n a read-only calendar also carries on every day: nothing can be chosen there, but the\n dates themselves are perfectly available and striking them all out would say the\n opposite. The hover rule below still reads `aria-disabled`, so neither highlights. */\n .v-date-picker-day[data-unavailable] {\n color: var(--vectis-color-text-subtle);\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker[data-readonly] .v-date-picker-day:not([data-unavailable]) {\n cursor: default;\n }\n\n /* A disabled calendar greys out through the colour tokens and never through opacity,\n the selection included: left in the accent colour it would go on looking live. */\n .v-date-picker-day:disabled {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n\n .v-date-picker[data-disabled] .v-date-picker-day[data-selected] {\n background: var(--vectis-color-surface-muted);\n color: var(--vectis-color-text-subtle);\n }\n\n .v-date-picker-day--static {\n color: var(--vectis-color-text-subtle);\n cursor: default;\n }\n\n /* A neighbouring day that falls outside the bounds, or is disabled, is struck\n through like any other unavailable date. */\n .v-date-picker-day--static[data-disabled] {\n text-decoration: line-through;\n cursor: not-allowed;\n }\n\n .v-date-picker-day:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n .v-date-picker-day-num {\n line-height: var(--vectis-text-control-leading);\n }\n\n .v-date-picker-dots {\n position: absolute;\n inset-block-end: calc(var(--vectis-space-1) * 0.5);\n display: flex;\n gap: 2px;\n }\n .v-date-picker-dot {\n inline-size: var(--vectis-control-size-date-picker-dot);\n block-size: var(--vectis-control-size-date-picker-dot);\n border-radius: var(--vectis-radius-pill);\n background: var(--date-picker-dot-color, var(--vectis-color-accent));\n }\n .v-date-picker-day[data-selected] .v-date-picker-dot {\n background: var(--vectis-color-text-on-accent);\n }\n\n /* The months and years views. They fill the calendar's width exactly like the days\n grid does: stretched by the flex column, then shared out by 1fr columns. */\n .v-date-picker-view {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--vectis-space-1);\n min-inline-size: calc(7 * var(--date-picker-cell));\n }\n /* The rows ARIA requires inside a grid, made invisible to the layout: with\n `display: contents` the cells remain direct grid items of `.v-date-picker-view`,\n so the columns line up as if the rows were not there. */\n .v-date-picker-view-row {\n display: contents;\n }\n\n .v-date-picker-view--years {\n max-block-size: calc(6 * var(--date-picker-cell));\n overflow-y: auto;\n }\n\n .v-date-picker-view-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n block-size: var(--vectis-control-height-lg);\n border: none;\n border-radius: var(--vectis-radius-pill);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: var(--vectis-text-body-md-size);\n text-transform: capitalize;\n cursor: pointer;\n transition: background-color var(--vectis-duration-fast) var(--vectis-ease-default);\n }\n .v-date-picker-view-cell:hover:not(:disabled):not([data-selected]) {\n background: var(--vectis-color-surface-muted);\n }\n .v-date-picker-view-cell[data-selected] {\n background: var(--vectis-color-accent);\n color: var(--vectis-color-text-on-accent);\n /* Again state emphasis, not a type role. */\n font-weight: var(--vectis-font-weight-semibold);\n }\n .v-date-picker-view-cell:disabled {\n color: var(--vectis-color-text-subtle);\n cursor: not-allowed;\n }\n .v-date-picker-view-cell:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n\n .v-date-picker-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-2);\n padding-block-start: var(--vectis-space-2);\n border-block-start: 1px solid var(--vectis-color-border);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-date-picker-day,\n .v-date-picker-view-cell {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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3B,iBAAe,MAAM,EAAA,QAAQ,KAAQ,KAAA;IACrC,iBAAe,MAAM,EAAA,QAAQ,SAAY,KAAA;IACzC,UAAU,EAAA;IACV,UAAK,MAAE,EAAW,CAAC;QAEjB,CAAC,GAAA,GAAA,EAAA;GAKCA,EAAAA,OAAO,UAAA,EAAA,GAAlB,EAEM,OAFN,IAEM,CADJ,EAAsB,EAAA,QAAA,QAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
@layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
|
|
2
|
-
@layer vectis.components{.v-dialog{inline-size:var(--dialog-width);max-inline-size:calc(100dvi - 2 * var(--vectis-space-4));max-block-size:calc(100dvb - 2 * var(--vectis-space-4));border-radius:var(--vectis-radius-overlay);background:var(--vectis-color-surface-overlay);color:var(--vectis-color-text);box-shadow:var(--vectis-shadow-xl);font-family:var(--vectis-text-family);border:none;flex-direction:column;margin:auto;padding:0;display:flex;overflow:hidden}.v-dialog:not([open]){display:none}.v-dialog:focus-visible{outline:none}.v-dialog-scroll{flex-direction:column;flex:auto;min-block-size:0;display:flex;overflow-y:auto;container-type:scroll-state}.v-dialog-edge{background:0 0;flex:none;block-size:1px;position:sticky}.v-dialog-edge--top{margin-block-end:-1px;inset-block-start:0}.v-dialog-edge--bottom{margin-block-start:-1px;inset-block-end:0}.v-dialog-header{justify-content:space-between;align-items:flex-start;gap:var(--vectis-space-4);padding:var(--vectis-space-6) var(--vectis-space-6) var(--vectis-space-3);flex:none;display:flex}.v-dialog-titles{flex-direction:column;min-inline-size:0;display:flex}.v-dialog-header-actions{align-items:center;gap:var(--vectis-space-1);margin-block-start:calc(-1 * var(--vectis-space-1));margin-inline-end:calc(-1 * var(--vectis-space-2));display:flex}.v-dialog-body{padding:var(--vectis-space-1) var(--vectis-space-6) var(--vectis-space-3);
|
|
2
|
+
@layer vectis.components{.v-dialog{--dialog-width:var(--vectis-control-size-dialog-width);inline-size:var(--dialog-width);max-inline-size:calc(100dvi - 2 * var(--vectis-space-4));max-block-size:calc(100dvb - 2 * var(--vectis-space-4));border-radius:var(--vectis-radius-overlay);background:var(--vectis-color-surface-overlay);color:var(--vectis-color-text);box-shadow:var(--vectis-shadow-xl);font-family:var(--vectis-text-family);border:none;flex-direction:column;margin:auto;padding:0;display:flex;overflow:hidden}.v-dialog:not([open]){display:none}.v-dialog:focus-visible{outline:none}.v-dialog-scroll{flex-direction:column;flex:auto;min-block-size:0;display:flex;overflow-y:auto;container-type:scroll-state}.v-dialog-edge{background:0 0;flex:none;block-size:1px;position:sticky}.v-dialog-edge--top{margin-block-end:-1px;inset-block-start:0}.v-dialog-edge--bottom{margin-block-start:-1px;inset-block-end:0}.v-dialog-header{justify-content:space-between;align-items:flex-start;gap:var(--vectis-space-4);padding:var(--vectis-space-6) var(--vectis-space-6) var(--vectis-space-3);flex:none;display:flex}.v-dialog-titles{flex-direction:column;min-inline-size:0;display:flex}.v-dialog-header-actions{align-items:center;gap:var(--vectis-space-1);margin-block-start:calc(-1 * var(--vectis-space-1));margin-inline-end:calc(-1 * var(--vectis-space-2));display:flex}.v-dialog-body{padding:var(--vectis-space-1) var(--vectis-space-6) var(--vectis-space-3);font-size:var(--vectis-text-body-md-size);line-height:var(--vectis-text-body-md-leading);flex:1 0 auto}.v-dialog-footer{justify-content:flex-end;align-items:center;gap:var(--vectis-space-3);padding:var(--vectis-space-3) var(--vectis-space-6) var(--vectis-space-6);flex-wrap:wrap;flex:none;display:flex}@container scroll-state(scrollable:top){.v-dialog-edge--top{background:var(--vectis-color-border)}}@container scroll-state(scrollable:bottom){.v-dialog-edge--bottom{background:var(--vectis-color-border)}}.v-dialog{transition:opacity var(--vectis-duration-base) var(--vectis-ease-default), transform var(--vectis-duration-base) var(--vectis-ease-default)}@starting-style{.v-dialog[open]{opacity:0;transform:scale(.97)}}.v-dialog::backdrop{background:var(--vectis-color-backdrop);transition:opacity var(--vectis-duration-base) var(--vectis-ease-default)}@starting-style{.v-dialog[open]::backdrop{opacity:0}}@media (prefers-reduced-motion:reduce){.v-dialog,.v-dialog::backdrop{transition:none}}}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Almost everything that makes a modal correct comes free with the native `<dialog>`
|
|
5
|
-
* element opened as a modal — it is drawn above the whole page, the background is
|
|
6
|
-
* dimmed and made unusable, the focus is trapped inside it and handed back to the
|
|
7
|
-
* trigger on closing, and whether a click outside or Escape dismisses it is declared
|
|
8
|
-
* with an attribute rather than coded.
|
|
9
|
-
*
|
|
10
|
-
* The ONLY behavioural JavaScript is the bridge between `v-model:open` and the two
|
|
11
|
-
* methods the platform offers no declarative equivalent for: opening as a modal, and
|
|
12
|
-
* closing.
|
|
13
|
-
*/
|
|
1
|
+
/** How assistive technology announces the dialog. */
|
|
2
|
+
export type DialogRole = 'dialog' | 'alertdialog';
|
|
14
3
|
interface DialogProps {
|
|
15
4
|
/**
|
|
16
5
|
* The title of the dialog, which also names it for assistive technology. It is
|
|
@@ -20,28 +9,36 @@ interface DialogProps {
|
|
|
20
9
|
/** A line under the title, explaining what the dialog is asking. */
|
|
21
10
|
subtitle?: string;
|
|
22
11
|
/**
|
|
23
|
-
* How wide the dialog is
|
|
24
|
-
*
|
|
12
|
+
* How wide the dialog is: a number is read as pixels, a string as any CSS length. Left
|
|
13
|
+
* out, it takes the `--vectis-control-size-dialog-width` token, 400px by default. It is
|
|
14
|
+
* never allowed to exceed the width of the viewport.
|
|
25
15
|
*/
|
|
26
|
-
width?: string;
|
|
16
|
+
width?: number | string;
|
|
27
17
|
/**
|
|
28
18
|
* What kind of dialog this is. `alertdialog` is for one that must be answered
|
|
29
19
|
* explicitly, and it makes screen readers announce it more insistently — see
|
|
30
20
|
* VDialogAlert, which is exactly that.
|
|
31
21
|
*/
|
|
32
|
-
role?:
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
role?: DialogRole;
|
|
23
|
+
/**
|
|
24
|
+
* Takes the close cross out of the header, leaving the reader with Escape, the
|
|
25
|
+
* backdrop and whatever the footer offers.
|
|
26
|
+
*/
|
|
27
|
+
hideClose?: boolean;
|
|
28
|
+
/** Stops a click outside the dialog from closing it. */
|
|
29
|
+
persistentBackdrop?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Stops the Escape key from closing the dialog. Note that refusing Escape while the
|
|
32
|
+
* backdrop still closes cannot be expressed natively, so both routes are then
|
|
33
|
+
* allowed.
|
|
34
|
+
*/
|
|
35
|
+
persistentEscape?: boolean;
|
|
39
36
|
/** What the close cross does, in words. It falls back to the design system dictionary. */
|
|
40
37
|
closeLabel?: string;
|
|
41
38
|
}
|
|
42
39
|
type __VLS_Props = DialogProps;
|
|
43
40
|
/** What the trigger has to carry: the click that opens the dialog, and the fact that it does. */
|
|
44
|
-
type
|
|
41
|
+
export type DialogTriggerProps = {
|
|
45
42
|
onClick: () => void;
|
|
46
43
|
'aria-haspopup': 'dialog';
|
|
47
44
|
};
|
|
@@ -50,8 +47,8 @@ type __VLS_Slots = {
|
|
|
50
47
|
default(): unknown;
|
|
51
48
|
/** Replaces the title and subtitle block with content of your own. */
|
|
52
49
|
header?(): unknown;
|
|
53
|
-
/** Extra controls in the header, placed before the close cross
|
|
54
|
-
|
|
50
|
+
/** Extra controls in the header, placed before the close cross: a menu, a full-screen toggle. */
|
|
51
|
+
'header-actions'?(): unknown;
|
|
55
52
|
/** The buttons at the foot of the dialog. */
|
|
56
53
|
footer?(): unknown;
|
|
57
54
|
/**
|
|
@@ -59,18 +56,33 @@ type __VLS_Slots = {
|
|
|
59
56
|
* stays rendered at all times, unlike the dialog itself.
|
|
60
57
|
*/
|
|
61
58
|
trigger?(props: {
|
|
62
|
-
triggerProps:
|
|
59
|
+
triggerProps: DialogTriggerProps;
|
|
63
60
|
}): unknown;
|
|
64
61
|
};
|
|
65
|
-
declare function show(): void
|
|
62
|
+
declare function show(): Promise<void>;
|
|
66
63
|
declare function requestClose(): void;
|
|
67
64
|
type __VLS_ModelProps = {
|
|
65
|
+
/**
|
|
66
|
+
* Whether the dialog is showing. It starts closed, and it is BIDIRECTIONAL: the browser
|
|
67
|
+
* writes back to it whenever the dialog closes on its own, through Escape or the backdrop,
|
|
68
|
+
* so a consumer never has to reset it by hand.
|
|
69
|
+
*/
|
|
68
70
|
'open'?: boolean;
|
|
69
71
|
};
|
|
70
72
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
71
73
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
74
|
+
/**
|
|
75
|
+
* Opens the dialog, exactly as setting `open` does. The opening lands on the next tick,
|
|
76
|
+
* once the element has been rendered: `el` is still null right after the call, and the
|
|
77
|
+
* promise returned settles once the dialog is showing.
|
|
78
|
+
*/
|
|
72
79
|
show: typeof show;
|
|
80
|
+
/**
|
|
81
|
+
* Closes the dialog. It closes unconditionally, `persistentEscape` and
|
|
82
|
+
* `persistentBackdrop` governing only the two routes the reader can take.
|
|
83
|
+
*/
|
|
73
84
|
close: typeof requestClose;
|
|
85
|
+
/** The `<dialog>` element. It is null while closed: each opening builds a fresh one. */
|
|
74
86
|
el: import('vue').Ref<HTMLDialogElement | null, HTMLDialogElement | null>;
|
|
75
87
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
76
88
|
"update:open": (value: boolean) => any;
|
|
@@ -78,13 +90,13 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
78
90
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
79
91
|
}>, {
|
|
80
92
|
title: string;
|
|
81
|
-
role:
|
|
93
|
+
role: DialogRole;
|
|
82
94
|
subtitle: string;
|
|
83
|
-
width: string;
|
|
84
|
-
|
|
95
|
+
width: number | string;
|
|
96
|
+
hideClose: boolean;
|
|
85
97
|
closeLabel: string;
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
persistentBackdrop: boolean;
|
|
99
|
+
persistentEscape: boolean;
|
|
88
100
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
89
101
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
90
102
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDialog.js","names":[],"sources":["../../../src/components/VDialog/VDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, useAttrs, useId, watch } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { useMessages } from '../../i18n/state'\n\n// @core\n/**\n * A modal dialog: it takes over the page until the reader answers it.\n *\n * Almost everything that makes a modal correct comes free with the native `<dialog>`\n * element opened as a modal — it is drawn above the whole page, the background is\n * dimmed and made unusable, the focus is trapped inside it and handed back to the\n * trigger on closing, and whether a click outside or Escape dismisses it is declared\n * with an attribute rather than coded.\n *\n * The ONLY behavioural JavaScript is the bridge between `v-model:open` and the two\n * methods the platform offers no declarative equivalent for: opening as a modal, and\n * closing.\n */\ninterface DialogProps {\n /**\n * The title of the dialog, which also names it for assistive technology. It is\n * ignored when the `#header` slot replaces the whole header.\n */\n title?: string\n /** A line under the title, explaining what the dialog is asking. */\n subtitle?: string\n /**\n * How wide the dialog is, in any CSS unit. It is never allowed to exceed the width\n * of the viewport.\n */\n width?: string\n /**\n * What kind of dialog this is. `alertdialog` is for one that must be answered\n * explicitly, and it makes screen readers announce it more insistently — see\n * VDialogAlert, which is exactly that.\n */\n role?: 'dialog' | 'alertdialog'\n /** Shows the close cross in the header. */\n closable?: boolean\n /** Lets a click outside the dialog close it. */\n closeOnBackdrop?: boolean\n /** Lets the Escape key close the dialog. */\n closeOnEscape?: boolean\n /** What the close cross does, in words. It falls back to the design system dictionary. */\n closeLabel?: string\n}\n\nconst props = withDefaults(defineProps<DialogProps>(), {\n title: undefined,\n subtitle: undefined,\n width: '400px',\n role: 'dialog',\n closable: true,\n closeOnBackdrop: true,\n closeOnEscape: true,\n closeLabel: undefined,\n})\n\nconst m = useMessages()\nconst resolvedCloseLabel = computed(() => props.closeLabel ?? m.value.common.close)\n\nconst open = defineModel<boolean>('open', { default: false })\n\n/** What the trigger has to carry: the click that opens the dialog, and the fact that it does. */\ntype TriggerProps = {\n onClick: () => void\n 'aria-haspopup': 'dialog'\n}\n\ndefineSlots<{\n /** The body of the dialog. This is the part that scrolls when there is too much of it. */\n default(): unknown\n /** Replaces the title and subtitle block with content of your own. */\n header?(): unknown\n /** Extra controls in the header, placed before the close cross — a menu, a full-screen toggle. */\n headerActions?(): unknown\n /** The buttons at the foot of the dialog. */\n footer?(): unknown\n /**\n * The button that opens the dialog. Bind the `triggerProps` it receives onto it. It\n * stays rendered at all times, unlike the dialog itself.\n */\n trigger?(props: { triggerProps: TriggerProps }): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst dialogEl = ref<HTMLDialogElement | null>(null)\nconst titleId = useId()\nconst subtitleId = useId()\n\n/**\n * Which dismissals the browser itself accepts, declared as an attribute rather than\n * handled in code: everything, Escape alone, or nothing.\n *\n * One combination cannot be expressed that way — a click outside allowed while Escape\n * is not — and it falls back to allowing both. Nothing in the design system asks for\n * it, and it would be a strange thing to want.\n */\nconst closedby = computed(() =>\n props.closeOnBackdrop ? 'any' : props.closeOnEscape ? 'closerequest' : 'none',\n)\n\n// @fallback\n// The `closedby` attribute is newer than the type definitions shipped with\n// TypeScript, so writing it directly in the template would be reported as an unknown\n// attribute. Passing it inside a bound object goes through the same path as any\n// forwarded attribute, which is not checked element by element. Vue still merges the\n// `class` and `style` it may contain with the static ones below.\nconst rootAttrs = computed(() => ({ ...attrs, closedby: closedby.value }))\n\n// The dialog and its content only exist while it is open, which also spares the page\n// whatever heavy thing it contains. Every opening therefore builds a BRAND NEW\n// element, so it is always opened as a modal from a clean slate, and closing removes\n// it entirely — nothing is left behind to swallow clicks, and reopening cannot race\n// with a closing that is still finishing. The trigger, by contrast, stays rendered at\n// all times.\nconst rendered = ref(open.value)\n\nfunction show() {\n open.value = true\n}\n\nfunction requestClose() {\n // Closing the element is enough: the browser then fires its own close event, which\n // is what puts the model back in step below.\n dialogEl.value?.close()\n}\n\nconst triggerProps = computed<TriggerProps>(() => ({\n onClick: show,\n 'aria-haspopup': 'dialog',\n}))\n\n// The `<dialog>` element is asymmetric in a way that shapes this whole bridge: it\n// announces every closing with an event, but announces nothing at all when it opens —\n// where a popover reports both. So the two directions are not written the same way:\n//\n// - opening: render the element, then, once Vue has actually put it in the document,\n// open it as a modal;\n// - closing: whatever closed it — the cross, our own call, Escape, a click outside —\n// the browser's close event is what puts the model back in step, and only then is\n// the element removed.\nwatch(open, async (value) => {\n if (value) {\n rendered.value = true\n await nextTick() // the brand new <dialog> has to exist before it can be opened\n dialogEl.value?.showModal()\n } else {\n dialogEl.value?.close()\n rendered.value = false\n }\n})\n\n// @ssr\nonMounted(() => {\n // A watcher does not run during the server render, so a dialog asked to be open from\n // the start would never be opened. The element is already there — the flag above was\n // initialized from the model — it just has to be told to show itself.\n if (open.value) dialogEl.value?.showModal()\n})\n\n// The browser's own close event, whatever caused it, is what brings the model back in\n// step with reality.\nfunction onClose() {\n open.value = false\n}\n\ndefineExpose({ show, close: requestClose, el: dialogEl })\n</script>\n\n<template>\n <slot name=\"trigger\" :trigger-props=\"triggerProps\" />\n <dialog\n v-if=\"rendered\"\n ref=\"dialogEl\"\n v-bind=\"rootAttrs\"\n class=\"v-dialog\"\n :style=\"{ '--dialog-width': width }\"\n :role=\"role === 'alertdialog' ? 'alertdialog' : undefined\"\n :aria-labelledby=\"title ? titleId : undefined\"\n :aria-describedby=\"subtitle ? subtitleId : undefined\"\n @close=\"onClose\"\n >\n <!--\n The header and the footer stay put while only the body scrolls, so the scrollbar\n is confined to the body and never runs along them.\n\n The lines that appear under the header and above the footer once the body is\n scrolled are drawn by two sentinels stuck INSIDE the scrolling area, and not by\n the header and footer themselves: a container query can only style what is inside\n the container it asks about, never a sibling of it.\n -->\n <header class=\"v-dialog-header\">\n <slot name=\"header\">\n <div class=\"v-dialog-titles\">\n <VTypography\n v-if=\"title\"\n :id=\"titleId\"\n as=\"h2\"\n variant=\"heading-3\"\n class=\"v-dialog-title\"\n >\n {{ title }}\n </VTypography>\n <VTypography\n v-if=\"subtitle\"\n :id=\"subtitleId\"\n variant=\"subtitle\"\n tone=\"muted\"\n class=\"v-dialog-subtitle\"\n >\n {{ subtitle }}\n </VTypography>\n </div>\n </slot>\n <div v-if=\"closable || $slots.headerActions\" class=\"v-dialog-header-actions\">\n <slot name=\"headerActions\" />\n <VIconButton\n v-if=\"closable\"\n class=\"v-dialog-close\"\n :label=\"resolvedCloseLabel\"\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n @click=\"requestClose\"\n >\n <VIcon :name=\"closeIcon\" />\n </VIconButton>\n </div>\n </header>\n <div class=\"v-dialog-scroll\">\n <span class=\"v-dialog-edge v-dialog-edge--top\" aria-hidden=\"true\" />\n <div class=\"v-dialog-body\">\n <slot />\n </div>\n <span class=\"v-dialog-edge v-dialog-edge--bottom\" aria-hidden=\"true\" />\n </div>\n <footer v-if=\"$slots.footer\" class=\"v-dialog-footer\">\n <slot name=\"footer\" />\n </footer>\n </dialog>\n</template>\n\n<style>\n@layer vectis.components {\n .v-dialog {\n /* The width comes from the prop, set inline. Whatever it asks for, the dialog is\n never allowed past the viewport, margins included. */\n inline-size: var(--dialog-width);\n max-inline-size: calc(100dvi - 2 * var(--vectis-space-4));\n max-block-size: calc(100dvb - 2 * var(--vectis-space-4));\n /* This puts the dialog back in the middle of the screen. The browser centres a\n modal with an automatic margin, which the design system's own reset — where\n every element loses its margins — had removed; restoring it here works because\n the component layer is stronger than the reset one. */\n margin: auto;\n /* The header and footer stay put while only the body scrolls, and hiding the\n overflow is what keeps the content inside the rounded corners. */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n padding: 0;\n border: none;\n border-radius: var(--vectis-radius-overlay);\n background: var(--vectis-color-surface-overlay);\n color: var(--vectis-color-text);\n box-shadow: var(--vectis-shadow-xl);\n font-family: var(--vectis-text-family);\n }\n\n /*\n * An indispensable guard. The browser hides a closed dialog with a rule of its own,\n * but any display we declare above beats it — so without this, a closed dialog would\n * sit in the page at the top left, swallowing clicks.\n *\n * It also covers the two moments where the element exists without being open yet: the\n * frame between rendering it and opening it, and the server-rendered markup. The\n * popovers have the very same guard.\n */\n .v-dialog:not([open]) {\n display: none;\n }\n\n /* Opening a modal puts the focus on the dialog itself. No ring is drawn around the\n whole thing for that: the focus a reader needs to see is the one on the controls\n inside. */\n .v-dialog:focus-visible {\n outline: none;\n }\n\n .v-dialog-scroll {\n /* The ONLY part that scrolls. It takes whatever room is left between the header\n and the footer, which is what keeps the scrollbar confined to it. The zero\n minimum is load-bearing: without it a flex item refuses to shrink below its\n content, and nothing would ever scroll. */\n flex: 1 1 auto;\n min-block-size: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n /* This makes the box something its descendants can ask questions about — namely\n whether there is content hidden above or below. It adds no containment of size. */\n container-type: scroll-state;\n }\n\n /*\n * The two sentinels: hairlines stuck to the top and the bottom of the scrolling\n * area, and descendants of it, which is what allows them to ask about its scroll\n * state. Their negative margins mean they occupy no space at all. They are\n * transparent until the rules further down reveal them.\n */\n .v-dialog-edge {\n flex: none;\n block-size: 1px;\n position: sticky;\n background: transparent;\n }\n\n .v-dialog-edge--top {\n inset-block-start: 0;\n margin-block-end: -1px;\n }\n\n .v-dialog-edge--bottom {\n inset-block-end: 0;\n margin-block-start: -1px;\n }\n\n .v-dialog-header {\n flex: none; /* stays at the top, outside whatever scrolls */\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--vectis-space-4);\n padding: var(--vectis-space-6) var(--vectis-space-6) var(--vectis-space-3);\n }\n\n .v-dialog-titles {\n display: flex;\n flex-direction: column;\n min-inline-size: 0;\n }\n\n /* The title and the subtitle are rendered by VTypography, which carries their type.\n Their classes remain as hooks, for a consumer's overrides and for the tests. */\n\n .v-dialog-header-actions {\n display: flex;\n align-items: center;\n gap: var(--vectis-space-1);\n /* The cross is a button, so it carries invisible padding of its own; pulling the\n row back by that amount is what makes the glyph line up with the header's edge\n rather than floating inside it. */\n margin-block-start: calc(-1 * var(--vectis-space-1));\n margin-inline-end: calc(-1 * var(--vectis-space-2));\n }\n\n .v-dialog-body {\n /* Short content is stretched to fill the space, so the footer stays at the bottom\n of the dialog rather than floating halfway up; long content keeps its natural\n height, overflows, and is what scrolls. */\n flex: 1 0 auto;\n padding: var(--vectis-space-1) var(--vectis-space-6) var(--vectis-space-3);\n color: var(--vectis-color-text);\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n }\n\n .v-dialog-footer {\n flex: none; /* stays at the bottom, outside whatever scrolls */\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-wrap: wrap;\n gap: var(--vectis-space-3);\n padding: var(--vectis-space-3) var(--vectis-space-6) var(--vectis-space-6);\n }\n\n /*\n * The lines only appear when they mean something. Asking the scrolling area whether\n * it can still be scrolled upwards tells us content is hidden ABOVE, so the line\n * under the header is shown; the same question downwards reveals the one above the\n * footer. In other words each line is drawn exactly when content is passing behind\n * the edge it marks.\n *\n * This kind of query is Chrome 133 and later for now. Where it is missing the\n * sentinels simply stay transparent, which is the intended fallback.\n */\n @container scroll-state(scrollable: top) {\n .v-dialog-edge--top {\n background: var(--vectis-color-border);\n }\n }\n\n @container scroll-state(scrollable: bottom) {\n .v-dialog-edge--bottom {\n background: var(--vectis-color-border);\n }\n }\n\n /*\n * The dialog animates on the way IN and not on the way out. Since it is removed from\n * the page the moment it closes, there is nothing left to animate out — that is the\n * price of the clean slate the lazy rendering buys, and it also spares the extra\n * declarations an exit animation would need.\n *\n * The starting values below are where a freshly rendered dialog begins, before\n * settling into its open state.\n */\n .v-dialog {\n transition:\n opacity var(--vectis-duration-base) var(--vectis-ease-default),\n transform var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n @starting-style {\n .v-dialog[open] {\n opacity: 0;\n transform: scale(0.97);\n }\n }\n\n .v-dialog::backdrop {\n background: var(--vectis-color-backdrop);\n transition: opacity var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n @starting-style {\n .v-dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-dialog,\n .v-dialog::backdrop {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"VDialog.js","names":[],"sources":["../../../src/components/VDialog/VDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * A modal dialog: it takes over the page until the reader answers it.\n *\n * Almost everything that makes a modal correct comes free with the native `<dialog>`\n * element opened as a modal — it is drawn above the whole page, the background is\n * dimmed and made unusable, the focus is trapped inside it and handed back to the\n * trigger on closing, and whether a click outside or Escape dismisses it is declared\n * with an attribute rather than coded.\n *\n * The ONLY behavioural JavaScript is the bridge between `v-model:open` and the two\n * methods the platform offers no declarative equivalent for: opening as a modal, and\n * closing.\n */\n\nimport { computed, nextTick, onMounted, ref, useAttrs, useId, watch } from 'vue'\n\nimport VIcon from '../VIcon/VIcon.vue'\nimport { close as closeIcon } from '../VIcon/icons/close'\nimport VIconButton from '../VIconButton/VIconButton.vue'\nimport VTypography from '../VTypography/VTypography.vue'\nimport { useMessages } from '../../i18n/state'\nimport { cssSize } from '../../utils/css'\n\n/** How assistive technology announces the dialog. */\nexport type DialogRole = 'dialog' | 'alertdialog'\n\ninterface DialogProps {\n /**\n * The title of the dialog, which also names it for assistive technology. It is\n * ignored when the `#header` slot replaces the whole header.\n */\n title?: string\n /** A line under the title, explaining what the dialog is asking. */\n subtitle?: string\n /**\n * How wide the dialog is: a number is read as pixels, a string as any CSS length. Left\n * out, it takes the `--vectis-control-size-dialog-width` token, 400px by default. It is\n * never allowed to exceed the width of the viewport.\n */\n width?: number | string\n /**\n * What kind of dialog this is. `alertdialog` is for one that must be answered\n * explicitly, and it makes screen readers announce it more insistently — see\n * VDialogAlert, which is exactly that.\n */\n role?: DialogRole\n /**\n * Takes the close cross out of the header, leaving the reader with Escape, the\n * backdrop and whatever the footer offers.\n */\n hideClose?: boolean\n /** Stops a click outside the dialog from closing it. */\n persistentBackdrop?: boolean\n /**\n * Stops the Escape key from closing the dialog. Note that refusing Escape while the\n * backdrop still closes cannot be expressed natively, so both routes are then\n * allowed.\n */\n persistentEscape?: boolean\n /** What the close cross does, in words. It falls back to the design system dictionary. */\n closeLabel?: string\n}\n\nconst props = withDefaults(defineProps<DialogProps>(), {\n title: undefined,\n subtitle: undefined,\n width: undefined,\n role: 'dialog',\n hideClose: false,\n persistentBackdrop: false,\n persistentEscape: false,\n closeLabel: undefined,\n})\n\nconst m = useMessages()\nconst resolvedCloseLabel = computed(() => props.closeLabel ?? m.value.common.close)\n\n/**\n * Whether the dialog is showing. It starts closed, and it is BIDIRECTIONAL: the browser\n * writes back to it whenever the dialog closes on its own, through Escape or the backdrop,\n * so a consumer never has to reset it by hand.\n */\nconst open = defineModel<boolean>('open', { default: false })\n\n/** What the trigger has to carry: the click that opens the dialog, and the fact that it does. */\nexport type DialogTriggerProps = {\n onClick: () => void\n 'aria-haspopup': 'dialog'\n}\n\ndefineSlots<{\n /** The body of the dialog. This is the part that scrolls when there is too much of it. */\n default(): unknown\n /** Replaces the title and subtitle block with content of your own. */\n header?(): unknown\n /** Extra controls in the header, placed before the close cross: a menu, a full-screen toggle. */\n 'header-actions'?(): unknown\n /** The buttons at the foot of the dialog. */\n footer?(): unknown\n /**\n * The button that opens the dialog. Bind the `triggerProps` it receives onto it. It\n * stays rendered at all times, unlike the dialog itself.\n */\n trigger?(props: { triggerProps: DialogTriggerProps }): unknown\n}>()\n\ndefineOptions({ inheritAttrs: false })\n\nconst attrs = useAttrs()\nconst dialogEl = ref<HTMLDialogElement | null>(null)\nconst titleId = useId()\nconst subtitleId = useId()\n\n/**\n * Which dismissals the browser itself accepts, declared as an attribute rather than\n * handled in code: everything, Escape alone, or nothing.\n *\n * One combination cannot be expressed that way — a click outside allowed while Escape\n * is not — and it falls back to allowing both. Nothing in the design system asks for\n * it, and it would be a strange thing to want.\n */\nconst closedby = computed(() =>\n props.persistentBackdrop ? (props.persistentEscape ? 'none' : 'closerequest') : 'any',\n)\n\n// @fallback\n// The `closedby` attribute is newer than the type definitions shipped with\n// TypeScript, so writing it directly in the template would be reported as an unknown\n// attribute. Passing it inside a bound object goes through the same path as any\n// forwarded attribute, which is not checked element by element. Vue still merges the\n// `class` and `style` it may contain with the static ones below.\nconst rootAttrs = computed(() => ({ ...attrs, closedby: closedby.value }))\n\n// The dialog and its content only exist while it is open, which also spares the page\n// whatever heavy thing it contains. Every opening therefore builds a BRAND NEW\n// element, so it is always opened as a modal from a clean slate, and closing removes\n// it entirely — nothing is left behind to swallow clicks, and reopening cannot race\n// with a closing that is still finishing. The trigger, by contrast, stays rendered at\n// all times.\nconst rendered = ref(open.value)\n\n/**\n * Settles once the dialog opened by the latest change of `open` is actually showing. The\n * opening waits for the element to be rendered, so it is always a tick behind the model.\n */\nlet opening: Promise<void> = Promise.resolve()\n\nfunction show(): Promise<void> {\n open.value = true\n // The watcher below only runs when the scheduler flushes, so `opening` is read from a\n // tick later: read at once, it would still be the promise of the previous opening.\n return nextTick(() => opening)\n}\n\nfunction requestClose() {\n // Closing the element is enough: the browser then fires its own close event, which\n // is what puts the model back in step below.\n dialogEl.value?.close()\n}\n\nconst triggerProps = computed<DialogTriggerProps>(() => ({\n onClick: show,\n 'aria-haspopup': 'dialog',\n}))\n\n// The `<dialog>` element is asymmetric in a way that shapes this whole bridge: it\n// announces every closing with an event, but announces nothing at all when it opens —\n// where a popover reports both. So the two directions are not written the same way:\n//\n// - opening: render the element, then, once Vue has actually put it in the document,\n// open it as a modal;\n// - closing: whatever closed it — the cross, our own call, Escape, a click outside —\n// the browser's close event is what puts the model back in step, and only then is\n// the element removed.\nwatch(open, (value) => {\n if (value) {\n rendered.value = true\n // the brand new <dialog> has to exist before it can be opened\n opening = nextTick(() => dialogEl.value?.showModal())\n } else {\n dialogEl.value?.close()\n rendered.value = false\n }\n})\n\n// @ssr\nonMounted(() => {\n // A watcher does not run during the server render, so a dialog asked to be open from\n // the start would never be opened. The element is already there — the flag above was\n // initialized from the model — it just has to be told to show itself.\n if (open.value) dialogEl.value?.showModal()\n})\n\n// The browser's own close event, whatever caused it, is what brings the model back in\n// step with reality.\nfunction onClose() {\n open.value = false\n}\n\ndefineExpose({\n /**\n * Opens the dialog, exactly as setting `open` does. The opening lands on the next tick,\n * once the element has been rendered: `el` is still null right after the call, and the\n * promise returned settles once the dialog is showing.\n */\n show,\n /**\n * Closes the dialog. It closes unconditionally, `persistentEscape` and\n * `persistentBackdrop` governing only the two routes the reader can take.\n */\n close: requestClose,\n /** The `<dialog>` element. It is null while closed: each opening builds a fresh one. */\n el: dialogEl,\n})\n</script>\n\n<template>\n <slot name=\"trigger\" :trigger-props=\"triggerProps\" />\n <dialog\n v-if=\"rendered\"\n ref=\"dialogEl\"\n v-bind=\"rootAttrs\"\n class=\"v-dialog\"\n :style=\"{ '--dialog-width': cssSize(width) }\"\n :role=\"role === 'alertdialog' ? 'alertdialog' : undefined\"\n :aria-labelledby=\"title ? titleId : undefined\"\n :aria-describedby=\"subtitle ? subtitleId : undefined\"\n @close=\"onClose\"\n >\n <!--\n The header and the footer stay put while only the body scrolls, so the scrollbar\n is confined to the body and never runs along them.\n\n The lines that appear under the header and above the footer once the body is\n scrolled are drawn by two sentinels stuck INSIDE the scrolling area, and not by\n the header and footer themselves: a container query can only style what is inside\n the container it asks about, never a sibling of it.\n -->\n <header class=\"v-dialog-header\">\n <slot name=\"header\">\n <div class=\"v-dialog-titles\">\n <VTypography\n v-if=\"title\"\n :id=\"titleId\"\n as=\"h2\"\n variant=\"heading-3\"\n class=\"v-dialog-title\"\n >\n {{ title }}\n </VTypography>\n <VTypography\n v-if=\"subtitle\"\n :id=\"subtitleId\"\n variant=\"subtitle\"\n tone=\"muted\"\n class=\"v-dialog-subtitle\"\n >\n {{ subtitle }}\n </VTypography>\n </div>\n </slot>\n <div v-if=\"!hideClose || $slots['header-actions']\" class=\"v-dialog-header-actions\">\n <slot name=\"header-actions\" />\n <VIconButton\n v-if=\"!hideClose\"\n class=\"v-dialog-close\"\n :label=\"resolvedCloseLabel\"\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n @click=\"requestClose\"\n >\n <VIcon :name=\"closeIcon\" />\n </VIconButton>\n </div>\n </header>\n <div class=\"v-dialog-scroll\">\n <span class=\"v-dialog-edge v-dialog-edge--top\" aria-hidden=\"true\" />\n <div class=\"v-dialog-body\">\n <slot />\n </div>\n <span class=\"v-dialog-edge v-dialog-edge--bottom\" aria-hidden=\"true\" />\n </div>\n <footer v-if=\"$slots.footer\" class=\"v-dialog-footer\">\n <slot name=\"footer\" />\n </footer>\n </dialog>\n</template>\n\n<style>\n@layer vectis.components {\n .v-dialog {\n /* The width comes from the prop, set inline, or from the token when there is none.\n Whatever it asks for, the dialog is never allowed past the viewport, margins included.\n\n TRAP — the token is declared ON the element rather than written as a `var()` fallback.\n A custom property inherits, and a dialog opened from inside another one is its DOM\n descendant: with a fallback, an alert confirming something in an 800px dialog would\n read that dialog's inline width and open 800px wide itself, with no error anywhere. */\n --dialog-width: var(--vectis-control-size-dialog-width);\n inline-size: var(--dialog-width);\n max-inline-size: calc(100dvi - 2 * var(--vectis-space-4));\n max-block-size: calc(100dvb - 2 * var(--vectis-space-4));\n /* This puts the dialog back in the middle of the screen. The browser centres a\n modal with an automatic margin, which the design system's own reset — where\n every element loses its margins — had removed; restoring it here works because\n the component layer is stronger than the reset one. */\n margin: auto;\n /* The header and footer stay put while only the body scrolls, and hiding the\n overflow is what keeps the content inside the rounded corners. */\n display: flex;\n flex-direction: column;\n overflow: hidden;\n padding: 0;\n border: none;\n border-radius: var(--vectis-radius-overlay);\n background: var(--vectis-color-surface-overlay);\n color: var(--vectis-color-text);\n box-shadow: var(--vectis-shadow-xl);\n font-family: var(--vectis-text-family);\n }\n\n /*\n * An indispensable guard. The browser hides a closed dialog with a rule of its own,\n * but any display we declare above beats it — so without this, a closed dialog would\n * sit in the page at the top left, swallowing clicks.\n *\n * It also covers the two moments where the element exists without being open yet: the\n * frame between rendering it and opening it, and the server-rendered markup. The\n * popovers have the very same guard.\n */\n .v-dialog:not([open]) {\n display: none;\n }\n\n /* Opening a modal puts the focus on the dialog itself. No ring is drawn around the\n whole thing for that: the focus a reader needs to see is the one on the controls\n inside. */\n .v-dialog:focus-visible {\n outline: none;\n }\n\n .v-dialog-scroll {\n /* The ONLY part that scrolls. It takes whatever room is left between the header\n and the footer, which is what keeps the scrollbar confined to it. The zero\n minimum is load-bearing: without it a flex item refuses to shrink below its\n content, and nothing would ever scroll. */\n flex: 1 1 auto;\n min-block-size: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n /* This makes the box something its descendants can ask questions about — namely\n whether there is content hidden above or below. It adds no containment of size. */\n container-type: scroll-state;\n }\n\n /*\n * The two sentinels: hairlines stuck to the top and the bottom of the scrolling\n * area, and descendants of it, which is what allows them to ask about its scroll\n * state. Their negative margins mean they occupy no space at all. They are\n * transparent until the rules further down reveal them.\n */\n .v-dialog-edge {\n flex: none;\n block-size: 1px;\n position: sticky;\n background: transparent;\n }\n\n .v-dialog-edge--top {\n inset-block-start: 0;\n margin-block-end: -1px;\n }\n\n .v-dialog-edge--bottom {\n inset-block-end: 0;\n margin-block-start: -1px;\n }\n\n .v-dialog-header {\n flex: none; /* stays at the top, outside whatever scrolls */\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--vectis-space-4);\n padding: var(--vectis-space-6) var(--vectis-space-6) var(--vectis-space-3);\n }\n\n .v-dialog-titles {\n display: flex;\n flex-direction: column;\n min-inline-size: 0;\n }\n\n /* The title and the subtitle are rendered by VTypography, which carries their type.\n Their classes remain as hooks, for a consumer's overrides and for the tests. */\n\n .v-dialog-header-actions {\n display: flex;\n align-items: center;\n gap: var(--vectis-space-1);\n /* The cross is a button, so it carries invisible padding of its own; pulling the\n row back by that amount is what makes the glyph line up with the header's edge\n rather than floating inside it. */\n margin-block-start: calc(-1 * var(--vectis-space-1));\n margin-inline-end: calc(-1 * var(--vectis-space-2));\n }\n\n .v-dialog-body {\n /* Short content is stretched to fill the space, so the footer stays at the bottom\n of the dialog rather than floating halfway up; long content keeps its natural\n height, overflows, and is what scrolls. */\n flex: 1 0 auto;\n padding: var(--vectis-space-1) var(--vectis-space-6) var(--vectis-space-3);\n font-size: var(--vectis-text-body-md-size);\n line-height: var(--vectis-text-body-md-leading);\n }\n\n .v-dialog-footer {\n flex: none; /* stays at the bottom, outside whatever scrolls */\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex-wrap: wrap;\n gap: var(--vectis-space-3);\n padding: var(--vectis-space-3) var(--vectis-space-6) var(--vectis-space-6);\n }\n\n /*\n * The lines only appear when they mean something. Asking the scrolling area whether\n * it can still be scrolled upwards tells us content is hidden ABOVE, so the line\n * under the header is shown; the same question downwards reveals the one above the\n * footer. In other words each line is drawn exactly when content is passing behind\n * the edge it marks.\n *\n * This kind of query is Chrome 133 and later for now. Where it is missing the\n * sentinels simply stay transparent, which is the intended fallback.\n */\n @container scroll-state(scrollable: top) {\n .v-dialog-edge--top {\n background: var(--vectis-color-border);\n }\n }\n\n @container scroll-state(scrollable: bottom) {\n .v-dialog-edge--bottom {\n background: var(--vectis-color-border);\n }\n }\n\n /*\n * The dialog animates on the way IN and not on the way out. Since it is removed from\n * the page the moment it closes, there is nothing left to animate out — that is the\n * price of the clean slate the lazy rendering buys, and it also spares the extra\n * declarations an exit animation would need.\n *\n * The starting values below are where a freshly rendered dialog begins, before\n * settling into its open state.\n */\n .v-dialog {\n transition:\n opacity var(--vectis-duration-base) var(--vectis-ease-default),\n transform var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n @starting-style {\n .v-dialog[open] {\n opacity: 0;\n transform: scale(0.97);\n }\n }\n\n .v-dialog::backdrop {\n background: var(--vectis-color-backdrop);\n transition: opacity var(--vectis-duration-base) var(--vectis-ease-default);\n }\n\n @starting-style {\n .v-dialog[open]::backdrop {\n opacity: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .v-dialog,\n .v-dialog::backdrop {\n transition: none;\n }\n }\n}\n</style>\n"],"mappings":""}
|