@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
package/src/table/createTable.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { TableState, TableCollection, Key, GridNode } from "@proyecto-vivia
|
|
|
10
10
|
import type { AriaTableProps, TableAria } from "./types";
|
|
11
11
|
import { useLocale } from "../i18n";
|
|
12
12
|
import { announce } from "../live-announcer";
|
|
13
|
+
import { scrollIntoViewport } from "../utils";
|
|
14
|
+
import { getInteractionModality } from "../interactions/createInteractionModality";
|
|
13
15
|
|
|
14
16
|
// Global map to store table metadata for child components
|
|
15
17
|
const tableMap = new WeakMap<
|
|
@@ -63,13 +65,6 @@ function isRow<T>(node: GridNode<T> | null): boolean {
|
|
|
63
65
|
return node?.type === "item";
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
function focusCurrentElement(el: HTMLElement | null | undefined) {
|
|
67
|
-
const target = el?.querySelector<HTMLElement>(
|
|
68
|
-
'[role="row"][tabindex="0"], [role="rowheader"][tabindex="0"], [role="gridcell"][tabindex="0"], [role="columnheader"][tabindex="0"]',
|
|
69
|
-
);
|
|
70
|
-
target?.focus();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
68
|
/**
|
|
74
69
|
* Creates accessibility props for a table component.
|
|
75
70
|
*/
|
|
@@ -146,13 +141,20 @@ export function createTable<T extends object>(
|
|
|
146
141
|
const isRTL = locale().direction === "rtl";
|
|
147
142
|
const setFocusedKey = (key: Key) => {
|
|
148
143
|
s.setFocusedKey(key);
|
|
149
|
-
queueMicrotask(() => focusCurrentElement(ref()));
|
|
150
144
|
};
|
|
151
145
|
const runTypeahead = (focusedKey: Key, focusedItem: GridNode<T>) => {
|
|
152
146
|
if (e.key.length !== 1 || e.ctrlKey || e.metaKey || e.altKey) {
|
|
153
147
|
return false;
|
|
154
148
|
}
|
|
155
149
|
|
|
150
|
+
// A leading Spacebar is a selection/action key, not the start of a type-ahead
|
|
151
|
+
// search. Mirror upstream useTypeSelect (`search.length === 0 && character === ' '`)
|
|
152
|
+
// and let it fall through so the focused row's own Space handler toggles selection.
|
|
153
|
+
// Once a search is active, Space continues the query as normal.
|
|
154
|
+
if (e.key === " " && typeaheadBuffer.length === 0) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
|
|
156
158
|
typeaheadBuffer += e.key.toLocaleLowerCase();
|
|
157
159
|
if (typeaheadTimeout) {
|
|
158
160
|
clearTimeout(typeaheadTimeout);
|
|
@@ -478,24 +480,12 @@ export function createTable<T extends object>(
|
|
|
478
480
|
}
|
|
479
481
|
return;
|
|
480
482
|
|
|
481
|
-
|
|
482
|
-
case
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
const keyToSelect =
|
|
488
|
-
isCell(focusedItem) && focusedItem.parentKey != null
|
|
489
|
-
? focusedItem.parentKey
|
|
490
|
-
: focusedKey;
|
|
491
|
-
|
|
492
|
-
if (e.shiftKey && s.selectionMode === "multiple") {
|
|
493
|
-
s.extendSelection(keyToSelect);
|
|
494
|
-
} else {
|
|
495
|
-
s.toggleSelection(keyToSelect);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
return;
|
|
483
|
+
// NOTE: Space/Enter selection is intentionally NOT handled here. Upstream
|
|
484
|
+
// useSelectableCollection has no ' '/Enter case — keyboard selection is owned
|
|
485
|
+
// by the row (useSelectableItem, ported in createTableRow). Handling it here too
|
|
486
|
+
// double-toggled the selection (row toggles on, grid toggles back off → no-op),
|
|
487
|
+
// since the row handler does not stop propagation. Space/Enter fall through to
|
|
488
|
+
// the type-ahead path below, which ignores a leading Space and bails on Enter.
|
|
499
489
|
|
|
500
490
|
default:
|
|
501
491
|
if (runTypeahead(focusedKey, focusedItem)) {
|
|
@@ -552,6 +542,46 @@ export function createTable<T extends object>(
|
|
|
552
542
|
}
|
|
553
543
|
};
|
|
554
544
|
|
|
545
|
+
// Mirror React Aria's useSelectableCollection: once the roving tabindex for
|
|
546
|
+
// the focused key has been committed to the DOM, move browser focus onto that
|
|
547
|
+
// element from a post-commit effect — looking it up by its stable data-key
|
|
548
|
+
// rather than by transient tabindex. Doing this imperatively during the key
|
|
549
|
+
// handler (in a microtask) raced Solid's reconciliation and dropped focus to
|
|
550
|
+
// <body>, so Space/Enter never reached the grid's selection handler.
|
|
551
|
+
createEffect(() => {
|
|
552
|
+
const s = state();
|
|
553
|
+
const key = s.focusedKey;
|
|
554
|
+
const el = ref();
|
|
555
|
+
if (!el || key == null) {
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Only manage focus while it already lives inside the table — i.e. the user
|
|
560
|
+
// is navigating with the keyboard. We gate on the *physical* position of
|
|
561
|
+
// browser focus rather than the grid's logical `isFocused` signal: focus can
|
|
562
|
+
// land directly on a row (a pointer click, or programmatic row focus) without
|
|
563
|
+
// ever firing the grid's own non-bubbling focus handler, so `isFocused` stays
|
|
564
|
+
// false even though the table genuinely holds focus. The contains() check is
|
|
565
|
+
// also what keeps us from pulling focus back from elsewhere on the page when
|
|
566
|
+
// the focused key changes from a background interaction.
|
|
567
|
+
const active = document.activeElement;
|
|
568
|
+
if (!active || (active !== el && !el.contains(active))) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const target = el.querySelector<HTMLElement>(`[data-key="${key}"]`);
|
|
573
|
+
if (target && target !== active) {
|
|
574
|
+
target.focus();
|
|
575
|
+
|
|
576
|
+
// Reveal the newly focused row/cell when navigating with the keyboard,
|
|
577
|
+
// mirroring useSelectableCollection. Pointer-driven focus changes should
|
|
578
|
+
// not shift the scroll position under the user's finger.
|
|
579
|
+
if (getInteractionModality() !== "pointer") {
|
|
580
|
+
scrollIntoViewport(target, { containingElement: el });
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
|
|
555
585
|
// Warn if no label is provided
|
|
556
586
|
createMemo(() => {
|
|
557
587
|
const p = props();
|
|
@@ -3,11 +3,29 @@
|
|
|
3
3
|
* Based on @react-aria/table/useTableRow.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createMemo,
|
|
6
|
+
import { createMemo, type Accessor } from "solid-js";
|
|
7
7
|
import type { JSX } from "solid-js";
|
|
8
|
-
import type {
|
|
9
|
-
|
|
8
|
+
import type {
|
|
9
|
+
Collection,
|
|
10
|
+
Key,
|
|
11
|
+
Selection,
|
|
12
|
+
TableState,
|
|
13
|
+
TableCollection,
|
|
14
|
+
} from "@proyecto-viviana/solid-stately";
|
|
15
|
+
import type { AriaTableRowProps, TableRowAria, ExpandButtonProps } from "./types";
|
|
10
16
|
import { getTableData } from "./createTable";
|
|
17
|
+
import { useLocale } from "../i18n";
|
|
18
|
+
import { createSelectableItem, type SelectableItemState } from "../selection/createSelectableItem";
|
|
19
|
+
import { mergeProps } from "../utils/mergeProps";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Arrow keys that expand/collapse a tree-grid row, mirroring `@react-aria/table`.
|
|
23
|
+
* Direction is flipped under RTL.
|
|
24
|
+
*/
|
|
25
|
+
const EXPANSION_KEYS = {
|
|
26
|
+
expand: { ltr: "ArrowRight", rtl: "ArrowLeft" },
|
|
27
|
+
collapse: { ltr: "ArrowLeft", rtl: "ArrowRight" },
|
|
28
|
+
} as const;
|
|
11
29
|
|
|
12
30
|
/**
|
|
13
31
|
* Creates accessibility props for a table row.
|
|
@@ -15,221 +33,161 @@ import { getTableData } from "./createTable";
|
|
|
15
33
|
export function createTableRow<T extends object>(
|
|
16
34
|
props: Accessor<AriaTableRowProps>,
|
|
17
35
|
state: Accessor<TableState<T, TableCollection<T>>>,
|
|
18
|
-
|
|
36
|
+
ref: Accessor<HTMLTableRowElement | null>,
|
|
19
37
|
): TableRowAria {
|
|
20
|
-
const
|
|
21
|
-
let didSelectOnPointer = false;
|
|
22
|
-
let didActionOnPointer = false;
|
|
38
|
+
const locale = useLocale();
|
|
23
39
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const p = props();
|
|
27
|
-
return s.isSelected(p.node.key);
|
|
28
|
-
});
|
|
40
|
+
// Tree-grid (expandable rows): only active when the collection has a tree column.
|
|
41
|
+
const isTreeRow = createMemo(() => state().treeColumn != null);
|
|
29
42
|
|
|
30
|
-
const
|
|
31
|
-
const s = state();
|
|
32
|
-
const p = props();
|
|
33
|
-
return !!p.isDisabled || s.isDisabled(p.node.key);
|
|
34
|
-
});
|
|
43
|
+
const hasChildRows = createMemo(() => props().node.isExpandable ?? false);
|
|
35
44
|
|
|
36
|
-
const
|
|
45
|
+
const isExpanded = createMemo(() => {
|
|
37
46
|
const s = state();
|
|
38
|
-
|
|
39
|
-
return s.
|
|
47
|
+
if (s.treeColumn == null) return false;
|
|
48
|
+
return s.expandedKeys === "all" || s.expandedKeys.has(props().node.key);
|
|
40
49
|
});
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const p = props();
|
|
45
|
-
const tableData = getTableData(s);
|
|
46
|
-
return (
|
|
47
|
-
s.selectionMode !== "none" || !!tableData?.actions.onRowAction || !!p.onAction || !!p.href
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const selectRow = (e: MouseEvent | PointerEvent | KeyboardEvent, forceReplace = false) => {
|
|
52
|
-
const s = state();
|
|
53
|
-
const p = props();
|
|
54
|
-
|
|
55
|
-
if (s.selectionMode !== "none") {
|
|
56
|
-
if (e.shiftKey && s.selectionMode === "multiple") {
|
|
57
|
-
s.extendSelection(p.node.key);
|
|
58
|
-
} else if (!forceReplace && (e.ctrlKey || e.metaKey || s.selectionBehavior === "toggle")) {
|
|
59
|
-
s.toggleSelection(p.node.key);
|
|
60
|
-
} else if (!forceReplace && s.selectionMode === "single" && s.isSelected(p.node.key)) {
|
|
61
|
-
s.toggleSelection(p.node.key);
|
|
62
|
-
} else {
|
|
63
|
-
// Replace selection
|
|
64
|
-
s.replaceSelection(p.node.key);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const activateLink = (e: MouseEvent | KeyboardEvent) => {
|
|
70
|
-
props().onLinkAction?.(e);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const runRowAction = (p: AriaTableRowProps, onRowAction: ((key: Key) => void) | undefined) => {
|
|
74
|
-
if (onRowAction) {
|
|
75
|
-
onRowAction(p.node.key);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (p.onAction) {
|
|
79
|
-
p.onAction();
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const isFromInteractiveElement = (e: Event) => {
|
|
84
|
-
const target = e.target;
|
|
85
|
-
if (!(target instanceof Element)) return false;
|
|
86
|
-
return !!target.closest(
|
|
87
|
-
'a[href],button,input,select,textarea,[role="button"],[role="checkbox"],[role="link"]',
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// Handle click/press for selection
|
|
92
|
-
const onClick = (e: MouseEvent) => {
|
|
51
|
+
// aria-posinset / aria-setsize among same-level sibling rows.
|
|
52
|
+
const siblingInfo = createMemo(() => {
|
|
93
53
|
const s = state();
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const onRowAction = tableData?.actions.onRowAction;
|
|
101
|
-
|
|
102
|
-
if (isFromInteractiveElement(e)) {
|
|
103
|
-
didSelectOnPointer = false;
|
|
104
|
-
didActionOnPointer = false;
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (p.href) {
|
|
109
|
-
if (s.selectionBehavior === "replace" && s.selectionMode !== "none") {
|
|
110
|
-
if (!didSelectOnPointer) {
|
|
111
|
-
selectRow(e, true);
|
|
112
|
-
}
|
|
113
|
-
} else if (!didActionOnPointer) {
|
|
114
|
-
activateLink(e);
|
|
54
|
+
const node = props().node;
|
|
55
|
+
if (node.parentKey != null) {
|
|
56
|
+
const parent = s.collection.getItem(node.parentKey);
|
|
57
|
+
if (parent) {
|
|
58
|
+
const siblings = parent.childNodes.filter((n) => n.type === "item");
|
|
59
|
+
return { posinset: node.index + 1, setsize: siblings.length };
|
|
115
60
|
}
|
|
116
|
-
didSelectOnPointer = false;
|
|
117
|
-
didActionOnPointer = false;
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (!didSelectOnPointer) {
|
|
122
|
-
selectRow(e);
|
|
123
61
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
};
|
|
62
|
+
const rootRows = s.collection.body.childNodes.filter((n) => n.type === "item");
|
|
63
|
+
const rootIndex = rootRows.findIndex((n) => n.key === node.key);
|
|
64
|
+
return {
|
|
65
|
+
posinset: rootIndex >= 0 ? rootIndex + 1 : node.index + 1,
|
|
66
|
+
setsize: rootRows.length,
|
|
67
|
+
};
|
|
68
|
+
});
|
|
131
69
|
|
|
132
|
-
const
|
|
70
|
+
const isSelected = createMemo(() => {
|
|
133
71
|
const s = state();
|
|
134
72
|
const p = props();
|
|
73
|
+
return s.isSelected(p.node.key);
|
|
74
|
+
});
|
|
135
75
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
76
|
+
const selectableState: SelectableItemState<T> = {
|
|
77
|
+
collection: () => state().collection as unknown as Collection<T>,
|
|
78
|
+
isFocused: () => state().isFocused,
|
|
79
|
+
setFocused: (focused: boolean) => state().setFocused(focused),
|
|
80
|
+
focusedKey: () => state().focusedKey,
|
|
81
|
+
childFocusStrategy: () => state().childFocusStrategy,
|
|
82
|
+
setFocusedKey: (key: Key | null, strategy) => state().setFocusedKey(key, strategy),
|
|
83
|
+
selectionMode: () => state().selectionMode,
|
|
84
|
+
selectionBehavior: () => state().selectionBehavior,
|
|
85
|
+
disallowEmptySelection: () => state().disallowEmptySelection,
|
|
86
|
+
selectedKeys: () => state().selectedKeys as Selection,
|
|
87
|
+
disabledKeys: () => state().disabledKeys,
|
|
88
|
+
disabledBehavior: () => state().disabledBehavior,
|
|
89
|
+
isEmpty: () => {
|
|
90
|
+
const keys = state().selectedKeys;
|
|
91
|
+
return keys !== "all" && keys.size === 0;
|
|
92
|
+
},
|
|
93
|
+
isSelectAll: () => state().selectedKeys === "all",
|
|
94
|
+
isSelected: (key: Key) => state().isSelected(key),
|
|
95
|
+
isDisabled: (key: Key) => {
|
|
96
|
+
const s = state();
|
|
97
|
+
const item = s.collection.getItem(key);
|
|
98
|
+
return (
|
|
99
|
+
s.disabledBehavior === "all" &&
|
|
100
|
+
s.isDisabled(key) &&
|
|
101
|
+
item?.props?.disabledBehavior !== "selection"
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
canSelectItem: (key: Key) => {
|
|
105
|
+
const s = state();
|
|
106
|
+
return s.selectionMode !== "none" && !s.isDisabled(key);
|
|
107
|
+
},
|
|
108
|
+
setSelectionBehavior: (behavior) => state().setSelectionBehavior(behavior),
|
|
109
|
+
toggleSelection: (key: Key) => state().toggleSelection(key),
|
|
110
|
+
replaceSelection: (key: Key) => state().replaceSelection(key),
|
|
111
|
+
setSelectedKeys: (keys: Iterable<Key>) => state().setSelectedKeys(keys),
|
|
112
|
+
selectAll: () => state().selectAll(),
|
|
113
|
+
clearSelection: () => state().clearSelection(),
|
|
114
|
+
toggleSelectAll: () => state().toggleSelectAll(),
|
|
115
|
+
extendSelection: (toKey: Key, _collection: Collection<T>) => state().extendSelection(toKey),
|
|
139
116
|
};
|
|
140
117
|
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (isDisabled()) return;
|
|
146
|
-
|
|
147
|
-
if (e.key === "Enter") {
|
|
148
|
-
e.preventDefault();
|
|
149
|
-
|
|
150
|
-
// Get table metadata for actions
|
|
118
|
+
const selectableItem = createSelectableItem<T>(
|
|
119
|
+
() => {
|
|
120
|
+
const s = state();
|
|
121
|
+
const p = props();
|
|
151
122
|
const tableData = getTableData(s);
|
|
152
123
|
const onRowAction = tableData?.actions.onRowAction;
|
|
124
|
+
const hasAction = !!p.onAction || !!onRowAction || !!p.href;
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
key: p.node.key,
|
|
128
|
+
id: `${tableData?.tableId ?? "table"}-row-${String(p.node.key)}`,
|
|
129
|
+
isVirtualized: p.isVirtualized,
|
|
130
|
+
shouldSelectOnPressUp: tableData?.shouldSelectOnPressUp ?? false,
|
|
131
|
+
isDisabled: !!p.isDisabled || s.collection.size === 0,
|
|
132
|
+
onAction: hasAction
|
|
133
|
+
? (event) => {
|
|
134
|
+
p.onAction?.();
|
|
135
|
+
onRowAction?.(p.node.key);
|
|
136
|
+
if (p.href) {
|
|
137
|
+
p.onLinkAction?.(event);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
: undefined,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
selectableState,
|
|
144
|
+
ref,
|
|
145
|
+
);
|
|
153
146
|
|
|
154
|
-
|
|
155
|
-
activateLink(e);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Handle selection
|
|
160
|
-
if (s.selectionMode !== "none") {
|
|
161
|
-
selectRow(e);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Call action handler
|
|
165
|
-
if (onRowAction) {
|
|
166
|
-
onRowAction(p.node.key);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (p.onAction) {
|
|
170
|
-
p.onAction();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (e.key === " " || e.key === "Space" || e.key === "Spacebar") {
|
|
175
|
-
e.preventDefault();
|
|
176
|
-
|
|
177
|
-
if (p.href && s.selectionMode !== "none") {
|
|
178
|
-
selectRow(e, s.selectionBehavior === "replace");
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (p.href) {
|
|
183
|
-
activateLink(e);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (s.selectionMode !== "none") {
|
|
188
|
-
selectRow(e);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
147
|
+
const isDisabled = () => selectableItem.isDisabled();
|
|
192
148
|
|
|
193
|
-
const
|
|
149
|
+
const onTreeGridKeyDown = (e: KeyboardEvent) => {
|
|
194
150
|
const s = state();
|
|
195
151
|
const p = props();
|
|
196
|
-
s.setFocusedKey(p.node.key);
|
|
197
|
-
};
|
|
198
152
|
|
|
199
|
-
|
|
200
|
-
if (isInteractive() && !isDisabled()) {
|
|
201
|
-
setIsPressed(true);
|
|
202
|
-
}
|
|
203
|
-
const s = state();
|
|
204
|
-
const tableData = getTableData(s);
|
|
205
|
-
if (s.selectionMode !== "none" && !tableData?.shouldSelectOnPressUp && !isDisabled()) {
|
|
206
|
-
selectRow(e);
|
|
207
|
-
didSelectOnPointer = true;
|
|
208
|
-
}
|
|
209
|
-
};
|
|
153
|
+
if (isDisabled()) return;
|
|
210
154
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
155
|
+
// Tree-grid expand/collapse with Left/Right arrows (flipped under RTL). Handled before
|
|
156
|
+
// selection/navigation; stopping propagation prevents the grid's arrow navigation when
|
|
157
|
+
// expansion consumes the key.
|
|
158
|
+
if (s.treeColumn != null) {
|
|
159
|
+
const direction = locale().direction === "rtl" ? "rtl" : "ltr";
|
|
160
|
+
const key = p.node.key;
|
|
161
|
+
const expanded = s.expandedKeys;
|
|
162
|
+
if (
|
|
163
|
+
e.key === EXPANSION_KEYS.expand[direction] &&
|
|
164
|
+
s.focusedKey === key &&
|
|
165
|
+
hasChildRows() &&
|
|
166
|
+
expanded !== "all" &&
|
|
167
|
+
!expanded.has(key)
|
|
168
|
+
) {
|
|
169
|
+
s.toggleKey(key);
|
|
170
|
+
e.stopPropagation();
|
|
171
|
+
return;
|
|
172
|
+
} else if (e.key === EXPANSION_KEYS.collapse[direction] && s.focusedKey === key) {
|
|
173
|
+
if (expanded !== "all") {
|
|
174
|
+
if (hasChildRows() && expanded.has(key)) {
|
|
175
|
+
s.toggleKey(key);
|
|
176
|
+
e.stopPropagation();
|
|
177
|
+
return;
|
|
178
|
+
} else if (!expanded.has(key) && p.node.parentKey != null && p.node.level > 0) {
|
|
179
|
+
// Leaf or already-collapsed row: move focus to the parent row.
|
|
180
|
+
s.setFocusedKey(p.node.parentKey);
|
|
181
|
+
e.stopPropagation();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
s.toggleKey(key);
|
|
186
|
+
e.stopPropagation();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
229
189
|
}
|
|
230
|
-
didActionOnPointer = true;
|
|
231
190
|
}
|
|
232
|
-
setIsPressed(false);
|
|
233
191
|
};
|
|
234
192
|
|
|
235
193
|
const rowProps = createMemo(() => {
|
|
@@ -241,27 +199,58 @@ export function createTableRow<T extends object>(
|
|
|
241
199
|
role: "row",
|
|
242
200
|
"aria-selected": s.selectionMode !== "none" ? isSelected() : undefined,
|
|
243
201
|
"aria-disabled": isDisabled() || undefined,
|
|
244
|
-
tabIndex: isFocused() ? 0 : -1,
|
|
245
|
-
onClick,
|
|
246
|
-
onDblClick,
|
|
247
|
-
onKeyDown,
|
|
248
|
-
onFocus,
|
|
249
|
-
onPointerDown,
|
|
250
|
-
onPointerUp,
|
|
251
202
|
};
|
|
252
203
|
|
|
253
|
-
//
|
|
254
|
-
if (
|
|
204
|
+
// Tree-grid rows expose their nesting depth, position and expansion state.
|
|
205
|
+
if (s.treeColumn != null) {
|
|
206
|
+
const { posinset, setsize } = siblingInfo();
|
|
207
|
+
baseProps["aria-expanded"] = hasChildRows() ? isExpanded() : undefined;
|
|
208
|
+
baseProps["aria-level"] = node.level + 1; // 1-based
|
|
209
|
+
baseProps["aria-posinset"] = posinset;
|
|
210
|
+
baseProps["aria-setsize"] = setsize;
|
|
211
|
+
baseProps.onKeyDown = onTreeGridKeyDown;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Add aria-rowindex for virtualized tables. Tree grids omit it (matches upstream).
|
|
215
|
+
if (p.isVirtualized && s.treeColumn == null && node.rowIndex != null) {
|
|
255
216
|
baseProps["aria-rowindex"] = node.rowIndex + 1; // 1-based
|
|
256
217
|
}
|
|
257
218
|
|
|
258
|
-
return
|
|
219
|
+
return mergeProps<JSX.HTMLAttributes<HTMLTableRowElement>>(
|
|
220
|
+
selectableItem.itemProps as unknown as JSX.HTMLAttributes<HTMLTableRowElement>,
|
|
221
|
+
baseProps,
|
|
222
|
+
);
|
|
259
223
|
});
|
|
260
224
|
|
|
225
|
+
// Chevron button for expanding/collapsing a tree-grid row. Press-based so it flows through
|
|
226
|
+
// our Button's `createPress`, and excluded from the tab order — reached via the row's
|
|
227
|
+
// Left/Right arrow keys instead. Mirrors `@react-aria/table`'s `expandButtonProps`; whether a
|
|
228
|
+
// chevron renders for a leaf row is the consumer's call (gate on `hasChildItems`), matching S2.
|
|
229
|
+
const onExpandPress = () => {
|
|
230
|
+
const s = state();
|
|
231
|
+
const p = props();
|
|
232
|
+
if (isDisabled()) return;
|
|
233
|
+
s.toggleKey(p.node.key);
|
|
234
|
+
s.setFocused(true);
|
|
235
|
+
s.setFocusedKey(p.node.key);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
const expandButtonProps = createMemo<ExpandButtonProps>(() => ({
|
|
239
|
+
isDisabled: isDisabled(),
|
|
240
|
+
onPress: onExpandPress,
|
|
241
|
+
excludeFromTabOrder: true,
|
|
242
|
+
preventFocusOnPress: true,
|
|
243
|
+
"data-react-aria-prevent-focus": true,
|
|
244
|
+
"aria-label": isExpanded() ? "Collapse" : "Expand",
|
|
245
|
+
}));
|
|
246
|
+
|
|
261
247
|
return {
|
|
262
248
|
get rowProps() {
|
|
263
249
|
return rowProps();
|
|
264
250
|
},
|
|
251
|
+
get expandButtonProps() {
|
|
252
|
+
return expandButtonProps();
|
|
253
|
+
},
|
|
265
254
|
get isSelected() {
|
|
266
255
|
return isSelected();
|
|
267
256
|
},
|
|
@@ -269,7 +258,13 @@ export function createTableRow<T extends object>(
|
|
|
269
258
|
return isDisabled();
|
|
270
259
|
},
|
|
271
260
|
get isPressed() {
|
|
272
|
-
return isPressed();
|
|
261
|
+
return selectableItem.isPressed();
|
|
262
|
+
},
|
|
263
|
+
get isExpanded() {
|
|
264
|
+
return isExpanded();
|
|
265
|
+
},
|
|
266
|
+
get hasChildRows() {
|
|
267
|
+
return hasChildRows();
|
|
273
268
|
},
|
|
274
269
|
};
|
|
275
270
|
}
|
|
@@ -55,12 +55,8 @@ export function createTableSelectAllCheckbox<T extends object>(
|
|
|
55
55
|
"aria-label": s.selectionMode === "single" ? "Select" : "Select All",
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
// Handle indeterminate state
|
|
59
|
-
// Note: indeterminate is not a standard HTML attribute, it must be set via JavaScript
|
|
60
|
-
// The component using this should handle this separately
|
|
61
58
|
if (isIndeterminate()) {
|
|
62
59
|
baseProps["data-indeterminate"] = "true";
|
|
63
|
-
baseProps["aria-checked"] = "mixed";
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
return baseProps as JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
@@ -70,5 +66,8 @@ export function createTableSelectAllCheckbox<T extends object>(
|
|
|
70
66
|
get checkboxProps() {
|
|
71
67
|
return checkboxProps();
|
|
72
68
|
},
|
|
69
|
+
get isIndeterminate() {
|
|
70
|
+
return isIndeterminate();
|
|
71
|
+
},
|
|
73
72
|
};
|
|
74
73
|
}
|
package/src/table/types.ts
CHANGED
|
@@ -5,6 +5,26 @@
|
|
|
5
5
|
|
|
6
6
|
import type { JSX } from "solid-js";
|
|
7
7
|
import type { Key, GridNode } from "@proyecto-viviana/solid-stately";
|
|
8
|
+
import type { AriaButtonProps } from "../button/types";
|
|
9
|
+
|
|
10
|
+
export interface TableRowLinkActionEvent {
|
|
11
|
+
metaKey?: boolean;
|
|
12
|
+
ctrlKey?: boolean;
|
|
13
|
+
altKey?: boolean;
|
|
14
|
+
shiftKey?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Props for a tree-grid row's expand/collapse chevron button.
|
|
19
|
+
*
|
|
20
|
+
* Press-based (mirrors `@react-aria/table`'s `expandButtonProps`) so it flows through our
|
|
21
|
+
* Button's `createPress`, plus the `data-react-aria-prevent-focus` marker that keeps focus
|
|
22
|
+
* management from re-focusing the chevron after a press.
|
|
23
|
+
*/
|
|
24
|
+
export type ExpandButtonProps = AriaButtonProps & {
|
|
25
|
+
/** Marks the chevron so focus management skips re-focusing it after a press. */
|
|
26
|
+
"data-react-aria-prevent-focus"?: boolean;
|
|
27
|
+
};
|
|
8
28
|
|
|
9
29
|
/**
|
|
10
30
|
* Props for the createTable hook.
|
|
@@ -93,7 +113,7 @@ export interface AriaTableRowProps {
|
|
|
93
113
|
/** Link href for row activation. */
|
|
94
114
|
href?: string;
|
|
95
115
|
/** Handler for link row activation. */
|
|
96
|
-
onLinkAction?: (event:
|
|
116
|
+
onLinkAction?: (event: TableRowLinkActionEvent) => void;
|
|
97
117
|
}
|
|
98
118
|
|
|
99
119
|
/**
|
|
@@ -102,12 +122,18 @@ export interface AriaTableRowProps {
|
|
|
102
122
|
export interface TableRowAria {
|
|
103
123
|
/** Props to spread on the row element. */
|
|
104
124
|
rowProps: JSX.HTMLAttributes<HTMLTableRowElement>;
|
|
125
|
+
/** Props to spread on a tree-grid row's expand/collapse chevron button. */
|
|
126
|
+
expandButtonProps: ExpandButtonProps;
|
|
105
127
|
/** Whether the row is selected. */
|
|
106
128
|
isSelected: boolean;
|
|
107
129
|
/** Whether the row is disabled. */
|
|
108
130
|
isDisabled: boolean;
|
|
109
131
|
/** Whether the row is pressed. */
|
|
110
132
|
isPressed: boolean;
|
|
133
|
+
/** Whether the row is expanded (tree grid only; false otherwise). */
|
|
134
|
+
isExpanded: boolean;
|
|
135
|
+
/** Whether the row has child rows (tree grid only; false otherwise). */
|
|
136
|
+
hasChildRows: boolean;
|
|
111
137
|
}
|
|
112
138
|
|
|
113
139
|
/**
|
|
@@ -170,4 +196,6 @@ export interface TableSelectionCheckboxAria {
|
|
|
170
196
|
export interface TableSelectAllCheckboxAria {
|
|
171
197
|
/** Props to spread on the checkbox input element. */
|
|
172
198
|
checkboxProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
199
|
+
/** Whether the native checkbox should expose its mixed state. */
|
|
200
|
+
isIndeterminate: boolean;
|
|
173
201
|
}
|