material-react-table 2.0.0-beta.1 → 2.0.0-beta.11

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 (571) hide show
  1. package/dist/index.d.ts +279 -261
  2. package/dist/{esm/material-react-table.esm.js → index.esm.js} +943 -921
  3. package/dist/index.esm.js.map +1 -0
  4. package/dist/{cjs/index.js → index.js} +948 -926
  5. package/dist/index.js.map +1 -0
  6. package/dist/types/MaterialReactTable.d.ts +7 -0
  7. package/dist/types/body/MRT_TableBody.d.ts +13 -0
  8. package/dist/types/body/MRT_TableBodyCell.d.ts +15 -0
  9. package/dist/types/body/MRT_TableBodyCellValue.d.ts +8 -0
  10. package/dist/types/body/MRT_TableBodyRow.d.ts +18 -0
  11. package/dist/types/body/MRT_TableBodyRowGrabHandle.d.ts +10 -0
  12. package/dist/types/body/MRT_TableBodyRowPinButton.d.ts +8 -0
  13. package/dist/types/body/MRT_TableDetailPanel.d.ts +13 -0
  14. package/dist/types/buttons/MRT_ColumnPinningButtons.d.ts +8 -0
  15. package/dist/types/buttons/MRT_CopyButton.d.ts +8 -0
  16. package/dist/types/buttons/MRT_EditActionButtons.d.ts +9 -0
  17. package/dist/types/buttons/MRT_ExpandAllButton.d.ts +7 -0
  18. package/dist/types/buttons/MRT_ExpandButton.d.ts +8 -0
  19. package/dist/{cjs/types → types}/buttons/MRT_GrabHandleButton.d.ts +3 -3
  20. package/dist/types/buttons/MRT_RowPinButton.d.ts +10 -0
  21. package/dist/types/buttons/MRT_ShowHideColumnsButton.d.ts +7 -0
  22. package/dist/types/buttons/MRT_ToggleDensePaddingButton.d.ts +7 -0
  23. package/dist/types/buttons/MRT_ToggleFiltersButton.d.ts +7 -0
  24. package/dist/types/buttons/MRT_ToggleFullScreenButton.d.ts +7 -0
  25. package/dist/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +7 -0
  26. package/dist/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +9 -0
  27. package/dist/types/column.utils.d.ts +119 -0
  28. package/dist/types/filterFns.d.ts +69 -0
  29. package/dist/types/footer/MRT_TableFooter.d.ts +11 -0
  30. package/dist/types/footer/MRT_TableFooterCell.d.ts +8 -0
  31. package/dist/types/footer/MRT_TableFooterRow.d.ts +12 -0
  32. package/dist/types/head/MRT_TableHead.d.ts +11 -0
  33. package/dist/types/head/MRT_TableHeadCell.d.ts +8 -0
  34. package/dist/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +8 -0
  35. package/dist/types/head/MRT_TableHeadCellFilterContainer.d.ts +8 -0
  36. package/dist/types/head/MRT_TableHeadCellFilterLabel.d.ts +8 -0
  37. package/dist/{cjs/types → types}/head/MRT_TableHeadCellGrabHandle.d.ts +4 -3
  38. package/dist/types/head/MRT_TableHeadCellResizeHandle.d.ts +8 -0
  39. package/dist/types/head/MRT_TableHeadCellSortLabel.d.ts +8 -0
  40. package/dist/types/head/MRT_TableHeadRow.d.ts +12 -0
  41. package/dist/types/hooks/useMRT_DisplayColumns.d.ts +9 -0
  42. package/dist/types/hooks/useMRT_Effects.d.ts +2 -0
  43. package/dist/types/hooks/useMRT_TableInstance.d.ts +2 -0
  44. package/dist/types/hooks/useMRT_TableOptions.d.ts +22 -0
  45. package/dist/{cjs/types → types}/index.d.ts +1 -0
  46. package/dist/types/inputs/MRT_EditCellTextField.d.ts +8 -0
  47. package/dist/types/inputs/MRT_FilterCheckbox.d.ts +8 -0
  48. package/dist/types/inputs/MRT_FilterRangeFields.d.ts +8 -0
  49. package/dist/types/inputs/MRT_FilterRangeSlider.d.ts +8 -0
  50. package/dist/types/inputs/MRT_FilterTextField.d.ts +9 -0
  51. package/dist/types/inputs/MRT_GlobalFilterTextField.d.ts +7 -0
  52. package/dist/types/inputs/MRT_SelectCheckbox.d.ts +9 -0
  53. package/dist/types/locales/az.d.ts +2 -0
  54. package/dist/{cjs/types → types}/locales/no.d.ts +1 -1
  55. package/dist/{esm/types → types}/menus/MRT_ColumnActionMenu.d.ts +4 -3
  56. package/dist/{esm/types → types}/menus/MRT_FilterOptionMenu.d.ts +4 -3
  57. package/dist/types/menus/MRT_RowActionMenu.d.ts +12 -0
  58. package/dist/types/menus/MRT_ShowHideColumnsMenu.d.ts +10 -0
  59. package/dist/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +12 -0
  60. package/dist/types/modals/MRT_EditRowModal.d.ts +8 -0
  61. package/dist/{esm/types → types}/sortingFns.d.ts +3 -3
  62. package/dist/types/style.utils.d.ts +32 -0
  63. package/dist/types/table/MRT_Table.d.ts +7 -0
  64. package/dist/types/table/MRT_TableContainer.d.ts +7 -0
  65. package/dist/types/table/MRT_TableLoadingOverlay.d.ts +7 -0
  66. package/dist/types/table/MRT_TablePaper.d.ts +7 -0
  67. package/dist/{cjs/types → types}/table/index.d.ts +1 -0
  68. package/dist/types/toolbar/MRT_BottomToolbar.d.ts +7 -0
  69. package/dist/types/toolbar/MRT_LinearProgressBar.d.ts +8 -0
  70. package/dist/types/toolbar/MRT_TablePagination.d.ts +11 -0
  71. package/dist/types/toolbar/MRT_ToolbarAlertBanner.d.ts +8 -0
  72. package/dist/types/toolbar/MRT_ToolbarDropZone.d.ts +7 -0
  73. package/dist/types/toolbar/MRT_ToolbarInternalButtons.d.ts +7 -0
  74. package/dist/types/toolbar/MRT_TopToolbar.d.ts +6 -0
  75. package/dist/{cjs/types → types}/types.d.ts +69 -50
  76. package/dist/types/useMaterialReactTable.d.ts +2 -0
  77. package/locales/ar.d.ts +1 -0
  78. package/locales/ar.js +0 -1
  79. package/locales/{ar.esm.js → ar.mjs} +0 -1
  80. package/locales/az.d.ts +3 -0
  81. package/locales/az.js +97 -0
  82. package/locales/az.mjs +93 -0
  83. package/locales/bg.d.ts +1 -0
  84. package/locales/bg.js +0 -1
  85. package/locales/{bg.esm.js → bg.mjs} +0 -1
  86. package/locales/cs.d.ts +1 -0
  87. package/locales/cs.js +0 -1
  88. package/locales/{cs.esm.js → cs.mjs} +0 -1
  89. package/locales/da.d.ts +1 -0
  90. package/locales/da.js +0 -1
  91. package/locales/{da.esm.js → da.mjs} +0 -1
  92. package/locales/de.d.ts +1 -0
  93. package/locales/de.js +0 -1
  94. package/locales/{de.esm.js → de.mjs} +0 -1
  95. package/locales/en.d.ts +1 -0
  96. package/locales/en.js +0 -1
  97. package/locales/{en.esm.js → en.mjs} +0 -1
  98. package/locales/es.d.ts +1 -0
  99. package/locales/es.js +0 -1
  100. package/locales/{es.esm.js → es.mjs} +0 -1
  101. package/locales/et.d.ts +1 -0
  102. package/locales/et.js +0 -1
  103. package/locales/{et.esm.js → et.mjs} +0 -1
  104. package/locales/fa.d.ts +1 -0
  105. package/locales/fa.js +0 -1
  106. package/locales/{fa.esm.js → fa.mjs} +0 -1
  107. package/locales/fi.d.ts +1 -0
  108. package/locales/fi.js +0 -1
  109. package/locales/{fi.esm.js → fi.mjs} +0 -1
  110. package/locales/fr.d.ts +1 -0
  111. package/locales/fr.js +0 -1
  112. package/locales/{fr.esm.js → fr.mjs} +0 -1
  113. package/locales/hu.d.ts +1 -0
  114. package/locales/hu.js +0 -1
  115. package/locales/{hu.esm.js → hu.mjs} +0 -1
  116. package/locales/hy.d.ts +1 -0
  117. package/locales/hy.js +0 -1
  118. package/locales/{hy.esm.js → hy.mjs} +0 -1
  119. package/locales/id.d.ts +1 -0
  120. package/locales/id.js +0 -1
  121. package/locales/{id.esm.js → id.mjs} +0 -1
  122. package/locales/it.d.ts +1 -0
  123. package/locales/it.js +0 -1
  124. package/locales/{it.esm.js → it.mjs} +0 -1
  125. package/locales/ja.d.ts +1 -0
  126. package/locales/ja.js +0 -1
  127. package/locales/{ja.esm.js → ja.mjs} +0 -1
  128. package/locales/ko.d.ts +1 -0
  129. package/locales/ko.js +0 -1
  130. package/locales/{ko.esm.js → ko.mjs} +0 -1
  131. package/locales/nl.d.ts +1 -0
  132. package/locales/nl.js +0 -1
  133. package/locales/{nl.esm.js → nl.mjs} +0 -1
  134. package/locales/no.d.ts +2 -1
  135. package/locales/no.js +0 -1
  136. package/locales/{no.esm.js → no.mjs} +0 -1
  137. package/locales/np.d.ts +1 -0
  138. package/locales/np.js +0 -1
  139. package/locales/{np.esm.js → np.mjs} +0 -1
  140. package/locales/pl.d.ts +1 -0
  141. package/locales/pl.js +0 -1
  142. package/locales/{pl.esm.js → pl.mjs} +0 -1
  143. package/locales/pt-BR.d.ts +1 -0
  144. package/locales/pt-BR.js +0 -1
  145. package/locales/{pt-BR.esm.js → pt-BR.mjs} +0 -1
  146. package/locales/pt.d.ts +1 -0
  147. package/locales/pt.js +0 -1
  148. package/locales/{pt.esm.js → pt.mjs} +0 -1
  149. package/locales/ro.d.ts +1 -0
  150. package/locales/ro.js +0 -1
  151. package/locales/{ro.esm.js → ro.mjs} +0 -1
  152. package/locales/ru.d.ts +1 -0
  153. package/locales/ru.js +0 -1
  154. package/locales/{ru.esm.js → ru.mjs} +0 -1
  155. package/locales/sk.d.ts +1 -0
  156. package/locales/sk.js +0 -1
  157. package/locales/{sk.esm.js → sk.mjs} +0 -1
  158. package/locales/sr-Cyrl-RS.d.ts +1 -0
  159. package/locales/sr-Cyrl-RS.js +0 -1
  160. package/locales/{sr-Cyrl-RS.esm.js → sr-Cyrl-RS.mjs} +0 -1
  161. package/locales/sr-Latn-RS.d.ts +1 -0
  162. package/locales/sr-Latn-RS.js +0 -1
  163. package/locales/{sr-Latn-RS.esm.js → sr-Latn-RS.mjs} +0 -1
  164. package/locales/sv.d.ts +1 -0
  165. package/locales/sv.js +0 -1
  166. package/locales/{sv.esm.js → sv.mjs} +0 -1
  167. package/locales/tr.d.ts +1 -0
  168. package/locales/tr.js +0 -1
  169. package/locales/{tr.esm.js → tr.mjs} +0 -1
  170. package/locales/uk.d.ts +1 -0
  171. package/locales/uk.js +0 -1
  172. package/locales/{uk.esm.js → uk.mjs} +0 -1
  173. package/locales/vi.d.ts +1 -0
  174. package/locales/vi.js +0 -1
  175. package/locales/{vi.esm.js → vi.mjs} +0 -1
  176. package/locales/zh-Hans.d.ts +1 -0
  177. package/locales/zh-Hans.js +17 -18
  178. package/locales/{zh-Hans.esm.js → zh-Hans.mjs} +17 -18
  179. package/locales/zh-Hant.d.ts +1 -0
  180. package/locales/zh-Hant.js +0 -1
  181. package/locales/{zh-Hant.esm.js → zh-Hant.mjs} +0 -1
  182. package/package.json +215 -31
  183. package/src/MaterialReactTable.tsx +5 -4
  184. package/src/body/MRT_TableBody.tsx +14 -8
  185. package/src/body/MRT_TableBodyCell.tsx +77 -70
  186. package/src/body/MRT_TableBodyCellValue.tsx +13 -9
  187. package/src/body/MRT_TableBodyRow.tsx +26 -15
  188. package/src/body/MRT_TableBodyRowGrabHandle.tsx +16 -7
  189. package/src/body/MRT_TableBodyRowPinButton.tsx +18 -7
  190. package/src/body/MRT_TableDetailPanel.tsx +19 -11
  191. package/src/buttons/MRT_ColumnPinningButtons.tsx +21 -8
  192. package/src/buttons/MRT_CopyButton.tsx +12 -11
  193. package/src/buttons/MRT_EditActionButtons.tsx +17 -7
  194. package/src/buttons/MRT_ExpandAllButton.tsx +13 -11
  195. package/src/buttons/MRT_ExpandButton.tsx +10 -8
  196. package/src/buttons/MRT_GrabHandleButton.tsx +10 -8
  197. package/src/buttons/MRT_RowPinButton.tsx +14 -7
  198. package/src/buttons/MRT_ShowHideColumnsButton.tsx +4 -4
  199. package/src/buttons/MRT_ToggleDensePaddingButton.tsx +4 -6
  200. package/src/buttons/MRT_ToggleFiltersButton.tsx +4 -4
  201. package/src/buttons/MRT_ToggleFullScreenButton.tsx +3 -4
  202. package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +4 -6
  203. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +15 -9
  204. package/src/column.utils.ts +46 -141
  205. package/src/filterFns.ts +15 -14
  206. package/src/footer/MRT_TableFooter.tsx +11 -7
  207. package/src/footer/MRT_TableFooterCell.tsx +21 -16
  208. package/src/footer/MRT_TableFooterRow.tsx +14 -9
  209. package/src/head/MRT_TableHead.tsx +10 -6
  210. package/src/head/MRT_TableHeadCell.tsx +102 -91
  211. package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +13 -12
  212. package/src/head/MRT_TableHeadCellFilterContainer.tsx +10 -6
  213. package/src/head/MRT_TableHeadCellFilterLabel.tsx +15 -9
  214. package/src/head/MRT_TableHeadCellGrabHandle.tsx +10 -3
  215. package/src/head/MRT_TableHeadCellResizeHandle.tsx +14 -9
  216. package/src/head/MRT_TableHeadCellSortLabel.tsx +38 -18
  217. package/src/head/MRT_TableHeadRow.tsx +15 -9
  218. package/src/hooks/useMRT_DisplayColumns.tsx +14 -10
  219. package/src/hooks/useMRT_Effects.ts +6 -2
  220. package/src/hooks/useMRT_TableInstance.ts +3 -2
  221. package/src/hooks/useMRT_TableOptions.ts +29 -4
  222. package/src/index.ts +1 -0
  223. package/src/inputs/MRT_EditCellTextField.tsx +18 -4
  224. package/src/inputs/MRT_FilterCheckbox.tsx +10 -5
  225. package/src/inputs/MRT_FilterRangeFields.tsx +19 -5
  226. package/src/inputs/MRT_FilterRangeSlider.tsx +10 -4
  227. package/src/inputs/MRT_FilterTextField.tsx +13 -5
  228. package/src/inputs/MRT_GlobalFilterTextField.tsx +27 -10
  229. package/src/inputs/MRT_SelectCheckbox.tsx +14 -7
  230. package/src/locales/az.ts +94 -0
  231. package/src/locales/no.ts +1 -1
  232. package/src/locales/zh-Hans.ts +17 -17
  233. package/src/menus/MRT_ColumnActionMenu.tsx +10 -4
  234. package/src/menus/MRT_FilterOptionMenu.tsx +6 -3
  235. package/src/menus/MRT_RowActionMenu.tsx +10 -4
  236. package/src/menus/MRT_ShowHideColumnsMenu.tsx +10 -4
  237. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +17 -10
  238. package/src/modals/MRT_EditRowModal.tsx +17 -11
  239. package/src/sortingFns.ts +3 -3
  240. package/src/style.utils.ts +149 -0
  241. package/src/table/MRT_Table.tsx +28 -34
  242. package/src/table/MRT_TableContainer.tsx +17 -46
  243. package/src/table/MRT_TableLoadingOverlay.tsx +54 -0
  244. package/src/table/MRT_TablePaper.tsx +13 -6
  245. package/src/table/index.ts +1 -0
  246. package/src/toolbar/MRT_BottomToolbar.tsx +16 -14
  247. package/src/toolbar/MRT_LinearProgressBar.tsx +16 -10
  248. package/src/toolbar/MRT_TablePagination.tsx +20 -10
  249. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +11 -7
  250. package/src/toolbar/MRT_ToolbarDropZone.tsx +8 -4
  251. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +10 -6
  252. package/src/toolbar/MRT_TopToolbar.tsx +11 -24
  253. package/src/types.ts +98 -56
  254. package/src/useMaterialReactTable.ts +8 -7
  255. package/dist/cjs/index.js.map +0 -1
  256. package/dist/cjs/types/MaterialReactTable.d.ts +0 -7
  257. package/dist/cjs/types/body/MRT_TableBody.d.ts +0 -12
  258. package/dist/cjs/types/body/MRT_TableBodyCell.d.ts +0 -15
  259. package/dist/cjs/types/body/MRT_TableBodyCellValue.d.ts +0 -7
  260. package/dist/cjs/types/body/MRT_TableBodyRow.d.ts +0 -18
  261. package/dist/cjs/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -9
  262. package/dist/cjs/types/body/MRT_TableBodyRowPinButton.d.ts +0 -7
  263. package/dist/cjs/types/body/MRT_TableDetailPanel.d.ts +0 -12
  264. package/dist/cjs/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -7
  265. package/dist/cjs/types/buttons/MRT_CopyButton.d.ts +0 -9
  266. package/dist/cjs/types/buttons/MRT_EditActionButtons.d.ts +0 -8
  267. package/dist/cjs/types/buttons/MRT_ExpandAllButton.d.ts +0 -6
  268. package/dist/cjs/types/buttons/MRT_ExpandButton.d.ts +0 -7
  269. package/dist/cjs/types/buttons/MRT_RowPinButton.d.ts +0 -9
  270. package/dist/cjs/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
  271. package/dist/cjs/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
  272. package/dist/cjs/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
  273. package/dist/cjs/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
  274. package/dist/cjs/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
  275. package/dist/cjs/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -8
  276. package/dist/cjs/types/column.utils.d.ts +0 -148
  277. package/dist/cjs/types/filterFns.d.ts +0 -68
  278. package/dist/cjs/types/footer/MRT_TableFooter.d.ts +0 -10
  279. package/dist/cjs/types/footer/MRT_TableFooterCell.d.ts +0 -7
  280. package/dist/cjs/types/footer/MRT_TableFooterRow.d.ts +0 -11
  281. package/dist/cjs/types/head/MRT_TableHead.d.ts +0 -10
  282. package/dist/cjs/types/head/MRT_TableHeadCell.d.ts +0 -7
  283. package/dist/cjs/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -7
  284. package/dist/cjs/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -7
  285. package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -7
  286. package/dist/cjs/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -7
  287. package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -9
  288. package/dist/cjs/types/head/MRT_TableHeadRow.d.ts +0 -11
  289. package/dist/cjs/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
  290. package/dist/cjs/types/hooks/useMRT_Effects.d.ts +0 -2
  291. package/dist/cjs/types/hooks/useMRT_TableInstance.d.ts +0 -2
  292. package/dist/cjs/types/hooks/useMRT_TableOptions.d.ts +0 -2
  293. package/dist/cjs/types/inputs/MRT_EditCellTextField.d.ts +0 -7
  294. package/dist/cjs/types/inputs/MRT_FilterCheckbox.d.ts +0 -7
  295. package/dist/cjs/types/inputs/MRT_FilterRangeFields.d.ts +0 -7
  296. package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +0 -7
  297. package/dist/cjs/types/inputs/MRT_FilterTextField.d.ts +0 -8
  298. package/dist/cjs/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -6
  299. package/dist/cjs/types/inputs/MRT_SelectCheckbox.d.ts +0 -8
  300. package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +0 -19
  301. package/dist/cjs/types/menus/MRT_FilterOptionMenu.d.ts +0 -12
  302. package/dist/cjs/types/menus/MRT_RowActionMenu.d.ts +0 -11
  303. package/dist/cjs/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -9
  304. package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -11
  305. package/dist/cjs/types/modals/MRT_EditRowModal.d.ts +0 -7
  306. package/dist/cjs/types/sortingFns.d.ts +0 -12
  307. package/dist/cjs/types/table/MRT_Table.d.ts +0 -6
  308. package/dist/cjs/types/table/MRT_TableContainer.d.ts +0 -6
  309. package/dist/cjs/types/table/MRT_TablePaper.d.ts +0 -6
  310. package/dist/cjs/types/toolbar/MRT_BottomToolbar.d.ts +0 -6
  311. package/dist/cjs/types/toolbar/MRT_LinearProgressBar.d.ts +0 -7
  312. package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +0 -7
  313. package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -7
  314. package/dist/cjs/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -6
  315. package/dist/cjs/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -6
  316. package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +0 -21
  317. package/dist/cjs/types/useMaterialReactTable.d.ts +0 -2
  318. package/dist/esm/material-react-table.esm.js.map +0 -1
  319. package/dist/esm/types/MaterialReactTable.d.ts +0 -7
  320. package/dist/esm/types/aggregationFns.d.ts +0 -11
  321. package/dist/esm/types/body/MRT_TableBody.d.ts +0 -12
  322. package/dist/esm/types/body/MRT_TableBodyCell.d.ts +0 -15
  323. package/dist/esm/types/body/MRT_TableBodyCellValue.d.ts +0 -7
  324. package/dist/esm/types/body/MRT_TableBodyRow.d.ts +0 -18
  325. package/dist/esm/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -9
  326. package/dist/esm/types/body/MRT_TableBodyRowPinButton.d.ts +0 -7
  327. package/dist/esm/types/body/MRT_TableDetailPanel.d.ts +0 -12
  328. package/dist/esm/types/body/index.d.ts +0 -7
  329. package/dist/esm/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -7
  330. package/dist/esm/types/buttons/MRT_CopyButton.d.ts +0 -9
  331. package/dist/esm/types/buttons/MRT_EditActionButtons.d.ts +0 -8
  332. package/dist/esm/types/buttons/MRT_ExpandAllButton.d.ts +0 -6
  333. package/dist/esm/types/buttons/MRT_ExpandButton.d.ts +0 -7
  334. package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +0 -12
  335. package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +0 -9
  336. package/dist/esm/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
  337. package/dist/esm/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
  338. package/dist/esm/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
  339. package/dist/esm/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
  340. package/dist/esm/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
  341. package/dist/esm/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -8
  342. package/dist/esm/types/buttons/index.d.ts +0 -13
  343. package/dist/esm/types/column.utils.d.ts +0 -148
  344. package/dist/esm/types/filterFns.d.ts +0 -68
  345. package/dist/esm/types/footer/MRT_TableFooter.d.ts +0 -10
  346. package/dist/esm/types/footer/MRT_TableFooterCell.d.ts +0 -7
  347. package/dist/esm/types/footer/MRT_TableFooterRow.d.ts +0 -11
  348. package/dist/esm/types/footer/index.d.ts +0 -3
  349. package/dist/esm/types/head/MRT_TableHead.d.ts +0 -10
  350. package/dist/esm/types/head/MRT_TableHeadCell.d.ts +0 -7
  351. package/dist/esm/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -7
  352. package/dist/esm/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -7
  353. package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -7
  354. package/dist/esm/types/head/MRT_TableHeadCellGrabHandle.d.ts +0 -9
  355. package/dist/esm/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -7
  356. package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -9
  357. package/dist/esm/types/head/MRT_TableHeadRow.d.ts +0 -11
  358. package/dist/esm/types/head/index.d.ts +0 -9
  359. package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
  360. package/dist/esm/types/hooks/useMRT_Effects.d.ts +0 -2
  361. package/dist/esm/types/hooks/useMRT_TableInstance.d.ts +0 -2
  362. package/dist/esm/types/hooks/useMRT_TableOptions.d.ts +0 -2
  363. package/dist/esm/types/icons.d.ts +0 -36
  364. package/dist/esm/types/index.d.ts +0 -16
  365. package/dist/esm/types/inputs/MRT_EditCellTextField.d.ts +0 -7
  366. package/dist/esm/types/inputs/MRT_FilterCheckbox.d.ts +0 -7
  367. package/dist/esm/types/inputs/MRT_FilterRangeFields.d.ts +0 -7
  368. package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +0 -7
  369. package/dist/esm/types/inputs/MRT_FilterTextField.d.ts +0 -8
  370. package/dist/esm/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -6
  371. package/dist/esm/types/inputs/MRT_SelectCheckbox.d.ts +0 -8
  372. package/dist/esm/types/inputs/index.d.ts +0 -7
  373. package/dist/esm/types/locales/ar.d.ts +0 -2
  374. package/dist/esm/types/locales/bg.d.ts +0 -2
  375. package/dist/esm/types/locales/cs.d.ts +0 -2
  376. package/dist/esm/types/locales/da.d.ts +0 -2
  377. package/dist/esm/types/locales/de.d.ts +0 -2
  378. package/dist/esm/types/locales/en.d.ts +0 -2
  379. package/dist/esm/types/locales/es.d.ts +0 -2
  380. package/dist/esm/types/locales/et.d.ts +0 -2
  381. package/dist/esm/types/locales/fa.d.ts +0 -2
  382. package/dist/esm/types/locales/fi.d.ts +0 -2
  383. package/dist/esm/types/locales/fr.d.ts +0 -2
  384. package/dist/esm/types/locales/hu.d.ts +0 -2
  385. package/dist/esm/types/locales/hy.d.ts +0 -2
  386. package/dist/esm/types/locales/id.d.ts +0 -2
  387. package/dist/esm/types/locales/it.d.ts +0 -2
  388. package/dist/esm/types/locales/ja.d.ts +0 -2
  389. package/dist/esm/types/locales/ko.d.ts +0 -2
  390. package/dist/esm/types/locales/nl.d.ts +0 -2
  391. package/dist/esm/types/locales/no.d.ts +0 -2
  392. package/dist/esm/types/locales/np.d.ts +0 -2
  393. package/dist/esm/types/locales/pl.d.ts +0 -2
  394. package/dist/esm/types/locales/pt-BR.d.ts +0 -2
  395. package/dist/esm/types/locales/pt.d.ts +0 -2
  396. package/dist/esm/types/locales/ro.d.ts +0 -2
  397. package/dist/esm/types/locales/ru.d.ts +0 -2
  398. package/dist/esm/types/locales/sk.d.ts +0 -2
  399. package/dist/esm/types/locales/sr-Cyrl-RS.d.ts +0 -2
  400. package/dist/esm/types/locales/sr-Latn-RS.d.ts +0 -2
  401. package/dist/esm/types/locales/sv.d.ts +0 -2
  402. package/dist/esm/types/locales/tr.d.ts +0 -2
  403. package/dist/esm/types/locales/uk.d.ts +0 -2
  404. package/dist/esm/types/locales/vi.d.ts +0 -2
  405. package/dist/esm/types/locales/zh-Hans.d.ts +0 -2
  406. package/dist/esm/types/locales/zh-Hant.d.ts +0 -2
  407. package/dist/esm/types/menus/MRT_RowActionMenu.d.ts +0 -11
  408. package/dist/esm/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -9
  409. package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -11
  410. package/dist/esm/types/menus/index.d.ts +0 -5
  411. package/dist/esm/types/modals/MRT_EditRowModal.d.ts +0 -7
  412. package/dist/esm/types/modals/index.d.ts +0 -1
  413. package/dist/esm/types/table/MRT_Table.d.ts +0 -6
  414. package/dist/esm/types/table/MRT_TableContainer.d.ts +0 -6
  415. package/dist/esm/types/table/MRT_TablePaper.d.ts +0 -6
  416. package/dist/esm/types/table/index.d.ts +0 -4
  417. package/dist/esm/types/toolbar/MRT_BottomToolbar.d.ts +0 -6
  418. package/dist/esm/types/toolbar/MRT_LinearProgressBar.d.ts +0 -7
  419. package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +0 -7
  420. package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -7
  421. package/dist/esm/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -6
  422. package/dist/esm/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -6
  423. package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +0 -21
  424. package/dist/esm/types/toolbar/index.d.ts +0 -7
  425. package/dist/esm/types/types.d.ts +0 -818
  426. package/dist/esm/types/useMaterialReactTable.d.ts +0 -2
  427. package/locales/ar.esm.d.ts +0 -2
  428. package/locales/ar.esm.js.map +0 -1
  429. package/locales/ar.js.map +0 -1
  430. package/locales/bg.esm.d.ts +0 -2
  431. package/locales/bg.esm.js.map +0 -1
  432. package/locales/bg.js.map +0 -1
  433. package/locales/cs.esm.d.ts +0 -2
  434. package/locales/cs.esm.js.map +0 -1
  435. package/locales/cs.js.map +0 -1
  436. package/locales/da.esm.d.ts +0 -2
  437. package/locales/da.esm.js.map +0 -1
  438. package/locales/da.js.map +0 -1
  439. package/locales/de.esm.d.ts +0 -2
  440. package/locales/de.esm.js.map +0 -1
  441. package/locales/de.js.map +0 -1
  442. package/locales/en.esm.d.ts +0 -2
  443. package/locales/en.esm.js.map +0 -1
  444. package/locales/en.js.map +0 -1
  445. package/locales/es.esm.d.ts +0 -2
  446. package/locales/es.esm.js.map +0 -1
  447. package/locales/es.js.map +0 -1
  448. package/locales/et.esm.d.ts +0 -2
  449. package/locales/et.esm.js.map +0 -1
  450. package/locales/et.js.map +0 -1
  451. package/locales/fa.esm.d.ts +0 -2
  452. package/locales/fa.esm.js.map +0 -1
  453. package/locales/fa.js.map +0 -1
  454. package/locales/fi.esm.d.ts +0 -2
  455. package/locales/fi.esm.js.map +0 -1
  456. package/locales/fi.js.map +0 -1
  457. package/locales/fr.esm.d.ts +0 -2
  458. package/locales/fr.esm.js.map +0 -1
  459. package/locales/fr.js.map +0 -1
  460. package/locales/hu.esm.d.ts +0 -2
  461. package/locales/hu.esm.js.map +0 -1
  462. package/locales/hu.js.map +0 -1
  463. package/locales/hy.esm.d.ts +0 -2
  464. package/locales/hy.esm.js.map +0 -1
  465. package/locales/hy.js.map +0 -1
  466. package/locales/id.esm.d.ts +0 -2
  467. package/locales/id.esm.js.map +0 -1
  468. package/locales/id.js.map +0 -1
  469. package/locales/it.esm.d.ts +0 -2
  470. package/locales/it.esm.js.map +0 -1
  471. package/locales/it.js.map +0 -1
  472. package/locales/ja.esm.d.ts +0 -2
  473. package/locales/ja.esm.js.map +0 -1
  474. package/locales/ja.js.map +0 -1
  475. package/locales/ko.esm.d.ts +0 -2
  476. package/locales/ko.esm.js.map +0 -1
  477. package/locales/ko.js.map +0 -1
  478. package/locales/nl.esm.d.ts +0 -2
  479. package/locales/nl.esm.js.map +0 -1
  480. package/locales/nl.js.map +0 -1
  481. package/locales/no.esm.d.ts +0 -2
  482. package/locales/no.esm.js.map +0 -1
  483. package/locales/no.js.map +0 -1
  484. package/locales/np.esm.d.ts +0 -2
  485. package/locales/np.esm.js.map +0 -1
  486. package/locales/np.js.map +0 -1
  487. package/locales/pl.esm.d.ts +0 -2
  488. package/locales/pl.esm.js.map +0 -1
  489. package/locales/pl.js.map +0 -1
  490. package/locales/pt-BR.esm.d.ts +0 -2
  491. package/locales/pt-BR.esm.js.map +0 -1
  492. package/locales/pt-BR.js.map +0 -1
  493. package/locales/pt.esm.d.ts +0 -2
  494. package/locales/pt.esm.js.map +0 -1
  495. package/locales/pt.js.map +0 -1
  496. package/locales/ro.esm.d.ts +0 -2
  497. package/locales/ro.esm.js.map +0 -1
  498. package/locales/ro.js.map +0 -1
  499. package/locales/ru.esm.d.ts +0 -2
  500. package/locales/ru.esm.js.map +0 -1
  501. package/locales/ru.js.map +0 -1
  502. package/locales/sk.esm.d.ts +0 -2
  503. package/locales/sk.esm.js.map +0 -1
  504. package/locales/sk.js.map +0 -1
  505. package/locales/sr-Cyrl-RS.esm.d.ts +0 -2
  506. package/locales/sr-Cyrl-RS.esm.js.map +0 -1
  507. package/locales/sr-Cyrl-RS.js.map +0 -1
  508. package/locales/sr-Latn-RS.esm.d.ts +0 -2
  509. package/locales/sr-Latn-RS.esm.js.map +0 -1
  510. package/locales/sr-Latn-RS.js.map +0 -1
  511. package/locales/sv.esm.d.ts +0 -2
  512. package/locales/sv.esm.js.map +0 -1
  513. package/locales/sv.js.map +0 -1
  514. package/locales/tr.esm.d.ts +0 -2
  515. package/locales/tr.esm.js.map +0 -1
  516. package/locales/tr.js.map +0 -1
  517. package/locales/uk.esm.d.ts +0 -2
  518. package/locales/uk.esm.js.map +0 -1
  519. package/locales/uk.js.map +0 -1
  520. package/locales/vi.esm.d.ts +0 -2
  521. package/locales/vi.esm.js.map +0 -1
  522. package/locales/vi.js.map +0 -1
  523. package/locales/zh-Hans.esm.d.ts +0 -2
  524. package/locales/zh-Hans.esm.js.map +0 -1
  525. package/locales/zh-Hans.js.map +0 -1
  526. package/locales/zh-Hant.esm.d.ts +0 -2
  527. package/locales/zh-Hant.esm.js.map +0 -1
  528. package/locales/zh-Hant.js.map +0 -1
  529. /package/dist/{cjs/types → types}/aggregationFns.d.ts +0 -0
  530. /package/dist/{cjs/types → types}/body/index.d.ts +0 -0
  531. /package/dist/{cjs/types → types}/buttons/index.d.ts +0 -0
  532. /package/dist/{cjs/types → types}/footer/index.d.ts +0 -0
  533. /package/dist/{cjs/types → types}/head/index.d.ts +0 -0
  534. /package/dist/{cjs/types → types}/icons.d.ts +0 -0
  535. /package/dist/{cjs/types → types}/inputs/index.d.ts +0 -0
  536. /package/dist/{cjs/types → types}/locales/ar.d.ts +0 -0
  537. /package/dist/{cjs/types → types}/locales/bg.d.ts +0 -0
  538. /package/dist/{cjs/types → types}/locales/cs.d.ts +0 -0
  539. /package/dist/{cjs/types → types}/locales/da.d.ts +0 -0
  540. /package/dist/{cjs/types → types}/locales/de.d.ts +0 -0
  541. /package/dist/{cjs/types → types}/locales/en.d.ts +0 -0
  542. /package/dist/{cjs/types → types}/locales/es.d.ts +0 -0
  543. /package/dist/{cjs/types → types}/locales/et.d.ts +0 -0
  544. /package/dist/{cjs/types → types}/locales/fa.d.ts +0 -0
  545. /package/dist/{cjs/types → types}/locales/fi.d.ts +0 -0
  546. /package/dist/{cjs/types → types}/locales/fr.d.ts +0 -0
  547. /package/dist/{cjs/types → types}/locales/hu.d.ts +0 -0
  548. /package/dist/{cjs/types → types}/locales/hy.d.ts +0 -0
  549. /package/dist/{cjs/types → types}/locales/id.d.ts +0 -0
  550. /package/dist/{cjs/types → types}/locales/it.d.ts +0 -0
  551. /package/dist/{cjs/types → types}/locales/ja.d.ts +0 -0
  552. /package/dist/{cjs/types → types}/locales/ko.d.ts +0 -0
  553. /package/dist/{cjs/types → types}/locales/nl.d.ts +0 -0
  554. /package/dist/{cjs/types → types}/locales/np.d.ts +0 -0
  555. /package/dist/{cjs/types → types}/locales/pl.d.ts +0 -0
  556. /package/dist/{cjs/types → types}/locales/pt-BR.d.ts +0 -0
  557. /package/dist/{cjs/types → types}/locales/pt.d.ts +0 -0
  558. /package/dist/{cjs/types → types}/locales/ro.d.ts +0 -0
  559. /package/dist/{cjs/types → types}/locales/ru.d.ts +0 -0
  560. /package/dist/{cjs/types → types}/locales/sk.d.ts +0 -0
  561. /package/dist/{cjs/types → types}/locales/sr-Cyrl-RS.d.ts +0 -0
  562. /package/dist/{cjs/types → types}/locales/sr-Latn-RS.d.ts +0 -0
  563. /package/dist/{cjs/types → types}/locales/sv.d.ts +0 -0
  564. /package/dist/{cjs/types → types}/locales/tr.d.ts +0 -0
  565. /package/dist/{cjs/types → types}/locales/uk.d.ts +0 -0
  566. /package/dist/{cjs/types → types}/locales/vi.d.ts +0 -0
  567. /package/dist/{cjs/types → types}/locales/zh-Hans.d.ts +0 -0
  568. /package/dist/{cjs/types → types}/locales/zh-Hant.d.ts +0 -0
  569. /package/dist/{cjs/types → types}/menus/index.d.ts +0 -0
  570. /package/dist/{cjs/types → types}/modals/index.d.ts +0 -0
  571. /package/dist/{cjs/types → types}/toolbar/index.d.ts +0 -0
@@ -1,21 +1,20 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import Paper from '@mui/material/Paper';
3
3
  import { useState, memo, useEffect, useMemo, useRef, useCallback, Fragment as Fragment$1, useLayoutEffect, useReducer } from 'react';
4
- import Box from '@mui/material/Box';
5
- import CircularProgress from '@mui/material/CircularProgress';
6
4
  import TableContainer from '@mui/material/TableContainer';
7
- import { darken, lighten, alpha, useTheme } from '@mui/material/styles';
8
5
  import { defaultRangeExtractor, useVirtualizer } from '@tanstack/react-virtual';
9
6
  import Table from '@mui/material/Table';
10
7
  import TableBody from '@mui/material/TableBody';
11
8
  import Typography from '@mui/material/Typography';
12
9
  import TableRow from '@mui/material/TableRow';
10
+ import { lighten, darken, alpha, useTheme } from '@mui/material/styles';
13
11
  import Skeleton from '@mui/material/Skeleton';
14
12
  import TableCell from '@mui/material/TableCell';
13
+ import Box from '@mui/material/Box';
14
+ import { flexRender as flexRender$1, createRow as createRow$1, sortingFns, aggregationFns, filterFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
15
15
  import highlightWords from 'highlight-words';
16
16
  import IconButton from '@mui/material/IconButton';
17
17
  import Tooltip from '@mui/material/Tooltip';
18
- import { flexRender as flexRender$1, createRow as createRow$1, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel, aggregationFns, filterFns } from '@tanstack/react-table';
19
18
  import Button from '@mui/material/Button';
20
19
  import MenuItem from '@mui/material/MenuItem';
21
20
  import TextField from '@mui/material/TextField';
@@ -23,6 +22,7 @@ import Collapse from '@mui/material/Collapse';
23
22
  import { compareItems, rankItem, rankings } from '@tanstack/match-sorter-utils';
24
23
  import TableFooter from '@mui/material/TableFooter';
25
24
  import TableHead from '@mui/material/TableHead';
25
+ import { alpha as alpha$1 } from '@mui/material';
26
26
  import ListItemIcon from '@mui/material/ListItemIcon';
27
27
  import Menu from '@mui/material/Menu';
28
28
  import Checkbox from '@mui/material/Checkbox';
@@ -40,7 +40,6 @@ import Popover from '@mui/material/Popover';
40
40
  import Divider from '@mui/material/Divider';
41
41
  import Badge from '@mui/material/Badge';
42
42
  import TableSortLabel from '@mui/material/TableSortLabel';
43
- import Toolbar from '@mui/material/Toolbar';
44
43
  import useMediaQuery from '@mui/material/useMediaQuery';
45
44
  import LinearProgress from '@mui/material/LinearProgress';
46
45
  import InputLabel from '@mui/material/InputLabel';
@@ -52,6 +51,7 @@ import AlertTitle from '@mui/material/AlertTitle';
52
51
  import Radio from '@mui/material/Radio';
53
52
  import Fade from '@mui/material/Fade';
54
53
  import Switch from '@mui/material/Switch';
54
+ import CircularProgress from '@mui/material/CircularProgress';
55
55
  import Dialog from '@mui/material/Dialog';
56
56
  import DialogActions from '@mui/material/DialogActions';
57
57
  import DialogContent from '@mui/material/DialogContent';
@@ -90,73 +90,31 @@ import SyncAltIcon from '@mui/icons-material/SyncAlt';
90
90
  import ViewColumnIcon from '@mui/icons-material/ViewColumn';
91
91
  import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
92
92
 
93
- const allowedTypes = ['string', 'number'];
94
- const MRT_TableBodyCellValue = ({ cell, table, }) => {
95
- var _a, _b, _c;
96
- const { getState, options: { enableFilterMatchHighlighting }, } = table;
97
- const { column, row } = cell;
98
- const { columnDef } = column;
99
- const { globalFilter, globalFilterFn } = getState();
100
- const filterValue = column.getFilterValue();
101
- let renderedCellValue = cell.getIsAggregated() && columnDef.AggregatedCell
102
- ? columnDef.AggregatedCell({
103
- cell,
104
- column,
105
- row,
106
- table,
107
- })
108
- : row.getIsGrouped() && !cell.getIsGrouped()
109
- ? null
110
- : cell.getIsGrouped() && columnDef.GroupedCell
111
- ? columnDef.GroupedCell({
112
- cell,
113
- column,
114
- row,
115
- table,
116
- })
117
- : undefined;
118
- const isGroupedValue = renderedCellValue !== undefined;
119
- if (!isGroupedValue) {
120
- renderedCellValue = cell.renderValue();
121
- }
122
- if (enableFilterMatchHighlighting &&
123
- columnDef.enableFilterMatchHighlighting !== false &&
124
- renderedCellValue &&
125
- allowedTypes.includes(typeof renderedCellValue) &&
126
- ((filterValue &&
127
- allowedTypes.includes(typeof filterValue) &&
128
- columnDef.filterVariant === 'text') ||
129
- (globalFilter &&
130
- allowedTypes.includes(typeof globalFilter) &&
131
- column.getCanGlobalFilter()))) {
132
- const chunks = highlightWords === null || highlightWords === void 0 ? void 0 : highlightWords({
133
- matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
134
- query: ((_a = filterValue !== null && filterValue !== void 0 ? filterValue : globalFilter) !== null && _a !== void 0 ? _a : '').toString(),
135
- text: renderedCellValue === null || renderedCellValue === void 0 ? void 0 : renderedCellValue.toString(),
136
- });
137
- if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
138
- renderedCellValue = (jsx("span", { "aria-label": renderedCellValue, role: "note", children: (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (jsx(Box, { "aria-hidden": "true", component: "span", sx: match
139
- ? {
140
- backgroundColor: (theme) => theme.palette.mode === 'dark'
141
- ? darken(theme.palette.warning.dark, 0.25)
142
- : lighten(theme.palette.warning.light, 0.5),
143
- borderRadius: '2px',
144
- color: (theme) => theme.palette.mode === 'dark' ? 'white' : 'black',
145
- padding: '2px 1px',
146
- }
147
- : undefined, children: text }, key)))) !== null && _c !== void 0 ? _c : renderedCellValue }));
148
- }
149
- }
150
- if (columnDef.Cell && !isGroupedValue) {
151
- renderedCellValue = columnDef.Cell({
152
- cell,
153
- column,
154
- renderedCellValue,
155
- row,
156
- table,
157
- });
158
- }
159
- return jsx(Fragment, { children: renderedCellValue });
93
+ /******************************************************************************
94
+ Copyright (c) Microsoft Corporation.
95
+
96
+ Permission to use, copy, modify, and/or distribute this software for any
97
+ purpose with or without fee is hereby granted.
98
+
99
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
100
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
101
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
102
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
103
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
104
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
105
+ PERFORMANCE OF THIS SOFTWARE.
106
+ ***************************************************************************** */
107
+ function __rest(s, e) {
108
+ var t = {};
109
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
110
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
111
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
112
+ }
113
+ return t;
114
+ }
115
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
116
+ var e = new Error(message);
117
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
160
118
  };
161
119
 
162
120
  const getColumnId = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
@@ -250,7 +208,6 @@ const getLeadingDisplayColumnIds = (props) => {
250
208
  'mrt-row-expand',
251
209
  props.enableRowSelection && 'mrt-row-select',
252
210
  props.enableRowNumbers && 'mrt-row-numbers',
253
- props.layoutMode === 'grid-no-grow' && 'mrt-row-spacer',
254
211
  ].filter(Boolean);
255
212
  };
256
213
  const getTrailingDisplayColumnIds = (props) => {
@@ -264,6 +221,7 @@ const getTrailingDisplayColumnIds = (props) => {
264
221
  props.positionExpandColumn === 'last' &&
265
222
  showExpandColumn(props) &&
266
223
  'mrt-row-expand',
224
+ props.layoutMode === 'grid-no-grow' && 'mrt-row-spacer',
267
225
  ].filter(Boolean);
268
226
  };
269
227
  const getDefaultColumnOrderIds = (props) => {
@@ -325,7 +283,41 @@ const getCanRankRows = (table) => {
325
283
  expanded !== true &&
326
284
  !Object.values(expanded).some(Boolean));
327
285
  };
328
- const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, }) => {
286
+ const parseFromValuesOrFunc = (fn, arg) => (fn instanceof Function ? fn(arg) : fn);
287
+ const flexRender = flexRender$1;
288
+ const createRow = (table, originalRow) => createRow$1(table, 'mrt-row-create', originalRow !== null && originalRow !== void 0 ? originalRow : Object.assign({}, ...getAllLeafColumnDefs(table.options.columns).map((col) => ({
289
+ [getColumnId(col)]: '',
290
+ }))), -1, 0);
291
+ const extraIndexRangeExtractor = (range, draggingIndex) => {
292
+ const newIndexes = defaultRangeExtractor(range);
293
+ if (draggingIndex >= 0 &&
294
+ draggingIndex < Math.max(range.startIndex - range.overscan, 0)) {
295
+ newIndexes.unshift(draggingIndex);
296
+ }
297
+ if (draggingIndex >= 0 && draggingIndex > range.endIndex + range.overscan) {
298
+ newIndexes.push(draggingIndex);
299
+ }
300
+ return newIndexes;
301
+ };
302
+ function createMRTColumnHelper() {
303
+ return {
304
+ accessor: (accessor, column) => {
305
+ return typeof accessor === 'function'
306
+ ? Object.assign(Object.assign({}, column), { accessorFn: accessor })
307
+ : Object.assign(Object.assign({}, column), { accessorKey: accessor });
308
+ },
309
+ display: (column) => column,
310
+ group: (column) => column,
311
+ };
312
+ }
313
+
314
+ const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
315
+ const getMRTTheme = (table, theme) => (Object.assign({ baseBackgroundColor: theme.palette.mode === 'dark'
316
+ ? lighten(theme.palette.background.default, 0.05)
317
+ : theme.palette.background.default, draggingBorderColor: theme.palette.primary.main, matchHighlightColor: theme.palette.mode === 'dark'
318
+ ? darken(theme.palette.warning.dark, 0.25)
319
+ : lighten(theme.palette.warning.light, 0.5), pinnedRowBackgroundColor: alpha(theme.palette.primary.main, 0.1), selectedRowBackgroundColor: alpha(theme.palette.primary.main, 0.2) }, parseFromValuesOrFunc(table.options.mrtTheme, theme)));
320
+ const getCommonMRTCellStyles = ({ column, header, table, tableCellProps, theme, }) => {
329
321
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
330
322
  const { options: { layoutMode }, } = table;
331
323
  const widthStyles = {
@@ -339,11 +331,11 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
339
331
  widthStyles.flex = '0 0 auto';
340
332
  }
341
333
  return Object.assign(Object.assign({ backgroundColor: column.getIsPinned() && column.columnDef.columnDefType !== 'group'
342
- ? alpha(lighten(theme.palette.background.default, 0.04), 0.97)
334
+ ? alpha(darken(getMRTTheme(table, theme).baseBackgroundColor, theme.palette.mode === 'dark' ? 0.05 : 0.01), 0.97)
343
335
  : 'inherit', backgroundImage: 'inherit', boxShadow: getIsLastLeftPinnedColumn(table, column)
344
- ? `-4px 0 8px -6px ${alpha(theme.palette.common.black, 0.2)} inset`
336
+ ? `-4px 0 8px -6px ${alpha(theme.palette.grey[700], 0.5)} inset`
345
337
  : getIsFirstRightPinnedColumn(column)
346
- ? `4px 0 8px -6px ${alpha(theme.palette.common.black, 0.2)} inset`
338
+ ? `4px 0 8px -6px ${alpha(theme.palette.grey[700], 0.5)} inset`
347
339
  : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, left: column.getIsPinned() === 'left'
348
340
  ? `${column.getStart('left')}px`
349
341
  : undefined, ml: table.options.enableColumnVirtualization &&
@@ -368,65 +360,111 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
368
360
  ? 'none'
369
361
  : `padding 150ms ease-in-out` }, widthStyles), parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme));
370
362
  };
371
- const MRT_DefaultColumn = {
372
- filterVariant: 'text',
373
- maxSize: 1000,
374
- minSize: 40,
375
- size: 180,
376
- };
377
- const MRT_DefaultDisplayColumn = {
378
- columnDefType: 'display',
379
- enableClickToCopy: false,
380
- enableColumnActions: false,
381
- enableColumnDragging: false,
382
- enableColumnFilter: false,
383
- enableColumnOrdering: false,
384
- enableEditing: false,
385
- enableGlobalFilter: false,
386
- enableGrouping: false,
387
- enableHiding: false,
388
- enableResizing: false,
389
- enableSorting: false,
390
- };
391
- const parseFromValuesOrFunc = (fn, arg) => (fn instanceof Function ? fn(arg) : fn);
392
- const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
393
- const flexRender = flexRender$1;
394
- const createRow = (table, originalRow) => createRow$1(table, 'mrt-row-create', originalRow !== null && originalRow !== void 0 ? originalRow : Object.assign({}, ...getAllLeafColumnDefs(table.options.columns).map((col) => ({
395
- [getColumnId(col)]: '',
396
- }))), -1, 0);
397
- const extraIndexRangeExtractor = (range, draggingIndex) => {
398
- const newIndexs = defaultRangeExtractor(range);
399
- if (draggingIndex >= 0 &&
400
- draggingIndex < Math.max(range.startIndex - range.overscan, 0)) {
401
- newIndexs.unshift(draggingIndex);
363
+ const getCommonToolbarStyles = ({ table, theme, }) => ({
364
+ alignItems: 'flex-start',
365
+ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor,
366
+ display: 'grid',
367
+ flexWrap: 'wrap-reverse',
368
+ minHeight: '3.5rem',
369
+ overflow: 'hidden',
370
+ position: 'relative',
371
+ transition: 'all 150ms ease-in-out',
372
+ zIndex: 1,
373
+ });
374
+
375
+ const allowedTypes = ['string', 'number'];
376
+ const MRT_TableBodyCellValue = ({ cell, table, }) => {
377
+ var _a, _b, _c;
378
+ const { getState, options: { enableFilterMatchHighlighting }, } = table;
379
+ const { column, row } = cell;
380
+ const { columnDef } = column;
381
+ const { globalFilter, globalFilterFn } = getState();
382
+ const filterValue = column.getFilterValue();
383
+ let renderedCellValue = cell.getIsAggregated() && columnDef.AggregatedCell
384
+ ? columnDef.AggregatedCell({
385
+ cell,
386
+ column,
387
+ row,
388
+ table,
389
+ })
390
+ : row.getIsGrouped() && !cell.getIsGrouped()
391
+ ? null
392
+ : cell.getIsGrouped() && columnDef.GroupedCell
393
+ ? columnDef.GroupedCell({
394
+ cell,
395
+ column,
396
+ row,
397
+ table,
398
+ })
399
+ : undefined;
400
+ const isGroupedValue = renderedCellValue !== undefined;
401
+ if (!isGroupedValue) {
402
+ renderedCellValue = cell.renderValue();
402
403
  }
403
- if (draggingIndex >= 0 && draggingIndex > range.endIndex + range.overscan) {
404
- newIndexs.push(draggingIndex);
404
+ if (enableFilterMatchHighlighting &&
405
+ columnDef.enableFilterMatchHighlighting !== false &&
406
+ renderedCellValue &&
407
+ allowedTypes.includes(typeof renderedCellValue) &&
408
+ ((filterValue &&
409
+ allowedTypes.includes(typeof filterValue) &&
410
+ columnDef.filterVariant === 'text') ||
411
+ (globalFilter &&
412
+ allowedTypes.includes(typeof globalFilter) &&
413
+ column.getCanGlobalFilter()))) {
414
+ const chunks = highlightWords === null || highlightWords === void 0 ? void 0 : highlightWords({
415
+ matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
416
+ query: ((_a = filterValue !== null && filterValue !== void 0 ? filterValue : globalFilter) !== null && _a !== void 0 ? _a : '').toString(),
417
+ text: renderedCellValue === null || renderedCellValue === void 0 ? void 0 : renderedCellValue.toString(),
418
+ });
419
+ if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
420
+ renderedCellValue = (jsx("span", { "aria-label": renderedCellValue, role: "note", children: (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (jsx(Box, { "aria-hidden": "true", component: "span", sx: match
421
+ ? {
422
+ backgroundColor: (theme) => getMRTTheme(table, theme).matchHighlightColor,
423
+ borderRadius: '2px',
424
+ color: (theme) => theme.palette.mode === 'dark'
425
+ ? theme.palette.common.white
426
+ : theme.palette.common.black,
427
+ padding: '2px 1px',
428
+ }
429
+ : undefined, children: text }, key)))) !== null && _c !== void 0 ? _c : renderedCellValue }));
430
+ }
431
+ }
432
+ if (columnDef.Cell && !isGroupedValue) {
433
+ renderedCellValue = columnDef.Cell({
434
+ cell,
435
+ column,
436
+ renderedCellValue,
437
+ row,
438
+ table,
439
+ });
405
440
  }
406
- return newIndexs;
441
+ return renderedCellValue;
407
442
  };
408
443
 
409
- const MRT_GrabHandleButton = ({ iconButtonProps, location, onDragEnd, onDragStart, table, }) => {
410
- var _a;
444
+ const MRT_GrabHandleButton = (_a) => {
445
+ var _b;
446
+ var { iconButtonProps, location, onDragEnd, onDragStart, table } = _a, rest = __rest(_a, ["iconButtonProps", "location", "onDragEnd", "onDragStart", "table"]);
411
447
  const { options: { icons: { DragHandleIcon }, localization, }, } = table;
412
- return (jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.move, children: jsx(IconButton, Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
448
+ const _iconButtonProps = Object.assign(Object.assign({}, iconButtonProps), rest);
449
+ return (jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.title) !== null && _b !== void 0 ? _b : localization.move, children: jsx(IconButton, Object.assign({ disableRipple: true, draggable: "true", size: "small" }, _iconButtonProps, { onClick: (e) => {
413
450
  var _a;
414
451
  e.stopPropagation();
415
- (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, e);
452
+ (_a = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(_iconButtonProps, e);
416
453
  }, onDragEnd: onDragEnd, onDragStart: onDragStart, sx: (theme) => (Object.assign({ '&:active': {
417
454
  cursor: 'grabbing',
418
455
  }, '&:hover': {
419
456
  backgroundColor: 'transparent',
420
457
  opacity: 1,
421
- }, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.3, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: jsx(DragHandleIcon, {}) })) }));
458
+ }, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.3, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(_iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.sx, theme))), title: undefined, children: jsx(DragHandleIcon, {}) })) }));
422
459
  };
423
460
 
424
- const MRT_TableBodyRowGrabHandle = ({ row, rowRef, table, }) => {
461
+ const MRT_TableBodyRowGrabHandle = (_a) => {
462
+ var { row, rowRef, table } = _a, rest = __rest(_a, ["row", "rowRef", "table"]);
425
463
  const { options: { muiRowDragHandleProps }, } = table;
426
- const iconButtonProps = parseFromValuesOrFunc(muiRowDragHandleProps, {
464
+ const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiRowDragHandleProps, {
427
465
  row,
428
466
  table,
429
- });
467
+ })), rest);
430
468
  const handleDragStart = (event) => {
431
469
  var _a;
432
470
  (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
@@ -442,8 +480,9 @@ const MRT_TableBodyRowGrabHandle = ({ row, rowRef, table, }) => {
442
480
  return (jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, location: "row", onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
443
481
  };
444
482
 
445
- const MRT_CopyButton = ({ cell, children, table, }) => {
446
- var _a;
483
+ const MRT_CopyButton = (_a) => {
484
+ var _b;
485
+ var { cell, table } = _a, rest = __rest(_a, ["cell", "table"]);
447
486
  const { options: { localization, muiCopyButtonProps }, } = table;
448
487
  const { column, row } = cell;
449
488
  const { columnDef } = column;
@@ -454,7 +493,7 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
454
493
  setCopied(true);
455
494
  setTimeout(() => setCopied(false), 4000);
456
495
  };
457
- const buttonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCopyButtonProps, {
496
+ const buttonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCopyButtonProps, {
458
497
  cell,
459
498
  column,
460
499
  row,
@@ -464,12 +503,13 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
464
503
  column,
465
504
  row,
466
505
  table,
467
- }));
468
- return (jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _a !== void 0 ? _a : (copied ? localization.copiedToClipboard : localization.clickToCopy), children: jsx(Button, Object.assign({ onClick: (e) => handleCopy(e, cell.getValue()), size: "small", type: "button", variant: "text" }, buttonProps, { sx: (theme) => (Object.assign({ backgroundColor: 'transparent', border: 'none', color: 'inherit', cursor: 'copy', fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', m: '-0.25rem', minWidth: 'unset', textAlign: 'inherit', textTransform: 'inherit' }, parseFromValuesOrFunc(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx, theme))), title: undefined, children: children })) }));
506
+ })), rest);
507
+ return (jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _b !== void 0 ? _b : (copied ? localization.copiedToClipboard : localization.clickToCopy), children: jsx(Button, Object.assign({ onClick: (e) => handleCopy(e, cell.getValue()), size: "small", type: "button", variant: "text" }, buttonProps, { sx: (theme) => (Object.assign({ backgroundColor: 'transparent', border: 'none', color: 'inherit', cursor: 'copy', fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', m: '-0.25rem', minWidth: 'unset', textAlign: 'inherit', textTransform: 'inherit' }, parseFromValuesOrFunc(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx, theme))), title: undefined })) }));
469
508
  };
470
509
 
471
- const MRT_EditCellTextField = ({ cell, table, }) => {
472
- var _a, _b, _c;
510
+ const MRT_EditCellTextField = (_a) => {
511
+ var _b, _c, _d;
512
+ var { cell, table } = _a, rest = __rest(_a, ["cell", "table"]);
473
513
  const { getState, options: { createDisplayMode, editDisplayMode, muiEditTextFieldProps }, refs: { editInputRefs }, setCreatingRow, setEditingCell, setEditingRow, } = table;
474
514
  const { column, row } = cell;
475
515
  const { columnDef } = column;
@@ -478,7 +518,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
478
518
  const isEditing = (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id;
479
519
  const isSelectEdit = columnDef.editVariant === 'select';
480
520
  const [value, setValue] = useState(() => cell.getValue());
481
- const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditTextFieldProps, {
521
+ const textFieldProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditTextFieldProps, {
482
522
  cell,
483
523
  column,
484
524
  row,
@@ -488,7 +528,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
488
528
  column,
489
529
  row,
490
530
  table,
491
- }));
531
+ })), rest);
492
532
  const saveInputValueToRowCache = (newValue) => {
493
533
  //@ts-ignore
494
534
  row._valuesCache[column.id] = newValue;
@@ -521,7 +561,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
521
561
  }
522
562
  };
523
563
  if (columnDef.Edit) {
524
- return jsx(Fragment, { children: (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table }) });
564
+ return jsx(Fragment, { children: (_b = columnDef.Edit) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, row, table }) });
525
565
  }
526
566
  return (jsx(TextField, Object.assign({ disabled: parseFromValuesOrFunc(columnDef.enableEditing, row) === false, fullWidth: true, inputRef: (inputRef) => {
527
567
  if (inputRef) {
@@ -530,15 +570,18 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
530
570
  textFieldProps.inputRef = inputRef;
531
571
  }
532
572
  }
533
- }, label: !['custom', 'modal'].includes((isCreating ? createDisplayMode : editDisplayMode))
573
+ }, label: ['custom', 'modal'].includes((isCreating ? createDisplayMode : editDisplayMode))
534
574
  ? columnDef.header
535
575
  : undefined, margin: "none", name: column.id, placeholder: !['custom', 'modal'].includes((isCreating ? createDisplayMode : editDisplayMode))
536
576
  ? columnDef.header
537
- : undefined, select: isSelectEdit, value: value, variant: "standard" }, textFieldProps, { InputProps: Object.assign({ disableUnderline: editDisplayMode === 'table' }, textFieldProps.InputProps), inputProps: Object.assign({ autoComplete: 'new-password' }, textFieldProps.inputProps), onBlur: handleBlur, onChange: handleChange, onClick: (e) => {
577
+ : undefined, select: isSelectEdit, size: "small", value: value, variant: "standard" }, textFieldProps, { InputProps: Object.assign(Object.assign({ disableUnderline: editDisplayMode === 'table' }, textFieldProps.InputProps), { sx: (theme) => {
578
+ var _a;
579
+ return (Object.assign({ mb: 0 }, parseFromValuesOrFunc((_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.sx, theme)));
580
+ } }), inputProps: Object.assign({ autoComplete: 'new-password' }, textFieldProps.inputProps), onBlur: handleBlur, onChange: handleChange, onClick: (e) => {
538
581
  var _a;
539
582
  e.stopPropagation();
540
583
  (_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
541
- }, onKeyDown: handleEnterKeyDown, children: (_b = textFieldProps.children) !== null && _b !== void 0 ? _b : (_c = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _c === void 0 ? void 0 : _c.map((option) => {
584
+ }, onKeyDown: handleEnterKeyDown, children: (_c = textFieldProps.children) !== null && _c !== void 0 ? _c : (_d = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _d === void 0 ? void 0 : _d.map((option) => {
542
585
  let value;
543
586
  let text;
544
587
  if (typeof option !== 'object') {
@@ -558,31 +601,24 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
558
601
  }) })));
559
602
  };
560
603
 
561
- const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, table, virtualCell, }) => {
562
- var _a, _b, _c, _d;
604
+ const MRT_TableBodyCell = (_a) => {
605
+ var _b, _c, _d, _e, _f;
606
+ var { cell, measureElement, numRows, rowIndex, rowRef, table, virtualIndex } = _a, rest = __rest(_a, ["cell", "measureElement", "numRows", "rowIndex", "rowRef", "table", "virtualIndex"]);
563
607
  const theme = useTheme();
564
608
  const { getState, options: { createDisplayMode, editDisplayMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enableRowNumbers, layoutMode, muiSkeletonProps, muiTableBodyCellProps, rowNumberMode, }, refs: { editInputRefs }, setEditingCell, setHoveredColumn, } = table;
565
609
  const { columnSizingInfo, creatingRow, density, draggingColumn, draggingRow, editingCell, editingRow, hoveredColumn, hoveredRow, isLoading, showSkeletons, } = getState();
566
610
  const { column, row } = cell;
567
611
  const { columnDef } = column;
568
612
  const { columnDefType } = columnDef;
569
- const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyCellProps, {
570
- cell,
571
- column,
572
- row,
573
- table,
574
- })), parseFromValuesOrFunc(columnDef.muiTableBodyCellProps, {
575
- cell,
576
- column,
577
- row,
578
- table,
579
- }));
613
+ const args = { cell, column, row, table };
614
+ const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableBodyCellProps, args)), rest);
580
615
  const skeletonProps = parseFromValuesOrFunc(muiSkeletonProps, {
581
616
  cell,
582
617
  column,
583
618
  row,
584
619
  table,
585
620
  });
621
+ const { draggingBorderColor } = getMRTTheme(table, theme);
586
622
  const [skeletonWidth, setSkeletonWidth] = useState(100);
587
623
  useEffect(() => {
588
624
  if ((!isLoading && !showSkeletons) || skeletonWidth !== 100)
@@ -600,13 +636,15 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
600
636
  const isFirstColumn = getIsFirstColumn(column, table);
601
637
  const isLastColumn = getIsLastColumn(column, table);
602
638
  const isLastRow = numRows && rowIndex === numRows - 1;
603
- const borderStyle = isDraggingColumn || isDraggingRow
604
- ? `1px dashed ${theme.palette.text.secondary} !important`
605
- : isHoveredColumn ||
606
- isHoveredRow ||
607
- columnSizingInfo.isResizingColumn === column.id
608
- ? `2px dashed ${theme.palette.primary.main} !important`
609
- : undefined;
639
+ const borderStyle = columnSizingInfo.isResizingColumn === column.id
640
+ ? `2px solid ${draggingBorderColor} !important`
641
+ : isDraggingColumn || isDraggingRow
642
+ ? `1px dashed ${theme.palette.grey[500]} !important`
643
+ : isHoveredColumn ||
644
+ isHoveredRow ||
645
+ columnSizingInfo.isResizingColumn === column.id
646
+ ? `2px dashed ${draggingBorderColor} !important`
647
+ : undefined;
610
648
  if (columnSizingInfo.isResizingColumn === column.id) {
611
649
  return { borderRight: borderStyle };
612
650
  }
@@ -670,13 +708,13 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
670
708
  setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
671
709
  }
672
710
  };
673
- return (jsx(TableCell, Object.assign({ "data-index": virtualCell === null || virtualCell === void 0 ? void 0 : virtualCell.index, ref: (node) => {
711
+ return (jsx(TableCell, Object.assign({ "data-index": virtualIndex, ref: (node) => {
674
712
  if (node) {
675
713
  measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
676
714
  }
677
715
  } }, tableCellProps, { onDoubleClick: handleDoubleClick, onDragEnter: handleDragEnter, sx: (theme) => (Object.assign(Object.assign({ '&:hover': {
678
- outline: ['cell', 'table'].includes(editDisplayMode !== null && editDisplayMode !== void 0 ? editDisplayMode : '')
679
- ? `1px solid ${theme.palette.text.secondary}`
716
+ outline: ['cell', 'table'].includes(editDisplayMode !== null && editDisplayMode !== void 0 ? editDisplayMode : '') && isEditable
717
+ ? `1px solid ${theme.palette.grey[500]}`
680
718
  : undefined,
681
719
  outlineOffset: '-1px',
682
720
  textOverflow: 'clip',
@@ -692,35 +730,36 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
692
730
  : '1rem'
693
731
  : columnDefType === 'display'
694
732
  ? '1rem 1.25rem'
695
- : '1.5rem', pl: column.id === 'mrt-row-expand'
733
+ : '1.5rem', textOverflow: columnDefType !== 'display' ? 'ellipsis' : undefined, [theme.direction === 'rtl' ? 'pr' : 'pl']: column.id === 'mrt-row-expand'
696
734
  ? `${row.depth +
697
735
  (density === 'compact'
698
736
  ? 0.5
699
737
  : density === 'comfortable'
700
738
  ? 0.75
701
739
  : 1.25)}rem`
702
- : undefined, textOverflow: columnDefType !== 'display' ? 'ellipsis' : undefined, whiteSpace: row.getIsPinned() || density === 'compact' ? 'nowrap' : 'normal', zIndex: (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id ? 2 : column.getIsPinned() ? 1 : 0 }, getCommonCellStyles({
740
+ : undefined, whiteSpace: row.getIsPinned() || density === 'compact' ? 'nowrap' : 'normal', zIndex: (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id ? 2 : column.getIsPinned() ? 1 : 0 }, getCommonMRTCellStyles({
703
741
  column,
704
742
  table,
705
743
  tableCellProps,
706
744
  theme,
707
- })), draggingBorders)), children: jsxs(Fragment, { children: [cell.getIsPlaceholder() ? ((_b = (_a = columnDef.PlaceholderCell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) !== null && _b !== void 0 ? _b : null) : isLoading || showSkeletons ? (jsx(Skeleton, Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, skeletonProps))) : enableRowNumbers &&
745
+ })), draggingBorders)), children: (_b = tableCellProps.children) !== null && _b !== void 0 ? _b : (jsxs(Fragment, { children: [cell.getIsPlaceholder() ? ((_d = (_c = columnDef.PlaceholderCell) === null || _c === void 0 ? void 0 : _c.call(columnDef, { cell, column, row, table })) !== null && _d !== void 0 ? _d : null) : showSkeletons !== false && (isLoading || showSkeletons) ? (jsx(Skeleton, Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, skeletonProps))) : enableRowNumbers &&
708
746
  rowNumberMode === 'static' &&
709
747
  column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (jsx(MRT_TableBodyRowGrabHandle, { row: row, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
710
748
  (column.id === 'mrt-row-select' ||
711
749
  column.id === 'mrt-row-expand' ||
712
- !row.getIsGrouped()) ? ((_c = columnDef.Cell) === null || _c === void 0 ? void 0 : _c.call(columnDef, {
750
+ !row.getIsGrouped()) ? ((_e = columnDef.Cell) === null || _e === void 0 ? void 0 : _e.call(columnDef, {
713
751
  cell,
714
752
  column,
715
753
  renderedCellValue: cell.renderValue(),
716
754
  row,
717
755
  table,
718
756
  })) : isCreating || isEditing ? (jsx(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
719
- columnDef.enableClickToCopy !== false ? (jsx(MRT_CopyButton, { cell: cell, table: table, children: jsx(MRT_TableBodyCellValue, { cell: cell, table: table }) })) : (jsx(MRT_TableBodyCellValue, { cell: cell, table: table })), cell.getIsGrouped() && !columnDef.GroupedCell && (jsxs(Fragment, { children: [" (", (_d = row.subRows) === null || _d === void 0 ? void 0 : _d.length, ")"] }))] }) })));
757
+ columnDef.enableClickToCopy !== false ? (jsx(MRT_CopyButton, { cell: cell, table: table, children: jsx(MRT_TableBodyCellValue, { cell: cell, table: table }) })) : (jsx(MRT_TableBodyCellValue, { cell: cell, table: table })), cell.getIsGrouped() && !columnDef.GroupedCell && (jsxs(Fragment, { children: [" (", (_f = row.subRows) === null || _f === void 0 ? void 0 : _f.length, ")"] }))] })) })));
720
758
  };
721
759
  const Memo_MRT_TableBodyCell = memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
722
760
 
723
- const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow, }) => {
761
+ const MRT_TableDetailPanel = (_a) => {
762
+ var { parentRowRef, row, rowIndex, table, virtualRow } = _a, rest = __rest(_a, ["parentRowRef", "row", "rowIndex", "table", "virtualRow"]);
724
763
  const { getState, getVisibleLeafColumns, options: { layoutMode, muiDetailPanelProps, muiTableBodyRowProps, renderDetailPanel, }, } = table;
725
764
  const { isLoading } = getState();
726
765
  const tableRowProps = parseFromValuesOrFunc(muiTableBodyRowProps, {
@@ -729,10 +768,10 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
729
768
  staticRowIndex: rowIndex,
730
769
  table,
731
770
  });
732
- const tableCellProps = parseFromValuesOrFunc(muiDetailPanelProps, {
771
+ const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiDetailPanelProps, {
733
772
  row,
734
773
  table,
735
- });
774
+ })), rest);
736
775
  return (jsx(TableRow, Object.assign({ className: "Mui-TableBodyCell-DetailPanel" }, tableRowProps, { sx: (theme) => {
737
776
  var _a, _b;
738
777
  return (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, position: virtualRow ? 'absolute' : undefined, top: virtualRow
@@ -741,8 +780,8 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
741
780
  ? `translateY(${virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.start}px)`
742
781
  : undefined, width: '100%', zIndex: virtualRow ? 2 : undefined }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme)));
743
782
  }, children: jsx(TableCell, Object.assign({ className: "Mui-TableBodyCell-DetailPanel", colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ backgroundColor: virtualRow
744
- ? lighten(theme.palette.background.default, 0.05)
745
- : undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : 'table-cell', py: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: renderDetailPanel && (jsx(Collapse, { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true, children: !isLoading && renderDetailPanel({ row, table }) })) })) })));
783
+ ? getMRTTheme(table, theme).baseBackgroundColor
784
+ : undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, py: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: renderDetailPanel && (jsx(Collapse, { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true, children: !isLoading && renderDetailPanel({ row, table }) })) })) })));
746
785
  };
747
786
 
748
787
  const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
@@ -782,7 +821,8 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
782
821
  }
783
822
  };
784
823
  const rowRef = useRef(null);
785
- return (jsxs(Fragment, { children: [jsxs(TableRow, Object.assign({ "data-index": virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.index, onDragEnter: handleDragEnter, ref: (node) => {
824
+ const { baseBackgroundColor, pinnedRowBackgroundColor, selectedRowBackgroundColor, } = getMRTTheme(table, theme);
825
+ return (jsxs(Fragment, { children: [jsxs(TableRow, Object.assign({ "data-index": virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.index, "data-pinned": !!isPinned || undefined, "data-selected": row.getIsSelected() || undefined, onDragEnter: handleDragEnter, ref: (node) => {
786
826
  if (node) {
787
827
  rowRef.current = node;
788
828
  measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
@@ -792,16 +832,16 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
792
832
  : undefined }, tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style), sx: (theme) => (Object.assign({ '&:hover td': {
793
833
  backgroundColor: (tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.hover) !== false
794
834
  ? row.getIsSelected()
795
- ? `${alpha(theme.palette.primary.main, 0.2)}`
835
+ ? `${alpha(selectedRowBackgroundColor, 0.3)}`
796
836
  : theme.palette.mode === 'dark'
797
- ? `${lighten(theme.palette.background.default, 0.12)}`
798
- : `${darken(theme.palette.background.default, 0.05)}`
837
+ ? `${lighten(baseBackgroundColor, 0.05)}`
838
+ : `${darken(baseBackgroundColor, 0.05)}`
799
839
  : undefined,
800
- }, backgroundColor: `${lighten(theme.palette.background.default, 0.05)} !important`, bottom: !virtualRow && bottomPinnedIndex !== undefined && isPinned
840
+ }, backgroundColor: `${baseBackgroundColor} !important`, bottom: !virtualRow && bottomPinnedIndex !== undefined && isPinned
801
841
  ? `${bottomPinnedIndex * rowHeight +
802
842
  (enableStickyFooter ? tableFooterHeight - 1 : 0)}px`
803
843
  : undefined, boxSizing: 'border-box', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, opacity: isPinned
804
- ? 0.98
844
+ ? 0.97
805
845
  : (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id || (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id
806
846
  ? 0.5
807
847
  : 1, position: virtualRow
@@ -810,9 +850,9 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
810
850
  ? 'sticky'
811
851
  : undefined, td: {
812
852
  backgroundColor: row.getIsSelected()
813
- ? alpha(theme.palette.primary.main, 0.2)
853
+ ? selectedRowBackgroundColor
814
854
  : isPinned
815
- ? alpha(theme.palette.primary.main, 0.1)
855
+ ? pinnedRowBackgroundColor
816
856
  : undefined,
817
857
  }, top: virtualRow
818
858
  ? 0
@@ -832,8 +872,8 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
832
872
  rowIndex,
833
873
  rowRef,
834
874
  table,
835
- virtualCell: columnVirtualizer
836
- ? cellOrVirtualCell
875
+ virtualIndex: columnVirtualizer
876
+ ? cellOrVirtualCell.index
837
877
  : undefined,
838
878
  };
839
879
  return cell ? (memoMode === 'cells' &&
@@ -860,18 +900,19 @@ const MRT_SortingFns = Object.assign(Object.assign({}, sortingFns), { fuzzy: fuz
860
900
  const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
861
901
  Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
862
902
 
863
- const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
864
- var _a, _b, _c, _d, _e, _f;
903
+ const MRT_TableBody = (_a) => {
904
+ var _b, _c, _d, _e, _f, _g;
905
+ var { columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["columnVirtualizer", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
865
906
  const { getBottomRows, getCenterRows, getIsSomeRowsPinned, getPrePaginationRowModel, getRowModel, getState, getTopRows, options: { createDisplayMode, enableGlobalFilterRankedResults, enablePagination, enableRowPinning, enableRowVirtualization, enableStickyFooter, enableStickyHeader, layoutMode, localization, manualExpanding, manualFiltering, manualGrouping, manualPagination, manualSorting, memoMode, muiTableBodyProps, renderEmptyRowsFallback, rowPinningDisplayMode, rowVirtualizerInstanceRef, rowVirtualizerOptions, }, refs: { tableContainerRef, tableFooterRef, tableHeadRef, tablePaperRef }, } = table;
866
907
  const { columnFilters, creatingRow, density, draggingRow, expanded, globalFilter, isFullScreen, pagination, rowPinning, sorting, } = getState();
867
- const tableBodyProps = parseFromValuesOrFunc(muiTableBodyProps, { table });
908
+ const tableBodyProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyProps, { table })), rest);
868
909
  const rowVirtualizerProps = parseFromValuesOrFunc(rowVirtualizerOptions, {
869
910
  table,
870
911
  });
871
912
  const tableHeadHeight = ((enableStickyHeader || isFullScreen) &&
872
- ((_a = tableHeadRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight)) ||
913
+ ((_b = tableHeadRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) ||
873
914
  0;
874
- const tableFooterHeight = (enableStickyFooter && ((_b = tableFooterRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) || 0;
915
+ const tableFooterHeight = (enableStickyFooter && ((_c = tableFooterRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight)) || 0;
875
916
  const shouldRankRows = useMemo(() => getCanRankRows(table) &&
876
917
  !Object.values(sorting).some(Boolean) &&
877
918
  globalFilter, [
@@ -948,16 +989,14 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
948
989
  return memoMode === 'rows' ? (jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
949
990
  }) }))), jsxs(TableBody, Object.assign({}, tableBodyProps, { sx: (theme) => (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, height: rowVirtualizer
950
991
  ? `${rowVirtualizer.getTotalSize()}px`
951
- : 'inherit', minHeight: !rows.length ? '100px' : undefined, position: 'relative' }, parseFromValuesOrFunc(tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx, theme))), children: [creatingRow && createDisplayMode === 'row' && (jsx(MRT_TableBodyRow, { row: creatingRow, rowIndex: -1, table: table })), (_c = tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.children) !== null && _c !== void 0 ? _c : (!rows.length ? (jsx("tr", { style: {
992
+ : 'inherit', minHeight: !rows.length ? '100px' : undefined, position: 'relative' }, parseFromValuesOrFunc(tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx, theme))), children: [creatingRow && createDisplayMode === 'row' && (jsx(MRT_TableBodyRow, { row: creatingRow, rowIndex: -1, table: table })), (_d = tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.children) !== null && _d !== void 0 ? _d : (!rows.length ? (jsx("tr", { style: {
952
993
  display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
953
994
  }, children: jsx("td", { colSpan: table.getVisibleLeafColumns().length, style: {
954
- display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid'))
955
- ? 'grid'
956
- : 'table-cell',
957
- }, children: (_d = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _d !== void 0 ? _d : (jsx(Typography, { sx: {
995
+ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
996
+ }, children: (_e = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _e !== void 0 ? _e : (jsx(Typography, { sx: {
958
997
  color: 'text.secondary',
959
998
  fontStyle: 'italic',
960
- maxWidth: `min(100vw, ${(_f = (_e = tablePaperRef.current) === null || _e === void 0 ? void 0 : _e.clientWidth) !== null && _f !== void 0 ? _f : 360}px)`,
999
+ maxWidth: `min(100vw, ${(_g = (_f = tablePaperRef.current) === null || _f === void 0 ? void 0 : _f.clientWidth) !== null && _g !== void 0 ? _g : 360}px)`,
961
1000
  py: '2rem',
962
1001
  textAlign: 'center',
963
1002
  width: '100%',
@@ -1001,48 +1040,48 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
1001
1040
  };
1002
1041
  const Memo_MRT_TableBody = memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
1003
1042
 
1004
- const MRT_TableFooterCell = ({ footer, table, }) => {
1005
- var _a, _b;
1043
+ const MRT_TableFooterCell = (_a) => {
1044
+ var _b, _c, _d;
1045
+ var { footer, table } = _a, rest = __rest(_a, ["footer", "table"]);
1006
1046
  const { getState, options: { layoutMode, muiTableFooterCellProps }, } = table;
1007
1047
  const { density } = getState();
1008
1048
  const { column } = footer;
1009
1049
  const { columnDef } = column;
1010
1050
  const { columnDefType } = columnDef;
1011
- const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterCellProps, { column, table })), parseFromValuesOrFunc(columnDef.muiTableFooterCellProps, {
1012
- column,
1013
- table,
1014
- }));
1015
- return (jsx(TableCell, Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: footer.colSpan, variant: "head" }, tableCellProps, { sx: (theme) => (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : 'table-cell', fontWeight: 'bold', justifyContent: columnDefType === 'group' ? 'center' : undefined, p: density === 'compact'
1051
+ const args = { column, table };
1052
+ const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableFooterCellProps, args)), rest);
1053
+ return (jsx(TableCell, Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: footer.colSpan, variant: "head" }, tableCellProps, { sx: (theme) => (Object.assign(Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, fontWeight: 'bold', justifyContent: columnDefType === 'group' ? 'center' : undefined, p: density === 'compact'
1016
1054
  ? '0.5rem'
1017
1055
  : density === 'comfortable'
1018
1056
  ? '1rem'
1019
- : '1.5rem', verticalAlign: 'top', zIndex: column.getIsPinned() && columnDefType !== 'group' ? 2 : 1 }, getCommonCellStyles({
1057
+ : '1.5rem', verticalAlign: 'top', zIndex: column.getIsPinned() && columnDefType !== 'group' ? 2 : 1 }, getCommonMRTCellStyles({
1020
1058
  column,
1021
1059
  table,
1022
1060
  tableCellProps,
1023
1061
  theme,
1024
- }))), children: jsx(Fragment, { children: footer.isPlaceholder
1025
- ? null
1026
- : (_b = (_a = parseFromValuesOrFunc(columnDef.Footer, {
1027
- column,
1028
- footer,
1029
- table,
1030
- })) !== null && _a !== void 0 ? _a : columnDef.footer) !== null && _b !== void 0 ? _b : null }) })));
1062
+ })), parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: (_b = tableCellProps.children) !== null && _b !== void 0 ? _b : (footer.isPlaceholder
1063
+ ? null
1064
+ : (_d = (_c = parseFromValuesOrFunc(columnDef.Footer, {
1065
+ column,
1066
+ footer,
1067
+ table,
1068
+ })) !== null && _c !== void 0 ? _c : columnDef.footer) !== null && _d !== void 0 ? _d : null) })));
1031
1069
  };
1032
1070
 
1033
- const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
1034
- var _a;
1071
+ const MRT_TableFooterRow = (_a) => {
1072
+ var _b;
1073
+ var { footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["footerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
1035
1074
  const { options: { layoutMode, muiTableFooterRowProps }, } = table;
1036
1075
  // if no content in row, skip row
1037
- if (!((_a = footerGroup.headers) === null || _a === void 0 ? void 0 : _a.some((header) => (typeof header.column.columnDef.footer === 'string' &&
1076
+ if (!((_b = footerGroup.headers) === null || _b === void 0 ? void 0 : _b.some((header) => (typeof header.column.columnDef.footer === 'string' &&
1038
1077
  !!header.column.columnDef.footer) ||
1039
1078
  header.column.columnDef.Footer)))
1040
1079
  return null;
1041
- const tableRowProps = parseFromValuesOrFunc(muiTableFooterRowProps, {
1080
+ const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterRowProps, {
1042
1081
  footerGroup,
1043
1082
  table,
1044
- });
1045
- return (jsxs(TableRow, Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.05), display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, width: '100%' }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : footerGroup.headers).map((footerOrVirtualFooter) => {
1083
+ })), rest);
1084
+ return (jsxs(TableRow, Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, width: '100%' }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : footerGroup.headers).map((footerOrVirtualFooter) => {
1046
1085
  const footer = virtualColumns
1047
1086
  ? footerGroup.headers[footerOrVirtualFooter.index]
1048
1087
  : footerOrVirtualFooter;
@@ -1050,12 +1089,13 @@ const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPadding
1050
1089
  }), virtualPaddingRight ? (jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
1051
1090
  };
1052
1091
 
1053
- const MRT_TableFooter = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
1092
+ const MRT_TableFooter = (_a) => {
1093
+ var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
1054
1094
  const { getFooterGroups, getState, options: { enableStickyFooter, layoutMode, muiTableFooterProps }, refs: { tableFooterRef }, } = table;
1055
1095
  const { isFullScreen } = getState();
1056
- const tableFooterProps = parseFromValuesOrFunc(muiTableFooterProps, {
1096
+ const tableFooterProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterProps, {
1057
1097
  table,
1058
- });
1098
+ })), rest);
1059
1099
  const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
1060
1100
  return (jsx(TableFooter, Object.assign({}, tableFooterProps, { ref: (ref) => {
1061
1101
  tableFooterRef.current = ref;
@@ -1160,14 +1200,15 @@ const rangeModes = ['between', 'betweenInclusive', 'inNumberRange'];
1160
1200
  const emptyModes = ['empty', 'notEmpty'];
1161
1201
  const arrModes = ['arrIncludesSome', 'arrIncludesAll', 'arrIncludes'];
1162
1202
  const rangeVariants = ['range-slider', 'date-range', 'range'];
1163
- const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilterValue, table, }) => {
1164
- var _a, _b, _c, _d;
1203
+ const MRT_FilterOptionMenu = (_a) => {
1204
+ var _b, _c, _d, _e;
1205
+ var { anchorEl, header, onSelect, setAnchorEl, setFilterValue, table } = _a, rest = __rest(_a, ["anchorEl", "header", "onSelect", "setAnchorEl", "setFilterValue", "table"]);
1165
1206
  const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
1166
1207
  const { density, globalFilterFn } = getState();
1167
1208
  const { column } = header !== null && header !== void 0 ? header : {};
1168
1209
  const { columnDef } = column !== null && column !== void 0 ? column : {};
1169
1210
  const currentFilterValue = column === null || column === void 0 ? void 0 : column.getFilterValue();
1170
- let allowedColumnFilterOptions = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _a !== void 0 ? _a : columnFilterModeOptions;
1211
+ let allowedColumnFilterOptions = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _b !== void 0 ? _b : columnFilterModeOptions;
1171
1212
  if (rangeVariants.includes(columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant)) {
1172
1213
  allowedColumnFilterOptions = [
1173
1214
  ...rangeModes,
@@ -1241,15 +1282,15 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
1241
1282
  onSelect === null || onSelect === void 0 ? void 0 : onSelect();
1242
1283
  };
1243
1284
  const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
1244
- return (jsx(Menu, { MenuListProps: {
1285
+ return (jsx(Menu, Object.assign({ MenuListProps: {
1245
1286
  dense: density === 'compact',
1246
- }, anchorEl: anchorEl, anchorOrigin: { horizontal: 'right', vertical: 'center' }, onClose: () => setAnchorEl(null), open: !!anchorEl, children: (_d = (header && column && columnDef
1247
- ? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
1287
+ }, anchorEl: anchorEl, anchorOrigin: { horizontal: 'right', vertical: 'center' }, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_e = (header && column && columnDef
1288
+ ? (_d = (_c = columnDef.renderColumnFilterModeMenuItems) === null || _c === void 0 ? void 0 : _c.call(columnDef, {
1248
1289
  column: column,
1249
1290
  internalFilterOptions,
1250
1291
  onSelectFilterMode: handleSelectFilterMode,
1251
1292
  table,
1252
- })) !== null && _c !== void 0 ? _c : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
1293
+ })) !== null && _d !== void 0 ? _d : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
1253
1294
  column: column,
1254
1295
  internalFilterOptions,
1255
1296
  onSelectFilterMode: handleSelectFilterMode,
@@ -1259,13 +1300,13 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
1259
1300
  internalFilterOptions,
1260
1301
  onSelectFilterMode: handleSelectFilterMode,
1261
1302
  table,
1262
- }))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ divider, label, option, symbol }, index) => (jsxs(MenuItem, { divider: divider, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
1303
+ }))) !== null && _e !== void 0 ? _e : internalFilterOptions.map(({ divider, label, option, symbol }, index) => (jsxs(MenuItem, { divider: divider, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
1263
1304
  alignItems: 'center',
1264
1305
  display: 'flex',
1265
1306
  gap: '2ch',
1266
1307
  my: 0,
1267
1308
  py: '6px',
1268
- }, value: option, children: [jsx(Box, { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) }));
1309
+ }, value: option, children: [jsx(Box, { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) })));
1269
1310
  };
1270
1311
 
1271
1312
  const commonMenuItemStyles = {
@@ -1278,8 +1319,9 @@ const commonListItemStyles = {
1278
1319
  alignItems: 'center',
1279
1320
  display: 'flex',
1280
1321
  };
1281
- const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
1282
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1322
+ const MRT_ColumnActionMenu = (_a) => {
1323
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1324
+ var { anchorEl, header, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "header", "setAnchorEl", "table"]);
1283
1325
  const { getState, options: { columnFilterDisplayMode, columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnPinning, enableColumnResizing, enableGrouping, enableHiding, enableSorting, enableSortingRemoval, icons: { ArrowRightIcon, ClearAllIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, RestartAltIcon, SortIcon, ViewColumnIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setColumnOrder, setColumnSizingInfo, setShowColumnFilters, toggleAllColumnsVisible, } = table;
1284
1326
  const { column } = header;
1285
1327
  const { columnDef } = column;
@@ -1334,7 +1376,7 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
1334
1376
  setFilterMenuAnchorEl(event.currentTarget);
1335
1377
  };
1336
1378
  const isSelectFilter = !!columnDef.filterSelectOptions;
1337
- const allowedColumnFilterOptions = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _a !== void 0 ? _a : columnFilterModeOptions;
1379
+ const allowedColumnFilterOptions = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _b !== void 0 ? _b : columnFilterModeOptions;
1338
1380
  const showFilterModeSubMenu = enableColumnFilterModes &&
1339
1381
  columnDef.enableColumnFilterModes !== false &&
1340
1382
  !isSelectFilter &&
@@ -1344,8 +1386,8 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
1344
1386
  ...(enableSorting && column.getCanSort()
1345
1387
  ? [
1346
1388
  enableSortingRemoval !== false && (jsx(MenuItem, { disabled: !column.getIsSorted(), onClick: handleClearSort, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(ClearAllIcon, {}) }), localization.clearSort] }) }, 0)),
1347
- jsx(MenuItem, { disabled: column.getIsSorted() === 'asc', onClick: handleSortAsc, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(SortIcon, { style: { transform: 'rotate(180deg) scaleX(-1)' } }) }), (_b = localization.sortByColumnAsc) === null || _b === void 0 ? void 0 : _b.replace('{column}', String(columnDef.header))] }) }, 1),
1348
- jsx(MenuItem, { disabled: column.getIsSorted() === 'desc', divider: enableColumnFilters || enableGrouping || enableHiding, onClick: handleSortDesc, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(SortIcon, {}) }), (_c = localization.sortByColumnDesc) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))] }) }, 2),
1389
+ jsx(MenuItem, { disabled: column.getIsSorted() === 'asc', onClick: handleSortAsc, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(SortIcon, { style: { transform: 'rotate(180deg) scaleX(-1)' } }) }), (_c = localization.sortByColumnAsc) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))] }) }, 1),
1390
+ jsx(MenuItem, { disabled: column.getIsSorted() === 'desc', divider: enableColumnFilters || enableGrouping || enableHiding, onClick: handleSortDesc, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(SortIcon, {}) }), (_d = localization.sortByColumnDesc) === null || _d === void 0 ? void 0 : _d.replace('{column}', String(columnDef.header))] }) }, 2),
1349
1391
  ]
1350
1392
  : []),
1351
1393
  ...(enableColumnFilters && column.getCanFilter()
@@ -1355,13 +1397,13 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
1355
1397
  !columnFilterValue.filter((value) => value).length), onClick: handleClearFilter, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(FilterListOffIcon, {}) }), localization.clearFilter] }) }, 3),
1356
1398
  columnFilterDisplayMode === 'subheader' && (jsxs(MenuItem, { disabled: showColumnFilters && !enableColumnFilterModes, divider: enableGrouping || enableHiding, onClick: showColumnFilters
1357
1399
  ? handleOpenFilterModeMenu
1358
- : handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(FilterListIcon, {}) }), (_d = localization.filterByColumn) === null || _d === void 0 ? void 0 : _d.replace('{column}', String(columnDef.header))] }), showFilterModeSubMenu && (jsx(IconButton, { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 }, children: jsx(ArrowRightIcon, {}) }))] }, 4)),
1400
+ : handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(FilterListIcon, {}) }), (_e = localization.filterByColumn) === null || _e === void 0 ? void 0 : _e.replace('{column}', String(columnDef.header))] }), showFilterModeSubMenu && (jsx(IconButton, { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 }, children: jsx(ArrowRightIcon, {}) }))] }, 4)),
1359
1401
  showFilterModeSubMenu && (jsx(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table }, 5)),
1360
1402
  ].filter(Boolean)
1361
1403
  : []),
1362
1404
  ...(enableGrouping && column.getCanGroup()
1363
1405
  ? [
1364
- jsx(MenuItem, { divider: enableColumnPinning, onClick: handleGroupByColumn, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(DynamicFeedIcon, {}) }), (_e = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _e === void 0 ? void 0 : _e.replace('{column}', String(columnDef.header))] }) }, 6),
1406
+ jsx(MenuItem, { divider: enableColumnPinning, onClick: handleGroupByColumn, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(DynamicFeedIcon, {}) }), (_f = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))] }) }, 6),
1365
1407
  ]
1366
1408
  : []),
1367
1409
  ...(enableColumnPinning && column.getCanPin()
@@ -1378,30 +1420,31 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
1378
1420
  : []),
1379
1421
  ...(enableHiding
1380
1422
  ? [
1381
- jsx(MenuItem, { disabled: !column.getCanHide(), onClick: handleHideColumn, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(VisibilityOffIcon, {}) }), (_f = localization.hideColumn) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))] }) }, 11),
1423
+ jsx(MenuItem, { disabled: !column.getCanHide(), onClick: handleHideColumn, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(VisibilityOffIcon, {}) }), (_g = localization.hideColumn) === null || _g === void 0 ? void 0 : _g.replace('{column}', String(columnDef.header))] }) }, 11),
1382
1424
  jsx(MenuItem, { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
1383
- .length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(ViewColumnIcon, {}) }), (_g = localization.showAllColumns) === null || _g === void 0 ? void 0 : _g.replace('{column}', String(columnDef.header))] }) }, 12),
1425
+ .length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(ViewColumnIcon, {}) }), (_h = localization.showAllColumns) === null || _h === void 0 ? void 0 : _h.replace('{column}', String(columnDef.header))] }) }, 12),
1384
1426
  ]
1385
1427
  : []),
1386
1428
  ].filter(Boolean);
1387
- return (jsx(Menu, { MenuListProps: {
1429
+ return (jsx(Menu, Object.assign({ MenuListProps: {
1388
1430
  dense: density === 'compact',
1389
- }, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl, children: (_k = (_j = (_h = columnDef.renderColumnActionsMenuItems) === null || _h === void 0 ? void 0 : _h.call(columnDef, {
1431
+ }, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_l = (_k = (_j = columnDef.renderColumnActionsMenuItems) === null || _j === void 0 ? void 0 : _j.call(columnDef, {
1390
1432
  closeMenu: () => setAnchorEl(null),
1391
1433
  column,
1392
1434
  internalColumnMenuItems,
1393
1435
  table,
1394
- })) !== null && _j !== void 0 ? _j : renderColumnActionsMenuItems === null || renderColumnActionsMenuItems === void 0 ? void 0 : renderColumnActionsMenuItems({
1436
+ })) !== null && _k !== void 0 ? _k : renderColumnActionsMenuItems === null || renderColumnActionsMenuItems === void 0 ? void 0 : renderColumnActionsMenuItems({
1395
1437
  closeMenu: () => setAnchorEl(null),
1396
1438
  column,
1397
1439
  internalColumnMenuItems,
1398
1440
  table,
1399
- })) !== null && _k !== void 0 ? _k : internalColumnMenuItems }));
1441
+ })) !== null && _l !== void 0 ? _l : internalColumnMenuItems })));
1400
1442
  };
1401
1443
 
1402
- const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
1403
- var _a;
1404
- const { options: { columnFilterDisplayMode, icons: { MoreVertIcon }, localization, muiColumnActionsButtonProps, }, } = table;
1444
+ const MRT_TableHeadCellColumnActionsButton = (_a) => {
1445
+ var _b;
1446
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1447
+ const { options: { icons: { MoreVertIcon }, localization, muiColumnActionsButtonProps, }, } = table;
1405
1448
  const { column } = header;
1406
1449
  const { columnDef } = column;
1407
1450
  const [anchorEl, setAnchorEl] = useState(null);
@@ -1410,32 +1453,33 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
1410
1453
  event.preventDefault();
1411
1454
  setAnchorEl(event.currentTarget);
1412
1455
  };
1413
- const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnActionsButtonProps, {
1456
+ const iconButtonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnActionsButtonProps, {
1414
1457
  column,
1415
1458
  table,
1416
1459
  })), parseFromValuesOrFunc(columnDef.muiColumnActionsButtonProps, {
1417
1460
  column,
1418
1461
  table,
1419
- }));
1420
- return (jsxs(Fragment, { children: [jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.columnActions, children: jsx(IconButton, Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ '&:hover': {
1462
+ })), rest);
1463
+ return (jsxs(Fragment, { children: [jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : localization.columnActions, children: jsx(IconButton, Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ '&:hover': {
1421
1464
  opacity: 1,
1422
- }, height: '2rem', m: '-4px', opacity: 0.3, transform: `scale(0.85) ${columnFilterDisplayMode !== 'popover' ? 'translateX(-4px)' : ''}`, transition: 'opacity 150ms', width: '2rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: jsx(MoreVertIcon, {}) })) }), anchorEl && (jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
1465
+ }, height: '2rem', m: '-8px -4px', opacity: 0.3, transition: 'all 150ms', width: '2rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: jsx(MoreVertIcon, { style: { transform: 'scale(0.9)' } }) })) }), anchorEl && (jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
1423
1466
  };
1424
1467
 
1425
- const MRT_FilterCheckbox = ({ column, table, }) => {
1426
- var _a, _b, _c;
1468
+ const MRT_FilterCheckbox = (_a) => {
1469
+ var _b, _c, _d;
1470
+ var { column, table } = _a, rest = __rest(_a, ["column", "table"]);
1427
1471
  const { getState, options: { localization, muiFilterCheckboxProps }, } = table;
1428
1472
  const { density } = getState();
1429
1473
  const { columnDef } = column;
1430
- const checkboxProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterCheckboxProps, {
1474
+ const checkboxProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterCheckboxProps, {
1431
1475
  column,
1432
1476
  table,
1433
1477
  })), parseFromValuesOrFunc(columnDef.muiFilterCheckboxProps, {
1434
1478
  column,
1435
1479
  table,
1436
- }));
1437
- const filterLabel = (_a = localization.filterByColumn) === null || _a === void 0 ? void 0 : _a.replace('{column}', columnDef.header);
1438
- return (jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : filterLabel, children: jsx(FormControlLabel, { control: jsx(Checkbox, Object.assign({ checked: column.getFilterValue() === 'true', color: column.getFilterValue() === undefined ? 'default' : 'primary', indeterminate: column.getFilterValue() === undefined, size: density === 'compact' ? 'small' : 'medium' }, checkboxProps, { onChange: (e, checked) => {
1480
+ })), rest);
1481
+ const filterLabel = (_b = localization.filterByColumn) === null || _b === void 0 ? void 0 : _b.replace('{column}', columnDef.header);
1482
+ return (jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, title: (_c = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, children: jsx(FormControlLabel, { control: jsx(Checkbox, Object.assign({ checked: column.getFilterValue() === 'true', color: column.getFilterValue() === undefined ? 'default' : 'primary', indeterminate: column.getFilterValue() === undefined, size: density === 'compact' ? 'small' : 'medium' }, checkboxProps, { onChange: (e, checked) => {
1439
1483
  var _a;
1440
1484
  column.setFilterValue(column.getFilterValue() === undefined
1441
1485
  ? 'true'
@@ -1447,19 +1491,20 @@ const MRT_FilterCheckbox = ({ column, table, }) => {
1447
1491
  var _a;
1448
1492
  e.stopPropagation();
1449
1493
  (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
1450
- }, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))) })), disableTypography: true, label: (_c = checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, sx: { color: 'text.secondary', fontWeight: 'normal', mt: '-4px' }, title: undefined }) }));
1494
+ }, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))) })), disableTypography: true, label: (_d = checkboxProps.title) !== null && _d !== void 0 ? _d : filterLabel, sx: { color: 'text.secondary', fontWeight: 'normal', mt: '-4px' }, title: undefined }) }));
1451
1495
  };
1452
1496
 
1453
- const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1454
- var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o;
1497
+ const MRT_FilterTextField = (_a) => {
1498
+ var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1499
+ var { header, rangeFilterIndex, table } = _a, rest = __rest(_a, ["header", "rangeFilterIndex", "table"]);
1455
1500
  const { options: { columnFilterModeOptions, enableColumnFilterModes, icons: { CloseIcon, FilterListIcon }, localization, manualFiltering, muiFilterAutocompleteProps, muiFilterDatePickerProps, muiFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
1456
1501
  const { column } = header;
1457
1502
  const { columnDef } = column;
1458
1503
  const { filterVariant } = columnDef;
1459
- const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTextFieldProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps, {
1504
+ const textFieldProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTextFieldProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps, {
1460
1505
  column,
1461
1506
  table,
1462
- }));
1507
+ })), rest);
1463
1508
  const autocompleteProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterAutocompleteProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterAutocompleteProps, {
1464
1509
  column,
1465
1510
  table,
@@ -1478,17 +1523,17 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1478
1523
  const currentFilterOption = columnDef._filterFn;
1479
1524
  const filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption)
1480
1525
  ? //@ts-ignore
1481
- localization[`filter${((_b = (_a = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt) === null || _a === void 0 ? void 0 : _a.call(currentFilterOption, 0)) === null || _b === void 0 ? void 0 : _b.toUpperCase()) +
1526
+ localization[`filter${((_c = (_b = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt) === null || _b === void 0 ? void 0 : _b.call(currentFilterOption, 0)) === null || _c === void 0 ? void 0 : _c.toUpperCase()) +
1482
1527
  (currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
1483
1528
  : '';
1484
1529
  const filterPlaceholder = !isRangeFilter
1485
- ? (_c = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.placeholder) !== null && _c !== void 0 ? _c : (_d = localization.filterByColumn) === null || _d === void 0 ? void 0 : _d.replace('{column}', String(columnDef.header))
1530
+ ? (_d = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.placeholder) !== null && _d !== void 0 ? _d : (_f = localization.filterByColumn) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))
1486
1531
  : rangeFilterIndex === 0
1487
1532
  ? localization.min
1488
1533
  : rangeFilterIndex === 1
1489
1534
  ? localization.max
1490
1535
  : '';
1491
- const allowedColumnFilterOptions = (_f = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _f !== void 0 ? _f : columnFilterModeOptions;
1536
+ const allowedColumnFilterOptions = (_g = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _g !== void 0 ? _g : columnFilterModeOptions;
1492
1537
  const showChangeModeButton = enableColumnFilterModes &&
1493
1538
  columnDef.enableColumnFilterModes !== false &&
1494
1539
  !rangeFilterIndex &&
@@ -1576,7 +1621,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1576
1621
  isMounted.current = true;
1577
1622
  }, [column.getFilterValue()]);
1578
1623
  if (columnDef.Filter) {
1579
- return (jsx(Fragment, { children: (_g = columnDef.Filter) === null || _g === void 0 ? void 0 : _g.call(columnDef, { column, header, rangeFilterIndex, table }) }));
1624
+ return (jsx(Fragment, { children: (_h = columnDef.Filter) === null || _h === void 0 ? void 0 : _h.call(columnDef, { column, header, rangeFilterIndex, table }) }));
1580
1625
  }
1581
1626
  const dropdownOptions = useMemo(() => {
1582
1627
  var _a;
@@ -1592,12 +1637,12 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1592
1637
  isMultiSelectFilter,
1593
1638
  isSelectFilter,
1594
1639
  ]);
1595
- const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsx(InputAdornment, { position: "end", sx: { mr: isSelectFilter || isMultiSelectFilter ? '20px' : undefined }, children: jsx(Tooltip, { arrow: true, placement: "right", title: (_h = localization.clearFilter) !== null && _h !== void 0 ? _h : '', children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.clearFilter, disabled: !((_j = filterValue === null || filterValue === void 0 ? void 0 : filterValue.toString()) === null || _j === void 0 ? void 0 : _j.length), onClick: handleClear, size: "small", sx: {
1640
+ const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsx(InputAdornment, { position: "end", sx: { mr: isSelectFilter || isMultiSelectFilter ? '20px' : undefined }, children: jsx(Tooltip, { placement: "right", title: (_j = localization.clearFilter) !== null && _j !== void 0 ? _j : '', children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.clearFilter, disabled: !((_k = filterValue === null || filterValue === void 0 ? void 0 : filterValue.toString()) === null || _k === void 0 ? void 0 : _k.length), onClick: handleClear, size: "small", sx: {
1596
1641
  height: '2rem',
1597
1642
  transform: 'scale(0.9)',
1598
1643
  width: '2rem',
1599
1644
  }, children: jsx(CloseIcon, {}) }) }) }) })) : null;
1600
- const startAdornment = showChangeModeButton ? (jsxs(InputAdornment, { position: "start", children: [jsx(Tooltip, { arrow: true, title: localization.changeFilterMode, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.changeFilterMode, onClick: handleFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsx(FilterListIcon, {}) }) }) }), filterChipLabel && (jsx(Chip, { label: filterChipLabel, onDelete: handleClearEmptyFilterChip }))] })) : null;
1645
+ const startAdornment = showChangeModeButton ? (jsxs(InputAdornment, { position: "start", children: [jsx(Tooltip, { title: localization.changeFilterMode, children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.changeFilterMode, onClick: handleFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsx(FilterListIcon, {}) }) }) }), filterChipLabel && (jsx(Chip, { label: filterChipLabel, onDelete: handleClearEmptyFilterChip }))] })) : null;
1601
1646
  const commonTextFieldProps = Object.assign(Object.assign({ FormHelperTextProps: {
1602
1647
  sx: {
1603
1648
  fontSize: '0.75rem',
@@ -1608,7 +1653,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1608
1653
  ? { endAdornment, startAdornment }
1609
1654
  : { startAdornment }, fullWidth: true, helperText: showChangeModeButton ? (jsx("label", { children: localization.filterMode.replace('{filterType}',
1610
1655
  // @ts-ignore
1611
- localization[`filter${((_k = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _k === void 0 ? void 0 : _k.toUpperCase()) +
1656
+ localization[`filter${((_l = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _l === void 0 ? void 0 : _l.toUpperCase()) +
1612
1657
  (currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null, inputProps: {
1613
1658
  autoComplete: 'new-password',
1614
1659
  disabled: !!filterChipLabel,
@@ -1627,16 +1672,18 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1627
1672
  ? undefined
1628
1673
  : filterPlaceholder, variant: 'standard' }, textFieldProps), { sx: (theme) => (Object.assign({ minWidth: isDateFilter
1629
1674
  ? '160px'
1630
- : isRangeFilter
1631
- ? '100px'
1632
- : !filterChipLabel
1633
- ? '120px'
1634
- : 'auto', mx: '-2px', p: 0, width: 'calc(100% + 4px)' }, parseFromValuesOrFunc(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx, theme))) });
1675
+ : enableColumnFilterModes && rangeFilterIndex === 0
1676
+ ? '110px'
1677
+ : isRangeFilter
1678
+ ? '100px'
1679
+ : !filterChipLabel
1680
+ ? '120px'
1681
+ : 'auto', mx: '-2px', p: 0, width: 'calc(100% + 4px)' }, parseFromValuesOrFunc(textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx, theme))) });
1635
1682
  return (jsxs(Fragment, { children: [isDateFilter ? (jsx(DatePicker, Object.assign({ onChange: (newDate) => {
1636
1683
  handleChange(newDate);
1637
1684
  }, value: filterValue || null }, datePickerProps, { slotProps: {
1638
- field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_l = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _l === void 0 ? void 0 : _l.field),
1639
- textField: Object.assign(Object.assign({}, commonTextFieldProps), (_m = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _m === void 0 ? void 0 : _m.textField),
1685
+ field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_m = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _m === void 0 ? void 0 : _m.field),
1686
+ textField: Object.assign(Object.assign({}, commonTextFieldProps), (_o = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _o === void 0 ? void 0 : _o.textField),
1640
1687
  } }))) : isAutocompleteFilter ? (jsx(Autocomplete, Object.assign({ freeSolo: true, getOptionLabel: (option) => option, onChange: (_e, newValue) => handleChange(newValue), options: dropdownOptions !== null && dropdownOptions !== void 0 ? dropdownOptions : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
1641
1688
  var _a;
1642
1689
  return (jsx(TextField, Object.assign({}, builtinTextFieldProps, commonTextFieldProps, { InputProps: Object.assign(Object.assign({}, builtinTextFieldProps.InputProps), { startAdornment: (_a = commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.startAdornment }), inputProps: Object.assign(Object.assign({}, builtinTextFieldProps.inputProps), commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.inputProps), onChange: handleTextFieldChange })));
@@ -1656,7 +1703,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1656
1703
  }, onChange: handleTextFieldChange, select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { value: filterValue !== null && filterValue !== void 0 ? filterValue : '', children: (isSelectFilter || isMultiSelectFilter) && [
1657
1704
  jsx(MenuItem, { disabled: true, divider: true, hidden: true, value: "", children: jsx(Box, { sx: { opacity: 0.5 }, children: filterPlaceholder }) }, "p"),
1658
1705
  ...[
1659
- (_o = textFieldProps.children) !== null && _o !== void 0 ? _o : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
1706
+ (_p = textFieldProps.children) !== null && _p !== void 0 ? _p : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
1660
1707
  var _a;
1661
1708
  if (!option)
1662
1709
  return '';
@@ -1682,21 +1729,23 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1682
1729
  ] }))), jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, setFilterValue: setFilterValue, table: table })] }));
1683
1730
  };
1684
1731
 
1685
- const MRT_FilterRangeFields = ({ header, table, }) => {
1686
- return (jsxs(Box, { sx: { display: 'grid', gap: '1rem', gridTemplateColumns: '1fr 1fr' }, children: [jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }), jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })] }));
1732
+ const MRT_FilterRangeFields = (_a) => {
1733
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1734
+ return (jsxs(Box, Object.assign({}, rest, { sx: (theme) => (Object.assign({ display: 'grid', gap: '1rem', gridTemplateColumns: '1fr 1fr' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: [jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }), jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })] })));
1687
1735
  };
1688
1736
 
1689
- const MRT_FilterRangeSlider = ({ header, table, }) => {
1690
- var _a, _b;
1737
+ const MRT_FilterRangeSlider = (_a) => {
1738
+ var _b, _c;
1739
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1691
1740
  const { options: { enableColumnFilterModes, localization, muiFilterSliderProps }, refs: { filterInputRefs }, } = table;
1692
1741
  const { column } = header;
1693
1742
  const { columnDef } = column;
1694
1743
  const currentFilterOption = columnDef._filterFn;
1695
1744
  const showChangeModeButton = enableColumnFilterModes && columnDef.enableColumnFilterModes !== false;
1696
- const sliderProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterSliderProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterSliderProps, { column, table }));
1745
+ const sliderProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterSliderProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterSliderProps, { column, table })), rest);
1697
1746
  let [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
1698
1747
  ? [sliderProps.min, sliderProps.max]
1699
- : (_a = column.getFacetedMinMaxValues()) !== null && _a !== void 0 ? _a : [0, 1];
1748
+ : (_b = column.getFacetedMinMaxValues()) !== null && _b !== void 0 ? _b : [0, 1];
1700
1749
  //fix potential TanStack Table bugs where min or max is an array
1701
1750
  if (Array.isArray(min))
1702
1751
  min = min[0];
@@ -1753,22 +1802,24 @@ const MRT_FilterRangeSlider = ({ header, table, }) => {
1753
1802
  whiteSpace: 'nowrap',
1754
1803
  }, children: localization.filterMode.replace('{filterType}',
1755
1804
  // @ts-ignore
1756
- localization[`filter${((_b = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _b === void 0 ? void 0 : _b.toUpperCase()) +
1805
+ localization[`filter${((_c = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _c === void 0 ? void 0 : _c.toUpperCase()) +
1757
1806
  (currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null] }));
1758
1807
  };
1759
1808
 
1760
- const MRT_TableHeadCellFilterContainer = ({ header, table, }) => {
1761
- var _a;
1809
+ const MRT_TableHeadCellFilterContainer = (_a) => {
1810
+ var _b;
1811
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1762
1812
  const { getState, options: { columnFilterDisplayMode }, } = table;
1763
1813
  const { showColumnFilters } = getState();
1764
1814
  const { column } = header;
1765
1815
  const { columnDef } = column;
1766
- return (jsx(Collapse, { in: showColumnFilters || columnFilterDisplayMode === 'popover', mountOnEnter: true, unmountOnExit: true, children: columnDef.filterVariant === 'checkbox' ? (jsx(MRT_FilterCheckbox, { column: column, table: table })) : columnDef.filterVariant === 'range-slider' ? (jsx(MRT_FilterRangeSlider, { header: header, table: table })) : ((_a = columnDef.filterVariant) === null || _a === void 0 ? void 0 : _a.includes('range')) ||
1767
- ['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsx(MRT_FilterTextField, { header: header, table: table })) }));
1816
+ return (jsx(Collapse, Object.assign({ in: showColumnFilters || columnFilterDisplayMode === 'popover', mountOnEnter: true, unmountOnExit: true }, rest, { children: columnDef.filterVariant === 'checkbox' ? (jsx(MRT_FilterCheckbox, { column: column, table: table })) : columnDef.filterVariant === 'range-slider' ? (jsx(MRT_FilterRangeSlider, { header: header, table: table })) : ((_b = columnDef.filterVariant) === null || _b === void 0 ? void 0 : _b.includes('range')) ||
1817
+ ['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsx(MRT_FilterTextField, { header: header, table: table })) })));
1768
1818
  };
1769
1819
 
1770
- const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
1771
- var _a, _b, _c;
1820
+ const MRT_TableHeadCellFilterLabel = (_a) => {
1821
+ var _b, _c, _d;
1822
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1772
1823
  const { options: { columnFilterDisplayMode, icons: { FilterAltIcon }, localization, }, refs: { filterInputRefs }, setShowColumnFilters, } = table;
1773
1824
  const { column } = header;
1774
1825
  const { columnDef } = column;
@@ -1776,16 +1827,16 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
1776
1827
  const [anchorEl, setAnchorEl] = useState(null);
1777
1828
  const isFilterActive = (Array.isArray(filterValue) && filterValue.some(Boolean)) ||
1778
1829
  (!!filterValue && !Array.isArray(filterValue));
1779
- const isRangeFilter = ((_a = columnDef.filterVariant) === null || _a === void 0 ? void 0 : _a.includes('range')) ||
1830
+ const isRangeFilter = ((_b = columnDef.filterVariant) === null || _b === void 0 ? void 0 : _b.includes('range')) ||
1780
1831
  ['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn);
1781
1832
  const currentFilterOption = columnDef._filterFn;
1782
1833
  const filterTooltip = columnFilterDisplayMode === 'popover' && !isFilterActive
1783
- ? (_b = localization.filterByColumn) === null || _b === void 0 ? void 0 : _b.replace('{column}', String(columnDef.header))
1834
+ ? (_c = localization.filterByColumn) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))
1784
1835
  : localization.filteringByColumn
1785
1836
  .replace('{column}', String(columnDef.header))
1786
1837
  .replace('{filterType}', currentFilterOption
1787
1838
  ? // @ts-ignore
1788
- localization[`filter${((_c = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _c === void 0 ? void 0 : _c.toUpperCase()) +
1839
+ localization[`filter${((_d = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _d === void 0 ? void 0 : _d.toUpperCase()) +
1789
1840
  (currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
1790
1841
  : '')
1791
1842
  .replace('{filterValue}', `"${Array.isArray(filterValue)
@@ -1795,7 +1846,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
1795
1846
  return (jsxs(Fragment, { children: [jsx(Grow, { in: columnFilterDisplayMode === 'popover' ||
1796
1847
  (!!filterValue && !isRangeFilter) ||
1797
1848
  (isRangeFilter && // @ts-ignore
1798
- (!!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[0]) || !!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[1]))), unmountOnExit: true, children: jsx(Box, { component: "span", sx: { flex: '0 0' }, children: jsx(Tooltip, { arrow: true, placement: "top", title: filterTooltip, children: jsx(IconButton, { disableRipple: true, onClick: (event) => {
1849
+ (!!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[0]) || !!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[1]))), unmountOnExit: true, children: jsx(Box, { component: "span", sx: { flex: '0 0' }, children: jsx(Tooltip, { placement: "top", title: filterTooltip, children: jsx(IconButton, Object.assign({ disableRipple: true, onClick: (event) => {
1799
1850
  if (columnFilterDisplayMode === 'popover') {
1800
1851
  setAnchorEl(event.currentTarget);
1801
1852
  }
@@ -1808,15 +1859,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
1808
1859
  (_b = filterInputRefs.current[`${column.id}-0`]) === null || _b === void 0 ? void 0 : _b.select();
1809
1860
  });
1810
1861
  event.stopPropagation();
1811
- }, size: "small", sx: {
1812
- height: '16px',
1813
- ml: '4px',
1814
- opacity: isFilterActive ? 1 : 0.3,
1815
- p: '8px',
1816
- transform: 'scale(0.75)',
1817
- transition: 'all 150ms ease-in-out',
1818
- width: '16px',
1819
- }, children: jsx(FilterAltIcon, {}) }) }) }) }), jsx(Popover, { anchorEl: anchorEl, anchorOrigin: {
1862
+ }, size: "small" }, rest, { sx: (theme) => (Object.assign({ height: '16px', ml: '4px', opacity: isFilterActive ? 1 : 0.3, p: '8px', transform: 'scale(0.75)', transition: 'all 150ms ease-in-out', width: '16px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsx(FilterAltIcon, {}) })) }) }) }), jsx(Popover, { anchorEl: anchorEl, anchorOrigin: {
1820
1863
  horizontal: 'center',
1821
1864
  vertical: 'top',
1822
1865
  }, onClick: (event) => event.stopPropagation(), onClose: (event) => {
@@ -1829,14 +1872,15 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
1829
1872
  }, children: jsx(Box, { sx: { p: '1rem' }, children: jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }) }) })] }));
1830
1873
  };
1831
1874
 
1832
- const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
1875
+ const MRT_TableHeadCellGrabHandle = (_a) => {
1876
+ var { column, table, tableHeadCellRef } = _a, rest = __rest(_a, ["column", "table", "tableHeadCellRef"]);
1833
1877
  const { getState, options: { enableColumnOrdering, muiColumnDragHandleProps }, setColumnOrder, setDraggingColumn, setHoveredColumn, } = table;
1834
1878
  const { columnDef } = column;
1835
1879
  const { columnOrder, draggingColumn, hoveredColumn } = getState();
1836
- const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnDragHandleProps, { column, table })), parseFromValuesOrFunc(columnDef.muiColumnDragHandleProps, {
1880
+ const iconButtonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnDragHandleProps, { column, table })), parseFromValuesOrFunc(columnDef.muiColumnDragHandleProps, {
1837
1881
  column,
1838
1882
  table,
1839
- }));
1883
+ })), rest);
1840
1884
  const handleDragStart = (event) => {
1841
1885
  var _a;
1842
1886
  (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
@@ -1860,8 +1904,9 @@ const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
1860
1904
  return (jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
1861
1905
  };
1862
1906
 
1863
- const MRT_TableHeadCellResizeHandle = ({ header, table, }) => {
1864
- var _a;
1907
+ const MRT_TableHeadCellResizeHandle = (_a) => {
1908
+ var _b;
1909
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1865
1910
  const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
1866
1911
  const { density } = getState();
1867
1912
  const { column } = header;
@@ -1870,7 +1915,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table, }) => {
1870
1915
  column.resetSize();
1871
1916
  }, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), style: {
1872
1917
  transform: column.getIsResizing() && columnResizeMode === 'onEnd'
1873
- ? `translateX(${(_a = getState().columnSizingInfo.deltaOffset) !== null && _a !== void 0 ? _a : 0}px)`
1918
+ ? `translateX(${(_b = getState().columnSizingInfo.deltaOffset) !== null && _b !== void 0 ? _b : 0}px)`
1874
1919
  : undefined,
1875
1920
  }, sx: (theme) => ({
1876
1921
  '&:active > hr': {
@@ -1885,59 +1930,57 @@ const MRT_TableHeadCellResizeHandle = ({ header, table, }) => {
1885
1930
  : '-28px',
1886
1931
  position: 'absolute',
1887
1932
  px: '4px',
1888
- right: '0',
1889
- }), children: jsx(Divider, { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: {
1890
- borderRadius: '2px',
1891
- borderWidth: '2px',
1892
- height: '24px',
1893
- touchAction: 'none',
1894
- transition: column.getIsResizing()
1933
+ right: column.columnDef.columnDefType === 'display' ? '4px' : '0',
1934
+ }), children: jsx(Divider, { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: (theme) => (Object.assign({ borderRadius: '2px', borderWidth: '2px', height: '24px', touchAction: 'none', transition: column.getIsResizing()
1895
1935
  ? undefined
1896
- : 'all 150ms ease-in-out',
1897
- userSelect: 'none',
1898
- zIndex: 4,
1899
- } }) }));
1936
+ : 'all 150ms ease-in-out', userSelect: 'none', zIndex: 4 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))) }) }));
1900
1937
  };
1901
1938
 
1902
- const MRT_TableHeadCellSortLabel = ({ header, table, }) => {
1939
+ const MRT_TableHeadCellSortLabel = (_a) => {
1940
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1903
1941
  const { getState, options: { icons: { ArrowDownwardIcon, SyncAltIcon }, localization, }, } = table;
1904
1942
  const { column } = header;
1905
1943
  const { columnDef } = column;
1906
- const { sorting } = getState();
1944
+ const { isLoading, showSkeletons, sorting } = getState();
1907
1945
  const isSorted = !!column.getIsSorted();
1908
- const sortTooltip = column.getIsSorted()
1909
- ? column.getIsSorted() === 'desc'
1910
- ? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
1911
- : localization.sortedByColumnAsc.replace('{column}', columnDef.header)
1912
- : column.getNextSortingOrder() === 'desc'
1913
- ? localization.sortByColumnDesc.replace('{column}', columnDef.header)
1914
- : localization.sortByColumnAsc.replace('{column}', columnDef.header);
1915
- return (jsx(Tooltip, { arrow: true, placement: "top", title: sortTooltip, children: jsx(Badge, { badgeContent: sorting.length > 1 ? column.getSortIndex() + 1 : 0, overlap: "circular", children: jsx(TableSortLabel, { IconComponent: !isSorted
1916
- ? (props) => (jsx(SyncAltIcon, Object.assign({}, props, { style: { transform: 'rotate(-90deg) scaleX(0.8)' } })))
1946
+ const sortTooltip = isLoading || showSkeletons
1947
+ ? ''
1948
+ : column.getIsSorted()
1949
+ ? column.getIsSorted() === 'desc'
1950
+ ? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
1951
+ : localization.sortedByColumnAsc.replace('{column}', columnDef.header)
1952
+ : column.getNextSortingOrder() === 'desc'
1953
+ ? localization.sortByColumnDesc.replace('{column}', columnDef.header)
1954
+ : localization.sortByColumnAsc.replace('{column}', columnDef.header);
1955
+ return (jsx(Tooltip, { placement: "top", title: sortTooltip, children: jsx(Badge, { badgeContent: sorting.length > 1 ? column.getSortIndex() + 1 : 0, overlap: "circular", children: jsx(TableSortLabel, Object.assign({ IconComponent: !isSorted
1956
+ ? (props) => (jsx(SyncAltIcon, Object.assign({}, props, { style: {
1957
+ transform: 'rotate(-90deg) scaleX(0.9) translateX(-1px)',
1958
+ } })))
1917
1959
  : ArrowDownwardIcon, active: true, "aria-label": sortTooltip, direction: isSorted ? column.getIsSorted() : undefined, onClick: (e) => {
1918
1960
  var _a;
1919
1961
  e.stopPropagation();
1920
1962
  (_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(e);
1921
- }, sx: {
1922
- flex: '0 0',
1923
- opacity: isSorted ? 1 : 0.3,
1924
- transition: 'all 150ms ease-in-out',
1925
- width: '3ch',
1926
- } }) }) }));
1963
+ } }, rest, { sx: (theme) => (Object.assign({ '.MuiTableSortLabel-icon': {
1964
+ color: `${theme.palette.mode === 'dark'
1965
+ ? theme.palette.text.primary
1966
+ : theme.palette.text.secondary} !important`,
1967
+ }, flex: '0 0', opacity: isSorted ? 1 : 0.3, transition: 'all 150ms ease-in-out', width: '3ch' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))) })) }) }));
1927
1968
  };
1928
1969
 
1929
- const MRT_TableHeadCell = ({ header, table, }) => {
1930
- var _a, _b, _c, _d, _f;
1970
+ const MRT_TableHeadCell = (_a) => {
1971
+ var _b, _c, _d, _f, _g, _h;
1972
+ var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
1931
1973
  const theme = useTheme();
1932
1974
  const { getState, options: { columnFilterDisplayMode, enableColumnActions, enableColumnDragging, enableColumnOrdering, enableGrouping, enableMultiSort, layoutMode, muiTableHeadCellProps, }, refs: { tableHeadCellRefs }, setHoveredColumn, } = table;
1933
1975
  const { columnSizingInfo, density, draggingColumn, grouping, hoveredColumn, showColumnFilters, } = getState();
1934
1976
  const { column } = header;
1935
1977
  const { columnDef } = column;
1936
1978
  const { columnDefType } = columnDef;
1937
- const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadCellProps, { column, table })), parseFromValuesOrFunc(columnDef.muiTableHeadCellProps, {
1979
+ const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadCellProps, { column, table })), parseFromValuesOrFunc(columnDef.muiTableHeadCellProps, {
1938
1980
  column,
1939
1981
  table,
1940
- }));
1982
+ })), rest);
1983
+ const { draggingBorderColor } = getMRTTheme(table, theme);
1941
1984
  const showColumnActions = (enableColumnActions || columnDef.enableColumnActions) &&
1942
1985
  columnDef.enableColumnActions !== false;
1943
1986
  const showDragHandle = enableColumnDragging !== false &&
@@ -1960,11 +2003,11 @@ const MRT_TableHeadCell = ({ header, table, }) => {
1960
2003
  const draggingBorders = useMemo(() => {
1961
2004
  const borderStyle = columnSizingInfo.isResizingColumn === column.id &&
1962
2005
  !header.subHeaders.length
1963
- ? `2px solid ${theme.palette.primary.main} !important`
2006
+ ? `2px solid ${draggingBorderColor} !important`
1964
2007
  : (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
1965
- ? `1px dashed ${theme.palette.text.secondary}`
2008
+ ? `1px dashed ${theme.palette.grey[500]}`
1966
2009
  : (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
1967
- ? `2px dashed ${theme.palette.primary.main}`
2010
+ ? `2px dashed ${draggingBorderColor}`
1968
2011
  : undefined;
1969
2012
  if (columnSizingInfo.isResizingColumn === column.id) {
1970
2013
  return { borderRight: borderStyle };
@@ -1986,11 +2029,11 @@ const MRT_TableHeadCell = ({ header, table, }) => {
1986
2029
  setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
1987
2030
  }
1988
2031
  };
1989
- const headerElement = (_a = parseFromValuesOrFunc(columnDef.Header, {
2032
+ const headerElement = (_b = parseFromValuesOrFunc(columnDef.Header, {
1990
2033
  column,
1991
2034
  header,
1992
2035
  table,
1993
- })) !== null && _a !== void 0 ? _a : columnDef.header;
2036
+ })) !== null && _b !== void 0 ? _b : columnDef.header;
1994
2037
  return (jsxs(TableCell, Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: header.colSpan, onDragEnter: handleDragEnter, ref: (node) => {
1995
2038
  if (node) {
1996
2039
  tableHeadCellRefs.current[column.id] = node;
@@ -2019,54 +2062,60 @@ const MRT_TableHeadCell = ({ header, table, }) => {
2019
2062
  ? 3
2020
2063
  : column.getIsPinned() && columnDefType !== 'group'
2021
2064
  ? 2
2022
- : 1 }, getCommonCellStyles({
2065
+ : 1 }, getCommonMRTCellStyles({
2023
2066
  column,
2024
2067
  header,
2025
2068
  table,
2026
2069
  tableCellProps,
2027
2070
  theme,
2028
- })), draggingBorders)), children: [header.isPlaceholder ? null : (jsxs(Box, { className: "Mui-TableHeadCell-Content", sx: {
2029
- alignItems: 'center',
2030
- display: 'flex',
2031
- flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
2032
- justifyContent: columnDefType === 'group' || (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
2033
- ? 'center'
2034
- : column.getCanResize()
2035
- ? 'space-between'
2036
- : 'flex-start',
2037
- position: 'relative',
2038
- width: '100%',
2039
- }, children: [jsxs(Box, { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
2040
- alignItems: 'center',
2041
- cursor: column.getCanSort() && columnDefType !== 'group'
2042
- ? 'pointer'
2043
- : undefined,
2044
- display: 'flex',
2045
- flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
2046
- overflow: columnDefType === 'data' ? 'hidden' : undefined,
2047
- pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
2048
- ? `${headerPL}rem`
2049
- : undefined,
2050
- }, children: [jsx(Box, { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
2051
- '&:hover': {
2052
- textOverflow: 'clip',
2053
- },
2054
- minWidth: `${Math.min((_c = (_b = columnDef.header) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0, 4)}ch`,
2055
- overflow: columnDefType === 'data' ? 'hidden' : undefined,
2056
- textOverflow: 'ellipsis',
2057
- whiteSpace: ((_f = (_d = columnDef.header) === null || _d === void 0 ? void 0 : _d.length) !== null && _f !== void 0 ? _f : 0) < 20 ? 'nowrap' : 'normal',
2058
- }, title: columnDefType === 'data' ? columnDef.header : undefined, children: headerElement }), column.getCanFilter() && (jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsx(MRT_TableHeadCellSortLabel, { header: header, table: table, tableCellProps: tableCellProps }))] }), columnDefType !== 'group' && (jsxs(Box, { className: "Mui-TableHeadCell-Content-Actions", sx: { whiteSpace: 'nowrap' }, children: [showDragHandle && (jsx(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
2059
- current: tableHeadCellRefs.current[column.id],
2060
- } })), showColumnActions && (jsx(MRT_TableHeadCellColumnActionsButton, { header: header, table: table }))] })), column.getCanResize() && (jsx(MRT_TableHeadCellResizeHandle, { header: header, table: table }))] })), columnFilterDisplayMode === 'subheader' && column.getCanFilter() && (jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }))] })));
2061
- };
2062
-
2063
- const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
2071
+ })), draggingBorders)), children: [header.isPlaceholder
2072
+ ? null
2073
+ : (_c = tableCellProps.children) !== null && _c !== void 0 ? _c : (jsxs(Box, { className: "Mui-TableHeadCell-Content", sx: {
2074
+ alignItems: 'center',
2075
+ display: 'flex',
2076
+ flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
2077
+ justifyContent: columnDefType === 'group' ||
2078
+ (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
2079
+ ? 'center'
2080
+ : column.getCanResize()
2081
+ ? 'space-between'
2082
+ : 'flex-start',
2083
+ position: 'relative',
2084
+ width: '100%',
2085
+ }, children: [jsxs(Box, { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
2086
+ alignItems: 'center',
2087
+ cursor: column.getCanSort() && columnDefType !== 'group'
2088
+ ? 'pointer'
2089
+ : undefined,
2090
+ display: 'flex',
2091
+ flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
2092
+ overflow: columnDefType === 'data' ? 'hidden' : undefined,
2093
+ pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
2094
+ ? `${headerPL}rem`
2095
+ : undefined,
2096
+ }, children: [jsx(Box, { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
2097
+ '&:hover': {
2098
+ textOverflow: 'clip',
2099
+ },
2100
+ minWidth: `${Math.min((_f = (_d = columnDef.header) === null || _d === void 0 ? void 0 : _d.length) !== null && _f !== void 0 ? _f : 0, 4)}ch`,
2101
+ overflow: columnDefType === 'data' ? 'hidden' : undefined,
2102
+ textOverflow: 'ellipsis',
2103
+ whiteSpace: ((_h = (_g = columnDef.header) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) < 20
2104
+ ? 'nowrap'
2105
+ : 'normal',
2106
+ }, title: columnDefType === 'data' ? columnDef.header : undefined, children: headerElement }), column.getCanFilter() && (jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsx(MRT_TableHeadCellSortLabel, { header: header, table: table }))] }), columnDefType !== 'group' && (jsxs(Box, { className: "Mui-TableHeadCell-Content-Actions", sx: { whiteSpace: 'nowrap' }, children: [showDragHandle && (jsx(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
2107
+ current: tableHeadCellRefs.current[column.id],
2108
+ } })), showColumnActions && (jsx(MRT_TableHeadCellColumnActionsButton, { header: header, table: table }))] })), column.getCanResize() && (jsx(MRT_TableHeadCellResizeHandle, { header: header, table: table }))] })), columnFilterDisplayMode === 'subheader' && column.getCanFilter() && (jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }))] })));
2109
+ };
2110
+
2111
+ const MRT_TableHeadRow = (_a) => {
2112
+ var { headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["headerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
2064
2113
  const { options: { layoutMode, muiTableHeadRowProps }, } = table;
2065
- const tableRowProps = parseFromValuesOrFunc(muiTableHeadRowProps, {
2114
+ const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadRowProps, {
2066
2115
  headerGroup,
2067
2116
  table,
2068
- });
2069
- return (jsxs(TableRow, Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.05), boxShadow: `4px 0 8px ${alpha(theme.palette.common.black, 0.1)}`, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, top: 0 }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : headerGroup.headers).map((headerOrVirtualHeader) => {
2117
+ })), { rest });
2118
+ return (jsxs(TableRow, Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, boxShadow: `4px 0 8px ${alpha$1(theme.palette.common.black, 0.1)}`, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, top: 0 }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : headerGroup.headers).map((headerOrVirtualHeader) => {
2070
2119
  const header = virtualColumns
2071
2120
  ? headerGroup.headers[headerOrVirtualHeader.index]
2072
2121
  : headerOrVirtualHeader;
@@ -2074,14 +2123,15 @@ const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLe
2074
2123
  }), virtualPaddingRight ? (jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
2075
2124
  };
2076
2125
 
2077
- const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
2126
+ const MRT_LinearProgressBar = (_a) => {
2127
+ var { isTopToolbar, table } = _a, rest = __rest(_a, ["isTopToolbar", "table"]);
2078
2128
  const { getState, options: { muiLinearProgressProps }, } = table;
2079
- const { showProgressBars } = getState();
2080
- const linearProgressProps = parseFromValuesOrFunc(muiLinearProgressProps, {
2129
+ const { isSaving, showProgressBars } = getState();
2130
+ const linearProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiLinearProgressProps, {
2081
2131
  isTopToolbar,
2082
2132
  table,
2083
- });
2084
- return (jsx(Collapse, { in: showProgressBars, mountOnEnter: true, sx: {
2133
+ })), rest);
2134
+ return (jsx(Collapse, { in: showProgressBars !== false && (showProgressBars || isSaving), mountOnEnter: true, sx: {
2085
2135
  bottom: isTopToolbar ? 0 : undefined,
2086
2136
  position: 'absolute',
2087
2137
  top: !isTopToolbar ? 0 : undefined,
@@ -2089,46 +2139,20 @@ const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
2089
2139
  }, unmountOnExit: true, children: jsx(LinearProgress, Object.assign({ "aria-busy": "true", "aria-label": "Loading", sx: { position: 'relative' } }, linearProgressProps)) }));
2090
2140
  };
2091
2141
 
2092
- /******************************************************************************
2093
- Copyright (c) Microsoft Corporation.
2094
-
2095
- Permission to use, copy, modify, and/or distribute this software for any
2096
- purpose with or without fee is hereby granted.
2097
-
2098
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2099
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2100
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2101
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2102
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2103
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2104
- PERFORMANCE OF THIS SOFTWARE.
2105
- ***************************************************************************** */
2106
- function __rest(s, e) {
2107
- var t = {};
2108
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2109
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2110
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2111
- }
2112
- return t;
2113
- }
2114
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
2115
- var e = new Error(message);
2116
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2117
- };
2118
-
2119
2142
  const defaultRowsPerPage = [5, 10, 15, 20, 25, 30, 50, 100];
2120
- const MRT_TablePagination = ({ position = 'bottom', table, }) => {
2143
+ const MRT_TablePagination = (_a) => {
2144
+ var { position = 'bottom', table } = _a, rest = __rest(_a, ["position", "table"]);
2121
2145
  const { getPrePaginationRowModel, getState, options: { enableToolbarInternalActions, icons: { ChevronLeftIcon, ChevronRightIcon, FirstPageIcon, LastPageIcon }, localization, muiPaginationProps, paginationDisplayMode, rowCount, }, setPageIndex, setPageSize, } = table;
2122
2146
  const { pagination: { pageIndex = 0, pageSize = 10 }, showGlobalFilter, } = getState();
2123
- const paginationProps = parseFromValuesOrFunc(muiPaginationProps, {
2147
+ const paginationProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiPaginationProps, {
2124
2148
  table,
2125
- });
2149
+ })), rest);
2126
2150
  const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
2127
2151
  const numberOfPages = Math.ceil(totalRowCount / pageSize);
2128
2152
  const showFirstLastPageButtons = numberOfPages > 2;
2129
2153
  const firstRowIndex = pageIndex * pageSize;
2130
2154
  const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
2131
- const _a = paginationProps !== null && paginationProps !== void 0 ? paginationProps : {}, { rowsPerPageOptions = defaultRowsPerPage, showFirstButton = showFirstLastPageButtons, showLastButton = showFirstLastPageButtons, showRowsPerPage = true } = _a, rest = __rest(_a, ["rowsPerPageOptions", "showFirstButton", "showLastButton", "showRowsPerPage"]);
2155
+ const _b = paginationProps !== null && paginationProps !== void 0 ? paginationProps : {}, { rowsPerPageOptions = defaultRowsPerPage, showFirstButton = showFirstLastPageButtons, showLastButton = showFirstLastPageButtons, showRowsPerPage = true } = _b, _rest = __rest(_b, ["rowsPerPageOptions", "showFirstButton", "showLastButton", "showRowsPerPage"]);
2132
2156
  return (jsxs(Box, { sx: {
2133
2157
  alignItems: 'center',
2134
2158
  display: 'flex',
@@ -2142,7 +2166,7 @@ const MRT_TablePagination = ({ position = 'bottom', table, }) => {
2142
2166
  ? '3rem'
2143
2167
  : undefined,
2144
2168
  position: 'relative',
2145
- px: '4px',
2169
+ px: '8px',
2146
2170
  py: '12px',
2147
2171
  zIndex: 2,
2148
2172
  }, children: [showRowsPerPage && (jsxs(Box, { sx: { alignItems: 'center', display: 'flex', gap: '8px' }, children: [jsx(InputLabel, { htmlFor: "mrt-rows-per-page", sx: { mb: 0 }, children: localization.rowsPerPage }), jsx(Select, { disableUnderline: true, id: "mrt-rows-per-page", inputProps: { 'aria-label': localization.rowsPerPage }, label: localization.rowsPerPage, onChange: (event) => setPageSize(+event.target.value), sx: { mb: 0 }, value: pageSize, variant: "standard", children: rowsPerPageOptions.map((value) => (jsx(MenuItem, { sx: { m: 0 }, value: value, children: value }, value))) })] })), paginationDisplayMode === 'pages' ? (jsx(Pagination, Object.assign({ count: numberOfPages, onChange: (_e, newPageIndex) => setPageIndex(newPageIndex - 1), page: pageIndex + 1, renderItem: (item) => (jsx(PaginationItem, Object.assign({ slots: {
@@ -2150,16 +2174,17 @@ const MRT_TablePagination = ({ position = 'bottom', table, }) => {
2150
2174
  last: LastPageIcon,
2151
2175
  next: ChevronRightIcon,
2152
2176
  previous: ChevronLeftIcon,
2153
- } }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, rest))) : paginationDisplayMode === 'default' ? (jsxs(Fragment, { children: [jsx(Typography, { align: "center", sx: { mb: 0, minWidth: '10ch', mx: '4px' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxs(Box, { gap: "xs", children: [showFirstButton && (jsx(IconButton, { "aria-label": localization.goToFirstPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(0), size: "small", children: jsx(FirstPageIcon, {}) })), jsx(IconButton, { "aria-label": localization.goToPreviousPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(pageIndex - 1), size: "small", children: jsx(ChevronLeftIcon, {}) }), jsx(IconButton, { "aria-label": localization.goToNextPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(pageIndex + 1), size: "small", children: jsx(ChevronRightIcon, {}) }), showLastButton && (jsx(IconButton, { "aria-label": localization.goToLastPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(numberOfPages - 1), size: "small", children: jsx(LastPageIcon, {}) }))] })] })) : null] }));
2177
+ } }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxs(Fragment, { children: [jsx(Typography, { align: "center", sx: { mb: 0, minWidth: '8ch', mx: '4px' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxs(Box, { gap: "xs", children: [showFirstButton && (jsx(IconButton, { "aria-label": localization.goToFirstPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(0), size: "small", children: jsx(FirstPageIcon, {}) })), jsx(IconButton, { "aria-label": localization.goToPreviousPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(pageIndex - 1), size: "small", children: jsx(ChevronLeftIcon, {}) }), jsx(IconButton, { "aria-label": localization.goToNextPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(pageIndex + 1), size: "small", children: jsx(ChevronRightIcon, {}) }), showLastButton && (jsx(IconButton, { "aria-label": localization.goToLastPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(numberOfPages - 1), size: "small", children: jsx(LastPageIcon, {}) }))] })] })) : null] }));
2154
2178
  };
2155
2179
 
2156
- const MRT_GlobalFilterTextField = ({ table, }) => {
2157
- var _a;
2180
+ const MRT_GlobalFilterTextField = (_a) => {
2181
+ var _b;
2182
+ var { table } = _a, rest = __rest(_a, ["table"]);
2158
2183
  const { getState, options: { enableGlobalFilterModes, icons: { CloseIcon, SearchIcon }, localization, manualFiltering, muiSearchTextFieldProps, }, refs: { searchInputRef }, setGlobalFilter, } = table;
2159
2184
  const { globalFilter, showGlobalFilter } = getState();
2160
- const textFieldProps = parseFromValuesOrFunc(muiSearchTextFieldProps, {
2185
+ const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiSearchTextFieldProps, {
2161
2186
  table,
2162
- });
2187
+ })), rest);
2163
2188
  const isMounted = useRef(false);
2164
2189
  const [anchorEl, setAnchorEl] = useState(null);
2165
2190
  const [searchValue, setSearchValue] = useState(globalFilter !== null && globalFilter !== void 0 ? globalFilter : '');
@@ -2189,10 +2214,10 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
2189
2214
  }
2190
2215
  isMounted.current = true;
2191
2216
  }, [globalFilter]);
2192
- return (jsxs(Collapse, { in: showGlobalFilter, mountOnEnter: true, orientation: "horizontal", unmountOnExit: true, children: [jsx(TextField, Object.assign({ InputProps: {
2193
- endAdornment: (jsx(InputAdornment, { position: "end", children: jsx(Tooltip, { arrow: true, title: (_a = localization.clearSearch) !== null && _a !== void 0 ? _a : '', children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small", children: jsx(CloseIcon, {}) }) }) }) })),
2194
- startAdornment: enableGlobalFilterModes ? (jsx(InputAdornment, { position: "start", children: jsx(Tooltip, { arrow: true, title: localization.changeSearchMode, children: jsx(IconButton, { "aria-label": localization.changeSearchMode, onClick: handleGlobalFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsx(SearchIcon, {}) }) }) })) : (jsx(SearchIcon, { style: { marginRight: '4px' } })),
2195
- }, onChange: handleChange, placeholder: localization.search, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard" }, textFieldProps, { inputRef: (inputRef) => {
2217
+ return (jsxs(Collapse, { in: showGlobalFilter, mountOnEnter: true, orientation: "horizontal", unmountOnExit: true, children: [jsx(TextField, Object.assign({ InputProps: Object.assign(Object.assign({ endAdornment: (jsx(InputAdornment, { position: "end", children: jsx(Tooltip, { title: (_b = localization.clearSearch) !== null && _b !== void 0 ? _b : '', children: jsx("span", { children: jsx(IconButton, { "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small", children: jsx(CloseIcon, {}) }) }) }) })), startAdornment: enableGlobalFilterModes ? (jsx(InputAdornment, { position: "start", children: jsx(Tooltip, { title: localization.changeSearchMode, children: jsx(IconButton, { "aria-label": localization.changeSearchMode, onClick: handleGlobalFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsx(SearchIcon, {}) }) }) })) : (jsx(SearchIcon, { style: { marginRight: '4px' } })) }, textFieldProps.InputProps), { sx: (theme) => {
2218
+ var _a;
2219
+ return (Object.assign({ mb: 0 }, parseFromValuesOrFunc((_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.sx, theme)));
2220
+ } }), inputProps: Object.assign({ autoComplete: 'new-password' }, textFieldProps.inputProps), onChange: handleChange, placeholder: localization.search, size: "small", value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "outlined" }, textFieldProps, { inputRef: (inputRef) => {
2196
2221
  searchInputRef.current = inputRef;
2197
2222
  if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
2198
2223
  textFieldProps.inputRef = inputRef;
@@ -2200,13 +2225,14 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
2200
2225
  } })), jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, onSelect: handleClear, setAnchorEl: setAnchorEl, table: table })] }));
2201
2226
  };
2202
2227
 
2203
- const MRT_SelectCheckbox = ({ row, selectAll, table, }) => {
2204
- var _a;
2228
+ const MRT_SelectCheckbox = (_a) => {
2229
+ var _b;
2230
+ var { row, selectAll, table } = _a, rest = __rest(_a, ["row", "selectAll", "table"]);
2205
2231
  const { getState, options: { enableMultiRowSelection, enableRowPinning, localization, muiSelectAllCheckboxProps, muiSelectCheckboxProps, rowPinningDisplayMode, selectAllMode, }, } = table;
2206
2232
  const { density, isLoading } = getState();
2207
- const checkboxProps = !row
2233
+ const checkboxProps = Object.assign(Object.assign({}, (!row
2208
2234
  ? parseFromValuesOrFunc(muiSelectAllCheckboxProps, { table })
2209
- : parseFromValuesOrFunc(muiSelectCheckboxProps, { row, table });
2235
+ : parseFromValuesOrFunc(muiSelectCheckboxProps, { row, table }))), rest);
2210
2236
  const allRowsSelected = selectAll
2211
2237
  ? selectAllMode === 'page'
2212
2238
  ? table.getIsAllPageRowsSelected()
@@ -2240,25 +2266,26 @@ const MRT_SelectCheckbox = ({ row, selectAll, table, }) => {
2240
2266
  e.stopPropagation();
2241
2267
  (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
2242
2268
  }, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.5rem', m: density !== 'compact' ? '-0.4rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.5rem', zIndex: 0 }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))), title: undefined });
2243
- return (jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _a !== void 0 ? _a : (selectAll
2269
+ return (jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : (selectAll
2244
2270
  ? localization.toggleSelectAll
2245
2271
  : localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsx(Radio, Object.assign({}, commonProps))) : (jsx(Checkbox, Object.assign({ indeterminate: selectAll
2246
2272
  ? table.getIsSomeRowsSelected() && !allRowsSelected
2247
2273
  : row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) }));
2248
2274
  };
2249
2275
 
2250
- const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
2251
- var _a, _b, _c;
2276
+ const MRT_ToolbarAlertBanner = (_a) => {
2277
+ var _b, _c, _d;
2278
+ var { stackAlertBanner, table } = _a, rest = __rest(_a, ["stackAlertBanner", "table"]);
2252
2279
  const { getPrePaginationRowModel, getSelectedRowModel, getState, options: { enableRowSelection, enableSelectAll, localization, muiToolbarAlertBannerChipProps, muiToolbarAlertBannerProps, positionToolbarAlertBanner, renderToolbarAlertBannerContent, rowCount, }, refs: { tablePaperRef }, } = table;
2253
2280
  const { density, grouping, showAlertBanner } = getState();
2254
- const alertProps = parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
2281
+ const alertProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
2255
2282
  table,
2256
- });
2283
+ })), rest);
2257
2284
  const chipProps = parseFromValuesOrFunc(muiToolbarAlertBannerChipProps, {
2258
2285
  table,
2259
2286
  });
2260
2287
  const selectedAlert = getSelectedRowModel().rows.length > 0
2261
- ? (_b = (_a = localization.selectedCountOfRowCountRowsSelected) === null || _a === void 0 ? void 0 : _a.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) === null || _b === void 0 ? void 0 : _b.replace('{rowCount}', (rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length).toString())
2288
+ ? (_c = (_b = localization.selectedCountOfRowCountRowsSelected) === null || _b === void 0 ? void 0 : _b.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) === null || _c === void 0 ? void 0 : _c.replace('{rowCount}', (rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length).toString())
2262
2289
  : null;
2263
2290
  const groupedAlert = grouping.length > 0 ? (jsxs("span", { children: [localization.groupedBy, ' ', grouping.map((columnId, index) => (jsxs(Fragment$1, { children: [index > 0 ? localization.thenBy : '', jsx(Chip, Object.assign({ label: table.getColumn(columnId).columnDef.header, onDelete: () => table.getColumn(columnId).toggleGrouping() }, chipProps))] }, `${index}-${columnId}`)))] })) : null;
2264
2291
  return (jsx(Collapse, { in: showAlertBanner || !!selectedAlert || !!groupedAlert, timeout: stackAlertBanner ? 200 : 0, children: jsx(Alert, Object.assign({ color: "info", icon: false }, alertProps, { sx: (theme) => {
@@ -2271,11 +2298,11 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
2271
2298
  : positionToolbarAlertBanner === 'bottom'
2272
2299
  ? '-1rem'
2273
2300
  : undefined, p: 0, position: 'relative', right: 0, top: 0, width: '100%', zIndex: 2 }, parseFromValuesOrFunc(alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx, theme)));
2274
- }, children: (_c = renderToolbarAlertBannerContent === null || renderToolbarAlertBannerContent === void 0 ? void 0 : renderToolbarAlertBannerContent({
2301
+ }, children: (_d = renderToolbarAlertBannerContent === null || renderToolbarAlertBannerContent === void 0 ? void 0 : renderToolbarAlertBannerContent({
2275
2302
  groupedAlert,
2276
2303
  selectedAlert,
2277
2304
  table,
2278
- })) !== null && _c !== void 0 ? _c : (jsxs(Fragment, { children: [(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && jsx(AlertTitle, { children: alertProps.title }), jsxs(Stack, { sx: {
2305
+ })) !== null && _d !== void 0 ? _d : (jsxs(Fragment, { children: [(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && jsx(AlertTitle, { children: alertProps.title }), jsxs(Stack, { sx: {
2279
2306
  p: positionToolbarAlertBanner !== 'head-overlay'
2280
2307
  ? '0.5rem 1rem'
2281
2308
  : density === 'spacious'
@@ -2288,8 +2315,9 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
2288
2315
  positionToolbarAlertBanner === 'head-overlay' && (jsx(MRT_SelectCheckbox, { selectAll: true, table: table })), ' ', selectedAlert] }), selectedAlert && groupedAlert && jsx("br", {}), groupedAlert] })] })) })) }));
2289
2316
  };
2290
2317
 
2291
- const MRT_ToolbarDropZone = ({ table, }) => {
2292
- var _a, _b;
2318
+ const MRT_ToolbarDropZone = (_a) => {
2319
+ var _b, _c;
2320
+ var { table } = _a, rest = __rest(_a, ["table"]);
2293
2321
  const { getState, options: { enableGrouping, localization }, setHoveredColumn, setShowToolbarDropZone, } = table;
2294
2322
  const { draggingColumn, grouping, hoveredColumn, showToolbarDropZone } = getState();
2295
2323
  const handleDragEnter = (_event) => {
@@ -2304,35 +2332,57 @@ const MRT_ToolbarDropZone = ({ table, }) => {
2304
2332
  !grouping.includes(draggingColumn.id));
2305
2333
  }
2306
2334
  }, [enableGrouping, draggingColumn, grouping]);
2307
- return (jsx(Fade, { in: showToolbarDropZone, children: jsx(Box, { className: "Mui-ToolbarDropZone", onDragEnter: handleDragEnter, sx: (theme) => ({
2308
- alignItems: 'center',
2309
- backdropFilter: 'blur(4px)',
2310
- backgroundColor: alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
2311
- border: `dashed ${theme.palette.info.main} 2px`,
2312
- boxSizing: 'border-box',
2313
- display: 'flex',
2314
- height: '100%',
2315
- justifyContent: 'center',
2316
- position: 'absolute',
2317
- width: '100%',
2318
- zIndex: 4,
2319
- }), children: jsx(Typography, { fontStyle: "italic", children: localization.dropToGroupBy.replace('{column}', (_b = (_a = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _a === void 0 ? void 0 : _a.header) !== null && _b !== void 0 ? _b : '') }) }) }));
2335
+ return (jsx(Fade, { in: showToolbarDropZone, children: jsx(Box, Object.assign({ className: "Mui-ToolbarDropZone", onDragEnter: handleDragEnter }, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', backdropFilter: 'blur(4px)', backgroundColor: alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1), border: `dashed ${theme.palette.info.main} 2px`, boxSizing: 'border-box', display: 'flex', height: '100%', justifyContent: 'center', position: 'absolute', width: '100%', zIndex: 4 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsx(Typography, { fontStyle: "italic", children: localization.dropToGroupBy.replace('{column}', (_c = (_b = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _b === void 0 ? void 0 : _b.header) !== null && _c !== void 0 ? _c : '') }) })) }));
2336
+ };
2337
+
2338
+ const MRT_BottomToolbar = (_a) => {
2339
+ var { table } = _a, rest = __rest(_a, ["table"]);
2340
+ const { getState, options: { enablePagination, muiBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions, }, refs: { bottomToolbarRef }, } = table;
2341
+ const { isFullScreen } = getState();
2342
+ const isMobile = useMediaQuery('(max-width:720px)');
2343
+ const toolbarProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiBottomToolbarProps, { table })), rest);
2344
+ const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
2345
+ return (jsxs(Box, Object.assign({}, toolbarProps, { ref: (node) => {
2346
+ if (node) {
2347
+ bottomToolbarRef.current = node;
2348
+ if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
2349
+ // @ts-ignore
2350
+ toolbarProps.ref.current = node;
2351
+ }
2352
+ }
2353
+ }, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${alpha$1(theme.palette.grey[700], 0.5)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [jsx(MRT_LinearProgressBar, { isTopToolbar: false, table: table }), positionToolbarAlertBanner === 'bottom' && (jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsx(MRT_ToolbarDropZone, { table: table })), jsxs(Box, { sx: {
2354
+ alignItems: 'center',
2355
+ boxSizing: 'border-box',
2356
+ display: 'flex',
2357
+ justifyContent: 'space-between',
2358
+ p: '0.5rem',
2359
+ width: '100%',
2360
+ }, children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsx("span", {})), jsx(Box, { sx: {
2361
+ display: 'flex',
2362
+ justifyContent: 'flex-end',
2363
+ position: stackAlertBanner ? 'relative' : 'absolute',
2364
+ right: 0,
2365
+ top: 0,
2366
+ }, children: enablePagination &&
2367
+ ['both', 'bottom'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsx(MRT_TablePagination, { position: "bottom", table: table })) })] })] })));
2320
2368
  };
2321
2369
 
2322
- const MRT_ColumnPinningButtons = ({ column, table, }) => {
2370
+ const MRT_ColumnPinningButtons = (_a) => {
2371
+ var { column, table } = _a, rest = __rest(_a, ["column", "table"]);
2323
2372
  const { options: { icons: { PushPinIcon }, localization, }, } = table;
2324
2373
  const handlePinColumn = (pinDirection) => {
2325
2374
  column.pin(pinDirection);
2326
2375
  };
2327
- return (jsx(Box, { sx: { minWidth: '70px', textAlign: 'center' }, children: column.getIsPinned() ? (jsx(Tooltip, { arrow: true, title: localization.unpin, children: jsx(IconButton, { onClick: () => handlePinColumn(false), size: "small", children: jsx(PushPinIcon, {}) }) })) : (jsxs(Fragment, { children: [jsx(Tooltip, { arrow: true, title: localization.pinToLeft, children: jsx(IconButton, { onClick: () => handlePinColumn('left'), size: "small", children: jsx(PushPinIcon, { style: {
2376
+ return (jsx(Box, Object.assign({}, rest, { sx: (theme) => (Object.assign({ minWidth: '70px', textAlign: 'center' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: column.getIsPinned() ? (jsx(Tooltip, { title: localization.unpin, children: jsx(IconButton, { onClick: () => handlePinColumn(false), size: "small", children: jsx(PushPinIcon, {}) }) })) : (jsxs(Fragment, { children: [jsx(Tooltip, { title: localization.pinToLeft, children: jsx(IconButton, { onClick: () => handlePinColumn('left'), size: "small", children: jsx(PushPinIcon, { style: {
2328
2377
  transform: 'rotate(90deg)',
2329
- } }) }) }), jsx(Tooltip, { arrow: true, title: localization.pinToRight, children: jsx(IconButton, { onClick: () => handlePinColumn('right'), size: "small", children: jsx(PushPinIcon, { style: {
2378
+ } }) }) }), jsx(Tooltip, { title: localization.pinToRight, children: jsx(IconButton, { onClick: () => handlePinColumn('right'), size: "small", children: jsx(PushPinIcon, { style: {
2330
2379
  transform: 'rotate(-90deg)',
2331
- } }) }) })] })) }));
2380
+ } }) }) })] })) })));
2332
2381
  };
2333
2382
 
2334
- const MRT_ShowHideColumnsMenuItems = ({ allColumns, column, hoveredColumn, setHoveredColumn, table, }) => {
2335
- var _a;
2383
+ const MRT_ShowHideColumnsMenuItems = (_a) => {
2384
+ var _b;
2385
+ var { allColumns, column, hoveredColumn, setHoveredColumn, table } = _a, rest = __rest(_a, ["allColumns", "column", "hoveredColumn", "setHoveredColumn", "table"]);
2336
2386
  const { getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, setColumnOrder, } = table;
2337
2387
  const { columnOrder } = getState();
2338
2388
  const { columnDef } = column;
@@ -2369,20 +2419,13 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, column, hoveredColumn, setHo
2369
2419
  setHoveredColumn(column);
2370
2420
  }
2371
2421
  };
2372
- return (jsxs(Fragment, { children: [jsx(MenuItem, { disableRipple: true, onDragEnter: handleDragEnter, ref: menuItemRef, sx: (theme) => ({
2373
- alignItems: 'center',
2374
- justifyContent: 'flex-start',
2375
- my: 0,
2376
- opacity: isDragging ? 0.5 : 1,
2377
- outline: isDragging
2378
- ? `2px dashed ${theme.palette.divider}`
2422
+ if (!columnDef.header)
2423
+ return null;
2424
+ return (jsxs(Fragment, { children: [jsx(MenuItem, Object.assign({ disableRipple: true, onDragEnter: handleDragEnter, ref: menuItemRef }, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', justifyContent: 'flex-start', my: 0, opacity: isDragging ? 0.5 : 1, outline: isDragging
2425
+ ? `2px dashed ${theme.palette.grey[500]}`
2379
2426
  : (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
2380
- ? `2px dashed ${theme.palette.primary.main}`
2381
- : 'none',
2382
- outlineOffset: '-2px',
2383
- pl: `${(column.depth + 0.5) * 2}rem`,
2384
- py: '6px',
2385
- }), children: jsxs(Box, { sx: {
2427
+ ? `2px dashed ${getMRTTheme(table, theme).draggingBorderColor}`
2428
+ : 'none', outlineOffset: '-2px', pl: `${(column.depth + 0.5) * 2}rem`, py: '6px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsxs(Box, { sx: {
2386
2429
  display: 'flex',
2387
2430
  flexWrap: 'nowrap',
2388
2431
  gap: '8px',
@@ -2397,10 +2440,11 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, column, hoveredColumn, setHo
2397
2440
  opacity: columnDefType !== 'display' ? 1 : 0.5,
2398
2441
  },
2399
2442
  },
2400
- }, control: jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.toggleVisibility, children: jsx(Switch, {}) }), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (jsx(Typography, { sx: { alignSelf: 'center' }, children: columnDef.header }))] }) }), (_a = column.columns) === null || _a === void 0 ? void 0 : _a.map((c, i) => (jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
2443
+ }, control: jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, title: localization.toggleVisibility, children: jsx(Switch, {}) }), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (jsx(Typography, { sx: { alignSelf: 'center' }, children: columnDef.header }))] }) })), (_b = column.columns) === null || _b === void 0 ? void 0 : _b.map((c, i) => (jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
2401
2444
  };
2402
2445
 
2403
- const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
2446
+ const MRT_ShowHideColumnsMenu = (_a) => {
2447
+ var { anchorEl, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "setAnchorEl", "table"]);
2404
2448
  const { getAllColumns, getAllLeafColumns, getCenterLeafColumns, getIsAllColumnsVisible, getIsSomeColumnsPinned, getIsSomeColumnsVisible, getLeftLeafColumns, getRightLeafColumns, getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, toggleAllColumnsVisible, } = table;
2405
2449
  const { columnOrder, columnPinning, density } = getState();
2406
2450
  const hideAllColumns = () => {
@@ -2428,14 +2472,14 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
2428
2472
  getRightLeafColumns(),
2429
2473
  ]);
2430
2474
  const [hoveredColumn, setHoveredColumn] = useState(null);
2431
- return (jsxs(Menu, { MenuListProps: {
2475
+ return (jsxs(Menu, Object.assign({ MenuListProps: {
2432
2476
  dense: density === 'compact',
2433
- }, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl, children: [jsxs(Box, { sx: {
2477
+ }, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [jsxs(Box, { sx: {
2434
2478
  display: 'flex',
2435
2479
  justifyContent: 'space-between',
2436
2480
  p: '0.5rem',
2437
2481
  pt: 0,
2438
- }, children: [enableHiding && (jsx(Button, { disabled: !getIsSomeColumnsVisible(), onClick: hideAllColumns, children: localization.hideAll })), enableColumnOrdering && (jsx(Button, { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options)), children: localization.resetOrder })), enableColumnPinning && (jsx(Button, { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true), children: localization.unpinAll })), enableHiding && (jsx(Button, { disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true), children: localization.showAll }))] }), jsx(Divider, {}), allColumns.map((column, index) => (jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${index}-${column.id}`)))] }));
2482
+ }, children: [enableHiding && (jsx(Button, { disabled: !getIsSomeColumnsVisible(), onClick: hideAllColumns, children: localization.hideAll })), enableColumnOrdering && (jsx(Button, { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options)), children: localization.resetOrder })), enableColumnPinning && (jsx(Button, { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true), children: localization.unpinAll })), enableHiding && (jsx(Button, { disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true), children: localization.showAll }))] }), jsx(Divider, {}), allColumns.map((column, index) => (jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${index}-${column.id}`)))] })));
2439
2483
  };
2440
2484
 
2441
2485
  const MRT_ShowHideColumnsButton = (_a) => {
@@ -2446,7 +2490,7 @@ const MRT_ShowHideColumnsButton = (_a) => {
2446
2490
  const handleClick = (event) => {
2447
2491
  setAnchorEl(event.currentTarget);
2448
2492
  };
2449
- return (jsxs(Fragment, { children: [jsx(Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns, children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined, children: jsx(ViewColumnIcon, {}) })) }), anchorEl && (jsx(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))] }));
2493
+ return (jsxs(Fragment, { children: [jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns, children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined, children: jsx(ViewColumnIcon, {}) })) }), anchorEl && (jsx(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))] }));
2450
2494
  };
2451
2495
 
2452
2496
  const MRT_ToggleDensePaddingButton = (_a) => {
@@ -2462,7 +2506,7 @@ const MRT_ToggleDensePaddingButton = (_a) => {
2462
2506
  : 'comfortable';
2463
2507
  setDensity(nextDensity);
2464
2508
  };
2465
- return (jsx(Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity, children: jsx(IconButton, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined, children: density === 'compact' ? (jsx(DensitySmallIcon, {})) : density === 'comfortable' ? (jsx(DensityMediumIcon, {})) : (jsx(DensityLargeIcon, {})) })) }));
2509
+ return (jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity, children: jsx(IconButton, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined, children: density === 'compact' ? (jsx(DensitySmallIcon, {})) : density === 'comfortable' ? (jsx(DensityMediumIcon, {})) : (jsx(DensityLargeIcon, {})) })) }));
2466
2510
  };
2467
2511
 
2468
2512
  const MRT_ToggleFiltersButton = (_a) => {
@@ -2473,7 +2517,7 @@ const MRT_ToggleFiltersButton = (_a) => {
2473
2517
  const handleToggleShowFilters = () => {
2474
2518
  setShowColumnFilters(!showColumnFilters);
2475
2519
  };
2476
- return (jsx(Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters, children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined, children: showColumnFilters ? jsx(FilterListOffIcon, {}) : jsx(FilterListIcon, {}) })) }));
2520
+ return (jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters, children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined, children: showColumnFilters ? jsx(FilterListOffIcon, {}) : jsx(FilterListIcon, {}) })) }));
2477
2521
  };
2478
2522
 
2479
2523
  const MRT_ToggleFullScreenButton = (_a) => {
@@ -2486,7 +2530,7 @@ const MRT_ToggleFullScreenButton = (_a) => {
2486
2530
  setTooltipOpened(false);
2487
2531
  setIsFullScreen(!isFullScreen);
2488
2532
  };
2489
- return (jsx(Tooltip, { arrow: true, open: tooltipOpened, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen, children: jsx(IconButton, Object.assign({ "aria-label": localization.toggleFullScreen, onClick: handleToggleFullScreen, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false) }, rest, { title: undefined, children: isFullScreen ? jsx(FullscreenExitIcon, {}) : jsx(FullscreenIcon, {}) })) }));
2533
+ return (jsx(Tooltip, { open: tooltipOpened, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen, children: jsx(IconButton, Object.assign({ "aria-label": localization.toggleFullScreen, onClick: handleToggleFullScreen, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false) }, rest, { title: undefined, children: isFullScreen ? jsx(FullscreenExitIcon, {}) : jsx(FullscreenIcon, {}) })) }));
2490
2534
  };
2491
2535
 
2492
2536
  const MRT_ToggleGlobalFilterButton = (_a) => {
@@ -2498,37 +2542,22 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
2498
2542
  setShowGlobalFilter(!showGlobalFilter);
2499
2543
  queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
2500
2544
  };
2501
- return (jsx(Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch, children: jsx(IconButton, Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter, onClick: handleToggleSearch }, rest, { title: undefined, children: showGlobalFilter ? jsx(SearchOffIcon, {}) : jsx(SearchIcon, {}) })) }));
2545
+ return (jsx(Tooltip, { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch, children: jsx(IconButton, Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter, onClick: handleToggleSearch }, rest, { title: undefined, children: showGlobalFilter ? jsx(SearchOffIcon, {}) : jsx(SearchIcon, {}) })) }));
2502
2546
  };
2503
2547
 
2504
- const MRT_ToolbarInternalButtons = ({ table, }) => {
2505
- var _a;
2548
+ const MRT_ToolbarInternalButtons = (_a) => {
2549
+ var _b;
2550
+ var { table } = _a, rest = __rest(_a, ["table"]);
2506
2551
  const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions, }, } = table;
2507
- return (jsx(Box, { sx: {
2508
- alignItems: 'center',
2509
- display: 'flex',
2510
- zIndex: 3,
2511
- }, children: (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
2552
+ return (jsx(Box, Object.assign({}, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', display: 'flex', zIndex: 3 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: (_b = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
2512
2553
  table,
2513
- })) !== null && _a !== void 0 ? _a : (jsxs(Fragment, { children: [enableFilters &&
2554
+ })) !== null && _b !== void 0 ? _b : (jsxs(Fragment, { children: [enableFilters &&
2514
2555
  enableGlobalFilter &&
2515
2556
  !(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters &&
2516
2557
  enableColumnFilters &&
2517
- columnFilterDisplayMode !== 'popover' && (jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsx(MRT_ToggleFullScreenButton, { table: table }))] })) }));
2558
+ columnFilterDisplayMode !== 'popover' && (jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsx(MRT_ToggleFullScreenButton, { table: table }))] })) })));
2518
2559
  };
2519
2560
 
2520
- const commonToolbarStyles = ({ theme }) => ({
2521
- alignItems: 'flex-start',
2522
- backgroundColor: lighten(theme.palette.background.default, 0.05),
2523
- backgroundImage: 'none',
2524
- display: 'grid',
2525
- flexWrap: 'wrap-reverse',
2526
- minHeight: '3.5rem',
2527
- overflow: 'hidden',
2528
- p: '0 !important',
2529
- transition: 'all 150ms ease-in-out',
2530
- zIndex: 1,
2531
- });
2532
2561
  const MRT_TopToolbar = ({ table, }) => {
2533
2562
  var _a;
2534
2563
  const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, muiTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions, }, refs: { topToolbarRef }, } = table;
@@ -2536,16 +2565,17 @@ const MRT_TopToolbar = ({ table, }) => {
2536
2565
  const isMobile = useMediaQuery('(max-width:720px)');
2537
2566
  const toolbarProps = parseFromValuesOrFunc(muiTopToolbarProps, { table });
2538
2567
  const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
2539
- return (jsxs(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (ref) => {
2568
+ return (jsxs(Box, Object.assign({}, toolbarProps, { ref: (ref) => {
2540
2569
  topToolbarRef.current = ref;
2541
2570
  if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
2542
2571
  // @ts-ignore
2543
2572
  toolbarProps.ref.current = ref;
2544
2573
  }
2545
- }, sx: (theme) => (Object.assign(Object.assign({ position: isFullScreen ? 'sticky' : undefined, top: isFullScreen ? '0' : undefined }, commonToolbarStyles({ theme })), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [positionToolbarAlertBanner === 'top' && (jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'top'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsx(MRT_ToolbarDropZone, { table: table })), jsxs(Box, { sx: {
2574
+ }, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, theme })), { position: isFullScreen ? 'sticky' : 'relative', top: isFullScreen ? '0' : undefined }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [positionToolbarAlertBanner === 'top' && (jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'top'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsx(MRT_ToolbarDropZone, { table: table })), jsxs(Box, { sx: {
2546
2575
  alignItems: 'flex-start',
2547
2576
  boxSizing: 'border-box',
2548
2577
  display: 'flex',
2578
+ gap: '0.5rem',
2549
2579
  justifyContent: 'space-between',
2550
2580
  p: '0.5rem',
2551
2581
  position: stackAlertBanner ? 'relative' : 'absolute',
@@ -2553,49 +2583,21 @@ const MRT_TopToolbar = ({ table, }) => {
2553
2583
  top: 0,
2554
2584
  width: '100%',
2555
2585
  }, children: [enableGlobalFilter && positionGlobalFilter === 'left' && (jsx(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : jsx("span", {}), enableToolbarInternalActions ? (jsxs(Box, { sx: {
2586
+ alignItems: 'center',
2556
2587
  display: 'flex',
2557
2588
  flexWrap: 'wrap-reverse',
2589
+ gap: '0.5rem',
2558
2590
  justifyContent: 'flex-end',
2559
2591
  }, children: [enableGlobalFilter && positionGlobalFilter === 'right' && (jsx(MRT_GlobalFilterTextField, { table: table })), jsx(MRT_ToolbarInternalButtons, { table: table })] })) : (enableGlobalFilter &&
2560
2592
  positionGlobalFilter === 'right' && (jsx(MRT_GlobalFilterTextField, { table: table })))] }), enablePagination &&
2561
2593
  ['both', 'top'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsx(MRT_TablePagination, { position: "top", table: table })), jsx(MRT_LinearProgressBar, { isTopToolbar: true, table: table })] })));
2562
2594
  };
2563
2595
 
2564
- const MRT_BottomToolbar = ({ table, }) => {
2565
- const { getState, options: { enablePagination, muiBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions, }, refs: { bottomToolbarRef }, } = table;
2566
- const { isFullScreen } = getState();
2567
- const isMobile = useMediaQuery('(max-width:720px)');
2568
- const toolbarProps = parseFromValuesOrFunc(muiBottomToolbarProps, { table });
2569
- const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
2570
- return (jsxs(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (node) => {
2571
- if (node) {
2572
- bottomToolbarRef.current = node;
2573
- if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
2574
- // @ts-ignore
2575
- toolbarProps.ref.current = node;
2576
- }
2577
- }
2578
- }, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, commonToolbarStyles({ theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${alpha(theme.palette.common.black, 0.1)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [jsx(MRT_LinearProgressBar, { isTopToolbar: false, table: table }), positionToolbarAlertBanner === 'bottom' && (jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsx(MRT_ToolbarDropZone, { table: table })), jsxs(Box, { sx: {
2579
- alignItems: 'center',
2580
- boxSizing: 'border-box',
2581
- display: 'flex',
2582
- justifyContent: 'space-between',
2583
- p: '0.5rem',
2584
- width: '100%',
2585
- }, children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsx("span", {})), jsx(Box, { sx: {
2586
- display: 'flex',
2587
- justifyContent: 'flex-end',
2588
- position: stackAlertBanner ? 'relative' : 'absolute',
2589
- right: 0,
2590
- top: 0,
2591
- }, children: enablePagination &&
2592
- ['both', 'bottom'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsx(MRT_TablePagination, { position: "bottom", table: table })) })] })] })));
2593
- };
2594
-
2595
- const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
2596
+ const MRT_TableHead = (_a) => {
2597
+ var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
2596
2598
  const { getHeaderGroups, getSelectedRowModel, getState, options: { enableStickyHeader, layoutMode, muiTableHeadProps, positionToolbarAlertBanner, }, refs: { tableHeadRef }, } = table;
2597
2599
  const { isFullScreen, showAlertBanner } = getState();
2598
- const tableHeadProps = parseFromValuesOrFunc(muiTableHeadProps, { table });
2600
+ const tableHeadProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadProps, { table })), rest);
2599
2601
  const stickyHeader = enableStickyHeader || isFullScreen;
2600
2602
  return (jsx(TableHead, Object.assign({}, tableHeadProps, { ref: (ref) => {
2601
2603
  tableHeadRef.current = ref;
@@ -2607,16 +2609,17 @@ const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddi
2607
2609
  (showAlertBanner || getSelectedRowModel().rows.length > 0) ? (jsx("tr", { style: {
2608
2610
  display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
2609
2611
  }, children: jsx("th", { colSpan: table.getVisibleLeafColumns().length, style: {
2610
- display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : 'table-cell',
2612
+ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
2611
2613
  padding: 0,
2612
2614
  }, children: jsx(MRT_ToolbarAlertBanner, { table: table }) }) })) : (getHeaderGroups().map((headerGroup) => (jsx(MRT_TableHeadRow, { headerGroup: headerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, headerGroup.id)))) })));
2613
2615
  };
2614
2616
 
2615
- const MRT_Table = ({ table, }) => {
2616
- var _a, _b, _c, _d;
2617
- const { getFlatHeaders, getState, options: { columnVirtualizerInstanceRef, columnVirtualizerOptions, columns, enableColumnPinning, enableColumnResizing, enableColumnVirtualization, enableStickyHeader, enableTableFooter, enableTableHead, layoutMode, memoMode, muiTableProps, }, refs: { tableContainerRef }, } = table;
2617
+ const MRT_Table = (_a) => {
2618
+ var _b, _c, _d, _e;
2619
+ var { table } = _a, rest = __rest(_a, ["table"]);
2620
+ const { getFlatHeaders, getState, options: { columnVirtualizerInstanceRef, columnVirtualizerOptions, columns, enableColumnPinning, enableColumnVirtualization, enableStickyHeader, enableTableFooter, enableTableHead, layoutMode, memoMode, muiTableProps, }, refs: { tableContainerRef }, } = table;
2618
2621
  const { columnPinning, columnSizing, columnSizingInfo, columnVisibility, draggingColumn, isFullScreen, } = getState();
2619
- const tableProps = parseFromValuesOrFunc(muiTableProps, { table });
2622
+ const tableProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableProps, { table })), rest);
2620
2623
  const columnVirtualizerProps = parseFromValuesOrFunc(columnVirtualizerOptions, { table });
2621
2624
  const columnSizeVars = useMemo(() => {
2622
2625
  const headers = getFlatHeaders();
@@ -2671,10 +2674,10 @@ const MRT_Table = ({ table, }) => {
2671
2674
  let virtualPaddingLeft;
2672
2675
  let virtualPaddingRight;
2673
2676
  if (columnVirtualizer && (virtualColumns === null || virtualColumns === void 0 ? void 0 : virtualColumns.length)) {
2674
- virtualPaddingLeft = (_b = (_a = virtualColumns[leftPinnedIndexes.length]) === null || _a === void 0 ? void 0 : _a.start) !== null && _b !== void 0 ? _b : 0;
2677
+ virtualPaddingLeft = (_c = (_b = virtualColumns[leftPinnedIndexes.length]) === null || _b === void 0 ? void 0 : _b.start) !== null && _c !== void 0 ? _c : 0;
2675
2678
  virtualPaddingRight =
2676
2679
  columnVirtualizer.getTotalSize() -
2677
- ((_d = (_c = virtualColumns[virtualColumns.length - 1 - rightPinnedIndexes.length]) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : 0);
2680
+ ((_e = (_d = virtualColumns[virtualColumns.length - 1 - rightPinnedIndexes.length]) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : 0);
2678
2681
  }
2679
2682
  const props = {
2680
2683
  table,
@@ -2682,12 +2685,31 @@ const MRT_Table = ({ table, }) => {
2682
2685
  virtualPaddingLeft,
2683
2686
  virtualPaddingRight,
2684
2687
  };
2685
- return (jsx(Fragment, { children: jsxs(Table, Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style), sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, tableLayout: layoutMode === 'semantic' && enableColumnResizing
2686
- ? 'fixed'
2687
- : undefined }, parseFromValuesOrFunc(tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx, theme))), children: [enableTableHead && jsx(MRT_TableHead, Object.assign({}, props)), memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (jsx(Memo_MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))) : (jsx(MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))), enableTableFooter && jsx(MRT_TableFooter, Object.assign({}, props))] })) }));
2688
+ return (jsxs(Table, Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style), sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined }, parseFromValuesOrFunc(tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx, theme))), children: [enableTableHead && jsx(MRT_TableHead, Object.assign({}, props)), memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (jsx(Memo_MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))) : (jsx(MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))), enableTableFooter && jsx(MRT_TableFooter, Object.assign({}, props))] })));
2689
+ };
2690
+
2691
+ const MRT_TableLoadingOverlay = (_a) => {
2692
+ var { table } = _a, rest = __rest(_a, ["table"]);
2693
+ const { options: { localization, muiCircularProgressProps }, } = table;
2694
+ const circularProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCircularProgressProps, { table })), rest);
2695
+ return (jsx(Box, { sx: (theme) => ({
2696
+ alignItems: 'center',
2697
+ backgroundColor: alpha(getMRTTheme(table, theme).baseBackgroundColor, 0.5),
2698
+ bottom: 0,
2699
+ display: 'flex',
2700
+ justifyContent: 'center',
2701
+ left: 0,
2702
+ maxHeight: '100vh',
2703
+ position: 'absolute',
2704
+ right: 0,
2705
+ top: 0,
2706
+ width: '100%',
2707
+ zIndex: 2,
2708
+ }), children: jsx(CircularProgress, Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) }));
2688
2709
  };
2689
2710
 
2690
- const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
2711
+ const MRT_EditActionButtons = (_a) => {
2712
+ var { row, table, variant = 'icon' } = _a, rest = __rest(_a, ["row", "table", "variant"]);
2691
2713
  const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onCreatingRowCancel, onCreatingRowSave, onEditingRowCancel, onEditingRowSave, }, refs: { editInputRefs }, setCreatingRow, setEditingRow, } = table;
2692
2714
  const { creatingRow, editingRow, isSaving } = getState();
2693
2715
  const isCreating = (creatingRow === null || creatingRow === void 0 ? void 0 : creatingRow.id) === row.id;
@@ -2730,16 +2752,17 @@ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
2730
2752
  });
2731
2753
  }
2732
2754
  };
2733
- return (jsx(Box, { onClick: (e) => e.stopPropagation(), sx: { display: 'flex', gap: '0.75rem' }, children: variant === 'icon' ? (jsxs(Fragment, { children: [jsx(Tooltip, { arrow: true, title: localization.cancel, children: jsx(IconButton, { "aria-label": localization.cancel, onClick: handleCancel, children: jsx(CancelIcon, {}) }) }), jsx(Tooltip, { arrow: true, title: localization.save, children: jsx(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSubmitRow, children: isSaving ? jsx(CircularProgress, { size: 18 }) : jsx(SaveIcon, {}) }) })] })) : (jsxs(Fragment, { children: [jsx(Button, { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxs(Button, { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsx(CircularProgress, { color: "inherit", size: 18 }), localization.save] })] })) }));
2755
+ return (jsx(Box, { onClick: (e) => e.stopPropagation(), sx: (theme) => (Object.assign({ display: 'flex', gap: '0.75rem' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: variant === 'icon' ? (jsxs(Fragment, { children: [jsx(Tooltip, { title: localization.cancel, children: jsx(IconButton, { "aria-label": localization.cancel, onClick: handleCancel, children: jsx(CancelIcon, {}) }) }), jsx(Tooltip, { title: localization.save, children: jsx(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSubmitRow, children: isSaving ? jsx(CircularProgress, { size: 18 }) : jsx(SaveIcon, {}) }) })] })) : (jsxs(Fragment, { children: [jsx(Button, { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxs(Button, { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsx(CircularProgress, { color: "inherit", size: 18 }), localization.save] })] })) }));
2734
2756
  };
2735
2757
 
2736
- const MRT_EditRowModal = ({ open, table, }) => {
2737
- var _a;
2738
- const { getState, options: { localization, muiCreateRowModalProps, muiEditRowModalProps, onCreatingRowCancel, onEditingRowCancel, renderCreateRowModalContent, renderEditRowModalContent, }, setCreatingRow, setEditingRow, } = table;
2758
+ const MRT_EditRowModal = (_a) => {
2759
+ var _b;
2760
+ var { open, table } = _a, rest = __rest(_a, ["open", "table"]);
2761
+ const { getState, options: { localization, muiCreateRowModalProps, muiEditRowDialogProps, onCreatingRowCancel, onEditingRowCancel, renderCreateRowDialogContent, renderEditRowDialogContent, }, setCreatingRow, setEditingRow, } = table;
2739
2762
  const { creatingRow, editingRow } = getState();
2740
2763
  const row = (creatingRow !== null && creatingRow !== void 0 ? creatingRow : editingRow);
2741
- const dialogProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditRowModalProps, { row, table })), (creatingRow &&
2742
- parseFromValuesOrFunc(muiCreateRowModalProps, { row, table })));
2764
+ const dialogProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditRowDialogProps, { row, table })), (creatingRow &&
2765
+ parseFromValuesOrFunc(muiCreateRowModalProps, { row, table }))), rest);
2743
2766
  const internalEditComponents = row
2744
2767
  .getAllCells()
2745
2768
  .filter((cell) => cell.column.columnDef.columnDefType === 'data')
@@ -2756,33 +2779,33 @@ const MRT_EditRowModal = ({ open, table, }) => {
2756
2779
  }
2757
2780
  row._valuesCache = {}; //reset values cache
2758
2781
  (_a = dialogProps.onClose) === null || _a === void 0 ? void 0 : _a.call(dialogProps, event, reason);
2759
- }, open: open }, dialogProps, { children: (_a = ((creatingRow &&
2760
- (renderCreateRowModalContent === null || renderCreateRowModalContent === void 0 ? void 0 : renderCreateRowModalContent({
2782
+ }, open: open }, dialogProps, { children: (_b = ((creatingRow &&
2783
+ (renderCreateRowDialogContent === null || renderCreateRowDialogContent === void 0 ? void 0 : renderCreateRowDialogContent({
2761
2784
  internalEditComponents,
2762
2785
  row,
2763
2786
  table,
2764
2787
  }))) ||
2765
- (renderEditRowModalContent === null || renderEditRowModalContent === void 0 ? void 0 : renderEditRowModalContent({
2788
+ (renderEditRowDialogContent === null || renderEditRowDialogContent === void 0 ? void 0 : renderEditRowDialogContent({
2766
2789
  internalEditComponents,
2767
2790
  row,
2768
2791
  table,
2769
- })))) !== null && _a !== void 0 ? _a : (jsxs(Fragment, { children: [jsx(DialogTitle, { sx: { textAlign: 'center' }, children: localization.edit }), jsx(DialogContent, { children: jsx("form", { onSubmit: (e) => e.preventDefault(), children: jsx(Stack, { sx: {
2770
- gap: '24px',
2792
+ })))) !== null && _b !== void 0 ? _b : (jsxs(Fragment, { children: [jsx(DialogTitle, { sx: { textAlign: 'center' }, children: localization.edit }), jsx(DialogContent, { children: jsx("form", { onSubmit: (e) => e.preventDefault(), children: jsx(Stack, { sx: {
2793
+ gap: '32px',
2771
2794
  paddingTop: '16px',
2772
2795
  width: '100%',
2773
2796
  }, children: internalEditComponents }) }) }), jsx(DialogActions, { sx: { p: '1.25rem' }, children: jsx(MRT_EditActionButtons, { row: row, table: table, variant: "text" }) })] })) })));
2774
2797
  };
2775
2798
 
2776
2799
  const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
2777
- const MRT_TableContainer = ({ table, }) => {
2778
- const { getState, options: { createDisplayMode, editDisplayMode, enableStickyHeader, localization, muiCircularProgressProps, muiTableContainerProps, }, refs: { bottomToolbarRef, tableContainerRef, topToolbarRef }, } = table;
2800
+ const MRT_TableContainer = (_a) => {
2801
+ var { table } = _a, rest = __rest(_a, ["table"]);
2802
+ const { getState, options: { createDisplayMode, editDisplayMode, enableStickyHeader, muiTableContainerProps, }, refs: { bottomToolbarRef, tableContainerRef, topToolbarRef }, } = table;
2779
2803
  const { creatingRow, editingRow, isFullScreen, isLoading, showLoadingOverlay, } = getState();
2780
- const loading = (isLoading || showLoadingOverlay) && showLoadingOverlay !== false;
2804
+ const loading = showLoadingOverlay !== false && (isLoading || showLoadingOverlay);
2781
2805
  const [totalToolbarHeight, setTotalToolbarHeight] = useState(0);
2782
- const tableContainerProps = parseFromValuesOrFunc(muiTableContainerProps, {
2806
+ const tableContainerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableContainerProps, {
2783
2807
  table,
2784
- });
2785
- const circularProgressProps = parseFromValuesOrFunc(muiCircularProgressProps, { table });
2808
+ })), rest);
2786
2809
  useIsomorphicLayoutEffect(() => {
2787
2810
  var _a, _b, _c, _d;
2788
2811
  const topToolbarHeight = typeof document !== 'undefined'
@@ -2795,7 +2818,7 @@ const MRT_TableContainer = ({ table, }) => {
2795
2818
  });
2796
2819
  const createModalOpen = createDisplayMode === 'modal' && creatingRow;
2797
2820
  const editModalOpen = editDisplayMode === 'modal' && editingRow;
2798
- return (jsxs(TableContainer, Object.assign({ "aria-busy": loading, "aria-describedby": "mrt-progress" }, tableContainerProps, { ref: (node) => {
2821
+ return (jsxs(TableContainer, Object.assign({ "aria-busy": loading, "aria-describedby": loading ? 'mrt-progress' : undefined }, tableContainerProps, { ref: (node) => {
2799
2822
  if (node) {
2800
2823
  tableContainerRef.current = node;
2801
2824
  if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
@@ -2807,27 +2830,15 @@ const MRT_TableContainer = ({ table, }) => {
2807
2830
  ? `calc(100vh - ${totalToolbarHeight}px)`
2808
2831
  : undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style), sx: (theme) => (Object.assign({ maxHeight: enableStickyHeader
2809
2832
  ? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 9999px)`
2810
- : undefined, maxWidth: '100%', overflow: 'auto', position: 'relative' }, parseFromValuesOrFunc(tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx, theme))), children: [loading ? (jsx(Box, { sx: (theme) => ({
2811
- alignItems: 'center',
2812
- backgroundColor: alpha(lighten(theme.palette.background.paper, 0.05), 0.5),
2813
- bottom: 0,
2814
- display: 'flex',
2815
- justifyContent: 'center',
2816
- left: 0,
2817
- maxHeight: '100vh',
2818
- position: 'absolute',
2819
- right: 0,
2820
- top: 0,
2821
- width: '100%',
2822
- zIndex: 2,
2823
- }), children: jsx(CircularProgress, Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) })) : null, jsx(MRT_Table, { table: table }), (createModalOpen || editModalOpen) && (jsx(MRT_EditRowModal, { open: true, table: table }))] })));
2833
+ : undefined, maxWidth: '100%', overflow: 'auto', position: 'relative' }, parseFromValuesOrFunc(tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx, theme))), children: [loading ? jsx(MRT_TableLoadingOverlay, { table: table }) : null, jsx(MRT_Table, { table: table }), (createModalOpen || editModalOpen) && (jsx(MRT_EditRowModal, { open: true, table: table }))] })));
2824
2834
  };
2825
2835
 
2826
- const MRT_TablePaper = ({ table, }) => {
2827
- var _a, _b;
2836
+ const MRT_TablePaper = (_a) => {
2837
+ var _b, _c;
2838
+ var { table } = _a, rest = __rest(_a, ["table"]);
2828
2839
  const { getState, options: { enableBottomToolbar, enableTopToolbar, muiTablePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table;
2829
2840
  const { isFullScreen } = getState();
2830
- const tablePaperProps = parseFromValuesOrFunc(muiTablePaperProps, { table });
2841
+ const tablePaperProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTablePaperProps, { table })), rest);
2831
2842
  return (jsxs(Paper, Object.assign({ elevation: 2 }, tablePaperProps, { ref: (ref) => {
2832
2843
  tablePaperRef.current = ref;
2833
2844
  if (tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.ref) {
@@ -2847,14 +2858,15 @@ const MRT_TablePaper = ({ table, }) => {
2847
2858
  right: 0,
2848
2859
  top: 0,
2849
2860
  width: '100vw',
2850
- zIndex: 9999,
2861
+ zIndex: 999,
2851
2862
  }
2852
- : {})), tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.style), sx: (theme) => (Object.assign({ overflow: 'hidden', transition: 'all 100ms ease-in-out' }, parseFromValuesOrFunc(tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.sx, theme))), children: [enableTopToolbar &&
2853
- ((_a = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _a !== void 0 ? _a : (jsx(MRT_TopToolbar, { table: table }))), jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
2854
- ((_b = parseFromValuesOrFunc(renderBottomToolbar, { table })) !== null && _b !== void 0 ? _b : (jsx(MRT_BottomToolbar, { table: table })))] })));
2863
+ : {})), tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.style), sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, backgroundImage: 'unset', overflow: 'hidden', transition: 'all 100ms ease-in-out' }, parseFromValuesOrFunc(tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.sx, theme))), children: [enableTopToolbar &&
2864
+ ((_b = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _b !== void 0 ? _b : (jsx(MRT_TopToolbar, { table: table }))), jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
2865
+ ((_c = parseFromValuesOrFunc(renderBottomToolbar, { table })) !== null && _c !== void 0 ? _c : (jsx(MRT_BottomToolbar, { table: table })))] })));
2855
2866
  };
2856
2867
 
2857
- const MRT_RowPinButton = ({ pinningPosition, row, table, }) => {
2868
+ const MRT_RowPinButton = (_a) => {
2869
+ var { pinningPosition, row, table } = _a, rest = __rest(_a, ["pinningPosition", "row", "table"]);
2858
2870
  const { options: { icons: { CloseIcon, PushPinIcon }, localization, rowPinningDisplayMode, }, } = table;
2859
2871
  const isPinned = row.getIsPinned();
2860
2872
  const [tooltipOpened, setTooltipOpened] = useState(false);
@@ -2863,44 +2875,43 @@ const MRT_RowPinButton = ({ pinningPosition, row, table, }) => {
2863
2875
  event.stopPropagation();
2864
2876
  row.pin(isPinned ? false : pinningPosition);
2865
2877
  };
2866
- return (jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, open: tooltipOpened, title: isPinned ? localization.unpin : localization.pin, children: jsx(IconButton, { "aria-label": localization.pin, onClick: handleTogglePin, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false), size: "small", sx: {
2867
- height: '24px',
2868
- width: '24px',
2869
- }, children: isPinned ? (jsx(CloseIcon, {})) : (jsx(PushPinIcon, { fontSize: "small", style: {
2878
+ return (jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, open: tooltipOpened, title: isPinned ? localization.unpin : localization.pin, children: jsx(IconButton, Object.assign({ "aria-label": localization.pin, onClick: handleTogglePin, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false), size: "small" }, rest, { sx: (theme) => (Object.assign({ height: '24px', width: '24px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: isPinned ? (jsx(CloseIcon, {})) : (jsx(PushPinIcon, { fontSize: "small", style: {
2870
2879
  transform: `rotate(${rowPinningDisplayMode === 'sticky'
2871
2880
  ? 135
2872
2881
  : pinningPosition === 'top'
2873
2882
  ? 180
2874
2883
  : 0}deg)`,
2875
- } })) }) }));
2884
+ } })) })) }));
2876
2885
  };
2877
2886
 
2878
- const MRT_TableBodyRowPinButton = ({ row, table, }) => {
2887
+ const MRT_TableBodyRowPinButton = (_a) => {
2888
+ var { row, table } = _a, rest = __rest(_a, ["row", "table"]);
2879
2889
  const { getState, options: { enableRowPinning, rowPinningDisplayMode }, } = table;
2880
2890
  const { density } = getState();
2881
2891
  const canPin = parseFromValuesOrFunc(enableRowPinning, row);
2882
2892
  if (!canPin)
2883
2893
  return null;
2894
+ const rowPinButtonProps = Object.assign({ row,
2895
+ table }, rest);
2884
2896
  if (rowPinningDisplayMode === 'top-and-bottom' && !row.getIsPinned()) {
2885
2897
  return (jsxs(Box, { sx: {
2886
2898
  display: 'flex',
2887
2899
  flexDirection: density === 'compact' ? 'row' : 'column',
2888
- }, children: [jsx(MRT_RowPinButton, { pinningPosition: "top", row: row, table: table }), jsx(MRT_RowPinButton, { pinningPosition: "bottom", row: row, table: table })] }));
2900
+ }, children: [jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "top" }, rowPinButtonProps)), jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "bottom" }, rowPinButtonProps))] }));
2889
2901
  }
2890
- return (jsx(MRT_RowPinButton, { pinningPosition: rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top', row: row, table: table }));
2902
+ return (jsx(MRT_RowPinButton, Object.assign({ pinningPosition: rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top' }, rowPinButtonProps)));
2891
2903
  };
2892
2904
 
2893
- const MRT_ExpandAllButton = ({ table, }) => {
2894
- var _a, _b;
2905
+ const MRT_ExpandAllButton = (_a) => {
2906
+ var _b, _c;
2907
+ var { table } = _a, rest = __rest(_a, ["table"]);
2895
2908
  const { getCanSomeRowsExpand, getIsAllRowsExpanded, getIsSomeRowsExpanded, getState, options: { icons: { KeyboardDoubleArrowDownIcon }, localization, muiExpandAllButtonProps, renderDetailPanel, }, toggleAllRowsExpanded, } = table;
2896
2909
  const { density, isLoading } = getState();
2897
- const iconButtonProps = parseFromValuesOrFunc(muiExpandAllButtonProps, {
2910
+ const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiExpandAllButtonProps, {
2898
2911
  table,
2899
- });
2912
+ })), rest);
2900
2913
  const isAllRowsExpanded = getIsAllRowsExpanded();
2901
- return (jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: ((_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : isAllRowsExpanded)
2902
- ? localization.collapseAll
2903
- : localization.expandAll, children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!isAllRowsExpanded) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsx(KeyboardDoubleArrowDownIcon, { style: {
2914
+ return (jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : (isAllRowsExpanded ? localization.collapseAll : localization.expandAll), children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!isAllRowsExpanded) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_c = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _c !== void 0 ? _c : (jsx(KeyboardDoubleArrowDownIcon, { style: {
2904
2915
  transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
2905
2916
  transition: 'transform 150ms',
2906
2917
  } })) })) }) }));
@@ -2922,24 +2933,23 @@ const MRT_ExpandButton = ({ row, table, }) => {
2922
2933
  row.toggleExpanded();
2923
2934
  (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
2924
2935
  };
2925
- return (jsx(Tooltip, { arrow: true, disableHoverListener: !canExpand && !renderDetailPanel, enterDelay: 1000, enterNextDelay: 1000, title: ((_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : isExpanded)
2926
- ? localization.collapse
2927
- : localization.expand, children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expand, disabled: !canExpand && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', opacity: !canExpand && !renderDetailPanel ? 0.3 : 1, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsx(ExpandMoreIcon, { style: {
2936
+ return (jsx(Tooltip, { disableHoverListener: !canExpand && !renderDetailPanel, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : (isExpanded ? localization.collapse : localization.expand), children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expand, disabled: !canExpand && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', opacity: !canExpand && !renderDetailPanel ? 0.3 : 1, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsx(ExpandMoreIcon, { style: {
2928
2937
  transform: `rotate(${!canExpand && !renderDetailPanel ? -90 : isExpanded ? -180 : 0}deg)`,
2929
2938
  transition: 'transform 150ms',
2930
2939
  } })) })) }) }));
2931
2940
  };
2932
2941
 
2933
- const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) => {
2942
+ const MRT_RowActionMenu = (_a) => {
2943
+ var { anchorEl, handleEdit, row, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "handleEdit", "row", "setAnchorEl", "table"]);
2934
2944
  const { getState, options: { enableEditing, icons: { EditIcon }, localization, renderRowActionMenuItems, }, } = table;
2935
2945
  const { density } = getState();
2936
- return (jsxs(Menu, { MenuListProps: {
2946
+ return (jsxs(Menu, Object.assign({ MenuListProps: {
2937
2947
  dense: density === 'compact',
2938
- }, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl, children: [parseFromValuesOrFunc(enableEditing, row) && (jsx(MenuItem, { onClick: handleEdit, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(EditIcon, {}) }), localization.edit] }) })), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 : renderRowActionMenuItems({
2948
+ }, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [parseFromValuesOrFunc(enableEditing, row) && (jsx(MenuItem, { onClick: handleEdit, sx: commonMenuItemStyles, children: jsxs(Box, { sx: commonListItemStyles, children: [jsx(ListItemIcon, { children: jsx(EditIcon, {}) }), localization.edit] }) })), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 : renderRowActionMenuItems({
2939
2949
  closeMenu: () => setAnchorEl(null),
2940
2950
  row,
2941
2951
  table,
2942
- })] }));
2952
+ })] })));
2943
2953
  };
2944
2954
 
2945
2955
  const commonIconButtonStyles = {
@@ -2952,7 +2962,8 @@ const commonIconButtonStyles = {
2952
2962
  transition: 'opacity 150ms',
2953
2963
  width: '2rem',
2954
2964
  };
2955
- const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
2965
+ const MRT_ToggleRowActionMenuButton = (_a) => {
2966
+ var { cell, row, table } = _a, rest = __rest(_a, ["cell", "row", "table"]);
2956
2967
  const { getState, options: { createDisplayMode, editDisplayMode, enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
2957
2968
  const { creatingRow, editingRow } = getState();
2958
2969
  const isCreating = (creatingRow === null || creatingRow === void 0 ? void 0 : creatingRow.id) === row.id;
@@ -2971,317 +2982,11 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
2971
2982
  setAnchorEl(null);
2972
2983
  };
2973
2984
  return (jsx(Fragment, { children: renderRowActions && !showEditActionButtons ? (renderRowActions({ cell, row, table })) : showEditActionButtons ? (jsx(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems &&
2974
- parseFromValuesOrFunc(enableEditing, row) ? (jsx(Tooltip, { arrow: true, placement: "right", title: localization.edit, children: jsx(IconButton, { "aria-label": localization.edit, onClick: handleStartEditMode, sx: commonIconButtonStyles, children: jsx(EditIcon, {}) }) })) : renderRowActionMenuItems ? (jsxs(Fragment, { children: [jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions, children: jsx(IconButton, { "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles, children: jsx(MoreHorizIcon, {}) }) }), jsx(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table })] })) : null }));
2985
+ parseFromValuesOrFunc(enableEditing, row) &&
2986
+ ['modal', 'row'].includes(editDisplayMode) ? (jsx(Tooltip, { placement: "right", title: localization.edit, children: jsx(IconButton, Object.assign({ "aria-label": localization.edit, onClick: handleStartEditMode, sx: commonIconButtonStyles }, rest, { children: jsx(EditIcon, {}) })) })) : renderRowActionMenuItems ? (jsxs(Fragment, { children: [jsx(Tooltip, { enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions, children: jsx(IconButton, Object.assign({ "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles }, rest, { children: jsx(MoreHorizIcon, {}) })) }), jsx(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table })] })) : null }));
2975
2987
  };
2976
2988
 
2977
- const blankColProps = {
2978
- sx: {
2979
- flex: '1 0 auto',
2980
- minWidth: 0,
2981
- p: 0,
2982
- width: 0,
2983
- },
2984
- };
2985
- const useMRT_DisplayColumns = ({ columnOrder, creatingRow, grouping, tableOptions, }) => {
2986
- var _a, _b;
2987
- return useMemo(() => {
2988
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
2989
- return [
2990
- ((_b = (_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.columnOrder) !== null && _b !== void 0 ? _b : columnOrder).includes('mrt-row-pin') && Object.assign(Object.assign(Object.assign({ Cell: ({ row, table }) => (jsx(MRT_TableBodyRowPinButton, { row: row, table: table })), header: tableOptions.localization.pin, size: 60 }, tableOptions.defaultDisplayColumn), (_c = tableOptions.displayColumnDefOptions) === null || _c === void 0 ? void 0 : _c['mrt-row-pin']), { id: 'mrt-row-pin' }),
2991
- ((_e = (_d = tableOptions.state) === null || _d === void 0 ? void 0 : _d.columnOrder) !== null && _e !== void 0 ? _e : columnOrder).includes('mrt-row-drag') && Object.assign(Object.assign(Object.assign({ Cell: ({ row, rowRef, table }) => (jsx(MRT_TableBodyRowGrabHandle, { row: row, rowRef: rowRef, table: table })), header: tableOptions.localization.move, size: 60 }, tableOptions.defaultDisplayColumn), (_f = tableOptions.displayColumnDefOptions) === null || _f === void 0 ? void 0 : _f['mrt-row-drag']), { id: 'mrt-row-drag' }),
2992
- (((_h = (_g = tableOptions.state) === null || _g === void 0 ? void 0 : _g.columnOrder) !== null && _h !== void 0 ? _h : columnOrder).includes('mrt-row-actions') ||
2993
- (creatingRow && tableOptions.createDisplayMode === 'row')) && Object.assign(Object.assign(Object.assign({ Cell: ({ cell, row, table }) => (jsx(MRT_ToggleRowActionMenuButton, { cell: cell, row: row, table: table })), header: tableOptions.localization.actions, size: 70 }, tableOptions.defaultDisplayColumn), (_j = tableOptions.displayColumnDefOptions) === null || _j === void 0 ? void 0 : _j['mrt-row-actions']), { id: 'mrt-row-actions' }),
2994
- ((_l = (_k = tableOptions.state) === null || _k === void 0 ? void 0 : _k.columnOrder) !== null && _l !== void 0 ? _l : columnOrder).includes('mrt-row-expand') &&
2995
- showExpandColumn(tableOptions, (_o = (_m = tableOptions.state) === null || _m === void 0 ? void 0 : _m.grouping) !== null && _o !== void 0 ? _o : grouping) && Object.assign(Object.assign(Object.assign({ Cell: ({ row, table }) => (jsx(MRT_ExpandButton, { row: row, table: table })), Header: tableOptions.enableExpandAll
2996
- ? ({ table }) => jsx(MRT_ExpandAllButton, { table: table })
2997
- : null, header: tableOptions.localization.expand, size: 60 }, tableOptions.defaultDisplayColumn), (_p = tableOptions.displayColumnDefOptions) === null || _p === void 0 ? void 0 : _p['mrt-row-expand']), { id: 'mrt-row-expand' }),
2998
- ((_r = (_q = tableOptions.state) === null || _q === void 0 ? void 0 : _q.columnOrder) !== null && _r !== void 0 ? _r : columnOrder).includes('mrt-row-select') && Object.assign(Object.assign(Object.assign({ Cell: ({ row, table }) => (jsx(MRT_SelectCheckbox, { row: row, table: table })), Header: tableOptions.enableSelectAll &&
2999
- tableOptions.enableMultiRowSelection
3000
- ? ({ table }) => jsx(MRT_SelectCheckbox, { selectAll: true, table: table })
3001
- : null, header: tableOptions.localization.select, size: 60 }, tableOptions.defaultDisplayColumn), (_s = tableOptions.displayColumnDefOptions) === null || _s === void 0 ? void 0 : _s['mrt-row-select']), { id: 'mrt-row-select' }),
3002
- ((_u = (_t = tableOptions.state) === null || _t === void 0 ? void 0 : _t.columnOrder) !== null && _u !== void 0 ? _u : columnOrder).includes('mrt-row-numbers') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => row.index + 1, Header: () => tableOptions.localization.rowNumber, header: tableOptions.localization.rowNumbers, size: 60 }, tableOptions.defaultDisplayColumn), (_v = tableOptions.displayColumnDefOptions) === null || _v === void 0 ? void 0 : _v['mrt-row-numbers']), { id: 'mrt-row-numbers' }),
3003
- ((_x = (_w = tableOptions.state) === null || _w === void 0 ? void 0 : _w.columnOrder) !== null && _x !== void 0 ? _x : columnOrder).includes('mrt-row-spacer') && {
3004
- columnDefType: 'display',
3005
- header: '',
3006
- id: 'spacer',
3007
- muiTableBodyCellProps: blankColProps,
3008
- muiTableFooterCellProps: blankColProps,
3009
- muiTableHeadCellProps: blankColProps,
3010
- },
3011
- ].filter(Boolean);
3012
- }, [
3013
- columnOrder,
3014
- grouping,
3015
- tableOptions.displayColumnDefOptions,
3016
- tableOptions.editDisplayMode,
3017
- tableOptions.enableColumnDragging,
3018
- tableOptions.enableColumnFilterModes,
3019
- tableOptions.enableColumnOrdering,
3020
- tableOptions.enableEditing,
3021
- tableOptions.enableExpandAll,
3022
- tableOptions.enableExpanding,
3023
- tableOptions.enableGrouping,
3024
- tableOptions.enableRowActions,
3025
- tableOptions.enableRowDragging,
3026
- tableOptions.enableRowNumbers,
3027
- tableOptions.enableRowOrdering,
3028
- tableOptions.enableRowSelection,
3029
- tableOptions.enableSelectAll,
3030
- tableOptions.localization,
3031
- tableOptions.positionActionsColumn,
3032
- tableOptions.renderDetailPanel,
3033
- tableOptions.renderRowActionMenuItems,
3034
- tableOptions.renderRowActions,
3035
- (_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.columnOrder,
3036
- (_b = tableOptions.state) === null || _b === void 0 ? void 0 : _b.grouping,
3037
- ]);
3038
- };
3039
-
3040
- const useMRT_Effects = (table) => {
3041
- const { getIsSomeRowsPinned, getState, options: { enablePagination, enableRowPinning, rowCount }, } = table;
3042
- const { density, globalFilter, isFullScreen, isLoading, pagination, showSkeletons, sorting, } = getState();
3043
- const rerender = useReducer(() => ({}), {})[1];
3044
- const isMounted = useRef(false);
3045
- const initialBodyHeight = useRef();
3046
- const previousTop = useRef();
3047
- useEffect(() => {
3048
- if (typeof window !== 'undefined') {
3049
- initialBodyHeight.current = document.body.style.height;
3050
- }
3051
- }, []);
3052
- useEffect(() => {
3053
- if (isMounted && typeof window !== 'undefined') {
3054
- if (isFullScreen) {
3055
- previousTop.current = document.body.getBoundingClientRect().top; //save scroll position
3056
- document.body.style.height = '100vh'; //hide page scrollbars when table is in full screen mode
3057
- }
3058
- else {
3059
- document.body.style.height = initialBodyHeight.current;
3060
- if (!previousTop.current)
3061
- return;
3062
- //restore scroll position
3063
- window.scrollTo({
3064
- behavior: 'instant',
3065
- top: -1 * previousTop.current,
3066
- });
3067
- }
3068
- }
3069
- isMounted.current = true;
3070
- }, [isFullScreen]);
3071
- //if page index is out of bounds, set it to the last page
3072
- useEffect(() => {
3073
- if (!enablePagination || isLoading || showSkeletons)
3074
- return;
3075
- const { pageIndex, pageSize } = pagination;
3076
- const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : table.getPrePaginationRowModel().rows.length;
3077
- const firstVisibleRowIndex = pageIndex * pageSize;
3078
- if (firstVisibleRowIndex > totalRowCount) {
3079
- table.setPageIndex(Math.floor(totalRowCount / pageSize));
3080
- }
3081
- }, [rowCount, table.getPrePaginationRowModel().rows.length]);
3082
- //turn off sort when global filter is looking for ranked results
3083
- const appliedSort = useRef(sorting);
3084
- useEffect(() => {
3085
- if (sorting.length) {
3086
- appliedSort.current = sorting;
3087
- }
3088
- }, [sorting]);
3089
- useEffect(() => {
3090
- if (!getCanRankRows(table))
3091
- return;
3092
- if (globalFilter) {
3093
- table.setSorting([]);
3094
- }
3095
- else {
3096
- table.setSorting(() => appliedSort.current || []);
3097
- }
3098
- }, [globalFilter]);
3099
- useEffect(() => {
3100
- if (enableRowPinning && getIsSomeRowsPinned()) {
3101
- setTimeout(() => {
3102
- rerender();
3103
- }, 150);
3104
- }
3105
- }, [density]);
3106
- };
3107
-
3108
- const useMRT_TableInstance = (tableOptions) => {
3109
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
3110
- const bottomToolbarRef = useRef(null);
3111
- const editInputRefs = useRef({});
3112
- const filterInputRefs = useRef({});
3113
- const searchInputRef = useRef(null);
3114
- const tableContainerRef = useRef(null);
3115
- const tableHeadCellRefs = useRef({});
3116
- const tablePaperRef = useRef(null);
3117
- const topToolbarRef = useRef(null);
3118
- const tableHeadRef = useRef(null);
3119
- const tableFooterRef = useRef(null);
3120
- const initialState = useMemo(() => {
3121
- var _a, _b, _c;
3122
- const initState = (_a = tableOptions.initialState) !== null && _a !== void 0 ? _a : {};
3123
- initState.columnOrder =
3124
- (_b = initState.columnOrder) !== null && _b !== void 0 ? _b : getDefaultColumnOrderIds(tableOptions);
3125
- initState.globalFilterFn = (_c = tableOptions.globalFilterFn) !== null && _c !== void 0 ? _c : 'fuzzy';
3126
- return initState;
3127
- }, []);
3128
- const [creatingRow, _setCreatingRow] = useState((_a = initialState.creatingRow) !== null && _a !== void 0 ? _a : null);
3129
- const [columnFilterFns, setColumnFilterFns] = useState(() => Object.assign({}, ...getAllLeafColumnDefs(tableOptions.columns).map((col) => {
3130
- var _a, _b, _c, _d;
3131
- return ({
3132
- [getColumnId(col)]: col.filterFn instanceof Function
3133
- ? (_a = col.filterFn.name) !== null && _a !== void 0 ? _a : 'custom'
3134
- : (_d = (_b = col.filterFn) !== null && _b !== void 0 ? _b : (_c = initialState === null || initialState === void 0 ? void 0 : initialState.columnFilterFns) === null || _c === void 0 ? void 0 : _c[getColumnId(col)]) !== null && _d !== void 0 ? _d : getDefaultColumnFilterFn(col),
3135
- });
3136
- })));
3137
- const [columnOrder, setColumnOrder] = useState((_b = initialState.columnOrder) !== null && _b !== void 0 ? _b : []);
3138
- const [density, setDensity] = useState((_c = initialState === null || initialState === void 0 ? void 0 : initialState.density) !== null && _c !== void 0 ? _c : 'comfortable');
3139
- const [draggingColumn, setDraggingColumn] = useState((_d = initialState.draggingColumn) !== null && _d !== void 0 ? _d : null);
3140
- const [draggingRow, setDraggingRow] = useState((_e = initialState.draggingRow) !== null && _e !== void 0 ? _e : null);
3141
- const [editingCell, setEditingCell] = useState((_f = initialState.editingCell) !== null && _f !== void 0 ? _f : null);
3142
- const [editingRow, setEditingRow] = useState((_g = initialState.editingRow) !== null && _g !== void 0 ? _g : null);
3143
- const [globalFilterFn, setGlobalFilterFn] = useState((_h = initialState.globalFilterFn) !== null && _h !== void 0 ? _h : 'fuzzy');
3144
- const [grouping, setGrouping] = useState((_j = initialState.grouping) !== null && _j !== void 0 ? _j : []);
3145
- const [hoveredColumn, setHoveredColumn] = useState((_k = initialState.hoveredColumn) !== null && _k !== void 0 ? _k : null);
3146
- const [hoveredRow, setHoveredRow] = useState((_l = initialState.hoveredRow) !== null && _l !== void 0 ? _l : null);
3147
- const [isFullScreen, setIsFullScreen] = useState((_m = initialState === null || initialState === void 0 ? void 0 : initialState.isFullScreen) !== null && _m !== void 0 ? _m : false);
3148
- const [showAlertBanner, setShowAlertBanner] = useState((_p = (_o = tableOptions.initialState) === null || _o === void 0 ? void 0 : _o.showAlertBanner) !== null && _p !== void 0 ? _p : false);
3149
- const [showColumnFilters, setShowColumnFilters] = useState((_q = initialState === null || initialState === void 0 ? void 0 : initialState.showColumnFilters) !== null && _q !== void 0 ? _q : false);
3150
- const [showGlobalFilter, setShowGlobalFilter] = useState((_r = initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) !== null && _r !== void 0 ? _r : false);
3151
- const [showToolbarDropZone, setShowToolbarDropZone] = useState((_s = initialState === null || initialState === void 0 ? void 0 : initialState.showToolbarDropZone) !== null && _s !== void 0 ? _s : false);
3152
- const displayColumns = useMRT_DisplayColumns({
3153
- columnOrder,
3154
- creatingRow,
3155
- grouping,
3156
- tableOptions,
3157
- });
3158
- const columnDefs = useMemo(() => {
3159
- var _a, _b, _c;
3160
- return prepareColumns({
3161
- aggregationFns: tableOptions.aggregationFns,
3162
- columnDefs: [...displayColumns, ...tableOptions.columns],
3163
- columnFilterFns: (_b = (_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.columnFilterFns) !== null && _b !== void 0 ? _b : columnFilterFns,
3164
- defaultDisplayColumn: (_c = tableOptions.defaultDisplayColumn) !== null && _c !== void 0 ? _c : {},
3165
- filterFns: tableOptions.filterFns,
3166
- sortingFns: tableOptions.sortingFns,
3167
- });
3168
- }, [
3169
- columnFilterFns,
3170
- displayColumns,
3171
- tableOptions.columns,
3172
- (_t = tableOptions.state) === null || _t === void 0 ? void 0 : _t.columnFilterFns,
3173
- ]);
3174
- const data = useMemo(() => {
3175
- var _a, _b, _c, _d, _e;
3176
- return (((_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.isLoading) || ((_b = tableOptions.state) === null || _b === void 0 ? void 0 : _b.showSkeletons)) &&
3177
- !tableOptions.data.length
3178
- ? [
3179
- ...Array(((_d = (_c = tableOptions.state) === null || _c === void 0 ? void 0 : _c.pagination) === null || _d === void 0 ? void 0 : _d.pageSize) ||
3180
- ((_e = initialState === null || initialState === void 0 ? void 0 : initialState.pagination) === null || _e === void 0 ? void 0 : _e.pageSize) ||
3181
- 10).fill(null),
3182
- ].map(() => Object.assign({}, ...getAllLeafColumnDefs(tableOptions.columns).map((col) => ({
3183
- [getColumnId(col)]: null,
3184
- }))))
3185
- : tableOptions.data;
3186
- }, [
3187
- tableOptions.data,
3188
- (_u = tableOptions.state) === null || _u === void 0 ? void 0 : _u.isLoading,
3189
- (_v = tableOptions.state) === null || _v === void 0 ? void 0 : _v.showSkeletons,
3190
- ]);
3191
- //@ts-ignore
3192
- const table = useReactTable(Object.assign(Object.assign({ getCoreRowModel: getCoreRowModel(), getExpandedRowModel: tableOptions.enableExpanding || tableOptions.enableGrouping
3193
- ? getExpandedRowModel()
3194
- : undefined, getFacetedMinMaxValues: tableOptions.enableFacetedValues
3195
- ? getFacetedMinMaxValues()
3196
- : undefined, getFacetedRowModel: tableOptions.enableFacetedValues
3197
- ? getFacetedRowModel()
3198
- : undefined, getFacetedUniqueValues: tableOptions.enableFacetedValues
3199
- ? getFacetedUniqueValues()
3200
- : undefined, getFilteredRowModel: tableOptions.enableColumnFilters ||
3201
- tableOptions.enableGlobalFilter ||
3202
- tableOptions.enableFilters
3203
- ? getFilteredRowModel()
3204
- : undefined, getGroupedRowModel: tableOptions.enableGrouping
3205
- ? getGroupedRowModel()
3206
- : undefined, getPaginationRowModel: tableOptions.enablePagination
3207
- ? getPaginationRowModel()
3208
- : undefined, getSortedRowModel: tableOptions.enableSorting
3209
- ? getSortedRowModel()
3210
- : undefined, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows, onColumnOrderChange: setColumnOrder, onGroupingChange: setGrouping }, tableOptions), {
3211
- //@ts-ignore
3212
- columns: columnDefs, data, globalFilterFn: (_w = tableOptions.filterFns) === null || _w === void 0 ? void 0 : _w[globalFilterFn !== null && globalFilterFn !== void 0 ? globalFilterFn : 'fuzzy'], initialState, state: Object.assign({ columnFilterFns,
3213
- columnOrder,
3214
- creatingRow,
3215
- density,
3216
- draggingColumn,
3217
- draggingRow,
3218
- editingCell,
3219
- editingRow,
3220
- globalFilterFn,
3221
- grouping,
3222
- hoveredColumn,
3223
- hoveredRow,
3224
- isFullScreen,
3225
- showAlertBanner,
3226
- showColumnFilters,
3227
- showGlobalFilter,
3228
- showToolbarDropZone }, tableOptions.state) }));
3229
- // @ts-ignore
3230
- table.refs = {
3231
- // @ts-ignore
3232
- bottomToolbarRef,
3233
- editInputRefs,
3234
- filterInputRefs,
3235
- // @ts-ignore
3236
- searchInputRef,
3237
- // @ts-ignore
3238
- tableContainerRef,
3239
- // @ts-ignore
3240
- tableFooterRef,
3241
- tableHeadCellRefs,
3242
- // @ts-ignore
3243
- tableHeadRef,
3244
- // @ts-ignore
3245
- tablePaperRef,
3246
- // @ts-ignore
3247
- topToolbarRef,
3248
- };
3249
- const setCreatingRow = (row) => {
3250
- var _a, _b;
3251
- let _row = row;
3252
- if (row === true) {
3253
- _row = createRow(table);
3254
- }
3255
- (_b = (_a = tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.onCreatingRowChange) === null || _a === void 0 ? void 0 : _a.call(tableOptions, _row)) !== null && _b !== void 0 ? _b : _setCreatingRow(_row);
3256
- };
3257
- table.setCreatingRow = setCreatingRow;
3258
- table.setColumnFilterFns =
3259
- (_x = tableOptions.onColumnFilterFnsChange) !== null && _x !== void 0 ? _x : setColumnFilterFns;
3260
- table.setDensity = (_y = tableOptions.onDensityChange) !== null && _y !== void 0 ? _y : setDensity;
3261
- table.setDraggingColumn =
3262
- (_z = tableOptions.onDraggingColumnChange) !== null && _z !== void 0 ? _z : setDraggingColumn;
3263
- table.setDraggingRow = (_0 = tableOptions.onDraggingRowChange) !== null && _0 !== void 0 ? _0 : setDraggingRow;
3264
- table.setEditingCell = (_1 = tableOptions.onEditingCellChange) !== null && _1 !== void 0 ? _1 : setEditingCell;
3265
- table.setEditingRow = (_2 = tableOptions.onEditingRowChange) !== null && _2 !== void 0 ? _2 : setEditingRow;
3266
- table.setGlobalFilterFn =
3267
- (_3 = tableOptions.onGlobalFilterFnChange) !== null && _3 !== void 0 ? _3 : setGlobalFilterFn;
3268
- table.setHoveredColumn =
3269
- (_4 = tableOptions.onHoveredColumnChange) !== null && _4 !== void 0 ? _4 : setHoveredColumn;
3270
- table.setHoveredRow = (_5 = tableOptions.onHoveredRowChange) !== null && _5 !== void 0 ? _5 : setHoveredRow;
3271
- table.setIsFullScreen = (_6 = tableOptions.onIsFullScreenChange) !== null && _6 !== void 0 ? _6 : setIsFullScreen;
3272
- table.setShowAlertBanner =
3273
- (_7 = tableOptions.onShowAlertBannerChange) !== null && _7 !== void 0 ? _7 : setShowAlertBanner;
3274
- table.setShowColumnFilters =
3275
- (_8 = tableOptions.onShowColumnFiltersChange) !== null && _8 !== void 0 ? _8 : setShowColumnFilters;
3276
- table.setShowGlobalFilter =
3277
- (_9 = tableOptions.onShowGlobalFilterChange) !== null && _9 !== void 0 ? _9 : setShowGlobalFilter;
3278
- table.setShowToolbarDropZone =
3279
- (_10 = tableOptions.onShowToolbarDropZoneChange) !== null && _10 !== void 0 ? _10 : setShowToolbarDropZone;
3280
- useMRT_Effects(table);
3281
- return table;
3282
- };
3283
-
3284
- const MRT_AggregationFns = Object.assign({}, aggregationFns);
2989
+ const MRT_AggregationFns = Object.assign({}, aggregationFns);
3285
2990
 
3286
2991
  const fuzzy = (row, columnId, filterValue, addMeta) => {
3287
2992
  const itemRank = rankItem(row.getValue(columnId), filterValue, {
@@ -3495,6 +3200,26 @@ const MRT_Localization_EN = {
3495
3200
  unpinAll: 'Unpin all',
3496
3201
  };
3497
3202
 
3203
+ const MRT_DefaultColumn = {
3204
+ filterVariant: 'text',
3205
+ maxSize: 1000,
3206
+ minSize: 40,
3207
+ size: 180,
3208
+ };
3209
+ const MRT_DefaultDisplayColumn = {
3210
+ columnDefType: 'display',
3211
+ enableClickToCopy: false,
3212
+ enableColumnActions: false,
3213
+ enableColumnDragging: false,
3214
+ enableColumnFilter: false,
3215
+ enableColumnOrdering: false,
3216
+ enableEditing: false,
3217
+ enableGlobalFilter: false,
3218
+ enableGrouping: false,
3219
+ enableHiding: false,
3220
+ enableResizing: false,
3221
+ enableSorting: false,
3222
+ };
3498
3223
  const useMRT_TableOptions = (_a) => {
3499
3224
  var _b;
3500
3225
  var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnPinning = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableExpanding, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = false, enableRowSelection = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode = 'semantic', localization, manualFiltering, manualGrouping, manualPagination, manualSorting, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberMode = 'static', rowPinningDisplayMode = 'sticky', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnFilterDisplayMode", "columnResizeMode", "createDisplayMode", "defaultColumn", "defaultDisplayColumn", "editDisplayMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnPinning", "enableColumnResizing", "enableDensityToggle", "enableExpandAll", "enableExpanding", "enableFilterMatchHighlighting", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enableRowPinning", "enableRowSelection", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "paginationDisplayMode", "positionActionsColumn", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberMode", "rowPinningDisplayMode", "selectAllMode", "sortingFns"]);
@@ -3572,12 +3297,309 @@ const useMRT_TableOptions = (_a) => {
3572
3297
  selectAllMode, sortingFns: _sortingFns }, rest);
3573
3298
  };
3574
3299
 
3575
- const useMaterialReactTable = (tableOptions) => {
3576
- const parsedTableOptions = useMRT_TableOptions(tableOptions);
3577
- const tableInstance = useMRT_TableInstance(parsedTableOptions);
3578
- return tableInstance;
3300
+ const blankColProps = {
3301
+ children: null,
3302
+ sx: {
3303
+ flex: '1 0 auto',
3304
+ minWidth: 0,
3305
+ p: 0,
3306
+ width: 0,
3307
+ },
3308
+ };
3309
+ const useMRT_DisplayColumns = ({ columnOrder, creatingRow, grouping, tableOptions, }) => {
3310
+ var _a, _b;
3311
+ return useMemo(() => {
3312
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
3313
+ return [
3314
+ ((_b = (_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.columnOrder) !== null && _b !== void 0 ? _b : columnOrder).includes('mrt-row-pin') && Object.assign(Object.assign({ Cell: ({ row, table }) => (jsx(MRT_TableBodyRowPinButton, { row: row, table: table })), header: tableOptions.localization.pin, size: 60 }, (_c = tableOptions.displayColumnDefOptions) === null || _c === void 0 ? void 0 : _c['mrt-row-pin']), { columnDefType: 'display', id: 'mrt-row-pin' }),
3315
+ ((_e = (_d = tableOptions.state) === null || _d === void 0 ? void 0 : _d.columnOrder) !== null && _e !== void 0 ? _e : columnOrder).includes('mrt-row-drag') && Object.assign(Object.assign({ Cell: ({ row, rowRef, table }) => (jsx(MRT_TableBodyRowGrabHandle, { row: row, rowRef: rowRef, table: table })), header: tableOptions.localization.move, size: 60 }, (_f = tableOptions.displayColumnDefOptions) === null || _f === void 0 ? void 0 : _f['mrt-row-drag']), { columnDefType: 'display', id: 'mrt-row-drag' }),
3316
+ (((_h = (_g = tableOptions.state) === null || _g === void 0 ? void 0 : _g.columnOrder) !== null && _h !== void 0 ? _h : columnOrder).includes('mrt-row-actions') ||
3317
+ (creatingRow && tableOptions.createDisplayMode === 'row')) && Object.assign(Object.assign({ Cell: ({ cell, row, table }) => (jsx(MRT_ToggleRowActionMenuButton, { cell: cell, row: row, table: table })), header: tableOptions.localization.actions, size: 70 }, (_j = tableOptions.displayColumnDefOptions) === null || _j === void 0 ? void 0 : _j['mrt-row-actions']), { columnDefType: 'display', id: 'mrt-row-actions' }),
3318
+ ((_l = (_k = tableOptions.state) === null || _k === void 0 ? void 0 : _k.columnOrder) !== null && _l !== void 0 ? _l : columnOrder).includes('mrt-row-expand') &&
3319
+ showExpandColumn(tableOptions, (_o = (_m = tableOptions.state) === null || _m === void 0 ? void 0 : _m.grouping) !== null && _o !== void 0 ? _o : grouping) && Object.assign(Object.assign({ Cell: ({ row, table }) => (jsx(MRT_ExpandButton, { row: row, table: table })), Header: tableOptions.enableExpandAll
3320
+ ? ({ table }) => jsx(MRT_ExpandAllButton, { table: table })
3321
+ : null, header: tableOptions.localization.expand, size: 60 }, (_p = tableOptions.displayColumnDefOptions) === null || _p === void 0 ? void 0 : _p['mrt-row-expand']), { columnDefType: 'display', id: 'mrt-row-expand' }),
3322
+ ((_r = (_q = tableOptions.state) === null || _q === void 0 ? void 0 : _q.columnOrder) !== null && _r !== void 0 ? _r : columnOrder).includes('mrt-row-select') && Object.assign(Object.assign({ Cell: ({ row, table }) => (jsx(MRT_SelectCheckbox, { row: row, table: table })), Header: tableOptions.enableSelectAll &&
3323
+ tableOptions.enableMultiRowSelection
3324
+ ? ({ table }) => jsx(MRT_SelectCheckbox, { selectAll: true, table: table })
3325
+ : null, header: tableOptions.localization.select, size: 60 }, (_s = tableOptions.displayColumnDefOptions) === null || _s === void 0 ? void 0 : _s['mrt-row-select']), { columnDefType: 'display', id: 'mrt-row-select' }),
3326
+ ((_u = (_t = tableOptions.state) === null || _t === void 0 ? void 0 : _t.columnOrder) !== null && _u !== void 0 ? _u : columnOrder).includes('mrt-row-numbers') && Object.assign(Object.assign({ Cell: ({ row }) => row.index + 1, Header: () => tableOptions.localization.rowNumber, header: tableOptions.localization.rowNumbers, size: 60 }, (_v = tableOptions.displayColumnDefOptions) === null || _v === void 0 ? void 0 : _v['mrt-row-numbers']), { columnDefType: 'display', id: 'mrt-row-numbers' }),
3327
+ ((_x = (_w = tableOptions.state) === null || _w === void 0 ? void 0 : _w.columnOrder) !== null && _x !== void 0 ? _x : columnOrder).includes('mrt-row-spacer') && Object.assign(Object.assign(Object.assign({}, (_y = tableOptions.displayColumnDefOptions) === null || _y === void 0 ? void 0 : _y['mrt-row-spacer']), MRT_DefaultDisplayColumn), { columnDefType: 'display', header: '', id: 'mrt-row-spacer', muiTableBodyCellProps: blankColProps, muiTableFooterCellProps: blankColProps, muiTableHeadCellProps: blankColProps }),
3328
+ ].filter(Boolean);
3329
+ }, [
3330
+ columnOrder,
3331
+ grouping,
3332
+ tableOptions.displayColumnDefOptions,
3333
+ tableOptions.editDisplayMode,
3334
+ tableOptions.enableColumnDragging,
3335
+ tableOptions.enableColumnFilterModes,
3336
+ tableOptions.enableColumnOrdering,
3337
+ tableOptions.enableEditing,
3338
+ tableOptions.enableExpandAll,
3339
+ tableOptions.enableExpanding,
3340
+ tableOptions.enableGrouping,
3341
+ tableOptions.enableRowActions,
3342
+ tableOptions.enableRowDragging,
3343
+ tableOptions.enableRowNumbers,
3344
+ tableOptions.enableRowOrdering,
3345
+ tableOptions.enableRowSelection,
3346
+ tableOptions.enableSelectAll,
3347
+ tableOptions.localization,
3348
+ tableOptions.positionActionsColumn,
3349
+ tableOptions.renderDetailPanel,
3350
+ tableOptions.renderRowActionMenuItems,
3351
+ tableOptions.renderRowActions,
3352
+ (_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.columnOrder,
3353
+ (_b = tableOptions.state) === null || _b === void 0 ? void 0 : _b.grouping,
3354
+ ]);
3355
+ };
3356
+
3357
+ const useMRT_Effects = (table) => {
3358
+ const { getIsSomeRowsPinned, getState, options: { enablePagination, enableRowPinning, rowCount }, } = table;
3359
+ const { density, globalFilter, isFullScreen, isLoading, pagination, showSkeletons, sorting, } = getState();
3360
+ const rerender = useReducer(() => ({}), {})[1];
3361
+ const isMounted = useRef(false);
3362
+ const initialBodyHeight = useRef();
3363
+ const previousTop = useRef();
3364
+ useEffect(() => {
3365
+ if (typeof window !== 'undefined') {
3366
+ initialBodyHeight.current = document.body.style.height;
3367
+ }
3368
+ }, []);
3369
+ useEffect(() => {
3370
+ if (isMounted && typeof window !== 'undefined') {
3371
+ if (isFullScreen) {
3372
+ previousTop.current = document.body.getBoundingClientRect().top; //save scroll position
3373
+ document.body.style.height = '100vh'; //hide page scrollbars when table is in full screen mode
3374
+ }
3375
+ else {
3376
+ document.body.style.height = initialBodyHeight.current;
3377
+ if (!previousTop.current)
3378
+ return;
3379
+ //restore scroll position
3380
+ window.scrollTo({
3381
+ behavior: 'instant',
3382
+ top: -1 * previousTop.current,
3383
+ });
3384
+ }
3385
+ }
3386
+ isMounted.current = true;
3387
+ }, [isFullScreen]);
3388
+ //if page index is out of bounds, set it to the last page
3389
+ useEffect(() => {
3390
+ if (!enablePagination || isLoading || showSkeletons)
3391
+ return;
3392
+ const { pageIndex, pageSize } = pagination;
3393
+ const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : table.getPrePaginationRowModel().rows.length;
3394
+ const firstVisibleRowIndex = pageIndex * pageSize;
3395
+ if (firstVisibleRowIndex > totalRowCount) {
3396
+ table.setPageIndex(Math.floor(totalRowCount / pageSize));
3397
+ }
3398
+ }, [rowCount, table.getPrePaginationRowModel().rows.length]);
3399
+ //turn off sort when global filter is looking for ranked results
3400
+ const appliedSort = useRef(sorting);
3401
+ useEffect(() => {
3402
+ if (sorting.length) {
3403
+ appliedSort.current = sorting;
3404
+ }
3405
+ }, [sorting]);
3406
+ useEffect(() => {
3407
+ if (!getCanRankRows(table))
3408
+ return;
3409
+ if (globalFilter) {
3410
+ table.setSorting([]);
3411
+ }
3412
+ else {
3413
+ table.setSorting(() => appliedSort.current || []);
3414
+ }
3415
+ }, [globalFilter]);
3416
+ useEffect(() => {
3417
+ if (enableRowPinning && getIsSomeRowsPinned()) {
3418
+ setTimeout(() => {
3419
+ rerender();
3420
+ }, 150);
3421
+ }
3422
+ }, [density]);
3423
+ };
3424
+
3425
+ const useMRT_TableInstance = (tableOptions) => {
3426
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
3427
+ const bottomToolbarRef = useRef(null);
3428
+ const editInputRefs = useRef({});
3429
+ const filterInputRefs = useRef({});
3430
+ const searchInputRef = useRef(null);
3431
+ const tableContainerRef = useRef(null);
3432
+ const tableHeadCellRefs = useRef({});
3433
+ const tablePaperRef = useRef(null);
3434
+ const topToolbarRef = useRef(null);
3435
+ const tableHeadRef = useRef(null);
3436
+ const tableFooterRef = useRef(null);
3437
+ const initialState = useMemo(() => {
3438
+ var _a, _b, _c;
3439
+ const initState = (_a = tableOptions.initialState) !== null && _a !== void 0 ? _a : {};
3440
+ initState.columnOrder =
3441
+ (_b = initState.columnOrder) !== null && _b !== void 0 ? _b : getDefaultColumnOrderIds(tableOptions);
3442
+ initState.globalFilterFn = (_c = tableOptions.globalFilterFn) !== null && _c !== void 0 ? _c : 'fuzzy';
3443
+ return initState;
3444
+ }, []);
3445
+ const [creatingRow, _setCreatingRow] = useState((_a = initialState.creatingRow) !== null && _a !== void 0 ? _a : null);
3446
+ const [columnFilterFns, setColumnFilterFns] = useState(() => Object.assign({}, ...getAllLeafColumnDefs(tableOptions.columns).map((col) => {
3447
+ var _a, _b, _c, _d;
3448
+ return ({
3449
+ [getColumnId(col)]: col.filterFn instanceof Function
3450
+ ? (_a = col.filterFn.name) !== null && _a !== void 0 ? _a : 'custom'
3451
+ : (_d = (_b = col.filterFn) !== null && _b !== void 0 ? _b : (_c = initialState === null || initialState === void 0 ? void 0 : initialState.columnFilterFns) === null || _c === void 0 ? void 0 : _c[getColumnId(col)]) !== null && _d !== void 0 ? _d : getDefaultColumnFilterFn(col),
3452
+ });
3453
+ })));
3454
+ const [columnOrder, setColumnOrder] = useState((_b = initialState.columnOrder) !== null && _b !== void 0 ? _b : []);
3455
+ const [density, setDensity] = useState((_c = initialState === null || initialState === void 0 ? void 0 : initialState.density) !== null && _c !== void 0 ? _c : 'comfortable');
3456
+ const [draggingColumn, setDraggingColumn] = useState((_d = initialState.draggingColumn) !== null && _d !== void 0 ? _d : null);
3457
+ const [draggingRow, setDraggingRow] = useState((_e = initialState.draggingRow) !== null && _e !== void 0 ? _e : null);
3458
+ const [editingCell, setEditingCell] = useState((_f = initialState.editingCell) !== null && _f !== void 0 ? _f : null);
3459
+ const [editingRow, setEditingRow] = useState((_g = initialState.editingRow) !== null && _g !== void 0 ? _g : null);
3460
+ const [globalFilterFn, setGlobalFilterFn] = useState((_h = initialState.globalFilterFn) !== null && _h !== void 0 ? _h : 'fuzzy');
3461
+ const [grouping, setGrouping] = useState((_j = initialState.grouping) !== null && _j !== void 0 ? _j : []);
3462
+ const [hoveredColumn, setHoveredColumn] = useState((_k = initialState.hoveredColumn) !== null && _k !== void 0 ? _k : null);
3463
+ const [hoveredRow, setHoveredRow] = useState((_l = initialState.hoveredRow) !== null && _l !== void 0 ? _l : null);
3464
+ const [isFullScreen, setIsFullScreen] = useState((_m = initialState === null || initialState === void 0 ? void 0 : initialState.isFullScreen) !== null && _m !== void 0 ? _m : false);
3465
+ const [showAlertBanner, setShowAlertBanner] = useState((_p = (_o = tableOptions.initialState) === null || _o === void 0 ? void 0 : _o.showAlertBanner) !== null && _p !== void 0 ? _p : false);
3466
+ const [showColumnFilters, setShowColumnFilters] = useState((_q = initialState === null || initialState === void 0 ? void 0 : initialState.showColumnFilters) !== null && _q !== void 0 ? _q : false);
3467
+ const [showGlobalFilter, setShowGlobalFilter] = useState((_r = initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) !== null && _r !== void 0 ? _r : false);
3468
+ const [showToolbarDropZone, setShowToolbarDropZone] = useState((_s = initialState === null || initialState === void 0 ? void 0 : initialState.showToolbarDropZone) !== null && _s !== void 0 ? _s : false);
3469
+ const displayColumns = useMRT_DisplayColumns({
3470
+ columnOrder,
3471
+ creatingRow,
3472
+ grouping,
3473
+ tableOptions,
3474
+ });
3475
+ const columnDefs = useMemo(() => {
3476
+ var _a, _b, _c;
3477
+ return prepareColumns({
3478
+ aggregationFns: tableOptions.aggregationFns,
3479
+ columnDefs: [...displayColumns, ...tableOptions.columns],
3480
+ columnFilterFns: (_b = (_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.columnFilterFns) !== null && _b !== void 0 ? _b : columnFilterFns,
3481
+ defaultDisplayColumn: (_c = tableOptions.defaultDisplayColumn) !== null && _c !== void 0 ? _c : {},
3482
+ filterFns: tableOptions.filterFns,
3483
+ sortingFns: tableOptions.sortingFns,
3484
+ });
3485
+ }, [
3486
+ columnFilterFns,
3487
+ displayColumns,
3488
+ tableOptions.columns,
3489
+ (_t = tableOptions.state) === null || _t === void 0 ? void 0 : _t.columnFilterFns,
3490
+ ]);
3491
+ const data = useMemo(() => {
3492
+ var _a, _b, _c, _d, _e;
3493
+ return (((_a = tableOptions.state) === null || _a === void 0 ? void 0 : _a.isLoading) || ((_b = tableOptions.state) === null || _b === void 0 ? void 0 : _b.showSkeletons)) &&
3494
+ !tableOptions.data.length
3495
+ ? [
3496
+ ...Array(((_d = (_c = tableOptions.state) === null || _c === void 0 ? void 0 : _c.pagination) === null || _d === void 0 ? void 0 : _d.pageSize) ||
3497
+ ((_e = initialState === null || initialState === void 0 ? void 0 : initialState.pagination) === null || _e === void 0 ? void 0 : _e.pageSize) ||
3498
+ 10).fill(null),
3499
+ ].map(() => Object.assign({}, ...getAllLeafColumnDefs(tableOptions.columns).map((col) => ({
3500
+ [getColumnId(col)]: null,
3501
+ }))))
3502
+ : tableOptions.data;
3503
+ }, [
3504
+ tableOptions.data,
3505
+ (_u = tableOptions.state) === null || _u === void 0 ? void 0 : _u.isLoading,
3506
+ (_v = tableOptions.state) === null || _v === void 0 ? void 0 : _v.showSkeletons,
3507
+ ]);
3508
+ //@ts-ignore
3509
+ const table = useReactTable(Object.assign(Object.assign({ getCoreRowModel: getCoreRowModel(), getExpandedRowModel: tableOptions.enableExpanding || tableOptions.enableGrouping
3510
+ ? getExpandedRowModel()
3511
+ : undefined, getFacetedMinMaxValues: tableOptions.enableFacetedValues
3512
+ ? getFacetedMinMaxValues()
3513
+ : undefined, getFacetedRowModel: tableOptions.enableFacetedValues
3514
+ ? getFacetedRowModel()
3515
+ : undefined, getFacetedUniqueValues: tableOptions.enableFacetedValues
3516
+ ? getFacetedUniqueValues()
3517
+ : undefined, getFilteredRowModel: tableOptions.enableColumnFilters ||
3518
+ tableOptions.enableGlobalFilter ||
3519
+ tableOptions.enableFilters
3520
+ ? getFilteredRowModel()
3521
+ : undefined, getGroupedRowModel: tableOptions.enableGrouping
3522
+ ? getGroupedRowModel()
3523
+ : undefined, getPaginationRowModel: tableOptions.enablePagination
3524
+ ? getPaginationRowModel()
3525
+ : undefined, getSortedRowModel: tableOptions.enableSorting
3526
+ ? getSortedRowModel()
3527
+ : undefined, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows, onColumnOrderChange: setColumnOrder, onGroupingChange: setGrouping }, tableOptions), {
3528
+ //@ts-ignore
3529
+ columns: columnDefs, data, globalFilterFn: (_w = tableOptions.filterFns) === null || _w === void 0 ? void 0 : _w[globalFilterFn !== null && globalFilterFn !== void 0 ? globalFilterFn : 'fuzzy'], initialState, state: Object.assign({ columnFilterFns,
3530
+ columnOrder,
3531
+ creatingRow,
3532
+ density,
3533
+ draggingColumn,
3534
+ draggingRow,
3535
+ editingCell,
3536
+ editingRow,
3537
+ globalFilterFn,
3538
+ grouping,
3539
+ hoveredColumn,
3540
+ hoveredRow,
3541
+ isFullScreen,
3542
+ showAlertBanner,
3543
+ showColumnFilters,
3544
+ showGlobalFilter,
3545
+ showToolbarDropZone }, tableOptions.state) }));
3546
+ // @ts-ignore
3547
+ table.refs = {
3548
+ // @ts-ignore
3549
+ bottomToolbarRef,
3550
+ editInputRefs,
3551
+ filterInputRefs,
3552
+ // @ts-ignore
3553
+ searchInputRef,
3554
+ // @ts-ignore
3555
+ tableContainerRef,
3556
+ // @ts-ignore
3557
+ tableFooterRef,
3558
+ tableHeadCellRefs,
3559
+ // @ts-ignore
3560
+ tableHeadRef,
3561
+ // @ts-ignore
3562
+ tablePaperRef,
3563
+ // @ts-ignore
3564
+ topToolbarRef,
3565
+ };
3566
+ const setCreatingRow = (row) => {
3567
+ var _a, _b;
3568
+ let _row = row;
3569
+ if (row === true) {
3570
+ _row = createRow(table);
3571
+ }
3572
+ (_b = (_a = tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.onCreatingRowChange) === null || _a === void 0 ? void 0 : _a.call(tableOptions, _row)) !== null && _b !== void 0 ? _b : _setCreatingRow(_row);
3573
+ };
3574
+ table.setCreatingRow = setCreatingRow;
3575
+ table.setColumnFilterFns =
3576
+ (_x = tableOptions.onColumnFilterFnsChange) !== null && _x !== void 0 ? _x : setColumnFilterFns;
3577
+ table.setDensity = (_y = tableOptions.onDensityChange) !== null && _y !== void 0 ? _y : setDensity;
3578
+ table.setDraggingColumn =
3579
+ (_z = tableOptions.onDraggingColumnChange) !== null && _z !== void 0 ? _z : setDraggingColumn;
3580
+ table.setDraggingRow = (_0 = tableOptions.onDraggingRowChange) !== null && _0 !== void 0 ? _0 : setDraggingRow;
3581
+ table.setEditingCell = (_1 = tableOptions.onEditingCellChange) !== null && _1 !== void 0 ? _1 : setEditingCell;
3582
+ table.setEditingRow = (_2 = tableOptions.onEditingRowChange) !== null && _2 !== void 0 ? _2 : setEditingRow;
3583
+ table.setGlobalFilterFn =
3584
+ (_3 = tableOptions.onGlobalFilterFnChange) !== null && _3 !== void 0 ? _3 : setGlobalFilterFn;
3585
+ table.setHoveredColumn =
3586
+ (_4 = tableOptions.onHoveredColumnChange) !== null && _4 !== void 0 ? _4 : setHoveredColumn;
3587
+ table.setHoveredRow = (_5 = tableOptions.onHoveredRowChange) !== null && _5 !== void 0 ? _5 : setHoveredRow;
3588
+ table.setIsFullScreen = (_6 = tableOptions.onIsFullScreenChange) !== null && _6 !== void 0 ? _6 : setIsFullScreen;
3589
+ table.setShowAlertBanner =
3590
+ (_7 = tableOptions.onShowAlertBannerChange) !== null && _7 !== void 0 ? _7 : setShowAlertBanner;
3591
+ table.setShowColumnFilters =
3592
+ (_8 = tableOptions.onShowColumnFiltersChange) !== null && _8 !== void 0 ? _8 : setShowColumnFilters;
3593
+ table.setShowGlobalFilter =
3594
+ (_9 = tableOptions.onShowGlobalFilterChange) !== null && _9 !== void 0 ? _9 : setShowGlobalFilter;
3595
+ table.setShowToolbarDropZone =
3596
+ (_10 = tableOptions.onShowToolbarDropZoneChange) !== null && _10 !== void 0 ? _10 : setShowToolbarDropZone;
3597
+ useMRT_Effects(table);
3598
+ return table;
3579
3599
  };
3580
3600
 
3601
+ const useMaterialReactTable = (tableOptions) => useMRT_TableInstance(useMRT_TableOptions(tableOptions));
3602
+
3581
3603
  const isTableInstanceProp = (props) => props.table !== undefined;
3582
3604
  const MaterialReactTable = (props) => {
3583
3605
  let table;
@@ -3590,5 +3612,5 @@ const MaterialReactTable = (props) => {
3590
3612
  return jsx(MRT_TablePaper, { table: table });
3591
3613
  };
3592
3614
 
3593
- export { MRT_AggregationFns, MRT_BottomToolbar, MRT_ColumnActionMenu, MRT_ColumnPinningButtons, MRT_CopyButton, MRT_DefaultColumn, MRT_DefaultDisplayColumn, MRT_EditActionButtons, MRT_EditCellTextField, MRT_EditRowModal, MRT_ExpandAllButton, MRT_ExpandButton, MRT_FilterCheckbox, MRT_FilterFns, MRT_FilterOptionMenu, MRT_FilterRangeFields, MRT_FilterRangeSlider, MRT_FilterTextField, MRT_GlobalFilterTextField, MRT_GrabHandleButton, MRT_LinearProgressBar, MRT_RowActionMenu, MRT_RowPinButton, MRT_SelectCheckbox, MRT_ShowHideColumnsButton, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, MRT_SortingFns, MRT_Table, MRT_TableBody, MRT_TableBodyCell, MRT_TableBodyCellValue, MRT_TableBodyRow, MRT_TableBodyRowGrabHandle, MRT_TableBodyRowPinButton, MRT_TableContainer, MRT_TableDetailPanel, MRT_TableFooter, MRT_TableFooterCell, MRT_TableFooterRow, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellColumnActionsButton, MRT_TableHeadCellFilterContainer, MRT_TableHeadCellFilterLabel, MRT_TableHeadCellGrabHandle, MRT_TableHeadCellResizeHandle, MRT_TableHeadCellSortLabel, MRT_TableHeadRow, MRT_TablePagination, MRT_TablePaper, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleFullScreenButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MaterialReactTable, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, commonListItemStyles, commonMenuItemStyles, commonToolbarStyles, createRow, extraIndexRangeExtractor, flexRender, getAllLeafColumnDefs, getCanRankRows, getColumnId, getCommonCellStyles, getDefaultColumnFilterFn, getDefaultColumnOrderIds, getIsFirstColumn, getIsFirstRightPinnedColumn, getIsLastColumn, getIsLastLeftPinnedColumn, getLeadingDisplayColumnIds, getTotalRight, getTrailingDisplayColumnIds, mrtFilterOptions, parseCSSVarId, parseFromValuesOrFunc, prepareColumns, rankGlobalFuzzy, reorderColumn, showExpandColumn, useMaterialReactTable };
3594
- //# sourceMappingURL=material-react-table.esm.js.map
3615
+ export { MRT_AggregationFns, MRT_BottomToolbar, MRT_ColumnActionMenu, MRT_ColumnPinningButtons, MRT_CopyButton, MRT_EditActionButtons, MRT_EditCellTextField, MRT_EditRowModal, MRT_ExpandAllButton, MRT_ExpandButton, MRT_FilterCheckbox, MRT_FilterFns, MRT_FilterOptionMenu, MRT_FilterRangeFields, MRT_FilterRangeSlider, MRT_FilterTextField, MRT_GlobalFilterTextField, MRT_GrabHandleButton, MRT_LinearProgressBar, MRT_RowActionMenu, MRT_RowPinButton, MRT_SelectCheckbox, MRT_ShowHideColumnsButton, MRT_ShowHideColumnsMenu, MRT_ShowHideColumnsMenuItems, MRT_SortingFns, MRT_Table, MRT_TableBody, MRT_TableBodyCell, MRT_TableBodyCellValue, MRT_TableBodyRow, MRT_TableBodyRowGrabHandle, MRT_TableBodyRowPinButton, MRT_TableContainer, MRT_TableDetailPanel, MRT_TableFooter, MRT_TableFooterCell, MRT_TableFooterRow, MRT_TableHead, MRT_TableHeadCell, MRT_TableHeadCellColumnActionsButton, MRT_TableHeadCellFilterContainer, MRT_TableHeadCellFilterLabel, MRT_TableHeadCellGrabHandle, MRT_TableHeadCellResizeHandle, MRT_TableHeadCellSortLabel, MRT_TableHeadRow, MRT_TableLoadingOverlay, MRT_TablePagination, MRT_TablePaper, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleFullScreenButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MaterialReactTable, Memo_MRT_TableBody, Memo_MRT_TableBodyCell, Memo_MRT_TableBodyRow, commonListItemStyles, commonMenuItemStyles, createMRTColumnHelper, createRow, extraIndexRangeExtractor, flexRender, getAllLeafColumnDefs, getCanRankRows, getColumnId, getCommonMRTCellStyles, getCommonToolbarStyles, getDefaultColumnFilterFn, getDefaultColumnOrderIds, getIsFirstColumn, getIsFirstRightPinnedColumn, getIsLastColumn, getIsLastLeftPinnedColumn, getLeadingDisplayColumnIds, getMRTTheme, getTotalRight, getTrailingDisplayColumnIds, mrtFilterOptions, parseCSSVarId, parseFromValuesOrFunc, prepareColumns, rankGlobalFuzzy, reorderColumn, showExpandColumn, useMaterialReactTable };
3616
+ //# sourceMappingURL=index.esm.js.map