@fluentui/react-table 9.0.0-alpha.9 → 9.0.0-rc.2

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 (417) hide show
  1. package/CHANGELOG.json +798 -1
  2. package/CHANGELOG.md +207 -2
  3. package/dist/index.d.ts +239 -133
  4. package/lib/components/DataGrid/DataGrid.js +1 -2
  5. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  6. package/lib/components/DataGrid/DataGrid.types.js.map +1 -1
  7. package/lib/components/DataGrid/renderDataGrid.js +5 -2
  8. package/lib/components/DataGrid/renderDataGrid.js.map +1 -1
  9. package/lib/components/DataGrid/useDataGrid.js +49 -3
  10. package/lib/components/DataGrid/useDataGrid.js.map +1 -1
  11. package/lib/components/DataGrid/useDataGridContextValues.js +11 -1
  12. package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
  13. package/lib/components/DataGrid/useDataGridStyles.js +0 -1
  14. package/lib/components/DataGrid/useDataGridStyles.js.map +1 -1
  15. package/lib/components/DataGridBody/DataGridBody.js +1 -2
  16. package/lib/components/DataGridBody/DataGridBody.js.map +1 -1
  17. package/lib/components/DataGridBody/DataGridBody.types.js.map +1 -1
  18. package/lib/components/DataGridBody/renderDataGridBody.js +13 -3
  19. package/lib/components/DataGridBody/renderDataGridBody.js.map +1 -1
  20. package/lib/components/DataGridBody/useDataGridBody.js +16 -2
  21. package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
  22. package/lib/components/DataGridBody/useDataGridBodyStyles.js +0 -1
  23. package/lib/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  24. package/lib/components/DataGridCell/DataGridCell.js +1 -2
  25. package/lib/components/DataGridCell/DataGridCell.js.map +1 -1
  26. package/lib/components/DataGridCell/renderDataGridCell.js +0 -1
  27. package/lib/components/DataGridCell/renderDataGridCell.js.map +1 -1
  28. package/lib/components/DataGridCell/useDataGridCell.js +7 -3
  29. package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
  30. package/lib/components/DataGridCell/useDataGridCellStyles.js +0 -1
  31. package/lib/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  32. package/lib/components/DataGridHeader/DataGridHeader.js +1 -2
  33. package/lib/components/DataGridHeader/DataGridHeader.js.map +1 -1
  34. package/lib/components/DataGridHeader/renderDataGridHeader.js +0 -1
  35. package/lib/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  36. package/lib/components/DataGridHeader/useDataGridHeader.js +2 -2
  37. package/lib/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  38. package/lib/components/DataGridHeader/useDataGridHeaderStyles.js +0 -1
  39. package/lib/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  40. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js +1 -2
  41. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  42. package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js +0 -1
  43. package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  44. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +23 -3
  45. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  46. package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +0 -4
  47. package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  48. package/lib/components/DataGridRow/DataGridRow.js +1 -2
  49. package/lib/components/DataGridRow/DataGridRow.js.map +1 -1
  50. package/lib/components/DataGridRow/DataGridRow.types.js.map +1 -1
  51. package/lib/components/DataGridRow/renderDataGridRow.js +15 -3
  52. package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
  53. package/lib/components/DataGridRow/useDataGridRow.js +56 -3
  54. package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
  55. package/lib/components/DataGridRow/useDataGridRowStyles.js +5 -2
  56. package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  57. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js +1 -2
  58. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  59. package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js +0 -1
  60. package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  61. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +33 -3
  62. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  63. package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +0 -4
  64. package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  65. package/lib/components/Table/Table.js +1 -2
  66. package/lib/components/Table/Table.js.map +1 -1
  67. package/lib/components/Table/Table.types.js.map +1 -1
  68. package/lib/components/Table/renderTable.js +2 -2
  69. package/lib/components/Table/renderTable.js.map +1 -1
  70. package/lib/components/Table/useTable.js +0 -2
  71. package/lib/components/Table/useTable.js.map +1 -1
  72. package/lib/components/Table/useTableContextValues.js.map +1 -1
  73. package/lib/components/Table/useTableStyles.js +13 -19
  74. package/lib/components/Table/useTableStyles.js.map +1 -1
  75. package/lib/components/TableBody/TableBody.js +1 -2
  76. package/lib/components/TableBody/TableBody.js.map +1 -1
  77. package/lib/components/TableBody/renderTableBody.js +3 -4
  78. package/lib/components/TableBody/renderTableBody.js.map +1 -1
  79. package/lib/components/TableBody/useTableBody.js +0 -2
  80. package/lib/components/TableBody/useTableBody.js.map +1 -1
  81. package/lib/components/TableBody/useTableBodyStyles.js +6 -10
  82. package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
  83. package/lib/components/TableCell/TableCell.js +1 -2
  84. package/lib/components/TableCell/TableCell.js.map +1 -1
  85. package/lib/components/TableCell/TableCell.types.js.map +1 -1
  86. package/lib/components/TableCell/renderTableCell.js +2 -2
  87. package/lib/components/TableCell/renderTableCell.js.map +1 -1
  88. package/lib/components/TableCell/useTableCell.js +4 -4
  89. package/lib/components/TableCell/useTableCell.js.map +1 -1
  90. package/lib/components/TableCell/useTableCellStyles.js +47 -26
  91. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  92. package/lib/components/TableCellActions/TableCellActions.js +1 -2
  93. package/lib/components/TableCellActions/TableCellActions.js.map +1 -1
  94. package/lib/components/TableCellActions/renderTableCellActions.js +3 -4
  95. package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -1
  96. package/lib/components/TableCellActions/useTableCellActions.js +2 -5
  97. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
  98. package/lib/components/TableCellActions/useTableCellActionsStyles.js +11 -19
  99. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  100. package/lib/components/TableCellLayout/TableCellLayout.js +1 -2
  101. package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -1
  102. package/lib/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  103. package/lib/components/TableCellLayout/renderTableCellLayout.js +10 -6
  104. package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  105. package/lib/components/TableCellLayout/useTableCellLayout.js +5 -5
  106. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  107. package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  108. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +41 -35
  109. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  110. package/lib/components/TableHeader/TableHeader.js +1 -2
  111. package/lib/components/TableHeader/TableHeader.js.map +1 -1
  112. package/lib/components/TableHeader/renderTableHeader.js +2 -2
  113. package/lib/components/TableHeader/renderTableHeader.js.map +1 -1
  114. package/lib/components/TableHeader/useTableHeader.js +1 -10
  115. package/lib/components/TableHeader/useTableHeader.js.map +1 -1
  116. package/lib/components/TableHeader/useTableHeaderStyles.js +6 -16
  117. package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  118. package/lib/components/TableHeaderCell/TableHeaderCell.js +1 -2
  119. package/lib/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  120. package/lib/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  121. package/lib/components/TableHeaderCell/renderTableHeaderCell.js +6 -4
  122. package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  123. package/lib/components/TableHeaderCell/useTableHeaderCell.js +11 -8
  124. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  125. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +69 -67
  126. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  127. package/lib/components/TableRow/TableRow.js +1 -2
  128. package/lib/components/TableRow/TableRow.js.map +1 -1
  129. package/lib/components/TableRow/TableRow.types.js.map +1 -1
  130. package/lib/components/TableRow/renderTableRow.js +3 -4
  131. package/lib/components/TableRow/renderTableRow.js.map +1 -1
  132. package/lib/components/TableRow/useTableRow.js +7 -5
  133. package/lib/components/TableRow/useTableRow.js.map +1 -1
  134. package/lib/components/TableRow/useTableRowStyles.js +137 -162
  135. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  136. package/lib/components/TableSelectionCell/TableSelectionCell.js +1 -2
  137. package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  138. package/lib/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  139. package/lib/components/TableSelectionCell/renderTableSelectionCell.js +6 -4
  140. package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  141. package/lib/components/TableSelectionCell/useTableSelectionCell.js +9 -5
  142. package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  143. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +43 -46
  144. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  145. package/lib/contexts/columnIdContext.js +9 -0
  146. package/lib/contexts/columnIdContext.js.map +1 -0
  147. package/lib/contexts/dataGridContext.js +13 -0
  148. package/lib/contexts/dataGridContext.js.map +1 -0
  149. package/lib/contexts/rowIdContext.js +9 -0
  150. package/lib/contexts/rowIdContext.js.map +1 -0
  151. package/lib/contexts/tableContext.js +0 -1
  152. package/lib/contexts/tableContext.js.map +1 -1
  153. package/lib/contexts/tableHeaderContext.js.map +1 -1
  154. package/lib/hooks/createColumn.js +35 -0
  155. package/lib/hooks/createColumn.js.map +1 -0
  156. package/lib/hooks/index.js +4 -3
  157. package/lib/hooks/index.js.map +1 -1
  158. package/lib/hooks/selectionManager.js +16 -32
  159. package/lib/hooks/selectionManager.js.map +1 -1
  160. package/lib/hooks/types.js.map +1 -1
  161. package/lib/hooks/{useTable.js → useTableFeatures.js} +12 -9
  162. package/lib/hooks/useTableFeatures.js.map +1 -0
  163. package/lib/hooks/{useSelection.js → useTableSelection.js} +18 -18
  164. package/lib/hooks/useTableSelection.js.map +1 -0
  165. package/lib/hooks/{useSort.js → useTableSort.js} +12 -21
  166. package/lib/hooks/useTableSort.js.map +1 -0
  167. package/lib/index.js +2 -1
  168. package/lib/index.js.map +1 -1
  169. package/lib-commonjs/DataGrid.js +0 -2
  170. package/lib-commonjs/DataGrid.js.map +1 -1
  171. package/lib-commonjs/DataGridBody.js +0 -2
  172. package/lib-commonjs/DataGridBody.js.map +1 -1
  173. package/lib-commonjs/DataGridCell.js +0 -2
  174. package/lib-commonjs/DataGridCell.js.map +1 -1
  175. package/lib-commonjs/DataGridHeader.js +0 -2
  176. package/lib-commonjs/DataGridHeader.js.map +1 -1
  177. package/lib-commonjs/DataGridHeaderCell.js +0 -2
  178. package/lib-commonjs/DataGridHeaderCell.js.map +1 -1
  179. package/lib-commonjs/DataGridRow.js +0 -2
  180. package/lib-commonjs/DataGridRow.js.map +1 -1
  181. package/lib-commonjs/DataGridSelectionCell.js +0 -2
  182. package/lib-commonjs/DataGridSelectionCell.js.map +1 -1
  183. package/lib-commonjs/Table.js +0 -2
  184. package/lib-commonjs/Table.js.map +1 -1
  185. package/lib-commonjs/TableBody.js +0 -2
  186. package/lib-commonjs/TableBody.js.map +1 -1
  187. package/lib-commonjs/TableCell.js +0 -2
  188. package/lib-commonjs/TableCell.js.map +1 -1
  189. package/lib-commonjs/TableCellActions.js +0 -2
  190. package/lib-commonjs/TableCellActions.js.map +1 -1
  191. package/lib-commonjs/TableCellLayout.js +0 -2
  192. package/lib-commonjs/TableCellLayout.js.map +1 -1
  193. package/lib-commonjs/TableCellPrimaryLayout.js +0 -2
  194. package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -1
  195. package/lib-commonjs/TableHeader.js +0 -2
  196. package/lib-commonjs/TableHeader.js.map +1 -1
  197. package/lib-commonjs/TableHeaderCell.js +0 -2
  198. package/lib-commonjs/TableHeaderCell.js.map +1 -1
  199. package/lib-commonjs/TableRow.js +0 -2
  200. package/lib-commonjs/TableRow.js.map +1 -1
  201. package/lib-commonjs/TableSelectionCell.js +0 -2
  202. package/lib-commonjs/TableSelectionCell.js.map +1 -1
  203. package/lib-commonjs/components/DataGrid/DataGrid.js +1 -8
  204. package/lib-commonjs/components/DataGrid/DataGrid.js.map +1 -1
  205. package/lib-commonjs/components/DataGrid/DataGrid.types.js.map +1 -1
  206. package/lib-commonjs/components/DataGrid/index.js +0 -6
  207. package/lib-commonjs/components/DataGrid/index.js.map +1 -1
  208. package/lib-commonjs/components/DataGrid/renderDataGrid.js +5 -5
  209. package/lib-commonjs/components/DataGrid/renderDataGrid.js.map +1 -1
  210. package/lib-commonjs/components/DataGrid/useDataGrid.js +49 -6
  211. package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
  212. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js +11 -4
  213. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
  214. package/lib-commonjs/components/DataGrid/useDataGridStyles.js +0 -5
  215. package/lib-commonjs/components/DataGrid/useDataGridStyles.js.map +1 -1
  216. package/lib-commonjs/components/DataGridBody/DataGridBody.js +1 -7
  217. package/lib-commonjs/components/DataGridBody/DataGridBody.js.map +1 -1
  218. package/lib-commonjs/components/DataGridBody/DataGridBody.types.js.map +1 -1
  219. package/lib-commonjs/components/DataGridBody/index.js +0 -6
  220. package/lib-commonjs/components/DataGridBody/index.js.map +1 -1
  221. package/lib-commonjs/components/DataGridBody/renderDataGridBody.js +13 -6
  222. package/lib-commonjs/components/DataGridBody/renderDataGridBody.js.map +1 -1
  223. package/lib-commonjs/components/DataGridBody/useDataGridBody.js +16 -5
  224. package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
  225. package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js +0 -5
  226. package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  227. package/lib-commonjs/components/DataGridCell/DataGridCell.js +1 -7
  228. package/lib-commonjs/components/DataGridCell/DataGridCell.js.map +1 -1
  229. package/lib-commonjs/components/DataGridCell/DataGridCell.types.js.map +1 -1
  230. package/lib-commonjs/components/DataGridCell/index.js +0 -6
  231. package/lib-commonjs/components/DataGridCell/index.js.map +1 -1
  232. package/lib-commonjs/components/DataGridCell/renderDataGridCell.js +0 -4
  233. package/lib-commonjs/components/DataGridCell/renderDataGridCell.js.map +1 -1
  234. package/lib-commonjs/components/DataGridCell/useDataGridCell.js +7 -6
  235. package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
  236. package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js +0 -5
  237. package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  238. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js +1 -7
  239. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js.map +1 -1
  240. package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
  241. package/lib-commonjs/components/DataGridHeader/index.js +0 -6
  242. package/lib-commonjs/components/DataGridHeader/index.js.map +1 -1
  243. package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js +0 -4
  244. package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  245. package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js +2 -5
  246. package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  247. package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js +0 -5
  248. package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  249. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js +1 -7
  250. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  251. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
  252. package/lib-commonjs/components/DataGridHeaderCell/index.js +0 -6
  253. package/lib-commonjs/components/DataGridHeaderCell/index.js.map +1 -1
  254. package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js +0 -4
  255. package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  256. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +23 -6
  257. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  258. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +0 -8
  259. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  260. package/lib-commonjs/components/DataGridRow/DataGridRow.js +1 -7
  261. package/lib-commonjs/components/DataGridRow/DataGridRow.js.map +1 -1
  262. package/lib-commonjs/components/DataGridRow/DataGridRow.types.js.map +1 -1
  263. package/lib-commonjs/components/DataGridRow/index.js +0 -6
  264. package/lib-commonjs/components/DataGridRow/index.js.map +1 -1
  265. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js +15 -6
  266. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
  267. package/lib-commonjs/components/DataGridRow/useDataGridRow.js +56 -6
  268. package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
  269. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js +5 -6
  270. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  271. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js +1 -7
  272. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  273. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
  274. package/lib-commonjs/components/DataGridSelectionCell/index.js +0 -6
  275. package/lib-commonjs/components/DataGridSelectionCell/index.js.map +1 -1
  276. package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js +0 -4
  277. package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  278. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +33 -6
  279. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  280. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +0 -8
  281. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  282. package/lib-commonjs/components/Table/Table.js +1 -8
  283. package/lib-commonjs/components/Table/Table.js.map +1 -1
  284. package/lib-commonjs/components/Table/Table.types.js.map +1 -1
  285. package/lib-commonjs/components/Table/index.js +0 -6
  286. package/lib-commonjs/components/Table/index.js.map +1 -1
  287. package/lib-commonjs/components/Table/renderTable.js +2 -7
  288. package/lib-commonjs/components/Table/renderTable.js.map +1 -1
  289. package/lib-commonjs/components/Table/useTable.js +0 -5
  290. package/lib-commonjs/components/Table/useTable.js.map +1 -1
  291. package/lib-commonjs/components/Table/useTableContextValues.js +0 -3
  292. package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
  293. package/lib-commonjs/components/Table/useTableStyles.js +13 -23
  294. package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
  295. package/lib-commonjs/components/TableBody/TableBody.js +1 -7
  296. package/lib-commonjs/components/TableBody/TableBody.js.map +1 -1
  297. package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -1
  298. package/lib-commonjs/components/TableBody/index.js +0 -6
  299. package/lib-commonjs/components/TableBody/index.js.map +1 -1
  300. package/lib-commonjs/components/TableBody/renderTableBody.js +3 -8
  301. package/lib-commonjs/components/TableBody/renderTableBody.js.map +1 -1
  302. package/lib-commonjs/components/TableBody/useTableBody.js +0 -6
  303. package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
  304. package/lib-commonjs/components/TableBody/useTableBodyStyles.js +6 -12
  305. package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
  306. package/lib-commonjs/components/TableCell/TableCell.js +1 -7
  307. package/lib-commonjs/components/TableCell/TableCell.js.map +1 -1
  308. package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -1
  309. package/lib-commonjs/components/TableCell/index.js +0 -6
  310. package/lib-commonjs/components/TableCell/index.js.map +1 -1
  311. package/lib-commonjs/components/TableCell/renderTableCell.js +2 -6
  312. package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
  313. package/lib-commonjs/components/TableCell/useTableCell.js +4 -8
  314. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  315. package/lib-commonjs/components/TableCell/useTableCellStyles.js +47 -30
  316. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  317. package/lib-commonjs/components/TableCellActions/TableCellActions.js +1 -7
  318. package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -1
  319. package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -1
  320. package/lib-commonjs/components/TableCellActions/index.js +0 -6
  321. package/lib-commonjs/components/TableCellActions/index.js.map +1 -1
  322. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js +3 -8
  323. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -1
  324. package/lib-commonjs/components/TableCellActions/useTableCellActions.js +1 -8
  325. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
  326. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +11 -23
  327. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  328. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +1 -8
  329. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -1
  330. package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  331. package/lib-commonjs/components/TableCellLayout/index.js +0 -6
  332. package/lib-commonjs/components/TableCellLayout/index.js.map +1 -1
  333. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js +10 -11
  334. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  335. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +5 -9
  336. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  337. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js +0 -3
  338. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  339. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +41 -39
  340. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  341. package/lib-commonjs/components/TableHeader/TableHeader.js +1 -7
  342. package/lib-commonjs/components/TableHeader/TableHeader.js.map +1 -1
  343. package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -1
  344. package/lib-commonjs/components/TableHeader/index.js +0 -6
  345. package/lib-commonjs/components/TableHeader/index.js.map +1 -1
  346. package/lib-commonjs/components/TableHeader/renderTableHeader.js +2 -7
  347. package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -1
  348. package/lib-commonjs/components/TableHeader/useTableHeader.js +1 -15
  349. package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
  350. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js +6 -19
  351. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  352. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js +1 -7
  353. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  354. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  355. package/lib-commonjs/components/TableHeaderCell/index.js +0 -6
  356. package/lib-commonjs/components/TableHeaderCell/index.js.map +1 -1
  357. package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js +6 -8
  358. package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  359. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +10 -14
  360. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  361. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +69 -71
  362. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  363. package/lib-commonjs/components/TableRow/TableRow.js +1 -7
  364. package/lib-commonjs/components/TableRow/TableRow.js.map +1 -1
  365. package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -1
  366. package/lib-commonjs/components/TableRow/index.js +0 -6
  367. package/lib-commonjs/components/TableRow/index.js.map +1 -1
  368. package/lib-commonjs/components/TableRow/renderTableRow.js +3 -8
  369. package/lib-commonjs/components/TableRow/renderTableRow.js.map +1 -1
  370. package/lib-commonjs/components/TableRow/useTableRow.js +7 -10
  371. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  372. package/lib-commonjs/components/TableRow/useTableRowStyles.js +137 -170
  373. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  374. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +1 -7
  375. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  376. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  377. package/lib-commonjs/components/TableSelectionCell/index.js +0 -6
  378. package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -1
  379. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js +6 -8
  380. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  381. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js +8 -11
  382. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  383. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +43 -50
  384. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  385. package/lib-commonjs/contexts/columnIdContext.js +16 -0
  386. package/lib-commonjs/contexts/columnIdContext.js.map +1 -0
  387. package/lib-commonjs/contexts/dataGridContext.js +20 -0
  388. package/lib-commonjs/contexts/dataGridContext.js.map +1 -0
  389. package/lib-commonjs/contexts/rowIdContext.js +16 -0
  390. package/lib-commonjs/contexts/rowIdContext.js.map +1 -0
  391. package/lib-commonjs/contexts/tableContext.js +0 -5
  392. package/lib-commonjs/contexts/tableContext.js.map +1 -1
  393. package/lib-commonjs/contexts/tableHeaderContext.js +0 -4
  394. package/lib-commonjs/contexts/tableHeaderContext.js.map +1 -1
  395. package/lib-commonjs/hooks/createColumn.js +42 -0
  396. package/lib-commonjs/hooks/createColumn.js.map +1 -0
  397. package/lib-commonjs/hooks/index.js +4 -8
  398. package/lib-commonjs/hooks/index.js.map +1 -1
  399. package/lib-commonjs/hooks/selectionManager.js +16 -34
  400. package/lib-commonjs/hooks/selectionManager.js.map +1 -1
  401. package/lib-commonjs/hooks/types.js.map +1 -1
  402. package/lib-commonjs/hooks/useTableFeatures.js +42 -0
  403. package/lib-commonjs/hooks/useTableFeatures.js.map +1 -0
  404. package/lib-commonjs/hooks/{useSelection.js → useTableSelection.js} +21 -28
  405. package/lib-commonjs/hooks/useTableSelection.js.map +1 -0
  406. package/lib-commonjs/hooks/{useSort.js → useTableSort.js} +15 -29
  407. package/lib-commonjs/hooks/useTableSort.js.map +1 -0
  408. package/lib-commonjs/index.js +27 -44
  409. package/lib-commonjs/index.js.map +1 -1
  410. package/package.json +15 -11
  411. package/lib/hooks/useSelection.js.map +0 -1
  412. package/lib/hooks/useSort.js.map +0 -1
  413. package/lib/hooks/useTable.js.map +0 -1
  414. package/lib-commonjs/hooks/useSelection.js.map +0 -1
  415. package/lib-commonjs/hooks/useSort.js.map +0 -1
  416. package/lib-commonjs/hooks/useTable.js +0 -42
  417. package/lib-commonjs/hooks/useTable.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"names":[],"mappings":"AAEA,SAAS,2BAAT,QAA4C,uCAA5C;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,8BAA8B,GAAG,CAC5C,KAD4C,EAE5C,GAF4C,KAGjB;EAC3B,OAAO,2BAA2B,CAAC,EAAE,GAAG,KAAL;IAAY,EAAE,EAAE;EAAhB,CAAD,EAA0B,GAA1B,CAAlC;AACD,CALM","sourcesContent":["import * as React from 'react';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\n\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n return useTableHeaderCell_unstable({ ...props, as: 'div' }, ref);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,gBAAgB,QAAQ,2BAA2B;AAE5D,SAASC,2BAA2B,QAAQ,uCAAuC;AACnF,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,eAAe,QAAQ,6BAA6B;AAE7D;;;;;;;;;AASA,OAAO,MAAMC,8BAA8B,GAAG,CAC5CC,KAA8B,EAC9BC,GAA2B,KACA;EAC3B,MAAMC,QAAQ,GAAGL,kBAAkB,EAAE;EACrC,MAAM;IAAEM;EAAQ,CAAE,GAAGL,eAAe,EAAE;EACtC,MAAMM,gBAAgB,GAAGR,2BAA2B,CAACS,GAAG,IAAIA,GAAG,CAACC,IAAI,CAACF,gBAAgB,CAAC;EACtF,MAAMG,aAAa,GAAGX,2BAA2B,CAACS,GAAG,IACnDF,QAAQ,GAAGE,GAAG,CAACC,IAAI,CAACE,gBAAgB,CAACN,QAAQ,CAAC,GAAGO,SAAS,CAC3D;EACD,MAAMC,OAAO,GAAGhB,gBAAgB,CAAEiB,CAA+C,IAAI;;IACnF,IAAIR,QAAQ,EAAE;MACZC,gBAAgB,CAACO,CAAC,EAAET,QAAQ,CAAC;;IAE/B,WAAK,CAACQ,OAAO,+CAAbV,KAAK,EAAWW,CAAC,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOhB,2BAA2B,CAChC;IAAEY,aAAa;IAAEK,EAAE,EAAE,KAAK;IAAEC,QAAQ,EAAEV,QAAQ,GAAGM,SAAS,GAAG,CAAC;IAAE,GAAGT,KAAK;IAAEU;EAAO,CAAE,EACnFT,GAAG,CACJ;AACH,CAAC","names":["useEventCallback","useTableHeaderCell_unstable","useDataGridContext_unstable","useColumnIdContext","useTableContext","useDataGridHeaderCell_unstable","props","ref","columnId","sortable","toggleColumnSort","ctx","sort","sortDirection","getSortDirection","undefined","onClick","e","as","tabIndex"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridHeaderCell/useDataGridHeaderCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport type { DataGridHeaderCellProps, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport { useTableHeaderCell_unstable } from '../TableHeaderCell/useTableHeaderCell';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useColumnIdContext } from '../../contexts/columnIdContext';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render DataGridHeaderCell.\n *\n * The returned state can be modified with hooks such as useDataGridHeaderCellStyles_unstable,\n * before being passed to renderDataGridHeaderCell_unstable.\n *\n * @param props - props from this instance of DataGridHeaderCell\n * @param ref - reference to root HTMLElement of DataGridHeaderCell\n */\nexport const useDataGridHeaderCell_unstable = (\n props: DataGridHeaderCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridHeaderCellState => {\n const columnId = useColumnIdContext();\n const { sortable } = useTableContext();\n const toggleColumnSort = useDataGridContext_unstable(ctx => ctx.sort.toggleColumnSort);\n const sortDirection = useDataGridContext_unstable(ctx =>\n sortable ? ctx.sort.getSortDirection(columnId) : undefined,\n );\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableHeaderCellElement>) => {\n if (sortable) {\n toggleColumnSort(e, columnId);\n }\n props.onClick?.(e);\n });\n\n return useTableHeaderCell_unstable(\n { sortDirection, as: 'div', tabIndex: sortable ? undefined : 0, ...props, onClick },\n ref,\n );\n};\n"]}
@@ -8,19 +8,15 @@ export const dataGridHeaderCellClassNames = {
8
8
  /**
9
9
  * Apply styling to the DataGridHeaderCell slots based on the state
10
10
  */
11
-
12
11
  export const useDataGridHeaderCellStyles_unstable = state => {
13
12
  useTableHeaderCellStyles_unstable(state);
14
13
  state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);
15
-
16
14
  if (state.button) {
17
15
  state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);
18
16
  }
19
-
20
17
  if (state.sortIcon) {
21
18
  state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);
22
19
  }
23
-
24
20
  return state;
25
21
  };
26
22
  //# sourceMappingURL=useDataGridHeaderCellStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridHeaderCell/useDataGridHeaderCellStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,QAA6B,gBAA7B;AAGA,SAAS,iCAAT,QAAkD,6CAAlD;AAEA,OAAO,MAAM,4BAA4B,GAA4C;EACnF,IAAI,EAAE,wBAD6E;EAEnF,MAAM,EAAE,gCAF2E;EAGnF,QAAQ,EAAE;AAHyE,CAA9E;AAMP;;AAEG;;AACH,OAAO,MAAM,oCAAoC,GAAI,KAAD,IAA4D;EAC9G,iCAAiC,CAAC,KAAD,CAAjC;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,4BAA4B,CAAC,IAA9B,EAAoC,KAAK,CAAC,IAAN,CAAW,SAA/C,CAAnC;;EAEA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,4BAA4B,CAAC,MAA9B,EAAsC,KAAK,CAAC,MAAN,CAAa,SAAnD,CAArC;EACD;;EAED,IAAI,KAAK,CAAC,QAAV,EAAoB;IAClB,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,4BAA4B,CAAC,QAA9B,EAAwC,KAAK,CAAC,QAAN,CAAe,SAAvD,CAAvC;EACD;;EAED,OAAO,KAAP;AACD,CAbM","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridHeaderCellSlots, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles';\n\nexport const dataGridHeaderCellClassNames: SlotClassNames<DataGridHeaderCellSlots> = {\n root: 'fui-DataGridHeaderCell',\n button: 'fui-DataGridHeaderCell__button',\n sortIcon: 'fui-DataGridHeaderCell__sortIcon',\n};\n\n/**\n * Apply styling to the DataGridHeaderCell slots based on the state\n */\nexport const useDataGridHeaderCellStyles_unstable = (state: DataGridHeaderCellState): DataGridHeaderCellState => {\n useTableHeaderCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);\n\n if (state.button) {\n state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);\n }\n\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAG7C,SAASC,iCAAiC,QAAQ,6CAA6C;AAE/F,OAAO,MAAMC,4BAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,MAAM,EAAE,gCAAgC;EACxCC,QAAQ,EAAE;CACX;AAED;;;AAGA,OAAO,MAAMC,oCAAoC,GAAIC,KAA8B,IAA6B;EAC9GN,iCAAiC,CAACM,KAAK,CAAC;EACxCA,KAAK,CAACJ,IAAI,CAACK,SAAS,GAAGR,YAAY,CAACE,4BAA4B,CAACC,IAAI,EAAEI,KAAK,CAACJ,IAAI,CAACK,SAAS,CAAC;EAE5F,IAAID,KAAK,CAACH,MAAM,EAAE;IAChBG,KAAK,CAACH,MAAM,CAACI,SAAS,GAAGR,YAAY,CAACE,4BAA4B,CAACE,MAAM,EAAEG,KAAK,CAACH,MAAM,CAACI,SAAS,CAAC;;EAGpG,IAAID,KAAK,CAACF,QAAQ,EAAE;IAClBE,KAAK,CAACF,QAAQ,CAACG,SAAS,GAAGR,YAAY,CAACE,4BAA4B,CAACG,QAAQ,EAAEE,KAAK,CAACF,QAAQ,CAACG,SAAS,CAAC;;EAG1G,OAAOD,KAAK;AACd,CAAC","names":["mergeClasses","useTableHeaderCellStyles_unstable","dataGridHeaderCellClassNames","root","button","sortIcon","useDataGridHeaderCellStyles_unstable","state","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridHeaderCell/useDataGridHeaderCellStyles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridHeaderCellSlots, DataGridHeaderCellState } from './DataGridHeaderCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableHeaderCellStyles_unstable } from '../TableHeaderCell/useTableHeaderCellStyles';\n\nexport const dataGridHeaderCellClassNames: SlotClassNames<DataGridHeaderCellSlots> = {\n root: 'fui-DataGridHeaderCell',\n button: 'fui-DataGridHeaderCell__button',\n sortIcon: 'fui-DataGridHeaderCell__sortIcon',\n};\n\n/**\n * Apply styling to the DataGridHeaderCell slots based on the state\n */\nexport const useDataGridHeaderCellStyles_unstable = (state: DataGridHeaderCellState): DataGridHeaderCellState => {\n useTableHeaderCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridHeaderCellClassNames.root, state.root.className);\n\n if (state.button) {\n state.button.className = mergeClasses(dataGridHeaderCellClassNames.button, state.button.className);\n }\n\n if (state.sortIcon) {\n state.sortIcon.className = mergeClasses(dataGridHeaderCellClassNames.sortIcon, state.sortIcon.className);\n }\n\n return state;\n};\n"]}
@@ -3,9 +3,8 @@ import { useDataGridRow_unstable } from './useDataGridRow';
3
3
  import { renderDataGridRow_unstable } from './renderDataGridRow';
4
4
  import { useDataGridRowStyles_unstable } from './useDataGridRowStyles';
5
5
  /**
6
- * DataGridRow component - TODO: add more docs
6
+ * DataGridRow component
7
7
  */
8
-
9
8
  export const DataGridRow = /*#__PURE__*/React.forwardRef((props, ref) => {
10
9
  const state = useDataGridRow_unstable(props, ref);
11
10
  useDataGridRowStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/DataGridRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AAIA;;AAEG;;AACH,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAD,EAAQ,GAAR,CAArC;EAEA,6BAA6B,CAAC,KAAD,CAA7B;EACA,OAAO,0BAA0B,CAAC,KAAD,CAAjC;AACD,CALiE,CAA3D;AAOP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { useDataGridRow_unstable } from './useDataGridRow';\nimport { renderDataGridRow_unstable } from './renderDataGridRow';\nimport { useDataGridRowStyles_unstable } from './useDataGridRowStyles';\nimport type { DataGridRowProps } from './DataGridRow.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DataGridRow component - TODO: add more docs\n */\nexport const DataGridRow: ForwardRefComponent<DataGridRowProps> = React.forwardRef((props, ref) => {\n const state = useDataGridRow_unstable(props, ref);\n\n useDataGridRowStyles_unstable(state);\n return renderDataGridRow_unstable(state);\n});\n\nDataGridRow.displayName = 'DataGridRow';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AAItE;;;AAGA,OAAO,MAAMC,WAAW,gBACqCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC3F,MAAMC,KAAK,GAAGP,uBAAuB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEjDJ,6BAA6B,CAACK,KAAK,CAAC;EACpC,OAAON,0BAA0B,CAACM,KAAK,CAAC;AAC1C,CAAC,CAAqG;AAEtGJ,WAAW,CAACK,WAAW,GAAG,aAAa","names":["React","useDataGridRow_unstable","renderDataGridRow_unstable","useDataGridRowStyles_unstable","DataGridRow","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridRow/DataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDataGridRow_unstable } from './useDataGridRow';\nimport { renderDataGridRow_unstable } from './renderDataGridRow';\nimport { useDataGridRowStyles_unstable } from './useDataGridRowStyles';\nimport type { DataGridRowProps } from './DataGridRow.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DataGridRow component\n */\nexport const DataGridRow: ForwardRefComponent<DataGridRowProps> &\n (<TItem>(props: DataGridRowProps<TItem>) => JSX.Element) = React.forwardRef((props, ref) => {\n const state = useDataGridRow_unstable(props, ref);\n\n useDataGridRowStyles_unstable(state);\n return renderDataGridRow_unstable(state);\n}) as ForwardRefComponent<DataGridRowProps> & (<TItem>(props: DataGridRowProps<TItem>) => JSX.Element);\n\nDataGridRow.displayName = 'DataGridRow';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DataGridRow.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridRow/DataGridRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import { TableRowProps, TableRowSlots, TableRowState } from '../TableRow/TableRow.types';\n\nexport type DataGridRowSlots = TableRowSlots;\n\n/**\n * DataGridRow Props\n */\nexport type DataGridRowProps = TableRowProps;\n\n/**\n * State used in rendering DataGridRow\n */\nexport type DataGridRowState = TableRowState;\n"]}
1
+ {"version":3,"file":"DataGridRow.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridRow/DataGridRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { Slot, ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { TableColumnDefinition } from '../../hooks';\nimport type { TableRowProps, TableRowSlots, TableRowState } from '../TableRow/TableRow.types';\nimport type { TableSelectionCell } from '../TableSelectionCell/TableSelectionCell';\n\nexport type DataGridRowSlots = TableRowSlots & {\n /**\n * When selection is enabled on the @see DataGrid, all rows\n * will render the selection cell.\n */\n selectionCell?: Slot<typeof TableSelectionCell>;\n};\n\nexport type CellRenderFunction<TItem = unknown> = (column: TableColumnDefinition<TItem>) => React.ReactNode;\n\n/**\n * DataGridRow Props\n */\nexport type DataGridRowProps<TItem = unknown> = Omit<TableRowProps, 'children'> &\n Omit<ComponentProps<DataGridRowSlots>, 'children'> & {\n children: CellRenderFunction<TItem>;\n };\n\n/**\n * State used in rendering DataGridRow\n */\nexport type DataGridRowState = TableRowState &\n ComponentState<DataGridRowSlots> & {\n renderCell: CellRenderFunction;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n columnDefs: TableColumnDefinition<any>[];\n };\n"]}
@@ -1,9 +1,21 @@
1
- import { renderTableRow_unstable } from '../TableRow/renderTableRow';
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ import { ColumnIdContextProvider } from '../../contexts/columnIdContext';
2
4
  /**
3
5
  * Render the final JSX of DataGridRow
4
6
  */
5
-
6
7
  export const renderDataGridRow_unstable = state => {
7
- return renderTableRow_unstable(state);
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, {
13
+ ...slotProps.root
14
+ }, slots.selectionCell && /*#__PURE__*/React.createElement(slots.selectionCell, {
15
+ ...slotProps.selectionCell
16
+ }), state.columnDefs.map(columnDef => /*#__PURE__*/React.createElement(ColumnIdContextProvider, {
17
+ value: columnDef.columnId,
18
+ key: columnDef.columnId
19
+ }, state.renderCell(columnDef))));
8
20
  };
9
21
  //# sourceMappingURL=renderDataGridRow.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/renderDataGridRow.tsx"],"names":[],"mappings":"AACA,SAAS,uBAAT,QAAwC,4BAAxC;AAEA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,OAAO,uBAAuB,CAAC,KAAD,CAA9B;AACD,CAFM","sourcesContent":["import type { DataGridRowState } from './DataGridRow.types';\nimport { renderTableRow_unstable } from '../TableRow/renderTableRow';\n\n/**\n * Render the final JSX of DataGridRow\n */\nexport const renderDataGridRow_unstable = (state: DataGridRowState) => {\n return renderTableRow_unstable(state);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,uBAAuB,QAAQ,gCAAgC;AAExE;;;AAGA,OAAO,MAAMC,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGL,QAAQ,CAAmBG,KAAK,CAAC;EAE9D,oBACEJ,oBAACK,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,GAC3BF,KAAK,CAACG,aAAa,iBAAIR,oBAACK,KAAK,CAACG,aAAa;IAAA,GAAKF,SAAS,CAACE;EAAa,EAAI,EAC3EJ,KAAK,CAACK,UAAU,CAACC,GAAG,CAACC,SAAS,iBAC7BX,oBAACE,uBAAuB;IAACU,KAAK,EAAED,SAAS,CAACE,QAAQ;IAAEC,GAAG,EAAEH,SAAS,CAACE;EAAQ,GACxET,KAAK,CAACW,UAAU,CAACJ,SAAS,CAAC,CAE/B,CAAC,CACS;AAEjB,CAAC","names":["React","getSlots","ColumnIdContextProvider","renderDataGridRow_unstable","state","slots","slotProps","root","selectionCell","columnDefs","map","columnDef","value","columnId","key","renderCell"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridRow/renderDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { DataGridRowState, DataGridRowSlots } from './DataGridRow.types';\nimport { ColumnIdContextProvider } from '../../contexts/columnIdContext';\n\n/**\n * Render the final JSX of DataGridRow\n */\nexport const renderDataGridRow_unstable = (state: DataGridRowState) => {\n const { slots, slotProps } = getSlots<DataGridRowSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.selectionCell && <slots.selectionCell {...slotProps.selectionCell} />}\n {state.columnDefs.map(columnDef => (\n <ColumnIdContextProvider value={columnDef.columnId} key={columnDef.columnId}>\n {state.renderCell(columnDef)}\n </ColumnIdContextProvider>\n ))}\n </slots.root>\n );\n};\n"]}
@@ -1,4 +1,10 @@
1
+ import { isInteractiveHTMLElement, useEventCallback, resolveShorthand } from '@fluentui/react-utilities';
2
+ import { Space } from '@fluentui/keyboard-keys';
1
3
  import { useTableRow_unstable } from '../TableRow/useTableRow';
4
+ import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
5
+ import { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';
6
+ import { useTableRowIdContext } from '../../contexts/rowIdContext';
7
+ import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
2
8
  /**
3
9
  * Create the state required to render DataGridRow.
4
10
  *
@@ -8,10 +14,57 @@ import { useTableRow_unstable } from '../TableRow/useTableRow';
8
14
  * @param props - props from this instance of DataGridRow
9
15
  * @param ref - reference to root HTMLElement of DataGridRow
10
16
  */
11
-
12
17
  export const useDataGridRow_unstable = (props, ref) => {
13
- return useTableRow_unstable({ ...props,
14
- as: 'div'
18
+ const rowId = useTableRowIdContext();
19
+ const isHeader = useIsInTableHeader();
20
+ const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);
21
+ const selectable = useDataGridContext_unstable(ctx => ctx.selectableRows);
22
+ const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));
23
+ const tabbable = useDataGridContext_unstable(ctx => ctx.focusMode === 'row_unstable');
24
+ const appearance = useDataGridContext_unstable(ctx => {
25
+ if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {
26
+ return ctx.selectionAppearance;
27
+ }
28
+ return 'none';
29
+ });
30
+ const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);
31
+ const onClick = useEventCallback(e => {
32
+ var _a;
33
+ if (selectable && !isHeader) {
34
+ toggleRow(e, rowId);
35
+ }
36
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
37
+ });
38
+ const onKeyDown = useEventCallback(e => {
39
+ var _a;
40
+ if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target)) {
41
+ // stop scrolling
42
+ e.preventDefault();
43
+ toggleRow(e, rowId);
44
+ }
45
+ (_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
46
+ });
47
+ const baseState = useTableRow_unstable({
48
+ appearance,
49
+ 'aria-selected': selectable ? selected : undefined,
50
+ ...props,
51
+ onClick,
52
+ onKeyDown,
53
+ children: null,
54
+ as: 'div',
55
+ tabIndex: tabbable && !isHeader ? 0 : undefined
15
56
  }, ref);
57
+ return {
58
+ ...baseState,
59
+ components: {
60
+ ...baseState.components,
61
+ selectionCell: DataGridSelectionCell
62
+ },
63
+ selectionCell: resolveShorthand(props.selectionCell, {
64
+ required: selectable
65
+ }),
66
+ renderCell: props.children,
67
+ columnDefs
68
+ };
16
69
  };
17
70
  //# sourceMappingURL=useDataGridRow.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRow.ts"],"names":[],"mappings":"AAEA,SAAS,oBAAT,QAAqC,yBAArC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH,OAAO,oBAAoB,CAAC,EAAE,GAAG,KAAL;IAAY,EAAE,EAAE;EAAhB,CAAD,EAA0B,GAA1B,CAA3B;AACD,CAFM","sourcesContent":["import * as React from 'react';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n return useTableRow_unstable({ ...props, as: 'div' }, ref);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,wBAAwB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,2BAA2B;AACxG,SAASC,KAAK,QAAQ,yBAAyB;AAE/C,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,qBAAqB,QAAQ,gDAAgD;AACtF,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;;;;;;;;AASA,OAAO,MAAMC,uBAAuB,GAAG,CAACC,KAAuB,EAAEC,GAA2B,KAAsB;EAChH,MAAMC,KAAK,GAAGL,oBAAoB,EAAE;EACpC,MAAMM,QAAQ,GAAGL,kBAAkB,EAAE;EACrC,MAAMM,UAAU,GAAGT,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACC,OAAO,CAAC;EAClE,MAAMC,UAAU,GAAGZ,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACG,cAAc,CAAC;EACzE,MAAMC,QAAQ,GAAGd,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACK,SAAS,CAACC,aAAa,CAACT,KAAK,CAAC,CAAC;EACvF,MAAMU,QAAQ,GAAGjB,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACQ,SAAS,KAAK,cAAc,CAAC;EACrF,MAAMC,UAAU,GAAGnB,2BAA2B,CAACU,GAAG,IAAG;IACnD,IAAI,CAACF,QAAQ,IAAII,UAAU,IAAIF,GAAG,CAACK,SAAS,CAACC,aAAa,CAACT,KAAK,CAAC,EAAE;MACjE,OAAOG,GAAG,CAACU,mBAAmB;;IAGhC,OAAO,MAAM;EACf,CAAC,CAAC;EACF,MAAMC,SAAS,GAAGrB,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACK,SAAS,CAACM,SAAS,CAAC;EAE7E,MAAMC,OAAO,GAAG1B,gBAAgB,CAAE2B,CAAwC,IAAI;;IAC5E,IAAIX,UAAU,IAAI,CAACJ,QAAQ,EAAE;MAC3Ba,SAAS,CAACE,CAAC,EAAEhB,KAAK,CAAC;;IAGrB,WAAK,CAACe,OAAO,+CAAbjB,KAAK,EAAWkB,CAAC,CAAC;EACpB,CAAC,CAAC;EAEF,MAAMC,SAAS,GAAG5B,gBAAgB,CAAE2B,CAA2C,IAAI;;IACjF,IAAIX,UAAU,IAAI,CAACJ,QAAQ,IAAIe,CAAC,CAACE,GAAG,KAAK3B,KAAK,IAAI,CAACH,wBAAwB,CAAC4B,CAAC,CAACG,MAAqB,CAAC,EAAE;MACpG;MACAH,CAAC,CAACI,cAAc,EAAE;MAClBN,SAAS,CAACE,CAAC,EAAEhB,KAAK,CAAC;;IAGrB,WAAK,CAACiB,SAAS,+CAAfnB,KAAK,EAAakB,CAAC,CAAC;EACtB,CAAC,CAAC;EAEF,MAAMK,SAAS,GAAG7B,oBAAoB,CACpC;IACEoB,UAAU;IACV,eAAe,EAAEP,UAAU,GAAGE,QAAQ,GAAGe,SAAS;IAClD,GAAGxB,KAAK;IACRiB,OAAO;IACPE,SAAS;IACTM,QAAQ,EAAE,IAAI;IACdC,EAAE,EAAE,KAAK;IACTC,QAAQ,EAAEf,QAAQ,IAAI,CAACT,QAAQ,GAAG,CAAC,GAAGqB;GACvC,EACDvB,GAAG,CACJ;EAED,OAAO;IACL,GAAGsB,SAAS;IACZK,UAAU,EAAE;MACV,GAAGL,SAAS,CAACK,UAAU;MACvBC,aAAa,EAAEjC;KAChB;IACDiC,aAAa,EAAErC,gBAAgB,CAACQ,KAAK,CAAC6B,aAAa,EAAE;MAAEC,QAAQ,EAAEvB;IAAU,CAAE,CAAC;IAC9EwB,UAAU,EAAE/B,KAAK,CAACyB,QAAQ;IAC1BrB;GACD;AACH,CAAC","names":["isInteractiveHTMLElement","useEventCallback","resolveShorthand","Space","useTableRow_unstable","useDataGridContext_unstable","DataGridSelectionCell","useTableRowIdContext","useIsInTableHeader","useDataGridRow_unstable","props","ref","rowId","isHeader","columnDefs","ctx","columns","selectable","selectableRows","selected","selection","isRowSelected","tabbable","focusMode","appearance","selectionAppearance","toggleRow","onClick","e","onKeyDown","key","target","preventDefault","baseState","undefined","children","as","tabIndex","components","selectionCell","required","renderCell"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isInteractiveHTMLElement, useEventCallback, resolveShorthand } from '@fluentui/react-utilities';\nimport { Space } from '@fluentui/keyboard-keys';\nimport type { DataGridRowProps, DataGridRowState } from './DataGridRow.types';\nimport { useTableRow_unstable } from '../TableRow/useTableRow';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { DataGridSelectionCell } from '../DataGridSelectionCell/DataGridSelectionCell';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n\n/**\n * Create the state required to render DataGridRow.\n *\n * The returned state can be modified with hooks such as useDataGridRowStyles_unstable,\n * before being passed to renderDataGridRow_unstable.\n *\n * @param props - props from this instance of DataGridRow\n * @param ref - reference to root HTMLElement of DataGridRow\n */\nexport const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref<HTMLElement>): DataGridRowState => {\n const rowId = useTableRowIdContext();\n const isHeader = useIsInTableHeader();\n const columnDefs = useDataGridContext_unstable(ctx => ctx.columns);\n const selectable = useDataGridContext_unstable(ctx => ctx.selectableRows);\n const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId));\n const tabbable = useDataGridContext_unstable(ctx => ctx.focusMode === 'row_unstable');\n const appearance = useDataGridContext_unstable(ctx => {\n if (!isHeader && selectable && ctx.selection.isRowSelected(rowId)) {\n return ctx.selectionAppearance;\n }\n\n return 'none';\n });\n const toggleRow = useDataGridContext_unstable(ctx => ctx.selection.toggleRow);\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader) {\n toggleRow(e, rowId);\n }\n\n props.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLTableRowElement>) => {\n if (selectable && !isHeader && e.key === Space && !isInteractiveHTMLElement(e.target as HTMLElement)) {\n // stop scrolling\n e.preventDefault();\n toggleRow(e, rowId);\n }\n\n props.onKeyDown?.(e);\n });\n\n const baseState = useTableRow_unstable(\n {\n appearance,\n 'aria-selected': selectable ? selected : undefined,\n ...props,\n onClick,\n onKeyDown,\n children: null,\n as: 'div',\n tabIndex: tabbable && !isHeader ? 0 : undefined,\n },\n ref,\n );\n\n return {\n ...baseState,\n components: {\n ...baseState.components,\n selectionCell: DataGridSelectionCell,\n },\n selectionCell: resolveShorthand(props.selectionCell, { required: selectable }),\n renderCell: props.children,\n columnDefs,\n };\n};\n"]}
@@ -1,15 +1,18 @@
1
1
  import { mergeClasses } from '@griffel/react';
2
2
  import { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles';
3
3
  export const dataGridRowClassNames = {
4
- root: 'fui-DataGridRow'
4
+ root: 'fui-DataGridRow',
5
+ selectionCell: 'fui-DataGridRow__selectionCell'
5
6
  };
6
7
  /**
7
8
  * Apply styling to the DataGridRow slots based on the state
8
9
  */
9
-
10
10
  export const useDataGridRowStyles_unstable = state => {
11
11
  useTableRowStyles_unstable(state);
12
12
  state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);
13
+ if (state.selectionCell) {
14
+ state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);
15
+ }
13
16
  return state;
14
17
  };
15
18
  //# sourceMappingURL=useDataGridRowStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,QAA6B,gBAA7B;AAGA,SAAS,0BAAT,QAA2C,+BAA3C;AAEA,OAAO,MAAM,qBAAqB,GAAqC;EACrE,IAAI,EAAE;AAD+D,CAAhE;AAIP;;AAEG;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA8C;EACzF,0BAA0B,CAAC,KAAD,CAA1B;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,qBAAqB,CAAC,IAAvB,EAA6B,KAAK,CAAC,IAAN,CAAW,SAAxC,CAAnC;EAEA,OAAO,KAAP;AACD,CALM","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles';\n\nexport const dataGridRowClassNames: SlotClassNames<DataGridRowSlots> = {\n root: 'fui-DataGridRow',\n};\n\n/**\n * Apply styling to the DataGridRow slots based on the state\n */\nexport const useDataGridRowStyles_unstable = (state: DataGridRowState): DataGridRowState => {\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAG7C,SAASC,0BAA0B,QAAQ,+BAA+B;AAE1E,OAAO,MAAMC,qBAAqB,GAAqC;EACrEC,IAAI,EAAE,iBAAiB;EACvBC,aAAa,EAAE;CAChB;AAED;;;AAGA,OAAO,MAAMC,6BAA6B,GAAIC,KAAuB,IAAsB;EACzFL,0BAA0B,CAACK,KAAK,CAAC;EACjCA,KAAK,CAACH,IAAI,CAACI,SAAS,GAAGP,YAAY,CAACE,qBAAqB,CAACC,IAAI,EAAEG,KAAK,CAACH,IAAI,CAACI,SAAS,CAAC;EACrF,IAAID,KAAK,CAACF,aAAa,EAAE;IACvBE,KAAK,CAACF,aAAa,CAACG,SAAS,GAAGP,YAAY,CAACE,qBAAqB,CAACE,aAAa,EAAEE,KAAK,CAACF,aAAa,CAACG,SAAS,CAAC;;EAGlH,OAAOD,KAAK;AACd,CAAC","names":["mergeClasses","useTableRowStyles_unstable","dataGridRowClassNames","root","selectionCell","useDataGridRowStyles_unstable","state","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridRow/useDataGridRowStyles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridRowSlots, DataGridRowState } from './DataGridRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableRowStyles_unstable } from '../TableRow/useTableRowStyles';\n\nexport const dataGridRowClassNames: SlotClassNames<DataGridRowSlots> = {\n root: 'fui-DataGridRow',\n selectionCell: 'fui-DataGridRow__selectionCell',\n};\n\n/**\n * Apply styling to the DataGridRow slots based on the state\n */\nexport const useDataGridRowStyles_unstable = (state: DataGridRowState): DataGridRowState => {\n useTableRowStyles_unstable(state);\n state.root.className = mergeClasses(dataGridRowClassNames.root, state.root.className);\n if (state.selectionCell) {\n state.selectionCell.className = mergeClasses(dataGridRowClassNames.selectionCell, state.selectionCell.className);\n }\n\n return state;\n};\n"]}
@@ -3,9 +3,8 @@ import { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';
3
3
  import { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';
4
4
  import { useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles';
5
5
  /**
6
- * DataGridSelectionCell component - TODO: add more docs
6
+ * DataGridSelectionCell component
7
7
  */
8
-
9
8
  export const DataGridSelectionCell = /*#__PURE__*/React.forwardRef((props, ref) => {
10
9
  const state = useDataGridSelectionCell_unstable(props, ref);
11
10
  useDataGridSelectionCellStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/DataGridSelectionCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iCAAT,QAAkD,4BAAlD;AACA,SAAS,oCAAT,QAAqD,+BAArD;AACA,SAAS,uCAAT,QAAwD,kCAAxD;AAIA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,gBAAoD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpH,MAAM,KAAK,GAAG,iCAAiC,CAAC,KAAD,EAAQ,GAAR,CAA/C;EAEA,uCAAuC,CAAC,KAAD,CAAvC;EACA,OAAO,oCAAoC,CAAC,KAAD,CAA3C;AACD,CALqF,CAA/E;AAOP,qBAAqB,CAAC,WAAtB,GAAoC,uBAApC","sourcesContent":["import * as React from 'react';\nimport { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';\nimport { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';\nimport { useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles';\nimport type { DataGridSelectionCellProps } from './DataGridSelectionCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DataGridSelectionCell component - TODO: add more docs\n */\nexport const DataGridSelectionCell: ForwardRefComponent<DataGridSelectionCellProps> = React.forwardRef((props, ref) => {\n const state = useDataGridSelectionCell_unstable(props, ref);\n\n useDataGridSelectionCellStyles_unstable(state);\n return renderDataGridSelectionCell_unstable(state);\n});\n\nDataGridSelectionCell.displayName = 'DataGridSelectionCell';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,iCAAiC,QAAQ,4BAA4B;AAC9E,SAASC,oCAAoC,QAAQ,+BAA+B;AACpF,SAASC,uCAAuC,QAAQ,kCAAkC;AAI1F;;;AAGA,OAAO,MAAMC,qBAAqB,gBAAoDJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpH,MAAMC,KAAK,GAAGP,iCAAiC,CAACK,KAAK,EAAEC,GAAG,CAAC;EAE3DJ,uCAAuC,CAACK,KAAK,CAAC;EAC9C,OAAON,oCAAoC,CAACM,KAAK,CAAC;AACpD,CAAC,CAAC;AAEFJ,qBAAqB,CAACK,WAAW,GAAG,uBAAuB","names":["React","useDataGridSelectionCell_unstable","renderDataGridSelectionCell_unstable","useDataGridSelectionCellStyles_unstable","DataGridSelectionCell","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/DataGridSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDataGridSelectionCell_unstable } from './useDataGridSelectionCell';\nimport { renderDataGridSelectionCell_unstable } from './renderDataGridSelectionCell';\nimport { useDataGridSelectionCellStyles_unstable } from './useDataGridSelectionCellStyles';\nimport type { DataGridSelectionCellProps } from './DataGridSelectionCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * DataGridSelectionCell component\n */\nexport const DataGridSelectionCell: ForwardRefComponent<DataGridSelectionCellProps> = React.forwardRef((props, ref) => {\n const state = useDataGridSelectionCell_unstable(props, ref);\n\n useDataGridSelectionCellStyles_unstable(state);\n return renderDataGridSelectionCell_unstable(state);\n});\n\nDataGridSelectionCell.displayName = 'DataGridSelectionCell';\n"]}
@@ -2,7 +2,6 @@ import { renderTableSelectionCell_unstable } from '../TableSelectionCell/renderT
2
2
  /**
3
3
  * Render the final JSX of DataGridSelectionCell
4
4
  */
5
-
6
5
  export const renderDataGridSelectionCell_unstable = state => {
7
6
  return renderTableSelectionCell_unstable(state);
8
7
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/renderDataGridSelectionCell.tsx"],"names":[],"mappings":"AACA,SAAS,iCAAT,QAAkD,gDAAlD;AAEA;;AAEG;;AACH,OAAO,MAAM,oCAAoC,GAAI,KAAD,IAAsC;EACxF,OAAO,iCAAiC,CAAC,KAAD,CAAxC;AACD,CAFM","sourcesContent":["import type { DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport { renderTableSelectionCell_unstable } from '../TableSelectionCell/renderTableSelectionCell';\n\n/**\n * Render the final JSX of DataGridSelectionCell\n */\nexport const renderDataGridSelectionCell_unstable = (state: DataGridSelectionCellState) => {\n return renderTableSelectionCell_unstable(state);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,iCAAiC,QAAQ,gDAAgD;AAElG;;;AAGA,OAAO,MAAMC,oCAAoC,GAAIC,KAAiC,IAAI;EACxF,OAAOF,iCAAiC,CAACE,KAAK,CAAC;AACjD,CAAC","names":["renderTableSelectionCell_unstable","renderDataGridSelectionCell_unstable","state"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/renderDataGridSelectionCell.tsx"],"sourcesContent":["import type { DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport { renderTableSelectionCell_unstable } from '../TableSelectionCell/renderTableSelectionCell';\n\n/**\n * Render the final JSX of DataGridSelectionCell\n */\nexport const renderDataGridSelectionCell_unstable = (state: DataGridSelectionCellState) => {\n return renderTableSelectionCell_unstable(state);\n};\n"]}
@@ -1,3 +1,7 @@
1
+ import { useEventCallback } from '@fluentui/react-utilities';
2
+ import { useDataGridContext_unstable } from '../../contexts/dataGridContext';
3
+ import { useTableRowIdContext } from '../../contexts/rowIdContext';
4
+ import { useIsInTableHeader } from '../../contexts/tableHeaderContext';
1
5
  import { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';
2
6
  /**
3
7
  * Create the state required to render DataGridSelectionCell.
@@ -8,10 +12,36 @@ import { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSe
8
12
  * @param props - props from this instance of DataGridSelectionCell
9
13
  * @param ref - reference to root HTMLElement of DataGridSelectionCell
10
14
  */
11
-
12
15
  export const useDataGridSelectionCell_unstable = (props, ref) => {
13
- return useTableSelectionCell_unstable({ ...props,
14
- as: 'div'
16
+ const isHeader = useIsInTableHeader();
17
+ const rowId = useTableRowIdContext();
18
+ const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);
19
+ const checked = useDataGridContext_unstable(ctx => {
20
+ if (isHeader && ctx.selection.selectionMode === 'multiselect') {
21
+ return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;
22
+ }
23
+ return ctx.selection.isRowSelected(rowId);
24
+ });
25
+ const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);
26
+ const type = useDataGridContext_unstable(ctx => ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio');
27
+ const onClick = useEventCallback(e => {
28
+ var _a;
29
+ if (isHeader) {
30
+ toggleAllRows(e);
31
+ }
32
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
33
+ });
34
+ return useTableSelectionCell_unstable({
35
+ as: 'div',
36
+ role: 'gridcell',
37
+ checked,
38
+ type,
39
+ hidden: isHeader && type === 'radio',
40
+ 'aria-checked': isHeader ? checked : undefined,
41
+ 'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,
42
+ subtle,
43
+ ...props,
44
+ onClick
15
45
  }, ref);
16
46
  };
17
47
  //# sourceMappingURL=useDataGridSelectionCell.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"names":[],"mappings":"AACA,SAAS,8BAAT,QAA+C,6CAA/C;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,iCAAiC,GAAG,CAC/C,KAD+C,EAE/C,GAF+C,KAGjB;EAC9B,OAAO,8BAA8B,CAAC,EAAE,GAAG,KAAL;IAAY,EAAE,EAAE;EAAhB,CAAD,EAA0B,GAA1B,CAArC;AACD,CALM","sourcesContent":["import * as React from 'react';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n return useTableSelectionCell_unstable({ ...props, as: 'div' }, ref);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,gBAAgB,QAAQ,2BAA2B;AAC5D,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,8BAA8B,QAAQ,6CAA6C;AAG5F;;;;;;;;;AASA,OAAO,MAAMC,iCAAiC,GAAG,CAC/CC,KAAiC,EACjCC,GAA2B,KACG;EAC9B,MAAMC,QAAQ,GAAGL,kBAAkB,EAAE;EACrC,MAAMM,KAAK,GAAGP,oBAAoB,EAAE;EACpC,MAAMQ,MAAM,GAAGT,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACC,eAAe,CAAC;EACtE,MAAMC,OAAO,GAAGZ,2BAA2B,CAACU,GAAG,IAAG;IAChD,IAAIH,QAAQ,IAAIG,GAAG,CAACG,SAAS,CAACC,aAAa,KAAK,aAAa,EAAE;MAC7D,OAAOJ,GAAG,CAACG,SAAS,CAACE,eAAe,GAAG,IAAI,GAAGL,GAAG,CAACG,SAAS,CAACG,gBAAgB,GAAG,OAAO,GAAG,KAAK;;IAGhG,OAAON,GAAG,CAACG,SAAS,CAACI,aAAa,CAACT,KAAK,CAAC;EAC3C,CAAC,CAAC;EAEF,MAAMU,aAAa,GAAGlB,2BAA2B,CAACU,GAAG,IAAIA,GAAG,CAACG,SAAS,CAACK,aAAa,CAAC;EACrF,MAAMC,IAAI,GAAGnB,2BAA2B,CAACU,GAAG,IAC1CA,GAAG,CAACG,SAAS,CAACC,aAAa,KAAK,aAAa,GAAG,UAAU,GAAG,OAAO,CACrE;EAED,MAAMM,OAAO,GAAGrB,gBAAgB,CAAEsB,CAAyC,IAAI;;IAC7E,IAAId,QAAQ,EAAE;MACZW,aAAa,CAACG,CAAC,CAAC;;IAGlB,WAAK,CAACD,OAAO,+CAAbf,KAAK,EAAWgB,CAAC,CAAC;EACpB,CAAC,CAAC;EAEF,OAAOlB,8BAA8B,CACnC;IACEmB,EAAE,EAAE,KAAK;IACTC,IAAI,EAAE,UAAU;IAChBX,OAAO;IACPO,IAAI;IACJK,MAAM,EAAEjB,QAAQ,IAAIY,IAAI,KAAK,OAAO;IACpC,cAAc,EAAEZ,QAAQ,GAAGK,OAAO,GAAGa,SAAS;IAC9C,eAAe,EAAElB,QAAQ,IAAIK,OAAO,KAAK,OAAO,GAAGa,SAAS,GAAGb,OAAO;IACtEH,MAAM;IACN,GAAGJ,KAAK;IACRe;GACD,EACDd,GAAG,CACJ;AACH,CAAC","names":["useEventCallback","useDataGridContext_unstable","useTableRowIdContext","useIsInTableHeader","useTableSelectionCell_unstable","useDataGridSelectionCell_unstable","props","ref","isHeader","rowId","subtle","ctx","subtleSelection","checked","selection","selectionMode","allRowsSelected","someRowsSelected","isRowSelected","toggleAllRows","type","onClick","e","as","role","hidden","undefined"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCell.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useDataGridContext_unstable } from '../../contexts/dataGridContext';\nimport { useTableRowIdContext } from '../../contexts/rowIdContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\nimport { useTableSelectionCell_unstable } from '../TableSelectionCell/useTableSelectionCell';\nimport type { DataGridSelectionCellProps, DataGridSelectionCellState } from './DataGridSelectionCell.types';\n\n/**\n * Create the state required to render DataGridSelectionCell.\n *\n * The returned state can be modified with hooks such as useDataGridSelectionCellStyles_unstable,\n * before being passed to renderDataGridSelectionCell_unstable.\n *\n * @param props - props from this instance of DataGridSelectionCell\n * @param ref - reference to root HTMLElement of DataGridSelectionCell\n */\nexport const useDataGridSelectionCell_unstable = (\n props: DataGridSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): DataGridSelectionCellState => {\n const isHeader = useIsInTableHeader();\n const rowId = useTableRowIdContext();\n const subtle = useDataGridContext_unstable(ctx => ctx.subtleSelection);\n const checked = useDataGridContext_unstable(ctx => {\n if (isHeader && ctx.selection.selectionMode === 'multiselect') {\n return ctx.selection.allRowsSelected ? true : ctx.selection.someRowsSelected ? 'mixed' : false;\n }\n\n return ctx.selection.isRowSelected(rowId);\n });\n\n const toggleAllRows = useDataGridContext_unstable(ctx => ctx.selection.toggleAllRows);\n const type = useDataGridContext_unstable(ctx =>\n ctx.selection.selectionMode === 'multiselect' ? 'checkbox' : 'radio',\n );\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLTableCellElement>) => {\n if (isHeader) {\n toggleAllRows(e);\n }\n\n props.onClick?.(e);\n });\n\n return useTableSelectionCell_unstable(\n {\n as: 'div',\n role: 'gridcell',\n checked,\n type,\n hidden: isHeader && type === 'radio',\n 'aria-checked': isHeader ? checked : undefined,\n 'aria-selected': isHeader || checked === 'mixed' ? undefined : checked,\n subtle,\n ...props,\n onClick,\n },\n ref,\n );\n};\n"]}
@@ -8,19 +8,15 @@ export const dataGridSelectionCellClassNames = {
8
8
  /**
9
9
  * Apply styling to the DataGridSelectionCell slots based on the state
10
10
  */
11
-
12
11
  export const useDataGridSelectionCellStyles_unstable = state => {
13
12
  useTableSelectionCellStyles_unstable(state);
14
13
  state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);
15
-
16
14
  if (state.checkboxIndicator) {
17
15
  state.checkboxIndicator.className = mergeClasses(dataGridSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);
18
16
  }
19
-
20
17
  if (state.radioIndicator) {
21
18
  state.radioIndicator.className = mergeClasses(dataGridSelectionCellClassNames.radioIndicator, state.radioIndicator.className);
22
19
  }
23
-
24
20
  return state;
25
21
  };
26
22
  //# sourceMappingURL=useDataGridSelectionCellStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCellStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,QAA6B,gBAA7B;AAGA,SAAS,oCAAT,QAAqD,mDAArD;AAEA,OAAO,MAAM,+BAA+B,GAA+C;EACzF,IAAI,EAAE,2BADmF;EAEzF,iBAAiB,EAAE,8CAFsE;EAGzF,cAAc,EAAE;AAHyE,CAApF;AAMP;;AAEG;;AACH,OAAO,MAAM,uCAAuC,GAClD,KADqD,IAEvB;EAC9B,oCAAoC,CAAC,KAAD,CAApC;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,+BAA+B,CAAC,IAAjC,EAAuC,KAAK,CAAC,IAAN,CAAW,SAAlD,CAAnC;;EAEA,IAAI,KAAK,CAAC,iBAAV,EAA6B;IAC3B,KAAK,CAAC,iBAAN,CAAwB,SAAxB,GAAoC,YAAY,CAC9C,+BAA+B,CAAC,iBADc,EAE9C,KAAK,CAAC,iBAAN,CAAwB,SAFsB,CAAhD;EAID;;EAED,IAAI,KAAK,CAAC,cAAV,EAA0B;IACxB,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,YAAY,CAC3C,+BAA+B,CAAC,cADW,EAE3C,KAAK,CAAC,cAAN,CAAqB,SAFsB,CAA7C;EAID;;EAED,OAAO,KAAP;AACD,CArBM","sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridSelectionCellSlots, DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles';\n\nexport const dataGridSelectionCellClassNames: SlotClassNames<DataGridSelectionCellSlots> = {\n root: 'fui-DataGridSelectionCell',\n checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-DataGridSelectionCell__radioIndicator',\n};\n\n/**\n * Apply styling to the DataGridSelectionCell slots based on the state\n */\nexport const useDataGridSelectionCellStyles_unstable = (\n state: DataGridSelectionCellState,\n): DataGridSelectionCellState => {\n useTableSelectionCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);\n\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,SAASA,YAAY,QAAQ,gBAAgB;AAG7C,SAASC,oCAAoC,QAAQ,mDAAmD;AAExG,OAAO,MAAMC,+BAA+B,GAA+C;EACzFC,IAAI,EAAE,2BAA2B;EACjCC,iBAAiB,EAAE,8CAA8C;EACjEC,cAAc,EAAE;CACjB;AAED;;;AAGA,OAAO,MAAMC,uCAAuC,GAClDC,KAAiC,IACH;EAC9BN,oCAAoC,CAACM,KAAK,CAAC;EAC3CA,KAAK,CAACJ,IAAI,CAACK,SAAS,GAAGR,YAAY,CAACE,+BAA+B,CAACC,IAAI,EAAEI,KAAK,CAACJ,IAAI,CAACK,SAAS,CAAC;EAE/F,IAAID,KAAK,CAACH,iBAAiB,EAAE;IAC3BG,KAAK,CAACH,iBAAiB,CAACI,SAAS,GAAGR,YAAY,CAC9CE,+BAA+B,CAACE,iBAAiB,EACjDG,KAAK,CAACH,iBAAiB,CAACI,SAAS,CAClC;;EAGH,IAAID,KAAK,CAACF,cAAc,EAAE;IACxBE,KAAK,CAACF,cAAc,CAACG,SAAS,GAAGR,YAAY,CAC3CE,+BAA+B,CAACG,cAAc,EAC9CE,KAAK,CAACF,cAAc,CAACG,SAAS,CAC/B;;EAGH,OAAOD,KAAK;AACd,CAAC","names":["mergeClasses","useTableSelectionCellStyles_unstable","dataGridSelectionCellClassNames","root","checkboxIndicator","radioIndicator","useDataGridSelectionCellStyles_unstable","state","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/DataGridSelectionCell/useDataGridSelectionCellStyles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { DataGridSelectionCellSlots, DataGridSelectionCellState } from './DataGridSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useTableSelectionCellStyles_unstable } from '../TableSelectionCell/useTableSelectionCellStyles';\n\nexport const dataGridSelectionCellClassNames: SlotClassNames<DataGridSelectionCellSlots> = {\n root: 'fui-DataGridSelectionCell',\n checkboxIndicator: 'fui-DataGridSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-DataGridSelectionCell__radioIndicator',\n};\n\n/**\n * Apply styling to the DataGridSelectionCell slots based on the state\n */\nexport const useDataGridSelectionCellStyles_unstable = (\n state: DataGridSelectionCellState,\n): DataGridSelectionCellState => {\n useTableSelectionCellStyles_unstable(state);\n state.root.className = mergeClasses(dataGridSelectionCellClassNames.root, state.root.className);\n\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n dataGridSelectionCellClassNames.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"]}
@@ -4,9 +4,8 @@ import { renderTable_unstable } from './renderTable';
4
4
  import { useTableStyles_unstable } from './useTableStyles';
5
5
  import { useTableContextValues_unstable } from './useTableContextValues';
6
6
  /**
7
- * Table component - TODO: add more docs
7
+ * Table component
8
8
  */
9
-
10
9
  export const Table = /*#__PURE__*/React.forwardRef((props, ref) => {
11
10
  const state = useTable_unstable(props, ref);
12
11
  useTableStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,YAAlC;AACA,SAAS,oBAAT,QAAqC,eAArC;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AAGA,SAAS,8BAAT,QAA+C,yBAA/C;AAEA;;AAEG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpF,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;EAEA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,EAAQ,8BAA8B,CAAC,KAAD,CAAtC,CAA3B;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\nimport { useTable_unstable } from './useTable';\nimport { renderTable_unstable } from './renderTable';\nimport { useTableStyles_unstable } from './useTableStyles';\nimport type { TableProps } from './Table.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTableContextValues_unstable } from './useTableContextValues';\n\n/**\n * Table component - TODO: add more docs\n */\nexport const Table: ForwardRefComponent<TableProps> = React.forwardRef((props, ref) => {\n const state = useTable_unstable(props, ref);\n\n useTableStyles_unstable(state);\n return renderTable_unstable(state, useTableContextValues_unstable(state));\n});\n\nTable.displayName = 'Table';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAG1D,SAASC,8BAA8B,QAAQ,yBAAyB;AAExE;;;AAGA,OAAO,MAAMC,KAAK,gBAAoCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGR,iBAAiB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAE3CL,uBAAuB,CAACM,KAAK,CAAC;EAC9B,OAAOP,oBAAoB,CAACO,KAAK,EAAEL,8BAA8B,CAACK,KAAK,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEFJ,KAAK,CAACK,WAAW,GAAG,OAAO","names":["React","useTable_unstable","renderTable_unstable","useTableStyles_unstable","useTableContextValues_unstable","Table","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/Table.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTable_unstable } from './useTable';\nimport { renderTable_unstable } from './renderTable';\nimport { useTableStyles_unstable } from './useTableStyles';\nimport type { TableProps } from './Table.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTableContextValues_unstable } from './useTableContextValues';\n\n/**\n * Table component\n */\nexport const Table: ForwardRefComponent<TableProps> = React.forwardRef((props, ref) => {\n const state = useTable_unstable(props, ref);\n\n useTableStyles_unstable(state);\n return renderTable_unstable(state, useTableContextValues_unstable(state));\n});\n\nTable.displayName = 'Table';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/Table.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableSlots = {\n root: Slot<'table', 'div'>;\n};\n\nexport type TableContextValue = {\n /**\n * Affects the sizes of all table subcomponents\n * @default medium\n */\n size: 'small' | 'smaller' | 'medium';\n\n /**\n * Render all table elements as divs intead of semantic table elements\n * Using divs no longer uses `display: table` layout but `display: flex`\n */\n noNativeElements: boolean;\n\n /**\n * Whether the table is sortable\n */\n sortable: boolean;\n};\n\nexport type SortDirection = 'ascending' | 'descending';\n\nexport type TableContextValues = {\n table: TableContextValue;\n};\n\n/**\n * Table Props\n */\nexport type TableProps = ComponentProps<TableSlots> & Partial<TableContextValue>;\n\n/**\n * State used in rendering Table\n */\nexport type TableState = ComponentState<TableSlots> &\n Pick<Required<TableProps>, 'size' | 'noNativeElements'> &\n TableContextValue;\n"]}
1
+ {"version":3,"file":"Table.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/Table.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type TableSlots = {\n root: Slot<'table', 'div'>;\n};\n\nexport type TableContextValue = {\n /**\n * Affects the sizes of all table subcomponents\n * @default medium\n */\n size: 'extra-small' | 'small' | 'medium';\n\n /**\n * Render all table elements as divs instead of semantic table elements\n * Using divs no longer uses `display: table` layout but `display: flex`\n * @default false\n */\n noNativeElements: boolean;\n\n /**\n * Whether the table is sortable\n * @default false\n */\n sortable: boolean;\n};\n\nexport type SortDirection = 'ascending' | 'descending';\n\nexport type TableContextValues = {\n table: TableContextValue;\n};\n\n/**\n * Table Props\n */\nexport type TableProps = ComponentProps<TableSlots> & Partial<TableContextValue>;\n\n/**\n * State used in rendering Table\n */\nexport type TableState = ComponentState<TableSlots> &\n Pick<Required<TableProps>, 'size' | 'noNativeElements'> &\n TableContextValue;\n"]}
@@ -4,7 +4,6 @@ import { TableContextProvider } from '../../contexts/tableContext';
4
4
  /**
5
5
  * Render the final JSX of Table
6
6
  */
7
-
8
7
  export const renderTable_unstable = (state, contextValues) => {
9
8
  const {
10
9
  slots,
@@ -12,7 +11,8 @@ export const renderTable_unstable = (state, contextValues) => {
12
11
  } = getSlots(state);
13
12
  return /*#__PURE__*/React.createElement(TableContextProvider, {
14
13
  value: contextValues.table
15
- }, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
14
+ }, /*#__PURE__*/React.createElement(slots.root, {
15
+ ...slotProps.root
16
16
  }));
17
17
  };
18
18
  //# sourceMappingURL=renderTable.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/Table/renderTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,oBAAT,QAAqC,6BAArC;AAEA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAG,CAAC,KAAD,EAAoB,aAApB,KAAyD;EAC3F,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAa,KAAb,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,oBAAD,EAAqB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAArB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableState, TableSlots, TableContextValues } from './Table.types';\nimport { TableContextProvider } from '../../contexts/tableContext';\n\n/**\n * Render the final JSX of Table\n */\nexport const renderTable_unstable = (state: TableState, contextValues: TableContextValues) => {\n const { slots, slotProps } = getSlots<TableSlots>(state);\n\n return (\n <TableContextProvider value={contextValues.table}>\n <slots.root {...slotProps.root} />\n </TableContextProvider>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,oBAAoB,QAAQ,6BAA6B;AAElE;;;AAGA,OAAO,MAAMC,oBAAoB,GAAG,CAACC,KAAiB,EAAEC,aAAiC,KAAI;EAC3F,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAaG,KAAK,CAAC;EAExD,oBACEJ,oBAACE,oBAAoB;IAACM,KAAK,EAAEH,aAAa,CAACI;EAAK,gBAC9CT,oBAACM,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,EAAI,CACb;AAE3B,CAAC","names":["React","getSlots","TableContextProvider","renderTable_unstable","state","contextValues","slots","slotProps","value","table","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/renderTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableState, TableSlots, TableContextValues } from './Table.types';\nimport { TableContextProvider } from '../../contexts/tableContext';\n\n/**\n * Render the final JSX of Table\n */\nexport const renderTable_unstable = (state: TableState, contextValues: TableContextValues) => {\n const { slots, slotProps } = getSlots<TableSlots>(state);\n\n return (\n <TableContextProvider value={contextValues.table}>\n <slots.root {...slotProps.root} />\n </TableContextProvider>\n );\n};\n"]}
@@ -8,10 +8,8 @@ import { getNativeElementProps } from '@fluentui/react-utilities';
8
8
  * @param props - props from this instance of Table
9
9
  * @param ref - reference to root HTMLElement of Table
10
10
  */
11
-
12
11
  export const useTable_unstable = (props, ref) => {
13
12
  var _a, _b, _c, _d;
14
-
15
13
  const rootComponent = ((_a = props.as) !== null && _a !== void 0 ? _a : props.noNativeElements) ? 'div' : 'table';
16
14
  return {
17
15
  components: {
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/Table/useTable.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;;;EAC9F,MAAM,aAAa,GAAG,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,EAAN,MAAQ,IAAR,IAAQ,EAAA,KAAA,KAAA,CAAR,GAAQ,EAAR,GAAY,KAAK,CAAC,gBAAlB,IAAqC,KAArC,GAA6C,OAAnE;EAEA,OAAO;IACL,UAAU,EAAE;MACV,IAAI,EAAE;IADI,CADP;IAIL,IAAI,EAAE,qBAAqB,CAAC,aAAD,EAAgB;MACzC,GADyC;MAEzC,IAAI,EAAE,aAAa,KAAK,KAAlB,GAA0B,OAA1B,GAAoC,SAFD;MAGzC,GAAG;IAHsC,CAAhB,CAJtB;IASL,IAAI,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,IAAN,MAAU,IAAV,IAAU,EAAA,KAAA,KAAA,CAAV,GAAU,EAAV,GAAc,QATf;IAUL,gBAAgB,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,gBAAN,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,EAAtB,GAA0B,KAVvC;IAWL,QAAQ,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,QAAN,MAAc,IAAd,IAAc,EAAA,KAAA,KAAA,CAAd,GAAc,EAAd,GAAkB;EAXvB,CAAP;AAaD,CAhBM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableProps, TableState } from './Table.types';\n\n/**\n * Create the state required to render Table.\n *\n * The returned state can be modified with hooks such as useTableStyles_unstable,\n * before being passed to renderTable_unstable.\n *\n * @param props - props from this instance of Table\n * @param ref - reference to root HTMLElement of Table\n */\nexport const useTable_unstable = (props: TableProps, ref: React.Ref<HTMLElement>): TableState => {\n const rootComponent = props.as ?? props.noNativeElements ? 'div' : 'table';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'table' : undefined,\n ...props,\n }),\n size: props.size ?? 'medium',\n noNativeElements: props.noNativeElements ?? false,\n sortable: props.sortable ?? false,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,qBAAqB,QAAQ,2BAA2B;AAGjE;;;;;;;;;AASA,OAAO,MAAMC,iBAAiB,GAAG,CAACC,KAAiB,EAAEC,GAA2B,KAAgB;;EAC9F,MAAMC,aAAa,GAAG,YAAK,CAACC,EAAE,mCAAIH,KAAK,CAACI,gBAAgB,IAAG,KAAK,GAAG,OAAO;EAE1E,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAEJ;KACP;IACDI,IAAI,EAAER,qBAAqB,CAACI,aAAa,EAAE;MACzCD,GAAG;MACHM,IAAI,EAAEL,aAAa,KAAK,KAAK,GAAG,OAAO,GAAGM,SAAS;MACnD,GAAGR;KACJ,CAAC;IACFS,IAAI,EAAE,WAAK,CAACA,IAAI,mCAAI,QAAQ;IAC5BL,gBAAgB,EAAE,WAAK,CAACA,gBAAgB,mCAAI,KAAK;IACjDM,QAAQ,EAAE,WAAK,CAACA,QAAQ,mCAAI;GAC7B;AACH,CAAC","names":["getNativeElementProps","useTable_unstable","props","ref","rootComponent","as","noNativeElements","components","root","role","undefined","size","sortable"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/useTable.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { TableProps, TableState } from './Table.types';\n\n/**\n * Create the state required to render Table.\n *\n * The returned state can be modified with hooks such as useTableStyles_unstable,\n * before being passed to renderTable_unstable.\n *\n * @param props - props from this instance of Table\n * @param ref - reference to root HTMLElement of Table\n */\nexport const useTable_unstable = (props: TableProps, ref: React.Ref<HTMLElement>): TableState => {\n const rootComponent = props.as ?? props.noNativeElements ? 'div' : 'table';\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref,\n role: rootComponent === 'div' ? 'table' : undefined,\n ...props,\n }),\n size: props.size ?? 'medium',\n noNativeElements: props.noNativeElements ?? false,\n sortable: props.sortable ?? false,\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/Table/useTableContextValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,OAAM,SAAU,8BAAV,CAAyC,KAAzC,EAA0D;EAC9D,MAAM;IAAE,IAAF;IAAQ,gBAAR;IAA0B;EAA1B,IAAuC,KAA7C;EAEA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAN,CACnB,OAAO;IACL,gBADK;IAEL,IAFK;IAGL;EAHK,CAAP,CADmB,EAMnB,CAAC,gBAAD,EAAmB,IAAnB,EAAyB,QAAzB,CANmB,CAArB;EASA,OAAO;IACL,KAAK,EAAE;EADF,CAAP;AAGD","sourcesContent":["import * as React from 'react';\nimport { TableContextValues, TableState } from './Table.types';\n\nexport function useTableContextValues_unstable(state: TableState): TableContextValues {\n const { size, noNativeElements, sortable } = state;\n\n const tableContext = React.useMemo(\n () => ({\n noNativeElements,\n size,\n sortable,\n }),\n [noNativeElements, size, sortable],\n );\n\n return {\n table: tableContext,\n };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,OAAM,SAAUC,8BAA8B,CAACC,KAAiB;EAC9D,MAAM;IAAEC,IAAI;IAAEC,gBAAgB;IAAEC;EAAQ,CAAE,GAAGH,KAAK;EAElD,MAAMI,YAAY,GAAGN,KAAK,CAACO,OAAO,CAChC,OAAO;IACLH,gBAAgB;IAChBD,IAAI;IACJE;GACD,CAAC,EACF,CAACD,gBAAgB,EAAED,IAAI,EAAEE,QAAQ,CAAC,CACnC;EAED,OAAO;IACLG,KAAK,EAAEF;GACR;AACH","names":["React","useTableContextValues_unstable","state","size","noNativeElements","sortable","tableContext","useMemo","table"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/useTableContextValues.ts"],"sourcesContent":["import * as React from 'react';\nimport { TableContextValues, TableState } from './Table.types';\n\nexport function useTableContextValues_unstable(state: TableState): TableContextValues {\n const { size, noNativeElements, sortable } = state;\n\n const tableContext = React.useMemo(\n () => ({\n noNativeElements,\n size,\n sortable,\n }),\n [noNativeElements, size, sortable],\n );\n\n return {\n table: tableContext,\n };\n}\n"]}
@@ -4,43 +4,37 @@ export const tableClassName = 'fui-Table';
4
4
  export const tableClassNames = {
5
5
  root: 'fui-Table'
6
6
  };
7
-
8
7
  const useTableLayoutStyles = /*#__PURE__*/__styles({
9
- "root": {
10
- "mc9l5x": "f1w4nmp0",
11
- "ha4doy": "fmrv4ls",
12
- "a9b677": "fly5x3f",
13
- "B73mfa3": "f14m3nip"
8
+ root: {
9
+ mc9l5x: "f1w4nmp0",
10
+ ha4doy: "fmrv4ls",
11
+ a9b677: "fly5x3f",
12
+ B73mfa3: "f14m3nip"
14
13
  }
15
14
  }, {
16
- "d": [".f1w4nmp0{display:table;}", ".fmrv4ls{vertical-align:middle;}", ".fly5x3f{width:100%;}", ".f14m3nip{table-layout:fixed;}"]
15
+ d: [".f1w4nmp0{display:table;}", ".fmrv4ls{vertical-align:middle;}", ".fly5x3f{width:100%;}", ".f14m3nip{table-layout:fixed;}"]
17
16
  });
18
-
19
17
  const useFlexLayoutStyles = /*#__PURE__*/__styles({
20
- "root": {
21
- "mc9l5x": "ftgm304"
18
+ root: {
19
+ mc9l5x: "ftgm304"
22
20
  }
23
21
  }, {
24
- "d": [".ftgm304{display:block;}"]
22
+ d: [".ftgm304{display:block;}"]
25
23
  });
26
24
  /**
27
25
  * Styles for the root slot
28
26
  */
29
-
30
-
31
27
  const useStyles = /*#__PURE__*/__styles({
32
- "root": {
33
- "po53p8": "fgkb47j",
34
- "De3pzq": "fhovq9v"
28
+ root: {
29
+ po53p8: "fgkb47j",
30
+ De3pzq: "fhovq9v"
35
31
  }
36
32
  }, {
37
- "d": [".fgkb47j{border-collapse:collapse;}", ".fhovq9v{background-color:var(--colorSubtleBackground);}"]
33
+ d: [".fgkb47j{border-collapse:collapse;}", ".fhovq9v{background-color:var(--colorSubtleBackground);}"]
38
34
  });
39
35
  /**
40
36
  * Apply styling to the Table slots based on the state
41
37
  */
42
-
43
-
44
38
  export const useTableStyles_unstable = state => {
45
39
  const styles = useStyles();
46
40
  const layoutStyles = {
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/Table/useTableStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA,OAAO,MAAM,cAAc,GAAG,WAAvB;AACP,OAAO,MAAM,eAAe,GAA+B;EACzD,IAAI,EAAE;AADmD,CAApD;;AAIP,MAAM,oBAAoB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AASA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAMA;;AAEG;;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAOA;;AAEG;;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAkC;EACvE,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,oBAAoB,EADR;IAEnB,IAAI,EAAE,mBAAmB;EAFN,CAArB;EAIA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAHpC,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;EAOA,OAAO,KAAP;AACD,CAdM","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableSlots, TableState } from './Table.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableClassName = 'fui-Table';\nexport const tableClassNames: SlotClassNames<TableSlots> = {\n root: 'fui-Table',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table',\n verticalAlign: 'middle',\n width: '100%',\n tableLayout: 'fixed',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'block',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n borderCollapse: 'collapse',\n backgroundColor: tokens.colorSubtleBackground,\n },\n});\n\n/**\n * Apply styling to the Table slots based on the state\n */\nexport const useTableStyles_unstable = (state: TableState): TableState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableClassName,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,mBAAqBA,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAI9C,OAAO,MAAMC,cAAc,GAAG,WAAW;AACzC,OAAO,MAAMC,eAAe,GAA+B;EACzDC,IAAI,EAAE;CACP;AAED,MAAMC,oBAAoB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAO3B;AAEF,MAAMC,mBAAmB,gBAAG;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAI1B;AAEF;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAKhB;AAEF;;;AAGA,OAAO,MAAMC,uBAAuB,GAAIC,KAAiB,IAAgB;EACvE,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAMI,YAAY,GAAG;IACnBC,KAAK,EAAEP,oBAAoB,EAAE;IAC7BQ,IAAI,EAAEP,mBAAmB;GAC1B;EACDG,KAAK,CAACL,IAAI,CAACU,SAAS,GAAGd,YAAY,CACjCE,cAAc,EACdQ,MAAM,CAACN,IAAI,EACXK,KAAK,CAACM,gBAAgB,GAAGJ,YAAY,CAACE,IAAI,CAACT,IAAI,GAAGO,YAAY,CAACC,KAAK,CAACR,IAAI,EACzEK,KAAK,CAACL,IAAI,CAACU,SAAS,CACrB;EAED,OAAOL,KAAK;AACd,CAAC","names":["mergeClasses","tokens","tableClassName","tableClassNames","root","useTableLayoutStyles","useFlexLayoutStyles","useStyles","useTableStyles_unstable","state","styles","layoutStyles","table","flex","className","noNativeElements"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/Table/useTableStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableSlots, TableState } from './Table.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const tableClassName = 'fui-Table';\nexport const tableClassNames: SlotClassNames<TableSlots> = {\n root: 'fui-Table',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table',\n verticalAlign: 'middle',\n width: '100%',\n tableLayout: 'fixed',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'block',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n borderCollapse: 'collapse',\n backgroundColor: tokens.colorSubtleBackground,\n },\n});\n\n/**\n * Apply styling to the Table slots based on the state\n */\nexport const useTableStyles_unstable = (state: TableState): TableState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableClassName,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.root.className,\n );\n\n return state;\n};\n"]}
@@ -3,9 +3,8 @@ import { useTableBody_unstable } from './useTableBody';
3
3
  import { renderTableBody_unstable } from './renderTableBody';
4
4
  import { useTableBodyStyles_unstable } from './useTableBodyStyles';
5
5
  /**
6
- * TableBody component - TODO: add more docs
6
+ * TableBody component
7
7
  */
8
-
9
8
  export const TableBody = /*#__PURE__*/React.forwardRef((props, ref) => {
10
9
  const state = useTableBody_unstable(props, ref);
11
10
  useTableBodyStyles_unstable(state);