@react-aria/gridlist 3.14.3 → 3.15.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.
Files changed (40) hide show
  1. package/dist/import.mjs +2 -8
  2. package/dist/main.js +5 -11
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +2 -8
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +3 -0
  7. package/package.json +15 -20
  8. package/src/index.ts +3 -7
  9. package/dist/types.d.ts +0 -135
  10. package/dist/types.d.ts.map +0 -1
  11. package/dist/useGridList.main.js +0 -83
  12. package/dist/useGridList.main.js.map +0 -1
  13. package/dist/useGridList.mjs +0 -78
  14. package/dist/useGridList.module.js +0 -78
  15. package/dist/useGridList.module.js.map +0 -1
  16. package/dist/useGridListItem.main.js +0 -288
  17. package/dist/useGridListItem.main.js.map +0 -1
  18. package/dist/useGridListItem.mjs +0 -283
  19. package/dist/useGridListItem.module.js +0 -283
  20. package/dist/useGridListItem.module.js.map +0 -1
  21. package/dist/useGridListSection.main.js +0 -43
  22. package/dist/useGridListSection.main.js.map +0 -1
  23. package/dist/useGridListSection.mjs +0 -38
  24. package/dist/useGridListSection.module.js +0 -38
  25. package/dist/useGridListSection.module.js.map +0 -1
  26. package/dist/useGridListSelectionCheckbox.main.js +0 -34
  27. package/dist/useGridListSelectionCheckbox.main.js.map +0 -1
  28. package/dist/useGridListSelectionCheckbox.mjs +0 -29
  29. package/dist/useGridListSelectionCheckbox.module.js +0 -29
  30. package/dist/useGridListSelectionCheckbox.module.js.map +0 -1
  31. package/dist/utils.main.js +0 -31
  32. package/dist/utils.main.js.map +0 -1
  33. package/dist/utils.mjs +0 -25
  34. package/dist/utils.module.js +0 -25
  35. package/dist/utils.module.js.map +0 -1
  36. package/src/useGridList.ts +0 -182
  37. package/src/useGridListItem.ts +0 -326
  38. package/src/useGridListSection.ts +0 -60
  39. package/src/useGridListSelectionCheckbox.ts +0 -32
  40. package/src/utils.ts +0 -43
package/dist/import.mjs CHANGED
@@ -1,7 +1,4 @@
1
- import {useGridList as $f47efb0c3a859cf2$export$664f9155035607eb} from "./useGridList.mjs";
2
- import {useGridListItem as $4e8b0456ef72939f$export$9610e69494fadfd2} from "./useGridListItem.mjs";
3
- import {useGridListSelectionCheckbox as $e52ffc04a4adbd52$export$e29f2573fabbf7b9} from "./useGridListSelectionCheckbox.mjs";
4
- import {useGridListSection as $d6848ac28ff5c637$export$8a024deed275af3f} from "./useGridListSection.mjs";
1
+ import {useGridList as $904cad0d702faa05$re_export$useGridList, useGridListItem as $904cad0d702faa05$re_export$useGridListItem, useGridListSelectionCheckbox as $904cad0d702faa05$re_export$useGridListSelectionCheckbox, useGridListSection as $904cad0d702faa05$re_export$useGridListSection} from "react-aria/useGridList";
5
2
 
6
3
  /*
7
4
  * Copyright 2022 Adobe. All rights reserved.
@@ -16,8 +13,5 @@ import {useGridListSection as $d6848ac28ff5c637$export$8a024deed275af3f} from ".
16
13
  */
17
14
 
18
15
 
19
-
20
-
21
-
22
- export {$f47efb0c3a859cf2$export$664f9155035607eb as useGridList, $4e8b0456ef72939f$export$9610e69494fadfd2 as useGridListItem, $e52ffc04a4adbd52$export$e29f2573fabbf7b9 as useGridListSelectionCheckbox, $d6848ac28ff5c637$export$8a024deed275af3f as useGridListSection};
16
+ export {$904cad0d702faa05$re_export$useGridList as useGridList, $904cad0d702faa05$re_export$useGridListItem as useGridListItem, $904cad0d702faa05$re_export$useGridListSelectionCheckbox as useGridListSelectionCheckbox, $904cad0d702faa05$re_export$useGridListSection as useGridListSection};
23
17
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,17 +1,14 @@
1
- var $acf209ae814f1c93$exports = require("./useGridList.main.js");
2
- var $f7116f5928c03f32$exports = require("./useGridListItem.main.js");
3
- var $43131ea217bc2ad3$exports = require("./useGridListSelectionCheckbox.main.js");
4
- var $6e114d409ef8350d$exports = require("./useGridListSection.main.js");
1
+ var $jyt0l$reactariauseGridList = require("react-aria/useGridList");
5
2
 
6
3
 
7
4
  function $parcel$export(e, n, v, s) {
8
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
9
6
  }
10
7
 
11
- $parcel$export(module.exports, "useGridList", () => $acf209ae814f1c93$exports.useGridList);
12
- $parcel$export(module.exports, "useGridListItem", () => $f7116f5928c03f32$exports.useGridListItem);
13
- $parcel$export(module.exports, "useGridListSelectionCheckbox", () => $43131ea217bc2ad3$exports.useGridListSelectionCheckbox);
14
- $parcel$export(module.exports, "useGridListSection", () => $6e114d409ef8350d$exports.useGridListSection);
8
+ $parcel$export(module.exports, "useGridList", function () { return $jyt0l$reactariauseGridList.useGridList; });
9
+ $parcel$export(module.exports, "useGridListItem", function () { return $jyt0l$reactariauseGridList.useGridListItem; });
10
+ $parcel$export(module.exports, "useGridListSelectionCheckbox", function () { return $jyt0l$reactariauseGridList.useGridListSelectionCheckbox; });
11
+ $parcel$export(module.exports, "useGridListSection", function () { return $jyt0l$reactariauseGridList.useGridListSection; });
15
12
  /*
16
13
  * Copyright 2022 Adobe. All rights reserved.
17
14
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -25,7 +22,4 @@ $parcel$export(module.exports, "useGridListSection", () => $6e114d409ef8350d$exp
25
22
  */
26
23
 
27
24
 
28
-
29
-
30
-
31
25
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
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';\nexport {useGridListSection} from './useGridListSection';\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":"main.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, useGridListItem, useGridListSelectionCheckbox, useGridListSection} from 'react-aria/useGridList';\n\nexport type {AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps, AriaGridListItemOptions, GridListItemAria, AriaGridListSectionProps, GridListSectionAria} from 'react-aria/useGridList';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from 'react-aria/private/grid/useGridSelectionCheckbox';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,7 +1,4 @@
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";
4
- import {useGridListSection as $d6848ac28ff5c637$export$8a024deed275af3f} from "./useGridListSection.module.js";
1
+ import {useGridList as $904cad0d702faa05$re_export$useGridList, useGridListItem as $904cad0d702faa05$re_export$useGridListItem, useGridListSelectionCheckbox as $904cad0d702faa05$re_export$useGridListSelectionCheckbox, useGridListSection as $904cad0d702faa05$re_export$useGridListSection} from "react-aria/useGridList";
5
2
 
6
3
  /*
7
4
  * Copyright 2022 Adobe. All rights reserved.
@@ -16,8 +13,5 @@ import {useGridListSection as $d6848ac28ff5c637$export$8a024deed275af3f} from ".
16
13
  */
17
14
 
18
15
 
19
-
20
-
21
-
22
- export {$f47efb0c3a859cf2$export$664f9155035607eb as useGridList, $4e8b0456ef72939f$export$9610e69494fadfd2 as useGridListItem, $e52ffc04a4adbd52$export$e29f2573fabbf7b9 as useGridListSelectionCheckbox, $d6848ac28ff5c637$export$8a024deed275af3f as useGridListSection};
16
+ export {$904cad0d702faa05$re_export$useGridList as useGridList, $904cad0d702faa05$re_export$useGridListItem as useGridListItem, $904cad0d702faa05$re_export$useGridListSelectionCheckbox as useGridListSelectionCheckbox, $904cad0d702faa05$re_export$useGridListSection as useGridListSection};
23
17
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
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';\nexport {useGridListSection} from './useGridListSection';\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"}
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, useGridListItem, useGridListSelectionCheckbox, useGridListSection} from 'react-aria/useGridList';\n\nexport type {AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps, AriaGridListItemOptions, GridListItemAria, AriaGridListSectionProps, GridListSectionAria} from 'react-aria/useGridList';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from 'react-aria/private/grid/useGridSelectionCheckbox';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,3 @@
1
+ export { useGridList, useGridListItem, useGridListSelectionCheckbox, useGridListSection } from 'react-aria/useGridList';
2
+ export type { AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps, AriaGridListItemOptions, GridListItemAria, AriaGridListSectionProps, GridListSectionAria } from 'react-aria/useGridList';
3
+ export type { AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria } from 'react-aria/private/grid/useGridSelectionCheckbox';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-aria/gridlist",
3
- "version": "3.14.3",
3
+ "version": "3.15.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -26,16 +26,8 @@
26
26
  "url": "https://github.com/adobe/react-spectrum"
27
27
  },
28
28
  "dependencies": {
29
- "@react-aria/focus": "^3.21.4",
30
- "@react-aria/grid": "^3.14.7",
31
- "@react-aria/i18n": "^3.12.15",
32
- "@react-aria/interactions": "^3.27.0",
33
- "@react-aria/selection": "^3.27.1",
34
- "@react-aria/utils": "^3.33.0",
35
- "@react-stately/list": "^3.13.3",
36
- "@react-stately/tree": "^3.9.5",
37
- "@react-types/shared": "^3.33.0",
38
- "@swc/helpers": "^0.5.0"
29
+ "@swc/helpers": "^0.5.0",
30
+ "react-aria": "3.48.0"
39
31
  },
40
32
  "peerDependencies": {
41
33
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
@@ -44,5 +36,8 @@
44
36
  "publishConfig": {
45
37
  "access": "public"
46
38
  },
47
- "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
39
+ "targets": {
40
+ "types": false
41
+ },
42
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
48
43
  }
package/src/index.ts CHANGED
@@ -10,11 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export {useGridList} from './useGridList';
14
- export {useGridListItem} from './useGridListItem';
15
- export {useGridListSelectionCheckbox} from './useGridListSelectionCheckbox';
16
- export {useGridListSection} from './useGridListSection';
13
+ export {useGridList, useGridListItem, useGridListSelectionCheckbox, useGridListSection} from 'react-aria/useGridList';
17
14
 
18
- export type {AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps} from './useGridList';
19
- export type {AriaGridListItemOptions, GridListItemAria} from './useGridListItem';
20
- export type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from '@react-aria/grid';
15
+ export type {AriaGridListOptions, AriaGridListProps, GridListAria, GridListProps, AriaGridListItemOptions, GridListItemAria, AriaGridListSectionProps, GridListSectionAria} from 'react-aria/useGridList';
16
+ export type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from 'react-aria/private/grid/useGridSelectionCheckbox';
package/dist/types.d.ts DELETED
@@ -1,135 +0,0 @@
1
- import { AriaLabelingProps, CollectionBase, DisabledBehavior, DOMAttributes, DOMProps, FocusStrategy, Key, KeyboardDelegate, LayoutDelegate, MultipleSelection, RefObject, FocusableElement, Node } from "@react-types/shared";
2
- import { ListState } from "@react-stately/list";
3
- import { SelectableItemStates } from "@react-aria/selection";
4
- import { TreeState } from "@react-stately/tree";
5
- import { AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria } from "@react-aria/grid";
6
- export interface GridListProps<T> extends CollectionBase<T>, MultipleSelection {
7
- /** Whether to auto focus the gridlist or an option. */
8
- autoFocus?: boolean | FocusStrategy;
9
- /**
10
- * Handler that is called when a user performs an action on an item. The exact user event depends on
11
- * the collection's `selectionBehavior` prop and the interaction modality.
12
- */
13
- onAction?: (key: Key) => void;
14
- /**
15
- * Whether `disabledKeys` applies to all interactions, or only selection.
16
- * @default "all"
17
- */
18
- disabledBehavior?: DisabledBehavior;
19
- /** Whether selection should occur on press up instead of press down. */
20
- shouldSelectOnPressUp?: boolean;
21
- }
22
- export interface AriaGridListProps<T> extends GridListProps<T>, DOMProps, AriaLabelingProps {
23
- /**
24
- * Whether keyboard navigation to focusable elements within grid list items is
25
- * via the left/right arrow keys or the tab key.
26
- * @default 'arrow'
27
- */
28
- keyboardNavigationBehavior?: 'arrow' | 'tab';
29
- /**
30
- * Whether pressing the escape key should clear selection in the grid list or not.
31
- *
32
- * Most experiences should not modify this option as it eliminates a keyboard user's ability to
33
- * easily clear selection. Only use if the escape key is being handled externally or should not
34
- * trigger selection clearing contextually.
35
- * @default 'clearSelection'
36
- */
37
- escapeKeyBehavior?: 'clearSelection' | 'none';
38
- }
39
- export interface AriaGridListOptions<T> extends Omit<AriaGridListProps<T>, 'children'> {
40
- /** Whether the list uses virtual scrolling. */
41
- isVirtualized?: boolean;
42
- /**
43
- * Whether typeahead navigation is disabled.
44
- * @default false
45
- */
46
- disallowTypeAhead?: boolean;
47
- /**
48
- * An optional keyboard delegate implementation for type to select,
49
- * to override the default.
50
- */
51
- keyboardDelegate?: KeyboardDelegate;
52
- /**
53
- * A delegate object that provides layout information for items in the collection.
54
- * By default this uses the DOM, but this can be overridden to implement things like
55
- * virtualized scrolling.
56
- */
57
- layoutDelegate?: LayoutDelegate;
58
- /**
59
- * Whether focus should wrap around when the end/start is reached.
60
- * @default false
61
- */
62
- shouldFocusWrap?: boolean;
63
- /**
64
- * The behavior of links in the collection.
65
- * - 'action': link behaves like onAction.
66
- * - 'selection': link follows selection interactions (e.g. if URL drives selection).
67
- * - 'override': links override all other interactions (link items are not selectable).
68
- * @default 'action'
69
- */
70
- linkBehavior?: 'action' | 'selection' | 'override';
71
- }
72
- export interface GridListAria {
73
- /** Props for the grid element. */
74
- gridProps: DOMAttributes;
75
- }
76
- /**
77
- * Provides the behavior and accessibility implementation for a list component with interactive children.
78
- * A grid list displays data in a single column and enables a user to navigate its contents via directional navigation keys.
79
- * @param props - Props for the list.
80
- * @param state - State for the list, as returned by `useListState`.
81
- * @param ref - The ref attached to the list element.
82
- */
83
- export function useGridList<T>(props: AriaGridListOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement | null>): GridListAria;
84
- export interface AriaGridListItemOptions {
85
- /** An object representing the list item. Contains all the relevant information that makes up the list row. */
86
- node: Node<unknown>;
87
- /** Whether the list row is contained in a virtual scroller. */
88
- isVirtualized?: boolean;
89
- /** Whether selection should occur on press up instead of press down. */
90
- shouldSelectOnPressUp?: boolean;
91
- /** Whether this item has children, even if not loaded yet. */
92
- hasChildItems?: boolean;
93
- }
94
- export interface GridListItemAria extends SelectableItemStates {
95
- /** Props for the list row element. */
96
- rowProps: DOMAttributes;
97
- /** Props for the grid cell element within the list row. */
98
- gridCellProps: DOMAttributes;
99
- /** Props for the list item description element, if any. */
100
- descriptionProps: DOMAttributes;
101
- }
102
- /**
103
- * Provides the behavior and accessibility implementation for a row in a grid list.
104
- * @param props - Props for the row.
105
- * @param state - State of the parent list, as returned by `useListState`.
106
- * @param ref - The ref attached to the row element.
107
- */
108
- export function useGridListItem<T>(props: AriaGridListItemOptions, state: ListState<T> | TreeState<T>, ref: RefObject<FocusableElement | null>): GridListItemAria;
109
- /**
110
- * Provides the behavior and accessibility implementation for a selection checkbox in a grid list.
111
- * @param props - Props for the selection checkbox.
112
- * @param state - State of the list, as returned by `useListState`.
113
- */
114
- export function useGridListSelectionCheckbox<T>(props: AriaGridSelectionCheckboxProps, state: ListState<T>): GridSelectionCheckboxAria;
115
- interface AriaGridListSectionProps {
116
- /** An accessibility label for the section. Required if `heading` is not present. */
117
- 'aria-label'?: string;
118
- }
119
- interface GridListSectionAria {
120
- /** Props for the wrapper list item. */
121
- rowProps: DOMAttributes;
122
- /** Props for the heading element, if any. */
123
- rowHeaderProps: DOMAttributes;
124
- /** Props for the grid's row group element. */
125
- rowGroupProps: DOMAttributes;
126
- }
127
- /**
128
- * Provides the behavior and accessibility implementation for a section in a grid list.
129
- * See `useGridList` for more details about grid list.
130
- * @param props - Props for the section.
131
- */
132
- export function useGridListSection<T>(props: AriaGridListSectionProps, state: ListState<T>, ref: RefObject<HTMLElement | null>): GridListSectionAria;
133
- export type { AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria } from '@react-aria/grid';
134
-
135
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;ACgCA,+BAA+B,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,EAAE,iBAAiB;IAC5E,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,mCAAmC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB;IACzF;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC7C;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAA;CAC9C;AAED,qCAAqC,CAAC,CAAE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,UAAU,CAAC;IACpF,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAA;CACnD;AAED;IACE,kCAAkC;IAClC,SAAS,EAAE,aAAa,CAAA;CACzB;AAED;;;;;;GAMG;AACH,4BAA4B,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,YAAY,CAoEnI;AC9JD;IACE,8GAA8G;IAC9G,IAAI,EAAE,KAAO,OAAO,CAAC,CAAC;IACtB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,8DAA8D;IAC9D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,iCAAkC,SAAQ,oBAAoB;IAC5D,sCAAsC;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB,2DAA2D;IAC3D,aAAa,EAAE,aAAa,CAAC;IAC7B,2DAA2D;IAC3D,gBAAgB,EAAE,aAAa,CAAA;CAChC;AAaD;;;;;GAKG;AACH,gCAAgC,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,gBAAgB,CA6PhK;ACzSD;;;;GAIG;AACH,6CAA6C,CAAC,EAAE,KAAK,EAAE,8BAA8B,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,GAAG,yBAAyB,CAUrI;ACfD;IACE,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;IACE,uCAAuC;IACvC,QAAQ,EAAE,aAAa,CAAC;IAExB,6CAA6C;IAC7C,cAAc,EAAE,aAAa,CAAC;IAE9B,8CAA8C;IAC9C,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED;;;;GAIG;AAEH,mCAAmC,CAAC,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,mBAAmB,CAqBnJ;ACxCD,YAAY,EAAC,8BAA8B,EAAE,yBAAyB,EAAC,MAAM,kBAAkB,CAAC","sources":["packages/@react-aria/gridlist/src/packages/@react-aria/gridlist/src/utils.ts","packages/@react-aria/gridlist/src/packages/@react-aria/gridlist/src/useGridList.ts","packages/@react-aria/gridlist/src/packages/@react-aria/gridlist/src/useGridListItem.ts","packages/@react-aria/gridlist/src/packages/@react-aria/gridlist/src/useGridListSelectionCheckbox.ts","packages/@react-aria/gridlist/src/packages/@react-aria/gridlist/src/useGridListSection.ts","packages/@react-aria/gridlist/src/packages/@react-aria/gridlist/src/index.ts","packages/@react-aria/gridlist/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,"/*\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';\nexport {useGridListSection} from './useGridListSection';\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":"types.d.ts.map"}
@@ -1,83 +0,0 @@
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, layoutDelegate: layoutDelegate, onAction: onAction, disallowTypeAhead: disallowTypeAhead, linkBehavior: linkBehavior = 'action', keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', shouldSelectOnPressUp: shouldSelectOnPressUp } = 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
- layoutDelegate: layoutDelegate,
38
- isVirtualized: isVirtualized,
39
- selectOnFocus: state.selectionManager.selectionBehavior === 'replace',
40
- shouldFocusWrap: props.shouldFocusWrap,
41
- linkBehavior: linkBehavior,
42
- disallowTypeAhead: disallowTypeAhead,
43
- autoFocus: props.autoFocus,
44
- escapeKeyBehavior: escapeKeyBehavior
45
- });
46
- let id = (0, $i2dnl$reactariautils.useId)(props.id);
47
- (0, $7db02799adae605d$exports.listMap).set(state, {
48
- id: id,
49
- onAction: onAction,
50
- linkBehavior: linkBehavior,
51
- keyboardNavigationBehavior: keyboardNavigationBehavior,
52
- shouldSelectOnPressUp: shouldSelectOnPressUp
53
- });
54
- let descriptionProps = (0, $i2dnl$reactariagrid.useHighlightSelectionDescription)({
55
- selectionManager: state.selectionManager,
56
- hasItemActions: !!onAction
57
- });
58
- let hasTabbableChild = (0, $i2dnl$reactariafocus.useHasTabbableChild)(ref, {
59
- isDisabled: state.collection.size !== 0
60
- });
61
- let domProps = (0, $i2dnl$reactariautils.filterDOMProps)(props, {
62
- labelable: true
63
- });
64
- let gridProps = (0, $i2dnl$reactariautils.mergeProps)(domProps, {
65
- role: 'grid',
66
- id: id,
67
- 'aria-multiselectable': state.selectionManager.selectionMode === 'multiple' ? 'true' : undefined
68
- }, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
69
- state.collection.size === 0 ? {
70
- tabIndex: hasTabbableChild ? -1 : 0
71
- } : listProps, descriptionProps);
72
- if (isVirtualized) {
73
- gridProps['aria-rowcount'] = state.collection.size;
74
- gridProps['aria-colcount'] = 1;
75
- }
76
- (0, $i2dnl$reactariagrid.useGridSelectionAnnouncement)({}, state);
77
- return {
78
- gridProps: gridProps
79
- };
80
- }
81
-
82
-
83
- //# sourceMappingURL=useGridList.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuGM,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAAkC;IACnH,IAAI,iBACF,aAAa,oBACb,gBAAgB,kBAChB,cAAc,YACd,QAAQ,qBACR,iBAAiB,gBACjB,eAAe,sCACf,6BAA6B,4BAC7B,oBAAoB,yCACpB,qBAAqB,EACtB,GAAG;IAEJ,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,EACnD,QAAQ,IAAI,CAAC;IAGf,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;QAClC,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;aAChC;0BACA;wBACA;uBACA;QACA,eAAe,MAAM,gBAAgB,CAAC,iBAAiB,KAAK;QAC5D,iBAAiB,MAAM,eAAe;sBACtC;2BACA;QACA,WAAW,MAAM,SAAS;2BAC1B;IACF;IAEA,IAAI,KAAK,CAAA,GAAA,2BAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,iCAAM,EAAE,GAAG,CAAC,OAAO;YAAC;kBAAI;sBAAU;oCAAc;+BAA4B;IAAqB;IAEjG,IAAI,mBAAmB,CAAA,GAAA,qDAA+B,EAAE;QACtD,kBAAkB,MAAM,gBAAgB;QACxC,gBAAgB,CAAC,CAAC;IACpB;IAEA,IAAI,mBAAmB,CAAA,GAAA,yCAAkB,EAAE,KAAK;QAC9C,YAAY,MAAM,UAAU,CAAC,IAAI,KAAK;IACxC;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,IAAI,YAA2B,CAAA,GAAA,gCAAS,EACtC,UACA;QACE,MAAM;YACN;QACA,wBAAwB,MAAM,gBAAgB,CAAC,aAAa,KAAK,aAAa,SAAS;IACzF,GACA,mGAAmG;IACnG,MAAM,UAAU,CAAC,IAAI,KAAK,IAAI;QAAC,UAAU,mBAAmB,KAAK;IAAC,IAAI,WACtE;IAGF,IAAI,eAAe;QACjB,SAAS,CAAC,gBAAgB,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 FocusStrategy,\n Key,\n KeyboardDelegate,\n LayoutDelegate,\n MultipleSelection,\n RefObject\n} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {listMap} from './utils';\nimport {ListState} from '@react-stately/list';\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 /** Whether to auto focus the gridlist or an option. */\n autoFocus?: boolean | FocusStrategy,\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 /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default \"all\"\n */\n disabledBehavior?: DisabledBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean\n}\n\nexport interface AriaGridListProps<T> extends GridListProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether keyboard navigation to focusable elements within grid list items is\n * via the left/right arrow keys or the tab key.\n * @default 'arrow'\n */\n keyboardNavigationBehavior?: 'arrow' | 'tab',\n /**\n * Whether pressing the escape key should clear selection in the grid list or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\n}\n\nexport interface AriaGridListOptions<T> extends Omit<AriaGridListProps<T>, 'children'> {\n /** Whether the list uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate,\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 | null>): GridListAria {\n let {\n isVirtualized,\n keyboardDelegate,\n layoutDelegate,\n onAction,\n disallowTypeAhead,\n linkBehavior = 'action',\n keyboardNavigationBehavior = 'arrow',\n escapeKeyBehavior = 'clearSelection',\n shouldSelectOnPressUp\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,\n layoutDelegate,\n isVirtualized,\n selectOnFocus: state.selectionManager.selectionBehavior === 'replace',\n shouldFocusWrap: props.shouldFocusWrap,\n linkBehavior,\n disallowTypeAhead,\n autoFocus: props.autoFocus,\n escapeKeyBehavior\n });\n\n let id = useId(props.id);\n listMap.set(state, {id, onAction, linkBehavior, keyboardNavigationBehavior, shouldSelectOnPressUp});\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"}
@@ -1,78 +0,0 @@
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, layoutDelegate: layoutDelegate, onAction: onAction, disallowTypeAhead: disallowTypeAhead, linkBehavior: linkBehavior = 'action', keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', shouldSelectOnPressUp: shouldSelectOnPressUp } = 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
- layoutDelegate: layoutDelegate,
32
- isVirtualized: isVirtualized,
33
- selectOnFocus: state.selectionManager.selectionBehavior === 'replace',
34
- shouldFocusWrap: props.shouldFocusWrap,
35
- linkBehavior: linkBehavior,
36
- disallowTypeAhead: disallowTypeAhead,
37
- autoFocus: props.autoFocus,
38
- escapeKeyBehavior: escapeKeyBehavior
39
- });
40
- let id = (0, $lnALe$useId)(props.id);
41
- (0, $ce9b18daab526bbd$export$5b9bb410392e3991).set(state, {
42
- id: id,
43
- onAction: onAction,
44
- linkBehavior: linkBehavior,
45
- keyboardNavigationBehavior: keyboardNavigationBehavior,
46
- shouldSelectOnPressUp: shouldSelectOnPressUp
47
- });
48
- let descriptionProps = (0, $lnALe$useHighlightSelectionDescription)({
49
- selectionManager: state.selectionManager,
50
- hasItemActions: !!onAction
51
- });
52
- let hasTabbableChild = (0, $lnALe$useHasTabbableChild)(ref, {
53
- isDisabled: state.collection.size !== 0
54
- });
55
- let domProps = (0, $lnALe$filterDOMProps)(props, {
56
- labelable: true
57
- });
58
- let gridProps = (0, $lnALe$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, $lnALe$useGridSelectionAnnouncement)({}, state);
71
- return {
72
- gridProps: gridProps
73
- };
74
- }
75
-
76
-
77
- export {$f47efb0c3a859cf2$export$664f9155035607eb as useGridList};
78
- //# sourceMappingURL=useGridList.module.js.map
@@ -1,78 +0,0 @@
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, layoutDelegate: layoutDelegate, onAction: onAction, disallowTypeAhead: disallowTypeAhead, linkBehavior: linkBehavior = 'action', keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', escapeKeyBehavior: escapeKeyBehavior = 'clearSelection', shouldSelectOnPressUp: shouldSelectOnPressUp } = 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
- layoutDelegate: layoutDelegate,
32
- isVirtualized: isVirtualized,
33
- selectOnFocus: state.selectionManager.selectionBehavior === 'replace',
34
- shouldFocusWrap: props.shouldFocusWrap,
35
- linkBehavior: linkBehavior,
36
- disallowTypeAhead: disallowTypeAhead,
37
- autoFocus: props.autoFocus,
38
- escapeKeyBehavior: escapeKeyBehavior
39
- });
40
- let id = (0, $lnALe$useId)(props.id);
41
- (0, $ce9b18daab526bbd$export$5b9bb410392e3991).set(state, {
42
- id: id,
43
- onAction: onAction,
44
- linkBehavior: linkBehavior,
45
- keyboardNavigationBehavior: keyboardNavigationBehavior,
46
- shouldSelectOnPressUp: shouldSelectOnPressUp
47
- });
48
- let descriptionProps = (0, $lnALe$useHighlightSelectionDescription)({
49
- selectionManager: state.selectionManager,
50
- hasItemActions: !!onAction
51
- });
52
- let hasTabbableChild = (0, $lnALe$useHasTabbableChild)(ref, {
53
- isDisabled: state.collection.size !== 0
54
- });
55
- let domProps = (0, $lnALe$filterDOMProps)(props, {
56
- labelable: true
57
- });
58
- let gridProps = (0, $lnALe$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, $lnALe$useGridSelectionAnnouncement)({}, state);
71
- return {
72
- gridProps: gridProps
73
- };
74
- }
75
-
76
-
77
- export {$f47efb0c3a859cf2$export$664f9155035607eb as useGridList};
78
- //# sourceMappingURL=useGridList.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuGM,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAAkC;IACnH,IAAI,iBACF,aAAa,oBACb,gBAAgB,kBAChB,cAAc,YACd,QAAQ,qBACR,iBAAiB,gBACjB,eAAe,sCACf,6BAA6B,4BAC7B,oBAAoB,yCACpB,qBAAqB,EACtB,GAAG;IAEJ,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,EACnD,QAAQ,IAAI,CAAC;IAGf,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAClC,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;aAChC;0BACA;wBACA;uBACA;QACA,eAAe,MAAM,gBAAgB,CAAC,iBAAiB,KAAK;QAC5D,iBAAiB,MAAM,eAAe;sBACtC;2BACA;QACA,WAAW,MAAM,SAAS;2BAC1B;IACF;IAEA,IAAI,KAAK,CAAA,GAAA,YAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAM,EAAE,GAAG,CAAC,OAAO;YAAC;kBAAI;sBAAU;oCAAc;+BAA4B;IAAqB;IAEjG,IAAI,mBAAmB,CAAA,GAAA,uCAA+B,EAAE;QACtD,kBAAkB,MAAM,gBAAgB;QACxC,gBAAgB,CAAC,CAAC;IACpB;IAEA,IAAI,mBAAmB,CAAA,GAAA,0BAAkB,EAAE,KAAK;QAC9C,YAAY,MAAM,UAAU,CAAC,IAAI,KAAK;IACxC;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,IAAI,YAA2B,CAAA,GAAA,iBAAS,EACtC,UACA;QACE,MAAM;YACN;QACA,wBAAwB,MAAM,gBAAgB,CAAC,aAAa,KAAK,aAAa,SAAS;IACzF,GACA,mGAAmG;IACnG,MAAM,UAAU,CAAC,IAAI,KAAK,IAAI;QAAC,UAAU,mBAAmB,KAAK;IAAC,IAAI,WACtE;IAGF,IAAI,eAAe;QACjB,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,IAAI;QAClD,SAAS,CAAC,gBAAgB,GAAG;IAC/B;IAEA,CAAA,GAAA,mCAA2B,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 FocusStrategy,\n Key,\n KeyboardDelegate,\n LayoutDelegate,\n MultipleSelection,\n RefObject\n} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {listMap} from './utils';\nimport {ListState} from '@react-stately/list';\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 /** Whether to auto focus the gridlist or an option. */\n autoFocus?: boolean | FocusStrategy,\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 /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default \"all\"\n */\n disabledBehavior?: DisabledBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean\n}\n\nexport interface AriaGridListProps<T> extends GridListProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether keyboard navigation to focusable elements within grid list items is\n * via the left/right arrow keys or the tab key.\n * @default 'arrow'\n */\n keyboardNavigationBehavior?: 'arrow' | 'tab',\n /**\n * Whether pressing the escape key should clear selection in the grid list or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\n}\n\nexport interface AriaGridListOptions<T> extends Omit<AriaGridListProps<T>, 'children'> {\n /** Whether the list uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate,\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 | null>): GridListAria {\n let {\n isVirtualized,\n keyboardDelegate,\n layoutDelegate,\n onAction,\n disallowTypeAhead,\n linkBehavior = 'action',\n keyboardNavigationBehavior = 'arrow',\n escapeKeyBehavior = 'clearSelection',\n shouldSelectOnPressUp\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,\n layoutDelegate,\n isVirtualized,\n selectOnFocus: state.selectionManager.selectionBehavior === 'replace',\n shouldFocusWrap: props.shouldFocusWrap,\n linkBehavior,\n disallowTypeAhead,\n autoFocus: props.autoFocus,\n escapeKeyBehavior\n });\n\n let id = useId(props.id);\n listMap.set(state, {id, onAction, linkBehavior, keyboardNavigationBehavior, shouldSelectOnPressUp});\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.module.js.map"}