@react-aria/gridlist 3.7.6-nightly.4555 → 3.7.6-nightly.4560

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/module.js CHANGED
@@ -1,23 +1,8 @@
1
- import {useId as $13Gtr$useId, filterDOMProps as $13Gtr$filterDOMProps, mergeProps as $13Gtr$mergeProps, useSlotId as $13Gtr$useSlotId, chain as $13Gtr$chain, scrollIntoViewport as $13Gtr$scrollIntoViewport, getScrollParent as $13Gtr$getScrollParent, getSyntheticLinkProps as $13Gtr$getSyntheticLinkProps} from "@react-aria/utils";
2
- import {useHighlightSelectionDescription as $13Gtr$useHighlightSelectionDescription, useGridSelectionAnnouncement as $13Gtr$useGridSelectionAnnouncement, useGridSelectionCheckbox as $13Gtr$useGridSelectionCheckbox} from "@react-aria/grid";
3
- import {useHasTabbableChild as $13Gtr$useHasTabbableChild, focusSafely as $13Gtr$focusSafely, getFocusableTreeWalker as $13Gtr$getFocusableTreeWalker} from "@react-aria/focus";
4
- import {useSelectableList as $13Gtr$useSelectableList, useSelectableItem as $13Gtr$useSelectableItem} from "@react-aria/selection";
5
- import {getLastItem as $13Gtr$getLastItem} from "@react-stately/collections";
6
- import {useRef as $13Gtr$useRef} from "react";
7
- import {isFocusVisible as $13Gtr$isFocusVisible} from "@react-aria/interactions";
8
- import {useLocale as $13Gtr$useLocale} from "@react-aria/i18n";
1
+ import {useGridList as $f47efb0c3a859cf2$export$664f9155035607eb} from "./useGridList.module.js";
2
+ import {useGridListItem as $4e8b0456ef72939f$export$9610e69494fadfd2} from "./useGridListItem.module.js";
3
+ import {useGridListSelectionCheckbox as $e52ffc04a4adbd52$export$e29f2573fabbf7b9} from "./useGridListSelectionCheckbox.module.js";
9
4
 
10
5
  /*
11
- * Copyright 2022 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */ /*
21
6
  * Copyright 2022 Adobe. All rights reserved.
22
7
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
8
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -28,321 +13,6 @@ import {useLocale as $13Gtr$useLocale} from "@react-aria/i18n";
28
13
  * OF ANY KIND, either express or implied. See the License for the specific language
29
14
  * governing permissions and limitations under the License.
30
15
  */
31
- /*
32
- * Copyright 2020 Adobe. All rights reserved.
33
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
34
- * you may not use this file except in compliance with the License. You may obtain a copy
35
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
36
- *
37
- * Unless required by applicable law or agreed to in writing, software distributed under
38
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
39
- * OF ANY KIND, either express or implied. See the License for the specific language
40
- * governing permissions and limitations under the License.
41
- */ const $ce9b18daab526bbd$export$5b9bb410392e3991 = new WeakMap();
42
- function $ce9b18daab526bbd$export$f45c25170b9a99c2(state, key) {
43
- let { id: id } = $ce9b18daab526bbd$export$5b9bb410392e3991.get(state);
44
- if (!id) throw new Error("Unknown list");
45
- return `${id}-${$ce9b18daab526bbd$export$e0c709538cb8ae18(key)}`;
46
- }
47
- function $ce9b18daab526bbd$export$e0c709538cb8ae18(key) {
48
- if (typeof key === "string") return key.replace(/\s*/g, "");
49
- return "" + key;
50
- }
51
-
52
-
53
-
54
-
55
-
56
- function $f47efb0c3a859cf2$export$664f9155035607eb(props, state, ref) {
57
- let { isVirtualized: isVirtualized, keyboardDelegate: keyboardDelegate, onAction: onAction, linkBehavior: linkBehavior = "action" } = props;
58
- if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
59
- let { listProps: listProps } = (0, $13Gtr$useSelectableList)({
60
- selectionManager: state.selectionManager,
61
- collection: state.collection,
62
- disabledKeys: state.disabledKeys,
63
- ref: ref,
64
- keyboardDelegate: keyboardDelegate,
65
- isVirtualized: isVirtualized,
66
- selectOnFocus: state.selectionManager.selectionBehavior === "replace",
67
- shouldFocusWrap: props.shouldFocusWrap,
68
- linkBehavior: linkBehavior
69
- });
70
- let id = (0, $13Gtr$useId)(props.id);
71
- (0, $ce9b18daab526bbd$export$5b9bb410392e3991).set(state, {
72
- id: id,
73
- onAction: onAction,
74
- linkBehavior: linkBehavior
75
- });
76
- let descriptionProps = (0, $13Gtr$useHighlightSelectionDescription)({
77
- selectionManager: state.selectionManager,
78
- hasItemActions: !!onAction
79
- });
80
- let hasTabbableChild = (0, $13Gtr$useHasTabbableChild)(ref, {
81
- isDisabled: state.collection.size !== 0
82
- });
83
- let domProps = (0, $13Gtr$filterDOMProps)(props, {
84
- labelable: true
85
- });
86
- let gridProps = (0, $13Gtr$mergeProps)(domProps, {
87
- role: "grid",
88
- id: id,
89
- "aria-multiselectable": state.selectionManager.selectionMode === "multiple" ? "true" : undefined
90
- }, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
91
- state.collection.size === 0 ? {
92
- tabIndex: hasTabbableChild ? -1 : 0
93
- } : listProps, descriptionProps);
94
- if (isVirtualized) {
95
- gridProps["aria-rowcount"] = state.collection.size;
96
- gridProps["aria-colcount"] = 1;
97
- }
98
- (0, $13Gtr$useGridSelectionAnnouncement)({}, state);
99
- return {
100
- gridProps: gridProps
101
- };
102
- }
103
-
104
-
105
- /*
106
- * Copyright 2022 Adobe. All rights reserved.
107
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
108
- * you may not use this file except in compliance with the License. You may obtain a copy
109
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
110
- *
111
- * Unless required by applicable law or agreed to in writing, software distributed under
112
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
113
- * OF ANY KIND, either express or implied. See the License for the specific language
114
- * governing permissions and limitations under the License.
115
- */
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
- const $4e8b0456ef72939f$var$EXPANSION_KEYS = {
124
- "expand": {
125
- ltr: "ArrowRight",
126
- rtl: "ArrowLeft"
127
- },
128
- "collapse": {
129
- ltr: "ArrowLeft",
130
- rtl: "ArrowRight"
131
- }
132
- };
133
- function $4e8b0456ef72939f$export$9610e69494fadfd2(props, state, ref) {
134
- var _node_props, _node_props1;
135
- // Copied from useGridCell + some modifications to make it not so grid specific
136
- let { node: node, isVirtualized: isVirtualized, shouldSelectOnPressUp: shouldSelectOnPressUp } = props;
137
- let { direction: direction } = (0, $13Gtr$useLocale)();
138
- let { onAction: onAction, linkBehavior: linkBehavior } = (0, $ce9b18daab526bbd$export$5b9bb410392e3991).get(state);
139
- let descriptionId = (0, $13Gtr$useSlotId)();
140
- // We need to track the key of the item at the time it was last focused so that we force
141
- // focus to go to the item when the DOM node is reused for a different item in a virtualizer.
142
- let keyWhenFocused = (0, $13Gtr$useRef)(null);
143
- let focus = ()=>{
144
- var _ref_current;
145
- // Don't shift focus to the row if the active element is a element within the row already
146
- // (e.g. clicking on a row button)
147
- if (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(document.activeElement))) (0, $13Gtr$focusSafely)(ref.current);
148
- };
149
- let treeGridRowProps = {};
150
- let hasChildRows;
151
- let hasLink = state.selectionManager.isLink(node.key);
152
- if (node != null && "expandedKeys" in state) {
153
- // TODO: ideally node.hasChildNodes would be a way to tell if a row has child nodes, but the row's contents make it so that value is always
154
- // true...
155
- hasChildRows = [
156
- ...state.collection.getChildren(node.key)
157
- ].length > 1;
158
- if (onAction == null && !hasLink && state.selectionManager.selectionMode === "none" && hasChildRows) onAction = ()=>state.toggleKey(node.key);
159
- let isExpanded = hasChildRows ? state.expandedKeys.has(node.key) : undefined;
160
- treeGridRowProps = {
161
- "aria-expanded": isExpanded,
162
- "aria-level": node.level + 1,
163
- "aria-posinset": (node === null || node === void 0 ? void 0 : node.index) + 1,
164
- "aria-setsize": node.level > 0 ? (0, $13Gtr$getLastItem)(state.collection.getChildren(node === null || node === void 0 ? void 0 : node.parentKey)).index + 1 : [
165
- ...state.collection
166
- ].filter((row)=>row.level === 0).at(-1).index + 1
167
- };
168
- }
169
- let { itemProps: itemProps, ...itemStates } = (0, $13Gtr$useSelectableItem)({
170
- selectionManager: state.selectionManager,
171
- key: node.key,
172
- ref: ref,
173
- isVirtualized: isVirtualized,
174
- shouldSelectOnPressUp: shouldSelectOnPressUp,
175
- onAction: onAction || ((_node_props = node.props) === null || _node_props === void 0 ? void 0 : _node_props.onAction) ? (0, $13Gtr$chain)((_node_props1 = node.props) === null || _node_props1 === void 0 ? void 0 : _node_props1.onAction, onAction ? ()=>onAction(node.key) : undefined) : undefined,
176
- focus: focus,
177
- linkBehavior: linkBehavior
178
- });
179
- let onKeyDown = (e)=>{
180
- if (!e.currentTarget.contains(e.target)) return;
181
- let walker = (0, $13Gtr$getFocusableTreeWalker)(ref.current);
182
- walker.currentNode = document.activeElement;
183
- if ("expandedKeys" in state && document.activeElement === ref.current) {
184
- if (e.key === $4e8b0456ef72939f$var$EXPANSION_KEYS["expand"][direction] && state.selectionManager.focusedKey === node.key && hasChildRows && !state.expandedKeys.has(node.key)) {
185
- state.toggleKey(node.key);
186
- e.stopPropagation();
187
- return;
188
- } else if (e.key === $4e8b0456ef72939f$var$EXPANSION_KEYS["collapse"][direction] && state.selectionManager.focusedKey === node.key && hasChildRows && state.expandedKeys.has(node.key)) {
189
- state.toggleKey(node.key);
190
- e.stopPropagation();
191
- return;
192
- }
193
- }
194
- switch(e.key){
195
- case "ArrowLeft":
196
- {
197
- // Find the next focusable element within the row.
198
- let focusable = direction === "rtl" ? walker.nextNode() : walker.previousNode();
199
- if (focusable) {
200
- e.preventDefault();
201
- e.stopPropagation();
202
- (0, $13Gtr$focusSafely)(focusable);
203
- (0, $13Gtr$scrollIntoViewport)(focusable, {
204
- containingElement: (0, $13Gtr$getScrollParent)(ref.current)
205
- });
206
- } else {
207
- // If there is no next focusable child, then return focus back to the row
208
- e.preventDefault();
209
- e.stopPropagation();
210
- if (direction === "rtl") {
211
- (0, $13Gtr$focusSafely)(ref.current);
212
- (0, $13Gtr$scrollIntoViewport)(ref.current, {
213
- containingElement: (0, $13Gtr$getScrollParent)(ref.current)
214
- });
215
- } else {
216
- walker.currentNode = ref.current;
217
- let lastElement = $4e8b0456ef72939f$var$last(walker);
218
- if (lastElement) {
219
- (0, $13Gtr$focusSafely)(lastElement);
220
- (0, $13Gtr$scrollIntoViewport)(lastElement, {
221
- containingElement: (0, $13Gtr$getScrollParent)(ref.current)
222
- });
223
- }
224
- }
225
- }
226
- break;
227
- }
228
- case "ArrowRight":
229
- {
230
- let focusable = direction === "rtl" ? walker.previousNode() : walker.nextNode();
231
- if (focusable) {
232
- e.preventDefault();
233
- e.stopPropagation();
234
- (0, $13Gtr$focusSafely)(focusable);
235
- (0, $13Gtr$scrollIntoViewport)(focusable, {
236
- containingElement: (0, $13Gtr$getScrollParent)(ref.current)
237
- });
238
- } else {
239
- e.preventDefault();
240
- e.stopPropagation();
241
- if (direction === "ltr") {
242
- (0, $13Gtr$focusSafely)(ref.current);
243
- (0, $13Gtr$scrollIntoViewport)(ref.current, {
244
- containingElement: (0, $13Gtr$getScrollParent)(ref.current)
245
- });
246
- } else {
247
- walker.currentNode = ref.current;
248
- let lastElement = $4e8b0456ef72939f$var$last(walker);
249
- if (lastElement) {
250
- (0, $13Gtr$focusSafely)(lastElement);
251
- (0, $13Gtr$scrollIntoViewport)(lastElement, {
252
- containingElement: (0, $13Gtr$getScrollParent)(ref.current)
253
- });
254
- }
255
- }
256
- }
257
- break;
258
- }
259
- case "ArrowUp":
260
- case "ArrowDown":
261
- // Prevent this event from reaching row children, e.g. menu buttons. We want arrow keys to navigate
262
- // to the row above/below instead. We need to re-dispatch the event from a higher parent so it still
263
- // bubbles and gets handled by useSelectableCollection.
264
- if (!e.altKey && ref.current.contains(e.target)) {
265
- e.stopPropagation();
266
- e.preventDefault();
267
- ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
268
- }
269
- break;
270
- }
271
- };
272
- let onFocus = (e)=>{
273
- keyWhenFocused.current = node.key;
274
- if (e.target !== ref.current) {
275
- // useSelectableItem only handles setting the focused key when
276
- // the focused element is the row itself. We also want to
277
- // set the focused key when a child element receives focus.
278
- // If focus is currently visible (e.g. the user is navigating with the keyboard),
279
- // then skip this. We want to restore focus to the previously focused row
280
- // in that case since the list should act like a single tab stop.
281
- if (!(0, $13Gtr$isFocusVisible)()) state.selectionManager.setFocusedKey(node.key);
282
- return;
283
- }
284
- };
285
- let linkProps = itemStates.hasAction ? (0, $13Gtr$getSyntheticLinkProps)(node.props) : {};
286
- let rowProps = (0, $13Gtr$mergeProps)(itemProps, linkProps, {
287
- role: "row",
288
- onKeyDownCapture: onKeyDown,
289
- onFocus: onFocus,
290
- "aria-label": node.textValue || undefined,
291
- "aria-selected": state.selectionManager.canSelectItem(node.key) ? state.selectionManager.isSelected(node.key) : undefined,
292
- "aria-disabled": state.selectionManager.isDisabled(node.key) || undefined,
293
- "aria-labelledby": descriptionId && node.textValue ? `${(0, $ce9b18daab526bbd$export$f45c25170b9a99c2)(state, node.key)} ${descriptionId}` : undefined,
294
- id: (0, $ce9b18daab526bbd$export$f45c25170b9a99c2)(state, node.key)
295
- });
296
- if (isVirtualized) rowProps["aria-rowindex"] = node.index + 1;
297
- let gridCellProps = {
298
- role: "gridcell",
299
- "aria-colindex": 1
300
- };
301
- // TODO: should isExpanded and hasChildRows be a item state that gets returned by the hook?
302
- return {
303
- rowProps: {
304
- ...(0, $13Gtr$mergeProps)(rowProps, treeGridRowProps)
305
- },
306
- gridCellProps: gridCellProps,
307
- descriptionProps: {
308
- id: descriptionId
309
- },
310
- ...itemStates
311
- };
312
- }
313
- function $4e8b0456ef72939f$var$last(walker) {
314
- let next;
315
- let last;
316
- do {
317
- last = walker.lastChild();
318
- if (last) next = last;
319
- }while (last);
320
- return next;
321
- }
322
-
323
-
324
- /*
325
- * Copyright 2022 Adobe. All rights reserved.
326
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
327
- * you may not use this file except in compliance with the License. You may obtain a copy
328
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
329
- *
330
- * Unless required by applicable law or agreed to in writing, software distributed under
331
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
332
- * OF ANY KIND, either express or implied. See the License for the specific language
333
- * governing permissions and limitations under the License.
334
- */
335
-
336
- function $e52ffc04a4adbd52$export$e29f2573fabbf7b9(props, state) {
337
- let { key: key } = props;
338
- const { checkboxProps: checkboxProps } = (0, $13Gtr$useGridSelectionCheckbox)(props, state);
339
- return {
340
- checkboxProps: {
341
- ...checkboxProps,
342
- "aria-labelledby": `${checkboxProps.id} ${(0, $ce9b18daab526bbd$export$f45c25170b9a99c2)(state, key)}`
343
- }
344
- };
345
- }
346
16
 
347
17
 
348
18
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC,GAaM,MAAM,4CAAU,IAAI;AAEpB,SAAS,0CAAY,KAAmB,EAAE,GAAQ;IACvD,IAAI,MAAC,EAAE,EAAC,GAAG,0CAAQ,GAAG,CAAC;IACvB,IAAI,CAAC,IACH,MAAM,IAAI,MAAM;IAGlB,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,0CAAa,KAAK,CAAC;AACrC;AAEO,SAAS,0CAAa,GAAQ;IACnC,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;;;;;;ADqCO,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,G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OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,yCAAO,EAAE,OAAO,KAAK,CAAC;QAClE;IACF;AACF;;","sources":["packages/@react-aria/gridlist/src/index.ts","packages/@react-aria/gridlist/src/useGridList.ts","packages/@react-aria/gridlist/src/utils.ts","packages/@react-aria/gridlist/src/useGridListItem.ts","packages/@react-aria/gridlist/src/useGridListSelectionCheckbox.ts"],"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\nexport {useGridList} from './useGridList';\nexport {useGridListItem} from './useGridListItem';\nexport {useGridListSelectionCheckbox} from './useGridListSelectionCheckbox';\n\nexport type {AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps} from './useGridList';\nexport type {AriaGridListItemOptions, GridListItemAria} from './useGridListItem';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from '@react-aria/grid';\n","/*\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 {\n AriaLabelingProps,\n CollectionBase,\n DisabledBehavior,\n DOMAttributes,\n DOMProps,\n Key,\n KeyboardDelegate,\n MultipleSelection\n} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {listMap} from './utils';\nimport {ListState} from '@react-stately/list';\nimport {RefObject} from 'react';\nimport {useGridSelectionAnnouncement, useHighlightSelectionDescription} from '@react-aria/grid';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface GridListProps<T> extends CollectionBase<T>, MultipleSelection {\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void,\n /** Whether `disabledKeys` applies to all interactions, or only selection. */\n disabledBehavior?: DisabledBehavior\n}\n\nexport interface AriaGridListProps<T> extends GridListProps<T>, DOMProps, AriaLabelingProps {}\n\nexport interface AriaGridListOptions<T> extends Omit<AriaGridListProps<T>, 'children'> {\n /** Whether the list uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'action'\n */\n linkBehavior?: 'action' | 'selection' | 'override'\n}\n\nexport interface GridListAria {\n /** Props for the grid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a list component with interactive children.\n * A grid list displays data in a single column and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the list.\n * @param state - State for the list, as returned by `useListState`.\n * @param ref - The ref attached to the list element.\n */\nexport function useGridList<T>(props: AriaGridListOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): GridListAria {\n let {\n isVirtualized,\n keyboardDelegate,\n onAction,\n linkBehavior = 'action'\n } = props;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n let {listProps} = useSelectableList({\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref,\n keyboardDelegate: keyboardDelegate,\n isVirtualized,\n selectOnFocus: state.selectionManager.selectionBehavior === 'replace',\n shouldFocusWrap: props.shouldFocusWrap,\n linkBehavior\n });\n\n let id = useId(props.id);\n listMap.set(state, {id, onAction, linkBehavior});\n\n let descriptionProps = useHighlightSelectionDescription({\n selectionManager: state.selectionManager,\n hasItemActions: !!onAction\n });\n\n let hasTabbableChild = useHasTabbableChild(ref, {\n isDisabled: state.collection.size !== 0\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n let gridProps: DOMAttributes = mergeProps(\n domProps,\n {\n role: 'grid',\n id,\n 'aria-multiselectable': state.selectionManager.selectionMode === 'multiple' ? 'true' : undefined\n },\n // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.\n state.collection.size === 0 ? {tabIndex: hasTabbableChild ? -1 : 0} : listProps,\n descriptionProps\n );\n\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size;\n gridProps['aria-colcount'] = 1;\n }\n\n useGridSelectionAnnouncement({}, state);\n\n return {\n gridProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from '@react-types/shared';\nimport type {ListState} from '@react-stately/list';\n\ninterface ListMapShared {\n id: string,\n onAction: (key: Key) => void,\n linkBehavior?: 'action' | 'selection' | 'override'\n}\n\n// Used to share:\n// id of the list and onAction between useList, useListItem, and useListSelectionCheckbox\nexport const listMap = new WeakMap<ListState<unknown>, ListMapShared>();\n\nexport function getRowId<T>(state: ListState<T>, key: Key) {\n let {id} = listMap.get(state);\n if (!id) {\n throw new Error('Unknown list');\n }\n\n return `${id}-${normalizeKey(key)}`;\n}\n\nexport function normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n","/*\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 {chain, getScrollParent, getSyntheticLinkProps, mergeProps, scrollIntoViewport, useSlotId} from '@react-aria/utils';\nimport {DOMAttributes, FocusableElement, Node as RSNode} from '@react-types/shared';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {getLastItem} from '@react-stately/collections';\nimport {getRowId, listMap} from './utils';\nimport {HTMLAttributes, KeyboardEvent as ReactKeyboardEvent, RefObject, useRef} from 'react';\nimport {isFocusVisible} from '@react-aria/interactions';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\nimport type {TreeState} from '@react-stately/tree';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface AriaGridListItemOptions {\n /** An object representing the list item. Contains all the relevant information that makes up the list row. */\n node: RSNode<unknown>,\n /** Whether the list row is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean\n}\n\nexport interface GridListItemAria extends SelectableItemStates {\n /** Props for the list row element. */\n rowProps: DOMAttributes,\n /** Props for the grid cell element within the list row. */\n gridCellProps: DOMAttributes,\n /** Props for the list item description element, if any. */\n descriptionProps: DOMAttributes\n}\n\nconst EXPANSION_KEYS = {\n 'expand': {\n ltr: 'ArrowRight',\n rtl: 'ArrowLeft'\n },\n 'collapse': {\n ltr: 'ArrowLeft',\n rtl: 'ArrowRight'\n }\n};\n\n/**\n * Provides the behavior and accessibility implementation for a row in a grid list.\n * @param props - Props for the row.\n * @param state - State of the parent list, as returned by `useListState`.\n * @param ref - The ref attached to the row element.\n */\nexport function useGridListItem<T>(props: AriaGridListItemOptions, state: ListState<T> | TreeState<T>, ref: RefObject<FocusableElement>): GridListItemAria {\n // Copied from useGridCell + some modifications to make it not so grid specific\n let {\n node,\n isVirtualized,\n shouldSelectOnPressUp\n } = props;\n\n let {direction} = useLocale();\n let {onAction, linkBehavior} = listMap.get(state);\n let descriptionId = useSlotId();\n\n // We need to track the key of the item at the time it was last focused so that we force\n // focus to go to the item when the DOM node is reused for a different item in a virtualizer.\n let keyWhenFocused = useRef(null);\n let focus = () => {\n // Don't shift focus to the row if the active element is a element within the row already\n // (e.g. clicking on a row button)\n if (\n (keyWhenFocused.current != null && node.key !== keyWhenFocused.current) ||\n !ref.current?.contains(document.activeElement)\n ) {\n focusSafely(ref.current);\n }\n };\n\n let treeGridRowProps: HTMLAttributes<HTMLElement> = {};\n let hasChildRows;\n let hasLink = state.selectionManager.isLink(node.key);\n if (node != null && 'expandedKeys' in state) {\n // TODO: ideally node.hasChildNodes would be a way to tell if a row has child nodes, but the row's contents make it so that value is always\n // true...\n hasChildRows = [...state.collection.getChildren(node.key)].length > 1;\n if (onAction == null && !hasLink && state.selectionManager.selectionMode === 'none' && hasChildRows) {\n onAction = () => state.toggleKey(node.key);\n }\n\n let isExpanded = hasChildRows ? state.expandedKeys.has(node.key) : undefined;\n treeGridRowProps = {\n 'aria-expanded': isExpanded,\n 'aria-level': node.level + 1,\n 'aria-posinset': node?.index + 1,\n 'aria-setsize': node.level > 0 ?\n (getLastItem(state.collection.getChildren(node?.parentKey))).index + 1 :\n [...state.collection].filter(row => row.level === 0).at(-1).index + 1\n };\n }\n\n let {itemProps, ...itemStates} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n shouldSelectOnPressUp,\n onAction: onAction || node.props?.onAction ? chain(node.props?.onAction, onAction ? () => onAction(node.key) : undefined) : undefined,\n focus,\n linkBehavior\n });\n\n let onKeyDown = (e: ReactKeyboardEvent) => {\n if (!e.currentTarget.contains(e.target as Element)) {\n return;\n }\n\n let walker = getFocusableTreeWalker(ref.current);\n walker.currentNode = document.activeElement;\n\n if ('expandedKeys' in state && document.activeElement === ref.current) {\n if ((e.key === EXPANSION_KEYS['expand'][direction]) && state.selectionManager.focusedKey === node.key && hasChildRows && !state.expandedKeys.has(node.key)) {\n state.toggleKey(node.key);\n e.stopPropagation();\n return;\n } else if ((e.key === EXPANSION_KEYS['collapse'][direction]) && state.selectionManager.focusedKey === node.key && hasChildRows && state.expandedKeys.has(node.key)) {\n state.toggleKey(node.key);\n e.stopPropagation();\n return;\n }\n }\n\n switch (e.key) {\n case 'ArrowLeft': {\n // Find the next focusable element within the row.\n let focusable = direction === 'rtl'\n ? walker.nextNode() as FocusableElement\n : walker.previousNode() as FocusableElement;\n\n if (focusable) {\n e.preventDefault();\n e.stopPropagation();\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n // If there is no next focusable child, then return focus back to the row\n e.preventDefault();\n e.stopPropagation();\n if (direction === 'rtl') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n let lastElement = last(walker);\n if (lastElement) {\n focusSafely(lastElement);\n scrollIntoViewport(lastElement, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowRight': {\n let focusable = direction === 'rtl'\n ? walker.previousNode() as FocusableElement\n : walker.nextNode() as FocusableElement;\n\n if (focusable) {\n e.preventDefault();\n e.stopPropagation();\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n e.preventDefault();\n e.stopPropagation();\n if (direction === 'ltr') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n let lastElement = last(walker);\n if (lastElement) {\n focusSafely(lastElement);\n scrollIntoViewport(lastElement, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n // Prevent this event from reaching row children, e.g. menu buttons. We want arrow keys to navigate\n // to the row above/below instead. We need to re-dispatch the event from a higher parent so it still\n // bubbles and gets handled by useSelectableCollection.\n if (!e.altKey && ref.current.contains(e.target as Element)) {\n e.stopPropagation();\n e.preventDefault();\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n }\n break;\n }\n };\n\n let onFocus = (e) => {\n keyWhenFocused.current = node.key;\n if (e.target !== ref.current) {\n // useSelectableItem only handles setting the focused key when\n // the focused element is the row itself. We also want to\n // set the focused key when a child element receives focus.\n // If focus is currently visible (e.g. the user is navigating with the keyboard),\n // then skip this. We want to restore focus to the previously focused row\n // in that case since the list should act like a single tab stop.\n if (!isFocusVisible()) {\n state.selectionManager.setFocusedKey(node.key);\n }\n return;\n }\n };\n\n let linkProps = itemStates.hasAction ? getSyntheticLinkProps(node.props) : {};\n let rowProps: DOMAttributes = mergeProps(itemProps, linkProps, {\n role: 'row',\n onKeyDownCapture: onKeyDown,\n onFocus,\n 'aria-label': node.textValue || undefined,\n 'aria-selected': state.selectionManager.canSelectItem(node.key) ? state.selectionManager.isSelected(node.key) : undefined,\n 'aria-disabled': state.selectionManager.isDisabled(node.key) || undefined,\n 'aria-labelledby': descriptionId && node.textValue ? `${getRowId(state, node.key)} ${descriptionId}` : undefined,\n id: getRowId(state, node.key)\n });\n\n if (isVirtualized) {\n rowProps['aria-rowindex'] = node.index + 1;\n }\n\n let gridCellProps = {\n role: 'gridcell',\n 'aria-colindex': 1\n };\n\n // TODO: should isExpanded and hasChildRows be a item state that gets returned by the hook?\n return {\n rowProps: {...mergeProps(rowProps, treeGridRowProps)},\n gridCellProps,\n descriptionProps: {\n id: descriptionId\n },\n ...itemStates\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","/*\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 {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria, useGridSelectionCheckbox} from '@react-aria/grid';\nimport {getRowId} from './utils';\nimport type {ListState} from '@react-stately/list';\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a grid list.\n * @param props - Props for the selection checkbox.\n * @param state - State of the list, as returned by `useListState`.\n */\nexport function useGridListSelectionCheckbox<T>(props: AriaGridSelectionCheckboxProps, state: ListState<T>): GridSelectionCheckboxAria {\n let {key} = props;\n const {checkboxProps} = useGridSelectionCheckbox(props, state as any);\n\n return {\n checkboxProps: {\n ...checkboxProps,\n 'aria-labelledby': `${checkboxProps.id} ${getRowId(state, key)}`\n }\n };\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/gridlist/src/index.ts"],"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\nexport {useGridList} from './useGridList';\nexport {useGridListItem} from './useGridListItem';\nexport {useGridListSelectionCheckbox} from './useGridListSelectionCheckbox';\n\nexport type {AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps} from './useGridList';\nexport type {AriaGridListItemOptions, GridListItemAria} from './useGridListItem';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from '@react-aria/grid';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,77 @@
1
+ var $7db02799adae605d$exports = require("./utils.main.js");
2
+ var $i2dnl$reactariautils = require("@react-aria/utils");
3
+ var $i2dnl$reactariagrid = require("@react-aria/grid");
4
+ var $i2dnl$reactariafocus = require("@react-aria/focus");
5
+ var $i2dnl$reactariaselection = require("@react-aria/selection");
6
+
7
+
8
+ function $parcel$export(e, n, v, s) {
9
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
+ }
11
+
12
+ $parcel$export(module.exports, "useGridList", () => $acf209ae814f1c93$export$664f9155035607eb);
13
+ /*
14
+ * Copyright 2022 Adobe. All rights reserved.
15
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License. You may obtain a copy
17
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software distributed under
20
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
+ * OF ANY KIND, either express or implied. See the License for the specific language
22
+ * governing permissions and limitations under the License.
23
+ */
24
+
25
+
26
+
27
+
28
+ function $acf209ae814f1c93$export$664f9155035607eb(props, state, ref) {
29
+ let { isVirtualized: isVirtualized, keyboardDelegate: keyboardDelegate, onAction: onAction, linkBehavior: linkBehavior = "action" } = props;
30
+ if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
31
+ let { listProps: listProps } = (0, $i2dnl$reactariaselection.useSelectableList)({
32
+ selectionManager: state.selectionManager,
33
+ collection: state.collection,
34
+ disabledKeys: state.disabledKeys,
35
+ ref: ref,
36
+ keyboardDelegate: keyboardDelegate,
37
+ isVirtualized: isVirtualized,
38
+ selectOnFocus: state.selectionManager.selectionBehavior === "replace",
39
+ shouldFocusWrap: props.shouldFocusWrap,
40
+ linkBehavior: linkBehavior
41
+ });
42
+ let id = (0, $i2dnl$reactariautils.useId)(props.id);
43
+ (0, $7db02799adae605d$exports.listMap).set(state, {
44
+ id: id,
45
+ onAction: onAction,
46
+ linkBehavior: linkBehavior
47
+ });
48
+ let descriptionProps = (0, $i2dnl$reactariagrid.useHighlightSelectionDescription)({
49
+ selectionManager: state.selectionManager,
50
+ hasItemActions: !!onAction
51
+ });
52
+ let hasTabbableChild = (0, $i2dnl$reactariafocus.useHasTabbableChild)(ref, {
53
+ isDisabled: state.collection.size !== 0
54
+ });
55
+ let domProps = (0, $i2dnl$reactariautils.filterDOMProps)(props, {
56
+ labelable: true
57
+ });
58
+ let gridProps = (0, $i2dnl$reactariautils.mergeProps)(domProps, {
59
+ role: "grid",
60
+ id: id,
61
+ "aria-multiselectable": state.selectionManager.selectionMode === "multiple" ? "true" : undefined
62
+ }, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
63
+ state.collection.size === 0 ? {
64
+ tabIndex: hasTabbableChild ? -1 : 0
65
+ } : listProps, descriptionProps);
66
+ if (isVirtualized) {
67
+ gridProps["aria-rowcount"] = state.collection.size;
68
+ gridProps["aria-colcount"] = 1;
69
+ }
70
+ (0, $i2dnl$reactariagrid.useGridSelectionAnnouncement)({}, state);
71
+ return {
72
+ gridProps: gridProps
73
+ };
74
+ }
75
+
76
+
77
+ //# sourceMappingURL=useGridList.main.js.map
@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GAAG,MAAM,UAAU,CAAC,IAAI;QAClD,SAAS,CAAC,gBAAgB,GAAG;IAC/B;IAEA,CAAA,GAAA,iDAA2B,EAAE,CAAC,GAAG;IAEjC,OAAO;mBACL;IACF;AACF","sources":["packages/@react-aria/gridlist/src/useGridList.ts"],"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 {\n AriaLabelingProps,\n CollectionBase,\n DisabledBehavior,\n DOMAttributes,\n DOMProps,\n Key,\n KeyboardDelegate,\n MultipleSelection\n} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {listMap} from './utils';\nimport {ListState} from '@react-stately/list';\nimport {RefObject} from 'react';\nimport {useGridSelectionAnnouncement, useHighlightSelectionDescription} from '@react-aria/grid';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useSelectableList} from '@react-aria/selection';\n\nexport interface GridListProps<T> extends CollectionBase<T>, MultipleSelection {\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void,\n /** Whether `disabledKeys` applies to all interactions, or only selection. */\n disabledBehavior?: DisabledBehavior\n}\n\nexport interface AriaGridListProps<T> extends GridListProps<T>, DOMProps, AriaLabelingProps {}\n\nexport interface AriaGridListOptions<T> extends Omit<AriaGridListProps<T>, 'children'> {\n /** Whether the list uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether focus should wrap around when the end/start is reached.\n * @default false\n */\n shouldFocusWrap?: boolean,\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'action'\n */\n linkBehavior?: 'action' | 'selection' | 'override'\n}\n\nexport interface GridListAria {\n /** Props for the grid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a list component with interactive children.\n * A grid list displays data in a single column and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the list.\n * @param state - State for the list, as returned by `useListState`.\n * @param ref - The ref attached to the list element.\n */\nexport function useGridList<T>(props: AriaGridListOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): GridListAria {\n let {\n isVirtualized,\n keyboardDelegate,\n onAction,\n linkBehavior = 'action'\n } = props;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n let {listProps} = useSelectableList({\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref,\n keyboardDelegate: keyboardDelegate,\n isVirtualized,\n selectOnFocus: state.selectionManager.selectionBehavior === 'replace',\n shouldFocusWrap: props.shouldFocusWrap,\n linkBehavior\n });\n\n let id = useId(props.id);\n listMap.set(state, {id, onAction, linkBehavior});\n\n let descriptionProps = useHighlightSelectionDescription({\n selectionManager: state.selectionManager,\n hasItemActions: !!onAction\n });\n\n let hasTabbableChild = useHasTabbableChild(ref, {\n isDisabled: state.collection.size !== 0\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n let gridProps: DOMAttributes = mergeProps(\n domProps,\n {\n role: 'grid',\n id,\n 'aria-multiselectable': state.selectionManager.selectionMode === 'multiple' ? 'true' : undefined\n },\n // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.\n state.collection.size === 0 ? {tabIndex: hasTabbableChild ? -1 : 0} : listProps,\n descriptionProps\n );\n\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size;\n gridProps['aria-colcount'] = 1;\n }\n\n useGridSelectionAnnouncement({}, state);\n\n return {\n gridProps\n };\n}\n"],"names":[],"version":3,"file":"useGridList.main.js.map"}
@@ -0,0 +1,72 @@
1
+ import {listMap as $ce9b18daab526bbd$export$5b9bb410392e3991} from "./utils.mjs";
2
+ import {useId as $lnALe$useId, filterDOMProps as $lnALe$filterDOMProps, mergeProps as $lnALe$mergeProps} from "@react-aria/utils";
3
+ import {useHighlightSelectionDescription as $lnALe$useHighlightSelectionDescription, useGridSelectionAnnouncement as $lnALe$useGridSelectionAnnouncement} from "@react-aria/grid";
4
+ import {useHasTabbableChild as $lnALe$useHasTabbableChild} from "@react-aria/focus";
5
+ import {useSelectableList as $lnALe$useSelectableList} from "@react-aria/selection";
6
+
7
+ /*
8
+ * Copyright 2022 Adobe. All rights reserved.
9
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License. You may obtain a copy
11
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software distributed under
14
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
+ * OF ANY KIND, either express or implied. See the License for the specific language
16
+ * governing permissions and limitations under the License.
17
+ */
18
+
19
+
20
+
21
+
22
+ function $f47efb0c3a859cf2$export$664f9155035607eb(props, state, ref) {
23
+ let { isVirtualized: isVirtualized, keyboardDelegate: keyboardDelegate, onAction: onAction, linkBehavior: linkBehavior = "action" } = props;
24
+ if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
25
+ let { listProps: listProps } = (0, $lnALe$useSelectableList)({
26
+ selectionManager: state.selectionManager,
27
+ collection: state.collection,
28
+ disabledKeys: state.disabledKeys,
29
+ ref: ref,
30
+ keyboardDelegate: keyboardDelegate,
31
+ isVirtualized: isVirtualized,
32
+ selectOnFocus: state.selectionManager.selectionBehavior === "replace",
33
+ shouldFocusWrap: props.shouldFocusWrap,
34
+ linkBehavior: linkBehavior
35
+ });
36
+ let id = (0, $lnALe$useId)(props.id);
37
+ (0, $ce9b18daab526bbd$export$5b9bb410392e3991).set(state, {
38
+ id: id,
39
+ onAction: onAction,
40
+ linkBehavior: linkBehavior
41
+ });
42
+ let descriptionProps = (0, $lnALe$useHighlightSelectionDescription)({
43
+ selectionManager: state.selectionManager,
44
+ hasItemActions: !!onAction
45
+ });
46
+ let hasTabbableChild = (0, $lnALe$useHasTabbableChild)(ref, {
47
+ isDisabled: state.collection.size !== 0
48
+ });
49
+ let domProps = (0, $lnALe$filterDOMProps)(props, {
50
+ labelable: true
51
+ });
52
+ let gridProps = (0, $lnALe$mergeProps)(domProps, {
53
+ role: "grid",
54
+ id: id,
55
+ "aria-multiselectable": state.selectionManager.selectionMode === "multiple" ? "true" : undefined
56
+ }, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
57
+ state.collection.size === 0 ? {
58
+ tabIndex: hasTabbableChild ? -1 : 0
59
+ } : listProps, descriptionProps);
60
+ if (isVirtualized) {
61
+ gridProps["aria-rowcount"] = state.collection.size;
62
+ gridProps["aria-colcount"] = 1;
63
+ }
64
+ (0, $lnALe$useGridSelectionAnnouncement)({}, state);
65
+ return {
66
+ gridProps: gridProps
67
+ };
68
+ }
69
+
70
+
71
+ export {$f47efb0c3a859cf2$export$664f9155035607eb as useGridList};
72
+ //# sourceMappingURL=useGridList.mjs.map
@@ -0,0 +1,72 @@
1
+ import {listMap as $ce9b18daab526bbd$export$5b9bb410392e3991} from "./utils.module.js";
2
+ import {useId as $lnALe$useId, filterDOMProps as $lnALe$filterDOMProps, mergeProps as $lnALe$mergeProps} from "@react-aria/utils";
3
+ import {useHighlightSelectionDescription as $lnALe$useHighlightSelectionDescription, useGridSelectionAnnouncement as $lnALe$useGridSelectionAnnouncement} from "@react-aria/grid";
4
+ import {useHasTabbableChild as $lnALe$useHasTabbableChild} from "@react-aria/focus";
5
+ import {useSelectableList as $lnALe$useSelectableList} from "@react-aria/selection";
6
+
7
+ /*
8
+ * Copyright 2022 Adobe. All rights reserved.
9
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License. You may obtain a copy
11
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software distributed under
14
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
+ * OF ANY KIND, either express or implied. See the License for the specific language
16
+ * governing permissions and limitations under the License.
17
+ */
18
+
19
+
20
+
21
+
22
+ function $f47efb0c3a859cf2$export$664f9155035607eb(props, state, ref) {
23
+ let { isVirtualized: isVirtualized, keyboardDelegate: keyboardDelegate, onAction: onAction, linkBehavior: linkBehavior = "action" } = props;
24
+ if (!props["aria-label"] && !props["aria-labelledby"]) console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
25
+ let { listProps: listProps } = (0, $lnALe$useSelectableList)({
26
+ selectionManager: state.selectionManager,
27
+ collection: state.collection,
28
+ disabledKeys: state.disabledKeys,
29
+ ref: ref,
30
+ keyboardDelegate: keyboardDelegate,
31
+ isVirtualized: isVirtualized,
32
+ selectOnFocus: state.selectionManager.selectionBehavior === "replace",
33
+ shouldFocusWrap: props.shouldFocusWrap,
34
+ linkBehavior: linkBehavior
35
+ });
36
+ let id = (0, $lnALe$useId)(props.id);
37
+ (0, $ce9b18daab526bbd$export$5b9bb410392e3991).set(state, {
38
+ id: id,
39
+ onAction: onAction,
40
+ linkBehavior: linkBehavior
41
+ });
42
+ let descriptionProps = (0, $lnALe$useHighlightSelectionDescription)({
43
+ selectionManager: state.selectionManager,
44
+ hasItemActions: !!onAction
45
+ });
46
+ let hasTabbableChild = (0, $lnALe$useHasTabbableChild)(ref, {
47
+ isDisabled: state.collection.size !== 0
48
+ });
49
+ let domProps = (0, $lnALe$filterDOMProps)(props, {
50
+ labelable: true
51
+ });
52
+ let gridProps = (0, $lnALe$mergeProps)(domProps, {
53
+ role: "grid",
54
+ id: id,
55
+ "aria-multiselectable": state.selectionManager.selectionMode === "multiple" ? "true" : undefined
56
+ }, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
57
+ state.collection.size === 0 ? {
58
+ tabIndex: hasTabbableChild ? -1 : 0
59
+ } : listProps, descriptionProps);
60
+ if (isVirtualized) {
61
+ gridProps["aria-rowcount"] = state.collection.size;
62
+ gridProps["aria-colcount"] = 1;
63
+ }
64
+ (0, $lnALe$useGridSelectionAnnouncement)({}, state);
65
+ return {
66
+ gridProps: gridProps
67
+ };
68
+ }
69
+
70
+
71
+ export {$f47efb0c3a859cf2$export$664f9155035607eb as useGridList};
72
+ //# sourceMappingURL=useGridList.module.js.map