@fluentui/react-tree 9.0.0-beta.10 → 9.0.0-beta.12
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 +122 -8
- package/CHANGELOG.md +41 -9
- package/dist/index.d.ts +73 -45
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/Tree.types.js.map +1 -1
- package/lib/components/Tree/renderTree.js +5 -5
- package/lib/components/Tree/renderTree.js.map +1 -1
- 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/renderTreeItem.js +6 -6
- package/lib/components/TreeItem/renderTreeItem.js.map +1 -1
- package/lib/components/TreeItem/useTreeItem.js +17 -4
- package/lib/components/TreeItem/useTreeItem.js.map +1 -1
- package/lib/components/TreeItemLayout/TreeItemLayout.types.js.map +1 -1
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js +4 -4
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/useTreeItemLayout.js +2 -2
- package/lib/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +5 -5
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js +7 -14
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +1 -1
- package/lib/contexts/treeContext.js.map +1 -1
- package/lib/hooks/useFlatTree.js +2 -2
- package/lib/hooks/useFlatTree.js.map +1 -1
- package/lib/hooks/useFlatTreeNavigation.js +7 -5
- package/lib/hooks/useFlatTreeNavigation.js.map +1 -1
- package/lib/hooks/useNestedTreeNavigation.js +1 -1
- package/lib/hooks/useNestedTreeNavigation.js.map +1 -1
- package/lib/hooks/useOpenItemsState.js +2 -3
- package/lib/hooks/useOpenItemsState.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/createFlatTreeItems.js +26 -17
- package/lib/utils/createFlatTreeItems.js.map +1 -1
- package/lib/utils/flattenTree.js +8 -4
- package/lib/utils/flattenTree.js.map +1 -1
- package/lib-commonjs/components/Tree/renderTree.js +5 -6
- package/lib-commonjs/components/Tree/renderTree.js.map +1 -1
- package/lib-commonjs/components/TreeItem/TreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/renderTreeItem.js +6 -7
- package/lib-commonjs/components/TreeItem/renderTreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItem.js +17 -5
- package/lib-commonjs/components/TreeItem/useTreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js +4 -5
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js +2 -2
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +5 -6
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js +11 -19
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +1 -1
- package/lib-commonjs/hooks/useFlatTree.js +2 -2
- package/lib-commonjs/hooks/useFlatTree.js.map +1 -1
- package/lib-commonjs/hooks/useFlatTreeNavigation.js +7 -5
- package/lib-commonjs/hooks/useFlatTreeNavigation.js.map +1 -1
- package/lib-commonjs/hooks/useNestedTreeNavigation.js +1 -1
- package/lib-commonjs/hooks/useNestedTreeNavigation.js.map +1 -1
- package/lib-commonjs/hooks/useOpenItemsState.js +2 -3
- package/lib-commonjs/hooks/useOpenItemsState.js.map +1 -1
- package/lib-commonjs/utils/createFlatTreeItems.js +26 -20
- package/lib-commonjs/utils/createFlatTreeItems.js.map +1 -1
- package/lib-commonjs/utils/flattenTree.js +8 -4
- package/lib-commonjs/utils/flattenTree.js.map +1 -1
- package/package.json +9 -8
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,121 @@
|
|
|
2
2
|
"name": "@fluentui/react-tree",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 24 Apr 2023 08:09:19 GMT",
|
|
6
|
+
"tag": "@fluentui/react-tree_v9.0.0-beta.12",
|
|
7
|
+
"version": "9.0.0-beta.12",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-tree",
|
|
13
|
+
"commit": "85c36e249b33b0bad79be4edd1a943dfc5233b11",
|
|
14
|
+
"comment": "bugfix: remove caret from react-jsx-runtime prerelease dependency"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-tree",
|
|
19
|
+
"commit": "acbc5fcb1381e9adcc4e1fa678a374d42a79438b",
|
|
20
|
+
"comment": "bugfix: fix parent navigation after independency from id"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
24
|
+
"package": "@fluentui/react-tree",
|
|
25
|
+
"commit": "4dde6727c7e7fe7fbf6fedb4e1619deddbd3e16a",
|
|
26
|
+
"comment": "feat: value property over id"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
30
|
+
"package": "@fluentui/react-tree",
|
|
31
|
+
"commit": "ab5e8979917780ec8cf6b3b08b3696fc1b7a83f4",
|
|
32
|
+
"comment": "chore: restructure stories, add separate category for flat tree"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-tree",
|
|
37
|
+
"comment": "Bump @fluentui/react-avatar to v9.4.10",
|
|
38
|
+
"commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-tree",
|
|
43
|
+
"comment": "Bump @fluentui/react-button to v9.3.10",
|
|
44
|
+
"commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-tree",
|
|
49
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
|
50
|
+
"commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Mon, 17 Apr 2023 17:54:01 GMT",
|
|
57
|
+
"tag": "@fluentui/react-tree_v9.0.0-beta.11",
|
|
58
|
+
"version": "9.0.0-beta.11",
|
|
59
|
+
"comments": {
|
|
60
|
+
"prerelease": [
|
|
61
|
+
{
|
|
62
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
63
|
+
"package": "@fluentui/react-tree",
|
|
64
|
+
"commit": "27665739a1f38468c63ea1544a2e82ff357d25f3",
|
|
65
|
+
"comment": "chore: adopt custom jsx pragma"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@fluentui/react-tree",
|
|
70
|
+
"comment": "Bump @fluentui/react-aria to v9.3.18",
|
|
71
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@fluentui/react-tree",
|
|
76
|
+
"comment": "Bump @fluentui/react-avatar to v9.4.9",
|
|
77
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-tree",
|
|
82
|
+
"comment": "Bump @fluentui/react-button to v9.3.9",
|
|
83
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-tree",
|
|
88
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.18",
|
|
89
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-tree",
|
|
94
|
+
"comment": "Bump @fluentui/react-portal to v9.2.6",
|
|
95
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-tree",
|
|
100
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.5",
|
|
101
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"author": "beachball",
|
|
105
|
+
"package": "@fluentui/react-tree",
|
|
106
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.0",
|
|
107
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"author": "beachball",
|
|
111
|
+
"package": "@fluentui/react-tree",
|
|
112
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.1",
|
|
113
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"date": "Wed, 12 Apr 2023 09:31:45 GMT",
|
|
6
120
|
"tag": "@fluentui/react-tree_v9.0.0-beta.10",
|
|
7
121
|
"version": "9.0.0-beta.10",
|
|
8
122
|
"comments": {
|
|
@@ -11,43 +125,43 @@
|
|
|
11
125
|
"author": "beachball",
|
|
12
126
|
"package": "@fluentui/react-tree",
|
|
13
127
|
"comment": "Bump @fluentui/react-aria to v9.3.17",
|
|
14
|
-
"commit": "
|
|
128
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
15
129
|
},
|
|
16
130
|
{
|
|
17
131
|
"author": "beachball",
|
|
18
132
|
"package": "@fluentui/react-tree",
|
|
19
133
|
"comment": "Bump @fluentui/react-avatar to v9.4.8",
|
|
20
|
-
"commit": "
|
|
134
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
21
135
|
},
|
|
22
136
|
{
|
|
23
137
|
"author": "beachball",
|
|
24
138
|
"package": "@fluentui/react-tree",
|
|
25
139
|
"comment": "Bump @fluentui/react-button to v9.3.8",
|
|
26
|
-
"commit": "
|
|
140
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
27
141
|
},
|
|
28
142
|
{
|
|
29
143
|
"author": "beachball",
|
|
30
144
|
"package": "@fluentui/react-tree",
|
|
31
145
|
"comment": "Bump @fluentui/react-context-selector to v9.1.17",
|
|
32
|
-
"commit": "
|
|
146
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
33
147
|
},
|
|
34
148
|
{
|
|
35
149
|
"author": "beachball",
|
|
36
150
|
"package": "@fluentui/react-tree",
|
|
37
151
|
"comment": "Bump @fluentui/react-portal to v9.2.5",
|
|
38
|
-
"commit": "
|
|
152
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
39
153
|
},
|
|
40
154
|
{
|
|
41
155
|
"author": "beachball",
|
|
42
156
|
"package": "@fluentui/react-tree",
|
|
43
157
|
"comment": "Bump @fluentui/react-tabster to v9.6.4",
|
|
44
|
-
"commit": "
|
|
158
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
45
159
|
},
|
|
46
160
|
{
|
|
47
161
|
"author": "beachball",
|
|
48
162
|
"package": "@fluentui/react-tree",
|
|
49
163
|
"comment": "Bump @fluentui/react-utilities to v9.7.4",
|
|
50
|
-
"commit": "
|
|
164
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
|
51
165
|
}
|
|
52
166
|
]
|
|
53
167
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,55 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-tree
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 24 Apr 2023 08:09:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.12)
|
|
8
|
+
|
|
9
|
+
Mon, 24 Apr 2023 08:09:19 GMT
|
|
10
|
+
[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
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- bugfix: remove caret from react-jsx-runtime prerelease dependency ([PR #27588](https://github.com/microsoft/fluentui/pull/27588) by bernardo.sunderhus@gmail.com)
|
|
15
|
+
- bugfix: fix parent navigation after independency from id ([PR #27642](https://github.com/microsoft/fluentui/pull/27642) by bernardo.sunderhus@gmail.com)
|
|
16
|
+
- feat: value property over id ([PR #27532](https://github.com/microsoft/fluentui/pull/27532) by bernardo.sunderhus@gmail.com)
|
|
17
|
+
- 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 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
|
|
19
|
+
- Bump @fluentui/react-button to v9.3.10 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
|
|
20
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
|
|
21
|
+
|
|
22
|
+
## [9.0.0-beta.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.11)
|
|
23
|
+
|
|
24
|
+
Mon, 17 Apr 2023 17:54:01 GMT
|
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tree_v9.0.0-beta.10..@fluentui/react-tree_v9.0.0-beta.11)
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
|
|
29
|
+
- chore: adopt custom jsx pragma ([PR #27542](https://github.com/microsoft/fluentui/pull/27542) by bernardo.sunderhus@gmail.com)
|
|
30
|
+
- Bump @fluentui/react-aria to v9.3.18 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
31
|
+
- Bump @fluentui/react-avatar to v9.4.9 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
32
|
+
- Bump @fluentui/react-button to v9.3.9 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
33
|
+
- Bump @fluentui/react-context-selector to v9.1.18 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
34
|
+
- Bump @fluentui/react-portal to v9.2.6 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
35
|
+
- Bump @fluentui/react-tabster to v9.6.5 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
36
|
+
- Bump @fluentui/react-utilities to v9.8.0 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
37
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.1 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
|
38
|
+
|
|
7
39
|
## [9.0.0-beta.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.10)
|
|
8
40
|
|
|
9
|
-
Wed, 12 Apr 2023 09:
|
|
41
|
+
Wed, 12 Apr 2023 09:31:45 GMT
|
|
10
42
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tree_v9.0.0-beta.9..@fluentui/react-tree_v9.0.0-beta.10)
|
|
11
43
|
|
|
12
44
|
### Changes
|
|
13
45
|
|
|
14
|
-
- Bump @fluentui/react-aria to v9.3.17 ([
|
|
15
|
-
- Bump @fluentui/react-avatar to v9.4.8 ([
|
|
16
|
-
- Bump @fluentui/react-button to v9.3.8 ([
|
|
17
|
-
- Bump @fluentui/react-context-selector to v9.1.17 ([
|
|
18
|
-
- Bump @fluentui/react-portal to v9.2.5 ([
|
|
19
|
-
- Bump @fluentui/react-tabster to v9.6.4 ([
|
|
20
|
-
- Bump @fluentui/react-utilities to v9.7.4 ([
|
|
46
|
+
- Bump @fluentui/react-aria to v9.3.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
47
|
+
- Bump @fluentui/react-avatar to v9.4.8 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
48
|
+
- Bump @fluentui/react-button to v9.3.8 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
49
|
+
- Bump @fluentui/react-context-selector to v9.1.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
50
|
+
- Bump @fluentui/react-portal to v9.2.5 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
51
|
+
- Bump @fluentui/react-tabster to v9.6.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
52
|
+
- Bump @fluentui/react-utilities to v9.7.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
|
21
53
|
|
|
22
54
|
## [9.0.0-beta.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.0.0-beta.9)
|
|
23
55
|
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { ProviderProps } from 'react';
|
|
|
21
21
|
import * as React_2 from 'react';
|
|
22
22
|
import type { Slot } from '@fluentui/react-utilities';
|
|
23
23
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
24
|
+
import { SlotRenderFunction } from '@fluentui/react-utilities';
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Converts a nested structure to a flat one which can be consumed by `useFlatTreeItems`
|
|
@@ -62,7 +63,7 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
|
62
63
|
* ]);
|
|
63
64
|
* ```
|
|
64
65
|
*/
|
|
65
|
-
export declare const flattenTree_unstable: (items: NestedTreeItem[]) => FlatTreeItemProps[];
|
|
66
|
+
export declare const flattenTree_unstable: <Value = string>(items: NestedTreeItem<Value>[]) => FlatTreeItemProps<Value>[];
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
69
|
* FlatTree API to manage all required mechanisms to convert a list of items into renderable TreeItems
|
|
@@ -74,13 +75,13 @@ export declare const flattenTree_unstable: (items: NestedTreeItem[]) => FlatTree
|
|
|
74
75
|
*
|
|
75
76
|
* On simple scenarios it is advised to simply use a nested structure instead.
|
|
76
77
|
*/
|
|
77
|
-
export declare type FlatTree = {
|
|
78
|
+
export declare type FlatTree<Value = string> = {
|
|
78
79
|
/**
|
|
79
80
|
* returns the properties required for the Tree component to work properly.
|
|
80
81
|
* That includes:
|
|
81
82
|
* `openItems`, `onOpenChange`, `onNavigation_unstable` and `ref`
|
|
82
83
|
*/
|
|
83
|
-
getTreeProps(): FlatTreeProps
|
|
84
|
+
getTreeProps(): FlatTreeProps<Value>;
|
|
84
85
|
/**
|
|
85
86
|
* internal method used to react to an `onNavigation` event.
|
|
86
87
|
* This method ensures proper navigation on keyboard and mouse interaction.
|
|
@@ -104,7 +105,7 @@ export declare type FlatTree = {
|
|
|
104
105
|
* };
|
|
105
106
|
*```
|
|
106
107
|
*/
|
|
107
|
-
navigate(data: TreeNavigationData_unstable): void;
|
|
108
|
+
navigate(data: TreeNavigationData_unstable<Value>): void;
|
|
108
109
|
/**
|
|
109
110
|
* returns next item to be focused on a navigation.
|
|
110
111
|
* This method is provided to decouple the element that needs to be focused from
|
|
@@ -112,21 +113,21 @@ export declare type FlatTree = {
|
|
|
112
113
|
*
|
|
113
114
|
* On the case of TypeAhead navigation this method returns the current item.
|
|
114
115
|
*/
|
|
115
|
-
getNextNavigableItem(visibleItems: FlatTreeItem[], data: TreeNavigationData_unstable): FlatTreeItem | undefined;
|
|
116
|
+
getNextNavigableItem(visibleItems: FlatTreeItem<Value>[], data: TreeNavigationData_unstable<Value>): FlatTreeItem<Value> | undefined;
|
|
116
117
|
/**
|
|
117
118
|
* an iterable containing all visually available flat tree items
|
|
118
119
|
*/
|
|
119
|
-
items(): IterableIterator<FlatTreeItem
|
|
120
|
+
items(): IterableIterator<FlatTreeItem<Value>>;
|
|
120
121
|
};
|
|
121
122
|
|
|
122
|
-
export declare type FlatTreeItem = Readonly<MutableFlatTreeItem
|
|
123
|
+
export declare type FlatTreeItem<Value = string> = Readonly<MutableFlatTreeItem<Value>>;
|
|
123
124
|
|
|
124
|
-
export declare type FlatTreeItemProps = TreeItemProps & {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
export declare type FlatTreeItemProps<Value = string> = Omit<TreeItemProps, 'value'> & {
|
|
126
|
+
value: Value;
|
|
127
|
+
parentValue?: Value;
|
|
127
128
|
};
|
|
128
129
|
|
|
129
|
-
export declare type FlatTreeProps = Required<Pick<TreeProps
|
|
130
|
+
export declare type FlatTreeProps<Value = string> = Required<Pick<TreeProps<Value>, 'openItems' | 'onOpenChange' | 'onNavigation_unstable'> & {
|
|
130
131
|
ref: React_2.Ref<HTMLDivElement>;
|
|
131
132
|
}>;
|
|
132
133
|
|
|
@@ -161,17 +162,18 @@ declare interface ImmutableSet<Value> {
|
|
|
161
162
|
* Used internally on createFlatTreeItems and VisibleFlatTreeItemGenerator
|
|
162
163
|
* to ensure required properties when building a FlatTreeITem
|
|
163
164
|
*/
|
|
164
|
-
declare type MutableFlatTreeItem = {
|
|
165
|
-
|
|
165
|
+
declare type MutableFlatTreeItem<Value = string> = {
|
|
166
|
+
parentValue?: Value;
|
|
166
167
|
childrenSize: number;
|
|
167
168
|
index: number;
|
|
168
|
-
|
|
169
|
+
value: Value;
|
|
169
170
|
level: number;
|
|
170
|
-
|
|
171
|
+
ref: React_2.RefObject<HTMLDivElement>;
|
|
172
|
+
getTreeItemProps(): Required<Pick<TreeItemProps<Value>, 'value' | 'aria-setsize' | 'aria-level' | 'aria-posinset' | 'leaf'>> & TreeItemProps<Value>;
|
|
171
173
|
};
|
|
172
174
|
|
|
173
|
-
export declare type NestedTreeItem = Omit<TreeItemProps
|
|
174
|
-
subtree?: NestedTreeItem[];
|
|
175
|
+
export declare type NestedTreeItem<Value = string> = Omit<TreeItemProps<Value>, 'subtree'> & {
|
|
176
|
+
subtree?: NestedTreeItem<Value>[];
|
|
175
177
|
};
|
|
176
178
|
|
|
177
179
|
export declare const renderTree_unstable: (state: TreeState, contextValues: TreeContextValues) => JSX.Element;
|
|
@@ -199,7 +201,22 @@ export declare const renderTreeItemPersonaLayout_unstable: (state: TreeItemPerso
|
|
|
199
201
|
* an item representing a folder can be expanded to reveal the contents of the folder,
|
|
200
202
|
* which may be files, folders, or both.
|
|
201
203
|
*/
|
|
202
|
-
export declare const Tree:
|
|
204
|
+
export declare const Tree: React_2.ForwardRefExoticComponent<Omit<TreeSlots, "root"> & Omit<{
|
|
205
|
+
as?: "div" | undefined;
|
|
206
|
+
} & Pick<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React_2.HTMLAttributes<HTMLDivElement>> & {
|
|
207
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React_2.RefObject<HTMLDivElement> | null | undefined;
|
|
208
|
+
} & {
|
|
209
|
+
children?: React_2.ReactNode | SlotRenderFunction<Pick<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React_2.HTMLAttributes<HTMLDivElement>> & {
|
|
210
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React_2.RefObject<HTMLDivElement> | null | undefined;
|
|
211
|
+
}>;
|
|
212
|
+
}, "ref"> & {
|
|
213
|
+
appearance?: "subtle" | "subtle-alpha" | "transparent" | undefined;
|
|
214
|
+
size?: "small" | "medium" | undefined;
|
|
215
|
+
openItems?: Iterable<string> | undefined;
|
|
216
|
+
defaultOpenItems?: Iterable<string> | undefined;
|
|
217
|
+
onOpenChange?(event: React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement, MouseEvent>, data: TreeOpenChangeData<string>): void;
|
|
218
|
+
onNavigation_unstable?(event: React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement, MouseEvent>, data: TreeNavigationData_unstable<string>): void;
|
|
219
|
+
} & React_2.RefAttributes<HTMLDivElement>> & (<Value = string>(props: TreeProps<Value>) => JSX.Element);
|
|
203
220
|
|
|
204
221
|
export declare const treeClassNames: SlotClassNames<TreeSlots>;
|
|
205
222
|
|
|
@@ -207,12 +224,12 @@ export declare type TreeContextValue = {
|
|
|
207
224
|
level: number;
|
|
208
225
|
appearance: 'subtle' | 'subtle-alpha' | 'transparent';
|
|
209
226
|
size: 'small' | 'medium';
|
|
210
|
-
openItems: ImmutableSet<
|
|
227
|
+
openItems: ImmutableSet<unknown>;
|
|
211
228
|
/**
|
|
212
229
|
* Requests dialog main component to update it's internal open state
|
|
213
230
|
*/
|
|
214
|
-
requestOpenChange(data: TreeOpenChangeData): void;
|
|
215
|
-
requestNavigation(data: TreeNavigationData_unstable): void;
|
|
231
|
+
requestOpenChange(data: TreeOpenChangeData<unknown>): void;
|
|
232
|
+
requestNavigation(data: TreeNavigationData_unstable<unknown>): void;
|
|
216
233
|
};
|
|
217
234
|
|
|
218
235
|
declare type TreeContextValues = {
|
|
@@ -228,10 +245,23 @@ declare type TreeContextValues = {
|
|
|
228
245
|
* The content and layout of a TreeItem can be defined using the TreeItemLayout or TreeItemPersonaLayout component,
|
|
229
246
|
* which should be used as a direct child of TreeItem.
|
|
230
247
|
*
|
|
231
|
-
* When a TreeItem has
|
|
248
|
+
* When a TreeItem has nested child subtree, an expand/collapse control is displayed,
|
|
232
249
|
* allowing the user to show or hide the children.
|
|
233
250
|
*/
|
|
234
|
-
export declare const TreeItem:
|
|
251
|
+
export declare const TreeItem: React_2.ForwardRefExoticComponent<Omit<Partial<TreeItemSlots>, "root"> & Omit<{
|
|
252
|
+
as?: "div" | undefined;
|
|
253
|
+
} & Pick<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React_2.HTMLAttributes<HTMLDivElement>> & {
|
|
254
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React_2.RefObject<HTMLDivElement> | null | undefined;
|
|
255
|
+
} & {
|
|
256
|
+
children?: React_2.ReactNode | SlotRenderFunction<Pick<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React_2.HTMLAttributes<HTMLDivElement>> & {
|
|
257
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React_2.RefObject<HTMLDivElement> | null | undefined;
|
|
258
|
+
}>;
|
|
259
|
+
} & {
|
|
260
|
+
style?: TreeItemCSSProperties | undefined;
|
|
261
|
+
}, "ref"> & {
|
|
262
|
+
value?: string | undefined;
|
|
263
|
+
leaf?: boolean | undefined;
|
|
264
|
+
} & React_2.RefAttributes<HTMLDivElement>> & (<Value = string>(props: TreeItemProps<Value>) => JSX.Element);
|
|
235
265
|
|
|
236
266
|
export declare const treeItemClassNames: SlotClassNames<TreeItemSlots>;
|
|
237
267
|
|
|
@@ -248,8 +278,6 @@ declare type TreeItemCSSProperties = React_2.CSSProperties & {
|
|
|
248
278
|
[treeItemLevelToken]?: string | number;
|
|
249
279
|
};
|
|
250
280
|
|
|
251
|
-
export declare type TreeItemId = string;
|
|
252
|
-
|
|
253
281
|
/**
|
|
254
282
|
* The `TreeItemLayout` component is used as a child of `TreeItem` to define the content and layout of a tree item.
|
|
255
283
|
* It provides a consistent visual structure for tree items in a `Tree` component.
|
|
@@ -265,7 +293,7 @@ export declare const treeItemLayoutClassNames: SlotClassNames<TreeItemLayoutSlot
|
|
|
265
293
|
export declare type TreeItemLayoutProps = ComponentProps<Partial<TreeItemLayoutSlots>>;
|
|
266
294
|
|
|
267
295
|
export declare type TreeItemLayoutSlots = {
|
|
268
|
-
root: Slot<'
|
|
296
|
+
root: Slot<'span'>;
|
|
269
297
|
/**
|
|
270
298
|
* Icon slot that renders right before main content
|
|
271
299
|
*/
|
|
@@ -274,6 +302,9 @@ export declare type TreeItemLayoutSlots = {
|
|
|
274
302
|
* Icon slot that renders right after main content
|
|
275
303
|
*/
|
|
276
304
|
iconAfter?: Slot<'span'>;
|
|
305
|
+
/**
|
|
306
|
+
* slot that render right after main content and iconAfter
|
|
307
|
+
*/
|
|
277
308
|
aside?: Slot<'span'>;
|
|
278
309
|
};
|
|
279
310
|
|
|
@@ -336,7 +367,8 @@ export declare type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaL
|
|
|
336
367
|
/**
|
|
337
368
|
* TreeItem Props
|
|
338
369
|
*/
|
|
339
|
-
export declare type TreeItemProps = ComponentProps<Partial<TreeItemSlots>> & {
|
|
370
|
+
export declare type TreeItemProps<Value = string> = ComponentProps<Partial<TreeItemSlots>> & {
|
|
371
|
+
value?: Value;
|
|
340
372
|
/**
|
|
341
373
|
* If a TreeItem is a leaf, it'll not present the `expandIcon` slot by default.
|
|
342
374
|
* This attribute is used to force the decision if a TreeItem is a leaf or not. By not providing this property
|
|
@@ -379,44 +411,40 @@ export declare type TreeItemState = ComponentState<TreeItemSlots> & {
|
|
|
379
411
|
isActionsVisible: boolean;
|
|
380
412
|
};
|
|
381
413
|
|
|
382
|
-
export declare type TreeNavigationData_unstable = {
|
|
383
|
-
|
|
414
|
+
export declare type TreeNavigationData_unstable<Value = string> = {
|
|
415
|
+
value: Value;
|
|
384
416
|
target: HTMLElement;
|
|
417
|
+
} & ({
|
|
418
|
+
event: React_2.MouseEvent<HTMLElement>;
|
|
385
419
|
type: 'Click';
|
|
386
420
|
} | {
|
|
387
421
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
388
|
-
target: HTMLElement;
|
|
389
422
|
type: 'TypeAhead';
|
|
390
423
|
} | {
|
|
391
424
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
392
|
-
target: HTMLElement;
|
|
393
425
|
type: typeof ArrowRight;
|
|
394
426
|
} | {
|
|
395
427
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
396
|
-
target: HTMLElement;
|
|
397
428
|
type: typeof ArrowLeft;
|
|
398
429
|
} | {
|
|
399
430
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
400
|
-
target: HTMLElement;
|
|
401
431
|
type: typeof ArrowUp;
|
|
402
432
|
} | {
|
|
403
433
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
404
|
-
target: HTMLElement;
|
|
405
434
|
type: typeof ArrowDown;
|
|
406
435
|
} | {
|
|
407
436
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
408
|
-
target: HTMLElement;
|
|
409
437
|
type: typeof Home;
|
|
410
438
|
} | {
|
|
411
439
|
event: React_2.KeyboardEvent<HTMLElement>;
|
|
412
|
-
target: HTMLElement;
|
|
413
440
|
type: typeof End;
|
|
414
|
-
};
|
|
441
|
+
});
|
|
415
442
|
|
|
416
443
|
export declare type TreeNavigationEvent_unstable = TreeNavigationData_unstable['event'];
|
|
417
444
|
|
|
418
|
-
export declare type TreeOpenChangeData = {
|
|
445
|
+
export declare type TreeOpenChangeData<Value = string> = {
|
|
419
446
|
open: boolean;
|
|
447
|
+
value: Value;
|
|
420
448
|
} & ({
|
|
421
449
|
event: React_2.MouseEvent<HTMLElement>;
|
|
422
450
|
target: HTMLElement;
|
|
@@ -441,7 +469,7 @@ export declare type TreeOpenChangeData = {
|
|
|
441
469
|
|
|
442
470
|
export declare type TreeOpenChangeEvent = TreeOpenChangeData['event'];
|
|
443
471
|
|
|
444
|
-
export declare type TreeProps = ComponentProps<TreeSlots> & {
|
|
472
|
+
export declare type TreeProps<Value = string> = ComponentProps<TreeSlots> & {
|
|
445
473
|
/**
|
|
446
474
|
* A tree item can have various appearances:
|
|
447
475
|
* - 'subtle' (default): The default tree item styles.
|
|
@@ -460,13 +488,13 @@ export declare type TreeProps = ComponentProps<TreeSlots> & {
|
|
|
460
488
|
* Controls the state of the open tree items.
|
|
461
489
|
* These property is ignored for subtrees.
|
|
462
490
|
*/
|
|
463
|
-
openItems?: Iterable<
|
|
491
|
+
openItems?: Iterable<Value>;
|
|
464
492
|
/**
|
|
465
493
|
* This refers to a list of ids of opened tree items.
|
|
466
494
|
* Default value for the uncontrolled state of open tree items.
|
|
467
495
|
* These property is ignored for subtrees.
|
|
468
496
|
*/
|
|
469
|
-
defaultOpenItems?: Iterable<
|
|
497
|
+
defaultOpenItems?: Iterable<Value>;
|
|
470
498
|
/**
|
|
471
499
|
* Callback fired when the component changes value from open state.
|
|
472
500
|
* These property is ignored for subtrees.
|
|
@@ -475,7 +503,7 @@ export declare type TreeProps = ComponentProps<TreeSlots> & {
|
|
|
475
503
|
* @param data - A data object with relevant information,
|
|
476
504
|
* such as open value and type of interaction that created the event.
|
|
477
505
|
*/
|
|
478
|
-
onOpenChange?(event: TreeOpenChangeEvent, data: TreeOpenChangeData): void;
|
|
506
|
+
onOpenChange?(event: TreeOpenChangeEvent, data: TreeOpenChangeData<Value>): void;
|
|
479
507
|
/**
|
|
480
508
|
* Callback fired when navigation happens inside the component.
|
|
481
509
|
* These property is ignored for subtrees.
|
|
@@ -485,7 +513,7 @@ export declare type TreeProps = ComponentProps<TreeSlots> & {
|
|
|
485
513
|
* @param event - a React's Synthetic event
|
|
486
514
|
* @param data - A data object with relevant information,
|
|
487
515
|
*/
|
|
488
|
-
onNavigation_unstable?(event: TreeNavigationEvent_unstable, data: TreeNavigationData_unstable): void;
|
|
516
|
+
onNavigation_unstable?(event: TreeNavigationEvent_unstable, data: TreeNavigationData_unstable<Value>): void;
|
|
489
517
|
};
|
|
490
518
|
|
|
491
519
|
export declare const TreeProvider: Provider<TreeContextValue | undefined> & FC<ProviderProps<TreeContextValue | undefined>>;
|
|
@@ -511,7 +539,7 @@ export declare type TreeState = ComponentState<TreeSlots> & TreeContextValue;
|
|
|
511
539
|
* @param flatTreeItemProps - a list of tree items
|
|
512
540
|
* @param options - in case control over the internal openItems is required
|
|
513
541
|
*/
|
|
514
|
-
export declare function useFlatTree_unstable(flatTreeItemProps: FlatTreeItemProps[], options?: Pick<TreeProps
|
|
542
|
+
export declare function useFlatTree_unstable<Value = string>(flatTreeItemProps: FlatTreeItemProps<Value>[], options?: Pick<TreeProps<Value>, 'openItems' | 'defaultOpenItems' | 'onOpenChange' | 'onNavigation_unstable'>): FlatTree<Value>;
|
|
515
543
|
|
|
516
544
|
/**
|
|
517
545
|
* Create the state required to render Tree.
|
|
@@ -537,7 +565,7 @@ export declare function useTreeContextValues_unstable(state: TreeState): TreeCon
|
|
|
537
565
|
* @param props - props from this instance of TreeItem
|
|
538
566
|
* @param ref - reference to root HTMLElement of TreeItem
|
|
539
567
|
*/
|
|
540
|
-
export declare
|
|
568
|
+
export declare function useTreeItem_unstable<Value = string>(props: TreeItemProps<Value>, ref: React_2.Ref<HTMLDivElement>): TreeItemState;
|
|
541
569
|
|
|
542
570
|
export declare const useTreeItemContext_unstable: () => TreeItemContextValue;
|
|
543
571
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useTree_unstable","renderTree_unstable","useTreeStyles_unstable","useTreeContextValues_unstable","Tree","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../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
|
|
1
|
+
{"version":3,"names":["React","useTree_unstable","renderTree_unstable","useTreeStyles_unstable","useTreeContextValues_unstable","Tree","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../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 = 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}) as ForwardRefComponent<TreeProps> & (<Value = string>(props: TreeProps<Value>) => JSX.Element);\n\nTree.displayName = 'Tree';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,sBAAsB,QAAQ;AAGvC,SAASC,6BAA6B,QAAQ;AAE9C;;;;;;;;AAQA,OAAO,MAAMC,IAAA,gBAAOL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACnD,MAAMC,KAAA,GAAQR,gBAAA,CAAiBM,KAAA,EAAOC,GAAA;EACtCL,sBAAA,CAAuBM,KAAA;EACvB,MAAMC,aAAA,GAAgBN,6BAAA,CAA8BK,KAAA;EACpD,OAAOP,mBAAA,CAAoBO,KAAA,EAAOC,aAAA;AACpC;AAEAL,IAAA,CAAKM,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React"],"sources":["../../../src/components/Tree/Tree.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TreeContextValue } from '../../contexts/treeContext';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, End, Enter, Home } from '@fluentui/keyboard-keys';\
|
|
1
|
+
{"version":3,"names":["React"],"sources":["../../../src/components/Tree/Tree.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { TreeContextValue } from '../../contexts/treeContext';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, End, Enter, Home } from '@fluentui/keyboard-keys';\n\nexport type TreeSlots = {\n root: Slot<'div'>;\n};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type TreeNavigationData_unstable<Value = string> = { value: Value; target: HTMLElement } & (\n | { event: React.MouseEvent<HTMLElement>; type: 'Click' }\n | { event: React.KeyboardEvent<HTMLElement>; type: 'TypeAhead' }\n | { event: React.KeyboardEvent<HTMLElement>; type: typeof ArrowRight }\n | { event: React.KeyboardEvent<HTMLElement>; type: typeof ArrowLeft }\n | { event: React.KeyboardEvent<HTMLElement>; type: typeof ArrowUp }\n | { event: React.KeyboardEvent<HTMLElement>; type: typeof ArrowDown }\n | { event: React.KeyboardEvent<HTMLElement>; type: typeof Home }\n | { event: React.KeyboardEvent<HTMLElement>; type: typeof End }\n);\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type TreeNavigationEvent_unstable = TreeNavigationData_unstable['event'];\n\nexport type TreeOpenChangeData<Value = string> = { open: boolean; value: Value } & (\n | {\n event: React.MouseEvent<HTMLElement>;\n target: HTMLElement;\n type: 'ExpandIconClick';\n }\n | {\n event: React.MouseEvent<HTMLElement>;\n target: HTMLElement;\n type: 'Click';\n }\n | {\n event: React.KeyboardEvent<HTMLElement>;\n target: HTMLElement;\n type: typeof Enter;\n }\n | {\n event: React.KeyboardEvent<HTMLElement>;\n target: HTMLElement;\n type: typeof ArrowRight;\n }\n | {\n event: React.KeyboardEvent<HTMLElement>;\n target: HTMLElement;\n type: typeof ArrowLeft;\n }\n);\n\nexport type TreeOpenChangeEvent = TreeOpenChangeData['event'];\n\nexport type TreeContextValues = {\n tree: TreeContextValue;\n};\n\nexport type TreeProps<Value = string> = ComponentProps<TreeSlots> & {\n /**\n * A tree item can have various appearances:\n * - 'subtle' (default): The default tree item styles.\n * - 'subtle-alpha': Minimizes emphasis on hovered or focused states.\n * - 'transparent': Removes background color.\n * @default 'subtle'\n */\n appearance?: 'subtle' | 'subtle-alpha' | 'transparent';\n /**\n * Size of the tree item.\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n /**\n * This refers to a list of ids of opened tree items.\n * Controls the state of the open tree items.\n * These property is ignored for subtrees.\n */\n openItems?: Iterable<Value>;\n /**\n * This refers to a list of ids of opened tree items.\n * Default value for the uncontrolled state of open tree items.\n * These property is ignored for subtrees.\n */\n defaultOpenItems?: Iterable<Value>;\n /**\n * Callback fired when the component changes value from open state.\n * These property is ignored for subtrees.\n *\n * @param event - a React's Synthetic event\n * @param data - A data object with relevant information,\n * such as open value and type of interaction that created the event.\n */\n onOpenChange?(event: TreeOpenChangeEvent, data: TreeOpenChangeData<Value>): void;\n\n /**\n * Callback fired when navigation happens inside the component.\n * These property is ignored for subtrees.\n *\n * FIXME: This method is not ideal, as navigation should be handled internally by tabster.\n *\n * @param event - a React's Synthetic event\n * @param data - A data object with relevant information,\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n onNavigation_unstable?(event: TreeNavigationEvent_unstable, data: TreeNavigationData_unstable<Value>): void;\n};\n\n/**\n * State used in rendering Tree\n */\nexport type TreeState = ComponentState<TreeSlots> & TreeContextValue;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
|
3
3
|
import { TreeProvider } from '../../contexts';
|
|
4
4
|
export const renderTree_unstable = (state, contextValues) => {
|
|
5
5
|
const {
|
|
6
6
|
slots,
|
|
7
7
|
slotProps
|
|
8
|
-
} =
|
|
9
|
-
return /*#__PURE__*/
|
|
8
|
+
} = getSlotsNext(state);
|
|
9
|
+
return /*#__PURE__*/createElement(TreeProvider, {
|
|
10
10
|
value: contextValues.tree
|
|
11
|
-
}, /*#__PURE__*/
|
|
11
|
+
}, /*#__PURE__*/createElement(slots.root, slotProps.root, slotProps.root.children));
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=renderTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createElement","getSlotsNext","TreeProvider","renderTree_unstable","state","contextValues","slots","slotProps","value","tree","root","children"],"sources":["../../../src/components/Tree/renderTree.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { TreeState, TreeSlots, TreeContextValues } from './Tree.types';\nimport { TreeProvider } from '../../contexts';\n\nexport const renderTree_unstable = (state: TreeState, contextValues: TreeContextValues) => {\n const { slots, slotProps } = getSlotsNext<TreeSlots>(state);\n\n return (\n <TreeProvider value={contextValues.tree}>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n </TreeProvider>\n );\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAC9B,SAASC,YAAY,QAAQ;AAE7B,SAASC,YAAY,QAAQ;AAE7B,OAAO,MAAMC,mBAAA,GAAsBA,CAACC,KAAA,EAAkBC,aAAA,KAAqC;EACzF,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGN,YAAA,CAAwBG,KAAA;EAErD,oBACEJ,aAXJ,CAWKE,YAAA;IAAaM,KAAA,EAAOH,aAAA,CAAcI;kBACjCT,aAZN,CAYOM,KAAA,CAAMI,IAAI,EAAKH,SAAA,CAAUG,IAAI,EAAGH,SAAA,CAAUG,IAAI,CAACC,QAAQ;AAG9D"}
|
|
@@ -12,7 +12,7 @@ import { useTreeItemContextValues_unstable } from './useTreeItemContextValues';
|
|
|
12
12
|
* The content and layout of a TreeItem can be defined using the TreeItemLayout or TreeItemPersonaLayout component,
|
|
13
13
|
* which should be used as a direct child of TreeItem.
|
|
14
14
|
*
|
|
15
|
-
* When a TreeItem has
|
|
15
|
+
* When a TreeItem has nested child subtree, an expand/collapse control is displayed,
|
|
16
16
|
* allowing the user to show or hide the children.
|
|
17
17
|
*/
|
|
18
18
|
export const TreeItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useTreeItem_unstable","renderTreeItem_unstable","useTreeItemStyles_unstable","useTreeItemContextValues_unstable","TreeItem","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../src/components/TreeItem/TreeItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTreeItem_unstable } from './useTreeItem';\nimport { renderTreeItem_unstable } from './renderTreeItem';\nimport { useTreeItemStyles_unstable } from './useTreeItemStyles';\nimport type { TreeItemProps } from './TreeItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTreeItemContextValues_unstable } from './useTreeItemContextValues';\n\n/**\n * The `TreeItem` component represents a single item in a tree.\n * It expects a certain order of children to work properly: the first child should be the node itself,\n * and the second child should be a nested subtree in the form of another Tree component or a standalone TreeItem.\n * This order follows the same order as document traversal for the TreeWalker API in JavaScript:\n * https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker.\n * The content and layout of a TreeItem can be defined using the TreeItemLayout or TreeItemPersonaLayout component,\n * which should be used as a direct child of TreeItem.\n *\n * When a TreeItem has
|
|
1
|
+
{"version":3,"names":["React","useTreeItem_unstable","renderTreeItem_unstable","useTreeItemStyles_unstable","useTreeItemContextValues_unstable","TreeItem","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../src/components/TreeItem/TreeItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTreeItem_unstable } from './useTreeItem';\nimport { renderTreeItem_unstable } from './renderTreeItem';\nimport { useTreeItemStyles_unstable } from './useTreeItemStyles';\nimport type { TreeItemProps } from './TreeItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTreeItemContextValues_unstable } from './useTreeItemContextValues';\n\n/**\n * The `TreeItem` component represents a single item in a tree.\n * It expects a certain order of children to work properly: the first child should be the node itself,\n * and the second child should be a nested subtree in the form of another Tree component or a standalone TreeItem.\n * This order follows the same order as document traversal for the TreeWalker API in JavaScript:\n * https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker.\n * The content and layout of a TreeItem can be defined using the TreeItemLayout or TreeItemPersonaLayout component,\n * which should be used as a direct child of TreeItem.\n *\n * When a TreeItem has nested child subtree, an expand/collapse control is displayed,\n * allowing the user to show or hide the children.\n */\nexport const TreeItem = React.forwardRef((props, ref) => {\n const state = useTreeItem_unstable(props, ref);\n\n useTreeItemStyles_unstable(state);\n const contextValues = useTreeItemContextValues_unstable(state);\n return renderTreeItem_unstable(state, contextValues);\n}) as ForwardRefComponent<TreeItemProps> & (<Value = string>(props: TreeItemProps<Value>) => JSX.Element);\n\nTreeItem.displayName = 'TreeItem';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,iCAAiC,QAAQ;AAElD;;;;;;;;;;;;AAYA,OAAO,MAAMC,QAAA,gBAAWL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvD,MAAMC,KAAA,GAAQR,oBAAA,CAAqBM,KAAA,EAAOC,GAAA;EAE1CL,0BAAA,CAA2BM,KAAA;EAC3B,MAAMC,aAAA,GAAgBN,iCAAA,CAAkCK,KAAA;EACxD,OAAOP,uBAAA,CAAwBO,KAAA,EAAOC,aAAA;AACxC;AAEAL,QAAA,CAASM,WAAW,GAAG"}
|