@fluentui/react-table 9.0.0-alpha.12 → 9.0.0-alpha.14

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.
Files changed (131) hide show
  1. package/CHANGELOG.json +227 -1
  2. package/CHANGELOG.md +50 -2
  3. package/dist/index.d.ts +103 -53
  4. package/lib/components/DataGrid/DataGrid.types.js.map +1 -1
  5. package/lib/components/DataGrid/useDataGrid.js +30 -6
  6. package/lib/components/DataGrid/useDataGrid.js.map +1 -1
  7. package/lib/components/DataGrid/useDataGridContextValues.js +4 -1
  8. package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
  9. package/lib/components/DataGridBody/useDataGridBody.js +12 -2
  10. package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
  11. package/lib/components/DataGridCell/useDataGridCell.js +1 -1
  12. package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
  13. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +25 -2
  14. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  15. package/lib/components/DataGridRow/DataGridRow.types.js.map +1 -1
  16. package/lib/components/DataGridRow/renderDataGridRow.js +9 -2
  17. package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
  18. package/lib/components/DataGridRow/useDataGridRow.js +62 -5
  19. package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
  20. package/lib/components/DataGridRow/useDataGridRowStyles.js +7 -1
  21. package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  22. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +37 -1
  23. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  24. package/lib/components/Table/Table.types.js.map +1 -1
  25. package/lib/components/TableCell/TableCell.types.js.map +1 -1
  26. package/lib/components/TableCell/useTableCell.js +4 -2
  27. package/lib/components/TableCell/useTableCell.js.map +1 -1
  28. package/lib/components/TableCell/useTableCellStyles.js +31 -5
  29. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  30. package/lib/components/TableCellActions/useTableCellActions.js +2 -3
  31. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
  32. package/lib/components/TableCellActions/useTableCellActionsStyles.js +2 -8
  33. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  34. package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  35. package/lib/components/TableCellLayout/useTableCellLayout.js +3 -2
  36. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  37. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +20 -6
  38. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  39. package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  40. package/lib/components/TableHeaderCell/useTableHeaderCell.js +11 -6
  41. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  42. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +17 -7
  43. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  44. package/lib/components/TableRow/TableRow.types.js.map +1 -1
  45. package/lib/components/TableRow/useTableRow.js +3 -2
  46. package/lib/components/TableRow/useTableRow.js.map +1 -1
  47. package/lib/components/TableRow/useTableRowStyles.js +14 -29
  48. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  49. package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  50. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +12 -6
  51. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  52. package/lib/contexts/columnIdContext.js +10 -0
  53. package/lib/contexts/columnIdContext.js.map +1 -0
  54. package/lib/contexts/dataGridContext.js +3 -0
  55. package/lib/contexts/dataGridContext.js.map +1 -1
  56. package/lib/contexts/rowIdContext.js +10 -0
  57. package/lib/contexts/rowIdContext.js.map +1 -0
  58. package/lib/hooks/index.js +3 -3
  59. package/lib/hooks/index.js.map +1 -1
  60. package/lib/hooks/types.js.map +1 -1
  61. package/lib/hooks/{useTable.js → useTableFeatures.js} +4 -4
  62. package/lib/hooks/useTableFeatures.js.map +1 -0
  63. package/lib/hooks/{useSelection.js → useTableSelection.js} +10 -6
  64. package/lib/hooks/useTableSelection.js.map +1 -0
  65. package/lib/hooks/{useSort.js → useTableSort.js} +4 -4
  66. package/lib/hooks/useTableSort.js.map +1 -0
  67. package/lib/index.js +1 -1
  68. package/lib/index.js.map +1 -1
  69. package/lib-commonjs/components/DataGrid/useDataGrid.js +30 -6
  70. package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
  71. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js +4 -1
  72. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
  73. package/lib-commonjs/components/DataGridBody/useDataGridBody.js +15 -2
  74. package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
  75. package/lib-commonjs/components/DataGridCell/useDataGridCell.js +1 -1
  76. package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
  77. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +29 -2
  78. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  79. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js +10 -2
  80. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
  81. package/lib-commonjs/components/DataGridRow/useDataGridRow.js +69 -5
  82. package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
  83. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js +7 -1
  84. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  85. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +41 -1
  86. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  87. package/lib-commonjs/components/TableCell/useTableCell.js +4 -2
  88. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  89. package/lib-commonjs/components/TableCell/useTableCellStyles.js +32 -5
  90. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  91. package/lib-commonjs/components/TableCellActions/useTableCellActions.js +1 -3
  92. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
  93. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +2 -9
  94. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  95. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +3 -2
  96. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  97. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +21 -6
  98. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  99. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +11 -5
  100. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  101. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +18 -7
  102. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  103. package/lib-commonjs/components/TableRow/useTableRow.js +2 -1
  104. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  105. package/lib-commonjs/components/TableRow/useTableRowStyles.js +14 -29
  106. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  107. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +13 -6
  108. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  109. package/lib-commonjs/contexts/columnIdContext.js +21 -0
  110. package/lib-commonjs/contexts/columnIdContext.js.map +1 -0
  111. package/lib-commonjs/contexts/dataGridContext.js +3 -0
  112. package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
  113. package/lib-commonjs/contexts/rowIdContext.js +21 -0
  114. package/lib-commonjs/contexts/rowIdContext.js.map +1 -0
  115. package/lib-commonjs/hooks/index.js +3 -3
  116. package/lib-commonjs/hooks/index.js.map +1 -1
  117. package/lib-commonjs/hooks/{useTable.js → useTableFeatures.js} +10 -10
  118. package/lib-commonjs/hooks/useTableFeatures.js.map +1 -0
  119. package/lib-commonjs/hooks/{useSelection.js → useTableSelection.js} +13 -9
  120. package/lib-commonjs/hooks/useTableSelection.js.map +1 -0
  121. package/lib-commonjs/hooks/{useSort.js → useTableSort.js} +7 -7
  122. package/lib-commonjs/hooks/useTableSort.js.map +1 -0
  123. package/lib-commonjs/index.js +7 -7
  124. package/lib-commonjs/index.js.map +1 -1
  125. package/package.json +10 -9
  126. package/lib/hooks/useSelection.js.map +0 -1
  127. package/lib/hooks/useSort.js.map +0 -1
  128. package/lib/hooks/useTable.js.map +0 -1
  129. package/lib-commonjs/hooks/useSelection.js.map +0 -1
  130. package/lib-commonjs/hooks/useSort.js.map +0 -1
  131. package/lib-commonjs/hooks/useTable.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,233 @@
2
2
  "name": "@fluentui/react-table",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 17 Nov 2022 23:02:45 GMT",
5
+ "date": "Tue, 20 Dec 2022 14:55:53 GMT",
6
+ "tag": "@fluentui/react-table_v9.0.0-alpha.14",
7
+ "version": "9.0.0-alpha.14",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "lingfangao@hotmail.com",
12
+ "package": "@fluentui/react-table",
13
+ "commit": "76054827c6b9ccc7ad73a818952f2d636ffc9e6d",
14
+ "comment": "fix: Explicit focus outline for TableHeaderCell and TableSelectionCell"
15
+ },
16
+ {
17
+ "author": "lingfangao@hotmail.com",
18
+ "package": "@fluentui/react-table",
19
+ "commit": "67a7284ac5934475134ce72af3965f3f9a223636",
20
+ "comment": "fix(DataGridSelectionCell): should render `aria-selected` on the cell"
21
+ },
22
+ {
23
+ "author": "lingfangao@hotmail.com",
24
+ "package": "@fluentui/react-table",
25
+ "commit": "622bcbbe42920f53466bed4ad998b67daac3d6d3",
26
+ "comment": "fix: DataGrid supports keyboard navigation by default"
27
+ },
28
+ {
29
+ "author": "lingfangao@hotmail.com",
30
+ "package": "@fluentui/react-table",
31
+ "commit": "c847712d9293db7028bc01e9ba4204e055ebbfb7",
32
+ "comment": "feat: Add row focus as unstable feature due to a11y unknowns"
33
+ },
34
+ {
35
+ "author": "lingfangao@hotmail.com",
36
+ "package": "@fluentui/react-table",
37
+ "commit": "b1f470d42273869bc4e10fefff6f08b90640092d",
38
+ "comment": "fix(DataGridRow): `children` type should only be render function"
39
+ },
40
+ {
41
+ "author": "lingfangao@hotmail.com",
42
+ "package": "@fluentui/react-table",
43
+ "commit": "dc96e9c54ac445396cd5e74812fd2ac1acdd15eb",
44
+ "comment": "fix: DataGridRow should prevent default on spacebar"
45
+ },
46
+ {
47
+ "author": "lingfangao@hotmail.com",
48
+ "package": "@fluentui/react-table",
49
+ "commit": "b0aab3b9647e55a355e5e1c0d4e4cf7cc7955fdb",
50
+ "comment": "feat: DataGrid supports custom row Ids"
51
+ },
52
+ {
53
+ "author": "lingfangao@hotmail.com",
54
+ "package": "@fluentui/react-table",
55
+ "commit": "ac32a5c210e34916f6990ebe4449621344ba0839",
56
+ "comment": "fix(TableHeaderCell): should render `aria-sort=\"none\"` if not sorted"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@fluentui/react-table",
61
+ "comment": "Bump @fluentui/react-aria to v9.3.3",
62
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
63
+ },
64
+ {
65
+ "author": "beachball",
66
+ "package": "@fluentui/react-table",
67
+ "comment": "Bump @fluentui/react-avatar to v9.2.9",
68
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
69
+ },
70
+ {
71
+ "author": "beachball",
72
+ "package": "@fluentui/react-table",
73
+ "comment": "Bump @fluentui/react-checkbox to v9.0.15",
74
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
75
+ },
76
+ {
77
+ "author": "beachball",
78
+ "package": "@fluentui/react-table",
79
+ "comment": "Bump @fluentui/react-context-selector to v9.1.3",
80
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
81
+ },
82
+ {
83
+ "author": "beachball",
84
+ "package": "@fluentui/react-table",
85
+ "comment": "Bump @fluentui/react-radio to v9.0.14",
86
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
87
+ },
88
+ {
89
+ "author": "beachball",
90
+ "package": "@fluentui/react-table",
91
+ "comment": "Bump @fluentui/react-tabster to v9.3.3",
92
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
93
+ },
94
+ {
95
+ "author": "beachball",
96
+ "package": "@fluentui/react-table",
97
+ "comment": "Bump @fluentui/react-theme to v9.1.4",
98
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
99
+ },
100
+ {
101
+ "author": "beachball",
102
+ "package": "@fluentui/react-table",
103
+ "comment": "Bump @fluentui/react-utilities to v9.3.0",
104
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
105
+ }
106
+ ],
107
+ "none": [
108
+ {
109
+ "author": "lingfangao@hotmail.com",
110
+ "package": "@fluentui/react-table",
111
+ "commit": "81c1239976fbf6dbc3c3c160462eac1b3ddfd0a8",
112
+ "comment": "docs: Table examples generally navigate with tab"
113
+ }
114
+ ]
115
+ }
116
+ },
117
+ {
118
+ "date": "Mon, 05 Dec 2022 18:29:31 GMT",
119
+ "tag": "@fluentui/react-table_v9.0.0-alpha.13",
120
+ "version": "9.0.0-alpha.13",
121
+ "comments": {
122
+ "prerelease": [
123
+ {
124
+ "author": "lingfangao@hotmail.com",
125
+ "package": "@fluentui/react-table",
126
+ "commit": "dfe430630188bb7e2fe2ddc15b5269fcfd1bf20b",
127
+ "comment": "fix: TableHeaderCell design fixes"
128
+ },
129
+ {
130
+ "author": "lingfangao@hotmail.com",
131
+ "package": "@fluentui/react-table",
132
+ "commit": "f64a67537afb35cb5007c16160d0a1deb656d875",
133
+ "comment": "BREAKING(useTable): `onSelectionChange` returns data object"
134
+ },
135
+ {
136
+ "author": "lingfangao@hotmail.com",
137
+ "package": "@fluentui/react-table",
138
+ "commit": "f7d7f82f6b3117ce163c6fee84b03c8774bed95f",
139
+ "comment": "docs: Update docstrings for props"
140
+ },
141
+ {
142
+ "author": "lingfangao@hotmail.com",
143
+ "package": "@fluentui/react-table",
144
+ "commit": "35de934c73603a2fc9416327ab1cf89283f76c5f",
145
+ "comment": "fix: Various design fixes to Table components"
146
+ },
147
+ {
148
+ "author": "lingfangao@hotmail.com",
149
+ "package": "@fluentui/react-table",
150
+ "commit": "6f450a1713c40d5429306ab1f6d76bc19e65c295",
151
+ "comment": "fix: Cell actions should have correct background when row focused within"
152
+ },
153
+ {
154
+ "author": "lingfangao@hotmail.com",
155
+ "package": "@fluentui/react-table",
156
+ "commit": "3ca7917d818ccde26b1dc172241f88a6e8f322b3",
157
+ "comment": "fix: Table row height is determined by cells"
158
+ },
159
+ {
160
+ "author": "lingfangao@hotmail.com",
161
+ "package": "@fluentui/react-table",
162
+ "commit": "f1a66a851248f1a2140cb387a62c19468afd3365",
163
+ "comment": "BREAKING: change `smaller` size to `extra-small`"
164
+ },
165
+ {
166
+ "author": "lingfangao@hotmail.com",
167
+ "package": "@fluentui/react-table",
168
+ "commit": "2d9a9f3147deea6d0c0a60747e1074faf47968c3",
169
+ "comment": "fix(TableCellLayout): Icon sizes in should match design spec"
170
+ },
171
+ {
172
+ "author": "lingfangao@hotmail.com",
173
+ "package": "@fluentui/react-table",
174
+ "commit": "31d2fa0e30649e991925fec10d49ac8fae2dc585",
175
+ "comment": "feat: `DataGrid` supports row sorting"
176
+ },
177
+ {
178
+ "author": "lingfangao@hotmail.com",
179
+ "package": "@fluentui/react-table",
180
+ "commit": "8811bf9bf2f5d2c6591ffdaa0a4024456f66bfbd",
181
+ "comment": "BREAKING: rename useTable->useTableFeatures, useSelection->useTableSelection, useSort->useTableSort"
182
+ },
183
+ {
184
+ "author": "lingfangao@hotmail.com",
185
+ "package": "@fluentui/react-table",
186
+ "commit": "6b90a6e90a71bb3ca36a6bc633d0d535ccb717e9",
187
+ "comment": "feat: DataGrid supports selection"
188
+ },
189
+ {
190
+ "author": "beachball",
191
+ "package": "@fluentui/react-table",
192
+ "comment": "Bump @fluentui/react-avatar to v9.2.8",
193
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
194
+ },
195
+ {
196
+ "author": "beachball",
197
+ "package": "@fluentui/react-table",
198
+ "comment": "Bump @fluentui/react-checkbox to v9.0.14",
199
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
200
+ },
201
+ {
202
+ "author": "beachball",
203
+ "package": "@fluentui/react-table",
204
+ "comment": "Bump @fluentui/react-radio to v9.0.13",
205
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
206
+ },
207
+ {
208
+ "author": "beachball",
209
+ "package": "@fluentui/react-table",
210
+ "comment": "Bump @fluentui/react-tabster to v9.3.2",
211
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
212
+ },
213
+ {
214
+ "author": "beachball",
215
+ "package": "@fluentui/react-table",
216
+ "comment": "Bump @fluentui/react-theme to v9.1.3",
217
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
218
+ }
219
+ ],
220
+ "none": [
221
+ {
222
+ "author": "lingfangao@hotmail.com",
223
+ "package": "@fluentui/react-table",
224
+ "commit": "8607e1bc8dbc03f9416f1c24d403f04ca91cd597",
225
+ "comment": "docs: Improve `DataGrid` docs"
226
+ }
227
+ ]
228
+ }
229
+ },
230
+ {
231
+ "date": "Thu, 17 Nov 2022 23:05:47 GMT",
6
232
  "tag": "@fluentui/react-table_v9.0.0-alpha.12",
7
233
  "version": "9.0.0-alpha.12",
8
234
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,60 @@
1
1
  # Change Log - @fluentui/react-table
2
2
 
3
- This log was last generated on Thu, 17 Nov 2022 23:02:45 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 20 Dec 2022 14:55:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-alpha.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.14)
8
+
9
+ Tue, 20 Dec 2022 14:55:53 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-alpha.13..@fluentui/react-table_v9.0.0-alpha.14)
11
+
12
+ ### Changes
13
+
14
+ - fix: Explicit focus outline for TableHeaderCell and TableSelectionCell ([PR #25938](https://github.com/microsoft/fluentui/pull/25938) by lingfangao@hotmail.com)
15
+ - fix(DataGridSelectionCell): should render `aria-selected` on the cell ([PR #25950](https://github.com/microsoft/fluentui/pull/25950) by lingfangao@hotmail.com)
16
+ - fix: DataGrid supports keyboard navigation by default ([PR #25939](https://github.com/microsoft/fluentui/pull/25939) by lingfangao@hotmail.com)
17
+ - feat: Add row focus as unstable feature due to a11y unknowns ([PR #25944](https://github.com/microsoft/fluentui/pull/25944) by lingfangao@hotmail.com)
18
+ - fix(DataGridRow): `children` type should only be render function ([PR #25930](https://github.com/microsoft/fluentui/pull/25930) by lingfangao@hotmail.com)
19
+ - fix: DataGridRow should prevent default on spacebar ([PR #25942](https://github.com/microsoft/fluentui/pull/25942) by lingfangao@hotmail.com)
20
+ - feat: DataGrid supports custom row Ids ([PR #25885](https://github.com/microsoft/fluentui/pull/25885) by lingfangao@hotmail.com)
21
+ - fix(TableHeaderCell): should render `aria-sort="none"` if not sorted ([PR #25921](https://github.com/microsoft/fluentui/pull/25921) by lingfangao@hotmail.com)
22
+ - Bump @fluentui/react-aria to v9.3.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
23
+ - Bump @fluentui/react-avatar to v9.2.9 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
24
+ - Bump @fluentui/react-checkbox to v9.0.15 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
25
+ - Bump @fluentui/react-context-selector to v9.1.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
26
+ - Bump @fluentui/react-radio to v9.0.14 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
27
+ - Bump @fluentui/react-tabster to v9.3.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
28
+ - Bump @fluentui/react-theme to v9.1.4 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
29
+ - Bump @fluentui/react-utilities to v9.3.0 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
30
+
31
+ ## [9.0.0-alpha.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.13)
32
+
33
+ Mon, 05 Dec 2022 18:29:31 GMT
34
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-alpha.12..@fluentui/react-table_v9.0.0-alpha.13)
35
+
36
+ ### Changes
37
+
38
+ - fix: TableHeaderCell design fixes ([PR #25712](https://github.com/microsoft/fluentui/pull/25712) by lingfangao@hotmail.com)
39
+ - BREAKING(useTable): `onSelectionChange` returns data object ([PR #25731](https://github.com/microsoft/fluentui/pull/25731) by lingfangao@hotmail.com)
40
+ - docs: Update docstrings for props ([PR #25787](https://github.com/microsoft/fluentui/pull/25787) by lingfangao@hotmail.com)
41
+ - fix: Various design fixes to Table components ([PR #25715](https://github.com/microsoft/fluentui/pull/25715) by lingfangao@hotmail.com)
42
+ - fix: Cell actions should have correct background when row focused within ([PR #25790](https://github.com/microsoft/fluentui/pull/25790) by lingfangao@hotmail.com)
43
+ - fix: Table row height is determined by cells ([PR #25717](https://github.com/microsoft/fluentui/pull/25717) by lingfangao@hotmail.com)
44
+ - BREAKING: change `smaller` size to `extra-small` ([PR #25713](https://github.com/microsoft/fluentui/pull/25713) by lingfangao@hotmail.com)
45
+ - fix(TableCellLayout): Icon sizes in should match design spec ([PR #25764](https://github.com/microsoft/fluentui/pull/25764) by lingfangao@hotmail.com)
46
+ - feat: `DataGrid` supports row sorting ([PR #25655](https://github.com/microsoft/fluentui/pull/25655) by lingfangao@hotmail.com)
47
+ - BREAKING: rename useTable->useTableFeatures, useSelection->useTableSelection, useSort->useTableSort ([PR #25797](https://github.com/microsoft/fluentui/pull/25797) by lingfangao@hotmail.com)
48
+ - feat: DataGrid supports selection ([PR #25719](https://github.com/microsoft/fluentui/pull/25719) by lingfangao@hotmail.com)
49
+ - Bump @fluentui/react-avatar to v9.2.8 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
50
+ - Bump @fluentui/react-checkbox to v9.0.14 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
51
+ - Bump @fluentui/react-radio to v9.0.13 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
52
+ - Bump @fluentui/react-tabster to v9.3.2 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
53
+ - Bump @fluentui/react-theme to v9.1.3 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
54
+
7
55
  ## [9.0.0-alpha.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-table_v9.0.0-alpha.12)
8
56
 
9
- Thu, 17 Nov 2022 23:02:45 GMT
57
+ Thu, 17 Nov 2022 23:05:47 GMT
10
58
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-table_v9.0.0-alpha.11..@fluentui/react-table_v9.0.0-alpha.12)
11
59
 
12
60
  ### Changes
package/dist/index.d.ts CHANGED
@@ -93,9 +93,24 @@ export declare const dataGridClassNames: SlotClassNames<DataGridSlots>;
93
93
  export declare type DataGridContextValue = HeadlessTableState<any> & {
94
94
  /**
95
95
  * How focus navigation will work in the datagrid
96
- * @default none
96
+ * @default cell
97
97
  */
98
98
  focusMode: FocusMode;
99
+ /**
100
+ * Lets child components know if rows selection is enabled
101
+ * @see selectionMode prop enables row selection on the component
102
+ */
103
+ selectableRows: boolean;
104
+ /**
105
+ * Enables subtle selection style
106
+ * @default false
107
+ */
108
+ subtleSelection: boolean;
109
+ /**
110
+ * Row appearance when selected
111
+ * @default brand
112
+ */
113
+ selectionAppearance: TableRowProps['appearance'];
99
114
  };
100
115
 
101
116
  export declare type DataGridContextValues = TableContextValues & {
@@ -143,7 +158,15 @@ export declare type DataGridHeaderState = TableHeaderState;
143
158
  /**
144
159
  * DataGrid Props
145
160
  */
146
- export declare type DataGridProps = TableProps & Pick<DataGridContextValue, 'items' | 'columns'> & Pick<Partial<DataGridContextValue>, 'focusMode'>;
161
+ export declare type DataGridProps = TableProps & Pick<DataGridContextValue, 'items' | 'columns' | 'getRowId'> & Pick<Partial<DataGridContextValue>, 'focusMode' | 'subtleSelection' | 'selectionAppearance'> & Pick<UseTableSortOptions, 'sortState' | 'defaultSortState'> & Pick<UseTableSelectionOptions, 'defaultSelectedItems' | 'selectedItems'> & {
162
+ onSortChange?: (e: React_2.MouseEvent, sortState: SortState) => void;
163
+ onSelectionChange?: (e: React_2.MouseEvent | React_2.KeyboardEvent, data: OnSelectionChangeData) => void;
164
+ /**
165
+ * Enables row selection and sets the selection mode
166
+ * @default false
167
+ */
168
+ selectionMode?: SelectionMode_2;
169
+ };
147
170
 
148
171
  /**
149
172
  * DataGridRow component - TODO: add more docs
@@ -155,16 +178,22 @@ export declare const dataGridRowClassNames: SlotClassNames<DataGridRowSlots>;
155
178
  /**
156
179
  * DataGridRow Props
157
180
  */
158
- export declare type DataGridRowProps = Omit<TableRowProps, 'children'> & {
181
+ export declare type DataGridRowProps = Omit<TableRowProps, 'children'> & Omit<ComponentProps<DataGridRowSlots>, 'children'> & {
159
182
  children: CellRenderFunction;
160
183
  };
161
184
 
162
- export declare type DataGridRowSlots = TableRowSlots;
185
+ export declare type DataGridRowSlots = TableRowSlots & {
186
+ /**
187
+ * When selection is enabled on the @see DataGrid, all rows
188
+ * will render the selection cell.
189
+ */
190
+ selectionCell?: Slot<typeof TableSelectionCell>;
191
+ };
163
192
 
164
193
  /**
165
194
  * State used in rendering DataGridRow
166
195
  */
167
- export declare type DataGridRowState = TableRowState;
196
+ export declare type DataGridRowState = TableRowState & ComponentState<DataGridRowSlots>;
168
197
 
169
198
  /**
170
199
  * DataGridSelectionCell component - TODO: add more docs
@@ -192,9 +221,9 @@ export declare type DataGridSlots = TableSlots;
192
221
  */
193
222
  export declare type DataGridState = TableState & {
194
223
  tableState: HeadlessTableState<unknown>;
195
- } & Pick<DataGridContextValue, 'focusMode'>;
224
+ } & Pick<DataGridContextValue, 'focusMode' | 'selectableRows' | 'subtleSelection' | 'selectionAppearance' | 'getRowId'>;
196
225
 
197
- export declare type FocusMode = 'none' | 'cell';
226
+ export declare type FocusMode = 'none' | 'cell' | 'row_unstable';
198
227
 
199
228
  export declare interface HeadlessTableState<TItem> extends Pick<UseTableOptions<TItem>, 'items' | 'getRowId'> {
200
229
  /**
@@ -216,6 +245,10 @@ export declare interface HeadlessTableState<TItem> extends Pick<UseTableOptions<
216
245
  columns: ColumnDefinition<TItem>[];
217
246
  }
218
247
 
248
+ declare interface OnSelectionChangeData {
249
+ selectedItems: Set<RowId>;
250
+ }
251
+
219
252
  /**
220
253
  * Render the final JSX of DataGrid
221
254
  */
@@ -403,6 +436,10 @@ declare type TableCellLayoutContextValues = {
403
436
  * TableCellLayout Props
404
437
  */
405
438
  export declare type TableCellLayoutProps = ComponentProps<Partial<TableCellLayoutSlots>> & {
439
+ /**
440
+ * Renders design variants of the table cell
441
+ * @default undefined
442
+ */
406
443
  appearance?: 'primary';
407
444
  };
408
445
 
@@ -431,7 +468,7 @@ export declare type TableCellLayoutSlots = {
431
468
  */
432
469
  export declare type TableCellLayoutState = ComponentState<TableCellLayoutSlots> & Pick<TableCellLayoutProps, 'appearance'> & {
433
470
  avatarSize: AvatarSizes | undefined;
434
- };
471
+ } & Pick<TableContextValue, 'size'>;
435
472
 
436
473
  /**
437
474
  * TableCell Props
@@ -445,7 +482,7 @@ export declare type TableCellSlots = {
445
482
  /**
446
483
  * State used in rendering TableCell
447
484
  */
448
- export declare type TableCellState = ComponentState<TableCellSlots> & Pick<TableContextValue, 'noNativeElements'>;
485
+ export declare type TableCellState = ComponentState<TableCellSlots> & Pick<TableContextValue, 'noNativeElements' | 'size'>;
449
486
 
450
487
  export declare const tableClassName = "fui-Table";
451
488
 
@@ -458,14 +495,16 @@ export declare type TableContextValue = {
458
495
  * Affects the sizes of all table subcomponents
459
496
  * @default medium
460
497
  */
461
- size: 'small' | 'smaller' | 'medium';
498
+ size: 'extra-small' | 'small' | 'medium';
462
499
  /**
463
500
  * Render all table elements as divs intead of semantic table elements
464
501
  * Using divs no longer uses `display: table` layout but `display: flex`
502
+ * @default false
465
503
  */
466
504
  noNativeElements: boolean;
467
505
  /**
468
506
  * Whether the table is sortable
507
+ * @default false
469
508
  */
470
509
  sortable: boolean;
471
510
  };
@@ -492,6 +531,9 @@ export declare const tableHeaderCellClassNames: SlotClassNames<TableHeaderCellSl
492
531
  * TableHeaderCell Props
493
532
  */
494
533
  export declare type TableHeaderCellProps = ComponentProps<Partial<TableHeaderCellSlots>> & {
534
+ /**
535
+ * @default undefined
536
+ */
495
537
  sortDirection?: SortDirection;
496
538
  };
497
539
 
@@ -546,7 +588,8 @@ export declare const tableRowClassNames: SlotClassNames<TableRowSlots>;
546
588
  */
547
589
  export declare type TableRowProps = ComponentProps<TableRowSlots> & {
548
590
  /**
549
- * A table row can have different variants
591
+ * A table row can have different variants. These appearances are
592
+ * intended to be used with selection.
550
593
  * @default none
551
594
  */
552
595
  appearance?: 'brand' | 'neutral' | 'none';
@@ -573,16 +616,22 @@ export declare const tableSelectionCellClassNames: SlotClassNames<TableSelection
573
616
  */
574
617
  export declare type TableSelectionCellProps = ComponentProps<Partial<Omit<TableSelectionCellSlots, 'media'>>> & {
575
618
  /**
576
- * A table can have two kinds of selection modes
619
+ * A table can have two kinds of selection modes.
620
+ * @default checkbox
577
621
  */
578
622
  type?: 'checkbox' | 'radio';
623
+ /**
624
+ * @default false
625
+ */
579
626
  checked?: CheckboxProps['checked'];
580
627
  /**
581
- * Only visible when checked or the parent row is hovered
628
+ * Only visible when checked or the parent row is hovered/focused
629
+ * @default false
582
630
  */
583
631
  subtle?: boolean;
584
632
  /**
585
633
  * Completely hides the selection cell visually but takes up the same space
634
+ * @default false
586
635
  */
587
636
  hidden?: boolean;
588
637
  };
@@ -640,6 +689,7 @@ export declare interface TableSelectionState {
640
689
  * Checks if a given rowId is selected
641
690
  */
642
691
  isRowSelected: (rowId: RowId) => boolean;
692
+ selectionMode: SelectionMode_2;
643
693
  }
644
694
 
645
695
  export declare type TableSlots = {
@@ -793,46 +843,6 @@ export declare const useDataGridSelectionCellStyles_unstable: (state: DataGridSe
793
843
  */
794
844
  export declare const useDataGridStyles_unstable: (state: DataGridState) => DataGridState;
795
845
 
796
- export declare function useSelection<TItem>(options: UseSelectionOptions): (tableState: HeadlessTableState<TItem>) => HeadlessTableState<TItem>;
797
-
798
- declare interface UseSelectionOptions {
799
- /**
800
- * Can be multi or single select
801
- */
802
- selectionMode: SelectionMode_2;
803
- /**
804
- * Used in uncontrolled mode to set initial selected rows on mount
805
- */
806
- defaultSelectedItems?: Set<RowId>;
807
- /**
808
- * Used to control row selection
809
- */
810
- selectedItems?: Set<RowId>;
811
- /**
812
- * Called when selection changes
813
- */
814
- onSelectionChange?: (e: React_2.SyntheticEvent, selectedItems: Set<RowId>) => void;
815
- }
816
-
817
- export declare function useSort<TItem>(options: UseSortOptions): (tableState: HeadlessTableState<TItem>) => HeadlessTableState<TItem>;
818
-
819
- declare interface UseSortOptions {
820
- /**
821
- * Used to control sorting
822
- */
823
- sortState?: SortState;
824
- /**
825
- * Used in uncontrolled mode to set initial sort column and direction on mount
826
- */
827
- defaultSortState?: SortState;
828
- /**
829
- * Called when sort changes
830
- */
831
- onSortChange?: (e: React_2.SyntheticEvent, state: SortState) => void;
832
- }
833
-
834
- export declare function useTable<TItem>(options: UseTableOptions<TItem>, plugins?: TableStatePlugin[]): HeadlessTableState<TItem>;
835
-
836
846
  /**
837
847
  * Create the state required to render Table.
838
848
  *
@@ -910,6 +920,8 @@ export declare const useTableCellStyles_unstable: (state: TableCellState) => Tab
910
920
 
911
921
  export declare const useTableContext: () => TableContextValue;
912
922
 
923
+ export declare function useTableFeatures<TItem>(options: UseTableOptions<TItem>, plugins?: TableStatePlugin[]): HeadlessTableState<TItem>;
924
+
913
925
  /**
914
926
  * Create the state required to render TableHeader.
915
927
  *
@@ -964,6 +976,8 @@ export declare const useTableRow_unstable: (props: TableRowProps, ref: React_2.R
964
976
  */
965
977
  export declare const useTableRowStyles_unstable: (state: TableRowState) => TableRowState;
966
978
 
979
+ export declare function useTableSelection<TItem>(options: UseTableSelectionOptions): (tableState: HeadlessTableState<TItem>) => HeadlessTableState<TItem>;
980
+
967
981
  /**
968
982
  * Create the state required to render TableSelectionCell.
969
983
  *
@@ -980,6 +994,42 @@ export declare const useTableSelectionCell_unstable: (props: TableSelectionCellP
980
994
  */
981
995
  export declare const useTableSelectionCellStyles_unstable: (state: TableSelectionCellState) => TableSelectionCellState;
982
996
 
997
+ declare interface UseTableSelectionOptions {
998
+ /**
999
+ * Can be multi or single select
1000
+ */
1001
+ selectionMode: SelectionMode_2;
1002
+ /**
1003
+ * Used in uncontrolled mode to set initial selected rows on mount
1004
+ */
1005
+ defaultSelectedItems?: Set<RowId>;
1006
+ /**
1007
+ * Used to control row selection
1008
+ */
1009
+ selectedItems?: Set<RowId>;
1010
+ /**
1011
+ * Called when selection changes
1012
+ */
1013
+ onSelectionChange?(e: React_2.SyntheticEvent, data: OnSelectionChangeData): void;
1014
+ }
1015
+
1016
+ export declare function useTableSort<TItem>(options: UseTableSortOptions): (tableState: HeadlessTableState<TItem>) => HeadlessTableState<TItem>;
1017
+
1018
+ declare interface UseTableSortOptions {
1019
+ /**
1020
+ * Used to control sorting
1021
+ */
1022
+ sortState?: SortState;
1023
+ /**
1024
+ * Used in uncontrolled mode to set initial sort column and direction on mount
1025
+ */
1026
+ defaultSortState?: SortState;
1027
+ /**
1028
+ * Called when sort changes
1029
+ */
1030
+ onSortChange?(e: React_2.SyntheticEvent, state: SortState): void;
1031
+ }
1032
+
983
1033
  /**
984
1034
  * Apply styling to the Table slots based on the state
985
1035
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGrid/DataGrid.types.ts"],"names":[],"mappings":"","sourcesContent":["import { TableContextValues, TableProps, TableSlots, TableState } from '../Table/Table.types';\nimport { TableState as HeadlessTableState } from '../../hooks';\n\nexport type DataGridSlots = TableSlots;\n\nexport type FocusMode = 'none' | 'cell';\n\nexport type DataGridContextValues = TableContextValues & {\n dataGrid: DataGridContextValue;\n};\n\n// Use any here since we can't know the user types\n// The user is responsible for narrowing the type downstream\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DataGridContextValue = HeadlessTableState<any> & {\n /**\n * How focus navigation will work in the datagrid\n * @default none\n */\n focusMode: FocusMode;\n};\n\n/**\n * DataGrid Props\n */\nexport type DataGridProps = TableProps &\n Pick<DataGridContextValue, 'items' | 'columns'> &\n Pick<Partial<DataGridContextValue>, 'focusMode'>;\n\n/**\n * State used in rendering DataGrid\n */\nexport type DataGridState = TableState & { tableState: HeadlessTableState<unknown> } & Pick<\n DataGridContextValue,\n 'focusMode'\n >;\n"]}
1
+ {"version":3,"file":"DataGrid.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGrid/DataGrid.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { TableContextValues, TableProps, TableSlots, TableState } from '../Table/Table.types';\nimport type {\n SortState,\n TableState as HeadlessTableState,\n UseTableSortOptions,\n SelectionMode,\n UseTableSelectionOptions,\n OnSelectionChangeData,\n} from '../../hooks';\nimport { TableRowProps } from '../TableRow/TableRow.types';\n\nexport type DataGridSlots = TableSlots;\n\nexport type FocusMode = 'none' | 'cell' | 'row_unstable';\n\nexport type DataGridContextValues = TableContextValues & {\n dataGrid: DataGridContextValue;\n};\n\n// Use any here since we can't know the user types\n// The user is responsible for narrowing the type downstream\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DataGridContextValue = HeadlessTableState<any> & {\n /**\n * How focus navigation will work in the datagrid\n * @default cell\n */\n focusMode: FocusMode;\n\n /**\n * Lets child components know if rows selection is enabled\n * @see selectionMode prop enables row selection on the component\n */\n selectableRows: boolean;\n\n /**\n * Enables subtle selection style\n * @default false\n */\n subtleSelection: boolean;\n\n /**\n * Row appearance when selected\n * @default brand\n */\n selectionAppearance: TableRowProps['appearance'];\n};\n\n/**\n * DataGrid Props\n */\nexport type DataGridProps = TableProps &\n Pick<DataGridContextValue, 'items' | 'columns' | 'getRowId'> &\n Pick<Partial<DataGridContextValue>, 'focusMode' | 'subtleSelection' | 'selectionAppearance'> &\n Pick<UseTableSortOptions, 'sortState' | 'defaultSortState'> &\n Pick<UseTableSelectionOptions, 'defaultSelectedItems' | 'selectedItems'> & {\n onSortChange?: (e: React.MouseEvent, sortState: SortState) => void;\n onSelectionChange?: (e: React.MouseEvent | React.KeyboardEvent, data: OnSelectionChangeData) => void;\n /**\n * Enables row selection and sets the selection mode\n * @default false\n */\n selectionMode?: SelectionMode;\n };\n\n/**\n * State used in rendering DataGrid\n */\nexport type DataGridState = TableState & { tableState: HeadlessTableState<unknown> } & Pick<\n DataGridContextValue,\n 'focusMode' | 'selectableRows' | 'subtleSelection' | 'selectionAppearance' | 'getRowId'\n >;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { useArrowNavigationGroup } from '@fluentui/react-tabster';
2
2
  import { useTable_unstable } from '../Table/useTable';
3
- import { useTable } from '../../hooks/useTable';
3
+ import { useTableFeatures, useTableSort, useTableSelection } from '../../hooks';
4
4
  /**
5
5
  * Create the state required to render DataGrid.
6
6
  *
@@ -15,25 +15,49 @@ export const useDataGrid_unstable = (props, ref) => {
15
15
  const {
16
16
  items,
17
17
  columns,
18
- focusMode = 'none'
18
+ focusMode = 'cell',
19
+ selectionMode,
20
+ onSortChange,
21
+ onSelectionChange,
22
+ defaultSortState,
23
+ sortState,
24
+ selectedItems,
25
+ defaultSelectedItems,
26
+ subtleSelection = false,
27
+ selectionAppearance = 'brand',
28
+ getRowId
19
29
  } = props;
20
30
  const navigable = focusMode !== 'none';
21
31
  const keyboardNavAttr = useArrowNavigationGroup({
22
32
  axis: 'grid'
23
33
  });
24
- const tableState = useTable({
34
+ const tableState = useTableFeatures({
25
35
  items,
26
- columns
27
- }, []);
36
+ columns,
37
+ getRowId
38
+ }, [useTableSort({
39
+ defaultSortState,
40
+ sortState,
41
+ onSortChange
42
+ }), useTableSelection({
43
+ defaultSelectedItems,
44
+ selectedItems,
45
+ onSelectionChange,
46
+ selectionMode: selectionMode !== null && selectionMode !== void 0 ? selectionMode : 'multiselect'
47
+ })]);
28
48
  const baseTableState = useTable_unstable({
29
49
  role: 'grid',
30
50
  as: 'div',
51
+ noNativeElements: true,
31
52
  ...(navigable && keyboardNavAttr),
32
53
  ...props
33
54
  }, ref);
34
55
  return { ...baseTableState,
35
56
  focusMode,
36
- tableState
57
+ tableState,
58
+ selectableRows: !!selectionMode,
59
+ subtleSelection,
60
+ selectionAppearance
37
61
  };
38
62
  };
39
63
  //# sourceMappingURL=useDataGrid.js.map