react-aria-components 1.12.2 → 1.14.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/Autocomplete.main.js +3 -3
- package/dist/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.mjs +3 -3
- package/dist/Autocomplete.module.js +3 -3
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Breadcrumbs.main.js +5 -3
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +5 -3
- package/dist/Breadcrumbs.module.js +5 -3
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +5 -11
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +5 -11
- package/dist/Button.module.js +5 -11
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +2 -2
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +2 -2
- package/dist/Calendar.module.js +2 -2
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.mjs +1 -1
- package/dist/Collection.module.js +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +1 -1
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +1 -1
- package/dist/ColorArea.module.js +1 -1
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +1 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +1 -1
- package/dist/ColorField.module.js +1 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorPicker.main.js +1 -1
- package/dist/ColorPicker.main.js.map +1 -1
- package/dist/ColorPicker.mjs +1 -1
- package/dist/ColorPicker.module.js +1 -1
- package/dist/ColorPicker.module.js.map +1 -1
- package/dist/ColorSlider.main.js +1 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +1 -1
- package/dist/ColorSlider.module.js +1 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +1 -1
- package/dist/ColorSwatchPicker.module.js +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +1 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +1 -1
- package/dist/ColorWheel.module.js +1 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +15 -9
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +15 -9
- package/dist/DateField.module.js +15 -9
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +6 -2
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +6 -2
- package/dist/DatePicker.module.js +6 -2
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +2 -1
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +2 -1
- package/dist/Disclosure.module.js +2 -1
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +1 -0
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +1 -0
- package/dist/FileTrigger.module.js +1 -0
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +25 -22
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +26 -24
- package/dist/GridList.module.js +26 -24
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +5 -4
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +5 -4
- package/dist/Group.module.js +5 -4
- package/dist/Group.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +5 -3
- package/dist/HiddenDateInput.main.js.map +1 -1
- package/dist/HiddenDateInput.mjs +5 -3
- package/dist/HiddenDateInput.module.js +5 -3
- package/dist/HiddenDateInput.module.js.map +1 -1
- package/dist/Input.main.js +4 -1
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +4 -1
- package/dist/Input.module.js +4 -1
- package/dist/Input.module.js.map +1 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +20 -7
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +21 -8
- package/dist/ListBox.module.js +21 -8
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +17 -7
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +17 -7
- package/dist/Menu.module.js +17 -7
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +9 -1
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +10 -2
- package/dist/Modal.module.js +10 -2
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +2 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +2 -1
- package/dist/NumberField.module.js +2 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RSPContexts.main.js +4 -0
- package/dist/RSPContexts.main.js.map +1 -1
- package/dist/RSPContexts.mjs +3 -1
- package/dist/RSPContexts.module.js +3 -1
- package/dist/RSPContexts.module.js.map +1 -1
- package/dist/RadioGroup.main.js +10 -2
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +10 -2
- package/dist/RadioGroup.module.js +10 -2
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +7 -3
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +7 -3
- package/dist/SearchField.module.js +7 -3
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +62 -22
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +65 -25
- package/dist/Select.module.js +65 -25
- package/dist/Select.module.js.map +1 -1
- package/dist/SelectionIndicator.main.js +45 -0
- package/dist/SelectionIndicator.main.js.map +1 -0
- package/dist/SelectionIndicator.mjs +35 -0
- package/dist/SelectionIndicator.module.js +35 -0
- package/dist/SelectionIndicator.module.js.map +1 -0
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.module.js.map +1 -1
- package/dist/SharedElementTransition.main.js +139 -0
- package/dist/SharedElementTransition.main.js.map +1 -0
- package/dist/SharedElementTransition.mjs +129 -0
- package/dist/SharedElementTransition.module.js +129 -0
- package/dist/SharedElementTransition.module.js.map +1 -0
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +142 -53
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +143 -54
- package/dist/Table.module.js +143 -54
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +86 -9
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +88 -12
- package/dist/Tabs.module.js +88 -12
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +29 -17
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +29 -17
- package/dist/TagGroup.module.js +29 -17
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +2 -2
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +2 -2
- package/dist/TextField.module.js +2 -2
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +7 -1
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +7 -1
- package/dist/ToggleButton.module.js +7 -1
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +4 -1
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +4 -1
- package/dist/ToggleButtonGroup.module.js +4 -1
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +16 -4
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +16 -4
- package/dist/Tree.module.js +16 -4
- package/dist/Tree.module.js.map +1 -1
- package/dist/import.mjs +13 -7
- package/dist/main.js +23 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +13 -7
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +663 -58
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +0 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +0 -1
- package/dist/utils.module.js +0 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/index.js +67 -67
- package/i18n/index.mjs +67 -67
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +25 -25
- package/src/Autocomplete.tsx +2 -2
- package/src/Breadcrumbs.tsx +25 -6
- package/src/Button.tsx +15 -11
- package/src/Calendar.tsx +51 -6
- package/src/Checkbox.tsx +25 -2
- package/src/Collection.tsx +1 -1
- package/src/ColorArea.tsx +15 -2
- package/src/ColorField.tsx +16 -1
- package/src/ColorPicker.tsx +5 -2
- package/src/ColorSlider.tsx +16 -2
- package/src/ColorSwatch.tsx +15 -2
- package/src/ColorSwatchPicker.tsx +18 -1
- package/src/ColorThumb.tsx +8 -2
- package/src/ColorWheel.tsx +24 -3
- package/src/ComboBox.tsx +18 -1
- package/src/DateField.tsx +60 -16
- package/src/DatePicker.tsx +38 -5
- package/src/Dialog.tsx +5 -0
- package/src/Disclosure.tsx +30 -5
- package/src/DragAndDrop.tsx +8 -2
- package/src/DropZone.tsx +16 -2
- package/src/FieldError.tsx +8 -2
- package/src/FileTrigger.tsx +1 -0
- package/src/Form.tsx +5 -0
- package/src/GridList.tsx +66 -35
- package/src/Group.tsx +32 -18
- package/src/HiddenDateInput.tsx +6 -4
- package/src/Input.tsx +23 -3
- package/src/Link.tsx +15 -2
- package/src/ListBox.tsx +58 -14
- package/src/Menu.tsx +41 -8
- package/src/Meter.tsx +16 -2
- package/src/Modal.tsx +30 -3
- package/src/NumberField.tsx +21 -3
- package/src/OverlayArrow.tsx +14 -2
- package/src/Popover.tsx +13 -1
- package/src/ProgressBar.tsx +17 -3
- package/src/RSPContexts.ts +19 -0
- package/src/RadioGroup.tsx +33 -4
- package/src/SearchField.tsx +36 -4
- package/src/Select.tsx +100 -36
- package/src/SelectionIndicator.tsx +46 -0
- package/src/Separator.tsx +10 -1
- package/src/SharedElementTransition.tsx +185 -0
- package/src/Slider.tsx +35 -3
- package/src/Switch.tsx +18 -5
- package/src/Table.tsx +204 -83
- package/src/Tabs.tsx +158 -15
- package/src/TagGroup.tsx +60 -26
- package/src/TextArea.tsx +14 -2
- package/src/TextField.tsx +20 -2
- package/src/Toast.tsx +22 -2
- package/src/ToggleButton.tsx +19 -2
- package/src/ToggleButtonGroup.tsx +26 -4
- package/src/Toolbar.tsx +13 -1
- package/src/Tooltip.tsx +13 -1
- package/src/Tree.tsx +76 -40
- package/src/index.ts +17 -10
- package/src/utils.tsx +2 -3
- package/dist/context.main.js +0 -25
- package/dist/context.main.js.map +0 -1
- package/dist/context.mjs +0 -19
- package/dist/context.module.js +0 -19
- package/dist/context.module.js.map +0 -1
- package/src/context.tsx +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAwEM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AACtF,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAyB;AAK9D,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAA0B,KAAsB,EAAE,GAAiC;IAC9J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE;IAEvB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AAW;QACf,uEAAuE;QACvE,iEAAiE;QACjE,MAAK;QACL,KAAK;OACJ,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/ListBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent, ItemNode, LoaderNode, SectionNode} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, ListState, Node, Orientation, SelectionBehavior, UNSTABLE_useFilteredListState, useListState} from 'react-stately';\nimport {filterDOMProps, inertValue, LoadMoreSentinelProps, useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './context';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the listbox is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the listbox is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the listbox is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the listbox.\n */\n state: ListState<unknown>\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' | 'label'>, CollectionProps<T>, StyleRenderProps<ListBoxRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * How multiple selection should behave in the collection.\n * @default \"toggle\"\n */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T extends object>(props: ListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>,\n props: ListBoxProps<T> & AriaListBoxOptions<T> & {filter?: SelectableCollectionContextValue<T>['filter']},\n listBoxRef: RefObject<HTMLElement | null>\n}\n\nfunction ListBoxInner<T extends object>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) {\n [props, listBoxRef] = useContextProps(props, listBoxRef, SelectableCollectionContext);\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical', filter} = props;\n let state = UNSTABLE_useFilteredListState(inputState, filter);\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot} = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(() => (\n props.keyboardDelegate || new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n })\n ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout, layoutDelegate]);\n\n let {listBoxProps} = useListBox({\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n }, state, listBoxRef);\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {orientation, layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, listBoxRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (isEmpty && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection?.collectionProps)}\n ref={listBoxRef as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={props.orientation || 'vertical'}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {}\n\nfunction ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection') {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: props.className,\n style: props.style,\n values: {}\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <section\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </HeaderContext.Provider>\n </section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent(SectionNode, ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function ListBoxItem<T extends object>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key}, dragState);\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, ref);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, optionProps, hoverProps, draggableItem?.dragProps, droppableItem?.dropProps)}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} ref={ref} />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n ...otherProps\n } = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...dropIndicatorProps}\n {...renderProps}\n // eslint-disable-next-line\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined} />\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n\nexport interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode,\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean\n}\n\nexport const ListBoxLoadMoreItem = createLeafComponent(LoaderNode, function ListBoxLoadingIndicator(props: ListBoxLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {\n let state = useContext(ListStateContext)!;\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(() => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }), [onLoadMore, scrollOffset, state?.collection]);\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-ListBoxLoadingIndicator',\n values: null\n });\n\n let optionProps = {\n // For Android talkback\n tabIndex: -1\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n };\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >\n <div data-testid=\"loadMoreSentinel\" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />\n </div>\n {isLoading && renderProps.children && (\n <div\n {...mergeProps(filterDOMProps(props, {global: true}), optionProps)}\n {...renderProps}\n // aria-selected isn't needed here since this option is not selectable.\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n role=\"option\"\n ref={ref as ForwardedRef<HTMLDivElement>}>\n {renderProps.children}\n </div>\n )}\n </>\n );\n});\n"],"names":[],"version":3,"file":"ListBox.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AA2FM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AACtF,MAAM,0DAA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,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,IAAI;QACJ,UAAU,KAAK,QAAQ;QACvB,kBAAkB;QAClB,QAAQ;IACV;IAEA,IAAI,cAAc;QAChB,uBAAuB;QACvB,UAAU;IAIZ;IAEA,qBACE,gFAGE,gCAAC;QAAI,OAAO;YAAC,UAAU;YAAY,OAAO;YAAG,QAAQ;QAAC;QAAG,OAAO,CAAA,GAAA,iBAAS,EAAE;qBACzE,gCAAC;QAAI,eAAY;QAAmB,KAAK;QAAa,OAAO;YAAC,UAAU;YAAY,QAAQ;YAAG,OAAO;QAAC;SAExG,aAAa,YAAY,QAAQ,kBAChC,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,OAAO;YAAC,QAAQ;QAAI,IAAI,YAAY;QACjE,GAAG,WAAW;QACf,uEAAuE;QACvE,iEAAiE;QACjE,MAAK;QACL,KAAK;OACJ,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/ListBox.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocus, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n Provider,\n RenderProps,\n SlotProps,\n StyleProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent, ItemNode, LoaderNode, SectionNode} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps} from './Collection';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, ListState, Node, Orientation, SelectionBehavior, UNSTABLE_useFilteredListState, useListState} from 'react-stately';\nimport {filterDOMProps, inertValue, LoadMoreSentinelProps, useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';\nimport {FocusEvents, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {SelectableCollectionContext, SelectableCollectionContextValue} from './RSPContexts';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\n\nexport interface ListBoxRenderProps {\n /**\n * Whether the listbox has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the listbox is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the listbox is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the listbox is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the listbox.\n */\n state: ListState<unknown>\n}\n\nexport interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' | 'label'>, CollectionProps<T>, StyleRenderProps<ListBoxRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-ListBox'\n */\n className?: ClassNameOrFunction<ListBoxRenderProps>,\n /**\n * How multiple selection should behave in the collection.\n * @default \"toggle\"\n */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */\n dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: ListBoxRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\nexport const ListBoxContext = createContext<ContextValue<ListBoxProps<any>, HTMLDivElement>>(null);\nexport const ListStateContext = createContext<ListState<any> | null>(null);\n\n/**\n * A listbox displays a list of options and allows a user to select one or more of them.\n */\nexport const ListBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function ListBox<T extends object>(props: ListBoxProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ListBoxContext);\n let state = useContext(ListStateContext);\n\n // The structure of ListBox is a bit strange because it needs to work inside other components like ComboBox and Select.\n // Those components render two copies of their children so that the collection can be built even when the popover is closed.\n // The first copy sends a collection document via context which we render the collection portal into.\n // The second copy sends a ListState object via context which we use to render the ListBox without rebuilding the state.\n // Otherwise, we have a standalone ListBox, so we need to create a collection and state ourselves.\n if (state) {\n return <ListBoxInner state={state} props={props} listBoxRef={ref} />;\n }\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <StandaloneListBox props={props} listBoxRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\nfunction StandaloneListBox({props, listBoxRef, collection}) {\n props = {...props, collection, children: null, items: null};\n let {layoutDelegate} = useContext(CollectionRendererContext);\n let state = useListState({...props, layoutDelegate});\n return <ListBoxInner state={state} props={props} listBoxRef={listBoxRef} />;\n}\n\ninterface ListBoxInnerProps<T> {\n state: ListState<T>,\n props: ListBoxProps<T> & AriaListBoxOptions<T> & {filter?: SelectableCollectionContextValue<T>['filter']},\n listBoxRef: RefObject<HTMLElement | null>\n}\n\nfunction ListBoxInner<T extends object>({state: inputState, props, listBoxRef}: ListBoxInnerProps<T>) {\n [props, listBoxRef] = useContextProps(props, listBoxRef, SelectableCollectionContext);\n let {dragAndDropHooks, layout = 'stack', orientation = 'vertical', filter} = props;\n let state = UNSTABLE_useFilteredListState(inputState, filter);\n let {collection, selectionManager} = state;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let {direction} = useLocale();\n let {disabledBehavior, disabledKeys} = selectionManager;\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate, CollectionRoot} = useContext(CollectionRendererContext);\n let keyboardDelegate = useMemo(() => (\n props.keyboardDelegate || new ListKeyboardDelegate({\n collection,\n collator,\n ref: listBoxRef,\n disabledKeys,\n disabledBehavior,\n layout,\n orientation,\n direction,\n layoutDelegate\n })\n ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout, layoutDelegate]);\n\n let {listBoxProps} = useListBox({\n ...props,\n shouldSelectOnPressUp: isListDraggable || props.shouldSelectOnPressUp,\n keyboardDelegate,\n isVirtualized\n }, state, listBoxRef);\n\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, listBoxRef);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, listBoxRef, {orientation, layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, listBoxRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let isEmpty = state.collection.size === 0;\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty,\n isFocused,\n isFocusVisible,\n layout: props.layout || 'stack',\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-ListBox',\n values: renderValues\n });\n\n let emptyState: JSX.Element | null = null;\n if (isEmpty && props.renderEmptyState) {\n emptyState = (\n <div\n // eslint-disable-next-line\n role=\"option\"\n style={{display: 'contents'}}>\n {props.renderEmptyState(renderValues)}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection?.collectionProps)}\n ref={listBoxRef as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={isEmpty || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={props.layout || 'stack'}\n data-orientation={props.orientation || 'vertical'}>\n <Provider\n values={[\n [ListBoxContext, props],\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [SeparatorContext, {elementType: 'div'}],\n [DropIndicatorContext, {render: ListBoxDropIndicatorWrapper}],\n [SectionContext, {name: 'ListBoxSection', render: ListBoxSectionInner}]\n ]}>\n <SharedElementTransition>\n <CollectionRoot\n collection={collection}\n scrollRef={listBoxRef}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface ListBoxSectionProps<T> extends SectionProps<T> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-ListBoxSection'\n */\n className?: string\n}\n\nfunction ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-ListBoxSection') {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useListBoxSection({\n heading,\n 'aria-label': props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: props.className,\n style: props.style,\n values: {}\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <section\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}>\n <HeaderContext.Provider value={{...headingProps, ref: headingRef}}>\n <CollectionBranch\n collection={state.collection}\n parent={section}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </HeaderContext.Provider>\n </section>\n );\n}\n\n/**\n * A ListBoxSection represents a section within a ListBox.\n */\nexport const ListBoxSection = /*#__PURE__*/ createBranchComponent(SectionNode, ListBoxSectionInner);\n\nexport interface ListBoxItemRenderProps extends ItemRenderProps {}\n\nexport interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, FocusEvents<HTMLDivElement>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-ListBoxItem'\n */\n className?: ClassNameOrFunction<ListBoxItemRenderProps>,\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A ListBoxItem represents an individual option in a ListBox.\n */\nexport const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function ListBoxItem<T extends object>(props: ListBoxItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let ref = useObjectRef<any>(forwardedRef);\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext)!;\n let {optionProps, labelProps, descriptionProps, ...states} = useOption(\n {key: item.key, 'aria-label': props?.['aria-label']},\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {focusProps} = useFocus(props);\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasAction: states.hasAction}, dragState);\n }\n\n let droppableItem: DroppableItemResult | null = null;\n if (dropState && dragAndDropHooks) {\n droppableItem = dragAndDropHooks.useDroppableItem!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, ref);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: props.children,\n defaultClassName: 'react-aria-ListBoxItem',\n values: {\n ...states,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: droppableItem?.isDropTarget\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n if (ElementType === 'a' && optionProps.tabIndex == null) {\n optionProps.tabIndex = -1;\n }\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, optionProps, hoverProps, focusProps, draggableItem?.dragProps, droppableItem?.dropProps)}\n ref={ref}\n data-allows-dragging={!!dragState || undefined}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={droppableItem?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n\nfunction ListBoxDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext)!;\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n ref\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <ListBoxDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} ref={ref} />\n );\n}\n\ninterface ListBoxDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean\n}\n\nfunction ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n ...otherProps\n } = props;\n\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...dropIndicatorProps}\n {...renderProps}\n // eslint-disable-next-line\n role=\"option\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined} />\n );\n}\n\nconst ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);\n\nexport interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-ListBoxLoadMoreItem'\n */\n className?: string,\n /**\n * The load more spinner to render when loading additional items.\n */\n children?: ReactNode,\n /**\n * Whether or not the loading spinner should be rendered or not.\n */\n isLoading?: boolean\n}\n\nexport const ListBoxLoadMoreItem = createLeafComponent(LoaderNode, function ListBoxLoadingIndicator(props: ListBoxLoadMoreItemProps, ref: ForwardedRef<HTMLDivElement>, item: Node<object>) {\n let state = useContext(ListStateContext)!;\n let {isLoading, onLoadMore, scrollOffset, ...otherProps} = props;\n\n let sentinelRef = useRef<HTMLDivElement>(null);\n let memoedLoadMoreProps = useMemo(() => ({\n onLoadMore,\n collection: state?.collection,\n sentinelRef,\n scrollOffset\n }), [onLoadMore, scrollOffset, state?.collection]);\n useLoadMoreSentinel(memoedLoadMoreProps, sentinelRef);\n let renderProps = useRenderProps({\n ...otherProps,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-ListBoxLoadingIndicator',\n values: null\n });\n\n let optionProps = {\n // For Android talkback\n tabIndex: -1\n // For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable\n // Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the\n // item count\n };\n\n return (\n <>\n {/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}\n {/* @ts-ignore - compatibility with React < 19 */}\n <div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >\n <div data-testid=\"loadMoreSentinel\" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />\n </div>\n {isLoading && renderProps.children && (\n <div\n {...mergeProps(filterDOMProps(props, {global: true}), optionProps)}\n {...renderProps}\n // aria-selected isn't needed here since this option is not selectable.\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props\n role=\"option\"\n ref={ref as ForwardedRef<HTMLDivElement>}>\n {renderProps.children}\n </div>\n )}\n </>\n );\n});\n"],"names":[],"version":3,"file":"ListBox.module.js.map"}
|
package/dist/Menu.main.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
var $3114c2382242bdc0$exports = require("./Collection.main.js");
|
|
2
1
|
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
3
|
-
var $
|
|
2
|
+
var $3114c2382242bdc0$exports = require("./Collection.main.js");
|
|
3
|
+
var $525402dfec7da5bc$exports = require("./RSPContexts.main.js");
|
|
4
4
|
var $c7efb75a1a3fe2d2$exports = require("./Header.main.js");
|
|
5
5
|
var $70c886ca98ebdc2b$exports = require("./Keyboard.main.js");
|
|
6
6
|
var $2979ab89b336194b$exports = require("./Dialog.main.js");
|
|
7
7
|
var $61e2b7078adb18bc$exports = require("./Popover.main.js");
|
|
8
|
+
var $54e872c96e6d295b$exports = require("./SelectionIndicator.main.js");
|
|
8
9
|
var $54b202ace195eaa4$exports = require("./Separator.main.js");
|
|
10
|
+
var $2d10bc562fea46b3$exports = require("./SharedElementTransition.main.js");
|
|
9
11
|
var $a8a589c28affdc40$exports = require("./Text.main.js");
|
|
10
12
|
var $2JTht$reactaria = require("react-aria");
|
|
11
13
|
var $2JTht$reactariacollections = require("@react-aria/collections");
|
|
@@ -58,6 +60,8 @@ $parcel$export(module.exports, "MenuItem", () => $a8f6e7d095d1cc86$export$2ce376
|
|
|
58
60
|
|
|
59
61
|
|
|
60
62
|
|
|
63
|
+
|
|
64
|
+
|
|
61
65
|
const $a8f6e7d095d1cc86$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
|
|
62
66
|
const $a8f6e7d095d1cc86$export$24aad8519b95b41b = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
|
|
63
67
|
const $a8f6e7d095d1cc86$export$795aec4671cbae19 = /*#__PURE__*/ (0, $2JTht$react.createContext)(null);
|
|
@@ -196,7 +200,7 @@ const $a8f6e7d095d1cc86$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $2JTht$react
|
|
|
196
200
|
}));
|
|
197
201
|
});
|
|
198
202
|
function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
|
|
199
|
-
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, (0, $
|
|
203
|
+
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, (0, $525402dfec7da5bc$exports.SelectableCollectionContext));
|
|
200
204
|
let { filter: filter, ...autocompleteMenuProps } = props;
|
|
201
205
|
let filteredCollection = (0, $2JTht$react.useMemo)(()=>filter ? collection.filter(filter) : collection, [
|
|
202
206
|
collection,
|
|
@@ -269,11 +273,11 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
|
|
|
269
273
|
null
|
|
270
274
|
],
|
|
271
275
|
[
|
|
272
|
-
(0, $
|
|
276
|
+
(0, $525402dfec7da5bc$exports.SelectableCollectionContext),
|
|
273
277
|
null
|
|
274
278
|
],
|
|
275
279
|
[
|
|
276
|
-
(0, $
|
|
280
|
+
(0, $525402dfec7da5bc$exports.FieldInputContext),
|
|
277
281
|
null
|
|
278
282
|
],
|
|
279
283
|
[
|
|
@@ -285,11 +289,11 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
|
|
|
285
289
|
triggerState !== null && triggerState !== void 0 ? triggerState : (0, $2JTht$reactstately.useMenuTriggerState)({})
|
|
286
290
|
]
|
|
287
291
|
]
|
|
288
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement(CollectionRoot, {
|
|
292
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement((0, $2d10bc562fea46b3$exports.SharedElementTransition), null, /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement(CollectionRoot, {
|
|
289
293
|
collection: state.collection,
|
|
290
294
|
persistedKeys: (0, $3114c2382242bdc0$exports.usePersistedKeys)(state.selectionManager.focusedKey),
|
|
291
295
|
scrollRef: ref
|
|
292
|
-
})), emptyState));
|
|
296
|
+
}))), emptyState));
|
|
293
297
|
}
|
|
294
298
|
// A subclass of SelectionManager that forwards focus-related properties to the parent,
|
|
295
299
|
// but has its own local selection state.
|
|
@@ -425,6 +429,12 @@ const $a8f6e7d095d1cc86$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $2JTht$react
|
|
|
425
429
|
[
|
|
426
430
|
(0, $70c886ca98ebdc2b$exports.KeyboardContext),
|
|
427
431
|
keyboardShortcutProps
|
|
432
|
+
],
|
|
433
|
+
[
|
|
434
|
+
(0, $54e872c96e6d295b$exports.SelectionIndicatorContext),
|
|
435
|
+
{
|
|
436
|
+
isSelected: states.isSelected
|
|
437
|
+
}
|
|
428
438
|
]
|
|
429
439
|
]
|
|
430
440
|
}, renderProps.children));
|
package/dist/Menu.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAiCM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AACtF,MAAM,8DAA0B,CAAA,GAAA,0BAAY,EAA2B;AAMhE,SAAS,0CAAY,KAAuB;IACjD,IAAI,QAAQ,CAAA,GAAA,uCAAkB,EAAE;IAChC,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAqB;IACpC,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;QACjD,GAAG,KAAK;QACR,MAAM;IACR,GAAG,OAAO;IACV,oCAAoC;IACpC,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAO,EAAiB;IAC5D,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE;QACzB,IAAI,IAAI,OAAO,EACb,eAAe,IAAI,OAAO,CAAC,WAAW,GAAG;IAE7C,GAAG;QAAC;KAAI;IAER,CAAA,GAAA,uCAAgB,EAAE;QAChB,KAAK;QACL,UAAU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AiB;YACrD,YAAY,CAAC,CAAC,KAAK,CAAC,gBAAgB;YACpC,QAAQ,KAAK,CAAC,gBAAgB,KAAK;QACrC;IACF;IAEA,IAAI,cAAiC,MAAM,IAAI,GAAG,MAAM;IACxD,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,eAAe,WAAW;QAChE,KAAK;QACL,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,OAAO,cAAc,IAAI;QAC7C,gBAAc,OAAO,SAAS,IAAI;QAClC,iBAAe,OAAO,UAAU,IAAI;QACpC,uBAAqB,iBAAiB,aAAa,KAAK,SAAS,YAAY,iBAAiB,aAAa;QAC3G,oBAAkB,CAAC,CAAC,KAAK,CAAC,gBAAgB,IAAI;QAC9C,aAAW,KAAK,CAAC,gBAAgB,KAAK,UAAU;qBAChD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE;wBAChB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;SACzC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaMenuProps, FocusScope, mergeProps, useHover, useMenu, useMenuItem, useMenuSection, useMenuTrigger, useSubmenuTrigger} from 'react-aria';\nimport {BaseCollection, Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, ItemNode, SectionNode} from '@react-aria/collections';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, RootMenuTriggerState, TreeState, useMenuTriggerState, useSubmenuTriggerState, useTreeState} from 'react-stately';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldInputContext, SelectableCollectionContext, SelectableCollectionContextValue} from './context';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, MultipleSelection, PressEvents} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby']\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>, shouldUseVirtualFocus?: boolean} | null>(null);\n\nclass SubmenuTriggerNode<T> extends CollectionNode<T> {\n static readonly type = 'submenutrigger';\n\n filter(collection: BaseCollection<T>, newCollection: BaseCollection<T>, filterFn: (textValue: string, node: Node<T>) => boolean): CollectionNode<T> | null {\n let triggerNode = collection.getItem(this.firstChildKey!);\n if (triggerNode && filterFn(triggerNode.textValue, this)) {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent(SubmenuTriggerNode, (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef, shouldUseVirtualFocus} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay,\n shouldUseVirtualFocus\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, {\n ref: submenuRef,\n ...submenuProps\n }],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n 'aria-labelledby': submenuProps['aria-labelledby'],\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuRenderProps {\n /**\n * Whether the menu has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean\n}\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<MenuRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: () => ReactNode\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nexport const Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(function Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface MenuInnerProps<T> {\n // For now we append filter and other autocomplete context props here for typescript, but eventually we can consider exposing these\n // as top level props for users to use with standalone Menus\n props: MenuProps<T> & {filter?: SelectableCollectionContextValue<object>['filter'], shouldUseVirtualFocus?: boolean},\n collection: BaseCollection<object>,\n menuRef: RefObject<HTMLElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n [props, ref] = useContextProps(props, ref, SelectableCollectionContext);\n let {filter, ...autocompleteMenuProps} = props;\n let filteredCollection = useMemo(() => filter ? collection.filter(filter) : collection, [collection, filter]);\n let state = useTreeState({\n ...props,\n collection: filteredCollection as ICollection<Node<object>>,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized, onClose: props.onClose || triggerState?.close}, state, ref);\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {\n isEmpty: state.collection.size === 0\n }\n });\n\n let emptyState: ReactElement | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n emptyState = (\n <div\n role=\"menuitem\"\n style={{display: 'contents'}}>\n {props.renderEmptyState()}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, menuProps)}\n ref={ref as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n data-empty={state.collection.size === 0 || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSectionInner}],\n [SubmenuTriggerContext, {parentMenuRef: ref, shouldUseVirtualFocus: autocompleteMenuProps?.shouldUseVirtualFocus}],\n [MenuItemContext, null],\n [SelectableCollectionContext, null],\n [FieldInputContext, null],\n [SelectionManagerContext, state.selectionManager],\n /* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */\n /* We assume the context can never change between defined and undefined. */\n /* eslint-disable-next-line react-hooks/rules-of-hooks */\n [RootMenuTriggerStateContext, triggerState ?? useMenuTriggerState({})]\n ]}>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n {emptyState}\n </div>\n </FocusScope>\n );\n}\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <section\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nexport const MenuSection = /*#__PURE__*/ createBranchComponent(SectionNode, MenuSectionInner);\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean,\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean\n}\n\nexport interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the item is selected. */\n onAction?: () => void\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent(ItemNode, function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible: states.isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, menuItemProps, hoverProps)}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AA+CM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B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I;QAC9C,aAAW,KAAK,CAAC,gBAAgB,KAAK,UAAU;qBAChD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE;wBAChB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;YACxC;gBAAC,CAAA,GAAA,mDAAwB;gBAAG;oBAAC,YAAY,OAAO,UAAU;gBAAA;aAAE;SAC7D;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaMenuProps, FocusScope, mergeProps, useHover, useMenu, useMenuItem, useMenuSection, useMenuTrigger, useSubmenuTrigger} from 'react-aria';\nimport {BaseCollection, Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, ItemNode, SectionNode} from '@react-aria/collections';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, RootMenuTriggerState, TreeState, useMenuTriggerState, useSubmenuTriggerState, useTreeState} from 'react-stately';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {FieldInputContext, SelectableCollectionContext, SelectableCollectionContextValue} from './RSPContexts';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, MultipleSelection, PressEvents} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n JSX,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SeparatorContext} from './Separator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps): JSX.Element {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby']\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>, shouldUseVirtualFocus?: boolean} | null>(null);\n\nclass SubmenuTriggerNode<T> extends CollectionNode<T> {\n static readonly type = 'submenutrigger';\n\n filter(collection: BaseCollection<T>, newCollection: BaseCollection<T>, filterFn: (textValue: string, node: Node<T>) => boolean): CollectionNode<T> | null {\n let triggerNode = collection.getItem(this.firstChildKey!);\n if (triggerNode && filterFn(triggerNode.textValue, this)) {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent(SubmenuTriggerNode, (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef, shouldUseVirtualFocus} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay,\n shouldUseVirtualFocus\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, {\n ref: submenuRef,\n ...submenuProps\n }],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n 'aria-labelledby': submenuProps['aria-labelledby'],\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuRenderProps {\n /**\n * Whether the menu has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean\n}\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<MenuRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Menu'\n */\n className?: ClassNameOrFunction<MenuRenderProps>,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: () => ReactNode\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nexport const Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(function Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface MenuInnerProps<T> {\n // For now we append filter and other autocomplete context props here for typescript, but eventually we can consider exposing these\n // as top level props for users to use with standalone Menus\n props: MenuProps<T> & {filter?: SelectableCollectionContextValue<object>['filter'], shouldUseVirtualFocus?: boolean},\n collection: BaseCollection<object>,\n menuRef: RefObject<HTMLElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n [props, ref] = useContextProps(props, ref, SelectableCollectionContext);\n let {filter, ...autocompleteMenuProps} = props;\n let filteredCollection = useMemo(() => filter ? collection.filter(filter) : collection, [collection, filter]);\n let state = useTreeState({\n ...props,\n collection: filteredCollection as ICollection<Node<object>>,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized, onClose: props.onClose || triggerState?.close}, state, ref);\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {\n isEmpty: state.collection.size === 0\n }\n });\n\n let emptyState: ReactElement | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n emptyState = (\n <div\n role=\"menuitem\"\n style={{display: 'contents'}}>\n {props.renderEmptyState()}\n </div>\n );\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <FocusScope>\n <div\n {...mergeProps(DOMProps, renderProps, menuProps)}\n ref={ref as RefObject<HTMLDivElement>}\n slot={props.slot || undefined}\n data-empty={state.collection.size === 0 || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSectionInner}],\n [SubmenuTriggerContext, {parentMenuRef: ref, shouldUseVirtualFocus: autocompleteMenuProps?.shouldUseVirtualFocus}],\n [MenuItemContext, null],\n [SelectableCollectionContext, null],\n [FieldInputContext, null],\n [SelectionManagerContext, state.selectionManager],\n /* Ensure root MenuTriggerState is defined, in case Menu is rendered outside a MenuTrigger. */\n /* We assume the context can never change between defined and undefined. */\n /* eslint-disable-next-line react-hooks/rules-of-hooks */\n [RootMenuTriggerStateContext, triggerState ?? useMenuTriggerState({})]\n ]}>\n <SharedElementTransition>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </SharedElementTransition>\n </Provider>\n {emptyState}\n </div>\n </FocusScope>\n );\n}\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-MenuSection'\n */\n className?: string\n}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSectionInner<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <section\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nexport const MenuSection = /*#__PURE__*/ createBranchComponent(SectionNode, MenuSectionInner);\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean,\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean\n}\n\nexport interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-MenuItem'\n */\n className?: ClassNameOrFunction<MenuItemRenderProps>,\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the item is selected. */\n onAction?: () => void\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent(ItemNode, function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible: states.isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <ElementType\n {...mergeProps(DOMProps, renderProps, menuItemProps, hoverProps)}\n ref={ref}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={states.isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: labelProps,\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps],\n [SelectionIndicatorContext, {isSelected: states.isSelected}]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.main.js.map"}
|
package/dist/Menu.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.mjs";
|
|
2
1
|
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
3
|
-
import {
|
|
2
|
+
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.mjs";
|
|
3
|
+
import {FieldInputContext as $4e85f108e88277b8$export$698f465ec27e93df, SelectableCollectionContext as $4e85f108e88277b8$export$b0d3ecf7112093a7} from "./RSPContexts.mjs";
|
|
4
4
|
import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.mjs";
|
|
5
5
|
import {KeyboardContext as $63df2425e2108aa8$export$744d98a3b8a94e1c} from "./Keyboard.mjs";
|
|
6
6
|
import {OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe} from "./Dialog.mjs";
|
|
7
7
|
import {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from "./Popover.mjs";
|
|
8
|
+
import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from "./SelectionIndicator.mjs";
|
|
8
9
|
import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.mjs";
|
|
10
|
+
import {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from "./SharedElementTransition.mjs";
|
|
9
11
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
10
12
|
import {useMenuTrigger as $kM2ZM$useMenuTrigger, useSubmenuTrigger as $kM2ZM$useSubmenuTrigger, useMenu as $kM2ZM$useMenu, FocusScope as $kM2ZM$FocusScope, mergeProps as $kM2ZM$mergeProps, useMenuSection as $kM2ZM$useMenuSection, useMenuItem as $kM2ZM$useMenuItem, useHover as $kM2ZM$useHover} from "react-aria";
|
|
11
13
|
import {CollectionNode as $kM2ZM$CollectionNode, createBranchComponent as $kM2ZM$createBranchComponent, CollectionBuilder as $kM2ZM$CollectionBuilder, Collection as $kM2ZM$Collection, SectionNode as $kM2ZM$SectionNode, createLeafComponent as $kM2ZM$createLeafComponent, ItemNode as $kM2ZM$ItemNode} from "@react-aria/collections";
|
|
@@ -41,6 +43,8 @@ import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$us
|
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
|
|
46
|
+
|
|
47
|
+
|
|
44
48
|
const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
|
|
45
49
|
const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
|
|
46
50
|
const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
|
|
@@ -179,7 +183,7 @@ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwa
|
|
|
179
183
|
}));
|
|
180
184
|
});
|
|
181
185
|
function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
|
|
182
|
-
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $
|
|
186
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $4e85f108e88277b8$export$b0d3ecf7112093a7));
|
|
183
187
|
let { filter: filter, ...autocompleteMenuProps } = props;
|
|
184
188
|
let filteredCollection = (0, $kM2ZM$useMemo)(()=>filter ? collection.filter(filter) : collection, [
|
|
185
189
|
collection,
|
|
@@ -252,11 +256,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
252
256
|
null
|
|
253
257
|
],
|
|
254
258
|
[
|
|
255
|
-
(0, $
|
|
259
|
+
(0, $4e85f108e88277b8$export$b0d3ecf7112093a7),
|
|
256
260
|
null
|
|
257
261
|
],
|
|
258
262
|
[
|
|
259
|
-
(0, $
|
|
263
|
+
(0, $4e85f108e88277b8$export$698f465ec27e93df),
|
|
260
264
|
null
|
|
261
265
|
],
|
|
262
266
|
[
|
|
@@ -268,11 +272,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
268
272
|
triggerState !== null && triggerState !== void 0 ? triggerState : (0, $kM2ZM$useMenuTriggerState)({})
|
|
269
273
|
]
|
|
270
274
|
]
|
|
271
|
-
}, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
|
|
275
|
+
}, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $c8a5a149f625efcf$export$758399f318e6385a), null, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
|
|
272
276
|
collection: state.collection,
|
|
273
277
|
persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey),
|
|
274
278
|
scrollRef: ref
|
|
275
|
-
})), emptyState));
|
|
279
|
+
}))), emptyState));
|
|
276
280
|
}
|
|
277
281
|
// A subclass of SelectionManager that forwards focus-related properties to the parent,
|
|
278
282
|
// but has its own local selection state.
|
|
@@ -408,6 +412,12 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
|
|
|
408
412
|
[
|
|
409
413
|
(0, $63df2425e2108aa8$export$744d98a3b8a94e1c),
|
|
410
414
|
keyboardShortcutProps
|
|
415
|
+
],
|
|
416
|
+
[
|
|
417
|
+
(0, $1d5b8b8664671ef2$export$c9549807523555e0),
|
|
418
|
+
{
|
|
419
|
+
isSelected: states.isSelected
|
|
420
|
+
}
|
|
411
421
|
]
|
|
412
422
|
]
|
|
413
423
|
}, renderProps.children));
|
package/dist/Menu.module.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.module.js";
|
|
2
1
|
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
3
|
-
import {
|
|
2
|
+
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, SectionContext as $7135fc7d473fd974$export$d40e14dec8b060a8, usePersistedKeys as $7135fc7d473fd974$export$90e00781bc59d8f9} from "./Collection.module.js";
|
|
3
|
+
import {FieldInputContext as $4e85f108e88277b8$export$698f465ec27e93df, SelectableCollectionContext as $4e85f108e88277b8$export$b0d3ecf7112093a7} from "./RSPContexts.module.js";
|
|
4
4
|
import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.module.js";
|
|
5
5
|
import {KeyboardContext as $63df2425e2108aa8$export$744d98a3b8a94e1c} from "./Keyboard.module.js";
|
|
6
6
|
import {OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe} from "./Dialog.module.js";
|
|
7
7
|
import {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from "./Popover.module.js";
|
|
8
|
+
import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from "./SelectionIndicator.module.js";
|
|
8
9
|
import {SeparatorContext as $431f98aba6844401$export$6615d83f6de245ce} from "./Separator.module.js";
|
|
10
|
+
import {SharedElementTransition as $c8a5a149f625efcf$export$758399f318e6385a} from "./SharedElementTransition.module.js";
|
|
9
11
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
|
|
10
12
|
import {useMenuTrigger as $kM2ZM$useMenuTrigger, useSubmenuTrigger as $kM2ZM$useSubmenuTrigger, useMenu as $kM2ZM$useMenu, FocusScope as $kM2ZM$FocusScope, mergeProps as $kM2ZM$mergeProps, useMenuSection as $kM2ZM$useMenuSection, useMenuItem as $kM2ZM$useMenuItem, useHover as $kM2ZM$useHover} from "react-aria";
|
|
11
13
|
import {CollectionNode as $kM2ZM$CollectionNode, createBranchComponent as $kM2ZM$createBranchComponent, CollectionBuilder as $kM2ZM$CollectionBuilder, Collection as $kM2ZM$Collection, SectionNode as $kM2ZM$SectionNode, createLeafComponent as $kM2ZM$createLeafComponent, ItemNode as $kM2ZM$ItemNode} from "@react-aria/collections";
|
|
@@ -41,6 +43,8 @@ import $kM2ZM$react, {createContext as $kM2ZM$createContext, useRef as $kM2ZM$us
|
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
|
|
46
|
+
|
|
47
|
+
|
|
44
48
|
const $3674c52c6b3c5bce$export$c7e742effb1c51e2 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
|
|
45
49
|
const $3674c52c6b3c5bce$export$24aad8519b95b41b = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
|
|
46
50
|
const $3674c52c6b3c5bce$export$795aec4671cbae19 = /*#__PURE__*/ (0, $kM2ZM$createContext)(null);
|
|
@@ -179,7 +183,7 @@ const $3674c52c6b3c5bce$export$d9b273488cd8ce6f = /*#__PURE__*/ (0, $kM2ZM$forwa
|
|
|
179
183
|
}));
|
|
180
184
|
});
|
|
181
185
|
function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection, menuRef: ref }) {
|
|
182
|
-
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $
|
|
186
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $4e85f108e88277b8$export$b0d3ecf7112093a7));
|
|
183
187
|
let { filter: filter, ...autocompleteMenuProps } = props;
|
|
184
188
|
let filteredCollection = (0, $kM2ZM$useMemo)(()=>filter ? collection.filter(filter) : collection, [
|
|
185
189
|
collection,
|
|
@@ -252,11 +256,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
252
256
|
null
|
|
253
257
|
],
|
|
254
258
|
[
|
|
255
|
-
(0, $
|
|
259
|
+
(0, $4e85f108e88277b8$export$b0d3ecf7112093a7),
|
|
256
260
|
null
|
|
257
261
|
],
|
|
258
262
|
[
|
|
259
|
-
(0, $
|
|
263
|
+
(0, $4e85f108e88277b8$export$698f465ec27e93df),
|
|
260
264
|
null
|
|
261
265
|
],
|
|
262
266
|
[
|
|
@@ -268,11 +272,11 @@ function $3674c52c6b3c5bce$var$MenuInner({ props: props, collection: collection,
|
|
|
268
272
|
triggerState !== null && triggerState !== void 0 ? triggerState : (0, $kM2ZM$useMenuTriggerState)({})
|
|
269
273
|
]
|
|
270
274
|
]
|
|
271
|
-
}, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
|
|
275
|
+
}, /*#__PURE__*/ (0, $kM2ZM$react).createElement((0, $c8a5a149f625efcf$export$758399f318e6385a), null, /*#__PURE__*/ (0, $kM2ZM$react).createElement(CollectionRoot, {
|
|
272
276
|
collection: state.collection,
|
|
273
277
|
persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey),
|
|
274
278
|
scrollRef: ref
|
|
275
|
-
})), emptyState));
|
|
279
|
+
}))), emptyState));
|
|
276
280
|
}
|
|
277
281
|
// A subclass of SelectionManager that forwards focus-related properties to the parent,
|
|
278
282
|
// but has its own local selection state.
|
|
@@ -408,6 +412,12 @@ const $3674c52c6b3c5bce$export$2ce376c2cc3355c8 = /*#__PURE__*/ (0, $kM2ZM$creat
|
|
|
408
412
|
[
|
|
409
413
|
(0, $63df2425e2108aa8$export$744d98a3b8a94e1c),
|
|
410
414
|
keyboardShortcutProps
|
|
415
|
+
],
|
|
416
|
+
[
|
|
417
|
+
(0, $1d5b8b8664671ef2$export$c9549807523555e0),
|
|
418
|
+
{
|
|
419
|
+
isSelected: states.isSelected
|
|
420
|
+
}
|
|
411
421
|
]
|
|
412
422
|
]
|
|
413
423
|
}, renderProps.children));
|