vectis-ui 0.12.0 → 0.14.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/dist/components/VAccordion/VAccordion.css +1 -1
- package/dist/components/VAccordion/VAccordion.d.ts +6 -5
- package/dist/components/VAccordion/VAccordion.js.map +1 -1
- package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.css +1 -1
- package/dist/components/VAccordion/VAccordionItem.d.ts +1 -1
- package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
- package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VAlert/VAlert.css +2 -0
- package/dist/components/VAlert/VAlert.d.ts +73 -0
- package/dist/components/VAlert/VAlert.js +9 -0
- package/dist/components/VAlert/VAlert.js.map +1 -0
- package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VAvatar/VAvatar.d.ts +2 -2
- package/dist/components/VAvatar/VAvatarGroup.d.ts +1 -1
- package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/VBadge/VBadge.d.ts +3 -3
- package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/VButton/VButton.d.ts +4 -4
- package/dist/components/VButton/VButtonGroup.css +1 -1
- package/dist/components/VButton/VButtonGroup.d.ts +2 -2
- package/dist/components/VButton/VButtonGroup.js.map +1 -1
- package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.css +1 -1
- package/dist/components/VCalendar/VCalendar.d.ts +7 -1
- package/dist/components/VCalendar/VCalendar.js.map +1 -1
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +20 -18
- package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
- package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.css +1 -1
- package/dist/components/VCalendar/VCalendarMonth.d.ts +2 -2
- package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
- package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
- package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
- package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.css +1 -1
- package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
- package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCalendar/gesture.d.ts +1 -16
- package/dist/components/VCalendar/gesture.js +1 -1
- package/dist/components/VCalendar/gesture.js.map +1 -1
- package/dist/components/VCalendar/types.d.ts +2 -0
- package/dist/components/VCard/VCard.css +2 -0
- package/dist/components/VCard/VCard.d.ts +87 -0
- package/dist/components/VCard/VCard.js +9 -0
- package/dist/components/VCard/VCard.js.map +1 -0
- package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCarousel/VCarousel.d.ts +1 -1
- package/dist/components/VCarousel/VCarousel.js.map +1 -1
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCheckbox/VCheckMark.css +2 -0
- package/dist/components/VCheckbox/VCheckMark.js +9 -0
- package/dist/components/VCheckbox/VCheckMark.js.map +1 -0
- package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCheckbox/VCheckbox.css +1 -1
- package/dist/components/VCheckbox/VCheckbox.d.ts +8 -3
- package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +54 -69
- package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VChip/VChip.d.ts +6 -6
- package/dist/components/VChip/VChip.js.map +1 -1
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +26 -26
- package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VColorInput/VColorInput.css +2 -0
- package/dist/components/VColorInput/VColorInput.d.ts +113 -0
- package/dist/components/VColorInput/VColorInput.js +9 -0
- package/dist/components/VColorInput/VColorInput.js.map +1 -0
- package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VColorPicker/VColorPicker.css +2 -0
- package/dist/components/VColorPicker/VColorPicker.d.ts +67 -0
- package/dist/components/VColorPicker/VColorPicker.js +9 -0
- package/dist/components/VColorPicker/VColorPicker.js.map +1 -0
- package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js +390 -0
- package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VColorPicker/color.d.ts +42 -0
- package/dist/components/VColorPicker/color.js +158 -0
- package/dist/components/VColorPicker/color.js.map +1 -0
- package/dist/components/VCombobox/VCombobox.css +1 -1
- package/dist/components/VCombobox/VCombobox.d.ts +46 -60
- package/dist/components/VCombobox/VCombobox.js.map +1 -1
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +271 -372
- package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VCommandPalette/VCommandPalette.css +2 -0
- package/dist/components/VCommandPalette/VCommandPalette.d.ts +163 -0
- package/dist/components/VCommandPalette/VCommandPalette.js +9 -0
- package/dist/components/VCommandPalette/VCommandPalette.js.map +1 -0
- package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js +321 -0
- package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.css +2 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.d.ts +38 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.js +9 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.js.map +1 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VContextMenu/VContextMenu.css +2 -0
- package/dist/components/VContextMenu/VContextMenu.d.ts +66 -0
- package/dist/components/VContextMenu/VContextMenu.js +9 -0
- package/dist/components/VContextMenu/VContextMenu.js.map +1 -0
- package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VDataTable/VDataTable.css +1 -1
- package/dist/components/VDataTable/VDataTable.d.ts +41 -16
- package/dist/components/VDataTable/VDataTable.js.map +1 -1
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +307 -194
- package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.d.ts +27 -7
- package/dist/components/VDateInput/VDateInput.js.map +1 -1
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +170 -162
- package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.d.ts +3 -3
- package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +228 -227
- package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDatePicker/keyboard.d.ts +7 -7
- package/dist/components/VDatePicker/keyboard.js +8 -6
- package/dist/components/VDatePicker/keyboard.js.map +1 -1
- package/dist/components/VDatePicker/names.js +16 -20
- package/dist/components/VDatePicker/names.js.map +1 -1
- package/dist/components/VDialog/VDialog.d.ts +2 -4
- package/dist/components/VDialog/VDialog.js.map +1 -1
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +46 -77
- package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VDrawer/VDrawer.css +2 -0
- package/dist/components/VDrawer/VDrawer.d.ts +102 -0
- package/dist/components/VDrawer/VDrawer.js +9 -0
- package/dist/components/VDrawer/VDrawer.js.map +1 -0
- package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VEmptyState/VEmptyState.css +2 -0
- package/dist/components/VEmptyState/VEmptyState.d.ts +43 -0
- package/dist/components/VEmptyState/VEmptyState.js +9 -0
- package/dist/components/VEmptyState/VEmptyState.js.map +1 -0
- package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VField/VField.css +2 -0
- package/dist/components/VField/VField.d.ts +84 -0
- package/dist/components/VField/VField.js +9 -0
- package/dist/components/VField/VField.js.map +1 -0
- package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VField/VFieldAnnouncer.d.ts +7 -0
- package/dist/components/VField/VFieldAnnouncer.js +7 -0
- package/dist/components/VField/VFieldAnnouncer.js.map +1 -0
- package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VField/VFieldMessage.d.ts +11 -0
- package/dist/components/VField/VFieldMessage.js +7 -0
- package/dist/components/VField/VFieldMessage.js.map +1 -0
- package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFieldset/VFieldset.css +2 -0
- package/dist/components/VFieldset/VFieldset.d.ts +52 -0
- package/dist/components/VFieldset/VFieldset.js +9 -0
- package/dist/components/VFieldset/VFieldset.js.map +1 -0
- package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VFileInput/VFileInput.css +1 -1
- package/dist/components/VFileInput/VFileInput.d.ts +31 -7
- package/dist/components/VFileInput/VFileInput.js.map +1 -1
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +168 -161
- package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VFilePicker/VFilePicker.d.ts +4 -4
- package/dist/components/VHotkeys/VHotkeys.css +1 -1
- package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +27 -30
- package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VHotkeys/platform.d.ts +2 -0
- package/dist/components/VHotkeys/platform.js +24 -5
- package/dist/components/VHotkeys/platform.js.map +1 -1
- package/dist/components/VHoverCard/VHoverCard.css +2 -0
- package/dist/components/VHoverCard/VHoverCard.d.ts +62 -0
- package/dist/components/VHoverCard/VHoverCard.js +9 -0
- package/dist/components/VHoverCard/VHoverCard.js.map +1 -0
- package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VIcon/icons/add.d.ts +5 -0
- package/dist/components/VIcon/icons/add.js +9 -0
- package/dist/components/VIcon/icons/add.js.map +1 -0
- package/dist/components/VIcon/icons/colorize.d.ts +5 -0
- package/dist/components/VIcon/icons/colorize.js +9 -0
- package/dist/components/VIcon/icons/colorize.js.map +1 -0
- package/dist/components/VIcon/icons/inbox.d.ts +5 -0
- package/dist/components/VIcon/icons/inbox.js +9 -0
- package/dist/components/VIcon/icons/inbox.js.map +1 -0
- package/dist/components/VIcon/icons/index.d.ts +42 -2
- package/dist/components/VIcon/icons/index.js +88 -72
- package/dist/components/VIcon/icons/index.js.map +1 -1
- package/dist/components/VIcon/icons/names.d.ts +2 -2
- package/dist/components/VIcon/icons/names.js +1 -1
- package/dist/components/VIcon/icons/names.js.map +1 -1
- package/dist/components/VIcon/icons/open_in_new.d.ts +5 -0
- package/dist/components/VIcon/icons/open_in_new.js +9 -0
- package/dist/components/VIcon/icons/open_in_new.js.map +1 -0
- package/dist/components/VIcon/icons/priority_high.d.ts +5 -0
- package/dist/components/VIcon/icons/priority_high.js +9 -0
- package/dist/components/VIcon/icons/priority_high.js.map +1 -0
- package/dist/components/VIcon/icons/remove.d.ts +5 -0
- package/dist/components/VIcon/icons/remove.js +9 -0
- package/dist/components/VIcon/icons/remove.js.map +1 -0
- package/dist/components/VIcon/icons/search_off.d.ts +5 -0
- package/dist/components/VIcon/icons/search_off.js +9 -0
- package/dist/components/VIcon/icons/search_off.js.map +1 -0
- package/dist/components/VIcon/icons/star.d.ts +5 -0
- package/dist/components/VIcon/icons/star.js +9 -0
- package/dist/components/VIcon/icons/star.js.map +1 -0
- package/dist/components/VIconButton/VIconButton.d.ts +4 -4
- package/dist/components/VInput/VInput.css +1 -1
- package/dist/components/VInput/VInput.d.ts +51 -2
- package/dist/components/VInput/VInput.js.map +1 -1
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +129 -106
- package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInput/VInputGroup.css +1 -1
- package/dist/components/VInput/VInputGroup.d.ts +20 -0
- package/dist/components/VInput/VInputGroup.js.map +1 -1
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +50 -51
- package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.css +1 -1
- package/dist/components/VInputOTP/VInputOTP.d.ts +27 -4
- package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +131 -113
- package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VLink/VLink.css +2 -0
- package/dist/components/VLink/VLink.d.ts +53 -0
- package/dist/components/VLink/VLink.js +9 -0
- package/dist/components/VLink/VLink.js.map +1 -0
- package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxChevron.css +2 -0
- package/dist/components/VListbox/VListboxChevron.d.ts +12 -0
- package/dist/components/VListbox/VListboxChevron.js +9 -0
- package/dist/components/VListbox/VListboxChevron.js.map +1 -0
- package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxGroup.css +2 -0
- package/dist/components/VListbox/VListboxGroup.d.ts +27 -0
- package/dist/components/VListbox/VListboxGroup.js +9 -0
- package/dist/components/VListbox/VListboxGroup.js.map +1 -0
- package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxOption.css +2 -0
- package/dist/components/{VCombobox/VComboboxOption.d.ts → VListbox/VListboxOption.d.ts} +4 -4
- package/dist/components/VListbox/VListboxOption.js +9 -0
- package/dist/components/VListbox/VListboxOption.js.map +1 -0
- package/dist/components/{VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js} +6 -6
- package/dist/components/VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxPanel.css +2 -0
- package/dist/components/VListbox/VListboxPanel.d.ts +59 -0
- package/dist/components/VListbox/VListboxPanel.js +9 -0
- package/dist/components/VListbox/VListboxPanel.js.map +1 -0
- package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxSeparator.css +2 -0
- package/dist/components/VListbox/VListboxSeparator.d.ts +3 -0
- package/dist/components/VListbox/VListboxSeparator.js +9 -0
- package/dist/components/VListbox/VListboxSeparator.js.map +1 -0
- package/dist/components/{VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js} +4 -4
- package/dist/components/VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VListbox/VListboxValues.css +2 -0
- package/dist/components/VListbox/VListboxValues.d.ts +52 -0
- package/dist/components/VListbox/VListboxValues.js +9 -0
- package/dist/components/VListbox/VListboxValues.js.map +1 -0
- package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VMenu/VMenu.d.ts +1 -1
- package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/VMenu/VMenuItem.d.ts +1 -1
- package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
- package/dist/components/VMenu/VMenuPanel.js.map +1 -1
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VMeter/VMeter.css +2 -0
- package/dist/components/VMeter/VMeter.d.ts +77 -0
- package/dist/components/VMeter/VMeter.js +9 -0
- package/dist/components/VMeter/VMeter.js.map +1 -0
- package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VNumberInput/VNumberInput.css +2 -0
- package/dist/components/VNumberInput/VNumberInput.d.ts +114 -0
- package/dist/components/VNumberInput/VNumberInput.js +9 -0
- package/dist/components/VNumberInput/VNumberInput.js.map +1 -0
- package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VNumberInput/number.d.ts +30 -0
- package/dist/components/VNumberInput/number.js +38 -0
- package/dist/components/VNumberInput/number.js.map +1 -0
- package/dist/components/VPagination/VPagination.d.ts +1 -1
- package/dist/components/VPagination/VPagination.js.map +1 -1
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +77 -77
- package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -2
- package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.d.ts +10 -7
- package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +52 -34
- package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRadio/VRadio.d.ts +8 -3
- package/dist/components/VRadio/VRadio.js.map +1 -1
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +52 -46
- package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VRating/VRating.css +2 -0
- package/dist/components/VRating/VRating.d.ts +92 -0
- package/dist/components/VRating/VRating.js +9 -0
- package/dist/components/VRating/VRating.js.map +1 -0
- package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js +158 -0
- package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VResizable/VResizable.css +2 -0
- package/dist/components/VResizable/VResizable.d.ts +50 -0
- package/dist/components/VResizable/VResizable.js +9 -0
- package/dist/components/VResizable/VResizable.js.map +1 -0
- package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VResizable/VResizablePanel.css +2 -0
- package/dist/components/VResizable/VResizablePanel.d.ts +60 -0
- package/dist/components/VResizable/VResizablePanel.js +9 -0
- package/dist/components/VResizable/VResizablePanel.js.map +1 -0
- package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VResizable/context.d.ts +24 -0
- package/dist/components/VResizable/context.js +6 -0
- package/dist/components/VResizable/context.js.map +1 -0
- package/dist/components/VResizable/layout.d.ts +28 -0
- package/dist/components/VResizable/layout.js +41 -0
- package/dist/components/VResizable/layout.js.map +1 -0
- package/dist/components/VSelect/VSelect.css +2 -0
- package/dist/components/VSelect/VSelect.d.ts +193 -0
- package/dist/components/VSelect/VSelect.js +9 -0
- package/dist/components/VSelect/VSelect.js.map +1 -0
- package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js +418 -0
- package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSeparator/VSeparator.js.map +1 -1
- package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +2 -2
- package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +3 -3
- package/dist/components/VSlider/VSlider.css +1 -1
- package/dist/components/VSlider/VSlider.d.ts +34 -8
- package/dist/components/VSlider/VSlider.js.map +1 -1
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +236 -215
- package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/VSnackbar/state.js.map +1 -1
- package/dist/components/VSplitButton/VSplitButton.css +2 -0
- package/dist/components/VSplitButton/VSplitButton.d.ts +114 -0
- package/dist/components/VSplitButton/VSplitButton.js +9 -0
- package/dist/components/VSplitButton/VSplitButton.js.map +1 -0
- package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VStepper/VStepper.css +2 -0
- package/dist/components/VStepper/VStepper.d.ts +73 -0
- package/dist/components/VStepper/VStepper.js +9 -0
- package/dist/components/VStepper/VStepper.js.map +1 -0
- package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VSwitch/VSwitch.d.ts +8 -3
- package/dist/components/VSwitch/VSwitch.js.map +1 -1
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +53 -47
- package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTab.css +1 -1
- package/dist/components/VTabs/VTab.d.ts +1 -1
- package/dist/components/VTabs/VTab.js.map +1 -1
- package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTabs/VTabs.css +1 -1
- package/dist/components/VTabs/VTabs.d.ts +13 -5
- package/dist/components/VTabs/VTabs.js.map +1 -1
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +20 -20
- package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.css +1 -1
- package/dist/components/VTextarea/VTextarea.d.ts +22 -2
- package/dist/components/VTextarea/VTextarea.js.map +1 -1
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +108 -100
- package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.d.ts +27 -7
- package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +187 -171
- package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.d.ts +2 -2
- package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTimeline/VTimeline.css +2 -0
- package/dist/components/VTimeline/VTimeline.d.ts +59 -0
- package/dist/components/VTimeline/VTimeline.js +9 -0
- package/dist/components/VTimeline/VTimeline.js.map +1 -0
- package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTimeline/VTimelineItem.css +2 -0
- package/dist/components/VTimeline/VTimelineItem.d.ts +48 -0
- package/dist/components/VTimeline/VTimelineItem.js +9 -0
- package/dist/components/VTimeline/VTimelineItem.js.map +1 -0
- package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTimeline/context.d.ts +11 -0
- package/dist/components/VTimeline/context.js +6 -0
- package/dist/components/VTimeline/context.js.map +1 -0
- package/dist/components/VTimeline/datetime.d.ts +8 -0
- package/dist/components/VTimeline/datetime.js +36 -0
- package/dist/components/VTimeline/datetime.js.map +1 -0
- package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/VToggle/VToggle.d.ts +4 -4
- package/dist/components/VToggle/VToggle.js.map +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VToggle/VToggleItem.d.ts +1 -1
- package/dist/components/VTooltip/VTooltip.d.ts +8 -2
- package/dist/components/VTooltip/VTooltip.js.map +1 -1
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +45 -43
- package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VTreeView/VTreeView.css +2 -0
- package/dist/components/VTreeView/VTreeView.d.ts +112 -0
- package/dist/components/VTreeView/VTreeView.js +9 -0
- package/dist/components/VTreeView/VTreeView.js.map +1 -0
- package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js +317 -0
- package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VTypography/VTypography.d.ts +1 -1
- package/dist/components/VVirtualList/VVirtualList.css +2 -0
- package/dist/components/VVirtualList/VVirtualList.d.ts +78 -0
- package/dist/components/VVirtualList/VVirtualList.js +9 -0
- package/dist/components/VVirtualList/VVirtualList.js.map +1 -0
- package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useChoice.d.ts +28 -0
- package/dist/composables/useChoice.js +28 -0
- package/dist/composables/useChoice.js.map +1 -0
- package/dist/composables/useDebouncedSearch.d.ts +17 -0
- package/dist/composables/useDebouncedSearch.js +18 -0
- package/dist/composables/useDebouncedSearch.js.map +1 -0
- package/dist/composables/useEscapeDismiss.d.ts +8 -0
- package/dist/composables/useEscapeDismiss.js +16 -0
- package/dist/composables/useEscapeDismiss.js.map +1 -0
- package/dist/composables/useFieldIds.d.ts +2 -1
- package/dist/composables/useFieldIds.js +7 -6
- package/dist/composables/useFieldIds.js.map +1 -1
- package/dist/composables/useFieldPanel.d.ts +1 -0
- package/dist/composables/useFieldPanel.js +52 -42
- package/dist/composables/useFieldPanel.js.map +1 -1
- package/dist/composables/useFileField.d.ts +1 -3
- package/dist/composables/useFileField.js +48 -50
- package/dist/composables/useFileField.js.map +1 -1
- package/dist/composables/useHotkeyListener.d.ts +17 -0
- package/dist/composables/useHotkeyListener.js +29 -0
- package/dist/composables/useHotkeyListener.js.map +1 -0
- package/dist/composables/useIconClickHandlers.d.ts +2 -10
- package/dist/composables/useIconClickHandlers.js +1 -1
- package/dist/composables/useIconClickHandlers.js.map +1 -1
- package/dist/{components/VCombobox/infiniteScroll.d.ts → composables/useInfiniteScroll.d.ts} +6 -0
- package/dist/{components/VCombobox/infiniteScroll.js → composables/useInfiniteScroll.js} +9 -9
- package/dist/composables/useInfiniteScroll.js.map +1 -0
- package/dist/composables/useListbox.d.ts +132 -0
- package/dist/composables/useListbox.js +227 -0
- package/dist/composables/useListbox.js.map +1 -0
- package/dist/composables/useModalDialog.d.ts +28 -0
- package/dist/composables/useModalDialog.js +60 -0
- package/dist/composables/useModalDialog.js.map +1 -0
- package/dist/composables/useRootAttrs.d.ts +2 -3
- package/dist/composables/useRootAttrs.js.map +1 -1
- package/dist/composables/useTypeahead.d.ts +13 -0
- package/dist/composables/useTypeahead.js +23 -0
- package/dist/composables/useTypeahead.js.map +1 -0
- package/dist/composables/useVirtualList.d.ts +46 -0
- package/dist/composables/useVirtualList.js +145 -0
- package/dist/composables/useVirtualList.js.map +1 -0
- package/dist/i18n/en.js +50 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/fr.js +50 -0
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/state.d.ts +1 -1
- package/dist/i18n/state.js +17 -6
- package/dist/i18n/state.js.map +1 -1
- package/dist/i18n/types.d.ts +103 -2
- package/dist/icons.js +45 -37
- package/dist/index.d.ts +49 -3
- package/dist/index.js +80 -56
- package/dist/styles.css +1 -1
- package/dist/tokens/index.d.ts +43 -0
- package/dist/tokens/semantic.d.ts +42 -0
- package/dist/tokens/semantic.js +43 -1
- package/dist/tokens/semantic.js.map +1 -1
- package/dist/tokens/themes/dark.d.ts +1 -0
- package/dist/tokens/themes/dark.js +1 -0
- package/dist/tokens/themes/dark.js.map +1 -1
- package/dist/tokens.json +215 -1
- package/dist/types.d.ts +57 -4
- package/dist/utils/arrowNav.js.map +1 -1
- package/dist/utils/attrs.d.ts +9 -0
- package/dist/utils/attrs.js +14 -0
- package/dist/utils/attrs.js.map +1 -0
- package/dist/utils/date.d.ts +1 -0
- package/dist/utils/date.js +5 -4
- package/dist/utils/date.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/VCombobox/VComboboxGroup.css +0 -2
- package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -17
- package/dist/components/VCombobox/VComboboxGroup.js +0 -9
- package/dist/components/VCombobox/VComboboxGroup.js.map +0 -1
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +0 -21
- package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/VCombobox/VComboboxOption.css +0 -2
- package/dist/components/VCombobox/VComboboxOption.js +0 -9
- package/dist/components/VCombobox/VComboboxOption.js.map +0 -1
- package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/VCombobox/VComboboxSeparator.css +0 -2
- package/dist/components/VCombobox/VComboboxSeparator.js +0 -9
- package/dist/components/VCombobox/VComboboxSeparator.js.map +0 -1
- package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/components/VCombobox/infiniteScroll.js.map +0 -1
- /package/dist/components/{VCombobox/VComboboxSeparator.d.ts → VCheckbox/VCheckMark.d.ts} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Where `scrollToIndex` brings the row: to the top, the middle, the bottom, or barely in view. */
|
|
2
|
+
export type VirtualListAlign = ScrollLogicalPosition;
|
|
3
|
+
/** What the default slot receives for each rendered row. */
|
|
4
|
+
export interface VirtualListItemSlotProps<T> {
|
|
5
|
+
item: T;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
/** The props of VVirtualList, for a row type `T`. */
|
|
9
|
+
export interface VirtualListProps<T> {
|
|
10
|
+
/** The rows of the list, all of them: only those near the viewport are rendered. */
|
|
11
|
+
items: T[];
|
|
12
|
+
/**
|
|
13
|
+
* The field identifying a row, under which its measured height is remembered. Without it a
|
|
14
|
+
* row is identified by its position, which suits a list that only grows at the end.
|
|
15
|
+
*/
|
|
16
|
+
itemKey?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The height assumed for a row not rendered yet, in pixels. Each row is measured once it
|
|
19
|
+
* renders, so this is only an estimate; the closer it is, the steadier the scrollbar.
|
|
20
|
+
*/
|
|
21
|
+
itemSize?: number;
|
|
22
|
+
/** How many rows to render beyond each edge of the viewport, so a fast scroll shows no gap. */
|
|
23
|
+
overscan?: number;
|
|
24
|
+
/**
|
|
25
|
+
* How many rows to render before the list can measure its viewport: on the server and until
|
|
26
|
+
* the page is hydrated.
|
|
27
|
+
*/
|
|
28
|
+
initialCount?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The height of the list: a number of pixels or any CSS length. Without it, give the list a
|
|
31
|
+
* bounded height in your own CSS; a list that grows with its content renders every row.
|
|
32
|
+
*/
|
|
33
|
+
height?: number | string;
|
|
34
|
+
/** The accessible name of the list. */
|
|
35
|
+
label?: string;
|
|
36
|
+
/** Says that rows are being loaded: a row with a spinner ends the list. */
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
/** What that row says, and what the spinner is announced as. */
|
|
39
|
+
loadingText?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Says that there are more rows to come, which makes the list ask for them as its end comes
|
|
42
|
+
* into view. The total is then announced as unknown.
|
|
43
|
+
*/
|
|
44
|
+
hasMore?: boolean;
|
|
45
|
+
}
|
|
46
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
47
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<VirtualListProps<T> & {
|
|
48
|
+
"onLoad-more"?: (() => any) | undefined;
|
|
49
|
+
}> & (typeof globalThis extends {
|
|
50
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
51
|
+
} ? P : {});
|
|
52
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
53
|
+
/**
|
|
54
|
+
* Scrolls the list until a row is in view, rendering it first if needed. `align` places it at
|
|
55
|
+
* the top, the middle or the bottom; by default it moves as little as possible.
|
|
56
|
+
*/
|
|
57
|
+
scrollToIndex: (index: number, align?: VirtualListAlign) => Promise<void>;
|
|
58
|
+
/** The scrolling element, which carries the list role. */
|
|
59
|
+
el: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
60
|
+
}>) => void;
|
|
61
|
+
attrs: any;
|
|
62
|
+
slots: {
|
|
63
|
+
/** One row of the list. */
|
|
64
|
+
default(props: VirtualListItemSlotProps<T>): unknown;
|
|
65
|
+
/** Replaces the spinner and the text of the loading row. */
|
|
66
|
+
loading?(): unknown;
|
|
67
|
+
};
|
|
68
|
+
emit: (evt: "load-more") => void;
|
|
69
|
+
}>) => import('vue').VNode & {
|
|
70
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
71
|
+
};
|
|
72
|
+
declare const _default: typeof __VLS_export;
|
|
73
|
+
export default _default;
|
|
74
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
75
|
+
[K in keyof T]: T[K];
|
|
76
|
+
} : {
|
|
77
|
+
[K in keyof T as K]: T[K];
|
|
78
|
+
}) & {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './VVirtualList.css';
|
|
2
|
+
import e from "./VVirtualList.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/VVirtualList/VVirtualList.vue
|
|
5
|
+
var t = e;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=VVirtualList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VVirtualList.js","names":[],"sources":["../../../src/components/VVirtualList/VVirtualList.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\n// @a11y @ssr @core\n/**\n * A list too long to render whole: only the rows near its viewport exist in the page. It is its\n * own scroll container, focusable so the keyboard can scroll it, and each row says where it\n * stands in the whole list. Rows are measured as they render, so they may differ in height.\n */\nimport { computed, ref, toRaw, watch } from 'vue'\n\nimport VSpinner from '../VSpinner/VSpinner.vue'\nimport { useInfiniteScroll } from '../../composables/useInfiniteScroll'\nimport { useVirtualList } from '../../composables/useVirtualList'\nimport { useMessages } from '../../i18n/state'\nimport { cssSize } from '../../utils/css'\nimport { isDev } from '../../utils/env'\n\n/** Where `scrollToIndex` brings the row: to the top, the middle, the bottom, or barely in view. */\nexport type VirtualListAlign = ScrollLogicalPosition\n\n/** What the default slot receives for each rendered row. */\nexport interface VirtualListItemSlotProps<T> {\n item: T\n index: number\n}\n\n/** The props of VVirtualList, for a row type `T`. */\nexport interface VirtualListProps<T> {\n /** The rows of the list, all of them: only those near the viewport are rendered. */\n items: T[]\n /**\n * The field identifying a row, under which its measured height is remembered. Without it a\n * row is identified by its position, which suits a list that only grows at the end.\n */\n itemKey?: string\n /**\n * The height assumed for a row not rendered yet, in pixels. Each row is measured once it\n * renders, so this is only an estimate; the closer it is, the steadier the scrollbar.\n */\n itemSize?: number\n /** How many rows to render beyond each edge of the viewport, so a fast scroll shows no gap. */\n overscan?: number\n /**\n * How many rows to render before the list can measure its viewport: on the server and until\n * the page is hydrated.\n */\n initialCount?: number\n /**\n * The height of the list: a number of pixels or any CSS length. Without it, give the list a\n * bounded height in your own CSS; a list that grows with its content renders every row.\n */\n height?: number | string\n /** The accessible name of the list. */\n label?: string\n /** Says that rows are being loaded: a row with a spinner ends the list. */\n loading?: boolean\n /** What that row says, and what the spinner is announced as. */\n loadingText?: string\n /**\n * Says that there are more rows to come, which makes the list ask for them as its end comes\n * into view. The total is then announced as unknown.\n */\n hasMore?: boolean\n}\n\nconst props = withDefaults(defineProps<VirtualListProps<T>>(), {\n itemKey: undefined,\n itemSize: 40,\n overscan: 5,\n initialCount: 10,\n height: undefined,\n label: undefined,\n loading: false,\n loadingText: undefined,\n hasMore: false,\n})\n\nconst emit = defineEmits<{\n /** The end of the list has come into view: send the next rows. */\n 'load-more': []\n}>()\n\ndefineSlots<{\n /** One row of the list. */\n default(props: VirtualListItemSlotProps<T>): unknown\n /** Replaces the spinner and the text of the loading row. */\n loading?(): unknown\n}>()\n\nconst m = useMessages()\nconst resolvedLoadingText = computed(() => props.loadingText ?? m.value.common.loading)\n\nconst listEl = ref<HTMLElement | null>(null)\nconst sentinelEl = ref<HTMLElement | null>(null)\n\n// Read through the raw array: computing the offsets visits every row's key, and a reactive read\n// for each of a hundred thousand rows is what would make scrolling stutter. The length is still\n// read reactively, so rows pushed in place are seen.\nfunction keyOf(index: number): unknown {\n if (!props.itemKey) return index\n const item = toRaw(props.items)[index] as Record<string, unknown> | undefined\n return item?.[props.itemKey]\n}\n\n// @a11y\n// The row holding the focus stays rendered while the list scrolls away from it: dropping it\n// would send the focus back to the page.\nconst focusedIndex = ref(-1)\n\nconst virtualList = useVirtualList({\n scrollEl: listEl,\n count: () => props.items.length,\n key: keyOf,\n itemSize: () => props.itemSize,\n overscan: () => props.overscan,\n initialCount: () => props.initialCount,\n pinned: () => (focusedIndex.value >= 0 ? [focusedIndex.value] : []),\n})\nconst { segments, measure } = virtualList\n\nfunction rowOf(target: EventTarget | null) {\n if (!(target instanceof Element)) return -1\n const row = target.closest('.v-virtual-list-item')\n if (!row || row.parentElement !== listEl.value) return -1\n return Number((row as HTMLElement).dataset.index)\n}\n\nfunction onFocusin(event: FocusEvent) {\n focusedIndex.value = rowOf(event.target)\n}\n\nfunction onFocusout(event: FocusEvent) {\n focusedIndex.value = rowOf(event.relatedTarget)\n}\n\nuseInfiniteScroll({\n sentinelEl,\n root: () => listEl.value,\n canLoad: () => props.hasMore && !props.loading,\n loaded: () => props.items,\n onLoadMore: () => emit('load-more'),\n})\n\n// @devwarn\n// A list without a bounded height grows with its content, so every row is in view and\n// rendered: the symptom is a long list that never scrolls.\nif (isDev) {\n watch(\n segments,\n (list) => {\n const el = listEl.value\n if (!el || props.items.length < 100 || el.scrollHeight > el.clientHeight) return\n if (list.some((segment) => segment.type === 'spacer')) return\n console.warn(\n '[VVirtualList] Every row is rendered because the list does not scroll: give it a `height` or a bounded height in CSS.',\n )\n },\n { flush: 'post', once: true },\n )\n}\n\ndefineExpose({\n /**\n * Scrolls the list until a row is in view, rendering it first if needed. `align` places it at\n * the top, the middle or the bottom; by default it moves as little as possible.\n */\n scrollToIndex: (index: number, align?: VirtualListAlign) =>\n virtualList.scrollToIndex(index, align),\n /** The scrolling element, which carries the list role. */\n el: listEl,\n})\n</script>\n\n<template>\n <div\n ref=\"listEl\"\n class=\"v-virtual-list\"\n role=\"list\"\n tabindex=\"0\"\n :aria-label=\"label\"\n :aria-busy=\"loading ? 'true' : undefined\"\n :style=\"{ blockSize: cssSize(height) }\"\n @focusin=\"onFocusin\"\n @focusout=\"onFocusout\"\n >\n <template\n v-for=\"segment in segments\"\n :key=\"segment.type === 'row' ? `row:${String(keyOf(segment.index))}` : segment.key\"\n >\n <div\n v-if=\"segment.type === 'spacer'\"\n class=\"v-virtual-list-spacer\"\n aria-hidden=\"true\"\n :style=\"{ blockSize: `${segment.size}px` }\"\n />\n <div\n v-else\n :ref=\"(el) => measure(el as Element | null, segment.index)\"\n role=\"listitem\"\n class=\"v-virtual-list-item\"\n :aria-setsize=\"hasMore ? -1 : items.length\"\n :aria-posinset=\"segment.index + 1\"\n :data-index=\"segment.index\"\n >\n <slot :item=\"items[segment.index]!\" :index=\"segment.index\" />\n </div>\n </template>\n\n <!--\n A single element for as long as more rows may come: replacing it would cancel the\n observation, and no further rows would be asked for. Hidden from assistive technology,\n which hears `aria-busy` on the list instead.\n -->\n <div v-if=\"hasMore || loading\" ref=\"sentinelEl\" class=\"v-virtual-list-more\" aria-hidden=\"true\">\n <slot v-if=\"loading\" name=\"loading\">\n <VSpinner :label=\"resolvedLoadingText\" />\n <span>{{ resolvedLoadingText }}</span>\n </slot>\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The list corrects its scroll itself when a row above the view changes height; the browser's\n * own anchoring would apply the same correction a second time. Positioned, so it contains the\n * absolutely positioned parts of the rows: positioned against an ancestor beyond it, they\n * escape its clip and stretch the page.\n */\n .v-virtual-list {\n position: relative;\n display: block;\n overflow-y: auto;\n overflow-anchor: none;\n border-radius: var(--vectis-radius-xs);\n }\n\n .v-virtual-list:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /*\n * A row contains the margins of its content: collapsing through it, they would sit between\n * rows where no measurement sees them.\n */\n .v-virtual-list-item {\n display: flow-root;\n }\n\n .v-virtual-list-more {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--vectis-space-2);\n min-block-size: var(--vectis-control-height-md);\n padding: var(--vectis-space-2);\n font-size: var(--vectis-text-body-sm-size);\n font-weight: var(--vectis-text-body-sm-weight);\n line-height: var(--vectis-text-body-sm-leading);\n color: var(--vectis-color-text-muted);\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { isDev as e } from "../../utils/env.js";
|
|
2
|
+
import { useMessages as t } from "../../i18n/state.js";
|
|
3
|
+
import { cssSize as n } from "../../utils/css.js";
|
|
4
|
+
import r from "../VSpinner/VSpinner.js";
|
|
5
|
+
import { useInfiniteScroll as i } from "../../composables/useInfiniteScroll.js";
|
|
6
|
+
import { useVirtualList as a } from "../../composables/useVirtualList.js";
|
|
7
|
+
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeStyle as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, toRaw as y, unref as b, watch as x } from "vue";
|
|
8
|
+
//#region src/components/VVirtualList/VVirtualList.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var S = ["aria-label", "aria-busy"], C = [
|
|
10
|
+
"aria-setsize",
|
|
11
|
+
"aria-posinset",
|
|
12
|
+
"data-index"
|
|
13
|
+
], w = /*@__PURE__*/ f({
|
|
14
|
+
__name: "VVirtualList",
|
|
15
|
+
props: {
|
|
16
|
+
items: {},
|
|
17
|
+
itemKey: { default: void 0 },
|
|
18
|
+
itemSize: { default: 40 },
|
|
19
|
+
overscan: { default: 5 },
|
|
20
|
+
initialCount: { default: 10 },
|
|
21
|
+
height: { default: void 0 },
|
|
22
|
+
label: { default: void 0 },
|
|
23
|
+
loading: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
loadingText: { default: void 0 },
|
|
28
|
+
hasMore: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["load-more"],
|
|
34
|
+
setup(f, { expose: w, emit: T }) {
|
|
35
|
+
let E = f, D = T, O = t(), k = s(() => E.loadingText ?? O.value.common.loading), A = h(null), j = h(null);
|
|
36
|
+
function M(e) {
|
|
37
|
+
return E.itemKey ? y(E.items)[e]?.[E.itemKey] : e;
|
|
38
|
+
}
|
|
39
|
+
let N = h(-1), P = a({
|
|
40
|
+
scrollEl: A,
|
|
41
|
+
count: () => E.items.length,
|
|
42
|
+
key: M,
|
|
43
|
+
itemSize: () => E.itemSize,
|
|
44
|
+
overscan: () => E.overscan,
|
|
45
|
+
initialCount: () => E.initialCount,
|
|
46
|
+
pinned: () => N.value >= 0 ? [N.value] : []
|
|
47
|
+
}), { segments: F, measure: I } = P;
|
|
48
|
+
function L(e) {
|
|
49
|
+
if (!(e instanceof Element)) return -1;
|
|
50
|
+
let t = e.closest(".v-virtual-list-item");
|
|
51
|
+
return !t || t.parentElement !== A.value ? -1 : Number(t.dataset.index);
|
|
52
|
+
}
|
|
53
|
+
function R(e) {
|
|
54
|
+
N.value = L(e.target);
|
|
55
|
+
}
|
|
56
|
+
function z(e) {
|
|
57
|
+
N.value = L(e.relatedTarget);
|
|
58
|
+
}
|
|
59
|
+
return i({
|
|
60
|
+
sentinelEl: j,
|
|
61
|
+
root: () => A.value,
|
|
62
|
+
canLoad: () => E.hasMore && !E.loading,
|
|
63
|
+
loaded: () => E.items,
|
|
64
|
+
onLoadMore: () => D("load-more")
|
|
65
|
+
}), e && x(F, (e) => {
|
|
66
|
+
let t = A.value;
|
|
67
|
+
!t || E.items.length < 100 || t.scrollHeight > t.clientHeight || e.some((e) => e.type === "spacer") || console.warn("[VVirtualList] Every row is rendered because the list does not scroll: give it a `height` or a bounded height in CSS.");
|
|
68
|
+
}, {
|
|
69
|
+
flush: "post",
|
|
70
|
+
once: !0
|
|
71
|
+
}), w({
|
|
72
|
+
scrollToIndex: (e, t) => P.scrollToIndex(e, t),
|
|
73
|
+
el: A
|
|
74
|
+
}), (e, t) => (m(), l("div", {
|
|
75
|
+
ref_key: "listEl",
|
|
76
|
+
ref: A,
|
|
77
|
+
class: "v-virtual-list",
|
|
78
|
+
role: "list",
|
|
79
|
+
tabindex: "0",
|
|
80
|
+
"aria-label": f.label,
|
|
81
|
+
"aria-busy": f.loading ? "true" : void 0,
|
|
82
|
+
style: p({ blockSize: b(n)(f.height) }),
|
|
83
|
+
onFocusin: R,
|
|
84
|
+
onFocusout: z
|
|
85
|
+
}, [(m(!0), l(o, null, g(b(F), (t) => (m(), l(o, { key: t.type === "row" ? `row:${String(M(t.index))}` : t.key }, [t.type === "spacer" ? (m(), l("div", {
|
|
86
|
+
key: 0,
|
|
87
|
+
class: "v-virtual-list-spacer",
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
style: p({ blockSize: `${t.size}px` })
|
|
90
|
+
}, null, 4)) : (m(), l("div", {
|
|
91
|
+
key: 1,
|
|
92
|
+
ref_for: !0,
|
|
93
|
+
ref: (e) => b(I)(e, t.index),
|
|
94
|
+
role: "listitem",
|
|
95
|
+
class: "v-virtual-list-item",
|
|
96
|
+
"aria-setsize": f.hasMore ? -1 : f.items.length,
|
|
97
|
+
"aria-posinset": t.index + 1,
|
|
98
|
+
"data-index": t.index
|
|
99
|
+
}, [_(e.$slots, "default", {
|
|
100
|
+
item: f.items[t.index],
|
|
101
|
+
index: t.index
|
|
102
|
+
})], 8, C))], 64))), 128)), f.hasMore || f.loading ? (m(), l("div", {
|
|
103
|
+
key: 0,
|
|
104
|
+
ref_key: "sentinelEl",
|
|
105
|
+
ref: j,
|
|
106
|
+
class: "v-virtual-list-more",
|
|
107
|
+
"aria-hidden": "true"
|
|
108
|
+
}, [f.loading ? _(e.$slots, "loading", {}, () => [d(r, { label: k.value }, null, 8, ["label"]), u("span", null, v(k.value), 1)], void 0, 0) : c("", !0)], 512)) : c("", !0)], 44, S));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
//#endregion
|
|
112
|
+
export { w as default };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=VVirtualList.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VVirtualList.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VVirtualList/VVirtualList.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\n// @a11y @ssr @core\n/**\n * A list too long to render whole: only the rows near its viewport exist in the page. It is its\n * own scroll container, focusable so the keyboard can scroll it, and each row says where it\n * stands in the whole list. Rows are measured as they render, so they may differ in height.\n */\nimport { computed, ref, toRaw, watch } from 'vue'\n\nimport VSpinner from '../VSpinner/VSpinner.vue'\nimport { useInfiniteScroll } from '../../composables/useInfiniteScroll'\nimport { useVirtualList } from '../../composables/useVirtualList'\nimport { useMessages } from '../../i18n/state'\nimport { cssSize } from '../../utils/css'\nimport { isDev } from '../../utils/env'\n\n/** Where `scrollToIndex` brings the row: to the top, the middle, the bottom, or barely in view. */\nexport type VirtualListAlign = ScrollLogicalPosition\n\n/** What the default slot receives for each rendered row. */\nexport interface VirtualListItemSlotProps<T> {\n item: T\n index: number\n}\n\n/** The props of VVirtualList, for a row type `T`. */\nexport interface VirtualListProps<T> {\n /** The rows of the list, all of them: only those near the viewport are rendered. */\n items: T[]\n /**\n * The field identifying a row, under which its measured height is remembered. Without it a\n * row is identified by its position, which suits a list that only grows at the end.\n */\n itemKey?: string\n /**\n * The height assumed for a row not rendered yet, in pixels. Each row is measured once it\n * renders, so this is only an estimate; the closer it is, the steadier the scrollbar.\n */\n itemSize?: number\n /** How many rows to render beyond each edge of the viewport, so a fast scroll shows no gap. */\n overscan?: number\n /**\n * How many rows to render before the list can measure its viewport: on the server and until\n * the page is hydrated.\n */\n initialCount?: number\n /**\n * The height of the list: a number of pixels or any CSS length. Without it, give the list a\n * bounded height in your own CSS; a list that grows with its content renders every row.\n */\n height?: number | string\n /** The accessible name of the list. */\n label?: string\n /** Says that rows are being loaded: a row with a spinner ends the list. */\n loading?: boolean\n /** What that row says, and what the spinner is announced as. */\n loadingText?: string\n /**\n * Says that there are more rows to come, which makes the list ask for them as its end comes\n * into view. The total is then announced as unknown.\n */\n hasMore?: boolean\n}\n\nconst props = withDefaults(defineProps<VirtualListProps<T>>(), {\n itemKey: undefined,\n itemSize: 40,\n overscan: 5,\n initialCount: 10,\n height: undefined,\n label: undefined,\n loading: false,\n loadingText: undefined,\n hasMore: false,\n})\n\nconst emit = defineEmits<{\n /** The end of the list has come into view: send the next rows. */\n 'load-more': []\n}>()\n\ndefineSlots<{\n /** One row of the list. */\n default(props: VirtualListItemSlotProps<T>): unknown\n /** Replaces the spinner and the text of the loading row. */\n loading?(): unknown\n}>()\n\nconst m = useMessages()\nconst resolvedLoadingText = computed(() => props.loadingText ?? m.value.common.loading)\n\nconst listEl = ref<HTMLElement | null>(null)\nconst sentinelEl = ref<HTMLElement | null>(null)\n\n// Read through the raw array: computing the offsets visits every row's key, and a reactive read\n// for each of a hundred thousand rows is what would make scrolling stutter. The length is still\n// read reactively, so rows pushed in place are seen.\nfunction keyOf(index: number): unknown {\n if (!props.itemKey) return index\n const item = toRaw(props.items)[index] as Record<string, unknown> | undefined\n return item?.[props.itemKey]\n}\n\n// @a11y\n// The row holding the focus stays rendered while the list scrolls away from it: dropping it\n// would send the focus back to the page.\nconst focusedIndex = ref(-1)\n\nconst virtualList = useVirtualList({\n scrollEl: listEl,\n count: () => props.items.length,\n key: keyOf,\n itemSize: () => props.itemSize,\n overscan: () => props.overscan,\n initialCount: () => props.initialCount,\n pinned: () => (focusedIndex.value >= 0 ? [focusedIndex.value] : []),\n})\nconst { segments, measure } = virtualList\n\nfunction rowOf(target: EventTarget | null) {\n if (!(target instanceof Element)) return -1\n const row = target.closest('.v-virtual-list-item')\n if (!row || row.parentElement !== listEl.value) return -1\n return Number((row as HTMLElement).dataset.index)\n}\n\nfunction onFocusin(event: FocusEvent) {\n focusedIndex.value = rowOf(event.target)\n}\n\nfunction onFocusout(event: FocusEvent) {\n focusedIndex.value = rowOf(event.relatedTarget)\n}\n\nuseInfiniteScroll({\n sentinelEl,\n root: () => listEl.value,\n canLoad: () => props.hasMore && !props.loading,\n loaded: () => props.items,\n onLoadMore: () => emit('load-more'),\n})\n\n// @devwarn\n// A list without a bounded height grows with its content, so every row is in view and\n// rendered: the symptom is a long list that never scrolls.\nif (isDev) {\n watch(\n segments,\n (list) => {\n const el = listEl.value\n if (!el || props.items.length < 100 || el.scrollHeight > el.clientHeight) return\n if (list.some((segment) => segment.type === 'spacer')) return\n console.warn(\n '[VVirtualList] Every row is rendered because the list does not scroll: give it a `height` or a bounded height in CSS.',\n )\n },\n { flush: 'post', once: true },\n )\n}\n\ndefineExpose({\n /**\n * Scrolls the list until a row is in view, rendering it first if needed. `align` places it at\n * the top, the middle or the bottom; by default it moves as little as possible.\n */\n scrollToIndex: (index: number, align?: VirtualListAlign) =>\n virtualList.scrollToIndex(index, align),\n /** The scrolling element, which carries the list role. */\n el: listEl,\n})\n</script>\n\n<template>\n <div\n ref=\"listEl\"\n class=\"v-virtual-list\"\n role=\"list\"\n tabindex=\"0\"\n :aria-label=\"label\"\n :aria-busy=\"loading ? 'true' : undefined\"\n :style=\"{ blockSize: cssSize(height) }\"\n @focusin=\"onFocusin\"\n @focusout=\"onFocusout\"\n >\n <template\n v-for=\"segment in segments\"\n :key=\"segment.type === 'row' ? `row:${String(keyOf(segment.index))}` : segment.key\"\n >\n <div\n v-if=\"segment.type === 'spacer'\"\n class=\"v-virtual-list-spacer\"\n aria-hidden=\"true\"\n :style=\"{ blockSize: `${segment.size}px` }\"\n />\n <div\n v-else\n :ref=\"(el) => measure(el as Element | null, segment.index)\"\n role=\"listitem\"\n class=\"v-virtual-list-item\"\n :aria-setsize=\"hasMore ? -1 : items.length\"\n :aria-posinset=\"segment.index + 1\"\n :data-index=\"segment.index\"\n >\n <slot :item=\"items[segment.index]!\" :index=\"segment.index\" />\n </div>\n </template>\n\n <!--\n A single element for as long as more rows may come: replacing it would cancel the\n observation, and no further rows would be asked for. Hidden from assistive technology,\n which hears `aria-busy` on the list instead.\n -->\n <div v-if=\"hasMore || loading\" ref=\"sentinelEl\" class=\"v-virtual-list-more\" aria-hidden=\"true\">\n <slot v-if=\"loading\" name=\"loading\">\n <VSpinner :label=\"resolvedLoadingText\" />\n <span>{{ resolvedLoadingText }}</span>\n </slot>\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The list corrects its scroll itself when a row above the view changes height; the browser's\n * own anchoring would apply the same correction a second time. Positioned, so it contains the\n * absolutely positioned parts of the rows: positioned against an ancestor beyond it, they\n * escape its clip and stretch the page.\n */\n .v-virtual-list {\n position: relative;\n display: block;\n overflow-y: auto;\n overflow-anchor: none;\n border-radius: var(--vectis-radius-xs);\n }\n\n .v-virtual-list:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /*\n * A row contains the margins of its content: collapsing through it, they would sit between\n * rows where no measurement sees them.\n */\n .v-virtual-list-item {\n display: flow-root;\n }\n\n .v-virtual-list-more {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--vectis-space-2);\n min-block-size: var(--vectis-control-height-md);\n padding: var(--vectis-space-2);\n font-size: var(--vectis-text-body-sm-size);\n font-weight: var(--vectis-text-body-sm-weight);\n line-height: var(--vectis-text-body-sm-leading);\n color: var(--vectis-color-text-muted);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEA,IAAM,IAAQ,GAYR,IAAO,GAYP,IAAI,EAAY,GAChB,IAAsB,QAAe,EAAM,eAAe,EAAE,MAAM,OAAO,OAAO,GAEhF,IAAS,EAAwB,IAAI,GACrC,IAAa,EAAwB,IAAI;EAK/C,SAAS,EAAM,GAAwB;GAGrC,OAFK,EAAM,UACE,EAAM,EAAM,KAAK,CAAC,CAAC,EACzB,GAAO,EAAM,WAFO;EAG7B;EAKA,IAAM,IAAe,EAAI,EAAE,GAErB,IAAc,EAAe;GACjC,UAAU;GACV,aAAa,EAAM,MAAM;GACzB,KAAK;GACL,gBAAgB,EAAM;GACtB,gBAAgB,EAAM;GACtB,oBAAoB,EAAM;GAC1B,cAAe,EAAa,SAAS,IAAI,CAAC,EAAa,KAAK,IAAI,CAAC;EACnE,CAAC,GACK,EAAE,aAAU,eAAY;EAE9B,SAAS,EAAM,GAA4B;GACzC,IAAI,EAAE,aAAkB,UAAU,OAAO;GACzC,IAAM,IAAM,EAAO,QAAQ,sBAAsB;GAEjD,OADI,CAAC,KAAO,EAAI,kBAAkB,EAAO,QAAc,KAChD,OAAQ,EAAoB,QAAQ,KAAK;EAClD;EAEA,SAAS,EAAU,GAAmB;GACpC,EAAa,QAAQ,EAAM,EAAM,MAAM;EACzC;EAEA,SAAS,EAAW,GAAmB;GACrC,EAAa,QAAQ,EAAM,EAAM,aAAa;EAChD;SAEA,EAAkB;GAChB;GACA,YAAY,EAAO;GACnB,eAAe,EAAM,WAAW,CAAC,EAAM;GACvC,cAAc,EAAM;GACpB,kBAAkB,EAAK,WAAW;EACpC,CAAC,GAKG,KACF,EACE,IACC,MAAS;GACR,IAAM,IAAK,EAAO;GACd,CAAC,KAAM,EAAM,MAAM,SAAS,OAAO,EAAG,eAAe,EAAG,gBACxD,EAAK,MAAM,MAAY,EAAQ,SAAS,QAAQ,KACpD,QAAQ,KACN,uHACF;EACF,GACA;GAAE,OAAO;GAAQ,MAAM;EAAK,CAC9B,GAGF,EAAa;GAKX,gBAAgB,GAAe,MAC7B,EAAY,cAAc,GAAO,CAAK;GAExC,IAAI;EACN,CAAC,mBAIC,EA6CM,OAAA;YA5CA;GAAJ,KAAI;GACJ,OAAM;GACN,MAAK;GACL,UAAS;GACR,cAAY,EAAA;GACZ,aAAW,EAAA,UAAO,SAAY,KAAA;GAC9B,OAAK,EAAA,EAAA,WAAe,EAAA,CAAA,CAAO,CAAC,EAAA,MAAM,EAAA,CAAA;GACzB;GACC;cAEX,EAqBW,GAAA,MAAA,EApBS,EAAA,CAAA,IAAX,wBACD,EAAQ,SAAI,QAAA,OAAoB,OAAO,EAAM,EAAQ,KAAK,CAAA,MAAO,EAAQ,IAAA,GAAA,CAGvE,EAAQ,SAAI,YAAA,EAAA,GADpB,EAKE,OAAA;;GAHA,OAAM;GACN,eAAY;GACX,OAAK,EAAA,EAAA,WAAA,GAAkB,EAAQ,KAAI,IAAA,CAAA;uBAEtC,EAUM,OAAA;;;GARH,MAAM,MAAO,EAAA,CAAA,CAAO,CAAC,GAAsB,EAAQ,KAAK;GACzD,MAAK;GACL,OAAM;GACL,gBAAc,EAAA,UAAO,KAAQ,EAAA,MAAM;GACnC,iBAAe,EAAQ,QAAK;GAC5B,cAAY,EAAQ;MAErB,EAA6D,EAAA,QAAA,WAAA;GAAtD,MAAM,EAAA,MAAM,EAAQ;GAAU,OAAO,EAAQ;8BAS7C,EAAA,WAAW,EAAA,WAAA,EAAA,GAAtB,EAKM,OAAA;;YAL6B;GAAJ,KAAI;GAAa,OAAM;GAAsB,eAAY;MAC1E,EAAA,UAAZ,EAGO,EAAA,QAAA,WAAA,CAAA,SAAA,CAFL,EAAyC,GAAA,EAA9B,OAAO,EAAA,MAAmB,GAAA,MAAA,GAAA,CAAA,OAAA,CAAA,GACrC,EAAsC,QAAA,MAAA,EAA7B,EAAA,KAAmB,GAAA,CAAA,CAAA,GAAA,KAAA,GAAA,CAAA,IAAA,EAAA,IAAA,EAAA,CAAA,GAAA,GAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,IAAA,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wiring VCheckbox, VRadio and VSwitch share. Their root is a layout box, so every attribute
|
|
3
|
+
* but `class` and `style` goes to the native input, where `name`, `required` and the aria-*
|
|
4
|
+
* take part in the form and the accessibility tree. The hint and the error are referenced from
|
|
5
|
+
* the input rather than nested in its label, so they are read after the name. The component
|
|
6
|
+
* declares `inheritAttrs: false` itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useChoice(props: {
|
|
9
|
+
hint?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
readonly: boolean;
|
|
12
|
+
}): {
|
|
13
|
+
rootClass: import('vue').ComputedRef<string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | (string | false | Record<string, unknown> | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined>;
|
|
14
|
+
rootStyle: import('vue').ComputedRef<import('vue').StyleValue>;
|
|
15
|
+
forwardedAttrs: import('vue').ComputedRef<Record<string, unknown>>;
|
|
16
|
+
hintId: string;
|
|
17
|
+
errorId: string;
|
|
18
|
+
describedBy: import('vue').ComputedRef<string | undefined>;
|
|
19
|
+
inputEl: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
20
|
+
refuseWhenReadonly: (event: MouseEvent) => void;
|
|
21
|
+
/** What the component exposes: its root is a layout box, so these reach the real input. */
|
|
22
|
+
exposed: {
|
|
23
|
+
/** Moves the focus to the native input. */
|
|
24
|
+
focus: (options?: FocusOptions) => void | undefined;
|
|
25
|
+
/** The native input, for what `focus` does not cover. */
|
|
26
|
+
el: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useRootAttrs as e } from "./useRootAttrs.js";
|
|
2
|
+
import { useFieldIds as t } from "./useFieldIds.js";
|
|
3
|
+
import { ref as n } from "vue";
|
|
4
|
+
//#region src/composables/useChoice.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { attrs: i, rootClass: a, rootStyle: o, forwardedAttrs: s } = e(), { hintId: c, errorId: l, describedBy: u } = t(i, () => !!r.hint && !r.error, void 0, () => !!r.error), d = n(null);
|
|
7
|
+
function f(e) {
|
|
8
|
+
r.readonly && e.preventDefault();
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
rootClass: a,
|
|
12
|
+
rootStyle: o,
|
|
13
|
+
forwardedAttrs: s,
|
|
14
|
+
hintId: c,
|
|
15
|
+
errorId: l,
|
|
16
|
+
describedBy: u,
|
|
17
|
+
inputEl: d,
|
|
18
|
+
refuseWhenReadonly: f,
|
|
19
|
+
exposed: {
|
|
20
|
+
focus: (e) => d.value?.focus(e),
|
|
21
|
+
el: d
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { r as useChoice };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=useChoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChoice.js","names":[],"sources":["../../src/composables/useChoice.ts"],"sourcesContent":["import { ref } from 'vue'\n\nimport { useFieldIds } from './useFieldIds'\nimport { useRootAttrs } from './useRootAttrs'\n\n// @a11y @core\n/**\n * The wiring VCheckbox, VRadio and VSwitch share. Their root is a layout box, so every attribute\n * but `class` and `style` goes to the native input, where `name`, `required` and the aria-*\n * take part in the form and the accessibility tree. The hint and the error are referenced from\n * the input rather than nested in its label, so they are read after the name. The component\n * declares `inheritAttrs: false` itself.\n */\nexport function useChoice(props: { hint?: string; error?: string; readonly: boolean }) {\n const { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n const { hintId, errorId, describedBy } = useFieldIds(\n attrs,\n () => !!props.hint && !props.error,\n undefined,\n () => !!props.error,\n )\n\n const inputEl = ref<HTMLInputElement | null>(null)\n\n /**\n * The native `readonly` attribute does nothing on a checkbox or a radio. Cancelling the click\n * refuses the change: the browser puts the previous state back and fires no `change`, so the\n * model never hears of it.\n */\n function refuseWhenReadonly(event: MouseEvent) {\n if (props.readonly) event.preventDefault()\n }\n\n return {\n rootClass,\n rootStyle,\n forwardedAttrs,\n hintId,\n errorId,\n describedBy,\n inputEl,\n refuseWhenReadonly,\n /** What the component exposes: its root is a layout box, so these reach the real input. */\n exposed: {\n /** Moves the focus to the native input. */\n focus: (options?: FocusOptions) => inputEl.value?.focus(options),\n /** The native input, for what `focus` does not cover. */\n el: inputEl,\n },\n }\n}\n"],"mappings":";;;;AAaA,SAAgB,EAAU,GAA6D;CACrF,IAAM,EAAE,UAAO,cAAW,cAAW,sBAAmB,EAAa,GAC/D,EAAE,WAAQ,YAAS,mBAAgB,EACvC,SACM,CAAC,CAAC,EAAM,QAAQ,CAAC,EAAM,OAC7B,KAAA,SACM,CAAC,CAAC,EAAM,KAChB,GAEM,IAAU,EAA6B,IAAI;CAOjD,SAAS,EAAmB,GAAmB;EAC7C,AAAI,EAAM,YAAU,EAAM,eAAe;CAC3C;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,SAAS;GAEP,QAAQ,MAA2B,EAAQ,OAAO,MAAM,CAAO;GAE/D,IAAI;EACN;CACF;AACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports a search term to an outside source, as VCombobox and VCommandPalette do: after a delay
|
|
3
|
+
* that each keystroke re-arms, never twice for the same term, so reopening on an unchanged term
|
|
4
|
+
* asks nothing again, and not at all once the panel has closed during the wait. The panel's state
|
|
5
|
+
* is read when the delay runs out rather than when it is armed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useDebouncedSearch(options: {
|
|
8
|
+
/** How long to wait after the last keystroke, in milliseconds. */
|
|
9
|
+
delay: () => number;
|
|
10
|
+
/** Whether the panel the results go to is still open. */
|
|
11
|
+
active: () => boolean;
|
|
12
|
+
/** Reports the term. */
|
|
13
|
+
report: (term: string) => void;
|
|
14
|
+
}): {
|
|
15
|
+
request: (term: string, immediate?: boolean) => void;
|
|
16
|
+
cancel: () => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useTimer as e } from "./useTimer.js";
|
|
2
|
+
//#region src/composables/useDebouncedSearch.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = e(), r;
|
|
5
|
+
function i(e, i = !1) {
|
|
6
|
+
n.cancel(), e !== r && n.start(() => {
|
|
7
|
+
t.active() && (r = e, t.report(e));
|
|
8
|
+
}, i ? 0 : t.delay());
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
request: i,
|
|
12
|
+
cancel: n.cancel
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as useDebouncedSearch };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=useDebouncedSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedSearch.js","names":[],"sources":["../../src/composables/useDebouncedSearch.ts"],"sourcesContent":["import { useTimer } from './useTimer'\n\n// @core\n/**\n * Reports a search term to an outside source, as VCombobox and VCommandPalette do: after a delay\n * that each keystroke re-arms, never twice for the same term, so reopening on an unchanged term\n * asks nothing again, and not at all once the panel has closed during the wait. The panel's state\n * is read when the delay runs out rather than when it is armed.\n */\nexport function useDebouncedSearch(options: {\n /** How long to wait after the last keystroke, in milliseconds. */\n delay: () => number\n /** Whether the panel the results go to is still open. */\n active: () => boolean\n /** Reports the term. */\n report: (term: string) => void\n}): { request: (term: string, immediate?: boolean) => void; cancel: () => void } {\n const timer = useTimer()\n let lastReported: string | undefined\n\n function request(term: string, immediate = false) {\n timer.cancel()\n if (term === lastReported) return\n timer.start(\n () => {\n if (!options.active()) return\n lastReported = term\n options.report(term)\n },\n immediate ? 0 : options.delay(),\n )\n }\n\n return { request, cancel: timer.cancel }\n}\n"],"mappings":";;AASA,SAAgB,EAAmB,GAO8C;CAC/E,IAAM,IAAQ,EAAS,GACnB;CAEJ,SAAS,EAAQ,GAAc,IAAY,IAAO;EAChD,EAAM,OAAO,GACT,MAAS,KACb,EAAM,YACE;GACC,EAAQ,OAAO,MACpB,IAAe,GACf,EAAQ,OAAO,CAAI;EACrB,GACA,IAAY,IAAI,EAAQ,MAAM,CAChC;CACF;CAEA,OAAO;EAAE;EAAS,QAAQ,EAAM;CAAO;AACzC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape dismisses an overlay opened by hover or focus from anywhere on the page (WCAG 1.4.13),
|
|
3
|
+
* for a magnifier user whose view it may be covering. Such an overlay rarely holds the focus, so
|
|
4
|
+
* the key is heard on the document while it shows, and it is spent there: inside a VDialog it
|
|
5
|
+
* would otherwise also be the dialog's close request. Returns the switch to call as the overlay
|
|
6
|
+
* opens and closes; the listener goes with the component.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useEscapeDismiss(onEscape: () => void): (active: boolean) => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { onBeforeUnmount as e } from "vue";
|
|
2
|
+
//#region src/composables/useEscapeDismiss.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = !1;
|
|
5
|
+
function r(e) {
|
|
6
|
+
e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), t());
|
|
7
|
+
}
|
|
8
|
+
function i(e) {
|
|
9
|
+
e !== n && (n = e, e ? document.addEventListener("keydown", r) : document.removeEventListener("keydown", r));
|
|
10
|
+
}
|
|
11
|
+
return e(() => i(!1)), i;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as useEscapeDismiss };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useEscapeDismiss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEscapeDismiss.js","names":[],"sources":["../../src/composables/useEscapeDismiss.ts"],"sourcesContent":["import { onBeforeUnmount } from 'vue'\n\n// @keyboard @a11y\n/**\n * Escape dismisses an overlay opened by hover or focus from anywhere on the page (WCAG 1.4.13),\n * for a magnifier user whose view it may be covering. Such an overlay rarely holds the focus, so\n * the key is heard on the document while it shows, and it is spent there: inside a VDialog it\n * would otherwise also be the dialog's close request. Returns the switch to call as the overlay\n * opens and closes; the listener goes with the component.\n */\nexport function useEscapeDismiss(onEscape: () => void): (active: boolean) => void {\n let listening = false\n\n function onKeydown(event: KeyboardEvent) {\n if (event.key !== 'Escape' || event.defaultPrevented) return\n event.preventDefault()\n onEscape()\n }\n\n function listen(active: boolean) {\n if (active === listening) return\n listening = active\n if (active) document.addEventListener('keydown', onKeydown)\n else document.removeEventListener('keydown', onKeydown)\n }\n\n onBeforeUnmount(() => listen(false))\n return listen\n}\n"],"mappings":";;AAUA,SAAgB,EAAiB,GAAiD;CAChF,IAAI,IAAY;CAEhB,SAAS,EAAU,GAAsB;EACnC,EAAM,QAAQ,YAAY,EAAM,qBACpC,EAAM,eAAe,GACrB,EAAS;CACX;CAEA,SAAS,EAAO,GAAiB;EAC3B,MAAW,MACf,IAAY,GACR,IAAQ,SAAS,iBAAiB,WAAW,CAAS,IACrD,SAAS,oBAAoB,WAAW,CAAS;CACxD;CAGA,OADA,QAAsB,EAAO,EAAK,CAAC,GAC5B;AACT"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
|
-
export declare function useFieldIds(attrs: Record<string, unknown>, hasHint: () => boolean, hasCounter?: () => boolean): {
|
|
2
|
+
export declare function useFieldIds(attrs: Record<string, unknown>, hasHint: () => boolean, hasCounter?: () => boolean, hasError?: () => boolean): {
|
|
3
3
|
fieldId: ComputedRef<string>;
|
|
4
4
|
hintId: string;
|
|
5
5
|
counterId: string;
|
|
6
|
+
errorId: string;
|
|
6
7
|
describedBy: ComputedRef<string | undefined>;
|
|
7
8
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { joinIds as e } from "../utils/ids.js";
|
|
2
2
|
import { computed as t, useId as n } from "vue";
|
|
3
3
|
//#region src/composables/useFieldIds.ts
|
|
4
|
-
function r(r, i, a = () => !1) {
|
|
5
|
-
let
|
|
4
|
+
function r(r, i, a = () => !1, o = () => !1) {
|
|
5
|
+
let s = n(), c = n(), l = n(), u = n();
|
|
6
6
|
return {
|
|
7
|
-
fieldId: t(() => r.id ??
|
|
8
|
-
hintId:
|
|
9
|
-
counterId:
|
|
10
|
-
|
|
7
|
+
fieldId: t(() => r.id ?? s),
|
|
8
|
+
hintId: c,
|
|
9
|
+
counterId: l,
|
|
10
|
+
errorId: u,
|
|
11
|
+
describedBy: t(() => e(r["aria-describedby"], o() && u, i() && c, a() && l))
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldIds.js","names":[],"sources":["../../src/composables/useFieldIds.ts"],"sourcesContent":["// @a11y @ssr\n/**\n * Use hydration-stable IDs and append hint/counter references to consumer aria-describedby
|
|
1
|
+
{"version":3,"file":"useFieldIds.js","names":[],"sources":["../../src/composables/useFieldIds.ts"],"sourcesContent":["// @a11y @ssr\n/**\n * Use hydration-stable IDs and append error/hint/counter references to consumer\n * aria-describedby rather than replacing it. The error comes first so that it is read first.\n */\n\nimport { computed, useId, type ComputedRef } from 'vue'\n\nimport { joinIds } from '../utils/ids'\n\nexport function useFieldIds(\n attrs: Record<string, unknown>,\n hasHint: () => boolean,\n hasCounter: () => boolean = () => false,\n hasError: () => boolean = () => false,\n): {\n fieldId: ComputedRef<string>\n hintId: string\n counterId: string\n errorId: string\n describedBy: ComputedRef<string | undefined>\n} {\n const uid = useId()\n const hintId = useId()\n const counterId = useId()\n const errorId = useId()\n\n return {\n fieldId: computed(() => (attrs.id as string | undefined) ?? uid),\n hintId,\n counterId,\n errorId,\n describedBy: computed(() =>\n joinIds(\n attrs['aria-describedby'] as string | undefined,\n hasError() && errorId,\n hasHint() && hintId,\n hasCounter() && counterId,\n ),\n ),\n }\n}\n"],"mappings":";;;AAUA,SAAgB,EACd,GACA,GACA,UAAkC,IAClC,UAAgC,IAOhC;CACA,IAAM,IAAM,EAAM,GACZ,IAAS,EAAM,GACf,IAAY,EAAM,GAClB,IAAU,EAAM;CAEtB,OAAO;EACL,SAAS,QAAgB,EAAM,MAA6B,CAAG;EAC/D;EACA;EACA;EACA,aAAa,QACX,EACE,EAAM,qBACN,EAAS,KAAK,GACd,EAAQ,KAAK,GACb,EAAW,KAAK,CAClB,CACF;CACF;AACF"}
|
|
@@ -37,6 +37,7 @@ export interface UseFieldPanelOptions {
|
|
|
37
37
|
export declare function useFieldPanel(options: UseFieldPanelOptions): {
|
|
38
38
|
open: Ref<boolean, boolean>;
|
|
39
39
|
panelId: string;
|
|
40
|
+
popupAttrs: (base: () => Record<string, unknown>, hasPanel: () => boolean) => import('vue').ComputedRef<Record<string, unknown>>;
|
|
40
41
|
openPanel: (moveFocus?: boolean) => void;
|
|
41
42
|
closePanel: () => void;
|
|
42
43
|
closeAndFocus: () => void;
|
|
@@ -1,69 +1,79 @@
|
|
|
1
1
|
import { NO_BUTTON_GROUP as e, buttonGroupKey as t } from "../components/VButton/context.js";
|
|
2
2
|
import { useFocusoutDismiss as n } from "./useFocusoutDismiss.js";
|
|
3
|
-
import {
|
|
3
|
+
import { computed as r, onBeforeUnmount as i, provide as a, ref as o, useId as s, watch as c } from "vue";
|
|
4
4
|
//#region src/composables/useFieldPanel.ts
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
|
|
5
|
+
function l(l) {
|
|
6
|
+
let u = o(!1), d = () => l.openOnFocus?.() ?? !1, f = s();
|
|
7
|
+
a(t, e);
|
|
8
|
+
let p = 0;
|
|
9
|
+
function m() {
|
|
10
|
+
p && cancelAnimationFrame(p), p = 0;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
function h(e = !d()) {
|
|
13
|
+
l.disabled() || u.value || (l.onOpen?.(), l.panelRef.value?.show(), e && (m(), p = requestAnimationFrame(() => {
|
|
14
|
+
p = 0, l.focusInPanel();
|
|
15
15
|
})));
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
17
|
+
function g() {
|
|
18
|
+
m(), u.value && (l.panelRef.value?.close(), l.onClose?.());
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
!e || !
|
|
20
|
+
i(m), c(l.disabled, (e) => {
|
|
21
|
+
!e || !u.value || (g(), u.value = !1);
|
|
22
22
|
});
|
|
23
|
-
let
|
|
24
|
-
function _() {
|
|
25
|
-
g = !0, c.field.value?.focus(), g = !1;
|
|
26
|
-
}
|
|
23
|
+
let _ = !1;
|
|
27
24
|
function v() {
|
|
28
|
-
l.value
|
|
25
|
+
_ = !0, l.field.value?.focus(), _ = !1;
|
|
29
26
|
}
|
|
30
27
|
function y() {
|
|
31
|
-
|
|
28
|
+
u.value && (g(), v());
|
|
32
29
|
}
|
|
33
30
|
function b() {
|
|
34
|
-
|
|
31
|
+
_ || !d() || h(!1);
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
x(e) || m();
|
|
33
|
+
function x() {
|
|
34
|
+
u.value ? y() : h(!0);
|
|
39
35
|
}
|
|
40
|
-
let
|
|
41
|
-
function
|
|
42
|
-
e
|
|
36
|
+
let S = (e) => !!e.target?.closest?.("button, a[href]");
|
|
37
|
+
function C(e) {
|
|
38
|
+
S(e) || h();
|
|
43
39
|
}
|
|
40
|
+
let w = n(l.rootEl, g);
|
|
44
41
|
function T(e) {
|
|
42
|
+
e.target?.closest("button, a, input, select, textarea, [tabindex]") || e.preventDefault();
|
|
43
|
+
}
|
|
44
|
+
function E(e) {
|
|
45
45
|
if (e.key === "Escape") {
|
|
46
|
-
|
|
46
|
+
u.value && (e.preventDefault(), y());
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
(e.key === "ArrowDown" || e.key === "Enter") && !
|
|
49
|
+
(e.key === "ArrowDown" || e.key === "Enter") && !u.value && !e.defaultPrevented && !S(e) && (e.preventDefault(), h(!0));
|
|
50
|
+
}
|
|
51
|
+
function D(e, t) {
|
|
52
|
+
return r(() => t() ? {
|
|
53
|
+
...e(),
|
|
54
|
+
role: "combobox",
|
|
55
|
+
"aria-haspopup": "dialog",
|
|
56
|
+
"aria-expanded": u.value,
|
|
57
|
+
"aria-controls": f
|
|
58
|
+
} : e());
|
|
50
59
|
}
|
|
51
60
|
return {
|
|
52
|
-
open:
|
|
53
|
-
panelId:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
open: u,
|
|
62
|
+
panelId: f,
|
|
63
|
+
popupAttrs: D,
|
|
64
|
+
openPanel: h,
|
|
65
|
+
closePanel: g,
|
|
66
|
+
closeAndFocus: y,
|
|
67
|
+
focusField: v,
|
|
68
|
+
onFieldFocus: b,
|
|
69
|
+
toggleFromIcon: x,
|
|
70
|
+
onControlClick: C,
|
|
71
|
+
onFocusout: w,
|
|
72
|
+
onKeydown: E,
|
|
73
|
+
onPanelMousedown: T
|
|
64
74
|
};
|
|
65
75
|
}
|
|
66
76
|
//#endregion
|
|
67
|
-
export {
|
|
77
|
+
export { l as useFieldPanel };
|
|
68
78
|
|
|
69
79
|
//# sourceMappingURL=useFieldPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldPanel.js","names":[],"sources":["../../src/composables/useFieldPanel.ts"],"sourcesContent":["import { onBeforeUnmount, provide, ref, useId, watch } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { NO_BUTTON_GROUP, buttonGroupKey } from '../components/VButton/context'\nimport { useFocusoutDismiss } from './useFocusoutDismiss'\n\n/** The least this needs of the field: something it can put the focus back on. */\ninterface FocusableField {\n focus: () => void\n}\n\n/** The least this needs of the panel: something it can open and close. */\ninterface PanelControl {\n show: () => void\n close: () => void\n}\n\nexport interface UseFieldPanelOptions {\n /** The component's root, against which \"the focus has left\" is judged. */\n rootEl: Ref<HTMLElement | null>\n /** The panel to open and close. */\n panelRef: Ref<PanelControl | null>\n /** The field the focus returns to. */\n field: Ref<FocusableField | null>\n /**\n * Whether opening is refused. It is the SINGLE cut-off point: every route in passes\n * through it, so a component never has to repeat the condition per handler.\n */\n disabled: () => boolean\n /** Moves the focus INTO the open panel: where in it is the component's business. */\n focusInPanel: () => void\n /** What the component needs to do as the panel opens: prepare a draft, reset a step. */\n onOpen?: () => void\n /** What it needs to do as the panel closes: clear an announcement, for instance. */\n onClose?: () => void\n /** Whether focusing the field opens the panel. It does not by default. */\n openOnFocus?: () => boolean\n}\n\n// @
|
|
1
|
+
{"version":3,"file":"useFieldPanel.js","names":[],"sources":["../../src/composables/useFieldPanel.ts"],"sourcesContent":["import { computed, onBeforeUnmount, provide, ref, useId, watch } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { NO_BUTTON_GROUP, buttonGroupKey } from '../components/VButton/context'\nimport { useFocusoutDismiss } from './useFocusoutDismiss'\n\n/** The least this needs of the field: something it can put the focus back on. */\ninterface FocusableField {\n focus: () => void\n}\n\n/** The least this needs of the panel: something it can open and close. */\ninterface PanelControl {\n show: () => void\n close: () => void\n}\n\nexport interface UseFieldPanelOptions {\n /** The component's root, against which \"the focus has left\" is judged. */\n rootEl: Ref<HTMLElement | null>\n /** The panel to open and close. */\n panelRef: Ref<PanelControl | null>\n /** The field the focus returns to. */\n field: Ref<FocusableField | null>\n /**\n * Whether opening is refused. It is the SINGLE cut-off point: every route in passes\n * through it, so a component never has to repeat the condition per handler.\n */\n disabled: () => boolean\n /** Moves the focus INTO the open panel: where in it is the component's business. */\n focusInPanel: () => void\n /** What the component needs to do as the panel opens: prepare a draft, reset a step. */\n onOpen?: () => void\n /** What it needs to do as the panel closes: clear an announcement, for instance. */\n onClose?: () => void\n /** Whether focusing the field opens the panel. It does not by default. */\n openOnFocus?: () => boolean\n}\n\n// @keyboard @a11y @core\n/**\n * The panel is written imperatively and read back by model. Bind `open` as `v-model:open` so\n * the DOM feeds it, but the write must stay synchronous: the `rAF` that moves focus assumes the\n * panel is already open when it is armed, and the model would put a tick in between.\n */\nexport function useFieldPanel(options: UseFieldPanelOptions) {\n const open = ref(false)\n const openOnFocus = () => options.openOnFocus?.() ?? false\n\n /** The id the panel carries, for the field's `aria-controls`. */\n const panelId = useId()\n\n // @core\n // Stop row contexts at the field boundary so the picker keeps its own button sizes instead of\n // inheriting the enclosing input group's shape.\n provide(buttonGroupKey, NO_BUTTON_GROUP)\n\n /*\n * The frame the focus is moved in, kept so it can be called off. A panel closed inside that\n * frame (Escape at once, the field disabled, a consumer closing it) would otherwise have the\n * focus pulled into it once shut, taken from the field it had just been handed back to.\n */\n let focusFrame = 0\n\n function cancelFocusFrame() {\n if (focusFrame) cancelAnimationFrame(focusFrame)\n focusFrame = 0\n }\n\n function openPanel(moveFocus = !openOnFocus()) {\n if (options.disabled() || open.value) return\n options.onOpen?.()\n options.panelRef.value?.show()\n // @a11y\n // A `manual` popover moves focus nowhere, so it is moved by hand; a frame later, the panel\n // not being painted yet, and nothing invisible can take focus.\n if (moveFocus) {\n cancelFocusFrame()\n focusFrame = requestAnimationFrame(() => {\n focusFrame = 0\n options.focusInPanel()\n })\n }\n }\n\n /** Closes the panel and leaves the focus where it is: the focus has already gone elsewhere. */\n function closePanel() {\n cancelFocusFrame()\n if (!open.value) return\n options.panelRef.value?.close()\n options.onClose?.()\n }\n\n onBeforeUnmount(cancelFocusFrame)\n\n // @core\n // A panel refused WHILE it is open (the field turned read-only or disabled, the picker\n // switched off) is unmounted by its `v-if`, and an unmounted popover sends no `toggle` to\n // bring `open` back down. The model then stays true, and the next time the panel is mounted\n // VPopover's mount replay shows it again with nobody having asked.\n watch(options.disabled, (refused) => {\n if (!refused || !open.value) return\n closePanel()\n open.value = false\n })\n\n // @a11y\n /*\n * Handing the focus back to the field is what makes a field that opens on FOCUS reopen the\n * panel that was just closed: the two would chase each other and the panel would never close.\n * The lock covers the focus call, which is synchronous.\n */\n let refocusing = false\n\n /** Puts the focus on the field without opening the panel. */\n function focusField() {\n refocusing = true\n options.field.value?.focus()\n refocusing = false\n }\n\n /** Closes the panel and hands the focus back to the field, under the lock above. */\n function closeAndFocus() {\n if (!open.value) return\n closePanel()\n focusField()\n }\n\n /** The field's focus handler: opens the panel on a field that asks for it. */\n function onFieldFocus() {\n if (refocusing || !openOnFocus()) return\n openPanel(false)\n }\n\n /** The icon at the end of the field. */\n function toggleFromIcon() {\n if (open.value) closeAndFocus()\n else openPanel(true)\n }\n\n /**\n * Whether an event started on one of the controls the field holds: the clear cross, the AM/PM\n * word, a clickable icon, or a button of the consumer's own in a slot.\n */\n const fromOwnControl = (event: Event) =>\n !!(event.target as HTMLElement | null)?.closest?.('button, a[href]')\n\n function onControlClick(event: MouseEvent) {\n if (fromOwnControl(event)) return\n openPanel()\n }\n\n // @a11y\n const onFocusout = useFocusoutDismiss(options.rootEl, closePanel)\n\n // @a11y\n /*\n * Clicking a non-focusable pixel of the panel (padding, the gutter between cells) hands focus\n * back to `<body>`. `onFocusout` above then fires with a null `relatedTarget`, reads it as an\n * exit; rightly; and closes a panel the reader has just clicked.\n */\n function onPanelMousedown(event: MouseEvent) {\n const target = event.target as HTMLElement | null\n if (!target?.closest('button, a, input, select, textarea, [tabindex]')) event.preventDefault()\n }\n\n // @keyboard @a11y\n function onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n if (open.value) {\n event.preventDefault()\n closeAndFocus()\n }\n return\n }\n // A key already consumed INSIDE the panel is ignored. An Enter that selected a day has just\n // CLOSED the panel, and without the guard would reopen it as it bubbles.\n if (\n (event.key === 'ArrowDown' || event.key === 'Enter') &&\n !open.value &&\n !event.defaultPrevented &&\n !fromOwnControl(event)\n ) {\n event.preventDefault()\n // Opened from the KEYBOARD the panel always takes focus, whatever `openOnFocus` says:\n // otherwise ArrowDown opens a panel the keyboard cannot reach.\n openPanel(true)\n }\n }\n\n // @a11y\n /**\n * The field's attributes with the popup wiring spread over them, which makes the field the\n * combobox the pattern calls for. Spread rather than bound after `v-bind`, where a binding wins\n * even when `undefined`: without a panel the wiring adds no key and the consumer's own `role`\n * or `aria-controls` stays.\n */\n function popupAttrs(base: () => Record<string, unknown>, hasPanel: () => boolean) {\n return computed(() =>\n hasPanel()\n ? {\n ...base(),\n role: 'combobox',\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open.value,\n 'aria-controls': panelId,\n }\n : base(),\n )\n }\n\n return {\n open,\n panelId,\n popupAttrs,\n openPanel,\n closePanel,\n closeAndFocus,\n focusField,\n onFieldFocus,\n toggleFromIcon,\n onControlClick,\n onFocusout,\n onKeydown,\n onPanelMousedown,\n }\n}\n"],"mappings":";;;;AA6CA,SAAgB,EAAc,GAA+B;CAC3D,IAAM,IAAO,EAAI,EAAK,GAChB,UAAoB,EAAQ,cAAc,KAAK,IAG/C,IAAU,EAAM;CAKtB,EAAQ,GAAgB,CAAe;CAOvC,IAAI,IAAa;CAEjB,SAAS,IAAmB;EAE1B,AADI,KAAY,qBAAqB,CAAU,GAC/C,IAAa;CACf;CAEA,SAAS,EAAU,IAAY,CAAC,EAAY,GAAG;EACzC,EAAQ,SAAS,KAAK,EAAK,UAC/B,EAAQ,SAAS,GACjB,EAAQ,SAAS,OAAO,KAAK,GAIzB,MACF,EAAiB,GACjB,IAAa,4BAA4B;GAEvC,AADA,IAAa,GACb,EAAQ,aAAa;EACvB,CAAC;CAEL;CAGA,SAAS,IAAa;EACpB,EAAiB,GACZ,EAAK,UACV,EAAQ,SAAS,OAAO,MAAM,GAC9B,EAAQ,UAAU;CACpB;CASA,AAPA,EAAgB,CAAgB,GAOhC,EAAM,EAAQ,WAAW,MAAY;EAC/B,CAAC,KAAW,CAAC,EAAK,UACtB,EAAW,GACX,EAAK,QAAQ;CACf,CAAC;CAQD,IAAI,IAAa;CAGjB,SAAS,IAAa;EAGpB,AAFA,IAAa,IACb,EAAQ,MAAM,OAAO,MAAM,GAC3B,IAAa;CACf;CAGA,SAAS,IAAgB;EAClB,EAAK,UACV,EAAW,GACX,EAAW;CACb;CAGA,SAAS,IAAe;EAClB,KAAc,CAAC,EAAY,KAC/B,EAAU,EAAK;CACjB;CAGA,SAAS,IAAiB;EACxB,AAAI,EAAK,QAAO,EAAc,IACzB,EAAU,EAAI;CACrB;CAMA,IAAM,KAAkB,MACtB,CAAC,CAAE,EAAM,QAA+B,UAAU,iBAAiB;CAErE,SAAS,EAAe,GAAmB;EACrC,EAAe,CAAK,KACxB,EAAU;CACZ;CAGA,IAAM,IAAa,EAAmB,EAAQ,QAAQ,CAAU;CAQhE,SAAS,EAAiB,GAAmB;EAE3C,AADe,EAAM,QACR,QAAQ,gDAAgD,KAAG,EAAM,eAAe;CAC/F;CAGA,SAAS,EAAU,GAAsB;EACvC,IAAI,EAAM,QAAQ,UAAU;GAC1B,AAAI,EAAK,UACP,EAAM,eAAe,GACrB,EAAc;GAEhB;EACF;EAGA,CACG,EAAM,QAAQ,eAAe,EAAM,QAAQ,YAC5C,CAAC,EAAK,SACN,CAAC,EAAM,oBACP,CAAC,EAAe,CAAK,MAErB,EAAM,eAAe,GAGrB,EAAU,EAAI;CAElB;CASA,SAAS,EAAW,GAAqC,GAAyB;EAChF,OAAO,QACL,EAAS,IACL;GACE,GAAG,EAAK;GACR,MAAM;GACN,iBAAiB;GACjB,iBAAiB,EAAK;GACtB,iBAAiB;EACnB,IACA,EAAK,CACX;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|