@proyecto-viviana/solidaria 0.4.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 +13 -79
- package/dist/_chunk/actiongroup.js.map +1 -1
- package/dist/_chunk/actiongroup.jsx +13 -79
- package/dist/_chunk/actiongroup.jsx.map +1 -1
- package/dist/_chunk/{live-announcer.js → announce.js} +1 -1
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/{live-announcer.jsx → announce.jsx} +1 -1
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +56 -8
- package/dist/_chunk/autocomplete.js.map +1 -1
- package/dist/_chunk/autocomplete.jsx +56 -8
- package/dist/_chunk/autocomplete.jsx.map +1 -1
- package/dist/_chunk/breadcrumbs.js +6 -4
- package/dist/_chunk/breadcrumbs.js.map +1 -1
- package/dist/_chunk/breadcrumbs.jsx +6 -4
- package/dist/_chunk/breadcrumbs.jsx.map +1 -1
- package/dist/_chunk/button.js +8 -9
- package/dist/_chunk/button.js.map +1 -1
- package/dist/_chunk/button.jsx +8 -9
- package/dist/_chunk/button.jsx.map +1 -1
- package/dist/_chunk/calendar.js +27 -26
- package/dist/_chunk/calendar.js.map +1 -1
- package/dist/_chunk/calendar.jsx +27 -26
- package/dist/_chunk/calendar.jsx.map +1 -1
- package/dist/_chunk/checkbox.js +5 -4
- package/dist/_chunk/checkbox.js.map +1 -1
- package/dist/_chunk/checkbox.jsx +5 -4
- package/dist/_chunk/checkbox.jsx.map +1 -1
- package/dist/_chunk/color.js +302 -18
- package/dist/_chunk/color.js.map +1 -1
- package/dist/_chunk/color.jsx +302 -18
- package/dist/_chunk/color.jsx.map +1 -1
- package/dist/_chunk/combobox.js +638 -12
- package/dist/_chunk/combobox.js.map +1 -1
- package/dist/_chunk/combobox.jsx +638 -12
- package/dist/_chunk/combobox.jsx.map +1 -1
- 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 +3 -171
- package/dist/_chunk/createCollator.js.map +1 -1
- package/dist/_chunk/createCollator.jsx +3 -165
- package/dist/_chunk/createCollator.jsx.map +1 -1
- package/dist/_chunk/createField.js +2 -1
- package/dist/_chunk/createField.js.map +1 -1
- package/dist/_chunk/createField.jsx +2 -1
- package/dist/_chunk/createField.jsx.map +1 -1
- package/dist/_chunk/createFocus.js +12 -8
- package/dist/_chunk/createFocus.js.map +1 -1
- package/dist/_chunk/createFocus.jsx +12 -8
- package/dist/_chunk/createFocus.jsx.map +1 -1
- package/dist/_chunk/createFocusWithin.js +12 -13
- package/dist/_chunk/createFocusWithin.js.map +1 -1
- package/dist/_chunk/createFocusWithin.jsx +12 -13
- package/dist/_chunk/createFocusWithin.jsx.map +1 -1
- package/dist/_chunk/createFocusable.js +3 -3
- package/dist/_chunk/createFocusable.js.map +1 -1
- package/dist/_chunk/createFocusable.jsx +3 -3
- package/dist/_chunk/createFocusable.jsx.map +1 -1
- package/dist/_chunk/{form.js → createFormReset.js} +1 -1
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/{form.jsx → createFormReset.jsx} +1 -1
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createHover.js +2 -1
- package/dist/_chunk/createHover.js.map +1 -1
- package/dist/_chunk/createHover.jsx +2 -1
- package/dist/_chunk/createHover.jsx.map +1 -1
- package/dist/_chunk/createInteractionModality.js +2 -3
- package/dist/_chunk/createInteractionModality.js.map +1 -1
- package/dist/_chunk/createInteractionModality.jsx +2 -3
- package/dist/_chunk/createInteractionModality.jsx.map +1 -1
- package/dist/_chunk/createLabel.js +2 -1
- package/dist/_chunk/createLabel.js.map +1 -1
- package/dist/_chunk/createLabel.jsx +2 -1
- package/dist/_chunk/createLabel.jsx.map +1 -1
- package/dist/_chunk/createLabels.js +3 -2
- package/dist/_chunk/createLabels.js.map +1 -1
- package/dist/_chunk/createLabels.jsx +3 -2
- package/dist/_chunk/createLabels.jsx.map +1 -1
- package/dist/_chunk/createLandmark.js +1 -1
- package/dist/_chunk/createLandmark.jsx +1 -1
- package/dist/_chunk/createProgressBar.js +2 -1
- package/dist/_chunk/createProgressBar.js.map +1 -1
- package/dist/_chunk/createProgressBar.jsx +2 -1
- package/dist/_chunk/createProgressBar.jsx.map +1 -1
- package/dist/_chunk/createSelectableItem.js +7 -3
- package/dist/_chunk/createSelectableItem.js.map +1 -1
- package/dist/_chunk/createSelectableItem.jsx +7 -3
- package/dist/_chunk/createSelectableItem.jsx.map +1 -1
- 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 +5 -4
- package/dist/_chunk/createToggle.js.map +1 -1
- package/dist/_chunk/createToggle.jsx +5 -4
- package/dist/_chunk/createToggle.jsx.map +1 -1
- package/dist/_chunk/datepicker.js +1413 -1100
- package/dist/_chunk/datepicker.js.map +1 -1
- package/dist/_chunk/datepicker.jsx +1413 -1100
- package/dist/_chunk/datepicker.jsx.map +1 -1
- package/dist/_chunk/disclosure.js +2 -2
- package/dist/_chunk/disclosure.js.map +1 -1
- package/dist/_chunk/disclosure.jsx +2 -2
- package/dist/_chunk/disclosure.jsx.map +1 -1
- package/dist/_chunk/dnd.js +1586 -495
- package/dist/_chunk/dnd.js.map +1 -1
- package/dist/_chunk/dnd.jsx +1586 -495
- package/dist/_chunk/dnd.jsx.map +1 -1
- package/dist/_chunk/env.js +1 -19
- package/dist/_chunk/env.js.map +1 -1
- package/dist/_chunk/env.jsx +1 -19
- package/dist/_chunk/env.jsx.map +1 -1
- package/dist/_chunk/focus.js +1 -1
- package/dist/_chunk/focus.js.map +1 -1
- package/dist/_chunk/focus.jsx +1 -1
- package/dist/_chunk/focus.jsx.map +1 -1
- package/dist/_chunk/focus2.js +54 -318
- package/dist/_chunk/focus2.js.map +1 -1
- package/dist/_chunk/focus2.jsx +53 -292
- package/dist/_chunk/focus2.jsx.map +1 -1
- package/dist/_chunk/grid.js +1 -1
- package/dist/_chunk/grid.jsx +1 -1
- package/dist/_chunk/gridlist.js +14 -9
- package/dist/_chunk/gridlist.js.map +1 -1
- package/dist/_chunk/gridlist.jsx +14 -9
- package/dist/_chunk/gridlist.jsx.map +1 -1
- package/dist/_chunk/i18n.js +3 -58
- package/dist/_chunk/i18n.js.map +1 -1
- package/dist/_chunk/i18n.jsx +3 -58
- package/dist/_chunk/i18n.jsx.map +1 -1
- package/dist/_chunk/interactions.js +99 -9
- package/dist/_chunk/interactions.js.map +1 -1
- package/dist/_chunk/interactions.jsx +97 -9
- package/dist/_chunk/interactions.jsx.map +1 -1
- package/dist/_chunk/link.js +2 -1
- package/dist/_chunk/link.js.map +1 -1
- package/dist/_chunk/link.jsx +2 -1
- package/dist/_chunk/link.jsx.map +1 -1
- package/dist/_chunk/listbox.js +42 -10
- package/dist/_chunk/listbox.js.map +1 -1
- package/dist/_chunk/listbox.jsx +42 -10
- package/dist/_chunk/listbox.jsx.map +1 -1
- 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 +5 -4
- package/dist/_chunk/menu.js.map +1 -1
- package/dist/_chunk/menu.jsx +5 -4
- package/dist/_chunk/menu.jsx.map +1 -1
- package/dist/_chunk/numberfield.js +3 -2
- package/dist/_chunk/numberfield.js.map +1 -1
- package/dist/_chunk/numberfield.jsx +3 -2
- package/dist/_chunk/numberfield.jsx.map +1 -1
- package/dist/_chunk/overlays.js +1 -1
- package/dist/_chunk/overlays.jsx +1 -1
- package/dist/_chunk/popover.js +3 -3
- package/dist/_chunk/popover.js.map +1 -1
- package/dist/_chunk/popover.jsx +3 -3
- package/dist/_chunk/popover.jsx.map +1 -1
- package/dist/_chunk/radio.js +7 -6
- package/dist/_chunk/radio.js.map +1 -1
- package/dist/_chunk/radio.jsx +7 -6
- package/dist/_chunk/radio.jsx.map +1 -1
- 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 +2 -1
- package/dist/_chunk/searchfield.js.map +1 -1
- package/dist/_chunk/searchfield.jsx +2 -1
- package/dist/_chunk/searchfield.jsx.map +1 -1
- package/dist/_chunk/select.js +8 -5
- package/dist/_chunk/select.js.map +1 -1
- package/dist/_chunk/select.jsx +8 -5
- package/dist/_chunk/select.jsx.map +1 -1
- package/dist/_chunk/selection.js +8 -21
- package/dist/_chunk/selection.js.map +1 -1
- package/dist/_chunk/selection.jsx +8 -21
- package/dist/_chunk/selection.jsx.map +1 -1
- package/dist/_chunk/separator.js +1 -1
- package/dist/_chunk/separator.jsx +1 -1
- package/dist/_chunk/slider.js +5 -4
- package/dist/_chunk/slider.js.map +1 -1
- package/dist/_chunk/slider.jsx +5 -4
- package/dist/_chunk/slider.jsx.map +1 -1
- 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/table.js +45 -8
- package/dist/_chunk/table.js.map +1 -1
- package/dist/_chunk/table.jsx +45 -8
- package/dist/_chunk/table.jsx.map +1 -1
- package/dist/_chunk/tabs.js +11 -8
- package/dist/_chunk/tabs.js.map +1 -1
- package/dist/_chunk/tabs.jsx +11 -8
- package/dist/_chunk/tabs.jsx.map +1 -1
- package/dist/_chunk/tag.js +54 -18
- package/dist/_chunk/tag.js.map +1 -1
- package/dist/_chunk/tag.jsx +54 -18
- package/dist/_chunk/tag.jsx.map +1 -1
- package/dist/_chunk/textfield.js +2 -1
- package/dist/_chunk/textfield.js.map +1 -1
- package/dist/_chunk/textfield.jsx +2 -1
- package/dist/_chunk/textfield.jsx.map +1 -1
- package/dist/_chunk/toolbar.js +4 -36
- package/dist/_chunk/toolbar.js.map +1 -1
- package/dist/_chunk/toolbar.jsx +4 -36
- package/dist/_chunk/toolbar.jsx.map +1 -1
- package/dist/_chunk/tooltip.js +2 -2
- package/dist/_chunk/tooltip.js.map +1 -1
- package/dist/_chunk/tooltip.jsx +2 -2
- package/dist/_chunk/tooltip.jsx.map +1 -1
- package/dist/_chunk/tree.js +42 -14
- package/dist/_chunk/tree.js.map +1 -1
- package/dist/_chunk/tree.jsx +42 -14
- package/dist/_chunk/tree.jsx.map +1 -1
- package/dist/_chunk/utils.js +59 -19
- package/dist/_chunk/utils.js.map +1 -1
- package/dist/_chunk/utils.jsx +59 -19
- package/dist/_chunk/utils.jsx.map +1 -1
- package/dist/_chunk/visually-hidden.js +3 -2
- package/dist/_chunk/visually-hidden.js.map +1 -1
- package/dist/_chunk/visually-hidden.jsx +3 -2
- package/dist/_chunk/visually-hidden.jsx.map +1 -1
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/autocomplete/createAutocomplete.d.ts +10 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- 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/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/collections/index.js +1 -1
- package/dist/collections/index.jsx +1 -1
- 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/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/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 -2
- package/dist/datepicker/index.jsx +2 -2
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -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 -2
- package/dist/dnd/index.jsx +3 -2
- 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 +5 -0
- 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 -2
- package/dist/focus/index.jsx +3 -2
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/index.js +1 -1
- package/dist/form/index.jsx +1 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/i18n/index.js +4 -2
- package/dist/i18n/index.jsx +4 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.jsx +18 -12
- package/dist/interactions/FocusableProvider.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.map +1 -1
- package/dist/interactions/index.js +1 -2
- package/dist/interactions/index.jsx +1 -2
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +1 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/live-announcer/index.js +1 -1
- package/dist/live-announcer/index.jsx +1 -1
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/selection/createSelectableItem.d.ts.map +1 -1
- package/dist/selection/index.js +2 -1
- package/dist/selection/index.jsx +2 -1
- 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/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/types.d.ts +8 -0
- 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 +1 -0
- package/dist/tabs/createTabs.d.ts.map +1 -1
- 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/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/utils/animation.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -3
- package/dist/utils/index.jsx +4 -3
- package/package.json +2 -2
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +136 -15
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +3 -4
- package/src/calendar/createCalendarCell.ts +17 -3
- package/src/calendar/createCalendarGrid.ts +5 -4
- package/src/calendar/createRangeCalendar.ts +27 -17
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/intl/index.ts +8 -0
- 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 -389
- 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 +487 -373
- 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 +36 -0
- package/src/focus/FocusScope.tsx +120 -12
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/gridlist/createGridList.ts +52 -16
- package/src/index.ts +11 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +5 -3
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +74 -2
- package/src/listbox/createOption.ts +16 -1
- package/src/select/createSelect.ts +23 -2
- package/src/selection/createSelectableItem.ts +14 -0
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/table/createTable.ts +26 -1
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +10 -0
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +8 -0
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +53 -12
- package/src/tag/createTag.ts +21 -32
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toolbar/createToolbar.ts +6 -58
- package/src/tree/createTree.ts +69 -14
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/utils/animation.ts +119 -27
- package/src/utils/dom.ts +3 -2
- package/src/utils/index.ts +2 -0
- package/dist/_chunk/createLongPress.js +0 -91
- package/dist/_chunk/createLongPress.js.map +0 -1
- package/dist/_chunk/createLongPress.jsx +0 -91
- package/dist/_chunk/createLongPress.jsx.map +0 -1
- package/dist/_chunk/form.js.map +0 -1
- package/dist/_chunk/form.jsx.map +0 -1
- package/dist/_chunk/live-announcer.js.map +0 -1
- package/dist/_chunk/live-announcer.jsx.map +0 -1
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dragDescriptionKeyboard": "按 Enter 鍵以開始拖曳。",
|
|
3
|
+
"dragDescriptionKeyboardAlt": "按 Alt+Enter 鍵以開始拖曳。",
|
|
4
|
+
"dragDescriptionLongPress": "長按以開始拖曳。",
|
|
5
|
+
"dragDescriptionTouch": "輕點兩下以開始拖曳。",
|
|
6
|
+
"dragDescriptionVirtual": "按一下滑鼠以開始拖曳。",
|
|
7
|
+
"dragItem": "拖曳「{itemText}」",
|
|
8
|
+
"dragSelectedItems": "拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}",
|
|
9
|
+
"dragSelectedKeyboard": "按 Enter 鍵以拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}。",
|
|
10
|
+
"dragSelectedKeyboardAlt": "按 Alt+Enter 鍵以拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}。",
|
|
11
|
+
"dragSelectedLongPress": "長按以拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}。",
|
|
12
|
+
"dragStartedKeyboard": "已開始拖曳。按 Tab 鍵以瀏覽至放置目標,然後按 Enter 鍵以放置,或按 Escape 鍵以取消。",
|
|
13
|
+
"dragStartedTouch": "已開始拖曳。瀏覽至放置目標,然後輕點兩下以放置。",
|
|
14
|
+
"dragStartedVirtual": "已開始拖曳。瀏覽至放置目標,然後按一下滑鼠或按 Enter 鍵以放置。",
|
|
15
|
+
"dropCanceled": "放置已取消。",
|
|
16
|
+
"dropComplete": "放置已完成。",
|
|
17
|
+
"dropDescriptionKeyboard": "按 Enter 鍵以放置。按 Escape 鍵以取消拖曳。",
|
|
18
|
+
"dropDescriptionTouch": "輕點兩下以放置。",
|
|
19
|
+
"dropDescriptionVirtual": "按一下滑鼠以放置。",
|
|
20
|
+
"dropIndicator": "放置指示器",
|
|
21
|
+
"dropOnItem": "放置在「{itemText}」上",
|
|
22
|
+
"dropOnRoot": "放置在",
|
|
23
|
+
"endDragKeyboard": "拖曳中。按 Enter 鍵以取消拖曳。",
|
|
24
|
+
"endDragTouch": "拖曳中。輕點兩下以取消拖曳。",
|
|
25
|
+
"endDragVirtual": "拖曳中。按一下滑鼠以取消拖曳。",
|
|
26
|
+
"insertAfter": "插入至「{itemText}」之後",
|
|
27
|
+
"insertBefore": "插入至「{itemText}」之前",
|
|
28
|
+
"insertBetween": "插入至「{beforeItemText}」和「{afterItemText}」之間"
|
|
29
|
+
}
|
package/src/dnd/utils.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
DropOperation,
|
|
13
13
|
} from "@proyecto-viviana/solid-stately";
|
|
14
14
|
import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
|
|
15
|
+
import { getInteractionModality } from "../interactions";
|
|
15
16
|
|
|
16
17
|
// Native drag types that can be transferred between applications
|
|
17
18
|
export const NATIVE_DRAG_TYPES: Set<string> = new Set(["text/plain", "text/uri-list", "text/html"]);
|
|
@@ -73,6 +74,41 @@ export const DROP_OPERATION_TO_DROP_EFFECT: Record<DropOperation, string> = {
|
|
|
73
74
|
move: "move",
|
|
74
75
|
};
|
|
75
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Maps the current interaction modality onto the drag modality used for
|
|
79
|
+
* announcements and descriptions. Mirrors @react-aria/dnd `mapModality`:
|
|
80
|
+
* pointer collapses to virtual, and a virtual modality on a coarse pointer
|
|
81
|
+
* (touch screen reader) becomes touch.
|
|
82
|
+
*/
|
|
83
|
+
function mapModality(modality: string | null): string {
|
|
84
|
+
if (!modality) {
|
|
85
|
+
modality = "virtual";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (modality === "pointer") {
|
|
89
|
+
modality = "virtual";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (
|
|
93
|
+
modality === "virtual" &&
|
|
94
|
+
typeof window !== "undefined" &&
|
|
95
|
+
typeof window.matchMedia === "function" &&
|
|
96
|
+
window.matchMedia("(pointer: coarse)").matches
|
|
97
|
+
) {
|
|
98
|
+
modality = "touch";
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return modality;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Returns the drag modality ('keyboard' | 'virtual' | 'touch') for the current
|
|
106
|
+
* interaction. Mirrors @react-aria/dnd `getDragModality`.
|
|
107
|
+
*/
|
|
108
|
+
export function getDragModality(): string {
|
|
109
|
+
return mapModality(getInteractionModality());
|
|
110
|
+
}
|
|
111
|
+
|
|
76
112
|
/**
|
|
77
113
|
* Get the types present in drag items.
|
|
78
114
|
*/
|
package/src/focus/FocusScope.tsx
CHANGED
|
@@ -15,7 +15,13 @@ import {
|
|
|
15
15
|
onMount,
|
|
16
16
|
} from "solid-js";
|
|
17
17
|
import { isServer } from "solid-js/web";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
getOwnerDocument,
|
|
20
|
+
isFocusable,
|
|
21
|
+
isTabbable,
|
|
22
|
+
getFocusableTreeWalker,
|
|
23
|
+
getActiveElement,
|
|
24
|
+
} from "../utils";
|
|
19
25
|
import { focusSafely } from "../utils/focus";
|
|
20
26
|
|
|
21
27
|
export interface FocusScopeProps {
|
|
@@ -62,6 +68,119 @@ interface FocusScopeContextValue {
|
|
|
62
68
|
scopeRef: Accessor<Element[]>;
|
|
63
69
|
}
|
|
64
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Walks a TreeWalker to its final (deepest-last) node, mirroring the `last`
|
|
73
|
+
* helper in @react-aria/focus.
|
|
74
|
+
*/
|
|
75
|
+
function lastFocusable(walker: TreeWalker): HTMLElement | null {
|
|
76
|
+
let next: HTMLElement | undefined;
|
|
77
|
+
let last: Node | null;
|
|
78
|
+
do {
|
|
79
|
+
last = walker.lastChild();
|
|
80
|
+
if (last) {
|
|
81
|
+
next = last as HTMLElement;
|
|
82
|
+
}
|
|
83
|
+
} while (last);
|
|
84
|
+
return next ?? null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates a FocusManager rooted at the given ref element, independent of any
|
|
89
|
+
* FocusScope. Mirrors @react-aria/focus's `createFocusManager`: it walks the
|
|
90
|
+
* focusable tree with `getFocusableTreeWalker` so segment/spinbutton navigation
|
|
91
|
+
* inside a date field group behaves exactly like upstream.
|
|
92
|
+
*/
|
|
93
|
+
export function createFocusManager(
|
|
94
|
+
ref: () => HTMLElement | null | undefined,
|
|
95
|
+
defaultOptions: FocusManagerOptions = {},
|
|
96
|
+
): FocusManager {
|
|
97
|
+
return {
|
|
98
|
+
focusNext(opts: FocusManagerOptions = {}) {
|
|
99
|
+
const root = ref();
|
|
100
|
+
if (!root) return null;
|
|
101
|
+
const {
|
|
102
|
+
from,
|
|
103
|
+
tabbable = defaultOptions.tabbable,
|
|
104
|
+
wrap = defaultOptions.wrap,
|
|
105
|
+
accept = defaultOptions.accept,
|
|
106
|
+
} = opts;
|
|
107
|
+
const node = from || getActiveElement(getOwnerDocument(root));
|
|
108
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
109
|
+
if (node && root.contains(node)) {
|
|
110
|
+
walker.currentNode = node;
|
|
111
|
+
}
|
|
112
|
+
let nextNode = walker.nextNode() as HTMLElement | null;
|
|
113
|
+
if (!nextNode && wrap) {
|
|
114
|
+
walker.currentNode = root;
|
|
115
|
+
nextNode = walker.nextNode() as HTMLElement | null;
|
|
116
|
+
}
|
|
117
|
+
if (nextNode) {
|
|
118
|
+
focusSafely(nextNode);
|
|
119
|
+
}
|
|
120
|
+
return nextNode;
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
focusPrevious(opts: FocusManagerOptions = {}) {
|
|
124
|
+
const root = ref();
|
|
125
|
+
if (!root) return null;
|
|
126
|
+
const {
|
|
127
|
+
from,
|
|
128
|
+
tabbable = defaultOptions.tabbable,
|
|
129
|
+
wrap = defaultOptions.wrap,
|
|
130
|
+
accept = defaultOptions.accept,
|
|
131
|
+
} = opts;
|
|
132
|
+
const node = from || getActiveElement(getOwnerDocument(root));
|
|
133
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
134
|
+
if (node && root.contains(node)) {
|
|
135
|
+
walker.currentNode = node;
|
|
136
|
+
} else {
|
|
137
|
+
const next = lastFocusable(walker);
|
|
138
|
+
if (next) {
|
|
139
|
+
focusSafely(next);
|
|
140
|
+
}
|
|
141
|
+
return next;
|
|
142
|
+
}
|
|
143
|
+
let previousNode = walker.previousNode() as HTMLElement | null;
|
|
144
|
+
if (!previousNode && wrap) {
|
|
145
|
+
walker.currentNode = root;
|
|
146
|
+
const lastNode = lastFocusable(walker);
|
|
147
|
+
if (!lastNode) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
previousNode = lastNode;
|
|
151
|
+
}
|
|
152
|
+
if (previousNode) {
|
|
153
|
+
focusSafely(previousNode);
|
|
154
|
+
}
|
|
155
|
+
return previousNode;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
focusFirst(opts: FocusManagerOptions = {}) {
|
|
159
|
+
const root = ref();
|
|
160
|
+
if (!root) return null;
|
|
161
|
+
const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;
|
|
162
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
163
|
+
const nextNode = walker.nextNode() as HTMLElement | null;
|
|
164
|
+
if (nextNode) {
|
|
165
|
+
focusSafely(nextNode);
|
|
166
|
+
}
|
|
167
|
+
return nextNode;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
focusLast(opts: FocusManagerOptions = {}) {
|
|
171
|
+
const root = ref();
|
|
172
|
+
if (!root) return null;
|
|
173
|
+
const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;
|
|
174
|
+
const walker = getFocusableTreeWalker(root, { tabbable, accept });
|
|
175
|
+
const next = lastFocusable(walker);
|
|
176
|
+
if (next) {
|
|
177
|
+
focusSafely(next);
|
|
178
|
+
}
|
|
179
|
+
return next;
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
65
184
|
const FocusScopeContext = createContext<FocusScopeContextValue | null>(null);
|
|
66
185
|
|
|
67
186
|
/**
|
|
@@ -107,17 +226,6 @@ function isElementInScope(element: Element | null, scope: Element[]): boolean {
|
|
|
107
226
|
return scope.some((node) => node.contains(element));
|
|
108
227
|
}
|
|
109
228
|
|
|
110
|
-
/**
|
|
111
|
-
* Gets the active element, accounting for shadow DOM.
|
|
112
|
-
*/
|
|
113
|
-
function getActiveElement(doc: Document): Element | null {
|
|
114
|
-
let activeElement = doc.activeElement;
|
|
115
|
-
while (activeElement?.shadowRoot?.activeElement) {
|
|
116
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
|
117
|
-
}
|
|
118
|
-
return activeElement;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
229
|
/**
|
|
122
230
|
* A scope is identified by its (stable) scope-elements accessor; `null` is the
|
|
123
231
|
* tree root. Mirrors @react-aria/focus's `ScopeRef`.
|
package/src/focus/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export {
|
|
2
2
|
FocusScope,
|
|
3
3
|
useFocusManager,
|
|
4
|
+
createFocusManager,
|
|
4
5
|
type FocusScopeProps,
|
|
5
6
|
type FocusManager,
|
|
6
7
|
type FocusManagerOptions,
|
|
@@ -22,6 +23,13 @@ export {
|
|
|
22
23
|
type VirtualFocusResult,
|
|
23
24
|
} from "./createVirtualFocus";
|
|
24
25
|
|
|
26
|
+
export {
|
|
27
|
+
moveVirtualFocus,
|
|
28
|
+
dispatchVirtualBlur,
|
|
29
|
+
dispatchVirtualFocus,
|
|
30
|
+
getVirtuallyFocusedElement,
|
|
31
|
+
} from "./virtualFocus";
|
|
32
|
+
|
|
25
33
|
export {
|
|
26
34
|
createAutoFocus,
|
|
27
35
|
clearAutoFocusQueue,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual-focus event dispatch primitives.
|
|
3
|
+
*
|
|
4
|
+
* A faithful port of @react-aria/focus's `virtualFocus` module. Under virtual
|
|
5
|
+
* focus (e.g. Autocomplete), real DOM focus stays on an input while the
|
|
6
|
+
* "focused" collection option is indicated by `aria-activedescendant`. Moving
|
|
7
|
+
* that virtual cursor dispatches synthetic `focus`/`blur` events (with matching
|
|
8
|
+
* bubbling `focusin`/`focusout`) on the option elements so listeners — notably
|
|
9
|
+
* the autocomplete input's `focusin` handler that mirrors the active descendant
|
|
10
|
+
* — react as if the element were really focused.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { getActiveElement, getOwnerDocument } from "../utils/dom";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Moves virtual focus to `to`, dispatching a virtual blur on the previously
|
|
17
|
+
* virtually-focused element (if any) and a virtual focus on `to` (if non-null).
|
|
18
|
+
*/
|
|
19
|
+
export function moveVirtualFocus(to: Element | null): void {
|
|
20
|
+
const from = getVirtuallyFocusedElement(getOwnerDocument(to));
|
|
21
|
+
if (from !== to) {
|
|
22
|
+
if (from) {
|
|
23
|
+
dispatchVirtualBlur(from, to);
|
|
24
|
+
}
|
|
25
|
+
if (to) {
|
|
26
|
+
dispatchVirtualFocus(to, from);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Dispatches synthetic `blur` + bubbling `focusout` events on `from`. */
|
|
32
|
+
export function dispatchVirtualBlur(from: Element, to: Element | null): void {
|
|
33
|
+
from.dispatchEvent(new FocusEvent("blur", { relatedTarget: to }));
|
|
34
|
+
from.dispatchEvent(new FocusEvent("focusout", { bubbles: true, relatedTarget: to }));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Dispatches synthetic `focus` + bubbling `focusin` events on `to`. */
|
|
38
|
+
export function dispatchVirtualFocus(to: Element, from: Element | null): void {
|
|
39
|
+
to.dispatchEvent(new FocusEvent("focus", { relatedTarget: from }));
|
|
40
|
+
to.dispatchEvent(new FocusEvent("focusin", { bubbles: true, relatedTarget: from }));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the currently virtually-focused element: the element referenced by the
|
|
45
|
+
* active element's `aria-activedescendant`, or the active element itself.
|
|
46
|
+
*/
|
|
47
|
+
export function getVirtuallyFocusedElement(document: Document): Element | null {
|
|
48
|
+
const activeElement = getActiveElement(document);
|
|
49
|
+
const activeDescendant = activeElement?.getAttribute("aria-activedescendant");
|
|
50
|
+
if (activeDescendant) {
|
|
51
|
+
return document.getElementById(activeDescendant) || activeElement;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return activeElement;
|
|
55
|
+
}
|
|
@@ -151,12 +151,21 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
151
151
|
}
|
|
152
152
|
case "ArrowRight":
|
|
153
153
|
case "ArrowLeft": {
|
|
154
|
-
//
|
|
155
|
-
// navigation
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
|
|
154
|
+
// The inline axis (Left/Right) belongs to the ROW under the default
|
|
155
|
+
// "arrow" navigation behavior: createGridListItem's onKeyDownCapture
|
|
156
|
+
// intercepts Left/Right for intra-row focus movement (a no-op for
|
|
157
|
+
// text-only rows), exactly as useGridListItem does upstream, so the
|
|
158
|
+
// container must NOT step between rows here. Only under "tab" navigation
|
|
159
|
+
// does the row stop intercepting and the event reach the collection —
|
|
160
|
+
// mirroring how useSelectableCollection handles Left/Right via
|
|
161
|
+
// ListKeyboardDelegate. Even then it strips getKeyLeftOf/getKeyRightOf
|
|
162
|
+
// for a vertical stack, so this stays a no-op unless the stack is
|
|
163
|
+
// horizontal, where Right=next / Left=prev in LTR, flipped under RTL.
|
|
164
|
+
// (In Solid the row's capture-phase stopPropagation does not reliably
|
|
165
|
+
// prevent the container's delegated onKeyDown, so this gate — not the
|
|
166
|
+
// row's stopPropagation — is what keeps the axes from double-firing.)
|
|
167
|
+
const behavior = p.keyboardNavigationBehavior ?? "arrow";
|
|
168
|
+
if (p.orientation !== "horizontal" || behavior !== "tab") break;
|
|
160
169
|
e.preventDefault();
|
|
161
170
|
const isRtl = p.direction === "rtl";
|
|
162
171
|
const forward = e.key === "ArrowRight" ? !isRtl : isRtl;
|
|
@@ -217,18 +226,41 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
217
226
|
}
|
|
218
227
|
};
|
|
219
228
|
|
|
220
|
-
|
|
229
|
+
// Focus marshalling — the grid container is a trampoline. Its roving tabIndex
|
|
230
|
+
// is 0 only while `focusedKey == null` (see gridProps below), so a Tab that
|
|
231
|
+
// reaches a standalone grid lands on the container itself; move the focused key
|
|
232
|
+
// onto the first/last row and the post-commit effect below pulls REAL DOM focus
|
|
233
|
+
// there while the container rolls to tabIndex -1. This mirrors
|
|
234
|
+
// useSelectableCollection's `onFocus` — the same direction-aware trampoline the
|
|
235
|
+
// standalone ListBox uses (createListBox.ts) — and is why a standalone grid
|
|
236
|
+
// announces the active row through real focus, never `aria-activedescendant`.
|
|
237
|
+
const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {
|
|
221
238
|
const s = state();
|
|
239
|
+
const p = props();
|
|
222
240
|
s.setFocused(true);
|
|
223
241
|
|
|
224
|
-
//
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
242
|
+
// onFocus is non-bubbling in Solid, so this fires only when the container
|
|
243
|
+
// itself receives focus; ignore anything that bubbled from a descendant.
|
|
244
|
+
// (`currentTarget` is null only in synthetic unit-test FocusEvents — treat
|
|
245
|
+
// those as a direct container focus.)
|
|
246
|
+
const container = e.currentTarget as HTMLElement | null;
|
|
247
|
+
if (container && !container.contains(e.target as Node)) return;
|
|
248
|
+
// Only marshal when no row is focused yet.
|
|
249
|
+
if (s.focusedKey != null || p.isDisabled) return;
|
|
250
|
+
|
|
251
|
+
const collection = s.collection;
|
|
252
|
+
const relatedTarget = e.relatedTarget as Element | null;
|
|
253
|
+
// Detect tab direction: focus arriving from an element that FOLLOWS the grid
|
|
254
|
+
// in document order means the user shift-tabbed backward into it, so enter at
|
|
255
|
+
// the LAST row; otherwise (forward Tab, or programmatic) enter at the FIRST.
|
|
256
|
+
const enterKey =
|
|
257
|
+
relatedTarget &&
|
|
258
|
+
container &&
|
|
259
|
+
container.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
260
|
+
? findNextNavigableKey(s, collection.getLastKey(), (k) => collection.getKeyBefore(k))
|
|
261
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
262
|
+
if (enterKey != null) {
|
|
263
|
+
s.setFocusedKey(enterKey);
|
|
232
264
|
}
|
|
233
265
|
};
|
|
234
266
|
|
|
@@ -287,7 +319,11 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
287
319
|
"aria-describedby": p["aria-describedby"],
|
|
288
320
|
"aria-multiselectable": s.selectionMode === "multiple" ? true : undefined,
|
|
289
321
|
"aria-disabled": p.isDisabled || undefined,
|
|
290
|
-
|
|
322
|
+
// Roving container tabIndex mirrors useSelectableCollection: the container
|
|
323
|
+
// is tabbable (0) only while nothing is focused, then rolls to -1 once a row
|
|
324
|
+
// takes focus so Tab exits the grid. A standalone grid drives AT through
|
|
325
|
+
// real row focus, so it never needs (nor emits) aria-activedescendant.
|
|
326
|
+
tabIndex: p.isDisabled ? undefined : s.focusedKey != null ? -1 : 0,
|
|
291
327
|
onKeyDown,
|
|
292
328
|
onFocus,
|
|
293
329
|
onBlur,
|
package/src/index.ts
CHANGED
|
@@ -327,6 +327,7 @@ export {
|
|
|
327
327
|
export {
|
|
328
328
|
FocusScope,
|
|
329
329
|
useFocusManager,
|
|
330
|
+
createFocusManager,
|
|
330
331
|
type FocusScopeProps,
|
|
331
332
|
type FocusManager,
|
|
332
333
|
type FocusManagerOptions,
|
|
@@ -340,6 +341,10 @@ export {
|
|
|
340
341
|
createVirtualFocus,
|
|
341
342
|
type VirtualFocusOptions,
|
|
342
343
|
type VirtualFocusResult,
|
|
344
|
+
moveVirtualFocus,
|
|
345
|
+
dispatchVirtualBlur,
|
|
346
|
+
dispatchVirtualFocus,
|
|
347
|
+
getVirtuallyFocusedElement,
|
|
343
348
|
createAutoFocus,
|
|
344
349
|
clearAutoFocusQueue,
|
|
345
350
|
getAutoFocusQueueLength,
|
|
@@ -405,9 +410,6 @@ export {
|
|
|
405
410
|
createTimeField,
|
|
406
411
|
type AriaTimeFieldProps,
|
|
407
412
|
type TimeFieldAria,
|
|
408
|
-
createTimeSegment,
|
|
409
|
-
type AriaTimeSegmentProps,
|
|
410
|
-
type TimeSegmentAria,
|
|
411
413
|
createDatePicker,
|
|
412
414
|
createDateRangePicker,
|
|
413
415
|
type AriaDatePickerProps,
|
|
@@ -516,6 +518,10 @@ export {
|
|
|
516
518
|
createDroppableCollection,
|
|
517
519
|
createDraggableItem,
|
|
518
520
|
createDroppableItem,
|
|
521
|
+
createDragSession,
|
|
522
|
+
isVirtualDragging,
|
|
523
|
+
registerDropItem,
|
|
524
|
+
dndIntlStrings,
|
|
519
525
|
setGlobalDraggingCollectionRef,
|
|
520
526
|
getGlobalDraggingCollectionRef,
|
|
521
527
|
setGlobalDraggingKeys,
|
|
@@ -537,6 +543,8 @@ export {
|
|
|
537
543
|
type DraggableItemAria,
|
|
538
544
|
type DroppableItemOptions,
|
|
539
545
|
type DroppableItemAria,
|
|
546
|
+
type DragSession,
|
|
547
|
+
type DndIntlStrings,
|
|
540
548
|
CUSTOM_DRAG_TYPE,
|
|
541
549
|
NATIVE_DRAG_TYPES,
|
|
542
550
|
GENERIC_TYPE,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This is a 1-1 port of React-Aria's FocusableProvider adapted for SolidJS.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { JSX, ParentComponent } from "solid-js";
|
|
7
|
+
import { JSX, mergeProps, ParentComponent, splitProps } from "solid-js";
|
|
8
8
|
import { FocusableContext, FocusableContextValue, FocusableProviderProps } from "./createFocusable";
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -27,14 +27,19 @@ import { FocusableContext, FocusableContextValue, FocusableProviderProps } from
|
|
|
27
27
|
export const FocusableProvider: ParentComponent<
|
|
28
28
|
FocusableProviderProps & JSX.HTMLAttributes<HTMLElement>
|
|
29
29
|
> = (props) => {
|
|
30
|
-
const { children, ...otherProps } = props
|
|
30
|
+
// Don't destructure: `const { children, ...otherProps } = props` evaluates the
|
|
31
|
+
// `children` getter immediately (2nd statement of the body), instantiating the
|
|
32
|
+
// nested subtree BEFORE this provider mounts — so a child that reads
|
|
33
|
+
// FocusableContext during its own setup would miss us. splitProps keeps
|
|
34
|
+
// otherProps a reactive proxy; children is read lazily inside the JSX, under
|
|
35
|
+
// the mounted provider. Same pattern as solidaria-components' useRenderProps.
|
|
36
|
+
const [, otherProps] = splitProps(props, ["children"]);
|
|
31
37
|
|
|
32
|
-
const context
|
|
33
|
-
...otherProps,
|
|
38
|
+
const context = mergeProps(otherProps, {
|
|
34
39
|
ref: (_el: HTMLElement) => {
|
|
35
40
|
// Store ref if needed by parent
|
|
36
41
|
},
|
|
37
|
-
};
|
|
42
|
+
}) as FocusableContextValue;
|
|
38
43
|
|
|
39
|
-
return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;
|
|
44
|
+
return <FocusableContext.Provider value={context}>{props.children}</FocusableContext.Provider>;
|
|
40
45
|
};
|
|
@@ -102,8 +102,10 @@ function createSyntheticBlurHandler(): (
|
|
|
102
102
|
* Based on react-aria's useFocus but adapted for SolidJS.
|
|
103
103
|
*/
|
|
104
104
|
export function createFocus(props: CreateFocusProps = {}): FocusResult {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
// Read isDisabled/handlers off `props` directly (not via destructure): a Solid
|
|
106
|
+
// hook body runs once, so a destructure would freeze them at call time. The
|
|
107
|
+
// handlers read props.x live and the returned props are getters, mirroring
|
|
108
|
+
// upstream useFocus's per-render re-read. guard:idiomatic-solid.
|
|
107
109
|
let cleanupRef: (() => void) | undefined;
|
|
108
110
|
const syntheticBlurHandler = createSyntheticBlurHandler();
|
|
109
111
|
|
|
@@ -117,12 +119,12 @@ export function createFocus(props: CreateFocusProps = {}): FocusResult {
|
|
|
117
119
|
const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {
|
|
118
120
|
// Only handle if target is the currentTarget (not bubbled from children)
|
|
119
121
|
if (e.target === e.currentTarget) {
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
+
if (props.onBlur) {
|
|
123
|
+
props.onBlur(e);
|
|
122
124
|
}
|
|
123
125
|
|
|
124
|
-
if (onFocusChange) {
|
|
125
|
-
onFocusChange(false);
|
|
126
|
+
if (props.onFocusChange) {
|
|
127
|
+
props.onFocusChange(false);
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
cleanupRef?.();
|
|
@@ -137,12 +139,12 @@ export function createFocus(props: CreateFocusProps = {}): FocusResult {
|
|
|
137
139
|
const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;
|
|
138
140
|
|
|
139
141
|
if (e.target === e.currentTarget && activeElement === getEventTarget(e)) {
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
+
if (props.onFocus) {
|
|
143
|
+
props.onFocus(e);
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
if (onFocusChange) {
|
|
145
|
-
onFocusChange(true);
|
|
146
|
+
if (props.onFocusChange) {
|
|
147
|
+
props.onFocusChange(true);
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
// Set up synthetic blur handler for Firefox bug
|
|
@@ -150,19 +152,22 @@ export function createFocus(props: CreateFocusProps = {}): FocusResult {
|
|
|
150
152
|
}
|
|
151
153
|
};
|
|
152
154
|
|
|
153
|
-
// If disabled or no handlers, return empty props
|
|
154
|
-
|
|
155
|
-
return {
|
|
156
|
-
focusProps: {},
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const hasHandlers = onFocusProp || onFocusChange || onBlurProp;
|
|
161
|
-
|
|
155
|
+
// If disabled or no handlers, return empty props. Getters re-read props so a
|
|
156
|
+
// later isDisabled/handler change is reflected (the body itself runs once).
|
|
162
157
|
return {
|
|
163
158
|
focusProps: {
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
get onFocus() {
|
|
160
|
+
if (props.isDisabled) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
return props.onFocus || props.onFocusChange || props.onBlur ? onFocus : undefined;
|
|
164
|
+
},
|
|
165
|
+
get onBlur() {
|
|
166
|
+
if (props.isDisabled) {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
return props.onBlur || props.onFocusChange ? onBlur : undefined;
|
|
170
|
+
},
|
|
166
171
|
},
|
|
167
172
|
};
|
|
168
173
|
}
|
|
@@ -92,7 +92,11 @@ function createSyntheticBlurHandler(): (
|
|
|
92
92
|
* Based on react-aria's useFocusWithin but adapted for SolidJS.
|
|
93
93
|
*/
|
|
94
94
|
export function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResult {
|
|
95
|
-
|
|
95
|
+
// Read isDisabled/handlers off `props` directly (not via destructure): a Solid
|
|
96
|
+
// hook body runs once, so destructuring would freeze them at call time and drop
|
|
97
|
+
// reactive updates — createOverlay/createVisuallyHidden pass a live isDisabled
|
|
98
|
+
// getter. The handlers below read props.x live; the return is getter-based so a
|
|
99
|
+
// later isDisabled flip re-computes. Mirrors upstream useFocusWithin's re-read.
|
|
96
100
|
|
|
97
101
|
// State tracking
|
|
98
102
|
let isFocusWithin = false;
|
|
@@ -123,12 +127,12 @@ export function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResu
|
|
|
123
127
|
cleanupRef?.();
|
|
124
128
|
cleanupRef = undefined;
|
|
125
129
|
|
|
126
|
-
if (onBlurWithin) {
|
|
127
|
-
onBlurWithin(e);
|
|
130
|
+
if (props.onBlurWithin) {
|
|
131
|
+
props.onBlurWithin(e);
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
if (onFocusWithinChange) {
|
|
131
|
-
onFocusWithinChange(false);
|
|
134
|
+
if (props.onFocusWithinChange) {
|
|
135
|
+
props.onFocusWithinChange(false);
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
};
|
|
@@ -145,12 +149,12 @@ export function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResu
|
|
|
145
149
|
const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;
|
|
146
150
|
|
|
147
151
|
if (!isFocusWithin && activeElement === getEventTarget(e)) {
|
|
148
|
-
if (onFocusWithin) {
|
|
149
|
-
onFocusWithin(e);
|
|
152
|
+
if (props.onFocusWithin) {
|
|
153
|
+
props.onFocusWithin(e);
|
|
150
154
|
}
|
|
151
155
|
|
|
152
|
-
if (onFocusWithinChange) {
|
|
153
|
-
onFocusWithinChange(true);
|
|
156
|
+
if (props.onFocusWithinChange) {
|
|
157
|
+
props.onFocusWithinChange(true);
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
isFocusWithin = true;
|
|
@@ -179,12 +183,12 @@ export function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResu
|
|
|
179
183
|
isFocusWithin = false;
|
|
180
184
|
removeAllGlobalListeners();
|
|
181
185
|
|
|
182
|
-
if (onBlurWithin) {
|
|
183
|
-
onBlurWithin(nativeEvent);
|
|
186
|
+
if (props.onBlurWithin) {
|
|
187
|
+
props.onBlurWithin(nativeEvent);
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
if (onFocusWithinChange) {
|
|
187
|
-
onFocusWithinChange(false);
|
|
190
|
+
if (props.onFocusWithinChange) {
|
|
191
|
+
props.onFocusWithinChange(false);
|
|
188
192
|
}
|
|
189
193
|
cleanupRef?.();
|
|
190
194
|
cleanupRef = undefined;
|
|
@@ -196,19 +200,14 @@ export function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResu
|
|
|
196
200
|
}
|
|
197
201
|
};
|
|
198
202
|
|
|
199
|
-
if (isDisabled) {
|
|
200
|
-
return {
|
|
201
|
-
focusWithinProps: {
|
|
202
|
-
onFocus: undefined,
|
|
203
|
-
onBlur: undefined,
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
203
|
return {
|
|
209
204
|
focusWithinProps: {
|
|
210
|
-
onFocus
|
|
211
|
-
|
|
205
|
+
get onFocus() {
|
|
206
|
+
return props.isDisabled ? undefined : onFocus;
|
|
207
|
+
},
|
|
208
|
+
get onBlur() {
|
|
209
|
+
return props.isDisabled ? undefined : onBlur;
|
|
210
|
+
},
|
|
212
211
|
},
|
|
213
212
|
};
|
|
214
213
|
}
|
|
@@ -361,11 +361,13 @@ export function createFocusVisible(props: FocusVisibleProps = {}): FocusVisibleR
|
|
|
361
361
|
return { isFocusVisible: () => false };
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
// autoFocus seeds the initial value once; isTextInput is read inside the effect
|
|
365
|
+
// so it re-subscribes reactively (a top-level destructure would freeze it — the
|
|
366
|
+
// body runs once). Mirrors upstream useFocusVisible's [isTextInput] dep.
|
|
367
|
+
const [isVisible, setIsVisible] = createSignal<boolean>(props.autoFocus || isFocusVisible());
|
|
366
368
|
|
|
367
369
|
createEffect(() => {
|
|
368
|
-
const cleanup = createFocusVisibleListener(setIsVisible, { isTextInput });
|
|
370
|
+
const cleanup = createFocusVisibleListener(setIsVisible, { isTextInput: props.isTextInput });
|
|
369
371
|
onCleanup(cleanup);
|
|
370
372
|
});
|
|
371
373
|
|