@fluentui/react-tree 9.0.0-beta.12 → 9.0.0-beta.13
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 +147 -4
- package/CHANGELOG.md +34 -5
- package/dist/index.d.ts +142 -81
- package/lib/TreeItemAside.js +2 -0
- package/lib/TreeItemAside.js.map +1 -0
- package/lib/components/Tree/Tree.js +1 -1
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/Tree.types.js.map +1 -1
- package/lib/components/Tree/index.js +1 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/Tree/renderTree.js +1 -1
- package/lib/components/Tree/renderTree.js.map +1 -1
- package/lib/components/Tree/useRootTree.js +160 -0
- package/lib/components/Tree/useRootTree.js.map +1 -0
- package/lib/components/Tree/useSubtree.js +40 -0
- package/lib/components/Tree/useSubtree.js.map +1 -0
- package/lib/components/Tree/useTree.js +2 -95
- package/lib/components/Tree/useTree.js.map +1 -1
- package/lib/components/Tree/useTreeContextValues.js +2 -4
- package/lib/components/Tree/useTreeContextValues.js.map +1 -1
- package/lib/components/Tree/useTreeStyles.styles.js +30 -0
- package/lib/components/Tree/useTreeStyles.styles.js.map +1 -0
- package/lib/components/TreeItem/TreeItem.js +1 -1
- package/lib/components/TreeItem/TreeItem.js.map +1 -1
- package/lib/components/TreeItem/TreeItem.types.js.map +1 -1
- package/lib/components/TreeItem/index.js +1 -1
- package/lib/components/TreeItem/index.js.map +1 -1
- package/lib/components/TreeItem/renderTreeItem.js +2 -5
- package/lib/components/TreeItem/renderTreeItem.js.map +1 -1
- package/lib/components/TreeItem/useTreeItem.js +58 -181
- package/lib/components/TreeItem/useTreeItem.js.map +1 -1
- package/lib/components/TreeItem/useTreeItemContextValues.js +25 -11
- package/lib/components/TreeItem/useTreeItemContextValues.js.map +1 -1
- package/lib/components/TreeItem/useTreeItemStyles.styles.js +102 -0
- package/lib/components/TreeItem/useTreeItemStyles.styles.js.map +1 -0
- package/lib/components/TreeItemAside/TreeItemAside.js +15 -0
- package/lib/components/TreeItemAside/TreeItemAside.js.map +1 -0
- package/lib/components/TreeItemAside/TreeItemAside.types.js +2 -0
- package/lib/components/TreeItemAside/TreeItemAside.types.js.map +1 -0
- package/lib/components/TreeItemAside/index.js +6 -0
- package/lib/components/TreeItemAside/index.js.map +1 -0
- package/lib/components/TreeItemAside/renderTreeItemAside.js +19 -0
- package/lib/components/TreeItemAside/renderTreeItemAside.js.map +1 -0
- package/lib/components/TreeItemAside/useTreeItemAside.js +35 -0
- package/lib/components/TreeItemAside/useTreeItemAside.js.map +1 -0
- package/lib/components/TreeItemAside/useTreeItemAsideStyles.styles.js +47 -0
- package/lib/components/TreeItemAside/useTreeItemAsideStyles.styles.js.map +1 -0
- package/lib/components/TreeItemChevron.js +27 -0
- package/lib/components/TreeItemChevron.js.map +1 -0
- package/lib/components/TreeItemLayout/TreeItemLayout.js +1 -1
- package/lib/components/TreeItemLayout/TreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/TreeItemLayout.types.js.map +1 -1
- package/lib/components/TreeItemLayout/index.js +1 -1
- package/lib/components/TreeItemLayout/index.js.map +1 -1
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js +1 -4
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/useTreeItemLayout.js +16 -11
- package/lib/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js +138 -0
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +1 -1
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/index.js +1 -1
- package/lib/components/TreeItemPersonaLayout/index.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +2 -5
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +16 -20
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutStyles.js → useTreeItemPersonaLayoutStyles.styles.js} +46 -18
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js.map +1 -0
- package/lib/contexts/treeContext.js +1 -2
- package/lib/contexts/treeContext.js.map +1 -1
- package/lib/contexts/treeItemContext.js +12 -4
- package/lib/contexts/treeItemContext.js.map +1 -1
- package/lib/hooks/useFlatTree.js +7 -7
- package/lib/hooks/useFlatTree.js.map +1 -1
- package/lib/hooks/useFlatTreeNavigation.js +8 -8
- package/lib/hooks/useFlatTreeNavigation.js.map +1 -1
- package/lib/hooks/useNestedTreeNavigation.js +8 -8
- package/lib/hooks/useNestedTreeNavigation.js.map +1 -1
- package/lib/hooks/useOpenItemsState.js +1 -1
- package/lib/hooks/useOpenItemsState.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/utils/createFlatTreeItems.js +12 -10
- package/lib/utils/createFlatTreeItems.js.map +1 -1
- package/lib/utils/flattenTree.js +0 -29
- package/lib/utils/flattenTree.js.map +1 -1
- package/lib/utils/tokens.js +11 -11
- package/lib/utils/tokens.js.map +1 -1
- package/lib-commonjs/TreeItemAside.js +9 -0
- package/lib-commonjs/TreeItemAside.js.map +1 -0
- package/lib-commonjs/components/Tree/Tree.js +2 -2
- package/lib-commonjs/components/Tree/Tree.js.map +1 -1
- package/lib-commonjs/components/Tree/index.js +1 -1
- package/lib-commonjs/components/Tree/index.js.map +1 -1
- package/lib-commonjs/components/Tree/renderTree.js +1 -1
- package/lib-commonjs/components/Tree/renderTree.js.map +1 -1
- package/lib-commonjs/components/Tree/useRootTree.js +151 -0
- package/lib-commonjs/components/Tree/useRootTree.js.map +1 -0
- package/lib-commonjs/components/Tree/useSubtree.js +41 -0
- package/lib-commonjs/components/Tree/useSubtree.js.map +1 -0
- package/lib-commonjs/components/Tree/useTree.js +4 -89
- package/lib-commonjs/components/Tree/useTree.js.map +1 -1
- package/lib-commonjs/components/Tree/useTreeContextValues.js +2 -3
- package/lib-commonjs/components/Tree/useTreeContextValues.js.map +1 -1
- package/lib-commonjs/components/Tree/{useTreeStyles.js → useTreeStyles.styles.js} +21 -4
- package/lib-commonjs/components/Tree/useTreeStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItem/TreeItem.js +2 -2
- package/lib-commonjs/components/TreeItem/TreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/index.js +1 -1
- package/lib-commonjs/components/TreeItem/index.js.map +1 -1
- package/lib-commonjs/components/TreeItem/renderTreeItem.js +2 -5
- package/lib-commonjs/components/TreeItem/renderTreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItem.js +55 -172
- package/lib-commonjs/components/TreeItem/useTreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItemContextValues.js +16 -15
- package/lib-commonjs/components/TreeItem/useTreeItemContextValues.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.styles.js +208 -0
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItemAside/TreeItemAside.js +21 -0
- package/lib-commonjs/components/TreeItemAside/TreeItemAside.js.map +1 -0
- package/lib-commonjs/components/TreeItemAside/TreeItemAside.types.js +7 -0
- package/lib-commonjs/components/TreeItemAside/TreeItemAside.types.js.map +1 -0
- package/lib-commonjs/components/TreeItemAside/index.js +13 -0
- package/lib-commonjs/components/TreeItemAside/index.js.map +1 -0
- package/lib-commonjs/components/TreeItemAside/renderTreeItemAside.js +22 -0
- package/lib-commonjs/components/TreeItemAside/renderTreeItemAside.js.map +1 -0
- package/lib-commonjs/components/TreeItemAside/useTreeItemAside.js +33 -0
- package/lib-commonjs/components/TreeItemAside/useTreeItemAside.js.map +1 -0
- package/lib-commonjs/components/TreeItemAside/useTreeItemAsideStyles.styles.js +92 -0
- package/lib-commonjs/components/TreeItemAside/useTreeItemAsideStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItemChevron.js +35 -0
- package/lib-commonjs/components/TreeItemChevron.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.js +2 -2
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/index.js +1 -1
- package/lib-commonjs/components/TreeItemLayout/index.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js +1 -2
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js +15 -10
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js +223 -0
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +2 -2
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/index.js +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/index.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +2 -3
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +14 -14
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/{useTreeItemPersonaLayoutStyles.js → useTreeItemPersonaLayoutStyles.styles.js} +82 -28
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/treeContext.js +1 -2
- package/lib-commonjs/contexts/treeContext.js.map +1 -1
- package/lib-commonjs/contexts/treeItemContext.js +12 -4
- package/lib-commonjs/contexts/treeItemContext.js.map +1 -1
- package/lib-commonjs/hooks/useFlatTree.js +7 -7
- package/lib-commonjs/hooks/useFlatTree.js.map +1 -1
- package/lib-commonjs/hooks/useFlatTreeNavigation.js +8 -8
- package/lib-commonjs/hooks/useFlatTreeNavigation.js.map +1 -1
- package/lib-commonjs/hooks/useNestedTreeNavigation.js +8 -8
- package/lib-commonjs/hooks/useNestedTreeNavigation.js.map +1 -1
- package/lib-commonjs/hooks/useOpenItemsState.js +1 -3
- package/lib-commonjs/hooks/useOpenItemsState.js.map +1 -1
- package/lib-commonjs/index.js +6 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/createFlatTreeItems.js +12 -10
- package/lib-commonjs/utils/createFlatTreeItems.js.map +1 -1
- package/lib-commonjs/utils/flattenTree.js +4 -37
- package/lib-commonjs/utils/flattenTree.js.map +1 -1
- package/lib-commonjs/utils/tokens.js +10 -10
- package/lib-commonjs/utils/tokens.js.map +1 -1
- package/package.json +15 -14
- package/.swcrc +0 -30
- package/lib/components/Tree/useTreeStyles.js +0 -20
- package/lib/components/Tree/useTreeStyles.js.map +0 -1
- package/lib/components/TreeItem/useTreeItemStyles.js +0 -203
- package/lib/components/TreeItem/useTreeItemStyles.js.map +0 -1
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.js +0 -98
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.js.map +0 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +0 -1
- package/lib-commonjs/components/Tree/useTreeStyles.js.map +0 -1
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.js +0 -375
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.js.map +0 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.js +0 -143
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.js.map +0 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +0 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,150 @@
|
|
|
2
2
|
"name": "@fluentui/react-tree",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 12 May 2023 20:22:30 GMT",
|
|
6
|
+
"tag": "@fluentui/react-tree_v9.0.0-beta.13",
|
|
7
|
+
"version": "9.0.0-beta.13",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "olfedias@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-tree",
|
|
13
|
+
"commit": "c28decb23d191a0daaaf6d5d1832429715102129",
|
|
14
|
+
"comment": "chore: exclude .swcrc from being published"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-tree",
|
|
19
|
+
"commit": "e61227d7e52d4210b0a108657e6c56c0cfaf8498",
|
|
20
|
+
"comment": "feat: TreeItem itemType restructure"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
24
|
+
"package": "@fluentui/react-tree",
|
|
25
|
+
"commit": "e741b289a0cda2711146d171d3b08deb8bb7a156",
|
|
26
|
+
"comment": "feat: creates TreeItemAside component"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
30
|
+
"package": "@fluentui/react-tree",
|
|
31
|
+
"commit": "53c5190f2774c4b42777af53f3739bf2949678e2",
|
|
32
|
+
"comment": "feat: makes useFlatTree generic"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
36
|
+
"package": "@fluentui/react-tree",
|
|
37
|
+
"commit": "fa0f2ce25e94ddc8759f545638e01cc34e0e99f4",
|
|
38
|
+
"comment": "chore: updates useOpenItemsState internals"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "olfedias@microsoft.com",
|
|
42
|
+
"package": "@fluentui/react-tree",
|
|
43
|
+
"commit": "9d6394b6c751092fd1d4e26ccc618b5ba05086ec",
|
|
44
|
+
"comment": "chore: move makeStyles() calls to .styles.ts files"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
48
|
+
"package": "@fluentui/react-tree",
|
|
49
|
+
"commit": "d85ae6d21f5c6db877d62ccb1e9270848afbf1bb",
|
|
50
|
+
"comment": "feat: adds lazy loading story"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
54
|
+
"package": "@fluentui/react-tree",
|
|
55
|
+
"commit": "be291a28d39881ce6607f465efc5c7402b2e014c",
|
|
56
|
+
"comment": "bugfix: fix horizontal overflow on tree"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
60
|
+
"package": "@fluentui/react-tree",
|
|
61
|
+
"commit": "27f252e27361df75a94c5bc5b09fc0097fefd969",
|
|
62
|
+
"comment": "bugfix: fix VisibleFlatTreeItemGenerator omitting visible items"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@fluentui/react-tree",
|
|
67
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.3",
|
|
68
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "beachball",
|
|
72
|
+
"package": "@fluentui/react-tree",
|
|
73
|
+
"comment": "Bump @fluentui/react-aria to v9.3.19",
|
|
74
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@fluentui/react-tree",
|
|
79
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.0",
|
|
80
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"author": "beachball",
|
|
84
|
+
"package": "@fluentui/react-tree",
|
|
85
|
+
"comment": "Bump @fluentui/react-button to v9.3.11",
|
|
86
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"author": "beachball",
|
|
90
|
+
"package": "@fluentui/react-tree",
|
|
91
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.19",
|
|
92
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"author": "beachball",
|
|
96
|
+
"package": "@fluentui/react-tree",
|
|
97
|
+
"comment": "Bump @fluentui/react-portal to v9.2.7",
|
|
98
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"author": "beachball",
|
|
102
|
+
"package": "@fluentui/react-tree",
|
|
103
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.4.0",
|
|
104
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"author": "beachball",
|
|
108
|
+
"package": "@fluentui/react-tree",
|
|
109
|
+
"comment": "Bump @fluentui/react-tabster to v9.7.0",
|
|
110
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"author": "beachball",
|
|
114
|
+
"package": "@fluentui/react-tree",
|
|
115
|
+
"comment": "Bump @fluentui/react-theme to v9.1.8",
|
|
116
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"author": "beachball",
|
|
120
|
+
"package": "@fluentui/react-tree",
|
|
121
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.1",
|
|
122
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"author": "beachball",
|
|
126
|
+
"package": "@fluentui/react-tree",
|
|
127
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.3",
|
|
128
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"author": "beachball",
|
|
132
|
+
"package": "@fluentui/react-tree",
|
|
133
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21",
|
|
134
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"none": [
|
|
138
|
+
{
|
|
139
|
+
"author": "martinhochel@microsoft.com",
|
|
140
|
+
"package": "@fluentui/react-tree",
|
|
141
|
+
"commit": "dbda7fa69e3000aaf8dd4a061e254ebd35198b8e",
|
|
142
|
+
"comment": "fix: update npmignore files to fix npm8/node16 regression how npm publish works"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"date": "Mon, 24 Apr 2023 08:12:44 GMT",
|
|
6
149
|
"tag": "@fluentui/react-tree_v9.0.0-beta.12",
|
|
7
150
|
"version": "9.0.0-beta.12",
|
|
8
151
|
"comments": {
|
|
@@ -35,19 +178,19 @@
|
|
|
35
178
|
"author": "beachball",
|
|
36
179
|
"package": "@fluentui/react-tree",
|
|
37
180
|
"comment": "Bump @fluentui/react-avatar to v9.4.10",
|
|
38
|
-
"commit": "
|
|
181
|
+
"commit": "505433ac64f144c9cca456097413d6af4582e5ee"
|
|
39
182
|
},
|
|
40
183
|
{
|
|
41
184
|
"author": "beachball",
|
|
42
185
|
"package": "@fluentui/react-tree",
|
|
43
186
|
"comment": "Bump @fluentui/react-button to v9.3.10",
|
|
44
|
-
"commit": "
|
|
187
|
+
"commit": "505433ac64f144c9cca456097413d6af4582e5ee"
|
|
45
188
|
},
|
|
46
189
|
{
|
|
47
190
|
"author": "beachball",
|
|
48
191
|
"package": "@fluentui/react-tree",
|
|
49
192
|
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
|
50
|
-
"commit": "
|
|
193
|
+
"commit": "505433ac64f144c9cca456097413d6af4582e5ee"
|
|
51
194
|
}
|
|
52
195
|
]
|
|
53
196
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-tree
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 12 May 2023 20:22:30 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.13)
|
|
8
|
+
|
|
9
|
+
Fri, 12 May 2023 20:22:30 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tree_v9.0.0-beta.12..@fluentui/react-tree_v9.0.0-beta.13)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
|
|
15
|
+
- feat: TreeItem itemType restructure ([PR #27799](https://github.com/microsoft/fluentui/pull/27799) by bernardo.sunderhus@gmail.com)
|
|
16
|
+
- feat: creates TreeItemAside component ([PR #27701](https://github.com/microsoft/fluentui/pull/27701) by bernardo.sunderhus@gmail.com)
|
|
17
|
+
- feat: makes useFlatTree generic ([PR #27682](https://github.com/microsoft/fluentui/pull/27682) by bernardo.sunderhus@gmail.com)
|
|
18
|
+
- chore: updates useOpenItemsState internals ([PR #27697](https://github.com/microsoft/fluentui/pull/27697) by bernardo.sunderhus@gmail.com)
|
|
19
|
+
- chore: move makeStyles() calls to .styles.ts files ([PR #27698](https://github.com/microsoft/fluentui/pull/27698) by olfedias@microsoft.com)
|
|
20
|
+
- feat: adds lazy loading story ([PR #27587](https://github.com/microsoft/fluentui/pull/27587) by bernardo.sunderhus@gmail.com)
|
|
21
|
+
- bugfix: fix horizontal overflow on tree ([PR #27825](https://github.com/microsoft/fluentui/pull/27825) by bernardo.sunderhus@gmail.com)
|
|
22
|
+
- bugfix: fix VisibleFlatTreeItemGenerator omitting visible items ([PR #27802](https://github.com/microsoft/fluentui/pull/27802) by bernardo.sunderhus@gmail.com)
|
|
23
|
+
- Bump @fluentui/keyboard-keys to v9.0.3 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
24
|
+
- Bump @fluentui/react-aria to v9.3.19 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
25
|
+
- Bump @fluentui/react-avatar to v9.5.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
26
|
+
- Bump @fluentui/react-button to v9.3.11 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
27
|
+
- Bump @fluentui/react-context-selector to v9.1.19 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
28
|
+
- Bump @fluentui/react-portal to v9.2.7 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
29
|
+
- Bump @fluentui/react-shared-contexts to v9.4.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
30
|
+
- Bump @fluentui/react-tabster to v9.7.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
31
|
+
- Bump @fluentui/react-theme to v9.1.8 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
32
|
+
- Bump @fluentui/react-utilities to v9.8.1 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
33
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.3 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
34
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
35
|
+
|
|
7
36
|
## [9.0.0-beta.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.12)
|
|
8
37
|
|
|
9
|
-
Mon, 24 Apr 2023 08:
|
|
38
|
+
Mon, 24 Apr 2023 08:12:44 GMT
|
|
10
39
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tree_v9.0.0-beta.11..@fluentui/react-tree_v9.0.0-beta.12)
|
|
11
40
|
|
|
12
41
|
### Changes
|
|
@@ -15,9 +44,9 @@ Mon, 24 Apr 2023 08:09:19 GMT
|
|
|
15
44
|
- bugfix: fix parent navigation after independency from id ([PR #27642](https://github.com/microsoft/fluentui/pull/27642) by bernardo.sunderhus@gmail.com)
|
|
16
45
|
- feat: value property over id ([PR #27532](https://github.com/microsoft/fluentui/pull/27532) by bernardo.sunderhus@gmail.com)
|
|
17
46
|
- chore: restructure stories, add separate category for flat tree ([PR #27586](https://github.com/microsoft/fluentui/pull/27586) by bernardo.sunderhus@gmail.com)
|
|
18
|
-
- Bump @fluentui/react-avatar to v9.4.10 ([
|
|
19
|
-
- Bump @fluentui/react-button to v9.3.10 ([
|
|
20
|
-
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([
|
|
47
|
+
- Bump @fluentui/react-avatar to v9.4.10 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
|
|
48
|
+
- Bump @fluentui/react-button to v9.3.10 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
|
|
49
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
|
|
21
50
|
|
|
22
51
|
## [9.0.0-beta.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.11)
|
|
23
52
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ArrowRight } from '@fluentui/keyboard-keys';
|
|
|
6
6
|
import { ArrowUp } from '@fluentui/keyboard-keys';
|
|
7
7
|
import type { AvatarContextValue } from '@fluentui/react-avatar';
|
|
8
8
|
import type { AvatarSize } from '@fluentui/react-avatar';
|
|
9
|
-
import
|
|
9
|
+
import { ButtonContextValue } from '@fluentui/react-button';
|
|
10
10
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
11
11
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
12
12
|
import { ContextSelector } from '@fluentui/react-context-selector';
|
|
@@ -23,6 +23,8 @@ import type { Slot } from '@fluentui/react-utilities';
|
|
|
23
23
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
24
24
|
import { SlotRenderFunction } from '@fluentui/react-utilities';
|
|
25
25
|
|
|
26
|
+
declare type FlattenedTreeItem<Props extends TreeItemProps<unknown>> = FlatTreeItemProps<NonNullable<Props['value']>> & Props;
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* Converts a nested structure to a flat one which can be consumed by `useFlatTreeItems`
|
|
28
30
|
* @example
|
|
@@ -63,7 +65,7 @@ import { SlotRenderFunction } from '@fluentui/react-utilities';
|
|
|
63
65
|
* ]);
|
|
64
66
|
* ```
|
|
65
67
|
*/
|
|
66
|
-
export declare const flattenTree_unstable: <
|
|
68
|
+
export declare const flattenTree_unstable: <Props extends TreeItemProps<unknown>>(items: NestedTreeItem<Props>[]) => FlattenedTreeItem<Props>[];
|
|
67
69
|
|
|
68
70
|
/**
|
|
69
71
|
* FlatTree API to manage all required mechanisms to convert a list of items into renderable TreeItems
|
|
@@ -75,13 +77,13 @@ export declare const flattenTree_unstable: <Value = string>(items: NestedTreeIte
|
|
|
75
77
|
*
|
|
76
78
|
* On simple scenarios it is advised to simply use a nested structure instead.
|
|
77
79
|
*/
|
|
78
|
-
export declare type FlatTree<
|
|
80
|
+
export declare type FlatTree<Props extends FlatTreeItemProps<unknown> = FlatTreeItemProps> = {
|
|
79
81
|
/**
|
|
80
82
|
* returns the properties required for the Tree component to work properly.
|
|
81
83
|
* That includes:
|
|
82
84
|
* `openItems`, `onOpenChange`, `onNavigation_unstable` and `ref`
|
|
83
85
|
*/
|
|
84
|
-
getTreeProps(): FlatTreeProps<
|
|
86
|
+
getTreeProps(): FlatTreeProps<Props['value']>;
|
|
85
87
|
/**
|
|
86
88
|
* internal method used to react to an `onNavigation` event.
|
|
87
89
|
* This method ensures proper navigation on keyboard and mouse interaction.
|
|
@@ -105,7 +107,7 @@ export declare type FlatTree<Value = string> = {
|
|
|
105
107
|
* };
|
|
106
108
|
*```
|
|
107
109
|
*/
|
|
108
|
-
navigate(data: TreeNavigationData_unstable<
|
|
110
|
+
navigate(data: TreeNavigationData_unstable<Props['value']>): void;
|
|
109
111
|
/**
|
|
110
112
|
* returns next item to be focused on a navigation.
|
|
111
113
|
* This method is provided to decouple the element that needs to be focused from
|
|
@@ -113,23 +115,43 @@ export declare type FlatTree<Value = string> = {
|
|
|
113
115
|
*
|
|
114
116
|
* On the case of TypeAhead navigation this method returns the current item.
|
|
115
117
|
*/
|
|
116
|
-
getNextNavigableItem(visibleItems: FlatTreeItem<
|
|
118
|
+
getNextNavigableItem(visibleItems: FlatTreeItem<Props>[], data: TreeNavigationData_unstable<Props['value']>): FlatTreeItem<Props> | undefined;
|
|
117
119
|
/**
|
|
118
120
|
* an iterable containing all visually available flat tree items
|
|
119
121
|
*/
|
|
120
|
-
items(): IterableIterator<FlatTreeItem<
|
|
122
|
+
items(): IterableIterator<FlatTreeItem<Props>>;
|
|
121
123
|
};
|
|
122
124
|
|
|
123
|
-
|
|
125
|
+
/**
|
|
126
|
+
* The item that is returned by `useFlatTree`, it represents a wrapper around the properties provided to
|
|
127
|
+
* `useFlatTree` but with extra information that might be useful on flat tree scenarios
|
|
128
|
+
*/
|
|
129
|
+
export declare type FlatTreeItem<Props extends FlatTreeItemProps<unknown> = FlatTreeItemProps> = {
|
|
130
|
+
index: number;
|
|
131
|
+
level: number;
|
|
132
|
+
childrenSize: number;
|
|
133
|
+
value: Props['value'];
|
|
134
|
+
parentValue: Props['parentValue'];
|
|
135
|
+
/**
|
|
136
|
+
* A reference to the element that will render the `TreeItem`,
|
|
137
|
+
* this is necessary for nodes with parents (to ensure child to parent navigation),
|
|
138
|
+
* if a node has no parent then this reference will be null.
|
|
139
|
+
*/
|
|
140
|
+
ref: React_2.RefObject<HTMLDivElement>;
|
|
141
|
+
getTreeItemProps(): Required<Pick<Props, 'value' | 'aria-setsize' | 'aria-level' | 'aria-posinset' | 'itemType'>> & Omit<Props, 'parentValue'>;
|
|
142
|
+
};
|
|
124
143
|
|
|
125
|
-
export declare type FlatTreeItemProps<Value = string> = Omit<TreeItemProps
|
|
144
|
+
export declare type FlatTreeItemProps<Value = string> = Omit<TreeItemProps<Value>, 'itemType'> & Partial<Pick<TreeItemProps<Value>, 'itemType'>> & {
|
|
126
145
|
value: Value;
|
|
127
146
|
parentValue?: Value;
|
|
128
147
|
};
|
|
129
148
|
|
|
130
|
-
|
|
149
|
+
declare type FlatTreeOptions<Props extends FlatTreeItemProps<unknown> = FlatTreeItemProps> = Pick<TreeProps<Props['value']>, 'openItems' | 'defaultOpenItems' | 'onOpenChange' | 'onNavigation_unstable'>;
|
|
150
|
+
|
|
151
|
+
export declare type FlatTreeProps<Value = string> = Required<Pick<TreeProps<Value>, 'openItems' | 'onOpenChange' | 'onNavigation_unstable'>> & {
|
|
131
152
|
ref: React_2.Ref<HTMLDivElement>;
|
|
132
|
-
|
|
153
|
+
openItems: ImmutableSet<Value>;
|
|
154
|
+
};
|
|
133
155
|
|
|
134
156
|
declare interface ImmutableSet<Value> {
|
|
135
157
|
/**
|
|
@@ -157,24 +179,11 @@ declare interface ImmutableSet<Value> {
|
|
|
157
179
|
[Symbol.iterator](): IterableIterator<Value>;
|
|
158
180
|
}
|
|
159
181
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
* Used internally on createFlatTreeItems and VisibleFlatTreeItemGenerator
|
|
163
|
-
* to ensure required properties when building a FlatTreeITem
|
|
164
|
-
*/
|
|
165
|
-
declare type MutableFlatTreeItem<Value = string> = {
|
|
166
|
-
parentValue?: Value;
|
|
167
|
-
childrenSize: number;
|
|
168
|
-
index: number;
|
|
169
|
-
value: Value;
|
|
170
|
-
level: number;
|
|
171
|
-
ref: React_2.RefObject<HTMLDivElement>;
|
|
172
|
-
getTreeItemProps(): Required<Pick<TreeItemProps<Value>, 'value' | 'aria-setsize' | 'aria-level' | 'aria-posinset' | 'leaf'>> & TreeItemProps<Value>;
|
|
182
|
+
export declare type NestedTreeItem<Props extends TreeItemProps<unknown>> = Omit<Props, 'subtree' | 'itemType'> & {
|
|
183
|
+
subtree?: NestedTreeItem<Props>[];
|
|
173
184
|
};
|
|
174
185
|
|
|
175
|
-
|
|
176
|
-
subtree?: NestedTreeItem<Value>[];
|
|
177
|
-
};
|
|
186
|
+
declare type OmitWithoutExpanding<P, K extends string | number | symbol> = P extends unknown ? Omit<P, K> : P;
|
|
178
187
|
|
|
179
188
|
export declare const renderTree_unstable: (state: TreeState, contextValues: TreeContextValues) => JSX.Element;
|
|
180
189
|
|
|
@@ -183,6 +192,11 @@ export declare const renderTree_unstable: (state: TreeState, contextValues: Tree
|
|
|
183
192
|
*/
|
|
184
193
|
export declare const renderTreeItem_unstable: (state: TreeItemState, contextValues: TreeItemContextValues) => JSX.Element;
|
|
185
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Render the final JSX of TreeItemAside
|
|
197
|
+
*/
|
|
198
|
+
export declare const renderTreeItemAside_unstable: (state: TreeItemAsideState) => JSX.Element | null;
|
|
199
|
+
|
|
186
200
|
/**
|
|
187
201
|
* Render the final JSX of TreeItemLayout
|
|
188
202
|
*/
|
|
@@ -210,7 +224,7 @@ export declare const Tree: React_2.ForwardRefExoticComponent<Omit<TreeSlots, "ro
|
|
|
210
224
|
ref?: ((instance: HTMLDivElement | null) => void) | React_2.RefObject<HTMLDivElement> | null | undefined;
|
|
211
225
|
}>;
|
|
212
226
|
}, "ref"> & {
|
|
213
|
-
appearance?: "
|
|
227
|
+
appearance?: "transparent" | "subtle" | "subtle-alpha" | undefined;
|
|
214
228
|
size?: "small" | "medium" | undefined;
|
|
215
229
|
openItems?: Iterable<string> | undefined;
|
|
216
230
|
defaultOpenItems?: Iterable<string> | undefined;
|
|
@@ -226,10 +240,9 @@ export declare type TreeContextValue = {
|
|
|
226
240
|
size: 'small' | 'medium';
|
|
227
241
|
openItems: ImmutableSet<unknown>;
|
|
228
242
|
/**
|
|
229
|
-
*
|
|
243
|
+
* requests root Tree component to respond to some tree item event,
|
|
230
244
|
*/
|
|
231
|
-
|
|
232
|
-
requestNavigation(data: TreeNavigationData_unstable<unknown>): void;
|
|
245
|
+
requestTreeResponse(request: TreeItemRequest<unknown>): void;
|
|
233
246
|
};
|
|
234
247
|
|
|
235
248
|
declare type TreeContextValues = {
|
|
@@ -260,18 +273,63 @@ export declare const TreeItem: React_2.ForwardRefExoticComponent<Omit<Partial<Tr
|
|
|
260
273
|
style?: TreeItemCSSProperties | undefined;
|
|
261
274
|
}, "ref"> & {
|
|
262
275
|
value?: string | undefined;
|
|
263
|
-
|
|
276
|
+
itemType: TreeItemType;
|
|
264
277
|
} & React_2.RefAttributes<HTMLDivElement>> & (<Value = string>(props: TreeItemProps<Value>) => JSX.Element);
|
|
265
278
|
|
|
279
|
+
/**
|
|
280
|
+
* TreeItemAside component - represents a custom set of actionable elements that will be visible when a certain
|
|
281
|
+
* `TreeItem` is currently "active".
|
|
282
|
+
*/
|
|
283
|
+
export declare const TreeItemAside: ForwardRefComponent<TreeItemAsideProps>;
|
|
284
|
+
|
|
285
|
+
export declare const treeItemAsideClassNames: SlotClassNames<TreeItemAsideSlots>;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* TreeItemAside Props
|
|
289
|
+
*/
|
|
290
|
+
export declare type TreeItemAsideProps = ComponentProps<TreeItemAsideSlots> & {
|
|
291
|
+
/**
|
|
292
|
+
* boolean indicating if the aside content should behave as "actions"
|
|
293
|
+
*
|
|
294
|
+
* actionable elements are normally buttons, menus, or other focusable elements.
|
|
295
|
+
* Those elements are only visibly available if the given tree item is currently active.
|
|
296
|
+
*/
|
|
297
|
+
actions?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Forces visibility of the aside content, even if they're actions
|
|
300
|
+
*/
|
|
301
|
+
visible?: true;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export declare type TreeItemAsideSlots = {
|
|
305
|
+
root: Slot<'div'>;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* State used in rendering TreeItemAside
|
|
310
|
+
*/
|
|
311
|
+
export declare type TreeItemAsideState = ComponentState<TreeItemAsideSlots> & {
|
|
312
|
+
actions: boolean;
|
|
313
|
+
visible: boolean;
|
|
314
|
+
buttonContextValue: ButtonContextValue;
|
|
315
|
+
};
|
|
316
|
+
|
|
266
317
|
export declare const treeItemClassNames: SlotClassNames<TreeItemSlots>;
|
|
267
318
|
|
|
268
319
|
declare type TreeItemContextValue = {
|
|
269
320
|
isActionsVisible: boolean;
|
|
321
|
+
isAsideVisible: boolean;
|
|
322
|
+
actionsRef: React_2.Ref<HTMLDivElement>;
|
|
323
|
+
expandIconRef: React_2.Ref<HTMLDivElement>;
|
|
324
|
+
layoutRef: React_2.Ref<HTMLDivElement>;
|
|
325
|
+
subtreeRef: React_2.Ref<HTMLDivElement>;
|
|
326
|
+
value: unknown;
|
|
327
|
+
itemType: TreeItemType;
|
|
328
|
+
open: boolean;
|
|
270
329
|
};
|
|
271
330
|
|
|
272
331
|
declare type TreeItemContextValues = {
|
|
273
332
|
treeItem: TreeItemContextValue;
|
|
274
|
-
button: ButtonContextValue;
|
|
275
333
|
};
|
|
276
334
|
|
|
277
335
|
declare type TreeItemCSSProperties = React_2.CSSProperties & {
|
|
@@ -293,25 +351,26 @@ export declare const treeItemLayoutClassNames: SlotClassNames<TreeItemLayoutSlot
|
|
|
293
351
|
export declare type TreeItemLayoutProps = ComponentProps<Partial<TreeItemLayoutSlots>>;
|
|
294
352
|
|
|
295
353
|
export declare type TreeItemLayoutSlots = {
|
|
296
|
-
root: Slot<'
|
|
354
|
+
root: Slot<'div'>;
|
|
297
355
|
/**
|
|
298
|
-
*
|
|
356
|
+
* Expand icon slot,
|
|
357
|
+
* by default renders a chevron icon to indicate opening and closing
|
|
299
358
|
*/
|
|
300
|
-
|
|
359
|
+
expandIcon?: Slot<'div'>;
|
|
301
360
|
/**
|
|
302
|
-
* Icon slot that renders right
|
|
361
|
+
* Icon slot that renders right before main content
|
|
303
362
|
*/
|
|
304
|
-
|
|
363
|
+
iconBefore?: Slot<'div'>;
|
|
305
364
|
/**
|
|
306
|
-
* slot that
|
|
365
|
+
* Icon slot that renders right after main content
|
|
307
366
|
*/
|
|
308
|
-
|
|
367
|
+
iconAfter?: Slot<'div'>;
|
|
309
368
|
};
|
|
310
369
|
|
|
311
370
|
/**
|
|
312
371
|
* State used in rendering TreeItemLayout
|
|
313
372
|
*/
|
|
314
|
-
export declare type TreeItemLayoutState = ComponentState<TreeItemLayoutSlots
|
|
373
|
+
export declare type TreeItemLayoutState = ComponentState<TreeItemLayoutSlots>;
|
|
315
374
|
|
|
316
375
|
export declare const treeItemLevelToken: "--fluent-TreeItem--level";
|
|
317
376
|
|
|
@@ -334,33 +393,34 @@ declare type TreeItemPersonaLayoutContextValues = {
|
|
|
334
393
|
export declare type TreeItemPersonaLayoutProps = ComponentProps<Partial<TreeItemPersonaLayoutSlots>>;
|
|
335
394
|
|
|
336
395
|
export declare type TreeItemPersonaLayoutSlots = {
|
|
337
|
-
root: Slot<'
|
|
396
|
+
root: NonNullable<Slot<'div'>>;
|
|
397
|
+
/**
|
|
398
|
+
* Expand icon slot,
|
|
399
|
+
* by default renders a chevron icon to indicate opening and closing
|
|
400
|
+
*/
|
|
401
|
+
expandIcon?: Slot<'div'>;
|
|
338
402
|
/**
|
|
339
403
|
* Avatar to display.
|
|
340
404
|
*/
|
|
341
|
-
media: NonNullable<Slot<'
|
|
405
|
+
media: NonNullable<Slot<'div'>>;
|
|
342
406
|
/**
|
|
343
407
|
* Main text. Children of the root slot are automatically rendered here
|
|
344
408
|
*/
|
|
345
|
-
main: Slot<'
|
|
409
|
+
main: NonNullable<Slot<'div'>>;
|
|
346
410
|
/**
|
|
347
411
|
* Secondary text that describes or complements the main text
|
|
348
412
|
*/
|
|
349
|
-
description?: Slot<'
|
|
350
|
-
/**
|
|
351
|
-
* aside text that works as extra textual information
|
|
352
|
-
*/
|
|
353
|
-
aside?: Slot<'span'>;
|
|
413
|
+
description?: Slot<'div'>;
|
|
354
414
|
/**
|
|
355
415
|
* A layout wrapper for the main and description slots
|
|
356
416
|
*/
|
|
357
|
-
content: Slot<'div'
|
|
417
|
+
content: NonNullable<Slot<'div'>>;
|
|
358
418
|
};
|
|
359
419
|
|
|
360
420
|
/**
|
|
361
421
|
* State used in rendering TreeItemPersonaLayout
|
|
362
422
|
*/
|
|
363
|
-
export declare type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaLayoutSlots> &
|
|
423
|
+
export declare type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaLayoutSlots> & {
|
|
364
424
|
avatarSize: AvatarSize;
|
|
365
425
|
};
|
|
366
426
|
|
|
@@ -369,48 +429,31 @@ export declare type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaL
|
|
|
369
429
|
*/
|
|
370
430
|
export declare type TreeItemProps<Value = string> = ComponentProps<Partial<TreeItemSlots>> & {
|
|
371
431
|
value?: Value;
|
|
372
|
-
|
|
373
|
-
* If a TreeItem is a leaf, it'll not present the `expandIcon` slot by default.
|
|
374
|
-
* This attribute is used to force the decision if a TreeItem is a leaf or not. By not providing this property
|
|
375
|
-
* this will be inferred by the presence of a subtree as part of the TreeItem children.
|
|
376
|
-
*/
|
|
377
|
-
leaf?: boolean;
|
|
432
|
+
itemType: TreeItemType;
|
|
378
433
|
};
|
|
379
434
|
|
|
380
|
-
export declare const TreeItemProvider: React_2.Provider<TreeItemContextValue | undefined
|
|
435
|
+
export declare const TreeItemProvider: React_2.Provider<TreeItemContextValue | undefined> & React_2.FC<React_2.ProviderProps<TreeItemContextValue | undefined>>;
|
|
436
|
+
|
|
437
|
+
declare type TreeItemRequest<Value> = {
|
|
438
|
+
itemType: TreeItemType;
|
|
439
|
+
} & (OmitWithoutExpanding<TreeOpenChangeData<Value>, 'open' | 'target'> | OmitWithoutExpanding<TreeNavigationData_unstable<Value>, 'target'>);
|
|
381
440
|
|
|
382
441
|
export declare type TreeItemSlots = {
|
|
383
442
|
root: Slot<ExtractSlotProps<Slot<'div'> & {
|
|
384
443
|
style?: TreeItemCSSProperties;
|
|
385
444
|
}>>;
|
|
386
|
-
content: NonNullable<Slot<'div'>>;
|
|
387
|
-
subtree?: Slot<'span'>;
|
|
388
|
-
/**
|
|
389
|
-
* Expand icon slot,
|
|
390
|
-
* by default renders a chevron icon to indicate opening and closing
|
|
391
|
-
*/
|
|
392
|
-
expandIcon?: Slot<'span'>;
|
|
393
|
-
/**
|
|
394
|
-
* Actions slot that renders on the end of tree item
|
|
395
|
-
* when the item is hovered/focused
|
|
396
|
-
*/
|
|
397
|
-
actions?: Slot<'span'>;
|
|
398
445
|
};
|
|
399
446
|
|
|
400
447
|
/**
|
|
401
448
|
* State used in rendering TreeItem
|
|
402
449
|
*/
|
|
403
|
-
export declare type TreeItemState = ComponentState<TreeItemSlots> & {
|
|
404
|
-
open: boolean;
|
|
405
|
-
isLeaf: boolean;
|
|
450
|
+
export declare type TreeItemState = ComponentState<TreeItemSlots> & TreeItemContextValue & {
|
|
406
451
|
level: number;
|
|
407
|
-
|
|
408
|
-
* By design, a button included on the actions slot should be small
|
|
409
|
-
*/
|
|
410
|
-
buttonSize: 'small';
|
|
411
|
-
isActionsVisible: boolean;
|
|
452
|
+
itemType: TreeItemType;
|
|
412
453
|
};
|
|
413
454
|
|
|
455
|
+
declare type TreeItemType = 'leaf' | 'branch';
|
|
456
|
+
|
|
414
457
|
export declare type TreeNavigationData_unstable<Value = string> = {
|
|
415
458
|
value: Value;
|
|
416
459
|
target: HTMLElement;
|
|
@@ -525,7 +568,9 @@ export declare type TreeSlots = {
|
|
|
525
568
|
/**
|
|
526
569
|
* State used in rendering Tree
|
|
527
570
|
*/
|
|
528
|
-
export declare type TreeState = ComponentState<TreeSlots> & TreeContextValue
|
|
571
|
+
export declare type TreeState = ComponentState<TreeSlots> & TreeContextValue & {
|
|
572
|
+
open: boolean;
|
|
573
|
+
};
|
|
529
574
|
|
|
530
575
|
/**
|
|
531
576
|
* this hook provides FlatTree API to manage all required mechanisms to convert a list of items into renderable TreeItems
|
|
@@ -539,7 +584,7 @@ export declare type TreeState = ComponentState<TreeSlots> & TreeContextValue;
|
|
|
539
584
|
* @param flatTreeItemProps - a list of tree items
|
|
540
585
|
* @param options - in case control over the internal openItems is required
|
|
541
586
|
*/
|
|
542
|
-
export declare function useFlatTree_unstable<
|
|
587
|
+
export declare function useFlatTree_unstable<Props extends FlatTreeItemProps<unknown> = FlatTreeItemProps>(flatTreeItemProps: Props[], options?: FlatTreeOptions<Props>): FlatTree<Props>;
|
|
543
588
|
|
|
544
589
|
/**
|
|
545
590
|
* Create the state required to render Tree.
|
|
@@ -567,7 +612,23 @@ export declare function useTreeContextValues_unstable(state: TreeState): TreeCon
|
|
|
567
612
|
*/
|
|
568
613
|
export declare function useTreeItem_unstable<Value = string>(props: TreeItemProps<Value>, ref: React_2.Ref<HTMLDivElement>): TreeItemState;
|
|
569
614
|
|
|
570
|
-
|
|
615
|
+
/**
|
|
616
|
+
* Create the state required to render TreeItemAside.
|
|
617
|
+
*
|
|
618
|
+
* The returned state can be modified with hooks such as useTreeItemAsideStyles_unstable,
|
|
619
|
+
* before being passed to renderTreeItemAside_unstable.
|
|
620
|
+
*
|
|
621
|
+
* @param props - props from this instance of TreeItemAside
|
|
622
|
+
* @param ref - reference to root HTMLElement of TreeItemAside
|
|
623
|
+
*/
|
|
624
|
+
export declare const useTreeItemAside_unstable: (props: TreeItemAsideProps, ref: React_2.Ref<HTMLElement>) => TreeItemAsideState;
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Apply styling to the TreeItemAside slots based on the state
|
|
628
|
+
*/
|
|
629
|
+
export declare const useTreeItemAsideStyles_unstable: (state: TreeItemAsideState) => TreeItemAsideState;
|
|
630
|
+
|
|
631
|
+
export declare const useTreeItemContext_unstable: <T>(selector: ContextSelector<TreeItemContextValue, T>) => T;
|
|
571
632
|
|
|
572
633
|
/**
|
|
573
634
|
* Create the state required to render TreeItemLayout.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/TreeItemAside.ts"],"sourcesContent":["export * from './components/TreeItemAside/index';\n"],"mappings":"AAAA,cAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTree_unstable } from './useTree';
|
|
3
3
|
import { renderTree_unstable } from './renderTree';
|
|
4
|
-
import { useTreeStyles_unstable } from './useTreeStyles';
|
|
4
|
+
import { useTreeStyles_unstable } from './useTreeStyles.styles';
|
|
5
5
|
import { useTreeContextValues_unstable } from './useTreeContextValues';
|
|
6
6
|
/**
|
|
7
7
|
* A tree view widget presents a hierarchical list.
|