@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
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* createDateField hook for Solidaria
|
|
3
3
|
*
|
|
4
|
-
* Provides the behavior and accessibility implementation for a date field
|
|
5
|
-
*
|
|
4
|
+
* Provides the behavior and accessibility implementation for a date field — a
|
|
5
|
+
* segmented spinbutton text input (NOT a calendar grid). Faithful port of
|
|
6
|
+
* @react-aria/datepicker `useDateField`: `fieldProps` IS the labelled
|
|
7
|
+
* `role="group"` that wraps the segments, `inputProps` describes a hidden native
|
|
8
|
+
* `<input>` for form submission, and segment labels/description/focus manager are
|
|
9
|
+
* published to each segment through the shared `hookData` WeakMap.
|
|
6
10
|
*/
|
|
7
11
|
|
|
8
|
-
import { createMemo } from "solid-js";
|
|
9
|
-
import { createId } from "../ssr";
|
|
10
|
-
import { createLabel } from "../label/createLabel";
|
|
12
|
+
import { createMemo, onMount } from "solid-js";
|
|
11
13
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
12
14
|
import { mergeProps } from "../utils/mergeProps";
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
+
import { filterDOMProps } from "../utils/filterDOMProps";
|
|
16
|
+
import { createField } from "../label/createField";
|
|
17
|
+
import { createDescription } from "../utils/createDescription";
|
|
18
|
+
import { createFocusWithin } from "../interactions/createFocusWithin";
|
|
19
|
+
import { createFocusManager, type FocusManager } from "../focus/FocusScope";
|
|
20
|
+
import { createStringFormatter } from "../i18n";
|
|
21
|
+
import { createFormValidation } from "../form/createFormValidation";
|
|
22
|
+
import { createFormReset } from "../form/createFormReset";
|
|
23
|
+
import { datePickerStrings } from "./intl";
|
|
24
|
+
import { createDatePickerGroup } from "./createDatePickerGroup";
|
|
25
|
+
import type { DateFieldState } from "@proyecto-viviana/solid-stately";
|
|
26
|
+
|
|
27
|
+
// Shared channel between the field and its segments. Unlike upstream (which stores
|
|
28
|
+
// plain strings and re-runs the hook every render), `ariaDescribedBy` is stored as
|
|
29
|
+
// an accessor so segments pick up the description id once `createDescription`'s
|
|
30
|
+
// deferred effect has appended its hidden node.
|
|
31
|
+
export const hookData = new WeakMap<
|
|
32
|
+
object,
|
|
33
|
+
{
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
ariaLabelledBy?: string;
|
|
36
|
+
ariaDescribedBy?: () => string | undefined;
|
|
37
|
+
focusManager: FocusManager;
|
|
38
|
+
}
|
|
39
|
+
>();
|
|
40
|
+
|
|
41
|
+
// Symbols used by DatePicker/DateRangePicker to make a nested date field
|
|
42
|
+
// role="presentation" and to inject a shared focus manager. Standalone fields
|
|
43
|
+
// never receive them.
|
|
44
|
+
export const roleSymbol = "__role_" + Date.now();
|
|
45
|
+
export const focusManagerSymbol = "__focusManager_" + Date.now();
|
|
15
46
|
|
|
16
47
|
export interface AriaDateFieldProps {
|
|
17
48
|
/** An ID for the date field. */
|
|
@@ -24,6 +55,10 @@ export interface AriaDateFieldProps {
|
|
|
24
55
|
"aria-labelledby"?: string;
|
|
25
56
|
/** The ID of an element that describes the date field. */
|
|
26
57
|
"aria-describedby"?: string;
|
|
58
|
+
/** Description text. */
|
|
59
|
+
description?: string;
|
|
60
|
+
/** Error message. */
|
|
61
|
+
errorMessage?: string | string[];
|
|
27
62
|
/** Whether the date field is disabled. */
|
|
28
63
|
isDisabled?: boolean;
|
|
29
64
|
/** Whether the date field is read-only. */
|
|
@@ -32,261 +67,235 @@ export interface AriaDateFieldProps {
|
|
|
32
67
|
isRequired?: boolean;
|
|
33
68
|
/** Whether the date field is invalid. */
|
|
34
69
|
isInvalid?: boolean;
|
|
35
|
-
/** Description text. */
|
|
36
|
-
description?: string;
|
|
37
|
-
/** Error message. */
|
|
38
|
-
errorMessage?: string;
|
|
39
70
|
/** Whether the element should receive focus on mount. */
|
|
40
71
|
autoFocus?: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
72
|
+
/** The name of the hidden input used for form submission. */
|
|
73
|
+
name?: string;
|
|
74
|
+
/** The `<form>` the hidden input is associated with. */
|
|
75
|
+
form?: string;
|
|
76
|
+
/** Ref to the hidden input element, for form reset/validation. */
|
|
77
|
+
inputRef?: () => HTMLInputElement | undefined;
|
|
78
|
+
/** Whether HTML form validation is used. */
|
|
79
|
+
validationBehavior?: "aria" | "native";
|
|
80
|
+
onFocus?: (e: FocusEvent) => void;
|
|
81
|
+
onBlur?: (e: FocusEvent) => void;
|
|
82
|
+
onFocusChange?: (isFocused: boolean) => void;
|
|
83
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
84
|
+
onKeyUp?: (e: KeyboardEvent) => void;
|
|
85
|
+
/** @internal presentation-role marker (set by DatePicker). */
|
|
86
|
+
[key: string]: unknown;
|
|
52
87
|
}
|
|
53
88
|
|
|
54
89
|
export interface DateFieldAria {
|
|
55
90
|
/** Props for the label element. */
|
|
56
91
|
labelProps: Record<string, unknown>;
|
|
57
|
-
/** Props for the field
|
|
92
|
+
/** Props for the field group element (wraps the segments). */
|
|
58
93
|
fieldProps: Record<string, unknown>;
|
|
59
|
-
/** Props for the
|
|
94
|
+
/** Props for the hidden native input element. */
|
|
60
95
|
inputProps: Record<string, unknown>;
|
|
61
96
|
/** Props for the description element. */
|
|
62
97
|
descriptionProps: Record<string, unknown>;
|
|
63
98
|
/** Props for the error message element. */
|
|
64
99
|
errorMessageProps: Record<string, unknown>;
|
|
65
|
-
/**
|
|
66
|
-
|
|
100
|
+
/** Whether the field is currently invalid. */
|
|
101
|
+
isInvalid: boolean;
|
|
102
|
+
/** The current error messages for the field, if invalid. */
|
|
103
|
+
validationErrors: string[];
|
|
104
|
+
/** The native validity state for the field. */
|
|
105
|
+
validationDetails: ValidityState;
|
|
67
106
|
}
|
|
68
107
|
|
|
69
108
|
/**
|
|
70
|
-
* Provides the behavior and accessibility implementation for a date field
|
|
109
|
+
* Provides the behavior and accessibility implementation for a date field.
|
|
71
110
|
*/
|
|
72
111
|
export function createDateField<T extends DateFieldState>(
|
|
73
112
|
props: MaybeAccessor<AriaDateFieldProps>,
|
|
74
113
|
state: T,
|
|
75
|
-
|
|
76
|
-
overlayState?: DatePickerOverlayState,
|
|
114
|
+
ref: () => HTMLElement | null,
|
|
77
115
|
): DateFieldAria {
|
|
78
116
|
const getProps = () => access(props);
|
|
79
|
-
const id = createId(getProps().id);
|
|
80
|
-
const descriptionId = createId();
|
|
81
|
-
const errorMessageId = createId();
|
|
82
|
-
const locale = useLocale();
|
|
83
117
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
118
|
+
const isPresentation = () => getProps()[roleSymbol] === "presentation";
|
|
119
|
+
|
|
120
|
+
const field = createField(() => {
|
|
121
|
+
const p = getProps();
|
|
122
|
+
const dv = state.displayValidation();
|
|
123
|
+
return {
|
|
124
|
+
id: p.id,
|
|
125
|
+
label: p.label,
|
|
126
|
+
"aria-label": p["aria-label"],
|
|
127
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
128
|
+
"aria-describedby": p["aria-describedby"],
|
|
129
|
+
description: p.description,
|
|
130
|
+
labelElementType: "span",
|
|
131
|
+
isInvalid: dv.isInvalid,
|
|
132
|
+
errorMessage: p.errorMessage || dv.validationErrors,
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Track the value on focus so we only commit validation when it actually changed.
|
|
137
|
+
let valueOnFocus: unknown = null;
|
|
138
|
+
const { focusWithinProps } = createFocusWithin({
|
|
139
|
+
get isDisabled() {
|
|
140
|
+
return getProps().isDisabled;
|
|
141
|
+
},
|
|
142
|
+
onFocusWithin(e) {
|
|
143
|
+
valueOnFocus = state.value();
|
|
144
|
+
getProps().onFocus?.(e);
|
|
88
145
|
},
|
|
89
|
-
|
|
90
|
-
|
|
146
|
+
onBlurWithin(e) {
|
|
147
|
+
state.confirmPlaceholder();
|
|
148
|
+
if (state.value() !== valueOnFocus) {
|
|
149
|
+
state.commitValidation();
|
|
150
|
+
}
|
|
151
|
+
getProps().onBlur?.(e);
|
|
91
152
|
},
|
|
92
|
-
|
|
93
|
-
|
|
153
|
+
onFocusWithinChange(isFocused) {
|
|
154
|
+
getProps().onFocusChange?.(isFocused);
|
|
94
155
|
},
|
|
95
|
-
labelElementType: "span",
|
|
96
156
|
});
|
|
97
157
|
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
ids.push(p["aria-describedby"]);
|
|
104
|
-
}
|
|
105
|
-
if (p.description) {
|
|
106
|
-
ids.push(descriptionId);
|
|
158
|
+
const stringFormatter = createStringFormatter(datePickerStrings, "@react-aria/datepicker");
|
|
159
|
+
const description = createMemo(() => {
|
|
160
|
+
const value = state.value();
|
|
161
|
+
if (!value) {
|
|
162
|
+
return "";
|
|
107
163
|
}
|
|
108
|
-
|
|
109
|
-
|
|
164
|
+
const message =
|
|
165
|
+
state.maxGranularity === "hour" ? "selectedTimeDescription" : "selectedDateDescription";
|
|
166
|
+
const fieldKey = state.maxGranularity === "hour" ? "time" : "date";
|
|
167
|
+
return stringFormatter().format(message, {
|
|
168
|
+
[fieldKey]: state.formatValue({ month: "long" }),
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
const descProps = createDescription(description);
|
|
172
|
+
|
|
173
|
+
// Within a date picker the field is role="presentation" and inherits the
|
|
174
|
+
// picker's own describedby; standalone it appends its own value description.
|
|
175
|
+
const describedBy = (): string | undefined => {
|
|
176
|
+
const fp = field.fieldProps as Record<string, string | undefined>;
|
|
177
|
+
if (isPresentation()) {
|
|
178
|
+
return fp["aria-describedby"];
|
|
110
179
|
}
|
|
111
|
-
return
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
// Segments from state
|
|
115
|
-
const segments = createMemo(() => state.segments());
|
|
116
|
-
|
|
117
|
-
// Label ID for linking input to label
|
|
118
|
-
const getLabelId = () => (labelProps as Record<string, string | undefined>).id;
|
|
119
|
-
|
|
120
|
-
// Localized role description
|
|
121
|
-
const getRoleDescription = () => {
|
|
122
|
-
const language = locale().locale.toLowerCase().split("-")[0] ?? "en";
|
|
123
|
-
return language === "es" ? "Campo de fecha" : "Date field";
|
|
180
|
+
return [descProps["aria-describedby"], fp["aria-describedby"]].filter(Boolean).join(" ") || undefined;
|
|
124
181
|
};
|
|
125
182
|
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
183
|
+
const propsFocusManager = getProps()[focusManagerSymbol] as FocusManager | undefined;
|
|
184
|
+
const focusManager = propsFocusManager || createFocusManager(ref);
|
|
185
|
+
|
|
186
|
+
const groupProps = createDatePickerGroup(
|
|
187
|
+
state as unknown as { setOpen?: (isOpen: boolean) => void },
|
|
188
|
+
ref,
|
|
189
|
+
isPresentation(),
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
// Publish labels and the focus manager to the segments.
|
|
193
|
+
const labelId = (field.labelProps as Record<string, string | undefined>).id;
|
|
194
|
+
hookData.set(state as unknown as object, {
|
|
195
|
+
ariaLabel: getProps()["aria-label"],
|
|
196
|
+
ariaLabelledBy: [labelId, getProps()["aria-labelledby"]].filter(Boolean).join(" ") || undefined,
|
|
197
|
+
ariaDescribedBy: describedBy,
|
|
198
|
+
focusManager,
|
|
199
|
+
});
|
|
138
200
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
201
|
+
// Auto focus the first segment on mount when requested.
|
|
202
|
+
onMount(() => {
|
|
203
|
+
if (getProps().autoFocus) {
|
|
204
|
+
focusManager.focusFirst();
|
|
142
205
|
}
|
|
206
|
+
});
|
|
143
207
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
208
|
+
// Form reset + native validation wiring.
|
|
209
|
+
if (props && typeof props === "object") {
|
|
210
|
+
createFormReset(
|
|
211
|
+
() => getProps().inputRef?.(),
|
|
212
|
+
state.defaultValue,
|
|
213
|
+
state.setValue as (value: unknown) => void,
|
|
214
|
+
);
|
|
215
|
+
createFormValidation(
|
|
216
|
+
{
|
|
217
|
+
get validationBehavior() {
|
|
218
|
+
return getProps().validationBehavior;
|
|
219
|
+
},
|
|
220
|
+
focus() {
|
|
221
|
+
focusManager.focusFirst();
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
state as unknown as Parameters<typeof createFormValidation>[1],
|
|
225
|
+
() => getProps().inputRef?.() as unknown as undefined,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
150
228
|
|
|
151
|
-
|
|
152
|
-
|
|
229
|
+
const fieldDOMProps = createMemo(() => {
|
|
230
|
+
if (isPresentation()) {
|
|
231
|
+
return { role: "presentation" };
|
|
153
232
|
}
|
|
154
|
-
|
|
233
|
+
return mergeProps(field.fieldProps as Record<string, unknown>, {
|
|
234
|
+
role: "group",
|
|
235
|
+
"aria-disabled": getProps().isDisabled || undefined,
|
|
236
|
+
"aria-describedby": describedBy(),
|
|
237
|
+
});
|
|
238
|
+
});
|
|
155
239
|
|
|
156
|
-
// Field container props
|
|
157
240
|
const fieldProps = createMemo(() => {
|
|
158
241
|
const p = getProps();
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
242
|
+
const domProps = filterDOMProps(p as Record<string, unknown>);
|
|
243
|
+
return mergeProps(
|
|
244
|
+
domProps as Record<string, unknown>,
|
|
245
|
+
fieldDOMProps(),
|
|
246
|
+
groupProps(),
|
|
247
|
+
// In Solid, onFocus/onBlur do not bubble, so the group (which only ever
|
|
248
|
+
// receives focus from its segment descendants) must listen via the
|
|
249
|
+
// bubbling onFocusIn/onFocusOut events instead.
|
|
250
|
+
{
|
|
251
|
+
onFocusIn: focusWithinProps.onFocus,
|
|
252
|
+
onFocusOut: focusWithinProps.onBlur,
|
|
253
|
+
},
|
|
162
254
|
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"
|
|
255
|
+
onKeyDown(e: KeyboardEvent) {
|
|
256
|
+
getProps().onKeyDown?.(e);
|
|
257
|
+
},
|
|
258
|
+
onKeyUp(e: KeyboardEvent) {
|
|
259
|
+
getProps().onKeyUp?.(e);
|
|
260
|
+
},
|
|
261
|
+
style: { unicodeBidi: "isolate" as const },
|
|
170
262
|
},
|
|
171
263
|
);
|
|
172
|
-
|
|
173
|
-
// Integrate with date picker overlay when available
|
|
174
|
-
if (overlayState) {
|
|
175
|
-
const existingOnKeyDown = baseProps.onKeyDown as ((e: KeyboardEvent) => void) | undefined;
|
|
176
|
-
|
|
177
|
-
baseProps.onKeyDown = (e: KeyboardEvent) => {
|
|
178
|
-
existingOnKeyDown?.(e);
|
|
179
|
-
if (e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
180
|
-
e.preventDefault();
|
|
181
|
-
e.stopPropagation();
|
|
182
|
-
overlayState.open();
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return baseProps;
|
|
188
264
|
});
|
|
189
265
|
|
|
190
|
-
// Input container props
|
|
191
266
|
const inputProps = createMemo(() => {
|
|
192
267
|
const p = getProps();
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
:
|
|
199
|
-
|
|
200
|
-
const isDisabled = p.isDisabled || state.isDisabled();
|
|
201
|
-
const isReadOnly = p.isReadOnly || state.isReadOnly();
|
|
202
|
-
const isRequired = p.isRequired || state.isRequired();
|
|
203
|
-
const isInvalid = p.isInvalid || state.isInvalid();
|
|
204
|
-
const hasValue = state.value() != null;
|
|
205
|
-
|
|
206
|
-
return {
|
|
207
|
-
role: "presentation",
|
|
208
|
-
"aria-labelledby": ariaLabelledBy,
|
|
209
|
-
"aria-describedby": getAriaDescribedBy(),
|
|
210
|
-
"aria-disabled": isDisabled || undefined,
|
|
211
|
-
"aria-readonly": isReadOnly || undefined,
|
|
212
|
-
"aria-required": isRequired || undefined,
|
|
213
|
-
"aria-invalid": isInvalid || undefined,
|
|
214
|
-
"aria-roledescription": getRoleDescription(),
|
|
215
|
-
autoFocus: p.autoFocus,
|
|
216
|
-
contentEditable: true,
|
|
217
|
-
suppressContentEditableWarning: true,
|
|
218
|
-
spellCheck: false,
|
|
219
|
-
autoCorrect: "off",
|
|
220
|
-
enterKeyHint: "next",
|
|
221
|
-
inputMode: "numeric" as const,
|
|
222
|
-
style: { caretColor: "transparent" },
|
|
223
|
-
"data-placeholder": !hasValue ? "true" : undefined,
|
|
224
|
-
onKeyDown: (e: KeyboardEvent) => {
|
|
225
|
-
const target = e.target as HTMLElement;
|
|
226
|
-
const currentTarget = e.currentTarget as HTMLElement;
|
|
227
|
-
|
|
228
|
-
// Only handle at the container level, not when a segment is focused
|
|
229
|
-
if (target !== currentTarget) return;
|
|
230
|
-
|
|
231
|
-
const dir = locale().direction;
|
|
232
|
-
const rtl = dir === "rtl";
|
|
233
|
-
|
|
234
|
-
switch (e.key) {
|
|
235
|
-
case "ArrowRight":
|
|
236
|
-
e.preventDefault();
|
|
237
|
-
focusSegment(rtl ? "prev" : "next", currentTarget);
|
|
238
|
-
break;
|
|
239
|
-
case "ArrowLeft":
|
|
240
|
-
e.preventDefault();
|
|
241
|
-
focusSegment(rtl ? "next" : "prev", currentTarget);
|
|
242
|
-
break;
|
|
243
|
-
case "Home":
|
|
244
|
-
e.preventDefault();
|
|
245
|
-
focusSegment("first", currentTarget);
|
|
246
|
-
break;
|
|
247
|
-
case "End":
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
focusSegment("last", currentTarget);
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
onFocus: () => {
|
|
254
|
-
// Focus state is tracked by the component layer
|
|
255
|
-
},
|
|
256
|
-
onBlur: () => {
|
|
257
|
-
state.confirmPlaceholder();
|
|
258
|
-
},
|
|
259
|
-
onClick: (e: MouseEvent) => {
|
|
260
|
-
const target = e.target as HTMLElement;
|
|
261
|
-
const currentTarget = e.currentTarget as HTMLElement;
|
|
262
|
-
|
|
263
|
-
// Only handle when clicking the container itself (empty area between segments)
|
|
264
|
-
if (target !== currentTarget) return;
|
|
265
|
-
|
|
266
|
-
const spinbuttons = Array.from(
|
|
267
|
-
currentTarget.querySelectorAll<HTMLElement>('[role="spinbutton"]'),
|
|
268
|
-
);
|
|
269
|
-
if (spinbuttons.length > 0) {
|
|
270
|
-
spinbuttons[0].focus();
|
|
271
|
-
}
|
|
272
|
-
},
|
|
268
|
+
const value = state.value();
|
|
269
|
+
const base: Record<string, unknown> = {
|
|
270
|
+
type: "hidden",
|
|
271
|
+
name: p.name,
|
|
272
|
+
form: p.form,
|
|
273
|
+
value: value?.toString() || "",
|
|
274
|
+
disabled: p.isDisabled,
|
|
273
275
|
};
|
|
276
|
+
if (p.validationBehavior === "native") {
|
|
277
|
+
// Use a hidden <input type="text"> rather than <input type="hidden"> so
|
|
278
|
+
// that an empty value blocks HTML form submission when the field is
|
|
279
|
+
// required. Mirrors @react-aria/datepicker useDateField.
|
|
280
|
+
base.type = "text";
|
|
281
|
+
base.hidden = true;
|
|
282
|
+
base.required = p.isRequired;
|
|
283
|
+
// Ignore the controlled-without-onChange warning.
|
|
284
|
+
base.onChange = () => {};
|
|
285
|
+
}
|
|
286
|
+
return base;
|
|
274
287
|
});
|
|
275
288
|
|
|
276
|
-
|
|
277
|
-
const descriptionProps = createMemo(() => ({
|
|
278
|
-
id: descriptionId,
|
|
279
|
-
}));
|
|
280
|
-
|
|
281
|
-
// Error message props
|
|
282
|
-
const errorMessageProps = createMemo(() => ({
|
|
283
|
-
id: errorMessageId,
|
|
284
|
-
role: "alert",
|
|
285
|
-
}));
|
|
289
|
+
const displayValidation = () => state.displayValidation();
|
|
286
290
|
|
|
287
291
|
return {
|
|
288
292
|
get labelProps() {
|
|
289
|
-
return
|
|
293
|
+
return {
|
|
294
|
+
...(field.labelProps as Record<string, unknown>),
|
|
295
|
+
onClick: () => {
|
|
296
|
+
focusManager.focusFirst();
|
|
297
|
+
},
|
|
298
|
+
};
|
|
290
299
|
},
|
|
291
300
|
get fieldProps() {
|
|
292
301
|
return fieldProps();
|
|
@@ -295,13 +304,19 @@ export function createDateField<T extends DateFieldState>(
|
|
|
295
304
|
return inputProps();
|
|
296
305
|
},
|
|
297
306
|
get descriptionProps() {
|
|
298
|
-
return descriptionProps
|
|
307
|
+
return field.descriptionProps as Record<string, unknown>;
|
|
299
308
|
},
|
|
300
309
|
get errorMessageProps() {
|
|
301
|
-
return errorMessageProps
|
|
310
|
+
return field.errorMessageProps as Record<string, unknown>;
|
|
311
|
+
},
|
|
312
|
+
get isInvalid() {
|
|
313
|
+
return displayValidation().isInvalid;
|
|
314
|
+
},
|
|
315
|
+
get validationErrors() {
|
|
316
|
+
return displayValidation().validationErrors;
|
|
302
317
|
},
|
|
303
|
-
get
|
|
304
|
-
return
|
|
318
|
+
get validationDetails() {
|
|
319
|
+
return displayValidation().validationDetails;
|
|
305
320
|
},
|
|
306
321
|
};
|
|
307
322
|
}
|