react-aria-components 1.10.1 → 1.12.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 +7 -20
- package/dist/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.mjs +8 -20
- package/dist/Autocomplete.module.js +8 -20
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Breadcrumbs.main.js +13 -3
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +15 -5
- package/dist/Breadcrumbs.module.js +15 -5
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +7 -17
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +7 -17
- package/dist/Button.module.js +7 -17
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +36 -14
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +38 -16
- package/dist/Calendar.module.js +38 -16
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +8 -3
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +10 -5
- package/dist/Checkbox.module.js +10 -5
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +5 -5
- package/dist/ColorArea.module.js +5 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +14 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +14 -1
- package/dist/ColorField.module.js +14 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -1
- package/dist/ColorSlider.module.js +3 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +6 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +6 -2
- package/dist/ColorSwatch.module.js +6 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +3 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -1
- package/dist/ColorThumb.module.js +3 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +4 -1
- package/dist/ComboBox.module.js +4 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +16 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -3
- package/dist/DateField.module.js +16 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +15 -8
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +16 -9
- package/dist/DatePicker.module.js +16 -9
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +4 -3
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +5 -4
- package/dist/Dialog.module.js +5 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +12 -10
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +13 -11
- package/dist/Disclosure.module.js +13 -11
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +31 -3
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +31 -3
- package/dist/DragAndDrop.module.js +31 -3
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +4 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -3
- package/dist/DropZone.module.js +4 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +3 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -1
- package/dist/FieldError.module.js +3 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +3 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +3 -1
- package/dist/FileTrigger.module.js +3 -1
- 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 +114 -26
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +116 -30
- package/dist/GridList.module.js +116 -30
- package/dist/GridList.module.js.map +1 -1
- package/dist/Header.main.js +1 -1
- package/dist/Header.main.js.map +1 -1
- package/dist/Header.mjs +2 -2
- package/dist/Header.module.js +2 -2
- package/dist/Header.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +118 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +109 -0
- package/dist/HiddenDateInput.module.js +109 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Link.main.js +7 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +7 -1
- package/dist/Link.module.js +7 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +27 -36
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +29 -38
- package/dist/ListBox.module.js +29 -38
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +44 -23
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +47 -26
- package/dist/Menu.module.js +47 -26
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +6 -2
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +6 -2
- package/dist/Meter.module.js +6 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +31 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +31 -6
- package/dist/Modal.module.js +31 -6
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -1
- package/dist/NumberField.module.js +4 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +10 -12
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +11 -13
- package/dist/Popover.module.js +11 -13
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +6 -2
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +6 -2
- package/dist/ProgressBar.module.js +6 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +8 -3
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +9 -4
- package/dist/RadioGroup.module.js +9 -4
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +9 -5
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +10 -6
- package/dist/SearchField.module.js +10 -6
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +12 -14
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +13 -15
- package/dist/Select.module.js +13 -15
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +17 -3
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +20 -6
- package/dist/Separator.module.js +20 -6
- package/dist/Separator.module.js.map +1 -1
- package/dist/Slider.main.js +7 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +8 -6
- package/dist/Slider.module.js +8 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +4 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +4 -1
- package/dist/Switch.module.js +4 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +104 -42
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +107 -45
- package/dist/Table.module.js +107 -45
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +24 -11
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +26 -13
- package/dist/Tabs.module.js +26 -13
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +27 -12
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +29 -14
- package/dist/TagGroup.module.js +29 -14
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +20 -6
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +21 -7
- package/dist/TextField.module.js +21 -7
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +9 -5
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +9 -5
- package/dist/Toast.module.js +9 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +8 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +8 -2
- package/dist/ToggleButton.module.js +8 -2
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +6 -2
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +6 -2
- package/dist/ToggleButtonGroup.module.js +6 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +4 -3
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +4 -3
- package/dist/Toolbar.module.js +4 -3
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +9 -14
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +10 -15
- package/dist/Tooltip.module.js +10 -15
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +81 -28
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +83 -30
- package/dist/Tree.module.js +83 -30
- package/dist/Tree.module.js.map +1 -1
- package/dist/TreeDropTargetDelegate.main.js +8 -5
- package/dist/TreeDropTargetDelegate.main.js.map +1 -1
- package/dist/TreeDropTargetDelegate.mjs +8 -5
- package/dist/TreeDropTargetDelegate.module.js +8 -5
- package/dist/TreeDropTargetDelegate.module.js.map +1 -1
- package/dist/context.main.js +25 -0
- package/dist/context.main.js.map +1 -0
- package/dist/context.mjs +19 -0
- package/dist/context.module.js +19 -0
- package/dist/context.module.js.map +1 -0
- package/dist/import.mjs +6 -6
- package/dist/main.js +7 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +358 -342
- package/dist/types.d.ts.map +1 -1
- package/dist/useDragAndDrop.main.js.map +1 -1
- package/dist/useDragAndDrop.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/package.json +27 -26
- package/src/Autocomplete.tsx +14 -25
- package/src/Breadcrumbs.tsx +16 -8
- package/src/Button.tsx +8 -30
- package/src/Calendar.tsx +41 -24
- package/src/Checkbox.tsx +8 -6
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +5 -6
- package/src/ColorField.tsx +6 -4
- package/src/ColorSlider.tsx +3 -2
- package/src/ColorSwatch.tsx +6 -3
- package/src/ColorSwatchPicker.tsx +3 -3
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +6 -5
- package/src/ComboBox.tsx +4 -4
- package/src/DateField.tsx +15 -10
- package/src/DatePicker.tsx +14 -12
- package/src/Dialog.tsx +6 -6
- package/src/Disclosure.tsx +10 -14
- package/src/DragAndDrop.tsx +31 -1
- package/src/DropZone.tsx +4 -5
- package/src/FieldError.tsx +3 -3
- package/src/FileTrigger.tsx +4 -3
- package/src/Form.tsx +2 -1
- package/src/GridList.tsx +112 -37
- package/src/Header.tsx +2 -2
- package/src/HiddenDateInput.tsx +142 -0
- package/src/Link.tsx +7 -3
- package/src/ListBox.tsx +40 -39
- package/src/Menu.tsx +52 -29
- package/src/Meter.tsx +6 -3
- package/src/Modal.tsx +16 -5
- package/src/NumberField.tsx +4 -4
- package/src/Popover.tsx +14 -14
- package/src/ProgressBar.tsx +6 -2
- package/src/RadioGroup.tsx +8 -6
- package/src/SearchField.tsx +8 -6
- package/src/Select.tsx +13 -16
- package/src/Separator.tsx +23 -6
- package/src/Slider.tsx +9 -11
- package/src/Switch.tsx +4 -3
- package/src/Table.tsx +119 -74
- package/src/Tabs.tsx +24 -17
- package/src/TagGroup.tsx +28 -18
- package/src/TextField.tsx +13 -9
- package/src/Toast.tsx +10 -8
- package/src/ToggleButton.tsx +8 -4
- package/src/ToggleButtonGroup.tsx +6 -4
- package/src/Toolbar.tsx +4 -5
- package/src/Tooltip.tsx +15 -18
- package/src/Tree.tsx +102 -46
- package/src/TreeDropTargetDelegate.ts +5 -1
- package/src/context.tsx +34 -0
- package/src/index.ts +9 -9
- package/src/useDragAndDrop.tsx +11 -11
- package/src/utils.tsx +9 -9
package/dist/GridList.mjs
CHANGED
|
@@ -3,12 +3,14 @@ import {CheckboxContext as $4e85f108e88277b8$export$b085522c77523c51} from "./RS
|
|
|
3
3
|
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae} from "./Collection.mjs";
|
|
4
4
|
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
5
5
|
import {DragAndDropContext as $612b8eb6cb90e02d$export$d188a835a7bc5783, DropIndicatorContext as $612b8eb6cb90e02d$export$f55761759794cf55, useDndPersistedKeys as $612b8eb6cb90e02d$export$d1e8e3fbb7461f6, useRenderDropIndicator as $612b8eb6cb90e02d$export$971707d8a129a1f7} from "./DragAndDrop.mjs";
|
|
6
|
+
import {FieldInputContext as $8e6cc465cc68f603$export$698f465ec27e93df, SelectableCollectionContext as $8e6cc465cc68f603$export$b0d3ecf7112093a7} from "./context.mjs";
|
|
7
|
+
import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.mjs";
|
|
6
8
|
import {ListStateContext as $eed445e0843c11d0$export$7c5906fe4f1f2af2} from "./ListBox.mjs";
|
|
7
9
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
8
|
-
import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKeyboardDelegate as $jTmF7$ListKeyboardDelegate, useGridList as $jTmF7$useGridList, useFocusRing as $jTmF7$useFocusRing, FocusScope as $jTmF7$FocusScope, mergeProps as $jTmF7$mergeProps, useGridListItem as $jTmF7$useGridListItem, useHover as $jTmF7$useHover, useGridListSelectionCheckbox as $jTmF7$useGridListSelectionCheckbox, useVisuallyHidden as $jTmF7$useVisuallyHidden} from "react-aria";
|
|
9
|
-
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent} from "@react-aria/collections";
|
|
10
|
-
import {useListState as $jTmF7$useListState} from "react-stately";
|
|
11
|
-
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef,
|
|
10
|
+
import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKeyboardDelegate as $jTmF7$ListKeyboardDelegate, useGridList as $jTmF7$useGridList, useFocusRing as $jTmF7$useFocusRing, FocusScope as $jTmF7$FocusScope, mergeProps as $jTmF7$mergeProps, useGridListItem as $jTmF7$useGridListItem, useHover as $jTmF7$useHover, useGridListSelectionCheckbox as $jTmF7$useGridListSelectionCheckbox, useVisuallyHidden as $jTmF7$useVisuallyHidden, useGridListSection as $jTmF7$useGridListSection} from "react-aria";
|
|
11
|
+
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent, ItemNode as $jTmF7$ItemNode, LoaderNode as $jTmF7$LoaderNode, createBranchComponent as $jTmF7$createBranchComponent, SectionNode as $jTmF7$SectionNode, HeaderNode as $jTmF7$HeaderNode} from "@react-aria/collections";
|
|
12
|
+
import {useListState as $jTmF7$useListState, UNSTABLE_useFilteredListState as $jTmF7$UNSTABLE_useFilteredListState} from "react-stately";
|
|
13
|
+
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef, useLoadMoreSentinel as $jTmF7$useLoadMoreSentinel, inertValue as $jTmF7$inertValue} from "@react-aria/utils";
|
|
12
14
|
import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF7$forwardRef, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect} from "react";
|
|
13
15
|
|
|
14
16
|
/*
|
|
@@ -33,6 +35,8 @@ import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF
|
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
|
38
|
+
|
|
39
|
+
|
|
36
40
|
const $72e60046c03fbe42$export$54fe942636b6416d = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
37
41
|
const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)(function GridList(props, ref) {
|
|
38
42
|
// Render the portal first so that we have the collection by the time we render the DOM in SSR.
|
|
@@ -46,23 +50,30 @@ const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwa
|
|
|
46
50
|
}));
|
|
47
51
|
});
|
|
48
52
|
function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
|
|
49
|
-
|
|
53
|
+
// TODO: for now, don't grab collection ref and collectionProps from the autocomplete, rely on the user tabbing to the gridlist
|
|
54
|
+
// figure out if we want to support virtual focus for grids when wrapped in an autocomplete
|
|
55
|
+
let contextProps;
|
|
56
|
+
[contextProps] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)({}, null, (0, $8e6cc465cc68f603$export$b0d3ecf7112093a7));
|
|
57
|
+
let { filter: filter, ...collectionProps } = contextProps;
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
+
let { shouldUseVirtualFocus: shouldUseVirtualFocus, disallowTypeAhead: disallowTypeAhead, ...DOMCollectionProps } = collectionProps || {};
|
|
50
60
|
let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
|
|
51
61
|
let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
52
|
-
let
|
|
62
|
+
let gridlistState = (0, $jTmF7$useListState)({
|
|
53
63
|
...props,
|
|
54
64
|
collection: collection,
|
|
55
65
|
children: undefined,
|
|
56
66
|
layoutDelegate: layoutDelegate
|
|
57
67
|
});
|
|
68
|
+
let filteredState = (0, $jTmF7$UNSTABLE_useFilteredListState)(gridlistState, filter);
|
|
58
69
|
let collator = (0, $jTmF7$useCollator)({
|
|
59
70
|
usage: 'search',
|
|
60
71
|
sensitivity: 'base'
|
|
61
72
|
});
|
|
62
|
-
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } =
|
|
73
|
+
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } = filteredState.selectionManager;
|
|
63
74
|
let { direction: direction } = (0, $jTmF7$useLocale)();
|
|
64
75
|
let keyboardDelegate = (0, $jTmF7$useMemo)(()=>new (0, $jTmF7$ListKeyboardDelegate)({
|
|
65
|
-
collection: collection,
|
|
76
|
+
collection: filteredState.collection,
|
|
66
77
|
collator: collator,
|
|
67
78
|
ref: ref,
|
|
68
79
|
disabledKeys: disabledKeys,
|
|
@@ -71,7 +82,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
71
82
|
layout: layout,
|
|
72
83
|
direction: direction
|
|
73
84
|
}), [
|
|
74
|
-
collection,
|
|
85
|
+
filteredState.collection,
|
|
75
86
|
ref,
|
|
76
87
|
layout,
|
|
77
88
|
disabledKeys,
|
|
@@ -82,13 +93,14 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
82
93
|
]);
|
|
83
94
|
let { gridProps: gridProps } = (0, $jTmF7$useGridList)({
|
|
84
95
|
...props,
|
|
96
|
+
...DOMCollectionProps,
|
|
85
97
|
keyboardDelegate: keyboardDelegate,
|
|
86
98
|
// Only tab navigation is supported in grid layout.
|
|
87
99
|
keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,
|
|
88
100
|
isVirtualized: isVirtualized,
|
|
89
101
|
shouldSelectOnPressUp: props.shouldSelectOnPressUp
|
|
90
|
-
},
|
|
91
|
-
let selectionManager =
|
|
102
|
+
}, filteredState, ref);
|
|
103
|
+
let selectionManager = filteredState.selectionManager;
|
|
92
104
|
let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
93
105
|
let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
|
|
94
106
|
let dragHooksProvided = (0, $jTmF7$useRef)(isListDraggable);
|
|
@@ -109,7 +121,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
109
121
|
let preview = (0, $jTmF7$useRef)(null);
|
|
110
122
|
if (isListDraggable && dragAndDropHooks) {
|
|
111
123
|
dragState = dragAndDropHooks.useDraggableCollectionState({
|
|
112
|
-
collection: collection,
|
|
124
|
+
collection: filteredState.collection,
|
|
113
125
|
selectionManager: selectionManager,
|
|
114
126
|
preview: dragAndDropHooks.renderDragPreview ? preview : undefined
|
|
115
127
|
});
|
|
@@ -121,11 +133,11 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
121
133
|
}
|
|
122
134
|
if (isListDroppable && dragAndDropHooks) {
|
|
123
135
|
dropState = dragAndDropHooks.useDroppableCollectionState({
|
|
124
|
-
collection: collection,
|
|
136
|
+
collection: filteredState.collection,
|
|
125
137
|
selectionManager: selectionManager
|
|
126
138
|
});
|
|
127
139
|
let keyboardDelegate = new (0, $jTmF7$ListKeyboardDelegate)({
|
|
128
|
-
collection: collection,
|
|
140
|
+
collection: filteredState.collection,
|
|
129
141
|
disabledKeys: selectionManager.disabledKeys,
|
|
130
142
|
disabledBehavior: selectionManager.disabledBehavior,
|
|
131
143
|
ref: ref
|
|
@@ -143,15 +155,14 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
143
155
|
});
|
|
144
156
|
}
|
|
145
157
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $jTmF7$useFocusRing)();
|
|
146
|
-
|
|
147
|
-
let isEmpty = state.collection.size === 0 || state.collection.size === 1 && ((_state_collection_getItem = state.collection.getItem(state.collection.getFirstKey())) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.type) === 'loader';
|
|
158
|
+
let isEmpty = filteredState.collection.size === 0;
|
|
148
159
|
let renderValues = {
|
|
149
160
|
isDropTarget: isRootDropTarget,
|
|
150
161
|
isEmpty: isEmpty,
|
|
151
162
|
isFocused: isFocused,
|
|
152
163
|
isFocusVisible: isFocusVisible,
|
|
153
164
|
layout: layout,
|
|
154
|
-
state:
|
|
165
|
+
state: filteredState
|
|
155
166
|
};
|
|
156
167
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
157
168
|
className: props.className,
|
|
@@ -176,10 +187,11 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
176
187
|
}
|
|
177
188
|
}, content));
|
|
178
189
|
}
|
|
190
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
191
|
+
global: true
|
|
192
|
+
});
|
|
179
193
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$FocusScope), null, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
180
|
-
...(0, $jTmF7$
|
|
181
|
-
...renderProps,
|
|
182
|
-
...(0, $jTmF7$mergeProps)(gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps, emptyStatePropOverrides),
|
|
194
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps, emptyStatePropOverrides),
|
|
183
195
|
ref: ref,
|
|
184
196
|
slot: props.slot || undefined,
|
|
185
197
|
onScroll: props.onScroll,
|
|
@@ -192,7 +204,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
192
204
|
values: [
|
|
193
205
|
[
|
|
194
206
|
(0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),
|
|
195
|
-
|
|
207
|
+
filteredState
|
|
196
208
|
],
|
|
197
209
|
[
|
|
198
210
|
(0, $612b8eb6cb90e02d$export$d188a835a7bc5783),
|
|
@@ -210,13 +222,13 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
210
222
|
]
|
|
211
223
|
]
|
|
212
224
|
}, isListDroppable && /*#__PURE__*/ (0, $jTmF7$react).createElement($72e60046c03fbe42$var$RootDropIndicator, null), /*#__PURE__*/ (0, $jTmF7$react).createElement(CollectionRoot, {
|
|
213
|
-
collection: collection,
|
|
225
|
+
collection: filteredState.collection,
|
|
214
226
|
scrollRef: ref,
|
|
215
227
|
persistedKeys: (0, $612b8eb6cb90e02d$export$d1e8e3fbb7461f6)(selectionManager, dragAndDropHooks, dropState),
|
|
216
228
|
renderDropIndicator: (0, $612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
|
|
217
229
|
})), emptyState, dragPreview));
|
|
218
230
|
}
|
|
219
|
-
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)(
|
|
231
|
+
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)((0, $jTmF7$ItemNode), function GridListItem(props, forwardedRef, item) {
|
|
220
232
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
221
233
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $jTmF7$useContext)((0, $612b8eb6cb90e02d$export$d188a835a7bc5783));
|
|
222
234
|
let ref = (0, $jTmF7$useObjectRef)(forwardedRef);
|
|
@@ -281,6 +293,11 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
281
293
|
}, [
|
|
282
294
|
item.textValue
|
|
283
295
|
]);
|
|
296
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
297
|
+
global: true
|
|
298
|
+
});
|
|
299
|
+
delete DOMProps.id;
|
|
300
|
+
delete DOMProps.onClick;
|
|
284
301
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$react).Fragment, null, dropIndicator && !dropIndicator.isHidden && /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
285
302
|
role: "row",
|
|
286
303
|
style: {
|
|
@@ -294,8 +311,7 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
294
311
|
...dropIndicator === null || dropIndicator === void 0 ? void 0 : dropIndicator.dropIndicatorProps,
|
|
295
312
|
ref: dropIndicatorRef
|
|
296
313
|
}))), /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
297
|
-
...(0, $jTmF7$mergeProps)(
|
|
298
|
-
...renderProps,
|
|
314
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps),
|
|
299
315
|
ref: ref,
|
|
300
316
|
"data-selected": states.isSelected || undefined,
|
|
301
317
|
"data-disabled": states.isDisabled || undefined,
|
|
@@ -354,6 +370,14 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
354
370
|
[
|
|
355
371
|
(0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),
|
|
356
372
|
null
|
|
373
|
+
],
|
|
374
|
+
[
|
|
375
|
+
(0, $8e6cc465cc68f603$export$b0d3ecf7112093a7),
|
|
376
|
+
null
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
(0, $8e6cc465cc68f603$export$698f465ec27e93df),
|
|
380
|
+
null
|
|
357
381
|
]
|
|
358
382
|
]
|
|
359
383
|
}, renderProps.children))));
|
|
@@ -425,7 +449,7 @@ function $72e60046c03fbe42$var$RootDropIndicator() {
|
|
|
425
449
|
ref: ref
|
|
426
450
|
})));
|
|
427
451
|
}
|
|
428
|
-
const $72e60046c03fbe42$export$
|
|
452
|
+
const $72e60046c03fbe42$export$392b9a0bbc7c7e43 = (0, $jTmF7$createLeafComponent)((0, $jTmF7$LoaderNode), function GridListLoadingIndicator(props, ref, item) {
|
|
429
453
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
430
454
|
let { isVirtualized: isVirtualized } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
431
455
|
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
|
|
@@ -440,7 +464,7 @@ const $72e60046c03fbe42$export$74653c2d94c32cc3 = (0, $jTmF7$createLeafComponent
|
|
|
440
464
|
scrollOffset,
|
|
441
465
|
state === null || state === void 0 ? void 0 : state.collection
|
|
442
466
|
]);
|
|
443
|
-
(0, $jTmF7$
|
|
467
|
+
(0, $jTmF7$useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
|
|
444
468
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
445
469
|
...otherProps,
|
|
446
470
|
id: undefined,
|
|
@@ -448,6 +472,9 @@ const $72e60046c03fbe42$export$74653c2d94c32cc3 = (0, $jTmF7$createLeafComponent
|
|
|
448
472
|
defaultClassName: 'react-aria-GridListLoadingIndicator',
|
|
449
473
|
values: null
|
|
450
474
|
});
|
|
475
|
+
// For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable
|
|
476
|
+
// Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the
|
|
477
|
+
// item count
|
|
451
478
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$react).Fragment, null, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
452
479
|
style: {
|
|
453
480
|
position: 'relative',
|
|
@@ -465,16 +492,75 @@ const $72e60046c03fbe42$export$74653c2d94c32cc3 = (0, $jTmF7$createLeafComponent
|
|
|
465
492
|
}
|
|
466
493
|
})), isLoading && renderProps.children && /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
467
494
|
...renderProps,
|
|
468
|
-
...(0, $jTmF7$
|
|
495
|
+
...(0, $jTmF7$filterDOMProps)(props, {
|
|
496
|
+
global: true
|
|
497
|
+
}),
|
|
469
498
|
role: "row",
|
|
470
|
-
"aria-rowindex": isVirtualized ? item.index + 1 : undefined,
|
|
471
499
|
ref: ref
|
|
472
500
|
}, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
473
501
|
"aria-colindex": isVirtualized ? 1 : undefined,
|
|
474
502
|
role: "gridcell"
|
|
475
503
|
}, renderProps.children)));
|
|
476
504
|
});
|
|
505
|
+
const $72e60046c03fbe42$export$f696877219115b14 = /*#__PURE__*/ (0, $jTmF7$createBranchComponent)((0, $jTmF7$SectionNode), (props, ref, item)=>{
|
|
506
|
+
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
507
|
+
let { CollectionBranch: CollectionBranch } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
508
|
+
let headingRef = (0, $jTmF7$useRef)(null);
|
|
509
|
+
ref = (0, $jTmF7$useObjectRef)(ref);
|
|
510
|
+
var _props_arialabel;
|
|
511
|
+
let { rowHeaderProps: rowHeaderProps, rowProps: rowProps, rowGroupProps: rowGroupProps } = (0, $jTmF7$useGridListSection)({
|
|
512
|
+
'aria-label': (_props_arialabel = props['aria-label']) !== null && _props_arialabel !== void 0 ? _props_arialabel : undefined
|
|
513
|
+
}, state, ref);
|
|
514
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
515
|
+
defaultClassName: 'react-aria-GridListSection',
|
|
516
|
+
className: props.className,
|
|
517
|
+
style: props.style,
|
|
518
|
+
values: {}
|
|
519
|
+
});
|
|
520
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
521
|
+
global: true
|
|
522
|
+
});
|
|
523
|
+
delete DOMProps.id;
|
|
524
|
+
return /*#__PURE__*/ (0, $jTmF7$react).createElement("section", {
|
|
525
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, rowGroupProps),
|
|
526
|
+
ref: ref
|
|
527
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
528
|
+
values: [
|
|
529
|
+
[
|
|
530
|
+
(0, $72a5793c14baf454$export$e0e4026c12a8bdbb),
|
|
531
|
+
{
|
|
532
|
+
...rowProps,
|
|
533
|
+
ref: headingRef
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
[
|
|
537
|
+
$72e60046c03fbe42$var$GridListHeaderContext,
|
|
538
|
+
{
|
|
539
|
+
...rowHeaderProps
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
]
|
|
543
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement(CollectionBranch, {
|
|
544
|
+
collection: state.collection,
|
|
545
|
+
parent: item
|
|
546
|
+
})));
|
|
547
|
+
});
|
|
548
|
+
const $72e60046c03fbe42$var$GridListHeaderContext = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
549
|
+
const $72e60046c03fbe42$export$1b574dbdb0075ff6 = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)((0, $jTmF7$HeaderNode), function Header(props, ref) {
|
|
550
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $72a5793c14baf454$export$e0e4026c12a8bdbb));
|
|
551
|
+
let rowHeaderProps = (0, $jTmF7$useContext)($72e60046c03fbe42$var$GridListHeaderContext);
|
|
552
|
+
return /*#__PURE__*/ (0, $jTmF7$react).createElement("header", {
|
|
553
|
+
className: "react-aria-GridListHeader",
|
|
554
|
+
ref: ref,
|
|
555
|
+
...props
|
|
556
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
557
|
+
...rowHeaderProps,
|
|
558
|
+
style: {
|
|
559
|
+
display: 'contents'
|
|
560
|
+
}
|
|
561
|
+
}, props.children));
|
|
562
|
+
});
|
|
477
563
|
|
|
478
564
|
|
|
479
|
-
export {$72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$
|
|
565
|
+
export {$72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$392b9a0bbc7c7e43 as GridListLoadMoreItem, $72e60046c03fbe42$export$f696877219115b14 as GridListSection, $72e60046c03fbe42$export$1b574dbdb0075ff6 as GridListHeader};
|
|
480
566
|
//# sourceMappingURL=GridList.module.js.map
|
package/dist/GridList.module.js
CHANGED
|
@@ -3,12 +3,14 @@ import {CheckboxContext as $4e85f108e88277b8$export$b085522c77523c51} from "./RS
|
|
|
3
3
|
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5, DefaultCollectionRenderer as $7135fc7d473fd974$export$a164736487e3f0ae} from "./Collection.module.js";
|
|
4
4
|
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
5
5
|
import {DragAndDropContext as $612b8eb6cb90e02d$export$d188a835a7bc5783, DropIndicatorContext as $612b8eb6cb90e02d$export$f55761759794cf55, useDndPersistedKeys as $612b8eb6cb90e02d$export$d1e8e3fbb7461f6, useRenderDropIndicator as $612b8eb6cb90e02d$export$971707d8a129a1f7} from "./DragAndDrop.module.js";
|
|
6
|
+
import {FieldInputContext as $8e6cc465cc68f603$export$698f465ec27e93df, SelectableCollectionContext as $8e6cc465cc68f603$export$b0d3ecf7112093a7} from "./context.module.js";
|
|
7
|
+
import {HeaderContext as $72a5793c14baf454$export$e0e4026c12a8bdbb} from "./Header.module.js";
|
|
6
8
|
import {ListStateContext as $eed445e0843c11d0$export$7c5906fe4f1f2af2} from "./ListBox.module.js";
|
|
7
9
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
|
|
8
|
-
import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKeyboardDelegate as $jTmF7$ListKeyboardDelegate, useGridList as $jTmF7$useGridList, useFocusRing as $jTmF7$useFocusRing, FocusScope as $jTmF7$FocusScope, mergeProps as $jTmF7$mergeProps, useGridListItem as $jTmF7$useGridListItem, useHover as $jTmF7$useHover, useGridListSelectionCheckbox as $jTmF7$useGridListSelectionCheckbox, useVisuallyHidden as $jTmF7$useVisuallyHidden} from "react-aria";
|
|
9
|
-
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent} from "@react-aria/collections";
|
|
10
|
-
import {useListState as $jTmF7$useListState} from "react-stately";
|
|
11
|
-
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef,
|
|
10
|
+
import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKeyboardDelegate as $jTmF7$ListKeyboardDelegate, useGridList as $jTmF7$useGridList, useFocusRing as $jTmF7$useFocusRing, FocusScope as $jTmF7$FocusScope, mergeProps as $jTmF7$mergeProps, useGridListItem as $jTmF7$useGridListItem, useHover as $jTmF7$useHover, useGridListSelectionCheckbox as $jTmF7$useGridListSelectionCheckbox, useVisuallyHidden as $jTmF7$useVisuallyHidden, useGridListSection as $jTmF7$useGridListSection} from "react-aria";
|
|
11
|
+
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent, ItemNode as $jTmF7$ItemNode, LoaderNode as $jTmF7$LoaderNode, createBranchComponent as $jTmF7$createBranchComponent, SectionNode as $jTmF7$SectionNode, HeaderNode as $jTmF7$HeaderNode} from "@react-aria/collections";
|
|
12
|
+
import {useListState as $jTmF7$useListState, UNSTABLE_useFilteredListState as $jTmF7$UNSTABLE_useFilteredListState} from "react-stately";
|
|
13
|
+
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef, useLoadMoreSentinel as $jTmF7$useLoadMoreSentinel, inertValue as $jTmF7$inertValue} from "@react-aria/utils";
|
|
12
14
|
import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF7$forwardRef, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect} from "react";
|
|
13
15
|
|
|
14
16
|
/*
|
|
@@ -33,6 +35,8 @@ import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF
|
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
|
38
|
+
|
|
39
|
+
|
|
36
40
|
const $72e60046c03fbe42$export$54fe942636b6416d = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
37
41
|
const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)(function GridList(props, ref) {
|
|
38
42
|
// Render the portal first so that we have the collection by the time we render the DOM in SSR.
|
|
@@ -46,23 +50,30 @@ const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwa
|
|
|
46
50
|
}));
|
|
47
51
|
});
|
|
48
52
|
function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
|
|
49
|
-
|
|
53
|
+
// TODO: for now, don't grab collection ref and collectionProps from the autocomplete, rely on the user tabbing to the gridlist
|
|
54
|
+
// figure out if we want to support virtual focus for grids when wrapped in an autocomplete
|
|
55
|
+
let contextProps;
|
|
56
|
+
[contextProps] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)({}, null, (0, $8e6cc465cc68f603$export$b0d3ecf7112093a7));
|
|
57
|
+
let { filter: filter, ...collectionProps } = contextProps;
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
+
let { shouldUseVirtualFocus: shouldUseVirtualFocus, disallowTypeAhead: disallowTypeAhead, ...DOMCollectionProps } = collectionProps || {};
|
|
50
60
|
let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
|
|
51
61
|
let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
52
|
-
let
|
|
62
|
+
let gridlistState = (0, $jTmF7$useListState)({
|
|
53
63
|
...props,
|
|
54
64
|
collection: collection,
|
|
55
65
|
children: undefined,
|
|
56
66
|
layoutDelegate: layoutDelegate
|
|
57
67
|
});
|
|
68
|
+
let filteredState = (0, $jTmF7$UNSTABLE_useFilteredListState)(gridlistState, filter);
|
|
58
69
|
let collator = (0, $jTmF7$useCollator)({
|
|
59
70
|
usage: 'search',
|
|
60
71
|
sensitivity: 'base'
|
|
61
72
|
});
|
|
62
|
-
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } =
|
|
73
|
+
let { disabledBehavior: disabledBehavior, disabledKeys: disabledKeys } = filteredState.selectionManager;
|
|
63
74
|
let { direction: direction } = (0, $jTmF7$useLocale)();
|
|
64
75
|
let keyboardDelegate = (0, $jTmF7$useMemo)(()=>new (0, $jTmF7$ListKeyboardDelegate)({
|
|
65
|
-
collection: collection,
|
|
76
|
+
collection: filteredState.collection,
|
|
66
77
|
collator: collator,
|
|
67
78
|
ref: ref,
|
|
68
79
|
disabledKeys: disabledKeys,
|
|
@@ -71,7 +82,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
71
82
|
layout: layout,
|
|
72
83
|
direction: direction
|
|
73
84
|
}), [
|
|
74
|
-
collection,
|
|
85
|
+
filteredState.collection,
|
|
75
86
|
ref,
|
|
76
87
|
layout,
|
|
77
88
|
disabledKeys,
|
|
@@ -82,13 +93,14 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
82
93
|
]);
|
|
83
94
|
let { gridProps: gridProps } = (0, $jTmF7$useGridList)({
|
|
84
95
|
...props,
|
|
96
|
+
...DOMCollectionProps,
|
|
85
97
|
keyboardDelegate: keyboardDelegate,
|
|
86
98
|
// Only tab navigation is supported in grid layout.
|
|
87
99
|
keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,
|
|
88
100
|
isVirtualized: isVirtualized,
|
|
89
101
|
shouldSelectOnPressUp: props.shouldSelectOnPressUp
|
|
90
|
-
},
|
|
91
|
-
let selectionManager =
|
|
102
|
+
}, filteredState, ref);
|
|
103
|
+
let selectionManager = filteredState.selectionManager;
|
|
92
104
|
let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
93
105
|
let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
|
|
94
106
|
let dragHooksProvided = (0, $jTmF7$useRef)(isListDraggable);
|
|
@@ -109,7 +121,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
109
121
|
let preview = (0, $jTmF7$useRef)(null);
|
|
110
122
|
if (isListDraggable && dragAndDropHooks) {
|
|
111
123
|
dragState = dragAndDropHooks.useDraggableCollectionState({
|
|
112
|
-
collection: collection,
|
|
124
|
+
collection: filteredState.collection,
|
|
113
125
|
selectionManager: selectionManager,
|
|
114
126
|
preview: dragAndDropHooks.renderDragPreview ? preview : undefined
|
|
115
127
|
});
|
|
@@ -121,11 +133,11 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
121
133
|
}
|
|
122
134
|
if (isListDroppable && dragAndDropHooks) {
|
|
123
135
|
dropState = dragAndDropHooks.useDroppableCollectionState({
|
|
124
|
-
collection: collection,
|
|
136
|
+
collection: filteredState.collection,
|
|
125
137
|
selectionManager: selectionManager
|
|
126
138
|
});
|
|
127
139
|
let keyboardDelegate = new (0, $jTmF7$ListKeyboardDelegate)({
|
|
128
|
-
collection: collection,
|
|
140
|
+
collection: filteredState.collection,
|
|
129
141
|
disabledKeys: selectionManager.disabledKeys,
|
|
130
142
|
disabledBehavior: selectionManager.disabledBehavior,
|
|
131
143
|
ref: ref
|
|
@@ -143,15 +155,14 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
143
155
|
});
|
|
144
156
|
}
|
|
145
157
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $jTmF7$useFocusRing)();
|
|
146
|
-
|
|
147
|
-
let isEmpty = state.collection.size === 0 || state.collection.size === 1 && ((_state_collection_getItem = state.collection.getItem(state.collection.getFirstKey())) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.type) === 'loader';
|
|
158
|
+
let isEmpty = filteredState.collection.size === 0;
|
|
148
159
|
let renderValues = {
|
|
149
160
|
isDropTarget: isRootDropTarget,
|
|
150
161
|
isEmpty: isEmpty,
|
|
151
162
|
isFocused: isFocused,
|
|
152
163
|
isFocusVisible: isFocusVisible,
|
|
153
164
|
layout: layout,
|
|
154
|
-
state:
|
|
165
|
+
state: filteredState
|
|
155
166
|
};
|
|
156
167
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
157
168
|
className: props.className,
|
|
@@ -176,10 +187,11 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
176
187
|
}
|
|
177
188
|
}, content));
|
|
178
189
|
}
|
|
190
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
191
|
+
global: true
|
|
192
|
+
});
|
|
179
193
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$FocusScope), null, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
180
|
-
...(0, $jTmF7$
|
|
181
|
-
...renderProps,
|
|
182
|
-
...(0, $jTmF7$mergeProps)(gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps, emptyStatePropOverrides),
|
|
194
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, gridProps, focusProps, droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps, emptyStatePropOverrides),
|
|
183
195
|
ref: ref,
|
|
184
196
|
slot: props.slot || undefined,
|
|
185
197
|
onScroll: props.onScroll,
|
|
@@ -192,7 +204,7 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
192
204
|
values: [
|
|
193
205
|
[
|
|
194
206
|
(0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),
|
|
195
|
-
|
|
207
|
+
filteredState
|
|
196
208
|
],
|
|
197
209
|
[
|
|
198
210
|
(0, $612b8eb6cb90e02d$export$d188a835a7bc5783),
|
|
@@ -210,13 +222,13 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
210
222
|
]
|
|
211
223
|
]
|
|
212
224
|
}, isListDroppable && /*#__PURE__*/ (0, $jTmF7$react).createElement($72e60046c03fbe42$var$RootDropIndicator, null), /*#__PURE__*/ (0, $jTmF7$react).createElement(CollectionRoot, {
|
|
213
|
-
collection: collection,
|
|
225
|
+
collection: filteredState.collection,
|
|
214
226
|
scrollRef: ref,
|
|
215
227
|
persistedKeys: (0, $612b8eb6cb90e02d$export$d1e8e3fbb7461f6)(selectionManager, dragAndDropHooks, dropState),
|
|
216
228
|
renderDropIndicator: (0, $612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
|
|
217
229
|
})), emptyState, dragPreview));
|
|
218
230
|
}
|
|
219
|
-
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)(
|
|
231
|
+
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)((0, $jTmF7$ItemNode), function GridListItem(props, forwardedRef, item) {
|
|
220
232
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
221
233
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $jTmF7$useContext)((0, $612b8eb6cb90e02d$export$d188a835a7bc5783));
|
|
222
234
|
let ref = (0, $jTmF7$useObjectRef)(forwardedRef);
|
|
@@ -281,6 +293,11 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
281
293
|
}, [
|
|
282
294
|
item.textValue
|
|
283
295
|
]);
|
|
296
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
297
|
+
global: true
|
|
298
|
+
});
|
|
299
|
+
delete DOMProps.id;
|
|
300
|
+
delete DOMProps.onClick;
|
|
284
301
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$react).Fragment, null, dropIndicator && !dropIndicator.isHidden && /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
285
302
|
role: "row",
|
|
286
303
|
style: {
|
|
@@ -294,8 +311,7 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
294
311
|
...dropIndicator === null || dropIndicator === void 0 ? void 0 : dropIndicator.dropIndicatorProps,
|
|
295
312
|
ref: dropIndicatorRef
|
|
296
313
|
}))), /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
297
|
-
...(0, $jTmF7$mergeProps)(
|
|
298
|
-
...renderProps,
|
|
314
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps),
|
|
299
315
|
ref: ref,
|
|
300
316
|
"data-selected": states.isSelected || undefined,
|
|
301
317
|
"data-disabled": states.isDisabled || undefined,
|
|
@@ -354,6 +370,14 @@ const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$creat
|
|
|
354
370
|
[
|
|
355
371
|
(0, $eed445e0843c11d0$export$7c5906fe4f1f2af2),
|
|
356
372
|
null
|
|
373
|
+
],
|
|
374
|
+
[
|
|
375
|
+
(0, $8e6cc465cc68f603$export$b0d3ecf7112093a7),
|
|
376
|
+
null
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
(0, $8e6cc465cc68f603$export$698f465ec27e93df),
|
|
380
|
+
null
|
|
357
381
|
]
|
|
358
382
|
]
|
|
359
383
|
}, renderProps.children))));
|
|
@@ -425,7 +449,7 @@ function $72e60046c03fbe42$var$RootDropIndicator() {
|
|
|
425
449
|
ref: ref
|
|
426
450
|
})));
|
|
427
451
|
}
|
|
428
|
-
const $72e60046c03fbe42$export$
|
|
452
|
+
const $72e60046c03fbe42$export$392b9a0bbc7c7e43 = (0, $jTmF7$createLeafComponent)((0, $jTmF7$LoaderNode), function GridListLoadingIndicator(props, ref, item) {
|
|
429
453
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
430
454
|
let { isVirtualized: isVirtualized } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
431
455
|
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset, ...otherProps } = props;
|
|
@@ -440,7 +464,7 @@ const $72e60046c03fbe42$export$74653c2d94c32cc3 = (0, $jTmF7$createLeafComponent
|
|
|
440
464
|
scrollOffset,
|
|
441
465
|
state === null || state === void 0 ? void 0 : state.collection
|
|
442
466
|
]);
|
|
443
|
-
(0, $jTmF7$
|
|
467
|
+
(0, $jTmF7$useLoadMoreSentinel)(memoedLoadMoreProps, sentinelRef);
|
|
444
468
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
445
469
|
...otherProps,
|
|
446
470
|
id: undefined,
|
|
@@ -448,6 +472,9 @@ const $72e60046c03fbe42$export$74653c2d94c32cc3 = (0, $jTmF7$createLeafComponent
|
|
|
448
472
|
defaultClassName: 'react-aria-GridListLoadingIndicator',
|
|
449
473
|
values: null
|
|
450
474
|
});
|
|
475
|
+
// For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable
|
|
476
|
+
// Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the
|
|
477
|
+
// item count
|
|
451
478
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$react).Fragment, null, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
452
479
|
style: {
|
|
453
480
|
position: 'relative',
|
|
@@ -465,16 +492,75 @@ const $72e60046c03fbe42$export$74653c2d94c32cc3 = (0, $jTmF7$createLeafComponent
|
|
|
465
492
|
}
|
|
466
493
|
})), isLoading && renderProps.children && /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
467
494
|
...renderProps,
|
|
468
|
-
...(0, $jTmF7$
|
|
495
|
+
...(0, $jTmF7$filterDOMProps)(props, {
|
|
496
|
+
global: true
|
|
497
|
+
}),
|
|
469
498
|
role: "row",
|
|
470
|
-
"aria-rowindex": isVirtualized ? item.index + 1 : undefined,
|
|
471
499
|
ref: ref
|
|
472
500
|
}, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
473
501
|
"aria-colindex": isVirtualized ? 1 : undefined,
|
|
474
502
|
role: "gridcell"
|
|
475
503
|
}, renderProps.children)));
|
|
476
504
|
});
|
|
505
|
+
const $72e60046c03fbe42$export$f696877219115b14 = /*#__PURE__*/ (0, $jTmF7$createBranchComponent)((0, $jTmF7$SectionNode), (props, ref, item)=>{
|
|
506
|
+
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
507
|
+
let { CollectionBranch: CollectionBranch } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
508
|
+
let headingRef = (0, $jTmF7$useRef)(null);
|
|
509
|
+
ref = (0, $jTmF7$useObjectRef)(ref);
|
|
510
|
+
var _props_arialabel;
|
|
511
|
+
let { rowHeaderProps: rowHeaderProps, rowProps: rowProps, rowGroupProps: rowGroupProps } = (0, $jTmF7$useGridListSection)({
|
|
512
|
+
'aria-label': (_props_arialabel = props['aria-label']) !== null && _props_arialabel !== void 0 ? _props_arialabel : undefined
|
|
513
|
+
}, state, ref);
|
|
514
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
515
|
+
defaultClassName: 'react-aria-GridListSection',
|
|
516
|
+
className: props.className,
|
|
517
|
+
style: props.style,
|
|
518
|
+
values: {}
|
|
519
|
+
});
|
|
520
|
+
let DOMProps = (0, $jTmF7$filterDOMProps)(props, {
|
|
521
|
+
global: true
|
|
522
|
+
});
|
|
523
|
+
delete DOMProps.id;
|
|
524
|
+
return /*#__PURE__*/ (0, $jTmF7$react).createElement("section", {
|
|
525
|
+
...(0, $jTmF7$mergeProps)(DOMProps, renderProps, rowGroupProps),
|
|
526
|
+
ref: ref
|
|
527
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
528
|
+
values: [
|
|
529
|
+
[
|
|
530
|
+
(0, $72a5793c14baf454$export$e0e4026c12a8bdbb),
|
|
531
|
+
{
|
|
532
|
+
...rowProps,
|
|
533
|
+
ref: headingRef
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
[
|
|
537
|
+
$72e60046c03fbe42$var$GridListHeaderContext,
|
|
538
|
+
{
|
|
539
|
+
...rowHeaderProps
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
]
|
|
543
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement(CollectionBranch, {
|
|
544
|
+
collection: state.collection,
|
|
545
|
+
parent: item
|
|
546
|
+
})));
|
|
547
|
+
});
|
|
548
|
+
const $72e60046c03fbe42$var$GridListHeaderContext = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
549
|
+
const $72e60046c03fbe42$export$1b574dbdb0075ff6 = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)((0, $jTmF7$HeaderNode), function Header(props, ref) {
|
|
550
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $72a5793c14baf454$export$e0e4026c12a8bdbb));
|
|
551
|
+
let rowHeaderProps = (0, $jTmF7$useContext)($72e60046c03fbe42$var$GridListHeaderContext);
|
|
552
|
+
return /*#__PURE__*/ (0, $jTmF7$react).createElement("header", {
|
|
553
|
+
className: "react-aria-GridListHeader",
|
|
554
|
+
ref: ref,
|
|
555
|
+
...props
|
|
556
|
+
}, /*#__PURE__*/ (0, $jTmF7$react).createElement("div", {
|
|
557
|
+
...rowHeaderProps,
|
|
558
|
+
style: {
|
|
559
|
+
display: 'contents'
|
|
560
|
+
}
|
|
561
|
+
}, props.children));
|
|
562
|
+
});
|
|
477
563
|
|
|
478
564
|
|
|
479
|
-
export {$72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$
|
|
565
|
+
export {$72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$392b9a0bbc7c7e43 as GridListLoadMoreItem, $72e60046c03fbe42$export$f696877219115b14 as GridListSection, $72e60046c03fbe42$export$1b574dbdb0075ff6 as GridListHeader};
|
|
480
566
|
//# sourceMappingURL=GridList.module.js.map
|