react-aria 3.50.0 → 3.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/index.cjs +15 -0
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.js +9 -1
- package/dist/exports/index.js.map +1 -1
- package/dist/exports/index.mjs +9 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/private/utils/domHelpers.cjs +1 -0
- package/dist/exports/private/utils/domHelpers.cjs.map +1 -1
- package/dist/exports/private/utils/domHelpers.js +2 -2
- package/dist/exports/private/utils/domHelpers.js.map +1 -1
- package/dist/exports/private/utils/domHelpers.mjs +2 -2
- package/dist/exports/private/utils/domHelpers.mjs.map +1 -1
- package/dist/exports/private/utils/platform.cjs +1 -0
- package/dist/exports/private/utils/platform.cjs.map +1 -1
- package/dist/exports/private/utils/platform.js +2 -2
- package/dist/exports/private/utils/platform.js.map +1 -1
- package/dist/exports/private/utils/platform.mjs +2 -2
- package/dist/exports/private/utils/platform.mjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs +1 -0
- package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.js +2 -2
- package/dist/exports/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs +2 -2
- package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/exports/useContextMenu.cjs +22 -0
- package/dist/exports/useContextMenu.cjs.map +1 -0
- package/dist/exports/useContextMenu.js +17 -0
- package/dist/exports/useContextMenu.js.map +1 -0
- package/dist/exports/useContextMenu.mjs +17 -0
- package/dist/exports/useContextMenu.mjs.map +1 -0
- package/dist/exports/usePreviewTrigger.cjs +22 -0
- package/dist/exports/usePreviewTrigger.cjs.map +1 -0
- package/dist/exports/usePreviewTrigger.js +17 -0
- package/dist/exports/usePreviewTrigger.js.map +1 -0
- package/dist/exports/usePreviewTrigger.mjs +17 -0
- package/dist/exports/usePreviewTrigger.mjs.map +1 -0
- package/dist/exports/useTokenField.cjs +27 -0
- package/dist/exports/useTokenField.cjs.map +1 -0
- package/dist/exports/useTokenField.js +19 -0
- package/dist/exports/useTokenField.js.map +1 -0
- package/dist/exports/useTokenField.mjs +19 -0
- package/dist/exports/useTokenField.mjs.map +1 -0
- package/dist/private/actiongroup/useActionGroup.cjs +24 -19
- package/dist/private/actiongroup/useActionGroup.cjs.map +1 -1
- package/dist/private/actiongroup/useActionGroup.js +24 -19
- package/dist/private/actiongroup/useActionGroup.js.map +1 -1
- package/dist/private/actiongroup/useActionGroup.mjs +24 -19
- package/dist/private/actiongroup/useActionGroup.mjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.cjs +2 -1
- package/dist/private/autocomplete/useAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.js +2 -1
- package/dist/private/autocomplete/useAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.mjs +2 -1
- package/dist/private/autocomplete/useAutocomplete.mjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.cjs +2 -0
- package/dist/private/breadcrumbs/useBreadcrumbItem.cjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.js +2 -0
- package/dist/private/breadcrumbs/useBreadcrumbItem.js.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.mjs +2 -0
- package/dist/private/breadcrumbs/useBreadcrumbItem.mjs.map +1 -1
- package/dist/private/button/useButton.cjs +2 -1
- package/dist/private/button/useButton.cjs.map +1 -1
- package/dist/private/button/useButton.js +2 -1
- package/dist/private/button/useButton.js.map +1 -1
- package/dist/private/button/useButton.mjs +2 -1
- package/dist/private/button/useButton.mjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.cjs +3 -0
- package/dist/private/button/useToggleButtonGroup.cjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.js +3 -0
- package/dist/private/button/useToggleButtonGroup.js.map +1 -1
- package/dist/private/button/useToggleButtonGroup.mjs +3 -0
- package/dist/private/button/useToggleButtonGroup.mjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.cjs +3 -0
- package/dist/private/calendar/useCalendarCell.cjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.js +3 -0
- package/dist/private/calendar/useCalendarCell.js.map +1 -1
- package/dist/private/calendar/useCalendarCell.mjs +3 -0
- package/dist/private/calendar/useCalendarCell.mjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.cjs +47 -52
- package/dist/private/calendar/useCalendarGrid.cjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.js +47 -52
- package/dist/private/calendar/useCalendarGrid.js.map +1 -1
- package/dist/private/calendar/useCalendarGrid.mjs +47 -52
- package/dist/private/calendar/useCalendarGrid.mjs.map +1 -1
- package/dist/private/calendar/useRangeCalendar.cjs +1 -0
- package/dist/private/calendar/useRangeCalendar.cjs.map +1 -1
- package/dist/private/calendar/useRangeCalendar.js +1 -0
- package/dist/private/calendar/useRangeCalendar.js.map +1 -1
- package/dist/private/calendar/useRangeCalendar.mjs +1 -0
- package/dist/private/calendar/useRangeCalendar.mjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.cjs +8 -3
- package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.js +8 -3
- package/dist/private/collections/CollectionBuilder.js.map +1 -1
- package/dist/private/collections/CollectionBuilder.mjs +8 -3
- package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
- package/dist/private/collections/Document.cjs +4 -0
- package/dist/private/collections/Document.cjs.map +1 -1
- package/dist/private/collections/Document.js +4 -0
- package/dist/private/collections/Document.js.map +1 -1
- package/dist/private/collections/Document.mjs +4 -0
- package/dist/private/collections/Document.mjs.map +1 -1
- package/dist/private/collections/Hidden.cjs +1 -0
- package/dist/private/collections/Hidden.cjs.map +1 -1
- package/dist/private/collections/Hidden.js +1 -0
- package/dist/private/collections/Hidden.js.map +1 -1
- package/dist/private/collections/Hidden.mjs +1 -0
- package/dist/private/collections/Hidden.mjs.map +1 -1
- package/dist/private/collections/useCachedChildren.cjs +1 -0
- package/dist/private/collections/useCachedChildren.cjs.map +1 -1
- package/dist/private/collections/useCachedChildren.js +1 -0
- package/dist/private/collections/useCachedChildren.js.map +1 -1
- package/dist/private/collections/useCachedChildren.mjs +1 -0
- package/dist/private/collections/useCachedChildren.mjs.map +1 -1
- package/dist/private/color/useColorArea.cjs +31 -34
- package/dist/private/color/useColorArea.cjs.map +1 -1
- package/dist/private/color/useColorArea.js +31 -34
- package/dist/private/color/useColorArea.js.map +1 -1
- package/dist/private/color/useColorArea.mjs +31 -34
- package/dist/private/color/useColorArea.mjs.map +1 -1
- package/dist/private/color/useColorSlider.cjs +4 -2
- package/dist/private/color/useColorSlider.cjs.map +1 -1
- package/dist/private/color/useColorSlider.js +4 -2
- package/dist/private/color/useColorSlider.js.map +1 -1
- package/dist/private/color/useColorSlider.mjs +4 -2
- package/dist/private/color/useColorSlider.mjs.map +1 -1
- package/dist/private/color/useColorWheel.cjs +16 -23
- package/dist/private/color/useColorWheel.cjs.map +1 -1
- package/dist/private/color/useColorWheel.js +16 -23
- package/dist/private/color/useColorWheel.js.map +1 -1
- package/dist/private/color/useColorWheel.mjs +16 -23
- package/dist/private/color/useColorWheel.mjs.map +1 -1
- package/dist/private/combobox/useComboBox.cjs +92 -29
- package/dist/private/combobox/useComboBox.cjs.map +1 -1
- package/dist/private/combobox/useComboBox.js +93 -29
- package/dist/private/combobox/useComboBox.js.map +1 -1
- package/dist/private/combobox/useComboBox.mjs +92 -29
- package/dist/private/combobox/useComboBox.mjs.map +1 -1
- package/dist/private/datepicker/useDateField.cjs +3 -6
- package/dist/private/datepicker/useDateField.cjs.map +1 -1
- package/dist/private/datepicker/useDateField.js +3 -6
- package/dist/private/datepicker/useDateField.js.map +1 -1
- package/dist/private/datepicker/useDateField.mjs +3 -6
- package/dist/private/datepicker/useDateField.mjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.cjs +48 -27
- package/dist/private/datepicker/useDatePickerGroup.cjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.js +49 -28
- package/dist/private/datepicker/useDatePickerGroup.js.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.mjs +49 -28
- package/dist/private/datepicker/useDatePickerGroup.mjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.cjs +21 -16
- package/dist/private/datepicker/useDateSegment.cjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.js +22 -17
- package/dist/private/datepicker/useDateSegment.js.map +1 -1
- package/dist/private/datepicker/useDateSegment.mjs +22 -17
- package/dist/private/datepicker/useDateSegment.mjs.map +1 -1
- package/dist/private/dialog/useDialog.cjs +8 -1
- package/dist/private/dialog/useDialog.cjs.map +1 -1
- package/dist/private/dialog/useDialog.js +10 -1
- package/dist/private/dialog/useDialog.js.map +1 -1
- package/dist/private/dialog/useDialog.mjs +8 -1
- package/dist/private/dialog/useDialog.mjs.map +1 -1
- package/dist/private/dnd/DragManager.cjs +3 -1
- package/dist/private/dnd/DragManager.cjs.map +1 -1
- package/dist/private/dnd/DragManager.js +3 -1
- package/dist/private/dnd/DragManager.js.map +1 -1
- package/dist/private/dnd/DragManager.mjs +3 -1
- package/dist/private/dnd/DragManager.mjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.cjs +3 -1
- package/dist/private/dnd/useAutoScroll.cjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.js +3 -1
- package/dist/private/dnd/useAutoScroll.js.map +1 -1
- package/dist/private/dnd/useAutoScroll.mjs +3 -1
- package/dist/private/dnd/useAutoScroll.mjs.map +1 -1
- package/dist/private/dnd/useDrag.cjs +4 -1
- package/dist/private/dnd/useDrag.cjs.map +1 -1
- package/dist/private/dnd/useDrag.js +4 -1
- package/dist/private/dnd/useDrag.js.map +1 -1
- package/dist/private/dnd/useDrag.mjs +4 -1
- package/dist/private/dnd/useDrag.mjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.cjs +4 -0
- package/dist/private/dnd/useDraggableItem.cjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.js +4 -0
- package/dist/private/dnd/useDraggableItem.js.map +1 -1
- package/dist/private/dnd/useDraggableItem.mjs +4 -0
- package/dist/private/dnd/useDraggableItem.mjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.cjs +4 -0
- package/dist/private/dnd/useDroppableCollection.cjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.js +4 -0
- package/dist/private/dnd/useDroppableCollection.js.map +1 -1
- package/dist/private/dnd/useDroppableCollection.mjs +4 -0
- package/dist/private/dnd/useDroppableCollection.mjs.map +1 -1
- package/dist/private/focus/FocusScope.cjs +5 -3
- package/dist/private/focus/FocusScope.cjs.map +1 -1
- package/dist/private/focus/FocusScope.js +5 -4
- package/dist/private/focus/FocusScope.js.map +1 -1
- package/dist/private/focus/FocusScope.mjs +5 -3
- package/dist/private/focus/FocusScope.mjs.map +1 -1
- package/dist/private/focus/useFocusRing.cjs +2 -1
- package/dist/private/focus/useFocusRing.cjs.map +1 -1
- package/dist/private/focus/useFocusRing.js +2 -1
- package/dist/private/focus/useFocusRing.js.map +1 -1
- package/dist/private/focus/useFocusRing.mjs +2 -1
- package/dist/private/focus/useFocusRing.mjs.map +1 -1
- package/dist/private/form/useFormValidation.cjs +6 -0
- package/dist/private/form/useFormValidation.cjs.map +1 -1
- package/dist/private/form/useFormValidation.js +6 -0
- package/dist/private/form/useFormValidation.js.map +1 -1
- package/dist/private/form/useFormValidation.mjs +6 -0
- package/dist/private/form/useFormValidation.mjs.map +1 -1
- package/dist/private/grid/useGrid.cjs +3 -2
- package/dist/private/grid/useGrid.cjs.map +1 -1
- package/dist/private/grid/useGrid.js +3 -2
- package/dist/private/grid/useGrid.js.map +1 -1
- package/dist/private/grid/useGrid.mjs +3 -2
- package/dist/private/grid/useGrid.mjs.map +1 -1
- package/dist/private/grid/useGridCell.cjs +44 -8
- package/dist/private/grid/useGridCell.cjs.map +1 -1
- package/dist/private/grid/useGridCell.js +44 -8
- package/dist/private/grid/useGridCell.js.map +1 -1
- package/dist/private/grid/useGridCell.mjs +44 -8
- package/dist/private/grid/useGridCell.mjs.map +1 -1
- package/dist/private/grid/utils.cjs.map +1 -1
- package/dist/private/grid/utils.js.map +1 -1
- package/dist/private/grid/utils.mjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.cjs +38 -30
- package/dist/private/gridlist/useGridListItem.cjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.js +38 -30
- package/dist/private/gridlist/useGridListItem.js.map +1 -1
- package/dist/private/gridlist/useGridListItem.mjs +38 -30
- package/dist/private/gridlist/useGridListItem.mjs.map +1 -1
- package/dist/private/interactions/PressResponder.cjs +1 -0
- package/dist/private/interactions/PressResponder.cjs.map +1 -1
- package/dist/private/interactions/PressResponder.js +1 -0
- package/dist/private/interactions/PressResponder.js.map +1 -1
- package/dist/private/interactions/PressResponder.mjs +1 -0
- package/dist/private/interactions/PressResponder.mjs.map +1 -1
- package/dist/private/interactions/Pressable.cjs +1 -0
- package/dist/private/interactions/Pressable.cjs.map +1 -1
- package/dist/private/interactions/Pressable.js +1 -0
- package/dist/private/interactions/Pressable.js.map +1 -1
- package/dist/private/interactions/Pressable.mjs +1 -0
- package/dist/private/interactions/Pressable.mjs.map +1 -1
- package/dist/private/interactions/createEventHandler.cjs +3 -2
- package/dist/private/interactions/createEventHandler.cjs.map +1 -1
- package/dist/private/interactions/createEventHandler.js +3 -2
- package/dist/private/interactions/createEventHandler.js.map +1 -1
- package/dist/private/interactions/createEventHandler.mjs +3 -2
- package/dist/private/interactions/createEventHandler.mjs.map +1 -1
- package/dist/private/interactions/createKeyboardShortcutHandler.cjs +130 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.cjs.map +1 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.js +125 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.js.map +1 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.mjs +125 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.mjs.map +1 -0
- package/dist/private/interactions/textSelection.cjs +2 -2
- package/dist/private/interactions/textSelection.cjs.map +1 -1
- package/dist/private/interactions/textSelection.js +3 -3
- package/dist/private/interactions/textSelection.js.map +1 -1
- package/dist/private/interactions/textSelection.mjs +3 -3
- package/dist/private/interactions/textSelection.mjs.map +1 -1
- package/dist/private/interactions/useContextMenu.cjs +104 -0
- package/dist/private/interactions/useContextMenu.cjs.map +1 -0
- package/dist/private/interactions/useContextMenu.js +99 -0
- package/dist/private/interactions/useContextMenu.js.map +1 -0
- package/dist/private/interactions/useContextMenu.mjs +99 -0
- package/dist/private/interactions/useContextMenu.mjs.map +1 -0
- package/dist/private/interactions/useFocusVisible.cjs +2 -2
- package/dist/private/interactions/useFocusVisible.cjs.map +1 -1
- package/dist/private/interactions/useFocusVisible.js +2 -2
- package/dist/private/interactions/useFocusVisible.js.map +1 -1
- package/dist/private/interactions/useFocusVisible.mjs +2 -2
- package/dist/private/interactions/useFocusVisible.mjs.map +1 -1
- package/dist/private/interactions/useFocusable.cjs +1 -0
- package/dist/private/interactions/useFocusable.cjs.map +1 -1
- package/dist/private/interactions/useFocusable.js +1 -0
- package/dist/private/interactions/useFocusable.js.map +1 -1
- package/dist/private/interactions/useFocusable.mjs +1 -0
- package/dist/private/interactions/useFocusable.mjs.map +1 -1
- package/dist/private/interactions/useHover.cjs +2 -1
- package/dist/private/interactions/useHover.cjs.map +1 -1
- package/dist/private/interactions/useHover.js +2 -1
- package/dist/private/interactions/useHover.js.map +1 -1
- package/dist/private/interactions/useHover.mjs +2 -1
- package/dist/private/interactions/useHover.mjs.map +1 -1
- package/dist/private/interactions/useKeyboard.cjs +46 -2
- package/dist/private/interactions/useKeyboard.cjs.map +1 -1
- package/dist/private/interactions/useKeyboard.js +48 -2
- package/dist/private/interactions/useKeyboard.js.map +1 -1
- package/dist/private/interactions/useKeyboard.mjs +46 -2
- package/dist/private/interactions/useKeyboard.mjs.map +1 -1
- package/dist/private/interactions/useLongPress.cjs +22 -22
- package/dist/private/interactions/useLongPress.cjs.map +1 -1
- package/dist/private/interactions/useLongPress.js +22 -22
- package/dist/private/interactions/useLongPress.js.map +1 -1
- package/dist/private/interactions/useLongPress.mjs +22 -22
- package/dist/private/interactions/useLongPress.mjs.map +1 -1
- package/dist/private/interactions/useMove.cjs +1 -8
- package/dist/private/interactions/useMove.cjs.map +1 -1
- package/dist/private/interactions/useMove.js +1 -8
- package/dist/private/interactions/useMove.js.map +1 -1
- package/dist/private/interactions/useMove.mjs +1 -8
- package/dist/private/interactions/useMove.mjs.map +1 -1
- package/dist/private/interactions/usePress.cjs +18 -33
- package/dist/private/interactions/usePress.cjs.map +1 -1
- package/dist/private/interactions/usePress.js +18 -33
- package/dist/private/interactions/usePress.js.map +1 -1
- package/dist/private/interactions/usePress.mjs +18 -33
- package/dist/private/interactions/usePress.mjs.map +1 -1
- package/dist/private/interactions/utils.cjs +10 -10
- package/dist/private/interactions/utils.cjs.map +1 -1
- package/dist/private/interactions/utils.js +10 -10
- package/dist/private/interactions/utils.js.map +1 -1
- package/dist/private/interactions/utils.mjs +10 -10
- package/dist/private/interactions/utils.mjs.map +1 -1
- package/dist/private/intl/combobox/fi-FI.cjs +5 -5
- package/dist/private/intl/combobox/fi-FI.cjs.map +1 -1
- package/dist/private/intl/combobox/fi-FI.js +5 -5
- package/dist/private/intl/combobox/fi-FI.js.map +1 -1
- package/dist/private/intl/combobox/fi-FI.mjs +5 -5
- package/dist/private/intl/combobox/fi-FI.mjs.map +1 -1
- package/dist/private/intl/previewtrigger/ar-AE.cjs +6 -0
- package/dist/private/intl/previewtrigger/ar-AE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ar-AE.js +8 -0
- package/dist/private/intl/previewtrigger/ar-AE.js.map +1 -0
- package/dist/private/intl/previewtrigger/ar-AE.mjs +8 -0
- package/dist/private/intl/previewtrigger/ar-AE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/bg-BG.cjs +6 -0
- package/dist/private/intl/previewtrigger/bg-BG.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/bg-BG.js +8 -0
- package/dist/private/intl/previewtrigger/bg-BG.js.map +1 -0
- package/dist/private/intl/previewtrigger/bg-BG.mjs +8 -0
- package/dist/private/intl/previewtrigger/bg-BG.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/cs-CZ.cjs +6 -0
- package/dist/private/intl/previewtrigger/cs-CZ.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/cs-CZ.js +8 -0
- package/dist/private/intl/previewtrigger/cs-CZ.js.map +1 -0
- package/dist/private/intl/previewtrigger/cs-CZ.mjs +8 -0
- package/dist/private/intl/previewtrigger/cs-CZ.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/da-DK.cjs +6 -0
- package/dist/private/intl/previewtrigger/da-DK.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/da-DK.js +8 -0
- package/dist/private/intl/previewtrigger/da-DK.js.map +1 -0
- package/dist/private/intl/previewtrigger/da-DK.mjs +8 -0
- package/dist/private/intl/previewtrigger/da-DK.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/de-DE.cjs +6 -0
- package/dist/private/intl/previewtrigger/de-DE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/de-DE.js +8 -0
- package/dist/private/intl/previewtrigger/de-DE.js.map +1 -0
- package/dist/private/intl/previewtrigger/de-DE.mjs +8 -0
- package/dist/private/intl/previewtrigger/de-DE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/el-GR.cjs +6 -0
- package/dist/private/intl/previewtrigger/el-GR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/el-GR.js +8 -0
- package/dist/private/intl/previewtrigger/el-GR.js.map +1 -0
- package/dist/private/intl/previewtrigger/el-GR.mjs +8 -0
- package/dist/private/intl/previewtrigger/el-GR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/en-US.cjs +6 -0
- package/dist/private/intl/previewtrigger/en-US.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/en-US.js +8 -0
- package/dist/private/intl/previewtrigger/en-US.js.map +1 -0
- package/dist/private/intl/previewtrigger/en-US.mjs +8 -0
- package/dist/private/intl/previewtrigger/en-US.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/es-ES.cjs +6 -0
- package/dist/private/intl/previewtrigger/es-ES.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/es-ES.js +8 -0
- package/dist/private/intl/previewtrigger/es-ES.js.map +1 -0
- package/dist/private/intl/previewtrigger/es-ES.mjs +8 -0
- package/dist/private/intl/previewtrigger/es-ES.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/et-EE.cjs +6 -0
- package/dist/private/intl/previewtrigger/et-EE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/et-EE.js +8 -0
- package/dist/private/intl/previewtrigger/et-EE.js.map +1 -0
- package/dist/private/intl/previewtrigger/et-EE.mjs +8 -0
- package/dist/private/intl/previewtrigger/et-EE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/fi-FI.cjs +6 -0
- package/dist/private/intl/previewtrigger/fi-FI.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/fi-FI.js +8 -0
- package/dist/private/intl/previewtrigger/fi-FI.js.map +1 -0
- package/dist/private/intl/previewtrigger/fi-FI.mjs +8 -0
- package/dist/private/intl/previewtrigger/fi-FI.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/fr-FR.cjs +6 -0
- package/dist/private/intl/previewtrigger/fr-FR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/fr-FR.js +8 -0
- package/dist/private/intl/previewtrigger/fr-FR.js.map +1 -0
- package/dist/private/intl/previewtrigger/fr-FR.mjs +8 -0
- package/dist/private/intl/previewtrigger/fr-FR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/he-IL.cjs +6 -0
- package/dist/private/intl/previewtrigger/he-IL.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/he-IL.js +8 -0
- package/dist/private/intl/previewtrigger/he-IL.js.map +1 -0
- package/dist/private/intl/previewtrigger/he-IL.mjs +8 -0
- package/dist/private/intl/previewtrigger/he-IL.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/hr-HR.cjs +6 -0
- package/dist/private/intl/previewtrigger/hr-HR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/hr-HR.js +8 -0
- package/dist/private/intl/previewtrigger/hr-HR.js.map +1 -0
- package/dist/private/intl/previewtrigger/hr-HR.mjs +8 -0
- package/dist/private/intl/previewtrigger/hr-HR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/hu-HU.cjs +6 -0
- package/dist/private/intl/previewtrigger/hu-HU.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/hu-HU.js +8 -0
- package/dist/private/intl/previewtrigger/hu-HU.js.map +1 -0
- package/dist/private/intl/previewtrigger/hu-HU.mjs +8 -0
- package/dist/private/intl/previewtrigger/hu-HU.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/it-IT.cjs +6 -0
- package/dist/private/intl/previewtrigger/it-IT.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/it-IT.js +8 -0
- package/dist/private/intl/previewtrigger/it-IT.js.map +1 -0
- package/dist/private/intl/previewtrigger/it-IT.mjs +8 -0
- package/dist/private/intl/previewtrigger/it-IT.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ja-JP.cjs +6 -0
- package/dist/private/intl/previewtrigger/ja-JP.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ja-JP.js +8 -0
- package/dist/private/intl/previewtrigger/ja-JP.js.map +1 -0
- package/dist/private/intl/previewtrigger/ja-JP.mjs +8 -0
- package/dist/private/intl/previewtrigger/ja-JP.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ko-KR.cjs +6 -0
- package/dist/private/intl/previewtrigger/ko-KR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ko-KR.js +8 -0
- package/dist/private/intl/previewtrigger/ko-KR.js.map +1 -0
- package/dist/private/intl/previewtrigger/ko-KR.mjs +8 -0
- package/dist/private/intl/previewtrigger/ko-KR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/lt-LT.cjs +6 -0
- package/dist/private/intl/previewtrigger/lt-LT.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/lt-LT.js +8 -0
- package/dist/private/intl/previewtrigger/lt-LT.js.map +1 -0
- package/dist/private/intl/previewtrigger/lt-LT.mjs +8 -0
- package/dist/private/intl/previewtrigger/lt-LT.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/lv-LV.cjs +6 -0
- package/dist/private/intl/previewtrigger/lv-LV.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/lv-LV.js +8 -0
- package/dist/private/intl/previewtrigger/lv-LV.js.map +1 -0
- package/dist/private/intl/previewtrigger/lv-LV.mjs +8 -0
- package/dist/private/intl/previewtrigger/lv-LV.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/nb-NO.cjs +6 -0
- package/dist/private/intl/previewtrigger/nb-NO.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/nb-NO.js +8 -0
- package/dist/private/intl/previewtrigger/nb-NO.js.map +1 -0
- package/dist/private/intl/previewtrigger/nb-NO.mjs +8 -0
- package/dist/private/intl/previewtrigger/nb-NO.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/nl-NL.cjs +6 -0
- package/dist/private/intl/previewtrigger/nl-NL.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/nl-NL.js +8 -0
- package/dist/private/intl/previewtrigger/nl-NL.js.map +1 -0
- package/dist/private/intl/previewtrigger/nl-NL.mjs +8 -0
- package/dist/private/intl/previewtrigger/nl-NL.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/pl-PL.cjs +6 -0
- package/dist/private/intl/previewtrigger/pl-PL.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/pl-PL.js +8 -0
- package/dist/private/intl/previewtrigger/pl-PL.js.map +1 -0
- package/dist/private/intl/previewtrigger/pl-PL.mjs +8 -0
- package/dist/private/intl/previewtrigger/pl-PL.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-BR.cjs +6 -0
- package/dist/private/intl/previewtrigger/pt-BR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-BR.js +8 -0
- package/dist/private/intl/previewtrigger/pt-BR.js.map +1 -0
- package/dist/private/intl/previewtrigger/pt-BR.mjs +8 -0
- package/dist/private/intl/previewtrigger/pt-BR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-PT.cjs +6 -0
- package/dist/private/intl/previewtrigger/pt-PT.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-PT.js +8 -0
- package/dist/private/intl/previewtrigger/pt-PT.js.map +1 -0
- package/dist/private/intl/previewtrigger/pt-PT.mjs +8 -0
- package/dist/private/intl/previewtrigger/pt-PT.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ro-RO.cjs +6 -0
- package/dist/private/intl/previewtrigger/ro-RO.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ro-RO.js +8 -0
- package/dist/private/intl/previewtrigger/ro-RO.js.map +1 -0
- package/dist/private/intl/previewtrigger/ro-RO.mjs +8 -0
- package/dist/private/intl/previewtrigger/ro-RO.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ru-RU.cjs +6 -0
- package/dist/private/intl/previewtrigger/ru-RU.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ru-RU.js +8 -0
- package/dist/private/intl/previewtrigger/ru-RU.js.map +1 -0
- package/dist/private/intl/previewtrigger/ru-RU.mjs +8 -0
- package/dist/private/intl/previewtrigger/ru-RU.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sk-SK.cjs +6 -0
- package/dist/private/intl/previewtrigger/sk-SK.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sk-SK.js +8 -0
- package/dist/private/intl/previewtrigger/sk-SK.js.map +1 -0
- package/dist/private/intl/previewtrigger/sk-SK.mjs +8 -0
- package/dist/private/intl/previewtrigger/sk-SK.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sl-SI.cjs +6 -0
- package/dist/private/intl/previewtrigger/sl-SI.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sl-SI.js +8 -0
- package/dist/private/intl/previewtrigger/sl-SI.js.map +1 -0
- package/dist/private/intl/previewtrigger/sl-SI.mjs +8 -0
- package/dist/private/intl/previewtrigger/sl-SI.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sr-SP.cjs +6 -0
- package/dist/private/intl/previewtrigger/sr-SP.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sr-SP.js +8 -0
- package/dist/private/intl/previewtrigger/sr-SP.js.map +1 -0
- package/dist/private/intl/previewtrigger/sr-SP.mjs +8 -0
- package/dist/private/intl/previewtrigger/sr-SP.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sv-SE.cjs +6 -0
- package/dist/private/intl/previewtrigger/sv-SE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sv-SE.js +8 -0
- package/dist/private/intl/previewtrigger/sv-SE.js.map +1 -0
- package/dist/private/intl/previewtrigger/sv-SE.mjs +8 -0
- package/dist/private/intl/previewtrigger/sv-SE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/tr-TR.cjs +6 -0
- package/dist/private/intl/previewtrigger/tr-TR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/tr-TR.js +8 -0
- package/dist/private/intl/previewtrigger/tr-TR.js.map +1 -0
- package/dist/private/intl/previewtrigger/tr-TR.mjs +8 -0
- package/dist/private/intl/previewtrigger/tr-TR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/uk-UA.cjs +6 -0
- package/dist/private/intl/previewtrigger/uk-UA.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/uk-UA.js +8 -0
- package/dist/private/intl/previewtrigger/uk-UA.js.map +1 -0
- package/dist/private/intl/previewtrigger/uk-UA.mjs +8 -0
- package/dist/private/intl/previewtrigger/uk-UA.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-CN.cjs +6 -0
- package/dist/private/intl/previewtrigger/zh-CN.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-CN.js +8 -0
- package/dist/private/intl/previewtrigger/zh-CN.js.map +1 -0
- package/dist/private/intl/previewtrigger/zh-CN.mjs +8 -0
- package/dist/private/intl/previewtrigger/zh-CN.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-TW.cjs +6 -0
- package/dist/private/intl/previewtrigger/zh-TW.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-TW.js +8 -0
- package/dist/private/intl/previewtrigger/zh-TW.js.map +1 -0
- package/dist/private/intl/previewtrigger/zh-TW.mjs +8 -0
- package/dist/private/intl/previewtrigger/zh-TW.mjs.map +1 -0
- package/dist/private/intl/table/ar-AE.cjs +3 -3
- package/dist/private/intl/table/ar-AE.cjs.map +1 -1
- package/dist/private/intl/table/ar-AE.js +3 -3
- package/dist/private/intl/table/ar-AE.js.map +1 -1
- package/dist/private/intl/table/ar-AE.mjs +3 -3
- package/dist/private/intl/table/ar-AE.mjs.map +1 -1
- package/dist/private/intl/table/bg-BG.cjs +3 -3
- package/dist/private/intl/table/bg-BG.cjs.map +1 -1
- package/dist/private/intl/table/bg-BG.js +3 -3
- package/dist/private/intl/table/bg-BG.js.map +1 -1
- package/dist/private/intl/table/bg-BG.mjs +3 -3
- package/dist/private/intl/table/bg-BG.mjs.map +1 -1
- package/dist/private/intl/table/cs-CZ.cjs +3 -3
- package/dist/private/intl/table/cs-CZ.cjs.map +1 -1
- package/dist/private/intl/table/cs-CZ.js +3 -3
- package/dist/private/intl/table/cs-CZ.js.map +1 -1
- package/dist/private/intl/table/cs-CZ.mjs +3 -3
- package/dist/private/intl/table/cs-CZ.mjs.map +1 -1
- package/dist/private/intl/table/da-DK.cjs +3 -3
- package/dist/private/intl/table/da-DK.cjs.map +1 -1
- package/dist/private/intl/table/da-DK.js +3 -3
- package/dist/private/intl/table/da-DK.js.map +1 -1
- package/dist/private/intl/table/da-DK.mjs +3 -3
- package/dist/private/intl/table/da-DK.mjs.map +1 -1
- package/dist/private/intl/table/de-DE.cjs +3 -3
- package/dist/private/intl/table/de-DE.cjs.map +1 -1
- package/dist/private/intl/table/de-DE.js +3 -3
- package/dist/private/intl/table/de-DE.js.map +1 -1
- package/dist/private/intl/table/de-DE.mjs +3 -3
- package/dist/private/intl/table/de-DE.mjs.map +1 -1
- package/dist/private/intl/table/el-GR.cjs +3 -3
- package/dist/private/intl/table/el-GR.cjs.map +1 -1
- package/dist/private/intl/table/el-GR.js +3 -3
- package/dist/private/intl/table/el-GR.js.map +1 -1
- package/dist/private/intl/table/el-GR.mjs +3 -3
- package/dist/private/intl/table/el-GR.mjs.map +1 -1
- package/dist/private/intl/table/es-ES.cjs +3 -3
- package/dist/private/intl/table/es-ES.cjs.map +1 -1
- package/dist/private/intl/table/es-ES.js +3 -3
- package/dist/private/intl/table/es-ES.js.map +1 -1
- package/dist/private/intl/table/es-ES.mjs +3 -3
- package/dist/private/intl/table/es-ES.mjs.map +1 -1
- package/dist/private/intl/table/et-EE.cjs +3 -3
- package/dist/private/intl/table/et-EE.cjs.map +1 -1
- package/dist/private/intl/table/et-EE.js +3 -3
- package/dist/private/intl/table/et-EE.js.map +1 -1
- package/dist/private/intl/table/et-EE.mjs +3 -3
- package/dist/private/intl/table/et-EE.mjs.map +1 -1
- package/dist/private/intl/table/fi-FI.cjs +3 -3
- package/dist/private/intl/table/fi-FI.cjs.map +1 -1
- package/dist/private/intl/table/fi-FI.js +3 -3
- package/dist/private/intl/table/fi-FI.js.map +1 -1
- package/dist/private/intl/table/fi-FI.mjs +3 -3
- package/dist/private/intl/table/fi-FI.mjs.map +1 -1
- package/dist/private/intl/table/fr-FR.cjs +3 -3
- package/dist/private/intl/table/fr-FR.cjs.map +1 -1
- package/dist/private/intl/table/fr-FR.js +3 -3
- package/dist/private/intl/table/fr-FR.js.map +1 -1
- package/dist/private/intl/table/fr-FR.mjs +3 -3
- package/dist/private/intl/table/fr-FR.mjs.map +1 -1
- package/dist/private/intl/table/he-IL.cjs +3 -3
- package/dist/private/intl/table/he-IL.cjs.map +1 -1
- package/dist/private/intl/table/he-IL.js +3 -3
- package/dist/private/intl/table/he-IL.js.map +1 -1
- package/dist/private/intl/table/he-IL.mjs +3 -3
- package/dist/private/intl/table/he-IL.mjs.map +1 -1
- package/dist/private/intl/table/hr-HR.cjs +3 -3
- package/dist/private/intl/table/hr-HR.cjs.map +1 -1
- package/dist/private/intl/table/hr-HR.js +3 -3
- package/dist/private/intl/table/hr-HR.js.map +1 -1
- package/dist/private/intl/table/hr-HR.mjs +3 -3
- package/dist/private/intl/table/hr-HR.mjs.map +1 -1
- package/dist/private/intl/table/hu-HU.cjs +3 -3
- package/dist/private/intl/table/hu-HU.cjs.map +1 -1
- package/dist/private/intl/table/hu-HU.js +3 -3
- package/dist/private/intl/table/hu-HU.js.map +1 -1
- package/dist/private/intl/table/hu-HU.mjs +3 -3
- package/dist/private/intl/table/hu-HU.mjs.map +1 -1
- package/dist/private/intl/table/it-IT.cjs +3 -3
- package/dist/private/intl/table/it-IT.cjs.map +1 -1
- package/dist/private/intl/table/it-IT.js +3 -3
- package/dist/private/intl/table/it-IT.js.map +1 -1
- package/dist/private/intl/table/it-IT.mjs +3 -3
- package/dist/private/intl/table/it-IT.mjs.map +1 -1
- package/dist/private/intl/table/ja-JP.cjs +3 -3
- package/dist/private/intl/table/ja-JP.cjs.map +1 -1
- package/dist/private/intl/table/ja-JP.js +3 -3
- package/dist/private/intl/table/ja-JP.js.map +1 -1
- package/dist/private/intl/table/ja-JP.mjs +3 -3
- package/dist/private/intl/table/ja-JP.mjs.map +1 -1
- package/dist/private/intl/table/ko-KR.cjs +3 -3
- package/dist/private/intl/table/ko-KR.cjs.map +1 -1
- package/dist/private/intl/table/ko-KR.js +3 -3
- package/dist/private/intl/table/ko-KR.js.map +1 -1
- package/dist/private/intl/table/ko-KR.mjs +3 -3
- package/dist/private/intl/table/ko-KR.mjs.map +1 -1
- package/dist/private/intl/table/lt-LT.cjs +3 -3
- package/dist/private/intl/table/lt-LT.cjs.map +1 -1
- package/dist/private/intl/table/lt-LT.js +3 -3
- package/dist/private/intl/table/lt-LT.js.map +1 -1
- package/dist/private/intl/table/lt-LT.mjs +3 -3
- package/dist/private/intl/table/lt-LT.mjs.map +1 -1
- package/dist/private/intl/table/lv-LV.cjs +3 -3
- package/dist/private/intl/table/lv-LV.cjs.map +1 -1
- package/dist/private/intl/table/lv-LV.js +3 -3
- package/dist/private/intl/table/lv-LV.js.map +1 -1
- package/dist/private/intl/table/lv-LV.mjs +3 -3
- package/dist/private/intl/table/lv-LV.mjs.map +1 -1
- package/dist/private/intl/table/nb-NO.cjs +3 -3
- package/dist/private/intl/table/nb-NO.cjs.map +1 -1
- package/dist/private/intl/table/nb-NO.js +3 -3
- package/dist/private/intl/table/nb-NO.js.map +1 -1
- package/dist/private/intl/table/nb-NO.mjs +3 -3
- package/dist/private/intl/table/nb-NO.mjs.map +1 -1
- package/dist/private/intl/table/nl-NL.cjs +3 -3
- package/dist/private/intl/table/nl-NL.cjs.map +1 -1
- package/dist/private/intl/table/nl-NL.js +3 -3
- package/dist/private/intl/table/nl-NL.js.map +1 -1
- package/dist/private/intl/table/nl-NL.mjs +3 -3
- package/dist/private/intl/table/nl-NL.mjs.map +1 -1
- package/dist/private/intl/table/pl-PL.cjs +3 -3
- package/dist/private/intl/table/pl-PL.cjs.map +1 -1
- package/dist/private/intl/table/pl-PL.js +3 -3
- package/dist/private/intl/table/pl-PL.js.map +1 -1
- package/dist/private/intl/table/pl-PL.mjs +3 -3
- package/dist/private/intl/table/pl-PL.mjs.map +1 -1
- package/dist/private/intl/table/pt-BR.cjs +3 -3
- package/dist/private/intl/table/pt-BR.cjs.map +1 -1
- package/dist/private/intl/table/pt-BR.js +3 -3
- package/dist/private/intl/table/pt-BR.js.map +1 -1
- package/dist/private/intl/table/pt-BR.mjs +3 -3
- package/dist/private/intl/table/pt-BR.mjs.map +1 -1
- package/dist/private/intl/table/pt-PT.cjs +3 -3
- package/dist/private/intl/table/pt-PT.cjs.map +1 -1
- package/dist/private/intl/table/pt-PT.js +3 -3
- package/dist/private/intl/table/pt-PT.js.map +1 -1
- package/dist/private/intl/table/pt-PT.mjs +3 -3
- package/dist/private/intl/table/pt-PT.mjs.map +1 -1
- package/dist/private/intl/table/ro-RO.cjs +3 -3
- package/dist/private/intl/table/ro-RO.cjs.map +1 -1
- package/dist/private/intl/table/ro-RO.js +3 -3
- package/dist/private/intl/table/ro-RO.js.map +1 -1
- package/dist/private/intl/table/ro-RO.mjs +3 -3
- package/dist/private/intl/table/ro-RO.mjs.map +1 -1
- package/dist/private/intl/table/ru-RU.cjs +3 -3
- package/dist/private/intl/table/ru-RU.cjs.map +1 -1
- package/dist/private/intl/table/ru-RU.js +3 -3
- package/dist/private/intl/table/ru-RU.js.map +1 -1
- package/dist/private/intl/table/ru-RU.mjs +3 -3
- package/dist/private/intl/table/ru-RU.mjs.map +1 -1
- package/dist/private/intl/table/sk-SK.cjs +3 -3
- package/dist/private/intl/table/sk-SK.cjs.map +1 -1
- package/dist/private/intl/table/sk-SK.js +3 -3
- package/dist/private/intl/table/sk-SK.js.map +1 -1
- package/dist/private/intl/table/sk-SK.mjs +3 -3
- package/dist/private/intl/table/sk-SK.mjs.map +1 -1
- package/dist/private/intl/table/sl-SI.cjs +3 -3
- package/dist/private/intl/table/sl-SI.cjs.map +1 -1
- package/dist/private/intl/table/sl-SI.js +3 -3
- package/dist/private/intl/table/sl-SI.js.map +1 -1
- package/dist/private/intl/table/sl-SI.mjs +3 -3
- package/dist/private/intl/table/sl-SI.mjs.map +1 -1
- package/dist/private/intl/table/sr-SP.cjs +3 -3
- package/dist/private/intl/table/sr-SP.cjs.map +1 -1
- package/dist/private/intl/table/sr-SP.js +3 -3
- package/dist/private/intl/table/sr-SP.js.map +1 -1
- package/dist/private/intl/table/sr-SP.mjs +3 -3
- package/dist/private/intl/table/sr-SP.mjs.map +1 -1
- package/dist/private/intl/table/sv-SE.cjs +3 -3
- package/dist/private/intl/table/sv-SE.cjs.map +1 -1
- package/dist/private/intl/table/sv-SE.js +3 -3
- package/dist/private/intl/table/sv-SE.js.map +1 -1
- package/dist/private/intl/table/sv-SE.mjs +3 -3
- package/dist/private/intl/table/sv-SE.mjs.map +1 -1
- package/dist/private/intl/table/tr-TR.cjs +3 -3
- package/dist/private/intl/table/tr-TR.cjs.map +1 -1
- package/dist/private/intl/table/tr-TR.js +3 -3
- package/dist/private/intl/table/tr-TR.js.map +1 -1
- package/dist/private/intl/table/tr-TR.mjs +3 -3
- package/dist/private/intl/table/tr-TR.mjs.map +1 -1
- package/dist/private/intl/table/uk-UA.cjs +3 -3
- package/dist/private/intl/table/uk-UA.cjs.map +1 -1
- package/dist/private/intl/table/uk-UA.js +3 -3
- package/dist/private/intl/table/uk-UA.js.map +1 -1
- package/dist/private/intl/table/uk-UA.mjs +3 -3
- package/dist/private/intl/table/uk-UA.mjs.map +1 -1
- package/dist/private/intl/table/zh-CN.cjs +4 -4
- package/dist/private/intl/table/zh-CN.cjs.map +1 -1
- package/dist/private/intl/table/zh-CN.js +4 -4
- package/dist/private/intl/table/zh-CN.js.map +1 -1
- package/dist/private/intl/table/zh-CN.mjs +4 -4
- package/dist/private/intl/table/zh-CN.mjs.map +1 -1
- package/dist/private/intl/table/zh-TW.cjs +3 -3
- package/dist/private/intl/table/zh-TW.cjs.map +1 -1
- package/dist/private/intl/table/zh-TW.js +3 -3
- package/dist/private/intl/table/zh-TW.js.map +1 -1
- package/dist/private/intl/table/zh-TW.mjs +3 -3
- package/dist/private/intl/table/zh-TW.mjs.map +1 -1
- package/dist/private/intl/tree/es-ES.cjs +1 -1
- package/dist/private/intl/tree/es-ES.cjs.map +1 -1
- package/dist/private/intl/tree/es-ES.js +1 -1
- package/dist/private/intl/tree/es-ES.js.map +1 -1
- package/dist/private/intl/tree/es-ES.mjs +1 -1
- package/dist/private/intl/tree/es-ES.mjs.map +1 -1
- package/dist/private/link/useLink.cjs +2 -1
- package/dist/private/link/useLink.cjs.map +1 -1
- package/dist/private/link/useLink.js +2 -1
- package/dist/private/link/useLink.js.map +1 -1
- package/dist/private/link/useLink.mjs +2 -1
- package/dist/private/link/useLink.mjs.map +1 -1
- package/dist/private/menu/useMenuItem.cjs +33 -33
- package/dist/private/menu/useMenuItem.cjs.map +1 -1
- package/dist/private/menu/useMenuItem.js +33 -33
- package/dist/private/menu/useMenuItem.js.map +1 -1
- package/dist/private/menu/useMenuItem.mjs +33 -33
- package/dist/private/menu/useMenuItem.mjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.cjs +96 -30
- package/dist/private/menu/useMenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.js +96 -30
- package/dist/private/menu/useMenuTrigger.js.map +1 -1
- package/dist/private/menu/useMenuTrigger.mjs +96 -30
- package/dist/private/menu/useMenuTrigger.mjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.cjs +44 -36
- package/dist/private/menu/useSubmenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.js +44 -36
- package/dist/private/menu/useSubmenuTrigger.js.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.mjs +44 -36
- package/dist/private/menu/useSubmenuTrigger.mjs.map +1 -1
- package/dist/private/numberfield/useNumberField.cjs +24 -19
- package/dist/private/numberfield/useNumberField.cjs.map +1 -1
- package/dist/private/numberfield/useNumberField.js +24 -19
- package/dist/private/numberfield/useNumberField.js.map +1 -1
- package/dist/private/numberfield/useNumberField.mjs +24 -19
- package/dist/private/numberfield/useNumberField.mjs.map +1 -1
- package/dist/private/overlays/Overlay.cjs +5 -1
- package/dist/private/overlays/Overlay.cjs.map +1 -1
- package/dist/private/overlays/Overlay.js +5 -1
- package/dist/private/overlays/Overlay.js.map +1 -1
- package/dist/private/overlays/Overlay.mjs +5 -1
- package/dist/private/overlays/Overlay.mjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.cjs +12 -8
- package/dist/private/overlays/ariaHideOutside.cjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.js +13 -9
- package/dist/private/overlays/ariaHideOutside.js.map +1 -1
- package/dist/private/overlays/ariaHideOutside.mjs +13 -9
- package/dist/private/overlays/ariaHideOutside.mjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.cjs +3 -4
- package/dist/private/overlays/useCloseOnScroll.cjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.js +4 -5
- package/dist/private/overlays/useCloseOnScroll.js.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.mjs +4 -5
- package/dist/private/overlays/useCloseOnScroll.mjs.map +1 -1
- package/dist/private/overlays/useOverlay.cjs +13 -7
- package/dist/private/overlays/useOverlay.cjs.map +1 -1
- package/dist/private/overlays/useOverlay.js +13 -7
- package/dist/private/overlays/useOverlay.js.map +1 -1
- package/dist/private/overlays/useOverlay.mjs +13 -7
- package/dist/private/overlays/useOverlay.mjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.cjs +6 -0
- package/dist/private/overlays/useOverlayPosition.cjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.js +6 -0
- package/dist/private/overlays/useOverlayPosition.js.map +1 -1
- package/dist/private/overlays/useOverlayPosition.mjs +6 -0
- package/dist/private/overlays/useOverlayPosition.mjs.map +1 -1
- package/dist/private/overlays/usePopover.cjs +6 -2
- package/dist/private/overlays/usePopover.cjs.map +1 -1
- package/dist/private/overlays/usePopover.js +7 -2
- package/dist/private/overlays/usePopover.js.map +1 -1
- package/dist/private/overlays/usePopover.mjs +6 -2
- package/dist/private/overlays/usePopover.mjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.cjs +2 -5
- package/dist/private/overlays/usePreventScroll.cjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.js +3 -6
- package/dist/private/overlays/usePreventScroll.js.map +1 -1
- package/dist/private/overlays/usePreventScroll.mjs +3 -6
- package/dist/private/overlays/usePreventScroll.mjs.map +1 -1
- package/dist/private/progress/useProgressBar.cjs +2 -1
- package/dist/private/progress/useProgressBar.cjs.map +1 -1
- package/dist/private/progress/useProgressBar.js +2 -1
- package/dist/private/progress/useProgressBar.js.map +1 -1
- package/dist/private/progress/useProgressBar.mjs +2 -1
- package/dist/private/progress/useProgressBar.mjs.map +1 -1
- package/dist/private/radio/useRadioGroup.cjs +26 -23
- package/dist/private/radio/useRadioGroup.cjs.map +1 -1
- package/dist/private/radio/useRadioGroup.js +26 -23
- package/dist/private/radio/useRadioGroup.js.map +1 -1
- package/dist/private/radio/useRadioGroup.mjs +26 -23
- package/dist/private/radio/useRadioGroup.mjs.map +1 -1
- package/dist/private/searchfield/useSearchField.cjs +28 -22
- package/dist/private/searchfield/useSearchField.cjs.map +1 -1
- package/dist/private/searchfield/useSearchField.js +28 -22
- package/dist/private/searchfield/useSearchField.js.map +1 -1
- package/dist/private/searchfield/useSearchField.mjs +28 -22
- package/dist/private/searchfield/useSearchField.mjs.map +1 -1
- package/dist/private/select/useSelect.cjs +21 -23
- package/dist/private/select/useSelect.cjs.map +1 -1
- package/dist/private/select/useSelect.js +23 -25
- package/dist/private/select/useSelect.js.map +1 -1
- package/dist/private/select/useSelect.mjs +21 -23
- package/dist/private/select/useSelect.mjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.cjs +203 -146
- package/dist/private/selection/useSelectableCollection.cjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.js +207 -150
- package/dist/private/selection/useSelectableCollection.js.map +1 -1
- package/dist/private/selection/useSelectableCollection.mjs +203 -146
- package/dist/private/selection/useSelectableCollection.mjs.map +1 -1
- package/dist/private/selection/useSelectableItem.cjs +58 -13
- package/dist/private/selection/useSelectableItem.cjs.map +1 -1
- package/dist/private/selection/useSelectableItem.js +58 -13
- package/dist/private/selection/useSelectableItem.js.map +1 -1
- package/dist/private/selection/useSelectableItem.mjs +58 -13
- package/dist/private/selection/useSelectableItem.mjs.map +1 -1
- package/dist/private/slider/useSlider.cjs.map +1 -1
- package/dist/private/slider/useSlider.js.map +1 -1
- package/dist/private/slider/useSlider.mjs.map +1 -1
- package/dist/private/slider/useSliderThumb.cjs +28 -26
- package/dist/private/slider/useSliderThumb.cjs.map +1 -1
- package/dist/private/slider/useSliderThumb.js +28 -26
- package/dist/private/slider/useSliderThumb.js.map +1 -1
- package/dist/private/slider/useSliderThumb.mjs +28 -26
- package/dist/private/slider/useSliderThumb.mjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.cjs +49 -34
- package/dist/private/spinbutton/useSpinButton.cjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.js +49 -34
- package/dist/private/spinbutton/useSpinButton.js.map +1 -1
- package/dist/private/spinbutton/useSpinButton.mjs +49 -34
- package/dist/private/spinbutton/useSpinButton.mjs.map +1 -1
- package/dist/private/ssr/SSRProvider.cjs +12 -3
- package/dist/private/ssr/SSRProvider.cjs.map +1 -1
- package/dist/private/ssr/SSRProvider.js +12 -3
- package/dist/private/ssr/SSRProvider.js.map +1 -1
- package/dist/private/ssr/SSRProvider.mjs +12 -3
- package/dist/private/ssr/SSRProvider.mjs.map +1 -1
- package/dist/private/steplist/useStepListItem.cjs +0 -9
- package/dist/private/steplist/useStepListItem.cjs.map +1 -1
- package/dist/private/steplist/useStepListItem.js +0 -10
- package/dist/private/steplist/useStepListItem.js.map +1 -1
- package/dist/private/steplist/useStepListItem.mjs +0 -9
- package/dist/private/steplist/useStepListItem.mjs.map +1 -1
- package/dist/private/table/useTable.cjs +4 -2
- package/dist/private/table/useTable.cjs.map +1 -1
- package/dist/private/table/useTable.js +4 -2
- package/dist/private/table/useTable.js.map +1 -1
- package/dist/private/table/useTable.mjs +4 -2
- package/dist/private/table/useTable.mjs.map +1 -1
- package/dist/private/table/useTableCell.cjs +2 -0
- package/dist/private/table/useTableCell.cjs.map +1 -1
- package/dist/private/table/useTableCell.js +2 -0
- package/dist/private/table/useTableCell.js.map +1 -1
- package/dist/private/table/useTableCell.mjs +2 -0
- package/dist/private/table/useTableCell.mjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.cjs +2 -3
- package/dist/private/table/useTableColumnHeader.cjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.js +2 -3
- package/dist/private/table/useTableColumnHeader.js.map +1 -1
- package/dist/private/table/useTableColumnHeader.mjs +2 -3
- package/dist/private/table/useTableColumnHeader.mjs.map +1 -1
- package/dist/private/table/useTableColumnResize.cjs +32 -14
- package/dist/private/table/useTableColumnResize.cjs.map +1 -1
- package/dist/private/table/useTableColumnResize.js +33 -15
- package/dist/private/table/useTableColumnResize.js.map +1 -1
- package/dist/private/table/useTableColumnResize.mjs +33 -15
- package/dist/private/table/useTableColumnResize.mjs.map +1 -1
- package/dist/private/table/useTableRow.cjs +4 -2
- package/dist/private/table/useTableRow.cjs.map +1 -1
- package/dist/private/table/useTableRow.js +4 -2
- package/dist/private/table/useTableRow.js.map +1 -1
- package/dist/private/table/useTableRow.mjs +4 -2
- package/dist/private/table/useTableRow.mjs.map +1 -1
- package/dist/private/tag/useTag.cjs +21 -11
- package/dist/private/tag/useTag.cjs.map +1 -1
- package/dist/private/tag/useTag.js +21 -11
- package/dist/private/tag/useTag.js.map +1 -1
- package/dist/private/tag/useTag.mjs +21 -11
- package/dist/private/tag/useTag.mjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.cjs +1 -0
- package/dist/private/textfield/useFormattedTextField.cjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.js +1 -0
- package/dist/private/textfield/useFormattedTextField.js.map +1 -1
- package/dist/private/textfield/useFormattedTextField.mjs +1 -0
- package/dist/private/textfield/useFormattedTextField.mjs.map +1 -1
- package/dist/private/toast/useToastRegion.cjs +5 -0
- package/dist/private/toast/useToastRegion.cjs.map +1 -1
- package/dist/private/toast/useToastRegion.js +5 -0
- package/dist/private/toast/useToastRegion.js.map +1 -1
- package/dist/private/toast/useToastRegion.mjs +5 -0
- package/dist/private/toast/useToastRegion.mjs.map +1 -1
- package/dist/private/toggle/useToggle.cjs +1 -0
- package/dist/private/toggle/useToggle.cjs.map +1 -1
- package/dist/private/toggle/useToggle.js +1 -0
- package/dist/private/toggle/useToggle.js.map +1 -1
- package/dist/private/toggle/useToggle.mjs +1 -0
- package/dist/private/toggle/useToggle.mjs.map +1 -1
- package/dist/private/tokenfield/useToken.cjs +46 -0
- package/dist/private/tokenfield/useToken.cjs.map +1 -0
- package/dist/private/tokenfield/useToken.js +41 -0
- package/dist/private/tokenfield/useToken.js.map +1 -0
- package/dist/private/tokenfield/useToken.mjs +41 -0
- package/dist/private/tokenfield/useToken.mjs.map +1 -0
- package/dist/private/tokenfield/useTokenField.cjs +587 -0
- package/dist/private/tokenfield/useTokenField.cjs.map +1 -0
- package/dist/private/tokenfield/useTokenField.js +590 -0
- package/dist/private/tokenfield/useTokenField.js.map +1 -0
- package/dist/private/tokenfield/useTokenField.mjs +579 -0
- package/dist/private/tokenfield/useTokenField.mjs.map +1 -0
- package/dist/private/toolbar/useToolbar.cjs +1 -0
- package/dist/private/toolbar/useToolbar.cjs.map +1 -1
- package/dist/private/toolbar/useToolbar.js +1 -0
- package/dist/private/toolbar/useToolbar.js.map +1 -1
- package/dist/private/toolbar/useToolbar.mjs +1 -0
- package/dist/private/toolbar/useToolbar.mjs.map +1 -1
- package/dist/private/tooltip/intlStrings.cjs +108 -0
- package/dist/private/tooltip/intlStrings.cjs.map +1 -0
- package/dist/private/tooltip/intlStrings.js +110 -0
- package/dist/private/tooltip/intlStrings.js.map +1 -0
- package/dist/private/tooltip/intlStrings.mjs +110 -0
- package/dist/private/tooltip/intlStrings.mjs.map +1 -0
- package/dist/private/tooltip/usePreviewTrigger.cjs +212 -0
- package/dist/private/tooltip/usePreviewTrigger.cjs.map +1 -0
- package/dist/private/tooltip/usePreviewTrigger.js +208 -0
- package/dist/private/tooltip/usePreviewTrigger.js.map +1 -0
- package/dist/private/tooltip/usePreviewTrigger.mjs +207 -0
- package/dist/private/tooltip/usePreviewTrigger.mjs.map +1 -0
- package/dist/private/tooltip/useSafeArea.cjs +134 -0
- package/dist/private/tooltip/useSafeArea.cjs.map +1 -0
- package/dist/private/tooltip/useSafeArea.js +130 -0
- package/dist/private/tooltip/useSafeArea.js.map +1 -0
- package/dist/private/tooltip/useSafeArea.mjs +129 -0
- package/dist/private/tooltip/useSafeArea.mjs.map +1 -0
- package/dist/private/tooltip/useTooltipTrigger.cjs +1 -0
- package/dist/private/tooltip/useTooltipTrigger.cjs.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.js +1 -0
- package/dist/private/tooltip/useTooltipTrigger.js.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.mjs +1 -0
- package/dist/private/tooltip/useTooltipTrigger.mjs.map +1 -1
- package/dist/private/tree/useTree.cjs +1 -0
- package/dist/private/tree/useTree.cjs.map +1 -1
- package/dist/private/tree/useTree.js +1 -0
- package/dist/private/tree/useTree.js.map +1 -1
- package/dist/private/tree/useTree.mjs +1 -0
- package/dist/private/tree/useTree.mjs.map +1 -1
- package/dist/private/utils/domHelpers.cjs +43 -12
- package/dist/private/utils/domHelpers.cjs.map +1 -1
- package/dist/private/utils/domHelpers.js +45 -14
- package/dist/private/utils/domHelpers.js.map +1 -1
- package/dist/private/utils/domHelpers.mjs +43 -13
- package/dist/private/utils/domHelpers.mjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.cjs +1 -1
- package/dist/private/utils/isVirtualEvent.cjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.js +1 -1
- package/dist/private/utils/isVirtualEvent.js.map +1 -1
- package/dist/private/utils/isVirtualEvent.mjs +1 -1
- package/dist/private/utils/isVirtualEvent.mjs.map +1 -1
- package/dist/private/utils/openLink.cjs +4 -2
- package/dist/private/utils/openLink.cjs.map +1 -1
- package/dist/private/utils/openLink.js +4 -2
- package/dist/private/utils/openLink.js.map +1 -1
- package/dist/private/utils/openLink.mjs +4 -2
- package/dist/private/utils/openLink.mjs.map +1 -1
- package/dist/private/utils/platform.cjs +8 -4
- package/dist/private/utils/platform.cjs.map +1 -1
- package/dist/private/utils/platform.js +7 -4
- package/dist/private/utils/platform.js.map +1 -1
- package/dist/private/utils/platform.mjs +7 -4
- package/dist/private/utils/platform.mjs.map +1 -1
- package/dist/private/utils/scrollIntoView.cjs +3 -3
- package/dist/private/utils/scrollIntoView.cjs.map +1 -1
- package/dist/private/utils/scrollIntoView.js +4 -4
- package/dist/private/utils/scrollIntoView.js.map +1 -1
- package/dist/private/utils/scrollIntoView.mjs +4 -4
- package/dist/private/utils/scrollIntoView.mjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.cjs +28 -1
- package/dist/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.js +30 -2
- package/dist/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.mjs +28 -2
- package/dist/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/private/utils/useDeepMemo.cjs +4 -1
- package/dist/private/utils/useDeepMemo.cjs.map +1 -1
- package/dist/private/utils/useDeepMemo.js +4 -1
- package/dist/private/utils/useDeepMemo.js.map +1 -1
- package/dist/private/utils/useDeepMemo.mjs +4 -1
- package/dist/private/utils/useDeepMemo.mjs.map +1 -1
- package/dist/private/utils/useDrag1D.cjs +2 -0
- package/dist/private/utils/useDrag1D.cjs.map +1 -1
- package/dist/private/utils/useDrag1D.js +2 -0
- package/dist/private/utils/useDrag1D.js.map +1 -1
- package/dist/private/utils/useDrag1D.mjs +2 -0
- package/dist/private/utils/useDrag1D.mjs.map +1 -1
- package/dist/private/utils/useFormReset.cjs +4 -0
- package/dist/private/utils/useFormReset.cjs.map +1 -1
- package/dist/private/utils/useFormReset.js +4 -0
- package/dist/private/utils/useFormReset.js.map +1 -1
- package/dist/private/utils/useFormReset.mjs +4 -0
- package/dist/private/utils/useFormReset.mjs.map +1 -1
- package/dist/private/utils/useId.cjs +23 -4
- package/dist/private/utils/useId.cjs.map +1 -1
- package/dist/private/utils/useId.js +23 -4
- package/dist/private/utils/useId.js.map +1 -1
- package/dist/private/utils/useId.mjs +23 -4
- package/dist/private/utils/useId.mjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.cjs +7 -3
- package/dist/private/utils/useLoadMoreSentinel.cjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.js +7 -3
- package/dist/private/utils/useLoadMoreSentinel.js.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.mjs +7 -3
- package/dist/private/utils/useLoadMoreSentinel.mjs.map +1 -1
- package/dist/private/utils/useObjectRef.cjs +3 -1
- package/dist/private/utils/useObjectRef.cjs.map +1 -1
- package/dist/private/utils/useObjectRef.js +3 -1
- package/dist/private/utils/useObjectRef.js.map +1 -1
- package/dist/private/utils/useObjectRef.mjs +3 -1
- package/dist/private/utils/useObjectRef.mjs.map +1 -1
- package/dist/private/utils/useSyncRef.cjs +2 -0
- package/dist/private/utils/useSyncRef.cjs.map +1 -1
- package/dist/private/utils/useSyncRef.js +2 -0
- package/dist/private/utils/useSyncRef.js.map +1 -1
- package/dist/private/utils/useSyncRef.mjs +2 -0
- package/dist/private/utils/useSyncRef.mjs.map +1 -1
- package/dist/private/utils/useViewportSize.cjs +3 -3
- package/dist/private/utils/useViewportSize.cjs.map +1 -1
- package/dist/private/utils/useViewportSize.js +4 -4
- package/dist/private/utils/useViewportSize.js.map +1 -1
- package/dist/private/utils/useViewportSize.mjs +4 -4
- package/dist/private/utils/useViewportSize.mjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.cjs +7 -4
- package/dist/private/virtualizer/ScrollView.cjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.js +8 -5
- package/dist/private/virtualizer/ScrollView.js.map +1 -1
- package/dist/private/virtualizer/ScrollView.mjs +8 -5
- package/dist/private/virtualizer/ScrollView.mjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.cjs +3 -2
- package/dist/private/virtualizer/VirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.js +3 -2
- package/dist/private/virtualizer/VirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.mjs +3 -2
- package/dist/private/virtualizer/VirtualizerItem.mjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.cjs +35 -2
- package/dist/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.js +36 -3
- package/dist/private/virtualizer/useVirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.mjs +36 -3
- package/dist/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.cjs +2 -1
- package/dist/private/visually-hidden/VisuallyHidden.cjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.js +2 -1
- package/dist/private/visually-hidden/VisuallyHidden.js.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.mjs +2 -1
- package/dist/private/visually-hidden/VisuallyHidden.mjs.map +1 -1
- package/dist/types/exports/index.d.ts +9 -0
- package/dist/types/exports/private/utils/domHelpers.d.ts +1 -1
- package/dist/types/exports/private/utils/platform.d.ts +1 -1
- package/dist/types/exports/private/utils/shadowdom/DOMFunctions.d.ts +1 -1
- package/dist/types/exports/useContextMenu.d.ts +2 -0
- package/dist/types/exports/usePreviewTrigger.d.ts +2 -0
- package/dist/types/exports/useTokenField.d.ts +4 -0
- package/dist/types/src/button/useToggleButtonGroup.d.ts +8 -0
- package/dist/types/src/combobox/useComboBox.d.ts +7 -1
- package/dist/types/src/dialog/useDialog.d.ts +2 -0
- package/dist/types/src/grid/useGrid.d.ts +7 -0
- package/dist/types/src/grid/useGridCell.d.ts +8 -1
- package/dist/types/src/grid/utils.d.ts +1 -0
- package/dist/types/src/gridlist/useGridListItem.d.ts +13 -0
- package/dist/types/src/interactions/createKeyboardShortcutHandler.d.ts +56 -0
- package/dist/types/src/interactions/useContextMenu.d.ts +21 -0
- package/dist/types/src/interactions/useKeyboard.d.ts +7 -0
- package/dist/types/src/interactions/useLongPress.d.ts +2 -0
- package/dist/types/src/overlays/usePopover.d.ts +2 -1
- package/dist/types/src/table/useTableCell.d.ts +12 -0
- package/dist/types/src/table/useTableColumnHeader.d.ts +12 -0
- package/dist/types/src/table/useTableColumnResize.d.ts +5 -0
- package/dist/types/src/tokenfield/useToken.d.ts +14 -0
- package/dist/types/src/tokenfield/useTokenField.d.ts +57 -0
- package/dist/types/src/tooltip/usePreviewTrigger.d.ts +27 -0
- package/dist/types/src/tooltip/useSafeArea.d.ts +26 -0
- package/dist/types/src/utils/domHelpers.d.ts +20 -5
- package/dist/types/src/utils/platform.d.ts +1 -0
- package/dist/types/src/utils/shadowdom/DOMFunctions.d.ts +11 -0
- package/dist/types/src/utils/useLoadMoreSentinel.d.ts +7 -0
- package/dist/types/src/virtualizer/VirtualizerItem.d.ts +1 -0
- package/dist/types/src/virtualizer/useVirtualizerItem.d.ts +1 -0
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +6 -6
- package/useContextMenu/package.json +5 -0
- package/usePreviewTrigger/package.json +5 -0
- package/useTokenField/package.json +5 -0
|
@@ -13,7 +13,7 @@ import {useLocalizedStringFormatter as $cf2482eff2eeeec2$export$f12b703ca79dfbb1
|
|
|
13
13
|
import {useMove as $1dfdc54e7eb53ba0$export$36da96379f79f245} from "../interactions/useMove.mjs";
|
|
14
14
|
import {usePress as $d27d541f9569d26d$export$45712eceda6fad21} from "../interactions/usePress.mjs";
|
|
15
15
|
import {useVisuallyHidden as $ea3928288112382f$export$a966af930f325cab} from "../visually-hidden/VisuallyHidden.mjs";
|
|
16
|
-
import {useRef as $jgovN$useRef, useCallback as $jgovN$useCallback, useEffect as $jgovN$useEffect} from "react";
|
|
16
|
+
import {useRef as $jgovN$useRef, useState as $jgovN$useState, useCallback as $jgovN$useCallback, useEffect as $jgovN$useEffect} from "react";
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
function $parcel$interopDefault(a) {
|
|
@@ -54,6 +54,9 @@ function $963a203da37f9c8f$export$52994e973806c219(props, state, ref) {
|
|
|
54
54
|
let lastSize = (0, $jgovN$useRef)(null);
|
|
55
55
|
let wasFocusedOnResizeStart = (0, $jgovN$useRef)(false);
|
|
56
56
|
let editModeEnabled = state.tableState.isKeyboardNavigationDisabled;
|
|
57
|
+
// Whether a mouse drag-resize is active. Set on the first move (not on press) so a cursor
|
|
58
|
+
// overlay only mounts during an actual drag.
|
|
59
|
+
let [isMouseResizing, setMouseResizing] = (0, $jgovN$useState)(false);
|
|
57
60
|
let { direction: direction } = (0, $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7)();
|
|
58
61
|
let startResize = (0, $jgovN$useCallback)((item)=>{
|
|
59
62
|
if (!isResizingRef.current) {
|
|
@@ -91,24 +94,35 @@ function $963a203da37f9c8f$export$52994e973806c219(props, state, ref) {
|
|
|
91
94
|
triggerRef,
|
|
92
95
|
onResizeEnd
|
|
93
96
|
]);
|
|
97
|
+
let endResizeEvent = ()=>{
|
|
98
|
+
if (editModeEnabled) {
|
|
99
|
+
endResize(item);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
};
|
|
94
104
|
let { keyboardProps: keyboardProps } = (0, $8296dad1a4c5e0dc$export$8f71654801c2f7cd)({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
shortcuts: {
|
|
106
|
+
Escape: ()=>{
|
|
107
|
+
return endResizeEvent();
|
|
108
|
+
},
|
|
109
|
+
Enter: ()=>{
|
|
110
|
+
if (editModeEnabled) endResize(item);
|
|
111
|
+
else startResize(item);
|
|
112
|
+
},
|
|
113
|
+
' ': ()=>{
|
|
114
|
+
return endResizeEvent();
|
|
115
|
+
},
|
|
116
|
+
Tab: ()=>{
|
|
117
|
+
return endResizeEvent();
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
120
|
});
|
|
108
121
|
const columnResizeWidthRef = (0, $jgovN$useRef)(0);
|
|
109
122
|
const { moveProps: moveProps } = (0, $1dfdc54e7eb53ba0$export$36da96379f79f245)({
|
|
110
|
-
onMoveStart () {
|
|
123
|
+
onMoveStart (e) {
|
|
111
124
|
columnResizeWidthRef.current = state.getColumnWidth(item.key);
|
|
125
|
+
if (e.pointerType === 'mouse') setMouseResizing(true);
|
|
112
126
|
startResize(item);
|
|
113
127
|
},
|
|
114
128
|
onMove (e) {
|
|
@@ -127,6 +141,7 @@ function $963a203da37f9c8f$export$52994e973806c219(props, state, ref) {
|
|
|
127
141
|
onMoveEnd (e) {
|
|
128
142
|
let { pointerType: pointerType } = e;
|
|
129
143
|
columnResizeWidthRef.current = 0;
|
|
144
|
+
setMouseResizing(false);
|
|
130
145
|
if (pointerType === 'mouse' || pointerType === 'touch' && wasFocusedOnResizeStart.current) endResize(item);
|
|
131
146
|
}
|
|
132
147
|
});
|
|
@@ -142,7 +157,8 @@ function $963a203da37f9c8f$export$52994e973806c219(props, state, ref) {
|
|
|
142
157
|
let value = Math.floor(state.getColumnWidth(item.key));
|
|
143
158
|
let modality = (0, $8f5a2122b0992be3$export$98e20ec92f614cfe)();
|
|
144
159
|
if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) modality = 'touch';
|
|
145
|
-
let description =
|
|
160
|
+
let description = // oxlint-disable-next-line react/react-compiler
|
|
161
|
+
triggerRef?.current == null && (modality === 'keyboard' || modality === 'virtual') && !isResizing ? stringFormatter.format('resizerDescription') : undefined;
|
|
146
162
|
let descriptionProps = (0, $121970af65029459$export$f8aeda7b10753fa1)(description);
|
|
147
163
|
let ariaProps = {
|
|
148
164
|
'aria-label': ariaLabel,
|
|
@@ -221,7 +237,8 @@ function $963a203da37f9c8f$export$52994e973806c219(props, state, ref) {
|
|
|
221
237
|
touchAction: 'none'
|
|
222
238
|
}
|
|
223
239
|
}),
|
|
224
|
-
inputProps: (0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)(visuallyHiddenProps,
|
|
240
|
+
inputProps: (0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)(visuallyHiddenProps, // oxlint-disable-next-line react/react-compiler
|
|
241
|
+
{
|
|
225
242
|
id: id,
|
|
226
243
|
onBlur: ()=>{
|
|
227
244
|
endResize(item);
|
|
@@ -229,7 +246,8 @@ function $963a203da37f9c8f$export$52994e973806c219(props, state, ref) {
|
|
|
229
246
|
onChange: onChange,
|
|
230
247
|
disabled: isDisabled
|
|
231
248
|
}, ariaProps),
|
|
232
|
-
isResizing: isResizing
|
|
249
|
+
isResizing: isResizing,
|
|
250
|
+
isMouseResizing: isMouseResizing
|
|
233
251
|
};
|
|
234
252
|
}
|
|
235
253
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAiEM,SAAS,0CACd,KAAoC,EACpC,KAAgC,EAChC,GAAuC;IAEvC,IAAI,EACF,QAAQ,IAAI,cACZ,UAAU,cACV,UAAU,iBACV,aAAa,YACb,QAAQ,eACR,WAAW,EACX,cAAc,SAAS,EACxB,GAAG;IACJ,MAAM,kBAAkB,CAAA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S,EACnB,qBACA;gBACE;YACA,QAAQ;gBACN,UAAU;YACZ;sBACA;YACA,UAAU;QACZ,GACA;oBAEF;IACF;AACF","sources":["packages/react-aria/src/table/useTableColumnResize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ChangeEvent, useCallback, useEffect, useRef} from 'react';\nimport {ColumnSize} from 'react-stately/useTableState';\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {focusSafely} from '../interactions/focusSafely';\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {getColumnHeaderId} from './utils';\nimport {GridNode} from 'react-stately/private/grid/GridCollection';\nimport intlMessages from '../../intl/table/*.json';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableColumnResizeState} from 'react-stately/useTableState';\nimport {useDescription} from '../utils/useDescription';\nimport {useEffectEvent} from '../utils/useEffectEvent';\nimport {useId} from '../utils/useId';\nimport {useInteractionModality} from '../interactions/useFocusVisible';\nimport {useKeyboard} from '../interactions/useKeyboard';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useMove} from '../interactions/useMove';\nimport {usePress} from '../interactions/usePress';\nimport {useVisuallyHidden} from '../visually-hidden/VisuallyHidden';\n\nexport interface TableColumnResizeAria {\n /** Props for the visually hidden input element. */\n inputProps: DOMAttributes;\n /** Props for the resizer element. */\n resizerProps: DOMAttributes;\n /** Whether this column is currently being resized. */\n isResizing: boolean;\n}\n\nexport interface AriaTableColumnResizeProps<T> {\n /**\n * An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader).\n * Contains all the relevant information that makes up the column header.\n */\n column: GridNode<T>;\n /** Aria label for the hidden input. Gets read when resizing. */\n 'aria-label': string;\n /**\n * Ref to the trigger if resizing was started from a column header menu. If it's provided, focus\n * will be returned there when resizing is done. If it isn't provided, it is assumed that the\n * resizer is visible at all time and keyboard resizing is started via pressing Enter on the\n * resizer and not on focus.\n */\n triggerRef?: RefObject<FocusableElement | null>;\n /** If resizing is disabled. */\n isDisabled?: boolean;\n /** Called when resizing starts. */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void;\n /** Called for every resize event that results in new column sizes. */\n onResize?: (widths: Map<Key, ColumnSize>) => void;\n /** Called when resizing ends. */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table column resizer element.\n *\n * @param props - Props for the resizer.\n * @param state - State for the table's resizable columns, as returned by\n * `useTableColumnResizeState`.\n * @param ref - The ref attached to the resizer's visually hidden input element.\n */\nexport function useTableColumnResize<T>(\n props: AriaTableColumnResizeProps<T>,\n state: TableColumnResizeState<T>,\n ref: RefObject<HTMLInputElement | null>\n): TableColumnResizeAria {\n let {\n column: item,\n triggerRef,\n isDisabled,\n onResizeStart,\n onResize,\n onResizeEnd,\n 'aria-label': ariaLabel\n } = props;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let id = useId();\n let isResizing = state.resizingColumn === item.key;\n let isResizingRef = useRef(isResizing);\n let lastSize = useRef<Map<Key, ColumnSize> | null>(null);\n let wasFocusedOnResizeStart = useRef(false);\n let editModeEnabled = state.tableState.isKeyboardNavigationDisabled;\n\n let {direction} = useLocale();\n\n let startResize = useCallback(\n item => {\n if (!isResizingRef.current) {\n lastSize.current = state.updateResizedColumns(item.key, state.getColumnWidth(item.key));\n state.startResize(item.key);\n state.tableState.setKeyboardNavigationDisabled(true);\n onResizeStart?.(lastSize.current);\n }\n isResizingRef.current = true;\n },\n [state, onResizeStart]\n );\n\n let resize = useCallback(\n (item, newWidth) => {\n let sizes = state.updateResizedColumns(item.key, newWidth);\n onResize?.(sizes);\n lastSize.current = sizes;\n },\n [state, onResize]\n );\n\n let endResize = useCallback(\n item => {\n if (isResizingRef.current) {\n if (lastSize.current == null) {\n lastSize.current = state.updateResizedColumns(item.key, state.getColumnWidth(item.key));\n }\n\n state.endResize();\n state.tableState.setKeyboardNavigationDisabled(false);\n onResizeEnd?.(lastSize.current);\n isResizingRef.current = false;\n\n if (triggerRef?.current && !wasFocusedOnResizeStart.current) {\n // switch focus back to the column header unless the resizer was already focused when resizing started.\n focusSafely(triggerRef.current);\n }\n }\n lastSize.current = null;\n },\n [state, triggerRef, onResizeEnd]\n );\n\n let {keyboardProps} = useKeyboard({\n onKeyDown: e => {\n if (editModeEnabled) {\n if (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ' || e.key === 'Tab') {\n e.preventDefault();\n endResize(item);\n }\n } else {\n // Continue propagation on keydown events so they still bubbles to useSelectableCollection and are handled there\n e.continuePropagation();\n\n if (e.key === 'Enter') {\n startResize(item);\n }\n }\n }\n });\n\n const columnResizeWidthRef = useRef<number>(0);\n const {moveProps} = useMove({\n onMoveStart() {\n columnResizeWidthRef.current = state.getColumnWidth(item.key);\n startResize(item);\n },\n onMove(e) {\n let {deltaX, deltaY, pointerType} = e;\n if (direction === 'rtl') {\n deltaX *= -1;\n }\n if (pointerType === 'keyboard') {\n if (deltaY !== 0 && deltaX === 0) {\n deltaX = deltaY * -1;\n }\n deltaX *= 10;\n }\n // if moving up/down only, no need to resize\n if (deltaX !== 0) {\n columnResizeWidthRef.current += deltaX;\n resize(item, columnResizeWidthRef.current);\n }\n },\n onMoveEnd(e) {\n let {pointerType} = e;\n columnResizeWidthRef.current = 0;\n if (pointerType === 'mouse' || (pointerType === 'touch' && wasFocusedOnResizeStart.current)) {\n endResize(item);\n }\n }\n });\n\n let onKeyDown = useCallback(\n e => {\n if (editModeEnabled) {\n moveProps.onKeyDown?.(e);\n }\n },\n [editModeEnabled, moveProps]\n );\n\n let min = Math.floor(state.getColumnMinWidth(item.key));\n let max = Math.floor(state.getColumnMaxWidth(item.key));\n if (max === Infinity) {\n max = Number.MAX_SAFE_INTEGER;\n }\n let value = Math.floor(state.getColumnWidth(item.key));\n let modality: string | null = useInteractionModality();\n if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) {\n modality = 'touch';\n }\n let description =\n triggerRef?.current == null &&\n (modality === 'keyboard' || modality === 'virtual') &&\n !isResizing\n ? stringFormatter.format('resizerDescription')\n : undefined;\n let descriptionProps = useDescription(description);\n let ariaProps = {\n 'aria-label': ariaLabel,\n 'aria-orientation': 'horizontal' as 'horizontal',\n 'aria-labelledby': `${id} ${getColumnHeaderId(state.tableState, item.key)}`,\n 'aria-valuetext': stringFormatter.format('columnSize', {value}),\n type: 'range',\n min,\n max,\n value,\n ...descriptionProps\n };\n\n const focusInput = useCallback(() => {\n if (ref.current) {\n focusSafely(ref.current);\n }\n }, [ref]);\n\n let resizingColumn = state.resizingColumn;\n let prevResizingColumn = useRef<Key | null>(null);\n let startResizeEvent = useEffectEvent(startResize);\n useEffect(() => {\n if (\n prevResizingColumn.current !== resizingColumn &&\n resizingColumn != null &&\n resizingColumn === item.key\n ) {\n wasFocusedOnResizeStart.current = getActiveElement() === ref.current;\n startResizeEvent(item);\n // Delay focusing input until Android Chrome's delayed click after touchend happens: https://bugs.chromium.org/p/chromium/issues/detail?id=1150073\n let timeout = setTimeout(() => focusInput(), 0);\n // VoiceOver on iOS has problems focusing the input from a menu.\n let VOTimeout = setTimeout(focusInput, 400);\n return () => {\n clearTimeout(timeout);\n clearTimeout(VOTimeout);\n };\n }\n prevResizingColumn.current = resizingColumn;\n }, [resizingColumn, item, focusInput, ref]);\n\n let onChange = (e: ChangeEvent<HTMLInputElement>) => {\n let currentWidth = state.getColumnWidth(item.key);\n let nextValue = parseFloat(getEventTarget(e).value);\n\n if (nextValue > currentWidth) {\n nextValue = currentWidth + 10;\n } else {\n nextValue = currentWidth - 10;\n }\n resize(item, nextValue);\n };\n\n let {pressProps} = usePress({\n preventFocusOnPress: true,\n onPressStart: e => {\n if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey || e.pointerType === 'keyboard') {\n return;\n }\n if (e.pointerType === 'virtual' && state.resizingColumn != null) {\n endResize(item);\n return;\n }\n\n // Sometimes onPress won't trigger for quick taps on mobile so we want to focus the input so blurring away\n // can cancel resize mode for us.\n focusInput();\n\n // If resizer is always visible, mobile screenreader user can access the visually hidden resizer directly and thus we don't need\n // to handle a virtual click to start the resizer.\n if (e.pointerType !== 'virtual') {\n startResize(item);\n }\n },\n onPress: e => {\n if (\n ((e.pointerType === 'touch' && wasFocusedOnResizeStart.current) ||\n e.pointerType === 'mouse') &&\n state.resizingColumn != null\n ) {\n endResize(item);\n }\n }\n });\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n return {\n resizerProps: mergeProps(keyboardProps, {...moveProps, onKeyDown}, pressProps, {\n style: {touchAction: 'none'}\n }),\n inputProps: mergeProps(\n visuallyHiddenProps,\n {\n id,\n onBlur: () => {\n endResize(item);\n },\n onChange,\n disabled: isDisabled\n },\n ariaProps\n ),\n isResizing\n };\n}\n"],"names":[],"version":3,"file":"useTableColumnResize.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAsEM,SAAS,0CACd,KAAoC,EACpC,KAAgC,EAChC,GAAuC;IAEvC,IAAI,EACF,QAAQ,IAAI,cACZ,UAAU,cACV,UAAU,iBACV,aAAa,YACb,QAAQ,eACR,WAAW,EACX,cAAc,SAAS,EACxB,GAAG;IACJ,MAAM,kBAAkB,CAAA,GAAA,yCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAClE,IAAI,KAAK,CAAA,GAAA,yCAAI;IACb,IAAI,aAAa,MAAM,cAAc,KAAK,KAAK,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yCAAS,EACnB,qBACA,gDAAgD;QAChD;gBACE;YACA,QAAQ;gBACN,UAAU;YACZ;sBACA;YACA,UAAU;QACZ,GACA;oBAEF;yBACA;IACF;AACF","sources":["packages/react-aria/src/table/useTableColumnResize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ChangeEvent, useCallback, useEffect, useRef, useState} from 'react';\nimport {ColumnSize} from 'react-stately/useTableState';\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {focusSafely} from '../interactions/focusSafely';\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {getColumnHeaderId} from './utils';\nimport {GridNode} from 'react-stately/private/grid/GridCollection';\nimport intlMessages from '../../intl/table/*.json';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableColumnResizeState} from 'react-stately/useTableState';\nimport {useDescription} from '../utils/useDescription';\nimport {useEffectEvent} from '../utils/useEffectEvent';\nimport {useId} from '../utils/useId';\nimport {useInteractionModality} from '../interactions/useFocusVisible';\nimport {useKeyboard} from '../interactions/useKeyboard';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useMove} from '../interactions/useMove';\nimport {usePress} from '../interactions/usePress';\nimport {useVisuallyHidden} from '../visually-hidden/VisuallyHidden';\n\nexport interface TableColumnResizeAria {\n /** Props for the visually hidden input element. */\n inputProps: DOMAttributes;\n /** Props for the resizer element. */\n resizerProps: DOMAttributes;\n /** Whether this column is currently being resized. */\n isResizing: boolean;\n /**\n * Whether this column is currently being resized via a mouse drag (e.g. to render a cursor\n * overlay).\n */\n isMouseResizing: boolean;\n}\n\nexport interface AriaTableColumnResizeProps<T> {\n /**\n * An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader).\n * Contains all the relevant information that makes up the column header.\n */\n column: GridNode<T>;\n /** Aria label for the hidden input. Gets read when resizing. */\n 'aria-label': string;\n /**\n * Ref to the trigger if resizing was started from a column header menu. If it's provided, focus\n * will be returned there when resizing is done. If it isn't provided, it is assumed that the\n * resizer is visible at all time and keyboard resizing is started via pressing Enter on the\n * resizer and not on focus.\n */\n triggerRef?: RefObject<FocusableElement | null>;\n /** If resizing is disabled. */\n isDisabled?: boolean;\n /** Called when resizing starts. */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void;\n /** Called for every resize event that results in new column sizes. */\n onResize?: (widths: Map<Key, ColumnSize>) => void;\n /** Called when resizing ends. */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table column resizer element.\n *\n * @param props - Props for the resizer.\n * @param state - State for the table's resizable columns, as returned by\n * `useTableColumnResizeState`.\n * @param ref - The ref attached to the resizer's visually hidden input element.\n */\nexport function useTableColumnResize<T>(\n props: AriaTableColumnResizeProps<T>,\n state: TableColumnResizeState<T>,\n ref: RefObject<HTMLInputElement | null>\n): TableColumnResizeAria {\n let {\n column: item,\n triggerRef,\n isDisabled,\n onResizeStart,\n onResize,\n onResizeEnd,\n 'aria-label': ariaLabel\n } = props;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let id = useId();\n let isResizing = state.resizingColumn === item.key;\n let isResizingRef = useRef(isResizing);\n let lastSize = useRef<Map<Key, ColumnSize> | null>(null);\n let wasFocusedOnResizeStart = useRef(false);\n let editModeEnabled = state.tableState.isKeyboardNavigationDisabled;\n // Whether a mouse drag-resize is active. Set on the first move (not on press) so a cursor\n // overlay only mounts during an actual drag.\n let [isMouseResizing, setMouseResizing] = useState(false);\n\n let {direction} = useLocale();\n\n let startResize = useCallback(\n item => {\n if (!isResizingRef.current) {\n lastSize.current = state.updateResizedColumns(item.key, state.getColumnWidth(item.key));\n state.startResize(item.key);\n state.tableState.setKeyboardNavigationDisabled(true);\n onResizeStart?.(lastSize.current);\n }\n isResizingRef.current = true;\n },\n [state, onResizeStart]\n );\n\n let resize = useCallback(\n (item, newWidth) => {\n let sizes = state.updateResizedColumns(item.key, newWidth);\n onResize?.(sizes);\n lastSize.current = sizes;\n },\n [state, onResize]\n );\n\n let endResize = useCallback(\n item => {\n if (isResizingRef.current) {\n if (lastSize.current == null) {\n lastSize.current = state.updateResizedColumns(item.key, state.getColumnWidth(item.key));\n }\n\n state.endResize();\n state.tableState.setKeyboardNavigationDisabled(false);\n onResizeEnd?.(lastSize.current);\n isResizingRef.current = false;\n\n if (triggerRef?.current && !wasFocusedOnResizeStart.current) {\n // switch focus back to the column header unless the resizer was already focused when resizing started.\n focusSafely(triggerRef.current);\n }\n }\n lastSize.current = null;\n },\n [state, triggerRef, onResizeEnd]\n );\n\n let endResizeEvent = () => {\n if (editModeEnabled) {\n endResize(item);\n return;\n }\n return false;\n };\n\n let {keyboardProps} = useKeyboard({\n shortcuts: {\n Escape: () => {\n return endResizeEvent();\n },\n Enter: () => {\n if (editModeEnabled) {\n endResize(item);\n } else {\n startResize(item);\n }\n },\n ' ': () => {\n return endResizeEvent();\n },\n Tab: () => {\n return endResizeEvent();\n }\n }\n });\n\n const columnResizeWidthRef = useRef<number>(0);\n const {moveProps} = useMove({\n onMoveStart(e) {\n columnResizeWidthRef.current = state.getColumnWidth(item.key);\n if (e.pointerType === 'mouse') {\n setMouseResizing(true);\n }\n startResize(item);\n },\n onMove(e) {\n let {deltaX, deltaY, pointerType} = e;\n if (direction === 'rtl') {\n deltaX *= -1;\n }\n if (pointerType === 'keyboard') {\n if (deltaY !== 0 && deltaX === 0) {\n deltaX = deltaY * -1;\n }\n deltaX *= 10;\n }\n // if moving up/down only, no need to resize\n if (deltaX !== 0) {\n columnResizeWidthRef.current += deltaX;\n resize(item, columnResizeWidthRef.current);\n }\n },\n onMoveEnd(e) {\n let {pointerType} = e;\n columnResizeWidthRef.current = 0;\n setMouseResizing(false);\n if (pointerType === 'mouse' || (pointerType === 'touch' && wasFocusedOnResizeStart.current)) {\n endResize(item);\n }\n }\n });\n\n let onKeyDown = useCallback(\n e => {\n if (editModeEnabled) {\n moveProps.onKeyDown?.(e);\n }\n },\n [editModeEnabled, moveProps]\n );\n\n let min = Math.floor(state.getColumnMinWidth(item.key));\n let max = Math.floor(state.getColumnMaxWidth(item.key));\n if (max === Infinity) {\n max = Number.MAX_SAFE_INTEGER;\n }\n let value = Math.floor(state.getColumnWidth(item.key));\n let modality: string | null = useInteractionModality();\n if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) {\n modality = 'touch';\n }\n let description =\n // oxlint-disable-next-line react/react-compiler\n triggerRef?.current == null &&\n (modality === 'keyboard' || modality === 'virtual') &&\n !isResizing\n ? stringFormatter.format('resizerDescription')\n : undefined;\n let descriptionProps = useDescription(description);\n let ariaProps = {\n 'aria-label': ariaLabel,\n 'aria-orientation': 'horizontal' as 'horizontal',\n 'aria-labelledby': `${id} ${getColumnHeaderId(state.tableState, item.key)}`,\n 'aria-valuetext': stringFormatter.format('columnSize', {value}),\n type: 'range',\n min,\n max,\n value,\n ...descriptionProps\n };\n\n const focusInput = useCallback(() => {\n if (ref.current) {\n focusSafely(ref.current);\n }\n }, [ref]);\n\n let resizingColumn = state.resizingColumn;\n let prevResizingColumn = useRef<Key | null>(null);\n let startResizeEvent = useEffectEvent(startResize);\n useEffect(() => {\n if (\n prevResizingColumn.current !== resizingColumn &&\n resizingColumn != null &&\n resizingColumn === item.key\n ) {\n wasFocusedOnResizeStart.current = getActiveElement() === ref.current;\n startResizeEvent(item);\n // Delay focusing input until Android Chrome's delayed click after touchend happens: https://bugs.chromium.org/p/chromium/issues/detail?id=1150073\n let timeout = setTimeout(() => focusInput(), 0);\n // VoiceOver on iOS has problems focusing the input from a menu.\n let VOTimeout = setTimeout(focusInput, 400);\n return () => {\n clearTimeout(timeout);\n clearTimeout(VOTimeout);\n };\n }\n prevResizingColumn.current = resizingColumn;\n }, [resizingColumn, item, focusInput, ref]);\n\n let onChange = (e: ChangeEvent<HTMLInputElement>) => {\n let currentWidth = state.getColumnWidth(item.key);\n let nextValue = parseFloat(getEventTarget(e).value);\n\n if (nextValue > currentWidth) {\n nextValue = currentWidth + 10;\n } else {\n nextValue = currentWidth - 10;\n }\n resize(item, nextValue);\n };\n\n let {pressProps} = usePress({\n preventFocusOnPress: true,\n onPressStart: e => {\n if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey || e.pointerType === 'keyboard') {\n return;\n }\n if (e.pointerType === 'virtual' && state.resizingColumn != null) {\n endResize(item);\n return;\n }\n\n // Sometimes onPress won't trigger for quick taps on mobile so we want to focus the input so blurring away\n // can cancel resize mode for us.\n focusInput();\n\n // If resizer is always visible, mobile screenreader user can access the visually hidden resizer directly and thus we don't need\n // to handle a virtual click to start the resizer.\n if (e.pointerType !== 'virtual') {\n startResize(item);\n }\n },\n onPress: e => {\n if (\n ((e.pointerType === 'touch' && wasFocusedOnResizeStart.current) ||\n e.pointerType === 'mouse') &&\n state.resizingColumn != null\n ) {\n endResize(item);\n }\n }\n });\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n return {\n resizerProps: mergeProps(keyboardProps, {...moveProps, onKeyDown}, pressProps, {\n style: {touchAction: 'none'}\n }),\n inputProps: mergeProps(\n visuallyHiddenProps,\n // oxlint-disable-next-line react/react-compiler\n {\n id,\n onBlur: () => {\n endResize(item);\n },\n onChange,\n disabled: isDisabled\n },\n ariaProps\n ),\n isResizing,\n isMouseResizing\n };\n}\n"],"names":[],"version":3,"file":"useTableColumnResize.mjs.map"}
|
|
@@ -49,8 +49,10 @@ function $068ae3d49ce17647$export$7f2f6ae19e707aa5(props, state, ref) {
|
|
|
49
49
|
let { node: node, isVirtualized: isVirtualized } = props;
|
|
50
50
|
let { rowProps: rowProps, ...states } = (0, $2e39d55f4397f5df$exports.useGridRow)(props, state, ref);
|
|
51
51
|
let { direction: direction } = (0, $2522e612fa919664$exports.useLocale)();
|
|
52
|
-
if (isVirtualized && state.treeColumn == null)
|
|
53
|
-
|
|
52
|
+
if (isVirtualized && state.treeColumn == null) // oxlint-disable-next-line react/react-compiler
|
|
53
|
+
rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based
|
|
54
|
+
else // oxlint-disable-next-line react/react-compiler
|
|
55
|
+
delete rowProps['aria-rowindex'];
|
|
54
56
|
let isExpanded = state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));
|
|
55
57
|
let stringFormatter = (0, $d4e8e26182baab6e$exports.useLocalizedStringFormatter)((0, ($parcel$interopDefault($526eef38cac7f2b8$exports))), '@react-aria/table');
|
|
56
58
|
let labelProps = (0, $3f0180db35edfbf7$exports.useLabels)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBD,MAAM,uCAAiB;IACrB,QAAQ;QACN,KAAK;QACL,KAAK;IACP;IACA,UAAU;QACR,KAAK;QACL,KAAK;IACP;AACF;AAYO,SAAS,0CACd,KAAsB,EACtB,KAAuC,EACvC,GAAuC;IAEvC,IAAI,QAAC,IAAI,iBAAE,aAAa,EAAC,GAAG;IAC5B,IAAI,YAAC,QAAQ,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,oCAAS,EACnC,OACA,OACA;IAEF,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAE1B,IAAI,iBAAiB,MAAM,UAAU,IAAI,MACvC,QAAQ,CAAC,gBAAgB,GAAG,KAAK,KAAK,GAAG,IAAI,MAAM,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,2BAA2B;SAE5G,OAAO,Q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Aa;gBACb,iCAAiC;gBACjC,GAAG,UAAU;YACf;QACF;IACF;IAEA,IAAI,qBAAqB,CAAA,GAAA,+CAAoB,EAAE,KAAK,KAAK;IACzD,IAAI,YAAY,OAAO,SAAS,GAAG,qBAAqB,CAAC;IACzD,OAAO;QACL,UAAU;YACR,GAAG,CAAA,GAAA,oCAAS,EAAE,UAAU,kBAAkB,UAAU;YACpD,mBAAmB,CAAA,GAAA,0CAAe,EAAE,OAAwB,KAAK,GAAG;QACtE;2BACA;QACA,GAAG,MAAM;IACX;AACF;AAEA,SAAS,mCAAa,UAAqC,EAAE,IAAmB;IAC9E,IAAI,kBAAkB,MACpB,OAAO,KAAK,YAAY,IAAI,OAAO,WAAW,OAAO,CAAC,KAAK,YAAY,IAAI;SAE3E,OAAO,MAAM,IAAI,CAAC,KAAK,UAAU,EAAE,QAAQ,CAAC,CAAA,OAAQ,KAAK,SAAS,KAAK,KAAK,GAAG;AAEnF","sources":["packages/react-aria/src/table/useTableRow.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\n\nimport {Collection, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '../grid/useGridRow';\nimport {HTMLAttributes} from 'react';\nimport intlMessages from '../../intl/table/*.json';\nimport {ITableCollection} from 'react-stately/private/table/TableCollection';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableState} from 'react-stately/useTableState';\nimport {TreeGridState} from 'react-stately/private/table/useTreeGridState';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n collapse: {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\nexport interface TableRowAria extends GridRowAria {\n expandButtonProps: AriaButtonProps;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n *\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(\n props: GridRowProps<T>,\n state: TableState<T> | TreeGridState<T>,\n ref: RefObject<FocusableElement | null>\n): TableRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, ITableCollection<T>, TableState<T>>(\n props,\n state as TableState<T>,\n ref\n );\n let {direction} = useLocale();\n\n if (isVirtualized && state.treeColumn == null) {\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n delete rowProps['aria-rowindex'];\n }\n\n let isExpanded =\n state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let labelProps = useLabels({\n 'aria-label': isExpanded\n ? stringFormatter.format('collapse')\n : stringFormatter.format('expand'),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n });\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let expandButtonProps: AriaButtonProps = {};\n if (state.treeColumn != null) {\n let treeNode = state.collection.getItem(node.key);\n if (treeNode != null) {\n let lastChild = getLastChild(state.collection, node);\n let hasChildRows =\n treeNode.props?.hasChildRows ||\n treeNode.props?.UNSTABLE_childItems ||\n lastChild?.type !== 'cell';\n let parent = state.collection.getItem(node.parentKey!)!;\n let isParentBody = parent.type === 'tablebody' || parent.type === 'body';\n let lastSibling = getLastChild(state.collection, parent)!;\n while (lastSibling && lastSibling.type !== 'item' && lastSibling.prevKey != null) {\n lastSibling = state.collection.getItem(lastSibling.prevKey)!;\n }\n\n treeGridRowProps = {\n onKeyDown: e => {\n if (\n e.key === EXPANSION_KEYS['expand'][direction] &&\n state.selectionManager.focusedKey === treeNode.key &&\n hasChildRows &&\n state.expandedKeys !== 'all' &&\n !state.expandedKeys.has(treeNode.key)\n ) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n e.key === EXPANSION_KEYS['collapse'][direction] &&\n state.selectionManager.focusedKey === treeNode.key\n ) {\n if (state.expandedKeys !== 'all') {\n if (hasChildRows && state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n !state.expandedKeys.has(treeNode.key) &&\n treeNode.parentKey != null &&\n treeNode.level > 0\n ) {\n // Item is a leaf or already collapsed, move focus to parent\n state.selectionManager.setFocusedKey(treeNode.parentKey);\n e.stopPropagation();\n }\n } else if (state.expandedKeys === 'all') {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n }\n },\n 'aria-expanded': hasChildRows\n ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key)\n : undefined,\n 'aria-level': treeNode.level + 1,\n 'aria-posinset': treeNode.index - (isParentBody ? 0 : state.collection.columnCount) + 1,\n 'aria-setsize': lastSibling.index - (isParentBody ? 0 : state.collection.columnCount) + 1\n };\n\n expandButtonProps = {\n isDisabled: states.isDisabled,\n onPress: () => {\n if (!states.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n // @ts-ignore\n 'data-react-aria-prevent-focus': true,\n ...labelProps\n };\n }\n }\n\n let syntheticLinkProps = useSyntheticLinkProps(node.props);\n let linkProps = states.hasAction ? syntheticLinkProps : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n },\n expandButtonProps,\n ...states\n };\n}\n\nfunction getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {\n if ('lastChildKey' in node) {\n return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;\n } else {\n return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);\n }\n}\n"],"names":[],"version":3,"file":"useTableRow.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBD,MAAM,uCAAiB;IACrB,QAAQ;QACN,KAAK;QACL,KAAK;IACP;IACA,UAAU;QACR,KAAK;QACL,KAAK;IACP;AACF;AAYO,SAAS,0CACd,KAAsB,EACtB,KAAuC,EACvC,GAAuC;IAEvC,IAAI,QAAC,IAAI,iBAAE,aAAa,EAAC,GAAG;IAC5B,IAAI,YAAC,QAAQ,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,oCAAS,EACnC,OACA,OACA;IAEF,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAE1B,IAAI,iBAAiB,MAAM,UAAU,IAAI,MACvC,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,GAAG,KAAK,KAAK,GAAG,IAAI,MAAM,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,2BAA2B;SAE5G,gDAAgD;IAChD,OAAO,QAAQ,CAAC,gBAAgB;IAGlC,IAAI,aACF,MAAM,UAAU,IAAI,QAAS,CAAA,MAAM,YAAY,KAAK,SAAS,MAAM,YAAY,CAAC,GAAG,CAAC,KAAK,GAAG,CAAA;IAC9F,IAAI,kBAAkB,CAAA,GAAA,qDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,aAAa,CAAA,GAAA,mCAAQ,EAAE;QACzB,cAAc,aACV,gBAAgB,MAAM,CAAC,cACvB,gBAAgB,MAAM,CAAC;QAC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M;IACX;AACF;AAEA,SAAS,mCAAa,UAAqC,EAAE,IAAmB;IAC9E,IAAI,kBAAkB,MACpB,OAAO,KAAK,YAAY,IAAI,OAAO,WAAW,OAAO,CAAC,KAAK,YAAY,IAAI;SAE3E,OAAO,MAAM,IAAI,CAAC,KAAK,UAAU,EAAE,QAAQ,CAAC,CAAA,OAAQ,KAAK,SAAS,KAAK,KAAK,GAAG;AAEnF","sources":["packages/react-aria/src/table/useTableRow.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\n\nimport {Collection, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '../grid/useGridRow';\nimport {HTMLAttributes} from 'react';\nimport intlMessages from '../../intl/table/*.json';\nimport {ITableCollection} from 'react-stately/private/table/TableCollection';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableState} from 'react-stately/useTableState';\nimport {TreeGridState} from 'react-stately/private/table/useTreeGridState';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n collapse: {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\nexport interface TableRowAria extends GridRowAria {\n expandButtonProps: AriaButtonProps;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n *\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(\n props: GridRowProps<T>,\n state: TableState<T> | TreeGridState<T>,\n ref: RefObject<FocusableElement | null>\n): TableRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, ITableCollection<T>, TableState<T>>(\n props,\n state as TableState<T>,\n ref\n );\n let {direction} = useLocale();\n\n if (isVirtualized && state.treeColumn == null) {\n // oxlint-disable-next-line react/react-compiler\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n // oxlint-disable-next-line react/react-compiler\n delete rowProps['aria-rowindex'];\n }\n\n let isExpanded =\n state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let labelProps = useLabels({\n 'aria-label': isExpanded\n ? stringFormatter.format('collapse')\n : stringFormatter.format('expand'),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n });\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let expandButtonProps: AriaButtonProps = {};\n if (state.treeColumn != null) {\n let treeNode = state.collection.getItem(node.key);\n if (treeNode != null) {\n let lastChild = getLastChild(state.collection, node);\n let hasChildRows =\n treeNode.props?.hasChildRows ||\n treeNode.props?.UNSTABLE_childItems ||\n lastChild?.type !== 'cell';\n let parent = state.collection.getItem(node.parentKey!)!;\n let isParentBody = parent.type === 'tablebody' || parent.type === 'body';\n let lastSibling = getLastChild(state.collection, parent)!;\n while (lastSibling && lastSibling.type !== 'item' && lastSibling.prevKey != null) {\n lastSibling = state.collection.getItem(lastSibling.prevKey)!;\n }\n\n treeGridRowProps = {\n onKeyDown: e => {\n if (\n e.key === EXPANSION_KEYS['expand'][direction] &&\n state.selectionManager.focusedKey === treeNode.key &&\n hasChildRows &&\n state.expandedKeys !== 'all' &&\n !state.expandedKeys.has(treeNode.key)\n ) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n e.key === EXPANSION_KEYS['collapse'][direction] &&\n state.selectionManager.focusedKey === treeNode.key\n ) {\n if (state.expandedKeys !== 'all') {\n if (hasChildRows && state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n !state.expandedKeys.has(treeNode.key) &&\n treeNode.parentKey != null &&\n treeNode.level > 0\n ) {\n // Item is a leaf or already collapsed, move focus to parent\n state.selectionManager.setFocusedKey(treeNode.parentKey);\n e.stopPropagation();\n }\n } else if (state.expandedKeys === 'all') {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n }\n },\n 'aria-expanded': hasChildRows\n ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key)\n : undefined,\n 'aria-level': treeNode.level + 1,\n 'aria-posinset': treeNode.index - (isParentBody ? 0 : state.collection.columnCount) + 1,\n 'aria-setsize': lastSibling.index - (isParentBody ? 0 : state.collection.columnCount) + 1\n };\n\n expandButtonProps = {\n isDisabled: states.isDisabled,\n onPress: () => {\n if (!states.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n // @ts-ignore\n 'data-react-aria-prevent-focus': true,\n ...labelProps\n };\n }\n }\n\n let syntheticLinkProps = useSyntheticLinkProps(node.props);\n let linkProps = states.hasAction ? syntheticLinkProps : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n },\n expandButtonProps,\n ...states\n };\n}\n\nfunction getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {\n if ('lastChildKey' in node) {\n return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;\n } else {\n return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);\n }\n}\n"],"names":[],"version":3,"file":"useTableRow.cjs.map"}
|
|
@@ -43,8 +43,10 @@ function $e2f10f6b84ce4b1d$export$7f2f6ae19e707aa5(props, state, ref) {
|
|
|
43
43
|
let { node: node, isVirtualized: isVirtualized } = props;
|
|
44
44
|
let { rowProps: rowProps, ...states } = (0, $2c62d09fc068cb16$export$96357d5a73f686fa)(props, state, ref);
|
|
45
45
|
let { direction: direction } = (0, $4defb058003b3e05$export$43bb16f9c6d9e3f7)();
|
|
46
|
-
if (isVirtualized && state.treeColumn == null)
|
|
47
|
-
|
|
46
|
+
if (isVirtualized && state.treeColumn == null) // oxlint-disable-next-line react/react-compiler
|
|
47
|
+
rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based
|
|
48
|
+
else // oxlint-disable-next-line react/react-compiler
|
|
49
|
+
delete rowProps['aria-rowindex'];
|
|
48
50
|
let isExpanded = state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));
|
|
49
51
|
let stringFormatter = (0, $1adfa757ef3cd864$export$f12b703ca79dfbb1)((0, ($parcel$interopDefault($4QDRk$intlStringsjs))), '@react-aria/table');
|
|
50
52
|
let labelProps = (0, $93a7fe14591f425f$export$d6875122194c7b44)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBD,MAAM,uCAAiB;IACrB,QAAQ;QACN,KAAK;QACL,KAAK;IACP;IACA,UAAU;QACR,KAAK;QACL,KAAK;IACP;AACF;AAYO,SAAS,0CACd,KAAsB,EACtB,KAAuC,EACvC,GAAuC;IAEvC,IAAI,QAAC,IAAI,iBAAE,aAAa,EAAC,GAAG;IAC5B,IAAI,YAAC,QAAQ,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,yCAAS,EACnC,OACA,OACA;IAEF,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAQ;IAE1B,IAAI,iBAAiB,MAAM,UAAU,IAAI,M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B,SAAS;oBACP,IAAI,CAAC,OAAO,UAAU,EAAE;wBACtB,MAAM,SAAS,CAAC,KAAK,GAAG;wBACxB,MAAM,gBAAgB,CAAC,UAAU,CAAC;wBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC,KAAK,GAAG;oBAC/C;gBACF;gBACA,qBAAqB;gBACrB,qBAAqB;gBACrB,aAAa;gBACb,iCAAiC;gBACjC,GAAG,UAAU;YACf;QACF;IACF;IAEA,IAAI,qBAAqB,CAAA,GAAA,yCAAoB,EAAE,KAAK,KAAK;IACzD,IAAI,YAAY,OAAO,SAAS,GAAG,qBAAqB,CAAC;IACzD,OAAO;QACL,UAAU;YACR,GAAG,CAAA,GAAA,yCAAS,EAAE,UAAU,kBAAkB,UAAU;YACpD,mBAAmB,CAAA,GAAA,wCAAe,EAAE,OAAwB,KAAK,GAAG;QACtE;2BACA;QACA,GAAG,MAAM;IACX;AACF;AAEA,SAAS,mCAAa,UAAqC,EAAE,IAAmB;IAC9E,IAAI,kBAAkB,MACpB,OAAO,KAAK,YAAY,IAAI,OAAO,WAAW,OAAO,CAAC,KAAK,YAAY,IAAI;SAE3E,OAAO,MAAM,IAAI,CAAC,KAAK,UAAU,EAAE,QAAQ,CAAC,CAAA,OAAQ,KAAK,SAAS,KAAK,KAAK,GAAG;AAEnF","sources":["packages/react-aria/src/table/useTableRow.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\n\nimport {Collection, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '../grid/useGridRow';\nimport {HTMLAttributes} from 'react';\nimport intlMessages from '../../intl/table/*.json';\nimport {ITableCollection} from 'react-stately/private/table/TableCollection';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableState} from 'react-stately/useTableState';\nimport {TreeGridState} from 'react-stately/private/table/useTreeGridState';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n collapse: {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\nexport interface TableRowAria extends GridRowAria {\n expandButtonProps: AriaButtonProps;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n *\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(\n props: GridRowProps<T>,\n state: TableState<T> | TreeGridState<T>,\n ref: RefObject<FocusableElement | null>\n): TableRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, ITableCollection<T>, TableState<T>>(\n props,\n state as TableState<T>,\n ref\n );\n let {direction} = useLocale();\n\n if (isVirtualized && state.treeColumn == null) {\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n delete rowProps['aria-rowindex'];\n }\n\n let isExpanded =\n state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let labelProps = useLabels({\n 'aria-label': isExpanded\n ? stringFormatter.format('collapse')\n : stringFormatter.format('expand'),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n });\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let expandButtonProps: AriaButtonProps = {};\n if (state.treeColumn != null) {\n let treeNode = state.collection.getItem(node.key);\n if (treeNode != null) {\n let lastChild = getLastChild(state.collection, node);\n let hasChildRows =\n treeNode.props?.hasChildRows ||\n treeNode.props?.UNSTABLE_childItems ||\n lastChild?.type !== 'cell';\n let parent = state.collection.getItem(node.parentKey!)!;\n let isParentBody = parent.type === 'tablebody' || parent.type === 'body';\n let lastSibling = getLastChild(state.collection, parent)!;\n while (lastSibling && lastSibling.type !== 'item' && lastSibling.prevKey != null) {\n lastSibling = state.collection.getItem(lastSibling.prevKey)!;\n }\n\n treeGridRowProps = {\n onKeyDown: e => {\n if (\n e.key === EXPANSION_KEYS['expand'][direction] &&\n state.selectionManager.focusedKey === treeNode.key &&\n hasChildRows &&\n state.expandedKeys !== 'all' &&\n !state.expandedKeys.has(treeNode.key)\n ) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n e.key === EXPANSION_KEYS['collapse'][direction] &&\n state.selectionManager.focusedKey === treeNode.key\n ) {\n if (state.expandedKeys !== 'all') {\n if (hasChildRows && state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n !state.expandedKeys.has(treeNode.key) &&\n treeNode.parentKey != null &&\n treeNode.level > 0\n ) {\n // Item is a leaf or already collapsed, move focus to parent\n state.selectionManager.setFocusedKey(treeNode.parentKey);\n e.stopPropagation();\n }\n } else if (state.expandedKeys === 'all') {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n }\n },\n 'aria-expanded': hasChildRows\n ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key)\n : undefined,\n 'aria-level': treeNode.level + 1,\n 'aria-posinset': treeNode.index - (isParentBody ? 0 : state.collection.columnCount) + 1,\n 'aria-setsize': lastSibling.index - (isParentBody ? 0 : state.collection.columnCount) + 1\n };\n\n expandButtonProps = {\n isDisabled: states.isDisabled,\n onPress: () => {\n if (!states.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n // @ts-ignore\n 'data-react-aria-prevent-focus': true,\n ...labelProps\n };\n }\n }\n\n let syntheticLinkProps = useSyntheticLinkProps(node.props);\n let linkProps = states.hasAction ? syntheticLinkProps : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n },\n expandButtonProps,\n ...states\n };\n}\n\nfunction getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {\n if ('lastChildKey' in node) {\n return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;\n } else {\n return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);\n }\n}\n"],"names":[],"version":3,"file":"useTableRow.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBD,MAAM,uCAAiB;IACrB,QAAQ;QACN,KAAK;QACL,KAAK;IACP;IACA,UAAU;QACR,KAAK;QACL,KAAK;IACP;AACF;AAYO,SAAS,0CACd,KAAsB,EACtB,KAAuC,EACvC,GAAuC;IAEvC,IAAI,QAAC,IAAI,iBAAE,aAAa,EAAC,GAAG;IAC5B,IAAI,YAAC,QAAQ,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,yCAAS,EACnC,OACA,OACA;IAEF,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAQ;IAE1B,IAAI,iBAAiB,MAAM,UAAU,IAAI,MACvC,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,GAAG,KAAK,KAAK,GAAG,IAAI,MAAM,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,2BAA2B;SAE5G,gDAAgD;IAChD,OAAO,QAAQ,CAAC,gBAAgB;IAGlC,IAAI,aACF,MAAM,UAAU,IAAI,QAAS,CAAA,MAAM,YAAY,KAAK,SAAS,MAAM,YAAY,CAA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;gBACb,iCAAiC;gBACjC,GAAG,UAAU;YACf;QACF;IACF;IAEA,IAAI,qBAAqB,CAAA,GAAA,yCAAoB,EAAE,KAAK,KAAK;IACzD,IAAI,YAAY,OAAO,SAAS,GAAG,qBAAqB,CAAC;IACzD,OAAO;QACL,UAAU;YACR,GAAG,CAAA,GAAA,yCAAS,EAAE,UAAU,kBAAkB,UAAU;YACpD,mBAAmB,CAAA,GAAA,wCAAe,EAAE,OAAwB,KAAK,GAAG;QACtE;2BACA;QACA,GAAG,MAAM;IACX;AACF;AAEA,SAAS,mCAAa,UAAqC,EAAE,IAAmB;IAC9E,IAAI,kBAAkB,MACpB,OAAO,KAAK,YAAY,IAAI,OAAO,WAAW,OAAO,CAAC,KAAK,YAAY,IAAI;SAE3E,OAAO,MAAM,IAAI,CAAC,KAAK,UAAU,EAAE,QAAQ,CAAC,CAAA,OAAQ,KAAK,SAAS,KAAK,KAAK,GAAG;AAEnF","sources":["packages/react-aria/src/table/useTableRow.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\n\nimport {Collection, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '../grid/useGridRow';\nimport {HTMLAttributes} from 'react';\nimport intlMessages from '../../intl/table/*.json';\nimport {ITableCollection} from 'react-stately/private/table/TableCollection';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableState} from 'react-stately/useTableState';\nimport {TreeGridState} from 'react-stately/private/table/useTreeGridState';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n collapse: {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\nexport interface TableRowAria extends GridRowAria {\n expandButtonProps: AriaButtonProps;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n *\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(\n props: GridRowProps<T>,\n state: TableState<T> | TreeGridState<T>,\n ref: RefObject<FocusableElement | null>\n): TableRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, ITableCollection<T>, TableState<T>>(\n props,\n state as TableState<T>,\n ref\n );\n let {direction} = useLocale();\n\n if (isVirtualized && state.treeColumn == null) {\n // oxlint-disable-next-line react/react-compiler\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n // oxlint-disable-next-line react/react-compiler\n delete rowProps['aria-rowindex'];\n }\n\n let isExpanded =\n state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let labelProps = useLabels({\n 'aria-label': isExpanded\n ? stringFormatter.format('collapse')\n : stringFormatter.format('expand'),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n });\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let expandButtonProps: AriaButtonProps = {};\n if (state.treeColumn != null) {\n let treeNode = state.collection.getItem(node.key);\n if (treeNode != null) {\n let lastChild = getLastChild(state.collection, node);\n let hasChildRows =\n treeNode.props?.hasChildRows ||\n treeNode.props?.UNSTABLE_childItems ||\n lastChild?.type !== 'cell';\n let parent = state.collection.getItem(node.parentKey!)!;\n let isParentBody = parent.type === 'tablebody' || parent.type === 'body';\n let lastSibling = getLastChild(state.collection, parent)!;\n while (lastSibling && lastSibling.type !== 'item' && lastSibling.prevKey != null) {\n lastSibling = state.collection.getItem(lastSibling.prevKey)!;\n }\n\n treeGridRowProps = {\n onKeyDown: e => {\n if (\n e.key === EXPANSION_KEYS['expand'][direction] &&\n state.selectionManager.focusedKey === treeNode.key &&\n hasChildRows &&\n state.expandedKeys !== 'all' &&\n !state.expandedKeys.has(treeNode.key)\n ) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n e.key === EXPANSION_KEYS['collapse'][direction] &&\n state.selectionManager.focusedKey === treeNode.key\n ) {\n if (state.expandedKeys !== 'all') {\n if (hasChildRows && state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n !state.expandedKeys.has(treeNode.key) &&\n treeNode.parentKey != null &&\n treeNode.level > 0\n ) {\n // Item is a leaf or already collapsed, move focus to parent\n state.selectionManager.setFocusedKey(treeNode.parentKey);\n e.stopPropagation();\n }\n } else if (state.expandedKeys === 'all') {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n }\n },\n 'aria-expanded': hasChildRows\n ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key)\n : undefined,\n 'aria-level': treeNode.level + 1,\n 'aria-posinset': treeNode.index - (isParentBody ? 0 : state.collection.columnCount) + 1,\n 'aria-setsize': lastSibling.index - (isParentBody ? 0 : state.collection.columnCount) + 1\n };\n\n expandButtonProps = {\n isDisabled: states.isDisabled,\n onPress: () => {\n if (!states.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n // @ts-ignore\n 'data-react-aria-prevent-focus': true,\n ...labelProps\n };\n }\n }\n\n let syntheticLinkProps = useSyntheticLinkProps(node.props);\n let linkProps = states.hasAction ? syntheticLinkProps : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n },\n expandButtonProps,\n ...states\n };\n}\n\nfunction getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {\n if ('lastChildKey' in node) {\n return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;\n } else {\n return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);\n }\n}\n"],"names":[],"version":3,"file":"useTableRow.js.map"}
|
|
@@ -43,8 +43,10 @@ function $d5954d038bf91c37$export$7f2f6ae19e707aa5(props, state, ref) {
|
|
|
43
43
|
let { node: node, isVirtualized: isVirtualized } = props;
|
|
44
44
|
let { rowProps: rowProps, ...states } = (0, $6b16276e8bbdaf8e$export$96357d5a73f686fa)(props, state, ref);
|
|
45
45
|
let { direction: direction } = (0, $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7)();
|
|
46
|
-
if (isVirtualized && state.treeColumn == null)
|
|
47
|
-
|
|
46
|
+
if (isVirtualized && state.treeColumn == null) // oxlint-disable-next-line react/react-compiler
|
|
47
|
+
rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based
|
|
48
|
+
else // oxlint-disable-next-line react/react-compiler
|
|
49
|
+
delete rowProps['aria-rowindex'];
|
|
48
50
|
let isExpanded = state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));
|
|
49
51
|
let stringFormatter = (0, $cf2482eff2eeeec2$export$f12b703ca79dfbb1)((0, ($parcel$interopDefault($eezcW$intlStringsmjs))), '@react-aria/table');
|
|
50
52
|
let labelProps = (0, $e8ac3c3f5d4bae7f$export$d6875122194c7b44)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBD,MAAM,uCAAiB;IACrB,QAAQ;QACN,KAAK;QACL,KAAK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AC/B,iBAAiB,SAAS,KAAK,GAAI,CAAA,eAAe,IAAI,MAAM,UAAU,CAAC,WAAW,AAAD,IAAK;gBACtF,gBAAgB,YAAY,KAAK,GAAI,CAAA,eAAe,IAAI,MAAM,UAAU,CAAC,WAAW,AAAD,IAAK;YAC1F;YAEA,oBAAoB;gBAClB,YAAY,OAAO,UAAU;gBAC7B,SAAS;oBACP,IAAI,CAAC,OAAO,UAAU,EAAE;wBACtB,MAAM,SAAS,CAAC,KAAK,GAAG;wBACxB,MAAM,gBAAgB,CAAC,UAAU,CAAC;wBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC,KAAK,GAAG;oBAC/C;gBACF;gBACA,qBAAqB;gBACrB,qBAAqB;gBACrB,aAAa;gBACb,iCAAiC;gBACjC,GAAG,UAAU;YACf;QACF;IACF;IAEA,IAAI,qBAAqB,CAAA,GAAA,yCAAoB,EAAE,KAAK,KAAK;IACzD,IAAI,YAAY,OAAO,SAAS,GAAG,qBAAqB,CAAC;IACzD,OAAO;QACL,UAAU;YACR,GAAG,CAAA,GAAA,yCAAS,EAAE,UAAU,kBAAkB,UAAU;YACpD,mBAAmB,CAAA,GAAA,wCAAe,EAAE,OAAwB,KAAK,GAAG;QACtE;2BACA;QACA,GAAG,MAAM;IACX;AACF;AAEA,SAAS,mCAAa,UAAqC,EAAE,IAAmB;IAC9E,IAAI,kBAAkB,MACpB,OAAO,KAAK,YAAY,IAAI,OAAO,WAAW,OAAO,CAAC,KAAK,YAAY,IAAI;SAE3E,OAAO,MAAM,IAAI,CAAC,KAAK,UAAU,EAAE,QAAQ,CAAC,CAAA,OAAQ,KAAK,SAAS,KAAK,KAAK,GAAG;AAEnF","sources":["packages/react-aria/src/table/useTableRow.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\n\nimport {Collection, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '../grid/useGridRow';\nimport {HTMLAttributes} from 'react';\nimport intlMessages from '../../intl/table/*.json';\nimport {ITableCollection} from 'react-stately/private/table/TableCollection';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableState} from 'react-stately/useTableState';\nimport {TreeGridState} from 'react-stately/private/table/useTreeGridState';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n collapse: {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\nexport interface TableRowAria extends GridRowAria {\n expandButtonProps: AriaButtonProps;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n *\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(\n props: GridRowProps<T>,\n state: TableState<T> | TreeGridState<T>,\n ref: RefObject<FocusableElement | null>\n): TableRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, ITableCollection<T>, TableState<T>>(\n props,\n state as TableState<T>,\n ref\n );\n let {direction} = useLocale();\n\n if (isVirtualized && state.treeColumn == null) {\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n delete rowProps['aria-rowindex'];\n }\n\n let isExpanded =\n state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let labelProps = useLabels({\n 'aria-label': isExpanded\n ? stringFormatter.format('collapse')\n : stringFormatter.format('expand'),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n });\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let expandButtonProps: AriaButtonProps = {};\n if (state.treeColumn != null) {\n let treeNode = state.collection.getItem(node.key);\n if (treeNode != null) {\n let lastChild = getLastChild(state.collection, node);\n let hasChildRows =\n treeNode.props?.hasChildRows ||\n treeNode.props?.UNSTABLE_childItems ||\n lastChild?.type !== 'cell';\n let parent = state.collection.getItem(node.parentKey!)!;\n let isParentBody = parent.type === 'tablebody' || parent.type === 'body';\n let lastSibling = getLastChild(state.collection, parent)!;\n while (lastSibling && lastSibling.type !== 'item' && lastSibling.prevKey != null) {\n lastSibling = state.collection.getItem(lastSibling.prevKey)!;\n }\n\n treeGridRowProps = {\n onKeyDown: e => {\n if (\n e.key === EXPANSION_KEYS['expand'][direction] &&\n state.selectionManager.focusedKey === treeNode.key &&\n hasChildRows &&\n state.expandedKeys !== 'all' &&\n !state.expandedKeys.has(treeNode.key)\n ) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n e.key === EXPANSION_KEYS['collapse'][direction] &&\n state.selectionManager.focusedKey === treeNode.key\n ) {\n if (state.expandedKeys !== 'all') {\n if (hasChildRows && state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n !state.expandedKeys.has(treeNode.key) &&\n treeNode.parentKey != null &&\n treeNode.level > 0\n ) {\n // Item is a leaf or already collapsed, move focus to parent\n state.selectionManager.setFocusedKey(treeNode.parentKey);\n e.stopPropagation();\n }\n } else if (state.expandedKeys === 'all') {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n }\n },\n 'aria-expanded': hasChildRows\n ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key)\n : undefined,\n 'aria-level': treeNode.level + 1,\n 'aria-posinset': treeNode.index - (isParentBody ? 0 : state.collection.columnCount) + 1,\n 'aria-setsize': lastSibling.index - (isParentBody ? 0 : state.collection.columnCount) + 1\n };\n\n expandButtonProps = {\n isDisabled: states.isDisabled,\n onPress: () => {\n if (!states.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n // @ts-ignore\n 'data-react-aria-prevent-focus': true,\n ...labelProps\n };\n }\n }\n\n let syntheticLinkProps = useSyntheticLinkProps(node.props);\n let linkProps = states.hasAction ? syntheticLinkProps : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n },\n expandButtonProps,\n ...states\n };\n}\n\nfunction getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {\n if ('lastChildKey' in node) {\n return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;\n } else {\n return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);\n }\n}\n"],"names":[],"version":3,"file":"useTableRow.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAkBD,MAAM,uCAAiB;IACrB,QAAQ;QACN,KAAK;QACL,KAAK;IACP;IACA,UAAU;QACR,KAAK;QACL,KAAK;IACP;AACF;AAYO,SAAS,0CACd,KAAsB,EACtB,KAAuC,EACvC,GAAuC;IAEvC,IAAI,QAAC,IAAI,iBAAE,aAAa,EAAC,GAAG;IAC5B,IAAI,YAAC,QAAQ,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,yCAAS,EACnC,OACA,OACA;IAEF,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAQ;IAE1B,IAAI,iBAAiB,MAAM,UAAU,IAAI,MACvC,gDAAgD;IAChD,QAAQ,CA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AC,UAAU,CAAC;wBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC,KAAK,GAAG;oBAC/C;gBACF;gBACA,qBAAqB;gBACrB,qBAAqB;gBACrB,aAAa;gBACb,iCAAiC;gBACjC,GAAG,UAAU;YACf;QACF;IACF;IAEA,IAAI,qBAAqB,CAAA,GAAA,yCAAoB,EAAE,KAAK,KAAK;IACzD,IAAI,YAAY,OAAO,SAAS,GAAG,qBAAqB,CAAC;IACzD,OAAO;QACL,UAAU;YACR,GAAG,CAAA,GAAA,yCAAS,EAAE,UAAU,kBAAkB,UAAU;YACpD,mBAAmB,CAAA,GAAA,wCAAe,EAAE,OAAwB,KAAK,GAAG;QACtE;2BACA;QACA,GAAG,MAAM;IACX;AACF;AAEA,SAAS,mCAAa,UAAqC,EAAE,IAAmB;IAC9E,IAAI,kBAAkB,MACpB,OAAO,KAAK,YAAY,IAAI,OAAO,WAAW,OAAO,CAAC,KAAK,YAAY,IAAI;SAE3E,OAAO,MAAM,IAAI,CAAC,KAAK,UAAU,EAAE,QAAQ,CAAC,CAAA,OAAQ,KAAK,SAAS,KAAK,KAAK,GAAG;AAEnF","sources":["packages/react-aria/src/table/useTableRow.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\n\nimport {Collection, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '../grid/useGridRow';\nimport {HTMLAttributes} from 'react';\nimport intlMessages from '../../intl/table/*.json';\nimport {ITableCollection} from 'react-stately/private/table/TableCollection';\nimport {mergeProps} from '../utils/mergeProps';\nimport {TableState} from 'react-stately/useTableState';\nimport {TreeGridState} from 'react-stately/private/table/useTreeGridState';\nimport {useLabels} from '../utils/useLabels';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nconst EXPANSION_KEYS = {\n expand: {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n collapse: {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\nexport interface TableRowAria extends GridRowAria {\n expandButtonProps: AriaButtonProps;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n *\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(\n props: GridRowProps<T>,\n state: TableState<T> | TreeGridState<T>,\n ref: RefObject<FocusableElement | null>\n): TableRowAria {\n let {node, isVirtualized} = props;\n let {rowProps, ...states} = useGridRow<T, ITableCollection<T>, TableState<T>>(\n props,\n state as TableState<T>,\n ref\n );\n let {direction} = useLocale();\n\n if (isVirtualized && state.treeColumn == null) {\n // oxlint-disable-next-line react/react-compiler\n rowProps['aria-rowindex'] = node.index + 1 + state.collection.headerRows.length; // aria-rowindex is 1 based\n } else {\n // oxlint-disable-next-line react/react-compiler\n delete rowProps['aria-rowindex'];\n }\n\n let isExpanded =\n state.treeColumn != null && (state.expandedKeys === 'all' || state.expandedKeys.has(node.key));\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n let labelProps = useLabels({\n 'aria-label': isExpanded\n ? stringFormatter.format('collapse')\n : stringFormatter.format('expand'),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n });\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let expandButtonProps: AriaButtonProps = {};\n if (state.treeColumn != null) {\n let treeNode = state.collection.getItem(node.key);\n if (treeNode != null) {\n let lastChild = getLastChild(state.collection, node);\n let hasChildRows =\n treeNode.props?.hasChildRows ||\n treeNode.props?.UNSTABLE_childItems ||\n lastChild?.type !== 'cell';\n let parent = state.collection.getItem(node.parentKey!)!;\n let isParentBody = parent.type === 'tablebody' || parent.type === 'body';\n let lastSibling = getLastChild(state.collection, parent)!;\n while (lastSibling && lastSibling.type !== 'item' && lastSibling.prevKey != null) {\n lastSibling = state.collection.getItem(lastSibling.prevKey)!;\n }\n\n treeGridRowProps = {\n onKeyDown: e => {\n if (\n e.key === EXPANSION_KEYS['expand'][direction] &&\n state.selectionManager.focusedKey === treeNode.key &&\n hasChildRows &&\n state.expandedKeys !== 'all' &&\n !state.expandedKeys.has(treeNode.key)\n ) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n e.key === EXPANSION_KEYS['collapse'][direction] &&\n state.selectionManager.focusedKey === treeNode.key\n ) {\n if (state.expandedKeys !== 'all') {\n if (hasChildRows && state.expandedKeys.has(treeNode.key)) {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n } else if (\n !state.expandedKeys.has(treeNode.key) &&\n treeNode.parentKey != null &&\n treeNode.level > 0\n ) {\n // Item is a leaf or already collapsed, move focus to parent\n state.selectionManager.setFocusedKey(treeNode.parentKey);\n e.stopPropagation();\n }\n } else if (state.expandedKeys === 'all') {\n state.toggleKey(treeNode.key);\n e.stopPropagation();\n }\n }\n },\n 'aria-expanded': hasChildRows\n ? state.expandedKeys === 'all' || state.expandedKeys.has(node.key)\n : undefined,\n 'aria-level': treeNode.level + 1,\n 'aria-posinset': treeNode.index - (isParentBody ? 0 : state.collection.columnCount) + 1,\n 'aria-setsize': lastSibling.index - (isParentBody ? 0 : state.collection.columnCount) + 1\n };\n\n expandButtonProps = {\n isDisabled: states.isDisabled,\n onPress: () => {\n if (!states.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n // @ts-ignore\n 'data-react-aria-prevent-focus': true,\n ...labelProps\n };\n }\n }\n\n let syntheticLinkProps = useSyntheticLinkProps(node.props);\n let linkProps = states.hasAction ? syntheticLinkProps : {};\n return {\n rowProps: {\n ...mergeProps(rowProps, treeGridRowProps, linkProps),\n 'aria-labelledby': getRowLabelledBy(state as TableState<T>, node.key)\n },\n expandButtonProps,\n ...states\n };\n}\n\nfunction getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) {\n if ('lastChildKey' in node) {\n return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null;\n } else {\n return Array.from(node.childNodes).findLast(item => item.parentKey === node.key);\n }\n}\n"],"names":[],"version":3,"file":"useTableRow.mjs.map"}
|
|
@@ -7,6 +7,7 @@ var $cfe896014413cb8c$exports = require("../interactions/useFocusable.cjs");
|
|
|
7
7
|
var $d07dc266c3dc14c0$exports = require("../gridlist/useGridListItem.cjs");
|
|
8
8
|
var $7ac82d1fee77eb8a$exports = require("../utils/useId.cjs");
|
|
9
9
|
var $d0df89f3abe2c2ca$exports = require("../interactions/useFocusVisible.cjs");
|
|
10
|
+
var $6d2f10bb8b359da5$exports = require("../interactions/useKeyboard.cjs");
|
|
10
11
|
var $d4e8e26182baab6e$exports = require("../i18n/useLocalizedStringFormatter.cjs");
|
|
11
12
|
var $75bd88aab025820b$exports = require("../utils/openLink.cjs");
|
|
12
13
|
|
|
@@ -41,6 +42,7 @@ $parcel$export(module.exports, "useTag", function () { return $e6145a72dc2af01a$
|
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
|
|
44
46
|
function $e6145a72dc2af01a$export$3f568fff7dff2f03(props, state, ref) {
|
|
45
47
|
let { item: item } = props;
|
|
46
48
|
let stringFormatter = (0, $d4e8e26182baab6e$exports.useLocalizedStringFormatter)((0, ($parcel$interopDefault($a3175550c11b26b5$exports))), '@react-aria/tag');
|
|
@@ -52,16 +54,24 @@ function $e6145a72dc2af01a$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
52
54
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
55
|
let { descriptionProps: _, ...stateWithoutDescription } = states;
|
|
54
56
|
let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
let { keyboardProps: keyboardProps } = (0, $6d2f10bb8b359da5$exports.useKeyboard)({
|
|
58
|
+
isDisabled: isDisabled,
|
|
59
|
+
shortcuts: {
|
|
60
|
+
Delete: ()=>{
|
|
61
|
+
if (state.selectionManager.isSelected(item.key)) onRemove?.(new Set(state.selectionManager.selectedKeys));
|
|
62
|
+
else onRemove?.(new Set([
|
|
63
|
+
item.key
|
|
64
|
+
]));
|
|
65
|
+
},
|
|
66
|
+
Backspace: ()=>{
|
|
67
|
+
if (state.selectionManager.isSelected(item.key)) onRemove?.(new Set(state.selectionManager.selectedKeys));
|
|
68
|
+
else onRemove?.(new Set([
|
|
69
|
+
item.key
|
|
70
|
+
]));
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
allowRepeats: true
|
|
74
|
+
});
|
|
65
75
|
let modality = (0, $d0df89f3abe2c2ca$exports.useInteractionModality)();
|
|
66
76
|
if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) modality = 'pointer';
|
|
67
77
|
let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';
|
|
@@ -88,7 +98,7 @@ function $e6145a72dc2af01a$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
88
98
|
},
|
|
89
99
|
rowProps: (0, $89b39774f3b79dbb$exports.mergeProps)(focusableProps, rowProps, domProps, linkProps, {
|
|
90
100
|
tabIndex: tabIndex,
|
|
91
|
-
|
|
101
|
+
...onRemove ? keyboardProps : {},
|
|
92
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.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\nimport {DOMAttributes, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {hookData} from './useTagGroup';\nimport intlMessages from '../../intl/tag/*.json';\nimport type {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {SelectableItemStates} from '../selection/useSelectableItem';\nimport {useDescription} from '../utils/useDescription';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {useGridListItem} from '../gridlist/useGridListItem';\nimport {useId} from '../utils/useId';\nimport {useInteractionModality} from '../interactions/useFocusVisible';\nimport {useKeyboard} from '../interactions/useKeyboard';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nexport interface TagAria extends SelectableItemStates {\n /** Props for the tag row element. */\n rowProps: DOMAttributes;\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes;\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps;\n /** Whether the tag can be removed. */\n allowsRemoving: boolean;\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n *\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(\n props: AriaTagProps<T>,\n state: ListState<T>,\n ref: RefObject<FocusableElement | null>\n): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem(\n {\n node: item\n },\n state,\n ref\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;\n let {keyboardProps} = useKeyboard({\n isDisabled,\n shortcuts: {\n Delete: () => {\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n },\n Backspace: () => {\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n }\n },\n allowRepeats: true\n });\n\n let modality = useInteractionModality();\n if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) {\n modality = 'pointer';\n }\n let description =\n onRemove && (modality === 'keyboard' || modality === 'virtual')\n ? stringFormatter.format('removeDescription')\n : '';\n let descProps = useDescription(description);\n\n let isItemFocused = item.key === state.selectionManager.focusedKey;\n let isFocused = state.selectionManager.focusedKey != null;\n let tabIndex = -1;\n if (!isDisabled && (isItemFocused || !isFocused)) {\n tabIndex = 0;\n }\n\n let domProps = filterDOMProps(item.props);\n let linkProps = useSyntheticLinkProps(item.props);\n let {focusableProps} = useFocusable(\n {\n ...item.props,\n isDisabled\n },\n ref\n );\n\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n isDisabled,\n id: buttonId,\n onPress: () => (onRemove ? onRemove(new Set([item.key])) : null)\n },\n rowProps: mergeProps(focusableProps, rowProps, domProps, linkProps, {\n tabIndex,\n ...(onRemove ? keyboardProps : {}),\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...stateWithoutDescription,\n allowsRemoving: !!onRemove\n };\n}\n"],"names":[],"version":3,"file":"useTag.cjs.map"}
|
|
@@ -7,6 +7,7 @@ import {useFocusable as $088f27a386bc4a8f$export$4c014de7c8940b4c} from "../inte
|
|
|
7
7
|
import {useGridListItem as $7d08662b45460e3b$export$9610e69494fadfd2} from "../gridlist/useGridListItem.js";
|
|
8
8
|
import {useId as $0292efe68908de6b$export$f680877a34711e37} from "../utils/useId.js";
|
|
9
9
|
import {useInteractionModality as $b50b1cc8a843ace7$export$98e20ec92f614cfe} from "../interactions/useFocusVisible.js";
|
|
10
|
+
import {useKeyboard as $bf74df7506f65576$export$8f71654801c2f7cd} from "../interactions/useKeyboard.js";
|
|
10
11
|
import {useLocalizedStringFormatter as $1adfa757ef3cd864$export$f12b703ca79dfbb1} from "../i18n/useLocalizedStringFormatter.js";
|
|
11
12
|
import {useSyntheticLinkProps as $044d3c97ce5d6621$export$bdc77b0c0a3a85d6} from "../utils/openLink.js";
|
|
12
13
|
|
|
@@ -35,6 +36,7 @@ function $parcel$interopDefault(a) {
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
39
|
+
|
|
38
40
|
function $b13ee33d16055494$export$3f568fff7dff2f03(props, state, ref) {
|
|
39
41
|
let { item: item } = props;
|
|
40
42
|
let stringFormatter = (0, $1adfa757ef3cd864$export$f12b703ca79dfbb1)((0, ($parcel$interopDefault($ecwFx$intlStringsjs))), '@react-aria/tag');
|
|
@@ -46,16 +48,24 @@ function $b13ee33d16055494$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
46
48
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
47
49
|
let { descriptionProps: _, ...stateWithoutDescription } = states;
|
|
48
50
|
let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
let { keyboardProps: keyboardProps } = (0, $bf74df7506f65576$export$8f71654801c2f7cd)({
|
|
52
|
+
isDisabled: isDisabled,
|
|
53
|
+
shortcuts: {
|
|
54
|
+
Delete: ()=>{
|
|
55
|
+
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
|
|
56
|
+
else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
|
|
57
|
+
item.key
|
|
58
|
+
]));
|
|
59
|
+
},
|
|
60
|
+
Backspace: ()=>{
|
|
61
|
+
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
|
|
62
|
+
else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
|
|
63
|
+
item.key
|
|
64
|
+
]));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
allowRepeats: true
|
|
68
|
+
});
|
|
59
69
|
let modality = (0, $b50b1cc8a843ace7$export$98e20ec92f614cfe)();
|
|
60
70
|
if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) modality = 'pointer';
|
|
61
71
|
let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';
|
|
@@ -82,7 +92,7 @@ function $b13ee33d16055494$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
82
92
|
},
|
|
83
93
|
rowProps: (0, $64c36edd757dfa16$export$9d1611c77c2fe928)(focusableProps, rowProps, domProps, linkProps, {
|
|
84
94
|
tabIndex: tabIndex,
|
|
85
|
-
|
|
95
|
+
...onRemove ? keyboardProps : {},
|
|
86
96
|
'aria-describedby': descProps['aria-describedby']
|
|
87
97
|
}),
|
|
88
98
|
gridCellProps: (0, $64c36edd757dfa16$export$9d1611c77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. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '../button/useButton';\nimport {DOMAttributes, FocusableElement, Node, RefObject} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {hookData} from './useTagGroup';\nimport intlMessages from '../../intl/tag/*.json';\nimport type {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {SelectableItemStates} from '../selection/useSelectableItem';\nimport {useDescription} from '../utils/useDescription';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {useGridListItem} from '../gridlist/useGridListItem';\nimport {useId} from '../utils/useId';\nimport {useInteractionModality} from '../interactions/useFocusVisible';\nimport {useKeyboard} from '../interactions/useKeyboard';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useSyntheticLinkProps} from '../utils/openLink';\n\nexport interface TagAria extends SelectableItemStates {\n /** Props for the tag row element. */\n rowProps: DOMAttributes;\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes;\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps;\n /** Whether the tag can be removed. */\n allowsRemoving: boolean;\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n *\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(\n props: AriaTagProps<T>,\n state: ListState<T>,\n ref: RefObject<FocusableElement | null>\n): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem(\n {\n node: item\n },\n state,\n ref\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;\n let {keyboardProps} = useKeyboard({\n isDisabled,\n shortcuts: {\n Delete: () => {\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n },\n Backspace: () => {\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n }\n },\n allowRepeats: true\n });\n\n let modality = useInteractionModality();\n if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) {\n modality = 'pointer';\n }\n let description =\n onRemove && (modality === 'keyboard' || modality === 'virtual')\n ? stringFormatter.format('removeDescription')\n : '';\n let descProps = useDescription(description);\n\n let isItemFocused = item.key === state.selectionManager.focusedKey;\n let isFocused = state.selectionManager.focusedKey != null;\n let tabIndex = -1;\n if (!isDisabled && (isItemFocused || !isFocused)) {\n tabIndex = 0;\n }\n\n let domProps = filterDOMProps(item.props);\n let linkProps = useSyntheticLinkProps(item.props);\n let {focusableProps} = useFocusable(\n {\n ...item.props,\n isDisabled\n },\n ref\n );\n\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n isDisabled,\n id: buttonId,\n onPress: () => (onRemove ? onRemove(new Set([item.key])) : null)\n },\n rowProps: mergeProps(focusableProps, rowProps, domProps, linkProps, {\n tabIndex,\n ...(onRemove ? keyboardProps : {}),\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...stateWithoutDescription,\n allowsRemoving: !!onRemove\n };\n}\n"],"names":[],"version":3,"file":"useTag.js.map"}
|