@proyecto-viviana/solidaria 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +141 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +141 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/announce.js +207 -0
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/announce.jsx +207 -0
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +244 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +244 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +121 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +121 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +275 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +275 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1037 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1037 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +235 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +235 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1458 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1458 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +1062 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +1062 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +61 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +61 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +55 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +55 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +105 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +105 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +120 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +120 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormReset.js +39 -0
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/createFormReset.jsx +39 -0
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +131 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +131 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +268 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +268 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +47 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +47 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +32 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +32 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +82 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +82 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +302 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +302 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +159 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +159 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1706 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1706 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +2395 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +2395 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +87 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +87 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +631 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +631 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +369 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +369 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +199 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +199 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +331 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +325 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +97 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +97 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +356 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +356 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +519 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +519 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +259 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +259 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +320 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +320 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +210 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +210 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +406 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +397 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +666 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +666 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +256 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +256 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1088 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1088 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +263 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +263 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +322 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +322 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +110 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +110 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +226 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +226 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +452 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +452 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +705 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +705 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +93 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +93 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -0
- package/dist/dnd/index.jsx +3 -0
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +7 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -0
- package/dist/focus/index.jsx +3 -0
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.jsx +5 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -18311
- package/dist/index.jsx +77 -18242
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +9 -0
- package/dist/interactions/index.jsx +9 -0
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +7 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +5 -0
- package/dist/selection/index.jsx +5 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +35 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +5 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +49 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.jsx +6 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +202 -35
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +5 -4
- package/src/calendar/createCalendarCell.ts +36 -5
- package/src/calendar/createCalendarGrid.ts +47 -12
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +27 -15
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/index.ts +17 -0
- package/src/calendar/intl/index.ts +8 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -384
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +488 -371
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +63 -3
- package/src/focus/FocusScope.tsx +266 -24
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +187 -48
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +51 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +26 -15
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +203 -10
- package/src/listbox/createOption.ts +84 -74
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +41 -4
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +512 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +82 -27
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +208 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +37 -1
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +95 -24
- package/src/tag/createTag.ts +30 -36
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -94
- package/src/tree/createTree.ts +165 -52
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +243 -0
- package/src/utils/dom.ts +216 -25
- package/src/utils/index.ts +10 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -3,11 +3,30 @@
|
|
|
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 { getRowLabelledBy } from "./utils";
|
|
18
|
+
import { useLocale } from "../i18n";
|
|
19
|
+
import { createSelectableItem, type SelectableItemState } from "../selection/createSelectableItem";
|
|
20
|
+
import { mergeProps } from "../utils/mergeProps";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Arrow keys that expand/collapse a tree-grid row, mirroring `@react-aria/table`.
|
|
24
|
+
* Direction is flipped under RTL.
|
|
25
|
+
*/
|
|
26
|
+
const EXPANSION_KEYS = {
|
|
27
|
+
expand: { ltr: "ArrowRight", rtl: "ArrowLeft" },
|
|
28
|
+
collapse: { ltr: "ArrowLeft", rtl: "ArrowRight" },
|
|
29
|
+
} as const;
|
|
11
30
|
|
|
12
31
|
/**
|
|
13
32
|
* Creates accessibility props for a table row.
|
|
@@ -15,221 +34,161 @@ import { getTableData } from "./createTable";
|
|
|
15
34
|
export function createTableRow<T extends object>(
|
|
16
35
|
props: Accessor<AriaTableRowProps>,
|
|
17
36
|
state: Accessor<TableState<T, TableCollection<T>>>,
|
|
18
|
-
|
|
37
|
+
ref: Accessor<HTMLTableRowElement | null>,
|
|
19
38
|
): TableRowAria {
|
|
20
|
-
const
|
|
21
|
-
let didSelectOnPointer = false;
|
|
22
|
-
let didActionOnPointer = false;
|
|
39
|
+
const locale = useLocale();
|
|
23
40
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const p = props();
|
|
27
|
-
return s.isSelected(p.node.key);
|
|
28
|
-
});
|
|
41
|
+
// Tree-grid (expandable rows): only active when the collection has a tree column.
|
|
42
|
+
const isTreeRow = createMemo(() => state().treeColumn != null);
|
|
29
43
|
|
|
30
|
-
const
|
|
31
|
-
const s = state();
|
|
32
|
-
const p = props();
|
|
33
|
-
return !!p.isDisabled || s.isDisabled(p.node.key);
|
|
34
|
-
});
|
|
44
|
+
const hasChildRows = createMemo(() => props().node.isExpandable ?? false);
|
|
35
45
|
|
|
36
|
-
const
|
|
46
|
+
const isExpanded = createMemo(() => {
|
|
37
47
|
const s = state();
|
|
38
|
-
|
|
39
|
-
return s.
|
|
48
|
+
if (s.treeColumn == null) return false;
|
|
49
|
+
return s.expandedKeys === "all" || s.expandedKeys.has(props().node.key);
|
|
40
50
|
});
|
|
41
51
|
|
|
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
|
+
// aria-posinset / aria-setsize among same-level sibling rows.
|
|
53
|
+
const siblingInfo = createMemo(() => {
|
|
52
54
|
const s = state();
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
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);
|
|
55
|
+
const node = props().node;
|
|
56
|
+
if (node.parentKey != null) {
|
|
57
|
+
const parent = s.collection.getItem(node.parentKey);
|
|
58
|
+
if (parent) {
|
|
59
|
+
const siblings = parent.childNodes.filter((n) => n.type === "item");
|
|
60
|
+
return { posinset: node.index + 1, setsize: siblings.length };
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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) => {
|
|
93
|
-
const s = state();
|
|
94
|
-
const p = props();
|
|
95
|
-
|
|
96
|
-
if (isDisabled()) return;
|
|
97
|
-
|
|
98
|
-
// Get table metadata for actions
|
|
99
|
-
const tableData = getTableData(s);
|
|
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);
|
|
115
|
-
}
|
|
116
|
-
didSelectOnPointer = false;
|
|
117
|
-
didActionOnPointer = false;
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (!didSelectOnPointer) {
|
|
122
|
-
selectRow(e);
|
|
123
|
-
}
|
|
124
|
-
didSelectOnPointer = false;
|
|
125
|
-
|
|
126
|
-
if (!didActionOnPointer) {
|
|
127
|
-
runRowAction(p, onRowAction);
|
|
128
|
-
}
|
|
129
|
-
didActionOnPointer = false;
|
|
130
|
-
};
|
|
63
|
+
const rootRows = s.collection.body.childNodes.filter((n) => n.type === "item");
|
|
64
|
+
const rootIndex = rootRows.findIndex((n) => n.key === node.key);
|
|
65
|
+
return {
|
|
66
|
+
posinset: rootIndex >= 0 ? rootIndex + 1 : node.index + 1,
|
|
67
|
+
setsize: rootRows.length,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
131
70
|
|
|
132
|
-
const
|
|
71
|
+
const isSelected = createMemo(() => {
|
|
133
72
|
const s = state();
|
|
134
73
|
const p = props();
|
|
74
|
+
return s.isSelected(p.node.key);
|
|
75
|
+
});
|
|
135
76
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
77
|
+
const selectableState: SelectableItemState<T> = {
|
|
78
|
+
collection: () => state().collection as unknown as Collection<T>,
|
|
79
|
+
isFocused: () => state().isFocused,
|
|
80
|
+
setFocused: (focused: boolean) => state().setFocused(focused),
|
|
81
|
+
focusedKey: () => state().focusedKey,
|
|
82
|
+
childFocusStrategy: () => state().childFocusStrategy,
|
|
83
|
+
setFocusedKey: (key: Key | null, strategy) => state().setFocusedKey(key, strategy),
|
|
84
|
+
selectionMode: () => state().selectionMode,
|
|
85
|
+
selectionBehavior: () => state().selectionBehavior,
|
|
86
|
+
disallowEmptySelection: () => state().disallowEmptySelection,
|
|
87
|
+
selectedKeys: () => state().selectedKeys as Selection,
|
|
88
|
+
disabledKeys: () => state().disabledKeys,
|
|
89
|
+
disabledBehavior: () => state().disabledBehavior,
|
|
90
|
+
isEmpty: () => {
|
|
91
|
+
const keys = state().selectedKeys;
|
|
92
|
+
return keys !== "all" && keys.size === 0;
|
|
93
|
+
},
|
|
94
|
+
isSelectAll: () => state().selectedKeys === "all",
|
|
95
|
+
isSelected: (key: Key) => state().isSelected(key),
|
|
96
|
+
isDisabled: (key: Key) => {
|
|
97
|
+
const s = state();
|
|
98
|
+
const item = s.collection.getItem(key);
|
|
99
|
+
return (
|
|
100
|
+
s.disabledBehavior === "all" &&
|
|
101
|
+
s.isDisabled(key) &&
|
|
102
|
+
item?.props?.disabledBehavior !== "selection"
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
canSelectItem: (key: Key) => {
|
|
106
|
+
const s = state();
|
|
107
|
+
return s.selectionMode !== "none" && !s.isDisabled(key);
|
|
108
|
+
},
|
|
109
|
+
setSelectionBehavior: (behavior) => state().setSelectionBehavior(behavior),
|
|
110
|
+
toggleSelection: (key: Key) => state().toggleSelection(key),
|
|
111
|
+
replaceSelection: (key: Key) => state().replaceSelection(key),
|
|
112
|
+
setSelectedKeys: (keys: Iterable<Key>) => state().setSelectedKeys(keys),
|
|
113
|
+
selectAll: () => state().selectAll(),
|
|
114
|
+
clearSelection: () => state().clearSelection(),
|
|
115
|
+
toggleSelectAll: () => state().toggleSelectAll(),
|
|
116
|
+
extendSelection: (toKey: Key, _collection: Collection<T>) => state().extendSelection(toKey),
|
|
139
117
|
};
|
|
140
118
|
|
|
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
|
|
119
|
+
const selectableItem = createSelectableItem<T>(
|
|
120
|
+
() => {
|
|
121
|
+
const s = state();
|
|
122
|
+
const p = props();
|
|
151
123
|
const tableData = getTableData(s);
|
|
152
124
|
const onRowAction = tableData?.actions.onRowAction;
|
|
125
|
+
const hasAction = !!p.onAction || !!onRowAction || !!p.href;
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
key: p.node.key,
|
|
129
|
+
id: `${tableData?.tableId ?? "table"}-row-${String(p.node.key)}`,
|
|
130
|
+
isVirtualized: p.isVirtualized,
|
|
131
|
+
shouldSelectOnPressUp: tableData?.shouldSelectOnPressUp ?? false,
|
|
132
|
+
isDisabled: !!p.isDisabled || s.collection.size === 0,
|
|
133
|
+
onAction: hasAction
|
|
134
|
+
? (event) => {
|
|
135
|
+
p.onAction?.();
|
|
136
|
+
onRowAction?.(p.node.key);
|
|
137
|
+
if (p.href) {
|
|
138
|
+
p.onLinkAction?.(event);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
: undefined,
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
selectableState,
|
|
145
|
+
ref,
|
|
146
|
+
);
|
|
153
147
|
|
|
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
|
-
};
|
|
148
|
+
const isDisabled = () => selectableItem.isDisabled();
|
|
192
149
|
|
|
193
|
-
const
|
|
150
|
+
const onTreeGridKeyDown = (e: KeyboardEvent) => {
|
|
194
151
|
const s = state();
|
|
195
152
|
const p = props();
|
|
196
|
-
s.setFocusedKey(p.node.key);
|
|
197
|
-
};
|
|
198
153
|
|
|
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
|
-
};
|
|
154
|
+
if (isDisabled()) return;
|
|
210
155
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
156
|
+
// Tree-grid expand/collapse with Left/Right arrows (flipped under RTL). Handled before
|
|
157
|
+
// selection/navigation; stopping propagation prevents the grid's arrow navigation when
|
|
158
|
+
// expansion consumes the key.
|
|
159
|
+
if (s.treeColumn != null) {
|
|
160
|
+
const direction = locale().direction === "rtl" ? "rtl" : "ltr";
|
|
161
|
+
const key = p.node.key;
|
|
162
|
+
const expanded = s.expandedKeys;
|
|
163
|
+
if (
|
|
164
|
+
e.key === EXPANSION_KEYS.expand[direction] &&
|
|
165
|
+
s.focusedKey === key &&
|
|
166
|
+
hasChildRows() &&
|
|
167
|
+
expanded !== "all" &&
|
|
168
|
+
!expanded.has(key)
|
|
169
|
+
) {
|
|
170
|
+
s.toggleKey(key);
|
|
171
|
+
e.stopPropagation();
|
|
172
|
+
return;
|
|
173
|
+
} else if (e.key === EXPANSION_KEYS.collapse[direction] && s.focusedKey === key) {
|
|
174
|
+
if (expanded !== "all") {
|
|
175
|
+
if (hasChildRows() && expanded.has(key)) {
|
|
176
|
+
s.toggleKey(key);
|
|
177
|
+
e.stopPropagation();
|
|
178
|
+
return;
|
|
179
|
+
} else if (!expanded.has(key) && p.node.parentKey != null && p.node.level > 0) {
|
|
180
|
+
// Leaf or already-collapsed row: move focus to the parent row.
|
|
181
|
+
s.setFocusedKey(p.node.parentKey);
|
|
182
|
+
e.stopPropagation();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
} else {
|
|
186
|
+
s.toggleKey(key);
|
|
187
|
+
e.stopPropagation();
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
229
190
|
}
|
|
230
|
-
didActionOnPointer = true;
|
|
231
191
|
}
|
|
232
|
-
setIsPressed(false);
|
|
233
192
|
};
|
|
234
193
|
|
|
235
194
|
const rowProps = createMemo(() => {
|
|
@@ -241,27 +200,67 @@ export function createTableRow<T extends object>(
|
|
|
241
200
|
role: "row",
|
|
242
201
|
"aria-selected": s.selectionMode !== "none" ? isSelected() : undefined,
|
|
243
202
|
"aria-disabled": isDisabled() || undefined,
|
|
244
|
-
tabIndex: isFocused() ? 0 : -1,
|
|
245
|
-
onClick,
|
|
246
|
-
onDblClick,
|
|
247
|
-
onKeyDown,
|
|
248
|
-
onFocus,
|
|
249
|
-
onPointerDown,
|
|
250
|
-
onPointerUp,
|
|
251
203
|
};
|
|
252
204
|
|
|
253
|
-
//
|
|
254
|
-
|
|
205
|
+
// A row is labelled by its row-header cell(s) — mirrors `useTableRow`'s
|
|
206
|
+
// `'aria-labelledby': getRowLabelledBy(state, node.key)`. Without it the
|
|
207
|
+
// browser falls back to concatenating every cell (incl. the selection
|
|
208
|
+
// checkbox), so the row's accessible name reads "Select Foo.pdf PDF …".
|
|
209
|
+
const labelledBy = getRowLabelledBy(s, node.key);
|
|
210
|
+
if (labelledBy) {
|
|
211
|
+
baseProps["aria-labelledby"] = labelledBy;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Tree-grid rows expose their nesting depth, position and expansion state.
|
|
215
|
+
if (s.treeColumn != null) {
|
|
216
|
+
const { posinset, setsize } = siblingInfo();
|
|
217
|
+
baseProps["aria-expanded"] = hasChildRows() ? isExpanded() : undefined;
|
|
218
|
+
baseProps["aria-level"] = node.level + 1; // 1-based
|
|
219
|
+
baseProps["aria-posinset"] = posinset;
|
|
220
|
+
baseProps["aria-setsize"] = setsize;
|
|
221
|
+
baseProps.onKeyDown = onTreeGridKeyDown;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Add aria-rowindex for virtualized tables. Tree grids omit it (matches upstream).
|
|
225
|
+
if (p.isVirtualized && s.treeColumn == null && node.rowIndex != null) {
|
|
255
226
|
baseProps["aria-rowindex"] = node.rowIndex + 1; // 1-based
|
|
256
227
|
}
|
|
257
228
|
|
|
258
|
-
return
|
|
229
|
+
return mergeProps<JSX.HTMLAttributes<HTMLTableRowElement>>(
|
|
230
|
+
selectableItem.itemProps as unknown as JSX.HTMLAttributes<HTMLTableRowElement>,
|
|
231
|
+
baseProps,
|
|
232
|
+
);
|
|
259
233
|
});
|
|
260
234
|
|
|
235
|
+
// Chevron button for expanding/collapsing a tree-grid row. Press-based so it flows through
|
|
236
|
+
// our Button's `createPress`, and excluded from the tab order — reached via the row's
|
|
237
|
+
// Left/Right arrow keys instead. Mirrors `@react-aria/table`'s `expandButtonProps`; whether a
|
|
238
|
+
// chevron renders for a leaf row is the consumer's call (gate on `hasChildItems`), matching S2.
|
|
239
|
+
const onExpandPress = () => {
|
|
240
|
+
const s = state();
|
|
241
|
+
const p = props();
|
|
242
|
+
if (isDisabled()) return;
|
|
243
|
+
s.toggleKey(p.node.key);
|
|
244
|
+
s.setFocused(true);
|
|
245
|
+
s.setFocusedKey(p.node.key);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const expandButtonProps = createMemo<ExpandButtonProps>(() => ({
|
|
249
|
+
isDisabled: isDisabled(),
|
|
250
|
+
onPress: onExpandPress,
|
|
251
|
+
excludeFromTabOrder: true,
|
|
252
|
+
preventFocusOnPress: true,
|
|
253
|
+
"data-react-aria-prevent-focus": true,
|
|
254
|
+
"aria-label": isExpanded() ? "Collapse" : "Expand",
|
|
255
|
+
}));
|
|
256
|
+
|
|
261
257
|
return {
|
|
262
258
|
get rowProps() {
|
|
263
259
|
return rowProps();
|
|
264
260
|
},
|
|
261
|
+
get expandButtonProps() {
|
|
262
|
+
return expandButtonProps();
|
|
263
|
+
},
|
|
265
264
|
get isSelected() {
|
|
266
265
|
return isSelected();
|
|
267
266
|
},
|
|
@@ -269,7 +268,13 @@ export function createTableRow<T extends object>(
|
|
|
269
268
|
return isDisabled();
|
|
270
269
|
},
|
|
271
270
|
get isPressed() {
|
|
272
|
-
return isPressed();
|
|
271
|
+
return selectableItem.isPressed();
|
|
272
|
+
},
|
|
273
|
+
get isExpanded() {
|
|
274
|
+
return isExpanded();
|
|
275
|
+
},
|
|
276
|
+
get hasChildRows() {
|
|
277
|
+
return hasChildRows();
|
|
273
278
|
},
|
|
274
279
|
};
|
|
275
280
|
}
|
|
@@ -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
|
}
|
|
@@ -8,6 +8,7 @@ import type { JSX } from "solid-js";
|
|
|
8
8
|
import { createId } from "@proyecto-viviana/solid-stately";
|
|
9
9
|
import type { TableState, TableCollection } from "@proyecto-viviana/solid-stately";
|
|
10
10
|
import type { AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria } from "./types";
|
|
11
|
+
import { getRowLabelledBy } from "./utils";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Creates accessibility props for a table row selection checkbox.
|
|
@@ -24,10 +25,25 @@ export function createTableSelectionCheckbox<T extends object>(
|
|
|
24
25
|
return s.isSelected(p.key);
|
|
25
26
|
});
|
|
26
27
|
|
|
28
|
+
// Mirrors `useGridSelectionCheckbox`'s `!selectionManager.canSelectItem(key)`:
|
|
29
|
+
// a row's checkbox is disabled when selection is off, the key is in
|
|
30
|
+
// `disabledKeys`, or the row/item itself is disabled. This is broader than the
|
|
31
|
+
// row's own focusability gate (which only disables under `disabledBehavior:
|
|
32
|
+
// "all"`) — a row disabled via its `isDisabled` prop still cannot be selected,
|
|
33
|
+
// so its checkbox is disabled regardless of `disabledBehavior`.
|
|
34
|
+
//
|
|
35
|
+
// `isRowDisabled` carries the render-time per-row `isDisabled` that this
|
|
36
|
+
// data-driven port keeps on the row hook rather than the collection node
|
|
37
|
+
// (surfaced via `TableRowContext`); the collection-node check below still
|
|
38
|
+
// applies for any path that does populate `node.isDisabled`.
|
|
27
39
|
const isDisabled = createMemo(() => {
|
|
28
40
|
const s = state();
|
|
29
41
|
const p = props();
|
|
30
|
-
|
|
42
|
+
if (s.selectionMode === "none" || s.disabledKeys.has(p.key) || p.isRowDisabled) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
const item = s.collection.getItem(p.key);
|
|
46
|
+
return !item || !!item.isDisabled || !!item.props?.isDisabled;
|
|
31
47
|
});
|
|
32
48
|
|
|
33
49
|
const onChange = () => {
|
|
@@ -39,6 +55,9 @@ export function createTableSelectionCheckbox<T extends object>(
|
|
|
39
55
|
};
|
|
40
56
|
|
|
41
57
|
const checkboxProps = createMemo(() => {
|
|
58
|
+
const s = state();
|
|
59
|
+
const p = props();
|
|
60
|
+
|
|
42
61
|
const baseProps: Record<string, unknown> = {
|
|
43
62
|
id: checkboxId,
|
|
44
63
|
type: "checkbox",
|
|
@@ -46,6 +65,10 @@ export function createTableSelectionCheckbox<T extends object>(
|
|
|
46
65
|
disabled: isDisabled(),
|
|
47
66
|
onChange,
|
|
48
67
|
"aria-label": "Select",
|
|
68
|
+
// Mirrors `useTableSelectionCheckbox`: the checkbox is labelled by its own
|
|
69
|
+
// "Select" text plus the row's row-header cell(s), so screen readers read
|
|
70
|
+
// "Select Foo.pdf" rather than a bare "Select".
|
|
71
|
+
"aria-labelledby": `${checkboxId} ${getRowLabelledBy(s, p.key)}`,
|
|
49
72
|
};
|
|
50
73
|
|
|
51
74
|
return baseProps as JSX.InputHTMLAttributes<HTMLInputElement>;
|
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
|
/**
|
|
@@ -154,6 +180,14 @@ export interface TableRowGroupAria {
|
|
|
154
180
|
export interface AriaTableSelectionCheckboxProps {
|
|
155
181
|
/** The key of the row. */
|
|
156
182
|
key: Key;
|
|
183
|
+
/**
|
|
184
|
+
* Whether the owning row is disabled. In upstream RAC the row's `isDisabled`
|
|
185
|
+
* lives on the shared collection node, so `selectionManager.canSelectItem`
|
|
186
|
+
* can read it. In this data-driven port per-row `isDisabled` is a render-time
|
|
187
|
+
* prop threaded through `createTableRow`, so it is surfaced to the sibling
|
|
188
|
+
* checkbox via `TableRowContext` and forwarded here.
|
|
189
|
+
*/
|
|
190
|
+
isRowDisabled?: boolean;
|
|
157
191
|
}
|
|
158
192
|
|
|
159
193
|
/**
|
|
@@ -170,4 +204,6 @@ export interface TableSelectionCheckboxAria {
|
|
|
170
204
|
export interface TableSelectAllCheckboxAria {
|
|
171
205
|
/** Props to spread on the checkbox input element. */
|
|
172
206
|
checkboxProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
207
|
+
/** Whether the native checkbox should expose its mixed state. */
|
|
208
|
+
isIndeterminate: boolean;
|
|
173
209
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table accessibility id helpers.
|
|
3
|
+
* Port of @react-aria/table/utils (`getRowLabelledBy` / cell id derivation).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
Key,
|
|
8
|
+
GridNode,
|
|
9
|
+
TableState,
|
|
10
|
+
TableCollection,
|
|
11
|
+
} from "@proyecto-viviana/solid-stately";
|
|
12
|
+
import { getTableData } from "./createTable";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A row is labelled by its row-header cells. Mirrors `@react-aria/table`'s
|
|
16
|
+
* `getRowLabelledBy`, which joins `getCellId(state, rowKey, columnKey)` across
|
|
17
|
+
* `collection.rowHeaderColumnKeys`. We resolve the actual rowheader cell node
|
|
18
|
+
* and rebuild the exact id string `createTableCell` puts on the element
|
|
19
|
+
* (`${tableId}-${parentKey}-${cellKey}`) so the reference always matches a real
|
|
20
|
+
* element, regardless of the cell-key scheme.
|
|
21
|
+
*/
|
|
22
|
+
export function getRowLabelledBy<T extends object>(
|
|
23
|
+
state: TableState<T, TableCollection<T>>,
|
|
24
|
+
rowKey: Key,
|
|
25
|
+
): string {
|
|
26
|
+
const tableData = getTableData(state);
|
|
27
|
+
const tableId = tableData?.tableId ?? "table";
|
|
28
|
+
const collection = state.collection as TableCollection<T> & {
|
|
29
|
+
getCell?: (rowKey: Key, columnKey: Key) => GridNode<T> | null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return [...collection.rowHeaderColumnKeys]
|
|
33
|
+
.map((columnKey) => {
|
|
34
|
+
const cell = collection.getCell?.(rowKey, columnKey);
|
|
35
|
+
return cell?.parentKey != null
|
|
36
|
+
? `${tableId}-${String(cell.parentKey)}-${String(cell.key)}`
|
|
37
|
+
: null;
|
|
38
|
+
})
|
|
39
|
+
.filter((id): id is string => id != null)
|
|
40
|
+
.join(" ");
|
|
41
|
+
}
|