react-aria 3.48.0 → 3.50.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/CollectionBuilder.cjs.map +1 -1
- package/dist/exports/CollectionBuilder.js.map +1 -1
- package/dist/exports/CollectionBuilder.mjs.map +1 -1
- package/dist/exports/index.cjs +12 -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/actiongroup/useActionGroup.cjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroup.js.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroup.mjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroupItem.cjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroupItem.js.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroupItem.mjs.map +1 -1
- package/dist/exports/private/autocomplete/useSearchAutocomplete.cjs.map +1 -1
- package/dist/exports/private/autocomplete/useSearchAutocomplete.js.map +1 -1
- package/dist/exports/private/autocomplete/useSearchAutocomplete.mjs.map +1 -1
- package/dist/exports/private/collections/BaseCollection.cjs.map +1 -1
- package/dist/exports/private/collections/BaseCollection.js.map +1 -1
- package/dist/exports/private/collections/BaseCollection.mjs.map +1 -1
- package/dist/exports/private/collections/useCachedChildren.cjs.map +1 -1
- package/dist/exports/private/collections/useCachedChildren.js.map +1 -1
- package/dist/exports/private/collections/useCachedChildren.mjs.map +1 -1
- package/dist/exports/private/focus/FocusScope.cjs.map +1 -1
- package/dist/exports/private/focus/FocusScope.js.map +1 -1
- package/dist/exports/private/focus/FocusScope.mjs.map +1 -1
- package/dist/exports/private/focus/virtualFocus.cjs.map +1 -1
- package/dist/exports/private/focus/virtualFocus.js.map +1 -1
- package/dist/exports/private/focus/virtualFocus.mjs.map +1 -1
- package/dist/exports/private/grid/GridKeyboardDelegate.cjs.map +1 -1
- package/dist/exports/private/grid/GridKeyboardDelegate.js.map +1 -1
- package/dist/exports/private/grid/GridKeyboardDelegate.mjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionAnnouncement.cjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionAnnouncement.js.map +1 -1
- package/dist/exports/private/grid/useGridSelectionAnnouncement.mjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionCheckbox.cjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionCheckbox.js.map +1 -1
- package/dist/exports/private/grid/useGridSelectionCheckbox.mjs.map +1 -1
- package/dist/exports/private/grid/useHighlightSelectionDescription.cjs.map +1 -1
- package/dist/exports/private/grid/useHighlightSelectionDescription.js.map +1 -1
- package/dist/exports/private/grid/useHighlightSelectionDescription.mjs.map +1 -1
- package/dist/exports/private/interactions/useFocusVisible.cjs.map +1 -1
- package/dist/exports/private/interactions/useFocusVisible.js.map +1 -1
- package/dist/exports/private/interactions/useFocusVisible.mjs.map +1 -1
- package/dist/exports/private/interactions/useFocusable.cjs.map +1 -1
- package/dist/exports/private/interactions/useFocusable.js.map +1 -1
- package/dist/exports/private/interactions/useFocusable.mjs.map +1 -1
- package/dist/exports/private/landmark/useLandmark.cjs.map +1 -1
- package/dist/exports/private/landmark/useLandmark.js.map +1 -1
- package/dist/exports/private/landmark/useLandmark.mjs.map +1 -1
- package/dist/exports/private/live-announcer/LiveAnnouncer.cjs.map +1 -1
- package/dist/exports/private/live-announcer/LiveAnnouncer.js.map +1 -1
- package/dist/exports/private/live-announcer/LiveAnnouncer.mjs.map +1 -1
- package/dist/exports/private/overlays/useModal.cjs.map +1 -1
- package/dist/exports/private/overlays/useModal.js.map +1 -1
- package/dist/exports/private/overlays/useModal.mjs.map +1 -1
- package/dist/exports/private/selection/useSelectableCollection.cjs.map +1 -1
- package/dist/exports/private/selection/useSelectableCollection.js.map +1 -1
- package/dist/exports/private/selection/useSelectableCollection.mjs.map +1 -1
- package/dist/exports/private/selection/useSelectableItem.cjs.map +1 -1
- package/dist/exports/private/selection/useSelectableItem.js.map +1 -1
- package/dist/exports/private/selection/useSelectableItem.mjs.map +1 -1
- package/dist/exports/private/selection/useSelectableList.cjs.map +1 -1
- package/dist/exports/private/selection/useSelectableList.js.map +1 -1
- package/dist/exports/private/selection/useSelectableList.mjs.map +1 -1
- package/dist/exports/private/selection/useTypeSelect.cjs.map +1 -1
- package/dist/exports/private/selection/useTypeSelect.js.map +1 -1
- package/dist/exports/private/selection/useTypeSelect.mjs.map +1 -1
- package/dist/exports/private/spinbutton/useSpinButton.cjs.map +1 -1
- package/dist/exports/private/spinbutton/useSpinButton.js.map +1 -1
- package/dist/exports/private/spinbutton/useSpinButton.mjs.map +1 -1
- package/dist/exports/private/steplist/useStepList.cjs.map +1 -1
- package/dist/exports/private/steplist/useStepList.js.map +1 -1
- package/dist/exports/private/steplist/useStepList.mjs.map +1 -1
- package/dist/exports/private/steplist/useStepListItem.cjs.map +1 -1
- package/dist/exports/private/steplist/useStepListItem.js.map +1 -1
- package/dist/exports/private/steplist/useStepListItem.mjs.map +1 -1
- package/dist/exports/private/utils/openLink.cjs.map +1 -1
- package/dist/exports/private/utils/openLink.js.map +1 -1
- package/dist/exports/private/utils/openLink.mjs.map +1 -1
- package/dist/exports/private/utils/platform.cjs.map +1 -1
- package/dist/exports/private/utils/platform.js.map +1 -1
- package/dist/exports/private/utils/platform.mjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.cjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.js.map +1 -1
- package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.mjs.map +1 -1
- package/dist/exports/private/utils/useLoadMoreSentinel.cjs.map +1 -1
- package/dist/exports/private/utils/useLoadMoreSentinel.js.map +1 -1
- package/dist/exports/private/utils/useLoadMoreSentinel.mjs.map +1 -1
- package/dist/exports/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
- package/dist/exports/private/virtualizer/useVirtualizerItem.js.map +1 -1
- package/dist/exports/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
- package/dist/exports/private/virtualizer/utils.cjs.map +1 -1
- package/dist/exports/private/virtualizer/utils.js.map +1 -1
- package/dist/exports/private/virtualizer/utils.mjs.map +1 -1
- package/dist/exports/useAutocomplete.cjs.map +1 -1
- package/dist/exports/useAutocomplete.js.map +1 -1
- package/dist/exports/useAutocomplete.mjs.map +1 -1
- package/dist/exports/useBreadcrumbs.cjs.map +1 -1
- package/dist/exports/useBreadcrumbs.js.map +1 -1
- package/dist/exports/useBreadcrumbs.mjs.map +1 -1
- package/dist/exports/useButton.cjs.map +1 -1
- package/dist/exports/useButton.js.map +1 -1
- package/dist/exports/useButton.mjs.map +1 -1
- package/dist/exports/useCalendar.cjs +9 -0
- package/dist/exports/useCalendar.cjs.map +1 -1
- package/dist/exports/useCalendar.js +7 -1
- package/dist/exports/useCalendar.js.map +1 -1
- package/dist/exports/useCalendar.mjs +7 -1
- package/dist/exports/useCalendar.mjs.map +1 -1
- package/dist/exports/useClipboard.cjs.map +1 -1
- package/dist/exports/useClipboard.js.map +1 -1
- package/dist/exports/useClipboard.mjs.map +1 -1
- package/dist/exports/useColorArea.cjs.map +1 -1
- package/dist/exports/useColorArea.js.map +1 -1
- package/dist/exports/useColorArea.mjs.map +1 -1
- package/dist/exports/useColorField.cjs.map +1 -1
- package/dist/exports/useColorField.js.map +1 -1
- package/dist/exports/useColorField.mjs.map +1 -1
- package/dist/exports/useColorSlider.cjs.map +1 -1
- package/dist/exports/useColorSlider.js.map +1 -1
- package/dist/exports/useColorSlider.mjs.map +1 -1
- package/dist/exports/useColorWheel.cjs.map +1 -1
- package/dist/exports/useColorWheel.js.map +1 -1
- package/dist/exports/useColorWheel.mjs.map +1 -1
- package/dist/exports/useComboBox.cjs.map +1 -1
- package/dist/exports/useComboBox.js.map +1 -1
- package/dist/exports/useComboBox.mjs.map +1 -1
- package/dist/exports/useDateField.cjs.map +1 -1
- package/dist/exports/useDateField.js.map +1 -1
- package/dist/exports/useDateField.mjs.map +1 -1
- package/dist/exports/useDateRangePicker.cjs.map +1 -1
- package/dist/exports/useDateRangePicker.js.map +1 -1
- package/dist/exports/useDateRangePicker.mjs.map +1 -1
- package/dist/exports/useDisclosure.cjs +1 -1
- package/dist/exports/useDisclosure.cjs.map +1 -1
- package/dist/exports/useDisclosure.js +1 -1
- package/dist/exports/useDisclosure.js.map +1 -1
- package/dist/exports/useDisclosure.mjs +1 -1
- package/dist/exports/useDisclosure.mjs.map +1 -1
- package/dist/exports/useDrag.cjs.map +1 -1
- package/dist/exports/useDrag.js.map +1 -1
- package/dist/exports/useDrag.mjs.map +1 -1
- package/dist/exports/useDraggableCollection.cjs.map +1 -1
- package/dist/exports/useDraggableCollection.js.map +1 -1
- package/dist/exports/useDraggableCollection.mjs.map +1 -1
- package/dist/exports/useDrop.cjs.map +1 -1
- package/dist/exports/useDrop.js.map +1 -1
- package/dist/exports/useDrop.mjs.map +1 -1
- package/dist/exports/useDroppableCollection.cjs.map +1 -1
- package/dist/exports/useDroppableCollection.js.map +1 -1
- package/dist/exports/useDroppableCollection.mjs.map +1 -1
- package/dist/exports/useFocusable.cjs.map +1 -1
- package/dist/exports/useFocusable.js.map +1 -1
- package/dist/exports/useFocusable.mjs.map +1 -1
- package/dist/exports/useGridList.cjs.map +1 -1
- package/dist/exports/useGridList.js.map +1 -1
- package/dist/exports/useGridList.mjs.map +1 -1
- package/dist/exports/useInteractOutside.cjs.map +1 -1
- package/dist/exports/useInteractOutside.js.map +1 -1
- package/dist/exports/useInteractOutside.mjs.map +1 -1
- package/dist/exports/useLandmark.cjs.map +1 -1
- package/dist/exports/useLandmark.js.map +1 -1
- package/dist/exports/useLandmark.mjs.map +1 -1
- package/dist/exports/useListBox.cjs.map +1 -1
- package/dist/exports/useListBox.js.map +1 -1
- package/dist/exports/useListBox.mjs.map +1 -1
- package/dist/exports/useLocalizedStringFormatter.cjs.map +1 -1
- package/dist/exports/useLocalizedStringFormatter.js.map +1 -1
- package/dist/exports/useLocalizedStringFormatter.mjs.map +1 -1
- package/dist/exports/useMove.cjs.map +1 -1
- package/dist/exports/useMove.js.map +1 -1
- package/dist/exports/useMove.mjs.map +1 -1
- package/dist/exports/useOverlayPosition.cjs.map +1 -1
- package/dist/exports/useOverlayPosition.js.map +1 -1
- package/dist/exports/useOverlayPosition.mjs.map +1 -1
- package/dist/exports/useProgressBar.cjs.map +1 -1
- package/dist/exports/useProgressBar.js.map +1 -1
- package/dist/exports/useProgressBar.mjs.map +1 -1
- package/dist/exports/useRangeCalendar.cjs +15 -0
- package/dist/exports/useRangeCalendar.cjs.map +1 -1
- package/dist/exports/useRangeCalendar.js +11 -1
- package/dist/exports/useRangeCalendar.js.map +1 -1
- package/dist/exports/useRangeCalendar.mjs +11 -1
- package/dist/exports/useRangeCalendar.mjs.map +1 -1
- package/dist/exports/useSelect.cjs.map +1 -1
- package/dist/exports/useSelect.js.map +1 -1
- package/dist/exports/useSelect.mjs.map +1 -1
- package/dist/exports/useSlider.cjs.map +1 -1
- package/dist/exports/useSlider.js.map +1 -1
- package/dist/exports/useSlider.mjs.map +1 -1
- package/dist/exports/useTable.cjs.map +1 -1
- package/dist/exports/useTable.js.map +1 -1
- package/dist/exports/useTable.mjs.map +1 -1
- package/dist/exports/useTimeField.cjs.map +1 -1
- package/dist/exports/useTimeField.js.map +1 -1
- package/dist/exports/useTimeField.mjs.map +1 -1
- package/dist/exports/useToggleButton.cjs.map +1 -1
- package/dist/exports/useToggleButton.js.map +1 -1
- package/dist/exports/useToggleButton.mjs.map +1 -1
- package/dist/exports/useToggleButtonGroup.cjs.map +1 -1
- package/dist/exports/useToggleButtonGroup.js.map +1 -1
- package/dist/exports/useToggleButtonGroup.mjs.map +1 -1
- package/dist/exports/useTree.cjs.map +1 -1
- package/dist/exports/useTree.js.map +1 -1
- package/dist/exports/useTree.mjs.map +1 -1
- package/dist/private/actiongroup/useActionGroup.cjs +3 -3
- package/dist/private/actiongroup/useActionGroup.cjs.map +1 -1
- package/dist/private/actiongroup/useActionGroup.js +3 -3
- package/dist/private/actiongroup/useActionGroup.js.map +1 -1
- package/dist/private/actiongroup/useActionGroup.mjs +3 -3
- package/dist/private/actiongroup/useActionGroup.mjs.map +1 -1
- package/dist/private/actiongroup/useActionGroupItem.cjs +5 -4
- package/dist/private/actiongroup/useActionGroupItem.cjs.map +1 -1
- package/dist/private/actiongroup/useActionGroupItem.js +5 -4
- package/dist/private/actiongroup/useActionGroupItem.js.map +1 -1
- package/dist/private/actiongroup/useActionGroupItem.mjs +5 -4
- package/dist/private/actiongroup/useActionGroupItem.mjs.map +1 -1
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.cjs +7 -5
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.cjs.map +1 -1
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.js +7 -5
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.js.map +1 -1
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.mjs +7 -5
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.mjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.cjs +16 -7
- package/dist/private/autocomplete/useAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.js +16 -7
- package/dist/private/autocomplete/useAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.mjs +16 -7
- package/dist/private/autocomplete/useAutocomplete.mjs.map +1 -1
- package/dist/private/autocomplete/useSearchAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/useSearchAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/useSearchAutocomplete.mjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.cjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.js.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.mjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbs.cjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbs.js.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbs.mjs.map +1 -1
- package/dist/private/button/useButton.cjs.map +1 -1
- package/dist/private/button/useButton.js.map +1 -1
- package/dist/private/button/useButton.mjs.map +1 -1
- package/dist/private/button/useToggleButton.cjs.map +1 -1
- package/dist/private/button/useToggleButton.js.map +1 -1
- package/dist/private/button/useToggleButton.mjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.cjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.js.map +1 -1
- package/dist/private/button/useToggleButtonGroup.mjs.map +1 -1
- package/dist/private/calendar/useCalendar.cjs.map +1 -1
- package/dist/private/calendar/useCalendar.js.map +1 -1
- package/dist/private/calendar/useCalendar.mjs.map +1 -1
- package/dist/private/calendar/useCalendarBase.cjs.map +1 -1
- package/dist/private/calendar/useCalendarBase.js.map +1 -1
- package/dist/private/calendar/useCalendarBase.mjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.cjs +10 -14
- package/dist/private/calendar/useCalendarCell.cjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.js +10 -14
- package/dist/private/calendar/useCalendarCell.js.map +1 -1
- package/dist/private/calendar/useCalendarCell.mjs +10 -14
- package/dist/private/calendar/useCalendarCell.mjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.cjs +9 -5
- package/dist/private/calendar/useCalendarGrid.cjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.js +10 -6
- package/dist/private/calendar/useCalendarGrid.js.map +1 -1
- package/dist/private/calendar/useCalendarGrid.mjs +10 -6
- package/dist/private/calendar/useCalendarGrid.mjs.map +1 -1
- package/dist/private/calendar/useCalendarHeading.cjs +56 -0
- package/dist/private/calendar/useCalendarHeading.cjs.map +1 -0
- package/dist/private/calendar/useCalendarHeading.js +52 -0
- package/dist/private/calendar/useCalendarHeading.js.map +1 -0
- package/dist/private/calendar/useCalendarHeading.mjs +51 -0
- package/dist/private/calendar/useCalendarHeading.mjs.map +1 -0
- package/dist/private/calendar/useCalendarMonthPicker.cjs +66 -0
- package/dist/private/calendar/useCalendarMonthPicker.cjs.map +1 -0
- package/dist/private/calendar/useCalendarMonthPicker.js +61 -0
- package/dist/private/calendar/useCalendarMonthPicker.js.map +1 -0
- package/dist/private/calendar/useCalendarMonthPicker.mjs +61 -0
- package/dist/private/calendar/useCalendarMonthPicker.mjs.map +1 -0
- package/dist/private/calendar/useCalendarYearPicker.cjs +90 -0
- package/dist/private/calendar/useCalendarYearPicker.cjs.map +1 -0
- package/dist/private/calendar/useCalendarYearPicker.js +86 -0
- package/dist/private/calendar/useCalendarYearPicker.js.map +1 -0
- package/dist/private/calendar/useCalendarYearPicker.mjs +85 -0
- package/dist/private/calendar/useCalendarYearPicker.mjs.map +1 -0
- package/dist/private/calendar/useRangeCalendar.cjs +1 -1
- package/dist/private/calendar/useRangeCalendar.cjs.map +1 -1
- package/dist/private/calendar/useRangeCalendar.js +1 -1
- package/dist/private/calendar/useRangeCalendar.js.map +1 -1
- package/dist/private/calendar/useRangeCalendar.mjs +1 -1
- package/dist/private/calendar/useRangeCalendar.mjs.map +1 -1
- package/dist/private/calendar/utils.cjs +20 -4
- package/dist/private/calendar/utils.cjs.map +1 -1
- package/dist/private/calendar/utils.js +22 -5
- package/dist/private/calendar/utils.js.map +1 -1
- package/dist/private/calendar/utils.mjs +20 -4
- package/dist/private/calendar/utils.mjs.map +1 -1
- package/dist/private/checkbox/useCheckbox.cjs +6 -35
- package/dist/private/checkbox/useCheckbox.cjs.map +1 -1
- package/dist/private/checkbox/useCheckbox.js +6 -35
- package/dist/private/checkbox/useCheckbox.js.map +1 -1
- package/dist/private/checkbox/useCheckbox.mjs +6 -35
- package/dist/private/checkbox/useCheckbox.mjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroup.cjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroup.js.map +1 -1
- package/dist/private/checkbox/useCheckboxGroup.mjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.cjs +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.cjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.js +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.js.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.mjs +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.mjs.map +1 -1
- package/dist/private/checkbox/utils.cjs.map +1 -1
- package/dist/private/checkbox/utils.js.map +1 -1
- package/dist/private/checkbox/utils.mjs.map +1 -1
- package/dist/private/collections/BaseCollection.cjs +4 -4
- package/dist/private/collections/BaseCollection.cjs.map +1 -1
- package/dist/private/collections/BaseCollection.js +4 -4
- package/dist/private/collections/BaseCollection.js.map +1 -1
- package/dist/private/collections/BaseCollection.mjs +4 -4
- package/dist/private/collections/BaseCollection.mjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.cjs +5 -3
- package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.js +5 -3
- package/dist/private/collections/CollectionBuilder.js.map +1 -1
- package/dist/private/collections/CollectionBuilder.mjs +5 -3
- package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
- package/dist/private/collections/Document.cjs.map +1 -1
- package/dist/private/collections/Document.js.map +1 -1
- package/dist/private/collections/Document.mjs.map +1 -1
- package/dist/private/collections/Hidden.cjs.map +1 -1
- package/dist/private/collections/Hidden.js.map +1 -1
- package/dist/private/collections/Hidden.mjs.map +1 -1
- package/dist/private/collections/useCachedChildren.cjs +29 -8
- package/dist/private/collections/useCachedChildren.cjs.map +1 -1
- package/dist/private/collections/useCachedChildren.js +29 -8
- package/dist/private/collections/useCachedChildren.js.map +1 -1
- package/dist/private/collections/useCachedChildren.mjs +29 -8
- package/dist/private/collections/useCachedChildren.mjs.map +1 -1
- package/dist/private/color/useColorArea.cjs.map +1 -1
- package/dist/private/color/useColorArea.js.map +1 -1
- package/dist/private/color/useColorArea.mjs.map +1 -1
- package/dist/private/color/useColorAreaGradient.cjs +1 -1
- package/dist/private/color/useColorAreaGradient.cjs.map +1 -1
- package/dist/private/color/useColorAreaGradient.js +1 -1
- package/dist/private/color/useColorAreaGradient.js.map +1 -1
- package/dist/private/color/useColorAreaGradient.mjs +1 -1
- package/dist/private/color/useColorAreaGradient.mjs.map +1 -1
- package/dist/private/color/useColorChannelField.cjs.map +1 -1
- package/dist/private/color/useColorChannelField.js.map +1 -1
- package/dist/private/color/useColorChannelField.mjs.map +1 -1
- package/dist/private/color/useColorField.cjs +1 -1
- package/dist/private/color/useColorField.cjs.map +1 -1
- package/dist/private/color/useColorField.js +1 -1
- package/dist/private/color/useColorField.js.map +1 -1
- package/dist/private/color/useColorField.mjs +1 -1
- package/dist/private/color/useColorField.mjs.map +1 -1
- package/dist/private/color/useColorSlider.cjs +2 -2
- package/dist/private/color/useColorSlider.cjs.map +1 -1
- package/dist/private/color/useColorSlider.js +2 -2
- package/dist/private/color/useColorSlider.js.map +1 -1
- package/dist/private/color/useColorSlider.mjs +2 -2
- package/dist/private/color/useColorSlider.mjs.map +1 -1
- package/dist/private/color/useColorSwatch.cjs.map +1 -1
- package/dist/private/color/useColorSwatch.js.map +1 -1
- package/dist/private/color/useColorSwatch.mjs.map +1 -1
- package/dist/private/color/useColorWheel.cjs.map +1 -1
- package/dist/private/color/useColorWheel.js.map +1 -1
- package/dist/private/color/useColorWheel.mjs.map +1 -1
- package/dist/private/combobox/useComboBox.cjs +5 -3
- package/dist/private/combobox/useComboBox.cjs.map +1 -1
- package/dist/private/combobox/useComboBox.js +5 -3
- package/dist/private/combobox/useComboBox.js.map +1 -1
- package/dist/private/combobox/useComboBox.mjs +5 -3
- package/dist/private/combobox/useComboBox.mjs.map +1 -1
- package/dist/private/datepicker/useDateField.cjs.map +1 -1
- package/dist/private/datepicker/useDateField.js.map +1 -1
- package/dist/private/datepicker/useDateField.mjs.map +1 -1
- package/dist/private/datepicker/useDatePicker.cjs.map +1 -1
- package/dist/private/datepicker/useDatePicker.js.map +1 -1
- package/dist/private/datepicker/useDatePicker.mjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.cjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.js.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.mjs.map +1 -1
- package/dist/private/datepicker/useDateRangePicker.cjs.map +1 -1
- package/dist/private/datepicker/useDateRangePicker.js.map +1 -1
- package/dist/private/datepicker/useDateRangePicker.mjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.cjs +2 -2
- package/dist/private/datepicker/useDateSegment.cjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.js +2 -2
- package/dist/private/datepicker/useDateSegment.js.map +1 -1
- package/dist/private/datepicker/useDateSegment.mjs +2 -2
- package/dist/private/datepicker/useDateSegment.mjs.map +1 -1
- package/dist/private/datepicker/useDisplayNames.cjs +1 -2
- package/dist/private/datepicker/useDisplayNames.cjs.map +1 -1
- package/dist/private/datepicker/useDisplayNames.js +1 -2
- package/dist/private/datepicker/useDisplayNames.js.map +1 -1
- package/dist/private/datepicker/useDisplayNames.mjs +1 -2
- package/dist/private/datepicker/useDisplayNames.mjs.map +1 -1
- package/dist/private/dialog/useDialog.cjs.map +1 -1
- package/dist/private/dialog/useDialog.js.map +1 -1
- package/dist/private/dialog/useDialog.mjs.map +1 -1
- package/dist/private/disclosure/useDisclosure.cjs.map +1 -1
- package/dist/private/disclosure/useDisclosure.js.map +1 -1
- package/dist/private/disclosure/useDisclosure.mjs.map +1 -1
- package/dist/private/dnd/DragManager.cjs +4 -1
- package/dist/private/dnd/DragManager.cjs.map +1 -1
- package/dist/private/dnd/DragManager.js +4 -1
- package/dist/private/dnd/DragManager.js.map +1 -1
- package/dist/private/dnd/DragManager.mjs +4 -1
- package/dist/private/dnd/DragManager.mjs.map +1 -1
- package/dist/private/dnd/DragPreview.cjs.map +1 -1
- package/dist/private/dnd/DragPreview.js.map +1 -1
- package/dist/private/dnd/DragPreview.mjs.map +1 -1
- package/dist/private/dnd/DropTargetKeyboardNavigation.cjs +16 -4
- package/dist/private/dnd/DropTargetKeyboardNavigation.cjs.map +1 -1
- package/dist/private/dnd/DropTargetKeyboardNavigation.js +16 -4
- package/dist/private/dnd/DropTargetKeyboardNavigation.js.map +1 -1
- package/dist/private/dnd/DropTargetKeyboardNavigation.mjs +16 -4
- package/dist/private/dnd/DropTargetKeyboardNavigation.mjs.map +1 -1
- package/dist/private/dnd/ListDropTargetDelegate.cjs.map +1 -1
- package/dist/private/dnd/ListDropTargetDelegate.js.map +1 -1
- package/dist/private/dnd/ListDropTargetDelegate.mjs.map +1 -1
- package/dist/private/dnd/constants.cjs.map +1 -1
- package/dist/private/dnd/constants.js.map +1 -1
- package/dist/private/dnd/constants.mjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.cjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.js.map +1 -1
- package/dist/private/dnd/useAutoScroll.mjs.map +1 -1
- package/dist/private/dnd/useClipboard.cjs.map +1 -1
- package/dist/private/dnd/useClipboard.js.map +1 -1
- package/dist/private/dnd/useClipboard.mjs.map +1 -1
- package/dist/private/dnd/useDrag.cjs.map +1 -1
- package/dist/private/dnd/useDrag.js.map +1 -1
- package/dist/private/dnd/useDrag.mjs.map +1 -1
- package/dist/private/dnd/useDraggableCollection.cjs.map +1 -1
- package/dist/private/dnd/useDraggableCollection.js.map +1 -1
- package/dist/private/dnd/useDraggableCollection.mjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.cjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.js.map +1 -1
- package/dist/private/dnd/useDraggableItem.mjs.map +1 -1
- package/dist/private/dnd/useDrop.cjs.map +1 -1
- package/dist/private/dnd/useDrop.js.map +1 -1
- package/dist/private/dnd/useDrop.mjs.map +1 -1
- package/dist/private/dnd/useDropIndicator.cjs.map +1 -1
- package/dist/private/dnd/useDropIndicator.js.map +1 -1
- package/dist/private/dnd/useDropIndicator.mjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.cjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.js.map +1 -1
- package/dist/private/dnd/useDroppableCollection.mjs.map +1 -1
- package/dist/private/dnd/useDroppableItem.cjs.map +1 -1
- package/dist/private/dnd/useDroppableItem.js.map +1 -1
- package/dist/private/dnd/useDroppableItem.mjs.map +1 -1
- package/dist/private/dnd/useVirtualDrop.cjs.map +1 -1
- package/dist/private/dnd/useVirtualDrop.js.map +1 -1
- package/dist/private/dnd/useVirtualDrop.mjs.map +1 -1
- package/dist/private/dnd/utils.cjs +14 -4
- package/dist/private/dnd/utils.cjs.map +1 -1
- package/dist/private/dnd/utils.js +14 -4
- package/dist/private/dnd/utils.js.map +1 -1
- package/dist/private/dnd/utils.mjs +14 -4
- package/dist/private/dnd/utils.mjs.map +1 -1
- package/dist/private/focus/FocusRing.cjs.map +1 -1
- package/dist/private/focus/FocusRing.js.map +1 -1
- package/dist/private/focus/FocusRing.mjs.map +1 -1
- package/dist/private/focus/FocusScope.cjs +4 -1
- package/dist/private/focus/FocusScope.cjs.map +1 -1
- package/dist/private/focus/FocusScope.js +4 -1
- package/dist/private/focus/FocusScope.js.map +1 -1
- package/dist/private/focus/FocusScope.mjs +4 -1
- package/dist/private/focus/FocusScope.mjs.map +1 -1
- package/dist/private/focus/useFocusRing.cjs.map +1 -1
- package/dist/private/focus/useFocusRing.js.map +1 -1
- package/dist/private/focus/useFocusRing.mjs.map +1 -1
- package/dist/private/focus/useHasTabbableChild.cjs.map +1 -1
- package/dist/private/focus/useHasTabbableChild.js.map +1 -1
- package/dist/private/focus/useHasTabbableChild.mjs.map +1 -1
- package/dist/private/form/useFormValidation.cjs +1 -1
- package/dist/private/form/useFormValidation.cjs.map +1 -1
- package/dist/private/form/useFormValidation.js +1 -1
- package/dist/private/form/useFormValidation.js.map +1 -1
- package/dist/private/form/useFormValidation.mjs +1 -1
- package/dist/private/form/useFormValidation.mjs.map +1 -1
- package/dist/private/grid/GridKeyboardDelegate.cjs +9 -9
- package/dist/private/grid/GridKeyboardDelegate.cjs.map +1 -1
- package/dist/private/grid/GridKeyboardDelegate.js +10 -10
- package/dist/private/grid/GridKeyboardDelegate.js.map +1 -1
- package/dist/private/grid/GridKeyboardDelegate.mjs +9 -9
- package/dist/private/grid/GridKeyboardDelegate.mjs.map +1 -1
- package/dist/private/grid/useGrid.cjs.map +1 -1
- package/dist/private/grid/useGrid.js.map +1 -1
- package/dist/private/grid/useGrid.mjs.map +1 -1
- package/dist/private/grid/useGridCell.cjs.map +1 -1
- package/dist/private/grid/useGridCell.js.map +1 -1
- package/dist/private/grid/useGridCell.mjs.map +1 -1
- package/dist/private/grid/useGridRow.cjs.map +1 -1
- package/dist/private/grid/useGridRow.js.map +1 -1
- package/dist/private/grid/useGridRow.mjs.map +1 -1
- package/dist/private/grid/useGridRowGroup.cjs.map +1 -1
- package/dist/private/grid/useGridRowGroup.js.map +1 -1
- package/dist/private/grid/useGridRowGroup.mjs.map +1 -1
- package/dist/private/grid/useGridSelectionAnnouncement.cjs.map +1 -1
- package/dist/private/grid/useGridSelectionAnnouncement.js.map +1 -1
- package/dist/private/grid/useGridSelectionAnnouncement.mjs.map +1 -1
- package/dist/private/grid/useGridSelectionCheckbox.cjs.map +1 -1
- package/dist/private/grid/useGridSelectionCheckbox.js.map +1 -1
- package/dist/private/grid/useGridSelectionCheckbox.mjs.map +1 -1
- package/dist/private/grid/useHighlightSelectionDescription.cjs.map +1 -1
- package/dist/private/grid/useHighlightSelectionDescription.js.map +1 -1
- package/dist/private/grid/useHighlightSelectionDescription.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/useGridList.cjs +2 -1
- package/dist/private/gridlist/useGridList.cjs.map +1 -1
- package/dist/private/gridlist/useGridList.js +2 -1
- package/dist/private/gridlist/useGridList.js.map +1 -1
- package/dist/private/gridlist/useGridList.mjs +2 -1
- package/dist/private/gridlist/useGridList.mjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.cjs +66 -23
- package/dist/private/gridlist/useGridListItem.cjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.js +67 -23
- package/dist/private/gridlist/useGridListItem.js.map +1 -1
- package/dist/private/gridlist/useGridListItem.mjs +66 -23
- package/dist/private/gridlist/useGridListItem.mjs.map +1 -1
- package/dist/private/gridlist/useGridListSection.cjs +3 -1
- package/dist/private/gridlist/useGridListSection.cjs.map +1 -1
- package/dist/private/gridlist/useGridListSection.js +3 -1
- package/dist/private/gridlist/useGridListSection.js.map +1 -1
- package/dist/private/gridlist/useGridListSection.mjs +3 -1
- package/dist/private/gridlist/useGridListSection.mjs.map +1 -1
- package/dist/private/gridlist/useGridListSelectionCheckbox.cjs.map +1 -1
- package/dist/private/gridlist/useGridListSelectionCheckbox.js.map +1 -1
- package/dist/private/gridlist/useGridListSelectionCheckbox.mjs.map +1 -1
- package/dist/private/gridlist/utils.cjs.map +1 -1
- package/dist/private/gridlist/utils.js.map +1 -1
- package/dist/private/gridlist/utils.mjs.map +1 -1
- package/dist/private/i18n/I18nProvider.cjs.map +1 -1
- package/dist/private/i18n/I18nProvider.js.map +1 -1
- package/dist/private/i18n/I18nProvider.mjs.map +1 -1
- package/dist/private/i18n/server.cjs.map +1 -1
- package/dist/private/i18n/server.js.map +1 -1
- package/dist/private/i18n/server.mjs.map +1 -1
- package/dist/private/i18n/useCollator.cjs.map +1 -1
- package/dist/private/i18n/useCollator.js.map +1 -1
- package/dist/private/i18n/useCollator.mjs.map +1 -1
- package/dist/private/i18n/useDateFormatter.cjs.map +1 -1
- package/dist/private/i18n/useDateFormatter.js.map +1 -1
- package/dist/private/i18n/useDateFormatter.mjs.map +1 -1
- package/dist/private/i18n/useDefaultLocale.cjs +2 -1
- package/dist/private/i18n/useDefaultLocale.cjs.map +1 -1
- package/dist/private/i18n/useDefaultLocale.js +2 -1
- package/dist/private/i18n/useDefaultLocale.js.map +1 -1
- package/dist/private/i18n/useDefaultLocale.mjs +2 -1
- package/dist/private/i18n/useDefaultLocale.mjs.map +1 -1
- package/dist/private/i18n/useFilter.cjs.map +1 -1
- package/dist/private/i18n/useFilter.js.map +1 -1
- package/dist/private/i18n/useFilter.mjs.map +1 -1
- package/dist/private/i18n/useListFormatter.cjs.map +1 -1
- package/dist/private/i18n/useListFormatter.js.map +1 -1
- package/dist/private/i18n/useListFormatter.mjs.map +1 -1
- package/dist/private/i18n/useLocalizedStringFormatter.cjs.map +1 -1
- package/dist/private/i18n/useLocalizedStringFormatter.js.map +1 -1
- package/dist/private/i18n/useLocalizedStringFormatter.mjs.map +1 -1
- package/dist/private/i18n/useNumberFormatter.cjs.map +1 -1
- package/dist/private/i18n/useNumberFormatter.js.map +1 -1
- package/dist/private/i18n/useNumberFormatter.mjs.map +1 -1
- package/dist/private/i18n/utils.cjs +2 -2
- package/dist/private/i18n/utils.cjs.map +1 -1
- package/dist/private/i18n/utils.js +2 -2
- package/dist/private/i18n/utils.js.map +1 -1
- package/dist/private/i18n/utils.mjs +2 -2
- package/dist/private/i18n/utils.mjs.map +1 -1
- package/dist/private/interactions/PressResponder.cjs.map +1 -1
- package/dist/private/interactions/PressResponder.js.map +1 -1
- package/dist/private/interactions/PressResponder.mjs.map +1 -1
- package/dist/private/interactions/Pressable.cjs.map +1 -1
- package/dist/private/interactions/Pressable.js.map +1 -1
- package/dist/private/interactions/Pressable.mjs.map +1 -1
- package/dist/private/interactions/context.cjs.map +1 -1
- package/dist/private/interactions/context.js.map +1 -1
- package/dist/private/interactions/context.mjs.map +1 -1
- package/dist/private/interactions/createEventHandler.cjs +3 -0
- package/dist/private/interactions/createEventHandler.cjs.map +1 -1
- package/dist/private/interactions/createEventHandler.js +3 -0
- package/dist/private/interactions/createEventHandler.js.map +1 -1
- package/dist/private/interactions/createEventHandler.mjs +3 -0
- package/dist/private/interactions/createEventHandler.mjs.map +1 -1
- package/dist/private/interactions/focusSafely.cjs.map +1 -1
- package/dist/private/interactions/focusSafely.js.map +1 -1
- package/dist/private/interactions/focusSafely.mjs.map +1 -1
- package/dist/private/interactions/textSelection.cjs.map +1 -1
- package/dist/private/interactions/textSelection.js.map +1 -1
- package/dist/private/interactions/textSelection.mjs.map +1 -1
- package/dist/private/interactions/useFocus.cjs.map +1 -1
- package/dist/private/interactions/useFocus.js.map +1 -1
- package/dist/private/interactions/useFocus.mjs.map +1 -1
- package/dist/private/interactions/useFocusVisible.cjs +20 -8
- package/dist/private/interactions/useFocusVisible.cjs.map +1 -1
- package/dist/private/interactions/useFocusVisible.js +20 -8
- package/dist/private/interactions/useFocusVisible.js.map +1 -1
- package/dist/private/interactions/useFocusVisible.mjs +20 -8
- package/dist/private/interactions/useFocusVisible.mjs.map +1 -1
- package/dist/private/interactions/useFocusWithin.cjs.map +1 -1
- package/dist/private/interactions/useFocusWithin.js.map +1 -1
- package/dist/private/interactions/useFocusWithin.mjs.map +1 -1
- package/dist/private/interactions/useFocusable.cjs.map +1 -1
- package/dist/private/interactions/useFocusable.js.map +1 -1
- package/dist/private/interactions/useFocusable.mjs.map +1 -1
- package/dist/private/interactions/useHover.cjs.map +1 -1
- package/dist/private/interactions/useHover.js.map +1 -1
- package/dist/private/interactions/useHover.mjs.map +1 -1
- package/dist/private/interactions/useInteractOutside.cjs.map +1 -1
- package/dist/private/interactions/useInteractOutside.js.map +1 -1
- package/dist/private/interactions/useInteractOutside.mjs.map +1 -1
- package/dist/private/interactions/useKeyboard.cjs.map +1 -1
- package/dist/private/interactions/useKeyboard.js.map +1 -1
- package/dist/private/interactions/useKeyboard.mjs.map +1 -1
- package/dist/private/interactions/useLongPress.cjs.map +1 -1
- package/dist/private/interactions/useLongPress.js.map +1 -1
- package/dist/private/interactions/useLongPress.mjs.map +1 -1
- package/dist/private/interactions/useMove.cjs.map +1 -1
- package/dist/private/interactions/useMove.js.map +1 -1
- package/dist/private/interactions/useMove.mjs.map +1 -1
- package/dist/private/interactions/usePress.cjs +11 -0
- package/dist/private/interactions/usePress.cjs.map +1 -1
- package/dist/private/interactions/usePress.js +12 -1
- package/dist/private/interactions/usePress.js.map +1 -1
- package/dist/private/interactions/usePress.mjs +12 -1
- package/dist/private/interactions/usePress.mjs.map +1 -1
- package/dist/private/interactions/useScrollWheel.cjs.map +1 -1
- package/dist/private/interactions/useScrollWheel.js.map +1 -1
- package/dist/private/interactions/useScrollWheel.mjs.map +1 -1
- package/dist/private/interactions/utils.cjs.map +1 -1
- package/dist/private/interactions/utils.js.map +1 -1
- package/dist/private/interactions/utils.mjs.map +1 -1
- package/dist/private/intl/tag/en-US.cjs.map +1 -1
- package/dist/private/intl/tag/en-US.js.map +1 -1
- package/dist/private/intl/tag/en-US.mjs.map +1 -1
- package/dist/private/label/useField.cjs.map +1 -1
- package/dist/private/label/useField.js.map +1 -1
- package/dist/private/label/useField.mjs.map +1 -1
- package/dist/private/label/useLabel.cjs.map +1 -1
- package/dist/private/label/useLabel.js.map +1 -1
- package/dist/private/label/useLabel.mjs.map +1 -1
- package/dist/private/landmark/useLandmark.cjs +2 -1
- package/dist/private/landmark/useLandmark.cjs.map +1 -1
- package/dist/private/landmark/useLandmark.js +2 -1
- package/dist/private/landmark/useLandmark.js.map +1 -1
- package/dist/private/landmark/useLandmark.mjs +2 -1
- package/dist/private/landmark/useLandmark.mjs.map +1 -1
- package/dist/private/link/useLink.cjs.map +1 -1
- package/dist/private/link/useLink.js.map +1 -1
- package/dist/private/link/useLink.mjs.map +1 -1
- package/dist/private/listbox/useListBox.cjs.map +1 -1
- package/dist/private/listbox/useListBox.js.map +1 -1
- package/dist/private/listbox/useListBox.mjs.map +1 -1
- package/dist/private/listbox/useListBoxSection.cjs.map +1 -1
- package/dist/private/listbox/useListBoxSection.js.map +1 -1
- package/dist/private/listbox/useListBoxSection.mjs.map +1 -1
- package/dist/private/listbox/useOption.cjs.map +1 -1
- package/dist/private/listbox/useOption.js.map +1 -1
- package/dist/private/listbox/useOption.mjs.map +1 -1
- package/dist/private/listbox/utils.cjs.map +1 -1
- package/dist/private/listbox/utils.js.map +1 -1
- package/dist/private/listbox/utils.mjs.map +1 -1
- package/dist/private/live-announcer/LiveAnnouncer.cjs +2 -2
- package/dist/private/live-announcer/LiveAnnouncer.cjs.map +1 -1
- package/dist/private/live-announcer/LiveAnnouncer.js +2 -2
- package/dist/private/live-announcer/LiveAnnouncer.js.map +1 -1
- package/dist/private/live-announcer/LiveAnnouncer.mjs +2 -2
- package/dist/private/live-announcer/LiveAnnouncer.mjs.map +1 -1
- package/dist/private/menu/useMenu.cjs.map +1 -1
- package/dist/private/menu/useMenu.js.map +1 -1
- package/dist/private/menu/useMenu.mjs.map +1 -1
- package/dist/private/menu/useMenuItem.cjs +1 -1
- package/dist/private/menu/useMenuItem.cjs.map +1 -1
- package/dist/private/menu/useMenuItem.js +1 -1
- package/dist/private/menu/useMenuItem.js.map +1 -1
- package/dist/private/menu/useMenuItem.mjs +1 -1
- package/dist/private/menu/useMenuItem.mjs.map +1 -1
- package/dist/private/menu/useMenuSection.cjs.map +1 -1
- package/dist/private/menu/useMenuSection.js.map +1 -1
- package/dist/private/menu/useMenuSection.mjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.js.map +1 -1
- package/dist/private/menu/useMenuTrigger.mjs.map +1 -1
- package/dist/private/menu/useSafelyMouseToSubmenu.cjs.map +1 -1
- package/dist/private/menu/useSafelyMouseToSubmenu.js.map +1 -1
- package/dist/private/menu/useSafelyMouseToSubmenu.mjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.js.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.mjs.map +1 -1
- package/dist/private/menu/utils.cjs.map +1 -1
- package/dist/private/menu/utils.js.map +1 -1
- package/dist/private/menu/utils.mjs.map +1 -1
- package/dist/private/meter/useMeter.cjs.map +1 -1
- package/dist/private/meter/useMeter.js.map +1 -1
- package/dist/private/meter/useMeter.mjs.map +1 -1
- package/dist/private/numberfield/useNumberField.cjs.map +1 -1
- package/dist/private/numberfield/useNumberField.js.map +1 -1
- package/dist/private/numberfield/useNumberField.mjs.map +1 -1
- package/dist/private/overlays/DismissButton.cjs.map +1 -1
- package/dist/private/overlays/DismissButton.js.map +1 -1
- package/dist/private/overlays/DismissButton.mjs.map +1 -1
- package/dist/private/overlays/Overlay.cjs.map +1 -1
- package/dist/private/overlays/Overlay.js.map +1 -1
- package/dist/private/overlays/Overlay.mjs.map +1 -1
- package/dist/private/overlays/PortalProvider.cjs.map +1 -1
- package/dist/private/overlays/PortalProvider.js.map +1 -1
- package/dist/private/overlays/PortalProvider.mjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.cjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.js.map +1 -1
- package/dist/private/overlays/ariaHideOutside.mjs.map +1 -1
- package/dist/private/overlays/calculatePosition.cjs +19 -20
- package/dist/private/overlays/calculatePosition.cjs.map +1 -1
- package/dist/private/overlays/calculatePosition.js +20 -21
- package/dist/private/overlays/calculatePosition.js.map +1 -1
- package/dist/private/overlays/calculatePosition.mjs +19 -20
- package/dist/private/overlays/calculatePosition.mjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.cjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.js.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.mjs.map +1 -1
- package/dist/private/overlays/useModal.cjs.map +1 -1
- package/dist/private/overlays/useModal.js.map +1 -1
- package/dist/private/overlays/useModal.mjs.map +1 -1
- package/dist/private/overlays/useModalOverlay.cjs.map +1 -1
- package/dist/private/overlays/useModalOverlay.js.map +1 -1
- package/dist/private/overlays/useModalOverlay.mjs.map +1 -1
- package/dist/private/overlays/useOverlay.cjs.map +1 -1
- package/dist/private/overlays/useOverlay.js.map +1 -1
- package/dist/private/overlays/useOverlay.mjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.cjs +3 -2
- package/dist/private/overlays/useOverlayPosition.cjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.js +3 -2
- package/dist/private/overlays/useOverlayPosition.js.map +1 -1
- package/dist/private/overlays/useOverlayPosition.mjs +3 -2
- package/dist/private/overlays/useOverlayPosition.mjs.map +1 -1
- package/dist/private/overlays/useOverlayTrigger.cjs.map +1 -1
- package/dist/private/overlays/useOverlayTrigger.js.map +1 -1
- package/dist/private/overlays/useOverlayTrigger.mjs.map +1 -1
- package/dist/private/overlays/usePopover.cjs.map +1 -1
- package/dist/private/overlays/usePopover.js.map +1 -1
- package/dist/private/overlays/usePopover.mjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.cjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.js.map +1 -1
- package/dist/private/overlays/usePreventScroll.mjs.map +1 -1
- package/dist/private/progress/useProgressBar.cjs.map +1 -1
- package/dist/private/progress/useProgressBar.js.map +1 -1
- package/dist/private/progress/useProgressBar.mjs.map +1 -1
- package/dist/private/radio/useRadio.cjs +5 -0
- package/dist/private/radio/useRadio.cjs.map +1 -1
- package/dist/private/radio/useRadio.js +5 -0
- package/dist/private/radio/useRadio.js.map +1 -1
- package/dist/private/radio/useRadio.mjs +5 -0
- package/dist/private/radio/useRadio.mjs.map +1 -1
- package/dist/private/radio/useRadioGroup.cjs.map +1 -1
- package/dist/private/radio/useRadioGroup.js.map +1 -1
- package/dist/private/radio/useRadioGroup.mjs.map +1 -1
- package/dist/private/radio/utils.cjs.map +1 -1
- package/dist/private/radio/utils.js.map +1 -1
- package/dist/private/radio/utils.mjs.map +1 -1
- package/dist/private/searchfield/useSearchField.cjs.map +1 -1
- package/dist/private/searchfield/useSearchField.js.map +1 -1
- package/dist/private/searchfield/useSearchField.mjs.map +1 -1
- package/dist/private/select/HiddenSelect.cjs +2 -1
- package/dist/private/select/HiddenSelect.cjs.map +1 -1
- package/dist/private/select/HiddenSelect.js +2 -1
- package/dist/private/select/HiddenSelect.js.map +1 -1
- package/dist/private/select/HiddenSelect.mjs +2 -1
- package/dist/private/select/HiddenSelect.mjs.map +1 -1
- package/dist/private/select/useSelect.cjs +3 -4
- package/dist/private/select/useSelect.cjs.map +1 -1
- package/dist/private/select/useSelect.js +3 -4
- package/dist/private/select/useSelect.js.map +1 -1
- package/dist/private/select/useSelect.mjs +3 -4
- package/dist/private/select/useSelect.mjs.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.cjs +56 -28
- package/dist/private/selection/ListKeyboardDelegate.cjs.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.js +57 -29
- package/dist/private/selection/ListKeyboardDelegate.js.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.mjs +56 -28
- package/dist/private/selection/ListKeyboardDelegate.mjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.cjs +21 -14
- package/dist/private/selection/useSelectableCollection.cjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.js +27 -19
- package/dist/private/selection/useSelectableCollection.js.map +1 -1
- package/dist/private/selection/useSelectableCollection.mjs +21 -14
- package/dist/private/selection/useSelectableCollection.mjs.map +1 -1
- package/dist/private/selection/useSelectableItem.cjs.map +1 -1
- package/dist/private/selection/useSelectableItem.js.map +1 -1
- package/dist/private/selection/useSelectableItem.mjs.map +1 -1
- package/dist/private/selection/useSelectableList.cjs.map +1 -1
- package/dist/private/selection/useSelectableList.js.map +1 -1
- package/dist/private/selection/useSelectableList.mjs.map +1 -1
- package/dist/private/selection/useTypeSelect.cjs +50 -18
- package/dist/private/selection/useTypeSelect.cjs.map +1 -1
- package/dist/private/selection/useTypeSelect.js +51 -19
- package/dist/private/selection/useTypeSelect.js.map +1 -1
- package/dist/private/selection/useTypeSelect.mjs +51 -19
- package/dist/private/selection/useTypeSelect.mjs.map +1 -1
- package/dist/private/selection/utils.cjs.map +1 -1
- package/dist/private/selection/utils.js.map +1 -1
- package/dist/private/selection/utils.mjs.map +1 -1
- package/dist/private/separator/useSeparator.cjs.map +1 -1
- package/dist/private/separator/useSeparator.js.map +1 -1
- package/dist/private/separator/useSeparator.mjs.map +1 -1
- package/dist/private/slider/useSlider.cjs +4 -2
- package/dist/private/slider/useSlider.cjs.map +1 -1
- package/dist/private/slider/useSlider.js +4 -2
- package/dist/private/slider/useSlider.js.map +1 -1
- package/dist/private/slider/useSlider.mjs +4 -2
- package/dist/private/slider/useSlider.mjs.map +1 -1
- package/dist/private/slider/useSliderThumb.cjs.map +1 -1
- package/dist/private/slider/useSliderThumb.js.map +1 -1
- package/dist/private/slider/useSliderThumb.mjs.map +1 -1
- package/dist/private/slider/utils.cjs.map +1 -1
- package/dist/private/slider/utils.js.map +1 -1
- package/dist/private/slider/utils.mjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.cjs +2 -0
- package/dist/private/spinbutton/useSpinButton.cjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.js +2 -0
- package/dist/private/spinbutton/useSpinButton.js.map +1 -1
- package/dist/private/spinbutton/useSpinButton.mjs +2 -0
- package/dist/private/spinbutton/useSpinButton.mjs.map +1 -1
- package/dist/private/ssr/SSRProvider.cjs +6 -6
- package/dist/private/ssr/SSRProvider.cjs.map +1 -1
- package/dist/private/ssr/SSRProvider.js +6 -6
- package/dist/private/ssr/SSRProvider.js.map +1 -1
- package/dist/private/ssr/SSRProvider.mjs +6 -6
- package/dist/private/ssr/SSRProvider.mjs.map +1 -1
- package/dist/private/steplist/useStepList.cjs.map +1 -1
- package/dist/private/steplist/useStepList.js.map +1 -1
- package/dist/private/steplist/useStepList.mjs.map +1 -1
- package/dist/private/steplist/useStepListItem.cjs.map +1 -1
- package/dist/private/steplist/useStepListItem.js.map +1 -1
- package/dist/private/steplist/useStepListItem.mjs.map +1 -1
- package/dist/private/switch/useSwitch.cjs +2 -4
- package/dist/private/switch/useSwitch.cjs.map +1 -1
- package/dist/private/switch/useSwitch.js +2 -4
- package/dist/private/switch/useSwitch.js.map +1 -1
- package/dist/private/switch/useSwitch.mjs +2 -4
- package/dist/private/switch/useSwitch.mjs.map +1 -1
- package/dist/private/table/TableKeyboardDelegate.cjs +4 -4
- package/dist/private/table/TableKeyboardDelegate.cjs.map +1 -1
- package/dist/private/table/TableKeyboardDelegate.js +4 -4
- package/dist/private/table/TableKeyboardDelegate.js.map +1 -1
- package/dist/private/table/TableKeyboardDelegate.mjs +4 -4
- package/dist/private/table/TableKeyboardDelegate.mjs.map +1 -1
- package/dist/private/table/useTable.cjs.map +1 -1
- package/dist/private/table/useTable.js.map +1 -1
- package/dist/private/table/useTable.mjs.map +1 -1
- package/dist/private/table/useTableCell.cjs.map +1 -1
- package/dist/private/table/useTableCell.js.map +1 -1
- package/dist/private/table/useTableCell.mjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.cjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.js.map +1 -1
- package/dist/private/table/useTableColumnHeader.mjs.map +1 -1
- package/dist/private/table/useTableColumnResize.cjs +1 -1
- package/dist/private/table/useTableColumnResize.cjs.map +1 -1
- package/dist/private/table/useTableColumnResize.js +1 -1
- package/dist/private/table/useTableColumnResize.js.map +1 -1
- package/dist/private/table/useTableColumnResize.mjs +1 -1
- package/dist/private/table/useTableColumnResize.mjs.map +1 -1
- package/dist/private/table/useTableHeaderRow.cjs +2 -1
- package/dist/private/table/useTableHeaderRow.cjs.map +1 -1
- package/dist/private/table/useTableHeaderRow.js +2 -1
- package/dist/private/table/useTableHeaderRow.js.map +1 -1
- package/dist/private/table/useTableHeaderRow.mjs +2 -1
- package/dist/private/table/useTableHeaderRow.mjs.map +1 -1
- package/dist/private/table/useTableRow.cjs +2 -2
- package/dist/private/table/useTableRow.cjs.map +1 -1
- package/dist/private/table/useTableRow.js +2 -2
- package/dist/private/table/useTableRow.js.map +1 -1
- package/dist/private/table/useTableRow.mjs +2 -2
- package/dist/private/table/useTableRow.mjs.map +1 -1
- package/dist/private/table/useTableSelectionCheckbox.cjs.map +1 -1
- package/dist/private/table/useTableSelectionCheckbox.js.map +1 -1
- package/dist/private/table/useTableSelectionCheckbox.mjs.map +1 -1
- package/dist/private/table/utils.cjs.map +1 -1
- package/dist/private/table/utils.js.map +1 -1
- package/dist/private/table/utils.mjs.map +1 -1
- package/dist/private/tabs/TabsKeyboardDelegate.cjs +2 -2
- package/dist/private/tabs/TabsKeyboardDelegate.cjs.map +1 -1
- package/dist/private/tabs/TabsKeyboardDelegate.js +2 -2
- package/dist/private/tabs/TabsKeyboardDelegate.js.map +1 -1
- package/dist/private/tabs/TabsKeyboardDelegate.mjs +2 -2
- package/dist/private/tabs/TabsKeyboardDelegate.mjs.map +1 -1
- package/dist/private/tabs/useTab.cjs.map +1 -1
- package/dist/private/tabs/useTab.js.map +1 -1
- package/dist/private/tabs/useTab.mjs.map +1 -1
- package/dist/private/tabs/useTabList.cjs +10 -10
- package/dist/private/tabs/useTabList.cjs.map +1 -1
- package/dist/private/tabs/useTabList.js +10 -10
- package/dist/private/tabs/useTabList.js.map +1 -1
- package/dist/private/tabs/useTabList.mjs +10 -10
- package/dist/private/tabs/useTabList.mjs.map +1 -1
- package/dist/private/tabs/useTabPanel.cjs.map +1 -1
- package/dist/private/tabs/useTabPanel.js.map +1 -1
- package/dist/private/tabs/useTabPanel.mjs.map +1 -1
- package/dist/private/tabs/utils.cjs.map +1 -1
- package/dist/private/tabs/utils.js.map +1 -1
- package/dist/private/tabs/utils.mjs.map +1 -1
- package/dist/private/tag/useTag.cjs.map +1 -1
- package/dist/private/tag/useTag.js.map +1 -1
- package/dist/private/tag/useTag.mjs.map +1 -1
- package/dist/private/tag/useTagGroup.cjs.map +1 -1
- package/dist/private/tag/useTagGroup.js.map +1 -1
- package/dist/private/tag/useTagGroup.mjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.cjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.js.map +1 -1
- package/dist/private/textfield/useFormattedTextField.mjs.map +1 -1
- package/dist/private/textfield/useTextField.cjs.map +1 -1
- package/dist/private/textfield/useTextField.js.map +1 -1
- package/dist/private/textfield/useTextField.mjs.map +1 -1
- package/dist/private/toast/useToast.cjs +2 -1
- package/dist/private/toast/useToast.cjs.map +1 -1
- package/dist/private/toast/useToast.js +2 -1
- package/dist/private/toast/useToast.js.map +1 -1
- package/dist/private/toast/useToast.mjs +2 -1
- package/dist/private/toast/useToast.mjs.map +1 -1
- package/dist/private/toast/useToastRegion.cjs.map +1 -1
- package/dist/private/toast/useToastRegion.js.map +1 -1
- package/dist/private/toast/useToastRegion.mjs.map +1 -1
- package/dist/private/toggle/useToggle.cjs +70 -8
- package/dist/private/toggle/useToggle.cjs.map +1 -1
- package/dist/private/toggle/useToggle.js +70 -8
- package/dist/private/toggle/useToggle.js.map +1 -1
- package/dist/private/toggle/useToggle.mjs +70 -8
- package/dist/private/toggle/useToggle.mjs.map +1 -1
- package/dist/private/toolbar/useToolbar.cjs +0 -1
- package/dist/private/toolbar/useToolbar.cjs.map +1 -1
- package/dist/private/toolbar/useToolbar.js +0 -1
- package/dist/private/toolbar/useToolbar.js.map +1 -1
- package/dist/private/toolbar/useToolbar.mjs +0 -1
- package/dist/private/toolbar/useToolbar.mjs.map +1 -1
- package/dist/private/tooltip/useTooltip.cjs.map +1 -1
- package/dist/private/tooltip/useTooltip.js.map +1 -1
- package/dist/private/tooltip/useTooltip.mjs.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.cjs.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.js.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.mjs.map +1 -1
- package/dist/private/tree/useTree.cjs.map +1 -1
- package/dist/private/tree/useTree.js.map +1 -1
- package/dist/private/tree/useTree.mjs.map +1 -1
- package/dist/private/tree/useTreeItem.cjs.map +1 -1
- package/dist/private/tree/useTreeItem.js.map +1 -1
- package/dist/private/tree/useTreeItem.mjs.map +1 -1
- package/dist/private/utils/animation.cjs.map +1 -1
- package/dist/private/utils/animation.js.map +1 -1
- package/dist/private/utils/animation.mjs.map +1 -1
- package/dist/private/utils/domHelpers.cjs +2 -1
- package/dist/private/utils/domHelpers.cjs.map +1 -1
- package/dist/private/utils/domHelpers.js +2 -1
- package/dist/private/utils/domHelpers.js.map +1 -1
- package/dist/private/utils/domHelpers.mjs +2 -1
- package/dist/private/utils/domHelpers.mjs.map +1 -1
- package/dist/private/utils/filterDOMProps.cjs.map +1 -1
- package/dist/private/utils/filterDOMProps.js.map +1 -1
- package/dist/private/utils/filterDOMProps.mjs.map +1 -1
- package/dist/private/utils/focusWithoutScrolling.cjs.map +1 -1
- package/dist/private/utils/focusWithoutScrolling.js.map +1 -1
- package/dist/private/utils/focusWithoutScrolling.mjs.map +1 -1
- package/dist/private/utils/getNonce.cjs.map +1 -1
- package/dist/private/utils/getNonce.js.map +1 -1
- package/dist/private/utils/getNonce.mjs.map +1 -1
- package/dist/private/utils/getOffset.cjs.map +1 -1
- package/dist/private/utils/getOffset.js.map +1 -1
- package/dist/private/utils/getOffset.mjs.map +1 -1
- package/dist/private/utils/getScrollParent.cjs.map +1 -1
- package/dist/private/utils/getScrollParent.js.map +1 -1
- package/dist/private/utils/getScrollParent.mjs.map +1 -1
- package/dist/private/utils/getScrollParents.cjs +3 -2
- package/dist/private/utils/getScrollParents.cjs.map +1 -1
- package/dist/private/utils/getScrollParents.js +3 -2
- package/dist/private/utils/getScrollParents.js.map +1 -1
- package/dist/private/utils/getScrollParents.mjs +3 -2
- package/dist/private/utils/getScrollParents.mjs.map +1 -1
- package/dist/private/utils/isElementVisible.cjs +1 -1
- package/dist/private/utils/isElementVisible.cjs.map +1 -1
- package/dist/private/utils/isElementVisible.js +1 -1
- package/dist/private/utils/isElementVisible.js.map +1 -1
- package/dist/private/utils/isElementVisible.mjs +1 -1
- package/dist/private/utils/isElementVisible.mjs.map +1 -1
- package/dist/private/utils/isFocusable.cjs +3 -1
- package/dist/private/utils/isFocusable.cjs.map +1 -1
- package/dist/private/utils/isFocusable.js +3 -1
- package/dist/private/utils/isFocusable.js.map +1 -1
- package/dist/private/utils/isFocusable.mjs +3 -1
- package/dist/private/utils/isFocusable.mjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.cjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.js.map +1 -1
- package/dist/private/utils/isVirtualEvent.mjs.map +1 -1
- package/dist/private/utils/keyboard.cjs.map +1 -1
- package/dist/private/utils/keyboard.js.map +1 -1
- package/dist/private/utils/keyboard.mjs.map +1 -1
- package/dist/private/utils/mergeProps.cjs.map +1 -1
- package/dist/private/utils/mergeProps.js.map +1 -1
- package/dist/private/utils/mergeProps.mjs.map +1 -1
- package/dist/private/utils/mergeRefs.cjs.map +1 -1
- package/dist/private/utils/mergeRefs.js.map +1 -1
- package/dist/private/utils/mergeRefs.mjs.map +1 -1
- package/dist/private/utils/openLink.cjs +12 -8
- package/dist/private/utils/openLink.cjs.map +1 -1
- package/dist/private/utils/openLink.js +12 -8
- package/dist/private/utils/openLink.js.map +1 -1
- package/dist/private/utils/openLink.mjs +12 -8
- package/dist/private/utils/openLink.mjs.map +1 -1
- package/dist/private/utils/platform.cjs.map +1 -1
- package/dist/private/utils/platform.js.map +1 -1
- package/dist/private/utils/platform.mjs.map +1 -1
- package/dist/private/utils/scrollIntoView.cjs +21 -18
- package/dist/private/utils/scrollIntoView.cjs.map +1 -1
- package/dist/private/utils/scrollIntoView.js +21 -18
- package/dist/private/utils/scrollIntoView.js.map +1 -1
- package/dist/private/utils/scrollIntoView.mjs +21 -18
- package/dist/private/utils/scrollIntoView.mjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/private/utils/shadowdom/ShadowTreeWalker.cjs +6 -6
- package/dist/private/utils/shadowdom/ShadowTreeWalker.cjs.map +1 -1
- package/dist/private/utils/shadowdom/ShadowTreeWalker.js +6 -6
- package/dist/private/utils/shadowdom/ShadowTreeWalker.js.map +1 -1
- package/dist/private/utils/shadowdom/ShadowTreeWalker.mjs +6 -6
- package/dist/private/utils/shadowdom/ShadowTreeWalker.mjs.map +1 -1
- package/dist/private/utils/useDeepMemo.cjs +1 -1
- package/dist/private/utils/useDeepMemo.cjs.map +1 -1
- package/dist/private/utils/useDeepMemo.js +1 -1
- package/dist/private/utils/useDeepMemo.js.map +1 -1
- package/dist/private/utils/useDeepMemo.mjs +1 -1
- package/dist/private/utils/useDeepMemo.mjs.map +1 -1
- package/dist/private/utils/useDescription.cjs.map +1 -1
- package/dist/private/utils/useDescription.js.map +1 -1
- package/dist/private/utils/useDescription.mjs.map +1 -1
- package/dist/private/utils/useDrag1D.cjs +1 -1
- package/dist/private/utils/useDrag1D.cjs.map +1 -1
- package/dist/private/utils/useDrag1D.js +1 -1
- package/dist/private/utils/useDrag1D.js.map +1 -1
- package/dist/private/utils/useDrag1D.mjs +1 -1
- package/dist/private/utils/useDrag1D.mjs.map +1 -1
- package/dist/private/utils/useFormReset.cjs.map +1 -1
- package/dist/private/utils/useFormReset.js.map +1 -1
- package/dist/private/utils/useFormReset.mjs.map +1 -1
- package/dist/private/utils/useGlobalListeners.cjs.map +1 -1
- package/dist/private/utils/useGlobalListeners.js.map +1 -1
- package/dist/private/utils/useGlobalListeners.mjs.map +1 -1
- package/dist/private/utils/useId.cjs.map +1 -1
- package/dist/private/utils/useId.js.map +1 -1
- package/dist/private/utils/useId.mjs.map +1 -1
- package/dist/private/utils/useLabels.cjs.map +1 -1
- package/dist/private/utils/useLabels.js.map +1 -1
- package/dist/private/utils/useLabels.mjs.map +1 -1
- package/dist/private/utils/useLayoutEffect.cjs.map +1 -1
- package/dist/private/utils/useLayoutEffect.js.map +1 -1
- package/dist/private/utils/useLayoutEffect.mjs.map +1 -1
- package/dist/private/utils/useLoadMore.cjs.map +1 -1
- package/dist/private/utils/useLoadMore.js.map +1 -1
- package/dist/private/utils/useLoadMore.mjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.cjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.js.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.mjs.map +1 -1
- package/dist/private/utils/useObjectRef.cjs.map +1 -1
- package/dist/private/utils/useObjectRef.js.map +1 -1
- package/dist/private/utils/useObjectRef.mjs.map +1 -1
- package/dist/private/utils/useResizeObserver.cjs.map +1 -1
- package/dist/private/utils/useResizeObserver.js.map +1 -1
- package/dist/private/utils/useResizeObserver.mjs.map +1 -1
- package/dist/private/utils/useSlot.cjs +54 -0
- package/dist/private/utils/useSlot.cjs.map +1 -0
- package/dist/private/utils/useSlot.js +49 -0
- package/dist/private/utils/useSlot.js.map +1 -0
- package/dist/private/utils/useSlot.mjs +49 -0
- package/dist/private/utils/useSlot.mjs.map +1 -0
- package/dist/private/utils/useSyncRef.cjs +2 -1
- package/dist/private/utils/useSyncRef.cjs.map +1 -1
- package/dist/private/utils/useSyncRef.js +2 -1
- package/dist/private/utils/useSyncRef.js.map +1 -1
- package/dist/private/utils/useSyncRef.mjs +2 -1
- package/dist/private/utils/useSyncRef.mjs.map +1 -1
- package/dist/private/utils/useUpdateEffect.cjs.map +1 -1
- package/dist/private/utils/useUpdateEffect.js.map +1 -1
- package/dist/private/utils/useUpdateEffect.mjs.map +1 -1
- package/dist/private/utils/useValueEffect.cjs.map +1 -1
- package/dist/private/utils/useValueEffect.js.map +1 -1
- package/dist/private/utils/useValueEffect.mjs.map +1 -1
- package/dist/private/utils/useViewportSize.cjs +3 -1
- package/dist/private/utils/useViewportSize.cjs.map +1 -1
- package/dist/private/utils/useViewportSize.js +3 -1
- package/dist/private/utils/useViewportSize.js.map +1 -1
- package/dist/private/utils/useViewportSize.mjs +3 -1
- package/dist/private/utils/useViewportSize.mjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.cjs +2 -2
- package/dist/private/virtualizer/ScrollView.cjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.js +2 -2
- package/dist/private/virtualizer/ScrollView.js.map +1 -1
- package/dist/private/virtualizer/ScrollView.mjs +2 -2
- package/dist/private/virtualizer/ScrollView.mjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.cjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.js.map +1 -1
- package/dist/private/virtualizer/Virtualizer.mjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.mjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
- package/dist/private/virtualizer/utils.cjs.map +1 -1
- package/dist/private/virtualizer/utils.js.map +1 -1
- package/dist/private/virtualizer/utils.mjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.cjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.js.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.mjs.map +1 -1
- package/dist/types/exports/index.d.ts +7 -0
- package/dist/types/exports/useCalendar.d.ts +6 -0
- package/dist/types/exports/useRangeCalendar.d.ts +11 -0
- package/dist/types/src/actiongroup/useActionGroup.d.ts +5 -1
- package/dist/types/src/aria-modal-polyfill/ariaModalPolyfill.d.ts +2 -1
- package/dist/types/src/autocomplete/useAutocomplete.d.ts +21 -9
- package/dist/types/src/autocomplete/useSearchAutocomplete.d.ts +15 -8
- package/dist/types/src/breadcrumbs/useBreadcrumbItem.d.ts +2 -0
- package/dist/types/src/button/useButton.d.ts +25 -7
- package/dist/types/src/button/useToggleButtonGroup.d.ts +1 -0
- package/dist/types/src/calendar/useCalendar.d.ts +3 -3
- package/dist/types/src/calendar/useCalendarBase.d.ts +2 -2
- package/dist/types/src/calendar/useCalendarCell.d.ts +9 -8
- package/dist/types/src/calendar/useCalendarGrid.d.ts +8 -4
- package/dist/types/src/calendar/useCalendarHeading.d.ts +22 -0
- package/dist/types/src/calendar/useCalendarMonthPicker.d.ts +22 -0
- package/dist/types/src/calendar/useCalendarYearPicker.d.ts +32 -0
- package/dist/types/src/calendar/useRangeCalendar.d.ts +5 -5
- package/dist/types/src/calendar/utils.d.ts +3 -3
- package/dist/types/src/checkbox/useCheckbox.d.ts +6 -1
- package/dist/types/src/checkbox/useCheckboxGroup.d.ts +1 -0
- package/dist/types/src/checkbox/useCheckboxGroupItem.d.ts +3 -2
- package/dist/types/src/collections/CollectionBuilder.d.ts +8 -7
- package/dist/types/src/collections/useCachedChildren.d.ts +1 -1
- package/dist/types/src/color/useColorArea.d.ts +7 -4
- package/dist/types/src/color/useColorChannelField.d.ts +2 -2
- package/dist/types/src/combobox/useComboBox.d.ts +5 -3
- package/dist/types/src/datepicker/useDateField.d.ts +2 -1
- package/dist/types/src/datepicker/useDatePicker.d.ts +5 -3
- package/dist/types/src/dialog/useDialog.d.ts +1 -0
- package/dist/types/src/disclosure/useDisclosure.d.ts +1 -0
- package/dist/types/src/dnd/ListDropTargetDelegate.d.ts +3 -0
- package/dist/types/src/dnd/useDrag.d.ts +11 -4
- package/dist/types/src/dnd/useDraggableCollection.d.ts +2 -2
- package/dist/types/src/dnd/useDraggableItem.d.ts +7 -6
- package/dist/types/src/dnd/useDrop.d.ts +5 -4
- package/dist/types/src/dnd/useDroppableCollection.d.ts +2 -2
- package/dist/types/src/dnd/utils.d.ts +3 -3
- package/dist/types/src/focus/FocusRing.d.ts +1 -0
- package/dist/types/src/focus/useFocusRing.d.ts +1 -0
- package/dist/types/src/focus/useHasTabbableChild.d.ts +1 -0
- package/dist/types/src/grid/GridKeyboardDelegate.d.ts +8 -4
- package/dist/types/src/grid/useGrid.d.ts +12 -4
- package/dist/types/src/grid/useGridCell.d.ts +11 -3
- package/dist/types/src/grid/useGridRow.d.ts +7 -2
- package/dist/types/src/grid/useGridSelectionAnnouncement.d.ts +3 -1
- package/dist/types/src/grid/useGridSelectionCheckbox.d.ts +1 -0
- package/dist/types/src/grid/useHighlightSelectionDescription.d.ts +1 -0
- package/dist/types/src/gridlist/useGridList.d.ts +20 -5
- package/dist/types/src/gridlist/useGridListItem.d.ts +5 -1
- package/dist/types/src/gridlist/useGridListSection.d.ts +1 -0
- package/dist/types/src/gridlist/useGridListSelectionCheckbox.d.ts +1 -0
- package/dist/types/src/i18n/useCollator.d.ts +3 -2
- package/dist/types/src/i18n/useDateFormatter.d.ts +3 -2
- package/dist/types/src/i18n/useFilter.d.ts +3 -2
- package/dist/types/src/i18n/useListFormatter.d.ts +3 -2
- package/dist/types/src/i18n/useLocalizedStringFormatter.d.ts +3 -1
- package/dist/types/src/i18n/useNumberFormatter.d.ts +3 -2
- package/dist/types/src/i18n/utils.d.ts +2 -1
- package/dist/types/src/interactions/createEventHandler.d.ts +2 -1
- package/dist/types/src/interactions/useFocusVisible.d.ts +11 -9
- package/dist/types/src/interactions/useLongPress.d.ts +3 -2
- package/dist/types/src/interactions/utils.d.ts +4 -3
- package/dist/types/src/label/useField.d.ts +3 -2
- package/dist/types/src/label/useLabel.d.ts +2 -0
- package/dist/types/src/landmark/useLandmark.d.ts +4 -1
- package/dist/types/src/link/useLink.d.ts +1 -0
- package/dist/types/src/listbox/useListBox.d.ts +8 -3
- package/dist/types/src/listbox/useListBoxSection.d.ts +1 -0
- package/dist/types/src/listbox/useOption.d.ts +7 -0
- package/dist/types/src/menu/useMenu.d.ts +3 -1
- package/dist/types/src/menu/useMenuItem.d.ts +10 -1
- package/dist/types/src/menu/useMenuSection.d.ts +1 -0
- package/dist/types/src/menu/useMenuTrigger.d.ts +1 -0
- package/dist/types/src/menu/useSafelyMouseToSubmenu.d.ts +3 -2
- package/dist/types/src/menu/useSubmenuTrigger.d.ts +7 -2
- package/dist/types/src/menu/utils.d.ts +1 -1
- package/dist/types/src/numberfield/useNumberField.d.ts +11 -4
- package/dist/types/src/overlays/Overlay.d.ts +1 -0
- package/dist/types/src/overlays/PortalProvider.d.ts +4 -1
- package/dist/types/src/overlays/ariaHideOutside.d.ts +1 -0
- package/dist/types/src/overlays/calculatePosition.d.ts +3 -1
- package/dist/types/src/overlays/useModal.d.ts +8 -7
- package/dist/types/src/overlays/useModalOverlay.d.ts +2 -0
- package/dist/types/src/overlays/useOverlay.d.ts +2 -0
- package/dist/types/src/overlays/useOverlayPosition.d.ts +18 -0
- package/dist/types/src/progress/useProgressBar.d.ts +5 -1
- package/dist/types/src/radio/useRadio.d.ts +4 -1
- package/dist/types/src/radio/useRadioGroup.d.ts +1 -0
- package/dist/types/src/searchfield/useSearchField.d.ts +7 -2
- package/dist/types/src/select/HiddenSelect.d.ts +2 -1
- package/dist/types/src/select/useSelect.d.ts +3 -1
- package/dist/types/src/selection/ListKeyboardDelegate.d.ts +19 -6
- package/dist/types/src/selection/useSelectableCollection.d.ts +17 -2
- package/dist/types/src/selection/useSelectableItem.d.ts +9 -7
- package/dist/types/src/selection/useSelectableList.d.ts +5 -2
- package/dist/types/src/separator/useSeparator.d.ts +1 -0
- package/dist/types/src/slider/useSlider.d.ts +5 -4
- package/dist/types/src/slider/useSliderThumb.d.ts +3 -1
- package/dist/types/src/switch/useSwitch.d.ts +14 -27
- package/dist/types/src/table/TableKeyboardDelegate.d.ts +6 -2
- package/dist/types/src/table/useTable.d.ts +8 -4
- package/dist/types/src/table/useTableCell.d.ts +7 -2
- package/dist/types/src/table/useTableColumnHeader.d.ts +9 -2
- package/dist/types/src/table/useTableColumnResize.d.ts +12 -6
- package/dist/types/src/table/useTableHeaderRow.d.ts +1 -0
- package/dist/types/src/table/useTableRow.d.ts +1 -0
- package/dist/types/src/table/useTableSelectionCheckbox.d.ts +2 -0
- package/dist/types/src/tabs/useTabList.d.ts +2 -0
- package/dist/types/src/tabs/useTabPanel.d.ts +2 -2
- package/dist/types/src/tag/useTag.d.ts +1 -0
- package/dist/types/src/tag/useTagGroup.d.ts +7 -3
- package/dist/types/src/textfield/useTextField.d.ts +26 -11
- package/dist/types/src/toast/useToast.d.ts +2 -2
- package/dist/types/src/toast/useToastRegion.d.ts +5 -3
- package/dist/types/src/toggle/useToggle.d.ts +8 -3
- package/dist/types/src/toolbar/useToolbar.d.ts +2 -0
- package/dist/types/src/tree/useTree.d.ts +5 -3
- package/dist/types/src/tree/useTreeItem.d.ts +5 -1
- package/dist/types/src/utils/filterDOMProps.d.ts +1 -0
- package/dist/types/src/utils/getNonce.d.ts +3 -2
- package/dist/types/src/utils/isElementVisible.d.ts +1 -0
- package/dist/types/src/utils/mergeProps.d.ts +3 -2
- package/dist/types/src/utils/scrollIntoView.d.ts +5 -3
- package/dist/types/src/utils/shadowdom/DOMFunctions.d.ts +1 -0
- package/dist/types/src/utils/useId.d.ts +2 -0
- package/dist/types/src/utils/useLabels.d.ts +1 -0
- package/dist/types/src/utils/useLoadMore.d.ts +6 -4
- package/dist/types/src/utils/useLoadMoreSentinel.d.ts +5 -3
- package/dist/types/src/utils/useSlot.d.ts +8 -0
- package/dist/types/src/visually-hidden/VisuallyHidden.d.ts +1 -0
- package/package.json +10 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {DOMLayoutDelegate as $a83747cc3f035330$export$8f5ed9ff9f511381} from "./DOMLayoutDelegate.mjs";
|
|
2
|
+
import {getItemElement as $22bbea12c2567021$export$c3d8340acf92597f} from "./utils.mjs";
|
|
2
3
|
import {isScrollable as $901761b40e390936$export$2bb74740c4e19def} from "../utils/isScrollable.mjs";
|
|
3
4
|
|
|
4
5
|
/*
|
|
@@ -13,6 +14,7 @@ import {isScrollable as $901761b40e390936$export$2bb74740c4e19def} from "../util
|
|
|
13
14
|
* governing permissions and limitations under the License.
|
|
14
15
|
*/
|
|
15
16
|
|
|
17
|
+
|
|
16
18
|
class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
|
|
17
19
|
constructor(...args){
|
|
18
20
|
if (args.length === 1) {
|
|
@@ -44,26 +46,26 @@ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
|
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
isDisabled(item) {
|
|
47
|
-
return this.disabledBehavior === 'all' && (item.props?.isDisabled || this.disabledKeys.has(item.key));
|
|
49
|
+
return this.disabledBehavior === 'all' && (item.props?.isDisabled || this.disabledKeys.has(item.key)) && item.props?.disabledBehavior !== 'selection';
|
|
48
50
|
}
|
|
49
|
-
findNextNonDisabled(key, getNext) {
|
|
51
|
+
findNextNonDisabled(key, getNext, includeDisabled = false) {
|
|
50
52
|
let nextKey = key;
|
|
51
53
|
while(nextKey != null){
|
|
52
54
|
let item = this.collection.getItem(nextKey);
|
|
53
|
-
if (item?.type === 'item' && !this.isDisabled(item)) return nextKey;
|
|
55
|
+
if (item?.type === 'item' && (includeDisabled || !this.isDisabled(item))) return nextKey;
|
|
54
56
|
nextKey = getNext(nextKey);
|
|
55
57
|
}
|
|
56
58
|
return null;
|
|
57
59
|
}
|
|
58
|
-
getNextKey(key) {
|
|
60
|
+
getNextKey(key, options) {
|
|
59
61
|
let nextKey = key;
|
|
60
62
|
nextKey = this.collection.getKeyAfter(nextKey);
|
|
61
|
-
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyAfter(key));
|
|
63
|
+
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyAfter(key), options?.includeDisabled);
|
|
62
64
|
}
|
|
63
|
-
getPreviousKey(key) {
|
|
65
|
+
getPreviousKey(key, options) {
|
|
64
66
|
let nextKey = key;
|
|
65
67
|
nextKey = this.collection.getKeyBefore(nextKey);
|
|
66
|
-
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyBefore(key));
|
|
68
|
+
return this.findNextNonDisabled(nextKey, (key)=>this.collection.getKeyBefore(key), options?.includeDisabled);
|
|
67
69
|
}
|
|
68
70
|
findKey(key, nextKey, shouldSkip) {
|
|
69
71
|
let tempKey = key;
|
|
@@ -84,41 +86,63 @@ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
|
|
|
84
86
|
isSameColumn(prevRect, itemRect) {
|
|
85
87
|
return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;
|
|
86
88
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
// checks to see if the next/prev key is spatially above/below the current key. If not, that means we are in
|
|
90
|
+
// a reversed column layout and need to adjust appropriately
|
|
91
|
+
// TODO: still need to see how this works with virtualizer once there is handling for the reverse layout
|
|
92
|
+
// this felt like a simpler approach then changing getKeyAbove/Below to be purely spatial calculations
|
|
93
|
+
isReversed(key) {
|
|
94
|
+
let nextKey = this.getNextKey(key);
|
|
95
|
+
let currentEl = (0, $22bbea12c2567021$export$c3d8340acf92597f)(this.ref, key);
|
|
96
|
+
if (nextKey != null) {
|
|
97
|
+
let nextEl = (0, $22bbea12c2567021$export$c3d8340acf92597f)(this.ref, nextKey);
|
|
98
|
+
if (!currentEl || !nextEl) return false;
|
|
99
|
+
return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;
|
|
100
|
+
}
|
|
101
|
+
let prevKey = this.getPreviousKey(key);
|
|
102
|
+
if (prevKey != null) {
|
|
103
|
+
let prevEl = (0, $22bbea12c2567021$export$c3d8340acf92597f)(this.ref, prevKey);
|
|
104
|
+
if (!currentEl || !prevEl) return false;
|
|
105
|
+
return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
getKeyBelow(key, options) {
|
|
110
|
+
if (this.layout === 'grid' && this.orientation === 'vertical') return this.findKey(key, (key)=>this.getNextKey(key, options), this.isSameRow);
|
|
111
|
+
else if (this.orientation === 'vertical') return this.isReversed(key) ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
|
|
112
|
+
else return this.getNextKey(key, options);
|
|
90
113
|
}
|
|
91
|
-
getKeyAbove(key) {
|
|
92
|
-
if (this.layout === 'grid' && this.orientation === 'vertical') return this.findKey(key, (key)=>this.getPreviousKey(key), this.isSameRow);
|
|
93
|
-
else return this.getPreviousKey(key);
|
|
114
|
+
getKeyAbove(key, options) {
|
|
115
|
+
if (this.layout === 'grid' && this.orientation === 'vertical') return this.findKey(key, (key)=>this.getPreviousKey(key, options), this.isSameRow);
|
|
116
|
+
else if (this.orientation === 'vertical') return this.isReversed(key) ? this.getNextKey(key, options) : this.getPreviousKey(key, options);
|
|
117
|
+
else return this.getPreviousKey(key, options);
|
|
94
118
|
}
|
|
95
|
-
getNextColumn(key, right) {
|
|
96
|
-
return right ? this.getPreviousKey(key) : this.getNextKey(key);
|
|
119
|
+
getNextColumn(key, right, options) {
|
|
120
|
+
return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);
|
|
97
121
|
}
|
|
98
|
-
getKeyRightOf(key) {
|
|
122
|
+
getKeyRightOf(key, options) {
|
|
99
123
|
// This is a temporary solution for CardView until we refactor useSelectableCollection.
|
|
100
124
|
// https://github.com/orgs/adobe/projects/19/views/32?pane=issue&itemId=77825042
|
|
101
125
|
let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyRightOf' : 'getKeyLeftOf';
|
|
102
126
|
if (this.layoutDelegate[layoutDelegateMethod]) {
|
|
103
127
|
key = this.layoutDelegate[layoutDelegateMethod](key);
|
|
104
|
-
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key));
|
|
128
|
+
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key), options?.includeDisabled);
|
|
105
129
|
}
|
|
106
130
|
if (this.layout === 'grid') {
|
|
107
|
-
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'rtl');
|
|
108
|
-
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'rtl'), this.isSameColumn);
|
|
109
|
-
} else if (this.orientation === 'horizontal') return this.getNextColumn(key, this.direction === 'rtl');
|
|
131
|
+
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'rtl', options);
|
|
132
|
+
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'rtl', options), this.isSameColumn);
|
|
133
|
+
} else if (this.orientation === 'horizontal') return this.getNextColumn(key, this.direction === 'rtl', options);
|
|
110
134
|
return null;
|
|
111
135
|
}
|
|
112
|
-
getKeyLeftOf(key) {
|
|
136
|
+
getKeyLeftOf(key, options) {
|
|
113
137
|
let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyLeftOf' : 'getKeyRightOf';
|
|
114
138
|
if (this.layoutDelegate[layoutDelegateMethod]) {
|
|
115
139
|
key = this.layoutDelegate[layoutDelegateMethod](key);
|
|
116
|
-
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key));
|
|
140
|
+
return this.findNextNonDisabled(key, (key)=>this.layoutDelegate[layoutDelegateMethod](key), options?.includeDisabled);
|
|
117
141
|
}
|
|
118
142
|
if (this.layout === 'grid') {
|
|
119
|
-
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'ltr');
|
|
120
|
-
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'ltr'), this.isSameColumn);
|
|
121
|
-
} else if (this.orientation === 'horizontal') return this.getNextColumn(key, this.direction === 'ltr');
|
|
143
|
+
if (this.orientation === 'vertical') return this.getNextColumn(key, this.direction === 'ltr', options);
|
|
144
|
+
else return this.findKey(key, (key)=>this.getNextColumn(key, this.direction === 'ltr', options), this.isSameColumn);
|
|
145
|
+
} else if (this.orientation === 'horizontal') return this.getNextColumn(key, this.direction === 'ltr', options);
|
|
122
146
|
return null;
|
|
123
147
|
}
|
|
124
148
|
getFirstKey() {
|
|
@@ -133,6 +157,7 @@ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
|
|
|
133
157
|
let menu = this.ref.current;
|
|
134
158
|
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
135
159
|
if (!itemRect) return null;
|
|
160
|
+
let reversed = this.isReversed(key);
|
|
136
161
|
if (menu && !(0, $901761b40e390936$export$2bb74740c4e19def)(menu)) return this.getFirstKey();
|
|
137
162
|
let nextKey = key;
|
|
138
163
|
if (this.orientation === 'horizontal') {
|
|
@@ -142,18 +167,21 @@ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
|
|
|
142
167
|
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
143
168
|
}
|
|
144
169
|
} else {
|
|
145
|
-
let
|
|
170
|
+
let visibleRect = this.layoutDelegate.getVisibleRect();
|
|
171
|
+
// column reverse makes y negative for items so we need to instead do current pos - height instead
|
|
172
|
+
let pageY = reversed ? itemRect.y - visibleRect.height : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);
|
|
146
173
|
while(itemRect && itemRect.y > pageY && nextKey != null){
|
|
147
174
|
nextKey = this.getKeyAbove(nextKey);
|
|
148
175
|
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
149
176
|
}
|
|
150
177
|
}
|
|
151
|
-
return nextKey ?? this.getFirstKey();
|
|
178
|
+
return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());
|
|
152
179
|
}
|
|
153
180
|
getKeyPageBelow(key) {
|
|
154
181
|
let menu = this.ref.current;
|
|
155
182
|
let itemRect = this.layoutDelegate.getItemRect(key);
|
|
156
183
|
if (!itemRect) return null;
|
|
184
|
+
let reversed = this.isReversed(key);
|
|
157
185
|
if (menu && !(0, $901761b40e390936$export$2bb74740c4e19def)(menu)) return this.getLastKey();
|
|
158
186
|
let nextKey = key;
|
|
159
187
|
if (this.orientation === 'horizontal') {
|
|
@@ -169,7 +197,7 @@ class $ae8f8d98b2b18f2f$export$a05409b8bb224a5a {
|
|
|
169
197
|
itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);
|
|
170
198
|
}
|
|
171
199
|
}
|
|
172
|
-
return nextKey ?? this.getLastKey();
|
|
200
|
+
return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());
|
|
173
201
|
}
|
|
174
202
|
getKeyForSearch(search, fromKey) {
|
|
175
203
|
if (!this.collator) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA;;;;;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ardDelegate.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 {Collection, Direction, DisabledBehavior, Key, KeyboardDelegate, LayoutDelegate, Node, Orientation, Rect, RefObject} from '@react-types/shared';\nimport {DOMLayoutDelegate} from './DOMLayoutDelegate';\nimport {isScrollable} from '../utils/isScrollable';\n\ninterface ListKeyboardDelegateOptions<T> {\n collection: Collection<Node<T>>,\n ref: RefObject<HTMLElement | null>,\n collator?: Intl.Collator,\n layout?: 'stack' | 'grid',\n orientation?: Orientation,\n direction?: Direction,\n disabledKeys?: Set<Key>,\n disabledBehavior?: DisabledBehavior,\n layoutDelegate?: LayoutDelegate\n}\n\nexport class ListKeyboardDelegate<T> implements KeyboardDelegate {\n private collection: Collection<Node<T>>;\n private disabledKeys: Set<Key>;\n private disabledBehavior: DisabledBehavior;\n private ref: RefObject<HTMLElement | null>;\n private collator: Intl.Collator | undefined;\n private layout: 'stack' | 'grid';\n private orientation?: Orientation;\n private direction?: Direction;\n private layoutDelegate: LayoutDelegate;\n\n constructor(collection: Collection<Node<T>>, disabledKeys: Set<Key>, ref: RefObject<HTMLElement | null>, collator?: Intl.Collator, expandedKeys?: Set<Key>);\n constructor(options: ListKeyboardDelegateOptions<T>);\n constructor(...args: any[]) {\n if (args.length === 1) {\n let opts = args[0] as ListKeyboardDelegateOptions<T>;\n this.collection = opts.collection;\n this.ref = opts.ref;\n this.collator = opts.collator;\n this.disabledKeys = opts.disabledKeys || new Set();\n this.disabledBehavior = opts.disabledBehavior || 'all';\n this.orientation = opts.orientation || 'vertical';\n this.direction = opts.direction;\n this.layout = opts.layout || 'stack';\n this.layoutDelegate = opts.layoutDelegate || new DOMLayoutDelegate(opts.ref);\n } else {\n this.collection = args[0];\n this.disabledKeys = args[1];\n this.ref = args[2];\n this.collator = args[3];\n this.layout = 'stack';\n this.orientation = 'vertical';\n this.disabledBehavior = 'all';\n this.layoutDelegate = new DOMLayoutDelegate(this.ref);\n }\n\n // If this is a vertical stack, remove the left/right methods completely\n // so they aren't called by useDroppableCollection.\n if (this.layout === 'stack' && this.orientation === 'vertical') {\n this.getKeyLeftOf = undefined;\n this.getKeyRightOf = undefined;\n }\n }\n\n private isDisabled(item: Node<unknown>) {\n return this.disabledBehavior === 'all' && (item.props?.isDisabled || this.disabledKeys.has(item.key));\n }\n\n private findNextNonDisabled(key: Key | null, getNext: (key: Key) => Key | null): Key | null {\n let nextKey = key;\n while (nextKey != null) {\n let item = this.collection.getItem(nextKey);\n if (item?.type === 'item' && !this.isDisabled(item)) {\n return nextKey;\n }\n\n nextKey = getNext(nextKey);\n }\n\n return null;\n }\n\n getNextKey(key: Key): Key | null {\n let nextKey: Key | null = key;\n nextKey = this.collection.getKeyAfter(nextKey);\n return this.findNextNonDisabled(nextKey, key => this.collection.getKeyAfter(key));\n }\n\n getPreviousKey(key: Key): Key | null {\n let nextKey: Key | null = key;\n nextKey = this.collection.getKeyBefore(nextKey);\n return this.findNextNonDisabled(nextKey, key => this.collection.getKeyBefore(key));\n }\n\n private findKey(\n key: Key,\n nextKey: (key: Key) => Key | null,\n shouldSkip: (prevRect: Rect, itemRect: Rect) => boolean\n ) {\n let tempKey: Key | null = key;\n let itemRect = this.layoutDelegate.getItemRect(tempKey);\n if (!itemRect || tempKey == null) {\n return null;\n }\n\n // Find the item above or below in the same column.\n let prevRect = itemRect;\n do {\n tempKey = nextKey(tempKey);\n if (tempKey == null) {\n break;\n }\n itemRect = this.layoutDelegate.getItemRect(tempKey);\n } while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);\n\n return tempKey;\n }\n\n private isSameRow(prevRect: Rect, itemRect: Rect) {\n return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;\n }\n\n private isSameColumn(prevRect: Rect, itemRect: Rect) {\n return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;\n }\n\n getKeyBelow(key: Key): Key | null {\n if (this.layout === 'grid' && this.orientation === 'vertical') {\n return this.findKey(key, (key) => this.getNextKey(key), this.isSameRow);\n } else {\n return this.getNextKey(key);\n }\n }\n\n getKeyAbove(key: Key): Key | null {\n if (this.layout === 'grid' && this.orientation === 'vertical') {\n return this.findKey(key, (key) => this.getPreviousKey(key), this.isSameRow);\n } else {\n return this.getPreviousKey(key);\n }\n }\n\n private getNextColumn(key: Key, right: boolean) {\n return right ? this.getPreviousKey(key) : this.getNextKey(key);\n }\n\n getKeyRightOf?(key: Key): Key | null {\n // This is a temporary solution for CardView until we refactor useSelectableCollection.\n // https://github.com/orgs/adobe/projects/19/views/32?pane=issue&itemId=77825042\n let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyRightOf' : 'getKeyLeftOf';\n if (this.layoutDelegate[layoutDelegateMethod]) {\n key = this.layoutDelegate[layoutDelegateMethod](key);\n return this.findNextNonDisabled(key, key => this.layoutDelegate[layoutDelegateMethod](key));\n }\n\n if (this.layout === 'grid') {\n if (this.orientation === 'vertical') {\n return this.getNextColumn(key, this.direction === 'rtl');\n } else {\n return this.findKey(key, (key) => this.getNextColumn(key, this.direction === 'rtl'), this.isSameColumn);\n }\n } else if (this.orientation === 'horizontal') {\n return this.getNextColumn(key, this.direction === 'rtl');\n }\n\n return null;\n }\n\n getKeyLeftOf?(key: Key): Key | null {\n let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyLeftOf' : 'getKeyRightOf';\n if (this.layoutDelegate[layoutDelegateMethod]) {\n key = this.layoutDelegate[layoutDelegateMethod](key);\n return this.findNextNonDisabled(key, key => this.layoutDelegate[layoutDelegateMethod](key));\n }\n\n if (this.layout === 'grid') {\n if (this.orientation === 'vertical') {\n return this.getNextColumn(key, this.direction === 'ltr');\n } else {\n return this.findKey(key, (key) => this.getNextColumn(key, this.direction === 'ltr'), this.isSameColumn);\n }\n } else if (this.orientation === 'horizontal') {\n return this.getNextColumn(key, this.direction === 'ltr');\n }\n\n return null;\n }\n\n getFirstKey(): Key | null {\n let key = this.collection.getFirstKey();\n return this.findNextNonDisabled(key, key => this.collection.getKeyAfter(key));\n }\n\n getLastKey(): Key | null {\n let key = this.collection.getLastKey();\n return this.findNextNonDisabled(key, key => this.collection.getKeyBefore(key));\n }\n\n getKeyPageAbove(key: Key): Key | null {\n let menu = this.ref.current;\n let itemRect = this.layoutDelegate.getItemRect(key);\n if (!itemRect) {\n return null;\n }\n\n if (menu && !isScrollable(menu)) {\n return this.getFirstKey();\n }\n\n let nextKey: Key | null = key;\n if (this.orientation === 'horizontal') {\n let pageX = Math.max(0, itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width);\n\n while (itemRect && itemRect.x > pageX && nextKey != null) {\n nextKey = this.getKeyAbove(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n } else {\n let pageY = Math.max(0, itemRect.y + itemRect.height - this.layoutDelegate.getVisibleRect().height);\n\n while (itemRect && itemRect.y > pageY && nextKey != null) {\n nextKey = this.getKeyAbove(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n }\n\n return nextKey ?? this.getFirstKey();\n }\n\n getKeyPageBelow(key: Key): Key | null {\n let menu = this.ref.current;\n let itemRect = this.layoutDelegate.getItemRect(key);\n if (!itemRect) {\n return null;\n }\n\n if (menu && !isScrollable(menu)) {\n return this.getLastKey();\n }\n\n let nextKey: Key | null = key;\n if (this.orientation === 'horizontal') {\n let pageX = Math.min(this.layoutDelegate.getContentSize().width, itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width);\n\n while (itemRect && itemRect.x < pageX && nextKey != null) {\n nextKey = this.getKeyBelow(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n } else {\n let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height);\n\n while (itemRect && itemRect.y < pageY && nextKey != null) {\n nextKey = this.getKeyBelow(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n }\n\n return nextKey ?? this.getLastKey();\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Key | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (!item) {\n return null;\n }\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getNextKey(key);\n }\n\n return null;\n }\n}\n"],"names":[],"version":3,"file":"ListKeyboardDelegate.mjs.map"}
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AA8BM,MAAM;IAmBX,YAAY,GAAG,IAAW,CAAE;QAC1B,IAAI,KAAK,MAAM,KAAK,GAAG;YACrB,IAAI,OAAO,IAAI,CAAC,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,KAAK,UAAU;YACjC,IAAI,CAAC,GAAG,GAAG,KAAK,GAAG;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,QAAQ;YAC7B,IAAI,CAAC,YAAY,GAAG,KAAK,YAAY,IAAI,IAAI;YAC7C,IAAI,CAAC,gBAAgB,GAAG,KAAK,gBAAgB,IAAI;YACjD,IAAI,CAAC,WAAW,GAAG,KAAK,WAAW,IAAI;YACvC,IAAI,CAAC,SAAS,GAAG,KAAK,SAAS;YAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,MAAM,IAAI;YAC7B,IAAI,CAAC,cAAc,GAAG,KAAK,cAAc,IAAI,IAAI,CAAA,GAAA,yCAAgB,EAAE,KAAK,GAAG;QAC7E,OAAO;YACL,IAAI,CAAC,UAAU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AC3C,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,GAAG,MAAM;YAG5E,MAAO,YAAY,SAAS,CAAC,GAAG,SAAS,WAAW,KAAM;gBACxD,UAAU,IAAI,CAAC,WAAW,CAAC;gBAC3B,WAAW,WAAW,OAAO,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;YACtE;QACF;QAEA,OAAO,WAAY,CAAA,WAAW,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,UAAU,EAAC;IACrE;IAEA,gBAAgB,MAAc,EAAE,OAAa,EAAc;QACzD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAChB,OAAO;QAGT,IAAI,aAAa,IAAI,CAAC,UAAU;QAChC,IAAI,MAAM,WAAW,IAAI,CAAC,WAAW;QACrC,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,WAAW,OAAO,CAAC;YAC9B,IAAI,CAAC,MACH,OAAO;YAET,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;YACrD,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GACjE,OAAO;YAGT,MAAM,IAAI,CAAC,UAAU,CAAC;QACxB;QAEA,OAAO;IACT;AACF","sources":["packages/react-aria/src/selection/ListKeyboardDelegate.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 {\n Collection,\n Direction,\n DisabledBehavior,\n Key,\n KeyboardDelegate,\n LayoutDelegate,\n Node,\n Orientation,\n Rect,\n RefObject\n} from '@react-types/shared';\nimport {DOMLayoutDelegate} from './DOMLayoutDelegate';\nimport {getItemElement} from './utils';\nimport {isScrollable} from '../utils/isScrollable';\n\ninterface ListKeyboardDelegateOptions<T> {\n collection: Collection<Node<T>>;\n ref: RefObject<HTMLElement | null>;\n collator?: Intl.Collator;\n layout?: 'stack' | 'grid';\n orientation?: Orientation;\n direction?: Direction;\n disabledKeys?: Set<Key>;\n disabledBehavior?: DisabledBehavior;\n layoutDelegate?: LayoutDelegate;\n}\n\nexport class ListKeyboardDelegate<T> implements KeyboardDelegate {\n private collection: Collection<Node<T>>;\n private disabledKeys: Set<Key>;\n private disabledBehavior: DisabledBehavior;\n private ref: RefObject<HTMLElement | null>;\n private collator: Intl.Collator | undefined;\n private layout: 'stack' | 'grid';\n private orientation?: Orientation;\n private direction?: Direction;\n private layoutDelegate: LayoutDelegate;\n\n constructor(\n collection: Collection<Node<T>>,\n disabledKeys: Set<Key>,\n ref: RefObject<HTMLElement | null>,\n collator?: Intl.Collator,\n expandedKeys?: Set<Key>\n );\n constructor(options: ListKeyboardDelegateOptions<T>);\n constructor(...args: any[]) {\n if (args.length === 1) {\n let opts = args[0] as ListKeyboardDelegateOptions<T>;\n this.collection = opts.collection;\n this.ref = opts.ref;\n this.collator = opts.collator;\n this.disabledKeys = opts.disabledKeys || new Set();\n this.disabledBehavior = opts.disabledBehavior || 'all';\n this.orientation = opts.orientation || 'vertical';\n this.direction = opts.direction;\n this.layout = opts.layout || 'stack';\n this.layoutDelegate = opts.layoutDelegate || new DOMLayoutDelegate(opts.ref);\n } else {\n this.collection = args[0];\n this.disabledKeys = args[1];\n this.ref = args[2];\n this.collator = args[3];\n this.layout = 'stack';\n this.orientation = 'vertical';\n this.disabledBehavior = 'all';\n this.layoutDelegate = new DOMLayoutDelegate(this.ref);\n }\n\n // If this is a vertical stack, remove the left/right methods completely\n // so they aren't called by useDroppableCollection.\n if (this.layout === 'stack' && this.orientation === 'vertical') {\n this.getKeyLeftOf = undefined;\n this.getKeyRightOf = undefined;\n }\n }\n\n private isDisabled(item: Node<unknown>) {\n return (\n this.disabledBehavior === 'all' &&\n (item.props?.isDisabled || this.disabledKeys.has(item.key)) &&\n item.props?.disabledBehavior !== 'selection'\n );\n }\n\n private findNextNonDisabled(\n key: Key | null,\n getNext: (key: Key) => Key | null,\n includeDisabled = false\n ): Key | null {\n let nextKey = key;\n while (nextKey != null) {\n let item = this.collection.getItem(nextKey);\n if (item?.type === 'item' && (includeDisabled || !this.isDisabled(item))) {\n return nextKey;\n }\n\n nextKey = getNext(nextKey);\n }\n\n return null;\n }\n\n getNextKey(key: Key, options?: {includeDisabled?: boolean}): Key | null {\n let nextKey: Key | null = key;\n nextKey = this.collection.getKeyAfter(nextKey);\n return this.findNextNonDisabled(\n nextKey,\n key => this.collection.getKeyAfter(key),\n options?.includeDisabled\n );\n }\n\n getPreviousKey(key: Key, options?: {includeDisabled?: boolean}): Key | null {\n let nextKey: Key | null = key;\n nextKey = this.collection.getKeyBefore(nextKey);\n return this.findNextNonDisabled(\n nextKey,\n key => this.collection.getKeyBefore(key),\n options?.includeDisabled\n );\n }\n\n private findKey(\n key: Key,\n nextKey: (key: Key) => Key | null,\n shouldSkip: (prevRect: Rect, itemRect: Rect) => boolean\n ) {\n let tempKey: Key | null = key;\n let itemRect = this.layoutDelegate.getItemRect(tempKey);\n if (!itemRect || tempKey == null) {\n return null;\n }\n\n // Find the item above or below in the same column.\n let prevRect = itemRect;\n do {\n tempKey = nextKey(tempKey);\n if (tempKey == null) {\n break;\n }\n itemRect = this.layoutDelegate.getItemRect(tempKey);\n } while (itemRect && shouldSkip(prevRect, itemRect) && tempKey != null);\n\n return tempKey;\n }\n\n private isSameRow(prevRect: Rect, itemRect: Rect) {\n return prevRect.y === itemRect.y || prevRect.x !== itemRect.x;\n }\n\n private isSameColumn(prevRect: Rect, itemRect: Rect) {\n return prevRect.x === itemRect.x || prevRect.y !== itemRect.y;\n }\n\n // checks to see if the next/prev key is spatially above/below the current key. If not, that means we are in\n // a reversed column layout and need to adjust appropriately\n // TODO: still need to see how this works with virtualizer once there is handling for the reverse layout\n // this felt like a simpler approach then changing getKeyAbove/Below to be purely spatial calculations\n private isReversed(key: Key): boolean {\n let nextKey = this.getNextKey(key);\n let currentEl = getItemElement(this.ref, key);\n if (nextKey != null) {\n let nextEl = getItemElement(this.ref, nextKey);\n if (!currentEl || !nextEl) {\n return false;\n }\n return currentEl.getBoundingClientRect().top > nextEl.getBoundingClientRect().top;\n }\n let prevKey = this.getPreviousKey(key);\n if (prevKey != null) {\n let prevEl = getItemElement(this.ref, prevKey);\n if (!currentEl || !prevEl) {\n return false;\n }\n return prevEl.getBoundingClientRect().top > currentEl.getBoundingClientRect().top;\n }\n return false;\n }\n\n getKeyBelow(key: Key, options?: {includeDisabled?: boolean}): Key | null {\n if (this.layout === 'grid' && this.orientation === 'vertical') {\n return this.findKey(key, key => this.getNextKey(key, options), this.isSameRow);\n } else if (this.orientation === 'vertical') {\n return this.isReversed(key)\n ? this.getPreviousKey(key, options)\n : this.getNextKey(key, options);\n } else {\n return this.getNextKey(key, options);\n }\n }\n\n getKeyAbove(key: Key, options?: {includeDisabled?: boolean}): Key | null {\n if (this.layout === 'grid' && this.orientation === 'vertical') {\n return this.findKey(key, key => this.getPreviousKey(key, options), this.isSameRow);\n } else if (this.orientation === 'vertical') {\n return this.isReversed(key)\n ? this.getNextKey(key, options)\n : this.getPreviousKey(key, options);\n } else {\n return this.getPreviousKey(key, options);\n }\n }\n\n private getNextColumn(key: Key, right: boolean, options?: {includeDisabled?: boolean}) {\n return right ? this.getPreviousKey(key, options) : this.getNextKey(key, options);\n }\n\n getKeyRightOf?(key: Key, options?: {includeDisabled?: boolean}): Key | null {\n // This is a temporary solution for CardView until we refactor useSelectableCollection.\n // https://github.com/orgs/adobe/projects/19/views/32?pane=issue&itemId=77825042\n let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyRightOf' : 'getKeyLeftOf';\n if (this.layoutDelegate[layoutDelegateMethod]) {\n key = this.layoutDelegate[layoutDelegateMethod](key);\n return this.findNextNonDisabled(\n key,\n key => this.layoutDelegate[layoutDelegateMethod](key),\n options?.includeDisabled\n );\n }\n\n if (this.layout === 'grid') {\n if (this.orientation === 'vertical') {\n return this.getNextColumn(key, this.direction === 'rtl', options);\n } else {\n return this.findKey(\n key,\n key => this.getNextColumn(key, this.direction === 'rtl', options),\n this.isSameColumn\n );\n }\n } else if (this.orientation === 'horizontal') {\n return this.getNextColumn(key, this.direction === 'rtl', options);\n }\n\n return null;\n }\n\n getKeyLeftOf?(key: Key, options?: {includeDisabled?: boolean}): Key | null {\n let layoutDelegateMethod = this.direction === 'ltr' ? 'getKeyLeftOf' : 'getKeyRightOf';\n if (this.layoutDelegate[layoutDelegateMethod]) {\n key = this.layoutDelegate[layoutDelegateMethod](key);\n return this.findNextNonDisabled(\n key,\n key => this.layoutDelegate[layoutDelegateMethod](key),\n options?.includeDisabled\n );\n }\n\n if (this.layout === 'grid') {\n if (this.orientation === 'vertical') {\n return this.getNextColumn(key, this.direction === 'ltr', options);\n } else {\n return this.findKey(\n key,\n key => this.getNextColumn(key, this.direction === 'ltr', options),\n this.isSameColumn\n );\n }\n } else if (this.orientation === 'horizontal') {\n return this.getNextColumn(key, this.direction === 'ltr', options);\n }\n\n return null;\n }\n\n getFirstKey(): Key | null {\n let key = this.collection.getFirstKey();\n return this.findNextNonDisabled(key, key => this.collection.getKeyAfter(key));\n }\n\n getLastKey(): Key | null {\n let key = this.collection.getLastKey();\n return this.findNextNonDisabled(key, key => this.collection.getKeyBefore(key));\n }\n\n getKeyPageAbove(key: Key): Key | null {\n let menu = this.ref.current;\n let itemRect = this.layoutDelegate.getItemRect(key);\n if (!itemRect) {\n return null;\n }\n\n let reversed = this.isReversed(key);\n if (menu && !isScrollable(menu)) {\n return this.getFirstKey();\n }\n\n let nextKey: Key | null = key;\n if (this.orientation === 'horizontal') {\n let pageX = Math.max(\n 0,\n itemRect.x + itemRect.width - this.layoutDelegate.getVisibleRect().width\n );\n\n while (itemRect && itemRect.x > pageX && nextKey != null) {\n nextKey = this.getKeyAbove(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n } else {\n let visibleRect = this.layoutDelegate.getVisibleRect();\n // column reverse makes y negative for items so we need to instead do current pos - height instead\n let pageY = reversed\n ? itemRect.y - visibleRect.height\n : Math.max(0, itemRect.y + itemRect.height - visibleRect.height);\n\n while (itemRect && itemRect.y > pageY && nextKey != null) {\n nextKey = this.getKeyAbove(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n }\n\n return nextKey ?? (reversed ? this.getLastKey() : this.getFirstKey());\n }\n\n getKeyPageBelow(key: Key): Key | null {\n let menu = this.ref.current;\n let itemRect = this.layoutDelegate.getItemRect(key);\n if (!itemRect) {\n return null;\n }\n\n let reversed = this.isReversed(key);\n if (menu && !isScrollable(menu)) {\n return this.getLastKey();\n }\n\n let nextKey: Key | null = key;\n if (this.orientation === 'horizontal') {\n let pageX = Math.min(\n this.layoutDelegate.getContentSize().width,\n itemRect.x - itemRect.width + this.layoutDelegate.getVisibleRect().width\n );\n\n while (itemRect && itemRect.x < pageX && nextKey != null) {\n nextKey = this.getKeyBelow(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n } else {\n let pageY = Math.min(\n this.layoutDelegate.getContentSize().height,\n itemRect.y - itemRect.height + this.layoutDelegate.getVisibleRect().height\n );\n\n while (itemRect && itemRect.y < pageY && nextKey != null) {\n nextKey = this.getKeyBelow(nextKey);\n itemRect = nextKey == null ? null : this.layoutDelegate.getItemRect(nextKey);\n }\n }\n\n return nextKey ?? (reversed ? this.getFirstKey() : this.getLastKey());\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Key | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey || this.getFirstKey();\n while (key != null) {\n let item = collection.getItem(key);\n if (!item) {\n return null;\n }\n let substring = item.textValue.slice(0, search.length);\n if (item.textValue && this.collator.compare(substring, search) === 0) {\n return key;\n }\n\n key = this.getNextKey(key);\n }\n\n return null;\n }\n}\n"],"names":[],"version":3,"file":"ListKeyboardDelegate.mjs.map"}
|
|
@@ -55,7 +55,7 @@ $parcel$export(module.exports, "useSelectableCollection", function () { return $
|
|
|
55
55
|
|
|
56
56
|
function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
57
57
|
let { selectionManager: manager, keyboardDelegate: delegate, ref: ref, autoFocus: autoFocus = false, shouldFocusWrap: shouldFocusWrap = false, disallowEmptySelection: disallowEmptySelection = false, disallowSelectAll: disallowSelectAll = false, escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace', disallowTypeAhead: disallowTypeAhead = false, shouldUseVirtualFocus: shouldUseVirtualFocus, allowsTabNavigation: allowsTabNavigation = false, scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
|
|
58
|
-
scrollRef = ref, linkBehavior: linkBehavior = 'action' } = options;
|
|
58
|
+
scrollRef = ref, linkBehavior: linkBehavior = 'action', UNSTABLE_focusOnEntry: UNSTABLE_focusOnEntry } = options;
|
|
59
59
|
let { direction: direction } = (0, $2522e612fa919664$exports.useLocale)();
|
|
60
60
|
let router = (0, $75bd88aab025820b$exports.useRouter)();
|
|
61
61
|
let onKeyDown = (e)=>{
|
|
@@ -195,6 +195,7 @@ function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
|
195
195
|
let last;
|
|
196
196
|
do {
|
|
197
197
|
last = walker.lastChild();
|
|
198
|
+
// oxlint-disable-next-line max-depth
|
|
198
199
|
if (last) next = last;
|
|
199
200
|
}while (last);
|
|
200
201
|
// If the active element is NOT tabbable but is contained by an element that IS tabbable (aka the cell), the browser will actually move focus to
|
|
@@ -227,14 +228,20 @@ function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
|
227
228
|
}
|
|
228
229
|
// Focus events can bubble through portals. Ignore these events.
|
|
229
230
|
if (!(0, $da02ee888921bc9e$exports.nodeContains)(e.currentTarget, (0, $da02ee888921bc9e$exports.getEventTarget)(e))) return;
|
|
231
|
+
let modality = (0, $d0df89f3abe2c2ca$exports.getInteractionModality)();
|
|
230
232
|
manager.setFocused(true);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
let navigateToKey = (key)=>{
|
|
234
|
+
if (key != null) {
|
|
235
|
+
manager.setFocusedKey(key);
|
|
236
|
+
if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
// we need the "virtual" modality case checks here because shift tabbing from the prompt field's attachment card back into the
|
|
240
|
+
// thread is a virtual focus event (the tab handler in onKeyDown focuses the ref of the AttachementList aka TagGroup via a focus() call, hence the virtual modality)
|
|
241
|
+
if (UNSTABLE_focusOnEntry && (modality === 'keyboard' || modality === 'virtual')) // always go to the first item in the Thread when tabbing forwards/backwards into the collection
|
|
242
|
+
// since it is probably more important to the user to see the new prompt reply rather than go to the last focused key
|
|
243
|
+
navigateToKey(UNSTABLE_focusOnEntry === 'first' ? delegate.getFirstKey?.() : delegate.getLastKey?.());
|
|
244
|
+
else if (manager.focusedKey == null) {
|
|
238
245
|
// If the user hasn't yet interacted with the collection, there will be no focusedKey set.
|
|
239
246
|
// Attempt to detect whether the user is tabbing forward or backward into the collection
|
|
240
247
|
// and either focus the first or last item accordingly.
|
|
@@ -252,8 +259,7 @@ function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
|
252
259
|
if (element instanceof HTMLElement) {
|
|
253
260
|
// This prevents a flash of focus on the first/last element in the collection, or the collection itself.
|
|
254
261
|
if (!(0, $da02ee888921bc9e$exports.isFocusWithin)(element) && !shouldUseVirtualFocus) (0, $4b9e9ed3f006ad27$exports.focusWithoutScrolling)(element);
|
|
255
|
-
|
|
256
|
-
if (modality === 'keyboard') (0, $9a1324d6ffd8bbb0$exports.scrollIntoViewport)(element, {
|
|
262
|
+
if (modality === 'keyboard' || UNSTABLE_focusOnEntry && modality === 'virtual') (0, $9a1324d6ffd8bbb0$exports.scrollIntoViewport)(element, {
|
|
257
263
|
containingElement: ref.current
|
|
258
264
|
});
|
|
259
265
|
}
|
|
@@ -278,12 +284,12 @@ function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
|
278
284
|
if (detail?.focusStrategy === 'first') shouldVirtualFocusFirst.current = true;
|
|
279
285
|
});
|
|
280
286
|
// update active descendant
|
|
287
|
+
let firstKey = delegate.getFirstKey?.() ?? null;
|
|
281
288
|
(0, $826bcd7bc2ba42c6$exports.useUpdateLayoutEffect)(()=>{
|
|
282
289
|
if (shouldVirtualFocusFirst.current) {
|
|
283
|
-
let keyToFocus = delegate.getFirstKey?.() ?? null;
|
|
284
290
|
// If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to
|
|
285
291
|
// the original active element (e.g. the autocomplete input)
|
|
286
|
-
if (
|
|
292
|
+
if (firstKey == null) {
|
|
287
293
|
let previousActiveElement = (0, $da02ee888921bc9e$exports.getActiveElement)();
|
|
288
294
|
(0, $4f541c01c875ab4e$exports.moveVirtualFocus)(ref.current);
|
|
289
295
|
(0, $4f541c01c875ab4e$exports.dispatchVirtualFocus)(previousActiveElement, null);
|
|
@@ -291,7 +297,7 @@ function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
|
291
297
|
// Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.
|
|
292
298
|
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
293
299
|
} else {
|
|
294
|
-
manager.setFocusedKey(
|
|
300
|
+
manager.setFocusedKey(firstKey);
|
|
295
301
|
// Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key
|
|
296
302
|
// If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key
|
|
297
303
|
// after the collection updates after load
|
|
@@ -299,7 +305,8 @@ function $df9ba3e9a7210056$export$d6daf82dcd84e87c(options) {
|
|
|
299
305
|
}
|
|
300
306
|
}
|
|
301
307
|
}, [
|
|
302
|
-
|
|
308
|
+
firstKey,
|
|
309
|
+
manager.collection.size
|
|
303
310
|
]);
|
|
304
311
|
// reset focus first flag
|
|
305
312
|
(0, $826bcd7bc2ba42c6$exports.useUpdateLayoutEffect)(()=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;AA4GM,SAAS,0CAAwB,OAAwC;IAC9E,IAAI,EACF,kBAAkB,OAAO,EACzB,kBAAkB,QAAQ,OAC1B,GAAG,aACH,YAAY,wBACZ,kBAAkB,+BAClB,yBAAyB,0BACzB,oBAAoB,0BACpB,oBAAoB,iCACpB,gBAAgB,QAAQ,iBAAiB,KAAK,8BAC9C,oBAAoB,8BACpB,qBAAqB,uBACrB,sBAAsB,kBACtB,kFAAkF;IAClF,YAAY,mBACZ,eAAe,UAChB,GAAG;IACJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAC1B,IAAI,SAAS,CAAA,GAAA,mCAAQ;IAErB,IAAI,YAAY,CAAC;QACf,6GAA6G;QAC7G,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,KAAK,OACxB,EAAE,cAAc;QAGlB,uEAAuE;QACvE,oDAAoD;QACpD,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAA,GAAA,sCAAW,EAAE,IAAI,OAAO,EAAE,CAAA,GAAA,wCAAa,EAAE,KAC5D;QAGF,MAAM,gBAAgB,CAAC,KAAsB;YAC3C,IAAI,OAAO,MAAM;gBACf,IAAI,QAAQ,MAAM,CAAC,QAAQ,iBAAiB,eAAe,iBAAiB,CAAC,CAAA,GAAA,0DAA+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;AACF","sources":["packages/react-aria/src/selection/useSelectableCollection.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 {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from '../utils/constants';\n\nimport {dispatchVirtualFocus, moveVirtualFocus} from '../focus/virtualFocus';\nimport {DOMAttributes, FocusableElement, FocusStrategy, Key, KeyboardDelegate, RefObject} from '@react-types/shared';\nimport {flushSync} from 'react-dom';\nimport {FocusEvent, KeyboardEvent, useEffect, useRef} from 'react';\nimport {focusSafely} from '../interactions/focusSafely';\nimport {focusWithoutScrolling} from '../utils/focusWithoutScrolling';\nimport {getActiveElement, getEventTarget, isFocusWithin, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getFocusableTreeWalker} from '../focus/FocusScope';\nimport {getInteractionModality} from '../interactions/useFocusVisible';\nimport {getItemElement, isNonContiguousSelectionModifier, useCollectionId} from './utils';\nimport {isCtrlKeyPressed} from '../utils/keyboard';\nimport {isTabbable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport {scrollIntoView, scrollIntoViewport} from '../utils/scrollIntoView';\nimport {useEvent} from '../utils/useEvent';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useRouter} from '../utils/openLink';\nimport {useTypeSelect} from './useTypeSelect';\nimport {useUpdateLayoutEffect} from '../utils/useUpdateLayoutEffect';\n\nexport interface AriaSelectableCollectionOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager,\n /**\n * A delegate object that implements behavior for keyboard focus movement.\n */\n keyboardDelegate: KeyboardDelegate,\n /**\n * The ref attached to the element representing the collection.\n */\n ref: RefObject<HTMLElement | null>,\n /**\n * Whether the collection or one of its items should be automatically focused upon render.\n * @default false\n */\n autoFocus?: boolean | FocusStrategy,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * Whether the collection allows empty selection.\n * @default false\n */\n disallowEmptySelection?: boolean,\n /**\n * Whether the collection allows the user to select all items via keyboard shortcut.\n * @default false\n */\n disallowSelectAll?: boolean,\n /**\n * Whether pressing the Escape should clear selection in the collection or not.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none',\n /**\n * Whether selection should occur automatically on focus.\n * @default false\n */\n selectOnFocus?: boolean,\n /**\n * Whether typeahead is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * Whether the collection items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n /**\n * Whether navigation through tab key is enabled.\n */\n allowsTabNavigation?: boolean,\n /**\n * Whether the collection items are contained in a virtual scroller.\n */\n isVirtualized?: boolean,\n /**\n * The ref attached to the scrollable body. Used to provide automatic scrolling on item focus for non-virtualized collections.\n * If not provided, defaults to the collection ref.\n */\n scrollRef?: RefObject<HTMLElement | null>,\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'action'\n */\n linkBehavior?: 'action' | 'selection' | 'override'\n}\n\nexport interface SelectableCollectionAria {\n /** Props for the collection element. */\n collectionProps: DOMAttributes\n}\n\n/**\n * Handles interactions with selectable collections.\n */\nexport function useSelectableCollection(options: AriaSelectableCollectionOptions): SelectableCollectionAria {\n let {\n selectionManager: manager,\n keyboardDelegate: delegate,\n ref,\n autoFocus = false,\n shouldFocusWrap = false,\n disallowEmptySelection = false,\n disallowSelectAll = false,\n escapeKeyBehavior = 'clearSelection',\n selectOnFocus = manager.selectionBehavior === 'replace',\n disallowTypeAhead = false,\n shouldUseVirtualFocus,\n allowsTabNavigation = false,\n // If no scrollRef is provided, assume the collection ref is the scrollable region\n scrollRef = ref,\n linkBehavior = 'action'\n } = options;\n let {direction} = useLocale();\n let router = useRouter();\n\n let onKeyDown = (e: KeyboardEvent) => {\n // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes\n if (e.altKey && e.key === 'Tab') {\n e.preventDefault();\n }\n\n // Keyboard events bubble through portals. Don't handle keyboard events\n // for elements outside the collection (e.g. menus).\n if (!ref.current || !nodeContains(ref.current, getEventTarget(e) as Element)) {\n return;\n }\n\n const navigateToKey = (key: Key | undefined, childFocus?: FocusStrategy) => {\n if (key != null) {\n if (manager.isLink(key) && linkBehavior === 'selection' && selectOnFocus && !isNonContiguousSelectionModifier(e)) {\n // Set focused key and re-render synchronously to bring item into view if needed.\n flushSync(() => {\n manager.setFocusedKey(key, childFocus);\n });\n\n let item = getItemElement(ref, key);\n let itemProps = manager.getItemProps(key);\n if (item) {\n router.open(item, e, itemProps.href, itemProps.routerOptions);\n }\n\n return;\n }\n\n manager.setFocusedKey(key, childFocus);\n\n if (manager.isLink(key) && linkBehavior === 'override') {\n return;\n }\n\n if (e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(key);\n } else if (selectOnFocus && !isNonContiguousSelectionModifier(e)) {\n manager.replaceSelection(key);\n }\n }\n };\n\n switch (e.key) {\n case 'ArrowDown': {\n if (delegate.getKeyBelow) {\n let nextKey = manager.focusedKey != null\n ? delegate.getKeyBelow?.(manager.focusedKey)\n : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getFirstKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n }\n case 'ArrowUp': {\n if (delegate.getKeyAbove) {\n let nextKey = manager.focusedKey != null\n ? delegate.getKeyAbove?.(manager.focusedKey)\n : delegate.getLastKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getLastKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n }\n case 'ArrowLeft': {\n if (delegate.getKeyLeftOf) {\n let nextKey: Key | undefined | null = manager.focusedKey != null ? delegate.getKeyLeftOf?.(manager.focusedKey) : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = direction === 'rtl' ? delegate.getFirstKey?.(manager.focusedKey) : delegate.getLastKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');\n }\n }\n break;\n }\n case 'ArrowRight': {\n if (delegate.getKeyRightOf) {\n let nextKey: Key | undefined | null = manager.focusedKey != null ? delegate.getKeyRightOf?.(manager.focusedKey) : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = direction === 'rtl' ? delegate.getLastKey?.(manager.focusedKey) : delegate.getFirstKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');\n }\n }\n break;\n }\n case 'Home':\n if (delegate.getFirstKey) {\n if (manager.focusedKey === null && e.shiftKey) {\n return;\n }\n e.preventDefault();\n let firstKey: Key | null = delegate.getFirstKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(firstKey);\n if (firstKey != null) {\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(firstKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(firstKey);\n }\n }\n }\n break;\n case 'End':\n if (delegate.getLastKey) {\n if (manager.focusedKey === null && e.shiftKey) {\n return;\n }\n e.preventDefault();\n let lastKey = delegate.getLastKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(lastKey);\n if (lastKey != null) {\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(lastKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(lastKey);\n }\n }\n }\n break;\n case 'PageDown':\n if (delegate.getKeyPageBelow && manager.focusedKey != null) {\n let nextKey = delegate.getKeyPageBelow(manager.focusedKey);\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n case 'PageUp':\n if (delegate.getKeyPageAbove && manager.focusedKey != null) {\n let nextKey = delegate.getKeyPageAbove(manager.focusedKey);\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n case 'a':\n if (isCtrlKeyPressed(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {\n e.preventDefault();\n manager.selectAll();\n }\n break;\n case 'Escape':\n if (escapeKeyBehavior === 'clearSelection' && !disallowEmptySelection && manager.selectedKeys.size !== 0) {\n e.stopPropagation();\n e.preventDefault();\n manager.clearSelection();\n }\n break;\n case 'Tab': {\n if (!allowsTabNavigation) {\n // There may be elements that are \"tabbable\" inside a collection (e.g. in a grid cell).\n // However, collections should be treated as a single tab stop, with arrow key navigation internally.\n // We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.\n // Instead, we handle the Tab key, and move focus manually to the first/last tabbable element\n // in the collection, so that the browser default behavior will apply starting from that element\n // rather than the currently focused one.\n if (e.shiftKey) {\n ref.current.focus();\n } else {\n let walker = getFocusableTreeWalker(ref.current, {tabbable: true});\n let next: FocusableElement | undefined = undefined;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n\n // If the active element is NOT tabbable but is contained by an element that IS tabbable (aka the cell), the browser will actually move focus to\n // the containing element. We need to special case this so that tab will move focus out of the grid instead of looping between\n // focusing the containing cell and back to the non-tabbable child element\n let activeElement = getActiveElement();\n if (next && (!isFocusWithin(next) || (activeElement && !isTabbable(activeElement)))) {\n focusWithoutScrolling(next);\n }\n }\n break;\n }\n }\n }\n };\n\n // Store the scroll position so we can restore it later.\n /// TODO: should this happen all the time??\n let scrollPos = useRef({top: 0, left: 0});\n useEvent(scrollRef, 'scroll', () => {\n scrollPos.current = {\n top: scrollRef.current?.scrollTop ?? 0,\n left: scrollRef.current?.scrollLeft ?? 0\n };\n });\n\n let onFocus = (e: FocusEvent) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n return;\n }\n\n manager.setFocused(true);\n if (manager.focusedKey == null) {\n let navigateToKey = (key: Key | undefined | null) => {\n if (key != null) {\n manager.setFocusedKey(key);\n if (selectOnFocus && !manager.isSelected(key)) {\n manager.replaceSelection(key);\n }\n }\n };\n // If the user hasn't yet interacted with the collection, there will be no focusedKey set.\n // Attempt to detect whether the user is tabbing forward or backward into the collection\n // and either focus the first or last item accordingly.\n let relatedTarget = e.relatedTarget as Element;\n if (relatedTarget && (e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING)) {\n navigateToKey(manager.lastSelectedKey ?? delegate.getLastKey?.());\n } else {\n navigateToKey(manager.firstSelectedKey ?? delegate.getFirstKey?.());\n }\n } else if (scrollRef.current) {\n // Restore the scroll position to what it was before.\n scrollRef.current.scrollTop = scrollPos.current.top;\n scrollRef.current.scrollLeft = scrollPos.current.left;\n }\n\n if (manager.focusedKey != null && scrollRef.current) {\n // Refocus and scroll the focused item into view if it exists within the scrollable region.\n let element = getItemElement(ref, manager.focusedKey);\n if (element instanceof HTMLElement) {\n // This prevents a flash of focus on the first/last element in the collection, or the collection itself.\n if (!isFocusWithin(element) && !shouldUseVirtualFocus) {\n focusWithoutScrolling(element);\n }\n\n let modality = getInteractionModality();\n if (modality === 'keyboard') {\n scrollIntoViewport(element, {containingElement: ref.current});\n }\n }\n }\n };\n\n let onBlur = (e) => {\n // Don't set blurred and then focused again if moving focus within the collection.\n if (!nodeContains(e.currentTarget, e.relatedTarget as HTMLElement)) {\n manager.setFocused(false);\n }\n };\n\n // Ref to track whether the first item in the collection should be automatically focused. Specifically used for autocomplete when user types\n // to focus the first key AFTER the collection updates.\n // TODO: potentially expand the usage of this\n let shouldVirtualFocusFirst = useRef(false);\n // Add event listeners for custom virtual events. These handle updating the focused key in response to various keyboard events\n // at the autocomplete level\n // TODO: fix type later\n useEvent(ref, FOCUS_EVENT, !shouldUseVirtualFocus ? undefined : (e: any) => {\n let {detail} = e;\n e.stopPropagation();\n manager.setFocused(true);\n // If the user is typing forwards, autofocus the first option in the list.\n if (detail?.focusStrategy === 'first') {\n shouldVirtualFocusFirst.current = true;\n }\n });\n\n // update active descendant\n useUpdateLayoutEffect(() => {\n if (shouldVirtualFocusFirst.current) {\n let keyToFocus = delegate.getFirstKey?.() ?? null;\n\n // If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to\n // the original active element (e.g. the autocomplete input)\n if (keyToFocus == null) {\n let previousActiveElement = getActiveElement();\n moveVirtualFocus(ref.current);\n dispatchVirtualFocus(previousActiveElement!, null);\n\n // If there wasn't a focusable key but the collection had items, then that means we aren't in an intermediate load state and all keys are disabled.\n // Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.\n if (manager.collection.size > 0) {\n shouldVirtualFocusFirst.current = false;\n }\n } else {\n manager.setFocusedKey(keyToFocus);\n // Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key\n // If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key\n // after the collection updates after load\n shouldVirtualFocusFirst.current = false;\n }\n }\n }, [manager.collection]);\n\n // reset focus first flag\n useUpdateLayoutEffect(() => {\n // If user causes the focused key to change in any other way, clear shouldVirtualFocusFirst so we don't\n // accidentally move focus from under them. Skip this if the collection was empty because we might be in a load\n // state and will still want to focus the first item after load\n if (manager.collection.size > 0) {\n shouldVirtualFocusFirst.current = false;\n }\n }, [manager.focusedKey]);\n\n useEvent(ref, CLEAR_FOCUS_EVENT, !shouldUseVirtualFocus ? undefined : (e: any) => {\n e.stopPropagation();\n manager.setFocused(false);\n if (e.detail?.clearFocusKey) {\n manager.setFocusedKey(null);\n }\n });\n\n const autoFocusRef = useRef(autoFocus);\n const didAutoFocusRef = useRef(false);\n useEffect(() => {\n if (autoFocusRef.current) {\n let focusedKey: Key | null = null;\n\n // Check focus strategy to determine which item to focus\n if (autoFocus === 'first') {\n focusedKey = delegate.getFirstKey?.() ?? null;\n } if (autoFocus === 'last') {\n focusedKey = delegate.getLastKey?.() ?? null;\n }\n\n // If there are any selected keys, make the first one the new focus target\n let selectedKeys = manager.selectedKeys;\n if (selectedKeys.size) {\n for (let key of selectedKeys) {\n if (manager.canSelectItem(key)) {\n focusedKey = key;\n break;\n }\n }\n }\n\n manager.setFocused(true);\n manager.setFocusedKey(focusedKey);\n\n // If no default focus key is selected, focus the collection itself.\n if (focusedKey == null && !shouldUseVirtualFocus && ref.current) {\n focusSafely(ref.current);\n }\n\n // Wait until the collection has items to autofocus.\n if (manager.collection.size > 0) {\n autoFocusRef.current = false;\n didAutoFocusRef.current = true;\n }\n }\n });\n\n // Scroll the focused element into view when the focusedKey changes.\n let lastFocusedKey = useRef(manager.focusedKey);\n let raf = useRef<number | null>(null);\n useEffect(() => {\n if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {\n let modality = getInteractionModality();\n let element = getItemElement(ref, manager.focusedKey);\n if (!(element instanceof HTMLElement)) {\n // If item element wasn't found, return early (don't update autoFocusRef and lastFocusedKey).\n // The collection may initially be empty (e.g. virtualizer), so wait until the element exists.\n return;\n }\n\n if (modality === 'keyboard' || didAutoFocusRef.current) {\n\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n\n raf.current = requestAnimationFrame(() => {\n if (scrollRef.current) {\n scrollIntoView(scrollRef.current, element);\n // Avoid scroll in iOS VO, since it may cause overlay to close (i.e. RAC submenu)\n if (modality !== 'virtual') {\n scrollIntoViewport(element, {containingElement: ref.current});\n }\n }\n });\n }\n }\n\n // If the focused key becomes null (e.g. the last item is deleted), focus the whole collection.\n if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) {\n focusSafely(ref.current);\n }\n\n lastFocusedKey.current = manager.focusedKey;\n didAutoFocusRef.current = false;\n });\n\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, []);\n\n // Intercept FocusScope restoration since virtualized collections can reuse DOM nodes.\n useEvent(ref, 'react-aria-focus-scope-restore', e => {\n e.preventDefault();\n manager.setFocused(true);\n });\n\n let handlers = {\n onKeyDown,\n onFocus,\n onBlur,\n onMouseDown(e) {\n // Ignore events that bubbled through portals.\n if (scrollRef.current === getEventTarget(e)) {\n // Prevent focus going to the collection when clicking on the scrollbar.\n e.preventDefault();\n }\n }\n };\n\n let {typeSelectProps} = useTypeSelect({\n keyboardDelegate: delegate,\n selectionManager: manager\n });\n\n if (!disallowTypeAhead) {\n handlers = mergeProps(typeSelectProps, handlers);\n }\n\n // If nothing is focused within the collection, make the collection itself tabbable.\n // This will be marshalled to either the first or last item depending on where focus came from.\n let tabIndex: number | undefined = undefined;\n if (!shouldUseVirtualFocus) {\n tabIndex = manager.focusedKey == null ? 0 : -1;\n }\n\n let collectionId = useCollectionId(manager.collection);\n return {\n collectionProps: mergeProps(handlers, {\n tabIndex,\n 'data-collection': collectionId\n })\n };\n}\n"],"names":[],"version":3,"file":"useSelectableCollection.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;AAuIM,SAAS,0CACd,OAAwC;IAExC,IAAI,EACF,kBAAkB,OAAO,EACzB,kBAAkB,QA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;QAGzB,eAAe,OAAO,GAAG,QAAQ,UAAU;QAC3C,gBAAgB,OAAO,GAAG;IAC5B;IAEA,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL,IAAI,IAAI,OAAO,EACb,qBAAqB,IAAI,OAAO;QAEpC;IACF,GAAG,EAAE;IAEL,sFAAsF;IACtF,CAAA,GAAA,kCAAO,EAAE,KAAK,kCAAkC,CAAA;QAC9C,EAAE,cAAc;QAChB,QAAQ,UAAU,CAAC;IACrB;IAEA,IAAI,WAAW;mBACb;iBACA;gBACA;QACA,aAAY,CAAC;YACX,8CAA8C;YAC9C,IAAI,UAAU,OAAO,KAAK,CAAA,GAAA,wCAAa,EAAE,IACvC,wEAAwE;YACxE,EAAE,cAAc;QAEpB;IACF;IAEA,IAAI,mBAAC,eAAe,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;QACpC,kBAAkB;QAClB,kBAAkB;IACpB;IAEA,IAAI,CAAC,mBACH,WAAW,CAAA,GAAA,oCAAS,EAAE,iBAAiB;IAGzC,oFAAoF;IACpF,+FAA+F;IAC/F,IAAI,WAA+B;IACnC,IAAI,CAAC,uBACH,WAAW,QAAQ,UAAU,IAAI,OAAO,IAAI;IAG9C,IAAI,eAAe,CAAA,GAAA,yCAAc,EAAE,QAAQ,UAAU;IACrD,OAAO;QACL,iBAAiB,CAAA,GAAA,oCAAS,EAAE,UAAU;sBACpC;YACA,mBAAmB;QACrB;IACF;AACF","sources":["packages/react-aria/src/selection/useSelectableCollection.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 {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from '../utils/constants';\n\nimport {dispatchVirtualFocus, moveVirtualFocus} from '../focus/virtualFocus';\nimport {\n DOMAttributes,\n FocusableElement,\n FocusStrategy,\n Key,\n KeyboardDelegate,\n RefObject\n} from '@react-types/shared';\nimport {flushSync} from 'react-dom';\nimport {FocusEvent, KeyboardEvent, useEffect, useRef} from 'react';\nimport {focusSafely} from '../interactions/focusSafely';\nimport {focusWithoutScrolling} from '../utils/focusWithoutScrolling';\nimport {\n getActiveElement,\n getEventTarget,\n isFocusWithin,\n nodeContains\n} from '../utils/shadowdom/DOMFunctions';\nimport {getFocusableTreeWalker} from '../focus/FocusScope';\nimport {getInteractionModality} from '../interactions/useFocusVisible';\nimport {getItemElement, isNonContiguousSelectionModifier, useCollectionId} from './utils';\nimport {isCtrlKeyPressed} from '../utils/keyboard';\nimport {isTabbable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {MultipleSelectionManager} from 'react-stately/useMultipleSelectionState';\nimport {scrollIntoView, scrollIntoViewport} from '../utils/scrollIntoView';\nimport {useEvent} from '../utils/useEvent';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useRouter} from '../utils/openLink';\nimport {useTypeSelect} from './useTypeSelect';\nimport {useUpdateLayoutEffect} from '../utils/useUpdateLayoutEffect';\n\nexport interface AriaSelectableCollectionOptions {\n /**\n * An interface for reading and updating multiple selection state.\n */\n selectionManager: MultipleSelectionManager;\n /**\n * A delegate object that implements behavior for keyboard focus movement.\n */\n keyboardDelegate: KeyboardDelegate;\n /**\n * The ref attached to the element representing the collection.\n */\n ref: RefObject<HTMLElement | null>;\n /**\n * Whether the collection or one of its items should be automatically focused upon render.\n *\n * @default false\n */\n autoFocus?: boolean | FocusStrategy;\n /**\n * Whether focus should wrap around when the end/start is reached.\n *\n * @default false\n */\n shouldFocusWrap?: boolean;\n /**\n * Whether the collection allows empty selection.\n *\n * @default false\n */\n disallowEmptySelection?: boolean;\n /**\n * Whether the collection allows the user to select all items via keyboard shortcut.\n *\n * @default false\n */\n disallowSelectAll?: boolean;\n /**\n * Whether pressing the Escape should clear selection in the collection or not.\n *\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none';\n /**\n * Whether selection should occur automatically on focus.\n *\n * @default false\n */\n selectOnFocus?: boolean;\n /**\n * Whether typeahead is disabled.\n *\n * @default false\n */\n disallowTypeAhead?: boolean;\n /**\n * Whether the collection items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean;\n /**\n * Whether navigation through tab key is enabled.\n */\n allowsTabNavigation?: boolean;\n /**\n * Whether the collection items are contained in a virtual scroller.\n */\n isVirtualized?: boolean;\n /**\n * The ref attached to the scrollable body. Used to provide automatic scrolling on item focus for\n * non-virtualized collections. If not provided, defaults to the collection ref.\n */\n scrollRef?: RefObject<HTMLElement | null>;\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n *\n * @default 'action'\n */\n linkBehavior?: 'action' | 'selection' | 'override';\n /**\n * Which item in the collection to focus when tabbing into the collection. Overrides default\n * roving tab index like behavior.\n *\n * @private\n */\n UNSTABLE_focusOnEntry?: 'first' | 'last';\n}\n\nexport interface SelectableCollectionAria {\n /** Props for the collection element. */\n collectionProps: DOMAttributes;\n}\n\n/**\n * Handles interactions with selectable collections.\n */\nexport function useSelectableCollection(\n options: AriaSelectableCollectionOptions\n): SelectableCollectionAria {\n let {\n selectionManager: manager,\n keyboardDelegate: delegate,\n ref,\n autoFocus = false,\n shouldFocusWrap = false,\n disallowEmptySelection = false,\n disallowSelectAll = false,\n escapeKeyBehavior = 'clearSelection',\n selectOnFocus = manager.selectionBehavior === 'replace',\n disallowTypeAhead = false,\n shouldUseVirtualFocus,\n allowsTabNavigation = false,\n // If no scrollRef is provided, assume the collection ref is the scrollable region\n scrollRef = ref,\n linkBehavior = 'action',\n UNSTABLE_focusOnEntry\n } = options;\n let {direction} = useLocale();\n let router = useRouter();\n\n let onKeyDown = (e: KeyboardEvent) => {\n // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes\n if (e.altKey && e.key === 'Tab') {\n e.preventDefault();\n }\n\n // Keyboard events bubble through portals. Don't handle keyboard events\n // for elements outside the collection (e.g. menus).\n if (!ref.current || !nodeContains(ref.current, getEventTarget(e) as Element)) {\n return;\n }\n\n const navigateToKey = (key: Key | undefined, childFocus?: FocusStrategy) => {\n if (key != null) {\n if (\n manager.isLink(key) &&\n linkBehavior === 'selection' &&\n selectOnFocus &&\n !isNonContiguousSelectionModifier(e)\n ) {\n // Set focused key and re-render synchronously to bring item into view if needed.\n flushSync(() => {\n manager.setFocusedKey(key, childFocus);\n });\n\n let item = getItemElement(ref, key);\n let itemProps = manager.getItemProps(key);\n if (item) {\n router.open(item, e, itemProps.href, itemProps.routerOptions);\n }\n\n return;\n }\n\n manager.setFocusedKey(key, childFocus);\n\n if (manager.isLink(key) && linkBehavior === 'override') {\n return;\n }\n\n if (e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(key);\n } else if (selectOnFocus && !isNonContiguousSelectionModifier(e)) {\n manager.replaceSelection(key);\n }\n }\n };\n\n switch (e.key) {\n case 'ArrowDown': {\n if (delegate.getKeyBelow) {\n let nextKey =\n manager.focusedKey != null\n ? delegate.getKeyBelow?.(manager.focusedKey)\n : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getFirstKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n }\n case 'ArrowUp': {\n if (delegate.getKeyAbove) {\n let nextKey =\n manager.focusedKey != null\n ? delegate.getKeyAbove?.(manager.focusedKey)\n : delegate.getLastKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey = delegate.getLastKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n }\n case 'ArrowLeft': {\n if (delegate.getKeyLeftOf) {\n let nextKey: Key | undefined | null =\n manager.focusedKey != null\n ? delegate.getKeyLeftOf?.(manager.focusedKey)\n : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey =\n direction === 'rtl'\n ? delegate.getFirstKey?.(manager.focusedKey)\n : delegate.getLastKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');\n }\n }\n break;\n }\n case 'ArrowRight': {\n if (delegate.getKeyRightOf) {\n let nextKey: Key | undefined | null =\n manager.focusedKey != null\n ? delegate.getKeyRightOf?.(manager.focusedKey)\n : delegate.getFirstKey?.();\n if (nextKey == null && shouldFocusWrap) {\n nextKey =\n direction === 'rtl'\n ? delegate.getLastKey?.(manager.focusedKey)\n : delegate.getFirstKey?.(manager.focusedKey);\n }\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');\n }\n }\n break;\n }\n case 'Home':\n if (delegate.getFirstKey) {\n if (manager.focusedKey === null && e.shiftKey) {\n return;\n }\n\n e.preventDefault();\n let firstKey: Key | null = delegate.getFirstKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(firstKey);\n if (firstKey != null) {\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(firstKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(firstKey);\n }\n }\n }\n break;\n case 'End':\n if (delegate.getLastKey) {\n if (manager.focusedKey === null && e.shiftKey) {\n return;\n }\n e.preventDefault();\n let lastKey = delegate.getLastKey(manager.focusedKey, isCtrlKeyPressed(e));\n manager.setFocusedKey(lastKey);\n if (lastKey != null) {\n if (isCtrlKeyPressed(e) && e.shiftKey && manager.selectionMode === 'multiple') {\n manager.extendSelection(lastKey);\n } else if (selectOnFocus) {\n manager.replaceSelection(lastKey);\n }\n }\n }\n break;\n case 'PageDown':\n if (delegate.getKeyPageBelow && manager.focusedKey != null) {\n let nextKey = delegate.getKeyPageBelow(manager.focusedKey);\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n case 'PageUp':\n if (delegate.getKeyPageAbove && manager.focusedKey != null) {\n let nextKey = delegate.getKeyPageAbove(manager.focusedKey);\n if (nextKey != null) {\n e.preventDefault();\n navigateToKey(nextKey);\n }\n }\n break;\n case 'a':\n if (\n isCtrlKeyPressed(e) &&\n manager.selectionMode === 'multiple' &&\n disallowSelectAll !== true\n ) {\n e.preventDefault();\n manager.selectAll();\n }\n break;\n case 'Escape':\n if (\n escapeKeyBehavior === 'clearSelection' &&\n !disallowEmptySelection &&\n manager.selectedKeys.size !== 0\n ) {\n e.stopPropagation();\n e.preventDefault();\n manager.clearSelection();\n }\n break;\n case 'Tab': {\n if (!allowsTabNavigation) {\n // There may be elements that are \"tabbable\" inside a collection (e.g. in a grid cell).\n // However, collections should be treated as a single tab stop, with arrow key navigation internally.\n // We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.\n // Instead, we handle the Tab key, and move focus manually to the first/last tabbable element\n // in the collection, so that the browser default behavior will apply starting from that element\n // rather than the currently focused one.\n if (e.shiftKey) {\n ref.current.focus();\n } else {\n let walker = getFocusableTreeWalker(ref.current, {tabbable: true});\n let next: FocusableElement | undefined = undefined;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n // oxlint-disable-next-line max-depth\n if (last) {\n next = last;\n }\n } while (last);\n\n // If the active element is NOT tabbable but is contained by an element that IS tabbable (aka the cell), the browser will actually move focus to\n // the containing element. We need to special case this so that tab will move focus out of the grid instead of looping between\n // focusing the containing cell and back to the non-tabbable child element\n let activeElement = getActiveElement();\n if (next && (!isFocusWithin(next) || (activeElement && !isTabbable(activeElement)))) {\n focusWithoutScrolling(next);\n }\n }\n break;\n }\n }\n }\n };\n\n // Store the scroll position so we can restore it later.\n /// TODO: should this happen all the time??\n let scrollPos = useRef({top: 0, left: 0});\n useEvent(scrollRef, 'scroll', () => {\n scrollPos.current = {\n top: scrollRef.current?.scrollTop ?? 0,\n left: scrollRef.current?.scrollLeft ?? 0\n };\n });\n\n let onFocus = (e: FocusEvent) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n manager.setFocused(false);\n }\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n return;\n }\n\n let modality = getInteractionModality();\n manager.setFocused(true);\n let navigateToKey = (key: Key | undefined | null) => {\n if (key != null) {\n manager.setFocusedKey(key);\n if (selectOnFocus && !manager.isSelected(key)) {\n manager.replaceSelection(key);\n }\n }\n };\n\n // we need the \"virtual\" modality case checks here because shift tabbing from the prompt field's attachment card back into the\n // thread is a virtual focus event (the tab handler in onKeyDown focuses the ref of the AttachementList aka TagGroup via a focus() call, hence the virtual modality)\n if (UNSTABLE_focusOnEntry && (modality === 'keyboard' || modality === 'virtual')) {\n // always go to the first item in the Thread when tabbing forwards/backwards into the collection\n // since it is probably more important to the user to see the new prompt reply rather than go to the last focused key\n navigateToKey(\n UNSTABLE_focusOnEntry === 'first' ? delegate.getFirstKey?.() : delegate.getLastKey?.()\n );\n } else if (manager.focusedKey == null) {\n // If the user hasn't yet interacted with the collection, there will be no focusedKey set.\n // Attempt to detect whether the user is tabbing forward or backward into the collection\n // and either focus the first or last item accordingly.\n let relatedTarget = e.relatedTarget as Element;\n if (\n relatedTarget &&\n e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING\n ) {\n navigateToKey(manager.lastSelectedKey ?? delegate.getLastKey?.());\n } else {\n navigateToKey(manager.firstSelectedKey ?? delegate.getFirstKey?.());\n }\n } else if (scrollRef.current) {\n // Restore the scroll position to what it was before.\n scrollRef.current.scrollTop = scrollPos.current.top;\n scrollRef.current.scrollLeft = scrollPos.current.left;\n }\n\n if (manager.focusedKey != null && scrollRef.current) {\n // Refocus and scroll the focused item into view if it exists within the scrollable region.\n let element = getItemElement(ref, manager.focusedKey);\n if (element instanceof HTMLElement) {\n // This prevents a flash of focus on the first/last element in the collection, or the collection itself.\n if (!isFocusWithin(element) && !shouldUseVirtualFocus) {\n focusWithoutScrolling(element);\n }\n\n if (modality === 'keyboard' || (UNSTABLE_focusOnEntry && modality === 'virtual')) {\n scrollIntoViewport(element, {containingElement: ref.current});\n }\n }\n }\n };\n\n let onBlur = e => {\n // Don't set blurred and then focused again if moving focus within the collection.\n if (!nodeContains(e.currentTarget, e.relatedTarget as HTMLElement)) {\n manager.setFocused(false);\n }\n };\n\n // Ref to track whether the first item in the collection should be automatically focused. Specifically used for autocomplete when user types\n // to focus the first key AFTER the collection updates.\n // TODO: potentially expand the usage of this\n let shouldVirtualFocusFirst = useRef(false);\n // Add event listeners for custom virtual events. These handle updating the focused key in response to various keyboard events\n // at the autocomplete level\n // TODO: fix type later\n useEvent(\n ref,\n FOCUS_EVENT,\n !shouldUseVirtualFocus\n ? undefined\n : (e: any) => {\n let {detail} = e;\n e.stopPropagation();\n manager.setFocused(true);\n // If the user is typing forwards, autofocus the first option in the list.\n if (detail?.focusStrategy === 'first') {\n shouldVirtualFocusFirst.current = true;\n }\n }\n );\n\n // update active descendant\n let firstKey = delegate.getFirstKey?.() ?? null;\n useUpdateLayoutEffect(() => {\n if (shouldVirtualFocusFirst.current) {\n // If no focusable items exist in the list, make sure to clear any activedescendant that may still exist and move focus back to\n // the original active element (e.g. the autocomplete input)\n if (firstKey == null) {\n let previousActiveElement = getActiveElement();\n moveVirtualFocus(ref.current);\n dispatchVirtualFocus(previousActiveElement!, null);\n\n // If there wasn't a focusable key but the collection had items, then that means we aren't in an intermediate load state and all keys are disabled.\n // Reset shouldVirtualFocusFirst so that we don't erronously autofocus an item when the collection is filtered again.\n if (manager.collection.size > 0) {\n shouldVirtualFocusFirst.current = false;\n }\n } else {\n manager.setFocusedKey(firstKey);\n // Only set shouldVirtualFocusFirst to false if we've successfully set the first key as the focused key\n // If there wasn't a key to focus, we might be in a temporary loading state so we'll want to still focus the first key\n // after the collection updates after load\n shouldVirtualFocusFirst.current = false;\n }\n }\n }, [firstKey, manager.collection.size]);\n\n // reset focus first flag\n useUpdateLayoutEffect(() => {\n // If user causes the focused key to change in any other way, clear shouldVirtualFocusFirst so we don't\n // accidentally move focus from under them. Skip this if the collection was empty because we might be in a load\n // state and will still want to focus the first item after load\n if (manager.collection.size > 0) {\n shouldVirtualFocusFirst.current = false;\n }\n }, [manager.focusedKey]);\n\n useEvent(\n ref,\n CLEAR_FOCUS_EVENT,\n !shouldUseVirtualFocus\n ? undefined\n : (e: any) => {\n e.stopPropagation();\n manager.setFocused(false);\n if (e.detail?.clearFocusKey) {\n manager.setFocusedKey(null);\n }\n }\n );\n\n const autoFocusRef = useRef(autoFocus);\n const didAutoFocusRef = useRef(false);\n useEffect(() => {\n if (autoFocusRef.current) {\n let focusedKey: Key | null = null;\n\n // Check focus strategy to determine which item to focus\n if (autoFocus === 'first') {\n focusedKey = delegate.getFirstKey?.() ?? null;\n }\n if (autoFocus === 'last') {\n focusedKey = delegate.getLastKey?.() ?? null;\n }\n\n // If there are any selected keys, make the first one the new focus target\n let selectedKeys = manager.selectedKeys;\n if (selectedKeys.size) {\n for (let key of selectedKeys) {\n if (manager.canSelectItem(key)) {\n focusedKey = key;\n break;\n }\n }\n }\n\n manager.setFocused(true);\n manager.setFocusedKey(focusedKey);\n\n // If no default focus key is selected, focus the collection itself.\n if (focusedKey == null && !shouldUseVirtualFocus && ref.current) {\n focusSafely(ref.current);\n }\n\n // Wait until the collection has items to autofocus.\n if (manager.collection.size > 0) {\n autoFocusRef.current = false;\n didAutoFocusRef.current = true;\n }\n }\n });\n\n // Scroll the focused element into view when the focusedKey changes.\n let lastFocusedKey = useRef(manager.focusedKey);\n let raf = useRef<number | null>(null);\n useEffect(() => {\n if (\n manager.isFocused &&\n manager.focusedKey != null &&\n (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) &&\n scrollRef.current &&\n ref.current\n ) {\n let modality = getInteractionModality();\n let element = getItemElement(ref, manager.focusedKey);\n if (!(element instanceof HTMLElement)) {\n // If item element wasn't found, return early (don't update autoFocusRef and lastFocusedKey).\n // The collection may initially be empty (e.g. virtualizer), so wait until the element exists.\n return;\n }\n\n if (modality === 'keyboard' || didAutoFocusRef.current) {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n\n raf.current = requestAnimationFrame(() => {\n if (scrollRef.current) {\n scrollIntoView(scrollRef.current, element);\n // Avoid scroll in iOS VO, since it may cause overlay to close (i.e. RAC submenu)\n if (modality !== 'virtual') {\n scrollIntoViewport(element, {containingElement: ref.current});\n }\n }\n });\n }\n }\n\n // If the focused key becomes null (e.g. the last item is deleted), focus the whole collection.\n if (\n !shouldUseVirtualFocus &&\n manager.isFocused &&\n manager.focusedKey == null &&\n lastFocusedKey.current != null &&\n ref.current\n ) {\n focusSafely(ref.current);\n }\n\n lastFocusedKey.current = manager.focusedKey;\n didAutoFocusRef.current = false;\n });\n\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, []);\n\n // Intercept FocusScope restoration since virtualized collections can reuse DOM nodes.\n useEvent(ref, 'react-aria-focus-scope-restore', e => {\n e.preventDefault();\n manager.setFocused(true);\n });\n\n let handlers = {\n onKeyDown,\n onFocus,\n onBlur,\n onMouseDown(e) {\n // Ignore events that bubbled through portals.\n if (scrollRef.current === getEventTarget(e)) {\n // Prevent focus going to the collection when clicking on the scrollbar.\n e.preventDefault();\n }\n }\n };\n\n let {typeSelectProps} = useTypeSelect({\n keyboardDelegate: delegate,\n selectionManager: manager\n });\n\n if (!disallowTypeAhead) {\n handlers = mergeProps(typeSelectProps, handlers);\n }\n\n // If nothing is focused within the collection, make the collection itself tabbable.\n // This will be marshalled to either the first or last item depending on where focus came from.\n let tabIndex: number | undefined = undefined;\n if (!shouldUseVirtualFocus) {\n tabIndex = manager.focusedKey == null ? 0 : -1;\n }\n\n let collectionId = useCollectionId(manager.collection);\n return {\n collectionProps: mergeProps(handlers, {\n tabIndex,\n 'data-collection': collectionId\n })\n };\n}\n"],"names":[],"version":3,"file":"useSelectableCollection.cjs.map"}
|