@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,623 @@
|
|
|
1
|
+
import { a as useLocale } from "./createCollator.js";
|
|
2
|
+
import { createMemo, createSignal } from "solid-js";
|
|
3
|
+
import { createId } from "@proyecto-viviana/solid-stately";
|
|
4
|
+
//#region src/grid/GridKeyboardDelegate.ts
|
|
5
|
+
/**
|
|
6
|
+
* A keyboard delegate that handles navigation in a grid.
|
|
7
|
+
*/
|
|
8
|
+
var GridKeyboardDelegate = class {
|
|
9
|
+
collection;
|
|
10
|
+
disabledKeys;
|
|
11
|
+
ref;
|
|
12
|
+
focusMode;
|
|
13
|
+
direction;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this.collection = options.collection;
|
|
16
|
+
this.disabledKeys = options.disabledKeys;
|
|
17
|
+
this.ref = options.ref;
|
|
18
|
+
this.focusMode = options.focusMode;
|
|
19
|
+
this.direction = options.direction;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if a key is disabled.
|
|
23
|
+
*/
|
|
24
|
+
isDisabled(key) {
|
|
25
|
+
return this.disabledKeys.has(key);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the parent row key for a cell.
|
|
29
|
+
*/
|
|
30
|
+
getRowKey(key) {
|
|
31
|
+
const item = this.collection.getItem(key);
|
|
32
|
+
if (!item) return null;
|
|
33
|
+
if (item.type === "item") return key;
|
|
34
|
+
if (item.type === "cell" && item.parentKey != null) return item.parentKey;
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get all body rows (excluding header rows).
|
|
39
|
+
*/
|
|
40
|
+
getBodyRows() {
|
|
41
|
+
return this.collection.rows.filter((row) => row.type === "item");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the first non-disabled key.
|
|
45
|
+
*/
|
|
46
|
+
getFirstKey(fromKey, global) {
|
|
47
|
+
const rows = this.getBodyRows();
|
|
48
|
+
if (this.focusMode === "row" || global) {
|
|
49
|
+
for (const row of rows) if (!this.isDisabled(row.key)) return row.key;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
if (fromKey != null) {
|
|
53
|
+
const rowKey = this.getRowKey(fromKey);
|
|
54
|
+
if (rowKey != null) {
|
|
55
|
+
const children = [...this.collection.getChildren(rowKey)];
|
|
56
|
+
if (children.length > 0) return children[0].key;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (rows.length > 0) {
|
|
60
|
+
const children = [...this.collection.getChildren(rows[0].key)];
|
|
61
|
+
if (children.length > 0) return children[0].key;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get the last non-disabled key.
|
|
67
|
+
*/
|
|
68
|
+
getLastKey(fromKey, global) {
|
|
69
|
+
const rows = this.getBodyRows();
|
|
70
|
+
if (this.focusMode === "row" || global) {
|
|
71
|
+
for (let i = rows.length - 1; i >= 0; i--) if (!this.isDisabled(rows[i].key)) return rows[i].key;
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (fromKey != null) {
|
|
75
|
+
const rowKey = this.getRowKey(fromKey);
|
|
76
|
+
if (rowKey != null) {
|
|
77
|
+
const children = [...this.collection.getChildren(rowKey)];
|
|
78
|
+
if (children.length > 0) return children[children.length - 1].key;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (rows.length > 0) {
|
|
82
|
+
const children = [...this.collection.getChildren(rows[rows.length - 1].key)];
|
|
83
|
+
if (children.length > 0) return children[children.length - 1].key;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get the key above the current key.
|
|
89
|
+
*/
|
|
90
|
+
getKeyAbove(key) {
|
|
91
|
+
const item = this.collection.getItem(key);
|
|
92
|
+
if (!item) return null;
|
|
93
|
+
const rows = this.getBodyRows();
|
|
94
|
+
if (this.focusMode === "row" || item.type === "item") {
|
|
95
|
+
const rowKey = item.type === "item" ? key : item.parentKey;
|
|
96
|
+
const rowIndex = rows.findIndex((r) => r.key === rowKey);
|
|
97
|
+
if (rowIndex > 0) {
|
|
98
|
+
for (let i = rowIndex - 1; i >= 0; i--) if (!this.isDisabled(rows[i].key)) return rows[i].key;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
if (item.type === "cell" && item.parentKey != null) {
|
|
103
|
+
const rowIndex = rows.findIndex((r) => r.key === item.parentKey);
|
|
104
|
+
const colIndex = item.column ?? item.index;
|
|
105
|
+
if (rowIndex > 0) {
|
|
106
|
+
for (let i = rowIndex - 1; i >= 0; i--) if (!this.isDisabled(rows[i].key)) {
|
|
107
|
+
const children = [...this.collection.getChildren(rows[i].key)];
|
|
108
|
+
const targetCol = Math.min(colIndex, children.length - 1);
|
|
109
|
+
if (targetCol >= 0) return children[targetCol].key;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get the key below the current key.
|
|
117
|
+
*/
|
|
118
|
+
getKeyBelow(key) {
|
|
119
|
+
const item = this.collection.getItem(key);
|
|
120
|
+
if (!item) return null;
|
|
121
|
+
const rows = this.getBodyRows();
|
|
122
|
+
if (this.focusMode === "row" || item.type === "item") {
|
|
123
|
+
const rowKey = item.type === "item" ? key : item.parentKey;
|
|
124
|
+
const rowIndex = rows.findIndex((r) => r.key === rowKey);
|
|
125
|
+
if (rowIndex >= 0 && rowIndex < rows.length - 1) {
|
|
126
|
+
for (let i = rowIndex + 1; i < rows.length; i++) if (!this.isDisabled(rows[i].key)) return rows[i].key;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
if (item.type === "cell" && item.parentKey != null) {
|
|
131
|
+
const rowIndex = rows.findIndex((r) => r.key === item.parentKey);
|
|
132
|
+
const colIndex = item.column ?? item.index;
|
|
133
|
+
if (rowIndex >= 0 && rowIndex < rows.length - 1) {
|
|
134
|
+
for (let i = rowIndex + 1; i < rows.length; i++) if (!this.isDisabled(rows[i].key)) {
|
|
135
|
+
const children = [...this.collection.getChildren(rows[i].key)];
|
|
136
|
+
const targetCol = Math.min(colIndex, children.length - 1);
|
|
137
|
+
if (targetCol >= 0) return children[targetCol].key;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get the key to the left of the current key.
|
|
145
|
+
*/
|
|
146
|
+
getKeyLeftOf(key) {
|
|
147
|
+
const item = this.collection.getItem(key);
|
|
148
|
+
if (!item) return null;
|
|
149
|
+
if (this.focusMode === "row") return null;
|
|
150
|
+
if (item.type === "cell" && item.parentKey != null) {
|
|
151
|
+
const children = [...this.collection.getChildren(item.parentKey)];
|
|
152
|
+
const colIndex = children.findIndex((c) => c.key === key);
|
|
153
|
+
if (this.direction === "rtl") {
|
|
154
|
+
if (colIndex < children.length - 1) return children[colIndex + 1].key;
|
|
155
|
+
} else if (colIndex > 0) return children[colIndex - 1].key;
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get the key to the right of the current key.
|
|
161
|
+
*/
|
|
162
|
+
getKeyRightOf(key) {
|
|
163
|
+
const item = this.collection.getItem(key);
|
|
164
|
+
if (!item) return null;
|
|
165
|
+
if (this.focusMode === "row") return null;
|
|
166
|
+
if (item.type === "cell" && item.parentKey != null) {
|
|
167
|
+
const children = [...this.collection.getChildren(item.parentKey)];
|
|
168
|
+
const colIndex = children.findIndex((c) => c.key === key);
|
|
169
|
+
if (this.direction === "rtl") {
|
|
170
|
+
if (colIndex > 0) return children[colIndex - 1].key;
|
|
171
|
+
} else if (colIndex < children.length - 1) return children[colIndex + 1].key;
|
|
172
|
+
}
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Get the key for page up.
|
|
177
|
+
*/
|
|
178
|
+
getKeyPageAbove(key) {
|
|
179
|
+
const el = this.ref();
|
|
180
|
+
if (!el) return null;
|
|
181
|
+
const item = this.collection.getItem(key);
|
|
182
|
+
if (!item) return null;
|
|
183
|
+
const rows = this.getBodyRows();
|
|
184
|
+
const rowKey = this.getRowKey(key);
|
|
185
|
+
const rowIndex = rows.findIndex((r) => r.key === rowKey);
|
|
186
|
+
if (rowIndex < 0) return null;
|
|
187
|
+
const rowHeight = el.scrollHeight / rows.length;
|
|
188
|
+
const pageSize = Math.max(1, Math.floor(el.clientHeight / rowHeight));
|
|
189
|
+
const targetIndex = Math.max(0, rowIndex - pageSize);
|
|
190
|
+
for (let i = targetIndex; i >= 0; i--) if (!this.isDisabled(rows[i].key)) {
|
|
191
|
+
if (this.focusMode === "row" || item.type === "item") return rows[i].key;
|
|
192
|
+
const colIndex = item.type === "cell" ? item.column ?? item.index : 0;
|
|
193
|
+
const children = [...this.collection.getChildren(rows[i].key)];
|
|
194
|
+
const targetCol = Math.min(colIndex, children.length - 1);
|
|
195
|
+
if (targetCol >= 0) return children[targetCol].key;
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get the key for page down.
|
|
201
|
+
*/
|
|
202
|
+
getKeyPageBelow(key) {
|
|
203
|
+
const el = this.ref();
|
|
204
|
+
if (!el) return null;
|
|
205
|
+
const item = this.collection.getItem(key);
|
|
206
|
+
if (!item) return null;
|
|
207
|
+
const rows = this.getBodyRows();
|
|
208
|
+
const rowKey = this.getRowKey(key);
|
|
209
|
+
const rowIndex = rows.findIndex((r) => r.key === rowKey);
|
|
210
|
+
if (rowIndex < 0) return null;
|
|
211
|
+
const rowHeight = el.scrollHeight / rows.length;
|
|
212
|
+
const pageSize = Math.max(1, Math.floor(el.clientHeight / rowHeight));
|
|
213
|
+
const targetIndex = Math.min(rows.length - 1, rowIndex + pageSize);
|
|
214
|
+
for (let i = targetIndex; i < rows.length; i++) if (!this.isDisabled(rows[i].key)) {
|
|
215
|
+
if (this.focusMode === "row" || item.type === "item") return rows[i].key;
|
|
216
|
+
const colIndex = item.type === "cell" ? item.column ?? item.index : 0;
|
|
217
|
+
const children = [...this.collection.getChildren(rows[i].key)];
|
|
218
|
+
const targetCol = Math.min(colIndex, children.length - 1);
|
|
219
|
+
if (targetCol >= 0) return children[targetCol].key;
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Get the key that matches the search string.
|
|
225
|
+
*/
|
|
226
|
+
getKeyForSearch(search, fromKey) {
|
|
227
|
+
const searchLower = search.toLowerCase();
|
|
228
|
+
const rows = this.getBodyRows();
|
|
229
|
+
let startIndex = 0;
|
|
230
|
+
if (fromKey != null) {
|
|
231
|
+
const rowKey = this.getRowKey(fromKey);
|
|
232
|
+
const idx = rows.findIndex((r) => r.key === rowKey);
|
|
233
|
+
if (idx >= 0) startIndex = idx + 1;
|
|
234
|
+
}
|
|
235
|
+
for (let i = startIndex; i < rows.length; i++) {
|
|
236
|
+
const row = rows[i];
|
|
237
|
+
if (!this.isDisabled(row.key)) {
|
|
238
|
+
if ((row.textValue?.toLowerCase() ?? "").startsWith(searchLower)) return row.key;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
for (let i = 0; i < startIndex; i++) {
|
|
242
|
+
const row = rows[i];
|
|
243
|
+
if (!this.isDisabled(row.key)) {
|
|
244
|
+
if ((row.textValue?.toLowerCase() ?? "").startsWith(searchLower)) return row.key;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/grid/createGrid.ts
|
|
252
|
+
/**
|
|
253
|
+
* createGrid - Provides accessibility for a grid component.
|
|
254
|
+
* Based on @react-aria/grid/useGrid.
|
|
255
|
+
*/
|
|
256
|
+
const gridMap = /* @__PURE__ */ new WeakMap();
|
|
257
|
+
/**
|
|
258
|
+
* Get the grid metadata for child components.
|
|
259
|
+
*/
|
|
260
|
+
function getGridData(state) {
|
|
261
|
+
return gridMap.get(state);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Creates accessibility props for a grid component.
|
|
265
|
+
* A grid displays data in rows and columns and enables navigation via arrow keys.
|
|
266
|
+
*/
|
|
267
|
+
function createGrid(props, state, ref) {
|
|
268
|
+
const id = createId(props().id);
|
|
269
|
+
const locale = useLocale();
|
|
270
|
+
const [_isFocused, setIsFocused] = createSignal(false);
|
|
271
|
+
const keyboardDelegate = createMemo(() => {
|
|
272
|
+
const p = props();
|
|
273
|
+
const s = state();
|
|
274
|
+
if (p.keyboardDelegate) return p.keyboardDelegate;
|
|
275
|
+
return new GridKeyboardDelegate({
|
|
276
|
+
collection: s.collection,
|
|
277
|
+
disabledKeys: s.disabledKeys,
|
|
278
|
+
ref,
|
|
279
|
+
focusMode: p.focusMode ?? "row",
|
|
280
|
+
direction: locale().direction
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
const storeGridData = () => {
|
|
284
|
+
const s = state();
|
|
285
|
+
const p = props();
|
|
286
|
+
gridMap.set(s, {
|
|
287
|
+
keyboardDelegate: keyboardDelegate(),
|
|
288
|
+
actions: {
|
|
289
|
+
onRowAction: p.onRowAction,
|
|
290
|
+
onCellAction: p.onCellAction
|
|
291
|
+
},
|
|
292
|
+
shouldSelectOnPressUp: p.shouldSelectOnPressUp
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
createMemo(() => {
|
|
296
|
+
storeGridData();
|
|
297
|
+
});
|
|
298
|
+
const onKeyDown = (e) => {
|
|
299
|
+
const s = state();
|
|
300
|
+
const p = props();
|
|
301
|
+
const delegate = keyboardDelegate();
|
|
302
|
+
if (s.isKeyboardNavigationDisabled) return;
|
|
303
|
+
const focusedKey = s.focusedKey;
|
|
304
|
+
if (focusedKey == null) {
|
|
305
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") {
|
|
306
|
+
const firstKey = delegate.getFirstKey?.();
|
|
307
|
+
if (firstKey != null) {
|
|
308
|
+
e.preventDefault();
|
|
309
|
+
s.setFocusedKey(firstKey);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
let nextKey = null;
|
|
315
|
+
switch (e.key) {
|
|
316
|
+
case "ArrowDown":
|
|
317
|
+
nextKey = delegate.getKeyBelow?.(focusedKey) ?? null;
|
|
318
|
+
break;
|
|
319
|
+
case "ArrowUp":
|
|
320
|
+
nextKey = delegate.getKeyAbove?.(focusedKey) ?? null;
|
|
321
|
+
break;
|
|
322
|
+
case "ArrowLeft":
|
|
323
|
+
nextKey = delegate.getKeyLeftOf?.(focusedKey) ?? null;
|
|
324
|
+
break;
|
|
325
|
+
case "ArrowRight":
|
|
326
|
+
nextKey = delegate.getKeyRightOf?.(focusedKey) ?? null;
|
|
327
|
+
break;
|
|
328
|
+
case "Home":
|
|
329
|
+
if (e.ctrlKey) nextKey = delegate.getFirstKey?.() ?? null;
|
|
330
|
+
else nextKey = delegate.getFirstKey?.(focusedKey) ?? null;
|
|
331
|
+
break;
|
|
332
|
+
case "End":
|
|
333
|
+
if (e.ctrlKey) nextKey = delegate.getLastKey?.() ?? null;
|
|
334
|
+
else nextKey = delegate.getLastKey?.(focusedKey) ?? null;
|
|
335
|
+
break;
|
|
336
|
+
case "PageDown":
|
|
337
|
+
nextKey = delegate.getKeyPageBelow?.(focusedKey) ?? null;
|
|
338
|
+
break;
|
|
339
|
+
case "PageUp":
|
|
340
|
+
nextKey = delegate.getKeyPageAbove?.(focusedKey) ?? null;
|
|
341
|
+
break;
|
|
342
|
+
case "Escape":
|
|
343
|
+
if (p.escapeKeyBehavior !== "none") s.clearSelection();
|
|
344
|
+
return;
|
|
345
|
+
case "a":
|
|
346
|
+
if (e.ctrlKey || e.metaKey) {
|
|
347
|
+
e.preventDefault();
|
|
348
|
+
if (s.selectionMode === "multiple") s.selectAll();
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
case " ":
|
|
352
|
+
case "Enter":
|
|
353
|
+
e.preventDefault();
|
|
354
|
+
if (s.selectionMode !== "none") if (e.shiftKey && s.selectionMode === "multiple") s.extendSelection(focusedKey);
|
|
355
|
+
else s.toggleSelection(focusedKey);
|
|
356
|
+
return;
|
|
357
|
+
default:
|
|
358
|
+
if (!p.disallowTypeAhead && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
359
|
+
const key = delegate.getKeyForSearch?.(e.key, focusedKey);
|
|
360
|
+
if (key != null) {
|
|
361
|
+
e.preventDefault();
|
|
362
|
+
s.setFocusedKey(key);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (nextKey != null) {
|
|
368
|
+
e.preventDefault();
|
|
369
|
+
s.setFocusedKey(nextKey);
|
|
370
|
+
if (e.shiftKey && s.selectionMode === "multiple") s.extendSelection(nextKey);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
const onFocus = (e) => {
|
|
374
|
+
const s = state();
|
|
375
|
+
if (!ref()?.contains(e.target)) return;
|
|
376
|
+
if (!s.isFocused) {
|
|
377
|
+
s.setFocused(true);
|
|
378
|
+
setIsFocused(true);
|
|
379
|
+
if (s.focusedKey == null) {
|
|
380
|
+
const firstKey = keyboardDelegate().getFirstKey?.();
|
|
381
|
+
if (firstKey != null) s.setFocusedKey(firstKey);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const onBlur = (e) => {
|
|
386
|
+
const s = state();
|
|
387
|
+
const el = ref();
|
|
388
|
+
if (el && !el.contains(e.relatedTarget)) {
|
|
389
|
+
s.setFocused(false);
|
|
390
|
+
setIsFocused(false);
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
createMemo(() => {
|
|
394
|
+
const p = props();
|
|
395
|
+
if (!p["aria-label"] && !p["aria-labelledby"]) console.warn("Grid: An aria-label or aria-labelledby prop is required for accessibility.");
|
|
396
|
+
});
|
|
397
|
+
const gridProps = createMemo(() => {
|
|
398
|
+
const p = props();
|
|
399
|
+
const s = state();
|
|
400
|
+
const baseProps = {
|
|
401
|
+
role: "grid",
|
|
402
|
+
id,
|
|
403
|
+
"aria-label": p["aria-label"],
|
|
404
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
405
|
+
"aria-describedby": p["aria-describedby"],
|
|
406
|
+
"aria-multiselectable": s.selectionMode === "multiple" ? "true" : void 0,
|
|
407
|
+
tabIndex: s.collection.size === 0 ? 0 : -1,
|
|
408
|
+
onKeyDown,
|
|
409
|
+
onFocus,
|
|
410
|
+
onBlur
|
|
411
|
+
};
|
|
412
|
+
if (p.isVirtualized) {
|
|
413
|
+
baseProps["aria-rowcount"] = s.collection.rowCount;
|
|
414
|
+
baseProps["aria-colcount"] = s.collection.columnCount;
|
|
415
|
+
}
|
|
416
|
+
return baseProps;
|
|
417
|
+
});
|
|
418
|
+
return { get gridProps() {
|
|
419
|
+
return gridProps();
|
|
420
|
+
} };
|
|
421
|
+
}
|
|
422
|
+
//#endregion
|
|
423
|
+
//#region src/grid/createGridRow.ts
|
|
424
|
+
/**
|
|
425
|
+
* createGridRow - Provides accessibility for a grid row.
|
|
426
|
+
* Based on @react-aria/grid/useGridRow.
|
|
427
|
+
*/
|
|
428
|
+
/**
|
|
429
|
+
* Creates accessibility props for a grid row.
|
|
430
|
+
*/
|
|
431
|
+
function createGridRow(props, state, _ref) {
|
|
432
|
+
const [isPressed, setIsPressed] = createSignal(false);
|
|
433
|
+
const isSelected = createMemo(() => {
|
|
434
|
+
const s = state();
|
|
435
|
+
const p = props();
|
|
436
|
+
return s.isSelected(p.key);
|
|
437
|
+
});
|
|
438
|
+
const isDisabled = createMemo(() => {
|
|
439
|
+
const s = state();
|
|
440
|
+
const p = props();
|
|
441
|
+
return s.isDisabled(p.key);
|
|
442
|
+
});
|
|
443
|
+
const isFocused = createMemo(() => {
|
|
444
|
+
const s = state();
|
|
445
|
+
const p = props();
|
|
446
|
+
return s.focusedKey === p.key;
|
|
447
|
+
});
|
|
448
|
+
const onClick = (e) => {
|
|
449
|
+
const s = state();
|
|
450
|
+
const p = props();
|
|
451
|
+
if (isDisabled()) return;
|
|
452
|
+
const onRowAction = getGridData(s)?.actions.onRowAction;
|
|
453
|
+
if (s.selectionMode !== "none") if (e.shiftKey && s.selectionMode === "multiple") s.extendSelection(p.key);
|
|
454
|
+
else if (e.ctrlKey || e.metaKey) s.toggleSelection(p.key);
|
|
455
|
+
else s.replaceSelection(p.key);
|
|
456
|
+
if (onRowAction) onRowAction(p.key);
|
|
457
|
+
if (p.onAction) p.onAction();
|
|
458
|
+
};
|
|
459
|
+
const onKeyDown = (e) => {
|
|
460
|
+
const s = state();
|
|
461
|
+
const p = props();
|
|
462
|
+
if (isDisabled()) return;
|
|
463
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
464
|
+
e.preventDefault();
|
|
465
|
+
const onRowAction = getGridData(s)?.actions.onRowAction;
|
|
466
|
+
if (s.selectionMode !== "none") s.toggleSelection(p.key);
|
|
467
|
+
if (onRowAction) onRowAction(p.key);
|
|
468
|
+
if (p.onAction) p.onAction();
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
const onFocus = () => {
|
|
472
|
+
const s = state();
|
|
473
|
+
const p = props();
|
|
474
|
+
s.setFocusedKey(p.key);
|
|
475
|
+
};
|
|
476
|
+
const onPointerDown = () => {
|
|
477
|
+
setIsPressed(true);
|
|
478
|
+
};
|
|
479
|
+
const onPointerUp = () => {
|
|
480
|
+
setIsPressed(false);
|
|
481
|
+
};
|
|
482
|
+
const rowProps = createMemo(() => {
|
|
483
|
+
const s = state();
|
|
484
|
+
const p = props();
|
|
485
|
+
const baseProps = {
|
|
486
|
+
role: "row",
|
|
487
|
+
"aria-selected": s.selectionMode !== "none" ? isSelected() : void 0,
|
|
488
|
+
"aria-disabled": isDisabled() || void 0,
|
|
489
|
+
tabIndex: isFocused() ? 0 : -1,
|
|
490
|
+
onClick,
|
|
491
|
+
onKeyDown,
|
|
492
|
+
onFocus,
|
|
493
|
+
onPointerDown,
|
|
494
|
+
onPointerUp
|
|
495
|
+
};
|
|
496
|
+
if (p.isVirtualized && p.index != null) baseProps["aria-rowindex"] = p.index + 1;
|
|
497
|
+
return baseProps;
|
|
498
|
+
});
|
|
499
|
+
return {
|
|
500
|
+
get rowProps() {
|
|
501
|
+
return rowProps();
|
|
502
|
+
},
|
|
503
|
+
get isSelected() {
|
|
504
|
+
return isSelected();
|
|
505
|
+
},
|
|
506
|
+
get isDisabled() {
|
|
507
|
+
return isDisabled();
|
|
508
|
+
},
|
|
509
|
+
get isPressed() {
|
|
510
|
+
return isPressed();
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/grid/createGridCell.ts
|
|
516
|
+
/**
|
|
517
|
+
* createGridCell - Provides accessibility for a grid cell.
|
|
518
|
+
* Based on @react-aria/grid/useGridCell.
|
|
519
|
+
*/
|
|
520
|
+
/**
|
|
521
|
+
* Creates accessibility props for a grid cell.
|
|
522
|
+
*/
|
|
523
|
+
function createGridCell(props, state, _ref) {
|
|
524
|
+
const [isPressed, setIsPressed] = createSignal(false);
|
|
525
|
+
const isSelected = createMemo(() => {
|
|
526
|
+
const s = state();
|
|
527
|
+
const p = props();
|
|
528
|
+
const node = s.collection.getItem(p.key);
|
|
529
|
+
if (node?.parentKey != null) return s.isSelected(node.parentKey);
|
|
530
|
+
return false;
|
|
531
|
+
});
|
|
532
|
+
const isDisabled = createMemo(() => {
|
|
533
|
+
const s = state();
|
|
534
|
+
const p = props();
|
|
535
|
+
const node = s.collection.getItem(p.key);
|
|
536
|
+
if (node?.parentKey != null) return s.isDisabled(node.parentKey);
|
|
537
|
+
return false;
|
|
538
|
+
});
|
|
539
|
+
const isFocused = createMemo(() => {
|
|
540
|
+
const s = state();
|
|
541
|
+
const p = props();
|
|
542
|
+
return s.focusedKey === p.key;
|
|
543
|
+
});
|
|
544
|
+
const onClick = (e) => {
|
|
545
|
+
const s = state();
|
|
546
|
+
const p = props();
|
|
547
|
+
if (isDisabled()) return;
|
|
548
|
+
const onCellAction = getGridData(s)?.actions.onCellAction;
|
|
549
|
+
const rowKey = s.collection.getItem(p.key)?.parentKey;
|
|
550
|
+
if (rowKey != null && s.selectionMode !== "none") if (e.shiftKey && s.selectionMode === "multiple") s.extendSelection(rowKey);
|
|
551
|
+
else if (e.ctrlKey || e.metaKey) s.toggleSelection(rowKey);
|
|
552
|
+
else s.replaceSelection(rowKey);
|
|
553
|
+
if (onCellAction) onCellAction(p.key);
|
|
554
|
+
if (p.onAction) p.onAction();
|
|
555
|
+
};
|
|
556
|
+
const onKeyDown = (e) => {
|
|
557
|
+
const s = state();
|
|
558
|
+
const p = props();
|
|
559
|
+
if (isDisabled()) return;
|
|
560
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
561
|
+
const onCellAction = getGridData(s)?.actions.onCellAction;
|
|
562
|
+
if (onCellAction || p.onAction) {
|
|
563
|
+
e.preventDefault();
|
|
564
|
+
if (onCellAction) onCellAction(p.key);
|
|
565
|
+
if (p.onAction) p.onAction();
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
const onFocus = () => {
|
|
570
|
+
const s = state();
|
|
571
|
+
const p = props();
|
|
572
|
+
s.setFocusedKey(p.key);
|
|
573
|
+
};
|
|
574
|
+
const onPointerDown = () => {
|
|
575
|
+
setIsPressed(true);
|
|
576
|
+
};
|
|
577
|
+
const onPointerUp = () => {
|
|
578
|
+
setIsPressed(false);
|
|
579
|
+
};
|
|
580
|
+
const cellProps = createMemo(() => {
|
|
581
|
+
const s = state();
|
|
582
|
+
const p = props();
|
|
583
|
+
const node = s.collection.getItem(p.key);
|
|
584
|
+
let role = "gridcell";
|
|
585
|
+
if (node?.type === "rowheader") role = "rowheader";
|
|
586
|
+
else if (node?.type === "column") role = "columnheader";
|
|
587
|
+
const baseProps = {
|
|
588
|
+
role,
|
|
589
|
+
"aria-disabled": isDisabled() || void 0,
|
|
590
|
+
"aria-selected": s.selectionMode !== "none" ? isSelected() : void 0,
|
|
591
|
+
tabIndex: isFocused() ? 0 : -1,
|
|
592
|
+
onClick,
|
|
593
|
+
onKeyDown,
|
|
594
|
+
onFocus,
|
|
595
|
+
onPointerDown,
|
|
596
|
+
onPointerUp
|
|
597
|
+
};
|
|
598
|
+
if (p.isVirtualized && node?.column != null) baseProps["aria-colindex"] = node.column + 1;
|
|
599
|
+
if (node?.colspan != null && node.colspan > 1) baseProps["aria-colspan"] = node.colspan;
|
|
600
|
+
return baseProps;
|
|
601
|
+
});
|
|
602
|
+
return {
|
|
603
|
+
get cellProps() {
|
|
604
|
+
return cellProps();
|
|
605
|
+
},
|
|
606
|
+
get isSelected() {
|
|
607
|
+
return isSelected();
|
|
608
|
+
},
|
|
609
|
+
get isDisabled() {
|
|
610
|
+
return isDisabled();
|
|
611
|
+
},
|
|
612
|
+
get isPressed() {
|
|
613
|
+
return isPressed();
|
|
614
|
+
},
|
|
615
|
+
get isFocused() {
|
|
616
|
+
return isFocused();
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
//#endregion
|
|
621
|
+
export { GridKeyboardDelegate as a, getGridData as i, createGridRow as n, createGrid as r, createGridCell as t };
|
|
622
|
+
|
|
623
|
+
//# sourceMappingURL=grid.js.map
|