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

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