@fluentui/react-table 9.0.4 → 9.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/CHANGELOG.json +147 -1
  2. package/CHANGELOG.md +36 -2
  3. package/README.md +552 -2
  4. package/Spec.md +475 -33
  5. package/dist/index.d.ts +3 -3
  6. package/lib/components/DataGrid/DataGrid.js +5 -0
  7. package/lib/components/DataGrid/DataGrid.js.map +1 -1
  8. package/lib/components/DataGrid/renderDataGrid.js.map +1 -1
  9. package/lib/components/DataGrid/useDataGrid.js +32 -4
  10. package/lib/components/DataGrid/useDataGrid.js.map +1 -1
  11. package/lib/components/DataGrid/useDataGridContextValues.js.map +1 -1
  12. package/lib/components/DataGrid/useDataGridStyles.js.map +1 -1
  13. package/lib/components/DataGridBody/DataGridBody.js +5 -0
  14. package/lib/components/DataGridBody/DataGridBody.js.map +1 -1
  15. package/lib/components/DataGridBody/renderDataGridBody.js.map +1 -1
  16. package/lib/components/DataGridBody/useDataGridBody.js.map +1 -1
  17. package/lib/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  18. package/lib/components/DataGridCell/DataGridCell.js +5 -0
  19. package/lib/components/DataGridCell/DataGridCell.js.map +1 -1
  20. package/lib/components/DataGridCell/renderDataGridCell.js.map +1 -1
  21. package/lib/components/DataGridCell/useDataGridCell.js.map +1 -1
  22. package/lib/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  23. package/lib/components/DataGridHeader/DataGridHeader.js +5 -0
  24. package/lib/components/DataGridHeader/DataGridHeader.js.map +1 -1
  25. package/lib/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  26. package/lib/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  27. package/lib/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  28. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js +5 -0
  29. package/lib/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  30. package/lib/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  31. package/lib/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  32. package/lib/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  33. package/lib/components/DataGridRow/DataGridRow.js +5 -0
  34. package/lib/components/DataGridRow/DataGridRow.js.map +1 -1
  35. package/lib/components/DataGridRow/renderDataGridRow.js.map +1 -1
  36. package/lib/components/DataGridRow/useDataGridRow.js.map +1 -1
  37. package/lib/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  38. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js +5 -0
  39. package/lib/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  40. package/lib/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  41. package/lib/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  42. package/lib/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  43. package/lib/components/Table/Table.js +5 -0
  44. package/lib/components/Table/Table.js.map +1 -1
  45. package/lib/components/Table/renderTable.js.map +1 -1
  46. package/lib/components/Table/useTable.js.map +1 -1
  47. package/lib/components/Table/useTableContextValues.js.map +1 -1
  48. package/lib/components/Table/useTableStyles.js.map +1 -1
  49. package/lib/components/TableBody/TableBody.js +5 -0
  50. package/lib/components/TableBody/TableBody.js.map +1 -1
  51. package/lib/components/TableBody/renderTableBody.js.map +1 -1
  52. package/lib/components/TableBody/useTableBody.js.map +1 -1
  53. package/lib/components/TableBody/useTableBodyStyles.js.map +1 -1
  54. package/lib/components/TableCell/TableCell.js +5 -0
  55. package/lib/components/TableCell/TableCell.js.map +1 -1
  56. package/lib/components/TableCell/renderTableCell.js.map +1 -1
  57. package/lib/components/TableCell/useTableCell.js.map +1 -1
  58. package/lib/components/TableCell/useTableCellStyles.js.map +1 -1
  59. package/lib/components/TableCellActions/TableCellActions.js +5 -0
  60. package/lib/components/TableCellActions/TableCellActions.js.map +1 -1
  61. package/lib/components/TableCellActions/renderTableCellActions.js.map +1 -1
  62. package/lib/components/TableCellActions/useTableCellActions.js.map +1 -1
  63. package/lib/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  64. package/lib/components/TableCellLayout/TableCellLayout.js +5 -0
  65. package/lib/components/TableCellLayout/TableCellLayout.js.map +1 -1
  66. package/lib/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  67. package/lib/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  68. package/lib/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  69. package/lib/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  70. package/lib/components/TableHeader/TableHeader.js +5 -0
  71. package/lib/components/TableHeader/TableHeader.js.map +1 -1
  72. package/lib/components/TableHeader/renderTableHeader.js.map +1 -1
  73. package/lib/components/TableHeader/useTableHeader.js.map +1 -1
  74. package/lib/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  75. package/lib/components/TableHeaderCell/TableHeaderCell.js +5 -0
  76. package/lib/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  77. package/lib/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  78. package/lib/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  79. package/lib/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  80. package/lib/components/TableResizeHandle/TableResizeHandle.js +5 -0
  81. package/lib/components/TableResizeHandle/TableResizeHandle.js.map +1 -1
  82. package/lib/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -1
  83. package/lib/components/TableResizeHandle/useTableResizeHandle.js.map +1 -1
  84. package/lib/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -1
  85. package/lib/components/TableRow/TableRow.js +5 -0
  86. package/lib/components/TableRow/TableRow.js.map +1 -1
  87. package/lib/components/TableRow/renderTableRow.js.map +1 -1
  88. package/lib/components/TableRow/useTableRow.js.map +1 -1
  89. package/lib/components/TableRow/useTableRowStyles.js.map +1 -1
  90. package/lib/components/TableSelectionCell/TableSelectionCell.js +5 -0
  91. package/lib/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  92. package/lib/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  93. package/lib/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  94. package/lib/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  95. package/lib/contexts/columnIdContext.js.map +1 -1
  96. package/lib/contexts/dataGridContext.js.map +1 -1
  97. package/lib/contexts/rowIdContext.js.map +1 -1
  98. package/lib/contexts/tableContext.js.map +1 -1
  99. package/lib/contexts/tableHeaderContext.js.map +1 -1
  100. package/lib/hooks/createColumn.js.map +1 -1
  101. package/lib/hooks/selectionManager.js.map +1 -1
  102. package/lib/hooks/types.js.map +1 -1
  103. package/lib/hooks/useMeasureElement.js.map +1 -1
  104. package/lib/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
  105. package/lib/hooks/useTableColumnResizeState.js.map +1 -1
  106. package/lib/hooks/useTableColumnSizing.js.map +1 -1
  107. package/lib/hooks/useTableFeatures.js.map +1 -1
  108. package/lib/hooks/useTableSelection.js +8 -2
  109. package/lib/hooks/useTableSelection.js.map +1 -1
  110. package/lib/hooks/useTableSort.js.map +1 -1
  111. package/lib/index.js.map +1 -1
  112. package/lib/utils/columnResizeUtils.js.map +1 -1
  113. package/lib-amd/components/DataGrid/DataGrid.js +3 -1
  114. package/lib-amd/components/DataGrid/DataGrid.js.map +1 -1
  115. package/lib-amd/components/DataGrid/useDataGrid.js +24 -2
  116. package/lib-amd/components/DataGrid/useDataGrid.js.map +1 -1
  117. package/lib-amd/components/DataGridBody/DataGridBody.js +3 -1
  118. package/lib-amd/components/DataGridBody/DataGridBody.js.map +1 -1
  119. package/lib-amd/components/DataGridCell/DataGridCell.js +3 -1
  120. package/lib-amd/components/DataGridCell/DataGridCell.js.map +1 -1
  121. package/lib-amd/components/DataGridHeader/DataGridHeader.js +3 -1
  122. package/lib-amd/components/DataGridHeader/DataGridHeader.js.map +1 -1
  123. package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.js +3 -1
  124. package/lib-amd/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  125. package/lib-amd/components/DataGridRow/DataGridRow.js +3 -1
  126. package/lib-amd/components/DataGridRow/DataGridRow.js.map +1 -1
  127. package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.js +3 -1
  128. package/lib-amd/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  129. package/lib-amd/components/Table/Table.js +3 -1
  130. package/lib-amd/components/Table/Table.js.map +1 -1
  131. package/lib-amd/components/TableBody/TableBody.js +3 -1
  132. package/lib-amd/components/TableBody/TableBody.js.map +1 -1
  133. package/lib-amd/components/TableCell/TableCell.js +3 -1
  134. package/lib-amd/components/TableCell/TableCell.js.map +1 -1
  135. package/lib-amd/components/TableCellActions/TableCellActions.js +3 -1
  136. package/lib-amd/components/TableCellActions/TableCellActions.js.map +1 -1
  137. package/lib-amd/components/TableCellLayout/TableCellLayout.js +3 -1
  138. package/lib-amd/components/TableCellLayout/TableCellLayout.js.map +1 -1
  139. package/lib-amd/components/TableHeader/TableHeader.js +3 -1
  140. package/lib-amd/components/TableHeader/TableHeader.js.map +1 -1
  141. package/lib-amd/components/TableHeaderCell/TableHeaderCell.js +3 -1
  142. package/lib-amd/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  143. package/lib-amd/components/TableResizeHandle/TableResizeHandle.js +3 -1
  144. package/lib-amd/components/TableResizeHandle/TableResizeHandle.js.map +1 -1
  145. package/lib-amd/components/TableRow/TableRow.js +3 -1
  146. package/lib-amd/components/TableRow/TableRow.js.map +1 -1
  147. package/lib-amd/components/TableSelectionCell/TableSelectionCell.js +3 -1
  148. package/lib-amd/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  149. package/lib-amd/hooks/types.js.map +1 -1
  150. package/lib-amd/hooks/useTableColumnResizeState.js +29 -27
  151. package/lib-amd/hooks/useTableColumnResizeState.js.map +1 -1
  152. package/lib-amd/hooks/useTableSelection.js +8 -2
  153. package/lib-amd/hooks/useTableSelection.js.map +1 -1
  154. package/lib-amd/index.js.map +1 -1
  155. package/lib-amd/utils/columnResizeUtils.js.map +1 -1
  156. package/lib-commonjs/DataGrid.js.map +1 -1
  157. package/lib-commonjs/DataGridBody.js.map +1 -1
  158. package/lib-commonjs/DataGridCell.js.map +1 -1
  159. package/lib-commonjs/DataGridHeader.js.map +1 -1
  160. package/lib-commonjs/DataGridHeaderCell.js.map +1 -1
  161. package/lib-commonjs/DataGridRow.js.map +1 -1
  162. package/lib-commonjs/DataGridSelectionCell.js.map +1 -1
  163. package/lib-commonjs/Table.js.map +1 -1
  164. package/lib-commonjs/TableBody.js.map +1 -1
  165. package/lib-commonjs/TableCell.js.map +1 -1
  166. package/lib-commonjs/TableCellActions.js.map +1 -1
  167. package/lib-commonjs/TableCellLayout.js.map +1 -1
  168. package/lib-commonjs/TableCellPrimaryLayout.js.map +1 -1
  169. package/lib-commonjs/TableHeader.js.map +1 -1
  170. package/lib-commonjs/TableHeaderCell.js.map +1 -1
  171. package/lib-commonjs/TableResizeHandle.js.map +1 -1
  172. package/lib-commonjs/TableRow.js.map +1 -1
  173. package/lib-commonjs/TableSelectionCell.js.map +1 -1
  174. package/lib-commonjs/components/DataGrid/DataGrid.js +5 -0
  175. package/lib-commonjs/components/DataGrid/DataGrid.js.map +1 -1
  176. package/lib-commonjs/components/DataGrid/DataGrid.types.js.map +1 -1
  177. package/lib-commonjs/components/DataGrid/index.js.map +1 -1
  178. package/lib-commonjs/components/DataGrid/renderDataGrid.js.map +1 -1
  179. package/lib-commonjs/components/DataGrid/useDataGrid.js +30 -2
  180. package/lib-commonjs/components/DataGrid/useDataGrid.js.map +1 -1
  181. package/lib-commonjs/components/DataGrid/useDataGridContextValues.js.map +1 -1
  182. package/lib-commonjs/components/DataGrid/useDataGridStyles.js.map +1 -1
  183. package/lib-commonjs/components/DataGridBody/DataGridBody.js +5 -0
  184. package/lib-commonjs/components/DataGridBody/DataGridBody.js.map +1 -1
  185. package/lib-commonjs/components/DataGridBody/DataGridBody.types.js.map +1 -1
  186. package/lib-commonjs/components/DataGridBody/index.js.map +1 -1
  187. package/lib-commonjs/components/DataGridBody/renderDataGridBody.js.map +1 -1
  188. package/lib-commonjs/components/DataGridBody/useDataGridBody.js.map +1 -1
  189. package/lib-commonjs/components/DataGridBody/useDataGridBodyStyles.js.map +1 -1
  190. package/lib-commonjs/components/DataGridCell/DataGridCell.js +5 -0
  191. package/lib-commonjs/components/DataGridCell/DataGridCell.js.map +1 -1
  192. package/lib-commonjs/components/DataGridCell/DataGridCell.types.js.map +1 -1
  193. package/lib-commonjs/components/DataGridCell/index.js.map +1 -1
  194. package/lib-commonjs/components/DataGridCell/renderDataGridCell.js.map +1 -1
  195. package/lib-commonjs/components/DataGridCell/useDataGridCell.js.map +1 -1
  196. package/lib-commonjs/components/DataGridCell/useDataGridCellStyles.js.map +1 -1
  197. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js +5 -0
  198. package/lib-commonjs/components/DataGridHeader/DataGridHeader.js.map +1 -1
  199. package/lib-commonjs/components/DataGridHeader/DataGridHeader.types.js.map +1 -1
  200. package/lib-commonjs/components/DataGridHeader/index.js.map +1 -1
  201. package/lib-commonjs/components/DataGridHeader/renderDataGridHeader.js.map +1 -1
  202. package/lib-commonjs/components/DataGridHeader/useDataGridHeader.js.map +1 -1
  203. package/lib-commonjs/components/DataGridHeader/useDataGridHeaderStyles.js.map +1 -1
  204. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js +5 -0
  205. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.js.map +1 -1
  206. package/lib-commonjs/components/DataGridHeaderCell/DataGridHeaderCell.types.js.map +1 -1
  207. package/lib-commonjs/components/DataGridHeaderCell/index.js.map +1 -1
  208. package/lib-commonjs/components/DataGridHeaderCell/renderDataGridHeaderCell.js.map +1 -1
  209. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCell.js.map +1 -1
  210. package/lib-commonjs/components/DataGridHeaderCell/useDataGridHeaderCellStyles.js.map +1 -1
  211. package/lib-commonjs/components/DataGridRow/DataGridRow.js +5 -0
  212. package/lib-commonjs/components/DataGridRow/DataGridRow.js.map +1 -1
  213. package/lib-commonjs/components/DataGridRow/DataGridRow.types.js.map +1 -1
  214. package/lib-commonjs/components/DataGridRow/index.js.map +1 -1
  215. package/lib-commonjs/components/DataGridRow/renderDataGridRow.js.map +1 -1
  216. package/lib-commonjs/components/DataGridRow/useDataGridRow.js.map +1 -1
  217. package/lib-commonjs/components/DataGridRow/useDataGridRowStyles.js.map +1 -1
  218. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js +5 -0
  219. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.js.map +1 -1
  220. package/lib-commonjs/components/DataGridSelectionCell/DataGridSelectionCell.types.js.map +1 -1
  221. package/lib-commonjs/components/DataGridSelectionCell/index.js.map +1 -1
  222. package/lib-commonjs/components/DataGridSelectionCell/renderDataGridSelectionCell.js.map +1 -1
  223. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCell.js.map +1 -1
  224. package/lib-commonjs/components/DataGridSelectionCell/useDataGridSelectionCellStyles.js.map +1 -1
  225. package/lib-commonjs/components/Table/Table.js +5 -0
  226. package/lib-commonjs/components/Table/Table.js.map +1 -1
  227. package/lib-commonjs/components/Table/Table.types.js.map +1 -1
  228. package/lib-commonjs/components/Table/index.js.map +1 -1
  229. package/lib-commonjs/components/Table/renderTable.js.map +1 -1
  230. package/lib-commonjs/components/Table/useTable.js.map +1 -1
  231. package/lib-commonjs/components/Table/useTableContextValues.js.map +1 -1
  232. package/lib-commonjs/components/Table/useTableStyles.js.map +1 -1
  233. package/lib-commonjs/components/TableBody/TableBody.js +5 -0
  234. package/lib-commonjs/components/TableBody/TableBody.js.map +1 -1
  235. package/lib-commonjs/components/TableBody/TableBody.types.js.map +1 -1
  236. package/lib-commonjs/components/TableBody/index.js.map +1 -1
  237. package/lib-commonjs/components/TableBody/renderTableBody.js.map +1 -1
  238. package/lib-commonjs/components/TableBody/useTableBody.js.map +1 -1
  239. package/lib-commonjs/components/TableBody/useTableBodyStyles.js.map +1 -1
  240. package/lib-commonjs/components/TableCell/TableCell.js +5 -0
  241. package/lib-commonjs/components/TableCell/TableCell.js.map +1 -1
  242. package/lib-commonjs/components/TableCell/TableCell.types.js.map +1 -1
  243. package/lib-commonjs/components/TableCell/index.js.map +1 -1
  244. package/lib-commonjs/components/TableCell/renderTableCell.js.map +1 -1
  245. package/lib-commonjs/components/TableCell/useTableCell.js.map +1 -1
  246. package/lib-commonjs/components/TableCell/useTableCellStyles.js.map +1 -1
  247. package/lib-commonjs/components/TableCellActions/TableCellActions.js +5 -0
  248. package/lib-commonjs/components/TableCellActions/TableCellActions.js.map +1 -1
  249. package/lib-commonjs/components/TableCellActions/TableCellActions.types.js.map +1 -1
  250. package/lib-commonjs/components/TableCellActions/index.js.map +1 -1
  251. package/lib-commonjs/components/TableCellActions/renderTableCellActions.js.map +1 -1
  252. package/lib-commonjs/components/TableCellActions/useTableCellActions.js.map +1 -1
  253. package/lib-commonjs/components/TableCellActions/useTableCellActionsStyles.js.map +1 -1
  254. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js +5 -0
  255. package/lib-commonjs/components/TableCellLayout/TableCellLayout.js.map +1 -1
  256. package/lib-commonjs/components/TableCellLayout/TableCellLayout.types.js.map +1 -1
  257. package/lib-commonjs/components/TableCellLayout/index.js.map +1 -1
  258. package/lib-commonjs/components/TableCellLayout/renderTableCellLayout.js.map +1 -1
  259. package/lib-commonjs/components/TableCellLayout/useTableCellLayout.js.map +1 -1
  260. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutContextValues.js.map +1 -1
  261. package/lib-commonjs/components/TableCellLayout/useTableCellLayoutStyles.js.map +1 -1
  262. package/lib-commonjs/components/TableHeader/TableHeader.js +5 -0
  263. package/lib-commonjs/components/TableHeader/TableHeader.js.map +1 -1
  264. package/lib-commonjs/components/TableHeader/TableHeader.types.js.map +1 -1
  265. package/lib-commonjs/components/TableHeader/index.js.map +1 -1
  266. package/lib-commonjs/components/TableHeader/renderTableHeader.js.map +1 -1
  267. package/lib-commonjs/components/TableHeader/useTableHeader.js.map +1 -1
  268. package/lib-commonjs/components/TableHeader/useTableHeaderStyles.js.map +1 -1
  269. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js +5 -0
  270. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
  271. package/lib-commonjs/components/TableHeaderCell/TableHeaderCell.types.js.map +1 -1
  272. package/lib-commonjs/components/TableHeaderCell/index.js.map +1 -1
  273. package/lib-commonjs/components/TableHeaderCell/renderTableHeaderCell.js.map +1 -1
  274. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCell.js.map +1 -1
  275. package/lib-commonjs/components/TableHeaderCell/useTableHeaderCellStyles.js.map +1 -1
  276. package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js +5 -0
  277. package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.js.map +1 -1
  278. package/lib-commonjs/components/TableResizeHandle/TableResizeHandle.types.js.map +1 -1
  279. package/lib-commonjs/components/TableResizeHandle/index.js.map +1 -1
  280. package/lib-commonjs/components/TableResizeHandle/renderTableResizeHandle.js.map +1 -1
  281. package/lib-commonjs/components/TableResizeHandle/useTableResizeHandle.js.map +1 -1
  282. package/lib-commonjs/components/TableResizeHandle/useTableResizeHandleStyles.js.map +1 -1
  283. package/lib-commonjs/components/TableRow/TableRow.js +5 -0
  284. package/lib-commonjs/components/TableRow/TableRow.js.map +1 -1
  285. package/lib-commonjs/components/TableRow/TableRow.types.js.map +1 -1
  286. package/lib-commonjs/components/TableRow/index.js.map +1 -1
  287. package/lib-commonjs/components/TableRow/renderTableRow.js.map +1 -1
  288. package/lib-commonjs/components/TableRow/useTableRow.js.map +1 -1
  289. package/lib-commonjs/components/TableRow/useTableRowStyles.js.map +1 -1
  290. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js +5 -0
  291. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.js.map +1 -1
  292. package/lib-commonjs/components/TableSelectionCell/TableSelectionCell.types.js.map +1 -1
  293. package/lib-commonjs/components/TableSelectionCell/index.js.map +1 -1
  294. package/lib-commonjs/components/TableSelectionCell/renderTableSelectionCell.js.map +1 -1
  295. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCell.js.map +1 -1
  296. package/lib-commonjs/components/TableSelectionCell/useTableSelectionCellStyles.js.map +1 -1
  297. package/lib-commonjs/contexts/columnIdContext.js.map +1 -1
  298. package/lib-commonjs/contexts/dataGridContext.js.map +1 -1
  299. package/lib-commonjs/contexts/rowIdContext.js.map +1 -1
  300. package/lib-commonjs/contexts/tableContext.js.map +1 -1
  301. package/lib-commonjs/contexts/tableHeaderContext.js.map +1 -1
  302. package/lib-commonjs/hooks/createColumn.js.map +1 -1
  303. package/lib-commonjs/hooks/index.js.map +1 -1
  304. package/lib-commonjs/hooks/selectionManager.js.map +1 -1
  305. package/lib-commonjs/hooks/types.js.map +1 -1
  306. package/lib-commonjs/hooks/useMeasureElement.js.map +1 -1
  307. package/lib-commonjs/hooks/useTableColumnResizeMouseHandler.js.map +1 -1
  308. package/lib-commonjs/hooks/useTableColumnResizeState.js.map +1 -1
  309. package/lib-commonjs/hooks/useTableColumnSizing.js.map +1 -1
  310. package/lib-commonjs/hooks/useTableFeatures.js.map +1 -1
  311. package/lib-commonjs/hooks/useTableSelection.js +8 -2
  312. package/lib-commonjs/hooks/useTableSelection.js.map +1 -1
  313. package/lib-commonjs/hooks/useTableSort.js.map +1 -1
  314. package/lib-commonjs/index.js.map +1 -1
  315. package/lib-commonjs/utils/columnResizeUtils.js.map +1 -1
  316. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAGnF;;;;;;;;;AASA,OAAO,MAAMC,6BAA6B,GAAG,CAC3CC,KAA6B,EAC7BC,GAA2B,KACD;EAC1B,MAAMC,OAAO,GAAGJ,gBAAgB,CAAEK,KAAuC,IAAI;;IAC3E,WAAK,CAACD,OAAO,+CAAbF,KAAK,EAAWG,KAAK,CAAC;IACtBA,KAAK,CAACC,eAAe,EAAE;EACzB,CAAC,CAAC;EACF,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAET,qBAAqB,CAAC,KAAK,EAAE;MACjCI,GAAG;MACH,GAAGD,KAAK;MACRE;KACD;GACF;AACH,CAAC","names":["getNativeElementProps","useEventCallback","useTableResizeHandle_unstable","props","ref","onClick","event","stopPropagation","components","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandle.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback } from '@fluentui/react-utilities';\nimport type { TableResizeHandleProps, TableResizeHandleState } from './TableResizeHandle.types';\n\n/**\n * Create the state required to render TableResizeHandle.\n *\n * The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,\n * before being passed to renderTableResizeHandle_unstable.\n *\n * @param props - props from this instance of TableResizeHandle\n * @param ref - reference to root HTMLElement of TableResizeHandle\n */\nexport const useTableResizeHandle_unstable = (\n props: TableResizeHandleProps,\n ref: React.Ref<HTMLElement>,\n): TableResizeHandleState => {\n const onClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n props.onClick?.(event);\n event.stopPropagation();\n });\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n onClick,\n }),\n };\n};\n"]}
1
+ {"version":3,"names":["getNativeElementProps","useEventCallback","useTableResizeHandle_unstable","props","ref","onClick","event","_a","call","stopPropagation","components","root"],"sources":["../src/packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandle.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback } from '@fluentui/react-utilities';\nimport type { TableResizeHandleProps, TableResizeHandleState } from './TableResizeHandle.types';\n\n/**\n * Create the state required to render TableResizeHandle.\n *\n * The returned state can be modified with hooks such as useTableResizeHandleStyles_unstable,\n * before being passed to renderTableResizeHandle_unstable.\n *\n * @param props - props from this instance of TableResizeHandle\n * @param ref - reference to root HTMLElement of TableResizeHandle\n */\nexport const useTableResizeHandle_unstable = (\n props: TableResizeHandleProps,\n ref: React.Ref<HTMLElement>,\n): TableResizeHandleState => {\n const onClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n props.onClick?.(event);\n event.stopPropagation();\n });\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n onClick,\n }),\n };\n};\n"],"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAGnF;;;;;;;;;AASA,OAAO,MAAMC,6BAA6B,GAAGA,CAC3CC,KAA6B,EAC7BC,GAA2B,KACD;EAC1B,MAAMC,OAAO,GAAGJ,gBAAgB,CAAEK,KAAuC,IAAI;;IAC3E,CAAAC,EAAA,GAAAJ,KAAK,CAACE,OAAO,cAAAE,EAAA,uBAAAA,EAAA,CAAAC,IAAA,CAAbL,KAAK,EAAWG,KAAK,CAAC;IACtBA,KAAK,CAACG,eAAe,EAAE;EACzB,CAAC,CAAC;EACF,OAAO;IACLC,UAAU,EAAE;MACVC,IAAI,EAAE;KACP;IACDA,IAAI,EAAEX,qBAAqB,CAAC,KAAK,EAAE;MACjCI,GAAG;MACH,GAAGD,KAAK;MACRE;KACD;GACF;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAO,MAAMC,2BAA2B,GAA2C;EACjFC,IAAI,EAAE;EACN;EACA;CACD;AAED;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;AAAA,EA6BhB;AAEF;;;AAGA,OAAO,MAAMC,mCAAmC,GAAIC,KAA6B,IAA4B;EAC3G,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1BE,KAAK,CAACH,IAAI,CAACK,SAAS,GAAGT,YAAY,CAACG,2BAA2B,CAACC,IAAI,EAAEI,MAAM,CAACJ,IAAI,EAAEG,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EACxG,OAAOF,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","tokens","tableResizeHandleClassNames","root","useStyles","useTableResizeHandleStyles_unstable","state","styles","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandleStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TableResizeHandleSlots, TableResizeHandleState } from './TableResizeHandle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const tableResizeHandleClassNames: SlotClassNames<TableResizeHandleSlots> = {\n root: 'fui-TableResizeHandle',\n // TODO: add class names for all slots on TableResizeHandleSlots.\n // Should be of the form `<slotName>: 'fui-TableResizeHandle__<slotName>`\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n right: 0,\n top: 0,\n bottom: 0,\n width: '16px',\n ...shorthands.margin(0, '-8px'),\n cursor: 'col-resize',\n opacity: 0,\n transitionProperty: 'opacity',\n transitionDuration: '.2s',\n zIndex: 1,\n\n ':hover': {\n opacity: 1,\n },\n\n ':after': {\n content: '\" \"',\n display: 'block',\n width: '1px',\n position: 'absolute',\n left: '50%',\n top: 0,\n bottom: 0,\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n});\n\n/**\n * Apply styling to the TableResizeHandle slots based on the state\n */\nexport const useTableResizeHandleStyles_unstable = (state: TableResizeHandleState): TableResizeHandleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableResizeHandleClassNames.root, styles.root, state.root.className);\n return state;\n};\n"]}
1
+ {"version":3,"names":["__styles","mergeClasses","shorthands","tokens","tableResizeHandleClassNames","root","useStyles","qhf8xq","j35jbq","Bhzewxz","B5kzvoi","a9b677","B6of3ja","t21cq0","jrapky","Frg6f3","Bceei9c","abs64n","Bmy1vo4","B3o57yi","Bj3rh1h","B7zu5sd","Bs6t6z0","Fdvyjd","Biobvvw","Hdbjpj","jc51t6","u6d25","Bj55yzk","Bkbwdz4","d","h","useTableResizeHandleStyles_unstable","state","styles","className"],"sources":["../src/packages/react-components/react-table/src/components/TableResizeHandle/useTableResizeHandleStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { TableResizeHandleSlots, TableResizeHandleState } from './TableResizeHandle.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const tableResizeHandleClassNames: SlotClassNames<TableResizeHandleSlots> = {\n root: 'fui-TableResizeHandle',\n // TODO: add class names for all slots on TableResizeHandleSlots.\n // Should be of the form `<slotName>: 'fui-TableResizeHandle__<slotName>`\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'absolute',\n right: 0,\n top: 0,\n bottom: 0,\n width: '16px',\n ...shorthands.margin(0, '-8px'),\n cursor: 'col-resize',\n opacity: 0,\n transitionProperty: 'opacity',\n transitionDuration: '.2s',\n zIndex: 1,\n\n ':hover': {\n opacity: 1,\n },\n\n ':after': {\n content: '\" \"',\n display: 'block',\n width: '1px',\n position: 'absolute',\n left: '50%',\n top: 0,\n bottom: 0,\n backgroundColor: tokens.colorNeutralStroke1,\n },\n },\n});\n\n/**\n * Apply styling to the TableResizeHandle slots based on the state\n */\nexport const useTableResizeHandleStyles_unstable = (state: TableResizeHandleState): TableResizeHandleState => {\n const styles = useStyles();\n state.root.className = mergeClasses(tableResizeHandleClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAO,MAAMC,2BAA2B,GAA2C;EACjFC,IAAI,EAAE;EACN;EACA;CACD;AAED;;;AAGA,MAAMC,SAAS,gBAAGN,QAAA;EAAAK,IAAA;IAAAE,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,KAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;EAAAC,CAAA;AAAA,EA6BhB;AAEF;;;AAGA,OAAO,MAAMC,mCAAmC,GAAIC,KAA6B,IAA4B;EAC3G,MAAMC,MAAM,GAAG5B,SAAS,EAAE;EAC1B2B,KAAK,CAAC5B,IAAI,CAAC8B,SAAS,GAAGlC,YAAY,CAACG,2BAA2B,CAACC,IAAI,EAAE6B,MAAM,CAAC7B,IAAI,EAAE4B,KAAK,CAAC5B,IAAI,CAAC8B,SAAS,CAAC;EACxG,OAAOF,KAAK;AACd,CAAC"}
@@ -2,12 +2,17 @@ import * as React from 'react';
2
2
  import { useTableRow_unstable } from './useTableRow';
3
3
  import { renderTableRow_unstable } from './renderTableRow';
4
4
  import { useTableRowStyles_unstable } from './useTableRowStyles';
5
+ import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
5
6
  /**
6
7
  * TableRow component
7
8
  */
8
9
  export const TableRow = /*#__PURE__*/React.forwardRef((props, ref) => {
9
10
  const state = useTableRow_unstable(props, ref);
10
11
  useTableRowStyles_unstable(state);
12
+ const {
13
+ useTableRowStyles_unstable: useCustomStyles
14
+ } = useCustomStyleHooks_unstable();
15
+ useCustomStyles(state);
11
16
  return renderTableRow_unstable(state);
12
17
  });
13
18
  TableRow.displayName = 'TableRow';
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAIhE;;;AAGA,OAAO,MAAMC,QAAQ,gBAAuCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1F,MAAMC,KAAK,GAAGP,oBAAoB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAE9CJ,0BAA0B,CAACK,KAAK,CAAC;EACjC,OAAON,uBAAuB,CAACM,KAAK,CAAC;AACvC,CAAC,CAAC;AAEFJ,QAAQ,CAACK,WAAW,GAAG,UAAU","names":["React","useTableRow_unstable","renderTableRow_unstable","useTableRowStyles_unstable","TableRow","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableRow/TableRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTableRow_unstable } from './useTableRow';\nimport { renderTableRow_unstable } from './renderTableRow';\nimport { useTableRowStyles_unstable } from './useTableRowStyles';\nimport type { TableRowProps } from './TableRow.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * TableRow component\n */\nexport const TableRow: ForwardRefComponent<TableRowProps> = React.forwardRef((props, ref) => {\n const state = useTableRow_unstable(props, ref);\n\n useTableRowStyles_unstable(state);\n return renderTableRow_unstable(state);\n});\n\nTableRow.displayName = 'TableRow';\n"]}
1
+ {"version":3,"names":["React","useTableRow_unstable","renderTableRow_unstable","useTableRowStyles_unstable","useCustomStyleHooks_unstable","TableRow","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-table/src/components/TableRow/TableRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTableRow_unstable } from './useTableRow';\nimport { renderTableRow_unstable } from './renderTableRow';\nimport { useTableRowStyles_unstable } from './useTableRowStyles';\nimport type { TableRowProps } from './TableRow.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TableRow component\n */\nexport const TableRow: ForwardRefComponent<TableRowProps> = React.forwardRef((props, ref) => {\n const state = useTableRow_unstable(props, ref);\n\n useTableRowStyles_unstable(state);\n\n const { useTableRowStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderTableRow_unstable(state);\n});\n\nTableRow.displayName = 'TableRow';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAGhE,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,QAAQ,gBAAuCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1F,MAAMC,KAAK,GAAGR,oBAAoB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAE9CL,0BAA0B,CAACM,KAAK,CAAC;EAEjC,MAAM;IAAEN,0BAA0B,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACtFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOP,uBAAuB,CAACO,KAAK,CAAC;AACvC,CAAC,CAAC;AAEFJ,QAAQ,CAACM,WAAW,GAAG,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,uBAAuB,GAAIC,KAAoB,IAAI;EAC9D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAgBE,KAAK,CAAC;EAE3D,oBAAOH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,EAAI;AAC3C,CAAC","names":["React","getSlots","renderTableRow_unstable","state","slots","slotProps","root"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableRow/renderTableRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableRowState, TableRowSlots } from './TableRow.types';\n\n/**\n * Render the final JSX of TableRow\n */\nexport const renderTableRow_unstable = (state: TableRowState) => {\n const { slots, slotProps } = getSlots<TableRowSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"]}
1
+ {"version":3,"names":["React","getSlots","renderTableRow_unstable","state","slots","slotProps","createElement","root"],"sources":["../src/packages/react-components/react-table/src/components/TableRow/renderTableRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableRowState, TableRowSlots } from './TableRow.types';\n\n/**\n * Render the final JSX of TableRow\n */\nexport const renderTableRow_unstable = (state: TableRowState) => {\n const { slots, slotProps } = getSlots<TableRowSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,uBAAuB,GAAIC,KAAoB,IAAI;EAC9D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAgBE,KAAK,CAAC;EAE3D,oBAAOH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,EAAI;AAC3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AACA,SAASA,qBAAqB,EAAEC,aAAa,QAAQ,2BAA2B;AAChF,SAASC,eAAe,EAAEC,cAAc,QAAQ,yBAAyB;AAEzE,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;;;;;;;;AASA,OAAO,MAAMC,oBAAoB,GAAG,CAACC,KAAoB,EAAEC,GAA2B,KAAmB;;EACvG,MAAM;IAAEC,gBAAgB;IAAEC;EAAI,CAAE,GAAGN,eAAe,EAAE;EACpD,MAAMO,aAAa,GAAG,YAAK,CAACC,EAAE,mCAAIH,gBAAgB,IAAG,KAAK,GAAG,IAAI;EACjE,MAAMI,eAAe,GAAGX,eAAe,EAAE;EACzC,MAAMY,cAAc,GAAGX,cAAc,EAAE;EACvC,MAAMY,WAAW,GAAGV,kBAAkB,EAAE;EAExC,OAAO;IACLW,UAAU,EAAE;MACVC,IAAI,EAAEN;KACP;IACDM,IAAI,EAAEjB,qBAAqB,CAACW,aAAa,EAAE;MACzCH,GAAG,EAAEP,aAAa,CAACO,GAAG,EAAEK,eAAe,EAAEC,cAAc,CAAC;MACxDI,IAAI,EAAEP,aAAa,KAAK,KAAK,GAAG,KAAK,GAAGQ,SAAS;MACjD,GAAGZ;KACJ,CAAC;IACFG,IAAI;IACJD,gBAAgB;IAChBW,UAAU,EAAE,WAAK,CAACA,UAAU,mCAAI,MAAM;IACtCL;GACD;AACH,CAAC","names":["getNativeElementProps","useMergedRefs","useFocusVisible","useFocusWithin","useTableContext","useIsInTableHeader","useTableRow_unstable","props","ref","noNativeElements","size","rootComponent","as","focusVisibleRef","focusWithinRef","isHeaderRow","components","root","role","undefined","appearance"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableRow/useTableRow.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusVisible, useFocusWithin } from '@fluentui/react-tabster';\nimport type { TableRowProps, TableRowState } from './TableRow.types';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n\n/**\n * Create the state required to render TableRow.\n *\n * The returned state can be modified with hooks such as useTableRowStyles_unstable,\n * before being passed to renderTableRow_unstable.\n *\n * @param props - props from this instance of TableRow\n * @param ref - reference to root HTMLElement of TableRow\n */\nexport const useTableRow_unstable = (props: TableRowProps, ref: React.Ref<HTMLElement>): TableRowState => {\n const { noNativeElements, size } = useTableContext();\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'tr';\n const focusVisibleRef = useFocusVisible();\n const focusWithinRef = useFocusWithin();\n const isHeaderRow = useIsInTableHeader();\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref: useMergedRefs(ref, focusVisibleRef, focusWithinRef),\n role: rootComponent === 'div' ? 'row' : undefined,\n ...props,\n }),\n size,\n noNativeElements,\n appearance: props.appearance ?? 'none',\n isHeaderRow,\n };\n};\n"]}
1
+ {"version":3,"names":["getNativeElementProps","useMergedRefs","useFocusVisible","useFocusWithin","useTableContext","useIsInTableHeader","useTableRow_unstable","props","ref","noNativeElements","size","rootComponent","_a","as","focusVisibleRef","focusWithinRef","isHeaderRow","components","root","role","undefined","appearance","_b"],"sources":["../src/packages/react-components/react-table/src/components/TableRow/useTableRow.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusVisible, useFocusWithin } from '@fluentui/react-tabster';\nimport type { TableRowProps, TableRowState } from './TableRow.types';\nimport { useTableContext } from '../../contexts/tableContext';\nimport { useIsInTableHeader } from '../../contexts/tableHeaderContext';\n\n/**\n * Create the state required to render TableRow.\n *\n * The returned state can be modified with hooks such as useTableRowStyles_unstable,\n * before being passed to renderTableRow_unstable.\n *\n * @param props - props from this instance of TableRow\n * @param ref - reference to root HTMLElement of TableRow\n */\nexport const useTableRow_unstable = (props: TableRowProps, ref: React.Ref<HTMLElement>): TableRowState => {\n const { noNativeElements, size } = useTableContext();\n const rootComponent = props.as ?? noNativeElements ? 'div' : 'tr';\n const focusVisibleRef = useFocusVisible();\n const focusWithinRef = useFocusWithin();\n const isHeaderRow = useIsInTableHeader();\n\n return {\n components: {\n root: rootComponent,\n },\n root: getNativeElementProps(rootComponent, {\n ref: useMergedRefs(ref, focusVisibleRef, focusWithinRef),\n role: rootComponent === 'div' ? 'row' : undefined,\n ...props,\n }),\n size,\n noNativeElements,\n appearance: props.appearance ?? 'none',\n isHeaderRow,\n };\n};\n"],"mappings":"AACA,SAASA,qBAAqB,EAAEC,aAAa,QAAQ,2BAA2B;AAChF,SAASC,eAAe,EAAEC,cAAc,QAAQ,yBAAyB;AAEzE,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE;;;;;;;;;AASA,OAAO,MAAMC,oBAAoB,GAAGA,CAACC,KAAoB,EAAEC,GAA2B,KAAmB;;EACvG,MAAM;IAAEC,gBAAgB;IAAEC;EAAI,CAAE,GAAGN,eAAe,EAAE;EACpD,MAAMO,aAAa,GAAG,EAAAC,EAAA,GAAAL,KAAK,CAACM,EAAE,cAAAD,EAAA,cAAAA,EAAA,GAAIH,gBAAgB,IAAG,KAAK,GAAG,IAAI;EACjE,MAAMK,eAAe,GAAGZ,eAAe,EAAE;EACzC,MAAMa,cAAc,GAAGZ,cAAc,EAAE;EACvC,MAAMa,WAAW,GAAGX,kBAAkB,EAAE;EAExC,OAAO;IACLY,UAAU,EAAE;MACVC,IAAI,EAAEP;KACP;IACDO,IAAI,EAAElB,qBAAqB,CAACW,aAAa,EAAE;MACzCH,GAAG,EAAEP,aAAa,CAACO,GAAG,EAAEM,eAAe,EAAEC,cAAc,CAAC;MACxDI,IAAI,EAAER,aAAa,KAAK,KAAK,GAAG,KAAK,GAAGS,SAAS;MACjD,GAAGb;KACJ,CA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sClassNames","tableSelectionCellClassNames","createCustomFocusIndicatorStyle","tableRowClassName","tableRowClassNames","root","useTableLayoutStyles","useFlexLayoutStyles","useStyles","useTableRowStyles_unstable","state","styles","layoutStyles","table","flex","className","isHeaderRow","rootInteractive","size","noNativeElements","appearance","noAppearanceFocusWithin"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableRow/useTableRowStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableRowSlots, TableRowState } from './TableRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tableCellActionsClassNames } from '../TableCellActions/useTableCellActionsStyles';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\n\nexport const tableRowClassName = 'fui-TableRow';\nexport const tableRowClassNames: SlotClassNames<TableRowSlots> = {\n root: tableRowClassName,\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-row',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n boxSizing: 'border-box',\n ...createCustomFocusIndicatorStyle(\n {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1,\n },\n },\n { selector: 'focus-within', enableOutline: true },\n ),\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 // When focus is within the row the background colour\n // should be the same as hover, except when there is a brand\n // or neutral appearance applied on the row\n noAppearanceFocusWithin: {\n ...createCustomFocusIndicatorStyle(\n {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n { selector: 'focus-within', enableOutline: true },\n ),\n },\n\n rootInteractive: {\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground1Pressed,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1,\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n },\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground1Hover,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1,\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n },\n },\n\n medium: {\n ...shorthands.borderBottom(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n\n small: {\n ...shorthands.borderBottom(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n\n 'extra-small': {\n fontSize: tokens.fontSizeBase200,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground2,\n color: tokens.colorNeutralForeground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStrokeOnBrand),\n ':hover': {\n backgroundColor: tokens.colorBrandBackground2,\n },\n ':active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n },\n\n '@media(forced-colors: active)': {\n ...shorthands.border('2px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px',\n },\n },\n },\n\n neutral: {\n '@media(forced-colors: active)': {\n ...shorthands.border('2px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px',\n },\n },\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground1Hover,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n },\n\n ...shorthands.borderColor(tokens.colorNeutralStrokeOnBrand),\n },\n\n none: {},\n});\n\n/**\n * Apply styling to the TableRow slots based on the state\n */\nexport const useTableRowStyles_unstable = (state: TableRowState): TableRowState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableRowClassNames.root,\n styles.root,\n !state.isHeaderRow && styles.rootInteractive,\n styles[state.size],\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n styles[state.appearance],\n state.appearance === 'none' && !state.isHeaderRow && styles.noAppearanceFocusWithin,\n state.root.className,\n );\n\n return state;\n};\n"]}
1
+ {"version":3,"names":["__styles","mergeClasses","shorthands","tokens","tableCellActionsClassNames","tableSelectionCellClassNames","createCustomFocusIndicatorStyle","tableRowClassName","tableRowClassNames","root","useTableLayoutStyles","mc9l5x","d","useFlexLayoutStyles","Bt984gj","useStyles","sj55zd","B7ck84d","Bconypa","B6guboy","Bn4voq9","g9k6zt","Bfpq7zp","kdpuga","Bw81rd7","B6xbmo0","dm238s","noAppearanceFocusWithin","Bm5rygw","rootInteractive","ecr2s2","lj723h","B43xm9u","i921ia","Jwef8y","Bi91k9c","Bpt6rm4","ff6mpl","medium","Bn0qgzm","oivjwe","B9xav0g","small","Be2twd7","brand","De3pzq","g2u3we","h3c5rm","zhjwy3","gwxt9v","v3aym","Bc736ss","Bk6ri7n","Bk5ld8o","c4eypz","felo30","Eshu5l","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","Beo2b4z","h6lo6r","Btyw6ap","w1pwid","Brwvgy3","yadkgm","neutral","none","a","h","m","useTableRowStyles_unstable","state","styles","layoutStyles","table","flex","className","isHeaderRow","size","noNativeElements","appearance"],"sources":["../src/packages/react-components/react-table/src/components/TableRow/useTableRowStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { TableRowSlots, TableRowState } from './TableRow.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tableCellActionsClassNames } from '../TableCellActions/useTableCellActionsStyles';\nimport { tableSelectionCellClassNames } from '../TableSelectionCell/useTableSelectionCellStyles';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\n\nexport const tableRowClassName = 'fui-TableRow';\nexport const tableRowClassNames: SlotClassNames<TableRowSlots> = {\n root: tableRowClassName,\n};\n\nconst useTableLayoutStyles = makeStyles({\n root: {\n display: 'table-row',\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n },\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground1,\n boxSizing: 'border-box',\n ...createCustomFocusIndicatorStyle(\n {\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1,\n },\n },\n { selector: 'focus-within', enableOutline: true },\n ),\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 // When focus is within the row the background colour\n // should be the same as hover, except when there is a brand\n // or neutral appearance applied on the row\n noAppearanceFocusWithin: {\n ...createCustomFocusIndicatorStyle(\n {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n },\n { selector: 'focus-within', enableOutline: true },\n ),\n },\n\n rootInteractive: {\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n color: tokens.colorNeutralForeground1Pressed,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1,\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n },\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n color: tokens.colorNeutralForeground1Hover,\n [`& .${tableCellActionsClassNames.root}`]: {\n opacity: 1,\n },\n [`& .${tableSelectionCellClassNames.root}`]: {\n opacity: 1,\n },\n },\n },\n\n medium: {\n ...shorthands.borderBottom(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n\n small: {\n ...shorthands.borderBottom(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n\n 'extra-small': {\n fontSize: tokens.fontSizeBase200,\n },\n\n brand: {\n backgroundColor: tokens.colorBrandBackground2,\n color: tokens.colorNeutralForeground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStrokeOnBrand),\n ':hover': {\n backgroundColor: tokens.colorBrandBackground2,\n },\n ':active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n },\n\n '@media(forced-colors: active)': {\n ...shorthands.border('2px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px',\n },\n },\n },\n\n neutral: {\n '@media(forced-colors: active)': {\n ...shorthands.border('2px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n ':focus-visible': {\n outlineOffset: '-4px',\n },\n },\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground1Hover,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n },\n\n ...shorthands.borderColor(tokens.colorNeutralStrokeOnBrand),\n },\n\n none: {},\n});\n\n/**\n * Apply styling to the TableRow slots based on the state\n */\nexport const useTableRowStyles_unstable = (state: TableRowState): TableRowState => {\n const styles = useStyles();\n const layoutStyles = {\n table: useTableLayoutStyles(),\n flex: useFlexLayoutStyles(),\n };\n state.root.className = mergeClasses(\n tableRowClassNames.root,\n styles.root,\n !state.isHeaderRow && styles.rootInteractive,\n styles[state.size],\n state.noNativeElements ? layoutStyles.flex.root : layoutStyles.table.root,\n styles[state.appearance],\n state.app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;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,EAkHhB;AAEF;;;AAGA,OAAO,MAAMC,0BAA0B,GAAIC,KAAoB,IAAmB;EAChF,MAAMC,MAAM,GAAG3D,SAAS,EAAE;EAC1B,MAAM4D,YAAY,GAAG;IACnBC,KAAK,EAAElE,oBAAoB,EAAE;IAC7BmE,IAAI,EAAEhE,mBAAmB;GAC1B;EACD4D,KAAK,CAAChE,IAAI,CAACqE,SAAS,GAAG7E,YAAY,CACjCO,kBAAkB,CAACC,IAAI,EACvBiE,MAAM,CAACjE,IAAI,EACX,CAACgE,KAAK,CAACM,WAAW,IAAIL,MAAM,CAAC7C,eAAe,EAC5C6C,MAAM,CAACD,KAAK,CAACO,IAAI,CAAC,EAClBP,KAAK,CAACQ,gBAAgB,GAAGN,YAAY,CAACE,IAAI,CAACpE,IAAI,GAAGkE,YAAY,CAACC,KAAK,CAACnE,IAAI,EACzEiE,MAAM,CAACD,KAAK,CAACS,UAAU,CAAC,EACxBT,KAAK,CAACS,UAAU,KAAK,MAAM,IAAI,CAACT,KAAK,CAACM,WAAW,IAAIL,MAAM,CAAC/C,uBAAuB,EACnF8C,KAAK,CAAChE,IAAI,CAACqE,SAAS,CACrB;EAED,OAAOL,KAAK;AACd,CAAC"}
@@ -2,12 +2,17 @@ import * as React from 'react';
2
2
  import { useTableSelectionCell_unstable } from './useTableSelectionCell';
3
3
  import { renderTableSelectionCell_unstable } from './renderTableSelectionCell';
4
4
  import { useTableSelectionCellStyles_unstable } from './useTableSelectionCellStyles';
5
+ import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
5
6
  /**
6
7
  * TableSelectionCell component
7
8
  */
8
9
  export const TableSelectionCell = /*#__PURE__*/React.forwardRef((props, ref) => {
9
10
  const state = useTableSelectionCell_unstable(props, ref);
10
11
  useTableSelectionCellStyles_unstable(state);
12
+ const {
13
+ useTableSelectionCellStyles_unstable: useCustomStyles
14
+ } = useCustomStyleHooks_unstable();
15
+ useCustomStyles(state);
11
16
  return renderTableSelectionCell_unstable(state);
12
17
  });
13
18
  TableSelectionCell.displayName = 'TableSelectionCell';
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,8BAA8B,QAAQ,yBAAyB;AACxE,SAASC,iCAAiC,QAAQ,4BAA4B;AAC9E,SAASC,oCAAoC,QAAQ,+BAA+B;AAIpF;;;AAGA,OAAO,MAAMC,kBAAkB,gBAAiDJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9G,MAAMC,KAAK,GAAGP,8BAA8B,CAACK,KAAK,EAAEC,GAAG,CAAC;EAExDJ,oCAAoC,CAACK,KAAK,CAAC;EAC3C,OAAON,iCAAiC,CAACM,KAAK,CAAC;AACjD,CAAC,CAAC;AAEFJ,kBAAkB,CAACK,WAAW,GAAG,oBAAoB","names":["React","useTableSelectionCell_unstable","renderTableSelectionCell_unstable","useTableSelectionCellStyles_unstable","TableSelectionCell","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableSelectionCell/TableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTableSelectionCell_unstable } from './useTableSelectionCell';\nimport { renderTableSelectionCell_unstable } from './renderTableSelectionCell';\nimport { useTableSelectionCellStyles_unstable } from './useTableSelectionCellStyles';\nimport type { TableSelectionCellProps } from './TableSelectionCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * TableSelectionCell component\n */\nexport const TableSelectionCell: ForwardRefComponent<TableSelectionCellProps> = React.forwardRef((props, ref) => {\n const state = useTableSelectionCell_unstable(props, ref);\n\n useTableSelectionCellStyles_unstable(state);\n return renderTableSelectionCell_unstable(state);\n});\n\nTableSelectionCell.displayName = 'TableSelectionCell';\n"]}
1
+ {"version":3,"names":["React","useTableSelectionCell_unstable","renderTableSelectionCell_unstable","useTableSelectionCellStyles_unstable","useCustomStyleHooks_unstable","TableSelectionCell","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-table/src/components/TableSelectionCell/TableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTableSelectionCell_unstable } from './useTableSelectionCell';\nimport { renderTableSelectionCell_unstable } from './renderTableSelectionCell';\nimport { useTableSelectionCellStyles_unstable } from './useTableSelectionCellStyles';\nimport type { TableSelectionCellProps } from './TableSelectionCell.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TableSelectionCell component\n */\nexport const TableSelectionCell: ForwardRefComponent<TableSelectionCellProps> = React.forwardRef((props, ref) => {\n const state = useTableSelectionCell_unstable(props, ref);\n\n useTableSelectionCellStyles_unstable(state);\n\n const { useTableSelectionCellStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderTableSelectionCell_unstable(state);\n});\n\nTableSelectionCell.displayName = 'TableSelectionCell';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,8BAA8B,QAAQ,yBAAyB;AACxE,SAASC,iCAAiC,QAAQ,4BAA4B;AAC9E,SAASC,oCAAoC,QAAQ,+BAA+B;AAGpF,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,kBAAkB,gBAAiDL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9G,MAAMC,KAAK,GAAGR,8BAA8B,CAACM,KAAK,EAAEC,GAAG,CAAC;EAExDL,oCAAoC,CAACM,KAAK,CAAC;EAE3C,MAAM;IAAEN,oCAAoC,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EAChGM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOP,iCAAiC,CAACO,KAAK,CAAC;AACjD,CAAC,CAAC;AAEFJ,kBAAkB,CAACM,WAAW,GAAG,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,iCAAiC,GAAIC,KAA8B,IAAI;EAClF,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAA0BE,KAAK,CAAC;EAErE,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,GAC3BH,KAAK,CAACI,IAAI,KAAK,UAAU,IAAIH,KAAK,CAACI,iBAAiB,iBACnDR,oBAACI,KAAK,CAACI,iBAAiB;IAAA,GAAKH,SAAS,CAACG;EAAiB,EACzD,EACAL,KAAK,CAACI,IAAI,KAAK,OAAO,IAAIH,KAAK,CAACK,cAAc,iBAAIT,oBAACI,KAAK,CAACK,cAAc;IAAA,GAAKJ,SAAS,CAACI;EAAc,EAAI,CAC9F;AAEjB,CAAC","names":["React","getSlots","renderTableSelectionCell_unstable","state","slots","slotProps","root","type","checkboxIndicator","radioIndicator"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableSelectionCell/renderTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableSelectionCellState, TableSelectionCellSlots } from './TableSelectionCell.types';\n\n/**\n * Render the final JSX of TableSelectionCell\n */\nexport const renderTableSelectionCell_unstable = (state: TableSelectionCellState) => {\n const { slots, slotProps } = getSlots<TableSelectionCellSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.type === 'checkbox' && slots.checkboxIndicator && (\n <slots.checkboxIndicator {...slotProps.checkboxIndicator} />\n )}\n {state.type === 'radio' && slots.radioIndicator && <slots.radioIndicator {...slotProps.radioIndicator} />}\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"names":["React","getSlots","renderTableSelectionCell_unstable","state","slots","slotProps","createElement","root","type","checkboxIndicator","radioIndicator"],"sources":["../src/packages/react-components/react-table/src/components/TableSelectionCell/renderTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TableSelectionCellState, TableSelectionCellSlots } from './TableSelectionCell.types';\n\n/**\n * Render the final JSX of TableSelectionCell\n */\nexport const renderTableSelectionCell_unstable = (state: TableSelectionCellState) => {\n const { slots, slotProps } = getSlots<TableSelectionCellSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.type === 'checkbox' && slots.checkboxIndicator && (\n <slots.checkboxIndicator {...slotProps.checkboxIndicator} />\n )}\n {state.type === 'radio' && slots.radioIndicator && <slots.radioIndicator {...slotProps.radioIndicator} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,iCAAiC,GAAIC,KAA8B,IAAI;EAClF,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAA0BE,KAAK,CAAC;EAErE,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,GAC3BJ,KAAK,CAACK,IAAI,KAAK,UAAU,IAAIJ,KAAK,CAACK,iBAAiB,iBACnDT,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,iBAAiB;IAAA,GAAKJ,SAAS,CAACI;EAAiB,EACzD,EACAN,KAAK,CAACK,IAAI,KAAK,OAAO,IAAIJ,KAAK,CAACM,cAAc,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACM,cAAc;IAAA,GAAKL,SAAS,CAACK;EAAc,EAAI,CAC9F;A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radio","useTableCell_unstable","useTableContext","useTableSelectionCell_unstable","props","ref","tableCellState","noNativeElements","type","checked","subtle","hidden","components","checkboxIndicator","radioIndicator","required","defaultProps","input","name"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/components/TableSelectionCell/useTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { Radio } from '@fluentui/react-radio';\nimport type { TableSelectionCellProps, TableSelectionCellState } from './TableSelectionCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableSelectionCell.\n *\n * The returned state can be modified with hooks such as useTableSelectionCellStyles_unstable,\n * before being passed to renderTableSelectionCell_unstable.\n *\n * @param props - props from this instance of TableSelectionCell\n * @param ref - reference to root HTMLElement of TableSelectionCell\n */\nexport const useTableSelectionCell_unstable = (\n props: TableSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): TableSelectionCellState => {\n const tableCellState = useTableCell_unstable(props, ref);\n const { noNativeElements } = useTableContext();\n const { type = 'checkbox', checked = false, subtle = false, hidden = false } = props;\n\n return {\n ...tableCellState,\n components: {\n ...tableCellState.components,\n checkboxIndicator: Checkbox,\n radioIndicator: Radio,\n },\n checkboxIndicator: resolveShorthand(props.checkboxIndicator, {\n required: type === 'checkbox',\n defaultProps: { checked: props.checked },\n }),\n radioIndicator: resolveShorthand(props.radioIndicator, {\n required: type === 'radio',\n defaultProps: { checked: !!checked, input: { name: useId('table-selection-radio') } },\n }),\n type,\n checked,\n noNativeElements,\n subtle,\n hidden,\n };\n};\n"]}
1
+ {"version":3,"names":["resolveShorthand","useId","Checkbox","Radio","useTableCell_unstable","useTableContext","useTableSelectionCell_unstable","props","ref","tableCellState","noNativeElements","type","checked","subtle","hidden","components","checkboxIndicator","radioIndicator","required","defaultProps","input","name"],"sources":["../src/packages/react-components/react-table/src/components/TableSelectionCell/useTableSelectionCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { Radio } from '@fluentui/react-radio';\nimport type { TableSelectionCellProps, TableSelectionCellState } from './TableSelectionCell.types';\nimport { useTableCell_unstable } from '../TableCell/useTableCell';\nimport { useTableContext } from '../../contexts/tableContext';\n\n/**\n * Create the state required to render TableSelectionCell.\n *\n * The returned state can be modified with hooks such as useTableSelectionCellStyles_unstable,\n * before being passed to renderTableSelectionCell_unstable.\n *\n * @param props - props from this instance of TableSelectionCell\n * @param ref - reference to root HTMLElement of TableSelectionCell\n */\nexport const useTableSelectionCell_unstable = (\n props: TableSelectionCellProps,\n ref: React.Ref<HTMLElement>,\n): TableSelectionCellState => {\n const tableCellState = useTableCell_unstable(props, ref);\n const { noNativeElements } = useTableContext();\n const { type = 'checkbox', checked = false, subtle = false, hidden = false } = props;\n\n return {\n ...tableCellState,\n components: {\n ...tableCellState.components,\n checkboxIndicator: Checkbox,\n radioIndicator: Radio,\n },\n checkboxIndicator: resolveShorthand(props.checkboxIndicator, {\n required: type === 'checkbox',\n defaultProps: { checked: props.checked },\n }),\n radioIndicator: resolveShorthand(props.radioIndicator, {\n required: type === 'radio',\n defaultProps: { checked: !!checked, input: { name: useId('table-selection-radio') } },\n }),\n type,\n checked,\n noNativeElements,\n subtle,\n hidden,\n };\n};\n"],"mappings":"AACA,SAASA,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AACnE,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,KAAK,QAAQ,uBAAuB;AAE7C,SAASC,qBAAqB,QAAQ,2BAA2B;AACjE,SAASC,eAAe,QAAQ,6BAA6B;AAE7D;;;;;;;;;AASA,OAAO,MAAMC,8BAA8B,GAAGA,CAC5CC,KAA8B,EAC9BC,GAA2B,KACA;EAC3B,MAAMC,cAAc,GAAGL,qBAAqB,CAACG,KAAK,EAAEC,GAA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EAC3CM,MAAM,CAACN,cAAc,EACrBK,KAAK,CAACL,cAAc,CAACU,SAAS,CAC/B;;EAGH,OAAOL,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","createCustomFocusIndicatorStyle","tokens","CELL_WIDTH","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 CELL_WIDTH = 44;\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: `${CELL_WIDTH}px`,\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: `${CELL_WIDTH}px`,\n maxWidth: `${CELL_WIDTH}px`,\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"]}
1
+ {"version":3,"names":["__styles","mergeClasses","shorthands","createCustomFocusIndicatorStyle","tokens","CELL_WIDTH","tableSelectionCellClassNames","root","checkboxIndicator","radioIndicator","useTableLayoutStyles","mc9l5x","a9b677","d","useFlexLayoutStyles","Bh6795r","Bnnss6s","xawz","Bf4jedk","B2u0y6b","Brf1p80","useStyles","fsow6f","Huce71","z8tnut","z189sj","Byoj8tv","uwmqm3","Bn4voq9","g9k6zt","Bfpq7zp","kdpuga","Bw81rd7","B6xbmo0","dm238s","Bt984gj","subtle","abs64n","Brovlpu","B486eqv","B8a84jv","hidden","Bcdw1i0","f","i","useTableSelectionCellStyles_unstable","state","styles","layoutStyles","table","flex","className","noNativeElements","checked"],"sources":["../src/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 CELL_WIDTH = 44;\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: `${CELL_WIDTH}px`,\n },\n});\n\nconst useFlexLayoutStyles = makeStyles({\n root: {\n display: 'flex',\n ...shorthands.flex(1, 1, '0px'),\n minWidth: `${CELL_WIDTH}px`,\n maxWidth: `${CELL_WIDTH}px`,\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"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAO,MAAMC,UAAU,GAAG,EAAE;AAE5B,OAAO,MAAMC,4BAA4B,GAA4C;EACnFC,IAAI,EAAE,wBAAwB;EAC9BC,iBAAiB,EAAE,2CAA2C;EAC9DC,cAAc,EAAE;CACjB;AAED,MAAMC,oBAAoB,gBAAGV,QAAA;EAAAO,IAAA;IAAAI,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAK3B;AAEF,MAAMC,mBAAmB,gBAAGd,QAAA;EAAAO,IAAA;IAAAI,MAAA;IAAAI,OAAA;IAAAC,OAAA;IAAAC,IAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAP,CAAA;AAAA,EAQ1B;AAEF;;;AAGA,MAAMQ,SAAS,gBAAGrB,QAAA;EAAAO,IAAA;IAAAe,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAzB,cAAA;IAAAE,MAAA;IAAAI,OAAA;IAAAoB,OAAA;IAAAf,OAAA;EAAA;EAAAgB,MAAA;IAAAC,MAAA;IAAA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O;AAG9B,MAAMC,eAAe,gBAAGD,KAAK,CAACE,aAAa,CAA4BC,SAAS,CAAC;AAEjF,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 { TableColumnId } from '../hooks/';\n\nconst columnIdContext = React.createContext<TableColumnId | undefined>(undefined);\n\nexport const columnIdContextDefaultValue = '';\n\nexport const useColumnIdContext = () => React.useContext(columnIdContext) ?? columnIdContextDefaultValue;\n\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"]}
1
+ {"version":3,"names":["React","columnIdContext","createContext","undefined","columnIdContextDefaultValue","useColumnIdContext","_a","useContext","ColumnIdContextProvider","Provider"],"sources":["../src/packages/react-components/react-table/src/contexts/columnIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TableColumnId } from '../hooks/';\n\nconst columnIdContext = React.createContext<TableColumnId | undefined>(undefined);\n\nexport const columnIdContextDefaultValue = '';\n\nexport const useColumnIdContext = () => React.useContext(columnIdContext) ?? columnIdContextDefaultValue;\n\nexport const ColumnIdContextProvider = columnIdContext.Provider;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,eAAe,gBAAGD,KAAK,CAACE,aAAa,CAA4BC,SAAS,CAAC;AAEjF,OAAO,MAAMC,2BAA2B,GAAG,EAAE;AAE7C,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAK;EAAA,IAAAC,EAAA;EAAC,QAAAA,EAAA,GAAAN,KAAK,CAACO,UAAU,CAACN,eAAe,CAAC,cAAAK,EAAA,cAAAA,EAAA,GAAIF,2BAA2B;AAAA;AAExG,OAAO,MAAMI,uBAAuB,GAAGP,eAAe,CAACQ,QAAQ"}
@@ -1 +1 @@
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"]}
1
+ {"version":3,"names":["createContext","useContextSelector","defaultTableState","dataGridContext","undefined","dataGridContextDefaultValue","subtleSelection","selectableRows","selectionAppearance","focusMode","DataGridContextProvider","Provider","useDataGridContext_unstable","selector","ctx"],"sources":["../src/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"],"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"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAyBC,SAAS,CAAC;AAE3E,OAAO,MAAMC,6BAA6B,GAAG,EAAE;AAE/C,OAAO,MAAMC,oBAAoB,GAAG,MAAK;EAAA;EAAC,kBAAK,CAACC,UAAU,CAACL,YAAY,CAAC,mCAAIG,6BAA6B;AAAA;AAEzG,OAAO,MAAMG,yBAAyB,GAAGN,YAAY,CAACO,QAAQ","names":["React","rowIdContext","createContext","undefined","tableRowIdContextDefaultValue","useTableRowIdContext","useContext","TableRowIdContextProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/contexts/rowIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TableRowId } from '../hooks/';\n\nconst rowIdContext = React.createContext<TableRowId | undefined>(undefined);\n\nexport const tableRowIdContextDefaultValue = '';\n\nexport const useTableRowIdContext = () => React.useContext(rowIdContext) ?? tableRowIdContextDefaultValue;\n\nexport const TableRowIdContextProvider = rowIdContext.Provider;\n"]}
1
+ {"version":3,"names":["React","rowIdContext","createContext","undefined","tableRowIdContextDefaultValue","useTableRowIdContext","_a","useContext","TableRowIdContextProvider","Provider"],"sources":["../src/packages/react-components/react-table/src/contexts/rowIdContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TableRowId } from '../hooks/';\n\nconst rowIdContext = React.createContext<TableRowId | undefined>(undefined);\n\nexport const tableRowIdContextDefaultValue = '';\n\nexport const useTableRowIdContext = () => React.useContext(rowIdContext) ?? tableRowIdContextDefaultValue;\n\nexport const TableRowIdContextProvider = rowIdContext.Provider;\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,MAAMC,YAAY,gBAAGD,KAAK,CAACE,aAAa,CAAyBC,SAAS,CAAC;AAE3E,OAAO,MAAMC,6BAA6B,GAAG,EAAE;AAE/C,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAK;EAAA,IAAAC,EAAA;EAAC,QAAAA,EAAA,GAAAN,KAAK,CAACO,UAAU,CAACN,YAAY,CAAC,cAAAK,EAAA,cAAAA,EAAA,GAAIF,6BAA6B;AAAA;AAEzG,OAAO,MAAMI,yBAAyB,GAAGP,YAAY,CAACQ,QAAQ"}
@@ -1 +1 @@
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
+ {"version":3,"names":["React","tableContext","createContext","undefined","tableContextDefaultValue","size","noNativeElements","sortable","TableContextProvider","Provider","useTableContext","_a","useContext"],"sources":["../src/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"],"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,GAAGA,CAAA,KAAK;EAAA,IAAAC,EAAA;EAAC,QAAAA,EAAA,GAAAX,KAAK,CAACY,UAAU,CAACX,YAAY,CAAC,cAAAU,EAAA,cAAAA,EAAA,GAAIP,wBAAwB;AAAA"}
@@ -1 +1 @@
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
+ {"version":3,"names":["React","tableHeaderContext","createContext","undefined","tableHeaderContextDefaultValue","TableHeaderContextProvider","Provider","useIsInTableHeader","useContext"],"sources":["../src/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"],"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,GAAGA,CAAA,KAAMP,KAAK,CAACQ,UAAU,CAACP,kBAAkB,CAAC,KAAKG,8BAA8B"}
@@ -1 +1 @@
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,iBAAiB,CAAQC,OAAwC;EAC/E,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","createTableColumn","options","columnId","renderCell","renderHeaderCell","compare"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/createColumn.ts"],"sourcesContent":["import { CreateTableColumnOptions } 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 createTableColumn<TItem>(options: CreateTableColumnOptions<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"]}
1
+ {"version":3,"names":["defaultCompare","defaultRenderCell","process","env","NODE_ENV","console","warn","defaultRenderHeaderCell","createTableColumn","options","columnId","renderCell","renderHeaderCell","compare"],"sources":["../src/packages/react-components/react-table/src/hooks/createColumn.ts"],"sourcesContent":["import { CreateTableColumnOptions } 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 createTableColumn<TItem>(options: CreateTableColumnOptions<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"],"mappings":"AAEA,MAAMA,cAAc,GAAGA,CAAA,KAAM,CAAC;AAE9B,MAAMC,iBAAiB,GAAGA,CAAA,KAAK;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,GAAGA,CAAA,KAAK;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,iBAAiBA,CAAQC,OAAwC;EAC/E,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"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAgBA,OAAM,SAAUA,sBAAsB,CACpCC,IAAmB,EACnBC,oBAA+C,MAAMC,SAAS;EAE9D,MAAMC,cAAc,GAAGH,IAAI,KAAK,aAAa,GAAGI,8BAA8B,GAAGC,4BAA4B;EAE7G,OAAOF,cAAc,CAACF,iBAAiB,CAAC;AAC1C;AAEA,SAASG,8BAA8B,CAACH,iBAA4C;EAClF,MAAMK,cAAc,GAAuC,CAACC,CAAC,EAAEC,OAAO,EAAEC,aAA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mC,KAAI;IAClF,OAAOA,aAAa,CAACI,GAAG,CAACD,MAAM,CAAC;EAClC,CAAC;EAED,OAAO;IACLM,UAAU;IACVE,UAAU;IACVC,YAAY;IACZC,UAAU;IACVC,UAAU;IACVjB;GACD;AACH;AAEA,SAASD,4BAA4B,CAACJ,iBAA4C;EAChF,MAAMiB,UAAU,GAAmC,CAACX,CAAC,EAAEK,MAAM,KAAI;IAC/DX,iBAAiB,CAACM,CAAC,EAAE,IAAIU,GAAG,CAAC,CAACL,MAAM,CAAC,CAAC,CAAC;EACzC,CAAC;EAED,MAAMU,UAAU,GAAmCf,CAAC,IAAG;IACrDN,iBAAiB,CAACM,CAAC,EAAE,IAAIU,GAAG,EAAmB,CAAC;EAClD,CAAC;EAED,MAAMM,UAAU,GAAG,CAACX,MAAuB,EAAEH,aAAmC,KAAI;IAClF,OAAOA,aAAa,CAACI,GAAG,CAACD,MAAM,CAAC;EAClC,CAAC;EAED,MAAMQ,UAAU,GAAmC,CAACb,CAAC,EAAEK,MAAM,KAAI;IAC/DX,iBAAiB,CAACM,CAAC,EAAE,IAAIU,GAAG,CAAC,CAACL,MAAM,CAAC,CAAC,CAAC;EACzC,CAAC;EAED,OAAO;IACLS,YAAY,EAAEC,UAAU;IACxBF,UAAU;IACVd,cAAc,EAAE,MAAK;MACnB,IAAIkB,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;QACzC,MAAM,IAAIC,KAAK,CAAC,6EAA6E,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, selectedItems: Set<SelectionItemId>) => void;\n\nexport interface SelectionManager {\n toggleItem(e: React.SyntheticEvent, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n selectItem(e: React.SyntheticEvent, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n deselectItem(e: React.SyntheticEvent, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n clearItems(e: React.SyntheticEvent): void;\n isSelected(id: SelectionItemId, selectedItems: Set<SelectionItemId>): boolean;\n toggleAllItems(e: React.SyntheticEvent, itemIds: SelectionItemId[], selectedItems: Set<SelectionItemId>): 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
+ {"version":3,"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"],"sources":["../src/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, selectedItems: Set<SelectionItemId>) => void;\n\nexport interface SelectionManager {\n toggleItem(e: React.SyntheticEvent, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n selectItem(e: React.SyntheticEvent, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n deselectItem(e: React.SyntheticEvent, id: SelectionItemId, selectedItems: Set<SelectionItemId>): void;\n clearItems(e: React.SyntheticEvent): void;\n isSelected(id: SelectionItemId, selectedItems: Set<SelectionItemId>): boolean;\n toggleAllItems(e: React.SyntheticEvent, itemIds: SelectionItemId[], selectedItems: Set<SelectionItemId>): 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"],"mappings":"AAgBA,OAAM,SAAUA,sBAAsBA,CACpCC,IAAmB,EACnBC,iBAAA,GAA+CA,CAAA,KAAMC,SAAS;EAE9D,MAAMC,cAAc,GAAGH,IAAI,KAAK,aAAa,GAAGI,8BAA8B,GAAGC,4BAA4B;EAE7G,OAAOF,cAAc,CAACF,iBAAiB,CAAC;AAC1C;AAEA,SAASG,8BAA8BA,CAACH,iBAA4C;EAClF,MAAMK,cAAc,GAAuCA,CAACC,CAAC,EAAEC,OAAO,EAAEC,aAAa,KAAI;IACvF,MAAMC,gBAAgB,GAAGF,OAAO,CAACG,KAAK,CAACC,MAAM,IAAIH,aAAa,CAACI,GAAG,CAACD,MAAM,CAAC,CAAC;IAE3E,IAAIF,gBAAgB,EAAE;MACpBD,aAAa,CAACK,KAAK,EAAE;KACtB,MAAM;MACLN,OAAO,CAACO,OAAO,CAACH,MAAM,IAAIH,aAAa,CAACO,GAAG,CAACJ,MAAM,CAAC,CAAC;;IAGtDX,iBAAiB,CAACM,CAAC,EAAE,IAAIU,GAAG,CAACR,aAAa,CAAC,CAAC;EAC9C,CAAC;EAED,MAAMS,UAAU,GAAmCA,CAACX,CAAC,EAAEK,MAAM,EAAEH,aAAa,KAAI;IAC9E,IAAIA,aAAa,CAACI,GAAG,CAACD,MAAM,CAAC,EAAE;MAC7BH,aAAa,CAACU,MA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,aAAmC,KAAI;IAClF,OAAOA,aAAa,CAACI,GAAG,CAACD,MAAM,CAAC;EAClC,CAAC;EAED,MAAMQ,UAAU,GAAmCA,CAACb,CAAC,EAAEK,MAAM,KAAI;IAC/DX,iBAAiB,CAACM,CAAC,EAAE,IAAIU,GAAG,CAAC,CAACL,MAAM,CAAC,CAAC,CAAC;EACzC,CAAC;EAED,OAAO;IACLS,YAAY,EAAEC,UAAU;IACxBF,UAAU;IACVd,cAAc,EAAEA,CAAA,KAAK;MACnB,IAAIkB,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;QACzC,MAAM,IAAIC,KAAK,CAAC,6EAA6E,CAAC;;MAGhG,OAAOzB,SAAS;IAClB,CAAC;IACDgB,UAAU;IACVI,UAAU;IACVC;GACD;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { SortDirection } from '../components/Table/Table.types';\nimport { TableHeaderCellProps } from '../components/TableHeaderCell/TableHeaderCell.types';\n\nexport type TableRowId = string | number;\nexport type TableColumnId = string | number;\nexport type SelectionMode = 'single' | 'multiselect';\n\nexport interface SortState {\n sortColumn: TableColumnId | undefined;\n sortDirection: SortDirection;\n}\n\nexport interface OnSelectionChangeData {\n selectedItems: Set<TableRowId>;\n}\n\nexport interface CreateTableColumnOptions<TItem> extends Partial<TableColumnDefinition<TItem>> {\n columnId: TableColumnId;\n}\n\nexport interface TableColumnDefinition<TItem> {\n columnId: TableColumnId;\n compare: (a: TItem, b: TItem) => number;\n renderHeaderCell: () => React.ReactNode;\n renderCell: (item: TItem) => React.ReactNode;\n}\n\nexport type RowEnhancer<TItem, TRowState extends TableRowData<TItem> = TableRowData<TItem>> = (\n row: TableRowData<TItem>,\n) => TRowState;\n\nexport interface TableSortState<TItem> {\n /**\n * Current sort direction\n */\n sortDirection: SortDirection;\n /**\n * Column id of the currently sorted column\n */\n sortColumn: TableColumnId | undefined;\n /**\n * Set the sort direction for the specified column\n */\n setColumnSort: (event: React.SyntheticEvent, columnId: TableColumnId, sortDirection: SortDirection) => void;\n /**\n * Toggles the sort direction for specified column\n */\n toggleColumnSort: (event: React.SyntheticEvent, columnId: TableColumnId) => void;\n /**\n * Returns the sort direction if a column is sorted,\n * returns undefined if the column is not sorted\n */\n getSortDirection: (columnId: TableColumnId) => SortDirection | undefined;\n\n /**\n * Sorts rows and returns a **shallow** copy of original items\n */\n sort: <TRowState extends TableRowData<TItem>>(rows: TRowState[]) => TRowState[];\n}\n\nexport interface TableSelectionState {\n /**\n * Clears all selected rows\n */\n clearRows: (e: React.SyntheticEvent) => void;\n /**\n * Selects single row\n */\n selectRow: (e: React.SyntheticEvent, rowId: TableRowId) => void;\n /**\n * De-selects single row\n */\n deselectRow: (e: React.SyntheticEvent, rowId: TableRowId) => void;\n /**\n * Toggle selection of all rows\n */\n toggleAllRows: (e: React.SyntheticEvent) => void;\n /**\n * Toggle selection of single row\n */\n toggleRow: (e: React.SyntheticEvent, rowId: TableRowId) => void;\n /**\n * Collection of row ids corresponding to selected rows\n */\n selectedRows: Set<TableRowId>;\n /**\n * Whether all rows are selected\n */\n allRowsSelected: boolean;\n /**\n * Whether some rows are selected\n */\n someRowsSelected: boolean;\n\n /**\n * Checks if a given rowId is selected\n */\n isRowSelected: (rowId: TableRowId) => boolean;\n\n selectionMode: SelectionMode;\n}\n\nexport interface TableRowData<TItem> {\n /**\n * User provided data\n */\n item: TItem;\n /**\n * The row id, defaults to index position in the collection\n */\n rowId: TableRowId;\n}\n\nexport interface TableFeaturesState<TItem> extends Pick<UseTableFeaturesOptions<TItem>, 'items' | 'getRowId'> {\n /**\n * The row data for rendering\n * @param rowEnhancer - Enhances the row with extra user data\n */\n getRows: <TRowState extends TableRowData<TItem> = TableRowData<TItem>>(\n rowEnhancer?: RowEnhancer<TItem, TRowState>,\n ) => TRowState[];\n /**\n * State and actions to manage row selection\n */\n selection: TableSelectionState;\n /**\n * State and actions to manage row sorting\n */\n sort: TableSortState<TItem>;\n /**\n * Table columns\n */\n columns: TableColumnDefinition<TItem>[];\n /**\n * State and actions to manage column resizing\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: TableColumnSizingState;\n /**\n * A React.Ref object to be set as a ref for the table.\n * Used with column resizing.\n */\n tableRef: React.Ref<HTMLDivElement>;\n}\n\nexport interface UseTableSortOptions {\n /**\n * Used to control sorting\n */\n sortState?: SortState;\n /**\n * Used in uncontrolled mode to set initial sort column and direction on mount\n */\n defaultSortState?: SortState;\n /**\n * Called when sort changes\n */\n onSortChange?(e: React.SyntheticEvent, state: SortState): void;\n}\n\nexport interface UseTableSelectionOptions {\n /**\n * Can be multi or single select\n */\n selectionMode: SelectionMode;\n /**\n * Used in uncontrolled mode to set initial selected rows on mount\n */\n defaultSelectedItems?: Set<TableRowId>;\n /**\n * Used to control row selection\n */\n selectedItems?: Set<TableRowId>;\n /**\n * Called when selection changes\n */\n onSelectionChange?(e: React.SyntheticEvent, data: OnSelectionChangeData): void;\n}\n\nexport interface UseTableFeaturesOptions<TItem> {\n columns: TableColumnDefinition<TItem>[];\n items: TItem[];\n getRowId?: (item: TItem) => TableRowId;\n}\n\nexport type TableFeaturePlugin = <TItem>(tableState: TableFeaturesState<TItem>) => TableFeaturesState<TItem>;\n\nexport interface ColumnWidthState {\n columnId: TableColumnId;\n width: number;\n minWidth: number;\n idealWidth: number;\n padding: number;\n}\n\nexport type ColumnSizingTableHeaderCellProps = Pick<TableHeaderCellProps, 'style' | 'aside'>;\nexport type ColumnSizingTableCellProps = Pick<TableHeaderCellProps, 'style'>;\n\nexport interface TableColumnSizingState {\n getOnMouseDown: (columnId: TableColumnId) => (e: React.MouseEvent | React.TouchEvent) => void;\n setColumnWidth: (columnId: TableColumnId, newSize: number) => void;\n getColumnWidths: () => ColumnWidthState[];\n getTableHeaderCellProps: (columnId: TableColumnId) => ColumnSizingTableHeaderCellProps;\n getTableCellProps: (columnId: TableColumnId) => ColumnSizingTableCellProps;\n}\n\nexport type ColumnResizeState = {\n getColumnWidth: (columnId: TableColumnId) => number;\n setColumnWidth: (e: TouchEvent | MouseEvent | undefined, data: { columnId: TableColumnId; width: number }) => void;\n getColumnById: (columnId: TableColumnId) => ColumnWidthState | undefined;\n getColumns: () => ColumnWidthState[];\n};\n\nexport type TableColumnSizingOptions = Record<\n TableColumnId,\n Partial<Pick<ColumnWidthState, 'minWidth' | 'idealWidth' | 'padding'>> & { defaultWidth?: number }\n>;\n\nexport type UseTableColumnSizingParams = {\n columnSizingOptions?: TableColumnSizingOptions;\n onColumnResize?: (e: TouchEvent | MouseEvent | undefined, data: { columnId: TableColumnId; width: number }) => void;\n containerWidthOffset?: number;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { SortDirection } from '../components/Table/Table.types';\nimport { TableHeaderCellProps } from '../components/TableHeaderCell/TableHeaderCell.types';\n\nexport type TableRowId = string | number;\nexport type TableColumnId = string | number;\nexport type SelectionMode = 'single' | 'multiselect';\n\nexport interface SortState {\n sortColumn: TableColumnId | undefined;\n sortDirection: SortDirection;\n}\n\nexport interface OnSelectionChangeData {\n selectedItems: Set<TableRowId>;\n}\n\nexport interface CreateTableColumnOptions<TItem> extends Partial<TableColumnDefinition<TItem>> {\n columnId: TableColumnId;\n}\n\nexport interface TableColumnDefinition<TItem> {\n columnId: TableColumnId;\n compare: (a: TItem, b: TItem) => number;\n renderHeaderCell: () => React.ReactNode;\n renderCell: (item: TItem) => React.ReactNode;\n}\n\nexport type RowEnhancer<TItem, TRowState extends TableRowData<TItem> = TableRowData<TItem>> = (\n row: TableRowData<TItem>,\n) => TRowState;\n\nexport interface TableSortState<TItem> {\n /**\n * Current sort direction\n */\n sortDirection: SortDirection;\n /**\n * Column id of the currently sorted column\n */\n sortColumn: TableColumnId | undefined;\n /**\n * Set the sort direction for the specified column\n */\n setColumnSort: (event: React.SyntheticEvent, columnId: TableColumnId, sortDirection: SortDirection) => void;\n /**\n * Toggles the sort direction for specified column\n */\n toggleColumnSort: (event: React.SyntheticEvent, columnId: TableColumnId) => void;\n /**\n * Returns the sort direction if a column is sorted,\n * returns undefined if the column is not sorted\n */\n getSortDirection: (columnId: TableColumnId) => SortDirection | undefined;\n\n /**\n * Sorts rows and returns a **shallow** copy of original items\n */\n sort: <TRowState extends TableRowData<TItem>>(rows: TRowState[]) => TRowState[];\n}\n\nexport interface TableSelectionState {\n /**\n * Clears all selected rows\n */\n clearRows: (e: React.SyntheticEvent) => void;\n /**\n * Selects single row\n */\n selectRow: (e: React.SyntheticEvent, rowId: TableRowId) => void;\n /**\n * De-selects single row\n */\n deselectRow: (e: React.SyntheticEvent, rowId: TableRowId) => void;\n /**\n * Toggle selection of all rows\n */\n toggleAllRows: (e: React.SyntheticEvent) => void;\n /**\n * Toggle selection of single row\n */\n toggleRow: (e: React.SyntheticEvent, rowId: TableRowId) => void;\n /**\n * Collection of row ids corresponding to selected rows\n */\n selectedRows: Set<TableRowId>;\n /**\n * Whether all rows are selected\n */\n allRowsSelected: boolean;\n /**\n * Whether some rows are selected\n */\n someRowsSelected: boolean;\n\n /**\n * Checks if a given rowId is selected\n */\n isRowSelected: (rowId: TableRowId) => boolean;\n\n selectionMode: SelectionMode;\n}\n\nexport interface TableRowData<TItem> {\n /**\n * User provided data\n */\n item: TItem;\n /**\n * The row id, defaults to index position in the collection\n */\n rowId: TableRowId;\n}\n\nexport interface TableFeaturesState<TItem> extends Pick<UseTableFeaturesOptions<TItem>, 'items' | 'getRowId'> {\n /**\n * The row data for rendering\n * @param rowEnhancer - Enhances the row with extra user data\n */\n getRows: <TRowState extends TableRowData<TItem> = TableRowData<TItem>>(\n rowEnhancer?: RowEnhancer<TItem, TRowState>,\n ) => TRowState[];\n /**\n * State and actions to manage row selection\n */\n selection: TableSelectionState;\n /**\n * State and actions to manage row sorting\n */\n sort: TableSortState<TItem>;\n /**\n * Table columns\n */\n columns: TableColumnDefinition<TItem>[];\n /**\n * State and actions to manage column resizing\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: TableColumnSizingState;\n /**\n * A React.Ref object to be set as a ref for the table.\n * Used with column resizing.\n */\n tableRef: React.Ref<HTMLDivElement>;\n}\n\nexport interface UseTableSortOptions {\n /**\n * Used to control sorting\n */\n sortState?: SortState;\n /**\n * Used in uncontrolled mode to set initial sort column and direction on mount\n */\n defaultSortState?: SortState;\n /**\n * Called when sort changes\n */\n onSortChange?(e: React.SyntheticEvent, state: SortState): void;\n}\n\nexport interface UseTableSelectionOptions {\n /**\n * Can be multi or single select\n */\n selectionMode: SelectionMode;\n /**\n * Used in uncontrolled mode to set initial selected rows on mount\n */\n defaultSelectedItems?: Iterable<TableRowId>;\n /**\n * Used to control row selection\n */\n selectedItems?: Iterable<TableRowId>;\n /**\n * Called when selection changes\n */\n onSelectionChange?(e: React.SyntheticEvent, data: OnSelectionChangeData): void;\n}\n\nexport interface UseTableFeaturesOptions<TItem> {\n columns: TableColumnDefinition<TItem>[];\n items: TItem[];\n getRowId?: (item: TItem) => TableRowId;\n}\n\nexport type TableFeaturePlugin = <TItem>(tableState: TableFeaturesState<TItem>) => TableFeaturesState<TItem>;\n\nexport interface ColumnWidthState {\n columnId: TableColumnId;\n width: number;\n minWidth: number;\n idealWidth: number;\n padding: number;\n}\n\nexport type ColumnSizingTableHeaderCellProps = Pick<TableHeaderCellProps, 'style' | 'aside'>;\nexport type ColumnSizingTableCellProps = Pick<TableHeaderCellProps, 'style'>;\n\nexport interface TableColumnSizingState {\n getOnMouseDown: (columnId: TableColumnId) => (e: React.MouseEvent | React.TouchEvent) => void;\n setColumnWidth: (columnId: TableColumnId, newSize: number) => void;\n getColumnWidths: () => ColumnWidthState[];\n getTableHeaderCellProps: (columnId: TableColumnId) => ColumnSizingTableHeaderCellProps;\n getTableCellProps: (columnId: TableColumnId) => ColumnSizingTableCellProps;\n}\n\nexport type ColumnResizeState = {\n getColumnWidth: (columnId: TableColumnId) => number;\n setColumnWidth: (e: TouchEvent | MouseEvent | undefined, data: { columnId: TableColumnId; width: number }) => void;\n getColumnById: (columnId: TableColumnId) => ColumnWidthState | undefined;\n getColumns: () => ColumnWidthState[];\n};\n\nexport type TableColumnSizingOptions = Record<\n TableColumnId,\n Partial<Pick<ColumnWidthState, 'minWidth' | 'idealWidth' | 'padding'>> & { defaultWidth?: number }\n>;\n\nexport type UseTableColumnSizingParams = {\n columnSizingOptions?: TableColumnSizingOptions;\n onColumnResize?: (e: TouchEvent | MouseEvent | undefined, data: { columnId: TableColumnId; width: number }) => void;\n containerWidthOffset?: number;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,SAAS,QAAQ,2BAA2B;AACrD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AAEjF;;;;;;AAMA,OAAM,SAAUC,iBAAiB;EAC/B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGL,KAAK,CAACM,QAAQ,CAAC,CAAC,CAAC;EAC3C,MAAMC,SAAS,GAAGP,KAAK,CAACQ,MAAM,CAA0BC,SAAS,CAAC;EAElE,MAAM;IAAEC;EAAc,CAAE,GAAGR,SAAS,EAAE;EAEtC;EACA,MAAMS,YAAY,GAAGX,KAAK,CAACY,WAAW,CAAC,MAAK;;IAC1C,MAAMC,cAAc,GAAG,eAAS,CAACC,OAAO,0CAAEC,qBAAqB,GAAGX,KAAK;IACvEC,QAAQ,CAACQ,cAAc,IAAI,CAAC,CAAC;EAC/B,CAAC,EAAE,EAAE,CAAC;EAEN;EACA,MAAM,CAACG,cAAc,CAAC,GAAGhB,KAAK,CAACM,QAAQ,CAACP,SAAS,EAAE,GAAG,IAAIkB,cAAc,CAACN,YAAY,CAAC,GAAGF,SAAS,CAAC;EACnG,MAAMS,iBAAiB,GAAGlB,KAAK,CAACY,WAAW,CACxCO,EAAmB,IAAI;IACtB,IAAI,CAACT,cAAc,IAAI,CAACM,cAAc,EAAE;MACtC;;IAGF;IACA,IAAIT,SAAS,CAACO,OAAO,EAAE;MACrBE,cAAc,CAACI,SAAS,CAACb,SAAS,CAACO,OAAO,CAAC;MAC3CP,SAAS,CAACO,OAAO,CAACO,MAAM,EAAE;;IAG5B,IAAIF,EAAE,EAAE;MACNZ,SAAS,CAACO,OAAO,GAAGJ,cAAc,CAACY,aAAa,CAAC,KAAK,CAAC;MACvDH,EAAE,CAACI,qBAAqB,CAAC,aAAa,EAAEhB,SAAS,CAACO,OAAO,CAAC;MAC1DE,cAAc,CAACQ,OAAO,CAACjB,SAAS,CAACO,OAAO,CAAC;MACzCH,YAAY,EAAE;;EAElB,CAAC,EACD,CAACD,cAAc,EAAEM,cAAc,EAAEL,YAAY,CAAC,CAC/C;EAEDX,KAAK,CAACyB,SAAS,CAAC,MAAK;IACnB,OAAO,MAAMT,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEU,UAAU,EAAE;EAC3C,CAAC,EAAE,CAACV,cAAc,CAAC,CAAC;EAEpB,OAAO;IAAEZ,KAAK;IAAEc;EAAiB,CAAE;AACrC","names":["canUseDOM","React","useFluent_unstable","useFluent","useMeasureElement","width","setWidth","useState","container","useRef","undefined","targetDocument","handleResize","useCallback","containerWidth","current","getBoundingClientRect","resizeObserver","ResizeObserver","measureElementRef","el","unobserve","remove","createElement","insertAdjacentElement","observe","useEffect","disconnect"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useMeasureElement.ts"],"sourcesContent":["import { canUseDOM } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * Provides a way of reporting element width.\n * Returns\n * `width` - current element width (0 by default),\n * `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure\n */\nexport function useMeasureElement<TElement extends HTMLElement = HTMLElement>() {\n const [width, setWidth] = React.useState(0);\n const container = React.useRef<HTMLElement | undefined>(undefined);\n\n const { targetDocument } = useFluent();\n\n // the handler for resize observer\n const handleResize = React.useCallback(() => {\n const containerWidth = container.current?.getBoundingClientRect().width;\n setWidth(containerWidth || 0);\n }, []);\n\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver] = React.useState(canUseDOM() ? new ResizeObserver(handleResize) : undefined);\n const measureElementRef = React.useCallback(\n (el: TElement | null) => {\n if (!targetDocument || !resizeObserver) {\n return;\n }\n\n // cleanup previous container\n if (container.current) {\n resizeObserver.unobserve(container.current);\n container.current.remove();\n }\n\n if (el) {\n container.current = targetDocument.createElement('div');\n el.insertAdjacentElement('beforebegin', container.current);\n resizeObserver.observe(container.current);\n handleResize();\n }\n },\n [targetDocument, resizeObserver, handleResize],\n );\n\n React.useEffect(() => {\n return () => resizeObserver?.disconnect();\n }, [resizeObserver]);\n\n return { width, measureElementRef };\n}\n"]}
1
+ {"version":3,"names":["canUseDOM","React","useFluent_unstable","useFluent","useMeasureElement","width","setWidth","useState","container","useRef","undefined","targetDocument","handleResize","useCallback","containerWidth","_a","current","getBoundingClientRect","resizeObserver","ResizeObserver","measureElementRef","el","unobserve","remove","createElement","insertAdjacentElement","observe","useEffect","disconnect"],"sources":["../src/packages/react-components/react-table/src/hooks/useMeasureElement.ts"],"sourcesContent":["import { canUseDOM } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * Provides a way of reporting element width.\n * Returns\n * `width` - current element width (0 by default),\n * `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure\n */\nexport function useMeasureElement<TElement extends HTMLElement = HTMLElement>() {\n const [width, setWidth] = React.useState(0);\n const container = React.useRef<HTMLElement | undefined>(undefined);\n\n const { targetDocument } = useFluent();\n\n // the handler for resize observer\n const handleResize = React.useCallback(() => {\n const containerWidth = container.current?.getBoundingClientRect().width;\n setWidth(containerWidth || 0);\n }, []);\n\n // Keep the reference of ResizeObserver in the state, as it should live through renders\n const [resizeObserver] = React.useState(canUseDOM() ? new ResizeObserver(handleResize) : undefined);\n const measureElementRef = React.useCallback(\n (el: TElement | null) => {\n if (!targetDocument || !resizeObserver) {\n return;\n }\n\n // cleanup previous container\n if (container.current) {\n resizeObserver.unobserve(container.current);\n container.current.remove();\n }\n\n if (el) {\n container.current = targetDocument.createElement('div');\n el.insertAdjacentElement('beforebegin', container.current);\n resizeObserver.observe(container.current);\n handleResize();\n }\n },\n [targetDocument, resizeObserver, handleResize],\n );\n\n React.useEffect(() => {\n return () => resizeObserver?.disconnect();\n }, [resizeObserver]);\n\n return { width, measureElementRef };\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,2BAA2B;AACrD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB,IAAIC,SAAS,QAAQ,iCAAiC;AAEjF;;;;;;AAMA,OAAM,SAAUC,iBAAiBA,CAAA;EAC/B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGL,KAAK,CAACM,QAAQ,CAAC,CAAC,CAAC;EAC3C,MAAMC,SAAS,GAAGP,KAAK,CAACQ,MAAM,CAA0BC,SAAS,CAAC;EAElE,MAAM;IAAEC;EAAc,CAAE,GAAGR,SAAS,EAAE;EAEtC;EACA,MAAMS,YAAY,GAAGX,KAAK,CAACY,WAAW,CAAC,MAAK;;IAC1C,MAAMC,cAAc,GAAG,CAAAC,EAAA,GAAAP,SAAS,CAACQ,OAAO,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,qBAAqB,GAAGZ,KAAK;IACvEC,QAAQ,CAACQ,cAAc,IAAI,CAAC,CAAC;EAC/B,CAAC,EAAE,EAAE,CAAC;EAEN;EACA,MAAM,CAACI,cAAc,CAAC,GAAGjB,KAAK,CAACM,QAAQ,CAACP,SAAS,EAAE,GAAG,IAAImB,cAAc,CAACP,YAAY,CAAC,GAAGF,SAAS,C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unstable","useFluent","getEventClientCoords","isMouseEvent","isTouchEvent","useTableColumnResizeMouseHandler","columnResizeState","mouseX","useRef","currentWidth","colId","undefined","targetDocument","globalWin","defaultView","recalculatePosition","useCallback","e","clientX","dx","current","setColumnWidth","columnId","width","onDrag","requestAnimationFrame","onDragEnd","event","removeEventListener","getOnMouseDown","getColumnWidth","target","currentTarget","button","addEventListener"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableColumnResizeMouseHandler.ts"],"sourcesContent":["import * as React from 'react';\nimport { TableColumnId, ColumnResizeState } from './types';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n NativeTouchOrMouseEvent,\n ReactTouchOrMouseEvent,\n getEventClientCoords,\n isMouseEvent,\n isTouchEvent,\n} from '@fluentui/react-utilities';\n\nexport function useTableColumnResizeMouseHandler(columnResizeState: ColumnResizeState) {\n const mouseX = React.useRef(0);\n const currentWidth = React.useRef(0);\n const colId = React.useRef<TableColumnId | undefined>(undefined);\n\n const { targetDocument } = useFluent();\n const globalWin = targetDocument?.defaultView;\n\n const recalculatePosition = React.useCallback(\n (e: NativeTouchOrMouseEvent) => {\n const { clientX } = getEventClientCoords(e);\n const dx = clientX - mouseX.current;\n\n // Update the local width for the column and set it\n currentWidth.current += dx;\n colId.current && columnResizeState.setColumnWidth(e, { columnId: colId.current, width: currentWidth.current });\n mouseX.current = clientX;\n },\n [columnResizeState],\n );\n\n const onDrag = React.useCallback(\n (e: NativeTouchOrMouseEvent) => {\n // Using requestAnimationFrame here drastically improves resizing experience on slower CPUs\n if (typeof globalWin?.requestAnimationFrame === 'function') {\n requestAnimationFrame(() => recalculatePosition(e));\n } else {\n recalculatePosition(e);\n }\n },\n [globalWin?.requestAnimationFrame, recalculatePosition],\n );\n\n const onDragEnd = React.useCallback(\n (event: NativeTouchOrMouseEvent) => {\n if (isMouseEvent(event)) {\n targetDocument?.removeEventListener('mouseup', onDragEnd);\n targetDocument?.removeEventListener('mousemove', onDrag);\n }\n if (isTouchEvent(event)) {\n targetDocument?.removeEventListener('touchend', onDragEnd);\n targetDocument?.removeEventListener('touchmove', onDrag);\n }\n },\n [onDrag, targetDocument],\n );\n\n const getOnMouseDown = (columnId: TableColumnId) => (event: ReactTouchOrMouseEvent) => {\n // Keep the width locally so that we decouple the calculation of the next with from rendering.\n // This makes the whole experience much faster and more precise\n currentWidth.current = columnResizeState.getColumnWidth(columnId);\n mouseX.current = getEventClientCoords(event).clientX;\n colId.current = columnId;\n\n if (isMouseEvent(event)) {\n // ignore other buttons than primary mouse button\n if (event.target !== event.currentTarget || event.button !== 0) {\n return;\n }\n targetDocument?.addEventListener('mouseup', onDragEnd);\n targetDocument?.addEventListener('mousemove', onDrag);\n }\n\n if (isTouchEvent(event)) {\n targetDocument?.addEventListener('touchend', onDragEnd);\n targetDocument?.addEventListener('touchmove', onDrag);\n }\n };\n\n return {\n getOnMouseDown: (columnId: TableColumnId) => getOnMouseDown(columnId),\n };\n}\n"]}
1
+ {"version":3,"names":["React","useFluent_unstable","useFluent","getEventClientCoords","isMouseEvent","isTouchEvent","useTableColumnResizeMouseHandler","columnResizeState","mouseX","useRef","currentWidth","colId","undefined","targetDocument","globalWin","defaultView","recalculatePosition","useCallback","e","clientX","dx","current","setColumnWidth","columnId","width","onDrag","requestAnimationFrame","onDragEnd","event","removeEventListener","getOnMouseDown","getColumnWidth","target","currentTarget","button","addEventListener"],"sources":["../src/packages/react-components/react-table/src/hooks/useTableColumnResizeMouseHandler.ts"],"sourcesContent":["import * as React from 'react';\nimport { TableColumnId, ColumnResizeState } from './types';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n NativeTouchOrMouseEvent,\n ReactTouchOrMouseEvent,\n getEventClientCoords,\n isMouseEvent,\n isTouchEvent,\n} from '@fluentui/react-utilities';\n\nexport function useTableColumnResizeMouseHandler(columnResizeState: ColumnResizeState) {\n const mouseX = React.useRef(0);\n const currentWidth = React.useRef(0);\n const colId = React.useRef<TableColumnId | undefined>(undefined);\n\n const { targetDocument } = useFluent();\n const globalWin = targetDocument?.defaultView;\n\n const recalculatePosition = React.useCallback(\n (e: NativeTouchOrMouseEvent) => {\n const { clientX } = getEventClientCoords(e);\n const dx = clientX - mouseX.current;\n\n // Update the local width for the column and set it\n currentWidth.current += dx;\n colId.current && columnResizeState.setColumnWidth(e, { columnId: colId.current, width: currentWidth.current });\n mouseX.current = clientX;\n },\n [columnResizeState],\n );\n\n const onDrag = React.useCallback(\n (e: NativeTouchOrMouseEvent) => {\n // Using requestAnimationFrame here drastically improves resizing experience on slower CPUs\n if (typeof globalWin?.requestAnimationFrame === 'function') {\n requestAnimationFrame(() => recalculatePosition(e));\n } else {\n recalculatePosition(e);\n }\n },\n [globalWin?.requestAnimationFrame, recalculatePosition],\n );\n\n const onDragEnd = React.useCallback(\n (event: NativeTouchOrMouseEvent) => {\n if (isMouseEvent(event)) {\n targetDocument?.removeEventListener('mouseup', onDragEnd);\n targetDocument?.removeEventListener('mousemove', onDrag);\n }\n if (isTouchEvent(event)) {\n targetDocument?.removeEventListener('touchend', onDragEnd);\n targetDocument?.removeEventListener('touchmove', onDrag);\n }\n },\n [onDrag, targetDocument],\n );\n\n const getOnMouseDown = (columnId: TableColumnId) => (event: ReactTouchOrMouseEvent) => {\n // Keep the width locally so that we decouple the calculation of the next with from rendering.\n // This makes the whole experience much faster and more precise\n currentWidth.current = columnResizeState.getColumnWidth(columnId);\n mouseX.current = getEventClientCoords(event).clientX;\n colId.current = columnId;\n\n if (isMouseEvent(event)) {\n // ignore other buttons than primary mouse button\n if (event.target !== event.currentTarget || event.button !== 0) {\n return;\n }\n targetDocument?.addEventListener('mouseup', onDragEnd);\n targetDocument?.addEventListener('mousemove', onDrag);\n }\n\n if (isTouchEvent(event)) {\n targetDocument?.addEventListener('touchend', onDragEnd);\n targetDocument?.addEventListener('touchmove', onDrag);\n }\n };\n\n return {\n getOnMouseDown: (columnId: TableColumnId) => getOnMouseDown(columnId),\n };\n}\n"],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gBAAgB,EAAEwB,KAAK,CAAC;IACrFC,UAAU,EAAE,MAAM7B,KAAK,CAACI,gBAAgB;IACxCN,cAAc,EAAG8B,KAAoB,IAAK9B,cAAc,CAACE,KAAK,CAACI,gBAAgB,EAAEwB,KAAK,CAAC;IACvFP;GACD;AACH","names":["useEventCallback","useIsomorphicLayoutEffect","React","columnDefinitionsToState","adjustColumnWidthsToFitContainer","getColumnById","setColumnProperty","getColumnWidth","createReducer","state","action","type","containerWidth","columnWidthState","newS","columns","columnSizingOptions","newState","columnId","width","column","newColumnWidthState","useTableColumnResizeState","params","onColumnResize","reducer","useMemo","dispatch","useReducer","undefined","setColumnWidth","event","data","col","Math","max","minWidth","colId","getColumns"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableColumnResizeState.ts"],"sourcesContent":["import { useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport {\n TableColumnDefinition,\n TableColumnId,\n ColumnResizeState,\n ColumnWidthState,\n UseTableColumnSizingParams,\n TableColumnSizingOptions,\n} from './types';\nimport {\n columnDefinitionsToState,\n adjustColumnWidthsToFitContainer,\n getColumnById,\n setColumnProperty,\n getColumnWidth,\n} from '../utils/columnResizeUtils';\n\ntype ComponentState<T> = {\n columns: TableColumnDefinition<T>[];\n containerWidth: number;\n columnWidthState: ColumnWidthState[];\n columnSizingOptions: TableColumnSizingOptions | undefined;\n};\n\ntype ColumnResizeStateAction<T> =\n | {\n type: 'CONTAINER_WIDTH_UPDATED';\n containerWidth: number;\n }\n | {\n type: 'COLUMNS_UPDATED';\n columns: TableColumnDefinition<T>[];\n }\n | {\n type: 'COLUMN_SIZING_OPTIONS_UPDATED';\n columnSizingOptions: TableColumnSizingOptions | undefined;\n }\n | {\n type: 'SET_COLUMN_WIDTH';\n columnId: TableColumnId;\n width: number;\n };\n\nconst createReducer = <T>() => (state: ComponentState<T>, action: ColumnResizeStateAction<T>): ComponentState<T> => {\n switch (action.type) {\n case 'CONTAINER_WIDTH_UPDATED':\n return {\n ...state,\n containerWidth: action.containerWidth,\n columnWidthState: adjustColumnWidthsToFitContainer(state.columnWidthState, action.containerWidth),\n };\n\n case 'COLUMNS_UPDATED':\n const newS = columnDefinitionsToState(action.columns, state.columnWidthState, state.columnSizingOptions);\n return {\n ...state,\n columns: action.columns,\n columnWidthState: adjustColumnWidthsToFitContainer(newS, state.containerWidth),\n };\n\n case 'COLUMN_SIZING_OPTIONS_UPDATED':\n const newState = columnDefinitionsToState(state.columns, state.columnWidthState, action.columnSizingOptions);\n return {\n ...state,\n columnSizingOptions: action.columnSizingOptions,\n columnWidthState: adjustColumnWidthsToFitContainer(newState, state.containerWidth),\n };\n\n case 'SET_COLUMN_WIDTH':\n const { columnId, width } = action;\n const { containerWidth } = state;\n\n const column = getColumnById(state.columnWidthState, columnId);\n let newColumnWidthState = [...state.columnWidthState];\n\n if (!column) {\n return state;\n }\n\n // Adjust the column width and measure the new total width\n newColumnWidthState = setColumnProperty(newColumnWidthState, columnId, 'width', width);\n // Set this width as idealWidth, because its a deliberate change, not a recalculation because of container\n newColumnWidthState = setColumnProperty(newColumnWidthState, columnId, 'idealWidth', width);\n // Adjust the widths to the container size\n newColumnWidthState = adjustColumnWidthsToFitContainer(newColumnWidthState, containerWidth);\n\n return { ...state, columnWidthState: newColumnWidthState };\n }\n};\n\nexport function useTableColumnResizeState<T>(\n columns: TableColumnDefinition<T>[],\n containerWidth: number,\n params: UseTableColumnSizingParams = {},\n): ColumnResizeState {\n const { onColumnResize, columnSizingOptions } = params;\n\n const reducer = React.useMemo(() => createReducer<T>(), []);\n\n const [state, dispatch] = React.useReducer(reducer, {\n columns,\n containerWidth: 0,\n columnWidthState: columnDefinitionsToState(columns, undefined, columnSizingOptions),\n columnSizingOptions,\n });\n\n useIsomorphicLayoutEffect(() => {\n dispatch({ type: 'CONTAINER_WIDTH_UPDATED', containerWidth });\n }, [containerWidth]);\n\n useIsomorphicLayoutEffect(() => {\n dispatch({ type: 'COLUMNS_UPDATED', columns });\n }, [columns]);\n\n useIsomorphicLayoutEffect(() => {\n dispatch({ type: 'COLUMN_SIZING_OPTIONS_UPDATED', columnSizingOptions });\n }, [columnSizingOptions]);\n\n const setColumnWidth = useEventCallback(\n (event: MouseEvent | TouchEvent | undefined, data: { columnId: TableColumnId; width: number }) => {\n let { width } = data;\n const { columnId } = data;\n const col = getColumnById(state.columnWidthState, columnId);\n if (!col) {\n return;\n }\n\n width = Math.max(col.minWidth || 0, width);\n\n if (onColumnResize) {\n onColumnResize(event, { columnId, width });\n }\n dispatch({ type: 'SET_COLUMN_WIDTH', columnId, width });\n },\n );\n\n return {\n getColumnById: (colId: TableColumnId) => getColumnById(state.columnWidthState, colId),\n getColumns: () => state.columnWidthState,\n getColumnWidth: (colId: TableColumnId) => getColumnWidth(state.columnWidthState, colId),\n setColumnWidth,\n };\n}\n"]}
1
+ {"version":3,"names":["useEventCallback","useIsomorphicLayoutEffect","React","columnDefinitionsToState","adjustColumnWidthsToFitContainer","getColumnById","setColumnProperty","getColumnWidth","createReducer","state","action","type","containerWidth","columnWidthState","newS","columns","columnSizingOptions","newState","columnId","width","column","newColumnWidthState","useTableColumnResizeState","params","onColumnResize","reducer","useMemo","dispatch","useReducer","undefined","setColumnWidth","event","data","col","Math","max","minWidth","colId","getColumns"],"sources":["../src/packages/react-components/react-table/src/hooks/useTableColumnResizeState.ts"],"sourcesContent":["import { useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport {\n TableColumnDefinition,\n TableColumnId,\n ColumnResizeState,\n ColumnWidthState,\n UseTableColumnSizingParams,\n TableColumnSizingOptions,\n} from './types';\nimport {\n columnDefinitionsToState,\n adjustColumnWidthsToFitContainer,\n getColumnById,\n setColumnProperty,\n getColumnWidth,\n} from '../utils/columnResizeUtils';\n\ntype ComponentState<T> = {\n columns: TableColumnDefinition<T>[];\n containerWidth: number;\n columnWidthState: ColumnWidthState[];\n columnSizingOptions: TableColumnSizingOptions | undefined;\n};\n\ntype ColumnResizeStateAction<T> =\n | {\n type: 'CONTAINER_WIDTH_UPDATED';\n containerWidth: number;\n }\n | {\n type: 'COLUMNS_UPDATED';\n columns: TableColumnDefinition<T>[];\n }\n | {\n type: 'COLUMN_SIZING_OPTIONS_UPDATED';\n columnSizingOptions: TableColumnSizingOptions | undefined;\n }\n | {\n type: 'SET_COLUMN_WIDTH';\n columnId: TableColumnId;\n width: number;\n };\n\nconst createReducer =\n <T>() =>\n (state: ComponentState<T>, action: ColumnResizeStateAction<T>): ComponentState<T> => {\n switch (action.type) {\n case 'CONTAINER_WIDTH_UPDATED':\n return {\n ...state,\n containerWidth: action.containerWidth,\n columnWidthState: adjustColumnWidthsToFitContainer(state.columnWidthState, action.containerWidth),\n };\n\n case 'COLUMNS_UPDATED':\n const newS = columnDefinitionsToState(action.columns, state.columnWidthState, state.columnSizingOptions);\n return {\n ...state,\n columns: action.columns,\n columnWidthState: adjustColumnWidthsToFitContainer(newS, state.containerWidth),\n };\n\n case 'COLUMN_SIZING_OPTIONS_UPDATED':\n const newState = columnDefinitionsToState(state.columns, state.columnWidthState, action.columnSizingOptions);\n return {\n ...state,\n columnSizingOptions: action.columnSizingOptions,\n columnWidthState: adjustColumnWidthsToFitContainer(newState, state.containerWidth),\n };\n\n case 'SET_COLUMN_WIDTH':\n const { columnId, width } = action;\n const { containerWidth } = state;\n\n const column = getColumnById(state.columnWidthState, columnId);\n let newColumnWidthState = [...state.columnWidthState];\n\n if (!column) {\n return state;\n }\n\n // Adjust the column width and measure the new total width\n newColumnWidthState = setColumnProperty(newColumnWidthState, columnId, 'width', width);\n // Set this width as idealWidth, because its a deliberate change, not a recalculation because of container\n newColumnWidthState = setColumnProperty(newColumnWidthState, columnId, 'idealWidth', width);\n // Adjust the widths to the container size\n newColumnWidthState = adjustColumnWidthsToFitContainer(newColumnWidthState, containerWidth);\n\n return { ...state, columnWidthState: newColumnWidthState };\n }\n };\n\nexport function useTableColumnResizeState<T>(\n columns: TableColumnDefinition<T>[],\n containerWidth: number,\n params: UseTableColumnSizingParams = {},\n): ColumnResizeState {\n const { onColumnResize, columnSizingOptions } = params;\n\n const reducer = React.useMemo(() => createReducer<T>(), []);\n\n const [state, dispatch] = React.useReducer(reducer, {\n columns,\n containerWidth: 0,\n columnWidthState: columnDefinitionsToState(columns, undefined, columnSizingOptions),\n columnSizingOptions,\n });\n\n useIsomorphicLayoutEffect(() => {\n dispatch({ type: 'CONTAINER_WIDTH_UPDATED', containerWidth });\n }, [containerWidth]);\n\n useIsomorphicLayoutEffect(() => {\n dispatch({ type: 'COLUMNS_UPDATED', columns });\n }, [columns]);\n\n useIsomorphicLayoutEffect(() => {\n dispatch({ type: 'COLUMN_SIZING_OPTIONS_UPDATED', columnSizingOptions });\n }, [columnSizingOptions]);\n\n const setColumnWidth = useEventCallback(\n (event: MouseEvent | TouchEvent | undefined, data: { columnId: TableColumnId; width: number }) => {\n let { width } = data;\n const { columnId } = data;\n const col = getColumnById(state.columnWidthState, columnId);\n if (!col) {\n return;\n }\n\n width = Math.max(col.minWidth || 0, width);\n\n if (onColumnResize) {\n onColumnResize(event, { columnId, width });\n }\n dispatch({ type: 'SET_COLUMN_WIDTH', columnId, width });\n },\n );\n\n return {\n getColumnById: (colId: TableColumnId) => getColumnById(state.columnWidthState, colId),\n getColumns: () => state.columnWidthState,\n getColumnWidth: (colId: TableColumnId) => getColumnWidth(state.columnWidthState, colId),\n setColumnWidth,\n };\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,yBAAyB,QAAQ,2BAA2B;AACvF,OAAO,KAAKC,KAAK,MAAM,OAAO;AAS9B,SACEC,wBAAwB,EACxBC,gCAAgC,EAChCC,aAAa,EACbC,iBAAiB,EACjBC,cAAc,QACT,4BAA4B;AA4BnC,MAAMC,aAAa,GACjBA,CAAA,KACA,CAACC,KAAwB,EAAEC,MAAkC,KAAuB;EAClF,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAK,yBAAyB;MAC5B,OAA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YAAY,EAAEV,YAAY,CAACnB,cAAc,CAACI,QAAQ;QAAC,EAEtD;QACD,OAAOqB,GAAG,GAAG;UAAEtB,KAAK,EAAEO,eAAe,CAACe,GAAG,CAAC;UAAEE;QAAK,CAAE,GAAG,EAAE;MAC1D,CAAC;MACDtB,iBAAiB,EAAGD,QAAuB,IAAI;QAC7C,MAAMqB,GAAG,GAAGR,iBAAiB,CAACS,aAAa,CAACtB,QAAQ,CAAC;QACrD,OAAOqB,GAAG,GAAG;UAAEtB,KAAK,EAAEO,eAAe,CAACe,GAAG;QAAC,CAAE,GAAG,EAAE;MACnD;;GAEH;AACH","names":["React","useTableColumnResizeState","useTableColumnResizeMouseHandler","useMeasureElement","TableResizeHandle","defaultColumnSizingState","getColumnWidths","getOnMouseDown","setColumnWidth","getTableHeaderCellProps","style","columnId","getTableCellProps","useTableColumnSizing_unstable","params","tableState","useTableColumnSizingState","getColumnStyles","column","width","minWidth","maxWidth","columns","measureElementRef","columnResizeState","containerWidthOffset","mouseHandler","tableRef","columnSizing_unstable","w","undefined","getColumns","col","getColumnById","aside","onMouseDown","onTouchStart"],"sourceRoot":"../src/","sources":["packages/react-components/react-table/src/hooks/useTableColumnSizing.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n TableColumnId,\n ColumnWidthState,\n TableColumnSizingState,\n TableFeaturesState,\n UseTableColumnSizingParams,\n} from './types';\nimport { useTableColumnResizeState } from './useTableColumnResizeState';\nimport { useTableColumnResizeMouseHandler } from './useTableColumnResizeMouseHandler';\nimport { useMeasureElement } from './useMeasureElement';\nimport { TableResizeHandle } from '../TableResizeHandle';\n\nexport const defaultColumnSizingState: TableColumnSizingState = {\n getColumnWidths: () => [],\n getOnMouseDown: () => () => null,\n setColumnWidth: () => null,\n getTableHeaderCellProps: () => ({ style: {}, columnId: '' }),\n getTableCellProps: () => ({ style: {}, columnId: '' }),\n};\n\nexport function useTableColumnSizing_unstable<TItem>(params?: UseTableColumnSizingParams) {\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: TableFeaturesState<TItem>) => useTableColumnSizingState(tableState, params);\n}\n\nfunction getColumnStyles(column: ColumnWidthState): React.CSSProperties {\n const width = column.width;\n\n return {\n // native styles\n width,\n // non-native element styles (flex layout)\n minWidth: width,\n maxWidth: width,\n };\n}\n\nfunction useTableColumnSizingState<TItem>(\n tableState: TableFeaturesState<TItem>,\n params?: UseTableColumnSizingParams,\n): TableFeaturesState<TItem> {\n const { columns } = tableState;\n\n // Gets the container width\n const { width, measureElementRef } = useMeasureElement();\n // Creates the state based on columns and available containerWidth\n const columnResizeState = useTableColumnResizeState(columns, width + (params?.containerWidthOffset || 0), params);\n // Creates the mouse handler and attaches the state to it\n const mouseHandler = useTableColumnResizeMouseHandler(columnResizeState);\n\n return {\n ...tableState,\n tableRef: measureElementRef,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: {\n getOnMouseDown: mouseHandler.getOnMouseDown,\n setColumnWidth: (columnId: TableColumnId, w: number) =>\n columnResizeState.setColumnWidth(undefined, { columnId, width: w }),\n getColumnWidths: columnResizeState.getColumns,\n getTableHeaderCellProps: (columnId: TableColumnId) => {\n const col = columnResizeState.getColumnById(columnId);\n const aside = (\n <TableResizeHandle\n onMouseDown={mouseHandler.getOnMouseDown(columnId)}\n onTouchStart={mouseHandler.getOnMouseDown(columnId)}\n />\n );\n return col ? { style: getColumnStyles(col), aside } : {};\n },\n getTableCellProps: (columnId: TableColumnId) => {\n const col = columnResizeState.getColumnById(columnId);\n return col ? { style: getColumnStyles(col) } : {};\n },\n },\n };\n}\n"]}
1
+ {"version":3,"names":["React","useTableColumnResizeState","useTableColumnResizeMouseHandler","useMeasureElement","TableResizeHandle","defaultColumnSizingState","getColumnWidths","getOnMouseDown","setColumnWidth","getTableHeaderCellProps","style","columnId","getTableCellProps","useTableColumnSizing_unstable","params","tableState","useTableColumnSizingState","getColumnStyles","column","width","minWidth","maxWidth","columns","measureElementRef","columnResizeState","containerWidthOffset","mouseHandler","tableRef","columnSizing_unstable","w","undefined","getColumns","col","getColumnById","aside","createElement","onMouseDown","onTouchStart"],"sources":["../src/packages/react-components/react-table/src/hooks/useTableColumnSizing.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n TableColumnId,\n ColumnWidthState,\n TableColumnSizingState,\n TableFeaturesState,\n UseTableColumnSizingParams,\n} from './types';\nimport { useTableColumnResizeState } from './useTableColumnResizeState';\nimport { useTableColumnResizeMouseHandler } from './useTableColumnResizeMouseHandler';\nimport { useMeasureElement } from './useMeasureElement';\nimport { TableResizeHandle } from '../TableResizeHandle';\n\nexport const defaultColumnSizingState: TableColumnSizingState = {\n getColumnWidths: () => [],\n getOnMouseDown: () => () => null,\n setColumnWidth: () => null,\n getTableHeaderCellProps: () => ({ style: {}, columnId: '' }),\n getTableCellProps: () => ({ style: {}, columnId: '' }),\n};\n\nexport function useTableColumnSizing_unstable<TItem>(params?: UseTableColumnSizingParams) {\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: TableFeaturesState<TItem>) => useTableColumnSizingState(tableState, params);\n}\n\nfunction getColumnStyles(column: ColumnWidthState): React.CSSProperties {\n const width = column.width;\n\n return {\n // native styles\n width,\n // non-native element styles (flex layout)\n minWidth: width,\n maxWidth: width,\n };\n}\n\nfunction useTableColumnSizingState<TItem>(\n tableState: TableFeaturesState<TItem>,\n params?: UseTableColumnSizingParams,\n): TableFeaturesState<TItem> {\n const { columns } = tableState;\n\n // Gets the container width\n const { width, measureElementRef } = useMeasureElement();\n // Creates the state based on columns and available containerWidth\n const columnResizeState = useTableColumnResizeState(columns, width + (params?.containerWidthOffset || 0), params);\n // Creates the mouse handler and attaches the state to it\n const mouseHandler = useTableColumnResizeMouseHandler(columnResizeState);\n\n return {\n ...tableState,\n tableRef: measureElementRef,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: {\n getOnMouseDown: mouseHandler.getOnMouseDown,\n setColumnWidth: (columnId: TableColumnId, w: number) =>\n columnResizeState.setColumnWidth(undefined, { columnId, width: w }),\n getColumnWidths: columnResizeState.getColumns,\n getTableHeaderCellProps: (columnId: TableColumnId) => {\n const col = columnResizeState.getColumnById(columnId);\n const aside = (\n <TableResizeHandle\n onMouseDown={mouseHandler.getOnMouseDown(columnId)}\n onTouchStart={mouseHandler.getOnMouseDown(columnId)}\n />\n );\n return col ? { style: getColumnStyles(col), aside } : {};\n },\n getTableCellProps: (columnId: TableColumnId) => {\n const col = columnResizeState.getColumnById(columnId);\n return col ? { style: getColumnStyles(col) } : {};\n },\n },\n };\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAQ9B,SAASC,yBAAyB,QAAQ,6BAA6B;AACvE,SAASC,gCAAgC,QAAQ,oCAAoC;AACrF,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,iBAAiB,QAAQ,sBAAsB;AAExD,OAAO,MAAMC,wBAAwB,GAA2B;EAC9DC,eAAe,EAAEA,CAAA,KAAM,EAAE;EACzBC,cAAc,EAAEA,CAAA,KAAM,MAAM,IAAI;EAChCC,cAAc,EAAEA,CAAA,KAAM,IAAI;EAC1BC,uBAAuB,EAAEA,CAAA,MAAO;IAAEC,KAAK,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAE,CAAE,CAAC;EAC5DC,iBAAiB,EAAEA,CAAA,MAAO;IAAEF,KAAK,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAE,CAAE;CACtD;AAED,OAAM,SAAUE,6BAA6BA,CAAQC,MAAmC;EACtF;EACA;EACA,OAAQC,UAAqC,IAAKC,yBAAyB,CAACD,UAAU,EAAED,MAAM,CAAC;AACjG;AAEA,SAASG,eAAeA,CAACC,MAAwB;EAC/C,MAAMC,KAAK,GAAGD,MAAM,CAACC,KAAK;EAE1B,OAAO;IACL;IACAA,KAAK;IACL;IACAC,QAAQ,EAAED,KAAK;IACfE,QAAQ,EA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IAC/CW,QAAQ,eAAEd,KAAK,CAACe,SAAS;GAC1B;EAED,OAAOG,OAAO,CAACO,MAAM,CAAC,CAACC,KAAK,EAAEC,MAAM,KAAKA,MAAM,CAACD,KAAK,CAAC,EAAEF,YAAY,CAAC;AACvE","names":["React","defaultTableSelectionState","defaultTableSortState","defaultColumnSizingState","defaultRowEnhancer","row","defaultTableState","selection","sort","getRows","getRowId","items","columns","columnSizing_unstable","tableRef","createRef","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 * as React from 'react';\nimport type {\n UseTableFeaturesOptions,\n TableFeaturesState,\n TableRowData,\n RowEnhancer,\n TableFeaturePlugin,\n TableSortState,\n} from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\nimport { defaultColumnSizingState } from './useTableColumnSizing';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, TableRowData<unknown>> = row => row;\n\nexport const defaultTableState: TableFeaturesState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createRef<HTMLDivElement>(),\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableFeaturesOptions<TItem>,\n plugins: TableFeaturePlugin[] = [],\n): TableFeaturesState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = <TRowState extends TableRowData<TItem>>(\n rowEnhancer = defaultRowEnhancer as RowEnhancer<TItem, TRowState>,\n ) => items.map((item, i) => rowEnhancer({ item, rowId: getRowId?.(item) ?? i }));\n\n const initialState: TableFeaturesState<TItem> = {\n getRowId,\n items,\n columns,\n getRows,\n selection: defaultTableSelectionState,\n sort: defaultTableSortState as TableSortState<TItem>,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createRef(),\n };\n\n return plugins.reduce((state, plugin) => plugin(state), initialState);\n}\n"]}
1
+ {"version":3,"names":["React","defaultTableSelectionState","defaultTableSortState","defaultColumnSizingState","defaultRowEnhancer","row","defaultTableState","selection","sort","getRows","getRowId","items","columns","columnSizing_unstable","tableRef","createRef","useTableFeatures","options","plugins","rowEnhancer","map","item","i","_a","rowId","initialState","reduce","state","plugin"],"sources":["../src/packages/react-components/react-table/src/hooks/useTableFeatures.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n UseTableFeaturesOptions,\n TableFeaturesState,\n TableRowData,\n RowEnhancer,\n TableFeaturePlugin,\n TableSortState,\n} from './types';\nimport { defaultTableSelectionState } from './useTableSelection';\nimport { defaultTableSortState } from './useTableSort';\nimport { defaultColumnSizingState } from './useTableColumnSizing';\n\nconst defaultRowEnhancer: RowEnhancer<unknown, TableRowData<unknown>> = row => row;\n\nexport const defaultTableState: TableFeaturesState<unknown> = {\n selection: defaultTableSelectionState,\n sort: defaultTableSortState,\n getRows: () => [],\n getRowId: () => '',\n items: [],\n columns: [],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createRef<HTMLDivElement>(),\n};\n\nexport function useTableFeatures<TItem>(\n options: UseTableFeaturesOptions<TItem>,\n plugins: TableFeaturePlugin[] = [],\n): TableFeaturesState<TItem> {\n const { items, getRowId, columns } = options;\n\n const getRows = <TRowState extends TableRowData<TItem>>(\n rowEnhancer = defaultRowEnhancer as RowEnhancer<TItem, TRowState>,\n ) => items.map((item, i) => rowEnhancer({ item, rowId: getRowId?.(item) ?? i }));\n\n const initialState: TableFeaturesState<TItem> = {\n getRowId,\n items,\n columns,\n getRows,\n selection: defaultTableSelectionState,\n sort: defaultTableSortState as TableSortState<TItem>,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n columnSizing_unstable: defaultColumnSizingState,\n tableRef: React.createR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,KAAK,CAACe,SAAS;GAC1B;EAED,OAAOG,OAAO,CAACQ,MAAM,CAAC,CAACC,KAAK,EAAEC,MAAM,KAAKA,MAAM,CAACD,KAAK,CAAC,EAAEF,YAAY,CAAC;AACvE"}
@@ -32,8 +32,8 @@ export function useTableSelectionState(tableState, options) {
32
32
  } = options;
33
33
  const [selected, setSelected] = useControllableState({
34
34
  initialState: new Set(),
35
- defaultState: defaultSelectedItems,
36
- state: selectedItems
35
+ defaultState: React.useMemo(() => defaultSelectedItems && createSetFromIterable(defaultSelectedItems), [defaultSelectedItems]),
36
+ state: React.useMemo(() => selectedItems && createSetFromIterable(selectedItems), [selectedItems])
37
37
  });
38
38
  const selectionManager = React.useMemo(() => {
39
39
  return createSelectionManager(selectionMode, (e, newSelectedItems) => {
@@ -71,4 +71,10 @@ export function useTableSelectionState(tableState, options) {
71
71
  }
72
72
  };
73
73
  }
74
+ /**
75
+ * Creates a set from a given iterable, in case the iterable is a set itself, returns the given set instead.
76
+ */
77
+ function createSetFromIterable(iterable) {
78
+ return iterable instanceof Set ? iterable : new Set(iterable);
79
+ }
74
80
  //# sourceMappingURL=useTableSelection.js.map