@fluentui/react-table 9.8.6 → 9.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +273 -1
- package/CHANGELOG.md +76 -2
- package/dist/index.d.ts +7 -2
- package/lib/components/DataGrid/useDataGrid.js +2 -2
- package/lib/components/DataGrid/useDataGrid.js.map +1 -1
- package/lib/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +13 -3
- package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib/components/DataGridRow/useDataGridRow.js +4 -4
- package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +2 -2
- package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
- package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js +2 -1
- package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib/components/TableResizeHandle/useTableResizeHandle.js +2 -2
- package/lib/components/TableResizeHandle/useTableResizeHandle.js.map +1 -1
- package/lib/contexts/columnIdContext.js +4 -2
- package/lib/contexts/columnIdContext.js.map +1 -1
- package/lib/contexts/rowIdContext.js +4 -2
- package/lib/contexts/rowIdContext.js.map +1 -1
- package/lib/contexts/tableContext.js +4 -2
- package/lib/contexts/tableContext.js.map +1 -1
- package/lib/hooks/types.js.map +1 -1
- package/lib/hooks/useKeyboardResizing.js +4 -4
- package/lib/hooks/useKeyboardResizing.js.map +1 -1
- package/lib/hooks/useMeasureElement.js +1 -4
- package/lib/hooks/useMeasureElement.js.map +1 -1
- package/lib/hooks/useTableColumnResizeMouseHandler.js +11 -17
- package/lib/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
- package/lib/hooks/useTableColumnSizing.js +3 -4
- package/lib/hooks/useTableColumnSizing.js.map +1 -1
- package/lib/hooks/useTableFeatures.js +2 -3
- package/lib/hooks/useTableFeatures.js.map +1 -1
- package/lib/hooks/useTableSelection.js +3 -5
- package/lib/hooks/useTableSelection.js.map +1 -1
- package/lib/hooks/useTableSort.js +3 -6
- package/lib/hooks/useTableSort.js.map +1 -1
- package/lib/utils/columnResizeUtils.js +2 -4
- package/lib/utils/columnResizeUtils.js.map +1 -1
- package/lib/utils/isColumnSortable.js +3 -0
- package/lib/utils/isColumnSortable.js.map +1 -0
- package/lib-commonjs/components/DataGrid/useDataGrid.js +2 -2
- package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +13 -3
- package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js +4 -4
- package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +2 -2
- package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +2 -1
- package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js +2 -2
- package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js.map +1 -1
- package/lib-commonjs/contexts/columnIdContext.js +4 -2
- package/lib-commonjs/contexts/columnIdContext.js.map +1 -1
- package/lib-commonjs/contexts/rowIdContext.js +4 -2
- package/lib-commonjs/contexts/rowIdContext.js.map +1 -1
- package/lib-commonjs/contexts/tableContext.js +4 -2
- package/lib-commonjs/contexts/tableContext.js.map +1 -1
- package/lib-commonjs/hooks/useKeyboardResizing.js +4 -4
- package/lib-commonjs/hooks/useKeyboardResizing.js.map +1 -1
- package/lib-commonjs/hooks/useMeasureElement.js +1 -4
- package/lib-commonjs/hooks/useMeasureElement.js.map +1 -1
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js +11 -17
- package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
- package/lib-commonjs/hooks/useTableColumnSizing.js +3 -4
- package/lib-commonjs/hooks/useTableColumnSizing.js.map +1 -1
- package/lib-commonjs/hooks/useTableFeatures.js +2 -3
- package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
- package/lib-commonjs/hooks/useTableSelection.js +3 -5
- package/lib-commonjs/hooks/useTableSelection.js.map +1 -1
- package/lib-commonjs/hooks/useTableSort.js +3 -6
- package/lib-commonjs/hooks/useTableSort.js.map +1 -1
- package/lib-commonjs/utils/columnResizeUtils.js +2 -4
- package/lib-commonjs/utils/columnResizeUtils.js.map +1 -1
- package/lib-commonjs/utils/isColumnSortable.js +13 -0
- package/lib-commonjs/utils/isColumnSortable.js.map +1 -0
- package/package.json +13 -13
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,279 @@
|
|
|
2
2
|
"name": "@fluentui/react-table",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 26 Sep 2023 17:44:17 GMT",
|
|
6
|
+
"tag": "@fluentui/react-table_v9.9.1",
|
|
7
|
+
"version": "9.9.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "yuanboxue@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-table",
|
|
13
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d",
|
|
14
|
+
"comment": "chore: trigger manual version bump after broken release"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-table",
|
|
19
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.6",
|
|
20
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-table",
|
|
25
|
+
"comment": "Bump @fluentui/react-aria to v9.3.38",
|
|
26
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-table",
|
|
31
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.34",
|
|
32
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-table",
|
|
37
|
+
"comment": "Bump @fluentui/react-checkbox to v9.1.44",
|
|
38
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-table",
|
|
43
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.36",
|
|
44
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-table",
|
|
49
|
+
"comment": "Bump @fluentui/react-radio to v9.1.44",
|
|
50
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@fluentui/react-table",
|
|
55
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.1",
|
|
56
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@fluentui/react-table",
|
|
61
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.1",
|
|
62
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@fluentui/react-table",
|
|
67
|
+
"comment": "Bump @fluentui/react-theme to v9.1.14",
|
|
68
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "beachball",
|
|
72
|
+
"package": "@fluentui/react-table",
|
|
73
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.5",
|
|
74
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@fluentui/react-table",
|
|
79
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.12",
|
|
80
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"date": "Tue, 26 Sep 2023 15:31:48 GMT",
|
|
87
|
+
"tag": "@fluentui/react-table_v9.9.0",
|
|
88
|
+
"version": "9.9.0",
|
|
89
|
+
"comments": {
|
|
90
|
+
"patch": [
|
|
91
|
+
{
|
|
92
|
+
"author": "martinhochel@microsoft.com",
|
|
93
|
+
"package": "@fluentui/react-table",
|
|
94
|
+
"commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
|
|
95
|
+
"comment": "fix: bump swc core to mitigate transpilation memory leaks"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "ololubek@microsoft.com",
|
|
99
|
+
"package": "@fluentui/react-table",
|
|
100
|
+
"commit": "a31e7394d9f169bc5aa55430a22cdc65425a1b49",
|
|
101
|
+
"comment": "chore: Update react-icons version to pick up IconDirectionContextProvider updated export"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"minor": [
|
|
105
|
+
{
|
|
106
|
+
"author": "kakrookaran@gmail.com",
|
|
107
|
+
"package": "@fluentui/react-table",
|
|
108
|
+
"commit": "f6a23fb313d375903616b436065d255a5f6367a0",
|
|
109
|
+
"comment": "feat: add sorting on individual columns"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"author": "beachball",
|
|
113
|
+
"package": "@fluentui/react-table",
|
|
114
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.5",
|
|
115
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"author": "beachball",
|
|
119
|
+
"package": "@fluentui/react-table",
|
|
120
|
+
"comment": "Bump @fluentui/react-aria to v9.3.37",
|
|
121
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"author": "beachball",
|
|
125
|
+
"package": "@fluentui/react-table",
|
|
126
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.33",
|
|
127
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"author": "beachball",
|
|
131
|
+
"package": "@fluentui/react-table",
|
|
132
|
+
"comment": "Bump @fluentui/react-checkbox to v9.1.43",
|
|
133
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"author": "beachball",
|
|
137
|
+
"package": "@fluentui/react-table",
|
|
138
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.35",
|
|
139
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"author": "beachball",
|
|
143
|
+
"package": "@fluentui/react-table",
|
|
144
|
+
"comment": "Bump @fluentui/react-radio to v9.1.43",
|
|
145
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"author": "beachball",
|
|
149
|
+
"package": "@fluentui/react-table",
|
|
150
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.0",
|
|
151
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"author": "beachball",
|
|
155
|
+
"package": "@fluentui/react-table",
|
|
156
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.0",
|
|
157
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"author": "beachball",
|
|
161
|
+
"package": "@fluentui/react-table",
|
|
162
|
+
"comment": "Bump @fluentui/react-theme to v9.1.13",
|
|
163
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"author": "beachball",
|
|
167
|
+
"package": "@fluentui/react-table",
|
|
168
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.4",
|
|
169
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"author": "beachball",
|
|
173
|
+
"package": "@fluentui/react-table",
|
|
174
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.11",
|
|
175
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"date": "Wed, 20 Sep 2023 17:47:43 GMT",
|
|
182
|
+
"tag": "@fluentui/react-table_v9.8.8",
|
|
183
|
+
"version": "9.8.8",
|
|
184
|
+
"comments": {
|
|
185
|
+
"patch": [
|
|
186
|
+
{
|
|
187
|
+
"author": "martinhochel@microsoft.com",
|
|
188
|
+
"package": "@fluentui/react-table",
|
|
189
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0",
|
|
190
|
+
"comment": "chore: trigger manual version bump after broken release"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"author": "beachball",
|
|
194
|
+
"package": "@fluentui/react-table",
|
|
195
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.32",
|
|
196
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"author": "beachball",
|
|
200
|
+
"package": "@fluentui/react-table",
|
|
201
|
+
"comment": "Bump @fluentui/react-checkbox to v9.1.42",
|
|
202
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"author": "beachball",
|
|
206
|
+
"package": "@fluentui/react-table",
|
|
207
|
+
"comment": "Bump @fluentui/react-radio to v9.1.42",
|
|
208
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"author": "beachball",
|
|
212
|
+
"package": "@fluentui/react-table",
|
|
213
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.8.1",
|
|
214
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"author": "beachball",
|
|
218
|
+
"package": "@fluentui/react-table",
|
|
219
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.11",
|
|
220
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"author": "beachball",
|
|
224
|
+
"package": "@fluentui/react-table",
|
|
225
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.10",
|
|
226
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"date": "Wed, 20 Sep 2023 14:59:53 GMT",
|
|
233
|
+
"tag": "@fluentui/react-table_v9.8.7",
|
|
234
|
+
"version": "9.8.7",
|
|
235
|
+
"comments": {
|
|
236
|
+
"patch": [
|
|
237
|
+
{
|
|
238
|
+
"author": "beachball",
|
|
239
|
+
"package": "@fluentui/react-table",
|
|
240
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.31",
|
|
241
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"author": "beachball",
|
|
245
|
+
"package": "@fluentui/react-table",
|
|
246
|
+
"comment": "Bump @fluentui/react-checkbox to v9.1.41",
|
|
247
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"author": "beachball",
|
|
251
|
+
"package": "@fluentui/react-table",
|
|
252
|
+
"comment": "Bump @fluentui/react-radio to v9.1.41",
|
|
253
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"author": "beachball",
|
|
257
|
+
"package": "@fluentui/react-table",
|
|
258
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.8.0",
|
|
259
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"author": "beachball",
|
|
263
|
+
"package": "@fluentui/react-table",
|
|
264
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.10",
|
|
265
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"author": "beachball",
|
|
269
|
+
"package": "@fluentui/react-table",
|
|
270
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.9",
|
|
271
|
+
"commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"date": "Thu, 14 Sep 2023 16:44:47 GMT",
|
|
6
278
|
"tag": "@fluentui/react-table_v9.8.6",
|
|
7
279
|
"version": "9.8.6",
|
|
8
280
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,86 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-table
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 26 Sep 2023 17:44:17 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.9.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.9.1)
|
|
8
|
+
|
|
9
|
+
Tue, 26 Sep 2023 17:44:17 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.9.0..@fluentui/react-table_v9.9.1)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
|
|
15
|
+
- Bump @fluentui/keyboard-keys to v9.0.6 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
16
|
+
- Bump @fluentui/react-aria to v9.3.38 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
17
|
+
- Bump @fluentui/react-avatar to v9.5.34 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
18
|
+
- Bump @fluentui/react-checkbox to v9.1.44 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
19
|
+
- Bump @fluentui/react-context-selector to v9.1.36 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
20
|
+
- Bump @fluentui/react-radio to v9.1.44 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
21
|
+
- Bump @fluentui/react-shared-contexts to v9.9.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
22
|
+
- Bump @fluentui/react-tabster to v9.13.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
23
|
+
- Bump @fluentui/react-theme to v9.1.14 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
24
|
+
- Bump @fluentui/react-utilities to v9.13.5 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
25
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.12 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
|
26
|
+
|
|
27
|
+
## [9.9.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.9.0)
|
|
28
|
+
|
|
29
|
+
Tue, 26 Sep 2023 15:31:48 GMT
|
|
30
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.8.8..@fluentui/react-table_v9.9.0)
|
|
31
|
+
|
|
32
|
+
### Minor changes
|
|
33
|
+
|
|
34
|
+
- feat: add sorting on individual columns ([PR #29196](https://github.com/microsoft/fluentui/pull/29196) by kakrookaran@gmail.com)
|
|
35
|
+
- Bump @fluentui/keyboard-keys to v9.0.5 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
36
|
+
- Bump @fluentui/react-aria to v9.3.37 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
37
|
+
- Bump @fluentui/react-avatar to v9.5.33 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
38
|
+
- Bump @fluentui/react-checkbox to v9.1.43 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
39
|
+
- Bump @fluentui/react-context-selector to v9.1.35 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
40
|
+
- Bump @fluentui/react-radio to v9.1.43 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
41
|
+
- Bump @fluentui/react-shared-contexts to v9.9.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
42
|
+
- Bump @fluentui/react-tabster to v9.13.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
43
|
+
- Bump @fluentui/react-theme to v9.1.13 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
44
|
+
- Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
45
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.11 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
|
46
|
+
|
|
47
|
+
### Patches
|
|
48
|
+
|
|
49
|
+
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
|
|
50
|
+
- chore: Update react-icons version to pick up IconDirectionContextProvider updated export ([PR #29151](https://github.com/microsoft/fluentui/pull/29151) by ololubek@microsoft.com)
|
|
51
|
+
|
|
52
|
+
## [9.8.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.8.8)
|
|
53
|
+
|
|
54
|
+
Wed, 20 Sep 2023 17:47:43 GMT
|
|
55
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.8.7..@fluentui/react-table_v9.8.8)
|
|
56
|
+
|
|
57
|
+
### Patches
|
|
58
|
+
|
|
59
|
+
- chore: trigger manual version bump after broken release ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by martinhochel@microsoft.com)
|
|
60
|
+
- Bump @fluentui/react-avatar to v9.5.32 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
61
|
+
- Bump @fluentui/react-checkbox to v9.1.42 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
62
|
+
- Bump @fluentui/react-radio to v9.1.42 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
63
|
+
- Bump @fluentui/react-shared-contexts to v9.8.1 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
64
|
+
- Bump @fluentui/react-tabster to v9.12.11 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
65
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.10 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
|
66
|
+
|
|
67
|
+
## [9.8.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.8.7)
|
|
68
|
+
|
|
69
|
+
Wed, 20 Sep 2023 14:59:53 GMT
|
|
70
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.8.6..@fluentui/react-table_v9.8.7)
|
|
71
|
+
|
|
72
|
+
### Patches
|
|
73
|
+
|
|
74
|
+
- Bump @fluentui/react-avatar to v9.5.31 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
75
|
+
- Bump @fluentui/react-checkbox to v9.1.41 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
76
|
+
- Bump @fluentui/react-radio to v9.1.41 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
77
|
+
- Bump @fluentui/react-shared-contexts to v9.8.0 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
78
|
+
- Bump @fluentui/react-tabster to v9.12.10 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
79
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.9 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
|
|
80
|
+
|
|
7
81
|
## [9.8.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.8.6)
|
|
8
82
|
|
|
9
|
-
Thu, 14 Sep 2023 16:
|
|
83
|
+
Thu, 14 Sep 2023 16:44:47 GMT
|
|
10
84
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.8.5..@fluentui/react-table_v9.8.6)
|
|
11
85
|
|
|
12
86
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ export declare const dataGridHeaderCellClassNames: SlotClassNames<DataGridHeader
|
|
|
175
175
|
/**
|
|
176
176
|
* DataGridHeaderCell Props
|
|
177
177
|
*/
|
|
178
|
-
export declare type DataGridHeaderCellProps = TableHeaderCellProps
|
|
178
|
+
export declare type DataGridHeaderCellProps = Omit<TableHeaderCellProps, 'sortable'>;
|
|
179
179
|
|
|
180
180
|
export declare type DataGridHeaderCellSlots = TableHeaderCellSlots;
|
|
181
181
|
|
|
@@ -625,6 +625,11 @@ export declare const tableHeaderCellClassNames: SlotClassNames<TableHeaderCellSl
|
|
|
625
625
|
* TableHeaderCell Props
|
|
626
626
|
*/
|
|
627
627
|
export declare type TableHeaderCellProps = ComponentProps<Partial<TableHeaderCellSlots>> & {
|
|
628
|
+
/**
|
|
629
|
+
* Whether the column is sortable
|
|
630
|
+
* @default false
|
|
631
|
+
*/
|
|
632
|
+
sortable?: boolean;
|
|
628
633
|
/**
|
|
629
634
|
* @default undefined
|
|
630
635
|
*/
|
|
@@ -647,7 +652,7 @@ export declare type TableHeaderCellSlots = {
|
|
|
647
652
|
/**
|
|
648
653
|
* State used in rendering TableHeaderCell
|
|
649
654
|
*/
|
|
650
|
-
export declare type TableHeaderCellState = ComponentState<TableHeaderCellSlots> & Pick<TableContextValue, 'noNativeElements'
|
|
655
|
+
export declare type TableHeaderCellState = ComponentState<TableHeaderCellSlots> & Pick<TableContextValue, 'noNativeElements'> & Pick<TableHeaderCellProps, 'sortable'>;
|
|
651
656
|
|
|
652
657
|
export declare const tableHeaderClassName = "fui-TableHeader";
|
|
653
658
|
|
|
@@ -47,8 +47,8 @@ import { CELL_WIDTH } from '../TableSelectionCell';
|
|
|
47
47
|
const innerRef = React.useRef(null);
|
|
48
48
|
const { findFirstFocusable, findLastFocusable } = useFocusFinders();
|
|
49
49
|
const onKeyDown = useEventCallback((e)=>{
|
|
50
|
-
var _props_onKeyDown
|
|
51
|
-
(_props_onKeyDown =
|
|
50
|
+
var _props_onKeyDown;
|
|
51
|
+
(_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);
|
|
52
52
|
focusMode === 'composite' && onCompositeKeyDown(e);
|
|
53
53
|
// handle ctrl+home and ctrl+end
|
|
54
54
|
if (!innerRef.current || !e.ctrlKey || e.defaultPrevented) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGrid.ts"],"sourcesContent":["import * as React from 'react';\nimport { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport type { DataGridProps, DataGridState } from './DataGrid.types';\nimport { useTable_unstable } from '../Table/useTable';\nimport { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { End, Home } from '@fluentui/keyboard-keys';\nimport {\n useTableFeatures,\n useTableSort,\n useTableSelection,\n useTableColumnSizing_unstable,\n useTableCompositeNavigation,\n} from '../../hooks';\nimport { CELL_WIDTH } from '../TableSelectionCell';\n\n/**\n * Create the state required to render DataGrid.\n *\n * The returned state can be modified with hooks such as useDataGridStyles_unstable,\n * before being passed to renderDataGrid_unstable.\n *\n * @param props - props from this instance of DataGrid\n * @param ref - reference to root HTMLElement of DataGrid\n */\nexport const useDataGrid_unstable = (props: DataGridProps, ref: React.Ref<HTMLElement>): DataGridState => {\n const {\n items,\n columns,\n focusMode = 'cell',\n selectionMode,\n onSortChange,\n onSelectionChange,\n defaultSortState,\n sortState,\n selectedItems,\n defaultSelectedItems,\n subtleSelection = false,\n selectionAppearance = 'brand',\n getRowId,\n resizableColumns,\n columnSizingOptions,\n onColumnResize,\n containerWidthOffset,\n } = props;\n\n const widthOffset = containerWidthOffset ?? (selectionMode ? -CELL_WIDTH : 0);\n\n const gridTabsterAttribute = useArrowNavigationGroup({\n axis: 'grid',\n });\n\n const {\n onTableKeyDown: onCompositeKeyDown,\n tableTabsterAttribute: compositeTabsterAttribute,\n tableRowTabsterAttribute: compositeRowTabsterAttribute,\n } = useTableCompositeNavigation();\n\n const tableState = useTableFeatures({ items, columns, getRowId }, [\n useTableSort({\n defaultSortState,\n sortState,\n onSortChange,\n }),\n useTableSelection({\n defaultSelectedItems,\n selectedItems,\n onSelectionChange,\n selectionMode: selectionMode ?? 'multiselect',\n }),\n useTableColumnSizing_unstable({\n onColumnResize,\n columnSizingOptions,\n // The selection cell is not part of the columns, therefore its width needs to be subtracted\n // from the container to make sure the columns don't overflow the table.\n containerWidthOffset: widthOffset,\n }),\n ]);\n\n const innerRef = React.useRef<HTMLDivElement>(null);\n const { findFirstFocusable, findLastFocusable } = useFocusFinders();\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableElement>) => {\n props.onKeyDown?.(e);\n focusMode === 'composite' && onCompositeKeyDown(e);\n\n // handle ctrl+home and ctrl+end\n if (!innerRef.current || !e.ctrlKey || e.defaultPrevented) {\n return;\n }\n\n if (e.key === Home) {\n const firstRow = innerRef.current.querySelector('[role=\"row\"]') as HTMLElement | null;\n if (firstRow) {\n findFirstFocusable(firstRow)?.focus();\n }\n }\n\n if (e.key === End) {\n const rows = innerRef.current.querySelectorAll('[role=\"row\"]');\n if (rows.length) {\n const lastRow = rows.item(rows.length - 1);\n findLastFocusable(lastRow as HTMLElement)?.focus();\n }\n }\n });\n\n const baseTableState = useTable_unstable(\n {\n role: 'grid',\n as: 'div',\n noNativeElements: true,\n ...(focusMode === 'cell' && gridTabsterAttribute),\n ...(focusMode === 'composite' && compositeTabsterAttribute),\n ...props,\n onKeyDown,\n ...(resizableColumns ? tableState.columnSizing_unstable.getTableProps(props) : {}),\n },\n useMergedRefs(ref, tableState.tableRef, innerRef),\n );\n\n return {\n ...baseTableState,\n focusMode,\n tableState,\n selectableRows: !!selectionMode,\n subtleSelection,\n selectionAppearance,\n resizableColumns,\n compositeRowTabsterAttribute,\n };\n};\n"],"names":["React","useArrowNavigationGroup","useFocusFinders","useTable_unstable","useEventCallback","useMergedRefs","End","Home","useTableFeatures","useTableSort","useTableSelection","useTableColumnSizing_unstable","useTableCompositeNavigation","CELL_WIDTH","useDataGrid_unstable","props","ref","items","columns","focusMode","selectionMode","onSortChange","onSelectionChange","defaultSortState","sortState","selectedItems","defaultSelectedItems","subtleSelection","selectionAppearance","getRowId","resizableColumns","columnSizingOptions","onColumnResize","containerWidthOffset","widthOffset","gridTabsterAttribute","axis","onTableKeyDown","onCompositeKeyDown","tableTabsterAttribute","compositeTabsterAttribute","tableRowTabsterAttribute","compositeRowTabsterAttribute","tableState","innerRef","useRef","findFirstFocusable","findLastFocusable","onKeyDown","e","current","ctrlKey","defaultPrevented","key","firstRow","querySelector","focus","rows","querySelectorAll","length","lastRow","item","baseTableState","role","as","noNativeElements","columnSizing_unstable","getTableProps","tableRef","selectableRows"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,eAAe,QAAQ,0BAA0B;AAEnF,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,4BAA4B;AAC5E,SAASC,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AACpD,SACEC,gBAAgB,EAChBC,YAAY,EACZC,iBAAiB,EACjBC,6BAA6B,EAC7BC,2BAA2B,QACtB,cAAc;AACrB,SAASC,UAAU,QAAQ,wBAAwB;AAEnD;;;;;;;;CAQC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAsBC;IACzD,MAAM,EACJC,KAAK,EACLC,OAAO,EACPC,YAAY,MAAM,EAClBC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,gBAAgB,EAChBC,SAAS,EACTC,aAAa,EACbC,oBAAoB,EACpBC,kBAAkB,KAAK,EACvBC,sBAAsB,OAAO,EAC7BC,QAAQ,EACRC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,EACdC,oBAAoB,EACrB,GAAGlB;IAEJ,MAAMmB,cAAcD,iCAAAA,kCAAAA,uBAAyBb,gBAAgB,CAACP,aAAa;IAE3E,MAAMsB,uBAAuBlC,wBAAwB;QACnDmC,MAAM;IACR;IAEA,MAAM,EACJC,gBAAgBC,kBAAkB,EAClCC,uBAAuBC,yBAAyB,EAChDC,0BAA0BC,4BAA4B,EACvD,GAAG9B;IAEJ,MAAM+B,aAAanC,iBAAiB;QAAES;QAAOC;QAASW;IAAS,GAAG;QAChEpB,aAAa;YACXc;YACAC;YACAH;QACF;QACAX,kBAAkB;YAChBgB;YACAD;YACAH;YACAF,eAAeA,0BAAAA,2BAAAA,gBAAiB;QAClC;QACAT,8BAA8B;YAC5BqB;YACAD;YACA,4FAA4F;YAC5F,wEAAwE;YACxEE,sBAAsBC;QACxB;KACD;IAED,MAAMU,WAAW5C,MAAM6C,MAAM,CAAiB;IAC9C,MAAM,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAE,GAAG7C;IAClD,MAAM8C,YAAY5C,iBAAiB,CAAC6C;YAClClC
|
|
1
|
+
{"version":3,"sources":["useDataGrid.ts"],"sourcesContent":["import * as React from 'react';\nimport { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';\nimport type { DataGridProps, DataGridState } from './DataGrid.types';\nimport { useTable_unstable } from '../Table/useTable';\nimport { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { End, Home } from '@fluentui/keyboard-keys';\nimport {\n useTableFeatures,\n useTableSort,\n useTableSelection,\n useTableColumnSizing_unstable,\n useTableCompositeNavigation,\n} from '../../hooks';\nimport { CELL_WIDTH } from '../TableSelectionCell';\n\n/**\n * Create the state required to render DataGrid.\n *\n * The returned state can be modified with hooks such as useDataGridStyles_unstable,\n * before being passed to renderDataGrid_unstable.\n *\n * @param props - props from this instance of DataGrid\n * @param ref - reference to root HTMLElement of DataGrid\n */\nexport const useDataGrid_unstable = (props: DataGridProps, ref: React.Ref<HTMLElement>): DataGridState => {\n const {\n items,\n columns,\n focusMode = 'cell',\n selectionMode,\n onSortChange,\n onSelectionChange,\n defaultSortState,\n sortState,\n selectedItems,\n defaultSelectedItems,\n subtleSelection = false,\n selectionAppearance = 'brand',\n getRowId,\n resizableColumns,\n columnSizingOptions,\n onColumnResize,\n containerWidthOffset,\n } = props;\n\n const widthOffset = containerWidthOffset ?? (selectionMode ? -CELL_WIDTH : 0);\n\n const gridTabsterAttribute = useArrowNavigationGroup({\n axis: 'grid',\n });\n\n const {\n onTableKeyDown: onCompositeKeyDown,\n tableTabsterAttribute: compositeTabsterAttribute,\n tableRowTabsterAttribute: compositeRowTabsterAttribute,\n } = useTableCompositeNavigation();\n\n const tableState = useTableFeatures({ items, columns, getRowId }, [\n useTableSort({\n defaultSortState,\n sortState,\n onSortChange,\n }),\n useTableSelection({\n defaultSelectedItems,\n selectedItems,\n onSelectionChange,\n selectionMode: selectionMode ?? 'multiselect',\n }),\n useTableColumnSizing_unstable({\n onColumnResize,\n columnSizingOptions,\n // The selection cell is not part of the columns, therefore its width needs to be subtracted\n // from the container to make sure the columns don't overflow the table.\n containerWidthOffset: widthOffset,\n }),\n ]);\n\n const innerRef = React.useRef<HTMLDivElement>(null);\n const { findFirstFocusable, findLastFocusable } = useFocusFinders();\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableElement>) => {\n props.onKeyDown?.(e);\n focusMode === 'composite' && onCompositeKeyDown(e);\n\n // handle ctrl+home and ctrl+end\n if (!innerRef.current || !e.ctrlKey || e.defaultPrevented) {\n return;\n }\n\n if (e.key === Home) {\n const firstRow = innerRef.current.querySelector('[role=\"row\"]') as HTMLElement | null;\n if (firstRow) {\n findFirstFocusable(firstRow)?.focus();\n }\n }\n\n if (e.key === End) {\n const rows = innerRef.current.querySelectorAll('[role=\"row\"]');\n if (rows.length) {\n const lastRow = rows.item(rows.length - 1);\n findLastFocusable(lastRow as HTMLElement)?.focus();\n }\n }\n });\n\n const baseTableState = useTable_unstable(\n {\n role: 'grid',\n as: 'div',\n noNativeElements: true,\n ...(focusMode === 'cell' && gridTabsterAttribute),\n ...(focusMode === 'composite' && compositeTabsterAttribute),\n ...props,\n onKeyDown,\n ...(resizableColumns ? tableState.columnSizing_unstable.getTableProps(props) : {}),\n },\n useMergedRefs(ref, tableState.tableRef, innerRef),\n );\n\n return {\n ...baseTableState,\n focusMode,\n tableState,\n selectableRows: !!selectionMode,\n subtleSelection,\n selectionAppearance,\n resizableColumns,\n compositeRowTabsterAttribute,\n };\n};\n"],"names":["React","useArrowNavigationGroup","useFocusFinders","useTable_unstable","useEventCallback","useMergedRefs","End","Home","useTableFeatures","useTableSort","useTableSelection","useTableColumnSizing_unstable","useTableCompositeNavigation","CELL_WIDTH","useDataGrid_unstable","props","ref","items","columns","focusMode","selectionMode","onSortChange","onSelectionChange","defaultSortState","sortState","selectedItems","defaultSelectedItems","subtleSelection","selectionAppearance","getRowId","resizableColumns","columnSizingOptions","onColumnResize","containerWidthOffset","widthOffset","gridTabsterAttribute","axis","onTableKeyDown","onCompositeKeyDown","tableTabsterAttribute","compositeTabsterAttribute","tableRowTabsterAttribute","compositeRowTabsterAttribute","tableState","innerRef","useRef","findFirstFocusable","findLastFocusable","onKeyDown","e","current","ctrlKey","defaultPrevented","key","firstRow","querySelector","focus","rows","querySelectorAll","length","lastRow","item","baseTableState","role","as","noNativeElements","columnSizing_unstable","getTableProps","tableRef","selectableRows"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,eAAe,QAAQ,0BAA0B;AAEnF,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,4BAA4B;AAC5E,SAASC,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AACpD,SACEC,gBAAgB,EAChBC,YAAY,EACZC,iBAAiB,EACjBC,6BAA6B,EAC7BC,2BAA2B,QACtB,cAAc;AACrB,SAASC,UAAU,QAAQ,wBAAwB;AAEnD;;;;;;;;CAQC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAsBC;IACzD,MAAM,EACJC,KAAK,EACLC,OAAO,EACPC,YAAY,MAAM,EAClBC,aAAa,EACbC,YAAY,EACZC,iBAAiB,EACjBC,gBAAgB,EAChBC,SAAS,EACTC,aAAa,EACbC,oBAAoB,EACpBC,kBAAkB,KAAK,EACvBC,sBAAsB,OAAO,EAC7BC,QAAQ,EACRC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,EACdC,oBAAoB,EACrB,GAAGlB;IAEJ,MAAMmB,cAAcD,iCAAAA,kCAAAA,uBAAyBb,gBAAgB,CAACP,aAAa;IAE3E,MAAMsB,uBAAuBlC,wBAAwB;QACnDmC,MAAM;IACR;IAEA,MAAM,EACJC,gBAAgBC,kBAAkB,EAClCC,uBAAuBC,yBAAyB,EAChDC,0BAA0BC,4BAA4B,EACvD,GAAG9B;IAEJ,MAAM+B,aAAanC,iBAAiB;QAAES;QAAOC;QAASW;IAAS,GAAG;QAChEpB,aAAa;YACXc;YACAC;YACAH;QACF;QACAX,kBAAkB;YAChBgB;YACAD;YACAH;YACAF,eAAeA,0BAAAA,2BAAAA,gBAAiB;QAClC;QACAT,8BAA8B;YAC5BqB;YACAD;YACA,4FAA4F;YAC5F,wEAAwE;YACxEE,sBAAsBC;QACxB;KACD;IAED,MAAMU,WAAW5C,MAAM6C,MAAM,CAAiB;IAC9C,MAAM,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAE,GAAG7C;IAClD,MAAM8C,YAAY5C,iBAAiB,CAAC6C;YAClClC;SAAAA,mBAAAA,MAAMiC,SAAS,cAAfjC,uCAAAA,sBAAAA,OAAkBkC;QAClB9B,cAAc,eAAemB,mBAAmBW;QAEhD,gCAAgC;QAChC,IAAI,CAACL,SAASM,OAAO,IAAI,CAACD,EAAEE,OAAO,IAAIF,EAAEG,gBAAgB,EAAE;YACzD;QACF;QAEA,IAAIH,EAAEI,GAAG,KAAK9C,MAAM;YAClB,MAAM+C,WAAWV,SAASM,OAAO,CAACK,aAAa,CAAC;YAChD,IAAID,UAAU;oBACZR;iBAAAA,sBAAAA,mBAAmBQ,uBAAnBR,0CAAAA,oBAA8BU,KAAK;YACrC;QACF;QAEA,IAAIP,EAAEI,GAAG,KAAK/C,KAAK;YACjB,MAAMmD,OAAOb,SAASM,OAAO,CAACQ,gBAAgB,CAAC;YAC/C,IAAID,KAAKE,MAAM,EAAE;oBAEfZ;gBADA,MAAMa,UAAUH,KAAKI,IAAI,CAACJ,KAAKE,MAAM,GAAG;iBACxCZ,qBAAAA,kBAAkBa,sBAAlBb,yCAAAA,mBAA2CS,KAAK;YAClD;QACF;IACF;IAEA,MAAMM,iBAAiB3D,kBACrB;QACE4D,MAAM;QACNC,IAAI;QACJC,kBAAkB;QAClB,GAAI9C,cAAc,UAAUgB,oBAAoB;QAChD,GAAIhB,cAAc,eAAeqB,yBAAyB;QAC1D,GAAGzB,KAAK;QACRiC;QACA,GAAIlB,mBAAmBa,WAAWuB,qBAAqB,CAACC,aAAa,CAACpD,SAAS,CAAC,CAAC;IACnF,GACAV,cAAcW,KAAK2B,WAAWyB,QAAQ,EAAExB;IAG1C,OAAO;QACL,GAAGkB,cAAc;QACjB3C;QACAwB;QACA0B,gBAAgB,CAAC,CAACjD;QAClBO;QACAC;QACAE;QACAY;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DataGridHeaderCell.types.ts"],"sourcesContent":["import {\n TableHeaderCellProps,\n TableHeaderCellSlots,\n TableHeaderCellState,\n} from '../TableHeaderCell/TableHeaderCell.types';\n\nexport type DataGridHeaderCellSlots = TableHeaderCellSlots;\n\n/**\n * DataGridHeaderCell Props\n */\nexport type DataGridHeaderCellProps = TableHeaderCellProps
|
|
1
|
+
{"version":3,"sources":["DataGridHeaderCell.types.ts"],"sourcesContent":["import {\n TableHeaderCellProps,\n TableHeaderCellSlots,\n TableHeaderCellState,\n} from '../TableHeaderCell/TableHeaderCell.types';\n\nexport type DataGridHeaderCellSlots = TableHeaderCellSlots;\n\n/**\n * DataGridHeaderCell Props\n */\nexport type DataGridHeaderCellProps = Omit<TableHeaderCellProps, 'sortable'>;\n\n/**\n * State used in rendering DataGridHeaderCell\n */\nexport type DataGridHeaderCellState = TableHeaderCellState;\n"],"names":[],"mappings":"AAAA,WAgB2D"}
|
|
@@ -4,6 +4,7 @@ import { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCe
|
|
|
4
4
|
import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
|
|
5
5
|
import { useColumnIdContext } from '../../contexts/columnIdContext';
|
|
6
6
|
import { useTableContext } from '../../contexts/tableContext';
|
|
7
|
+
import { isColumnSortable } from '../../utils/isColumnSortable';
|
|
7
8
|
/**
|
|
8
9
|
* Create the state required to render DataGridHeaderCell.
|
|
9
10
|
*
|
|
@@ -14,20 +15,29 @@ import { useTableContext } from '../../contexts/tableContext';
|
|
|
14
15
|
* @param ref - reference to root HTMLElement of DataGridHeaderCell
|
|
15
16
|
*/ export const useDataGridHeaderCell_unstable = (props, ref)=>{
|
|
16
17
|
const columnId = useColumnIdContext();
|
|
17
|
-
const { sortable } = useTableContext();
|
|
18
|
+
const { sortable: gridSortable } = useTableContext();
|
|
18
19
|
const toggleColumnSort = useDataGridContext_unstable((ctx)=>ctx.sort.toggleColumnSort);
|
|
20
|
+
const sortable = useDataGridContext_unstable((ctx)=>{
|
|
21
|
+
const columnSortable = !!ctx.columns.find((c)=>c.columnId === columnId && isColumnSortable(c));
|
|
22
|
+
if (!gridSortable) {
|
|
23
|
+
// if the grid is not sortable - disable sorting on all columns
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return columnSortable;
|
|
27
|
+
});
|
|
19
28
|
const sortDirection = useDataGridContext_unstable((ctx)=>sortable ? ctx.sort.getSortDirection(columnId) : undefined);
|
|
20
29
|
const resizableColumns = useDataGridContext_unstable((ctx)=>ctx.resizableColumns);
|
|
21
30
|
const columnSizing = useDataGridContext_unstable((ctx)=>ctx.columnSizing_unstable);
|
|
22
31
|
// eslint-disable-next-line deprecation/deprecation -- prefer HTMLTableCellElement
|
|
23
32
|
const onClick = useEventCallback((e)=>{
|
|
24
|
-
var _props_onClick
|
|
33
|
+
var _props_onClick;
|
|
25
34
|
if (sortable) {
|
|
26
35
|
toggleColumnSort(e, columnId);
|
|
27
36
|
}
|
|
28
|
-
(_props_onClick =
|
|
37
|
+
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
|
|
29
38
|
});
|
|
30
39
|
return useTableHeaderCell_unstable({
|
|
40
|
+
sortable,
|
|
31
41
|
sortDirection,
|
|
32
42
|
as: 'div',
|
|
33
43
|
tabIndex: sortable ? undefined : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n
|
|
1
|
+
{"version":3,"sources":["useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { isColumnSortable } from '../../utils/isColumnSortable';\n\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable: gridSortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n\n const sortable = useDataGridContext_unstable(ctx => {\n const columnSortable = !!ctx.columns.find(c => c.columnId === columnId && isColumnSortable(c));\n if (!gridSortable) {\n // if the grid is not sortable - disable sorting on all columns\n return false;\n }\n\n return columnSortable;\n });\n\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const resizableColumns = useDataGridContext_unstable(ctx => ctx.resizableColumns);\n const columnSizing = useDataGridContext_unstable(ctx => ctx.columnSizing_unstable);\n\n // eslint-disable-next-line deprecation/deprecation -- prefer HTMLTableCellElement\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableHeaderCellElement>) => {\n if (sortable) {\n toggleColumnSort(e, columnId);\n }\n props.onClick?.(e);\n });\n\n return useTableHeaderCell_unstable(\n {\n sortable,\n sortDirection,\n as: 'div',\n tabIndex: sortable ? undefined : 0,\n ...(resizableColumns ? columnSizing.getTableHeaderCellProps(columnId) : {}),\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useEventCallback","useTableHeaderCell_unstable","useDataGridContext_unstable","useColumnIdContext","useTableContext","isColumnSortable","useDataGridHeaderCell_unstable","props","ref","columnId","sortable","gridSortable","toggleColumnSort","ctx","sort","columnSortable","columns","find","c","sortDirection","getSortDirection","undefined","resizableColumns","columnSizing","columnSizing_unstable","onClick","e","as","tabIndex","getTableHeaderCellProps"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,4BAA4B;AAE7D,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,gBAAgB,QAAQ,+BAA+B;AAEhE;;;;;;;;CAQC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,WAAWN;IACjB,MAAM,EAAEO,UAAUC,YAAY,EAAE,GAAGP;IACnC,MAAMQ,mBAAmBV,4BAA4BW,CAAAA,MAAOA,IAAIC,IAAI,CAACF,gBAAgB;IAErF,MAAMF,WAAWR,4BAA4BW,CAAAA;QAC3C,MAAME,iBAAiB,CAAC,CAACF,IAAIG,OAAO,CAACC,IAAI,CAACC,CAAAA,IAAKA,EAAET,QAAQ,KAAKA,YAAYJ,iBAAiBa;QAC3F,IAAI,CAACP,cAAc;YACjB,+DAA+D;YAC/D,OAAO;QACT;QAEA,OAAOI;IACT;IAEA,MAAMI,gBAAgBjB,4BAA4BW,CAAAA,MAChDH,WAAWG,IAAIC,IAAI,CAACM,gBAAgB,CAACX,YAAYY;IAEnD,MAAMC,mBAAmBpB,4BAA4BW,CAAAA,MAAOA,IAAIS,gBAAgB;IAChF,MAAMC,eAAerB,4BAA4BW,CAAAA,MAAOA,IAAIW,qBAAqB;IAEjF,kFAAkF;IAClF,MAAMC,UAAUzB,iBAAiB,CAAC0B;YAIhCnB;QAHA,IAAIG,UAAU;YACZE,iBAAiBc,GAAGjB;QACtB;SACAF,iBAAAA,MAAMkB,OAAO,cAAblB,qCAAAA,oBAAAA,OAAgBmB;IAClB;IAEA,OAAOzB,4BACL;QACES;QACAS;QACAQ,IAAI;QACJC,UAAUlB,WAAWW,YAAY;QACjC,GAAIC,mBAAmBC,aAAaM,uBAAuB,CAACpB,YAAY,CAAC,CAAC;QAC1E,GAAGF,KAAK;QACRkB;IACF,GACAjB;AAEJ,EAAE"}
|
|
@@ -32,20 +32,20 @@ import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
|
|
|
32
32
|
const toggleRow = useDataGridContext_unstable((ctx)=>ctx.selection.toggleRow);
|
|
33
33
|
const dataGridContextValue = useDataGridContext_unstable((ctx)=>ctx);
|
|
34
34
|
const onClick = useEventCallback((e)=>{
|
|
35
|
-
var _props_onClick
|
|
35
|
+
var _props_onClick;
|
|
36
36
|
if (selectable && !isHeader) {
|
|
37
37
|
toggleRow(e, rowId);
|
|
38
38
|
}
|
|
39
|
-
(_props_onClick =
|
|
39
|
+
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
|
|
40
40
|
});
|
|
41
41
|
const onKeyDown = useEventCallback((e)=>{
|
|
42
|
-
var _props_onKeyDown
|
|
42
|
+
var _props_onKeyDown;
|
|
43
43
|
if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target)) {
|
|
44
44
|
// stop scrolling
|
|
45
45
|
e.preventDefault();
|
|
46
46
|
toggleRow(e, rowId);
|
|
47
47
|
}
|
|
48
|
-
(_props_onKeyDown =
|
|
48
|
+
(_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, e);
|
|
49
49
|
});
|
|
50
50
|
const baseState = useTableRow_unstable({
|
|
51
51
|
appearance,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n const rowId = useTableRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);\n const selectable = useDataGridContext_unstable(ctx => ctx.selectableRows);\n const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));\n const focusMode = useDataGridContext_unstable(ctx => ctx.focusMode);\n const compositeRowTabsterAttribute = useDataGridContext_unstable(ctx => ctx.compositeRowTabsterAttribute);\n const tabbable = focusMode === 'row_unstable' || focusMode === 'composite';\n const appearance = useDataGridContext_unstable(ctx => {\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n const dataGridContextValue = useDataGridContext_unstable(ctx => ctx);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\n appearance,\n 'aria-selected': selectable ? selected : undefined,\n tabIndex: tabbable && !isHeader ? 0 : undefined,\n ...(focusMode === 'composite' && !isHeader && compositeRowTabsterAttribute),\n ...props,\n onClick,\n onKeyDown,\n children: null,\n as: 'div',\n },\n ref,\n );\n\n return {\n ...baseState,\n components: {\n ...baseState.components,\n selectionCell: DataGridSelectionCell,\n },\n selectionCell: slot.optional(props.selectionCell, {\n renderByDefault: selectable,\n elementType: DataGridSelectionCell,\n }),\n renderCell: props.children,\n columnDefs,\n dataGridContextValue,\n };\n};\n"],"names":["React","isInteractiveHTMLElement","useEventCallback","slot","Space","useTableRow_unstable","useDataGridContext_unstable","DataGridSelectionCell","useTableRowIdContext","useIsInTableHeader","useDataGridRow_unstable","props","ref","rowId","isHeader","columnDefs","ctx","columns","selectable","selectableRows","selected","selection","isRowSelected","focusMode","compositeRowTabsterAttribute","tabbable","appearance","selectionAppearance","toggleRow","dataGridContextValue","onClick","e","onKeyDown","key","target","preventDefault","baseState","undefined","tabIndex","children","as","components","selectionCell","optional","renderByDefault","elementType","renderCell"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAC7F,SAASC,KAAK,QAAQ,0BAA0B;AAEhD,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,qBAAqB,QAAQ,iDAAiD;AACvF,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,oCAAoC;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQL;IACd,MAAMM,WAAWL;IACjB,MAAMM,aAAaT,4BAA4BU,CAAAA,MAAOA,IAAIC,OAAO;IACjE,MAAMC,aAAaZ,4BAA4BU,CAAAA,MAAOA,IAAIG,cAAc;IACxE,MAAMC,WAAWd,4BAA4BU,CAAAA,MAAOA,IAAIK,SAAS,CAACC,aAAa,CAACT;IAChF,MAAMU,YAAYjB,4BAA4BU,CAAAA,MAAOA,IAAIO,SAAS;IAClE,MAAMC,+BAA+BlB,4BAA4BU,CAAAA,MAAOA,IAAIQ,4BAA4B;IACxG,MAAMC,WAAWF,cAAc,kBAAkBA,cAAc;IAC/D,MAAMG,aAAapB,4BAA4BU,CAAAA;QAC7C,IAAI,CAACF,YAAYI,cAAcF,IAAIK,SAAS,CAACC,aAAa,CAACT,QAAQ;YACjE,OAAOG,IAAIW,mBAAmB;QAChC;QAEA,OAAO;IACT;IACA,MAAMC,YAAYtB,4BAA4BU,CAAAA,MAAOA,IAAIK,SAAS,CAACO,SAAS;IAC5E,MAAMC,uBAAuBvB,4BAA4BU,CAAAA,MAAOA;IAEhE,MAAMc,UAAU5B,iBAAiB,CAAC6B;YAKhCpB
|
|
1
|
+
{"version":3,"sources":["useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, slot } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n const rowId = useTableRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);\n const selectable = useDataGridContext_unstable(ctx => ctx.selectableRows);\n const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));\n const focusMode = useDataGridContext_unstable(ctx => ctx.focusMode);\n const compositeRowTabsterAttribute = useDataGridContext_unstable(ctx => ctx.compositeRowTabsterAttribute);\n const tabbable = focusMode === 'row_unstable' || focusMode === 'composite';\n const appearance = useDataGridContext_unstable(ctx => {\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n const dataGridContextValue = useDataGridContext_unstable(ctx => ctx);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\n appearance,\n 'aria-selected': selectable ? selected : undefined,\n tabIndex: tabbable && !isHeader ? 0 : undefined,\n ...(focusMode === 'composite' && !isHeader && compositeRowTabsterAttribute),\n ...props,\n onClick,\n onKeyDown,\n children: null,\n as: 'div',\n },\n ref,\n );\n\n return {\n ...baseState,\n components: {\n ...baseState.components,\n selectionCell: DataGridSelectionCell,\n },\n selectionCell: slot.optional(props.selectionCell, {\n renderByDefault: selectable,\n elementType: DataGridSelectionCell,\n }),\n renderCell: props.children,\n columnDefs,\n dataGridContextValue,\n };\n};\n"],"names":["React","isInteractiveHTMLElement","useEventCallback","slot","Space","useTableRow_unstable","useDataGridContext_unstable","DataGridSelectionCell","useTableRowIdContext","useIsInTableHeader","useDataGridRow_unstable","props","ref","rowId","isHeader","columnDefs","ctx","columns","selectable","selectableRows","selected","selection","isRowSelected","focusMode","compositeRowTabsterAttribute","tabbable","appearance","selectionAppearance","toggleRow","dataGridContextValue","onClick","e","onKeyDown","key","target","preventDefault","baseState","undefined","tabIndex","children","as","components","selectionCell","optional","renderByDefault","elementType","renderCell"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAC7F,SAASC,KAAK,QAAQ,0BAA0B;AAEhD,SAASC,oBAAoB,QAAQ,0BAA0B;AAC/D,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,qBAAqB,QAAQ,iDAAiD;AACvF,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,oCAAoC;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAMC,QAAQL;IACd,MAAMM,WAAWL;IACjB,MAAMM,aAAaT,4BAA4BU,CAAAA,MAAOA,IAAIC,OAAO;IACjE,MAAMC,aAAaZ,4BAA4BU,CAAAA,MAAOA,IAAIG,cAAc;IACxE,MAAMC,WAAWd,4BAA4BU,CAAAA,MAAOA,IAAIK,SAAS,CAACC,aAAa,CAACT;IAChF,MAAMU,YAAYjB,4BAA4BU,CAAAA,MAAOA,IAAIO,SAAS;IAClE,MAAMC,+BAA+BlB,4BAA4BU,CAAAA,MAAOA,IAAIQ,4BAA4B;IACxG,MAAMC,WAAWF,cAAc,kBAAkBA,cAAc;IAC/D,MAAMG,aAAapB,4BAA4BU,CAAAA;QAC7C,IAAI,CAACF,YAAYI,cAAcF,IAAIK,SAAS,CAACC,aAAa,CAACT,QAAQ;YACjE,OAAOG,IAAIW,mBAAmB;QAChC;QAEA,OAAO;IACT;IACA,MAAMC,YAAYtB,4BAA4BU,CAAAA,MAAOA,IAAIK,SAAS,CAACO,SAAS;IAC5E,MAAMC,uBAAuBvB,4BAA4BU,CAAAA,MAAOA;IAEhE,MAAMc,UAAU5B,iBAAiB,CAAC6B;YAKhCpB;QAJA,IAAIO,cAAc,CAACJ,UAAU;YAC3Bc,UAAUG,GAAGlB;QACf;SAEAF,iBAAAA,MAAMmB,OAAO,cAAbnB,qCAAAA,oBAAAA,OAAgBoB;IAClB;IAEA,MAAMC,YAAY9B,iBAAiB,CAAC6B;YAOlCpB;QANA,IAAIO,cAAc,CAACJ,YAAYiB,EAAEE,GAAG,KAAK7B,SAAS,CAACH,yBAAyB8B,EAAEG,MAAM,GAAkB;YACpG,iBAAiB;YACjBH,EAAEI,cAAc;YAChBP,UAAUG,GAAGlB;QACf;SAEAF,mBAAAA,MAAMqB,SAAS,cAAfrB,uCAAAA,sBAAAA,OAAkBoB;IACpB;IAEA,MAAMK,YAAY/B,qBAChB;QACEqB;QACA,iBAAiBR,aAAaE,WAAWiB;QACzCC,UAAUb,YAAY,CAACX,WAAW,IAAIuB;QACtC,GAAId,cAAc,eAAe,CAACT,YAAYU,4BAA4B;QAC1E,GAAGb,KAAK;QACRmB;QACAE;QACAO,UAAU;QACVC,IAAI;IACN,GACA5B;IAGF,OAAO;QACL,GAAGwB,SAAS;QACZK,YAAY;YACV,GAAGL,UAAUK,UAAU;YACvBC,eAAenC;QACjB;QACAmC,eAAevC,KAAKwC,QAAQ,CAAChC,MAAM+B,aAAa,EAAE;YAChDE,iBAAiB1B;YACjB2B,aAAatC;QACf;QACAuC,YAAYnC,MAAM4B,QAAQ;QAC1BxB;QACAc;IACF;AACF,EAAE"}
|
|
@@ -25,11 +25,11 @@ import { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSe
|
|
|
25
25
|
const toggleAllRows = useDataGridContext_unstable((ctx)=>ctx.selection.toggleAllRows);
|
|
26
26
|
const type = useDataGridContext_unstable((ctx)=>ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio');
|
|
27
27
|
const onClick = useEventCallback((e)=>{
|
|
28
|
-
var _props_onClick
|
|
28
|
+
var _props_onClick;
|
|
29
29
|
if (isHeader) {
|
|
30
30
|
toggleAllRows(e);
|
|
31
31
|
}
|
|
32
|
-
(_props_onClick =
|
|
32
|
+
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, e);
|
|
33
33
|
});
|
|
34
34
|
return useTableSelectionCell_unstable({
|
|
35
35
|
as: 'div',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n hidden: isHeader && type === 'radio',\n 'aria-checked': isHeader ? checked : undefined,\n 'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,\n subtle,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useEventCallback","useDataGridContext_unstable","useTableRowIdContext","useIsInTableHeader","useTableSelectionCell_unstable","useDataGridSelectionCell_unstable","props","ref","isHeader","rowId","subtle","ctx","subtleSelection","checked","selection","selectionMode","allRowsSelected","someRowsSelected","isRowSelected","toggleAllRows","type","onClick","e","as","role","hidden","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,8BAA8B,QAAQ,8CAA8C;AAG7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC,OACAC;IAEA,MAAMC,WAAWL;IACjB,MAAMM,QAAQP;IACd,MAAMQ,SAAST,4BAA4BU,CAAAA,MAAOA,IAAIC,eAAe;IACrE,MAAMC,UAAUZ,4BAA4BU,CAAAA;QAC1C,IAAIH,YAAYG,IAAIG,SAAS,CAACC,aAAa,KAAK,eAAe;YAC7D,OAAOJ,IAAIG,SAAS,CAACE,eAAe,GAAG,OAAOL,IAAIG,SAAS,CAACG,gBAAgB,GAAG,UAAU;QAC3F;QAEA,OAAON,IAAIG,SAAS,CAACI,aAAa,CAACT;IACrC;IAEA,MAAMU,gBAAgBlB,4BAA4BU,CAAAA,MAAOA,IAAIG,SAAS,CAACK,aAAa;IACpF,MAAMC,OAAOnB,4BAA4BU,CAAAA,MACvCA,IAAIG,SAAS,CAACC,aAAa,KAAK,gBAAgB,aAAa;IAG/D,MAAMM,UAAUrB,iBAAiB,CAACsB;YAKhChB
|
|
1
|
+
{"version":3,"sources":["useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n hidden: isHeader && type === 'radio',\n 'aria-checked': isHeader ? checked : undefined,\n 'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,\n subtle,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"],"names":["React","useEventCallback","useDataGridContext_unstable","useTableRowIdContext","useIsInTableHeader","useTableSelectionCell_unstable","useDataGridSelectionCell_unstable","props","ref","isHeader","rowId","subtle","ctx","subtleSelection","checked","selection","selectionMode","allRowsSelected","someRowsSelected","isRowSelected","toggleAllRows","type","onClick","e","as","role","hidden","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,8BAA8B,QAAQ,8CAA8C;AAG7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC,OACAC;IAEA,MAAMC,WAAWL;IACjB,MAAMM,QAAQP;IACd,MAAMQ,SAAST,4BAA4BU,CAAAA,MAAOA,IAAIC,eAAe;IACrE,MAAMC,UAAUZ,4BAA4BU,CAAAA;QAC1C,IAAIH,YAAYG,IAAIG,SAAS,CAACC,aAAa,KAAK,eAAe;YAC7D,OAAOJ,IAAIG,SAAS,CAACE,eAAe,GAAG,OAAOL,IAAIG,SAAS,CAACG,gBAAgB,GAAG,UAAU;QAC3F;QAEA,OAAON,IAAIG,SAAS,CAACI,aAAa,CAACT;IACrC;IAEA,MAAMU,gBAAgBlB,4BAA4BU,CAAAA,MAAOA,IAAIG,SAAS,CAACK,aAAa;IACpF,MAAMC,OAAOnB,4BAA4BU,CAAAA,MACvCA,IAAIG,SAAS,CAACC,aAAa,KAAK,gBAAgB,aAAa;IAG/D,MAAMM,UAAUrB,iBAAiB,CAACsB;YAKhChB;QAJA,IAAIE,UAAU;YACZW,cAAcG;QAChB;SAEAhB,iBAAAA,MAAMe,OAAO,cAAbf,qCAAAA,oBAAAA,OAAgBgB;IAClB;IAEA,OAAOlB,+BACL;QACEmB,IAAI;QACJC,MAAM;QACNX;QACAO;QACAK,QAAQjB,YAAYY,SAAS;QAC7B,gBAAgBZ,WAAWK,UAAUa;QACrC,iBAAiBlB,YAAYK,YAAY,UAAUa,YAAYb;QAC/DH;QACA,GAAGJ,KAAK;QACRe;IACF,GACAd;AAEJ,EAAE"}
|