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

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 (399) hide show
  1. package/CHANGELOG.json +129 -1
  2. package/CHANGELOG.md +34 -2
  3. package/dist/index.d.ts +8 -2
  4. package/lib/components/DataGrid/DataGrid.js +0 -1
  5. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  6. package/lib/components/DataGrid/renderDataGrid.js +0 -1
  7. package/lib/components/DataGrid/renderDataGrid.js.map +1 -1
  8. package/lib/components/DataGrid/useDataGrid.js +2 -2
  9. package/lib/components/DataGrid/useDataGrid.js.map +1 -1
  10. package/lib/components/DataGrid/useDataGridContextValues.js +4 -2
  11. package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
  12. package/lib/components/DataGrid/useDataGridStyles.js +0 -1
  13. package/lib/components/DataGrid/useDataGridStyles.js.map +1 -1
  14. package/lib/components/DataGridBody/DataGridBody.js +0 -1
  15. package/lib/components/DataGridBody/DataGridBody.js.map +1 -1
  16. package/lib/components/DataGridBody/DataGridBody.types.js.map +1 -1
  17. package/lib/components/DataGridBody/renderDataGridBody.js +13 -3
  18. package/lib/components/DataGridBody/renderDataGridBody.js.map +1 -1
  19. package/lib/components/DataGridBody/useDataGridBody.js +8 -12
  20. package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
  21. package/lib/components/DataGridBody/useDataGridBodyStyles.js +0 -1
  22. package/lib/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  23. package/lib/components/DataGridCell/DataGridCell.js +0 -1
  24. package/lib/components/DataGridCell/DataGridCell.js.map +1 -1
  25. package/lib/components/DataGridCell/renderDataGridCell.js +0 -1
  26. package/lib/components/DataGridCell/renderDataGridCell.js.map +1 -1
  27. package/lib/components/DataGridCell/useDataGridCell.js +0 -1
  28. package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
  29. package/lib/components/DataGridCell/useDataGridCellStyles.js +0 -1
  30. package/lib/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  31. package/lib/components/DataGridHeader/DataGridHeader.js +0 -1
  32. package/lib/components/DataGridHeader/DataGridHeader.js.map +1 -1
  33. package/lib/components/DataGridHeader/renderDataGridHeader.js +0 -1
  34. package/lib/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  35. package/lib/components/DataGridHeader/useDataGridHeader.js +2 -2
  36. package/lib/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  37. package/lib/components/DataGridHeader/useDataGridHeaderStyles.js +0 -1
  38. package/lib/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  39. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js +0 -1
  40. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  41. package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js +0 -1
  42. package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  43. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js +0 -3
  44. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  45. package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +0 -4
  46. package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  47. package/lib/components/DataGridRow/DataGridRow.js +0 -1
  48. package/lib/components/DataGridRow/DataGridRow.js.map +1 -1
  49. package/lib/components/DataGridRow/DataGridRow.types.js.map +1 -1
  50. package/lib/components/DataGridRow/renderDataGridRow.js +9 -4
  51. package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
  52. package/lib/components/DataGridRow/useDataGridRow.js +8 -19
  53. package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
  54. package/lib/components/DataGridRow/useDataGridRowStyles.js +0 -3
  55. package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  56. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js +0 -1
  57. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  58. package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js +0 -1
  59. package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  60. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js +0 -8
  61. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  62. package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +0 -4
  63. package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  64. package/lib/components/Table/Table.js +0 -1
  65. package/lib/components/Table/Table.js.map +1 -1
  66. package/lib/components/Table/renderTable.js +2 -2
  67. package/lib/components/Table/renderTable.js.map +1 -1
  68. package/lib/components/Table/useTable.js +0 -2
  69. package/lib/components/Table/useTable.js.map +1 -1
  70. package/lib/components/Table/useTableContextValues.js.map +1 -1
  71. package/lib/components/Table/useTableStyles.js +13 -19
  72. package/lib/components/Table/useTableStyles.js.map +1 -1
  73. package/lib/components/TableBody/TableBody.js +0 -1
  74. package/lib/components/TableBody/TableBody.js.map +1 -1
  75. package/lib/components/TableBody/renderTableBody.js +4 -4
  76. package/lib/components/TableBody/renderTableBody.js.map +1 -1
  77. package/lib/components/TableBody/useTableBody.js +0 -2
  78. package/lib/components/TableBody/useTableBody.js.map +1 -1
  79. package/lib/components/TableBody/useTableBodyStyles.js +6 -10
  80. package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
  81. package/lib/components/TableCell/TableCell.js +0 -1
  82. package/lib/components/TableCell/TableCell.js.map +1 -1
  83. package/lib/components/TableCell/renderTableCell.js +2 -2
  84. package/lib/components/TableCell/renderTableCell.js.map +1 -1
  85. package/lib/components/TableCell/useTableCell.js +0 -2
  86. package/lib/components/TableCell/useTableCell.js.map +1 -1
  87. package/lib/components/TableCell/useTableCellStyles.js +36 -42
  88. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  89. package/lib/components/TableCellActions/TableCellActions.js +0 -1
  90. package/lib/components/TableCellActions/TableCellActions.js.map +1 -1
  91. package/lib/components/TableCellActions/renderTableCellActions.js +4 -4
  92. package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -1
  93. package/lib/components/TableCellActions/useTableCellActions.js +0 -2
  94. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
  95. package/lib/components/TableCellActions/useTableCellActionsStyles.js +10 -13
  96. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  97. package/lib/components/TableCellLayout/TableCellLayout.js +0 -1
  98. package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -1
  99. package/lib/components/TableCellLayout/renderTableCellLayout.js +10 -6
  100. package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  101. package/lib/components/TableCellLayout/useTableCellLayout.js +0 -1
  102. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  103. package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  104. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js +29 -37
  105. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  106. package/lib/components/TableHeader/TableHeader.js +0 -1
  107. package/lib/components/TableHeader/TableHeader.js.map +1 -1
  108. package/lib/components/TableHeader/renderTableHeader.js +2 -2
  109. package/lib/components/TableHeader/renderTableHeader.js.map +1 -1
  110. package/lib/components/TableHeader/useTableHeader.js +0 -2
  111. package/lib/components/TableHeader/useTableHeader.js.map +1 -1
  112. package/lib/components/TableHeader/useTableHeaderStyles.js +10 -14
  113. package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  114. package/lib/components/TableHeaderCell/TableHeaderCell.js +0 -1
  115. package/lib/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  116. package/lib/components/TableHeaderCell/renderTableHeaderCell.js +6 -4
  117. package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  118. package/lib/components/TableHeaderCell/useTableHeaderCell.js +0 -2
  119. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  120. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js +68 -76
  121. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  122. package/lib/components/TableRow/TableRow.js +0 -1
  123. package/lib/components/TableRow/TableRow.js.map +1 -1
  124. package/lib/components/TableRow/renderTableRow.js +4 -4
  125. package/lib/components/TableRow/renderTableRow.js.map +1 -1
  126. package/lib/components/TableRow/useTableRow.js +0 -2
  127. package/lib/components/TableRow/useTableRow.js.map +1 -1
  128. package/lib/components/TableRow/useTableRowStyles.js +136 -142
  129. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  130. package/lib/components/TableSelectionCell/TableSelectionCell.js +0 -1
  131. package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  132. package/lib/components/TableSelectionCell/renderTableSelectionCell.js +6 -4
  133. package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  134. package/lib/components/TableSelectionCell/useTableSelectionCell.js +4 -3
  135. package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  136. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js +42 -51
  137. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  138. package/lib/contexts/columnIdContext.js +0 -1
  139. package/lib/contexts/columnIdContext.js.map +1 -1
  140. package/lib/contexts/dataGridContext.js +2 -1
  141. package/lib/contexts/dataGridContext.js.map +1 -1
  142. package/lib/contexts/rowIdContext.js +0 -1
  143. package/lib/contexts/rowIdContext.js.map +1 -1
  144. package/lib/contexts/tableContext.js +0 -1
  145. package/lib/contexts/tableContext.js.map +1 -1
  146. package/lib/contexts/tableHeaderContext.js.map +1 -1
  147. package/lib/hooks/createColumn.js +0 -6
  148. package/lib/hooks/createColumn.js.map +1 -1
  149. package/lib/hooks/selectionManager.js +0 -16
  150. package/lib/hooks/selectionManager.js.map +1 -1
  151. package/lib/hooks/useTableFeatures.js +0 -5
  152. package/lib/hooks/useTableFeatures.js.map +1 -1
  153. package/lib/hooks/useTableSelection.js +2 -6
  154. package/lib/hooks/useTableSelection.js.map +1 -1
  155. package/lib/hooks/useTableSort.js +4 -13
  156. package/lib/hooks/useTableSort.js.map +1 -1
  157. package/lib/index.js.map +1 -1
  158. package/lib-commonjs/DataGrid.js +0 -2
  159. package/lib-commonjs/DataGrid.js.map +1 -1
  160. package/lib-commonjs/DataGridBody.js +0 -2
  161. package/lib-commonjs/DataGridBody.js.map +1 -1
  162. package/lib-commonjs/DataGridCell.js +0 -2
  163. package/lib-commonjs/DataGridCell.js.map +1 -1
  164. package/lib-commonjs/DataGridHeader.js +0 -2
  165. package/lib-commonjs/DataGridHeader.js.map +1 -1
  166. package/lib-commonjs/DataGridHeaderCell.js +0 -2
  167. package/lib-commonjs/DataGridHeaderCell.js.map +1 -1
  168. package/lib-commonjs/DataGridRow.js +0 -2
  169. package/lib-commonjs/DataGridRow.js.map +1 -1
  170. package/lib-commonjs/DataGridSelectionCell.js +0 -2
  171. package/lib-commonjs/DataGridSelectionCell.js.map +1 -1
  172. package/lib-commonjs/Table.js +0 -2
  173. package/lib-commonjs/Table.js.map +1 -1
  174. package/lib-commonjs/TableBody.js +0 -2
  175. package/lib-commonjs/TableBody.js.map +1 -1
  176. package/lib-commonjs/TableCell.js +0 -2
  177. package/lib-commonjs/TableCell.js.map +1 -1
  178. package/lib-commonjs/TableCellActions.js +0 -2
  179. package/lib-commonjs/TableCellActions.js.map +1 -1
  180. package/lib-commonjs/TableCellLayout.js +0 -2
  181. package/lib-commonjs/TableCellLayout.js.map +1 -1
  182. package/lib-commonjs/TableCellPrimaryLayout.js +0 -2
  183. package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -1
  184. package/lib-commonjs/TableHeader.js +0 -2
  185. package/lib-commonjs/TableHeader.js.map +1 -1
  186. package/lib-commonjs/TableHeaderCell.js +0 -2
  187. package/lib-commonjs/TableHeaderCell.js.map +1 -1
  188. package/lib-commonjs/TableRow.js +0 -2
  189. package/lib-commonjs/TableRow.js.map +1 -1
  190. package/lib-commonjs/TableSelectionCell.js +0 -2
  191. package/lib-commonjs/TableSelectionCell.js.map +1 -1
  192. package/lib-commonjs/components/DataGrid/DataGrid.js +0 -7
  193. package/lib-commonjs/components/DataGrid/DataGrid.js.map +1 -1
  194. package/lib-commonjs/components/DataGrid/DataGrid.types.js.map +1 -1
  195. package/lib-commonjs/components/DataGrid/index.js +0 -6
  196. package/lib-commonjs/components/DataGrid/index.js.map +1 -1
  197. package/lib-commonjs/components/DataGrid/renderDataGrid.js +0 -6
  198. package/lib-commonjs/components/DataGrid/renderDataGrid.js.map +1 -1
  199. package/lib-commonjs/components/DataGrid/useDataGrid.js +2 -7
  200. package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
  201. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js +4 -5
  202. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
  203. package/lib-commonjs/components/DataGrid/useDataGridStyles.js +0 -5
  204. package/lib-commonjs/components/DataGrid/useDataGridStyles.js.map +1 -1
  205. package/lib-commonjs/components/DataGridBody/DataGridBody.js +0 -6
  206. package/lib-commonjs/components/DataGridBody/DataGridBody.js.map +1 -1
  207. package/lib-commonjs/components/DataGridBody/DataGridBody.types.js.map +1 -1
  208. package/lib-commonjs/components/DataGridBody/index.js +0 -6
  209. package/lib-commonjs/components/DataGridBody/index.js.map +1 -1
  210. package/lib-commonjs/components/DataGridBody/renderDataGridBody.js +13 -6
  211. package/lib-commonjs/components/DataGridBody/renderDataGridBody.js.map +1 -1
  212. package/lib-commonjs/components/DataGridBody/useDataGridBody.js +8 -19
  213. package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
  214. package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js +0 -5
  215. package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  216. package/lib-commonjs/components/DataGridCell/DataGridCell.js +0 -6
  217. package/lib-commonjs/components/DataGridCell/DataGridCell.js.map +1 -1
  218. package/lib-commonjs/components/DataGridCell/DataGridCell.types.js.map +1 -1
  219. package/lib-commonjs/components/DataGridCell/index.js +0 -6
  220. package/lib-commonjs/components/DataGridCell/index.js.map +1 -1
  221. package/lib-commonjs/components/DataGridCell/renderDataGridCell.js +0 -4
  222. package/lib-commonjs/components/DataGridCell/renderDataGridCell.js.map +1 -1
  223. package/lib-commonjs/components/DataGridCell/useDataGridCell.js +0 -5
  224. package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
  225. package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js +0 -5
  226. package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  227. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js +0 -6
  228. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js.map +1 -1
  229. package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
  230. package/lib-commonjs/components/DataGridHeader/index.js +0 -6
  231. package/lib-commonjs/components/DataGridHeader/index.js.map +1 -1
  232. package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js +0 -4
  233. package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  234. package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js +2 -5
  235. package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  236. package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js +0 -5
  237. package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  238. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js +0 -6
  239. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  240. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
  241. package/lib-commonjs/components/DataGridHeaderCell/index.js +0 -6
  242. package/lib-commonjs/components/DataGridHeaderCell/index.js.map +1 -1
  243. package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js +0 -4
  244. package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  245. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js +0 -10
  246. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  247. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js +0 -8
  248. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  249. package/lib-commonjs/components/DataGridRow/DataGridRow.js +0 -6
  250. package/lib-commonjs/components/DataGridRow/DataGridRow.js.map +1 -1
  251. package/lib-commonjs/components/DataGridRow/DataGridRow.types.js.map +1 -1
  252. package/lib-commonjs/components/DataGridRow/index.js +0 -6
  253. package/lib-commonjs/components/DataGridRow/index.js.map +1 -1
  254. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js +9 -8
  255. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
  256. package/lib-commonjs/components/DataGridRow/useDataGridRow.js +8 -30
  257. package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
  258. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js +0 -7
  259. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  260. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js +0 -6
  261. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  262. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
  263. package/lib-commonjs/components/DataGridSelectionCell/index.js +0 -6
  264. package/lib-commonjs/components/DataGridSelectionCell/index.js.map +1 -1
  265. package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js +0 -4
  266. package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  267. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js +0 -15
  268. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  269. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js +0 -8
  270. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  271. package/lib-commonjs/components/Table/Table.js +0 -7
  272. package/lib-commonjs/components/Table/Table.js.map +1 -1
  273. package/lib-commonjs/components/Table/Table.types.js.map +1 -1
  274. package/lib-commonjs/components/Table/index.js +0 -6
  275. package/lib-commonjs/components/Table/index.js.map +1 -1
  276. package/lib-commonjs/components/Table/renderTable.js +2 -7
  277. package/lib-commonjs/components/Table/renderTable.js.map +1 -1
  278. package/lib-commonjs/components/Table/useTable.js +0 -5
  279. package/lib-commonjs/components/Table/useTable.js.map +1 -1
  280. package/lib-commonjs/components/Table/useTableContextValues.js +0 -3
  281. package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
  282. package/lib-commonjs/components/Table/useTableStyles.js +13 -23
  283. package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
  284. package/lib-commonjs/components/TableBody/TableBody.js +0 -6
  285. package/lib-commonjs/components/TableBody/TableBody.js.map +1 -1
  286. package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -1
  287. package/lib-commonjs/components/TableBody/index.js +0 -6
  288. package/lib-commonjs/components/TableBody/index.js.map +1 -1
  289. package/lib-commonjs/components/TableBody/renderTableBody.js +4 -8
  290. package/lib-commonjs/components/TableBody/renderTableBody.js.map +1 -1
  291. package/lib-commonjs/components/TableBody/useTableBody.js +0 -6
  292. package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
  293. package/lib-commonjs/components/TableBody/useTableBodyStyles.js +6 -12
  294. package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
  295. package/lib-commonjs/components/TableCell/TableCell.js +0 -6
  296. package/lib-commonjs/components/TableCell/TableCell.js.map +1 -1
  297. package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -1
  298. package/lib-commonjs/components/TableCell/index.js +0 -6
  299. package/lib-commonjs/components/TableCell/index.js.map +1 -1
  300. package/lib-commonjs/components/TableCell/renderTableCell.js +2 -6
  301. package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
  302. package/lib-commonjs/components/TableCell/useTableCell.js +0 -6
  303. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  304. package/lib-commonjs/components/TableCell/useTableCellStyles.js +36 -47
  305. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  306. package/lib-commonjs/components/TableCellActions/TableCellActions.js +0 -6
  307. package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -1
  308. package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -1
  309. package/lib-commonjs/components/TableCellActions/index.js +0 -6
  310. package/lib-commonjs/components/TableCellActions/index.js.map +1 -1
  311. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js +4 -8
  312. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -1
  313. package/lib-commonjs/components/TableCellActions/useTableCellActions.js +0 -5
  314. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
  315. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js +10 -16
  316. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  317. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +0 -7
  318. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -1
  319. package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  320. package/lib-commonjs/components/TableCellLayout/index.js +0 -6
  321. package/lib-commonjs/components/TableCellLayout/index.js.map +1 -1
  322. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js +10 -11
  323. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  324. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js +0 -5
  325. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  326. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js +0 -3
  327. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  328. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js +29 -42
  329. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  330. package/lib-commonjs/components/TableHeader/TableHeader.js +0 -6
  331. package/lib-commonjs/components/TableHeader/TableHeader.js.map +1 -1
  332. package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -1
  333. package/lib-commonjs/components/TableHeader/index.js +0 -6
  334. package/lib-commonjs/components/TableHeader/index.js.map +1 -1
  335. package/lib-commonjs/components/TableHeader/renderTableHeader.js +2 -7
  336. package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -1
  337. package/lib-commonjs/components/TableHeader/useTableHeader.js +0 -6
  338. package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
  339. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js +10 -17
  340. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  341. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js +0 -6
  342. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  343. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  344. package/lib-commonjs/components/TableHeaderCell/index.js +0 -6
  345. package/lib-commonjs/components/TableHeaderCell/index.js.map +1 -1
  346. package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js +6 -8
  347. package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  348. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js +0 -10
  349. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  350. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js +68 -81
  351. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  352. package/lib-commonjs/components/TableRow/TableRow.js +0 -6
  353. package/lib-commonjs/components/TableRow/TableRow.js.map +1 -1
  354. package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -1
  355. package/lib-commonjs/components/TableRow/index.js +0 -6
  356. package/lib-commonjs/components/TableRow/index.js.map +1 -1
  357. package/lib-commonjs/components/TableRow/renderTableRow.js +4 -8
  358. package/lib-commonjs/components/TableRow/renderTableRow.js.map +1 -1
  359. package/lib-commonjs/components/TableRow/useTableRow.js +0 -7
  360. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  361. package/lib-commonjs/components/TableRow/useTableRowStyles.js +136 -150
  362. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  363. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +0 -6
  364. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  365. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  366. package/lib-commonjs/components/TableSelectionCell/index.js +0 -6
  367. package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -1
  368. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js +6 -8
  369. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  370. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js +4 -10
  371. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  372. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js +42 -56
  373. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  374. package/lib-commonjs/contexts/columnIdContext.js +0 -5
  375. package/lib-commonjs/contexts/columnIdContext.js.map +1 -1
  376. package/lib-commonjs/contexts/dataGridContext.js +2 -6
  377. package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
  378. package/lib-commonjs/contexts/rowIdContext.js +0 -5
  379. package/lib-commonjs/contexts/rowIdContext.js.map +1 -1
  380. package/lib-commonjs/contexts/tableContext.js +0 -5
  381. package/lib-commonjs/contexts/tableContext.js.map +1 -1
  382. package/lib-commonjs/contexts/tableHeaderContext.js +0 -4
  383. package/lib-commonjs/contexts/tableHeaderContext.js.map +1 -1
  384. package/lib-commonjs/hooks/createColumn.js +0 -8
  385. package/lib-commonjs/hooks/createColumn.js.map +1 -1
  386. package/lib-commonjs/hooks/index.js +0 -6
  387. package/lib-commonjs/hooks/index.js.map +1 -1
  388. package/lib-commonjs/hooks/selectionManager.js +0 -18
  389. package/lib-commonjs/hooks/selectionManager.js.map +1 -1
  390. package/lib-commonjs/hooks/types.js.map +1 -1
  391. package/lib-commonjs/hooks/useTableFeatures.js +0 -9
  392. package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
  393. package/lib-commonjs/hooks/useTableSelection.js +2 -13
  394. package/lib-commonjs/hooks/useTableSelection.js.map +1 -1
  395. package/lib-commonjs/hooks/useTableSort.js +4 -18
  396. package/lib-commonjs/hooks/useTableSort.js.map +1 -1
  397. package/lib-commonjs/index.js +0 -36
  398. package/lib-commonjs/index.js.map +1 -1
  399. package/package.json +12 -12
@@ -6,75 +6,69 @@ export const tableSelectionCellClassNames = {
6
6
  checkboxIndicator: 'fui-TableSelectionCell__checkboxIndicator',
7
7
  radioIndicator: 'fui-TableSelectionCell__radioIndicator'
8
8
  };
9
-
10
9
  const useTableLayoutStyles = /*#__PURE__*/__styles({
11
- "root": {
12
- "mc9l5x": "f15pt5es",
13
- "a9b677": "fksc0bp"
10
+ root: {
11
+ mc9l5x: "f15pt5es",
12
+ a9b677: "fksc0bp"
14
13
  }
15
14
  }, {
16
- "d": [".f15pt5es{display:table-cell;}", ".fksc0bp{width:44px;}"]
15
+ d: [".f15pt5es{display:table-cell;}", ".fksc0bp{width:44px;}"]
17
16
  });
18
-
19
17
  const useFlexLayoutStyles = /*#__PURE__*/__styles({
20
- "root": {
21
- "mc9l5x": "f22iagw",
22
- "Bh6795r": "fqerorx",
23
- "Bnnss6s": "f1neuvcm",
24
- "xawz": "fkjuxzh",
25
- "Bf4jedk": "fvrlu0f",
26
- "B2u0y6b": "f1c71y05",
27
- "Brf1p80": "f4d9j23"
18
+ root: {
19
+ mc9l5x: "f22iagw",
20
+ Bh6795r: "fqerorx",
21
+ Bnnss6s: "f1neuvcm",
22
+ xawz: "fkjuxzh",
23
+ Bf4jedk: "fvrlu0f",
24
+ B2u0y6b: "f1c71y05",
25
+ Brf1p80: "f4d9j23"
28
26
  }
29
27
  }, {
30
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".fvrlu0f{min-width:44px;}", ".f1c71y05{max-width:44px;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}"]
28
+ d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1neuvcm{-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;}", ".fkjuxzh{-webkit-flex-basis:0px;-ms-flex-preferred-size:0px;flex-basis:0px;}", ".fvrlu0f{min-width:44px;}", ".f1c71y05{max-width:44px;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}"]
31
29
  });
32
30
  /**
33
31
  * Styles for the root slot
34
32
  */
35
-
36
-
37
33
  const useStyles = /*#__PURE__*/__styles({
38
- "root": {
39
- "fsow6f": "f17mccla",
40
- "Huce71": "fz5stix",
41
- "z8tnut": "f1g0x7ka",
42
- "z189sj": ["fhxju0i", "f1cnd47f"],
43
- "Byoj8tv": "f1qch9an",
44
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
45
- "Bn4voq9": "fz36nt7",
46
- "g9k6zt": "f9znhxp",
47
- "Bfpq7zp": "fqrak0z",
48
- "kdpuga": ["f1o2ludy", "f1kjnpwc"],
49
- "Bw81rd7": ["f1kjnpwc", "f1o2ludy"],
50
- "B6xbmo0": ["fxmnebo", "f1witrsb"],
51
- "dm238s": ["f1witrsb", "fxmnebo"]
34
+ root: {
35
+ fsow6f: "f17mccla",
36
+ Huce71: "fz5stix",
37
+ z8tnut: "f1g0x7ka",
38
+ z189sj: ["fhxju0i", "f1cnd47f"],
39
+ Byoj8tv: "f1qch9an",
40
+ uwmqm3: ["f1cnd47f", "fhxju0i"],
41
+ Bn4voq9: "fz36nt7",
42
+ g9k6zt: "f9znhxp",
43
+ Bfpq7zp: "fqrak0z",
44
+ kdpuga: ["f1o2ludy", "f1kjnpwc"],
45
+ Bw81rd7: ["f1kjnpwc", "f1o2ludy"],
46
+ B6xbmo0: ["fxmnebo", "f1witrsb"],
47
+ dm238s: ["f1witrsb", "fxmnebo"]
52
48
  },
53
- "radioIndicator": {
54
- "mc9l5x": "f22iagw",
55
- "Bh6795r": "fqerorx",
56
- "Bt984gj": "f122n59",
57
- "Brf1p80": "f4d9j23"
49
+ radioIndicator: {
50
+ mc9l5x: "f22iagw",
51
+ Bh6795r: "fqerorx",
52
+ Bt984gj: "f122n59",
53
+ Brf1p80: "f4d9j23"
58
54
  },
59
- "subtle": {
60
- "abs64n": "fk73vx1",
61
- "Brovlpu": "ftqa4ok",
62
- "B486eqv": "f2hkw1w",
63
- "B8a84jv": "f1y7ij6c"
55
+ subtle: {
56
+ abs64n: "fk73vx1",
57
+ Brovlpu: "ftqa4ok",
58
+ B486eqv: "f2hkw1w",
59
+ B8a84jv: "f1y7ij6c"
64
60
  },
65
- "hidden": {
66
- "Bcdw1i0": "fd7fpy0"
61
+ hidden: {
62
+ Bcdw1i0: "fd7fpy0"
67
63
  }
68
64
  }, {
69
- "d": [".f17mccla{text-align:center;}", ".fz5stix{white-space:nowrap;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fz36nt7[data-fui-focus-visible]{outline-width:2px;}", ".f9znhxp[data-fui-focus-visible]{outline-style:solid;}", ".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}", ".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}", ".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fk73vx1{opacity:0;}", ".f1y7ij6c[data-fui-focus-within]:focus-within{opacity:1;}", ".fd7fpy0{visibility:hidden;}"],
70
- "f": [".ftqa4ok:focus{outline-style:none;}"],
71
- "i": [".f2hkw1w:focus-visible{outline-style:none;}"]
65
+ d: [".f17mccla{text-align:center;}", ".fz5stix{white-space:nowrap;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fz36nt7[data-fui-focus-visible]{outline-width:2px;}", ".f9znhxp[data-fui-focus-visible]{outline-style:solid;}", ".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}", ".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}", ".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}", ".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fk73vx1{opacity:0;}", ".f1y7ij6c[data-fui-focus-within]:focus-within{opacity:1;}", ".fd7fpy0{visibility:hidden;}"],
66
+ f: [".ftqa4ok:focus{outline-style:none;}"],
67
+ i: [".f2hkw1w:focus-visible{outline-style:none;}"]
72
68
  });
73
69
  /**
74
70
  * Apply styling to the TableSelectionCell slots based on the state
75
71
  */
76
-
77
-
78
72
  export const useTableSelectionCellStyles_unstable = state => {
79
73
  const styles = useStyles();
80
74
  const layoutStyles = {
@@ -82,15 +76,12 @@ export const useTableSelectionCellStyles_unstable = state => {
82
76
  flex: useFlexLayoutStyles()
83
77
  };
84
78
  state.root.className = mergeClasses(tableSelectionCellClassNames.root, styles.root, state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root, state.subtle && state.checked === false && styles.subtle, state.hidden && styles.hidden, state.root.className);
85
-
86
79
  if (state.checkboxIndicator) {
87
80
  state.checkboxIndicator.className = mergeClasses(tableSelectionCellClassNames.checkboxIndicator, state.checkboxIndicator.className);
88
81
  }
89
-
90
82
  if (state.radioIndicator) {
91
83
  state.radioIndicator.className = mergeClasses(tableSelectionCellClassNames.radioIndicator, styles.radioIndicator, state.radioIndicator.className);
92
84
  }
93
-
94
85
  return state;
95
86
  };
96
87
  //# sourceMappingURL=useTableSelectionCellStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/components/TableSelectionCell/useTableSelectionCellStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAEA,OAAO,MAAM,4BAA4B,GAA4C;EACnF,IAAI,EAAE,wBAD6E;EAEnF,iBAAiB,EAAE,2CAFgE;EAGnF,cAAc,EAAE;AAHmE,CAA9E;;AAMP,MAAM,oBAAoB,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA7B;;AAOA,MAAM,mBAAmB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAA5B;AAUA;;AAEG;;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;AAAA,EAAlB;AAoCA;;AAEG;;;AACH,OAAO,MAAM,oCAAoC,GAAI,KAAD,IAA4D;EAC9G,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,4BAA4B,CAAC,IADI,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,gBAAN,GAAyB,YAAY,CAAC,IAAb,CAAkB,IAA3C,GAAkD,YAAY,CAAC,KAAb,CAAmB,IAHpC,EAIjC,KAAK,CAAC,MAAN,IAAgB,KAAK,CAAC,OAAN,KAAkB,KAAlC,IAA2C,MAAM,CAAC,MAJjB,EAKjC,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MALU,EAMjC,KAAK,CAAC,IAAN,CAAW,SANsB,CAAnC;;EAQA,IAAI,KAAK,CAAC,iBAAV,EAA6B;IAC3B,KAAK,CAAC,iBAAN,CAAwB,SAAxB,GAAoC,YAAY,CAC9C,4BAA4B,CAAC,iBADiB,EAE9C,KAAK,CAAC,iBAAN,CAAwB,SAFsB,CAAhD;EAID;;EAED,IAAI,KAAK,CAAC,cAAV,EAA0B;IACxB,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,YAAY,CAC3C,4BAA4B,CAAC,cADc,EAE3C,MAAM,CAAC,cAFoC,EAG3C,KAAK,CAAC,cAAN,CAAqB,SAHsB,CAA7C;EAKD;;EAED,OAAO,KAAP;AACD,CA9BM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TableSelectionCellSlots, TableSelectionCellState } from './TableSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const tableSelectionCellClassNames: SlotClassNames<TableSelectionCellSlots> = {\n root: 'fui-TableSelectionCell',\n checkboxIndicator: 'fui-TableSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-TableSelectionCell__radioIndicator',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n width: '44px',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: '44px',\n maxWidth: '44px',\n justifyContent: 'center',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n textAlign: 'center',\n whiteSpace: 'nowrap',\n ...shorthands.padding(0),\n ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.outline('2px', 'solid', tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n { selector: 'focus', enableOutline: true },\n ),\n },\n\n radioIndicator: {\n display: 'flex',\n flexGrow: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n\n subtle: {\n opacity: 0,\n ...createCustomFocusIndicatorStyle(\n {\n opacity: 1,\n },\n { selector: 'focus-within' },\n ),\n },\n\n hidden: {\n visibility: 'hidden',\n },\n});\n\n/**\n * Apply styling to the TableSelectionCell slots based on the state\n */\nexport const useTableSelectionCellStyles_unstable = (state: TableSelectionCellState): TableSelectionCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableSelectionCellClassNames.root,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.subtle && state.checked === false && styles.subtle,\n state.hidden && styles.hidden,\n state.root.className,\n );\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n tableSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n tableSelectionCellClassNames.radioIndicator,\n styles.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAO,MAAMC,4BAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,iBAAiB,EAAE,2CAA2C;EAC9DC,cAAc,EAAE;CACjB;AAED,MAAMC,oBAAoB,gBAAG;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAK3B;AAEF,MAAMC,mBAAmB,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA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AAc,CAACU,SAAS,CAC/B;;EAGH,OAAOL,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","createCustomFocusIndicatorStyle","tokens","tableSelectionCellClassNames","root","checkboxIndicator","radioIndicator","useTableLayoutStyles","useFlexLayoutStyles","useStyles","useTableSelectionCellStyles_unstable","state","styles","layoutStyles","table","flex","className","noNativeElements","subtle","checked","hidden"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableSelectionCell/useTableSelectionCellStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TableSelectionCellSlots, TableSelectionCellState } from './TableSelectionCell.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const tableSelectionCellClassNames: SlotClassNames<TableSelectionCellSlots> = {\n root: 'fui-TableSelectionCell',\n checkboxIndicator: 'fui-TableSelectionCell__checkboxIndicator',\n radioIndicator: 'fui-TableSelectionCell__radioIndicator',\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-cell',\n width: '44px',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: '44px',\n maxWidth: '44px',\n justifyContent: 'center',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n textAlign: 'center',\n whiteSpace: 'nowrap',\n ...shorthands.padding(0),\n ...createCustomFocusIndicatorStyle(\n {\n ...shorthands.outline('2px', 'solid', tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n { selector: 'focus', enableOutline: true },\n ),\n },\n\n radioIndicator: {\n display: 'flex',\n flexGrow: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n\n subtle: {\n opacity: 0,\n ...createCustomFocusIndicatorStyle(\n {\n opacity: 1,\n },\n { selector: 'focus-within' },\n ),\n },\n\n hidden: {\n visibility: 'hidden',\n },\n});\n\n/**\n * Apply styling to the TableSelectionCell slots based on the state\n */\nexport const useTableSelectionCellStyles_unstable = (state: TableSelectionCellState): TableSelectionCellState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableSelectionCellClassNames.root,\n styles.root,\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n state.subtle && state.checked === false && styles.subtle,\n state.hidden && styles.hidden,\n state.root.className,\n );\n if (state.checkboxIndicator) {\n state.checkboxIndicator.className = mergeClasses(\n tableSelectionCellClassNames.checkboxIndicator,\n state.checkboxIndicator.className,\n );\n }\n\n if (state.radioIndicator) {\n state.radioIndicator.className = mergeClasses(\n tableSelectionCellClassNames.radioIndicator,\n styles.radioIndicator,\n state.radioIndicator.className,\n );\n }\n\n return state;\n};\n"]}
@@ -3,7 +3,6 @@ const columnIdContext = /*#__PURE__*/React.createContext(undefined);
3
3
  export const columnIdContextDefaultValue = '';
4
4
  export const useColumnIdContext = () => {
5
5
  var _a;
6
-
7
6
  return (_a = React.useContext(columnIdContext)) !== null && _a !== void 0 ? _a : columnIdContextDefaultValue;
8
7
  };
9
8
  export const ColumnIdContextProvider = columnIdContext.Provider;
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/contexts/columnIdContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,MAAM,eAAe,gBAAG,KAAK,CAAC,aAAN,CAA0C,SAA1C,CAAxB;AAEA,OAAO,MAAM,2BAA2B,GAAG,EAApC;AAEP,OAAO,MAAM,kBAAkB,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,eAAjB,CAAA,MAAiC,IAAjC,IAAiC,EAAA,KAAA,KAAA,CAAjC,GAAiC,EAAjC,GAAqC,2BAArC;AAAgE,CAAjG;AAEP,OAAO,MAAM,uBAAuB,GAAG,eAAe,CAAC,QAAhD","sourcesContent":["import * as React from 'react';\nimport type { ColumnId } from '../hooks/';\n\nconst columnIdContext = React.createContext<ColumnId | undefined>(undefined);\n\nexport const columnIdContextDefaultValue = '';\n\nexport const useColumnIdContext = () => React.useContext(columnIdContext) ?? columnIdContextDefaultValue;\n\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,eAAe,gBAAGD,KAAK,CAACE,aAAa,CAAuBC,SAAS,CAAC;AAE5E,OAAO,MAAMC,2BAA2B,GAAG,EAAE;AAE7C,OAAO,MAAMC,kBAAkB,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACL,eAAe,CAAC,mCAAIG,2BAA2B;AAAA;AAExG,OAAO,MAAMG,uBAAuB,GAAGN,eAAe,CAACO,QAAQ","names":["React","columnIdContext","createContext","undefined","columnIdContextDefaultValue","useColumnIdContext","useContext","ColumnIdContextProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/columnIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ColumnId } from '../hooks/';\n\nconst columnIdContext = React.createContext<ColumnId | undefined>(undefined);\n\nexport const columnIdContextDefaultValue = '';\n\nexport const useColumnIdContext = () => React.useContext(columnIdContext) ?? columnIdContextDefaultValue;\n\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"]}
@@ -1,7 +1,8 @@
1
1
  import { createContext, useContextSelector } from '@fluentui/react-context-selector';
2
2
  import { defaultTableState } from '../hooks';
3
3
  const dataGridContext = /*#__PURE__*/createContext(undefined);
4
- const dataGridContextDefaultValue = { ...defaultTableState,
4
+ const dataGridContextDefaultValue = {
5
+ ...defaultTableState,
5
6
  subtleSelection: false,
6
7
  selectableRows: false,
7
8
  selectionAppearance: 'brand',
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/contexts/dataGridContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,EAAwB,kBAAxB,QAAkD,kCAAlD;AAGA,SAAS,iBAAT,QAAkC,UAAlC;AAEA,MAAM,eAAe,gBAAG,aAAa,CAAmC,SAAnC,CAArC;AAEA,MAAM,2BAA2B,GAAyB,EACxD,GAAG,iBADqD;EAExD,eAAe,EAAE,KAFuC;EAGxD,cAAc,EAAE,KAHwC;EAIxD,mBAAmB,EAAE,OAJmC;EAKxD,SAAS,EAAE;AAL6C,CAA1D;AAQA,OAAO,MAAM,uBAAuB,GAAG,eAAe,CAAC,QAAhD;AAEP,OAAO,MAAM,2BAA2B,GAAO,QAAJ,IACzC,kBAAkB,CAAC,eAAD,EAAkB,CAAC,GAAG,GAAG,2BAAP,KAAuC,QAAQ,CAAC,GAAD,CAAjE,CADb","sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport { DataGridContextValue } from '../components/DataGrid/DataGrid.types';\nimport { defaultTableState } from '../hooks';\n\nconst dataGridContext = createContext<DataGridContextValue | undefined>(undefined);\n\nconst dataGridContextDefaultValue: DataGridContextValue = {\n ...defaultTableState,\n subtleSelection: false,\n selectableRows: false,\n selectionAppearance: 'brand',\n focusMode: 'none',\n};\n\nexport const DataGridContextProvider = dataGridContext.Provider;\n\nexport const useDataGridContext_unstable = <T>(selector: ContextSelector<DataGridContextValue, T>) =>\n useContextSelector(dataGridContext, (ctx = dataGridContextDefaultValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,kCAAkC;AAGpF,SAASC,iBAAiB,QAAQ,UAAU;AAE5C,MAAMC,eAAe,gBAAGH,aAAa,CAAmCI,SAAS,CAAC;AAElF,MAAMC,2BAA2B,GAAyB;EACxD,GAAGH,iBAAiB;EACpBI,eAAe,EAAE,KAAK;EACtBC,cAAc,EAAE,KAAK;EACrBC,mBAAmB,EAAE,OAAO;EAC5BC,SAAS,EAAE;CACZ;AAED,OAAO,MAAMC,uBAAuB,GAAGP,eAAe,CAACQ,QAAQ;AAE/D,OAAO,MAAMC,2BAA2B,GAAOC,QAAkD,IAC/FZ,kBAAkB,CAACE,eAAe,EAAE,CAACW,GAAG,GAAGT,2BAA2B,KAAKQ,QAAQ,CAACC,GAAG,CAAC,CAAC","names":["createContext","useContextSelector","defaultTableState","dataGridContext","undefined","dataGridContextDefaultValue","subtleSelection","selectableRows","selectionAppearance","focusMode","DataGridContextProvider","Provider","useDataGridContext_unstable","selector","ctx"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/dataGridContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector } from '@fluentui/react-context-selector';\nimport { DataGridContextValue } from '../components/DataGrid/DataGrid.types';\nimport { defaultTableState } from '../hooks';\n\nconst dataGridContext = createContext<DataGridContextValue | undefined>(undefined);\n\nconst dataGridContextDefaultValue: DataGridContextValue = {\n ...defaultTableState,\n subtleSelection: false,\n selectableRows: false,\n selectionAppearance: 'brand',\n focusMode: 'none',\n};\n\nexport const DataGridContextProvider = dataGridContext.Provider;\n\nexport const useDataGridContext_unstable = <T>(selector: ContextSelector<DataGridContextValue, T>) =>\n useContextSelector(dataGridContext, (ctx = dataGridContextDefaultValue) => selector(ctx));\n"]}
@@ -3,7 +3,6 @@ const rowIdContext = /*#__PURE__*/React.createContext(undefined);
3
3
  export const rowIdContextDefaultValue = '';
4
4
  export const useRowIdContext = () => {
5
5
  var _a;
6
-
7
6
  return (_a = React.useContext(rowIdContext)) !== null && _a !== void 0 ? _a : rowIdContextDefaultValue;
8
7
  };
9
8
  export const RowIdContextProvider = rowIdContext.Provider;
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/contexts/rowIdContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,MAAM,YAAY,gBAAG,KAAK,CAAC,aAAN,CAAuC,SAAvC,CAArB;AAEA,OAAO,MAAM,wBAAwB,GAAG,EAAjC;AAEP,OAAO,MAAM,eAAe,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,YAAjB,CAAA,MAA8B,IAA9B,IAA8B,EAAA,KAAA,KAAA,CAA9B,GAA8B,EAA9B,GAAkC,wBAAlC;AAA0D,CAAxF;AAEP,OAAO,MAAM,oBAAoB,GAAG,YAAY,CAAC,QAA1C","sourcesContent":["import * as React from 'react';\nimport type { RowId } from '../hooks/';\n\nconst rowIdContext = React.createContext<RowId | undefined>(undefined);\n\nexport const rowIdContextDefaultValue = '';\n\nexport const useRowIdContext = () => React.useContext(rowIdContext) ?? rowIdContextDefaultValue;\n\nexport const RowIdContextProvider = rowIdContext.Provider;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAoBC,SAAS,CAAC;AAEtE,OAAO,MAAMC,wBAAwB,GAAG,EAAE;AAE1C,OAAO,MAAMC,eAAe,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACL,YAAY,CAAC,mCAAIG,wBAAwB;AAAA;AAE/F,OAAO,MAAMG,oBAAoB,GAAGN,YAAY,CAACO,QAAQ","names":["React","rowIdContext","createContext","undefined","rowIdContextDefaultValue","useRowIdContext","useContext","RowIdContextProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/rowIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { RowId } from '../hooks/';\n\nconst rowIdContext = React.createContext<RowId | undefined>(undefined);\n\nexport const rowIdContextDefaultValue = '';\n\nexport const useRowIdContext = () => React.useContext(rowIdContext) ?? rowIdContextDefaultValue;\n\nexport const RowIdContextProvider = rowIdContext.Provider;\n"]}
@@ -8,7 +8,6 @@ export const tableContextDefaultValue = {
8
8
  export const TableContextProvider = tableContext.Provider;
9
9
  export const useTableContext = () => {
10
10
  var _a;
11
-
12
11
  return (_a = React.useContext(tableContext)) !== null && _a !== void 0 ? _a : tableContextDefaultValue;
13
12
  };
14
13
  //# sourceMappingURL=tableContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/contexts/tableContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,MAAM,YAAY,gBAAG,KAAK,CAAC,aAAN,CAAmD,SAAnD,CAArB;AAEA,OAAO,MAAM,wBAAwB,GAAsB;EACzD,IAAI,EAAE,QADmD;EAEzD,gBAAgB,EAAE,KAFuC;EAGzD,QAAQ,EAAE;AAH+C,CAApD;AAMP,OAAO,MAAM,oBAAoB,GAAG,YAAY,CAAC,QAA1C;AACP,OAAO,MAAM,eAAe,GAAG,MAAK;EAAA,IAAA,EAAA;;EAAC,OAAA,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,YAAjB,CAAA,MAA8B,IAA9B,IAA8B,EAAA,KAAA,KAAA,CAA9B,GAA8B,EAA9B,GAAkC,wBAAlC;AAA0D,CAAxF","sourcesContent":["import * as React from 'react';\nimport { TableContextValue } from '../components/Table/Table.types';\n\nconst tableContext = React.createContext<TableContextValue | undefined>(undefined);\n\nexport const tableContextDefaultValue: TableContextValue = {\n size: 'medium',\n noNativeElements: false,\n sortable: false,\n};\n\nexport const TableContextProvider = tableContext.Provider;\nexport const useTableContext = () => React.useContext(tableContext) ?? tableContextDefaultValue;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAgCC,SAAS,CAAC;AAElF,OAAO,MAAMC,wBAAwB,GAAsB;EACzDC,IAAI,EAAE,QAAQ;EACdC,gBAAgB,EAAE,KAAK;EACvBC,QAAQ,EAAE;CACX;AAED,OAAO,MAAMC,oBAAoB,GAAGP,YAAY,CAACQ,QAAQ;AACzD,OAAO,MAAMC,eAAe,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACV,YAAY,CAAC,mCAAIG,wBAAwB;AAAA","names":["React","tableContext","createContext","undefined","tableContextDefaultValue","size","noNativeElements","sortable","TableContextProvider","Provider","useTableContext","useContext"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/tableContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { TableContextValue } from '../components/Table/Table.types';\n\nconst tableContext = React.createContext<TableContextValue | undefined>(undefined);\n\nexport const tableContextDefaultValue: TableContextValue = {\n size: 'medium',\n noNativeElements: false,\n sortable: false,\n};\n\nexport const TableContextProvider = tableContext.Provider;\nexport const useTableContext = () => React.useContext(tableContext) ?? tableContextDefaultValue;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/contexts/tableHeaderContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,MAAM,kBAAkB,gBAAG,KAAK,CAAC,aAAN,CAAwC,SAAxC,CAA3B;AAEA,MAAM,8BAA8B,GAAG,EAAvC;AAEA,OAAO,MAAM,0BAA0B,GAAG,kBAAkB,CAAC,QAAtD;AACP,OAAO,MAAM,kBAAkB,GAAG,MAAM,KAAK,CAAC,UAAN,CAAiB,kBAAjB,MAAyC,8BAA1E","sourcesContent":["import * as React from 'react';\n\nconst tableHeaderContext = React.createContext<string | undefined>(undefined);\n\nconst tableHeaderContextDefaultValue = '';\n\nexport const TableHeaderContextProvider = tableHeaderContext.Provider;\nexport const useIsInTableHeader = () => React.useContext(tableHeaderContext) === tableHeaderContextDefaultValue;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,MAAMC,kBAAkB,gBAAGD,KAAK,CAACE,aAAa,CAAqBC,SAAS,CAAC;AAE7E,MAAMC,8BAA8B,GAAG,EAAE;AAEzC,OAAO,MAAMC,0BAA0B,GAAGJ,kBAAkB,CAACK,QAAQ;AACrE,OAAO,MAAMC,kBAAkB,GAAG,MAAMP,KAAK,CAACQ,UAAU,CAACP,kBAAkB,CAAC,KAAKG,8BAA8B","names":["React","tableHeaderContext","createContext","undefined","tableHeaderContextDefaultValue","TableHeaderContextProvider","Provider","useIsInTableHeader","useContext"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/tableHeaderContext.ts"],"sourcesContent":["import * as React from 'react';\n\nconst tableHeaderContext = React.createContext<string | undefined>(undefined);\n\nconst tableHeaderContextDefaultValue = '';\n\nexport const TableHeaderContextProvider = tableHeaderContext.Provider;\nexport const useIsInTableHeader = () => React.useContext(tableHeaderContext) === tableHeaderContextDefaultValue;\n"]}
@@ -1,20 +1,16 @@
1
1
  const defaultCompare = () => 0;
2
-
3
2
  const defaultRenderCell = () => {
4
3
  if (process.env.NODE_ENV !== 'production') {
5
4
  // eslint-disable-next-line no-console
6
5
  console.warn('@fluentui/react-table: You are using the default column renderCell function that renders null');
7
6
  }
8
-
9
7
  return null;
10
8
  };
11
-
12
9
  const defaultRenderHeaderCell = () => {
13
10
  if (process.env.NODE_ENV !== 'production') {
14
11
  // eslint-disable-next-line no-console
15
12
  console.warn('@fluentui/react-table: You are using the default column renderHeaderCell function that renders null');
16
13
  }
17
-
18
14
  return null;
19
15
  };
20
16
  /**
@@ -22,8 +18,6 @@ const defaultRenderHeaderCell = () => {
22
18
  * @param options - column definition options
23
19
  * @returns - column definition with defaults
24
20
  */
25
-
26
-
27
21
  export function createColumn(options) {
28
22
  const {
29
23
  columnId,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/hooks/createColumn.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAAG,MAAM,CAA7B;;AAEA,MAAM,iBAAiB,GAAG,MAAK;EAC7B,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC;IACA,OAAO,CAAC,IAAR,CAAa,+FAAb;EACD;;EAED,OAAO,IAAP;AACD,CAPD;;AASA,MAAM,uBAAuB,GAAG,MAAK;EACnC,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC;IACA,OAAO,CAAC,IAAR,CAAa,qGAAb;EACD;;EAED,OAAO,IAAP;AACD,CAPD;AASA;;;;AAIG;;;AACH,OAAM,SAAU,YAAV,CAA8B,OAA9B,EAAiE;EACrE,MAAM;IACJ,QADI;IAEJ,UAAU,GAAG,iBAFT;IAGJ,gBAAgB,GAAG,uBAHf;IAIJ,OAAO,GAAG;EAJN,IAKF,OALJ;EAOA,OAAO;IACL,QADK;IAEL,UAFK;IAGL,gBAHK;IAIL;EAJK,CAAP;AAMD","sourcesContent":["import { CreateColumnOptions } from './types';\n\nconst defaultCompare = () => 0;\n\nconst defaultRenderCell = () => {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('@fluentui/react-table: You are using the default column renderCell function that renders null');\n }\n\n return null;\n};\n\nconst defaultRenderHeaderCell = () => {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('@fluentui/react-table: You are using the default column renderHeaderCell function that renders null');\n }\n\n return null;\n};\n\n/**\n * Helper function to create column definition with defaults\n * @param options - column definition options\n * @returns - column definition with defaults\n */\nexport function createColumn<TItem>(options: CreateColumnOptions<TItem>) {\n const {\n columnId,\n renderCell = defaultRenderCell,\n renderHeaderCell = defaultRenderHeaderCell,\n compare = defaultCompare,\n } = options;\n\n return {\n columnId,\n renderCell,\n renderHeaderCell,\n compare,\n };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAEA,MAAMA,cAAc,GAAG,MAAM,CAAC;AAE9B,MAAMC,iBAAiB,GAAG,MAAK;EAC7B,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC;IACAC,OAAO,CAACC,IAAI,CAAC,+FAA+F,CAAC;;EAG/G,OAAO,IAAI;AACb,CAAC;AAED,MAAMC,uBAAuB,GAAG,MAAK;EACnC,IAAIL,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC;IACAC,OAAO,CAACC,IAAI,CAAC,qGAAqG,CAAC;;EAGrH,OAAO,IAAI;AACb,CAAC;AAED;;;;;AAKA,OAAM,SAAUE,YAAY,CAAQC,OAAmC;EACrE,MAAM;IACJC,QAAQ;IACRC,UAAU,GAAGV,iBAAiB;IAC9BW,gBAAgB,GAAGL,uBAAuB;IAC1CM,OAAO,GAAGb;EAAc,CACzB,GAAGS,OAAO;EAEX,OAAO;IACLC,QAAQ;IACRC,UAAU;IACVC,gBAAgB;IAChBC;GACD;AACH","names":["defaultCompare","defaultRenderCell","process","env","NODE_ENV","console","warn","defaultRenderHeaderCell","createColumn","options","columnId","renderCell","renderHeaderCell","compare"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/createColumn.ts"],"sourcesContent":["import { CreateColumnOptions } from './types';\n\nconst defaultCompare = () => 0;\n\nconst defaultRenderCell = () => {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('@fluentui/react-table: You are using the default column renderCell function that renders null');\n }\n\n return null;\n};\n\nconst defaultRenderHeaderCell = () => {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('@fluentui/react-table: You are using the default column renderHeaderCell function that renders null');\n }\n\n return null;\n};\n\n/**\n * Helper function to create column definition with defaults\n * @param options - column definition options\n * @returns - column definition with defaults\n */\nexport function createColumn<TItem>(options: CreateColumnOptions<TItem>) {\n const {\n columnId,\n renderCell = defaultRenderCell,\n renderHeaderCell = defaultRenderHeaderCell,\n compare = defaultCompare,\n } = options;\n\n return {\n columnId,\n renderCell,\n renderHeaderCell,\n compare,\n };\n}\n"]}
@@ -2,48 +2,38 @@ export function createSelectionManager(mode, onSelectionChange = () => undefined
2
2
  const managerFactory = mode === 'multiselect' ? createMultipleSelectionManager : createSingleSelectionManager;
3
3
  return managerFactory(onSelectionChange);
4
4
  }
5
-
6
5
  function createMultipleSelectionManager(onSelectionChange) {
7
6
  const toggleAllItems = (e, itemIds, selectedItems) => {
8
7
  const allItemsSelected = itemIds.every(itemId => selectedItems.has(itemId));
9
-
10
8
  if (allItemsSelected) {
11
9
  selectedItems.clear();
12
10
  } else {
13
11
  itemIds.forEach(itemId => selectedItems.add(itemId));
14
12
  }
15
-
16
13
  onSelectionChange(e, new Set(selectedItems));
17
14
  };
18
-
19
15
  const toggleItem = (e, itemId, selectedItems) => {
20
16
  if (selectedItems.has(itemId)) {
21
17
  selectedItems.delete(itemId);
22
18
  } else {
23
19
  selectedItems.add(itemId);
24
20
  }
25
-
26
21
  onSelectionChange(e, new Set(selectedItems));
27
22
  };
28
-
29
23
  const selectItem = (e, itemId, selectedItems) => {
30
24
  selectedItems.add(itemId);
31
25
  onSelectionChange(e, new Set(selectedItems));
32
26
  };
33
-
34
27
  const deselectItem = (e, itemId, selectedItems) => {
35
28
  selectedItems.delete(itemId);
36
29
  onSelectionChange(e, new Set(selectedItems));
37
30
  };
38
-
39
31
  const clearItems = e => {
40
32
  onSelectionChange(e, new Set());
41
33
  };
42
-
43
34
  const isSelected = (itemId, selectedItems) => {
44
35
  return selectedItems.has(itemId);
45
36
  };
46
-
47
37
  return {
48
38
  toggleItem,
49
39
  selectItem,
@@ -53,24 +43,19 @@ function createMultipleSelectionManager(onSelectionChange) {
53
43
  toggleAllItems
54
44
  };
55
45
  }
56
-
57
46
  function createSingleSelectionManager(onSelectionChange) {
58
47
  const toggleItem = (e, itemId) => {
59
48
  onSelectionChange(e, new Set([itemId]));
60
49
  };
61
-
62
50
  const clearItems = e => {
63
51
  onSelectionChange(e, new Set());
64
52
  };
65
-
66
53
  const isSelected = (itemId, selectedItems) => {
67
54
  return selectedItems.has(itemId);
68
55
  };
69
-
70
56
  const selectItem = (e, itemId) => {
71
57
  onSelectionChange(e, new Set([itemId]));
72
58
  };
73
-
74
59
  return {
75
60
  deselectItem: clearItems,
76
61
  selectItem,
@@ -78,7 +63,6 @@ function createSingleSelectionManager(onSelectionChange) {
78
63
  if (process.env.NODE_ENV !== 'production') {
79
64
  throw new Error('[react-table]: `toggleAllItems` should not be used in single selection mode');
80
65
  }
81
-
82
66
  return undefined;
83
67
  },
84
68
  toggleItem,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/hooks/selectionManager.ts"],"names":[],"mappings":"AAoBA,OAAM,SAAU,sBAAV,CACJ,IADI,EAEJ,iBAAA,GAA+C,MAAM,SAFjD,EAE0D;EAE9D,MAAM,cAAc,GAAG,IAAI,KAAK,aAAT,GAAyB,8BAAzB,GAA0D,4BAAjF;EAEA,OAAO,cAAc,CAAC,iBAAD,CAArB;AACD;;AAED,SAAS,8BAAT,CAAwC,iBAAxC,EAAoF;EAClF,MAAM,cAAc,GAAuC,CAAC,CAAD,EAAI,OAAJ,EAAa,aAAb,KAA8B;IACvF,MAAM,gBAAgB,GAAG,OAAO,CAAC,KAAR,CAAc,MAAM,IAAI,aAAa,CAAC,GAAd,CAAkB,MAAlB,CAAxB,CAAzB;;IAEA,IAAI,gBAAJ,EAAsB;MACpB,aAAa,CAAC,KAAd;IACD,CAFD,MAEO;MACL,OAAO,CAAC,OAAR,CAAgB,MAAM,IAAI,aAAa,CAAC,GAAd,CAAkB,MAAlB,CAA1B;IACD;;IAED,iBAAiB,CAAC,CAAD,EAAI,IAAI,GAAJ,CAAQ,aAAR,CAAJ,CAAjB;EACD,CAVD;;EAYA,MAAM,UAAU,GAAmC,CAAC,CAAD,EAAI,MAAJ,EAAY,aAAZ,KAA6B;IAC9E,IAAI,aAAa,CAAC,GAAd,CAAkB,MAAlB,CAAJ,EAA+B;MAC7B,aAA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1B,KAAiE;IAClF,OAAO,aAAa,CAAC,GAAd,CAAkB,MAAlB,CAAP;EACD,CAFD;;EAIA,MAAM,UAAU,GAAmC,CAAC,CAAD,EAAI,MAAJ,KAAc;IAC/D,iBAAiB,CAAC,CAAD,EAAI,IAAI,GAAJ,CAAQ,CAAC,MAAD,CAAR,CAAJ,CAAjB;EACD,CAFD;;EAIA,OAAO;IACL,YAAY,EAAE,UADT;IAEL,UAFK;IAGL,cAAc,EAAE,MAAK;MACnB,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;QACzC,MAAM,IAAI,KAAJ,CAAU,6EAAV,CAAN;MACD;;MAED,OAAO,SAAP;IACD,CATI;IAUL,UAVK;IAWL,UAXK;IAYL;EAZK,CAAP;AAcD","sourcesContent":["import * as React from 'react';\nimport { SelectionMode } from './types';\n\ntype OnSelectionChangeCallback = (e: React.SyntheticEvent | Event, selectedItems: Set<SelectionItemId>) => void;\n\nexport interface SelectionManager {\n toggleItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n selectItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n deselectItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n clearItems(e: React.SyntheticEvent | Event): void;\n isSelected(id: SelectionItemId, selectedItems: Set<SelectionItemId>): boolean;\n toggleAllItems(\n e: React.SyntheticEvent | Event,\n itemIds: SelectionItemId[],\n selectedItems: Set<SelectionItemId>,\n ): void;\n}\n\nexport type SelectionItemId = string | number;\n\nexport function createSelectionManager(\n mode: SelectionMode,\n onSelectionChange: OnSelectionChangeCallback = () => undefined,\n): SelectionManager {\n const managerFactory = mode === 'multiselect' ? createMultipleSelectionManager : createSingleSelectionManager;\n\n return managerFactory(onSelectionChange);\n}\n\nfunction createMultipleSelectionManager(onSelectionChange: OnSelectionChangeCallback): SelectionManager {\n const toggleAllItems: SelectionManager['toggleAllItems'] = (e, itemIds, selectedItems) => {\n const allItemsSelected = itemIds.every(itemId => selectedItems.has(itemId));\n\n if (allItemsSelected) {\n selectedItems.clear();\n } else {\n itemIds.forEach(itemId => selectedItems.add(itemId));\n }\n\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const toggleItem: SelectionManager['toggleItem'] = (e, itemId, selectedItems) => {\n if (selectedItems.has(itemId)) {\n selectedItems.delete(itemId);\n } else {\n selectedItems.add(itemId);\n }\n\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const selectItem: SelectionManager['selectItem'] = (e, itemId, selectedItems) => {\n selectedItems.add(itemId);\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const deselectItem: SelectionManager['deselectItem'] = (e, itemId, selectedItems) => {\n selectedItems.delete(itemId);\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const clearItems: SelectionManager['clearItems'] = e => {\n onSelectionChange(e, new Set());\n };\n\n const isSelected = (itemId: SelectionItemId, selectedItems: Set<SelectionItemId>) => {\n return selectedItems.has(itemId);\n };\n\n return {\n toggleItem,\n selectItem,\n deselectItem,\n clearItems,\n isSelected,\n toggleAllItems,\n };\n}\n\nfunction createSingleSelectionManager(onSelectionChange: OnSelectionChangeCallback): SelectionManager {\n const toggleItem: SelectionManager['toggleItem'] = (e, itemId) => {\n onSelectionChange(e, new Set([itemId]));\n };\n\n const clearItems: SelectionManager['clearItems'] = e => {\n onSelectionChange(e, new Set<SelectionItemId>());\n };\n\n const isSelected = (itemId: SelectionItemId, selectedItems: Set<SelectionItemId>) => {\n return selectedItems.has(itemId);\n };\n\n const selectItem: SelectionManager['selectItem'] = (e, itemId) => {\n onSelectionChange(e, new Set([itemId]));\n };\n\n return {\n deselectItem: clearItems,\n selectItem,\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-table]: `toggleAllItems` should not be used in single selection mode');\n }\n\n return undefined;\n },\n toggleItem,\n clearItems,\n isSelected,\n };\n}\n"],"sourceRoot":"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CAAC;;MAGhG,OAAOzB,SAAS;IAClB,CAAC;IACDgB,UAAU;IACVI,UAAU;IACVC;GACD;AACH","names":["createSelectionManager","mode","onSelectionChange","undefined","managerFactory","createMultipleSelectionManager","createSingleSelectionManager","toggleAllItems","e","itemIds","selectedItems","allItemsSelected","every","itemId","has","clear","forEach","add","Set","toggleItem","delete","selectItem","deselectItem","clearItems","isSelected","process","env","NODE_ENV","Error"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/selectionManager.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionMode } from './types';\n\ntype OnSelectionChangeCallback = (e: React.SyntheticEvent | Event, selectedItems: Set<SelectionItemId>) => void;\n\nexport interface SelectionManager {\n toggleItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n selectItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n deselectItem(e: React.SyntheticEvent | Event, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n clearItems(e: React.SyntheticEvent | Event): void;\n isSelected(id: SelectionItemId, selectedItems: Set<SelectionItemId>): boolean;\n toggleAllItems(\n e: React.SyntheticEvent | Event,\n itemIds: SelectionItemId[],\n selectedItems: Set<SelectionItemId>,\n ): void;\n}\n\nexport type SelectionItemId = string | number;\n\nexport function createSelectionManager(\n mode: SelectionMode,\n onSelectionChange: OnSelectionChangeCallback = () => undefined,\n): SelectionManager {\n const managerFactory = mode === 'multiselect' ? createMultipleSelectionManager : createSingleSelectionManager;\n\n return managerFactory(onSelectionChange);\n}\n\nfunction createMultipleSelectionManager(onSelectionChange: OnSelectionChangeCallback): SelectionManager {\n const toggleAllItems: SelectionManager['toggleAllItems'] = (e, itemIds, selectedItems) => {\n const allItemsSelected = itemIds.every(itemId => selectedItems.has(itemId));\n\n if (allItemsSelected) {\n selectedItems.clear();\n } else {\n itemIds.forEach(itemId => selectedItems.add(itemId));\n }\n\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const toggleItem: SelectionManager['toggleItem'] = (e, itemId, selectedItems) => {\n if (selectedItems.has(itemId)) {\n selectedItems.delete(itemId);\n } else {\n selectedItems.add(itemId);\n }\n\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const selectItem: SelectionManager['selectItem'] = (e, itemId, selectedItems) => {\n selectedItems.add(itemId);\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const deselectItem: SelectionManager['deselectItem'] = (e, itemId, selectedItems) => {\n selectedItems.delete(itemId);\n onSelectionChange(e, new Set(selectedItems));\n };\n\n const clearItems: SelectionManager['clearItems'] = e => {\n onSelectionChange(e, new Set());\n };\n\n const isSelected = (itemId: SelectionItemId, selectedItems: Set<SelectionItemId>) => {\n return selectedItems.has(itemId);\n };\n\n return {\n toggleItem,\n selectItem,\n deselectItem,\n clearItems,\n isSelected,\n toggleAllItems,\n };\n}\n\nfunction createSingleSelectionManager(onSelectionChange: OnSelectionChangeCallback): SelectionManager {\n const toggleItem: SelectionManager['toggleItem'] = (e, itemId) => {\n onSelectionChange(e, new Set([itemId]));\n };\n\n const clearItems: SelectionManager['clearItems'] = e => {\n onSelectionChange(e, new Set<SelectionItemId>());\n };\n\n const isSelected = (itemId: SelectionItemId, selectedItems: Set<SelectionItemId>) => {\n return selectedItems.has(itemId);\n };\n\n const selectItem: SelectionManager['selectItem'] = (e, itemId) => {\n onSelectionChange(e, new Set([itemId]));\n };\n\n return {\n deselectItem: clearItems,\n selectItem,\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-table]: `toggleAllItems` should not be used in single selection mode');\n }\n\n return undefined;\n },\n toggleItem,\n clearItems,\n isSelected,\n };\n}\n"]}
@@ -1,8 +1,6 @@
1
1
  import { defaultTableSelectionState } from './useTableSelection';
2
2
  import { defaultTableSortState } from './useTableSort';
3
-
4
3
  const defaultRowEnhancer = row => row;
5
-
6
4
  export const defaultTableState = {
7
5
  selection: defaultTableSelectionState,
8
6
  sort: defaultTableSortState,
@@ -17,16 +15,13 @@ export function useTableFeatures(options, plugins = []) {
17
15
  getRowId,
18
16
  columns
19
17
  } = options;
20
-
21
18
  const getRows = (rowEnhancer = defaultRowEnhancer) => items.map((item, i) => {
22
19
  var _a;
23
-
24
20
  return rowEnhancer({
25
21
  item,
26
22
  rowId: (_a = getRowId === null || getRowId === void 0 ? void 0 : getRowId(item)) !== null && _a !== void 0 ? _a : i
27
23
  });
28
24
  });
29
-
30
25
  const initialState = {
31
26
  getRowId,
32
27
  items,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/hooks/useTableFeatures.ts"],"names":[],"mappings":"AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,qBAAT,QAAsC,gBAAtC;;AAEA,MAAM,kBAAkB,GAA4C,GAAG,IAAI,GAA3E;;AAEA,OAAO,MAAM,iBAAiB,GAAwB;EACpD,SAAS,EAAE,0BADyC;EAEpD,IAAI,EAAE,qBAF8C;EAGpD,OAAO,EAAE,MAAM,EAHqC;EAIpD,QAAQ,EAAE,MAAM,EAJoC;EAKpD,KAAK,EAAE,EAL6C;EAMpD,OAAO,EAAE;AAN2C,CAA/C;AASP,OAAM,SAAU,gBAAV,CACJ,OADI,EAEJ,OAAA,GAA8B,EAF1B,EAE4B;EAEhC,MAAM;IAAE,KAAF;IAAS,QAAT;IAAmB;EAAnB,IAA+B,OAArC;;EAEA,MAAM,OAAO,GAAG,CACd,WAAA,GAAc,kBADA,KAEX,KAAK,CAAC,GAAN,CAAU,CAAC,IAAD,EAAO,CAAP,KAAY;IAAA,IAAA,EAAA;;IAAC,OAAA,WAAW,CAAC;MAAE,IAAF;MAAQ,KAAK,EAAE,CAAA,EAAA,GAAA,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAQ,KAAA,CAAR,GAAA,QAAQ,CAAG,IAAH,CAAR,MAAgB,IAAhB,IAAgB,EAAA,KAAA,KAAA,CAAhB,GAAgB,EAAhB,GAAoB;IAAnC,CAAD,CAAX;EAAmD,CAA1E,CAFL;;EAIA,MAAM,YAAY,GAAsB;IACtC,QADsC;IAEtC,KAFsC;IAGtC,OAHsC;IAItC,OAJsC;IAKtC,SAAS,EAAE,0BAL2B;IAMtC,IAAI,EAAE;EANgC,CAAxC;EASA,OAAO,OAAO,CAAC,MAAR,CAAe,CAAC,KAAD,EAAQ,MAAR,KAAmB,MAAM,CAAC,KAAD,CAAxC,EAAiD,YAAjD,CAAP;AACD","sourcesContent":["import type { UseTableOptions, TableState, RowState, RowEnhancer, TableStatePlugin, TableSortState } from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, RowState<unknown>> = row => row;\n\nexport const defaultTableState: TableState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableOptions<TItem>,\n plugins: TableStatePlugin[] = [],\n): TableState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = <TRowState extends RowState<TItem>>(\n rowEnhancer = defaultRowEnhancer as RowEnhancer<TItem, TRowState>,\n ) => items.map((item, i) => rowEnhancer({ item, rowId: getRowId?.(item) ?? i }));\n\n const initialState: TableState<TItem> = {\n getRowId,\n items,\n columns,\n getRows,\n selection: defaultTableSelectionState,\n sort: defaultTableSortState as TableSortState<TItem>,\n };\n\n return plugins.reduce((state, plugin) => plugin(state), initialState);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,qBAAqB,QAAQ,gBAAgB;AAEtD,MAAMC,kBAAkB,GAA4CC,GAAG,IAAIA,GAAG;AAE9E,OAAO,MAAMC,iBAAiB,GAAwB;EACpDC,SAAS,EAAEL,0BAA0B;EACrCM,IAAI,EAAEL,qBAAqB;EAC3BM,OAAO,EAAE,MAAM,EAAE;EACjBC,QAAQ,EAAE,MAAM,EAAE;EAClBC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE;CACV;AAED,OAAM,SAAUC,gBAAgB,CAC9BC,OAA+B,EAC/BC,UAA8B,EAAE;EAEhC,MAAM;IAAEJ,KAAK;IAAED,QAAQ;IAAEE;EAAO,CAAE,GAAGE,OAAO;EAE5C,MAAML,OAAO,GAAG,CACdO,cAAcZ,kBAAmD,KAC9DO,KAAK,CAACM,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,KAAI;IAAA;IAAC,kBAAW,CAAC;MAAED,IAAI;MAAEE,KAAK,EAAE,cAAQ,aAARV,QAAQ,uBAARA,QAAQ,CAAGQ,IAAI,CAAC,mCAAIC;IAAC,CAAE,CAAC;EAAA,EAAC;EAEhF,MAAME,YAAY,GAAsB;IACtCX,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPH,OAAO;IACPF,SAAS,EAAEL,0BAA0B;IACrCM,IAAI,EAAEL;GACP;EAED,OAAOY,OAAO,CAACO,MAAM,CAAC,CAACC,KAAK,EAAEC,MAAM,KAAKA,MAAM,CAACD,KAAK,CAAC,EAAEF,YAAY,CAAC;AACvE","names":["defaultTableSelectionState","defaultTableSortState","defaultRowEnhancer","row","defaultTableState","selection","sort","getRows","getRowId","items","columns","useTableFeatures","options","plugins","rowEnhancer","map","item","i","rowId","initialState","reduce","state","plugin"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableFeatures.ts"],"sourcesContent":["import type { UseTableOptions, TableState, RowState, RowEnhancer, TableStatePlugin, TableSortState } from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, RowState<unknown>> = row => row;\n\nexport const defaultTableState: TableState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableOptions<TItem>,\n plugins: TableStatePlugin[] = [],\n): TableState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = <TRowState extends RowState<TItem>>(\n rowEnhancer = defaultRowEnhancer as RowEnhancer<TItem, TRowState>,\n ) => items.map((item, i) => rowEnhancer({ item, rowId: getRowId?.(item) ?? i }));\n\n const initialState: TableState<TItem> = {\n getRowId,\n items,\n columns,\n getRows,\n selection: defaultTableSelectionState,\n sort: defaultTableSortState as TableSortState<TItem>,\n };\n\n return plugins.reduce((state, plugin) => plugin(state), initialState);\n}\n"]}
@@ -1,9 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useControllableState, useEventCallback } from '@fluentui/react-utilities';
3
3
  import { createSelectionManager } from './selectionManager';
4
-
5
4
  const noop = () => undefined;
6
-
7
5
  export const defaultTableSelectionState = {
8
6
  allRowsSelected: false,
9
7
  clearRows: noop,
@@ -50,17 +48,15 @@ export function useTableSelectionState(tableState, options) {
50
48
  const toggleAllRows = useEventCallback(e => {
51
49
  selectionManager.toggleAllItems(e, items.map((item, i) => {
52
50
  var _a;
53
-
54
51
  return (_a = getRowId === null || getRowId === void 0 ? void 0 : getRowId(item)) !== null && _a !== void 0 ? _a : i;
55
52
  }), selected);
56
53
  });
57
54
  const toggleRow = useEventCallback((e, rowId) => selectionManager.toggleItem(e, rowId, selected));
58
55
  const deselectRow = useEventCallback((e, rowId) => selectionManager.deselectItem(e, rowId, selected));
59
56
  const selectRow = useEventCallback((e, rowId) => selectionManager.selectItem(e, rowId, selected));
60
-
61
57
  const isRowSelected = rowId => selectionManager.isSelected(rowId, selected);
62
-
63
- return { ...tableState,
58
+ return {
59
+ ...tableState,
64
60
  selection: {
65
61
  selectionMode,
66
62
  someRowsSelected: selected.size > 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-table/src/hooks/useTableSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,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A6B,QAAQ,CAAC,IAAT,GAAgB,CAA7C,GAAiD,QAAQ,CAAC,IAAT,KAAkB,KAAK,CAAC,MAHjF;MAIT,YAAY,EAAE,QAJL;MAKT,SALS;MAMT,aANS;MAOT,SAAS,EAAE,gBAAgB,CAAC,UAPnB;MAQT,WARS;MAST,SATS;MAUT;IAVS;EAFN,CAAP;AAeD","sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport { createSelectionManager } from './selectionManager';\nimport type { RowId, TableSelectionState, TableState, UseTableSelectionOptions } from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSelectionState: TableSelectionState = {\n allRowsSelected: false,\n clearRows: noop,\n deselectRow: noop,\n isRowSelected: () => false,\n selectRow: noop,\n selectedRows: new Set(),\n someRowsSelected: false,\n toggleAllRows: noop,\n toggleRow: noop,\n selectionMode: 'multiselect',\n};\n\nexport function useTableSelection<TItem>(options: UseTableSelectionOptions) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableState<TItem>) => useTableSelectionState(tableState, options);\n}\n\nexport function useTableSelectionState<TItem>(\n tableState: TableState<TItem>,\n options: UseTableSelectionOptions,\n): TableState<TItem> {\n const { items, getRowId } = tableState;\n const { selectionMode, defaultSelectedItems, selectedItems, onSelectionChange } = options;\n\n const [selected, setSelected] = useControllableState({\n initialState: new Set<RowId>(),\n defaultState: defaultSelectedItems,\n state: selectedItems,\n });\n\n const selectionManager = React.useMemo(() => {\n return createSelectionManager(selectionMode, (e, newSelectedItems) => {\n setSelected(() => {\n onSelectionChange?.(e as React.SyntheticEvent, { selectedItems: newSelectedItems });\n return newSelectedItems;\n });\n });\n }, [onSelectionChange, selectionMode, setSelected]);\n\n const toggleAllRows: TableSelectionState['toggleAllRows'] = useEventCallback(e => {\n selectionManager.toggleAllItems(\n e,\n items.map((item, i) => getRowId?.(item) ?? i),\n selected,\n );\n });\n\n const toggleRow: TableSelectionState['toggleRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.toggleItem(e, rowId, selected),\n );\n\n const deselectRow: TableSelectionState['deselectRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.deselectItem(e, rowId, selected),\n );\n\n const selectRow: TableSelectionState['selectRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.selectItem(e, rowId, selected),\n );\n\n const isRowSelected: TableSelectionState['isRowSelected'] = (rowId: RowId) =>\n selectionManager.isSelected(rowId, selected);\n\n return {\n ...tableState,\n selection: {\n selectionMode,\n someRowsSelected: selected.size > 0,\n allRowsSelected: selectionMode === 'single' ? selected.size > 0 : selected.size === items.length,\n selectedRows: selected,\n toggleRow,\n toggleAllRows,\n clearRows: selectionManager.clearItems,\n deselectRow,\n selectRow,\n isRowSelected,\n },\n };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,oBAAoB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAClF,SAASC,sBAAsB,QAAQ,oBAAoB;AAG3D,MAAMC,IAAI,GAAG,MAAMC,SAAS;AAE5B,OAAO,MAAMC,0BAA0B,GAAwB;EAC7DC,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAEJ,IAAI;EACfK,WAAW,EAAEL,IAAI;EACjBM,aAAa,EAAE,MAAM,KAAK;EAC1BC,SAAS,EAAEP,IAAI;EACfQ,YAAY,eAAE,IAAIC,GAAG,EAAE;EACvBC,gBAAgB,EAAE,KAAK;EACvBC,aAAa,EAAEX,IAAI;EACnBY,SAAS,EAAEZ,IAAI;EACfa,aAAa,EAAE;CAChB;AAED,OAAM,SAAUC,iBAAiB,CAAQC,OAAiC;EACxE;EACA;EACA,OAAQC,UAA6B,IAAKC,sBAAsB,CAACD,UAAU,EAAED,OAAO,CAAC;AACvF;AAEA,OAAM,SAAUE,sBAAsB,CACpCD,UAA6B,EAC7BD,OAAiC;EAEjC,MAAM;IAAE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CAACU,YAAY,CAACR,CAAC,EAAEM,KAAK,EAAEb,QAAQ,CAAC,CAClD;EAED,MAAMhB,SAAS,GAAqCT,gBAAgB,CAAC,CAACgC,CAAC,EAAEM,KAAY,KACnFR,gBAAgB,CAACW,UAAU,CAACT,CAAC,EAAEM,KAAK,EAAEb,QAAQ,CAAC,CAChD;EAED,MAAMjB,aAAa,GAA0C8B,KAAY,IACvER,gBAAgB,CAACY,UAAU,CAACJ,KAAK,EAAEb,QAAQ,CAAC;EAE9C,OAAO;IACL,GAAGP,UAAU;IACbyB,SAAS,EAAE;MACT5B,aAAa;MACbH,gBAAgB,EAAEa,QAAQ,CAACmB,IAAI,GAAG,CAAC;MACnCvC,eAAe,EAAEU,aAAa,KAAK,QAAQ,GAAGU,QAAQ,CAACmB,IAAI,GAAG,CAAC,GAAGnB,QAAQ,CAACmB,IAAI,KAAKxB,KAAK,CAACyB,MAAM;MAChGnC,YAAY,EAAEe,QAAQ;MACtBX,SAAS;MACTD,aAAa;MACbP,SAAS,EAAEwB,gBAAgB,CAACgB,UAAU;MACtCvC,WAAW;MACXE,SAAS;MACTD;;GAEH;AACH","names":["React","useControllableState","useEventCallback","createSelectionManager","noop","undefined","defaultTableSelectionState","allRowsSelected","clearRows","deselectRow","isRowSelected","selectRow","selectedRows","Set","someRowsSelected","toggleAllRows","toggleRow","selectionMode","useTableSelection","options","tableState","useTableSelectionState","items","getRowId","defaultSelectedItems","selectedItems","onSelectionChange","selected","setSelected","initialState","defaultState","state","selectionManager","useMemo","e","newSelectedItems","toggleAllItems","map","item","i","rowId","toggleItem","deselectItem","selectItem","isSelected","selection","size","length","clearItems"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport { createSelectionManager } from './selectionManager';\nimport type { RowId, TableSelectionState, TableState, UseTableSelectionOptions } from './types';\n\nconst noop = () => undefined;\n\nexport const defaultTableSelectionState: TableSelectionState = {\n allRowsSelected: false,\n clearRows: noop,\n deselectRow: noop,\n isRowSelected: () => false,\n selectRow: noop,\n selectedRows: new Set(),\n someRowsSelected: false,\n toggleAllRows: noop,\n toggleRow: noop,\n selectionMode: 'multiselect',\n};\n\nexport function useTableSelection<TItem>(options: UseTableSelectionOptions) {\n // False positive, these plugin hooks are intended to be run on every render\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return (tableState: TableState<TItem>) => useTableSelectionState(tableState, options);\n}\n\nexport function useTableSelectionState<TItem>(\n tableState: TableState<TItem>,\n options: UseTableSelectionOptions,\n): TableState<TItem> {\n const { items, getRowId } = tableState;\n const { selectionMode, defaultSelectedItems, selectedItems, onSelectionChange } = options;\n\n const [selected, setSelected] = useControllableState({\n initialState: new Set<RowId>(),\n defaultState: defaultSelectedItems,\n state: selectedItems,\n });\n\n const selectionManager = React.useMemo(() => {\n return createSelectionManager(selectionMode, (e, newSelectedItems) => {\n setSelected(() => {\n onSelectionChange?.(e as React.SyntheticEvent, { selectedItems: newSelectedItems });\n return newSelectedItems;\n });\n });\n }, [onSelectionChange, selectionMode, setSelected]);\n\n const toggleAllRows: TableSelectionState['toggleAllRows'] = useEventCallback(e => {\n selectionManager.toggleAllItems(\n e,\n items.map((item, i) => getRowId?.(item) ?? i),\n selected,\n );\n });\n\n const toggleRow: TableSelectionState['toggleRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.toggleItem(e, rowId, selected),\n );\n\n const deselectRow: TableSelectionState['deselectRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.deselectItem(e, rowId, selected),\n );\n\n const selectRow: TableSelectionState['selectRow'] = useEventCallback((e, rowId: RowId) =>\n selectionManager.selectItem(e, rowId, selected),\n );\n\n const isRowSelected: TableSelectionState['isRowSelected'] = (rowId: RowId) =>\n selectionManager.isSelected(rowId, selected);\n\n return {\n ...tableState,\n selection: {\n selectionMode,\n someRowsSelected: selected.size > 0,\n allRowsSelected: selectionMode === 'single' ? selected.size > 0 : selected.size === items.length,\n selectedRows: selected,\n toggleRow,\n toggleAllRows,\n clearRows: selectionManager.clearItems,\n deselectRow,\n selectRow,\n isRowSelected,\n },\n };\n}\n"]}