@fluentui/react-table 9.0.4 → 9.1.0

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 (316) hide show
  1. package/CHANGELOG.json +96 -1
  2. package/CHANGELOG.md +21 -2
  3. package/README.md +552 -2
  4. package/Spec.md +475 -33
  5. package/dist/index.d.ts +3 -3
  6. package/lib/components/DataGrid/DataGrid.js +5 -0
  7. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  8. package/lib/components/DataGrid/renderDataGrid.js.map +1 -1
  9. package/lib/components/DataGrid/useDataGrid.js +32 -4
  10. package/lib/components/DataGrid/useDataGrid.js.map +1 -1
  11. package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
  12. package/lib/components/DataGrid/useDataGridStyles.js.map +1 -1
  13. package/lib/components/DataGridBody/DataGridBody.js +5 -0
  14. package/lib/components/DataGridBody/DataGridBody.js.map +1 -1
  15. package/lib/components/DataGridBody/renderDataGridBody.js.map +1 -1
  16. package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
  17. package/lib/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  18. package/lib/components/DataGridCell/DataGridCell.js +5 -0
  19. package/lib/components/DataGridCell/DataGridCell.js.map +1 -1
  20. package/lib/components/DataGridCell/renderDataGridCell.js.map +1 -1
  21. package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
  22. package/lib/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  23. package/lib/components/DataGridHeader/DataGridHeader.js +5 -0
  24. package/lib/components/DataGridHeader/DataGridHeader.js.map +1 -1
  25. package/lib/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  26. package/lib/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  27. package/lib/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  28. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js +5 -0
  29. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  30. package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  31. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  32. package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  33. package/lib/components/DataGridRow/DataGridRow.js +5 -0
  34. package/lib/components/DataGridRow/DataGridRow.js.map +1 -1
  35. package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
  36. package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
  37. package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  38. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js +5 -0
  39. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  40. package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  41. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  42. package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  43. package/lib/components/Table/Table.js +5 -0
  44. package/lib/components/Table/Table.js.map +1 -1
  45. package/lib/components/Table/renderTable.js.map +1 -1
  46. package/lib/components/Table/useTable.js.map +1 -1
  47. package/lib/components/Table/useTableContextValues.js.map +1 -1
  48. package/lib/components/Table/useTableStyles.js.map +1 -1
  49. package/lib/components/TableBody/TableBody.js +5 -0
  50. package/lib/components/TableBody/TableBody.js.map +1 -1
  51. package/lib/components/TableBody/renderTableBody.js.map +1 -1
  52. package/lib/components/TableBody/useTableBody.js.map +1 -1
  53. package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
  54. package/lib/components/TableCell/TableCell.js +5 -0
  55. package/lib/components/TableCell/TableCell.js.map +1 -1
  56. package/lib/components/TableCell/renderTableCell.js.map +1 -1
  57. package/lib/components/TableCell/useTableCell.js.map +1 -1
  58. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  59. package/lib/components/TableCellActions/TableCellActions.js +5 -0
  60. package/lib/components/TableCellActions/TableCellActions.js.map +1 -1
  61. package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -1
  62. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
  63. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  64. package/lib/components/TableCellLayout/TableCellLayout.js +5 -0
  65. package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -1
  66. package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  67. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  68. package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  69. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  70. package/lib/components/TableHeader/TableHeader.js +5 -0
  71. package/lib/components/TableHeader/TableHeader.js.map +1 -1
  72. package/lib/components/TableHeader/renderTableHeader.js.map +1 -1
  73. package/lib/components/TableHeader/useTableHeader.js.map +1 -1
  74. package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  75. package/lib/components/TableHeaderCell/TableHeaderCell.js +5 -0
  76. package/lib/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  77. package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  78. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  79. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  80. package/lib/components/TableResizeHandle/TableResizeHandle.js +5 -0
  81. package/lib/components/TableResizeHandle/TableResizeHandle.js.map +1 -1
  82. package/lib/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -1
  83. package/lib/components/TableResizeHandle/useTableResizeHandle.js.map +1 -1
  84. package/lib/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -1
  85. package/lib/components/TableRow/TableRow.js +5 -0
  86. package/lib/components/TableRow/TableRow.js.map +1 -1
  87. package/lib/components/TableRow/renderTableRow.js.map +1 -1
  88. package/lib/components/TableRow/useTableRow.js.map +1 -1
  89. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  90. package/lib/components/TableSelectionCell/TableSelectionCell.js +5 -0
  91. package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  92. package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  93. package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  94. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  95. package/lib/contexts/columnIdContext.js.map +1 -1
  96. package/lib/contexts/dataGridContext.js.map +1 -1
  97. package/lib/contexts/rowIdContext.js.map +1 -1
  98. package/lib/contexts/tableContext.js.map +1 -1
  99. package/lib/contexts/tableHeaderContext.js.map +1 -1
  100. package/lib/hooks/createColumn.js.map +1 -1
  101. package/lib/hooks/selectionManager.js.map +1 -1
  102. package/lib/hooks/types.js.map +1 -1
  103. package/lib/hooks/useMeasureElement.js.map +1 -1
  104. package/lib/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
  105. package/lib/hooks/useTableColumnResizeState.js.map +1 -1
  106. package/lib/hooks/useTableColumnSizing.js.map +1 -1
  107. package/lib/hooks/useTableFeatures.js.map +1 -1
  108. package/lib/hooks/useTableSelection.js +8 -2
  109. package/lib/hooks/useTableSelection.js.map +1 -1
  110. package/lib/hooks/useTableSort.js.map +1 -1
  111. package/lib/index.js.map +1 -1
  112. package/lib/utils/columnResizeUtils.js.map +1 -1
  113. package/lib-amd/components/DataGrid/DataGrid.js +3 -1
  114. package/lib-amd/components/DataGrid/DataGrid.js.map +1 -1
  115. package/lib-amd/components/DataGrid/useDataGrid.js +24 -2
  116. package/lib-amd/components/DataGrid/useDataGrid.js.map +1 -1
  117. package/lib-amd/components/DataGridBody/DataGridBody.js +3 -1
  118. package/lib-amd/components/DataGridBody/DataGridBody.js.map +1 -1
  119. package/lib-amd/components/DataGridCell/DataGridCell.js +3 -1
  120. package/lib-amd/components/DataGridCell/DataGridCell.js.map +1 -1
  121. package/lib-amd/components/DataGridHeader/DataGridHeader.js +3 -1
  122. package/lib-amd/components/DataGridHeader/DataGridHeader.js.map +1 -1
  123. package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.js +3 -1
  124. package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  125. package/lib-amd/components/DataGridRow/DataGridRow.js +3 -1
  126. package/lib-amd/components/DataGridRow/DataGridRow.js.map +1 -1
  127. package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.js +3 -1
  128. package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  129. package/lib-amd/components/Table/Table.js +3 -1
  130. package/lib-amd/components/Table/Table.js.map +1 -1
  131. package/lib-amd/components/TableBody/TableBody.js +3 -1
  132. package/lib-amd/components/TableBody/TableBody.js.map +1 -1
  133. package/lib-amd/components/TableCell/TableCell.js +3 -1
  134. package/lib-amd/components/TableCell/TableCell.js.map +1 -1
  135. package/lib-amd/components/TableCellActions/TableCellActions.js +3 -1
  136. package/lib-amd/components/TableCellActions/TableCellActions.js.map +1 -1
  137. package/lib-amd/components/TableCellLayout/TableCellLayout.js +3 -1
  138. package/lib-amd/components/TableCellLayout/TableCellLayout.js.map +1 -1
  139. package/lib-amd/components/TableHeader/TableHeader.js +3 -1
  140. package/lib-amd/components/TableHeader/TableHeader.js.map +1 -1
  141. package/lib-amd/components/TableHeaderCell/TableHeaderCell.js +3 -1
  142. package/lib-amd/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  143. package/lib-amd/components/TableResizeHandle/TableResizeHandle.js +3 -1
  144. package/lib-amd/components/TableResizeHandle/TableResizeHandle.js.map +1 -1
  145. package/lib-amd/components/TableRow/TableRow.js +3 -1
  146. package/lib-amd/components/TableRow/TableRow.js.map +1 -1
  147. package/lib-amd/components/TableSelectionCell/TableSelectionCell.js +3 -1
  148. package/lib-amd/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  149. package/lib-amd/hooks/types.js.map +1 -1
  150. package/lib-amd/hooks/useTableColumnResizeState.js +29 -27
  151. package/lib-amd/hooks/useTableColumnResizeState.js.map +1 -1
  152. package/lib-amd/hooks/useTableSelection.js +8 -2
  153. package/lib-amd/hooks/useTableSelection.js.map +1 -1
  154. package/lib-amd/index.js.map +1 -1
  155. package/lib-amd/utils/columnResizeUtils.js.map +1 -1
  156. package/lib-commonjs/DataGrid.js.map +1 -1
  157. package/lib-commonjs/DataGridBody.js.map +1 -1
  158. package/lib-commonjs/DataGridCell.js.map +1 -1
  159. package/lib-commonjs/DataGridHeader.js.map +1 -1
  160. package/lib-commonjs/DataGridHeaderCell.js.map +1 -1
  161. package/lib-commonjs/DataGridRow.js.map +1 -1
  162. package/lib-commonjs/DataGridSelectionCell.js.map +1 -1
  163. package/lib-commonjs/Table.js.map +1 -1
  164. package/lib-commonjs/TableBody.js.map +1 -1
  165. package/lib-commonjs/TableCell.js.map +1 -1
  166. package/lib-commonjs/TableCellActions.js.map +1 -1
  167. package/lib-commonjs/TableCellLayout.js.map +1 -1
  168. package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -1
  169. package/lib-commonjs/TableHeader.js.map +1 -1
  170. package/lib-commonjs/TableHeaderCell.js.map +1 -1
  171. package/lib-commonjs/TableResizeHandle.js.map +1 -1
  172. package/lib-commonjs/TableRow.js.map +1 -1
  173. package/lib-commonjs/TableSelectionCell.js.map +1 -1
  174. package/lib-commonjs/components/DataGrid/DataGrid.js +5 -0
  175. package/lib-commonjs/components/DataGrid/DataGrid.js.map +1 -1
  176. package/lib-commonjs/components/DataGrid/DataGrid.types.js.map +1 -1
  177. package/lib-commonjs/components/DataGrid/index.js.map +1 -1
  178. package/lib-commonjs/components/DataGrid/renderDataGrid.js.map +1 -1
  179. package/lib-commonjs/components/DataGrid/useDataGrid.js +30 -2
  180. package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
  181. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
  182. package/lib-commonjs/components/DataGrid/useDataGridStyles.js.map +1 -1
  183. package/lib-commonjs/components/DataGridBody/DataGridBody.js +5 -0
  184. package/lib-commonjs/components/DataGridBody/DataGridBody.js.map +1 -1
  185. package/lib-commonjs/components/DataGridBody/DataGridBody.types.js.map +1 -1
  186. package/lib-commonjs/components/DataGridBody/index.js.map +1 -1
  187. package/lib-commonjs/components/DataGridBody/renderDataGridBody.js.map +1 -1
  188. package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
  189. package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  190. package/lib-commonjs/components/DataGridCell/DataGridCell.js +5 -0
  191. package/lib-commonjs/components/DataGridCell/DataGridCell.js.map +1 -1
  192. package/lib-commonjs/components/DataGridCell/DataGridCell.types.js.map +1 -1
  193. package/lib-commonjs/components/DataGridCell/index.js.map +1 -1
  194. package/lib-commonjs/components/DataGridCell/renderDataGridCell.js.map +1 -1
  195. package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
  196. package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  197. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js +5 -0
  198. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js.map +1 -1
  199. package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
  200. package/lib-commonjs/components/DataGridHeader/index.js.map +1 -1
  201. package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  202. package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  203. package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  204. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js +5 -0
  205. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  206. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
  207. package/lib-commonjs/components/DataGridHeaderCell/index.js.map +1 -1
  208. package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  209. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  210. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  211. package/lib-commonjs/components/DataGridRow/DataGridRow.js +5 -0
  212. package/lib-commonjs/components/DataGridRow/DataGridRow.js.map +1 -1
  213. package/lib-commonjs/components/DataGridRow/DataGridRow.types.js.map +1 -1
  214. package/lib-commonjs/components/DataGridRow/index.js.map +1 -1
  215. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
  216. package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
  217. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  218. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js +5 -0
  219. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  220. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
  221. package/lib-commonjs/components/DataGridSelectionCell/index.js.map +1 -1
  222. package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  223. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  224. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  225. package/lib-commonjs/components/Table/Table.js +5 -0
  226. package/lib-commonjs/components/Table/Table.js.map +1 -1
  227. package/lib-commonjs/components/Table/Table.types.js.map +1 -1
  228. package/lib-commonjs/components/Table/index.js.map +1 -1
  229. package/lib-commonjs/components/Table/renderTable.js.map +1 -1
  230. package/lib-commonjs/components/Table/useTable.js.map +1 -1
  231. package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
  232. package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
  233. package/lib-commonjs/components/TableBody/TableBody.js +5 -0
  234. package/lib-commonjs/components/TableBody/TableBody.js.map +1 -1
  235. package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -1
  236. package/lib-commonjs/components/TableBody/index.js.map +1 -1
  237. package/lib-commonjs/components/TableBody/renderTableBody.js.map +1 -1
  238. package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
  239. package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
  240. package/lib-commonjs/components/TableCell/TableCell.js +5 -0
  241. package/lib-commonjs/components/TableCell/TableCell.js.map +1 -1
  242. package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -1
  243. package/lib-commonjs/components/TableCell/index.js.map +1 -1
  244. package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
  245. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  246. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  247. package/lib-commonjs/components/TableCellActions/TableCellActions.js +5 -0
  248. package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -1
  249. package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -1
  250. package/lib-commonjs/components/TableCellActions/index.js.map +1 -1
  251. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -1
  252. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
  253. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  254. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +5 -0
  255. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -1
  256. package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  257. package/lib-commonjs/components/TableCellLayout/index.js.map +1 -1
  258. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  259. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  260. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  261. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  262. package/lib-commonjs/components/TableHeader/TableHeader.js +5 -0
  263. package/lib-commonjs/components/TableHeader/TableHeader.js.map +1 -1
  264. package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -1
  265. package/lib-commonjs/components/TableHeader/index.js.map +1 -1
  266. package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -1
  267. package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
  268. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  269. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js +5 -0
  270. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  271. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  272. package/lib-commonjs/components/TableHeaderCell/index.js.map +1 -1
  273. package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  274. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  275. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  276. package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js +5 -0
  277. package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js.map +1 -1
  278. package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -1
  279. package/lib-commonjs/components/TableResizeHandle/index.js.map +1 -1
  280. package/lib-commonjs/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -1
  281. package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js.map +1 -1
  282. package/lib-commonjs/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -1
  283. package/lib-commonjs/components/TableRow/TableRow.js +5 -0
  284. package/lib-commonjs/components/TableRow/TableRow.js.map +1 -1
  285. package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -1
  286. package/lib-commonjs/components/TableRow/index.js.map +1 -1
  287. package/lib-commonjs/components/TableRow/renderTableRow.js.map +1 -1
  288. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  289. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  290. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +5 -0
  291. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  292. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  293. package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -1
  294. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  295. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  296. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  297. package/lib-commonjs/contexts/columnIdContext.js.map +1 -1
  298. package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
  299. package/lib-commonjs/contexts/rowIdContext.js.map +1 -1
  300. package/lib-commonjs/contexts/tableContext.js.map +1 -1
  301. package/lib-commonjs/contexts/tableHeaderContext.js.map +1 -1
  302. package/lib-commonjs/hooks/createColumn.js.map +1 -1
  303. package/lib-commonjs/hooks/index.js.map +1 -1
  304. package/lib-commonjs/hooks/selectionManager.js.map +1 -1
  305. package/lib-commonjs/hooks/types.js.map +1 -1
  306. package/lib-commonjs/hooks/useMeasureElement.js.map +1 -1
  307. package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
  308. package/lib-commonjs/hooks/useTableColumnResizeState.js.map +1 -1
  309. package/lib-commonjs/hooks/useTableColumnSizing.js.map +1 -1
  310. package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
  311. package/lib-commonjs/hooks/useTableSelection.js +8 -2
  312. package/lib-commonjs/hooks/useTableSelection.js.map +1 -1
  313. package/lib-commonjs/hooks/useTableSort.js.map +1 -1
  314. package/lib-commonjs/index.js.map +1 -1
  315. package/lib-commonjs/utils/columnResizeUtils.js.map +1 -1
  316. package/package.json +9 -9
package/Spec.md CHANGED
@@ -2,62 +2,504 @@
2
2
 
3
3
  ## Background
4
4
 
5
- _Description and use cases of this component_
5
+ A table is a control that represents information in a two dimensional format in rows and columns.
6
+ A table can also be interactive where the user can navigation each individual cell in the table using
7
+ keyboard or nest controls inside table cells. Tables should can include both header and footer cells
8
+ that can be used to label the data in the associated cells or facilitate data sorting.
6
9
 
7
10
  ## Prior Art
8
11
 
9
- _Include background research done for this component_
12
+ - https://open-ui.org/components/table.research
13
+ - [23983](https://github.com/microsoft/fluentui/issues/23983)
10
14
 
11
- - _Link to Open UI research_
12
- - _Link to comparison of v7 and v0_
13
- - _Link to GitHub epic issue for the converged component_
15
+ ### Comparison of v8 and v0
16
+
17
+ - v0 [Table](https://fluentsite.z22.web.core.windows.net/components/table/props) component
18
+ - v8 [DetailsList](https://developer.microsoft.com/en-us/fluentui#/controls/web/detailslist) component
19
+
20
+ The equivalent of the proposed Table component is DetailsList for v8 and Table in v0. There are many differences
21
+ between the two are the complexity of the built-in features of these components. The v0 Table off-loads more complex
22
+ scenarios to the end user rather than built in. The v8 DetailsList owns a lot of the complex features of a table
23
+ such as selection, sorting, virtualization and marquee selection.
24
+
25
+ #### Focusability and interaction
26
+
27
+ The v0 Table supports row and cell keyboard navigation through focusing. This is done through an accessibility behaviour
28
+ prop.
29
+
30
+ ```tsx
31
+ <Table header={header} rows={rowsPlain} aria-label="Nested navigation" accessibility={gridNestedBehavior} />
32
+ ```
33
+
34
+ The v8 DetailsList supports focusing rows and navigating rows using arrow keys by default.
35
+
36
+ Row navigation behaves the same way for v0 and v8. Each table row is focusable and navigable using the up and down
37
+ arrow keys. Using up or down arrow while focused on a cell will focus the next row.
38
+
39
+ In v0 if there are nested focusable elements inside a focusable cell, then the user must press `Enter` to move focus
40
+ into the cell. The focus inside a cell is trapped and focus can only revert to the cell when the user presses `Escape`. v8
41
+ handles this in a completely different way. Cells are not focusable by default but the FocusZone component will allow
42
+ horizontal cell navigation by the the focusable elements.
43
+
44
+ The pattern followed by v0 has a drawback that there is no screen reader prompt to let users know that a table cell
45
+ contains interactive elements. The pattern followed by v8 however has a drawback that custom handling is necessary
46
+ when the cell contents also need to support arrow key navigation.
47
+
48
+ #### Selection
49
+
50
+ The v0 table does not support any built-in selection features. However guidance on how to implement a table with
51
+ selectable rows is provided in [prototypes on the docsite](https://fluentsite.z22.web.core.windows.net/0.63.0/prototype-table).
52
+
53
+ The v8 DetailsList supports row selection by displaying a checkbox on first column that indicates the selection status
54
+ of the row. The first column of the header is also a checkbox that can either indicate the selection status of the
55
+ rows or can be used to toggle selection of all rows in the list. Additionally, the DetailsList supports marquee selection
56
+ where a user can click and drag a selection box that will select every row that is partially contained within the selection box.
57
+
58
+ v8 uses a non-standard Selection class that is passed as reference through props to get the current selection state of the list.
59
+ The architecture choice for selection is most likely related to having to support marquee selection as a composite behaviour.
60
+
61
+ ```tsx
62
+ _selection = new Selection({
63
+ onSelectionChanged: () => {
64
+ this.setState({
65
+ selectionDetails: this._getSelectionDetails(),
66
+ });
67
+ },
68
+ });
69
+
70
+ <DetailsList items={items} selectionMode={SelectionMode.multiple} setKey="multiple" selection={_selection} />;
71
+
72
+ // Marquee selection
73
+ <MarqueeSelection selection={this._selection}>
74
+ <DetailsList items={items} selectionMode={SelectionMode.multiple} setKey="multiple" selection={_selection} />;
75
+ </MarqueeSelection>;
76
+ ```
77
+
78
+ Selection in the DetailsList is also possible with keyboard by holding down the `Shift` key while using up and down
79
+ arrow to navigate rows. The next focused row is selected if `Shift` is pressed.
80
+
81
+ #### Sorting
82
+
83
+ Both v0 Table and v8 DetailsList provide code samples of sorting data by column that follow the same principle. The component
84
+ APIs both allow events for column click which can be used to sort data.
85
+
86
+ ```tsx
87
+ // v0
88
+ const sortColumnHeader = (title, order, onOrderChange) => ({
89
+ content: `${title} ${order !== 0 ? order === 1 ? <ArrowUp /> : <ArrowDown /> : ''}`
90
+ onClick: () => onOrderChange(order === 0 ? 1 : -order),
91
+ });
92
+
93
+ const header = {
94
+ key: 'header',
95
+ items: columns.map(c =>
96
+ sortColumnHeader(c.title, c.name === sortColumn ? sortDirection : 0, newSortDirection => {
97
+ setSortColumn(c.name);
98
+ setSortDirection(newSortDirection);
99
+ }),
100
+ ),
101
+ };
102
+
103
+ <Table header={header} rows={sortedRows} />;
104
+
105
+ // v8
106
+ const onColumnClick = (ev: React.MouseEvent<HTMLElement>, column: IColumn): void => {
107
+ // sort data
108
+ };
109
+
110
+ const columns: IColumn[] = [
111
+ {
112
+ name: 'File Type',
113
+ fieldName: 'name',
114
+ onColumnClick: onColumnClick,
115
+ },
116
+ {
117
+ name: 'Name',
118
+ fieldName: 'name',
119
+ onColumnClick: onColumnClick,
120
+ },
121
+ ];
122
+
123
+ <DetailsList
124
+ items={items}
125
+ columns={columns}
126
+ isHeaderVisible={true}
127
+ />
128
+ ```
129
+
130
+ #### Column resizing
131
+
132
+ Column resizing is only supported by the v8 DetailsList. Columns can be resized without any additional configuration.
133
+ In order to support this, every column always has an inline style where the width in pixels is applied.
14
134
 
15
135
  ## Sample Code
16
136
 
17
- _Provide some representative example code that uses the proposed API for the component_
137
+ ```tsx
138
+ <Table>
139
+ <TableHeader>
140
+ <TableRow>
141
+ <TableCell> </TableCell>
142
+ <TableCell> </TableCell>
143
+ <TableCell> </TableCell>
144
+ </TableRow>
145
+ </TableHeader>
146
+
147
+ <TableBody>
148
+ <TableRow>
149
+ <TableCell> </TableCell>
150
+ <TableCell> </TableCell>
151
+ <TableCell> </TableCell>
152
+ </TableRow>
153
+ </TableBody>
154
+ </Table>
155
+ ```
18
156
 
19
157
  ## Variants
20
158
 
21
- _Describe visual or functional variants of this control, if applicable. For example, a slider could have a 2D variant._
159
+ ### Sorting
160
+
161
+ The table header should support design and interactions for sorting the table by column.
162
+
163
+ ### Selectable rows
164
+
165
+ Table rows can be selected. The table header should also support a 'select all' feature, selecting the
166
+ table header should select all rows.
167
+
168
+ ### Primary column
169
+
170
+ A primary column is generally the first column of the table, however there is no strict requirement on this. This
171
+ column has some design differences and supports secondary content which can contain extra instructions or
172
+ description.
173
+
174
+ ### Column actions
175
+
176
+ Each cell can support optional buttons/actions that only appear when focused or the row is hovered.
177
+
178
+ #### Cell media
179
+
180
+ A cell can also include a media item such as an icon or an avatar positioned at the start of the cell.
181
+
182
+ ### Sizes
183
+
184
+ The table supports the following sizes that affect the layout and size of its child components:
185
+
186
+ - small
187
+ - smaller
188
+ - medium
189
+ - large
22
190
 
23
191
  ## API
24
192
 
25
- _List the **Props** and **Slots** proposed for the component. Ideally this would just be a link to the component's `.types.ts` file_
193
+ ### Table
194
+
195
+ The `Table` component is intended to present data in a tabular format. Apart from sortable headers, the component
196
+ is intended to be presentational and not interactive. This component can also be a bail out for end users if
197
+ overriding the default interaction behaviour of the `DataGrid` component is too difficult.
198
+
199
+ - [Table](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/Table/Table.types.ts);
200
+ - [TableHeader](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/TableHeader/TableHeader.types.ts);
201
+ - [TableRow](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/TableRow/TableRow.types.ts);
202
+ - [TableCell](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/TableCell/TableCell.types.ts);
203
+ - [TableCellLayout](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/TableCellLayout/TableCellLayout.types.ts);
204
+ - [TableBody](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/TableBody/TableBody.types.ts);
205
+ - [TableSelectionCell](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/TableSelectionCell/TableSelectionCell.types.ts);
206
+
207
+ ### DataGrid
208
+
209
+ - [DataGrid](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGrid/DataGrid.types.ts);
210
+ - [DataGridHeader](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGridHeader/DataGridHeader.types.ts);
211
+ - [DataGridRow](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGridRow/DataGridRow.types.ts);
212
+ - [DataGridCell](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGridCell/DataGridCell.types.ts);
213
+ - [DataGridCellLayout](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGridCellLayout/DataGridCellLayout.types.ts);
214
+ - [DataGridBody](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGridBody/DataGridBody.types.ts);
215
+ - [DataGridSelectionCell](https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-table/src/components/DataGridSelectionCell/DataGridSelectionCell.types.ts);
26
216
 
27
217
  ## Structure
28
218
 
29
- - _**Public**_
30
- - _**Internal**_
31
- - _**DOM** - how the component will be rendered as HTML elements_
219
+ ### Table
32
220
 
33
- ## Migration
221
+ ```tsx
222
+ <Table>
223
+ <TableHeader>
224
+ <TableRow>
225
+ <TableCell> </TableCell>
226
+ <TableRow>
227
+ </TableHeader>
228
+
229
+ <TableBody>
230
+ <TableRow>
231
+ <TableCell> </TableCell>
232
+ </TableRow>
233
+ </TableBody>
234
+ </Table>
235
+ ```
236
+
237
+ ```html
238
+ <table>
239
+ <thead>
240
+ <tr>
241
+ <th></th>
242
+ </tr>
243
+ </thead>
244
+
245
+ <tbody>
246
+ <tr>
247
+ <td></td>
248
+ </tr>
249
+ </tbody>
250
+ </table>
251
+ ```
252
+
253
+ ### Table cell with media
254
+
255
+ ```tsx
256
+ <TableRow>
257
+ <TableCell>
258
+ <TableCellLayout media={<FileIcon />}>Cell</TableCellLayout>
259
+ </TableCell>
260
+ <TableRow>
261
+ ```
262
+
263
+ ```html
264
+ <tr>
265
+ <td><span>FileIcon</span> Cell</td>
266
+ </tr>
267
+ ```
268
+
269
+ ### Table without semantic elements
270
+
271
+ ```tsx
272
+ <Table noNativeElements>
273
+ <TableHeader>
274
+ <TableRow>
275
+ <TableHeaderCell>Header</TableHeaderCell>
276
+ </TableRow>
277
+ </TableHeader>
278
+ </Table>
279
+
280
+ // OR
281
+
282
+ <Table as="div">
283
+ <TableHeader as="div">
284
+ <TableRow as="div">
285
+ <TableHeaderCell as="div">Header</TableHeaderCell>
286
+ </TableRow>
287
+ </TableHeader>
288
+ </Table>
289
+ ```
290
+
291
+ ```html
292
+ <div role="table">
293
+ <div role="rowgroup">
294
+ <div role="row">
295
+ <div role="columnheader"><button>Header</button></div>
296
+ </div>
297
+ </div>
298
+ </div>
299
+ ```
300
+
301
+ ### Sortable
302
+
303
+ ```tsx
304
+ <Table sortable>
305
+ <TableHeader>
306
+ <TableRow>
307
+ <TableHeaderCell sortDirection="ascending">Header</TableHeaderCell>
308
+ </TableRow>
309
+ </TableHeader>
310
+ </Table>
311
+ ```
312
+
313
+ ```html
314
+ <table>
315
+ <thead>
316
+ <tr>
317
+ <th aria-sort="ascending"><button>Header</button></th>
318
+ </tr>
319
+ </thead>
320
+ </table>
321
+ ```
322
+
323
+ ### Primary column
324
+
325
+ ```tsx
326
+ <Table>
327
+ <TableBody>
328
+ <TableRow>
329
+ <TableCell>
330
+ <TableCellLayout main="Main content" description="Description" media={<FileIcon />} appearance="primary">
331
+ Children
332
+ </TableCellLayout>
333
+ </TableCell>
334
+ </TableRow>
335
+ </TableBody>
336
+ </Table>
337
+ ```
338
+
339
+ ```html
340
+ <table>
341
+ <tbody>
342
+ <tr>
343
+ <td>
344
+ <span aria-hidden="true">icon</span>
345
+ <div>
346
+ <span>Main content</span>
347
+ <span>Description</span>
348
+ </div>
349
+ Children
350
+ </td>
351
+ </tr>
352
+ </tbody>
353
+ </table>
354
+ ```
355
+
356
+ ### Column actions
357
+
358
+ ```tsx
359
+ <Table>
360
+ <TableBody>
361
+ <TableRow>
362
+ <TableCell media={<FileIcon />}>
363
+ Content
364
+ <TableCellActions><Button icon={<FileIcon />} /></TableCellActions>
365
+ </TablePrimaryCell>
366
+ </TableRow>
367
+ </TableBody>
368
+ </Table>
369
+ ```
370
+
371
+ ```html
372
+ <table>
373
+ <tbody>
374
+ <tr>
375
+ <td>
376
+ <span aria-hidden="true">icon</span>
377
+ Content
378
+ <div>
379
+ <button><span>FileIcon</span></button>
380
+ </div>
381
+ </td>
382
+ </tr>
383
+ </tbody>
384
+ </table>
385
+ ```
386
+
387
+ ### DataGrid
34
388
 
35
- _Describe what will need to be done to upgrade from the existing implementations:_
389
+ ```tsx
390
+ <DataGrid
391
+ items={items}
392
+ columns={columns}
393
+ sortable
394
+ selectionMode="multiselect"
395
+ getRowId={item => item.file.label}
396
+ onSelectionChange={(e, data) => console.log(data)}
397
+ >
398
+ <DataGridHeader>
399
+ <DataGridRow selectionCell={{ 'aria-label': 'Select all rows' }}>
400
+ {({ renderHeaderCell }) => <DataGridHeaderCell>{renderHeaderCell()}</DataGridHeaderCell>}
401
+ </DataGridRow>
402
+ </DataGridHeader>
403
+ <DataGridBody<Item>>
404
+ {({ item, rowId }) => (
405
+ <DataGridRow<Item> key={rowId} selectionCell={{ 'aria-label': 'Select row' }}>
406
+ {({ renderCell }) => <DataGridCell>{renderCell(item)}</DataGridCell>}
407
+ </DataGridRow>
408
+ )}
409
+ </DataGridBody>
410
+ </DataGrid>
411
+ ```
36
412
 
37
- - _Migration from v8_
38
- - _Migration from v0_
413
+ ```html
414
+ <div role="grid">
415
+ <div role="rowgroup">
416
+ <div role="row">
417
+ <div role="columnheader"></div>
418
+ </div>
419
+ </div>
420
+
421
+ <div role="rowgroup">
422
+ <div role="row">
423
+ <div role="gridcell"></div>
424
+ </div>
425
+ </div>
426
+ </div>
427
+ ```
428
+
429
+ ## Migration
430
+
431
+ > ⚒️ This section is still being developed and will be completed once APIs for this component become more stable
39
432
 
40
433
  ## Behaviors
41
434
 
42
- _Explain how the component will behave in use, including:_
435
+ ### Sortable header cells
436
+
437
+ Table header cells are only focusable when they are sortable. Focus when tabbing into the Table control should
438
+ focus on the first sortable header, if any.
439
+
440
+ <img src="./etc/images/table-interactions/Slide2.PNG" width="700" />
441
+ <img src="./etc/images/table-interactions/Slide3.PNG" width="700" />
442
+ <img src="./etc/images/table-interactions/Slide4.PNG" width="700" />
443
+
444
+ ### Navigation modes
445
+
446
+ The below are the different navigation modes that are possible on a table
447
+
448
+ #### none
449
+
450
+ This mode is the default, there is no keyboard navigation possible in the table content. However, this does not
451
+ include the header cells which can be sortable. They are covered above.
452
+
453
+ #### cell
43
454
 
44
- - _Component States_
45
- - _Interaction_
46
- - _Keyboard_
47
- - _Cursor_
48
- - _Touch_
49
- - _Screen readers_
455
+ This is the most accessible and screenreader friendly navigation mode. This is what is recommended by the
456
+ [WAI APG examples](https://www.w3.org/WAI/ARIA/apg/example-index/grid/dataGrids). Navigation happsn only
457
+ on the level of the cell in both directions.
50
458
 
459
+ <img src="./etc/images/table-interactions/Slide6.PNG" width="700" />
460
+ <img src="./etc/images/table-interactions/Slide7.PNG" width="700" />
461
+ <img src="./etc/images/table-interactions/Slide8.PNG" width="700" />
462
+ <img src="./etc/images/table-interactions/Slide9.PNG" width="700" />
463
+ <img src="./etc/images/table-interactions/Slide10.PNG" width="700" />
464
+
465
+ #### row
466
+
467
+ This navigation mode can cause screen reader issues since tables are not intended to be navigated by row in any mode.
468
+ This mode only navigates the table by row and can be useful when row selection is the only interactive feature of
469
+ the component
470
+
471
+ <img src="./etc/images/table-interactions/Slide12.PNG" width="700" />
472
+ <img src="./etc/images/table-interactions/Slide13.PNG" width="700" />
473
+ <img src="./etc/images/table-interactions/Slide14.PNG" width="700" />
474
+
475
+ ### Nested focusables in cells
476
+
477
+ #### Single focusable
478
+
479
+ When there is a single focusable element inside a cell, users are recommended to choose `cell` navigation mode.
480
+ In this scenario, cells will be focused on navigation, but the focusable
481
+ element inside the cell should be focused if it exists.
482
+
483
+ <img src="./etc/images/table-interactions/Slide24.PNG" width="700" />
484
+ <img src="./etc/images/table-interactions/Slide25.PNG" width="700" />
485
+
486
+ #### Nested focusable
487
+
488
+ When there are multile focusable elemnts inside a cell, we implement a pattern similar to the [WAI grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/).
489
+ Pressing `Enter` on a cell will move focus and trap focus inside until the user presses `Escape` to revert back to grid navigation.
490
+
491
+ <img src="./etc/images/table-interactions/Slide27.PNG" width="700" />
492
+ <img src="./etc/images/table-interactions/Slide28.PNG" width="700" />
493
+ <img src="./etc/images/table-interactions/Slide29.PNG" width="700" />
494
+ <img src="./etc/images/table-interactions/Slide30.PNG" width="700" />
51
495
  ## Accessibility
52
496
 
53
- Base accessibility information is included in the design document. After the spec is filled and review, outcomes from it need to be communicated to design and incorporated in the design document.
54
-
55
- - Decide whether to use **native element** or folow **ARIA** and provide reasons
56
- - Identify the **[ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/) pattern** and, if the component is listed there, follow its specification as possible.
57
- - Identify accessibility **variants**, the `role` ([ARIA roles](https://www.w3.org/TR/wai-aria-1.1/#role_definitions)) of the component, its `slots` and `aria-*` props.
58
- - Describe the **keyboard navigation**: Tab Oder and Arrow Key Navigation. Describe any other keyboard **shortcuts** used
59
- - Specify texts for **state change announcements** - [ARIA live regions
60
- ](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) (number of available items in dropdown, error messages, confirmations, ...)
61
- - Identify UI parts that appear on **hover or focus** and specify keyboard and screen reader interaction with them
62
- - List cases when **focus** needs to be **trapped** in sections of the UI (for dialogs and popups or for hierarchical navigation)
63
- - List cases when **focus** needs to be **moved programatically** (if parts of the UI are appearing/disappearing or other cases)
497
+ The spec aims to use the accessibility section as little as possible and building an accessible component by default.
498
+ The follow a11y resources were used in the drafting of this spec:
499
+
500
+ - https://www.w3.org/WAI/ARIA/apg/patterns/grid/
501
+ - https://www.w3.org/WAI/ARIA/apg/example-index/grid/dataGrids
502
+ - https://www.w3.org/WAI/ARIA/apg/example-index/table/sortable-table.html
503
+ - https://www.w3.org/WAI/ARIA/apg/example-index/table/table
504
+ - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/grid_role
505
+ - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/table_role
package/dist/index.d.ts CHANGED
@@ -1117,7 +1117,7 @@ export declare const useTableSelectionCell_unstable: (props: TableSelectionCellP
1117
1117
  */
1118
1118
  export declare const useTableSelectionCellStyles_unstable: (state: TableSelectionCellState) => TableSelectionCellState;
1119
1119
 
1120
- declare interface UseTableSelectionOptions {
1120
+ export declare interface UseTableSelectionOptions {
1121
1121
  /**
1122
1122
  * Can be multi or single select
1123
1123
  */
@@ -1125,11 +1125,11 @@ declare interface UseTableSelectionOptions {
1125
1125
  /**
1126
1126
  * Used in uncontrolled mode to set initial selected rows on mount
1127
1127
  */
1128
- defaultSelectedItems?: Set<TableRowId>;
1128
+ defaultSelectedItems?: Iterable<TableRowId>;
1129
1129
  /**
1130
1130
  * Used to control row selection
1131
1131
  */
1132
- selectedItems?: Set<TableRowId>;
1132
+ selectedItems?: Iterable<TableRowId>;
1133
1133
  /**
1134
1134
  * Called when selection changes
1135
1135
  */
@@ -3,12 +3,17 @@ import { useDataGrid_unstable } from './useDataGrid';
3
3
  import { renderDataGrid_unstable } from './renderDataGrid';
4
4
  import { useDataGridStyles_unstable } from './useDataGridStyles';
5
5
  import { useDataGridContextValues_unstable } from './useDataGridContextValues';
6
+ import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
6
7
  /**
7
8
  * DataGrid component
8
9
  */
9
10
  export const DataGrid = /*#__PURE__*/React.forwardRef((props, ref) => {
10
11
  const state = useDataGrid_unstable(props, ref);
11
12
  useDataGridStyles_unstable(state);
13
+ const {
14
+ useDataGridStyles_unstable: useCustomStyles
15
+ } = useCustomStyleHooks_unstable();
16
+ useCustomStyles(state);
12
17
  return renderDataGrid_unstable(state, useDataGridContextValues_unstable(state));
13
18
  });
14
19
  DataGrid.displayName = 'DataGrid';
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAGhE,SAASC,iCAAiC,QAAQ,4BAA4B;AAE9E;;;AAGA,OAAO,MAAMC,QAAQ,gBAAuCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1F,MAAMC,KAAK,GAAGR,oBAAoB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAE9CL,0BAA0B,CAACM,KAAK,CAAC;EACjC,OAAOP,uBAAuB,CAACO,KAAK,EAAEL,iCAAiC,CAACK,KAAK,CAAC,CAAC;AACjF,CAAC,CAAC;AAEFJ,QAAQ,CAACK,WAAW,GAAG,UAAU","names":["React","useDataGrid_unstable","renderDataGrid_unstable","useDataGridStyles_unstable","useDataGridContextValues_unstable","DataGrid","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDataGrid_unstable } from './useDataGrid';\nimport { renderDataGrid_unstable } from './renderDataGrid';\nimport { useDataGridStyles_unstable } from './useDataGridStyles';\nimport type { DataGridProps } from './DataGrid.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useDataGridContextValues_unstable } from './useDataGridContextValues';\n\n/**\n * DataGrid component\n */\nexport const DataGrid: ForwardRefComponent<DataGridProps> = React.forwardRef((props, ref) => {\n const state = useDataGrid_unstable(props, ref);\n\n useDataGridStyles_unstable(state);\n return renderDataGrid_unstable(state, useDataGridContextValues_unstable(state));\n});\n\nDataGrid.displayName = 'DataGrid';\n"]}
1
+ {"version":3,"names":["React","useDataGrid_unstable","renderDataGrid_unstable","useDataGridStyles_unstable","useDataGridContextValues_unstable","useCustomStyleHooks_unstable","DataGrid","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-table/src/components/DataGrid/DataGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDataGrid_unstable } from './useDataGrid';\nimport { renderDataGrid_unstable } from './renderDataGrid';\nimport { useDataGridStyles_unstable } from './useDataGridStyles';\nimport type { DataGridProps } from './DataGrid.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useDataGridContextValues_unstable } from './useDataGridContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * DataGrid component\n */\nexport const DataGrid: ForwardRefComponent<DataGridProps> = React.forwardRef((props, ref) => {\n const state = useDataGrid_unstable(props, ref);\n\n useDataGridStyles_unstable(state);\n\n const { useDataGridStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderDataGrid_unstable(state, useDataGridContextValues_unstable(state));\n});\n\nDataGrid.displayName = 'DataGrid';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAGhE,SAASC,iCAAiC,QAAQ,4BAA4B;AAC9E,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,QAAQ,gBAAuCN,KAAK,CAACO,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1F,MAAMC,KAAK,GAAGT,oBAAoB,CAACO,KAAK,EAAEC,GAAG,CAAC;EAE9CN,0BAA0B,CAACO,KAAK,CAAC;EAEjC,MAAM;IAAEP,0BAA0B,EAAEQ;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACtFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOR,uBAAuB,CAACQ,KAAK,EAAEN,iCAAiC,CAACM,KAAK,CAAC,CAAC;AACjF,CAAC,CAAC;AAEFJ,QAAQ,CAACM,WAAW,GAAG,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,uBAAuB,QAAQ,gCAAgC;AAExE;;;AAGA,OAAO,MAAMC,uBAAuB,GAAG,CAACC,KAAoB,EAAEC,aAAoC,KAAI;EACpG,oBACEL,oBAACE,uBAAuB;IAACI,KAAK,EAAED,aAAa,CAACE;EAAQ,GACnDN,oBAAoB,CAACG,KAAK,EAAEC,aAAa,CAAC,CACnB;AAE9B,CAAC","names":["React","renderTable_unstable","DataGridContextProvider","renderDataGrid_unstable","state","contextValues","value","dataGrid"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGrid/renderDataGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { DataGridContextValues, DataGridState } from './DataGrid.types';\nimport { renderTable_unstable } from '../Table/renderTable';\nimport { DataGridContextProvider } from '../../contexts/dataGridContext';\n\n/**\n * Render the final JSX of DataGrid\n */\nexport const renderDataGrid_unstable = (state: DataGridState, contextValues: DataGridContextValues) => {\n return (\n <DataGridContextProvider value={contextValues.dataGrid}>\n {renderTable_unstable(state, contextValues)}\n </DataGridContextProvider>\n );\n};\n"]}
1
+ {"version":3,"names":["React","renderTable_unstable","DataGridContextProvider","renderDataGrid_unstable","state","contextValues","createElement","value","dataGrid"],"sources":["../src/packages/react-components/react-table/src/components/DataGrid/renderDataGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { DataGridContextValues, DataGridState } from './DataGrid.types';\nimport { renderTable_unstable } from '../Table/renderTable';\nimport { DataGridContextProvider } from '../../contexts/dataGridContext';\n\n/**\n * Render the final JSX of DataGrid\n */\nexport const renderDataGrid_unstable = (state: DataGridState, contextValues: DataGridContextValues) => {\n return (\n <DataGridContextProvider value={contextValues.dataGrid}>\n {renderTable_unstable(state, contextValues)}\n </DataGridContextProvider>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,uBAAuB,QAAQ,gCAAgC;AAExE;;;AAGA,OAAO,MAAMC,uBAAuB,GAAGA,CAACC,KAAoB,EAAEC,aAAoC,KAAI;EACpG,oBACEL,KAAA,CAAAM,aAAA,CAACJ,uBAAuB;IAACK,KAAK,EAAEF,aAAa,CAACG;EAAQ,GACnDP,oBAAoB,CAACG,KAAK,EAAEC,aAAa,CAAC,CACnB;AAE9B,CAAC"}
@@ -1,8 +1,10 @@
1
- import { useArrowNavigationGroup } from '@fluentui/react-tabster';
1
+ import * as React from 'react';
2
+ import { useArrowNavigationGroup, useFocusFinders } from '@fluentui/react-tabster';
2
3
  import { useTable_unstable } from '../Table/useTable';
3
4
  import { useTableFeatures, useTableSort, useTableSelection, useTableColumnSizing_unstable } from '../../hooks';
4
5
  import { CELL_WIDTH } from '../TableSelectionCell';
5
- import { useMergedRefs } from '@fluentui/react-utilities';
6
+ import { useEventCallback, useMergedRefs } from '@fluentui/react-utilities';
7
+ import { End, Home } from '@fluentui/keyboard-keys';
6
8
  /**
7
9
  * Create the state required to render DataGrid.
8
10
  *
@@ -55,13 +57,39 @@ export const useDataGrid_unstable = (props, ref) => {
55
57
  // from the container to make sure the columns don't overflow the table.
56
58
  containerWidthOffset: selectionMode ? -CELL_WIDTH : 0
57
59
  })]);
60
+ const innerRef = React.useRef(null);
61
+ const {
62
+ findFirstFocusable,
63
+ findLastFocusable
64
+ } = useFocusFinders();
65
+ const onKeyDown = useEventCallback(e => {
66
+ var _a, _b, _c;
67
+ (_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
68
+ if (!innerRef.current || !e.ctrlKey || e.defaultPrevented) {
69
+ return;
70
+ }
71
+ if (e.key === Home) {
72
+ const firstRow = innerRef.current.querySelector('[role="row"]');
73
+ if (firstRow) {
74
+ (_b = findFirstFocusable(firstRow)) === null || _b === void 0 ? void 0 : _b.focus();
75
+ }
76
+ }
77
+ if (e.key === End) {
78
+ const rows = innerRef.current.querySelectorAll('[role="row"]');
79
+ if (rows.length) {
80
+ const lastRow = rows.item(rows.length - 1);
81
+ (_c = findLastFocusable(lastRow)) === null || _c === void 0 ? void 0 : _c.focus();
82
+ }
83
+ }
84
+ });
58
85
  const baseTableState = useTable_unstable({
59
86
  role: 'grid',
60
87
  as: 'div',
61
88
  noNativeElements: true,
62
89
  ...(navigable && keyboardNavAttr),
63
- ...props
64
- }, useMergedRefs(ref, tableState.tableRef));
90
+ ...props,
91
+ onKeyDown
92
+ }, useMergedRefs(ref, tableState.tableRef, innerRef));
65
93
  return {
66
94
  ...baseTableState,
67
95
  focusMode,