@proyecto-viviana/solidaria 0.2.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -236
- package/dist/_chunk/actiongroup.js +207 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +207 -0
- package/dist/_chunk/actiongroup.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 +196 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +196 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +119 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +119 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +276 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +276 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1036 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1036 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +234 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +234 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1174 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1174 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +436 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +436 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +229 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +223 -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 +54 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +54 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +101 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +101 -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 +121 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +121 -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/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 +130 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +130 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +269 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +269 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +46 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +46 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +31 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +31 -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/createLongPress.js +91 -0
- package/dist/_chunk/createLongPress.js.map +1 -0
- package/dist/_chunk/createLongPress.jsx +91 -0
- package/dist/_chunk/createLongPress.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 +81 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +81 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +298 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +298 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +158 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +158 -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 +1393 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1393 -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 +1304 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +1304 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +105 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +105 -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 +895 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +870 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/form.js +39 -0
- package/dist/_chunk/form.js.map +1 -0
- package/dist/_chunk/form.jsx +39 -0
- package/dist/_chunk/form.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 +364 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +364 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +254 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +254 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +241 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +237 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +96 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +96 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +324 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +324 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/live-announcer.js +207 -0
- package/dist/_chunk/live-announcer.js.map +1 -0
- package/dist/_chunk/live-announcer.jsx +207 -0
- package/dist/_chunk/live-announcer.jsx.map +1 -0
- package/dist/_chunk/menu.js +518 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +518 -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 +258 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +258 -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 +319 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +319 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +209 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +209 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +403 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +394 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +679 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +679 -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 +255 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +255 -0
- package/dist/_chunk/slider.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 +1051 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1051 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +260 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +260 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +286 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +286 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +109 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +109 -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 +258 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +258 -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 +424 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +424 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +665 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +665 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +92 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +92 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts +5 -5
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.d.ts +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -10
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/autocomplete/index.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 +9 -7
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.d.ts +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createButton.d.ts +1 -1
- package/dist/button/createButton.d.ts.map +1 -1
- package/dist/button/createToggleButton.d.ts +3 -3
- package/dist/button/createToggleButtonGroup.d.ts +7 -7
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.d.ts +6 -6
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/button/types.d.ts +18 -12
- package/dist/button/types.d.ts.map +1 -1
- package/dist/calendar/createCalendar.d.ts +15 -5
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts +6 -2
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts +4 -4
- 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 +15 -5
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts +4 -2
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +7 -5
- 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 +12 -0
- package/dist/calendar/intl/index.d.ts.map +1 -0
- package/dist/calendar/utils.d.ts +16 -0
- package/dist/calendar/utils.d.ts.map +1 -0
- package/dist/checkbox/createCheckbox.d.ts +10 -6
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroup.d.ts +7 -7
- package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts +4 -4
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupState.d.ts +2 -2
- package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -1
- package/dist/checkbox/index.d.ts +8 -8
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.d.ts +3 -3
- package/dist/collections/index.d.ts.map +1 -1
- 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 +3 -3
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts +4 -4
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts +4 -4
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts +2 -2
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts +3 -3
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.d.ts +6 -6
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/types.d.ts +98 -16
- package/dist/color/types.d.ts.map +1 -1
- package/dist/combobox/createComboBox.d.ts +10 -7
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/index.d.ts +1 -1
- package/dist/datepicker/createDateField.d.ts +18 -6
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +51 -5
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +19 -0
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -0
- package/dist/datepicker/createDateRangePicker.d.ts +8 -6
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +10 -2
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createTimeField.d.ts +11 -5
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/createTimeSegment.d.ts +2 -2
- package/dist/datepicker/createTimeSegment.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +7 -6
- 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/dialog/createDialog.d.ts +5 -5
- package/dist/dialog/createDialog.d.ts.map +1 -1
- package/dist/dialog/index.d.ts +2 -2
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/dialog/types.d.ts +4 -4
- package/dist/disclosure/createDisclosure.d.ts +5 -2
- package/dist/disclosure/createDisclosure.d.ts.map +1 -1
- package/dist/disclosure/createDisclosureGroup.d.ts +4 -4
- package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -1
- package/dist/disclosure/index.d.ts +2 -2
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/createDrag.d.ts +2 -2
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts +2 -2
- package/dist/dnd/createDraggableItem.d.ts +3 -3
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDrop.d.ts +2 -2
- package/dist/dnd/createDrop.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +26 -6
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/createDroppableItem.d.ts +3 -3
- package/dist/dnd/index.d.ts +12 -12
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +2 -0
- package/dist/dnd/index.jsx +2 -0
- package/dist/dnd/types.d.ts +2 -2
- package/dist/dnd/types.d.ts.map +1 -1
- package/dist/dnd/utils.d.ts +2 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +1 -1
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/createAutoFocus.d.ts.map +1 -1
- package/dist/focus/createFocusRestore.d.ts.map +1 -1
- package/dist/focus/createVirtualFocus.d.ts +4 -4
- package/dist/focus/createVirtualFocus.d.ts.map +1 -1
- package/dist/focus/index.d.ts +4 -4
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +2 -0
- package/dist/focus/index.jsx +2 -0
- package/dist/form/createFormReset.d.ts +1 -1
- package/dist/form/createFormValidation.d.ts +3 -3
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.d.ts +2 -2
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/GridKeyboardDelegate.d.ts +5 -5
- package/dist/grid/createGrid.d.ts +3 -3
- package/dist/grid/createGridCell.d.ts +3 -3
- package/dist/grid/createGridRow.d.ts +3 -3
- package/dist/grid/index.d.ts +5 -5
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/grid/types.d.ts +8 -8
- package/dist/gridlist/createGridList.d.ts +12 -4
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +4 -4
- 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/createGridListSelectionCheckbox.d.ts +3 -3
- package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +1 -1
- package/dist/gridlist/index.d.ts +5 -4
- 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 +61 -7
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/createCollator.d.ts.map +1 -1
- package/dist/i18n/createDateFormatter.d.ts.map +1 -1
- package/dist/i18n/createFilter.d.ts.map +1 -1
- package/dist/i18n/createNumberFormatter.d.ts +1 -1
- package/dist/i18n/createNumberFormatter.d.ts.map +1 -1
- package/dist/i18n/createStringFormatter.d.ts +2 -2
- package/dist/i18n/createStringFormatter.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +8 -8
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/index.jsx +3 -0
- package/dist/i18n/locale.d.ts +2 -2
- package/dist/i18n/locale.d.ts.map +1 -1
- package/dist/i18n/utils.d.ts.map +1 -1
- package/dist/index.d.ts +56 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -17119
- package/dist/index.jsx +71 -0
- package/dist/interactions/FocusableProvider.d.ts +2 -2
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +13 -2
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusRing.d.ts +1 -1
- package/dist/interactions/createFocusRing.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createFocusable.d.ts +3 -3
- package/dist/interactions/createFocusable.d.ts.map +1 -1
- package/dist/interactions/createHover.d.ts +5 -5
- package/dist/interactions/createHover.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +3 -4
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createLongPress.d.ts +5 -5
- package/dist/interactions/createMove.d.ts +5 -5
- package/dist/interactions/createMove.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts +4 -4
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.d.ts +12 -12
- package/dist/interactions/index.d.ts.map +1 -1
- package/dist/interactions/index.js +10 -0
- package/dist/interactions/index.jsx +10 -0
- package/dist/label/createField.d.ts +4 -4
- package/dist/label/createField.d.ts.map +1 -1
- package/dist/label/createLabel.d.ts +7 -7
- package/dist/label/createLabel.d.ts.map +1 -1
- package/dist/label/createLabels.d.ts +1 -1
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.d.ts +5 -5
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/createLandmark.d.ts +5 -5
- package/dist/landmark/createLandmark.d.ts.map +1 -1
- package/dist/landmark/index.d.ts +1 -1
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/createLink.d.ts +14 -8
- package/dist/link/createLink.d.ts.map +1 -1
- package/dist/link/index.d.ts +1 -1
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +48 -6
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +27 -4
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.d.ts +2 -2
- package/dist/listbox/index.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/announce.d.ts +2 -2
- package/dist/live-announcer/announce.d.ts.map +1 -1
- package/dist/live-announcer/index.d.ts +1 -1
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +14 -11
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +25 -5
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/createMenuTrigger.d.ts +4 -4
- package/dist/menu/index.d.ts +3 -3
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/createMeter.d.ts +6 -6
- package/dist/meter/createMeter.d.ts.map +1 -1
- package/dist/meter/index.d.ts +1 -1
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts +9 -8
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.d.ts +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/ariaHideOutside.d.ts.map +1 -1
- package/dist/overlays/createModal.d.ts +3 -3
- package/dist/overlays/createModal.d.ts.map +1 -1
- package/dist/overlays/createOverlay.d.ts +1 -1
- package/dist/overlays/createOverlay.d.ts.map +1 -1
- package/dist/overlays/createOverlayTrigger.d.ts +6 -6
- package/dist/overlays/index.d.ts +6 -6
- package/dist/overlays/index.d.ts.map +1 -1
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +6 -4
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +11 -3
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/createPopover.d.ts +4 -4
- package/dist/popover/createPopover.d.ts.map +1 -1
- package/dist/popover/index.d.ts +3 -3
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/createProgressBar.d.ts +7 -5
- package/dist/progress/createProgressBar.d.ts.map +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +9 -7
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/createRadioGroup.d.ts +10 -10
- package/dist/radio/createRadioGroup.d.ts.map +1 -1
- package/dist/radio/createRadioGroupState.d.ts +3 -3
- package/dist/radio/createRadioGroupState.d.ts.map +1 -1
- package/dist/radio/index.d.ts +3 -3
- package/dist/radio/index.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/createSearchField.d.ts +7 -7
- package/dist/searchfield/createSearchField.d.ts.map +1 -1
- package/dist/searchfield/index.d.ts +2 -2
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createHiddenSelect.d.ts +4 -4
- package/dist/select/createHiddenSelect.d.ts.map +1 -1
- package/dist/select/createSelect.d.ts +14 -6
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.d.ts +2 -2
- package/dist/select/index.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 +2 -2
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +10 -1
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +4 -0
- package/dist/selection/index.jsx +4 -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/createSeparator.d.ts +9 -5
- package/dist/separator/createSeparator.d.ts.map +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts +11 -7
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.d.ts +2 -2
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/ssr/index.d.ts +18 -1
- 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/createStepList.d.ts +36 -0
- package/dist/steplist/createStepList.d.ts.map +1 -0
- package/dist/steplist/index.d.ts +2 -0
- package/dist/steplist/index.d.ts.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +10 -4
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts +3 -3
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableCell.d.ts +3 -3
- package/dist/table/createTableCell.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts +3 -3
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableColumnResize.d.ts +41 -0
- package/dist/table/createTableColumnResize.d.ts.map +1 -0
- package/dist/table/createTableHeaderRow.d.ts +3 -3
- package/dist/table/createTableRow.d.ts +4 -4
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableRowGroup.d.ts +2 -2
- package/dist/table/createTableRowGroup.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts +3 -3
- package/dist/table/createTableSelectionCheckbox.d.ts +3 -3
- package/dist/table/index.d.ts +11 -9
- package/dist/table/index.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 +41 -7
- package/dist/table/types.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +32 -28
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +4 -2
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +5 -5
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.d.ts +2 -2
- package/dist/tag/index.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/createTextField.d.ts +17 -11
- package/dist/textfield/createTextField.d.ts.map +1 -1
- package/dist/textfield/index.d.ts +1 -1
- package/dist/textfield/index.d.ts.map +1 -1
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts +2 -2
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/createToastRegion.d.ts +5 -3
- package/dist/toast/createToastRegion.d.ts.map +1 -1
- package/dist/toast/index.d.ts +2 -2
- package/dist/toast/index.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 +13 -9
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/createToggleState.d.ts +2 -2
- package/dist/toggle/createToggleState.d.ts.map +1 -1
- package/dist/toggle/index.d.ts +4 -4
- package/dist/toggle/index.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 +9 -9
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +1 -1
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/createTooltip.d.ts +5 -5
- package/dist/tooltip/createTooltip.d.ts.map +1 -1
- package/dist/tooltip/createTooltipTrigger.d.ts +10 -5
- package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
- package/dist/tooltip/index.d.ts +2 -2
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +8 -4
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +4 -4
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts +3 -3
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.d.ts +4 -4
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +20 -6
- 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/createDescription.d.ts +2 -2
- package/dist/utils/createDescription.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +48 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/focus.d.ts +1 -1
- package/dist/utils/focus.d.ts.map +1 -1
- package/dist/utils/geometry.d.ts.map +1 -1
- package/dist/utils/index.d.ts +15 -12
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.jsx +5 -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/reactivity.d.ts +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/createVisuallyHidden.d.ts +2 -2
- package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -1
- package/dist/visually-hidden/index.d.ts +1 -1
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +334 -33
- package/src/actiongroup/createActionGroup.ts +101 -91
- package/src/actiongroup/index.ts +1 -1
- package/src/autocomplete/createAutocomplete.ts +177 -148
- package/src/autocomplete/index.ts +1 -1
- package/src/breadcrumbs/createBreadcrumbs.ts +33 -42
- package/src/breadcrumbs/index.ts +1 -1
- package/src/button/createButton.ts +102 -73
- package/src/button/createToggleButton.ts +10 -10
- package/src/button/createToggleButtonGroup.ts +25 -32
- package/src/button/index.ts +6 -9
- package/src/button/types.ts +18 -12
- package/src/calendar/createCalendar.ts +64 -29
- package/src/calendar/createCalendarCell.ts +115 -46
- package/src/calendar/createCalendarGrid.ts +97 -41
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +68 -31
- package/src/calendar/createRangeCalendarCell.ts +92 -31
- package/src/calendar/index.ts +21 -8
- package/src/calendar/intl/index.ts +210 -0
- package/src/calendar/utils.ts +231 -0
- package/src/checkbox/createCheckbox.ts +23 -21
- package/src/checkbox/createCheckboxGroup.ts +68 -44
- package/src/checkbox/createCheckboxGroupItem.ts +26 -41
- package/src/checkbox/createCheckboxGroupState.ts +3 -22
- package/src/checkbox/index.ts +8 -10
- package/src/collections/index.ts +33 -29
- package/src/color/createColorArea.ts +232 -154
- package/src/color/createColorField.ts +107 -58
- package/src/color/createColorSlider.ts +231 -73
- package/src/color/createColorSwatch.ts +38 -13
- package/src/color/createColorWheel.ts +208 -83
- package/src/color/index.ts +6 -6
- package/src/color/types.ts +98 -16
- package/src/combobox/createComboBox.ts +157 -100
- package/src/combobox/index.ts +1 -1
- package/src/combobox/intl/index.ts +5 -5
- package/src/datepicker/createDateField.ts +192 -39
- package/src/datepicker/createDatePicker.ts +260 -67
- package/src/datepicker/createDatePickerGroup.ts +149 -0
- package/src/datepicker/createDateRangePicker.ts +105 -57
- package/src/datepicker/createDateSegment.ts +188 -96
- package/src/datepicker/createTimeField.ts +38 -34
- package/src/datepicker/createTimeSegment.ts +67 -85
- package/src/datepicker/index.ts +13 -14
- package/src/dialog/createDialog.ts +45 -38
- package/src/dialog/index.ts +2 -2
- package/src/dialog/types.ts +4 -4
- package/src/disclosure/createDisclosure.ts +138 -33
- package/src/disclosure/createDisclosureGroup.ts +8 -21
- package/src/disclosure/index.ts +2 -2
- package/src/dnd/createDrag.ts +19 -25
- package/src/dnd/createDraggableCollection.ts +4 -4
- package/src/dnd/createDraggableItem.ts +20 -19
- package/src/dnd/createDrop.ts +42 -51
- package/src/dnd/createDroppableCollection.ts +293 -173
- package/src/dnd/createDroppableItem.ts +34 -34
- package/src/dnd/index.ts +23 -12
- package/src/dnd/types.ts +4 -7
- package/src/dnd/utils.ts +58 -47
- package/src/focus/FocusScope.tsx +301 -176
- package/src/focus/createAutoFocus.ts +4 -20
- package/src/focus/createFocusRestore.ts +15 -28
- package/src/focus/createVirtualFocus.ts +20 -36
- package/src/focus/index.ts +4 -8
- package/src/form/createFormReset.ts +4 -4
- package/src/form/createFormValidation.ts +23 -39
- package/src/form/index.ts +2 -5
- package/src/grid/GridKeyboardDelegate.ts +30 -30
- package/src/grid/createGrid.ts +36 -36
- package/src/grid/createGridCell.ts +18 -18
- package/src/grid/createGridRow.ts +14 -14
- package/src/grid/index.ts +5 -5
- package/src/grid/types.ts +8 -8
- package/src/gridlist/createGridList.ts +172 -64
- package/src/gridlist/createGridListItem.ts +98 -121
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/createGridListSelectionCheckbox.ts +12 -9
- package/src/gridlist/index.ts +7 -4
- package/src/gridlist/types.ts +58 -7
- package/src/i18n/createCollator.ts +5 -18
- package/src/i18n/createDateFormatter.ts +5 -13
- package/src/i18n/createFilter.ts +11 -24
- package/src/i18n/createNumberFormatter.ts +4 -6
- package/src/i18n/createStringFormatter.ts +19 -15
- package/src/i18n/index.ts +8 -11
- package/src/i18n/locale.tsx +15 -40
- package/src/i18n/utils.ts +35 -39
- package/src/index.ts +111 -172
- package/src/interactions/FocusableProvider.tsx +3 -7
- package/src/interactions/PressEvent.ts +18 -4
- package/src/interactions/createFocus.ts +12 -8
- package/src/interactions/createFocusRing.ts +21 -19
- package/src/interactions/createFocusWithin.ts +20 -13
- package/src/interactions/createFocusable.ts +15 -16
- package/src/interactions/createHover.ts +70 -55
- package/src/interactions/createInteractionModality.ts +96 -94
- package/src/interactions/createKeyboard.ts +12 -2
- package/src/interactions/createLongPress.ts +23 -23
- package/src/interactions/createMove.ts +72 -62
- package/src/interactions/createPress.ts +192 -92
- package/src/interactions/index.ts +24 -16
- package/src/label/createField.ts +18 -19
- package/src/label/createLabel.ts +18 -30
- package/src/label/createLabels.ts +8 -12
- package/src/label/index.ts +5 -5
- package/src/landmark/createLandmark.ts +30 -51
- package/src/landmark/index.ts +1 -1
- package/src/link/createLink.ts +83 -56
- package/src/link/index.ts +1 -1
- package/src/listbox/createListBox.ts +198 -66
- package/src/listbox/createOption.ts +112 -71
- package/src/listbox/index.ts +2 -6
- package/src/live-announcer/announce.ts +44 -71
- package/src/live-announcer/index.ts +1 -1
- package/src/menu/createMenu.ts +171 -65
- package/src/menu/createMenuItem.ts +315 -51
- package/src/menu/createMenuTrigger.ts +15 -15
- package/src/menu/index.ts +3 -12
- package/src/meter/createMeter.ts +7 -15
- package/src/meter/index.ts +1 -1
- package/src/numberfield/createNumberField.ts +205 -80
- package/src/numberfield/index.ts +1 -1
- package/src/overlays/ariaHideOutside.ts +14 -10
- package/src/overlays/createInteractOutside.ts +21 -18
- package/src/overlays/createModal.tsx +17 -17
- package/src/overlays/createOverlay.ts +38 -8
- package/src/overlays/createOverlayTrigger.ts +16 -16
- package/src/overlays/createPreventScroll.ts +46 -24
- package/src/overlays/index.ts +6 -17
- package/src/popover/calculatePosition.ts +134 -124
- package/src/popover/createOverlayPosition.ts +55 -40
- package/src/popover/createPopover.ts +42 -17
- package/src/popover/index.ts +3 -3
- package/src/progress/createProgressBar.ts +31 -32
- package/src/progress/index.ts +1 -1
- package/src/radio/createRadio.ts +114 -75
- package/src/radio/createRadioGroup.ts +83 -77
- package/src/radio/createRadioGroupState.ts +7 -31
- package/src/radio/index.ts +3 -8
- package/src/searchfield/createSearchField.ts +57 -29
- package/src/searchfield/index.ts +2 -2
- package/src/select/createHiddenSelect.tsx +57 -44
- package/src/select/createSelect.ts +146 -73
- package/src/select/index.ts +2 -7
- 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 +498 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +120 -59
- package/src/selection/index.ts +32 -1
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/separator/createSeparator.ts +20 -25
- package/src/separator/index.ts +1 -1
- package/src/slider/createSlider.ts +128 -112
- package/src/slider/index.ts +2 -2
- package/src/ssr/index.tsx +38 -46
- package/src/steplist/createStepList.ts +106 -0
- package/src/steplist/index.ts +8 -0
- package/src/switch/createSwitch.ts +19 -14
- package/src/switch/index.ts +1 -1
- package/src/table/createTable.ts +192 -95
- package/src/table/createTableCell.ts +17 -16
- package/src/table/createTableColumnHeader.ts +67 -20
- package/src/table/createTableColumnResize.ts +256 -0
- package/src/table/createTableHeaderRow.ts +7 -7
- package/src/table/createTableRow.ts +206 -91
- package/src/table/createTableRowGroup.ts +5 -7
- package/src/table/createTableSelectAllCheckbox.ts +14 -14
- package/src/table/createTableSelectionCheckbox.ts +8 -8
- package/src/table/index.ts +14 -9
- package/src/table/types.ts +43 -7
- package/src/tabs/createTabs.ts +123 -111
- package/src/tabs/index.ts +1 -1
- package/src/tag/createTag.ts +57 -50
- package/src/tag/createTagGroup.ts +47 -41
- package/src/tag/index.ts +2 -6
- package/src/textfield/createTextField.ts +67 -35
- package/src/textfield/index.ts +1 -5
- package/src/toast/createToast.ts +29 -26
- package/src/toast/createToastRegion.ts +169 -26
- package/src/toast/index.ts +2 -6
- package/src/toggle/createToggle.ts +115 -53
- package/src/toggle/createToggleState.ts +2 -10
- package/src/toggle/index.ts +4 -5
- package/src/toolbar/createToolbar.ts +214 -230
- package/src/toolbar/index.ts +1 -1
- package/src/tooltip/createTooltip.ts +11 -24
- package/src/tooltip/createTooltipTrigger.ts +61 -49
- package/src/tooltip/index.ts +2 -2
- package/src/tree/createTree.ts +128 -72
- package/src/tree/createTreeItem.ts +120 -135
- package/src/tree/createTreeSelectionCheckbox.ts +11 -8
- package/src/tree/index.ts +4 -4
- package/src/tree/types.ts +20 -6
- package/src/utils/animation.ts +151 -0
- package/src/utils/createDescription.ts +6 -23
- package/src/utils/dom.ts +265 -68
- package/src/utils/env.ts +9 -11
- package/src/utils/events.ts +7 -7
- package/src/utils/filterDOMProps.ts +49 -49
- package/src/utils/focus.ts +60 -68
- package/src/utils/geometry.ts +1 -4
- package/src/utils/globalListeners.ts +9 -9
- package/src/utils/index.ts +20 -22
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +49 -15
- package/src/utils/platform.ts +2 -2
- package/src/utils/reactivity.ts +3 -3
- package/src/utils/scrollIntoView.ts +181 -0
- package/src/utils/textSelection.ts +16 -16
- package/src/visually-hidden/createVisuallyHidden.ts +16 -28
- package/src/visually-hidden/index.ts +1 -1
- package/dist/i18n/NumberFormatter.d.ts +0 -43
- package/dist/i18n/NumberFormatter.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.ssr.js +0 -17082
- package/dist/index.ssr.js.map +0 -1
- package/src/i18n/NumberFormatter.ts +0 -266
|
@@ -5,23 +5,25 @@
|
|
|
5
5
|
* component like ListBox, GridList, or Table.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { createMemo, onCleanup, type Accessor } from
|
|
9
|
-
import type { JSX } from
|
|
8
|
+
import { createMemo, onCleanup, type Accessor } from "solid-js";
|
|
9
|
+
import type { JSX } from "solid-js";
|
|
10
10
|
import type {
|
|
11
11
|
DroppableCollectionState,
|
|
12
12
|
DropTarget,
|
|
13
13
|
DropOperation,
|
|
14
14
|
DropItem,
|
|
15
|
+
DragType,
|
|
15
16
|
DragTypes,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import {
|
|
17
|
+
Key,
|
|
18
|
+
} from "@proyecto-viviana/solid-stately";
|
|
19
|
+
import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
|
|
20
|
+
import { createDrop } from "./createDrop";
|
|
19
21
|
import {
|
|
20
22
|
getGlobalDraggingCollectionRef,
|
|
21
23
|
getGlobalDraggingKeys,
|
|
22
24
|
getGlobalDraggingTypes,
|
|
23
|
-
} from
|
|
24
|
-
import { getGlobalAllowedDropOperations, DROP_OPERATION } from
|
|
25
|
+
} from "./createDraggableCollection";
|
|
26
|
+
import { getGlobalAllowedDropOperations, DROP_OPERATION } from "./utils";
|
|
25
27
|
|
|
26
28
|
// Global state for tracking the drop collection
|
|
27
29
|
let globalDropCollectionRef: HTMLElement | null = null;
|
|
@@ -41,23 +43,23 @@ export interface DropTargetDelegate {
|
|
|
41
43
|
getDropTargetFromPoint(
|
|
42
44
|
x: number,
|
|
43
45
|
y: number,
|
|
44
|
-
isValidDropTarget: (target: DropTarget) => boolean
|
|
46
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
45
47
|
): DropTarget | null;
|
|
46
48
|
/**
|
|
47
49
|
* Returns the next keyboard-navigable drop target.
|
|
48
50
|
*/
|
|
49
51
|
getKeyboardNavigationTarget?(
|
|
50
52
|
target: DropTarget | null,
|
|
51
|
-
direction:
|
|
52
|
-
isValidDropTarget: (target: DropTarget) => boolean
|
|
53
|
+
direction: "next" | "previous",
|
|
54
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
53
55
|
): DropTarget | null;
|
|
54
56
|
/**
|
|
55
57
|
* Returns the next page-navigable drop target.
|
|
56
58
|
*/
|
|
57
59
|
getKeyboardPageNavigationTarget?(
|
|
58
60
|
target: DropTarget | null,
|
|
59
|
-
direction:
|
|
60
|
-
isValidDropTarget: (target: DropTarget) => boolean
|
|
61
|
+
direction: "next" | "previous",
|
|
62
|
+
isValidDropTarget: (target: DropTarget) => boolean,
|
|
61
63
|
): DropTarget | null;
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -72,17 +74,26 @@ export interface KeyboardDelegateLike {
|
|
|
72
74
|
getKeyPageAbove?: (key: string | number) => string | number | null;
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
interface CollectionNodeLike {
|
|
78
|
+
type?: string;
|
|
79
|
+
key: Key;
|
|
80
|
+
parentKey?: Key | null;
|
|
81
|
+
childNodes?: CollectionNodeLike[];
|
|
82
|
+
isExpanded?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface CollectionLike {
|
|
86
|
+
getItem(key: Key): CollectionNodeLike | null;
|
|
87
|
+
[Symbol.iterator](): Iterator<CollectionNodeLike>;
|
|
88
|
+
}
|
|
89
|
+
|
|
75
90
|
export interface DroppableCollectionOptions {
|
|
76
91
|
/** Reference to the collection element. */
|
|
77
92
|
ref: Accessor<HTMLElement | null>;
|
|
78
93
|
/** A delegate that provides drop targets for pointer coordinates. */
|
|
79
94
|
dropTargetDelegate: DropTargetDelegate;
|
|
80
95
|
/** Handler called when items are dropped to be inserted. */
|
|
81
|
-
onInsert?: (e: {
|
|
82
|
-
items: DropItem[];
|
|
83
|
-
target: DropTarget;
|
|
84
|
-
dropOperation: DropOperation;
|
|
85
|
-
}) => void;
|
|
96
|
+
onInsert?: (e: { items: DropItem[]; target: DropTarget; dropOperation: DropOperation }) => void;
|
|
86
97
|
/** Handler called when items are dropped on the root. */
|
|
87
98
|
onRootDrop?: (e: { items: DropItem[]; dropOperation: DropOperation }) => void;
|
|
88
99
|
/** Handler called when items are dropped on an item. */
|
|
@@ -118,17 +129,25 @@ export interface DroppableCollectionOptions {
|
|
|
118
129
|
keyboardDelegate?: KeyboardDelegateLike;
|
|
119
130
|
/** Optional keyboard handler composed with internal drop target navigation keys. */
|
|
120
131
|
onKeyDown?: (e: KeyboardEvent) => void;
|
|
132
|
+
/** Collection snapshot used to restore focus and selection after a drop mutates items. */
|
|
133
|
+
collection?: CollectionLike;
|
|
134
|
+
/** Current collection selection used to avoid replacing user-updated selection after a drop. */
|
|
135
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
136
|
+
/** Sets collection selection after a drop when new rows were inserted and selection was unchanged. */
|
|
137
|
+
setSelectedKeys?: (keys: Set<Key>) => void;
|
|
138
|
+
/** Sets collection focus after a drop when new rows were inserted. */
|
|
139
|
+
setFocusedKey?: (key: Key | null) => void;
|
|
121
140
|
/** Whether the collection is disabled for dropping. */
|
|
122
141
|
isDisabled?: boolean;
|
|
123
142
|
/** Accepted drag types. 'all' accepts any type. */
|
|
124
|
-
acceptedDragTypes?:
|
|
143
|
+
acceptedDragTypes?: "all" | Array<string | symbol>;
|
|
125
144
|
}
|
|
126
145
|
|
|
127
146
|
export function getDropItemTypes(item: DropItem): Set<string | symbol> {
|
|
128
|
-
if (item.kind ===
|
|
147
|
+
if (item.kind === "file") {
|
|
129
148
|
return new Set([item.type]);
|
|
130
149
|
}
|
|
131
|
-
if (item.kind ===
|
|
150
|
+
if (item.kind === "text") {
|
|
132
151
|
return new Set(item.types);
|
|
133
152
|
}
|
|
134
153
|
return new Set([DIRECTORY_DRAG_TYPE]);
|
|
@@ -148,7 +167,7 @@ export interface DroppableCollectionAria {
|
|
|
148
167
|
*/
|
|
149
168
|
export function createDroppableCollection(
|
|
150
169
|
options: Accessor<DroppableCollectionOptions>,
|
|
151
|
-
state: DroppableCollectionState
|
|
170
|
+
state: DroppableCollectionState,
|
|
152
171
|
): DroppableCollectionAria {
|
|
153
172
|
const getOptions = createMemo(() => options());
|
|
154
173
|
|
|
@@ -165,7 +184,7 @@ export function createDroppableCollection(
|
|
|
165
184
|
const getDropOperationForTarget = (
|
|
166
185
|
target: DropTarget,
|
|
167
186
|
types: DragTypes,
|
|
168
|
-
allowedOperations: DropOperation[]
|
|
187
|
+
allowedOperations: DropOperation[],
|
|
169
188
|
): DropOperation => {
|
|
170
189
|
return state.getDropOperation(target, types, allowedOperations);
|
|
171
190
|
};
|
|
@@ -176,35 +195,23 @@ export function createDroppableCollection(
|
|
|
176
195
|
getDropOperationForPoint: (types, allowedOperations, x, y) => {
|
|
177
196
|
const opts = getOptions();
|
|
178
197
|
const isValidDropTarget = (target: DropTarget) =>
|
|
179
|
-
getDropOperationForTarget(target, types, allowedOperations) !==
|
|
198
|
+
getDropOperationForTarget(target, types, allowedOperations) !== "cancel";
|
|
180
199
|
|
|
181
|
-
const target = opts.dropTargetDelegate.getDropTargetFromPoint(
|
|
182
|
-
x,
|
|
183
|
-
y,
|
|
184
|
-
isValidDropTarget
|
|
185
|
-
);
|
|
200
|
+
const target = opts.dropTargetDelegate.getDropTargetFromPoint(x, y, isValidDropTarget);
|
|
186
201
|
|
|
187
202
|
if (!target) {
|
|
188
|
-
currentDropOperation =
|
|
203
|
+
currentDropOperation = "cancel";
|
|
189
204
|
nextTarget = null;
|
|
190
|
-
return
|
|
205
|
+
return "cancel";
|
|
191
206
|
}
|
|
192
207
|
|
|
193
|
-
currentDropOperation = getDropOperationForTarget(
|
|
194
|
-
target,
|
|
195
|
-
types,
|
|
196
|
-
allowedOperations
|
|
197
|
-
);
|
|
208
|
+
currentDropOperation = getDropOperationForTarget(target, types, allowedOperations);
|
|
198
209
|
|
|
199
210
|
// If target doesn't accept, try root
|
|
200
|
-
if (currentDropOperation ===
|
|
201
|
-
const rootTarget: DropTarget = { type:
|
|
202
|
-
const rootOp = getDropOperationForTarget(
|
|
203
|
-
|
|
204
|
-
types,
|
|
205
|
-
allowedOperations
|
|
206
|
-
);
|
|
207
|
-
if (rootOp !== 'cancel') {
|
|
211
|
+
if (currentDropOperation === "cancel") {
|
|
212
|
+
const rootTarget: DropTarget = { type: "root" };
|
|
213
|
+
const rootOp = getDropOperationForTarget(rootTarget, types, allowedOperations);
|
|
214
|
+
if (rootOp !== "cancel") {
|
|
208
215
|
nextTarget = rootTarget;
|
|
209
216
|
currentDropOperation = rootOp;
|
|
210
217
|
return currentDropOperation;
|
|
@@ -213,11 +220,11 @@ export function createDroppableCollection(
|
|
|
213
220
|
|
|
214
221
|
// Update drop collection ref
|
|
215
222
|
const ref = opts.ref();
|
|
216
|
-
if (target && currentDropOperation !==
|
|
223
|
+
if (target && currentDropOperation !== "cancel" && ref !== globalDropCollectionRef) {
|
|
217
224
|
setGlobalDropCollectionRef(ref);
|
|
218
225
|
}
|
|
219
226
|
|
|
220
|
-
nextTarget = currentDropOperation ===
|
|
227
|
+
nextTarget = currentDropOperation === "cancel" ? null : target;
|
|
221
228
|
return currentDropOperation;
|
|
222
229
|
},
|
|
223
230
|
onDropEnter: () => {
|
|
@@ -237,9 +244,9 @@ export function createDroppableCollection(
|
|
|
237
244
|
onDropActivate: (e) => {
|
|
238
245
|
const opts = getOptions();
|
|
239
246
|
if (
|
|
240
|
-
state.target?.type ===
|
|
241
|
-
state.target.dropPosition ===
|
|
242
|
-
typeof opts.onDropActivate ===
|
|
247
|
+
state.target?.type === "item" &&
|
|
248
|
+
state.target.dropPosition === "on" &&
|
|
249
|
+
typeof opts.onDropActivate === "function"
|
|
243
250
|
) {
|
|
244
251
|
opts.onDropActivate({
|
|
245
252
|
target: state.target,
|
|
@@ -253,14 +260,21 @@ export function createDroppableCollection(
|
|
|
253
260
|
setGlobalDropCollectionRef(opts.ref());
|
|
254
261
|
|
|
255
262
|
if (state.target) {
|
|
263
|
+
const target = state.target;
|
|
264
|
+
const previousCollection = opts.collection;
|
|
265
|
+
const previousSelectedKeys = normalizeSelection(opts.selectedKeys);
|
|
256
266
|
opts.onDrop?.({
|
|
257
267
|
items: e.items,
|
|
258
|
-
target
|
|
268
|
+
target,
|
|
259
269
|
dropOperation: e.dropOperation,
|
|
260
270
|
x: e.x,
|
|
261
271
|
y: e.y,
|
|
262
272
|
});
|
|
263
|
-
handleDrop(e.items,
|
|
273
|
+
void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {
|
|
274
|
+
queueMicrotask(() => {
|
|
275
|
+
updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);
|
|
276
|
+
});
|
|
277
|
+
});
|
|
264
278
|
}
|
|
265
279
|
},
|
|
266
280
|
}));
|
|
@@ -268,7 +282,7 @@ export function createDroppableCollection(
|
|
|
268
282
|
const handleDrop = async (
|
|
269
283
|
items: DropItem[],
|
|
270
284
|
target: DropTarget,
|
|
271
|
-
dropOperation: DropOperation
|
|
285
|
+
dropOperation: DropOperation,
|
|
272
286
|
) => {
|
|
273
287
|
const opts = getOptions();
|
|
274
288
|
const isInternal = isInternalDropOperation();
|
|
@@ -276,7 +290,7 @@ export function createDroppableCollection(
|
|
|
276
290
|
// Filter items by accepted types
|
|
277
291
|
let filteredItems = items;
|
|
278
292
|
const acceptedTypes = opts.acceptedDragTypes;
|
|
279
|
-
if (acceptedTypes && acceptedTypes !==
|
|
293
|
+
if (acceptedTypes && acceptedTypes !== "all") {
|
|
280
294
|
filteredItems = items.filter((item) => {
|
|
281
295
|
const itemTypes = getDropItemTypes(item);
|
|
282
296
|
return acceptedTypes.some((type) => itemTypes.has(type));
|
|
@@ -286,12 +300,12 @@ export function createDroppableCollection(
|
|
|
286
300
|
if (filteredItems.length === 0) return;
|
|
287
301
|
|
|
288
302
|
// Call appropriate handlers based on target type
|
|
289
|
-
if (target.type ===
|
|
303
|
+
if (target.type === "root" && opts.onRootDrop) {
|
|
290
304
|
await opts.onRootDrop({ items: filteredItems, dropOperation });
|
|
291
305
|
}
|
|
292
306
|
|
|
293
|
-
if (target.type ===
|
|
294
|
-
if (target.dropPosition ===
|
|
307
|
+
if (target.type === "item") {
|
|
308
|
+
if (target.dropPosition === "on" && opts.onItemDrop) {
|
|
295
309
|
await opts.onItemDrop({
|
|
296
310
|
items: filteredItems,
|
|
297
311
|
target,
|
|
@@ -310,7 +324,7 @@ export function createDroppableCollection(
|
|
|
310
324
|
});
|
|
311
325
|
}
|
|
312
326
|
|
|
313
|
-
if (target.dropPosition !==
|
|
327
|
+
if (target.dropPosition !== "on") {
|
|
314
328
|
if (!isInternal && opts.onInsert) {
|
|
315
329
|
await opts.onInsert({
|
|
316
330
|
items: filteredItems,
|
|
@@ -346,26 +360,30 @@ export function createDroppableCollection(
|
|
|
346
360
|
onKeyDownBase?.(e);
|
|
347
361
|
const opts = getOptions();
|
|
348
362
|
if (opts.isDisabled) return;
|
|
349
|
-
const resolveDirection = ():
|
|
363
|
+
const resolveDirection = (): "ltr" | "rtl" => {
|
|
350
364
|
const refEl = opts.ref();
|
|
351
|
-
if (
|
|
365
|
+
if (
|
|
366
|
+
refEl &&
|
|
367
|
+
typeof window !== "undefined" &&
|
|
368
|
+
typeof window.getComputedStyle === "function"
|
|
369
|
+
) {
|
|
352
370
|
const computedDir = window.getComputedStyle(refEl).direction;
|
|
353
|
-
if (computedDir ===
|
|
371
|
+
if (computedDir === "rtl") return "rtl";
|
|
354
372
|
}
|
|
355
|
-
return typeof document !==
|
|
373
|
+
return typeof document !== "undefined" && document.dir === "rtl" ? "rtl" : "ltr";
|
|
356
374
|
};
|
|
357
|
-
const isRtl = resolveDirection() ===
|
|
358
|
-
const forwardHorizontalKey = isRtl ?
|
|
359
|
-
const backwardHorizontalKey = isRtl ?
|
|
375
|
+
const isRtl = resolveDirection() === "rtl";
|
|
376
|
+
const forwardHorizontalKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
377
|
+
const backwardHorizontalKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
360
378
|
const callUserOnKeyDown = () => opts.onKeyDown?.(e);
|
|
361
379
|
const getKeyboardAllowedOperations = (): DropOperation[] => {
|
|
362
380
|
const allowedBits = getGlobalAllowedDropOperations();
|
|
363
|
-
if (!allowedBits) return [
|
|
381
|
+
if (!allowedBits) return ["copy", "move", "link"];
|
|
364
382
|
const allowed: DropOperation[] = [];
|
|
365
|
-
if (allowedBits & DROP_OPERATION.copy) allowed.push(
|
|
366
|
-
if (allowedBits & DROP_OPERATION.move) allowed.push(
|
|
367
|
-
if (allowedBits & DROP_OPERATION.link) allowed.push(
|
|
368
|
-
return allowed.length > 0 ? allowed : [
|
|
383
|
+
if (allowedBits & DROP_OPERATION.copy) allowed.push("copy");
|
|
384
|
+
if (allowedBits & DROP_OPERATION.move) allowed.push("move");
|
|
385
|
+
if (allowedBits & DROP_OPERATION.link) allowed.push("link");
|
|
386
|
+
return allowed.length > 0 ? allowed : ["copy", "move", "link"];
|
|
369
387
|
};
|
|
370
388
|
const getKeyboardDragTypes = (): DragTypes => {
|
|
371
389
|
const draggingTypes = getGlobalDraggingTypes();
|
|
@@ -373,20 +391,23 @@ export function createDroppableCollection(
|
|
|
373
391
|
return { has: () => true };
|
|
374
392
|
}
|
|
375
393
|
return {
|
|
376
|
-
|
|
394
|
+
// Keyboard drag mirrors upstream's raw Set<string> delegate: no
|
|
395
|
+
// wildcard expansion (that lives in the DataTransfer-backed DragTypes).
|
|
396
|
+
has: (type: DragType | DragType[]) => typeof type === "string" && draggingTypes.has(type),
|
|
377
397
|
};
|
|
378
398
|
};
|
|
379
399
|
const isValidDropTarget = (target: DropTarget) =>
|
|
380
|
-
state.getDropOperation(target, getKeyboardDragTypes(), getKeyboardAllowedOperations()) !==
|
|
400
|
+
state.getDropOperation(target, getKeyboardDragTypes(), getKeyboardAllowedOperations()) !==
|
|
401
|
+
"cancel";
|
|
381
402
|
const targetsEqual = (a: DropTarget, b: DropTarget): boolean => {
|
|
382
403
|
if (a.type !== b.type) return false;
|
|
383
|
-
if (a.type ===
|
|
384
|
-
if (a.type !==
|
|
404
|
+
if (a.type === "root" && b.type === "root") return true;
|
|
405
|
+
if (a.type !== "item" || b.type !== "item") return false;
|
|
385
406
|
return a.key === b.key && a.dropPosition === b.dropPosition;
|
|
386
407
|
};
|
|
387
408
|
const findNextValidTarget = (
|
|
388
409
|
start: DropTarget | null,
|
|
389
|
-
getNext: (target: DropTarget | null) => DropTarget | null
|
|
410
|
+
getNext: (target: DropTarget | null) => DropTarget | null,
|
|
390
411
|
): DropTarget | null => {
|
|
391
412
|
let current = start;
|
|
392
413
|
let seenRoot = 0;
|
|
@@ -399,7 +420,7 @@ export function createDroppableCollection(
|
|
|
399
420
|
return isValidDropTarget(next) ? next : null;
|
|
400
421
|
}
|
|
401
422
|
current = next;
|
|
402
|
-
if (next.type ===
|
|
423
|
+
if (next.type === "root") {
|
|
403
424
|
seenRoot += 1;
|
|
404
425
|
if (seenRoot >= 2) {
|
|
405
426
|
return isValidDropTarget(next) ? next : null;
|
|
@@ -411,49 +432,48 @@ export function createDroppableCollection(
|
|
|
411
432
|
};
|
|
412
433
|
const resolveTargetForKey = (
|
|
413
434
|
key: string | number | null,
|
|
414
|
-
direction:
|
|
435
|
+
direction: "next" | "previous",
|
|
415
436
|
): DropTarget | null => {
|
|
416
437
|
if (key == null) return null;
|
|
417
|
-
const onTarget: DropTarget = { type:
|
|
438
|
+
const onTarget: DropTarget = { type: "item", key, dropPosition: "on" };
|
|
418
439
|
if (isValidDropTarget(onTarget)) return onTarget;
|
|
419
|
-
const insertionOrder: Array<
|
|
420
|
-
? [
|
|
421
|
-
: ['after', 'before'];
|
|
440
|
+
const insertionOrder: Array<"before" | "after"> =
|
|
441
|
+
direction === "next" ? ["before", "after"] : ["after", "before"];
|
|
422
442
|
for (const position of insertionOrder) {
|
|
423
|
-
const insertionTarget: DropTarget = { type:
|
|
443
|
+
const insertionTarget: DropTarget = { type: "item", key, dropPosition: position };
|
|
424
444
|
if (isValidDropTarget(insertionTarget)) return insertionTarget;
|
|
425
445
|
}
|
|
426
446
|
return null;
|
|
427
447
|
};
|
|
428
448
|
const resolveBoundaryTargetForDirection = (
|
|
429
449
|
key: string | number | null,
|
|
430
|
-
direction:
|
|
450
|
+
direction: "next" | "previous",
|
|
431
451
|
): DropTarget | null => {
|
|
432
452
|
if (key == null) return null;
|
|
433
|
-
const boundaryOrder: Array<
|
|
434
|
-
? [
|
|
435
|
-
: ['after', 'on', 'before'];
|
|
453
|
+
const boundaryOrder: Array<"before" | "on" | "after"> =
|
|
454
|
+
direction === "next" ? ["before", "on", "after"] : ["after", "on", "before"];
|
|
436
455
|
for (const position of boundaryOrder) {
|
|
437
|
-
const candidate: DropTarget = { type:
|
|
456
|
+
const candidate: DropTarget = { type: "item", key, dropPosition: position };
|
|
438
457
|
if (isValidDropTarget(candidate)) return candidate;
|
|
439
458
|
}
|
|
440
459
|
return null;
|
|
441
460
|
};
|
|
442
461
|
const resolveFallbackKeyboardTarget = (
|
|
443
462
|
keyName: string,
|
|
444
|
-
currentTarget: DropTarget | null = state.target
|
|
463
|
+
currentTarget: DropTarget | null = state.target,
|
|
445
464
|
): DropTarget | null => {
|
|
446
465
|
const keyboardDelegate = opts.keyboardDelegate;
|
|
447
466
|
if (!keyboardDelegate) return null;
|
|
448
|
-
const currentKey = currentTarget?.type ===
|
|
467
|
+
const currentKey = currentTarget?.type === "item" ? currentTarget.key : null;
|
|
449
468
|
const keyForDirection = (
|
|
450
|
-
direction:
|
|
451
|
-
getter: ((key: string | number) => string | number | null) | undefined
|
|
469
|
+
direction: "next" | "previous",
|
|
470
|
+
getter: ((key: string | number) => string | number | null) | undefined,
|
|
452
471
|
): DropTarget | null => {
|
|
453
472
|
if (currentKey == null) {
|
|
454
|
-
const boundaryKey =
|
|
455
|
-
|
|
456
|
-
|
|
473
|
+
const boundaryKey =
|
|
474
|
+
direction === "next"
|
|
475
|
+
? keyboardDelegate.getFirstKey?.()
|
|
476
|
+
: keyboardDelegate.getLastKey?.();
|
|
457
477
|
return resolveBoundaryTargetForDirection(boundaryKey ?? null, direction);
|
|
458
478
|
}
|
|
459
479
|
if (!getter) return null;
|
|
@@ -470,113 +490,132 @@ export function createDroppableCollection(
|
|
|
470
490
|
return null;
|
|
471
491
|
};
|
|
472
492
|
|
|
473
|
-
if (keyName ===
|
|
474
|
-
if (keyName ===
|
|
493
|
+
if (keyName === "ArrowDown") return keyForDirection("next", keyboardDelegate.getKeyBelow);
|
|
494
|
+
if (keyName === "ArrowUp") return keyForDirection("previous", keyboardDelegate.getKeyAbove);
|
|
475
495
|
if (keyName === forwardHorizontalKey) {
|
|
476
|
-
return keyForDirection(
|
|
496
|
+
return keyForDirection(
|
|
497
|
+
"next",
|
|
498
|
+
isRtl ? keyboardDelegate.getKeyLeftOf : keyboardDelegate.getKeyRightOf,
|
|
499
|
+
);
|
|
477
500
|
}
|
|
478
501
|
if (keyName === backwardHorizontalKey) {
|
|
479
|
-
return keyForDirection(
|
|
502
|
+
return keyForDirection(
|
|
503
|
+
"previous",
|
|
504
|
+
isRtl ? keyboardDelegate.getKeyRightOf : keyboardDelegate.getKeyLeftOf,
|
|
505
|
+
);
|
|
480
506
|
}
|
|
481
|
-
if (keyName ===
|
|
482
|
-
|
|
483
|
-
|
|
507
|
+
if (keyName === "Home")
|
|
508
|
+
return resolveBoundaryTargetForDirection(
|
|
509
|
+
keyboardDelegate.getFirstKey?.() ?? null,
|
|
510
|
+
"next",
|
|
511
|
+
);
|
|
512
|
+
if (keyName === "End")
|
|
513
|
+
return resolveBoundaryTargetForDirection(
|
|
514
|
+
keyboardDelegate.getLastKey?.() ?? null,
|
|
515
|
+
"previous",
|
|
516
|
+
);
|
|
517
|
+
if (keyName === "PageDown") {
|
|
484
518
|
if (currentKey != null && keyboardDelegate.getKeyPageBelow) {
|
|
485
|
-
return resolveTargetForKey(keyboardDelegate.getKeyPageBelow(currentKey),
|
|
519
|
+
return resolveTargetForKey(keyboardDelegate.getKeyPageBelow(currentKey), "next");
|
|
486
520
|
}
|
|
487
|
-
return keyForDirection(
|
|
521
|
+
return keyForDirection("next", keyboardDelegate.getKeyBelow);
|
|
488
522
|
}
|
|
489
|
-
if (keyName ===
|
|
523
|
+
if (keyName === "PageUp") {
|
|
490
524
|
if (currentKey != null && keyboardDelegate.getKeyPageAbove) {
|
|
491
|
-
return resolveTargetForKey(keyboardDelegate.getKeyPageAbove(currentKey),
|
|
525
|
+
return resolveTargetForKey(keyboardDelegate.getKeyPageAbove(currentKey), "previous");
|
|
492
526
|
}
|
|
493
|
-
return keyForDirection(
|
|
527
|
+
return keyForDirection("previous", keyboardDelegate.getKeyAbove);
|
|
494
528
|
}
|
|
495
529
|
return null;
|
|
496
530
|
};
|
|
497
531
|
const resolvePageTargetForState = (
|
|
498
|
-
direction:
|
|
499
|
-
currentTarget: DropTarget
|
|
532
|
+
direction: "next" | "previous",
|
|
533
|
+
currentTarget: DropTarget,
|
|
500
534
|
): DropTarget | null => {
|
|
501
535
|
const keyboardDelegate = opts.keyboardDelegate;
|
|
502
536
|
if (!keyboardDelegate) return null;
|
|
503
|
-
if (direction ===
|
|
537
|
+
if (direction === "next") {
|
|
504
538
|
let targetKey = keyboardDelegate.getFirstKey?.() ?? null;
|
|
505
|
-
let dropPosition:
|
|
506
|
-
if (currentTarget.type ===
|
|
539
|
+
let dropPosition: "before" | "on" | "after" = "after";
|
|
540
|
+
if (currentTarget.type === "item") {
|
|
507
541
|
targetKey = currentTarget.key;
|
|
508
542
|
dropPosition = currentTarget.dropPosition;
|
|
509
543
|
}
|
|
510
|
-
let nextKey =
|
|
544
|
+
let nextKey =
|
|
545
|
+
targetKey != null ? (keyboardDelegate.getKeyPageBelow?.(targetKey) ?? null) : null;
|
|
511
546
|
if (
|
|
512
547
|
nextKey == null ||
|
|
513
|
-
(currentTarget.type ===
|
|
548
|
+
(currentTarget.type === "item" && currentTarget.key === keyboardDelegate.getLastKey?.())
|
|
514
549
|
) {
|
|
515
550
|
nextKey = keyboardDelegate.getLastKey?.() ?? null;
|
|
516
|
-
dropPosition =
|
|
551
|
+
dropPosition = "after";
|
|
517
552
|
}
|
|
518
553
|
if (nextKey == null) return null;
|
|
519
554
|
return {
|
|
520
|
-
type:
|
|
555
|
+
type: "item",
|
|
521
556
|
key: nextKey,
|
|
522
557
|
dropPosition,
|
|
523
558
|
};
|
|
524
559
|
}
|
|
525
560
|
|
|
526
|
-
if (currentTarget.type ===
|
|
561
|
+
if (currentTarget.type === "item") {
|
|
527
562
|
if (currentTarget.key === keyboardDelegate.getFirstKey?.()) {
|
|
528
|
-
return { type:
|
|
563
|
+
return { type: "root" };
|
|
529
564
|
}
|
|
530
565
|
let nextKey = keyboardDelegate.getKeyPageAbove?.(currentTarget.key) ?? null;
|
|
531
|
-
let dropPosition:
|
|
566
|
+
let dropPosition: "before" | "on" | "after" = currentTarget.dropPosition;
|
|
532
567
|
if (nextKey == null) {
|
|
533
568
|
nextKey = keyboardDelegate.getFirstKey?.() ?? null;
|
|
534
|
-
dropPosition =
|
|
569
|
+
dropPosition = "before";
|
|
535
570
|
}
|
|
536
571
|
if (nextKey == null) return null;
|
|
537
572
|
return {
|
|
538
|
-
type:
|
|
573
|
+
type: "item",
|
|
539
574
|
key: nextKey,
|
|
540
575
|
dropPosition,
|
|
541
576
|
};
|
|
542
577
|
}
|
|
543
578
|
|
|
544
|
-
return currentTarget.type ===
|
|
579
|
+
return currentTarget.type === "root" ? currentTarget : null;
|
|
545
580
|
};
|
|
546
|
-
if (e.key ===
|
|
581
|
+
if (e.key === "PageDown" || e.key === "PageUp") {
|
|
547
582
|
if (
|
|
548
|
-
(e.key ===
|
|
549
|
-
(e.key ===
|
|
583
|
+
(e.key === "PageDown" && !opts.keyboardDelegate?.getKeyPageBelow) ||
|
|
584
|
+
(e.key === "PageUp" && !opts.keyboardDelegate?.getKeyPageAbove)
|
|
550
585
|
) {
|
|
551
586
|
callUserOnKeyDown();
|
|
552
587
|
return;
|
|
553
588
|
}
|
|
554
|
-
const direction = e.key ===
|
|
589
|
+
const direction = e.key === "PageDown" ? "next" : "previous";
|
|
555
590
|
const pageNavigation = opts.dropTargetDelegate.getKeyboardPageNavigationTarget;
|
|
556
591
|
const stepNavigation = opts.dropTargetDelegate.getKeyboardNavigationTarget;
|
|
557
592
|
const resolveStepTarget = (
|
|
558
593
|
target: DropTarget | null,
|
|
559
|
-
navDirection:
|
|
594
|
+
navDirection: "next" | "previous",
|
|
560
595
|
): DropTarget | null =>
|
|
561
|
-
stepNavigation?.(target, navDirection, isValidDropTarget)
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
596
|
+
stepNavigation?.(target, navDirection, isValidDropTarget) ??
|
|
597
|
+
resolveFallbackKeyboardTarget(
|
|
598
|
+
navDirection === "next" ? "ArrowDown" : "ArrowUp",
|
|
599
|
+
target,
|
|
600
|
+
) ??
|
|
601
|
+
resolveFallbackKeyboardTarget(navDirection === "next" ? "Home" : "End", target) ??
|
|
602
|
+
null;
|
|
565
603
|
let nextTarget: DropTarget | null = null;
|
|
566
604
|
if (!state.target) {
|
|
567
605
|
nextTarget = findNextValidTarget(null, (target) => resolveStepTarget(target, direction));
|
|
568
606
|
} else {
|
|
569
|
-
const pageTarget =
|
|
570
|
-
|
|
571
|
-
??
|
|
607
|
+
const pageTarget =
|
|
608
|
+
pageNavigation?.(state.target, direction, isValidDropTarget) ??
|
|
609
|
+
resolvePageTargetForState(direction, state.target) ??
|
|
610
|
+
null;
|
|
572
611
|
if (pageTarget && isValidDropTarget(pageTarget)) {
|
|
573
612
|
nextTarget = pageTarget;
|
|
574
613
|
} else {
|
|
575
614
|
const startTarget = pageTarget ?? state.target;
|
|
576
|
-
nextTarget =
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
615
|
+
nextTarget =
|
|
616
|
+
findNextValidTarget(startTarget, (target) => resolveStepTarget(target, direction)) ??
|
|
617
|
+
findNextValidTarget(startTarget, (target) =>
|
|
618
|
+
resolveStepTarget(target, direction === "next" ? "previous" : "next"),
|
|
580
619
|
);
|
|
581
620
|
}
|
|
582
621
|
}
|
|
@@ -588,34 +627,37 @@ export function createDroppableCollection(
|
|
|
588
627
|
return;
|
|
589
628
|
}
|
|
590
629
|
if (
|
|
591
|
-
(e.key ===
|
|
592
|
-
e.key ===
|
|
593
|
-
e.key ===
|
|
594
|
-
e.key ===
|
|
595
|
-
e.key ===
|
|
596
|
-
e.key ===
|
|
630
|
+
(e.key === "ArrowDown" ||
|
|
631
|
+
e.key === "ArrowUp" ||
|
|
632
|
+
e.key === "ArrowRight" ||
|
|
633
|
+
e.key === "ArrowLeft" ||
|
|
634
|
+
e.key === "Home" ||
|
|
635
|
+
e.key === "End") &&
|
|
597
636
|
opts.dropTargetDelegate.getKeyboardNavigationTarget
|
|
598
637
|
) {
|
|
599
638
|
if (
|
|
600
|
-
(e.key ===
|
|
601
|
-
(e.key ===
|
|
602
|
-
(e.key ===
|
|
603
|
-
(e.key ===
|
|
604
|
-
(e.key ===
|
|
605
|
-
(e.key ===
|
|
639
|
+
(e.key === "ArrowDown" && !opts.keyboardDelegate?.getKeyBelow) ||
|
|
640
|
+
(e.key === "ArrowUp" && !opts.keyboardDelegate?.getKeyAbove) ||
|
|
641
|
+
(e.key === "ArrowLeft" && !opts.keyboardDelegate?.getKeyLeftOf) ||
|
|
642
|
+
(e.key === "ArrowRight" && !opts.keyboardDelegate?.getKeyRightOf) ||
|
|
643
|
+
(e.key === "Home" && !opts.keyboardDelegate?.getFirstKey) ||
|
|
644
|
+
(e.key === "End" && !opts.keyboardDelegate?.getLastKey)
|
|
606
645
|
) {
|
|
607
646
|
callUserOnKeyDown();
|
|
608
647
|
return;
|
|
609
648
|
}
|
|
610
|
-
const isForwardKey =
|
|
611
|
-
|
|
612
|
-
const
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
649
|
+
const isForwardKey =
|
|
650
|
+
e.key === "ArrowDown" || e.key === forwardHorizontalKey || e.key === "Home";
|
|
651
|
+
const direction = isForwardKey ? "next" : "previous";
|
|
652
|
+
const navigationStart = e.key === "Home" || e.key === "End" ? null : state.target;
|
|
653
|
+
const nextTarget = findNextValidTarget(
|
|
654
|
+
navigationStart,
|
|
655
|
+
(target) =>
|
|
656
|
+
opts.dropTargetDelegate.getKeyboardNavigationTarget?.(
|
|
657
|
+
target,
|
|
658
|
+
direction,
|
|
659
|
+
isValidDropTarget,
|
|
660
|
+
) ?? resolveFallbackKeyboardTarget(e.key, target),
|
|
619
661
|
);
|
|
620
662
|
if (nextTarget) {
|
|
621
663
|
e.preventDefault();
|
|
@@ -625,27 +667,27 @@ export function createDroppableCollection(
|
|
|
625
667
|
return;
|
|
626
668
|
}
|
|
627
669
|
if (
|
|
628
|
-
e.key ===
|
|
629
|
-
e.key ===
|
|
630
|
-
e.key ===
|
|
631
|
-
e.key ===
|
|
632
|
-
e.key ===
|
|
633
|
-
e.key ===
|
|
670
|
+
e.key === "ArrowDown" ||
|
|
671
|
+
e.key === "ArrowUp" ||
|
|
672
|
+
e.key === "ArrowRight" ||
|
|
673
|
+
e.key === "ArrowLeft" ||
|
|
674
|
+
e.key === "Home" ||
|
|
675
|
+
e.key === "End"
|
|
634
676
|
) {
|
|
635
677
|
if (
|
|
636
|
-
(e.key ===
|
|
637
|
-
(e.key ===
|
|
638
|
-
(e.key ===
|
|
639
|
-
(e.key ===
|
|
640
|
-
(e.key ===
|
|
641
|
-
(e.key ===
|
|
678
|
+
(e.key === "ArrowDown" && !opts.keyboardDelegate?.getKeyBelow) ||
|
|
679
|
+
(e.key === "ArrowUp" && !opts.keyboardDelegate?.getKeyAbove) ||
|
|
680
|
+
(e.key === "ArrowLeft" && !opts.keyboardDelegate?.getKeyLeftOf) ||
|
|
681
|
+
(e.key === "ArrowRight" && !opts.keyboardDelegate?.getKeyRightOf) ||
|
|
682
|
+
(e.key === "Home" && !opts.keyboardDelegate?.getFirstKey) ||
|
|
683
|
+
(e.key === "End" && !opts.keyboardDelegate?.getLastKey)
|
|
642
684
|
) {
|
|
643
685
|
callUserOnKeyDown();
|
|
644
686
|
return;
|
|
645
687
|
}
|
|
646
|
-
const navigationStart = e.key ===
|
|
688
|
+
const navigationStart = e.key === "Home" || e.key === "End" ? null : state.target;
|
|
647
689
|
const nextTarget = findNextValidTarget(navigationStart, (target) =>
|
|
648
|
-
resolveFallbackKeyboardTarget(e.key, target)
|
|
690
|
+
resolveFallbackKeyboardTarget(e.key, target),
|
|
649
691
|
);
|
|
650
692
|
if (nextTarget) {
|
|
651
693
|
e.preventDefault();
|
|
@@ -654,13 +696,13 @@ export function createDroppableCollection(
|
|
|
654
696
|
callUserOnKeyDown();
|
|
655
697
|
return;
|
|
656
698
|
}
|
|
657
|
-
if (e.key ===
|
|
699
|
+
if (e.key === "Enter" && state.target) {
|
|
658
700
|
e.preventDefault();
|
|
659
701
|
state.activateTarget(0, 0);
|
|
660
702
|
callUserOnKeyDown();
|
|
661
703
|
return;
|
|
662
704
|
}
|
|
663
|
-
if (e.key ===
|
|
705
|
+
if (e.key === "Escape" && state.target) {
|
|
664
706
|
e.preventDefault();
|
|
665
707
|
state.exitTarget(0, 0);
|
|
666
708
|
callUserOnKeyDown();
|
|
@@ -676,7 +718,85 @@ export function createDroppableCollection(
|
|
|
676
718
|
|
|
677
719
|
return {
|
|
678
720
|
get collectionProps() {
|
|
679
|
-
return collectionProps() as DroppableCollectionAria[
|
|
721
|
+
return collectionProps() as DroppableCollectionAria["collectionProps"];
|
|
680
722
|
},
|
|
681
723
|
};
|
|
682
724
|
}
|
|
725
|
+
|
|
726
|
+
function normalizeSelection(selection: "all" | Iterable<Key> | undefined): "all" | Set<Key> | null {
|
|
727
|
+
if (selection == null) return null;
|
|
728
|
+
if (selection === "all") return "all";
|
|
729
|
+
return new Set(selection);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
function selectionEquals(a: "all" | Set<Key> | null, b: "all" | Set<Key> | null): boolean {
|
|
733
|
+
if (a === b) return true;
|
|
734
|
+
if (!a || !b || a === "all" || b === "all") return false;
|
|
735
|
+
if (a.size !== b.size) return false;
|
|
736
|
+
for (const key of a) {
|
|
737
|
+
if (!b.has(key)) return false;
|
|
738
|
+
}
|
|
739
|
+
return true;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
function getNewItemKeys(collection: CollectionLike, previousCollection: CollectionLike): Set<Key> {
|
|
743
|
+
const keys = new Set<Key>();
|
|
744
|
+
const visit = (node: CollectionNodeLike) => {
|
|
745
|
+
if (node.type === "item" && !previousCollection.getItem(node.key)) {
|
|
746
|
+
keys.add(node.key);
|
|
747
|
+
}
|
|
748
|
+
for (const child of node.childNodes ?? []) {
|
|
749
|
+
visit(child);
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
for (const node of collection) {
|
|
754
|
+
visit(node);
|
|
755
|
+
}
|
|
756
|
+
return keys;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function updateFocusAfterDrop(
|
|
760
|
+
opts: DroppableCollectionOptions,
|
|
761
|
+
previousCollection: CollectionLike | undefined,
|
|
762
|
+
previousSelectedKeys: "all" | Set<Key> | null,
|
|
763
|
+
target: DropTarget,
|
|
764
|
+
): void {
|
|
765
|
+
const collection = opts.collection;
|
|
766
|
+
if (!collection || !previousCollection) return;
|
|
767
|
+
|
|
768
|
+
const newKeys = getNewItemKeys(collection, previousCollection);
|
|
769
|
+
if (newKeys.size === 0) return;
|
|
770
|
+
|
|
771
|
+
const currentSelectedKeys = normalizeSelection(opts.selectedKeys);
|
|
772
|
+
if (
|
|
773
|
+
opts.setSelectedKeys &&
|
|
774
|
+
previousSelectedKeys &&
|
|
775
|
+
selectionEquals(previousSelectedKeys, currentSelectedKeys)
|
|
776
|
+
) {
|
|
777
|
+
opts.setSelectedKeys(newKeys);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
const first = newKeys.values().next().value;
|
|
781
|
+
if (first == null) return;
|
|
782
|
+
|
|
783
|
+
let focusKey: Key | null = first;
|
|
784
|
+
const item = collection.getItem(first);
|
|
785
|
+
const parent = item?.parentKey != null ? collection.getItem(item.parentKey) : null;
|
|
786
|
+
const isDroppedOnCollapsedParent =
|
|
787
|
+
target.type === "item" &&
|
|
788
|
+
target.dropPosition === "on" &&
|
|
789
|
+
item?.parentKey != null &&
|
|
790
|
+
parent?.isExpanded !== true;
|
|
791
|
+
|
|
792
|
+
if (item && (item.type === "cell" || item.type === "rowheader" || isDroppedOnCollapsedParent)) {
|
|
793
|
+
focusKey = item.parentKey ?? first;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
opts.setFocusedKey?.(focusKey);
|
|
797
|
+
|
|
798
|
+
queueMicrotask(() => {
|
|
799
|
+
const row = opts.ref()?.querySelector<HTMLElement>('[role="row"][tabindex="0"]');
|
|
800
|
+
row?.focus();
|
|
801
|
+
});
|
|
802
|
+
}
|