@proyecto-viviana/solidaria 0.3.0 → 0.4.1
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/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +141 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +141 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/announce.js +207 -0
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/announce.jsx +207 -0
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +244 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +244 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +121 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +121 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +275 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +275 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1037 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1037 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +235 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +235 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1458 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1458 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +1062 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +1062 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +61 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +61 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +55 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +55 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +105 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +105 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +120 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +120 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormReset.js +39 -0
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/createFormReset.jsx +39 -0
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +131 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +131 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +268 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +268 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +47 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +47 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +32 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +32 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +82 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +82 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +302 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +302 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +159 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +159 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1706 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1706 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +2395 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +2395 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +87 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +87 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +631 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +631 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +369 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +369 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +199 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +199 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +331 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +325 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +97 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +97 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +356 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +356 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +519 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +519 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +259 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +259 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +320 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +320 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +210 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +210 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +406 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +397 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +666 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +666 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +256 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +256 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1088 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1088 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +263 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +263 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +322 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +322 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +110 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +110 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +226 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +226 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +452 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +452 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +705 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +705 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +93 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +93 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -0
- package/dist/dnd/index.jsx +3 -0
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +7 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -0
- package/dist/focus/index.jsx +3 -0
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.jsx +5 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -18311
- package/dist/index.jsx +77 -18242
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +9 -0
- package/dist/interactions/index.jsx +9 -0
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +7 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +5 -0
- package/dist/selection/index.jsx +5 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +35 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +5 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +49 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.jsx +6 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +202 -35
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +5 -4
- package/src/calendar/createCalendarCell.ts +36 -5
- package/src/calendar/createCalendarGrid.ts +47 -12
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +27 -15
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/index.ts +17 -0
- package/src/calendar/intl/index.ts +8 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -384
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +488 -371
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +63 -3
- package/src/focus/FocusScope.tsx +266 -24
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +187 -48
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +51 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +26 -15
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +203 -10
- package/src/listbox/createOption.ts +84 -74
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +41 -4
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +512 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +82 -27
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +208 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +37 -1
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +95 -24
- package/src/tag/createTag.ts +30 -36
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -94
- package/src/tree/createTree.ts +165 -52
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +243 -0
- package/src/utils/dom.ts +216 -25
- package/src/utils/index.ts +10 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dragDescriptionKeyboard": "按 Enter 鍵以開始拖曳。",
|
|
3
|
+
"dragDescriptionKeyboardAlt": "按 Alt+Enter 鍵以開始拖曳。",
|
|
4
|
+
"dragDescriptionLongPress": "長按以開始拖曳。",
|
|
5
|
+
"dragDescriptionTouch": "輕點兩下以開始拖曳。",
|
|
6
|
+
"dragDescriptionVirtual": "按一下滑鼠以開始拖曳。",
|
|
7
|
+
"dragItem": "拖曳「{itemText}」",
|
|
8
|
+
"dragSelectedItems": "拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}",
|
|
9
|
+
"dragSelectedKeyboard": "按 Enter 鍵以拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}。",
|
|
10
|
+
"dragSelectedKeyboardAlt": "按 Alt+Enter 鍵以拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}。",
|
|
11
|
+
"dragSelectedLongPress": "長按以拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}。",
|
|
12
|
+
"dragStartedKeyboard": "已開始拖曳。按 Tab 鍵以瀏覽至放置目標,然後按 Enter 鍵以放置,或按 Escape 鍵以取消。",
|
|
13
|
+
"dragStartedTouch": "已開始拖曳。瀏覽至放置目標,然後輕點兩下以放置。",
|
|
14
|
+
"dragStartedVirtual": "已開始拖曳。瀏覽至放置目標,然後按一下滑鼠或按 Enter 鍵以放置。",
|
|
15
|
+
"dropCanceled": "放置已取消。",
|
|
16
|
+
"dropComplete": "放置已完成。",
|
|
17
|
+
"dropDescriptionKeyboard": "按 Enter 鍵以放置。按 Escape 鍵以取消拖曳。",
|
|
18
|
+
"dropDescriptionTouch": "輕點兩下以放置。",
|
|
19
|
+
"dropDescriptionVirtual": "按一下滑鼠以放置。",
|
|
20
|
+
"dropIndicator": "放置指示器",
|
|
21
|
+
"dropOnItem": "放置在「{itemText}」上",
|
|
22
|
+
"dropOnRoot": "放置在",
|
|
23
|
+
"endDragKeyboard": "拖曳中。按 Enter 鍵以取消拖曳。",
|
|
24
|
+
"endDragTouch": "拖曳中。輕點兩下以取消拖曳。",
|
|
25
|
+
"endDragVirtual": "拖曳中。按一下滑鼠以取消拖曳。",
|
|
26
|
+
"insertAfter": "插入至「{itemText}」之後",
|
|
27
|
+
"insertBefore": "插入至「{itemText}」之前",
|
|
28
|
+
"insertBetween": "插入至「{beforeItemText}」和「{afterItemText}」之間"
|
|
29
|
+
}
|
package/src/dnd/utils.ts
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
DragItem,
|
|
7
|
+
DragType,
|
|
7
8
|
DropItem,
|
|
8
9
|
TextDropItem,
|
|
9
10
|
FileDropItem,
|
|
10
11
|
DirectoryDropItem,
|
|
11
12
|
DropOperation,
|
|
12
13
|
} from "@proyecto-viviana/solid-stately";
|
|
14
|
+
import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
|
|
15
|
+
import { getInteractionModality } from "../interactions";
|
|
13
16
|
|
|
14
17
|
// Native drag types that can be transferred between applications
|
|
15
18
|
export const NATIVE_DRAG_TYPES: Set<string> = new Set(["text/plain", "text/uri-list", "text/html"]);
|
|
@@ -71,6 +74,41 @@ export const DROP_OPERATION_TO_DROP_EFFECT: Record<DropOperation, string> = {
|
|
|
71
74
|
move: "move",
|
|
72
75
|
};
|
|
73
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Maps the current interaction modality onto the drag modality used for
|
|
79
|
+
* announcements and descriptions. Mirrors @react-aria/dnd `mapModality`:
|
|
80
|
+
* pointer collapses to virtual, and a virtual modality on a coarse pointer
|
|
81
|
+
* (touch screen reader) becomes touch.
|
|
82
|
+
*/
|
|
83
|
+
function mapModality(modality: string | null): string {
|
|
84
|
+
if (!modality) {
|
|
85
|
+
modality = "virtual";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (modality === "pointer") {
|
|
89
|
+
modality = "virtual";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (
|
|
93
|
+
modality === "virtual" &&
|
|
94
|
+
typeof window !== "undefined" &&
|
|
95
|
+
typeof window.matchMedia === "function" &&
|
|
96
|
+
window.matchMedia("(pointer: coarse)").matches
|
|
97
|
+
) {
|
|
98
|
+
modality = "touch";
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return modality;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Returns the drag modality ('keyboard' | 'virtual' | 'touch') for the current
|
|
106
|
+
* interaction. Mirrors @react-aria/dnd `getDragModality`.
|
|
107
|
+
*/
|
|
108
|
+
export function getDragModality(): string {
|
|
109
|
+
return mapModality(getInteractionModality());
|
|
110
|
+
}
|
|
111
|
+
|
|
74
112
|
/**
|
|
75
113
|
* Get the types present in drag items.
|
|
76
114
|
*/
|
|
@@ -231,11 +269,33 @@ export class DragTypesImpl {
|
|
|
231
269
|
this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes("Files");
|
|
232
270
|
}
|
|
233
271
|
|
|
234
|
-
has(type:
|
|
235
|
-
if (
|
|
272
|
+
has(type: DragType | DragType[]): boolean {
|
|
273
|
+
if (Array.isArray(type)) {
|
|
274
|
+
return type.some((t) => this.has(t));
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (
|
|
278
|
+
this.includesUnknownTypes ||
|
|
279
|
+
(type === DIRECTORY_DRAG_TYPE && this.types.has(GENERIC_TYPE)) ||
|
|
280
|
+
type === "*/*"
|
|
281
|
+
) {
|
|
236
282
|
return true;
|
|
237
283
|
}
|
|
238
|
-
|
|
284
|
+
|
|
285
|
+
if (typeof type === "string") {
|
|
286
|
+
// Wildcard MIME match, e.g. "image/*" accepts "image/png".
|
|
287
|
+
if (type.endsWith("/*")) {
|
|
288
|
+
for (const key of this.types) {
|
|
289
|
+
if (key.startsWith(type.slice(0, -2))) {
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
return this.types.has(type);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return false;
|
|
239
299
|
}
|
|
240
300
|
}
|
|
241
301
|
|
package/src/focus/FocusScope.tsx
CHANGED
|
@@ -15,7 +15,13 @@ import {
|
|
|
15
15
|
onMount,
|
|
16
16
|
} from "solid-js";
|
|
17
17
|
import { isServer } from "solid-js/web";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
getOwnerDocument,
|
|
20
|
+
isFocusable,
|
|
21
|
+
isTabbable,
|
|
22
|
+
getFocusableTreeWalker,
|
|
23
|
+
getActiveElement,
|
|
24
|
+
} from "../utils";
|
|
19
25
|
import { focusSafely } from "../utils/focus";
|
|
20
26
|
|
|
21
27
|
export interface FocusScopeProps {
|
|
@@ -62,6 +68,119 @@ interface FocusScopeContextValue {
|
|
|
62
68
|
scopeRef: Accessor<Element[]>;
|
|
63
69
|
}
|
|
64
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Walks a TreeWalker to its final (deepest-last) node, mirroring the `last`
|
|
73
|
+
* helper in @react-aria/focus.
|
|
74
|
+
*/
|
|
75
|
+
function lastFocusable(walker: TreeWalker): HTMLElement | null {
|
|
76
|
+
let next: HTMLElement | undefined;
|
|
77
|
+
let last: Node | null;
|
|
78
|
+
do {
|
|
79
|
+
last = walker.lastChild();
|
|
80
|
+
if (last) {
|
|
81
|
+
next = last as HTMLElement;
|
|
82
|
+
}
|
|
83
|
+
} while (last);
|
|
84
|
+
return next ?? null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates a FocusManager rooted at the given ref element, independent of any
|
|
89
|
+
* FocusScope. Mirrors @react-aria/focus's `createFocusManager`: it walks the
|
|
90
|
+
* focusable tree with `getFocusableTreeWalker` so segment/spinbutton navigation
|
|
91
|
+
* inside a date field group behaves exactly like upstream.
|
|
92
|
+
*/
|
|
93
|
+
export function createFocusManager(
|
|
94
|
+
ref: () => HTMLElement | null | undefined,
|
|
95
|
+
defaultOptions: FocusManagerOptions = {},
|
|
96
|
+
): FocusManager {
|
|
97
|
+
return {
|
|
98
|
+
focusNext(opts: FocusManagerOptions = {}) {
|
|
99
|
+
const root = ref();
|
|
100
|
+
if (!root) return null;
|
|
101
|
+
const {
|
|
102
|
+
from,
|
|
103
|
+
tabbable = defaultOptions.tabbable,
|
|
104
|
+
wrap = defaultOptions.wrap,
|
|
105
|
+
accept = defaultOptions.accept,
|
|
106
|
+
} = opts;
|
|
107
|
+
const node = from || getActiveElement(getOwnerDocument(root));
|
|
108
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
109
|
+
if (node && root.contains(node)) {
|
|
110
|
+
walker.currentNode = node;
|
|
111
|
+
}
|
|
112
|
+
let nextNode = walker.nextNode() as HTMLElement | null;
|
|
113
|
+
if (!nextNode && wrap) {
|
|
114
|
+
walker.currentNode = root;
|
|
115
|
+
nextNode = walker.nextNode() as HTMLElement | null;
|
|
116
|
+
}
|
|
117
|
+
if (nextNode) {
|
|
118
|
+
focusSafely(nextNode);
|
|
119
|
+
}
|
|
120
|
+
return nextNode;
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
focusPrevious(opts: FocusManagerOptions = {}) {
|
|
124
|
+
const root = ref();
|
|
125
|
+
if (!root) return null;
|
|
126
|
+
const {
|
|
127
|
+
from,
|
|
128
|
+
tabbable = defaultOptions.tabbable,
|
|
129
|
+
wrap = defaultOptions.wrap,
|
|
130
|
+
accept = defaultOptions.accept,
|
|
131
|
+
} = opts;
|
|
132
|
+
const node = from || getActiveElement(getOwnerDocument(root));
|
|
133
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
134
|
+
if (node && root.contains(node)) {
|
|
135
|
+
walker.currentNode = node;
|
|
136
|
+
} else {
|
|
137
|
+
const next = lastFocusable(walker);
|
|
138
|
+
if (next) {
|
|
139
|
+
focusSafely(next);
|
|
140
|
+
}
|
|
141
|
+
return next;
|
|
142
|
+
}
|
|
143
|
+
let previousNode = walker.previousNode() as HTMLElement | null;
|
|
144
|
+
if (!previousNode && wrap) {
|
|
145
|
+
walker.currentNode = root;
|
|
146
|
+
const lastNode = lastFocusable(walker);
|
|
147
|
+
if (!lastNode) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
previousNode = lastNode;
|
|
151
|
+
}
|
|
152
|
+
if (previousNode) {
|
|
153
|
+
focusSafely(previousNode);
|
|
154
|
+
}
|
|
155
|
+
return previousNode;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
focusFirst(opts: FocusManagerOptions = {}) {
|
|
159
|
+
const root = ref();
|
|
160
|
+
if (!root) return null;
|
|
161
|
+
const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;
|
|
162
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
163
|
+
const nextNode = walker.nextNode() as HTMLElement | null;
|
|
164
|
+
if (nextNode) {
|
|
165
|
+
focusSafely(nextNode);
|
|
166
|
+
}
|
|
167
|
+
return nextNode;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
focusLast(opts: FocusManagerOptions = {}) {
|
|
171
|
+
const root = ref();
|
|
172
|
+
if (!root) return null;
|
|
173
|
+
const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;
|
|
174
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
175
|
+
const next = lastFocusable(walker);
|
|
176
|
+
if (next) {
|
|
177
|
+
focusSafely(next);
|
|
178
|
+
}
|
|
179
|
+
return next;
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
65
184
|
const FocusScopeContext = createContext<FocusScopeContextValue | null>(null);
|
|
66
185
|
|
|
67
186
|
/**
|
|
@@ -73,23 +192,6 @@ export function useFocusManager(): FocusManager | undefined {
|
|
|
73
192
|
return useContext(FocusScopeContext)?.focusManager;
|
|
74
193
|
}
|
|
75
194
|
|
|
76
|
-
/**
|
|
77
|
-
* Checks if an element is tabbable (focusable via Tab key).
|
|
78
|
-
*/
|
|
79
|
-
function isTabbable(element: Element): boolean {
|
|
80
|
-
if (!isFocusable(element)) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Check tabIndex
|
|
85
|
-
const tabIndex = element.getAttribute("tabindex");
|
|
86
|
-
if (tabIndex != null) {
|
|
87
|
-
return parseInt(tabIndex, 10) >= 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
195
|
/**
|
|
94
196
|
* Gets all focusable elements within a scope.
|
|
95
197
|
*/
|
|
@@ -125,14 +227,96 @@ function isElementInScope(element: Element | null, scope: Element[]): boolean {
|
|
|
125
227
|
}
|
|
126
228
|
|
|
127
229
|
/**
|
|
128
|
-
*
|
|
230
|
+
* A scope is identified by its (stable) scope-elements accessor; `null` is the
|
|
231
|
+
* tree root. Mirrors @react-aria/focus's `ScopeRef`.
|
|
232
|
+
*/
|
|
233
|
+
type ScopeRef = Accessor<Element[]> | null;
|
|
234
|
+
|
|
235
|
+
interface FocusScopeTreeNode {
|
|
236
|
+
scopeRef: ScopeRef;
|
|
237
|
+
parent: FocusScopeTreeNode | null;
|
|
238
|
+
children: Set<FocusScopeTreeNode>;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* A registry of the live FocusScopes and their parent/child relationships,
|
|
243
|
+
* mirroring @react-aria/focus's `focusScopeTree`. The DOM tree alone can't
|
|
244
|
+
* express scope nesting because a child scope (e.g. a menu opened from inside a
|
|
245
|
+
* modal popover) is rendered in a portal, outside its parent scope's subtree.
|
|
246
|
+
* The tree records that nesting so containment can recognize a portaled
|
|
247
|
+
* descendant scope as "inside".
|
|
129
248
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
249
|
+
class FocusScopeTree {
|
|
250
|
+
root: FocusScopeTreeNode;
|
|
251
|
+
private fastMap = new Map<ScopeRef, FocusScopeTreeNode>();
|
|
252
|
+
|
|
253
|
+
constructor() {
|
|
254
|
+
this.root = { scopeRef: null, parent: null, children: new Set() };
|
|
255
|
+
this.fastMap.set(null, this.root);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
getTreeNode(scopeRef: ScopeRef): FocusScopeTreeNode | undefined {
|
|
259
|
+
return this.fastMap.get(scopeRef);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
addTreeNode(scopeRef: ScopeRef, parent: ScopeRef): void {
|
|
263
|
+
const parentNode = this.fastMap.get(parent) ?? this.root;
|
|
264
|
+
const node: FocusScopeTreeNode = { scopeRef, parent: parentNode, children: new Set() };
|
|
265
|
+
parentNode.children.add(node);
|
|
266
|
+
this.fastMap.set(scopeRef, node);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
removeTreeNode(scopeRef: ScopeRef): void {
|
|
270
|
+
// never remove the root
|
|
271
|
+
if (scopeRef === null) return;
|
|
272
|
+
const node = this.fastMap.get(scopeRef);
|
|
273
|
+
if (!node) return;
|
|
274
|
+
const parentNode = node.parent;
|
|
275
|
+
if (parentNode) {
|
|
276
|
+
parentNode.children.delete(node);
|
|
277
|
+
// Re-parent any children so a mid-tree unmount doesn't orphan descendants.
|
|
278
|
+
for (const child of node.children) {
|
|
279
|
+
child.parent = parentNode;
|
|
280
|
+
parentNode.children.add(child);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
this.fastMap.delete(scopeRef);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Pre-order depth-first; skips the null-scoped root, like upstream.
|
|
287
|
+
*traverse(node: FocusScopeTreeNode = this.root): Generator<FocusScopeTreeNode> {
|
|
288
|
+
if (node.scopeRef != null) {
|
|
289
|
+
yield node;
|
|
290
|
+
}
|
|
291
|
+
for (const child of node.children) {
|
|
292
|
+
yield* this.traverse(child);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const focusScopeTree = new FocusScopeTree();
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Whether the element is inside `scope` or any of its descendant scopes.
|
|
301
|
+
*
|
|
302
|
+
* `isElementInScope`'s `node.contains` already covers descendant scopes that
|
|
303
|
+
* are DOM children, but not those rendered in a portal. Walking the scope
|
|
304
|
+
* subtree closes that gap so focus moving into a portaled child scope still
|
|
305
|
+
* counts as "inside". Mirrors @react-aria/focus's `isElementInChildScope`.
|
|
306
|
+
*/
|
|
307
|
+
function isElementInChildScope(element: Element, scope: ScopeRef = null): boolean {
|
|
308
|
+
// Always allow focus to move into a top-layer element (e.g. toasts).
|
|
309
|
+
if (element instanceof Element && element.closest("[data-react-aria-top-layer]")) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
for (const node of focusScopeTree.traverse(focusScopeTree.getTreeNode(scope))) {
|
|
314
|
+
if (node.scopeRef && isElementInScope(element, node.scopeRef())) {
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
134
317
|
}
|
|
135
|
-
|
|
318
|
+
|
|
319
|
+
return false;
|
|
136
320
|
}
|
|
137
321
|
|
|
138
322
|
/**
|
|
@@ -151,6 +335,11 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
151
335
|
let endRef: HTMLSpanElement | undefined;
|
|
152
336
|
const [scopeElements, setScopeElements] = createSignal<Element[]>([]);
|
|
153
337
|
|
|
338
|
+
// The nearest enclosing FocusScope (through context, which Solid propagates
|
|
339
|
+
// across portals) is this scope's parent in the focus-scope tree. Read it
|
|
340
|
+
// before we shadow the context with our own provider below.
|
|
341
|
+
const parentScopeRef = useContext(FocusScopeContext)?.scopeRef ?? null;
|
|
342
|
+
|
|
154
343
|
// Store the element that was focused when the scope mounted
|
|
155
344
|
let nodeToRestore: Element | null = null;
|
|
156
345
|
|
|
@@ -272,6 +461,16 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
272
461
|
setScopeElements(nodes);
|
|
273
462
|
});
|
|
274
463
|
|
|
464
|
+
// Register this scope in the focus-scope tree so containment can recognize a
|
|
465
|
+
// portaled descendant scope as "inside" it. The scope-elements accessor is a
|
|
466
|
+
// stable identity, so it works as the tree key even before it's populated.
|
|
467
|
+
onMount(() => {
|
|
468
|
+
focusScopeTree.addTreeNode(scopeElements, parentScopeRef);
|
|
469
|
+
});
|
|
470
|
+
onCleanup(() => {
|
|
471
|
+
focusScopeTree.removeTreeNode(scopeElements);
|
|
472
|
+
});
|
|
473
|
+
|
|
275
474
|
// Save the currently focused element for restoration (must happen before autoFocus/contain effects run).
|
|
276
475
|
onMount(() => {
|
|
277
476
|
if (!props.restoreFocus) return;
|
|
@@ -354,6 +553,12 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
354
553
|
|
|
355
554
|
if (isElementInScope(target, scope)) {
|
|
356
555
|
focusedNode = target;
|
|
556
|
+
} else if (isElementInChildScope(target, scopeElements)) {
|
|
557
|
+
// Focus moved into a descendant scope — e.g. a menu opened from inside
|
|
558
|
+
// this modal popover, rendered in a portal outside this scope's DOM
|
|
559
|
+
// subtree. Track it but don't pull focus back, which would tear the
|
|
560
|
+
// nested overlay down.
|
|
561
|
+
focusedNode = target;
|
|
357
562
|
} else if (focusedNode) {
|
|
358
563
|
// Focus escaped the scope, bring it back
|
|
359
564
|
focusSafely(focusedNode as HTMLElement);
|
|
@@ -363,12 +568,49 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
363
568
|
}
|
|
364
569
|
};
|
|
365
570
|
|
|
571
|
+
let restoreRaf: number | null = null;
|
|
572
|
+
|
|
573
|
+
const onFocusOut = (e: FocusEvent) => {
|
|
574
|
+
const target = e.target as Element;
|
|
575
|
+
if (!isElementInScope(target, scopeElements())) return;
|
|
576
|
+
|
|
577
|
+
// Focus left an element inside the scope. Wait a frame (like upstream's
|
|
578
|
+
// onBlur) so a synchronous refocus elsewhere can settle; if focus ended
|
|
579
|
+
// up outside every scope (e.g. blur() to body), pull it back.
|
|
580
|
+
const win = doc.defaultView ?? window;
|
|
581
|
+
if (restoreRaf != null) win.cancelAnimationFrame(restoreRaf);
|
|
582
|
+
restoreRaf = win.requestAnimationFrame(() => {
|
|
583
|
+
restoreRaf = null;
|
|
584
|
+
const scope = scopeElements();
|
|
585
|
+
const activeElement = getActiveElement(doc);
|
|
586
|
+
if (
|
|
587
|
+
activeElement &&
|
|
588
|
+
(isElementInScope(activeElement, scope) ||
|
|
589
|
+
isElementInChildScope(activeElement, scopeElements))
|
|
590
|
+
) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
if (doc.body.contains(target)) {
|
|
595
|
+
focusedNode = target;
|
|
596
|
+
focusSafely(target as HTMLElement);
|
|
597
|
+
} else {
|
|
598
|
+
focusManager.focusFirst();
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
|
|
366
603
|
doc.addEventListener("keydown", onKeyDown, true);
|
|
367
604
|
doc.addEventListener("focusin", onFocusIn, true);
|
|
605
|
+
doc.addEventListener("focusout", onFocusOut, true);
|
|
368
606
|
|
|
369
607
|
onCleanup(() => {
|
|
370
608
|
doc.removeEventListener("keydown", onKeyDown, true);
|
|
371
609
|
doc.removeEventListener("focusin", onFocusIn, true);
|
|
610
|
+
doc.removeEventListener("focusout", onFocusOut, true);
|
|
611
|
+
if (restoreRaf != null) {
|
|
612
|
+
(doc.defaultView ?? window).cancelAnimationFrame(restoreRaf);
|
|
613
|
+
}
|
|
372
614
|
});
|
|
373
615
|
});
|
|
374
616
|
|
package/src/focus/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export {
|
|
2
2
|
FocusScope,
|
|
3
3
|
useFocusManager,
|
|
4
|
+
createFocusManager,
|
|
4
5
|
type FocusScopeProps,
|
|
5
6
|
type FocusManager,
|
|
6
7
|
type FocusManagerOptions,
|
|
@@ -22,6 +23,13 @@ export {
|
|
|
22
23
|
type VirtualFocusResult,
|
|
23
24
|
} from "./createVirtualFocus";
|
|
24
25
|
|
|
26
|
+
export {
|
|
27
|
+
moveVirtualFocus,
|
|
28
|
+
dispatchVirtualBlur,
|
|
29
|
+
dispatchVirtualFocus,
|
|
30
|
+
getVirtuallyFocusedElement,
|
|
31
|
+
} from "./virtualFocus";
|
|
32
|
+
|
|
25
33
|
export {
|
|
26
34
|
createAutoFocus,
|
|
27
35
|
clearAutoFocusQueue,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual-focus event dispatch primitives.
|
|
3
|
+
*
|
|
4
|
+
* A faithful port of @react-aria/focus's `virtualFocus` module. Under virtual
|
|
5
|
+
* focus (e.g. Autocomplete), real DOM focus stays on an input while the
|
|
6
|
+
* "focused" collection option is indicated by `aria-activedescendant`. Moving
|
|
7
|
+
* that virtual cursor dispatches synthetic `focus`/`blur` events (with matching
|
|
8
|
+
* bubbling `focusin`/`focusout`) on the option elements so listeners — notably
|
|
9
|
+
* the autocomplete input's `focusin` handler that mirrors the active descendant
|
|
10
|
+
* — react as if the element were really focused.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { getActiveElement, getOwnerDocument } from "../utils/dom";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Moves virtual focus to `to`, dispatching a virtual blur on the previously
|
|
17
|
+
* virtually-focused element (if any) and a virtual focus on `to` (if non-null).
|
|
18
|
+
*/
|
|
19
|
+
export function moveVirtualFocus(to: Element | null): void {
|
|
20
|
+
const from = getVirtuallyFocusedElement(getOwnerDocument(to));
|
|
21
|
+
if (from !== to) {
|
|
22
|
+
if (from) {
|
|
23
|
+
dispatchVirtualBlur(from, to);
|
|
24
|
+
}
|
|
25
|
+
if (to) {
|
|
26
|
+
dispatchVirtualFocus(to, from);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Dispatches synthetic `blur` + bubbling `focusout` events on `from`. */
|
|
32
|
+
export function dispatchVirtualBlur(from: Element, to: Element | null): void {
|
|
33
|
+
from.dispatchEvent(new FocusEvent("blur", { relatedTarget: to }));
|
|
34
|
+
from.dispatchEvent(new FocusEvent("focusout", { bubbles: true, relatedTarget: to }));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Dispatches synthetic `focus` + bubbling `focusin` events on `to`. */
|
|
38
|
+
export function dispatchVirtualFocus(to: Element, from: Element | null): void {
|
|
39
|
+
to.dispatchEvent(new FocusEvent("focus", { relatedTarget: from }));
|
|
40
|
+
to.dispatchEvent(new FocusEvent("focusin", { bubbles: true, relatedTarget: from }));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the currently virtually-focused element: the element referenced by the
|
|
45
|
+
* active element's `aria-activedescendant`, or the active element itself.
|
|
46
|
+
*/
|
|
47
|
+
export function getVirtuallyFocusedElement(document: Document): Element | null {
|
|
48
|
+
const activeElement = getActiveElement(document);
|
|
49
|
+
const activeDescendant = activeElement?.getAttribute("aria-activedescendant");
|
|
50
|
+
if (activeDescendant) {
|
|
51
|
+
return document.getElementById(activeDescendant) || activeElement;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return activeElement;
|
|
55
|
+
}
|
|
@@ -108,7 +108,14 @@ export function createFormValidation(
|
|
|
108
108
|
// Set custom validity on the native input
|
|
109
109
|
createEffect(() => {
|
|
110
110
|
const input = ref();
|
|
111
|
-
|
|
111
|
+
// `'setCustomValidity' in input` guards refs that aren't true form elements
|
|
112
|
+
// (e.g. a custom element), matching upstream useFormValidation.
|
|
113
|
+
if (
|
|
114
|
+
validationBehavior() === "native" &&
|
|
115
|
+
input &&
|
|
116
|
+
"setCustomValidity" in input &&
|
|
117
|
+
!input.disabled
|
|
118
|
+
) {
|
|
112
119
|
const realtimeValidation = state.realtimeValidation();
|
|
113
120
|
const errorMessage = realtimeValidation.isInvalid
|
|
114
121
|
? realtimeValidation.validationErrors.join(" ") || "Invalid value."
|