@fluentui/react-tree 0.0.0-nightly-20230310-0421.1
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/CHANGELOG.json +86 -0
- package/CHANGELOG.md +24 -0
- package/LICENSE +15 -0
- package/README.md +5 -0
- package/dist/index.d.ts +469 -0
- package/lib/Tree.js +2 -0
- package/lib/Tree.js.map +1 -0
- package/lib/TreeItem.js +2 -0
- package/lib/TreeItem.js.map +1 -0
- package/lib/TreeItemLayout.js +2 -0
- package/lib/TreeItemLayout.js.map +1 -0
- package/lib/TreeItemPersonaLayout.js +2 -0
- package/lib/TreeItemPersonaLayout.js.map +1 -0
- package/lib/components/Tree/Tree.js +21 -0
- package/lib/components/Tree/Tree.js.map +1 -0
- package/lib/components/Tree/Tree.types.js +2 -0
- package/lib/components/Tree/Tree.types.js.map +1 -0
- package/lib/components/Tree/index.js +7 -0
- package/lib/components/Tree/index.js.map +1 -0
- package/lib/components/Tree/renderTree.js +15 -0
- package/lib/components/Tree/renderTree.js.map +1 -0
- package/lib/components/Tree/useTree.js +113 -0
- package/lib/components/Tree/useTree.js.map +1 -0
- package/lib/components/Tree/useTreeContextValues.js +26 -0
- package/lib/components/Tree/useTreeContextValues.js.map +1 -0
- package/lib/components/Tree/useTreeStyles.js +20 -0
- package/lib/components/Tree/useTreeStyles.js.map +1 -0
- package/lib/components/TreeItem/TreeItem.js +16 -0
- package/lib/components/TreeItem/TreeItem.js.map +1 -0
- package/lib/components/TreeItem/TreeItem.types.js +2 -0
- package/lib/components/TreeItem/TreeItem.types.js.map +1 -0
- package/lib/components/TreeItem/index.js +6 -0
- package/lib/components/TreeItem/index.js.map +1 -0
- package/lib/components/TreeItem/renderTreeItem.js +29 -0
- package/lib/components/TreeItem/renderTreeItem.js.map +1 -0
- package/lib/components/TreeItem/useTreeItem.js +250 -0
- package/lib/components/TreeItem/useTreeItem.js.map +1 -0
- package/lib/components/TreeItem/useTreeItemContextValues.js +18 -0
- package/lib/components/TreeItem/useTreeItemContextValues.js.map +1 -0
- package/lib/components/TreeItem/useTreeItemStyles.js +203 -0
- package/lib/components/TreeItem/useTreeItemStyles.js.map +1 -0
- package/lib/components/TreeItemLayout/TreeItemLayout.js +14 -0
- package/lib/components/TreeItemLayout/TreeItemLayout.js.map +1 -0
- package/lib/components/TreeItemLayout/TreeItemLayout.types.js +2 -0
- package/lib/components/TreeItemLayout/TreeItemLayout.types.js.map +1 -0
- package/lib/components/TreeItemLayout/index.js +6 -0
- package/lib/components/TreeItemLayout/index.js.map +1 -0
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js +24 -0
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -0
- package/lib/components/TreeItemLayout/useTreeItemLayout.js +49 -0
- package/lib/components/TreeItemLayout/useTreeItemLayout.js.map +1 -0
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.js +98 -0
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +16 -0
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js +2 -0
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/index.js +6 -0
- package/lib/components/TreeItemPersonaLayout/index.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +31 -0
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +58 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js +13 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js +115 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +1 -0
- package/lib/contexts/index.js +3 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/contexts/treeContext.js +19 -0
- package/lib/contexts/treeContext.js.map +1 -0
- package/lib/contexts/treeItemContext.js +13 -0
- package/lib/contexts/treeItemContext.js.map +1 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useFlatTreeItems.js +134 -0
- package/lib/hooks/useFlatTreeItems.js.map +1 -0
- package/lib/hooks/useFlatTreeNavigation.js +74 -0
- package/lib/hooks/useFlatTreeNavigation.js.map +1 -0
- package/lib/hooks/useHTMLElementWalker.js +80 -0
- package/lib/hooks/useHTMLElementWalker.js.map +1 -0
- package/lib/hooks/useNestedTreeNavigation.js +59 -0
- package/lib/hooks/useNestedTreeNavigation.js.map +1 -0
- package/lib/hooks/useOpenItemsState.js +22 -0
- package/lib/hooks/useOpenItemsState.js.map +1 -0
- package/lib/hooks/useRovingTabIndexes.js +53 -0
- package/lib/hooks/useRovingTabIndexes.js.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/ImmutableSet.js +37 -0
- package/lib/utils/ImmutableSet.js.map +1 -0
- package/lib/utils/assert.js +7 -0
- package/lib/utils/assert.js.map +1 -0
- package/lib/utils/flattenTree.js +32 -0
- package/lib/utils/flattenTree.js.map +1 -0
- package/lib/utils/nextTypeAheadElement.js +14 -0
- package/lib/utils/nextTypeAheadElement.js.map +1 -0
- package/lib/utils/normalizeOpenItems.js +7 -0
- package/lib/utils/normalizeOpenItems.js.map +1 -0
- package/lib/utils/tokens.js +19 -0
- package/lib/utils/tokens.js.map +1 -0
- package/lib/utils/treeItemFilter.js +4 -0
- package/lib/utils/treeItemFilter.js.map +1 -0
- package/lib-commonjs/Tree.js +8 -0
- package/lib-commonjs/Tree.js.map +1 -0
- package/lib-commonjs/TreeItem.js +8 -0
- package/lib-commonjs/TreeItem.js.map +1 -0
- package/lib-commonjs/TreeItemLayout.js +8 -0
- package/lib-commonjs/TreeItemLayout.js.map +1 -0
- package/lib-commonjs/TreeItemPersonaLayout.js +8 -0
- package/lib-commonjs/TreeItemPersonaLayout.js.map +1 -0
- package/lib-commonjs/components/Tree/Tree.js +27 -0
- package/lib-commonjs/components/Tree/Tree.js.map +1 -0
- package/lib-commonjs/components/Tree/Tree.types.js +6 -0
- package/lib-commonjs/components/Tree/Tree.types.js.map +1 -0
- package/lib-commonjs/components/Tree/index.js +13 -0
- package/lib-commonjs/components/Tree/index.js.map +1 -0
- package/lib-commonjs/components/Tree/renderTree.js +22 -0
- package/lib-commonjs/components/Tree/renderTree.js.map +1 -0
- package/lib-commonjs/components/Tree/useTree.js +120 -0
- package/lib-commonjs/components/Tree/useTree.js.map +1 -0
- package/lib-commonjs/components/Tree/useTreeContextValues.js +33 -0
- package/lib-commonjs/components/Tree/useTreeContextValues.js.map +1 -0
- package/lib-commonjs/components/Tree/useTreeStyles.js +27 -0
- package/lib-commonjs/components/Tree/useTreeStyles.js.map +1 -0
- package/lib-commonjs/components/TreeItem/TreeItem.js +22 -0
- package/lib-commonjs/components/TreeItem/TreeItem.js.map +1 -0
- package/lib-commonjs/components/TreeItem/TreeItem.types.js +7 -0
- package/lib-commonjs/components/TreeItem/TreeItem.types.js.map +1 -0
- package/lib-commonjs/components/TreeItem/index.js +12 -0
- package/lib-commonjs/components/TreeItem/index.js.map +1 -0
- package/lib-commonjs/components/TreeItem/renderTreeItem.js +36 -0
- package/lib-commonjs/components/TreeItem/renderTreeItem.js.map +1 -0
- package/lib-commonjs/components/TreeItem/useTreeItem.js +257 -0
- package/lib-commonjs/components/TreeItem/useTreeItem.js.map +1 -0
- package/lib-commonjs/components/TreeItem/useTreeItemContextValues.js +25 -0
- package/lib-commonjs/components/TreeItem/useTreeItemContextValues.js.map +1 -0
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.js +210 -0
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.js +20 -0
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.types.js +6 -0
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.types.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/index.js +12 -0
- package/lib-commonjs/components/TreeItemLayout/index.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js +31 -0
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js +56 -0
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.js +105 -0
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +22 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js +6 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/index.js +12 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/index.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +38 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +65 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js +20 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js +122 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +1 -0
- package/lib-commonjs/contexts/index.js +9 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/contexts/treeContext.js +24 -0
- package/lib-commonjs/contexts/treeContext.js.map +1 -0
- package/lib-commonjs/contexts/treeItemContext.js +18 -0
- package/lib-commonjs/contexts/treeItemContext.js.map +1 -0
- package/lib-commonjs/hooks/index.js +10 -0
- package/lib-commonjs/hooks/index.js.map +1 -0
- package/lib-commonjs/hooks/useFlatTreeItems.js +141 -0
- package/lib-commonjs/hooks/useFlatTreeItems.js.map +1 -0
- package/lib-commonjs/hooks/useFlatTreeNavigation.js +81 -0
- package/lib-commonjs/hooks/useFlatTreeNavigation.js.map +1 -0
- package/lib-commonjs/hooks/useHTMLElementWalker.js +88 -0
- package/lib-commonjs/hooks/useHTMLElementWalker.js.map +1 -0
- package/lib-commonjs/hooks/useNestedTreeNavigation.js +66 -0
- package/lib-commonjs/hooks/useNestedTreeNavigation.js.map +1 -0
- package/lib-commonjs/hooks/useOpenItemsState.js +29 -0
- package/lib-commonjs/hooks/useOpenItemsState.js.map +1 -0
- package/lib-commonjs/hooks/useRovingTabIndexes.js +60 -0
- package/lib-commonjs/hooks/useRovingTabIndexes.js.map +1 -0
- package/lib-commonjs/index.js +183 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/ImmutableSet.js +45 -0
- package/lib-commonjs/utils/ImmutableSet.js.map +1 -0
- package/lib-commonjs/utils/assert.js +14 -0
- package/lib-commonjs/utils/assert.js.map +1 -0
- package/lib-commonjs/utils/flattenTree.js +38 -0
- package/lib-commonjs/utils/flattenTree.js.map +1 -0
- package/lib-commonjs/utils/nextTypeAheadElement.js +21 -0
- package/lib-commonjs/utils/nextTypeAheadElement.js.map +1 -0
- package/lib-commonjs/utils/normalizeOpenItems.js +14 -0
- package/lib-commonjs/utils/normalizeOpenItems.js.map +1 -0
- package/lib-commonjs/utils/tokens.js +25 -0
- package/lib-commonjs/utils/tokens.js.map +1 -0
- package/lib-commonjs/utils/treeItemFilter.js +11 -0
- package/lib-commonjs/utils/treeItemFilter.js.map +1 -0
- package/package.json +64 -0
package/CHANGELOG.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluentui/react-tree",
|
|
3
|
+
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Fri, 10 Mar 2023 04:30:51 GMT",
|
|
6
|
+
"tag": "@fluentui/react-tree_v0.0.0-nightly-20230310-0421.1",
|
|
7
|
+
"version": "0.0.0-nightly-20230310-0421.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "fluentui-internal@service.microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-tree",
|
|
13
|
+
"commit": "not available",
|
|
14
|
+
"comment": "Release nightly v9"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-tree",
|
|
19
|
+
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230310-0421.1",
|
|
20
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-tree",
|
|
25
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230310-0421.1",
|
|
26
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-tree",
|
|
31
|
+
"comment": "Bump @fluentui/react-avatar to v0.0.0-nightly-20230310-0421.1",
|
|
32
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-tree",
|
|
37
|
+
"comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230310-0421.1",
|
|
38
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-tree",
|
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230310-0421.1",
|
|
44
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-tree",
|
|
49
|
+
"comment": "Bump @fluentui/react-portal to v0.0.0-nightly-20230310-0421.1",
|
|
50
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@fluentui/react-tree",
|
|
55
|
+
"comment": "Bump @fluentui/react-button to v0.0.0-nightly-20230310-0421.1",
|
|
56
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@fluentui/react-tree",
|
|
61
|
+
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230310-0421.1",
|
|
62
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@fluentui/react-tree",
|
|
67
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230310-0421.1",
|
|
68
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "beachball",
|
|
72
|
+
"package": "@fluentui/react-tree",
|
|
73
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230310-0421.1",
|
|
74
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@fluentui/react-tree",
|
|
79
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230310-0421.1",
|
|
80
|
+
"commit": "4eb253fe218a0665b7efe33aaacdefa2c49eb3cb"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Change Log - @fluentui/react-tree
|
|
2
|
+
|
|
3
|
+
This log was last generated on Fri, 10 Mar 2023 04:30:51 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
<!-- Start content -->
|
|
6
|
+
|
|
7
|
+
## [0.0.0-nightly-20230310-0421.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v0.0.0-nightly-20230310-0421.1)
|
|
8
|
+
|
|
9
|
+
Fri, 10 Mar 2023 04:30:51 GMT
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
14
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
15
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
16
|
+
- Bump @fluentui/react-avatar to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
17
|
+
- Bump @fluentui/react-aria to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
19
|
+
- Bump @fluentui/react-portal to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
20
|
+
- Bump @fluentui/react-button to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
21
|
+
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
22
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
|
24
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230310-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/4eb253fe218a0665b7efe33aaacdefa2c49eb3cb) by beachball)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@fluentui/react-tree
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14
|
+
|
|
15
|
+
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
|
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# @fluentui/react-tree
|
|
2
|
+
|
|
3
|
+
**React Tree components for [Fluent UI React](https://react.fluentui.dev/)**
|
|
4
|
+
|
|
5
|
+
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
import { ArrowDown } from '@fluentui/keyboard-keys';
|
|
4
|
+
import { ArrowLeft } from '@fluentui/keyboard-keys';
|
|
5
|
+
import { ArrowRight } from '@fluentui/keyboard-keys';
|
|
6
|
+
import { ArrowUp } from '@fluentui/keyboard-keys';
|
|
7
|
+
import type { AvatarContextValue } from '@fluentui/react-avatar';
|
|
8
|
+
import type { AvatarSize } from '@fluentui/react-avatar';
|
|
9
|
+
import type { ButtonContextValue } from '@fluentui/react-button';
|
|
10
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
11
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
|
12
|
+
import { ContextSelector } from '@fluentui/react-context-selector';
|
|
13
|
+
import { End } from '@fluentui/keyboard-keys';
|
|
14
|
+
import { Enter } from '@fluentui/keyboard-keys';
|
|
15
|
+
import type { ExtractSlotProps } from '@fluentui/react-utilities';
|
|
16
|
+
import { FC } from 'react';
|
|
17
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
18
|
+
import { Home } from '@fluentui/keyboard-keys';
|
|
19
|
+
import { Provider } from 'react';
|
|
20
|
+
import { ProviderProps } from 'react';
|
|
21
|
+
import * as React_2 from 'react';
|
|
22
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
23
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Converts a nested structure to a flat one which can be consumed by `useFlatTreeItems`
|
|
27
|
+
*/
|
|
28
|
+
export declare const flattenTree_unstable: (items: NestedTreeItem[]) => FlatTreeItem[];
|
|
29
|
+
|
|
30
|
+
export declare type FlatTreeItem = Required<Pick<TreeItemProps, 'id'>> & TreeItemProps & {
|
|
31
|
+
parentId?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export declare type FlatTreeItemProps = Required<Pick<TreeItemProps, 'id' | 'aria-level' | 'aria-posinset' | 'leaf' | 'aria-setsize'>> & TreeItemProps;
|
|
35
|
+
|
|
36
|
+
export declare type FlatTreeProps = Required<Pick<TreeProps, 'openItems' | 'onOpenChange' | 'onNavigation_unstable'> & {
|
|
37
|
+
ref: React_2.Ref<HTMLDivElement>;
|
|
38
|
+
}>;
|
|
39
|
+
|
|
40
|
+
declare interface ImmutableSet<Value> {
|
|
41
|
+
/**
|
|
42
|
+
* The number of (unique) elements in a ImmutableSet.
|
|
43
|
+
*/
|
|
44
|
+
readonly size: number;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new ImmutableSet containing all previous element plus the one provided as argument
|
|
47
|
+
* @param value - new value to be included in the new ImmutableSet instance
|
|
48
|
+
*/
|
|
49
|
+
add(value: Value): ImmutableSet<Value>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns a reference to ImmutableSet.emptySet
|
|
52
|
+
*/
|
|
53
|
+
clear(): ImmutableSet<Value>;
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new ImmutableSet with the original items and removes a specified value from the new ImmutableSet.
|
|
56
|
+
*/
|
|
57
|
+
delete(value: Value): ImmutableSet<Value>;
|
|
58
|
+
/**
|
|
59
|
+
* @returns a boolean indicating whether an element with the specified value exists in the ImmutableSet or not.
|
|
60
|
+
*/
|
|
61
|
+
has(value: Value): boolean;
|
|
62
|
+
/** Iterates over values in the ImmutableSet. */
|
|
63
|
+
[Symbol.iterator](): IterableIterator<Value>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare type LazyArray<Value> = {
|
|
67
|
+
map<NextValue>(fn: (child: Value) => NextValue): NextValue[];
|
|
68
|
+
toArray(): Value[];
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export declare type LazyFlatTreeItems = LazyArray<FlatTreeItemProps> & {
|
|
72
|
+
get(id: string): TreeItemPropsReference | null;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare type NestedTreeItem = Omit<TreeItemProps, 'subtree'> & {
|
|
76
|
+
subtree?: NestedTreeItem[];
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export declare const renderTree_unstable: (state: TreeState, contextValues: TreeContextValues) => JSX.Element;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Render the final JSX of TreeItem
|
|
83
|
+
*/
|
|
84
|
+
export declare const renderTreeItem_unstable: (state: TreeItemState, contextValues: TreeItemContextValues) => JSX.Element;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Render the final JSX of TreeItemLayout
|
|
88
|
+
*/
|
|
89
|
+
export declare const renderTreeItemLayout_unstable: (state: TreeItemLayoutState) => JSX.Element;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Render the final JSX of TreeItemPersonaLayout
|
|
93
|
+
*/
|
|
94
|
+
export declare const renderTreeItemPersonaLayout_unstable: (state: TreeItemPersonaLayoutState, contextValues: TreeItemPersonaLayoutContextValues) => JSX.Element;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A tree view widget presents a hierarchical list.
|
|
98
|
+
* Any item in the hierarchy may have child items,
|
|
99
|
+
* and items that have children may be expanded or collapsed to show or hide the children.
|
|
100
|
+
* For example, in a file system navigator that uses a tree view to display folders and files,
|
|
101
|
+
* an item representing a folder can be expanded to reveal the contents of the folder,
|
|
102
|
+
* which may be files, folders, or both.
|
|
103
|
+
*/
|
|
104
|
+
export declare const Tree: ForwardRefComponent<TreeProps>;
|
|
105
|
+
|
|
106
|
+
export declare const treeClassNames: SlotClassNames<TreeSlots>;
|
|
107
|
+
|
|
108
|
+
export declare type TreeContextValue = {
|
|
109
|
+
level: number;
|
|
110
|
+
appearance: 'subtle' | 'subtle-alpha' | 'transparent';
|
|
111
|
+
size: 'small' | 'medium';
|
|
112
|
+
openItems: ImmutableSet<TreeItemId>;
|
|
113
|
+
/**
|
|
114
|
+
* Requests dialog main component to update it's internal open state
|
|
115
|
+
*/
|
|
116
|
+
requestOpenChange(data: TreeOpenChangeData): void;
|
|
117
|
+
requestNavigation(data: TreeNavigationData_unstable): void;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
declare type TreeContextValues = {
|
|
121
|
+
tree: TreeContextValue;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* TreeItem component - TODO: add more docs
|
|
126
|
+
*/
|
|
127
|
+
export declare const TreeItem: ForwardRefComponent<TreeItemProps>;
|
|
128
|
+
|
|
129
|
+
export declare const treeItemClassNames: SlotClassNames<TreeItemSlots>;
|
|
130
|
+
|
|
131
|
+
declare type TreeItemContextValue = {
|
|
132
|
+
isActionsVisible: boolean;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
declare type TreeItemContextValues = {
|
|
136
|
+
treeItem: TreeItemContextValue;
|
|
137
|
+
button: ButtonContextValue;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
declare type TreeItemCSSProperties = React_2.CSSProperties & {
|
|
141
|
+
[treeItemLevelToken]?: string | number;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export declare type TreeItemId = string | number;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* TreeItemLayout component - TODO: add more docs
|
|
148
|
+
*/
|
|
149
|
+
export declare const TreeItemLayout: ForwardRefComponent<TreeItemLayoutProps>;
|
|
150
|
+
|
|
151
|
+
export declare const treeItemLayoutClassNames: SlotClassNames<TreeItemLayoutSlots>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* TreeItemLayout Props
|
|
155
|
+
*/
|
|
156
|
+
export declare type TreeItemLayoutProps = ComponentProps<Partial<TreeItemLayoutSlots>>;
|
|
157
|
+
|
|
158
|
+
export declare type TreeItemLayoutSlots = {
|
|
159
|
+
root: Slot<'div'>;
|
|
160
|
+
/**
|
|
161
|
+
* Icon slot that renders right before main content
|
|
162
|
+
*/
|
|
163
|
+
iconBefore?: Slot<'span'>;
|
|
164
|
+
/**
|
|
165
|
+
* Icon slot that renders right after main content
|
|
166
|
+
*/
|
|
167
|
+
iconAfter?: Slot<'span'>;
|
|
168
|
+
aside?: Slot<'span'>;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* State used in rendering TreeItemLayout
|
|
173
|
+
*/
|
|
174
|
+
export declare type TreeItemLayoutState = ComponentState<TreeItemLayoutSlots> & TreeItemContextValue;
|
|
175
|
+
|
|
176
|
+
export declare const treeItemLevelToken: "--fluent-TreeItem--level";
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* TreeItemPersonaLayout component - TODO: add more docs
|
|
180
|
+
*/
|
|
181
|
+
export declare const TreeItemPersonaLayout: ForwardRefComponent<TreeItemPersonaLayoutProps>;
|
|
182
|
+
|
|
183
|
+
export declare const treeItemPersonaLayoutClassNames: SlotClassNames<TreeItemPersonaLayoutSlots>;
|
|
184
|
+
|
|
185
|
+
declare type TreeItemPersonaLayoutContextValues = {
|
|
186
|
+
avatar: AvatarContextValue;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* TreeItemPersonaLayout Props
|
|
191
|
+
*/
|
|
192
|
+
export declare type TreeItemPersonaLayoutProps = ComponentProps<Partial<TreeItemPersonaLayoutSlots>>;
|
|
193
|
+
|
|
194
|
+
export declare type TreeItemPersonaLayoutSlots = {
|
|
195
|
+
root: Slot<'span'>;
|
|
196
|
+
/**
|
|
197
|
+
* Avatar to display.
|
|
198
|
+
*/
|
|
199
|
+
media: NonNullable<Slot<'span'>>;
|
|
200
|
+
/**
|
|
201
|
+
* Main text. Children of the root slot are automatically rendered here
|
|
202
|
+
*/
|
|
203
|
+
main: Slot<'span'>;
|
|
204
|
+
/**
|
|
205
|
+
* Secondary text that describes or complements the main text
|
|
206
|
+
*/
|
|
207
|
+
description?: Slot<'span'>;
|
|
208
|
+
/**
|
|
209
|
+
* aside text that works as extra textual information
|
|
210
|
+
*/
|
|
211
|
+
aside?: Slot<'span'>;
|
|
212
|
+
/**
|
|
213
|
+
* A layout wrapper for the main and description slots
|
|
214
|
+
*/
|
|
215
|
+
content: Slot<'div'>;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* State used in rendering TreeItemPersonaLayout
|
|
220
|
+
*/
|
|
221
|
+
export declare type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaLayoutSlots> & TreeItemContextValue & {
|
|
222
|
+
avatarSize: AvatarSize;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* TreeItem Props
|
|
227
|
+
*/
|
|
228
|
+
export declare type TreeItemProps = ComponentProps<Partial<TreeItemSlots>> & {
|
|
229
|
+
/**
|
|
230
|
+
* If a TreeItem is a leaf, it'll not present the `expandIcon` slot by default.
|
|
231
|
+
* This attribute is used to force the decision if a TreeItem is a leaf or not. By not providing this property
|
|
232
|
+
* this will be inferred by the presence of a subtree as part of the TreeItem children.
|
|
233
|
+
*/
|
|
234
|
+
leaf?: boolean;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
declare type TreeItemPropsReference = {
|
|
238
|
+
props: Required<Pick<TreeItemProps, 'id' | 'aria-level' | 'aria-posinset' | 'leaf'>> & TreeItemProps;
|
|
239
|
+
parentId?: string;
|
|
240
|
+
childrenSize: number;
|
|
241
|
+
index: number;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export declare const TreeItemProvider: React_2.Provider<TreeItemContextValue | undefined>;
|
|
245
|
+
|
|
246
|
+
export declare type TreeItemSlots = {
|
|
247
|
+
root: Slot<ExtractSlotProps<Slot<'div'> & {
|
|
248
|
+
style?: TreeItemCSSProperties;
|
|
249
|
+
}>>;
|
|
250
|
+
content: NonNullable<Slot<'div'>>;
|
|
251
|
+
subtree?: Slot<'span'>;
|
|
252
|
+
/**
|
|
253
|
+
* Expand icon slot,
|
|
254
|
+
* by default renders a chevron icon to indicate opening and closing
|
|
255
|
+
*/
|
|
256
|
+
expandIcon?: Slot<'span'>;
|
|
257
|
+
/**
|
|
258
|
+
* Actions slot that renders on the end of tree item
|
|
259
|
+
* when the item is hovered/focused
|
|
260
|
+
*/
|
|
261
|
+
actions?: Slot<'span'>;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* State used in rendering TreeItem
|
|
266
|
+
*/
|
|
267
|
+
export declare type TreeItemState = ComponentState<TreeItemSlots> & {
|
|
268
|
+
open: boolean;
|
|
269
|
+
isLeaf: boolean;
|
|
270
|
+
level: number;
|
|
271
|
+
/**
|
|
272
|
+
* By design, a button included on the actions slot should be small
|
|
273
|
+
*/
|
|
274
|
+
buttonSize: 'small';
|
|
275
|
+
isActionsVisible: boolean;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export declare type TreeNavigationData_unstable = {
|
|
279
|
+
event: React_2.MouseEvent<HTMLElement>;
|
|
280
|
+
target: HTMLElement;
|
|
281
|
+
type: 'Click';
|
|
282
|
+
} | {
|
|
283
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
284
|
+
target: HTMLElement;
|
|
285
|
+
type: 'TypeAhead';
|
|
286
|
+
} | {
|
|
287
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
288
|
+
target: HTMLElement;
|
|
289
|
+
type: typeof ArrowRight;
|
|
290
|
+
} | {
|
|
291
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
292
|
+
target: HTMLElement;
|
|
293
|
+
type: typeof ArrowLeft;
|
|
294
|
+
} | {
|
|
295
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
296
|
+
target: HTMLElement;
|
|
297
|
+
type: typeof ArrowUp;
|
|
298
|
+
} | {
|
|
299
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
300
|
+
target: HTMLElement;
|
|
301
|
+
type: typeof ArrowDown;
|
|
302
|
+
} | {
|
|
303
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
304
|
+
target: HTMLElement;
|
|
305
|
+
type: typeof Home;
|
|
306
|
+
} | {
|
|
307
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
308
|
+
target: HTMLElement;
|
|
309
|
+
type: typeof End;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export declare type TreeNavigationEvent_unstable = TreeNavigationData_unstable['event'];
|
|
313
|
+
|
|
314
|
+
export declare type TreeOpenChangeData = {
|
|
315
|
+
open: boolean;
|
|
316
|
+
} & ({
|
|
317
|
+
event: React_2.MouseEvent<HTMLElement>;
|
|
318
|
+
target: HTMLElement;
|
|
319
|
+
type: 'ExpandIconClick';
|
|
320
|
+
} | {
|
|
321
|
+
event: React_2.MouseEvent<HTMLElement>;
|
|
322
|
+
target: HTMLElement;
|
|
323
|
+
type: 'Click';
|
|
324
|
+
} | {
|
|
325
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
326
|
+
target: HTMLElement;
|
|
327
|
+
type: typeof Enter;
|
|
328
|
+
} | {
|
|
329
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
330
|
+
target: HTMLElement;
|
|
331
|
+
type: typeof ArrowRight;
|
|
332
|
+
} | {
|
|
333
|
+
event: React_2.KeyboardEvent<HTMLElement>;
|
|
334
|
+
target: HTMLElement;
|
|
335
|
+
type: typeof ArrowLeft;
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
export declare type TreeOpenChangeEvent = TreeOpenChangeData['event'];
|
|
339
|
+
|
|
340
|
+
export declare type TreeProps = ComponentProps<TreeSlots> & {
|
|
341
|
+
/**
|
|
342
|
+
* A tree item can have various appearances:
|
|
343
|
+
* - 'subtle' (default): The default tree item styles.
|
|
344
|
+
* - 'subtle-alpha': Minimizes emphasis on hovered or focused states.
|
|
345
|
+
* - 'transparent': Removes background color.
|
|
346
|
+
* @default 'subtle'
|
|
347
|
+
*/
|
|
348
|
+
appearance?: 'subtle' | 'subtle-alpha' | 'transparent';
|
|
349
|
+
/**
|
|
350
|
+
* Size of the tree item.
|
|
351
|
+
* @default 'medium'
|
|
352
|
+
*/
|
|
353
|
+
size?: 'small' | 'medium';
|
|
354
|
+
/**
|
|
355
|
+
* This refers to a list of ids of opened tree items.
|
|
356
|
+
* Controls the state of the open tree items.
|
|
357
|
+
* These property is ignored for subtrees.
|
|
358
|
+
*/
|
|
359
|
+
openItems?: Iterable<TreeItemId>;
|
|
360
|
+
/**
|
|
361
|
+
* This refers to a list of ids of opened tree items.
|
|
362
|
+
* Default value for the uncontrolled state of open tree items.
|
|
363
|
+
* These property is ignored for subtrees.
|
|
364
|
+
*/
|
|
365
|
+
defaultOpenItems?: Iterable<TreeItemId>;
|
|
366
|
+
/**
|
|
367
|
+
* Callback fired when the component changes value from open state.
|
|
368
|
+
* These property is ignored for subtrees.
|
|
369
|
+
*
|
|
370
|
+
* @param event - a React's Synthetic event
|
|
371
|
+
* @param data - A data object with relevant information,
|
|
372
|
+
* such as open value and type of interaction that created the event.
|
|
373
|
+
*/
|
|
374
|
+
onOpenChange?(event: TreeOpenChangeEvent, data: TreeOpenChangeData): void;
|
|
375
|
+
/**
|
|
376
|
+
* Callback fired when navigation happens inside the component.
|
|
377
|
+
* These property is ignored for subtrees.
|
|
378
|
+
*
|
|
379
|
+
* FIXME: This method is not ideal, as navigation should be handled internally by tabster.
|
|
380
|
+
*
|
|
381
|
+
* @param event - a React's Synthetic event
|
|
382
|
+
* @param data - A data object with relevant information,
|
|
383
|
+
*/
|
|
384
|
+
onNavigation_unstable?(event: TreeNavigationEvent_unstable, data: TreeNavigationData_unstable): void;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export declare const TreeProvider: Provider<TreeContextValue | undefined> & FC<ProviderProps<TreeContextValue | undefined>>;
|
|
388
|
+
|
|
389
|
+
export declare type TreeSlots = {
|
|
390
|
+
root: Slot<'div'>;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* State used in rendering Tree
|
|
395
|
+
*/
|
|
396
|
+
export declare type TreeState = ComponentState<TreeSlots> & TreeContextValue;
|
|
397
|
+
|
|
398
|
+
export declare function useFlatTreeItems_unstable(items: FlatTreeItem[], options?: UseFlatTreeItemsOptions): readonly [FlatTreeProps, LazyFlatTreeItems];
|
|
399
|
+
|
|
400
|
+
export declare type UseFlatTreeItemsOptions = Pick<TreeProps, 'openItems' | 'defaultOpenItems'>;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Create the state required to render Tree.
|
|
404
|
+
*
|
|
405
|
+
* The returned state can be modified with hooks such as useTreeStyles_unstable,
|
|
406
|
+
* before being passed to renderTree_unstable.
|
|
407
|
+
*
|
|
408
|
+
* @param props - props from this instance of Tree
|
|
409
|
+
* @param ref - reference to root HTMLElement of Tree
|
|
410
|
+
*/
|
|
411
|
+
export declare const useTree_unstable: (props: TreeProps, ref: React_2.Ref<HTMLElement>) => TreeState;
|
|
412
|
+
|
|
413
|
+
export declare const useTreeContext_unstable: <T>(selector: ContextSelector<TreeContextValue, T>) => T;
|
|
414
|
+
|
|
415
|
+
export declare function useTreeContextValues_unstable(state: TreeState): TreeContextValues;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Create the state required to render TreeItem.
|
|
419
|
+
*
|
|
420
|
+
* The returned state can be modified with hooks such as useTreeItemStyles_unstable,
|
|
421
|
+
* before being passed to renderTreeItem_unstable.
|
|
422
|
+
*
|
|
423
|
+
* @param props - props from this instance of TreeItem
|
|
424
|
+
* @param ref - reference to root HTMLElement of TreeItem
|
|
425
|
+
*/
|
|
426
|
+
export declare const useTreeItem_unstable: (props: TreeItemProps, ref: React_2.Ref<HTMLDivElement>) => TreeItemState;
|
|
427
|
+
|
|
428
|
+
export declare const useTreeItemContext_unstable: () => TreeItemContextValue;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Create the state required to render TreeItemLayout.
|
|
432
|
+
*
|
|
433
|
+
* The returned state can be modified with hooks such as useTreeItemLayoutStyles_unstable,
|
|
434
|
+
* before being passed to renderTreeItemLayout_unstable.
|
|
435
|
+
*
|
|
436
|
+
* @param props - props from this instance of TreeItemLayout
|
|
437
|
+
* @param ref - reference to root HTMLElement of TreeItemLayout
|
|
438
|
+
*/
|
|
439
|
+
export declare const useTreeItemLayout_unstable: (props: TreeItemLayoutProps, ref: React_2.Ref<HTMLElement>) => TreeItemLayoutState;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Apply styling to the TreeItemLayout slots based on the state
|
|
443
|
+
*/
|
|
444
|
+
export declare const useTreeItemLayoutStyles_unstable: (state: TreeItemLayoutState) => TreeItemLayoutState;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Create the state required to render TreeItemPersonaLayout.
|
|
448
|
+
*
|
|
449
|
+
* The returned state can be modified with hooks such as useTreeItemPersonaLayoutStyles_unstable,
|
|
450
|
+
* before being passed to renderTreeItemPersonaLayout_unstable.
|
|
451
|
+
*
|
|
452
|
+
* @param props - props from this instance of TreeItemPersonaLayout
|
|
453
|
+
* @param ref - reference to root HTMLElement of TreeItemPersonaLayout
|
|
454
|
+
*/
|
|
455
|
+
export declare const useTreeItemPersonaLayout_unstable: (props: TreeItemPersonaLayoutProps, ref: React_2.Ref<HTMLSpanElement>) => TreeItemPersonaLayoutState;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Apply styling to the TreeItemPersonaLayout slots based on the state
|
|
459
|
+
*/
|
|
460
|
+
export declare const useTreeItemPersonaLayoutStyles_unstable: (state: TreeItemPersonaLayoutState) => TreeItemPersonaLayoutState;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Apply styling to the TreeItem slots based on the state
|
|
464
|
+
*/
|
|
465
|
+
export declare const useTreeItemStyles_unstable: (state: TreeItemState) => TreeItemState;
|
|
466
|
+
|
|
467
|
+
export declare const useTreeStyles_unstable: (state: TreeState) => TreeState;
|
|
468
|
+
|
|
469
|
+
export { }
|
package/lib/Tree.js
ADDED
package/lib/Tree.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tree/src/Tree.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Tree/index';\n"]}
|
package/lib/TreeItem.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeItem.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tree/src/TreeItem.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './components/TreeItem/index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeItemLayout.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tree/src/TreeItemLayout.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/TreeItemLayout/index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeItemPersonaLayout.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-tree/src/TreeItemPersonaLayout.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC","sourcesContent":["export * from './components/TreeItemPersonaLayout/index';\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useTree_unstable } from './useTree';
|
|
3
|
+
import { renderTree_unstable } from './renderTree';
|
|
4
|
+
import { useTreeStyles_unstable } from './useTreeStyles';
|
|
5
|
+
import { useTreeContextValues_unstable } from './useTreeContextValues';
|
|
6
|
+
/**
|
|
7
|
+
* A tree view widget presents a hierarchical list.
|
|
8
|
+
* Any item in the hierarchy may have child items,
|
|
9
|
+
* and items that have children may be expanded or collapsed to show or hide the children.
|
|
10
|
+
* For example, in a file system navigator that uses a tree view to display folders and files,
|
|
11
|
+
* an item representing a folder can be expanded to reveal the contents of the folder,
|
|
12
|
+
* which may be files, folders, or both.
|
|
13
|
+
*/
|
|
14
|
+
export const Tree = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
|
+
const state = useTree_unstable(props, ref);
|
|
16
|
+
useTreeStyles_unstable(state);
|
|
17
|
+
const contextValues = useTreeContextValues_unstable(state);
|
|
18
|
+
return renderTree_unstable(state, contextValues);
|
|
19
|
+
});
|
|
20
|
+
Tree.displayName = 'Tree';
|
|
21
|
+
//# sourceMappingURL=Tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useTree_unstable","renderTree_unstable","useTreeStyles_unstable","useTreeContextValues_unstable","Tree","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../../../../../../../packages/react-components/react-tree/src/components/Tree/Tree.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTree_unstable } from './useTree';\nimport { renderTree_unstable } from './renderTree';\nimport { useTreeStyles_unstable } from './useTreeStyles';\nimport type { TreeProps } from './Tree.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTreeContextValues_unstable } from './useTreeContextValues';\n\n/**\n * A tree view widget presents a hierarchical list.\n * Any item in the hierarchy may have child items,\n * and items that have children may be expanded or collapsed to show or hide the children.\n * For example, in a file system navigator that uses a tree view to display folders and files,\n * an item representing a folder can be expanded to reveal the contents of the folder,\n * which may be files, folders, or both.\n */\nexport const Tree: ForwardRefComponent<TreeProps> = React.forwardRef((props, ref) => {\n const state = useTree_unstable(props, ref);\n useTreeStyles_unstable(state);\n const contextValues = useTreeContextValues_unstable(state);\n return renderTree_unstable(state, contextValues);\n});\n\nTree.displayName = 'Tree';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,sBAAsB,QAAQ,iBAAiB;AAGxD,SAASC,6BAA6B,QAAQ,wBAAwB;AAEtE;;;;;;;;AAQA,OAAO,MAAMC,IAAI,gBAAmCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAClF,MAAMC,KAAK,GAAGR,gBAAgB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAC1CL,sBAAsB,CAACM,KAAK,CAAC;EAC7B,MAAMC,aAAa,GAAGN,6BAA6B,CAACK,KAAK,CAAC;EAC1D,OAAOP,mBAAmB,CAACO,KAAK,EAAEC,aAAa,CAAC;AAClD,CAAC,CAAC;AAEFL,IAAI,CAACM,WAAW,GAAG,MAAM"}
|