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