@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
|
@@ -5,24 +5,25 @@
|
|
|
5
5
|
* component like ListBox, GridList, or Table.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { createMemo, onCleanup, type Accessor } from "solid-js";
|
|
8
|
+
import { createEffect, createMemo, onCleanup, type Accessor } from "solid-js";
|
|
9
9
|
import type { JSX } from "solid-js";
|
|
10
10
|
import type {
|
|
11
|
+
Collection,
|
|
11
12
|
DroppableCollectionState,
|
|
12
13
|
DropTarget,
|
|
13
14
|
DropOperation,
|
|
14
15
|
DropItem,
|
|
16
|
+
DragType,
|
|
15
17
|
DragTypes,
|
|
16
18
|
Key,
|
|
17
19
|
} from "@proyecto-viviana/solid-stately";
|
|
18
20
|
import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
|
|
19
21
|
import { createDrop } from "./createDrop";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from "
|
|
25
|
-
import { getGlobalAllowedDropOperations, DROP_OPERATION } from "./utils";
|
|
22
|
+
import { getGlobalDraggingCollectionRef, getGlobalDraggingKeys } from "./createDraggableCollection";
|
|
23
|
+
import { getTypes } from "./utils";
|
|
24
|
+
import { registerDropTarget } from "./DragManager";
|
|
25
|
+
import { navigate, type DropNavigationKeyboardDelegate } from "./DropTargetKeyboardNavigation";
|
|
26
|
+
import { useLocale } from "../i18n/locale";
|
|
26
27
|
|
|
27
28
|
// Global state for tracking the drop collection
|
|
28
29
|
let globalDropCollectionRef: HTMLElement | null = null;
|
|
@@ -128,8 +129,12 @@ export interface DroppableCollectionOptions {
|
|
|
128
129
|
keyboardDelegate?: KeyboardDelegateLike;
|
|
129
130
|
/** Optional keyboard handler composed with internal drop target navigation keys. */
|
|
130
131
|
onKeyDown?: (e: KeyboardEvent) => void;
|
|
131
|
-
/**
|
|
132
|
-
|
|
132
|
+
/**
|
|
133
|
+
* The collection backing the droppable. Used both to restore focus/selection
|
|
134
|
+
* after a drop mutates items and to drive keyboard drop-target navigation
|
|
135
|
+
* (`navigate()` walks `getKeyAfter`/`getKeyBefore`).
|
|
136
|
+
*/
|
|
137
|
+
collection?: Collection;
|
|
133
138
|
/** Current collection selection used to avoid replacing user-updated selection after a drop. */
|
|
134
139
|
selectedKeys?: "all" | Iterable<Key>;
|
|
135
140
|
/** Sets collection selection after a drop when new rows were inserted and selection was unchanged. */
|
|
@@ -170,6 +175,10 @@ export function createDroppableCollection(
|
|
|
170
175
|
): DroppableCollectionAria {
|
|
171
176
|
const getOptions = createMemo(() => options());
|
|
172
177
|
|
|
178
|
+
// Layout direction drives keyboard drop-target navigation (Left/Right flip in
|
|
179
|
+
// RTL). Read at the reactive owner so the registration effect re-runs on change.
|
|
180
|
+
const locale = useLocale();
|
|
181
|
+
|
|
173
182
|
// Track the next target during drag operations
|
|
174
183
|
let nextTarget: DropTarget | null = null;
|
|
175
184
|
let currentDropOperation: DropOperation | null = null;
|
|
@@ -185,7 +194,13 @@ export function createDroppableCollection(
|
|
|
185
194
|
types: DragTypes,
|
|
186
195
|
allowedOperations: DropOperation[],
|
|
187
196
|
): DropOperation => {
|
|
188
|
-
return state.getDropOperation(
|
|
197
|
+
return state.getDropOperation(
|
|
198
|
+
target,
|
|
199
|
+
types,
|
|
200
|
+
allowedOperations,
|
|
201
|
+
isInternalDropOperation(),
|
|
202
|
+
getGlobalDraggingKeys(),
|
|
203
|
+
);
|
|
189
204
|
};
|
|
190
205
|
|
|
191
206
|
// Create base drop behavior
|
|
@@ -255,29 +270,37 @@ export function createDroppableCollection(
|
|
|
255
270
|
}
|
|
256
271
|
},
|
|
257
272
|
onDrop: (e) => {
|
|
258
|
-
|
|
259
|
-
setGlobalDropCollectionRef(opts.ref());
|
|
260
|
-
|
|
273
|
+
setGlobalDropCollectionRef(getOptions().ref());
|
|
261
274
|
if (state.target) {
|
|
262
|
-
|
|
263
|
-
const previousCollection = opts.collection;
|
|
264
|
-
const previousSelectedKeys = normalizeSelection(opts.selectedKeys);
|
|
265
|
-
opts.onDrop?.({
|
|
266
|
-
items: e.items,
|
|
267
|
-
target,
|
|
268
|
-
dropOperation: e.dropOperation,
|
|
269
|
-
x: e.x,
|
|
270
|
-
y: e.y,
|
|
271
|
-
});
|
|
272
|
-
void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {
|
|
273
|
-
queueMicrotask(() => {
|
|
274
|
-
updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);
|
|
275
|
-
});
|
|
276
|
-
});
|
|
275
|
+
runDrop(e, state.target);
|
|
277
276
|
}
|
|
278
277
|
},
|
|
279
278
|
}));
|
|
280
279
|
|
|
280
|
+
// Shared drop handler for both the native-pointer path (createDrop, above) and
|
|
281
|
+
// the keyboard path (the DragManager-registered drop target, below). Mirrors
|
|
282
|
+
// upstream's `defaultOnDrop`, which `useDrop` and `DragManager` both invoke.
|
|
283
|
+
const runDrop = (
|
|
284
|
+
e: { items: DropItem[]; dropOperation: DropOperation; x: number; y: number },
|
|
285
|
+
target: DropTarget,
|
|
286
|
+
) => {
|
|
287
|
+
const opts = getOptions();
|
|
288
|
+
const previousCollection = opts.collection;
|
|
289
|
+
const previousSelectedKeys = normalizeSelection(opts.selectedKeys);
|
|
290
|
+
opts.onDrop?.({
|
|
291
|
+
items: e.items,
|
|
292
|
+
target,
|
|
293
|
+
dropOperation: e.dropOperation,
|
|
294
|
+
x: e.x,
|
|
295
|
+
y: e.y,
|
|
296
|
+
});
|
|
297
|
+
void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {
|
|
298
|
+
queueMicrotask(() => {
|
|
299
|
+
updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
|
|
281
304
|
const handleDrop = async (
|
|
282
305
|
items: DropItem[],
|
|
283
306
|
target: DropTarget,
|
|
@@ -285,6 +308,13 @@ export function createDroppableCollection(
|
|
|
285
308
|
) => {
|
|
286
309
|
const opts = getOptions();
|
|
287
310
|
const isInternal = isInternalDropOperation();
|
|
311
|
+
// Capture the dragging keys ONCE up front, mirroring upstream's
|
|
312
|
+
// `let {draggingKeys} = globalDndState` at the top of `defaultOnDrop`. In
|
|
313
|
+
// Solid the global keys live in a signal whose drag-teardown effect flushes
|
|
314
|
+
// synchronously during this same drop flow (React batches, so upstream never
|
|
315
|
+
// observes the clear mid-handler). Re-reading the global in the onMove/onReorder
|
|
316
|
+
// branches would therefore see an already-emptied set; the snapshot preserves it.
|
|
317
|
+
const draggingKeys = getGlobalDraggingKeys();
|
|
288
318
|
|
|
289
319
|
// Filter items by accepted types
|
|
290
320
|
let filteredItems = items;
|
|
@@ -315,7 +345,6 @@ export function createDroppableCollection(
|
|
|
315
345
|
|
|
316
346
|
// Handle move for internal operations
|
|
317
347
|
if (opts.onMove && isInternal) {
|
|
318
|
-
const draggingKeys = getGlobalDraggingKeys();
|
|
319
348
|
await opts.onMove({
|
|
320
349
|
keys: draggingKeys,
|
|
321
350
|
target,
|
|
@@ -333,7 +362,6 @@ export function createDroppableCollection(
|
|
|
333
362
|
}
|
|
334
363
|
|
|
335
364
|
if (isInternal && opts.onReorder) {
|
|
336
|
-
const draggingKeys = getGlobalDraggingKeys();
|
|
337
365
|
await opts.onReorder({
|
|
338
366
|
keys: draggingKeys,
|
|
339
367
|
target,
|
|
@@ -352,367 +380,418 @@ export function createDroppableCollection(
|
|
|
352
380
|
}
|
|
353
381
|
});
|
|
354
382
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
383
|
+
// Wrap the raw `Set<string>` the DragManager hands keyboard drop targets into
|
|
384
|
+
// the `DragTypes` delegate the port state expects. Mirrors upstream, which
|
|
385
|
+
// passes the raw Set to `state.getDropOperation` (no wildcard expansion — that
|
|
386
|
+
// lives in the DataTransfer-backed DragTypes used by the native-pointer path).
|
|
387
|
+
const wrapTypes = (types: Set<string>): DragTypes => ({
|
|
388
|
+
has: (type: DragType | DragType[]) => {
|
|
389
|
+
if (typeof type === "string") return types.has(type);
|
|
390
|
+
if (Array.isArray(type)) return type.some((t) => typeof t === "string" && types.has(t));
|
|
391
|
+
return false;
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
const targetsEqual = (
|
|
396
|
+
a: DropTarget | null | undefined,
|
|
397
|
+
b: DropTarget | null | undefined,
|
|
398
|
+
): boolean => {
|
|
399
|
+
if (!a || !b) return false;
|
|
400
|
+
if (a.type !== b.type) return false;
|
|
401
|
+
if (a.type === "root") return true;
|
|
402
|
+
if (a.type !== "item" || b.type !== "item") return false;
|
|
403
|
+
return a.key === b.key && a.dropPosition === b.dropPosition;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// Port substitute for upstream's `state.isDropTarget(target)` (the port state
|
|
407
|
+
// exposes `isDropTarget` only as a "drag is over this collection" boolean, not
|
|
408
|
+
// a per-target predicate): whether `target` equals the current drop target.
|
|
409
|
+
const isCurrentTarget = (target: DropTarget | null | undefined): boolean =>
|
|
410
|
+
targetsEqual(state.target, target);
|
|
411
|
+
|
|
412
|
+
// Register the collection element as a keyboard/virtual drop target on the
|
|
413
|
+
// DragManager singleton. This is the faithful port of upstream
|
|
414
|
+
// `useDroppableCollection`'s `useEffect` (react-aria 3.50) that installs the
|
|
415
|
+
// DragManager DropTarget — replacing the port's former self-contained
|
|
416
|
+
// `collectionProps.onKeyDown` engine. Re-runs when the element or locale
|
|
417
|
+
// direction changes (upstream keys the effect on `[localState, ref, onDrop, direction]`).
|
|
418
|
+
createEffect(() => {
|
|
419
|
+
const refEl = getOptions().ref();
|
|
420
|
+
if (!refEl) return;
|
|
421
|
+
const rtl = locale().direction === "rtl";
|
|
422
|
+
|
|
423
|
+
const getNextTarget = (
|
|
424
|
+
target: DropTarget | null | undefined,
|
|
425
|
+
wrap = true,
|
|
426
|
+
key: "left" | "right" | "up" | "down" = "down",
|
|
427
|
+
): DropTarget | null => {
|
|
360
428
|
const opts = getOptions();
|
|
361
|
-
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
has: (type: string | symbol) => typeof type === "string" && draggingTypes.has(type),
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
const isValidDropTarget = (target: DropTarget) =>
|
|
397
|
-
state.getDropOperation(target, getKeyboardDragTypes(), getKeyboardAllowedOperations()) !==
|
|
398
|
-
"cancel";
|
|
399
|
-
const targetsEqual = (a: DropTarget, b: DropTarget): boolean => {
|
|
400
|
-
if (a.type !== b.type) return false;
|
|
401
|
-
if (a.type === "root" && b.type === "root") return true;
|
|
402
|
-
if (a.type !== "item" || b.type !== "item") return false;
|
|
403
|
-
return a.key === b.key && a.dropPosition === b.dropPosition;
|
|
404
|
-
};
|
|
405
|
-
const findNextValidTarget = (
|
|
406
|
-
start: DropTarget | null,
|
|
407
|
-
getNext: (target: DropTarget | null) => DropTarget | null,
|
|
408
|
-
): DropTarget | null => {
|
|
409
|
-
let current = start;
|
|
410
|
-
let seenRoot = 0;
|
|
411
|
-
let safety = 0;
|
|
412
|
-
while (safety < 256) {
|
|
413
|
-
safety += 1;
|
|
414
|
-
const next = getNext(current);
|
|
415
|
-
if (!next) return null;
|
|
416
|
-
if (current && targetsEqual(current, next)) {
|
|
417
|
-
return isValidDropTarget(next) ? next : null;
|
|
418
|
-
}
|
|
419
|
-
current = next;
|
|
420
|
-
if (next.type === "root") {
|
|
421
|
-
seenRoot += 1;
|
|
422
|
-
if (seenRoot >= 2) {
|
|
423
|
-
return isValidDropTarget(next) ? next : null;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
if (isValidDropTarget(next)) return next;
|
|
427
|
-
}
|
|
428
|
-
return null;
|
|
429
|
-
};
|
|
430
|
-
const resolveTargetForKey = (
|
|
431
|
-
key: string | number | null,
|
|
432
|
-
direction: "next" | "previous",
|
|
433
|
-
): DropTarget | null => {
|
|
434
|
-
if (key == null) return null;
|
|
435
|
-
const onTarget: DropTarget = { type: "item", key, dropPosition: "on" };
|
|
436
|
-
if (isValidDropTarget(onTarget)) return onTarget;
|
|
437
|
-
const insertionOrder: Array<"before" | "after"> =
|
|
438
|
-
direction === "next" ? ["before", "after"] : ["after", "before"];
|
|
439
|
-
for (const position of insertionOrder) {
|
|
440
|
-
const insertionTarget: DropTarget = { type: "item", key, dropPosition: position };
|
|
441
|
-
if (isValidDropTarget(insertionTarget)) return insertionTarget;
|
|
442
|
-
}
|
|
443
|
-
return null;
|
|
444
|
-
};
|
|
445
|
-
const resolveBoundaryTargetForDirection = (
|
|
446
|
-
key: string | number | null,
|
|
447
|
-
direction: "next" | "previous",
|
|
448
|
-
): DropTarget | null => {
|
|
449
|
-
if (key == null) return null;
|
|
450
|
-
const boundaryOrder: Array<"before" | "on" | "after"> =
|
|
451
|
-
direction === "next" ? ["before", "on", "after"] : ["after", "on", "before"];
|
|
452
|
-
for (const position of boundaryOrder) {
|
|
453
|
-
const candidate: DropTarget = { type: "item", key, dropPosition: position };
|
|
454
|
-
if (isValidDropTarget(candidate)) return candidate;
|
|
429
|
+
const collection = opts.collection;
|
|
430
|
+
const keyboardDelegate = opts.keyboardDelegate;
|
|
431
|
+
if (!collection || !keyboardDelegate) return null;
|
|
432
|
+
return navigate(
|
|
433
|
+
keyboardDelegate as DropNavigationKeyboardDelegate,
|
|
434
|
+
collection,
|
|
435
|
+
target,
|
|
436
|
+
key,
|
|
437
|
+
rtl,
|
|
438
|
+
wrap,
|
|
439
|
+
);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
const getPreviousTarget = (target: DropTarget | null | undefined, wrap = true) =>
|
|
443
|
+
getNextTarget(target, wrap, "up");
|
|
444
|
+
|
|
445
|
+
const nextValidTarget = (
|
|
446
|
+
target: DropTarget | null | undefined,
|
|
447
|
+
types: Set<string>,
|
|
448
|
+
allowedDropOperations: DropOperation[],
|
|
449
|
+
getNext: (target: DropTarget | null | undefined, wrap: boolean) => DropTarget | null,
|
|
450
|
+
wrap = true,
|
|
451
|
+
): DropTarget | null => {
|
|
452
|
+
let seenRoot = 0;
|
|
453
|
+
let operation: DropOperation;
|
|
454
|
+
do {
|
|
455
|
+
const next = getNext(target, wrap);
|
|
456
|
+
if (!next) return null;
|
|
457
|
+
target = next;
|
|
458
|
+
operation = getDropOperationForTarget(next, wrapTypes(types), allowedDropOperations);
|
|
459
|
+
if (target.type === "root") {
|
|
460
|
+
seenRoot++;
|
|
455
461
|
}
|
|
462
|
+
} while (operation === "cancel" && !isCurrentTarget(target) && seenRoot < 2);
|
|
463
|
+
|
|
464
|
+
if (operation === "cancel") {
|
|
456
465
|
return null;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
): DropTarget | null => {
|
|
469
|
-
if (currentKey == null) {
|
|
470
|
-
const boundaryKey =
|
|
471
|
-
direction === "next"
|
|
472
|
-
? keyboardDelegate.getFirstKey?.()
|
|
473
|
-
: keyboardDelegate.getLastKey?.();
|
|
474
|
-
return resolveBoundaryTargetForDirection(boundaryKey ?? null, direction);
|
|
475
|
-
}
|
|
476
|
-
if (!getter) return null;
|
|
477
|
-
let nextKey = getter(currentKey);
|
|
478
|
-
let safety = 0;
|
|
479
|
-
while (nextKey != null && safety < 256) {
|
|
480
|
-
const resolvedTarget = resolveTargetForKey(nextKey, direction);
|
|
481
|
-
if (resolvedTarget) return resolvedTarget;
|
|
482
|
-
const candidate = getter(nextKey);
|
|
483
|
-
if (candidate === nextKey) break;
|
|
484
|
-
nextKey = candidate;
|
|
485
|
-
safety += 1;
|
|
486
|
-
}
|
|
487
|
-
return null;
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
if (keyName === "ArrowDown") return keyForDirection("next", keyboardDelegate.getKeyBelow);
|
|
491
|
-
if (keyName === "ArrowUp") return keyForDirection("previous", keyboardDelegate.getKeyAbove);
|
|
492
|
-
if (keyName === forwardHorizontalKey) {
|
|
493
|
-
return keyForDirection(
|
|
494
|
-
"next",
|
|
495
|
-
isRtl ? keyboardDelegate.getKeyLeftOf : keyboardDelegate.getKeyRightOf,
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
if (keyName === backwardHorizontalKey) {
|
|
499
|
-
return keyForDirection(
|
|
500
|
-
"previous",
|
|
501
|
-
isRtl ? keyboardDelegate.getKeyRightOf : keyboardDelegate.getKeyLeftOf,
|
|
502
|
-
);
|
|
503
|
-
}
|
|
504
|
-
if (keyName === "Home")
|
|
505
|
-
return resolveBoundaryTargetForDirection(
|
|
506
|
-
keyboardDelegate.getFirstKey?.() ?? null,
|
|
507
|
-
"next",
|
|
508
|
-
);
|
|
509
|
-
if (keyName === "End")
|
|
510
|
-
return resolveBoundaryTargetForDirection(
|
|
511
|
-
keyboardDelegate.getLastKey?.() ?? null,
|
|
512
|
-
"previous",
|
|
513
|
-
);
|
|
514
|
-
if (keyName === "PageDown") {
|
|
515
|
-
if (currentKey != null && keyboardDelegate.getKeyPageBelow) {
|
|
516
|
-
return resolveTargetForKey(keyboardDelegate.getKeyPageBelow(currentKey), "next");
|
|
517
|
-
}
|
|
518
|
-
return keyForDirection("next", keyboardDelegate.getKeyBelow);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
return target;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
const unregister = registerDropTarget({
|
|
472
|
+
element: refEl,
|
|
473
|
+
preventFocusOnDrop: true,
|
|
474
|
+
getDropOperation(types, allowedOperations) {
|
|
475
|
+
if (state.target) {
|
|
476
|
+
return getDropOperationForTarget(state.target, wrapTypes(types), allowedOperations);
|
|
519
477
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
478
|
+
|
|
479
|
+
// Check if any of the targets accept the drop.
|
|
480
|
+
const target = nextValidTarget(null, types, allowedOperations, (t, wrap) =>
|
|
481
|
+
getNextTarget(t, wrap),
|
|
482
|
+
);
|
|
483
|
+
return target ? "move" : "cancel";
|
|
484
|
+
},
|
|
485
|
+
onDropEnter(_e, drag) {
|
|
486
|
+
const types = getTypes(drag.items);
|
|
487
|
+
// Update the drop collection ref tracker for createDroppableItem's isInternal check.
|
|
488
|
+
setGlobalDropCollectionRef(getOptions().ref());
|
|
489
|
+
|
|
490
|
+
// When entering the droppable collection for the first time, upstream's
|
|
491
|
+
// default drop target is AFTER the focused key
|
|
492
|
+
// (useDroppableCollection.ts:505-559). The port's DroppableCollectionState
|
|
493
|
+
// carries no selectionManager, but at keyboard pickup the dragged item IS
|
|
494
|
+
// the collection's focused item, so we recover the focused key from the
|
|
495
|
+
// drag target element's `data-key` (createSelectableItem stamps it).
|
|
496
|
+
const opts = getOptions();
|
|
497
|
+
let key = keyFromDragElement(drag.element, opts.collection);
|
|
498
|
+
let dropPosition: "before" | "on" | "after" = "after";
|
|
499
|
+
|
|
500
|
+
// Mirror upstream's reorder heuristic: if the focused item is also
|
|
501
|
+
// selected, drop after the last selected item; but if it is the first of
|
|
502
|
+
// a multi-selection, drop before the first (select-down → move down,
|
|
503
|
+
// select-up → move up). Single-key keyboard drags never hit this branch.
|
|
504
|
+
const selected = normalizeSelection(opts.selectedKeys);
|
|
505
|
+
if (key != null && opts.collection && selectionHas(selected, key)) {
|
|
506
|
+
const ordered = orderedSelectedKeys(selected, opts.collection);
|
|
507
|
+
if (ordered.length > 1 && ordered[0] === key) {
|
|
508
|
+
dropPosition = "before";
|
|
509
|
+
} else if (ordered.length > 0) {
|
|
510
|
+
key = ordered[ordered.length - 1];
|
|
523
511
|
}
|
|
524
|
-
return keyForDirection("previous", keyboardDelegate.getKeyAbove);
|
|
525
512
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const keyboardDelegate = opts.keyboardDelegate;
|
|
533
|
-
if (!keyboardDelegate) return null;
|
|
534
|
-
if (direction === "next") {
|
|
535
|
-
let targetKey = keyboardDelegate.getFirstKey?.() ?? null;
|
|
536
|
-
let dropPosition: "before" | "on" | "after" = "after";
|
|
537
|
-
if (currentTarget.type === "item") {
|
|
538
|
-
targetKey = currentTarget.key;
|
|
539
|
-
dropPosition = currentTarget.dropPosition;
|
|
540
|
-
}
|
|
541
|
-
let nextKey =
|
|
542
|
-
targetKey != null ? (keyboardDelegate.getKeyPageBelow?.(targetKey) ?? null) : null;
|
|
513
|
+
|
|
514
|
+
let target: DropTarget | null = null;
|
|
515
|
+
if (key != null) {
|
|
516
|
+
target = { type: "item", key, dropPosition };
|
|
517
|
+
// If the default target is not valid, find the next one that is, then
|
|
518
|
+
// fall back to the previous. Mirrors useDroppableCollection.ts:538-551.
|
|
543
519
|
if (
|
|
544
|
-
|
|
545
|
-
|
|
520
|
+
getDropOperationForTarget(target, wrapTypes(types), drag.allowedDropOperations) ===
|
|
521
|
+
"cancel"
|
|
546
522
|
) {
|
|
547
|
-
|
|
548
|
-
|
|
523
|
+
target =
|
|
524
|
+
nextValidTarget(
|
|
525
|
+
target,
|
|
526
|
+
types,
|
|
527
|
+
drag.allowedDropOperations,
|
|
528
|
+
(t, wrap) => getNextTarget(t, wrap),
|
|
529
|
+
false,
|
|
530
|
+
) ??
|
|
531
|
+
nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
|
|
549
532
|
}
|
|
550
|
-
if (nextKey == null) return null;
|
|
551
|
-
return {
|
|
552
|
-
type: "item",
|
|
553
|
-
key: nextKey,
|
|
554
|
-
dropPosition,
|
|
555
|
-
};
|
|
556
533
|
}
|
|
557
534
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
let dropPosition: "before" | "on" | "after" = currentTarget.dropPosition;
|
|
564
|
-
if (nextKey == null) {
|
|
565
|
-
nextKey = keyboardDelegate.getFirstKey?.() ?? null;
|
|
566
|
-
dropPosition = "before";
|
|
567
|
-
}
|
|
568
|
-
if (nextKey == null) return null;
|
|
569
|
-
return {
|
|
570
|
-
type: "item",
|
|
571
|
-
key: nextKey,
|
|
572
|
-
dropPosition,
|
|
573
|
-
};
|
|
535
|
+
// If no focused key, start from the root (upstream's fallback).
|
|
536
|
+
if (!target) {
|
|
537
|
+
target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>
|
|
538
|
+
getNextTarget(t, wrap),
|
|
539
|
+
);
|
|
574
540
|
}
|
|
575
541
|
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
542
|
+
state.setTarget(target);
|
|
543
|
+
},
|
|
544
|
+
onDropExit() {
|
|
545
|
+
setGlobalDropCollectionRef(null);
|
|
546
|
+
state.setTarget(null);
|
|
547
|
+
},
|
|
548
|
+
onDropTargetEnter(target) {
|
|
549
|
+
state.setTarget(target);
|
|
550
|
+
},
|
|
551
|
+
onDropActivate(e, target) {
|
|
552
|
+
const opts = getOptions();
|
|
579
553
|
if (
|
|
580
|
-
|
|
581
|
-
|
|
554
|
+
target?.type === "item" &&
|
|
555
|
+
target?.dropPosition === "on" &&
|
|
556
|
+
typeof opts.onDropActivate === "function"
|
|
582
557
|
) {
|
|
583
|
-
|
|
584
|
-
return;
|
|
558
|
+
opts.onDropActivate({ target, x: e.x, y: e.y });
|
|
585
559
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
target
|
|
591
|
-
navDirection: "next" | "previous",
|
|
592
|
-
): DropTarget | null =>
|
|
593
|
-
stepNavigation?.(target, navDirection, isValidDropTarget) ??
|
|
594
|
-
resolveFallbackKeyboardTarget(
|
|
595
|
-
navDirection === "next" ? "ArrowDown" : "ArrowUp",
|
|
596
|
-
target,
|
|
597
|
-
) ??
|
|
598
|
-
resolveFallbackKeyboardTarget(navDirection === "next" ? "Home" : "End", target) ??
|
|
599
|
-
null;
|
|
600
|
-
let nextTarget: DropTarget | null = null;
|
|
601
|
-
if (!state.target) {
|
|
602
|
-
nextTarget = findNextValidTarget(null, (target) => resolveStepTarget(target, direction));
|
|
603
|
-
} else {
|
|
604
|
-
const pageTarget =
|
|
605
|
-
pageNavigation?.(state.target, direction, isValidDropTarget) ??
|
|
606
|
-
resolvePageTargetForState(direction, state.target) ??
|
|
607
|
-
null;
|
|
608
|
-
if (pageTarget && isValidDropTarget(pageTarget)) {
|
|
609
|
-
nextTarget = pageTarget;
|
|
610
|
-
} else {
|
|
611
|
-
const startTarget = pageTarget ?? state.target;
|
|
612
|
-
nextTarget =
|
|
613
|
-
findNextValidTarget(startTarget, (target) => resolveStepTarget(target, direction)) ??
|
|
614
|
-
findNextValidTarget(startTarget, (target) =>
|
|
615
|
-
resolveStepTarget(target, direction === "next" ? "previous" : "next"),
|
|
616
|
-
);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
if (nextTarget) {
|
|
620
|
-
e.preventDefault();
|
|
621
|
-
state.setTarget(nextTarget);
|
|
622
|
-
}
|
|
623
|
-
callUserOnKeyDown();
|
|
624
|
-
return;
|
|
625
|
-
}
|
|
626
|
-
if (
|
|
627
|
-
(e.key === "ArrowDown" ||
|
|
628
|
-
e.key === "ArrowUp" ||
|
|
629
|
-
e.key === "ArrowRight" ||
|
|
630
|
-
e.key === "ArrowLeft" ||
|
|
631
|
-
e.key === "Home" ||
|
|
632
|
-
e.key === "End") &&
|
|
633
|
-
opts.dropTargetDelegate.getKeyboardNavigationTarget
|
|
634
|
-
) {
|
|
635
|
-
if (
|
|
636
|
-
(e.key === "ArrowDown" && !opts.keyboardDelegate?.getKeyBelow) ||
|
|
637
|
-
(e.key === "ArrowUp" && !opts.keyboardDelegate?.getKeyAbove) ||
|
|
638
|
-
(e.key === "ArrowLeft" && !opts.keyboardDelegate?.getKeyLeftOf) ||
|
|
639
|
-
(e.key === "ArrowRight" && !opts.keyboardDelegate?.getKeyRightOf) ||
|
|
640
|
-
(e.key === "Home" && !opts.keyboardDelegate?.getFirstKey) ||
|
|
641
|
-
(e.key === "End" && !opts.keyboardDelegate?.getLastKey)
|
|
642
|
-
) {
|
|
643
|
-
callUserOnKeyDown();
|
|
644
|
-
return;
|
|
645
|
-
}
|
|
646
|
-
const isForwardKey =
|
|
647
|
-
e.key === "ArrowDown" || e.key === forwardHorizontalKey || e.key === "Home";
|
|
648
|
-
const direction = isForwardKey ? "next" : "previous";
|
|
649
|
-
const navigationStart = e.key === "Home" || e.key === "End" ? null : state.target;
|
|
650
|
-
const nextTarget = findNextValidTarget(
|
|
651
|
-
navigationStart,
|
|
652
|
-
(target) =>
|
|
653
|
-
opts.dropTargetDelegate.getKeyboardNavigationTarget?.(
|
|
654
|
-
target,
|
|
655
|
-
direction,
|
|
656
|
-
isValidDropTarget,
|
|
657
|
-
) ?? resolveFallbackKeyboardTarget(e.key, target),
|
|
658
|
-
);
|
|
659
|
-
if (nextTarget) {
|
|
660
|
-
e.preventDefault();
|
|
661
|
-
state.setTarget(nextTarget);
|
|
560
|
+
},
|
|
561
|
+
onDrop(e, target) {
|
|
562
|
+
setGlobalDropCollectionRef(getOptions().ref());
|
|
563
|
+
if (state.target) {
|
|
564
|
+
runDrop(e, target || state.target);
|
|
662
565
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
e.key === "ArrowRight" ||
|
|
670
|
-
e.key === "ArrowLeft" ||
|
|
671
|
-
e.key === "Home" ||
|
|
672
|
-
e.key === "End"
|
|
673
|
-
) {
|
|
674
|
-
if (
|
|
675
|
-
(e.key === "ArrowDown" && !opts.keyboardDelegate?.getKeyBelow) ||
|
|
676
|
-
(e.key === "ArrowUp" && !opts.keyboardDelegate?.getKeyAbove) ||
|
|
677
|
-
(e.key === "ArrowLeft" && !opts.keyboardDelegate?.getKeyLeftOf) ||
|
|
678
|
-
(e.key === "ArrowRight" && !opts.keyboardDelegate?.getKeyRightOf) ||
|
|
679
|
-
(e.key === "Home" && !opts.keyboardDelegate?.getFirstKey) ||
|
|
680
|
-
(e.key === "End" && !opts.keyboardDelegate?.getLastKey)
|
|
681
|
-
) {
|
|
682
|
-
callUserOnKeyDown();
|
|
566
|
+
},
|
|
567
|
+
onKeyDown(e, drag) {
|
|
568
|
+
const opts = getOptions();
|
|
569
|
+
const keyboardDelegate = opts.keyboardDelegate;
|
|
570
|
+
if (!keyboardDelegate) {
|
|
571
|
+
opts.onKeyDown?.(e);
|
|
683
572
|
return;
|
|
684
573
|
}
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
574
|
+
const types = getTypes(drag.items);
|
|
575
|
+
switch (e.key) {
|
|
576
|
+
case "ArrowDown": {
|
|
577
|
+
if (keyboardDelegate.getKeyBelow) {
|
|
578
|
+
const target = nextValidTarget(
|
|
579
|
+
state.target,
|
|
580
|
+
types,
|
|
581
|
+
drag.allowedDropOperations,
|
|
582
|
+
(t, wrap) => getNextTarget(t, wrap, "down"),
|
|
583
|
+
);
|
|
584
|
+
state.setTarget(target);
|
|
585
|
+
}
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
case "ArrowUp": {
|
|
589
|
+
if (keyboardDelegate.getKeyAbove) {
|
|
590
|
+
const target = nextValidTarget(
|
|
591
|
+
state.target,
|
|
592
|
+
types,
|
|
593
|
+
drag.allowedDropOperations,
|
|
594
|
+
(t, wrap) => getNextTarget(t, wrap, "up"),
|
|
595
|
+
);
|
|
596
|
+
state.setTarget(target);
|
|
597
|
+
}
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
case "ArrowLeft": {
|
|
601
|
+
if (keyboardDelegate.getKeyLeftOf) {
|
|
602
|
+
const target = nextValidTarget(
|
|
603
|
+
state.target,
|
|
604
|
+
types,
|
|
605
|
+
drag.allowedDropOperations,
|
|
606
|
+
(t, wrap) => getNextTarget(t, wrap, "left"),
|
|
607
|
+
);
|
|
608
|
+
state.setTarget(target);
|
|
609
|
+
}
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
case "ArrowRight": {
|
|
613
|
+
if (keyboardDelegate.getKeyRightOf) {
|
|
614
|
+
const target = nextValidTarget(
|
|
615
|
+
state.target,
|
|
616
|
+
types,
|
|
617
|
+
drag.allowedDropOperations,
|
|
618
|
+
(t, wrap) => getNextTarget(t, wrap, "right"),
|
|
619
|
+
);
|
|
620
|
+
state.setTarget(target);
|
|
621
|
+
}
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
case "Home": {
|
|
625
|
+
if (keyboardDelegate.getFirstKey) {
|
|
626
|
+
const target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>
|
|
627
|
+
getNextTarget(t, wrap),
|
|
628
|
+
);
|
|
629
|
+
state.setTarget(target);
|
|
630
|
+
}
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
case "End": {
|
|
634
|
+
if (keyboardDelegate.getLastKey) {
|
|
635
|
+
const target = nextValidTarget(
|
|
636
|
+
null,
|
|
637
|
+
types,
|
|
638
|
+
drag.allowedDropOperations,
|
|
639
|
+
getPreviousTarget,
|
|
640
|
+
);
|
|
641
|
+
state.setTarget(target);
|
|
642
|
+
}
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
case "PageDown": {
|
|
646
|
+
if (keyboardDelegate.getKeyPageBelow) {
|
|
647
|
+
let target = state.target;
|
|
648
|
+
if (!target) {
|
|
649
|
+
target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>
|
|
650
|
+
getNextTarget(t, wrap),
|
|
651
|
+
);
|
|
652
|
+
} else {
|
|
653
|
+
// If on the root, go to the item a page below the top. Otherwise a page below the current item.
|
|
654
|
+
let targetKey = keyboardDelegate.getFirstKey?.();
|
|
655
|
+
if (target.type === "item") {
|
|
656
|
+
targetKey = target.key;
|
|
657
|
+
}
|
|
658
|
+
let nextKey: Key | null = null;
|
|
659
|
+
if (targetKey != null) {
|
|
660
|
+
nextKey = keyboardDelegate.getKeyPageBelow(targetKey);
|
|
661
|
+
}
|
|
662
|
+
let dropPosition: "before" | "on" | "after" =
|
|
663
|
+
target.type === "item" ? target.dropPosition : "after";
|
|
664
|
+
|
|
665
|
+
// If there is no next key, or we are starting on the last key, jump to the last possible position.
|
|
666
|
+
if (
|
|
667
|
+
nextKey == null ||
|
|
668
|
+
(target.type === "item" && target.key === keyboardDelegate.getLastKey?.())
|
|
669
|
+
) {
|
|
670
|
+
nextKey = keyboardDelegate.getLastKey?.() ?? null;
|
|
671
|
+
dropPosition = "after";
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
if (nextKey == null) {
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
target = {
|
|
678
|
+
type: "item",
|
|
679
|
+
key: nextKey,
|
|
680
|
+
dropPosition,
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
// If the target does not accept the drop, find the next valid target.
|
|
684
|
+
// If no next valid target, find the previous valid target.
|
|
685
|
+
const operation = getDropOperationForTarget(
|
|
686
|
+
target,
|
|
687
|
+
wrapTypes(types),
|
|
688
|
+
drag.allowedDropOperations,
|
|
689
|
+
);
|
|
690
|
+
if (operation === "cancel") {
|
|
691
|
+
target =
|
|
692
|
+
nextValidTarget(
|
|
693
|
+
target,
|
|
694
|
+
types,
|
|
695
|
+
drag.allowedDropOperations,
|
|
696
|
+
(t, wrap) => getNextTarget(t, wrap),
|
|
697
|
+
false,
|
|
698
|
+
) ??
|
|
699
|
+
nextValidTarget(
|
|
700
|
+
target,
|
|
701
|
+
types,
|
|
702
|
+
drag.allowedDropOperations,
|
|
703
|
+
getPreviousTarget,
|
|
704
|
+
false,
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
state.setTarget(target ?? state.target);
|
|
710
|
+
}
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
case "PageUp": {
|
|
714
|
+
if (!keyboardDelegate.getKeyPageAbove) {
|
|
715
|
+
break;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
let target = state.target;
|
|
719
|
+
if (!target) {
|
|
720
|
+
target = nextValidTarget(
|
|
721
|
+
null,
|
|
722
|
+
types,
|
|
723
|
+
drag.allowedDropOperations,
|
|
724
|
+
getPreviousTarget,
|
|
725
|
+
);
|
|
726
|
+
} else if (target.type === "item") {
|
|
727
|
+
// If at the top already, switch to the root. Otherwise navigate a page up.
|
|
728
|
+
if (target.key === keyboardDelegate.getFirstKey?.()) {
|
|
729
|
+
target = {
|
|
730
|
+
type: "root",
|
|
731
|
+
};
|
|
732
|
+
} else {
|
|
733
|
+
let nextKey: Key | null | undefined = keyboardDelegate.getKeyPageAbove(target.key);
|
|
734
|
+
let dropPosition: "before" | "on" | "after" = target.dropPosition;
|
|
735
|
+
if (nextKey == null) {
|
|
736
|
+
nextKey = keyboardDelegate.getFirstKey?.();
|
|
737
|
+
dropPosition = "before";
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
if (nextKey == null) {
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
target = {
|
|
744
|
+
type: "item",
|
|
745
|
+
key: nextKey,
|
|
746
|
+
dropPosition,
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// If the target does not accept the drop, find the previous valid target.
|
|
751
|
+
// If no next valid target, find the next valid target.
|
|
752
|
+
const operation = getDropOperationForTarget(
|
|
753
|
+
target,
|
|
754
|
+
wrapTypes(types),
|
|
755
|
+
drag.allowedDropOperations,
|
|
756
|
+
);
|
|
757
|
+
if (operation === "cancel") {
|
|
758
|
+
target =
|
|
759
|
+
nextValidTarget(
|
|
760
|
+
target,
|
|
761
|
+
types,
|
|
762
|
+
drag.allowedDropOperations,
|
|
763
|
+
getPreviousTarget,
|
|
764
|
+
false,
|
|
765
|
+
) ??
|
|
766
|
+
nextValidTarget(
|
|
767
|
+
target,
|
|
768
|
+
types,
|
|
769
|
+
drag.allowedDropOperations,
|
|
770
|
+
(t, wrap) => getNextTarget(t, wrap),
|
|
771
|
+
false,
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
state.setTarget(target ?? state.target);
|
|
777
|
+
break;
|
|
778
|
+
}
|
|
692
779
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
state.activateTarget(0, 0);
|
|
699
|
-
callUserOnKeyDown();
|
|
700
|
-
return;
|
|
701
|
-
}
|
|
702
|
-
if (e.key === "Escape" && state.target) {
|
|
703
|
-
e.preventDefault();
|
|
704
|
-
state.exitTarget(0, 0);
|
|
705
|
-
callUserOnKeyDown();
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
callUserOnKeyDown();
|
|
709
|
-
};
|
|
710
|
-
return {
|
|
711
|
-
...baseDropProps,
|
|
712
|
-
onKeyDown,
|
|
713
|
-
};
|
|
780
|
+
opts.onKeyDown?.(e);
|
|
781
|
+
},
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
onCleanup(unregister);
|
|
714
785
|
});
|
|
715
786
|
|
|
787
|
+
const collectionProps = createMemo<Record<string, unknown>>(() => ({
|
|
788
|
+
...drop.dropProps,
|
|
789
|
+
// Remove description from the collection element. If dropping on the entire
|
|
790
|
+
// collection, there should be a drop indicator that carries this
|
|
791
|
+
// description, so no need to double-announce.
|
|
792
|
+
"aria-describedby": null,
|
|
793
|
+
}));
|
|
794
|
+
|
|
716
795
|
return {
|
|
717
796
|
get collectionProps() {
|
|
718
797
|
return collectionProps() as DroppableCollectionAria["collectionProps"];
|
|
@@ -726,6 +805,40 @@ function normalizeSelection(selection: "all" | Iterable<Key> | undefined): "all"
|
|
|
726
805
|
return new Set(selection);
|
|
727
806
|
}
|
|
728
807
|
|
|
808
|
+
// Recover the collection key of a dragged/dropped DOM element. createSelectableItem
|
|
809
|
+
// stamps `data-key={String(key)}`, so the attribute is the stringified key; map it
|
|
810
|
+
// back to the real (possibly numeric) collection key by matching against the
|
|
811
|
+
// collection's nodes.
|
|
812
|
+
function keyFromDragElement(element: HTMLElement | null, collection: Collection | undefined): Key | null {
|
|
813
|
+
if (!element) return null;
|
|
814
|
+
const raw = element.getAttribute("data-key") ?? element.closest("[data-key]")?.getAttribute("data-key");
|
|
815
|
+
if (raw == null) return null;
|
|
816
|
+
if (!collection) return raw;
|
|
817
|
+
// Fast path: the raw string is already a valid key.
|
|
818
|
+
if ((collection as unknown as CollectionLike).getItem(raw) != null) return raw;
|
|
819
|
+
for (const node of collection as unknown as CollectionLike) {
|
|
820
|
+
if (String(node.key) === raw) return node.key;
|
|
821
|
+
}
|
|
822
|
+
return raw;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
function selectionHas(selection: "all" | Set<Key> | null, key: Key): boolean {
|
|
826
|
+
if (selection === "all") return true;
|
|
827
|
+
return selection != null && selection.has(key);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// The selected keys in collection (DOM) order, so [0] is the first selected item
|
|
831
|
+
// and [length-1] the last — mirroring upstream's firstSelectedKey/lastSelectedKey.
|
|
832
|
+
function orderedSelectedKeys(selection: "all" | Set<Key> | null, collection: Collection): Key[] {
|
|
833
|
+
const out: Key[] = [];
|
|
834
|
+
for (const node of collection as unknown as CollectionLike) {
|
|
835
|
+
if (node.type === "item" && selectionHas(selection, node.key)) {
|
|
836
|
+
out.push(node.key);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
return out;
|
|
840
|
+
}
|
|
841
|
+
|
|
729
842
|
function selectionEquals(a: "all" | Set<Key> | null, b: "all" | Set<Key> | null): boolean {
|
|
730
843
|
if (a === b) return true;
|
|
731
844
|
if (!a || !b || a === "all" || b === "all") return false;
|
|
@@ -755,11 +868,15 @@ function getNewItemKeys(collection: CollectionLike, previousCollection: Collecti
|
|
|
755
868
|
|
|
756
869
|
function updateFocusAfterDrop(
|
|
757
870
|
opts: DroppableCollectionOptions,
|
|
758
|
-
|
|
871
|
+
previousCollectionRaw: Collection | undefined,
|
|
759
872
|
previousSelectedKeys: "all" | Set<Key> | null,
|
|
760
873
|
target: DropTarget,
|
|
761
874
|
): void {
|
|
762
|
-
|
|
875
|
+
// Read the (real) collection through the structural `CollectionLike` view: it
|
|
876
|
+
// exposes the optional cell/rowheader/isExpanded fields upstream inspects, which
|
|
877
|
+
// are simply absent (undefined) for flat collections like ListBox.
|
|
878
|
+
const collection = opts.collection as CollectionLike | undefined;
|
|
879
|
+
const previousCollection = previousCollectionRaw as unknown as CollectionLike | undefined;
|
|
763
880
|
if (!collection || !previousCollection) return;
|
|
764
881
|
|
|
765
882
|
const newKeys = getNewItemKeys(collection, previousCollection);
|