vectis-ui 0.1.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/LICENSE +21 -0
- package/NOTICE +27 -0
- package/README.md +354 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/VAccordion/VAccordion.css +2 -0
- package/dist/components/VAccordion/VAccordion.d.ts +59 -0
- package/dist/components/VAccordion/VAccordion.js +9 -0
- package/dist/components/VAccordion/VAccordion.js.map +1 -0
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VAccordion/VAccordionItem.css +2 -0
- package/dist/components/VAccordion/VAccordionItem.d.ts +64 -0
- package/dist/components/VAccordion/VAccordionItem.js +9 -0
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -0
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VAccordion/context.d.ts +18 -0
- package/dist/components/VAccordion/context.js +6 -0
- package/dist/components/VAccordion/context.js.map +1 -0
- package/dist/components/VAvatar/VAvatar.css +2 -0
- package/dist/components/VAvatar/VAvatar.d.ts +68 -0
- package/dist/components/VAvatar/VAvatar.js +9 -0
- package/dist/components/VAvatar/VAvatar.js.map +1 -0
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VAvatar/VAvatarGroup.css +2 -0
- package/dist/components/VAvatar/VAvatarGroup.d.ts +59 -0
- package/dist/components/VAvatar/VAvatarGroup.js +9 -0
- package/dist/components/VAvatar/VAvatarGroup.js.map +1 -0
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VAvatar/context.d.ts +17 -0
- package/dist/components/VAvatar/context.js +6 -0
- package/dist/components/VAvatar/context.js.map +1 -0
- package/dist/components/VBadge/VBadge.css +2 -0
- package/dist/components/VBadge/VBadge.d.ts +74 -0
- package/dist/components/VBadge/VBadge.js +9 -0
- package/dist/components/VBadge/VBadge.js.map +1 -0
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VBreadcrumb/VBreadcrumb.css +2 -0
- package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +68 -0
- package/dist/components/VBreadcrumb/VBreadcrumb.js +9 -0
- package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -0
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VButton/VButton.css +2 -0
- package/dist/components/VButton/VButton.d.ts +88 -0
- package/dist/components/VButton/VButton.js +9 -0
- package/dist/components/VButton/VButton.js.map +1 -0
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VButton/VButtonGroup.css +2 -0
- package/dist/components/VButton/VButtonGroup.d.ts +32 -0
- package/dist/components/VButton/VButtonGroup.js +9 -0
- package/dist/components/VButton/VButtonGroup.js.map +1 -0
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCalendar/VCalendar.css +2 -0
- package/dist/components/VCalendar/VCalendar.d.ts +129 -0
- package/dist/components/VCalendar/VCalendar.js +9 -0
- package/dist/components/VCalendar/VCalendar.js.map +1 -0
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +374 -0
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCalendar/VCalendarEvent.css +2 -0
- package/dist/components/VCalendar/VCalendarEvent.d.ts +71 -0
- package/dist/components/VCalendar/VCalendarEvent.js +9 -0
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -0
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCalendar/VCalendarMonth.css +2 -0
- package/dist/components/VCalendar/VCalendarMonth.d.ts +60 -0
- package/dist/components/VCalendar/VCalendarMonth.js +9 -0
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -0
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +342 -0
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCalendar/VCalendarTimeGrid.css +2 -0
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +85 -0
- package/dist/components/VCalendar/VCalendarTimeGrid.js +9 -0
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -0
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +621 -0
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCalendar/VCalendarYear.css +2 -0
- package/dist/components/VCalendar/VCalendarYear.d.ts +31 -0
- package/dist/components/VCalendar/VCalendarYear.js +9 -0
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -0
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCalendar/color.d.ts +9 -0
- package/dist/components/VCalendar/color.js +9 -0
- package/dist/components/VCalendar/color.js.map +1 -0
- package/dist/components/VCalendar/edgeStep.d.ts +38 -0
- package/dist/components/VCalendar/edgeStep.js +28 -0
- package/dist/components/VCalendar/edgeStep.js.map +1 -0
- package/dist/components/VCalendar/keyboard.d.ts +78 -0
- package/dist/components/VCalendar/keyboard.js +86 -0
- package/dist/components/VCalendar/keyboard.js.map +1 -0
- package/dist/components/VCalendar/layout.d.ts +355 -0
- package/dist/components/VCalendar/layout.js +292 -0
- package/dist/components/VCalendar/layout.js.map +1 -0
- package/dist/components/VCalendar/types.d.ts +78 -0
- package/dist/components/VCarousel/VCarousel.css +2 -0
- package/dist/components/VCarousel/VCarousel.d.ts +241 -0
- package/dist/components/VCarousel/VCarousel.js +9 -0
- package/dist/components/VCarousel/VCarousel.js.map +1 -0
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +262 -0
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCarousel/VCarouselItem.d.ts +41 -0
- package/dist/components/VCarousel/VCarouselItem.js +7 -0
- package/dist/components/VCarousel/VCarouselItem.js.map +1 -0
- package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCarousel/context.d.ts +23 -0
- package/dist/components/VCarousel/context.js +6 -0
- package/dist/components/VCarousel/context.js.map +1 -0
- package/dist/components/VCheckbox/VCheckbox.css +2 -0
- package/dist/components/VCheckbox/VCheckbox.d.ts +63 -0
- package/dist/components/VCheckbox/VCheckbox.js +9 -0
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -0
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VChip/VChip.css +2 -0
- package/dist/components/VChip/VChip.d.ts +120 -0
- package/dist/components/VChip/VChip.js +9 -0
- package/dist/components/VChip/VChip.js.map +1 -0
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +118 -0
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCombobox/VCombobox.css +2 -0
- package/dist/components/VCombobox/VCombobox.d.ts +183 -0
- package/dist/components/VCombobox/VCombobox.js +9 -0
- package/dist/components/VCombobox/VCombobox.js.map +1 -0
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +428 -0
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCombobox/VComboboxGroup.css +2 -0
- package/dist/components/VCombobox/VComboboxGroup.d.ts +26 -0
- package/dist/components/VCombobox/VComboboxGroup.js +9 -0
- package/dist/components/VCombobox/VComboboxGroup.js.map +1 -0
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCombobox/VComboboxOption.css +2 -0
- package/dist/components/VCombobox/VComboboxOption.d.ts +48 -0
- package/dist/components/VCombobox/VComboboxOption.js +9 -0
- package/dist/components/VCombobox/VComboboxOption.js.map +1 -0
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCombobox/VComboboxSeparator.css +2 -0
- package/dist/components/VCombobox/VComboboxSeparator.d.ts +3 -0
- package/dist/components/VCombobox/VComboboxSeparator.js +9 -0
- package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -0
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCombobox/infiniteScroll.d.ts +22 -0
- package/dist/components/VCombobox/infiniteScroll.js +28 -0
- package/dist/components/VCombobox/infiniteScroll.js.map +1 -0
- package/dist/components/VDataTable/VDataTable.css +2 -0
- package/dist/components/VDataTable/VDataTable.d.ts +214 -0
- package/dist/components/VDataTable/VDataTable.js +9 -0
- package/dist/components/VDataTable/VDataTable.js.map +1 -0
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +396 -0
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VDateInput/VDateInput.css +2 -0
- package/dist/components/VDateInput/VDateInput.d.ts +152 -0
- package/dist/components/VDateInput/VDateInput.js +9 -0
- package/dist/components/VDateInput/VDateInput.js.map +1 -0
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +324 -0
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VDatePicker/VDatePicker.css +2 -0
- package/dist/components/VDatePicker/VDatePicker.d.ts +143 -0
- package/dist/components/VDatePicker/VDatePicker.js +9 -0
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -0
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +454 -0
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VDatePicker/keyboard.d.ts +56 -0
- package/dist/components/VDatePicker/keyboard.js +26 -0
- package/dist/components/VDatePicker/keyboard.js.map +1 -0
- package/dist/components/VDialog/VDialog.css +2 -0
- package/dist/components/VDialog/VDialog.d.ts +96 -0
- package/dist/components/VDialog/VDialog.js +9 -0
- package/dist/components/VDialog/VDialog.js.map +1 -0
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VDialog/VDialogAlert.d.ts +67 -0
- package/dist/components/VDialog/VDialogAlert.js +7 -0
- package/dist/components/VDialog/VDialogAlert.js.map +1 -0
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFileInput/VFileInput.css +2 -0
- package/dist/components/VFileInput/VFileInput.d.ts +156 -0
- package/dist/components/VFileInput/VFileInput.js +9 -0
- package/dist/components/VFileInput/VFileInput.js.map +1 -0
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFileInput/truncate.d.ts +29 -0
- package/dist/components/VFileInput/truncate.js +10 -0
- package/dist/components/VFileInput/truncate.js.map +1 -0
- package/dist/components/VFilePicker/VFilePicker.css +2 -0
- package/dist/components/VFilePicker/VFilePicker.d.ts +203 -0
- package/dist/components/VFilePicker/VFilePicker.js +9 -0
- package/dist/components/VFilePicker/VFilePicker.js.map +1 -0
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +266 -0
- package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFilePicker/fileKind.d.ts +29 -0
- package/dist/components/VFilePicker/fileKind.js +91 -0
- package/dist/components/VFilePicker/fileKind.js.map +1 -0
- package/dist/components/VHotkeys/VHotkeys.css +2 -0
- package/dist/components/VHotkeys/VHotkeys.d.ts +100 -0
- package/dist/components/VHotkeys/VHotkeys.js +9 -0
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -0
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VHotkeys/platform.d.ts +82 -0
- package/dist/components/VHotkeys/platform.js +115 -0
- package/dist/components/VHotkeys/platform.js.map +1 -0
- package/dist/components/VIcon/VIcon.css +2 -0
- package/dist/components/VIcon/VIcon.d.ts +57 -0
- package/dist/components/VIcon/VIcon.js +9 -0
- package/dist/components/VIcon/VIcon.js.map +1 -0
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VIcon/iconProps.d.ts +30 -0
- package/dist/components/VIcon/iconProps.js +6 -0
- package/dist/components/VIcon/iconProps.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_downward.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_downward.js +9 -0
- package/dist/components/VIcon/icons/arrow_downward.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_downward_alt.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_downward_alt.js +9 -0
- package/dist/components/VIcon/icons/arrow_downward_alt.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_drop_down.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_drop_down.js +9 -0
- package/dist/components/VIcon/icons/arrow_drop_down.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_drop_up.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_drop_up.js +9 -0
- package/dist/components/VIcon/icons/arrow_drop_up.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_left_alt.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_left_alt.js +9 -0
- package/dist/components/VIcon/icons/arrow_left_alt.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_right_alt.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_right_alt.js +9 -0
- package/dist/components/VIcon/icons/arrow_right_alt.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_upward.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_upward.js +9 -0
- package/dist/components/VIcon/icons/arrow_upward.js.map +1 -0
- package/dist/components/VIcon/icons/arrow_upward_alt.d.ts +5 -0
- package/dist/components/VIcon/icons/arrow_upward_alt.js +9 -0
- package/dist/components/VIcon/icons/arrow_upward_alt.js.map +1 -0
- package/dist/components/VIcon/icons/attach_file.d.ts +5 -0
- package/dist/components/VIcon/icons/attach_file.js +9 -0
- package/dist/components/VIcon/icons/attach_file.js.map +1 -0
- package/dist/components/VIcon/icons/audio_file.d.ts +5 -0
- package/dist/components/VIcon/icons/audio_file.js +9 -0
- package/dist/components/VIcon/icons/audio_file.js.map +1 -0
- package/dist/components/VIcon/icons/calendar_today.d.ts +5 -0
- package/dist/components/VIcon/icons/calendar_today.js +9 -0
- package/dist/components/VIcon/icons/calendar_today.js.map +1 -0
- package/dist/components/VIcon/icons/check.d.ts +5 -0
- package/dist/components/VIcon/icons/check.js +9 -0
- package/dist/components/VIcon/icons/check.js.map +1 -0
- package/dist/components/VIcon/icons/check_circle.d.ts +5 -0
- package/dist/components/VIcon/icons/check_circle.js +9 -0
- package/dist/components/VIcon/icons/check_circle.js.map +1 -0
- package/dist/components/VIcon/icons/chevron_left.d.ts +5 -0
- package/dist/components/VIcon/icons/chevron_left.js +9 -0
- package/dist/components/VIcon/icons/chevron_left.js.map +1 -0
- package/dist/components/VIcon/icons/chevron_right.d.ts +5 -0
- package/dist/components/VIcon/icons/chevron_right.js +9 -0
- package/dist/components/VIcon/icons/chevron_right.js.map +1 -0
- package/dist/components/VIcon/icons/close.d.ts +5 -0
- package/dist/components/VIcon/icons/close.js +9 -0
- package/dist/components/VIcon/icons/close.js.map +1 -0
- package/dist/components/VIcon/icons/cloud_upload.d.ts +5 -0
- package/dist/components/VIcon/icons/cloud_upload.js +9 -0
- package/dist/components/VIcon/icons/cloud_upload.js.map +1 -0
- package/dist/components/VIcon/icons/code.d.ts +5 -0
- package/dist/components/VIcon/icons/code.js +9 -0
- package/dist/components/VIcon/icons/code.js.map +1 -0
- package/dist/components/VIcon/icons/description.d.ts +5 -0
- package/dist/components/VIcon/icons/description.js +9 -0
- package/dist/components/VIcon/icons/description.js.map +1 -0
- package/dist/components/VIcon/icons/error.d.ts +5 -0
- package/dist/components/VIcon/icons/error.js +9 -0
- package/dist/components/VIcon/icons/error.js.map +1 -0
- package/dist/components/VIcon/icons/expand_less.d.ts +5 -0
- package/dist/components/VIcon/icons/expand_less.js +9 -0
- package/dist/components/VIcon/icons/expand_less.js.map +1 -0
- package/dist/components/VIcon/icons/expand_more.d.ts +5 -0
- package/dist/components/VIcon/icons/expand_more.js +9 -0
- package/dist/components/VIcon/icons/expand_more.js.map +1 -0
- package/dist/components/VIcon/icons/folder_zip.d.ts +5 -0
- package/dist/components/VIcon/icons/folder_zip.js +9 -0
- package/dist/components/VIcon/icons/folder_zip.js.map +1 -0
- package/dist/components/VIcon/icons/image.d.ts +5 -0
- package/dist/components/VIcon/icons/image.js +9 -0
- package/dist/components/VIcon/icons/image.js.map +1 -0
- package/dist/components/VIcon/icons/index.d.ts +183 -0
- package/dist/components/VIcon/icons/index.js +77 -0
- package/dist/components/VIcon/icons/index.js.map +1 -0
- package/dist/components/VIcon/icons/info.d.ts +5 -0
- package/dist/components/VIcon/icons/info.js +9 -0
- package/dist/components/VIcon/icons/info.js.map +1 -0
- package/dist/components/VIcon/icons/more_horiz.d.ts +5 -0
- package/dist/components/VIcon/icons/more_horiz.js +9 -0
- package/dist/components/VIcon/icons/more_horiz.js.map +1 -0
- package/dist/components/VIcon/icons/names.d.ts +11 -0
- package/dist/components/VIcon/icons/names.js +5 -0
- package/dist/components/VIcon/icons/names.js.map +1 -0
- package/dist/components/VIcon/icons/notifications.d.ts +5 -0
- package/dist/components/VIcon/icons/notifications.js +9 -0
- package/dist/components/VIcon/icons/notifications.js.map +1 -0
- package/dist/components/VIcon/icons/picture_as_pdf.d.ts +5 -0
- package/dist/components/VIcon/icons/picture_as_pdf.js +9 -0
- package/dist/components/VIcon/icons/picture_as_pdf.js.map +1 -0
- package/dist/components/VIcon/icons/schedule.d.ts +5 -0
- package/dist/components/VIcon/icons/schedule.js +9 -0
- package/dist/components/VIcon/icons/schedule.js.map +1 -0
- package/dist/components/VIcon/icons/search.d.ts +5 -0
- package/dist/components/VIcon/icons/search.js +9 -0
- package/dist/components/VIcon/icons/search.js.map +1 -0
- package/dist/components/VIcon/icons/swap_vert.d.ts +5 -0
- package/dist/components/VIcon/icons/swap_vert.js +9 -0
- package/dist/components/VIcon/icons/swap_vert.js.map +1 -0
- package/dist/components/VIcon/icons/table_chart.d.ts +5 -0
- package/dist/components/VIcon/icons/table_chart.js +9 -0
- package/dist/components/VIcon/icons/table_chart.js.map +1 -0
- package/dist/components/VIcon/icons/video_file.d.ts +5 -0
- package/dist/components/VIcon/icons/video_file.js +9 -0
- package/dist/components/VIcon/icons/video_file.js.map +1 -0
- package/dist/components/VIcon/icons/viewBox.d.ts +6 -0
- package/dist/components/VIcon/icons/viewBox.js +6 -0
- package/dist/components/VIcon/icons/viewBox.js.map +1 -0
- package/dist/components/VIcon/icons/warning.d.ts +5 -0
- package/dist/components/VIcon/icons/warning.js +9 -0
- package/dist/components/VIcon/icons/warning.js.map +1 -0
- package/dist/components/VIcon/resolver.d.ts +76 -0
- package/dist/components/VIcon/resolver.js +35 -0
- package/dist/components/VIcon/resolver.js.map +1 -0
- package/dist/components/VIcon/types.d.ts +77 -0
- package/dist/components/VIconButton/VIconButton.css +2 -0
- package/dist/components/VIconButton/VIconButton.d.ts +66 -0
- package/dist/components/VIconButton/VIconButton.js +9 -0
- package/dist/components/VIconButton/VIconButton.js.map +1 -0
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VInput/VInput.css +2 -0
- package/dist/components/VInput/VInput.d.ts +152 -0
- package/dist/components/VInput/VInput.js +9 -0
- package/dist/components/VInput/VInput.js.map +1 -0
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +185 -0
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VInputOTP/VInputOTP.css +2 -0
- package/dist/components/VInputOTP/VInputOTP.d.ts +76 -0
- package/dist/components/VInputOTP/VInputOTP.js +9 -0
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -0
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +149 -0
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenu.d.ts +91 -0
- package/dist/components/VMenu/VMenu.js +7 -0
- package/dist/components/VMenu/VMenu.js.map +1 -0
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenuGroup.css +2 -0
- package/dist/components/VMenu/VMenuGroup.d.ts +22 -0
- package/dist/components/VMenu/VMenuGroup.js +9 -0
- package/dist/components/VMenu/VMenuGroup.js.map +1 -0
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenuItem.css +2 -0
- package/dist/components/VMenu/VMenuItem.d.ts +85 -0
- package/dist/components/VMenu/VMenuItem.js +9 -0
- package/dist/components/VMenu/VMenuItem.js.map +1 -0
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenuPanel.css +2 -0
- package/dist/components/VMenu/VMenuPanel.d.ts +91 -0
- package/dist/components/VMenu/VMenuPanel.js +9 -0
- package/dist/components/VMenu/VMenuPanel.js.map +1 -0
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenuSeparator.css +2 -0
- package/dist/components/VMenu/VMenuSeparator.d.ts +3 -0
- package/dist/components/VMenu/VMenuSeparator.js +9 -0
- package/dist/components/VMenu/VMenuSeparator.js.map +1 -0
- package/dist/components/VMenu/VMenuSeparator.vue_vue_type_script_setup_true_lang.js +13 -0
- package/dist/components/VMenu/VMenuSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/context.d.ts +33 -0
- package/dist/components/VMenu/context.js +9 -0
- package/dist/components/VMenu/context.js.map +1 -0
- package/dist/components/VPagination/VPagination.css +2 -0
- package/dist/components/VPagination/VPagination.d.ts +103 -0
- package/dist/components/VPagination/VPagination.js +9 -0
- package/dist/components/VPagination/VPagination.js.map +1 -0
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +270 -0
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VPopover/VPopover.css +2 -0
- package/dist/components/VPopover/VPopover.d.ts +82 -0
- package/dist/components/VPopover/VPopover.js +9 -0
- package/dist/components/VPopover/VPopover.js.map +1 -0
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VProgressCircular/VProgressCircular.css +2 -0
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +60 -0
- package/dist/components/VProgressCircular/VProgressCircular.js +9 -0
- package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -0
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VProgressLinear/VProgressLinear.css +2 -0
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +74 -0
- package/dist/components/VProgressLinear/VProgressLinear.js +9 -0
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -0
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VRadio/VRadio.css +2 -0
- package/dist/components/VRadio/VRadio.d.ts +58 -0
- package/dist/components/VRadio/VRadio.js +9 -0
- package/dist/components/VRadio/VRadio.js.map +1 -0
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSeparator/VSeparator.css +2 -0
- package/dist/components/VSeparator/VSeparator.d.ts +23 -0
- package/dist/components/VSeparator/VSeparator.js +9 -0
- package/dist/components/VSeparator/VSeparator.js.map +1 -0
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigation.css +2 -0
- package/dist/components/VSideNavigation/VSideNavigation.d.ts +64 -0
- package/dist/components/VSideNavigation/VSideNavigation.js +9 -0
- package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigationGroup.css +2 -0
- package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +33 -0
- package/dist/components/VSideNavigation/VSideNavigationGroup.js +9 -0
- package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigationItem.css +2 -0
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +103 -0
- package/dist/components/VSideNavigation/VSideNavigationItem.js +9 -0
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +154 -0
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSideNavigation/VSideNavigationSeparator.css +2 -0
- package/dist/components/VSideNavigation/VSideNavigationSeparator.d.ts +3 -0
- package/dist/components/VSideNavigation/VSideNavigationSeparator.js +17 -0
- package/dist/components/VSideNavigation/VSideNavigationSeparator.js.map +1 -0
- package/dist/components/VSideNavigation/context.d.ts +37 -0
- package/dist/components/VSideNavigation/context.js +6 -0
- package/dist/components/VSideNavigation/context.js.map +1 -0
- package/dist/components/VSkeletonLoader/VSkeletonLoader.css +2 -0
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +75 -0
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js +9 -0
- package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -0
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSlider/VSlider.css +2 -0
- package/dist/components/VSlider/VSlider.d.ts +82 -0
- package/dist/components/VSlider/VSlider.js +9 -0
- package/dist/components/VSlider/VSlider.js.map +1 -0
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSnackbar/VSnackbar.css +2 -0
- package/dist/components/VSnackbar/VSnackbar.d.ts +51 -0
- package/dist/components/VSnackbar/VSnackbar.js +9 -0
- package/dist/components/VSnackbar/VSnackbar.js.map +1 -0
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSnackbar/state.d.ts +92 -0
- package/dist/components/VSnackbar/state.js +18 -0
- package/dist/components/VSnackbar/state.js.map +1 -0
- package/dist/components/VSpinner/VSpinner.css +2 -0
- package/dist/components/VSpinner/VSpinner.d.ts +21 -0
- package/dist/components/VSpinner/VSpinner.js +9 -0
- package/dist/components/VSpinner/VSpinner.js.map +1 -0
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSwitch/VSwitch.css +2 -0
- package/dist/components/VSwitch/VSwitch.d.ts +46 -0
- package/dist/components/VSwitch/VSwitch.js +9 -0
- package/dist/components/VSwitch/VSwitch.js.map +1 -0
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTabs/VTab.css +2 -0
- package/dist/components/VTabs/VTab.d.ts +42 -0
- package/dist/components/VTabs/VTab.js +9 -0
- package/dist/components/VTabs/VTab.js.map +1 -0
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTabs/VTabPanel.css +2 -0
- package/dist/components/VTabs/VTabPanel.d.ts +34 -0
- package/dist/components/VTabs/VTabPanel.js +9 -0
- package/dist/components/VTabs/VTabPanel.js.map +1 -0
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTabs/VTabs.css +2 -0
- package/dist/components/VTabs/VTabs.d.ts +107 -0
- package/dist/components/VTabs/VTabs.js +9 -0
- package/dist/components/VTabs/VTabs.js.map +1 -0
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +199 -0
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTabs/context.d.ts +43 -0
- package/dist/components/VTabs/context.js +6 -0
- package/dist/components/VTabs/context.js.map +1 -0
- package/dist/components/VTextarea/VTextarea.css +2 -0
- package/dist/components/VTextarea/VTextarea.d.ts +140 -0
- package/dist/components/VTextarea/VTextarea.js +9 -0
- package/dist/components/VTextarea/VTextarea.js.map +1 -0
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTimeInput/VTimeInput.css +2 -0
- package/dist/components/VTimeInput/VTimeInput.d.ts +112 -0
- package/dist/components/VTimeInput/VTimeInput.js +9 -0
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -0
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +385 -0
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTimePicker/VTimePicker.css +2 -0
- package/dist/components/VTimePicker/VTimePicker.d.ts +89 -0
- package/dist/components/VTimePicker/VTimePicker.js +9 -0
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -0
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +257 -0
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VToast/VToast.css +2 -0
- package/dist/components/VToast/VToast.d.ts +24 -0
- package/dist/components/VToast/VToast.js +9 -0
- package/dist/components/VToast/VToast.js.map +1 -0
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VToast/VToaster.css +2 -0
- package/dist/components/VToast/VToaster.d.ts +42 -0
- package/dist/components/VToast/VToaster.js +9 -0
- package/dist/components/VToast/VToaster.js.map +1 -0
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VToast/state.d.ts +74 -0
- package/dist/components/VToast/state.js +25 -0
- package/dist/components/VToast/state.js.map +1 -0
- package/dist/components/VToggle/VToggle.css +2 -0
- package/dist/components/VToggle/VToggle.d.ts +84 -0
- package/dist/components/VToggle/VToggle.js +9 -0
- package/dist/components/VToggle/VToggle.js.map +1 -0
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VToggle/VToggleItem.css +2 -0
- package/dist/components/VToggle/VToggleItem.d.ts +35 -0
- package/dist/components/VToggle/VToggleItem.js +9 -0
- package/dist/components/VToggle/VToggleItem.js.map +1 -0
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VToggle/context.d.ts +37 -0
- package/dist/components/VToggle/context.js +6 -0
- package/dist/components/VToggle/context.js.map +1 -0
- package/dist/components/VTooltip/VTooltip.css +2 -0
- package/dist/components/VTooltip/VTooltip.d.ts +76 -0
- package/dist/components/VTooltip/VTooltip.js +9 -0
- package/dist/components/VTooltip/VTooltip.js.map +1 -0
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTypography/VTypography.css +2 -0
- package/dist/components/VTypography/VTypography.d.ts +46 -0
- package/dist/components/VTypography/VTypography.js +9 -0
- package/dist/components/VTypography/VTypography.js.map +1 -0
- package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useAriaLabel.d.ts +19 -0
- package/dist/composables/useAriaLabel.js +10 -0
- package/dist/composables/useAriaLabel.js.map +1 -0
- package/dist/composables/useFieldIds.d.ts +21 -0
- package/dist/composables/useFieldIds.js +14 -0
- package/dist/composables/useFieldIds.js.map +1 -0
- package/dist/composables/useFieldPanel.d.ts +61 -0
- package/dist/composables/useFieldPanel.js +39 -0
- package/dist/composables/useFieldPanel.js.map +1 -0
- package/dist/composables/useFileDrop.d.ts +30 -0
- package/dist/composables/useFileDrop.js +28 -0
- package/dist/composables/useFileDrop.js.map +1 -0
- package/dist/composables/useFileField.d.ts +36 -0
- package/dist/composables/useFileField.js +45 -0
- package/dist/composables/useFileField.js.map +1 -0
- package/dist/composables/useFocusoutDismiss.d.ts +17 -0
- package/dist/composables/useFocusoutDismiss.js +11 -0
- package/dist/composables/useFocusoutDismiss.js.map +1 -0
- package/dist/composables/useIconClickHandlers.d.ts +27 -0
- package/dist/composables/useIconClickHandlers.js +13 -0
- package/dist/composables/useIconClickHandlers.js.map +1 -0
- package/dist/composables/useMaskedField.d.ts +65 -0
- package/dist/composables/useMaskedField.js +54 -0
- package/dist/composables/useMaskedField.js.map +1 -0
- package/dist/composables/usePopover.d.ts +7 -0
- package/dist/composables/usePopover.js +24 -0
- package/dist/composables/usePopover.js.map +1 -0
- package/dist/composables/useProgressValue.d.ts +13 -0
- package/dist/composables/useProgressValue.js +14 -0
- package/dist/composables/useProgressValue.js.map +1 -0
- package/dist/composables/useRootAttrs.d.ts +34 -0
- package/dist/composables/useRootAttrs.js +15 -0
- package/dist/composables/useRootAttrs.js.map +1 -0
- package/dist/composables/useTextLimit.d.ts +31 -0
- package/dist/composables/useTextLimit.js +19 -0
- package/dist/composables/useTextLimit.js.map +1 -0
- package/dist/composables/useTimer.d.ts +18 -0
- package/dist/composables/useTimer.js +19 -0
- package/dist/composables/useTimer.js.map +1 -0
- package/dist/i18n/en.d.ts +10 -0
- package/dist/i18n/en.js +179 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/fr.d.ts +18 -0
- package/dist/i18n/fr.js +179 -0
- package/dist/i18n/fr.js.map +1 -0
- package/dist/i18n/state.d.ts +64 -0
- package/dist/i18n/state.js +40 -0
- package/dist/i18n/state.js.map +1 -0
- package/dist/i18n/types.d.ts +345 -0
- package/dist/icons.d.ts +16 -0
- package/dist/icons.js +38 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.js +64 -0
- package/dist/styles.css +1 -0
- package/dist/tokens/css.d.ts +25 -0
- package/dist/tokens/css.js +29 -0
- package/dist/tokens/css.js.map +1 -0
- package/dist/tokens/index.d.ts +370 -0
- package/dist/tokens/index.js +15 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/primitives.d.ts +101 -0
- package/dist/tokens/primitives.js +166 -0
- package/dist/tokens/primitives.js.map +1 -0
- package/dist/tokens/semantic.d.ts +236 -0
- package/dist/tokens/semantic.js +219 -0
- package/dist/tokens/semantic.js.map +1 -0
- package/dist/tokens/themes/dark.d.ts +49 -0
- package/dist/tokens/themes/dark.js +53 -0
- package/dist/tokens/themes/dark.js.map +1 -0
- package/dist/tokens/types.d.ts +38 -0
- package/dist/tokens/types.js +16 -0
- package/dist/tokens/types.js.map +1 -0
- package/dist/tokens.json +1516 -0
- package/dist/utils/array.d.ts +10 -0
- package/dist/utils/array.js +8 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/arrowNav.d.ts +27 -0
- package/dist/utils/arrowNav.js +26 -0
- package/dist/utils/arrowNav.js.map +1 -0
- package/dist/utils/chip.d.ts +26 -0
- package/dist/utils/chip.js +13 -0
- package/dist/utils/chip.js.map +1 -0
- package/dist/utils/css.d.ts +19 -0
- package/dist/utils/css.js +13 -0
- package/dist/utils/css.js.map +1 -0
- package/dist/utils/date.d.ts +199 -0
- package/dist/utils/date.js +225 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/direction.d.ts +18 -0
- package/dist/utils/direction.js +8 -0
- package/dist/utils/direction.js.map +1 -0
- package/dist/utils/env.d.ts +10 -0
- package/dist/utils/file.d.ts +95 -0
- package/dist/utils/file.js +70 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/focus.d.ts +24 -0
- package/dist/utils/focus.js +13 -0
- package/dist/utils/focus.js.map +1 -0
- package/dist/utils/matcher.d.ts +13 -0
- package/dist/utils/matcher.js +11 -0
- package/dist/utils/matcher.js.map +1 -0
- package/dist/utils/number.d.ts +9 -0
- package/dist/utils/number.js +8 -0
- package/dist/utils/number.js.map +1 -0
- package/dist/utils/text.d.ts +19 -0
- package/dist/utils/text.js +12 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/time.d.ts +138 -0
- package/dist/utils/time.js +123 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/vnode.d.ts +21 -0
- package/dist/utils/vnode.js +14 -0
- package/dist/utils/vnode.js.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.js","names":[],"sources":["../../src/utils/date.ts"],"sourcesContent":["// @ssr @core — module-wide: every export below is @core unless tagged otherwise.\n/**\n * The date arithmetic behind VDatePicker and VDateInput, written as pure functions:\n * they read nothing outside their arguments and change nothing around them.\n *\n * The whole module speaks one language, the ISO `YYYY-MM-DD` string, and computes\n * everything in the reader's LOCAL time. Two shortcuts are therefore banned\n * throughout: `new Date('YYYY-MM-DD')`, which the language interprets as UTC and\n * which consequently lands on the previous or the next day depending on the time\n * zone, and `toISOString()`, which formats in UTC for the same reason. `Date`\n * objects exist here only as an intermediate step, built with `new Date(y, m, d)` —\n * local midnight — and turned back into text by concatenation.\n *\n * The names of months and days come from `Intl`, which is available on the server as\n * well as in the browser. They are formatted from REFERENCE dates pinned to\n * `timeZone: 'UTC'`, so that the resulting label never depends on the time zone of\n * the machine doing the rendering.\n */\n\nimport { digitsOf, pad2 } from './text'\n\nconst ISO_RE = /^\\d{4}-\\d{2}-\\d{2}$/\n\n/**\n * Tells whether a value is a real `YYYY-MM-DD` date. The shape alone is not enough:\n * `2026-02-31` matches the pattern, so the check goes through a parse and a\n * reformat, and only a value that survives the round trip unchanged is accepted.\n */\nexport function isValidISO(iso: unknown): iso is string {\n if (typeof iso !== 'string' || !ISO_RE.test(iso)) return false\n const d = parseISO(iso)\n return d !== null && formatISO(d) === iso\n}\n\n/**\n * Turns an ISO string into a `Date` set at local midnight, or returns `null` when\n * the string is not one. Every caller here has to handle that `null`: the bounds a\n * consumer passes are raw strings and may be anything.\n */\nexport function parseISO(iso: string | null | undefined): Date | null {\n if (typeof iso !== 'string' || !ISO_RE.test(iso)) return null\n const parts = iso.split('-')\n const date = new Date(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]))\n return Number.isNaN(date.getTime()) ? null : date\n}\n\n/**\n * Writes a `Date` as an ISO string, reading its LOCAL components. This manual\n * concatenation is what `toISOString()` cannot do, since that one formats in UTC.\n */\nexport function formatISO(date: Date): string {\n return `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`\n}\n\n/**\n * Builds an ISO string from separate values. The month is 0-indexed, as everywhere\n * in the language: 0 is January.\n */\nexport function isoOf(year: number, month0: number, day: number): string {\n return formatISO(new Date(year, month0, day))\n}\n\n/**\n * Moves a date by a number of days, forwards or backwards. Crossing into another\n * month or year is handled by `Date` itself.\n */\nexport function addDays(iso: string, n: number): string {\n const d = parseISO(iso)\n if (!d) return iso\n d.setDate(d.getDate() + n)\n return formatISO(d)\n}\n\n/**\n * Moves a date by a number of months, keeping the day of the month where possible.\n * When the target month is too short the day is brought back to its last one: 31\n * January plus one month gives 28 or 29 February, and never spills over into March\n * the way a naive addition would.\n */\nexport function addMonths(iso: string, n: number): string {\n const d = parseISO(iso)\n if (!d) return iso\n const day = d.getDate()\n d.setDate(1)\n d.setMonth(d.getMonth() + n)\n d.setDate(Math.min(day, daysInMonth(d.getFullYear(), d.getMonth())))\n return formatISO(d)\n}\n\n/**\n * How many days the given month holds, leap years included. Day 0 of the following\n * month is the last day of this one, which is what makes the leap year rule the\n * language's problem rather than ours.\n */\nexport function daysInMonth(year: number, month0: number): number {\n return new Date(year, month0 + 1, 0).getDate()\n}\n\n/**\n * Compares two dates chronologically, returning the usual -1, 0 or 1. Because the\n * `YYYY-MM-DD` format puts its most significant part first, comparing the strings as\n * text already gives the chronological order: no parsing is needed.\n */\nexport function compareISO(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n/**\n * Whether two dates are the same day, with a null on either side counting as no\n * date at all rather than as a match.\n */\nexport const isSameISO = (a: string | null, b: string | null) => !!a && a === b\n\n/**\n * Brings a date back inside the allowed interval, returning the bound it exceeded.\n * Both bounds are optional, and an absent one means unbounded on that side.\n */\nexport function clampISO(iso: string, min?: string, max?: string): string {\n if (min && compareISO(iso, min) < 0) return min\n if (max && compareISO(iso, max) > 0) return max\n return iso\n}\n\n/** Whether a date falls inside the allowed interval, each bound being optional. */\nexport function isWithin(iso: string, min?: string, max?: string): boolean {\n if (min && compareISO(iso, min) < 0) return false\n if (max && compareISO(iso, max) > 0) return false\n return true\n}\n\n/** One square of a month grid. */\nexport interface MonthCell {\n /** The day it stands for, as an ISO `YYYY-MM-DD` string. */\n iso: string\n /**\n * Which side of the displayed month this day belongs to when it is not part of it,\n * and `null` when it is.\n */\n adjacent: 'prev' | 'next' | null\n}\n\n/**\n * Builds the grid of a month: 42 cells, six rows of seven, filled out at both ends\n * with the days of the neighbouring months. The count is fixed on purpose, so that\n * the calendar keeps the same height from one month to the next instead of jumping\n * by a row. `firstDayOfWeek` runs from 0 for Sunday to 6 for Saturday.\n */\nexport function buildMonthGrid(year: number, month0: number, firstDayOfWeek: number): MonthCell[] {\n const first = new Date(year, month0, 1)\n // How many cells the 1st of the month sits after the start of its row, which is\n // exactly how many days of the previous month the grid has to open with.\n const offset = (first.getDay() - firstDayOfWeek + 7) % 7\n const cells: MonthCell[] = []\n const start = new Date(year, month0, 1 - offset)\n for (let i = 0; i < 42; i++) {\n const d = new Date(start.getFullYear(), start.getMonth(), start.getDate() + i)\n const adjacent =\n d.getMonth() === month0 && d.getFullYear() === year\n ? null\n : compareISO(formatISO(d), formatISO(first)) < 0\n ? 'prev'\n : 'next'\n cells.push({ iso: formatISO(d), adjacent })\n }\n return cells\n}\n\n// @fallback @ssr\n/**\n * The day the week starts on in a given locale, from 0 for Sunday to 6 for Saturday\n * — Sunday in the United States, Monday in most of Europe, Saturday in much of the\n * Middle East. It comes from `Intl.Locale`, whose own numbering runs from 1 for\n * Monday to 7 for Sunday.\n *\n * That part of `Intl` is not everywhere (some Node builds lack it), so the answer\n * falls back to Monday when it is missing. A component can always override the\n * result with its `firstDayOfWeek` prop.\n */\nconst firstDayCache = new Map<string, number>()\n\nexport function firstDayOfWeekFor(locale: string): number {\n const cached = firstDayCache.get(locale)\n if (cached !== undefined) return cached\n const first = resolveFirstDayOfWeek(locale)\n firstDayCache.set(locale, first)\n return first\n}\n\nfunction resolveFirstDayOfWeek(locale: string): number {\n try {\n // Implementations disagree on the shape: Chrome and Safari expose `weekInfo` as\n // a getter, others a `getWeekInfo()` method. Both are tried.\n const loc = new Intl.Locale(locale) as Intl.Locale & {\n weekInfo?: { firstDay: number }\n getWeekInfo?: () => { firstDay: number }\n }\n const info = loc.getWeekInfo?.() ?? loc.weekInfo\n if (info?.firstDay) return info.firstDay % 7 // brings Sunday, their 7, back to 0\n } catch {\n /* an invalid locale throws a RangeError: fall through to the fallback */\n }\n return 1 // Monday\n}\n\n// The reference instants the names are formatted from. Any Sunday will do for the\n// weekdays, and any year for the months; combined with `timeZone: 'UTC'` at every\n// call site, they pin the output whatever zone the machine is in.\nconst REF_SUNDAY = Date.UTC(2021, 7, 1) // 1 August 2021 fell on a Sunday\nconst MS_DAY = 86_400_000\n\n/**\n * The names of the seven days, starting from `firstDayOfWeek` so the list can be\n * dropped straight into a calendar header.\n */\nexport function weekdayNames(\n locale: string,\n firstDayOfWeek: number,\n weekday: 'narrow' | 'short' | 'long' = 'short',\n): string[] {\n const fmt = new Intl.DateTimeFormat(locale, { weekday, timeZone: 'UTC' })\n return Array.from({ length: 7 }, (_, i) =>\n fmt.format(REF_SUNDAY + ((firstDayOfWeek + i) % 7) * MS_DAY),\n )\n}\n\n/** The names of the twelve months, in January-to-December order. */\nexport function monthNames(locale: string, month: 'long' | 'short' = 'long'): string[] {\n const fmt = new Intl.DateTimeFormat(locale, { month, timeZone: 'UTC' })\n return Array.from({ length: 12 }, (_, i) => fmt.format(Date.UTC(2021, i, 1)))\n}\n\n/**\n * Month names shortened for the picker's narrow cells: a name of four characters or\n * fewer is kept whole (\"May\", \"June\", \"July\"), a longer one is cut to three\n * characters followed by a dot (\"January\" becomes \"Jan.\"). The name is spread with\n * `[...n]` rather than indexed, so that an accented or non-Latin character counts as\n * one character and is never cut in half.\n */\nexport function monthNamesCompact(locale: string): string[] {\n return monthNames(locale, 'long').map((n) => {\n const chars = [...n]\n return chars.length <= 4 ? n : chars.slice(0, 3).join('') + '.'\n })\n}\n\n/**\n * One formatter kept per locale and set of options, for the lifetime of the module —\n * the same `formatterFor` idiom as in `utils/file.ts` and `utils/time.ts`.\n *\n * Building an `Intl.DateTimeFormat` costs one to two orders of magnitude more than\n * using one, and the three functions below are called ONE VALUE AT A TIME: VDateInput\n * formats a multiple selection inside a `.map`, so a fresh formatter would be built\n * for every date. `weekdayNames` and `monthNames` already hoist theirs out of their\n * loop; this cache gives the per-call functions the same property.\n *\n * The options object is part of the cache key. `JSON.stringify` is stable enough\n * here — these objects are literals written by the components, not data coming from\n * a user — and costs a fraction of a construction.\n */\nconst formatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction formatterFor(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n const key = `${locale}|${JSON.stringify(options)}`\n let formatter = formatters.get(key)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, options)\n formatters.set(key, formatter)\n }\n return formatter\n}\n\n/** The name of one month, 0 being January. */\nexport function monthName(\n locale: string,\n month0: number,\n month: 'long' | 'short' = 'long',\n): string {\n return formatterFor(locale, { month, timeZone: 'UTC' }).format(Date.UTC(2021, month0, 1))\n}\n\n/**\n * A date written out for the reader, in the conventions of their locale — this is\n * what VDateInput shows in its field. An unparsable date yields an empty string\n * rather than a broken one.\n */\nexport function formatDisplay(\n iso: string,\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): string {\n const d = parseISO(iso)\n return d ? formatterFor(locale, options).format(d) : ''\n}\n\n/**\n * A period written out for the reader. `Intl`'s own `formatRange` is what factors\n * out the parts the two dates share, giving \"19–26 June 2026\" rather than the two\n * full dates side by side. A period of a single day is formatted as that one date.\n */\nexport function formatDisplayRange(\n start: string,\n end: string,\n locale: string,\n options: Intl.DateTimeFormatOptions,\n): string {\n const a = parseISO(start)\n const b = parseISO(end)\n if (!a || !b) return ''\n const fmt = formatterFor(locale, options)\n return compareISO(start, end) === 0 ? fmt.format(a) : fmt.formatRange(a, b)\n}\n\n/*\n * The numeric input mask, used by VDateInput when its field can be typed into.\n *\n * A field being typed into never shows the long display format — \"10 June 2026\" is\n * not something one can type — but a purely numeric mask instead. The order of the\n * three fields and the separator between them are DERIVED from the locale rather\n * than hardcoded, which is what makes the same field work for a reader in Tokyo and\n * one in Chicago.\n */\n\nexport type DateMaskField = 'day' | 'month' | 'year'\n\n/** Everything a locale decides about how a date is typed. */\nexport interface DateMask {\n /**\n * The order the three fields appear in: day, month, year in the United Kingdom,\n * month, day, year in the United States, year, month, day in Japan.\n */\n order: readonly DateMaskField[]\n /** The single character between two fields, stripped of bidi marks and spaces. */\n separator: string\n /** How many digits each field takes, in the same order: 4 for the year, 2 otherwise. */\n lengths: readonly number[]\n /** How many digits the complete mask holds, which is always 8. */\n size: number\n}\n\nconst MASK_FALLBACK: DateMask = {\n order: ['day', 'month', 'year'],\n separator: '/',\n lengths: [2, 2, 4],\n size: 8,\n}\n\n/**\n * The date the mask is read from: 22 November 2021. Its three numbers all differ, so\n * whichever order the locale prints them in, each one can be told apart.\n */\nconst REF_MASK_DATE = Date.UTC(2021, 10, 22)\n\n/** The invisible direction marks some locales insert, such as U+200F before \"/\" in ar-EG. */\nconst BIDI_MARKS = /[]/g\n\n/**\n * Works out how a date is typed in a given locale, by formatting a known date and\n * looking at what came out.\n *\n * The calendar and the numbering system are FORCED to Gregorian and Latin digits.\n * Without that, `fa-IR` answers with a Persian year (1400 rather than 2021) and\n * `ar-EG` with Arabic-Indic digits — two things a numeric field could neither\n * display nor read back. An invalid locale throws, and the answer then falls back to\n * day/month/year separated by \"/\".\n */\nconst maskCache = new Map<string, DateMask>()\n\nexport function dateMaskFor(locale: string): DateMask {\n const cached = maskCache.get(locale)\n if (cached) return cached\n const mask = buildDateMask(locale)\n maskCache.set(locale, mask)\n return mask\n}\n\n/*\n * TRAP — the returned `DateMask` is SHARED between every caller for a locale, so it must be\n * treated as read-only. Nothing mutates it today (it is read field by field in\n * `formatDateMask`, `parseDateMask` and `maskPlaceholder`), and it is the same contract the\n * memoized `Intl` formatters in this file already have.\n */\nfunction buildDateMask(locale: string): DateMask {\n try {\n const parts = new Intl.DateTimeFormat(locale, {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n timeZone: 'UTC',\n calendar: 'gregory',\n numberingSystem: 'latn',\n }).formatToParts(REF_MASK_DATE)\n\n const order = parts\n .map((p) => p.type)\n .filter((t): t is DateMaskField => t === 'day' || t === 'month' || t === 'year')\n\n // The separator is the first literal appearing AFTER the first field, and not\n // simply the first literal: Hungarian and Korean end the whole format with a dot\n // (\"2021. 11. 22.\"), which must not be mistaken for it.\n const firstField = parts.findIndex((p) => p.type !== 'literal')\n const separator = parts\n .slice(firstField)\n .find((p) => p.type === 'literal')\n ?.value.replace(BIDI_MARKS, '')\n .trim()\n\n if (order.length === 3 && separator) {\n const lengths = order.map((f) => (f === 'year' ? 4 : 2))\n return { order, separator, lengths, size: 8 }\n }\n } catch {\n /* an invalid locale throws a RangeError: fall through to the fallback */\n }\n return MASK_FALLBACK\n}\n\n/**\n * Lays a run of digits out as masked text. The separator appears AS SOON AS the field\n * before it is full — typing \"22\" already gives \"22/\" — so the reader sees their\n * progress without ever having to type a separator themselves.\n *\n * This has a consequence the component must honour: pressing Backspace on such a\n * separator has to delete the DIGIT before it. Deleting the separator alone would\n * see the mask write it straight back, and the key would look dead.\n */\nexport function formatDateMask(digits: string, mask: DateMask): string {\n const all = digitsOf(digits).slice(0, mask.size)\n let out = ''\n let i = 0\n for (let f = 0; f < mask.lengths.length; f++) {\n const len = mask.lengths[f] as number\n const chunk = all.slice(i, i + len)\n if (!chunk) break\n out += chunk\n i += len\n if (chunk.length < len) break // this field is still being typed: no separator yet\n if (f < mask.lengths.length - 1) out += mask.separator\n }\n return out\n}\n\n/**\n * Writes an ISO date in the mask of the locale, ready to be put in the field: the\n * same day reads \"10/06/2026\" in London and \"06/10/2026\" in Chicago.\n */\nexport function isoToMask(iso: string, mask: DateMask): string {\n if (!isValidISO(iso)) return ''\n const [year, month, day] = iso.split('-') as [string, string, string]\n const by: Record<DateMaskField, string> = { year, month, day }\n return formatDateMask(mask.order.map((f) => by[f]).join(''), mask)\n}\n\nexport interface ParseMaskOptions {\n /**\n * The century a two-digit year is expanded into: with 2000, \"10/06/26\" is read as\n * 2026. It is only accepted when the year is the LAST field of the mask, since\n * elsewhere the following separator already tells the two apart.\n *\n * Leaving it out refuses any year shorter than four digits, and that is the mode\n * used while the reader types — so that \"26\", passed through on the way to \"2026\",\n * is never committed as a year of its own.\n */\n yearPivot?: number\n}\n\n/**\n * Reads masked text back into an ISO date, or returns `null` when the text is\n * incomplete, holds too many digits, or names a day that does not exist — 31\n * February passes every length check and is caught by the round trip `isValidISO`\n * performs.\n *\n * Whether the resulting date is allowed is a different question: the `min`/`max`\n * bounds and the disabled dates belong to the component, and this function knows\n * nothing about props.\n */\nexport function parseDateMask(\n text: string,\n mask: DateMask,\n options: ParseMaskOptions = {},\n): string | null {\n const digits = digitsOf(text)\n const by: Partial<Record<DateMaskField, string>> = {}\n let i = 0\n for (let k = 0; k < mask.order.length; k++) {\n const field = mask.order[k] as DateMaskField\n const len = mask.lengths[k] as number\n const chunk = digits.slice(i, i + len)\n if (chunk.length === len) i += len\n else if (\n field === 'year' &&\n options.yearPivot !== undefined &&\n k === mask.order.length - 1 &&\n chunk.length === 2\n )\n i += 2\n else return null\n by[field] = chunk\n }\n if (i !== digits.length) return null // digits are left over: the entry is too long\n const year =\n (by.year as string).length === 2\n ? String((options.yearPivot as number) + Number(by.year))\n : (by.year as string)\n const iso = `${year}-${by.month}-${by.day}`\n return isValidISO(iso) ? iso : null\n}\n\n/**\n * Where the caret has to go to sit just after the nth digit. Counting digits is the\n * only landmark that survives a reformat: an absolute position jumps by one the\n * moment a separator appears or disappears, so restoring it would leave the caret in\n * the wrong place on exactly the keystrokes that matter.\n *\n * When a separator is passed and it directly follows that position, the caret steps\n * over it: while typing, it must land in the NEXT field rather than in front of a\n * separator that has just been written. On deletion the argument is omitted, so the\n * caret stays before it and the next Backspace reaches the digit.\n */\nexport function caretAfterDigits(text: string, n: number, separator?: string): number {\n let pos = 0\n if (n > 0) {\n pos = text.length\n let seen = 0\n for (let i = 0; i < text.length; i++) {\n const code = text.charCodeAt(i)\n if (code >= 48 && code <= 57 && ++seen === n) {\n pos = i + 1\n break\n }\n }\n }\n if (separator && text.startsWith(separator, pos)) pos += separator.length\n return pos\n}\n\nconst PLACEHOLDER_FALLBACK: Record<DateMaskField, string> = { day: 'd', month: 'm', year: 'y' }\n\n/**\n * Ideographic scripts, which are excluded from the placeholder: a repeated \"日\" does\n * not read as a template the way a repeated letter does.\n */\nconst IDEOGRAPHIC = /[\\p{sc=Han}\\p{sc=Hangul}\\p{sc=Hiragana}\\p{sc=Katakana}]/u\n\n// @fallback\n/**\n * The empty template shown in the field: \"dd/mm/yyyy\" in English, \"jj/mm/aaaa\" in\n * French, \"tt.mm.jjjj\" in German, \"дд/мм/гггг\" in Russian.\n *\n * Each letter is the first letter of the field's own name in that language, taken\n * from `Intl.DisplayNames` — which lands on the attested convention of every\n * alphabetic script without a table to maintain. It falls back to the Latin letters\n * when that part of `Intl` is missing, or when the script is ideographic and the\n * repetition would mean nothing.\n */\nexport function maskPlaceholder(locale: string, mask: DateMask): string {\n const letters = placeholderLetters(locale)\n return mask.order.map((f, k) => letters[f].repeat(mask.lengths[k] as number)).join(mask.separator)\n}\n\n/**\n * The three letters a locale writes its date fields with, worked out once per locale.\n *\n * It is the LETTERS that are cached and not the finished placeholder, because the result\n * also depends on the mask handed in — caching the string would be wrong the moment a\n * caller passes a mask that is not `dateMaskFor(locale)`. All of the cost is here anyway:\n * `Intl.DisplayNames` is the most expensive constructor in this file by an order of\n * magnitude (measured at ~0.22 ms a call, against ~0.07 for `dateMaskFor`), and the string\n * assembly below it is a handful of `repeat` calls.\n */\nconst placeholderLetterCache = new Map<string, typeof PLACEHOLDER_FALLBACK>()\n\nfunction placeholderLetters(locale: string): typeof PLACEHOLDER_FALLBACK {\n const cached = placeholderLetterCache.get(locale)\n if (cached) return cached\n\n const letters = { ...PLACEHOLDER_FALLBACK }\n try {\n const names = new Intl.DisplayNames(locale, { type: 'dateTimeField' })\n for (const field of ['day', 'month', 'year'] as const) {\n const first = [...(names.of(field) ?? '')][0]\n if (first && /\\p{L}/u.test(first) && !IDEOGRAPHIC.test(first))\n letters[field] = first.toLocaleLowerCase(locale)\n }\n } catch {\n /* Intl.DisplayNames is unavailable here: keep the Latin letters */\n }\n placeholderLetterCache.set(locale, letters)\n return letters\n}\n"],"mappings":";;AAqBA,IAAM,IAAS;AAOf,SAAgB,EAAW,GAA6B;CACtD,IAAI,OAAO,KAAQ,YAAY,CAAC,EAAO,KAAK,CAAG,GAAG,OAAO;CACzD,IAAM,IAAI,EAAS,CAAG;CACtB,OAAO,MAAM,QAAQ,EAAU,CAAC,MAAM;AACxC;AAOA,SA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AC;GAC3C,AAAI,KAAS,SAAS,KAAK,CAAK,KAAK,CAAC,EAAY,KAAK,CAAK,MAC1D,EAAQ,KAAS,EAAM,kBAAkB,CAAM;EACnD;CACF,QAAQ,CAER;CAEA,OADA,EAAuB,IAAI,GAAQ,CAAO,GACnC;AACT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether an element is laid out right to left.
|
|
3
|
+
*
|
|
4
|
+
* The design system does almost everything in LOGICAL properties, which mirror themselves
|
|
5
|
+
* and need no help. This exists for the handful of places that cannot: a key name
|
|
6
|
+
* (`ArrowRight`), a pointer coordinate and a scroll delta are all PHYSICAL, so the code
|
|
7
|
+
* reading them has to know which way the inline axis runs before it can decide what
|
|
8
|
+
* "forward" means.
|
|
9
|
+
*
|
|
10
|
+
* It reads the COMPUTED direction rather than the `dir` attribute on purpose: `dir` may sit
|
|
11
|
+
* on any ancestor, or come from a stylesheet, and only the computed value accounts for both.
|
|
12
|
+
* That read forces a style recalculation, so callers ask at event time — never in a render
|
|
13
|
+
* or a loop.
|
|
14
|
+
*
|
|
15
|
+
* A null element answers `false`: a component whose ref is not set yet has nothing laid out,
|
|
16
|
+
* and left to right is the assumption the rest of the code already makes.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isRtl(el: Element | null | undefined): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direction.js","names":[],"sources":["../../src/utils/direction.ts"],"sourcesContent":["// @core\n/**\n * Whether an element is laid out right to left.\n *\n * The design system does almost everything in LOGICAL properties, which mirror themselves\n * and need no help. This exists for the handful of places that cannot: a key name\n * (`ArrowRight`), a pointer coordinate and a scroll delta are all PHYSICAL, so the code\n * reading them has to know which way the inline axis runs before it can decide what\n * \"forward\" means.\n *\n * It reads the COMPUTED direction rather than the `dir` attribute on purpose: `dir` may sit\n * on any ancestor, or come from a stylesheet, and only the computed value accounts for both.\n * That read forces a style recalculation, so callers ask at event time — never in a render\n * or a loop.\n *\n * A null element answers `false`: a component whose ref is not set yet has nothing laid out,\n * and left to right is the assumption the rest of the code already makes.\n */\nexport function isRtl(el: Element | null | undefined): boolean {\n return el != null && getComputedStyle(el).direction === 'rtl'\n}\n"],"mappings":";AAkBA,SAAgB,EAAM,GAAyC;CAC7D,OAAO,KAAM,QAAQ,iBAAiB,CAAE,CAAC,CAAC,cAAc;AAC1D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the library is running in a development build. It is what the design system's
|
|
3
|
+
* warnings are gated on — an icon-only button with no name, two options that contradict
|
|
4
|
+
* each other — so that none of them reaches a finished application.
|
|
5
|
+
*
|
|
6
|
+
* The flag comes from the build tool the library is developed with, and it is looked up
|
|
7
|
+
* cautiously: an application built with a different tool may not provide it at all, and
|
|
8
|
+
* every warning then simply stays silent rather than failing.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isDev: boolean;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the design system has to decide about a file the browser hands it, before
|
|
3
|
+
* that file is accepted: is it of a kind we asked for, how do we write its size out, and
|
|
4
|
+
* which of a batch may come in.
|
|
5
|
+
*
|
|
6
|
+
* The three are grouped because they are about the same SUBJECT, not because they share
|
|
7
|
+
* any code — the same arrangement as the text helpers.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here knows anything about components, which is what gives the screening its
|
|
10
|
+
* shape: it HANDS BACK the files it refused instead of announcing them. One body then
|
|
11
|
+
* serves a component that reports refusals one at a time and a test that reads them all
|
|
12
|
+
* as a list.
|
|
13
|
+
*/
|
|
14
|
+
/** All the matching needs of a file, so that a test does not have to counterfeit one. */
|
|
15
|
+
export interface FileCandidate {
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decides whether a file is one of the kinds a component said it would take.
|
|
21
|
+
*
|
|
22
|
+
* The list of accepted kinds is written exactly as HTML has always written it, and it
|
|
23
|
+
* admits three forms: an extension such as ".pdf", regardless of capitals; a whole family
|
|
24
|
+
* such as "image/*"; or one precise kind. Saying nothing at all accepts everything, which
|
|
25
|
+
* is what saying nothing has always meant.
|
|
26
|
+
*
|
|
27
|
+
* The reason this exists in code rather than being left to the browser is that the
|
|
28
|
+
* browser only applies that list to the dialog it opens. A file DROPPED onto the page
|
|
29
|
+
* goes around it entirely and arrives untouched. Without this second reading, dropping
|
|
30
|
+
* would smuggle in anything at all past a restriction the consumer believes is being
|
|
31
|
+
* enforced.
|
|
32
|
+
*
|
|
33
|
+
* TRAP — the kind of a file is the BROWSER's guess, and it is often simply empty: an
|
|
34
|
+
* extension it has never heard of, or certain Linux setups. A list written only in terms
|
|
35
|
+
* of kinds then turns away a perfectly good file, which is why the documentation asks for
|
|
36
|
+
* extensions to be spelled out alongside them — "image/*,.heic" rather than "image/*" on
|
|
37
|
+
* its own.
|
|
38
|
+
*/
|
|
39
|
+
export declare function matchesAccept(file: FileCandidate, accept?: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Writes a size out the way a reader expects to see it: 1 200 000 becomes "1.2 MB" in
|
|
42
|
+
* English and "1,2 Mo" in French.
|
|
43
|
+
*
|
|
44
|
+
* The design system's rule about language applies here unchanged. The FORM comes from the
|
|
45
|
+
* browser, which already knows the unit in every language and where the decimal mark
|
|
46
|
+
* goes; only the WORDS around it come from the dictionary. Nothing in this function is
|
|
47
|
+
* translatable.
|
|
48
|
+
*
|
|
49
|
+
* A kilobyte is a thousand bytes, and each rung of the ladder is a thousand of the one
|
|
50
|
+
* below. That is exactly what the unit names the browser prints mean. Using the other,
|
|
51
|
+
* computing convention of 1024 would have a file of 1024 bytes shown as "1.02 kB" — a
|
|
52
|
+
* discrepancy no reader could explain to themselves.
|
|
53
|
+
*
|
|
54
|
+
* A size that is negative, or not a number at all, is treated as nothing rather than
|
|
55
|
+
* producing nonsense. The number comes straight from the file, and a size shown beside a
|
|
56
|
+
* name must never be the thing that breaks.
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatBytes(bytes: number, locale: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Why a file was turned away. Each component declares its own public name for this: a
|
|
61
|
+
* type belongs to the component that exposes it, and nothing in here is public.
|
|
62
|
+
*/
|
|
63
|
+
export type FileRejectReason = 'type' | 'size' | 'count' | 'total-size';
|
|
64
|
+
export interface FileRejection {
|
|
65
|
+
file: File;
|
|
66
|
+
reason: FileRejectReason;
|
|
67
|
+
}
|
|
68
|
+
export interface FileLimits {
|
|
69
|
+
accept?: string;
|
|
70
|
+
/** How large ONE file may be, in bytes. */
|
|
71
|
+
maxSize?: number;
|
|
72
|
+
/** Already settled by the caller: a field that takes a single file passes one. */
|
|
73
|
+
maxFiles?: number;
|
|
74
|
+
maxTotalSize?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Sorts an arriving batch of files into those that may come in and those that may not,
|
|
78
|
+
* given what has already been chosen.
|
|
79
|
+
*
|
|
80
|
+
* The checks run in the order a reader can act on. A file of the wrong KIND is reported
|
|
81
|
+
* as such even when it is also too big, because being told to shrink a file that would
|
|
82
|
+
* never have been accepted anyway is worse than useless.
|
|
83
|
+
*
|
|
84
|
+
* Nothing is set aside for being chosen twice. There is no reliable way to tell one file
|
|
85
|
+
* from another — two files in different folders may perfectly well share a name — so
|
|
86
|
+
* "already chosen" is deliberately not one of the reasons a file can be refused.
|
|
87
|
+
*
|
|
88
|
+
* What is already chosen counts towards BOTH the number of files and the running total,
|
|
89
|
+
* which is what makes a second drop obey the same limits as the first rather than
|
|
90
|
+
* starting again from nothing.
|
|
91
|
+
*/
|
|
92
|
+
export declare function screenFiles(incoming: readonly File[], current: readonly File[], limits: FileLimits): {
|
|
93
|
+
accepted: File[];
|
|
94
|
+
rejected: FileRejection[];
|
|
95
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/utils/file.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (!t) return !0;
|
|
4
|
+
let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
5
|
+
if (n.length === 0) return !0;
|
|
6
|
+
let r = e.name.toLowerCase(), i = e.type.toLowerCase();
|
|
7
|
+
return n.some((e) => e === "*" || e === "*/*" ? !0 : e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i !== "" && i.startsWith(e.slice(0, -1)) : i === e);
|
|
8
|
+
}
|
|
9
|
+
var t = [
|
|
10
|
+
"byte",
|
|
11
|
+
"kilobyte",
|
|
12
|
+
"megabyte",
|
|
13
|
+
"gigabyte",
|
|
14
|
+
"terabyte"
|
|
15
|
+
], n = /* @__PURE__ */ new Map(), r = (e) => e === 0 ? 0 : 1;
|
|
16
|
+
function i(e, i) {
|
|
17
|
+
let a = `${e}|${i}`, o = n.get(a);
|
|
18
|
+
return o || (o = new Intl.NumberFormat(e, {
|
|
19
|
+
style: "unit",
|
|
20
|
+
unit: t[i],
|
|
21
|
+
unitDisplay: "short",
|
|
22
|
+
maximumFractionDigits: r(i)
|
|
23
|
+
}), n.set(a, o)), o;
|
|
24
|
+
}
|
|
25
|
+
function a(e, n) {
|
|
26
|
+
let a = Number.isFinite(e) && e > 0 ? e : 0, o = a === 0 ? 0 : Math.min(t.length - 1, Math.max(0, Math.floor(Math.log10(a) / 3))), s = a / 1e3 ** o;
|
|
27
|
+
return Math.round(s * 10 ** r(o)) / 10 ** r(o) >= 1e3 && o < t.length - 1 && (o += 1, s = a / 1e3 ** o), i(n, o).format(s);
|
|
28
|
+
}
|
|
29
|
+
function o(t, n, r) {
|
|
30
|
+
let i = [], a = [], o = n.reduce((e, t) => e + t.size, 0);
|
|
31
|
+
for (let s of t) {
|
|
32
|
+
if (!e(s, r.accept)) {
|
|
33
|
+
a.push({
|
|
34
|
+
file: s,
|
|
35
|
+
reason: "type"
|
|
36
|
+
});
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (r.maxSize !== void 0 && s.size > r.maxSize) {
|
|
40
|
+
a.push({
|
|
41
|
+
file: s,
|
|
42
|
+
reason: "size"
|
|
43
|
+
});
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (r.maxFiles !== void 0 && n.length + i.length >= r.maxFiles) {
|
|
47
|
+
a.push({
|
|
48
|
+
file: s,
|
|
49
|
+
reason: "count"
|
|
50
|
+
});
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (r.maxTotalSize !== void 0 && o + s.size > r.maxTotalSize) {
|
|
54
|
+
a.push({
|
|
55
|
+
file: s,
|
|
56
|
+
reason: "total-size"
|
|
57
|
+
});
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
i.push(s), o += s.size;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
accepted: i,
|
|
64
|
+
rejected: a
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { a as formatBytes, e as matchesAccept, o as screenFiles };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","names":[],"sources":["../../src/utils/file.ts"],"sourcesContent":["// @core — module-wide: pure domain logic, no a11y, no DOM, no environment guard.\n/**\n * Everything the design system has to decide about a file the browser hands it, before\n * that file is accepted: is it of a kind we asked for, how do we write its size out, and\n * which of a batch may come in.\n *\n * The three are grouped because they are about the same SUBJECT, not because they share\n * any code — the same arrangement as the text helpers.\n *\n * Nothing here knows anything about components, which is what gives the screening its\n * shape: it HANDS BACK the files it refused instead of announcing them. One body then\n * serves a component that reports refusals one at a time and a test that reads them all\n * as a list.\n */\n\n/** All the matching needs of a file, so that a test does not have to counterfeit one. */\nexport interface FileCandidate {\n name: string\n type: string\n}\n\n/**\n * Decides whether a file is one of the kinds a component said it would take.\n *\n * The list of accepted kinds is written exactly as HTML has always written it, and it\n * admits three forms: an extension such as \".pdf\", regardless of capitals; a whole family\n * such as \"image/*\"; or one precise kind. Saying nothing at all accepts everything, which\n * is what saying nothing has always meant.\n *\n * The reason this exists in code rather than being left to the browser is that the\n * browser only applies that list to the dialog it opens. A file DROPPED onto the page\n * goes around it entirely and arrives untouched. Without this second reading, dropping\n * would smuggle in anything at all past a restriction the consumer believes is being\n * enforced.\n *\n * TRAP — the kind of a file is the BROWSER's guess, and it is often simply empty: an\n * extension it has never heard of, or certain Linux setups. A list written only in terms\n * of kinds then turns away a perfectly good file, which is why the documentation asks for\n * extensions to be spelled out alongside them — \"image/*,.heic\" rather than \"image/*\" on\n * its own.\n */\nexport function matchesAccept(file: FileCandidate, accept?: string): boolean {\n if (!accept) return true\n\n const tokens = accept\n .split(',')\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean)\n if (tokens.length === 0) return true\n\n const name = file.name.toLowerCase()\n const type = file.type.toLowerCase()\n\n return tokens.some((token) => {\n if (token === '*' || token === '*/*') return true\n if (token.startsWith('.')) return name.endsWith(token)\n if (token.endsWith('/*')) return type !== '' && type.startsWith(token.slice(0, -1))\n return type === token\n })\n}\n\n/** The units a size can be written in, smallest first — the rungs of the ladder. */\nconst UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte'] as const\n\n/**\n * Building a number formatter costs one to two orders of magnitude more than using one,\n * and a running total is rewritten every time a file is added — so one is built per\n * language and rung, and kept for as long as the page lives.\n */\nconst formatters = new Map<string, Intl.NumberFormat>()\n\n/** Bytes are counted whole; above that, one decimal is what reads as a size. */\nconst digitsFor = (step: number) => (step === 0 ? 0 : 1)\n\nfunction formatterFor(locale: string, step: number): Intl.NumberFormat {\n const key = `${locale}|${step}`\n let formatter = formatters.get(key)\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, {\n style: 'unit',\n unit: UNITS[step]!,\n unitDisplay: 'short',\n maximumFractionDigits: digitsFor(step),\n })\n formatters.set(key, formatter)\n }\n return formatter\n}\n\n/**\n * Writes a size out the way a reader expects to see it: 1 200 000 becomes \"1.2 MB\" in\n * English and \"1,2 Mo\" in French.\n *\n * The design system's rule about language applies here unchanged. The FORM comes from the\n * browser, which already knows the unit in every language and where the decimal mark\n * goes; only the WORDS around it come from the dictionary. Nothing in this function is\n * translatable.\n *\n * A kilobyte is a thousand bytes, and each rung of the ladder is a thousand of the one\n * below. That is exactly what the unit names the browser prints mean. Using the other,\n * computing convention of 1024 would have a file of 1024 bytes shown as \"1.02 kB\" — a\n * discrepancy no reader could explain to themselves.\n *\n * A size that is negative, or not a number at all, is treated as nothing rather than\n * producing nonsense. The number comes straight from the file, and a size shown beside a\n * name must never be the thing that breaks.\n */\nexport function formatBytes(bytes: number, locale: string): string {\n const n = Number.isFinite(bytes) && bytes > 0 ? bytes : 0\n\n let step = n === 0 ? 0 : Math.min(UNITS.length - 1, Math.max(0, Math.floor(Math.log10(n) / 3)))\n let value = n / 1000 ** step\n\n /*\n * The carry. A size of 999 999 bytes belongs on the kilobyte rung, and at one decimal\n * it ROUNDS to 1000 — so the rung and the rounding have to agree, or the reader is\n * shown \"1,000 kB\" where they expect \"1 MB\". The rounding is done first and the step up\n * second: the other order lets exactly the same discrepancy through one rung higher.\n */\n const rounded = Math.round(value * 10 ** digitsFor(step)) / 10 ** digitsFor(step)\n if (rounded >= 1000 && step < UNITS.length - 1) {\n step += 1\n value = n / 1000 ** step\n }\n\n return formatterFor(locale, step).format(value)\n}\n\n/**\n * Why a file was turned away. Each component declares its own public name for this: a\n * type belongs to the component that exposes it, and nothing in here is public.\n */\nexport type FileRejectReason = 'type' | 'size' | 'count' | 'total-size'\n\nexport interface FileRejection {\n file: File\n reason: FileRejectReason\n}\n\nexport interface FileLimits {\n accept?: string\n /** How large ONE file may be, in bytes. */\n maxSize?: number\n /** Already settled by the caller: a field that takes a single file passes one. */\n maxFiles?: number\n maxTotalSize?: number\n}\n\n/**\n * Sorts an arriving batch of files into those that may come in and those that may not,\n * given what has already been chosen.\n *\n * The checks run in the order a reader can act on. A file of the wrong KIND is reported\n * as such even when it is also too big, because being told to shrink a file that would\n * never have been accepted anyway is worse than useless.\n *\n * Nothing is set aside for being chosen twice. There is no reliable way to tell one file\n * from another — two files in different folders may perfectly well share a name — so\n * \"already chosen\" is deliberately not one of the reasons a file can be refused.\n *\n * What is already chosen counts towards BOTH the number of files and the running total,\n * which is what makes a second drop obey the same limits as the first rather than\n * starting again from nothing.\n */\nexport function screenFiles(\n incoming: readonly File[],\n current: readonly File[],\n limits: FileLimits,\n): { accepted: File[]; rejected: FileRejection[] } {\n const accepted: File[] = []\n const rejected: FileRejection[] = []\n let total = current.reduce((sum, file) => sum + file.size, 0)\n\n for (const file of incoming) {\n if (!matchesAccept(file, limits.accept)) {\n rejected.push({ file, reason: 'type' })\n continue\n }\n if (limits.maxSize !== undefined && file.size > limits.maxSize) {\n rejected.push({ file, reason: 'size' })\n continue\n }\n if (limits.maxFiles !== undefined && current.length + accepted.length >= limits.maxFiles) {\n rejected.push({ file, reason: 'count' })\n continue\n }\n if (limits.maxTotalSize !== undefined && total + file.size > limits.maxTotalSize) {\n rejected.push({ file, reason: 'total-size' })\n continue\n }\n accepted.push(file)\n total += file.size\n }\n\n return { accepted, rejected }\n}\n"],"mappings":";AAyCA,SAAgB,EAAc,GAAqB,GAA0B;CAC3E,IAAI,CAAC,GAAQ,OAAO;CAEpB,IAAM,IAAS,EACZ,MAAM,GAAG,CAAC,CACV,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1C,OAAO,OAAO;CACjB,IAAI,EAAO,WAAW,GAAG,OAAO;CAEhC,IAAM,IAAO,EAAK,KAAK,YAAY,GAC7B,IAAO,EAAK,KAAK,YAAY;CAEnC,OAAO,EAAO,MAAM,MACd,MAAU,OAAO,MAAU,QAAc,KACzC,EAAM,WAAW,GAAG,IAAU,EAAK,SAAS,CAAK,IACjD,EAAM,SAAS,IAAI,IAAU,MAAS,MAAM,EAAK,WAAW,EAAM,MAAM,GAAG,EAAE,CAAC,IAC3E,MAAS,CACjB;AACH;AAGA,IAAM,IAAQ;C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C;EACF;EACA,IAAI,EAAO,aAAa,KAAA,KAAa,EAAQ,SAAS,EAAS,UAAU,EAAO,UAAU;GACxF,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAQ,CAAC;GACvC;EACF;EACA,IAAI,EAAO,iBAAiB,KAAA,KAAa,IAAQ,EAAK,OAAO,EAAO,cAAc;GAChF,EAAS,KAAK;IAAE;IAAM,QAAQ;GAAa,CAAC;GAC5C;EACF;EAEA,AADA,EAAS,KAAK,CAAI,GAClB,KAAS,EAAK;CAChB;CAEA,OAAO;EAAE;EAAU;CAAS;AAC9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telling a keyboard focus apart from a pointer one.
|
|
3
|
+
*
|
|
4
|
+
* The distinction is needed because `focus` alone does not carry it: an element focused by a
|
|
5
|
+
* mouse click and one reached with the Tab key are in exactly the same state, and a component
|
|
6
|
+
* reading a bare focus flag treats a passing click as a reader settling in. The browser already
|
|
7
|
+
* makes that judgement for its own focus rings, and `:focus-visible` is where it publishes it —
|
|
8
|
+
* a pointer click on a button does not match it, a Tab does.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Whether this element is focused in the way a keyboard user focuses things.
|
|
12
|
+
*
|
|
13
|
+
* The `try` is for a selector engine that does not know the pseudo-class, and throws on one it
|
|
14
|
+
* cannot parse rather than answering false. Every caller treats the keyboard as the careful
|
|
15
|
+
* answer — it is the one that keeps a component reachable — so that is what an environment
|
|
16
|
+
* unable to be asked returns.
|
|
17
|
+
*
|
|
18
|
+
* TRAP for the tests — jsdom is NOT that environment. It parses `:focus-visible` happily and
|
|
19
|
+
* answers `false` for everything, a genuinely focused element included, so the `catch` never
|
|
20
|
+
* runs there and every test silently takes the pointer branch. A test that means to exercise
|
|
21
|
+
* the keyboard one has to stub `matches` on the element being asked; what it then locks is
|
|
22
|
+
* that the component ASKS and branches, never what jsdom would have answered.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isKeyboardFocus(target: EventTarget | null): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/utils/focus.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!(e instanceof Element)) return !1;
|
|
4
|
+
try {
|
|
5
|
+
return e.matches(":focus-visible");
|
|
6
|
+
} catch {
|
|
7
|
+
return !0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as isKeyboardFocus };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=focus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.js","names":[],"sources":["../../src/utils/focus.ts"],"sourcesContent":["/**\n * Telling a keyboard focus apart from a pointer one.\n *\n * The distinction is needed because `focus` alone does not carry it: an element focused by a\n * mouse click and one reached with the Tab key are in exactly the same state, and a component\n * reading a bare focus flag treats a passing click as a reader settling in. The browser already\n * makes that judgement for its own focus rings, and `:focus-visible` is where it publishes it —\n * a pointer click on a button does not match it, a Tab does.\n */\n\n// @a11y @fallback\n/**\n * Whether this element is focused in the way a keyboard user focuses things.\n *\n * The `try` is for a selector engine that does not know the pseudo-class, and throws on one it\n * cannot parse rather than answering false. Every caller treats the keyboard as the careful\n * answer — it is the one that keeps a component reachable — so that is what an environment\n * unable to be asked returns.\n *\n * TRAP for the tests — jsdom is NOT that environment. It parses `:focus-visible` happily and\n * answers `false` for everything, a genuinely focused element included, so the `catch` never\n * runs there and every test silently takes the pointer branch. A test that means to exercise\n * the keyboard one has to stub `matches` on the element being asked; what it then locks is\n * that the component ASKS and branches, never what jsdom would have answered.\n */\nexport function isKeyboardFocus(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n try {\n return target.matches(':focus-visible')\n } catch {\n return true\n }\n}\n"],"mappings":";AAyBA,SAAgB,EAAgB,GAAqC;CACnE,IAAI,EAAE,aAAkB,UAAU,OAAO;CACzC,IAAI;EACF,OAAO,EAAO,QAAQ,gBAAgB;CACxC,QAAQ;EACN,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns any of the design system's "which entries are unavailable" props into a
|
|
3
|
+
* single function to ask. Those props — `disabledDates`, `disabledPages` and their
|
|
4
|
+
* kind — accept either a LIST of the values concerned or a FUNCTION deciding for
|
|
5
|
+
* each one, and this is what lets the components stop caring which of the two they
|
|
6
|
+
* were handed.
|
|
7
|
+
*
|
|
8
|
+
* It is meant to be resolved ONCE, inside a `computed`, and not called afresh for
|
|
9
|
+
* every value: a list is converted into a `Set` here, so each lookup is then
|
|
10
|
+
* immediate, where an `includes` would walk the whole list again for every cell on
|
|
11
|
+
* screen.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveMatcher<T>(matcher: readonly T[] | ((value: T) => boolean) | undefined): (value: T) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matcher.js","names":[],"sources":["../../src/utils/matcher.ts"],"sourcesContent":["// @core\n/**\n * Turns any of the design system's \"which entries are unavailable\" props into a\n * single function to ask. Those props — `disabledDates`, `disabledPages` and their\n * kind — accept either a LIST of the values concerned or a FUNCTION deciding for\n * each one, and this is what lets the components stop caring which of the two they\n * were handed.\n *\n * It is meant to be resolved ONCE, inside a `computed`, and not called afresh for\n * every value: a list is converted into a `Set` here, so each lookup is then\n * immediate, where an `includes` would walk the whole list again for every cell on\n * screen.\n */\nexport function resolveMatcher<T>(\n matcher: readonly T[] | ((value: T) => boolean) | undefined,\n): (value: T) => boolean {\n if (!matcher) return () => false\n if (typeof matcher === 'function') return matcher\n const set = new Set(matcher)\n return (value: T) => set.has(value)\n}\n"],"mappings":";AAaA,SAAgB,EACd,GACuB;CACvB,IAAI,CAAC,GAAS,aAAa;CAC3B,IAAI,OAAO,KAAY,YAAY,OAAO;CAC1C,IAAM,IAAM,IAAI,IAAI,CAAO;CAC3B,QAAQ,MAAa,EAAI,IAAI,CAAK;AACpC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds a number between a lower and an upper bound.
|
|
3
|
+
*
|
|
4
|
+
* When the two bounds cross over — which happens as soon as the upper one is worked out
|
|
5
|
+
* from something empty, the last position of a list with nothing in it being one short of
|
|
6
|
+
* the first — the LOWER bound wins. It is the one that is always a position something can
|
|
7
|
+
* sit at.
|
|
8
|
+
*/
|
|
9
|
+
export declare function clamp(n: number, min: number, max: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.js","names":[],"sources":["../../src/utils/number.ts"],"sourcesContent":["// @core\n/**\n * Holds a number between a lower and an upper bound.\n *\n * When the two bounds cross over — which happens as soon as the upper one is worked out\n * from something empty, the last position of a list with nothing in it being one short of\n * the first — the LOWER bound wins. It is the one that is always a position something can\n * sit at.\n */\nexport function clamp(n: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, n))\n}\n"],"mappings":";AASA,SAAgB,EAAM,GAAW,GAAa,GAAqB;CACjE,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAC,CAAC;AACvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The form of a text used for COMPARING it: capitals and accents no longer count.
|
|
3
|
+
*
|
|
4
|
+
* The accents are removed by pulling each letter apart into the plain letter and the mark
|
|
5
|
+
* above it, then dropping the marks. This is used wherever the design system matches a
|
|
6
|
+
* list against what someone has typed — searching for "e" must find "é", since nobody
|
|
7
|
+
* expects to have to reach for the right accent to find a name.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeText(s: string): string;
|
|
10
|
+
/** A whole number written on two digits, so that 7 becomes "07" — as dates and times are. */
|
|
11
|
+
export declare function pad2(n: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* Just the digits of a text, everything else thrown away.
|
|
14
|
+
*
|
|
15
|
+
* It knows nothing of dates or of times, and that is why it lives among the text helpers
|
|
16
|
+
* rather than with either of them: the fields one types a date or a time into only ever
|
|
17
|
+
* deal in the run of digits, and place the separators between them themselves.
|
|
18
|
+
*/
|
|
19
|
+
export declare const digitsOf: (text: string) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/utils/text.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return String(e).padStart(2, "0");
|
|
7
|
+
}
|
|
8
|
+
var n = (e) => e.replace(/\D/g, "");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as digitsOf, e as normalizeText, t as pad2 };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","names":[],"sources":["../../src/utils/text.ts"],"sourcesContent":["// @core\n/**\n * The form of a text used for COMPARING it: capitals and accents no longer count.\n *\n * The accents are removed by pulling each letter apart into the plain letter and the mark\n * above it, then dropping the marks. This is used wherever the design system matches a\n * list against what someone has typed — searching for \"e\" must find \"é\", since nobody\n * expects to have to reach for the right accent to find a name.\n */\nexport function normalizeText(s: string): string {\n return s\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n}\n\n// @core\n/** A whole number written on two digits, so that 7 becomes \"07\" — as dates and times are. */\nexport function pad2(n: number): string {\n return String(n).padStart(2, '0')\n}\n\n// @core\n/**\n * Just the digits of a text, everything else thrown away.\n *\n * It knows nothing of dates or of times, and that is why it lives among the text helpers\n * rather than with either of them: the fields one types a date or a time into only ever\n * deal in the run of digits, and place the separators between them themselves.\n */\nexport const digitsOf = (text: string): string => text.replace(/\\D/g, '')\n"],"mappings":";AASA,SAAgB,EAAc,GAAmB;CAC/C,OAAO,EACJ,UAAU,KAAK,CAAC,CAChB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,YAAY;AACjB;AAIA,SAAgB,EAAK,GAAmB;CACtC,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;AAClC;AAUA,IAAa,KAAY,MAAyB,EAAK,QAAQ,OAAO,EAAE"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export type HourFormat = '12h' | '24h';
|
|
2
|
+
export type Meridiem = 'AM' | 'PM';
|
|
3
|
+
export interface TimeParts {
|
|
4
|
+
/** The hour on the 24-hour clock, from 0 to 23. */
|
|
5
|
+
hour: number;
|
|
6
|
+
minute: number;
|
|
7
|
+
}
|
|
8
|
+
/** Whether something is a time in the canonical form — two digits, a colon, two digits. */
|
|
9
|
+
export declare function isValidTime(value: unknown): value is string;
|
|
10
|
+
/** Reads a canonical time into its two numbers, or nothing at all if it is not one. */
|
|
11
|
+
export declare function parseTime(value: string | null | undefined): TimeParts | null;
|
|
12
|
+
/** Writes an hour and a minute back into the canonical form, both on two digits. */
|
|
13
|
+
export declare function formatTime(hour: number, minute: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Turns an hour of the 24-hour clock into the hour a 12-hour clock face shows, together
|
|
16
|
+
* with which half of the day it belongs to: midnight is 12 AM, noon is 12 PM, and eleven
|
|
17
|
+
* at night is 11 PM.
|
|
18
|
+
*/
|
|
19
|
+
export declare function to12h(hour24: number): {
|
|
20
|
+
hour: number;
|
|
21
|
+
meridiem: Meridiem;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The way back: an hour read off a 12-hour clock face, plus the half of the day it is in,
|
|
25
|
+
* gives the hour on the 24-hour clock — 12 in the morning is 0, 12 in the afternoon is 12.
|
|
26
|
+
*/
|
|
27
|
+
export declare function to24h(hour12: number, meridiem: Meridiem): number;
|
|
28
|
+
export declare function hourCycleFor(locale: string): HourFormat;
|
|
29
|
+
/**
|
|
30
|
+
* A time written out for a reader — "19:05", or "7:05 PM".
|
|
31
|
+
*
|
|
32
|
+
* The choice of clock is imposed on the browser rather than left to it, so that the text
|
|
33
|
+
* follows what the component settled on. A consumer may ask for a 24-hour clock in a
|
|
34
|
+
* language that would have chosen otherwise, and their choice must be the one that shows.
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatDisplay(time: string, locale: string, format: HourFormat): string;
|
|
37
|
+
/**
|
|
38
|
+
* Snaps a minute to the nearest one the component allows — every five minutes, say — and
|
|
39
|
+
* brings it back inside the hour.
|
|
40
|
+
*
|
|
41
|
+
* Both ends need that last part: 58 minutes snapped to five-minute steps lands on 60,
|
|
42
|
+
* which is 0, and stepping back from 0 with the keyboard goes through minus one, which is
|
|
43
|
+
* 59.
|
|
44
|
+
*/
|
|
45
|
+
export declare function snapMinute(minute: number, step: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* Where a finger landed on the clock face, given as an offset from the centre, becomes
|
|
48
|
+
* which mark it was pointing at.
|
|
49
|
+
*
|
|
50
|
+
* The marks are numbered from the twelve o'clock position and go round clockwise, and the
|
|
51
|
+
* nearest one wins. The offsets are the ones the screen uses, where going DOWN is
|
|
52
|
+
* positive, which is why the vertical one is negated to measure the angle from the top.
|
|
53
|
+
*/
|
|
54
|
+
export declare function angleToIndex(dx: number, dy: number, segments: number): number;
|
|
55
|
+
/** How far from the centre a finger landed, as a fraction: nothing at the centre, one at the edge. */
|
|
56
|
+
export declare function distanceFraction(dx: number, dy: number, radius: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* How close to the centre a finger has to land for it to be aiming at the INNER ring of
|
|
59
|
+
* numbers, the one holding the small hours of a 24-hour clock. It is the halfway mark
|
|
60
|
+
* between the two rings of numerals.
|
|
61
|
+
*
|
|
62
|
+
* TRAP — the number is DERIVED from the dial's size and the size of a numeral, both of
|
|
63
|
+
* which are decided in the stylesheet: a dial of 256px across and numerals of 48px put
|
|
64
|
+
* the two rings' centres at 104px and 56px from the middle, whose halfway point is
|
|
65
|
+
* 0.625 of the radius. Changing either size in the CSS without changing this leaves the
|
|
66
|
+
* threshold between two rings it no longer separates, and a tap near the boundary quietly
|
|
67
|
+
* sets the wrong hour.
|
|
68
|
+
*/
|
|
69
|
+
export declare const DIAL_INNER_THRESHOLD = 0.625;
|
|
70
|
+
/**
|
|
71
|
+
* Which hour a mark stands for, on a dial laid out as two rings: the outer one carries 12
|
|
72
|
+
* then 1 to 11, the inner one carries midnight then 13 to 23. The first mark of each is
|
|
73
|
+
* the one at the twelve o'clock position.
|
|
74
|
+
*/
|
|
75
|
+
export declare function dialIndexToHour24(index: number, ring: 'outer' | 'inner'): number;
|
|
76
|
+
/**
|
|
77
|
+
* The way back, which is what tells the hand where to point: midnight is the top of the
|
|
78
|
+
* inner ring, noon the top of the outer one, and three in the afternoon the third mark of
|
|
79
|
+
* the inner ring.
|
|
80
|
+
*/
|
|
81
|
+
export declare function hour24ToDial(hour: number): {
|
|
82
|
+
index: number;
|
|
83
|
+
ring: 'outer' | 'inner';
|
|
84
|
+
};
|
|
85
|
+
export interface TimeOption {
|
|
86
|
+
/** The canonical time, which is what the component's value will be set to. */
|
|
87
|
+
value: string;
|
|
88
|
+
/** The same time written out for the reader: "07:30", or "7:30 AM". */
|
|
89
|
+
label: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A time as a count of minutes since midnight, or nothing if it is not a time. It is what
|
|
93
|
+
* gives a time its position in a list.
|
|
94
|
+
*/
|
|
95
|
+
export declare function minutesOf(time: string | null | undefined): number | null;
|
|
96
|
+
/**
|
|
97
|
+
* Every time of the day at a given interval, from midnight up to the last one before the
|
|
98
|
+
* next.
|
|
99
|
+
*
|
|
100
|
+
* There is deliberately no earliest or latest here, because the time picker itself has
|
|
101
|
+
* none: do not invent one.
|
|
102
|
+
*
|
|
103
|
+
* An interval that makes no sense — nothing, a fraction, more than an hour — falls back
|
|
104
|
+
* to one an hour. The list has to stay FINITE even when the warning the component prints
|
|
105
|
+
* about it was ignored, since an interval of zero would build times for ever.
|
|
106
|
+
*/
|
|
107
|
+
export declare function timeList(step: number, locale: string, format: HourFormat): TimeOption[];
|
|
108
|
+
/**
|
|
109
|
+
* Lays a run of typed digits out as a time. The colon appears AS SOON AS the hour is
|
|
110
|
+
* complete — typing "09" already gives "09:" — exactly as a date's separators do.
|
|
111
|
+
*/
|
|
112
|
+
export declare function formatTimeMask(digits: string): string;
|
|
113
|
+
/**
|
|
114
|
+
* Where the caret belongs so as to sit just after a given number of digits.
|
|
115
|
+
*
|
|
116
|
+
* It is a plain formula rather than a scan of the text, because a time's separator is
|
|
117
|
+
* always in the same place — which is exactly what the date's equivalent cannot assume,
|
|
118
|
+
* since the order and the width of its parts change from one language to the next.
|
|
119
|
+
*
|
|
120
|
+
* The flag says something was INSERTED, and the caret then steps over the colon into the
|
|
121
|
+
* minutes. On a deletion it stays in FRONT of it, or the next press of the key would step
|
|
122
|
+
* over the colon instead of erasing a digit, and the key would appear to do nothing.
|
|
123
|
+
*/
|
|
124
|
+
export declare function timeCaret(n: number, skipSeparator?: boolean): number;
|
|
125
|
+
/**
|
|
126
|
+
* Writes a canonical time into the field, in whichever form is being SHOWN. On a 12-hour
|
|
127
|
+
* clock the hour is brought back into the range 1 to 12: which half of the day it is
|
|
128
|
+
* belongs to the pair of buttons beside the field, and never to the text itself.
|
|
129
|
+
*/
|
|
130
|
+
export declare function timeToMask(time: string | null | undefined, format: HourFormat): string;
|
|
131
|
+
/**
|
|
132
|
+
* Reads what has been typed back into a canonical time, or nothing at all when it is
|
|
133
|
+
* incomplete, too long, or not a time anyone could point to.
|
|
134
|
+
*
|
|
135
|
+
* On a 12-hour clock the half of the day comes from the pair of buttons beside the field.
|
|
136
|
+
* This is the ONE place where what was typed and that choice meet.
|
|
137
|
+
*/
|
|
138
|
+
export declare function parseTimeMask(text: string, format: HourFormat, meridiem?: Meridiem): string | null;
|