@react-aria/tree 3.0.0-nightly.2962 → 3.0.0-nightly.2971
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/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/useTreeGridList.main.js.map +1 -1
- package/dist/useTreeGridList.module.js.map +1 -1
- package/dist/useTreeGridListItem.main.js.map +1 -1
- package/dist/useTreeGridListItem.module.js.map +1 -1
- package/package.json +11 -11
- package/src/useTreeGridList.ts +2 -2
- package/src/useTreeGridListItem.ts +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface TreeGridListProps<T> extends GridListProps<T> {
|
|
|
8
8
|
}
|
|
9
9
|
export interface AriaTreeGridListProps<T> extends Omit<AriaGridListProps<T>, 'keyboardNavigationBehavior'> {
|
|
10
10
|
}
|
|
11
|
-
export interface AriaTreeGridListOptions<T> extends Omit<AriaGridListOptions<T>, 'children' | '
|
|
11
|
+
export interface AriaTreeGridListOptions<T> extends Omit<AriaGridListOptions<T>, 'children' | 'shouldFocusWrap'> {
|
|
12
12
|
/**
|
|
13
13
|
* An optional keyboard delegate implementation for type to select,
|
|
14
14
|
* to override the default.
|
|
@@ -26,7 +26,7 @@ export interface TreeGridListAria {
|
|
|
26
26
|
* @param state - State for the treegrid, as returned by `useTreeState`.
|
|
27
27
|
* @param ref - The ref attached to the treegrid element.
|
|
28
28
|
*/
|
|
29
|
-
export function useTreeGridList<T>(props: AriaTreeGridListOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement>): TreeGridListAria;
|
|
29
|
+
export function useTreeGridList<T>(props: AriaTreeGridListOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement | null>): TreeGridListAria;
|
|
30
30
|
export interface AriaTreeGridListItemOptions extends Omit<AriaGridListItemOptions, 'isVirtualized'> {
|
|
31
31
|
/** An object representing the treegrid item. Contains all the relevant information that makes up the treegrid row. */
|
|
32
32
|
node: Node<unknown>;
|
|
@@ -47,6 +47,6 @@ export interface TreeGridListItemAria extends GridListItemAria {
|
|
|
47
47
|
* @param state - State of the parent list, as returned by `useTreeState`.
|
|
48
48
|
* @param ref - The ref attached to the row element.
|
|
49
49
|
*/
|
|
50
|
-
export function useTreeGridListItem<T>(props: AriaTreeGridListItemOptions, state: TreeState<T>, ref: RefObject<FocusableElement>): TreeGridListItemAria;
|
|
50
|
+
export function useTreeGridListItem<T>(props: AriaTreeGridListItemOptions, state: TreeState<T>, ref: RefObject<FocusableElement | null>): TreeGridListItemAria;
|
|
51
51
|
|
|
52
52
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAYA,8BAEC;ACMD,mCAAmC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC;CAAG;AAEjE,uCAAuC,CAAC,CAAE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,4BAA4B,CAAC;CAAG;AAC7G,yCAAyC,CAAC,CAAE,SAAQ,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,UAAU,GAAG,
|
|
1
|
+
{"mappings":";;;;;AAYA,8BAEC;ACMD,mCAAmC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC;CAAG;AAEjE,uCAAuC,CAAC,CAAE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,4BAA4B,CAAC;CAAG;AAC7G,yCAAyC,CAAC,CAAE,SAAQ,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,UAAU,GAAG,iBAAiB,CAAC;IAC9G;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC;AAED;IACE,sCAAsC;IACtC,SAAS,EAAE,aAAa,CAAA;CACzB;AAED;;;;;;GAMG;AACH,gCAAgC,CAAC,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,gBAAgB,CAO/I;AC5BD,4CAA6C,SAAQ,IAAI,CAAC,uBAAuB,EAAE,eAAe,CAAC;IACjG,sHAAsH;IACtH,IAAI,EAAE,KAAK,OAAO,CAAC,CAAA;CACpB;AAED,qCAAsC,SAAQ,gBAAgB;IAC5D,2CAA2C;IAC3C,QAAQ,EAAE,aAAa,CAAC;IACxB,0EAA0E;IAC1E,aAAa,EAAE,aAAa,CAAC;IAC7B,+DAA+D;IAC/D,gBAAgB,EAAE,aAAa,CAAC;IAChC,iDAAiD;IACjD,iBAAiB,EAAE,eAAe,CAAA;CACnC;AAED;;;;;GAKG;AACH,oCAAoC,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,oBAAoB,CAwB7J","sources":["packages/@react-aria/tree/src/packages/@react-aria/tree/src/useTree.ts","packages/@react-aria/tree/src/packages/@react-aria/tree/src/useTreeGridList.ts","packages/@react-aria/tree/src/packages/@react-aria/tree/src/useTreeGridListItem.ts","packages/@react-aria/tree/src/packages/@react-aria/tree/src/index.ts","packages/@react-aria/tree/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\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\nexport {useTree} from './useTree';\nexport {useTreeGridList} from './useTreeGridList';\nexport {useTreeGridListItem} from './useTreeGridListItem';\n\nexport type {AriaTreeGridListOptions, AriaTreeGridListProps, TreeGridListAria, TreeGridListProps} from './useTreeGridList';\nexport type {AriaTreeGridListItemOptions, TreeGridListItemAria} from './useTreeGridListItem';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAiCM,SAAS,0CAAmB,KAAiC,EAAE,KAAmB,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAiCM,SAAS,0CAAmB,KAAiC,EAAE,KAAmB,EAAE,GAAkC;IAC3H,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,oCAAU,EAAE,OAAO,OAAO;IAC5C,UAAU,IAAI,GAAG;IAEjB,OAAO;mBACL;IACF;AACF","sources":["packages/@react-aria/tree/src/useTreeGridList.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaGridListOptions, AriaGridListProps, GridListProps, useGridList} from '@react-aria/gridlist';\nimport {\n DOMAttributes,\n KeyboardDelegate\n} from '@react-types/shared';\nimport {RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\n\nexport interface TreeGridListProps<T> extends GridListProps<T> {}\n\nexport interface AriaTreeGridListProps<T> extends Omit<AriaGridListProps<T>, 'keyboardNavigationBehavior'> {}\nexport interface AriaTreeGridListOptions<T> extends Omit<AriaGridListOptions<T>, 'children' | 'shouldFocusWrap'> {\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\nexport interface TreeGridListAria {\n /** Props for the treegrid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a single column treegrid component with interactive children.\n * A tree grid provides users with a way to navigate nested hierarchical information.\n * @param props - Props for the treegrid.\n * @param state - State for the treegrid, as returned by `useTreeState`.\n * @param ref - The ref attached to the treegrid element.\n */\nexport function useTreeGridList<T>(props: AriaTreeGridListOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement | null>): TreeGridListAria {\n let {gridProps} = useGridList(props, state, ref);\n gridProps.role = 'treegrid';\n\n return {\n gridProps\n };\n}\n"],"names":[],"version":3,"file":"useTreeGridList.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAiCM,SAAS,0CAAmB,KAAiC,EAAE,KAAmB,EAAE,
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAiCM,SAAS,0CAAmB,KAAiC,EAAE,KAAmB,EAAE,GAAkC;IAC3H,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE,OAAO,OAAO;IAC5C,UAAU,IAAI,GAAG;IAEjB,OAAO;mBACL;IACF;AACF","sources":["packages/@react-aria/tree/src/useTreeGridList.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaGridListOptions, AriaGridListProps, GridListProps, useGridList} from '@react-aria/gridlist';\nimport {\n DOMAttributes,\n KeyboardDelegate\n} from '@react-types/shared';\nimport {RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\n\nexport interface TreeGridListProps<T> extends GridListProps<T> {}\n\nexport interface AriaTreeGridListProps<T> extends Omit<AriaGridListProps<T>, 'keyboardNavigationBehavior'> {}\nexport interface AriaTreeGridListOptions<T> extends Omit<AriaGridListOptions<T>, 'children' | 'shouldFocusWrap'> {\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\nexport interface TreeGridListAria {\n /** Props for the treegrid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a single column treegrid component with interactive children.\n * A tree grid provides users with a way to navigate nested hierarchical information.\n * @param props - Props for the treegrid.\n * @param state - State for the treegrid, as returned by `useTreeState`.\n * @param ref - The ref attached to the treegrid element.\n */\nexport function useTreeGridList<T>(props: AriaTreeGridListOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement | null>): TreeGridListAria {\n let {gridProps} = useGridList(props, state, ref);\n gridProps.role = 'treegrid';\n\n return {\n gridProps\n };\n}\n"],"names":[],"version":3,"file":"useTreeGridList.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkCM,SAAS,0CAAuB,KAAkC,EAAE,KAAmB,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkCM,SAAS,0CAAuB,KAAkC,EAAE,KAAmB,EAAE,GAAuC;IACrI,IAAI,QAAC,IAAI,EAAC,GAAG;IACb,IAAI,eAAe,CAAA,GAAA,wCAAc,EAAE,OAAO,OAAO;IACjD,IAAI,aAAa,aAAa,QAAQ,CAAC,gBAAgB,KAAK;IAC5D,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,oBAAoB;QACtB,SAAS;YACP,IAAI,CAAC,aAAa,UAAU,EAAE;gBAC5B,MAAM,SAAS,CAAC,KAAK,GAAG;gBACxB,MAAM,gBAAgB,CAAC,UAAU,CAAC;gBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC,KAAK,GAAG;YAC/C;QACF;QACA,cAAc,aAAa,gBAAgB,MAAM,CAAC,cAAc,gBAAgB,MAAM,CAAC;QACvF,UAAU,CAAA,GAAA,+BAAQ,MAAM,KAAK;QAC7B,iCAAiC;IACnC;IAEA,+FAA+F;IAC/F,OAAO;QACL,GAAG,YAAY;2BACf;IACF;AACF","sources":["packages/@react-aria/tree/src/useTreeGridListItem.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaButtonProps} from '@react-types/button';\nimport {AriaGridListItemOptions, GridListItemAria, useGridListItem} from '@react-aria/gridlist';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAndroid} from '@react-aria/utils';\nimport {RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTreeGridListItemOptions extends Omit<AriaGridListItemOptions, 'isVirtualized'> {\n /** An object representing the treegrid item. Contains all the relevant information that makes up the treegrid row. */\n node: Node<unknown>\n}\n\nexport interface TreeGridListItemAria extends GridListItemAria {\n /** Props for the tree grid row element. */\n rowProps: DOMAttributes,\n /** Props for the tree grid cell element within the tree grid list row. */\n gridCellProps: DOMAttributes,\n /** Props for the tree grid row description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tree grid row expand button. */\n expandButtonProps: AriaButtonProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a tree grid list.\n * @param props - Props for the row.\n * @param state - State of the parent list, as returned by `useTreeState`.\n * @param ref - The ref attached to the row element.\n */\nexport function useTreeGridListItem<T>(props: AriaTreeGridListItemOptions, state: TreeState<T>, ref: RefObject<FocusableElement | null>): TreeGridListItemAria {\n let {node} = props;\n let gridListAria = useGridListItem(props, state, ref);\n let isExpanded = gridListAria.rowProps['aria-expanded'] === true;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tree');\n\n let expandButtonProps = {\n onPress: () => {\n if (!gridListAria.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n 'aria-label': isExpanded ? stringFormatter.format('collapse') : stringFormatter.format('expand'),\n tabIndex: isAndroid() ? -1 : null,\n 'data-react-aria-prevent-focus': true\n };\n\n // TODO: should it return a state specifically for isExpanded? Or is aria attribute sufficient?\n return {\n ...gridListAria,\n expandButtonProps\n };\n}\n"],"names":[],"version":3,"file":"useTreeGridListItem.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkCM,SAAS,0CAAuB,KAAkC,EAAE,KAAmB,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkCM,SAAS,0CAAuB,KAAkC,EAAE,KAAmB,EAAE,GAAuC;IACrI,IAAI,QAAC,IAAI,EAAC,GAAG;IACb,IAAI,eAAe,CAAA,GAAA,sBAAc,EAAE,OAAO,OAAO;IACjD,IAAI,aAAa,aAAa,QAAQ,CAAC,gBAAgB,KAAK;IAC5D,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,oBAAoB;QACtB,SAAS;YACP,IAAI,CAAC,aAAa,UAAU,EAAE;gBAC5B,MAAM,SAAS,CAAC,KAAK,GAAG;gBACxB,MAAM,gBAAgB,CAAC,UAAU,CAAC;gBAClC,MAAM,gBAAgB,CAAC,aAAa,CAAC,KAAK,GAAG;YAC/C;QACF;QACA,cAAc,aAAa,gBAAgB,MAAM,CAAC,cAAc,gBAAgB,MAAM,CAAC;QACvF,UAAU,CAAA,GAAA,gBAAQ,MAAM,KAAK;QAC7B,iCAAiC;IACnC;IAEA,+FAA+F;IAC/F,OAAO;QACL,GAAG,YAAY;2BACf;IACF;AACF","sources":["packages/@react-aria/tree/src/useTreeGridListItem.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaButtonProps} from '@react-types/button';\nimport {AriaGridListItemOptions, GridListItemAria, useGridListItem} from '@react-aria/gridlist';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAndroid} from '@react-aria/utils';\nimport {RefObject} from 'react';\nimport {TreeState} from '@react-stately/tree';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTreeGridListItemOptions extends Omit<AriaGridListItemOptions, 'isVirtualized'> {\n /** An object representing the treegrid item. Contains all the relevant information that makes up the treegrid row. */\n node: Node<unknown>\n}\n\nexport interface TreeGridListItemAria extends GridListItemAria {\n /** Props for the tree grid row element. */\n rowProps: DOMAttributes,\n /** Props for the tree grid cell element within the tree grid list row. */\n gridCellProps: DOMAttributes,\n /** Props for the tree grid row description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tree grid row expand button. */\n expandButtonProps: AriaButtonProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a tree grid list.\n * @param props - Props for the row.\n * @param state - State of the parent list, as returned by `useTreeState`.\n * @param ref - The ref attached to the row element.\n */\nexport function useTreeGridListItem<T>(props: AriaTreeGridListItemOptions, state: TreeState<T>, ref: RefObject<FocusableElement | null>): TreeGridListItemAria {\n let {node} = props;\n let gridListAria = useGridListItem(props, state, ref);\n let isExpanded = gridListAria.rowProps['aria-expanded'] === true;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tree');\n\n let expandButtonProps = {\n onPress: () => {\n if (!gridListAria.isDisabled) {\n state.toggleKey(node.key);\n state.selectionManager.setFocused(true);\n state.selectionManager.setFocusedKey(node.key);\n }\n },\n 'aria-label': isExpanded ? stringFormatter.format('collapse') : stringFormatter.format('expand'),\n tabIndex: isAndroid() ? -1 : null,\n 'data-react-aria-prevent-focus': true\n };\n\n // TODO: should it return a state specifically for isExpanded? Or is aria attribute sufficient?\n return {\n ...gridListAria,\n expandButtonProps\n };\n}\n"],"names":[],"version":3,"file":"useTreeGridListItem.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/tree",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.2971+4e3af379e",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/gridlist": "3.8.2-nightly.
|
|
26
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
27
|
-
"@react-aria/selection": "3.0.0-nightly.
|
|
28
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
29
|
-
"@react-stately/tree": "3.0.0-nightly.
|
|
30
|
-
"@react-types/button": "3.9.5-nightly.
|
|
31
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
25
|
+
"@react-aria/gridlist": "3.8.2-nightly.4683+4e3af379e",
|
|
26
|
+
"@react-aria/i18n": "3.0.0-nightly.2971+4e3af379e",
|
|
27
|
+
"@react-aria/selection": "3.0.0-nightly.2971+4e3af379e",
|
|
28
|
+
"@react-aria/utils": "3.0.0-nightly.2971+4e3af379e",
|
|
29
|
+
"@react-stately/tree": "3.0.0-nightly.2971+4e3af379e",
|
|
30
|
+
"@react-types/button": "3.9.5-nightly.4683+4e3af379e",
|
|
31
|
+
"@react-types/shared": "3.0.0-nightly.2971+4e3af379e",
|
|
32
32
|
"@swc/helpers": "^0.5.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0",
|
|
36
|
-
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
35
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "4e3af379e569faac3b374e0ed5a98b2a19cd92c3"
|
|
42
42
|
}
|
package/src/useTreeGridList.ts
CHANGED
|
@@ -21,7 +21,7 @@ import {TreeState} from '@react-stately/tree';
|
|
|
21
21
|
export interface TreeGridListProps<T> extends GridListProps<T> {}
|
|
22
22
|
|
|
23
23
|
export interface AriaTreeGridListProps<T> extends Omit<AriaGridListProps<T>, 'keyboardNavigationBehavior'> {}
|
|
24
|
-
export interface AriaTreeGridListOptions<T> extends Omit<AriaGridListOptions<T>, 'children' | '
|
|
24
|
+
export interface AriaTreeGridListOptions<T> extends Omit<AriaGridListOptions<T>, 'children' | 'shouldFocusWrap'> {
|
|
25
25
|
/**
|
|
26
26
|
* An optional keyboard delegate implementation for type to select,
|
|
27
27
|
* to override the default.
|
|
@@ -41,7 +41,7 @@ export interface TreeGridListAria {
|
|
|
41
41
|
* @param state - State for the treegrid, as returned by `useTreeState`.
|
|
42
42
|
* @param ref - The ref attached to the treegrid element.
|
|
43
43
|
*/
|
|
44
|
-
export function useTreeGridList<T>(props: AriaTreeGridListOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement>): TreeGridListAria {
|
|
44
|
+
export function useTreeGridList<T>(props: AriaTreeGridListOptions<T>, state: TreeState<T>, ref: RefObject<HTMLElement | null>): TreeGridListAria {
|
|
45
45
|
let {gridProps} = useGridList(props, state, ref);
|
|
46
46
|
gridProps.role = 'treegrid';
|
|
47
47
|
|
|
@@ -42,7 +42,7 @@ export interface TreeGridListItemAria extends GridListItemAria {
|
|
|
42
42
|
* @param state - State of the parent list, as returned by `useTreeState`.
|
|
43
43
|
* @param ref - The ref attached to the row element.
|
|
44
44
|
*/
|
|
45
|
-
export function useTreeGridListItem<T>(props: AriaTreeGridListItemOptions, state: TreeState<T>, ref: RefObject<FocusableElement>): TreeGridListItemAria {
|
|
45
|
+
export function useTreeGridListItem<T>(props: AriaTreeGridListItemOptions, state: TreeState<T>, ref: RefObject<FocusableElement | null>): TreeGridListItemAria {
|
|
46
46
|
let {node} = props;
|
|
47
47
|
let gridListAria = useGridListItem(props, state, ref);
|
|
48
48
|
let isExpanded = gridListAria.rowProps['aria-expanded'] === true;
|