@proyecto-viviana/solidaria 0.3.0 → 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/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/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +2 -0
- 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/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- 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/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/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/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -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/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.js +2 -0
- package/dist/dnd/index.jsx +2 -0
- package/dist/dnd/utils.d.ts +2 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.js +2 -0
- package/dist/focus/index.jsx +2 -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 +3 -0
- package/dist/i18n/index.jsx +3 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -18311
- package/dist/index.jsx +71 -18242
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.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 +10 -0
- package/dist/interactions/index.jsx +10 -0
- 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 +6 -0
- 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.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 +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/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/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/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/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +27 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +4 -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/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/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 +48 -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 +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/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/autocomplete/createAutocomplete.ts +67 -21
- package/src/calendar/createCalendar.ts +2 -0
- package/src/calendar/createCalendarCell.ts +19 -2
- package/src/calendar/createCalendarGrid.ts +43 -9
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +2 -0
- package/src/calendar/index.ts +17 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/datepicker/createDateSegment.ts +6 -1
- package/src/dnd/createDroppableCollection.ts +4 -1
- package/src/dnd/utils.ts +27 -3
- package/src/focus/FocusScope.tsx +152 -18
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +145 -42
- 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 +40 -0
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createInteractionModality.ts +21 -12
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/listbox/createListBox.ts +129 -8
- package/src/listbox/createOption.ts +68 -73
- 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 +18 -2
- 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 +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/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +56 -26
- package/src/table/createTableRow.ts +198 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/types.ts +29 -1
- package/src/tabs/createTabs.ts +50 -20
- package/src/tag/createTag.ts +9 -4
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -42
- package/src/tree/createTree.ts +100 -42
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +151 -0
- package/src/utils/dom.ts +215 -25
- package/src/utils/index.ts +8 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
import { i as access, o as mergeProps } from "./env.jsx";
|
|
2
|
+
import { S as scrollIntoViewport, c as isCtrlKeyPressed, x as scrollIntoView } from "./utils.jsx";
|
|
3
|
+
import { a as getEventTarget, b as openLink, f as isFocusWithin, g as isTabbable, h as isScrollable, i as getActiveElement, n as focusWithoutScrolling, o as getFocusableTreeWalker, t as focusSafely, y as nodeContains } from "./focus.jsx";
|
|
4
|
+
import { o as getInteractionModality } from "./createInteractionModality.jsx";
|
|
5
|
+
import { a as useLocale, t as createCollator } from "./createCollator.jsx";
|
|
6
|
+
import { t as createTypeSelect } from "./createTypeSelect.jsx";
|
|
7
|
+
import { a as isNonContiguousSelectionModifier, i as getItemElement, o as registerCollectionId } from "./createSelectableItem.jsx";
|
|
8
|
+
import { createEffect, createMemo, on, onCleanup } from "solid-js";
|
|
9
|
+
import { isServer } from "solid-js/web";
|
|
10
|
+
//#region src/selection/createScrollIntoViewOnFocus.ts
|
|
11
|
+
/**
|
|
12
|
+
* Reveals the virtually-focused collection item when the focused key changes via
|
|
13
|
+
* keyboard navigation.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the focused-key scroll effect in @react-aria/selection's
|
|
16
|
+
* `useSelectableCollection`. Activedescendant collections (ListBox / Menu /
|
|
17
|
+
* ComboBox) keep real DOM focus on the container and point at the active item
|
|
18
|
+
* with `aria-activedescendant`, so the browser never natively scrolls the
|
|
19
|
+
* focused option into view the way a roving-tabindex collection would. This
|
|
20
|
+
* effect restores that behavior through our `scrollIntoViewport` util.
|
|
21
|
+
*/
|
|
22
|
+
function createScrollIntoViewOnFocus(options) {
|
|
23
|
+
if (isServer) return;
|
|
24
|
+
const getItemElement = options.getItemElement ?? ((root, key) => root.querySelector(`[data-key="${key}"]`));
|
|
25
|
+
createEffect(() => {
|
|
26
|
+
const key = options.focusedKey();
|
|
27
|
+
if (key == null) return;
|
|
28
|
+
if (options.isActive && !options.isActive()) return;
|
|
29
|
+
if (getInteractionModality() === "pointer") return;
|
|
30
|
+
const root = options.ref();
|
|
31
|
+
if (!root) return;
|
|
32
|
+
queueMicrotask(() => {
|
|
33
|
+
const element = getItemElement(root, key);
|
|
34
|
+
if (element) scrollIntoViewport(element, { containingElement: root });
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/selection/constants.ts
|
|
40
|
+
/**
|
|
41
|
+
* Custom DOM event names used to drive virtual focus into a selectable
|
|
42
|
+
* collection from an outside controller (e.g. an Autocomplete input). Mirrors
|
|
43
|
+
* @react-aria/selection's `utils/constants` (`FOCUS_EVENT` / `CLEAR_FOCUS_EVENT`).
|
|
44
|
+
*
|
|
45
|
+
* Canonical home is here, in the selection layer, because the collection is the
|
|
46
|
+
* consumer that listens for them. A controller that wants to move virtual focus
|
|
47
|
+
* (the deferred autocomplete-collection bridge) dispatches these onto the
|
|
48
|
+
* collection ref.
|
|
49
|
+
*/
|
|
50
|
+
/** Dispatched onto a collection to focus it (optionally its first item). */
|
|
51
|
+
const FOCUS_EVENT = "react-aria-focus";
|
|
52
|
+
/** Dispatched onto a collection to blur it (optionally clearing the focused key). */
|
|
53
|
+
const CLEAR_FOCUS_EVENT = "react-aria-clear-focus";
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/selection/DOMLayoutDelegate.ts
|
|
56
|
+
/**
|
|
57
|
+
* A {@link LayoutDelegate} that measures items via the DOM.
|
|
58
|
+
*/
|
|
59
|
+
var DOMLayoutDelegate = class {
|
|
60
|
+
ref;
|
|
61
|
+
constructor(ref) {
|
|
62
|
+
this.ref = ref;
|
|
63
|
+
}
|
|
64
|
+
getItemRect(key) {
|
|
65
|
+
const container = this.ref();
|
|
66
|
+
if (!container) return null;
|
|
67
|
+
const item = key != null ? getItemElement(this.ref, key) : null;
|
|
68
|
+
if (!item) return null;
|
|
69
|
+
const containerRect = container.getBoundingClientRect();
|
|
70
|
+
const itemRect = item.getBoundingClientRect();
|
|
71
|
+
return {
|
|
72
|
+
x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,
|
|
73
|
+
y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,
|
|
74
|
+
width: itemRect.width,
|
|
75
|
+
height: itemRect.height
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
getContentSize() {
|
|
79
|
+
const container = this.ref();
|
|
80
|
+
return {
|
|
81
|
+
width: container?.scrollWidth ?? 0,
|
|
82
|
+
height: container?.scrollHeight ?? 0
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
getVisibleRect() {
|
|
86
|
+
const container = this.ref();
|
|
87
|
+
return {
|
|
88
|
+
x: container?.scrollLeft ?? 0,
|
|
89
|
+
y: container?.scrollTop ?? 0,
|
|
90
|
+
width: container?.clientWidth ?? 0,
|
|
91
|
+
height: container?.clientHeight ?? 0
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/selection/ListKeyboardDelegate.ts
|
|
97
|
+
/**
|
|
98
|
+
* A keyboard delegate that handles navigation within a list/stack collection.
|
|
99
|
+
*/
|
|
100
|
+
var ListKeyboardDelegate = class {
|
|
101
|
+
collection;
|
|
102
|
+
disabledKeys;
|
|
103
|
+
disabledBehavior;
|
|
104
|
+
ref;
|
|
105
|
+
collator;
|
|
106
|
+
layout;
|
|
107
|
+
orientation;
|
|
108
|
+
direction;
|
|
109
|
+
layoutDelegate;
|
|
110
|
+
/** Present unless this is a vertical stack (mirrors upstream's method deletion). */
|
|
111
|
+
getKeyLeftOf;
|
|
112
|
+
/** Present unless this is a vertical stack (mirrors upstream's method deletion). */
|
|
113
|
+
getKeyRightOf;
|
|
114
|
+
constructor(options) {
|
|
115
|
+
this.collection = options.collection;
|
|
116
|
+
this.ref = options.ref;
|
|
117
|
+
this.collator = options.collator;
|
|
118
|
+
this.disabledKeys = options.disabledKeys ?? /* @__PURE__ */ new Set();
|
|
119
|
+
this.disabledBehavior = options.disabledBehavior ?? "all";
|
|
120
|
+
this.orientation = options.orientation ?? "vertical";
|
|
121
|
+
this.direction = options.direction;
|
|
122
|
+
this.layout = options.layout ?? "stack";
|
|
123
|
+
this.layoutDelegate = options.layoutDelegate ?? new DOMLayoutDelegate(options.ref);
|
|
124
|
+
if (!(this.layout === "stack" && this.orientation === "vertical")) {
|
|
125
|
+
this.getKeyLeftOf = (key, opts) => this.computeKeyLeftOf(key, opts);
|
|
126
|
+
this.getKeyRightOf = (key, opts) => this.computeKeyRightOf(key, opts);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
isDisabled(item) {
|
|
130
|
+
return this.disabledBehavior === "all" && (item.props?.isDisabled === true || item.isDisabled === true || this.disabledKeys.has(item.key)) && item.props?.disabledBehavior !== "selection";
|
|
131
|
+
}
|
|
132
|
+
findNextNonDisabled(key, getNext, includeDisabled = false) {
|
|
133
|
+
let nextKey = key;
|
|
134
|
+
while (nextKey != null) {
|
|
135
|
+
const item = this.collection.getItem(nextKey);
|
|
136
|
+
if (item?.type === "item" && (includeDisabled || !this.isDisabled(item))) return nextKey;
|
|
137
|
+
nextKey = getNext(nextKey);
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
getNextKey(key, options) {
|
|
142
|
+
let nextKey = key;
|
|
143
|
+
nextKey = this.collection.getKeyAfter(nextKey);
|
|
144
|
+
return this.findNextNonDisabled(nextKey, (k) => this.collection.getKeyAfter(k), options?.includeDisabled);
|
|
145
|
+
}
|
|
146
|
+
getPreviousKey(key, options) {
|
|
147
|
+
let nextKey = key;
|
|
148
|
+
nextKey = this.collection.getKeyBefore(nextKey);
|
|
149
|
+
return this.findNextNonDisabled(nextKey, (k) => this.collection.getKeyBefore(k), options?.includeDisabled);
|
|
150
|
+
}
|
|
151
|
+
findKey(key, nextKey, shouldSkip) {
|
|
152
|
+
let tempKey = key;
|
|
153
|
+
let itemRect = this.layoutDelegate.getItemRect(tempKey);
|
|
154
|
+
if (!itemRect || tempKey == null) return null;
|
|
155
|
+
const prevRect = itemRect;
|
|
156
|
+
do {
|
|
157
|
+
tempKey = nextKey(tempKey);
|
|
158
|
+
if (tempKey == null) break;
|
|
159
|
+
itemRect = this.layoutDelegate.getItemRect(tempKey);
|
|
160
|
+
} while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);
|
|
161
|
+
return tempKey;
|
|
162
|
+
}
|
|
163
|
+
isSameRow(prevRect, itemRect) {
|
|
164
|
+
return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;
|
|
165
|
+
}
|
|
166
|
+
isSameColumn(prevRect, itemRect) {
|
|
167
|
+
return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
|
|
168
|
+
}
|
|
169
|
+
isReversed(key) {
|
|
170
|
+
const nextKey = this.getNextKey(key);
|
|
171
|
+
const currentEl = getItemElement(this.ref, key);
|
|
172
|
+
if (nextKey != null) {
|
|
173
|
+
const nextEl = getItemElement(this.ref, nextKey);
|
|
174
|
+
if (!currentEl || !nextEl) return false;
|
|
175
|
+
return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;
|
|
176
|
+
}
|
|
177
|
+
const prevKey = this.getPreviousKey(key);
|
|
178
|
+
if (prevKey != null) {
|
|
179
|
+
const prevEl = getItemElement(this.ref, prevKey);
|
|
180
|
+
if (!currentEl || !prevEl) return false;
|
|
181
|
+
return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
getKeyBelow(key, options) {
|
|
186
|
+
if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (k) => this.getNextKey(k, options), this.isSameRow);
|
|
187
|
+
else if (this.orientation === "vertical") return this.isReversed(key) ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
|
|
188
|
+
else return this.getNextKey(key, options);
|
|
189
|
+
}
|
|
190
|
+
getKeyAbove(key, options) {
|
|
191
|
+
if (this.layout === "grid" && this.orientation === "vertical") return this.findKey(key, (k) => this.getPreviousKey(k, options), this.isSameRow);
|
|
192
|
+
else if (this.orientation === "vertical") return this.isReversed(key) ? this.getNextKey(key, options) : this.getPreviousKey(key, options);
|
|
193
|
+
else return this.getPreviousKey(key, options);
|
|
194
|
+
}
|
|
195
|
+
getNextColumn(key, right, options) {
|
|
196
|
+
return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
|
|
197
|
+
}
|
|
198
|
+
computeKeyRightOf(key, options) {
|
|
199
|
+
const method = this.direction === "ltr" ? "getKeyRightOf" : "getKeyLeftOf";
|
|
200
|
+
const layoutMethod = this.layoutDelegate[method];
|
|
201
|
+
if (layoutMethod) {
|
|
202
|
+
const next = layoutMethod.call(this.layoutDelegate, key);
|
|
203
|
+
return this.findNextNonDisabled(next, (k) => this.layoutDelegate[method]?.call(this.layoutDelegate, k) ?? null, options?.includeDisabled);
|
|
204
|
+
}
|
|
205
|
+
if (this.layout === "grid") if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "rtl", options);
|
|
206
|
+
else return this.findKey(key, (k) => this.getNextColumn(k, this.direction === "rtl", options), this.isSameColumn);
|
|
207
|
+
else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "rtl", options);
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
computeKeyLeftOf(key, options) {
|
|
211
|
+
const method = this.direction === "ltr" ? "getKeyLeftOf" : "getKeyRightOf";
|
|
212
|
+
const layoutMethod = this.layoutDelegate[method];
|
|
213
|
+
if (layoutMethod) {
|
|
214
|
+
const next = layoutMethod.call(this.layoutDelegate, key);
|
|
215
|
+
return this.findNextNonDisabled(next, (k) => this.layoutDelegate[method]?.call(this.layoutDelegate, k) ?? null, options?.includeDisabled);
|
|
216
|
+
}
|
|
217
|
+
if (this.layout === "grid") if (this.orientation === "vertical") return this.getNextColumn(key, this.direction === "ltr", options);
|
|
218
|
+
else return this.findKey(key, (k) => this.getNextColumn(k, this.direction === "ltr", options), this.isSameColumn);
|
|
219
|
+
else if (this.orientation === "horizontal") return this.getNextColumn(key, this.direction === "ltr", options);
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
getFirstKey() {
|
|
223
|
+
const key = this.collection.getFirstKey();
|
|
224
|
+
return this.findNextNonDisabled(key, (k) => this.collection.getKeyAfter(k));
|
|
225
|
+
}
|
|
226
|
+
getLastKey() {
|
|
227
|
+
const key = this.collection.getLastKey();
|
|
228
|
+
return this.findNextNonDisabled(key, (k) => this.collection.getKeyBefore(k));
|
|
229
|
+
}
|
|
230
|
+
getKeyPageAbove(key) {
|
|
231
|
+
const menu = this.ref();
|
|
232
|
+
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
233
|
+
if (!itemRect) return null;
|
|
234
|
+
const reversed = this.isReversed(key);
|
|
235
|
+
if (menu && !isScrollable(menu)) return this.getFirstKey();
|
|
236
|
+
let nextKey = key;
|
|
237
|
+
if (this.orientation === "horizontal") {
|
|
238
|
+
const pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);
|
|
239
|
+
while (itemRect && itemRect.x > pageX && nextKey != null) {
|
|
240
|
+
nextKey = this.getKeyAbove(nextKey);
|
|
241
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
const visibleRect = this.layoutDelegate.getVisibleRect();
|
|
245
|
+
const pageY = reversed ? itemRect.y - visibleRect.height : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);
|
|
246
|
+
while (itemRect && itemRect.y > pageY && nextKey != null) {
|
|
247
|
+
nextKey = this.getKeyAbove(nextKey);
|
|
248
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());
|
|
252
|
+
}
|
|
253
|
+
getKeyPageBelow(key) {
|
|
254
|
+
const menu = this.ref();
|
|
255
|
+
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
256
|
+
if (!itemRect) return null;
|
|
257
|
+
const reversed = this.isReversed(key);
|
|
258
|
+
if (menu && !isScrollable(menu)) return this.getLastKey();
|
|
259
|
+
let nextKey = key;
|
|
260
|
+
if (this.orientation === "horizontal") {
|
|
261
|
+
const pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width);
|
|
262
|
+
while (itemRect && itemRect.x < pageX && nextKey != null) {
|
|
263
|
+
nextKey = this.getKeyBelow(nextKey);
|
|
264
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
const pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);
|
|
268
|
+
while (itemRect && itemRect.y < pageY && nextKey != null) {
|
|
269
|
+
nextKey = this.getKeyBelow(nextKey);
|
|
270
|
+
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());
|
|
274
|
+
}
|
|
275
|
+
getKeyForSearch(search, fromKey) {
|
|
276
|
+
if (!this.collator) return null;
|
|
277
|
+
const collection = this.collection;
|
|
278
|
+
let key = fromKey ?? this.getFirstKey();
|
|
279
|
+
while (key != null) {
|
|
280
|
+
const item = collection.getItem(key);
|
|
281
|
+
if (!item) return null;
|
|
282
|
+
const substring = item.textValue.slice(0, search.length);
|
|
283
|
+
if (item.textValue && this.collator.compare(substring, search) === 0) return key;
|
|
284
|
+
key = this.getNextKey(key);
|
|
285
|
+
}
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/selection/createSelectableCollection.ts
|
|
291
|
+
/**
|
|
292
|
+
* createSelectableCollection - keyboard, focus, and selection interactions for a
|
|
293
|
+
* selectable collection. Based on @react-aria/selection's
|
|
294
|
+
* `useSelectableCollection`.
|
|
295
|
+
*
|
|
296
|
+
* React → Solid adaptations (faithful to upstream behavior):
|
|
297
|
+
* - `ref` / `scrollRef` are Solid accessors; `keyboardDelegate` may be an
|
|
298
|
+
* accessor so a recreated delegate stays current.
|
|
299
|
+
* - Per-render React effects become `createEffect`s that read the manager's
|
|
300
|
+
* reactive getters: the autofocus and scroll-into-view effects track
|
|
301
|
+
* `isFocused` / `focusedKey` / `collection.size` and run when those change.
|
|
302
|
+
* `useUpdateLayoutEffect` (skip-first) maps to `on(..., { defer: true })`.
|
|
303
|
+
* - Plain closure variables replace `useRef` (a Solid component body runs once).
|
|
304
|
+
* - React's bubbling `onFocus` / `onBlur` are `onFocusIn` / `onFocusOut`
|
|
305
|
+
* (the native bubbling focus events) here.
|
|
306
|
+
* - The link branch opens the anchor directly (we have no router abstraction)
|
|
307
|
+
* and needs no `flushSync` — `setFocusedKey` is synchronous and the keyed
|
|
308
|
+
* item element already exists in the DOM.
|
|
309
|
+
* - Virtual-focus cursor movement (`moveVirtualFocus` / `dispatchVirtualFocus`)
|
|
310
|
+
* is not yet modeled — a documented gap, consistent with createSelectableItem.
|
|
311
|
+
* The focused-key bookkeeping around it is preserved.
|
|
312
|
+
*/
|
|
313
|
+
/**
|
|
314
|
+
* Handles interactions with selectable collections.
|
|
315
|
+
*/
|
|
316
|
+
function createSelectableCollection(options) {
|
|
317
|
+
const manager = options.selectionManager;
|
|
318
|
+
const delegate = () => access(options.keyboardDelegate);
|
|
319
|
+
const ref = options.ref;
|
|
320
|
+
const scrollRef = options.scrollRef ?? ref;
|
|
321
|
+
const autoFocus = options.autoFocus ?? false;
|
|
322
|
+
const shouldFocusWrap = options.shouldFocusWrap ?? false;
|
|
323
|
+
const disallowEmptySelection = options.disallowEmptySelection ?? false;
|
|
324
|
+
const disallowSelectAll = options.disallowSelectAll ?? false;
|
|
325
|
+
const escapeKeyBehavior = options.escapeKeyBehavior ?? "clearSelection";
|
|
326
|
+
const disallowTypeAhead = options.disallowTypeAhead ?? false;
|
|
327
|
+
const shouldUseVirtualFocus = options.shouldUseVirtualFocus ?? false;
|
|
328
|
+
const allowsTabNavigation = options.allowsTabNavigation ?? false;
|
|
329
|
+
const linkBehavior = options.linkBehavior ?? "action";
|
|
330
|
+
const focusOnEntry = options.UNSTABLE_focusOnEntry;
|
|
331
|
+
const selectOnFocus = () => options.selectOnFocus ?? manager.selectionBehavior === "replace";
|
|
332
|
+
const locale = useLocale();
|
|
333
|
+
const direction = () => locale().direction;
|
|
334
|
+
const onKeyDown = (e) => {
|
|
335
|
+
const d = delegate();
|
|
336
|
+
if (e.altKey && e.key === "Tab") e.preventDefault();
|
|
337
|
+
const root = ref();
|
|
338
|
+
if (!root || !nodeContains(root, getEventTarget(e))) return;
|
|
339
|
+
const navigateToKey = (key, childFocus) => {
|
|
340
|
+
if (key == null) return;
|
|
341
|
+
if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus() && !isNonContiguousSelectionModifier(e)) {
|
|
342
|
+
manager.setFocusedKey(key, childFocus);
|
|
343
|
+
const item = getItemElement(ref, key);
|
|
344
|
+
if (item instanceof HTMLAnchorElement) openLink(item, e);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
manager.setFocusedKey(key, childFocus);
|
|
348
|
+
if (manager.isLink(key) && linkBehavior === "override") return;
|
|
349
|
+
if (e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(key);
|
|
350
|
+
else if (selectOnFocus() && !isNonContiguousSelectionModifier(e)) manager.replaceSelection(key);
|
|
351
|
+
};
|
|
352
|
+
switch (e.key) {
|
|
353
|
+
case "ArrowDown":
|
|
354
|
+
if (d.getKeyBelow) {
|
|
355
|
+
let nextKey = manager.focusedKey != null ? d.getKeyBelow(manager.focusedKey) : d.getFirstKey?.();
|
|
356
|
+
if (nextKey == null && shouldFocusWrap) nextKey = d.getFirstKey?.(manager.focusedKey ?? void 0);
|
|
357
|
+
if (nextKey != null) {
|
|
358
|
+
e.preventDefault();
|
|
359
|
+
navigateToKey(nextKey);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
break;
|
|
363
|
+
case "ArrowUp":
|
|
364
|
+
if (d.getKeyAbove) {
|
|
365
|
+
let nextKey = manager.focusedKey != null ? d.getKeyAbove(manager.focusedKey) : d.getLastKey?.();
|
|
366
|
+
if (nextKey == null && shouldFocusWrap) nextKey = d.getLastKey?.(manager.focusedKey ?? void 0);
|
|
367
|
+
if (nextKey != null) {
|
|
368
|
+
e.preventDefault();
|
|
369
|
+
navigateToKey(nextKey);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
break;
|
|
373
|
+
case "ArrowLeft":
|
|
374
|
+
if (d.getKeyLeftOf) {
|
|
375
|
+
let nextKey = manager.focusedKey != null ? d.getKeyLeftOf(manager.focusedKey) : d.getFirstKey?.();
|
|
376
|
+
if (nextKey == null && shouldFocusWrap) nextKey = direction() === "rtl" ? d.getFirstKey?.(manager.focusedKey ?? void 0) : d.getLastKey?.(manager.focusedKey ?? void 0);
|
|
377
|
+
if (nextKey != null) {
|
|
378
|
+
e.preventDefault();
|
|
379
|
+
navigateToKey(nextKey, direction() === "rtl" ? "first" : "last");
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
break;
|
|
383
|
+
case "ArrowRight":
|
|
384
|
+
if (d.getKeyRightOf) {
|
|
385
|
+
let nextKey = manager.focusedKey != null ? d.getKeyRightOf(manager.focusedKey) : d.getFirstKey?.();
|
|
386
|
+
if (nextKey == null && shouldFocusWrap) nextKey = direction() === "rtl" ? d.getLastKey?.(manager.focusedKey ?? void 0) : d.getFirstKey?.(manager.focusedKey ?? void 0);
|
|
387
|
+
if (nextKey != null) {
|
|
388
|
+
e.preventDefault();
|
|
389
|
+
navigateToKey(nextKey, direction() === "rtl" ? "last" : "first");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
break;
|
|
393
|
+
case "Home":
|
|
394
|
+
if (d.getFirstKey) {
|
|
395
|
+
if (manager.focusedKey == null && e.shiftKey) return;
|
|
396
|
+
e.preventDefault();
|
|
397
|
+
const firstKey = d.getFirstKey(manager.focusedKey ?? void 0, isCtrlKeyPressed(e));
|
|
398
|
+
manager.setFocusedKey(firstKey);
|
|
399
|
+
if (firstKey != null) {
|
|
400
|
+
if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
|
|
401
|
+
else if (selectOnFocus()) manager.replaceSelection(firstKey);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
break;
|
|
405
|
+
case "End":
|
|
406
|
+
if (d.getLastKey) {
|
|
407
|
+
if (manager.focusedKey == null && e.shiftKey) return;
|
|
408
|
+
e.preventDefault();
|
|
409
|
+
const lastKey = d.getLastKey(manager.focusedKey ?? void 0, isCtrlKeyPressed(e));
|
|
410
|
+
manager.setFocusedKey(lastKey);
|
|
411
|
+
if (lastKey != null) {
|
|
412
|
+
if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
|
|
413
|
+
else if (selectOnFocus()) manager.replaceSelection(lastKey);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
break;
|
|
417
|
+
case "PageDown":
|
|
418
|
+
if (d.getKeyPageBelow && manager.focusedKey != null) {
|
|
419
|
+
const nextKey = d.getKeyPageBelow(manager.focusedKey);
|
|
420
|
+
if (nextKey != null) {
|
|
421
|
+
e.preventDefault();
|
|
422
|
+
navigateToKey(nextKey);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
break;
|
|
426
|
+
case "PageUp":
|
|
427
|
+
if (d.getKeyPageAbove && manager.focusedKey != null) {
|
|
428
|
+
const nextKey = d.getKeyPageAbove(manager.focusedKey);
|
|
429
|
+
if (nextKey != null) {
|
|
430
|
+
e.preventDefault();
|
|
431
|
+
navigateToKey(nextKey);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
435
|
+
case "a":
|
|
436
|
+
if (isCtrlKeyPressed(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
|
|
437
|
+
e.preventDefault();
|
|
438
|
+
manager.selectAll();
|
|
439
|
+
}
|
|
440
|
+
break;
|
|
441
|
+
case "Escape":
|
|
442
|
+
if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
|
|
443
|
+
e.stopPropagation();
|
|
444
|
+
e.preventDefault();
|
|
445
|
+
manager.clearSelection();
|
|
446
|
+
}
|
|
447
|
+
break;
|
|
448
|
+
case "Tab": if (!allowsTabNavigation) {
|
|
449
|
+
if (e.shiftKey) root.focus();
|
|
450
|
+
else {
|
|
451
|
+
const walker = getFocusableTreeWalker(root, { tabbable: true });
|
|
452
|
+
let next;
|
|
453
|
+
let last;
|
|
454
|
+
do {
|
|
455
|
+
last = walker.lastChild();
|
|
456
|
+
if (last) next = last;
|
|
457
|
+
} while (last);
|
|
458
|
+
const activeElement = getActiveElement();
|
|
459
|
+
if (next && (!isFocusWithin(next) || activeElement && !isTabbable(activeElement))) focusWithoutScrolling(next);
|
|
460
|
+
}
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
const scrollPos = {
|
|
466
|
+
top: 0,
|
|
467
|
+
left: 0
|
|
468
|
+
};
|
|
469
|
+
addRefListener(scrollRef, "scroll", () => {
|
|
470
|
+
const sr = scrollRef();
|
|
471
|
+
scrollPos.top = sr?.scrollTop ?? 0;
|
|
472
|
+
scrollPos.left = sr?.scrollLeft ?? 0;
|
|
473
|
+
});
|
|
474
|
+
const onFocusIn = (e) => {
|
|
475
|
+
const currentTarget = e.currentTarget;
|
|
476
|
+
if (manager.isFocused) {
|
|
477
|
+
if (!nodeContains(currentTarget, getEventTarget(e))) manager.setFocused(false);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (!nodeContains(currentTarget, getEventTarget(e))) return;
|
|
481
|
+
const modality = getInteractionModality();
|
|
482
|
+
manager.setFocused(true);
|
|
483
|
+
const navigate = (key) => {
|
|
484
|
+
if (key != null) {
|
|
485
|
+
manager.setFocusedKey(key);
|
|
486
|
+
if (selectOnFocus() && !manager.isSelected(key)) manager.replaceSelection(key);
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
if (focusOnEntry && (modality === "keyboard" || modality === "virtual")) navigate(focusOnEntry === "first" ? delegate().getFirstKey?.() : delegate().getLastKey?.());
|
|
490
|
+
else if (manager.focusedKey == null) {
|
|
491
|
+
const relatedTarget = e.relatedTarget;
|
|
492
|
+
if (relatedTarget && currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigate(manager.lastSelectedKey ?? delegate().getLastKey?.());
|
|
493
|
+
else navigate(manager.firstSelectedKey ?? delegate().getFirstKey?.());
|
|
494
|
+
} else if (scrollRef()) {
|
|
495
|
+
const sr = scrollRef();
|
|
496
|
+
sr.scrollTop = scrollPos.top;
|
|
497
|
+
sr.scrollLeft = scrollPos.left;
|
|
498
|
+
}
|
|
499
|
+
if (manager.focusedKey != null && scrollRef()) {
|
|
500
|
+
const element = getItemElement(ref, manager.focusedKey);
|
|
501
|
+
if (element instanceof HTMLElement) {
|
|
502
|
+
if (!isFocusWithin(element) && !shouldUseVirtualFocus) focusWithoutScrolling(element);
|
|
503
|
+
if (modality === "keyboard" || focusOnEntry && modality === "virtual") scrollIntoViewport(element, { containingElement: ref() });
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
const onFocusOut = (e) => {
|
|
508
|
+
const currentTarget = e.currentTarget;
|
|
509
|
+
if (!nodeContains(currentTarget, e.relatedTarget)) manager.setFocused(false);
|
|
510
|
+
};
|
|
511
|
+
let shouldVirtualFocusFirst = false;
|
|
512
|
+
if (shouldUseVirtualFocus) {
|
|
513
|
+
addRefListener(ref, FOCUS_EVENT, (e) => {
|
|
514
|
+
const detail = e.detail;
|
|
515
|
+
e.stopPropagation();
|
|
516
|
+
manager.setFocused(true);
|
|
517
|
+
if (detail?.focusStrategy === "first") shouldVirtualFocusFirst = true;
|
|
518
|
+
});
|
|
519
|
+
addRefListener(ref, CLEAR_FOCUS_EVENT, (e) => {
|
|
520
|
+
e.stopPropagation();
|
|
521
|
+
manager.setFocused(false);
|
|
522
|
+
if (e.detail?.clearFocusKey) manager.setFocusedKey(null);
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
createEffect(on(() => [delegate().getFirstKey?.() ?? null, manager.collection.size], ([firstKey]) => {
|
|
526
|
+
if (!shouldVirtualFocusFirst) return;
|
|
527
|
+
if (firstKey == null) {
|
|
528
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst = false;
|
|
529
|
+
} else {
|
|
530
|
+
manager.setFocusedKey(firstKey);
|
|
531
|
+
shouldVirtualFocusFirst = false;
|
|
532
|
+
}
|
|
533
|
+
}, { defer: true }));
|
|
534
|
+
createEffect(on(() => manager.focusedKey, () => {
|
|
535
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst = false;
|
|
536
|
+
}, { defer: true }));
|
|
537
|
+
let autoFocusActive = autoFocus !== false;
|
|
538
|
+
let didAutoFocus = false;
|
|
539
|
+
createEffect(() => {
|
|
540
|
+
const size = manager.collection.size;
|
|
541
|
+
const selectedKeys = manager.selectedKeys;
|
|
542
|
+
if (!autoFocusActive) return;
|
|
543
|
+
let focusedKey = null;
|
|
544
|
+
if (autoFocus === "first") focusedKey = delegate().getFirstKey?.() ?? null;
|
|
545
|
+
if (autoFocus === "last") focusedKey = delegate().getLastKey?.() ?? null;
|
|
546
|
+
if (selectedKeys.size) {
|
|
547
|
+
for (const key of selectedKeys) if (manager.canSelectItem(key)) {
|
|
548
|
+
focusedKey = key;
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
manager.setFocused(true);
|
|
553
|
+
manager.setFocusedKey(focusedKey);
|
|
554
|
+
const root = ref();
|
|
555
|
+
if (focusedKey == null && !shouldUseVirtualFocus && root) focusSafely(root);
|
|
556
|
+
if (size > 0) {
|
|
557
|
+
autoFocusActive = false;
|
|
558
|
+
didAutoFocus = true;
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
let lastFocusedKey = manager.focusedKey;
|
|
562
|
+
let raf = null;
|
|
563
|
+
createEffect(() => {
|
|
564
|
+
const isFocused = manager.isFocused;
|
|
565
|
+
const focusedKey = manager.focusedKey;
|
|
566
|
+
const root = ref();
|
|
567
|
+
const sr = scrollRef();
|
|
568
|
+
if (isFocused && focusedKey != null && (focusedKey !== lastFocusedKey || didAutoFocus) && sr && root) {
|
|
569
|
+
const modality = getInteractionModality();
|
|
570
|
+
const element = getItemElement(ref, focusedKey);
|
|
571
|
+
if (!(element instanceof HTMLElement)) return;
|
|
572
|
+
if (modality === "keyboard" || didAutoFocus) {
|
|
573
|
+
if (raf != null) cancelAnimationFrame(raf);
|
|
574
|
+
raf = requestAnimationFrame(() => {
|
|
575
|
+
const scrollEl = scrollRef();
|
|
576
|
+
if (scrollEl) {
|
|
577
|
+
scrollIntoView(scrollEl, element);
|
|
578
|
+
if (modality !== "virtual") scrollIntoViewport(element, { containingElement: ref() });
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
if (!shouldUseVirtualFocus && isFocused && focusedKey == null && lastFocusedKey != null && root) focusSafely(root);
|
|
584
|
+
lastFocusedKey = focusedKey;
|
|
585
|
+
didAutoFocus = false;
|
|
586
|
+
});
|
|
587
|
+
onCleanup(() => {
|
|
588
|
+
if (raf != null) cancelAnimationFrame(raf);
|
|
589
|
+
});
|
|
590
|
+
addRefListener(ref, "react-aria-focus-scope-restore", (e) => {
|
|
591
|
+
e.preventDefault();
|
|
592
|
+
manager.setFocused(true);
|
|
593
|
+
});
|
|
594
|
+
const onMouseDown = (e) => {
|
|
595
|
+
if (scrollRef() === getEventTarget(e)) e.preventDefault();
|
|
596
|
+
};
|
|
597
|
+
const { typeSelectProps } = createTypeSelect({
|
|
598
|
+
collection: () => manager.collection,
|
|
599
|
+
focusedKey: () => manager.focusedKey,
|
|
600
|
+
onFocusedKeyChange: (key) => manager.setFocusedKey(key),
|
|
601
|
+
isKeyDisabled: (key) => manager.isDisabled(key)
|
|
602
|
+
});
|
|
603
|
+
const collectionId = registerCollectionId(manager);
|
|
604
|
+
return { get collectionProps() {
|
|
605
|
+
let tabIndex;
|
|
606
|
+
if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
|
|
607
|
+
let handlers = {
|
|
608
|
+
onKeyDown,
|
|
609
|
+
onFocusIn,
|
|
610
|
+
onFocusOut,
|
|
611
|
+
onMouseDown
|
|
612
|
+
};
|
|
613
|
+
if (!disallowTypeAhead) handlers = mergeProps(typeSelectProps, handlers);
|
|
614
|
+
return mergeProps(handlers, {
|
|
615
|
+
tabIndex,
|
|
616
|
+
"data-collection": collectionId
|
|
617
|
+
});
|
|
618
|
+
} };
|
|
619
|
+
}
|
|
620
|
+
/** Attaches `type` to the element from `ref`, re-binding when the element changes. */
|
|
621
|
+
function addRefListener(ref, type, handler) {
|
|
622
|
+
createEffect(() => {
|
|
623
|
+
const el = ref();
|
|
624
|
+
if (!el) return;
|
|
625
|
+
el.addEventListener(type, handler);
|
|
626
|
+
onCleanup(() => el.removeEventListener(type, handler));
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region src/selection/createSelectableList.ts
|
|
631
|
+
/**
|
|
632
|
+
* createSelectableList - keyboard navigation and selection for a list collection.
|
|
633
|
+
* Based on @react-aria/selection's `useSelectableList`.
|
|
634
|
+
*
|
|
635
|
+
* React → Solid adaptations (faithful to upstream behavior):
|
|
636
|
+
* - `ref` / `scrollRef` are Solid accessors.
|
|
637
|
+
* - The default `ListKeyboardDelegate` is built inside a `createMemo` so it is
|
|
638
|
+
* recreated whenever the collection, disabled keys, disabled behavior, or
|
|
639
|
+
* collator change (the house convention — the delegate stores those as plain
|
|
640
|
+
* values; see {@link ListKeyboardDelegate}). This is the Solid equivalent of
|
|
641
|
+
* upstream's `useMemo` keyed on the same inputs.
|
|
642
|
+
* - Upstream takes `collection` and `disabledKeys` as separate props; our
|
|
643
|
+
* SelectionManager already exposes them as reactive getters
|
|
644
|
+
* (`manager.collection`, `manager.disabledKeys`, `manager.disabledBehavior`),
|
|
645
|
+
* so the delegate is derived from the manager — a single source of truth.
|
|
646
|
+
* A `layoutDelegate` may still be supplied for virtualized collections.
|
|
647
|
+
*/
|
|
648
|
+
/**
|
|
649
|
+
* Handles interactions with a selectable list collection.
|
|
650
|
+
*/
|
|
651
|
+
function createSelectableList(options) {
|
|
652
|
+
const manager = options.selectionManager;
|
|
653
|
+
const collator = createCollator({
|
|
654
|
+
usage: "search",
|
|
655
|
+
sensitivity: "base"
|
|
656
|
+
});
|
|
657
|
+
const keyboardDelegate = createMemo(() => {
|
|
658
|
+
if (options.keyboardDelegate != null) return access(options.keyboardDelegate);
|
|
659
|
+
return new ListKeyboardDelegate({
|
|
660
|
+
collection: manager.collection,
|
|
661
|
+
disabledKeys: manager.disabledKeys,
|
|
662
|
+
disabledBehavior: manager.disabledBehavior,
|
|
663
|
+
ref: options.ref,
|
|
664
|
+
collator: collator(),
|
|
665
|
+
layoutDelegate: options.layoutDelegate
|
|
666
|
+
});
|
|
667
|
+
});
|
|
668
|
+
const collection = createSelectableCollection({
|
|
669
|
+
...options,
|
|
670
|
+
keyboardDelegate
|
|
671
|
+
});
|
|
672
|
+
return { get listProps() {
|
|
673
|
+
return collection.collectionProps;
|
|
674
|
+
} };
|
|
675
|
+
}
|
|
676
|
+
//#endregion
|
|
677
|
+
export { CLEAR_FOCUS_EVENT as a, DOMLayoutDelegate as i, createSelectableCollection as n, FOCUS_EVENT as o, ListKeyboardDelegate as r, createScrollIntoViewOnFocus as s, createSelectableList as t };
|
|
678
|
+
|
|
679
|
+
//# sourceMappingURL=selection.jsx.map
|