material-react-table 2.0.0-beta.3 → 2.0.0-beta.5
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.
- package/dist/cjs/index.js +704 -774
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +613 -595
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/index.d.ts +167 -161
- package/locales/ar/index.d.ts +3 -0
- package/locales/ar/index.esm.d.ts +3 -0
- package/locales/{ar.esm.js → ar/index.esm.js} +0 -1
- package/locales/{ar.js → ar/index.js} +0 -3
- package/locales/ar/package.json +6 -0
- package/locales/az/index.d.ts +3 -0
- package/locales/az/index.esm.d.ts +3 -0
- package/locales/az/index.esm.js +93 -0
- package/locales/az/index.js +95 -0
- package/locales/az/package.json +6 -0
- package/locales/bg/index.d.ts +3 -0
- package/locales/bg/index.esm.d.ts +3 -0
- package/locales/{bg.esm.js → bg/index.esm.js} +0 -1
- package/locales/{bg.js → bg/index.js} +0 -3
- package/locales/bg/package.json +6 -0
- package/locales/cs/index.d.ts +3 -0
- package/locales/cs/index.esm.d.ts +3 -0
- package/locales/{cs.esm.js → cs/index.esm.js} +0 -1
- package/locales/{cs.js → cs/index.js} +0 -3
- package/locales/cs/package.json +6 -0
- package/locales/da/index.d.ts +3 -0
- package/locales/da/index.esm.d.ts +3 -0
- package/locales/{da.esm.js → da/index.esm.js} +0 -1
- package/locales/{da.js → da/index.js} +0 -3
- package/locales/da/package.json +6 -0
- package/locales/de/index.d.ts +3 -0
- package/locales/de/index.esm.d.ts +3 -0
- package/locales/{de.esm.js → de/index.esm.js} +0 -1
- package/locales/{de.js → de/index.js} +0 -3
- package/locales/de/package.json +6 -0
- package/locales/en/index.d.ts +3 -0
- package/locales/en/index.esm.d.ts +3 -0
- package/locales/{en.esm.js → en/index.esm.js} +0 -1
- package/locales/{en.js → en/index.js} +0 -3
- package/locales/en/package.json +6 -0
- package/locales/es/index.d.ts +3 -0
- package/locales/es/index.esm.d.ts +3 -0
- package/locales/{es.esm.js → es/index.esm.js} +0 -1
- package/locales/{es.js → es/index.js} +0 -3
- package/locales/es/package.json +6 -0
- package/locales/et/index.d.ts +3 -0
- package/locales/et/index.esm.d.ts +3 -0
- package/locales/{et.esm.js → et/index.esm.js} +0 -1
- package/locales/{et.js → et/index.js} +0 -3
- package/locales/et/package.json +6 -0
- package/locales/fa/index.d.ts +3 -0
- package/locales/fa/index.esm.d.ts +3 -0
- package/locales/{fa.esm.js → fa/index.esm.js} +0 -1
- package/locales/{fa.js → fa/index.js} +0 -3
- package/locales/fa/package.json +6 -0
- package/locales/fi/index.d.ts +3 -0
- package/locales/fi/index.esm.d.ts +3 -0
- package/locales/{fi.esm.js → fi/index.esm.js} +0 -1
- package/locales/{fi.js → fi/index.js} +0 -3
- package/locales/fi/package.json +6 -0
- package/locales/fr/index.d.ts +3 -0
- package/locales/fr/index.esm.d.ts +3 -0
- package/locales/{fr.esm.js → fr/index.esm.js} +0 -1
- package/locales/{fr.js → fr/index.js} +0 -3
- package/locales/fr/package.json +6 -0
- package/locales/hu/index.d.ts +3 -0
- package/locales/hu/index.esm.d.ts +3 -0
- package/locales/{hu.esm.js → hu/index.esm.js} +0 -1
- package/locales/{hu.js → hu/index.js} +0 -3
- package/locales/hu/package.json +6 -0
- package/locales/hy/index.d.ts +3 -0
- package/locales/hy/index.esm.d.ts +3 -0
- package/locales/{hy.esm.js → hy/index.esm.js} +0 -1
- package/locales/{hy.js → hy/index.js} +0 -3
- package/locales/hy/package.json +6 -0
- package/locales/id/index.d.ts +3 -0
- package/locales/id/index.esm.d.ts +3 -0
- package/locales/{id.esm.js → id/index.esm.js} +0 -1
- package/locales/{id.js → id/index.js} +0 -3
- package/locales/id/package.json +6 -0
- package/locales/it/index.d.ts +3 -0
- package/locales/it/index.esm.d.ts +3 -0
- package/locales/{it.esm.js → it/index.esm.js} +0 -1
- package/locales/{it.js → it/index.js} +0 -3
- package/locales/it/package.json +6 -0
- package/locales/ja/index.d.ts +3 -0
- package/locales/ja/index.esm.d.ts +3 -0
- package/locales/{ja.esm.js → ja/index.esm.js} +0 -1
- package/locales/{ja.js → ja/index.js} +0 -3
- package/locales/ja/package.json +6 -0
- package/locales/ko/index.d.ts +3 -0
- package/locales/ko/index.esm.d.ts +3 -0
- package/locales/{ko.esm.js → ko/index.esm.js} +0 -1
- package/locales/{ko.js → ko/index.js} +0 -3
- package/locales/ko/package.json +6 -0
- package/locales/nl/index.d.ts +3 -0
- package/locales/nl/index.esm.d.ts +3 -0
- package/locales/{nl.esm.js → nl/index.esm.js} +0 -1
- package/locales/{nl.js → nl/index.js} +0 -3
- package/locales/nl/package.json +6 -0
- package/locales/no/index.d.ts +3 -0
- package/locales/no/index.esm.d.ts +3 -0
- package/locales/{no.esm.js → no/index.esm.js} +0 -1
- package/locales/{no.js → no/index.js} +0 -3
- package/locales/no/package.json +6 -0
- package/locales/np/index.d.ts +3 -0
- package/locales/np/index.esm.d.ts +3 -0
- package/locales/{np.esm.js → np/index.esm.js} +0 -1
- package/locales/{np.js → np/index.js} +0 -3
- package/locales/np/package.json +6 -0
- package/locales/pl/index.d.ts +3 -0
- package/locales/pl/index.esm.d.ts +3 -0
- package/locales/{pl.esm.js → pl/index.esm.js} +0 -1
- package/locales/{pl.js → pl/index.js} +0 -3
- package/locales/pl/package.json +6 -0
- package/locales/pt/index.d.ts +3 -0
- package/locales/pt/index.esm.d.ts +3 -0
- package/locales/{pt.esm.js → pt/index.esm.js} +0 -1
- package/locales/{pt.js → pt/index.js} +0 -3
- package/locales/pt/package.json +6 -0
- package/locales/pt-BR/index.d.ts +3 -0
- package/locales/pt-BR/index.esm.d.ts +3 -0
- package/locales/{pt-BR.esm.js → pt-BR/index.esm.js} +0 -1
- package/locales/{pt-BR.js → pt-BR/index.js} +0 -3
- package/locales/pt-BR/package.json +6 -0
- package/locales/ro/index.d.ts +3 -0
- package/locales/ro/index.esm.d.ts +3 -0
- package/locales/{ro.esm.js → ro/index.esm.js} +0 -1
- package/locales/{ro.js → ro/index.js} +0 -3
- package/locales/ro/package.json +6 -0
- package/locales/ru/index.d.ts +3 -0
- package/locales/ru/index.esm.d.ts +3 -0
- package/locales/{ru.esm.js → ru/index.esm.js} +0 -1
- package/locales/{ru.js → ru/index.js} +0 -3
- package/locales/ru/package.json +6 -0
- package/locales/sk/index.d.ts +3 -0
- package/locales/sk/index.esm.d.ts +3 -0
- package/locales/{sk.esm.js → sk/index.esm.js} +0 -1
- package/locales/{sk.js → sk/index.js} +0 -3
- package/locales/sk/package.json +6 -0
- package/locales/sr-Cyrl-RS/index.d.ts +3 -0
- package/locales/sr-Cyrl-RS/index.esm.d.ts +3 -0
- package/locales/{sr-Cyrl-RS.esm.js → sr-Cyrl-RS/index.esm.js} +0 -1
- package/locales/{sr-Cyrl-RS.js → sr-Cyrl-RS/index.js} +0 -3
- package/locales/sr-Cyrl-RS/package.json +6 -0
- package/locales/sr-Latn-RS/index.d.ts +3 -0
- package/locales/sr-Latn-RS/index.esm.d.ts +3 -0
- package/locales/{sr-Latn-RS.esm.js → sr-Latn-RS/index.esm.js} +0 -1
- package/locales/{sr-Latn-RS.js → sr-Latn-RS/index.js} +0 -3
- package/locales/sr-Latn-RS/package.json +6 -0
- package/locales/sv/index.d.ts +3 -0
- package/locales/sv/index.esm.d.ts +3 -0
- package/locales/{sv.esm.js → sv/index.esm.js} +0 -1
- package/locales/{sv.js → sv/index.js} +0 -3
- package/locales/sv/package.json +6 -0
- package/locales/tr/index.d.ts +3 -0
- package/locales/tr/index.esm.d.ts +3 -0
- package/locales/{tr.esm.js → tr/index.esm.js} +0 -1
- package/locales/{tr.js → tr/index.js} +0 -3
- package/locales/tr/package.json +6 -0
- package/locales/uk/index.d.ts +3 -0
- package/locales/uk/index.esm.d.ts +3 -0
- package/locales/{uk.esm.js → uk/index.esm.js} +0 -1
- package/locales/{uk.js → uk/index.js} +0 -3
- package/locales/uk/package.json +6 -0
- package/locales/vi/index.d.ts +3 -0
- package/locales/vi/index.esm.d.ts +3 -0
- package/locales/{vi.esm.js → vi/index.esm.js} +0 -1
- package/locales/{vi.js → vi/index.js} +0 -3
- package/locales/vi/package.json +6 -0
- package/locales/zh-Hans/index.d.ts +3 -0
- package/locales/zh-Hans/index.esm.d.ts +3 -0
- package/locales/{zh-Hans.esm.js → zh-Hans/index.esm.js} +0 -1
- package/locales/{zh-Hans.js → zh-Hans/index.js} +0 -3
- package/locales/zh-Hans/package.json +6 -0
- package/locales/zh-Hant/index.d.ts +3 -0
- package/locales/zh-Hant/index.esm.d.ts +3 -0
- package/locales/{zh-Hant.esm.js → zh-Hant/index.esm.js} +0 -1
- package/locales/{zh-Hant.js → zh-Hant/index.js} +0 -3
- package/locales/zh-Hant/package.json +6 -0
- package/package.json +37 -28
- package/src/body/MRT_TableBody.tsx +8 -6
- package/src/body/MRT_TableBodyCell.tsx +67 -66
- package/src/body/MRT_TableBodyCellValue.tsx +6 -6
- package/src/body/MRT_TableBodyRow.tsx +16 -12
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +10 -5
- package/src/body/MRT_TableBodyRowPinButton.tsx +12 -5
- package/src/body/MRT_TableDetailPanel.tsx +13 -9
- package/src/buttons/MRT_ColumnPinningButtons.tsx +12 -3
- package/src/buttons/MRT_CopyButton.tsx +6 -8
- package/src/buttons/MRT_EditActionButtons.tsx +9 -3
- package/src/buttons/MRT_ExpandAllButton.tsx +9 -5
- package/src/buttons/MRT_ExpandButton.tsx +2 -2
- package/src/buttons/MRT_GrabHandleButton.tsx +8 -5
- package/src/buttons/MRT_RowPinButton.tsx +8 -4
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +7 -3
- package/src/column.utils.ts +2 -121
- package/src/footer/MRT_TableFooter.tsx +9 -5
- package/src/footer/MRT_TableFooterCell.tsx +15 -14
- package/src/footer/MRT_TableFooterRow.tsx +12 -8
- package/src/head/MRT_TableHead.tsx +8 -4
- package/src/head/MRT_TableHeadCell.tsx +96 -89
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +7 -9
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +4 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +8 -4
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +4 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +7 -4
- package/src/head/MRT_TableHeadCellSortLabel.tsx +31 -15
- package/src/head/MRT_TableHeadRow.tsx +13 -8
- package/src/hooks/useMRT_DisplayColumns.tsx +1 -0
- package/src/hooks/useMRT_TableOptions.ts +22 -1
- package/src/index.ts +1 -0
- package/src/inputs/MRT_EditCellTextField.tsx +15 -1
- package/src/inputs/MRT_FilterCheckbox.tsx +4 -2
- package/src/inputs/MRT_FilterRangeFields.tsx +13 -3
- package/src/inputs/MRT_FilterRangeSlider.tsx +4 -2
- package/src/inputs/MRT_FilterTextField.tsx +3 -1
- package/src/inputs/MRT_GlobalFilterTextField.tsx +23 -6
- package/src/inputs/MRT_SelectCheckbox.tsx +8 -4
- package/src/locales/az.ts +94 -0
- package/src/locales/no.ts +1 -1
- package/src/menus/MRT_ColumnActionMenu.tsx +4 -2
- package/src/menus/MRT_FilterOptionMenu.tsx +4 -2
- package/src/menus/MRT_RowActionMenu.tsx +4 -2
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +4 -2
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +9 -5
- package/src/modals/MRT_EditRowModal.tsx +5 -3
- package/src/style.utils.ts +149 -0
- package/src/table/MRT_Table.tsx +26 -32
- package/src/table/MRT_TableContainer.tsx +15 -44
- package/src/table/MRT_TableLoadingOverlay.tsx +54 -0
- package/src/table/MRT_TablePaper.tsx +8 -4
- package/src/table/index.ts +1 -0
- package/src/toolbar/MRT_BottomToolbar.tsx +14 -12
- package/src/toolbar/MRT_LinearProgressBar.tsx +14 -8
- package/src/toolbar/MRT_TablePagination.tsx +18 -8
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +9 -5
- package/src/toolbar/MRT_ToolbarDropZone.tsx +6 -2
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -4
- package/src/toolbar/MRT_TopToolbar.tsx +8 -21
- package/src/types.ts +13 -5
- package/src/useMaterialReactTable.ts +2 -5
- package/dist/cjs/types/MaterialReactTable.d.ts +0 -7
- package/dist/cjs/types/aggregationFns.d.ts +0 -11
- package/dist/cjs/types/body/MRT_TableBody.d.ts +0 -12
- package/dist/cjs/types/body/MRT_TableBodyCell.d.ts +0 -15
- package/dist/cjs/types/body/MRT_TableBodyCellValue.d.ts +0 -7
- package/dist/cjs/types/body/MRT_TableBodyRow.d.ts +0 -18
- package/dist/cjs/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -9
- package/dist/cjs/types/body/MRT_TableBodyRowPinButton.d.ts +0 -7
- package/dist/cjs/types/body/MRT_TableDetailPanel.d.ts +0 -12
- package/dist/cjs/types/body/index.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_CopyButton.d.ts +0 -9
- package/dist/cjs/types/buttons/MRT_EditActionButtons.d.ts +0 -8
- package/dist/cjs/types/buttons/MRT_ExpandAllButton.d.ts +0 -6
- package/dist/cjs/types/buttons/MRT_ExpandButton.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +0 -12
- package/dist/cjs/types/buttons/MRT_RowPinButton.d.ts +0 -9
- package/dist/cjs/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
- package/dist/cjs/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -8
- package/dist/cjs/types/buttons/index.d.ts +0 -13
- package/dist/cjs/types/column.utils.d.ts +0 -149
- package/dist/cjs/types/filterFns.d.ts +0 -69
- package/dist/cjs/types/footer/MRT_TableFooter.d.ts +0 -10
- package/dist/cjs/types/footer/MRT_TableFooterCell.d.ts +0 -7
- package/dist/cjs/types/footer/MRT_TableFooterRow.d.ts +0 -11
- package/dist/cjs/types/footer/index.d.ts +0 -3
- package/dist/cjs/types/head/MRT_TableHead.d.ts +0 -10
- package/dist/cjs/types/head/MRT_TableHeadCell.d.ts +0 -7
- package/dist/cjs/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -7
- package/dist/cjs/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -7
- package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -7
- package/dist/cjs/types/head/MRT_TableHeadCellGrabHandle.d.ts +0 -9
- package/dist/cjs/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -7
- package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -9
- package/dist/cjs/types/head/MRT_TableHeadRow.d.ts +0 -11
- package/dist/cjs/types/head/index.d.ts +0 -9
- package/dist/cjs/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
- package/dist/cjs/types/hooks/useMRT_Effects.d.ts +0 -2
- package/dist/cjs/types/hooks/useMRT_TableInstance.d.ts +0 -2
- package/dist/cjs/types/hooks/useMRT_TableOptions.d.ts +0 -2
- package/dist/cjs/types/icons.d.ts +0 -36
- package/dist/cjs/types/index.d.ts +0 -16
- package/dist/cjs/types/inputs/MRT_EditCellTextField.d.ts +0 -7
- package/dist/cjs/types/inputs/MRT_FilterCheckbox.d.ts +0 -7
- package/dist/cjs/types/inputs/MRT_FilterRangeFields.d.ts +0 -7
- package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +0 -7
- package/dist/cjs/types/inputs/MRT_FilterTextField.d.ts +0 -8
- package/dist/cjs/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -6
- package/dist/cjs/types/inputs/MRT_SelectCheckbox.d.ts +0 -8
- package/dist/cjs/types/inputs/index.d.ts +0 -7
- package/dist/cjs/types/locales/ar.d.ts +0 -2
- package/dist/cjs/types/locales/bg.d.ts +0 -2
- package/dist/cjs/types/locales/cs.d.ts +0 -2
- package/dist/cjs/types/locales/da.d.ts +0 -2
- package/dist/cjs/types/locales/de.d.ts +0 -2
- package/dist/cjs/types/locales/en.d.ts +0 -2
- package/dist/cjs/types/locales/es.d.ts +0 -2
- package/dist/cjs/types/locales/et.d.ts +0 -2
- package/dist/cjs/types/locales/fa.d.ts +0 -2
- package/dist/cjs/types/locales/fi.d.ts +0 -2
- package/dist/cjs/types/locales/fr.d.ts +0 -2
- package/dist/cjs/types/locales/hu.d.ts +0 -2
- package/dist/cjs/types/locales/hy.d.ts +0 -2
- package/dist/cjs/types/locales/id.d.ts +0 -2
- package/dist/cjs/types/locales/it.d.ts +0 -2
- package/dist/cjs/types/locales/ja.d.ts +0 -2
- package/dist/cjs/types/locales/ko.d.ts +0 -2
- package/dist/cjs/types/locales/nl.d.ts +0 -2
- package/dist/cjs/types/locales/no.d.ts +0 -2
- package/dist/cjs/types/locales/np.d.ts +0 -2
- package/dist/cjs/types/locales/pl.d.ts +0 -2
- package/dist/cjs/types/locales/pt-BR.d.ts +0 -2
- package/dist/cjs/types/locales/pt.d.ts +0 -2
- package/dist/cjs/types/locales/ro.d.ts +0 -2
- package/dist/cjs/types/locales/ru.d.ts +0 -2
- package/dist/cjs/types/locales/sk.d.ts +0 -2
- package/dist/cjs/types/locales/sr-Cyrl-RS.d.ts +0 -2
- package/dist/cjs/types/locales/sr-Latn-RS.d.ts +0 -2
- package/dist/cjs/types/locales/sv.d.ts +0 -2
- package/dist/cjs/types/locales/tr.d.ts +0 -2
- package/dist/cjs/types/locales/uk.d.ts +0 -2
- package/dist/cjs/types/locales/vi.d.ts +0 -2
- package/dist/cjs/types/locales/zh-Hans.d.ts +0 -2
- package/dist/cjs/types/locales/zh-Hant.d.ts +0 -2
- package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +0 -19
- package/dist/cjs/types/menus/MRT_FilterOptionMenu.d.ts +0 -12
- package/dist/cjs/types/menus/MRT_RowActionMenu.d.ts +0 -11
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -9
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -11
- package/dist/cjs/types/menus/index.d.ts +0 -5
- package/dist/cjs/types/modals/MRT_EditRowModal.d.ts +0 -7
- package/dist/cjs/types/modals/index.d.ts +0 -1
- package/dist/cjs/types/sortingFns.d.ts +0 -12
- package/dist/cjs/types/table/MRT_Table.d.ts +0 -6
- package/dist/cjs/types/table/MRT_TableContainer.d.ts +0 -6
- package/dist/cjs/types/table/MRT_TablePaper.d.ts +0 -6
- package/dist/cjs/types/table/index.d.ts +0 -4
- package/dist/cjs/types/toolbar/MRT_BottomToolbar.d.ts +0 -6
- package/dist/cjs/types/toolbar/MRT_LinearProgressBar.d.ts +0 -7
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +0 -7
- package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -7
- package/dist/cjs/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -6
- package/dist/cjs/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -6
- package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +0 -21
- package/dist/cjs/types/toolbar/index.d.ts +0 -7
- package/dist/cjs/types/types.d.ts +0 -828
- package/dist/cjs/types/useMaterialReactTable.d.ts +0 -2
- package/dist/esm/types/MaterialReactTable.d.ts +0 -7
- package/dist/esm/types/aggregationFns.d.ts +0 -11
- package/dist/esm/types/body/MRT_TableBody.d.ts +0 -12
- package/dist/esm/types/body/MRT_TableBodyCell.d.ts +0 -15
- package/dist/esm/types/body/MRT_TableBodyCellValue.d.ts +0 -7
- package/dist/esm/types/body/MRT_TableBodyRow.d.ts +0 -18
- package/dist/esm/types/body/MRT_TableBodyRowGrabHandle.d.ts +0 -9
- package/dist/esm/types/body/MRT_TableBodyRowPinButton.d.ts +0 -7
- package/dist/esm/types/body/MRT_TableDetailPanel.d.ts +0 -12
- package/dist/esm/types/body/index.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_ColumnPinningButtons.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_CopyButton.d.ts +0 -9
- package/dist/esm/types/buttons/MRT_EditActionButtons.d.ts +0 -8
- package/dist/esm/types/buttons/MRT_ExpandAllButton.d.ts +0 -6
- package/dist/esm/types/buttons/MRT_ExpandButton.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +0 -12
- package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +0 -9
- package/dist/esm/types/buttons/MRT_ShowHideColumnsButton.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_ToggleDensePaddingButton.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_ToggleFiltersButton.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_ToggleFullScreenButton.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +0 -7
- package/dist/esm/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +0 -8
- package/dist/esm/types/buttons/index.d.ts +0 -13
- package/dist/esm/types/column.utils.d.ts +0 -149
- package/dist/esm/types/filterFns.d.ts +0 -69
- package/dist/esm/types/footer/MRT_TableFooter.d.ts +0 -10
- package/dist/esm/types/footer/MRT_TableFooterCell.d.ts +0 -7
- package/dist/esm/types/footer/MRT_TableFooterRow.d.ts +0 -11
- package/dist/esm/types/footer/index.d.ts +0 -3
- package/dist/esm/types/head/MRT_TableHead.d.ts +0 -10
- package/dist/esm/types/head/MRT_TableHeadCell.d.ts +0 -7
- package/dist/esm/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +0 -7
- package/dist/esm/types/head/MRT_TableHeadCellFilterContainer.d.ts +0 -7
- package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +0 -7
- package/dist/esm/types/head/MRT_TableHeadCellGrabHandle.d.ts +0 -9
- package/dist/esm/types/head/MRT_TableHeadCellResizeHandle.d.ts +0 -7
- package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +0 -9
- package/dist/esm/types/head/MRT_TableHeadRow.d.ts +0 -11
- package/dist/esm/types/head/index.d.ts +0 -9
- package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +0 -9
- package/dist/esm/types/hooks/useMRT_Effects.d.ts +0 -2
- package/dist/esm/types/hooks/useMRT_TableInstance.d.ts +0 -2
- package/dist/esm/types/hooks/useMRT_TableOptions.d.ts +0 -2
- package/dist/esm/types/icons.d.ts +0 -36
- package/dist/esm/types/index.d.ts +0 -16
- package/dist/esm/types/inputs/MRT_EditCellTextField.d.ts +0 -7
- package/dist/esm/types/inputs/MRT_FilterCheckbox.d.ts +0 -7
- package/dist/esm/types/inputs/MRT_FilterRangeFields.d.ts +0 -7
- package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +0 -7
- package/dist/esm/types/inputs/MRT_FilterTextField.d.ts +0 -8
- package/dist/esm/types/inputs/MRT_GlobalFilterTextField.d.ts +0 -6
- package/dist/esm/types/inputs/MRT_SelectCheckbox.d.ts +0 -8
- package/dist/esm/types/inputs/index.d.ts +0 -7
- package/dist/esm/types/locales/ar.d.ts +0 -2
- package/dist/esm/types/locales/bg.d.ts +0 -2
- package/dist/esm/types/locales/cs.d.ts +0 -2
- package/dist/esm/types/locales/da.d.ts +0 -2
- package/dist/esm/types/locales/de.d.ts +0 -2
- package/dist/esm/types/locales/en.d.ts +0 -2
- package/dist/esm/types/locales/es.d.ts +0 -2
- package/dist/esm/types/locales/et.d.ts +0 -2
- package/dist/esm/types/locales/fa.d.ts +0 -2
- package/dist/esm/types/locales/fi.d.ts +0 -2
- package/dist/esm/types/locales/fr.d.ts +0 -2
- package/dist/esm/types/locales/hu.d.ts +0 -2
- package/dist/esm/types/locales/hy.d.ts +0 -2
- package/dist/esm/types/locales/id.d.ts +0 -2
- package/dist/esm/types/locales/it.d.ts +0 -2
- package/dist/esm/types/locales/ja.d.ts +0 -2
- package/dist/esm/types/locales/ko.d.ts +0 -2
- package/dist/esm/types/locales/nl.d.ts +0 -2
- package/dist/esm/types/locales/no.d.ts +0 -2
- package/dist/esm/types/locales/np.d.ts +0 -2
- package/dist/esm/types/locales/pl.d.ts +0 -2
- package/dist/esm/types/locales/pt-BR.d.ts +0 -2
- package/dist/esm/types/locales/pt.d.ts +0 -2
- package/dist/esm/types/locales/ro.d.ts +0 -2
- package/dist/esm/types/locales/ru.d.ts +0 -2
- package/dist/esm/types/locales/sk.d.ts +0 -2
- package/dist/esm/types/locales/sr-Cyrl-RS.d.ts +0 -2
- package/dist/esm/types/locales/sr-Latn-RS.d.ts +0 -2
- package/dist/esm/types/locales/sv.d.ts +0 -2
- package/dist/esm/types/locales/tr.d.ts +0 -2
- package/dist/esm/types/locales/uk.d.ts +0 -2
- package/dist/esm/types/locales/vi.d.ts +0 -2
- package/dist/esm/types/locales/zh-Hans.d.ts +0 -2
- package/dist/esm/types/locales/zh-Hant.d.ts +0 -2
- package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +0 -19
- package/dist/esm/types/menus/MRT_FilterOptionMenu.d.ts +0 -12
- package/dist/esm/types/menus/MRT_RowActionMenu.d.ts +0 -11
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenu.d.ts +0 -9
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +0 -11
- package/dist/esm/types/menus/index.d.ts +0 -5
- package/dist/esm/types/modals/MRT_EditRowModal.d.ts +0 -7
- package/dist/esm/types/modals/index.d.ts +0 -1
- package/dist/esm/types/sortingFns.d.ts +0 -12
- package/dist/esm/types/table/MRT_Table.d.ts +0 -6
- package/dist/esm/types/table/MRT_TableContainer.d.ts +0 -6
- package/dist/esm/types/table/MRT_TablePaper.d.ts +0 -6
- package/dist/esm/types/table/index.d.ts +0 -4
- package/dist/esm/types/toolbar/MRT_BottomToolbar.d.ts +0 -6
- package/dist/esm/types/toolbar/MRT_LinearProgressBar.d.ts +0 -7
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +0 -7
- package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +0 -7
- package/dist/esm/types/toolbar/MRT_ToolbarDropZone.d.ts +0 -6
- package/dist/esm/types/toolbar/MRT_ToolbarInternalButtons.d.ts +0 -6
- package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +0 -21
- package/dist/esm/types/toolbar/index.d.ts +0 -7
- package/dist/esm/types/types.d.ts +0 -828
- package/dist/esm/types/useMaterialReactTable.d.ts +0 -2
- package/locales/ar.d.ts +0 -2
- package/locales/ar.esm.d.ts +0 -2
- package/locales/ar.esm.js.map +0 -1
- package/locales/ar.js.map +0 -1
- package/locales/bg.d.ts +0 -2
- package/locales/bg.esm.d.ts +0 -2
- package/locales/bg.esm.js.map +0 -1
- package/locales/bg.js.map +0 -1
- package/locales/cs.d.ts +0 -2
- package/locales/cs.esm.d.ts +0 -2
- package/locales/cs.esm.js.map +0 -1
- package/locales/cs.js.map +0 -1
- package/locales/da.d.ts +0 -2
- package/locales/da.esm.d.ts +0 -2
- package/locales/da.esm.js.map +0 -1
- package/locales/da.js.map +0 -1
- package/locales/de.d.ts +0 -2
- package/locales/de.esm.d.ts +0 -2
- package/locales/de.esm.js.map +0 -1
- package/locales/de.js.map +0 -1
- package/locales/en.d.ts +0 -2
- package/locales/en.esm.d.ts +0 -2
- package/locales/en.esm.js.map +0 -1
- package/locales/en.js.map +0 -1
- package/locales/es.d.ts +0 -2
- package/locales/es.esm.d.ts +0 -2
- package/locales/es.esm.js.map +0 -1
- package/locales/es.js.map +0 -1
- package/locales/et.d.ts +0 -2
- package/locales/et.esm.d.ts +0 -2
- package/locales/et.esm.js.map +0 -1
- package/locales/et.js.map +0 -1
- package/locales/fa.d.ts +0 -2
- package/locales/fa.esm.d.ts +0 -2
- package/locales/fa.esm.js.map +0 -1
- package/locales/fa.js.map +0 -1
- package/locales/fi.d.ts +0 -2
- package/locales/fi.esm.d.ts +0 -2
- package/locales/fi.esm.js.map +0 -1
- package/locales/fi.js.map +0 -1
- package/locales/fr.d.ts +0 -2
- package/locales/fr.esm.d.ts +0 -2
- package/locales/fr.esm.js.map +0 -1
- package/locales/fr.js.map +0 -1
- package/locales/hu.d.ts +0 -2
- package/locales/hu.esm.d.ts +0 -2
- package/locales/hu.esm.js.map +0 -1
- package/locales/hu.js.map +0 -1
- package/locales/hy.d.ts +0 -2
- package/locales/hy.esm.d.ts +0 -2
- package/locales/hy.esm.js.map +0 -1
- package/locales/hy.js.map +0 -1
- package/locales/id.d.ts +0 -2
- package/locales/id.esm.d.ts +0 -2
- package/locales/id.esm.js.map +0 -1
- package/locales/id.js.map +0 -1
- package/locales/it.d.ts +0 -2
- package/locales/it.esm.d.ts +0 -2
- package/locales/it.esm.js.map +0 -1
- package/locales/it.js.map +0 -1
- package/locales/ja.d.ts +0 -2
- package/locales/ja.esm.d.ts +0 -2
- package/locales/ja.esm.js.map +0 -1
- package/locales/ja.js.map +0 -1
- package/locales/ko.d.ts +0 -2
- package/locales/ko.esm.d.ts +0 -2
- package/locales/ko.esm.js.map +0 -1
- package/locales/ko.js.map +0 -1
- package/locales/nl.d.ts +0 -2
- package/locales/nl.esm.d.ts +0 -2
- package/locales/nl.esm.js.map +0 -1
- package/locales/nl.js.map +0 -1
- package/locales/no.d.ts +0 -2
- package/locales/no.esm.d.ts +0 -2
- package/locales/no.esm.js.map +0 -1
- package/locales/no.js.map +0 -1
- package/locales/np.d.ts +0 -2
- package/locales/np.esm.d.ts +0 -2
- package/locales/np.esm.js.map +0 -1
- package/locales/np.js.map +0 -1
- package/locales/pl.d.ts +0 -2
- package/locales/pl.esm.d.ts +0 -2
- package/locales/pl.esm.js.map +0 -1
- package/locales/pl.js.map +0 -1
- package/locales/pt-BR.d.ts +0 -2
- package/locales/pt-BR.esm.d.ts +0 -2
- package/locales/pt-BR.esm.js.map +0 -1
- package/locales/pt-BR.js.map +0 -1
- package/locales/pt.d.ts +0 -2
- package/locales/pt.esm.d.ts +0 -2
- package/locales/pt.esm.js.map +0 -1
- package/locales/pt.js.map +0 -1
- package/locales/ro.d.ts +0 -2
- package/locales/ro.esm.d.ts +0 -2
- package/locales/ro.esm.js.map +0 -1
- package/locales/ro.js.map +0 -1
- package/locales/ru.d.ts +0 -2
- package/locales/ru.esm.d.ts +0 -2
- package/locales/ru.esm.js.map +0 -1
- package/locales/ru.js.map +0 -1
- package/locales/sk.d.ts +0 -2
- package/locales/sk.esm.d.ts +0 -2
- package/locales/sk.esm.js.map +0 -1
- package/locales/sk.js.map +0 -1
- package/locales/sr-Cyrl-RS.d.ts +0 -2
- package/locales/sr-Cyrl-RS.esm.d.ts +0 -2
- package/locales/sr-Cyrl-RS.esm.js.map +0 -1
- package/locales/sr-Cyrl-RS.js.map +0 -1
- package/locales/sr-Latn-RS.d.ts +0 -2
- package/locales/sr-Latn-RS.esm.d.ts +0 -2
- package/locales/sr-Latn-RS.esm.js.map +0 -1
- package/locales/sr-Latn-RS.js.map +0 -1
- package/locales/sv.d.ts +0 -2
- package/locales/sv.esm.d.ts +0 -2
- package/locales/sv.esm.js.map +0 -1
- package/locales/sv.js.map +0 -1
- package/locales/tr.d.ts +0 -2
- package/locales/tr.esm.d.ts +0 -2
- package/locales/tr.esm.js.map +0 -1
- package/locales/tr.js.map +0 -1
- package/locales/uk.d.ts +0 -2
- package/locales/uk.esm.d.ts +0 -2
- package/locales/uk.esm.js.map +0 -1
- package/locales/uk.js.map +0 -1
- package/locales/vi.d.ts +0 -2
- package/locales/vi.esm.d.ts +0 -2
- package/locales/vi.esm.js.map +0 -1
- package/locales/vi.js.map +0 -1
- package/locales/zh-Hans.d.ts +0 -2
- package/locales/zh-Hans.esm.d.ts +0 -2
- package/locales/zh-Hans.esm.js.map +0 -1
- package/locales/zh-Hans.js.map +0 -1
- package/locales/zh-Hant.d.ts +0 -2
- package/locales/zh-Hant.esm.d.ts +0 -2
- package/locales/zh-Hant.esm.js.map +0 -1
- package/locales/zh-Hant.js.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
|
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 newIndexs = reactVirtual.defaultRangeExtractor(range);
|
|
297
|
+
if (draggingIndex >= 0 &&
|
|
298
|
+
draggingIndex < Math.max(range.startIndex - range.overscan, 0)) {
|
|
299
|
+
newIndexs.unshift(draggingIndex);
|
|
300
|
+
}
|
|
301
|
+
if (draggingIndex >= 0 && draggingIndex > range.endIndex + range.overscan) {
|
|
302
|
+
newIndexs.push(draggingIndex);
|
|
303
|
+
}
|
|
304
|
+
return newIndexs;
|
|
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) }, table.options.mrtTheme));
|
|
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.
|
|
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.
|
|
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.
|
|
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,76 +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
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
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 (
|
|
494
|
-
|
|
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
|
+
}
|
|
495
435
|
}
|
|
496
|
-
|
|
436
|
+
if (columnDef.Cell && !isGroupedValue) {
|
|
437
|
+
renderedCellValue = columnDef.Cell({
|
|
438
|
+
cell,
|
|
439
|
+
column,
|
|
440
|
+
renderedCellValue,
|
|
441
|
+
row,
|
|
442
|
+
table,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
return renderedCellValue;
|
|
497
446
|
};
|
|
498
|
-
function createMRTColumnHelper() {
|
|
499
|
-
return {
|
|
500
|
-
accessor: (accessor, column) => {
|
|
501
|
-
return typeof accessor === 'function'
|
|
502
|
-
? Object.assign(Object.assign({}, column), { accessorFn: accessor })
|
|
503
|
-
: Object.assign(Object.assign({}, column), { accessorKey: accessor });
|
|
504
|
-
},
|
|
505
|
-
display: (column) => column,
|
|
506
|
-
group: (column) => column,
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
447
|
|
|
510
|
-
const MRT_GrabHandleButton = (
|
|
511
|
-
var
|
|
448
|
+
const MRT_GrabHandleButton = (_a) => {
|
|
449
|
+
var _b;
|
|
450
|
+
var { iconButtonProps, location, onDragEnd, onDragStart, table } = _a, rest = __rest(_a, ["iconButtonProps", "location", "onDragEnd", "onDragStart", "table"]);
|
|
512
451
|
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
|
513
|
-
|
|
452
|
+
const _iconButtonProps = Object.assign(Object.assign({}, iconButtonProps), rest);
|
|
453
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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) => {
|
|
514
454
|
var _a;
|
|
515
455
|
e.stopPropagation();
|
|
516
|
-
(_a =
|
|
456
|
+
(_a = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(_iconButtonProps, e);
|
|
517
457
|
}, onDragEnd: onDragEnd, onDragStart: onDragStart, sx: (theme) => (Object.assign({ '&:active': {
|
|
518
458
|
cursor: 'grabbing',
|
|
519
459
|
}, '&:hover': {
|
|
520
460
|
backgroundColor: 'transparent',
|
|
521
461
|
opacity: 1,
|
|
522
|
-
}, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.3, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(
|
|
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, {}) })) }));
|
|
523
463
|
};
|
|
524
464
|
|
|
525
|
-
const MRT_TableBodyRowGrabHandle = (
|
|
465
|
+
const MRT_TableBodyRowGrabHandle = (_a) => {
|
|
466
|
+
var { row, rowRef, table } = _a, rest = __rest(_a, ["row", "rowRef", "table"]);
|
|
526
467
|
const { options: { muiRowDragHandleProps }, } = table;
|
|
527
|
-
const iconButtonProps = parseFromValuesOrFunc(muiRowDragHandleProps, {
|
|
468
|
+
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiRowDragHandleProps, {
|
|
528
469
|
row,
|
|
529
470
|
table,
|
|
530
|
-
});
|
|
471
|
+
})), rest);
|
|
531
472
|
const handleDragStart = (event) => {
|
|
532
473
|
var _a;
|
|
533
474
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
|
@@ -543,8 +484,9 @@ const MRT_TableBodyRowGrabHandle = ({ row, rowRef, table, }) => {
|
|
|
543
484
|
return (jsxRuntime.jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, location: "row", onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
|
|
544
485
|
};
|
|
545
486
|
|
|
546
|
-
const MRT_CopyButton = (
|
|
547
|
-
var
|
|
487
|
+
const MRT_CopyButton = (_a) => {
|
|
488
|
+
var _b;
|
|
489
|
+
var { cell, table } = _a, rest = __rest(_a, ["cell", "table"]);
|
|
548
490
|
const { options: { localization, muiCopyButtonProps }, } = table;
|
|
549
491
|
const { column, row } = cell;
|
|
550
492
|
const { columnDef } = column;
|
|
@@ -555,7 +497,7 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
|
555
497
|
setCopied(true);
|
|
556
498
|
setTimeout(() => setCopied(false), 4000);
|
|
557
499
|
};
|
|
558
|
-
const buttonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCopyButtonProps, {
|
|
500
|
+
const buttonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCopyButtonProps, {
|
|
559
501
|
cell,
|
|
560
502
|
column,
|
|
561
503
|
row,
|
|
@@ -565,12 +507,13 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
|
565
507
|
column,
|
|
566
508
|
row,
|
|
567
509
|
table,
|
|
568
|
-
}));
|
|
569
|
-
return (jsxRuntime.jsx(
|
|
510
|
+
})), rest);
|
|
511
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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 })) }));
|
|
570
512
|
};
|
|
571
513
|
|
|
572
|
-
const MRT_EditCellTextField = (
|
|
573
|
-
var
|
|
514
|
+
const MRT_EditCellTextField = (_a) => {
|
|
515
|
+
var _b, _c, _d, _e;
|
|
516
|
+
var { cell, table } = _a, rest = __rest(_a, ["cell", "table"]);
|
|
574
517
|
const { getState, options: { createDisplayMode, editDisplayMode, muiEditTextFieldProps }, refs: { editInputRefs }, setCreatingRow, setEditingCell, setEditingRow, } = table;
|
|
575
518
|
const { column, row } = cell;
|
|
576
519
|
const { columnDef } = column;
|
|
@@ -579,7 +522,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
579
522
|
const isEditing = (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id;
|
|
580
523
|
const isSelectEdit = columnDef.editVariant === 'select';
|
|
581
524
|
const [value, setValue] = react.useState(() => cell.getValue());
|
|
582
|
-
const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditTextFieldProps, {
|
|
525
|
+
const textFieldProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditTextFieldProps, {
|
|
583
526
|
cell,
|
|
584
527
|
column,
|
|
585
528
|
row,
|
|
@@ -589,7 +532,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
589
532
|
column,
|
|
590
533
|
row,
|
|
591
534
|
table,
|
|
592
|
-
}));
|
|
535
|
+
})), rest);
|
|
593
536
|
const saveInputValueToRowCache = (newValue) => {
|
|
594
537
|
//@ts-ignore
|
|
595
538
|
row._valuesCache[column.id] = newValue;
|
|
@@ -622,9 +565,9 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
622
565
|
}
|
|
623
566
|
};
|
|
624
567
|
if (columnDef.Edit) {
|
|
625
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: (
|
|
568
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: (_b = columnDef.Edit) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, row, table }) });
|
|
626
569
|
}
|
|
627
|
-
return (jsxRuntime.jsx(
|
|
570
|
+
return (jsxRuntime.jsx(TextField, Object.assign({ disabled: parseFromValuesOrFunc(columnDef.enableEditing, row) === false, fullWidth: true, inputRef: (inputRef) => {
|
|
628
571
|
if (inputRef) {
|
|
629
572
|
editInputRefs.current[column.id] = inputRef;
|
|
630
573
|
if (textFieldProps.inputRef) {
|
|
@@ -635,11 +578,14 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
635
578
|
? columnDef.header
|
|
636
579
|
: undefined, margin: "none", name: column.id, placeholder: !['custom', 'modal'].includes((isCreating ? createDisplayMode : editDisplayMode))
|
|
637
580
|
? columnDef.header
|
|
638
|
-
: undefined, select: isSelectEdit, value: value, variant: "standard" }, textFieldProps, { InputProps: Object.assign({ disableUnderline: editDisplayMode === 'table' }, textFieldProps.InputProps),
|
|
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', sx: Object.assign({ p: 0 }, (_c = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputProps) === null || _c === void 0 ? void 0 : _c.sx) }, textFieldProps.inputProps), onBlur: handleBlur, onChange: handleChange, onClick: (e) => {
|
|
639
585
|
var _a;
|
|
640
586
|
e.stopPropagation();
|
|
641
587
|
(_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
|
|
642
|
-
}, onKeyDown: handleEnterKeyDown, children: (
|
|
588
|
+
}, onKeyDown: handleEnterKeyDown, children: (_d = textFieldProps.children) !== null && _d !== void 0 ? _d : (_e = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _e === void 0 ? void 0 : _e.map((option) => {
|
|
643
589
|
let value;
|
|
644
590
|
let text;
|
|
645
591
|
if (typeof option !== 'object') {
|
|
@@ -650,7 +596,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
650
596
|
value = option.value;
|
|
651
597
|
text = option.text;
|
|
652
598
|
}
|
|
653
|
-
return (jsxRuntime.jsx(
|
|
599
|
+
return (jsxRuntime.jsx(MenuItem, { sx: {
|
|
654
600
|
alignItems: 'center',
|
|
655
601
|
display: 'flex',
|
|
656
602
|
gap: '0.5rem',
|
|
@@ -659,31 +605,24 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
659
605
|
}) })));
|
|
660
606
|
};
|
|
661
607
|
|
|
662
|
-
const MRT_TableBodyCell = (
|
|
663
|
-
var
|
|
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"]);
|
|
664
611
|
const theme = styles.useTheme();
|
|
665
612
|
const { getState, options: { createDisplayMode, editDisplayMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enableRowNumbers, layoutMode, muiSkeletonProps, muiTableBodyCellProps, rowNumberMode, }, refs: { editInputRefs }, setEditingCell, setHoveredColumn, } = table;
|
|
666
613
|
const { columnSizingInfo, creatingRow, density, draggingColumn, draggingRow, editingCell, editingRow, hoveredColumn, hoveredRow, isLoading, showSkeletons, } = getState();
|
|
667
614
|
const { column, row } = cell;
|
|
668
615
|
const { columnDef } = column;
|
|
669
616
|
const { columnDefType } = columnDef;
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
column,
|
|
673
|
-
row,
|
|
674
|
-
table,
|
|
675
|
-
})), parseFromValuesOrFunc(columnDef.muiTableBodyCellProps, {
|
|
676
|
-
cell,
|
|
677
|
-
column,
|
|
678
|
-
row,
|
|
679
|
-
table,
|
|
680
|
-
}));
|
|
617
|
+
const args = { cell, column, row, table };
|
|
618
|
+
const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableBodyCellProps, args)), rest);
|
|
681
619
|
const skeletonProps = parseFromValuesOrFunc(muiSkeletonProps, {
|
|
682
620
|
cell,
|
|
683
621
|
column,
|
|
684
622
|
row,
|
|
685
623
|
table,
|
|
686
624
|
});
|
|
625
|
+
const { draggingBorderColor } = getMRTTheme(table, theme);
|
|
687
626
|
const [skeletonWidth, setSkeletonWidth] = react.useState(100);
|
|
688
627
|
react.useEffect(() => {
|
|
689
628
|
if ((!isLoading && !showSkeletons) || skeletonWidth !== 100)
|
|
@@ -702,13 +641,13 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
|
702
641
|
const isLastColumn = getIsLastColumn(column, table);
|
|
703
642
|
const isLastRow = numRows && rowIndex === numRows - 1;
|
|
704
643
|
const borderStyle = columnSizingInfo.isResizingColumn === column.id
|
|
705
|
-
? `2px solid ${
|
|
644
|
+
? `2px solid ${draggingBorderColor} !important`
|
|
706
645
|
: isDraggingColumn || isDraggingRow
|
|
707
|
-
? `1px dashed ${theme.palette.
|
|
646
|
+
? `1px dashed ${theme.palette.grey[500]} !important`
|
|
708
647
|
: isHoveredColumn ||
|
|
709
648
|
isHoveredRow ||
|
|
710
649
|
columnSizingInfo.isResizingColumn === column.id
|
|
711
|
-
? `2px dashed ${
|
|
650
|
+
? `2px dashed ${draggingBorderColor} !important`
|
|
712
651
|
: undefined;
|
|
713
652
|
if (columnSizingInfo.isResizingColumn === column.id) {
|
|
714
653
|
return { borderRight: borderStyle };
|
|
@@ -773,13 +712,13 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
|
773
712
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
774
713
|
}
|
|
775
714
|
};
|
|
776
|
-
return (jsxRuntime.jsx(
|
|
715
|
+
return (jsxRuntime.jsx(TableCell, Object.assign({ "data-index": virtualIndex, ref: (node) => {
|
|
777
716
|
if (node) {
|
|
778
717
|
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
|
779
718
|
}
|
|
780
719
|
} }, tableCellProps, { onDoubleClick: handleDoubleClick, onDragEnter: handleDragEnter, sx: (theme) => (Object.assign(Object.assign({ '&:hover': {
|
|
781
|
-
outline: ['cell', 'table'].includes(editDisplayMode !== null && editDisplayMode !== void 0 ? editDisplayMode : '')
|
|
782
|
-
? `1px solid ${theme.palette.
|
|
720
|
+
outline: ['cell', 'table'].includes(editDisplayMode !== null && editDisplayMode !== void 0 ? editDisplayMode : '') && isEditable
|
|
721
|
+
? `1px solid ${theme.palette.grey[500]}`
|
|
783
722
|
: undefined,
|
|
784
723
|
outlineOffset: '-1px',
|
|
785
724
|
textOverflow: 'clip',
|
|
@@ -802,28 +741,29 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
|
802
741
|
: density === 'comfortable'
|
|
803
742
|
? 0.75
|
|
804
743
|
: 1.25)}rem`
|
|
805
|
-
: 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 },
|
|
744
|
+
: 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 }, getCommonMRTCellStyles({
|
|
806
745
|
column,
|
|
807
746
|
table,
|
|
808
747
|
tableCellProps,
|
|
809
748
|
theme,
|
|
810
|
-
})), draggingBorders)), children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [cell.getIsPlaceholder() ? ((
|
|
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 &&
|
|
811
750
|
rowNumberMode === 'static' &&
|
|
812
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' &&
|
|
813
752
|
(column.id === 'mrt-row-select' ||
|
|
814
753
|
column.id === 'mrt-row-expand' ||
|
|
815
|
-
!row.getIsGrouped()) ? ((
|
|
754
|
+
!row.getIsGrouped()) ? ((_e = columnDef.Cell) === null || _e === void 0 ? void 0 : _e.call(columnDef, {
|
|
816
755
|
cell,
|
|
817
756
|
column,
|
|
818
757
|
renderedCellValue: cell.renderValue(),
|
|
819
758
|
row,
|
|
820
759
|
table,
|
|
821
760
|
})) : isCreating || isEditing ? (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
|
822
|
-
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: [" (", (
|
|
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, ")"] }))] })) })));
|
|
823
762
|
};
|
|
824
763
|
const Memo_MRT_TableBodyCell = react.memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
|
|
825
764
|
|
|
826
|
-
const MRT_TableDetailPanel = (
|
|
765
|
+
const MRT_TableDetailPanel = (_a) => {
|
|
766
|
+
var { parentRowRef, row, rowIndex, table, virtualRow } = _a, rest = __rest(_a, ["parentRowRef", "row", "rowIndex", "table", "virtualRow"]);
|
|
827
767
|
const { getState, getVisibleLeafColumns, options: { layoutMode, muiDetailPanelProps, muiTableBodyRowProps, renderDetailPanel, }, } = table;
|
|
828
768
|
const { isLoading } = getState();
|
|
829
769
|
const tableRowProps = parseFromValuesOrFunc(muiTableBodyRowProps, {
|
|
@@ -832,20 +772,20 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
|
|
|
832
772
|
staticRowIndex: rowIndex,
|
|
833
773
|
table,
|
|
834
774
|
});
|
|
835
|
-
const tableCellProps = parseFromValuesOrFunc(muiDetailPanelProps, {
|
|
775
|
+
const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiDetailPanelProps, {
|
|
836
776
|
row,
|
|
837
777
|
table,
|
|
838
|
-
});
|
|
839
|
-
return (jsxRuntime.jsx(
|
|
778
|
+
})), rest);
|
|
779
|
+
return (jsxRuntime.jsx(TableRow, Object.assign({ className: "Mui-TableBodyCell-DetailPanel" }, tableRowProps, { sx: (theme) => {
|
|
840
780
|
var _a, _b;
|
|
841
781
|
return (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, position: virtualRow ? 'absolute' : undefined, top: virtualRow
|
|
842
782
|
? `${(_b = (_a = parentRowRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.height}px`
|
|
843
783
|
: undefined, transform: virtualRow
|
|
844
784
|
? `translateY(${virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.start}px)`
|
|
845
785
|
: undefined, width: '100%', zIndex: virtualRow ? 2 : undefined }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme)));
|
|
846
|
-
}, children: jsxRuntime.jsx(
|
|
847
|
-
?
|
|
848
|
-
: undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' :
|
|
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 }) })) })) })));
|
|
849
789
|
};
|
|
850
790
|
|
|
851
791
|
const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
|
|
@@ -885,7 +825,8 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
|
885
825
|
}
|
|
886
826
|
};
|
|
887
827
|
const rowRef = react.useRef(null);
|
|
888
|
-
|
|
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, onDragEnter: handleDragEnter, ref: (node) => {
|
|
889
830
|
if (node) {
|
|
890
831
|
rowRef.current = node;
|
|
891
832
|
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
|
@@ -895,16 +836,16 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
|
895
836
|
: undefined }, tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style), sx: (theme) => (Object.assign({ '&:hover td': {
|
|
896
837
|
backgroundColor: (tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.hover) !== false
|
|
897
838
|
? row.getIsSelected()
|
|
898
|
-
? `${styles.alpha(
|
|
839
|
+
? `${styles.alpha(selectedRowBackgroundColor, 0.3)}`
|
|
899
840
|
: theme.palette.mode === 'dark'
|
|
900
|
-
? `${styles.lighten(
|
|
901
|
-
: `${styles.darken(
|
|
841
|
+
? `${styles.lighten(baseBackgroundColor, 0.05)}`
|
|
842
|
+
: `${styles.darken(baseBackgroundColor, 0.05)}`
|
|
902
843
|
: undefined,
|
|
903
|
-
}, backgroundColor: `${
|
|
844
|
+
}, backgroundColor: `${baseBackgroundColor} !important`, bottom: !virtualRow && bottomPinnedIndex !== undefined && isPinned
|
|
904
845
|
? `${bottomPinnedIndex * rowHeight +
|
|
905
846
|
(enableStickyFooter ? tableFooterHeight - 1 : 0)}px`
|
|
906
847
|
: undefined, boxSizing: 'border-box', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, opacity: isPinned
|
|
907
|
-
? 0.
|
|
848
|
+
? 0.97
|
|
908
849
|
: (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id || (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id
|
|
909
850
|
? 0.5
|
|
910
851
|
: 1, position: virtualRow
|
|
@@ -913,9 +854,9 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
|
913
854
|
? 'sticky'
|
|
914
855
|
: undefined, td: {
|
|
915
856
|
backgroundColor: row.getIsSelected()
|
|
916
|
-
?
|
|
857
|
+
? selectedRowBackgroundColor
|
|
917
858
|
: isPinned
|
|
918
|
-
?
|
|
859
|
+
? pinnedRowBackgroundColor
|
|
919
860
|
: undefined,
|
|
920
861
|
}, top: virtualRow
|
|
921
862
|
? 0
|
|
@@ -935,8 +876,8 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
|
935
876
|
rowIndex,
|
|
936
877
|
rowRef,
|
|
937
878
|
table,
|
|
938
|
-
|
|
939
|
-
? cellOrVirtualCell
|
|
879
|
+
virtualIndex: columnVirtualizer
|
|
880
|
+
? cellOrVirtualCell.index
|
|
940
881
|
: undefined,
|
|
941
882
|
};
|
|
942
883
|
return cell ? (memoMode === 'cells' &&
|
|
@@ -963,18 +904,19 @@ const MRT_SortingFns = Object.assign(Object.assign({}, reactTable.sortingFns), {
|
|
|
963
904
|
const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
|
|
964
905
|
Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
|
|
965
906
|
|
|
966
|
-
const MRT_TableBody = (
|
|
967
|
-
var
|
|
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"]);
|
|
968
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;
|
|
969
911
|
const { columnFilters, creatingRow, density, draggingRow, expanded, globalFilter, isFullScreen, pagination, rowPinning, sorting, } = getState();
|
|
970
|
-
const tableBodyProps = parseFromValuesOrFunc(muiTableBodyProps, { table });
|
|
912
|
+
const tableBodyProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyProps, { table })), rest);
|
|
971
913
|
const rowVirtualizerProps = parseFromValuesOrFunc(rowVirtualizerOptions, {
|
|
972
914
|
table,
|
|
973
915
|
});
|
|
974
916
|
const tableHeadHeight = ((enableStickyHeader || isFullScreen) &&
|
|
975
|
-
((
|
|
917
|
+
((_b = tableHeadRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) ||
|
|
976
918
|
0;
|
|
977
|
-
const tableFooterHeight = (enableStickyFooter && ((
|
|
919
|
+
const tableFooterHeight = (enableStickyFooter && ((_c = tableFooterRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight)) || 0;
|
|
978
920
|
const shouldRankRows = react.useMemo(() => getCanRankRows(table) &&
|
|
979
921
|
!Object.values(sorting).some(Boolean) &&
|
|
980
922
|
globalFilter, [
|
|
@@ -1036,7 +978,7 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
|
1036
978
|
? rowVirtualizer.getVirtualItems()
|
|
1037
979
|
: undefined;
|
|
1038
980
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!(rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) &&
|
|
1039
|
-
getIsSomeRowsPinned('top') && (jsxRuntime.jsx(
|
|
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) => {
|
|
1040
982
|
const props = {
|
|
1041
983
|
columnVirtualizer,
|
|
1042
984
|
measureElement: rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement,
|
|
@@ -1049,18 +991,16 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
|
1049
991
|
virtualPaddingRight,
|
|
1050
992
|
};
|
|
1051
993
|
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
|
|
1052
|
-
}) }))), jsxRuntime.jsxs(
|
|
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
|
|
1053
995
|
? `${rowVirtualizer.getTotalSize()}px`
|
|
1054
|
-
: '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 })), (
|
|
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: {
|
|
1055
997
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
|
1056
998
|
}, children: jsxRuntime.jsx("td", { colSpan: table.getVisibleLeafColumns().length, style: {
|
|
1057
|
-
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid'))
|
|
1058
|
-
|
|
1059
|
-
: 'table-cell',
|
|
1060
|
-
}, children: (_d = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _d !== void 0 ? _d : (jsxRuntime.jsx(Typography__default["default"], { sx: {
|
|
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: {
|
|
1061
1001
|
color: 'text.secondary',
|
|
1062
1002
|
fontStyle: 'italic',
|
|
1063
|
-
maxWidth: `min(100vw, ${(
|
|
1003
|
+
maxWidth: `min(100vw, ${(_g = (_f = tablePaperRef.current) === null || _f === void 0 ? void 0 : _f.clientWidth) !== null && _g !== void 0 ? _g : 360}px)`,
|
|
1064
1004
|
py: '2rem',
|
|
1065
1005
|
textAlign: 'center',
|
|
1066
1006
|
width: '100%',
|
|
@@ -1087,7 +1027,7 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
|
1087
1027
|
};
|
|
1088
1028
|
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
|
|
1089
1029
|
}) })))] })), !(rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) &&
|
|
1090
|
-
getIsSomeRowsPinned('bottom') && (jsxRuntime.jsx(
|
|
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) => {
|
|
1091
1031
|
const props = {
|
|
1092
1032
|
columnVirtualizer,
|
|
1093
1033
|
measureElement: rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement,
|
|
@@ -1104,48 +1044,48 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
|
1104
1044
|
};
|
|
1105
1045
|
const Memo_MRT_TableBody = react.memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
|
|
1106
1046
|
|
|
1107
|
-
const MRT_TableFooterCell = (
|
|
1108
|
-
var
|
|
1047
|
+
const MRT_TableFooterCell = (_a) => {
|
|
1048
|
+
var _b, _c, _d;
|
|
1049
|
+
var { footer, table } = _a, rest = __rest(_a, ["footer", "table"]);
|
|
1109
1050
|
const { getState, options: { layoutMode, muiTableFooterCellProps }, } = table;
|
|
1110
1051
|
const { density } = getState();
|
|
1111
1052
|
const { column } = footer;
|
|
1112
1053
|
const { columnDef } = column;
|
|
1113
1054
|
const { columnDefType } = columnDef;
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
}));
|
|
1118
|
-
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'
|
|
1119
1058
|
? '0.5rem'
|
|
1120
1059
|
: density === 'comfortable'
|
|
1121
1060
|
? '1rem'
|
|
1122
|
-
: '1.5rem', verticalAlign: 'top', zIndex: column.getIsPinned() && columnDefType !== 'group' ? 2 : 1 },
|
|
1061
|
+
: '1.5rem', verticalAlign: 'top', zIndex: column.getIsPinned() && columnDefType !== 'group' ? 2 : 1 }, getCommonMRTCellStyles({
|
|
1123
1062
|
column,
|
|
1124
1063
|
table,
|
|
1125
1064
|
tableCellProps,
|
|
1126
1065
|
theme,
|
|
1127
|
-
}))), children:
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
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) })));
|
|
1134
1073
|
};
|
|
1135
1074
|
|
|
1136
|
-
const MRT_TableFooterRow = (
|
|
1137
|
-
var
|
|
1075
|
+
const MRT_TableFooterRow = (_a) => {
|
|
1076
|
+
var _b;
|
|
1077
|
+
var { footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["footerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
1138
1078
|
const { options: { layoutMode, muiTableFooterRowProps }, } = table;
|
|
1139
1079
|
// if no content in row, skip row
|
|
1140
|
-
if (!((
|
|
1080
|
+
if (!((_b = footerGroup.headers) === null || _b === void 0 ? void 0 : _b.some((header) => (typeof header.column.columnDef.footer === 'string' &&
|
|
1141
1081
|
!!header.column.columnDef.footer) ||
|
|
1142
1082
|
header.column.columnDef.Footer)))
|
|
1143
1083
|
return null;
|
|
1144
|
-
const tableRowProps = parseFromValuesOrFunc(muiTableFooterRowProps, {
|
|
1084
|
+
const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterRowProps, {
|
|
1145
1085
|
footerGroup,
|
|
1146
1086
|
table,
|
|
1147
|
-
});
|
|
1148
|
-
return (jsxRuntime.jsxs(
|
|
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) => {
|
|
1149
1089
|
const footer = virtualColumns
|
|
1150
1090
|
? footerGroup.headers[footerOrVirtualFooter.index]
|
|
1151
1091
|
: footerOrVirtualFooter;
|
|
@@ -1153,14 +1093,15 @@ const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPadding
|
|
|
1153
1093
|
}), virtualPaddingRight ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
|
|
1154
1094
|
};
|
|
1155
1095
|
|
|
1156
|
-
const MRT_TableFooter = (
|
|
1096
|
+
const MRT_TableFooter = (_a) => {
|
|
1097
|
+
var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
1157
1098
|
const { getFooterGroups, getState, options: { enableStickyFooter, layoutMode, muiTableFooterProps }, refs: { tableFooterRef }, } = table;
|
|
1158
1099
|
const { isFullScreen } = getState();
|
|
1159
|
-
const tableFooterProps = parseFromValuesOrFunc(muiTableFooterProps, {
|
|
1100
|
+
const tableFooterProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterProps, {
|
|
1160
1101
|
table,
|
|
1161
|
-
});
|
|
1102
|
+
})), rest);
|
|
1162
1103
|
const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
|
|
1163
|
-
return (jsxRuntime.jsx(
|
|
1104
|
+
return (jsxRuntime.jsx(TableFooter, Object.assign({}, tableFooterProps, { ref: (ref) => {
|
|
1164
1105
|
tableFooterRef.current = ref;
|
|
1165
1106
|
if (tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.ref) {
|
|
1166
1107
|
// @ts-ignore
|
|
@@ -1263,14 +1204,15 @@ const rangeModes = ['between', 'betweenInclusive', 'inNumberRange'];
|
|
|
1263
1204
|
const emptyModes = ['empty', 'notEmpty'];
|
|
1264
1205
|
const arrModes = ['arrIncludesSome', 'arrIncludesAll', 'arrIncludes'];
|
|
1265
1206
|
const rangeVariants = ['range-slider', 'date-range', 'range'];
|
|
1266
|
-
const MRT_FilterOptionMenu = (
|
|
1267
|
-
var
|
|
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"]);
|
|
1268
1210
|
const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
1269
1211
|
const { density, globalFilterFn } = getState();
|
|
1270
1212
|
const { column } = header !== null && header !== void 0 ? header : {};
|
|
1271
1213
|
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
|
1272
1214
|
const currentFilterValue = column === null || column === void 0 ? void 0 : column.getFilterValue();
|
|
1273
|
-
let allowedColumnFilterOptions = (
|
|
1215
|
+
let allowedColumnFilterOptions = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _b !== void 0 ? _b : columnFilterModeOptions;
|
|
1274
1216
|
if (rangeVariants.includes(columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant)) {
|
|
1275
1217
|
allowedColumnFilterOptions = [
|
|
1276
1218
|
...rangeModes,
|
|
@@ -1344,15 +1286,15 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
|
1344
1286
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
1345
1287
|
};
|
|
1346
1288
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
|
1347
|
-
return (jsxRuntime.jsx(
|
|
1289
|
+
return (jsxRuntime.jsx(Menu, Object.assign({ MenuListProps: {
|
|
1348
1290
|
dense: density === 'compact',
|
|
1349
|
-
}, anchorEl: anchorEl, anchorOrigin: { horizontal: 'right', vertical: 'center' }, onClose: () => setAnchorEl(null), open: !!anchorEl, children: (
|
|
1350
|
-
? (
|
|
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, {
|
|
1351
1293
|
column: column,
|
|
1352
1294
|
internalFilterOptions,
|
|
1353
1295
|
onSelectFilterMode: handleSelectFilterMode,
|
|
1354
1296
|
table,
|
|
1355
|
-
})) !== null &&
|
|
1297
|
+
})) !== null && _d !== void 0 ? _d : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
|
|
1356
1298
|
column: column,
|
|
1357
1299
|
internalFilterOptions,
|
|
1358
1300
|
onSelectFilterMode: handleSelectFilterMode,
|
|
@@ -1362,13 +1304,13 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
|
1362
1304
|
internalFilterOptions,
|
|
1363
1305
|
onSelectFilterMode: handleSelectFilterMode,
|
|
1364
1306
|
table,
|
|
1365
|
-
}))) !== null &&
|
|
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: {
|
|
1366
1308
|
alignItems: 'center',
|
|
1367
1309
|
display: 'flex',
|
|
1368
1310
|
gap: '2ch',
|
|
1369
1311
|
my: 0,
|
|
1370
1312
|
py: '6px',
|
|
1371
|
-
}, value: option, children: [jsxRuntime.jsx(
|
|
1313
|
+
}, value: option, children: [jsxRuntime.jsx(Box, { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) })));
|
|
1372
1314
|
};
|
|
1373
1315
|
|
|
1374
1316
|
const commonMenuItemStyles = {
|
|
@@ -1381,8 +1323,9 @@ const commonListItemStyles = {
|
|
|
1381
1323
|
alignItems: 'center',
|
|
1382
1324
|
display: 'flex',
|
|
1383
1325
|
};
|
|
1384
|
-
const MRT_ColumnActionMenu = (
|
|
1385
|
-
var
|
|
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"]);
|
|
1386
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;
|
|
1387
1330
|
const { column } = header;
|
|
1388
1331
|
const { columnDef } = column;
|
|
@@ -1437,7 +1380,7 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
1437
1380
|
setFilterMenuAnchorEl(event.currentTarget);
|
|
1438
1381
|
};
|
|
1439
1382
|
const isSelectFilter = !!columnDef.filterSelectOptions;
|
|
1440
|
-
const allowedColumnFilterOptions = (
|
|
1383
|
+
const allowedColumnFilterOptions = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _b !== void 0 ? _b : columnFilterModeOptions;
|
|
1441
1384
|
const showFilterModeSubMenu = enableColumnFilterModes &&
|
|
1442
1385
|
columnDef.enableColumnFilterModes !== false &&
|
|
1443
1386
|
!isSelectFilter &&
|
|
@@ -1446,65 +1389,66 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
1446
1389
|
const internalColumnMenuItems = [
|
|
1447
1390
|
...(enableSorting && column.getCanSort()
|
|
1448
1391
|
? [
|
|
1449
|
-
enableSortingRemoval !== false && (jsxRuntime.jsx(
|
|
1450
|
-
jsxRuntime.jsx(
|
|
1451
|
-
jsxRuntime.jsx(
|
|
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),
|
|
1452
1395
|
]
|
|
1453
1396
|
: []),
|
|
1454
1397
|
...(enableColumnFilters && column.getCanFilter()
|
|
1455
1398
|
? [
|
|
1456
|
-
jsxRuntime.jsx(
|
|
1399
|
+
jsxRuntime.jsx(MenuItem, { disabled: !columnFilterValue ||
|
|
1457
1400
|
(Array.isArray(columnFilterValue) &&
|
|
1458
|
-
!columnFilterValue.filter((value) => value).length), onClick: handleClearFilter, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(
|
|
1459
|
-
columnFilterDisplayMode === 'subheader' && (jsxRuntime.jsxs(
|
|
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
|
|
1460
1403
|
? handleOpenFilterModeMenu
|
|
1461
|
-
: handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxRuntime.jsxs(
|
|
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)),
|
|
1462
1405
|
showFilterModeSubMenu && (jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table }, 5)),
|
|
1463
1406
|
].filter(Boolean)
|
|
1464
1407
|
: []),
|
|
1465
1408
|
...(enableGrouping && column.getCanGroup()
|
|
1466
1409
|
? [
|
|
1467
|
-
jsxRuntime.jsx(
|
|
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),
|
|
1468
1411
|
]
|
|
1469
1412
|
: []),
|
|
1470
1413
|
...(enableColumnPinning && column.getCanPin()
|
|
1471
1414
|
? [
|
|
1472
|
-
jsxRuntime.jsx(
|
|
1473
|
-
jsxRuntime.jsx(
|
|
1474
|
-
jsxRuntime.jsx(
|
|
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),
|
|
1475
1418
|
]
|
|
1476
1419
|
: []),
|
|
1477
1420
|
...(enableColumnResizing && column.getCanResize()
|
|
1478
1421
|
? [
|
|
1479
|
-
jsxRuntime.jsx(
|
|
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),
|
|
1480
1423
|
]
|
|
1481
1424
|
: []),
|
|
1482
1425
|
...(enableHiding
|
|
1483
1426
|
? [
|
|
1484
|
-
jsxRuntime.jsx(
|
|
1485
|
-
jsxRuntime.jsx(
|
|
1486
|
-
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(
|
|
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),
|
|
1487
1430
|
]
|
|
1488
1431
|
: []),
|
|
1489
1432
|
].filter(Boolean);
|
|
1490
|
-
return (jsxRuntime.jsx(
|
|
1433
|
+
return (jsxRuntime.jsx(Menu, Object.assign({ MenuListProps: {
|
|
1491
1434
|
dense: density === 'compact',
|
|
1492
|
-
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl, children: (
|
|
1435
|
+
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_l = (_k = (_j = columnDef.renderColumnActionsMenuItems) === null || _j === void 0 ? void 0 : _j.call(columnDef, {
|
|
1493
1436
|
closeMenu: () => setAnchorEl(null),
|
|
1494
1437
|
column,
|
|
1495
1438
|
internalColumnMenuItems,
|
|
1496
1439
|
table,
|
|
1497
|
-
})) !== null &&
|
|
1440
|
+
})) !== null && _k !== void 0 ? _k : renderColumnActionsMenuItems === null || renderColumnActionsMenuItems === void 0 ? void 0 : renderColumnActionsMenuItems({
|
|
1498
1441
|
closeMenu: () => setAnchorEl(null),
|
|
1499
1442
|
column,
|
|
1500
1443
|
internalColumnMenuItems,
|
|
1501
1444
|
table,
|
|
1502
|
-
})) !== null &&
|
|
1445
|
+
})) !== null && _l !== void 0 ? _l : internalColumnMenuItems })));
|
|
1503
1446
|
};
|
|
1504
1447
|
|
|
1505
|
-
const MRT_TableHeadCellColumnActionsButton = (
|
|
1506
|
-
var
|
|
1507
|
-
|
|
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;
|
|
1508
1452
|
const { column } = header;
|
|
1509
1453
|
const { columnDef } = column;
|
|
1510
1454
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
@@ -1513,32 +1457,33 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
|
1513
1457
|
event.preventDefault();
|
|
1514
1458
|
setAnchorEl(event.currentTarget);
|
|
1515
1459
|
};
|
|
1516
|
-
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnActionsButtonProps, {
|
|
1460
|
+
const iconButtonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnActionsButtonProps, {
|
|
1517
1461
|
column,
|
|
1518
1462
|
table,
|
|
1519
1463
|
})), parseFromValuesOrFunc(columnDef.muiColumnActionsButtonProps, {
|
|
1520
1464
|
column,
|
|
1521
1465
|
table,
|
|
1522
|
-
}));
|
|
1523
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
|
1466
|
+
})), rest);
|
|
1467
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { arrow: true, 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': {
|
|
1524
1468
|
opacity: 1,
|
|
1525
|
-
}, height: '2rem', m: '-4px', opacity: 0.3,
|
|
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 }))] }));
|
|
1526
1470
|
};
|
|
1527
1471
|
|
|
1528
|
-
const MRT_FilterCheckbox = (
|
|
1529
|
-
var
|
|
1472
|
+
const MRT_FilterCheckbox = (_a) => {
|
|
1473
|
+
var _b, _c, _d;
|
|
1474
|
+
var { column, table } = _a, rest = __rest(_a, ["column", "table"]);
|
|
1530
1475
|
const { getState, options: { localization, muiFilterCheckboxProps }, } = table;
|
|
1531
1476
|
const { density } = getState();
|
|
1532
1477
|
const { columnDef } = column;
|
|
1533
|
-
const checkboxProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterCheckboxProps, {
|
|
1478
|
+
const checkboxProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterCheckboxProps, {
|
|
1534
1479
|
column,
|
|
1535
1480
|
table,
|
|
1536
1481
|
})), parseFromValuesOrFunc(columnDef.muiFilterCheckboxProps, {
|
|
1537
1482
|
column,
|
|
1538
1483
|
table,
|
|
1539
|
-
}));
|
|
1540
|
-
const filterLabel = (
|
|
1541
|
-
return (jsxRuntime.jsx(
|
|
1484
|
+
})), rest);
|
|
1485
|
+
const filterLabel = (_b = localization.filterByColumn) === null || _b === void 0 ? void 0 : _b.replace('{column}', columnDef.header);
|
|
1486
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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) => {
|
|
1542
1487
|
var _a;
|
|
1543
1488
|
column.setFilterValue(column.getFilterValue() === undefined
|
|
1544
1489
|
? 'true'
|
|
@@ -1550,19 +1495,20 @@ const MRT_FilterCheckbox = ({ column, table, }) => {
|
|
|
1550
1495
|
var _a;
|
|
1551
1496
|
e.stopPropagation();
|
|
1552
1497
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
|
1553
|
-
}, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))) })), disableTypography: true, label: (
|
|
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 }) }));
|
|
1554
1499
|
};
|
|
1555
1500
|
|
|
1556
|
-
const MRT_FilterTextField = (
|
|
1557
|
-
var
|
|
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"]);
|
|
1558
1504
|
const { options: { columnFilterModeOptions, enableColumnFilterModes, icons: { CloseIcon, FilterListIcon }, localization, manualFiltering, muiFilterAutocompleteProps, muiFilterDatePickerProps, muiFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
|
|
1559
1505
|
const { column } = header;
|
|
1560
1506
|
const { columnDef } = column;
|
|
1561
1507
|
const { filterVariant } = columnDef;
|
|
1562
|
-
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, {
|
|
1563
1509
|
column,
|
|
1564
1510
|
table,
|
|
1565
|
-
}));
|
|
1511
|
+
})), rest);
|
|
1566
1512
|
const autocompleteProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterAutocompleteProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterAutocompleteProps, {
|
|
1567
1513
|
column,
|
|
1568
1514
|
table,
|
|
@@ -1581,17 +1527,17 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1581
1527
|
const currentFilterOption = columnDef._filterFn;
|
|
1582
1528
|
const filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption)
|
|
1583
1529
|
? //@ts-ignore
|
|
1584
|
-
localization[`filter${((
|
|
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()) +
|
|
1585
1531
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
|
|
1586
1532
|
: '';
|
|
1587
1533
|
const filterPlaceholder = !isRangeFilter
|
|
1588
|
-
? (
|
|
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))
|
|
1589
1535
|
: rangeFilterIndex === 0
|
|
1590
1536
|
? localization.min
|
|
1591
1537
|
: rangeFilterIndex === 1
|
|
1592
1538
|
? localization.max
|
|
1593
1539
|
: '';
|
|
1594
|
-
const allowedColumnFilterOptions = (
|
|
1540
|
+
const allowedColumnFilterOptions = (_g = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _g !== void 0 ? _g : columnFilterModeOptions;
|
|
1595
1541
|
const showChangeModeButton = enableColumnFilterModes &&
|
|
1596
1542
|
columnDef.enableColumnFilterModes !== false &&
|
|
1597
1543
|
!rangeFilterIndex &&
|
|
@@ -1679,7 +1625,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1679
1625
|
isMounted.current = true;
|
|
1680
1626
|
}, [column.getFilterValue()]);
|
|
1681
1627
|
if (columnDef.Filter) {
|
|
1682
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (
|
|
1628
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (_h = columnDef.Filter) === null || _h === void 0 ? void 0 : _h.call(columnDef, { column, header, rangeFilterIndex, table }) }));
|
|
1683
1629
|
}
|
|
1684
1630
|
const dropdownOptions = react.useMemo(() => {
|
|
1685
1631
|
var _a;
|
|
@@ -1695,12 +1641,12 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1695
1641
|
isMultiSelectFilter,
|
|
1696
1642
|
isSelectFilter,
|
|
1697
1643
|
]);
|
|
1698
|
-
const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsxRuntime.jsx(
|
|
1644
|
+
const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsxRuntime.jsx(InputAdornment, { position: "end", sx: { mr: isSelectFilter || isMultiSelectFilter ? '20px' : undefined }, children: jsxRuntime.jsx(Tooltip, { arrow: true, 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: {
|
|
1699
1645
|
height: '2rem',
|
|
1700
1646
|
transform: 'scale(0.9)',
|
|
1701
1647
|
width: '2rem',
|
|
1702
1648
|
}, children: jsxRuntime.jsx(CloseIcon, {}) }) }) }) })) : null;
|
|
1703
|
-
const startAdornment = showChangeModeButton ? (jsxRuntime.jsxs(
|
|
1649
|
+
const startAdornment = showChangeModeButton ? (jsxRuntime.jsxs(InputAdornment, { position: "start", children: [jsxRuntime.jsx(Tooltip, { arrow: true, 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;
|
|
1704
1650
|
const commonTextFieldProps = Object.assign(Object.assign({ FormHelperTextProps: {
|
|
1705
1651
|
sx: {
|
|
1706
1652
|
fontSize: '0.75rem',
|
|
@@ -1711,7 +1657,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1711
1657
|
? { endAdornment, startAdornment }
|
|
1712
1658
|
: { startAdornment }, fullWidth: true, helperText: showChangeModeButton ? (jsxRuntime.jsx("label", { children: localization.filterMode.replace('{filterType}',
|
|
1713
1659
|
// @ts-ignore
|
|
1714
|
-
localization[`filter${((
|
|
1660
|
+
localization[`filter${((_l = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _l === void 0 ? void 0 : _l.toUpperCase()) +
|
|
1715
1661
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null, inputProps: {
|
|
1716
1662
|
autoComplete: 'new-password',
|
|
1717
1663
|
disabled: !!filterChipLabel,
|
|
@@ -1740,28 +1686,28 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1740
1686
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isDateFilter ? (jsxRuntime.jsx(DatePicker.DatePicker, Object.assign({ onChange: (newDate) => {
|
|
1741
1687
|
handleChange(newDate);
|
|
1742
1688
|
}, value: filterValue || null }, datePickerProps, { slotProps: {
|
|
1743
|
-
field: Object.assign({ clearable: true, onClear: () => handleClear() }, (
|
|
1744
|
-
textField: Object.assign(Object.assign({}, commonTextFieldProps), (
|
|
1745
|
-
} }))) : isAutocompleteFilter ? (jsxRuntime.jsx(
|
|
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) => {
|
|
1746
1692
|
var _a;
|
|
1747
|
-
return (jsxRuntime.jsx(
|
|
1748
|
-
}, value: filterValue }))) : (jsxRuntime.jsx(
|
|
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: {
|
|
1749
1695
|
displayEmpty: true,
|
|
1750
1696
|
multiple: isMultiSelectFilter,
|
|
1751
1697
|
renderValue: isMultiSelectFilter
|
|
1752
|
-
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsxRuntime.jsx(
|
|
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) => {
|
|
1753
1699
|
const selectedValue = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.find((option) => option instanceof Object
|
|
1754
1700
|
? option.value === value
|
|
1755
1701
|
: option === value);
|
|
1756
|
-
return (jsxRuntime.jsx(
|
|
1702
|
+
return (jsxRuntime.jsx(Chip, { label: selectedValue instanceof Object
|
|
1757
1703
|
? selectedValue.text
|
|
1758
1704
|
: selectedValue }, value));
|
|
1759
1705
|
}) }))
|
|
1760
1706
|
: undefined,
|
|
1761
1707
|
}, onChange: handleTextFieldChange, select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { value: filterValue !== null && filterValue !== void 0 ? filterValue : '', children: (isSelectFilter || isMultiSelectFilter) && [
|
|
1762
|
-
jsxRuntime.jsx(
|
|
1708
|
+
jsxRuntime.jsx(MenuItem, { disabled: true, divider: true, hidden: true, value: "", children: jsxRuntime.jsx(Box, { sx: { opacity: 0.5 }, children: filterPlaceholder }) }, "p"),
|
|
1763
1709
|
...[
|
|
1764
|
-
(
|
|
1710
|
+
(_p = textFieldProps.children) !== null && _p !== void 0 ? _p : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
|
|
1765
1711
|
var _a;
|
|
1766
1712
|
if (!option)
|
|
1767
1713
|
return '';
|
|
@@ -1775,33 +1721,35 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1775
1721
|
value = option.value;
|
|
1776
1722
|
text = option.text;
|
|
1777
1723
|
}
|
|
1778
|
-
return (jsxRuntime.jsxs(
|
|
1724
|
+
return (jsxRuntime.jsxs(MenuItem, { sx: {
|
|
1779
1725
|
alignItems: 'center',
|
|
1780
1726
|
display: 'flex',
|
|
1781
1727
|
gap: '0.5rem',
|
|
1782
1728
|
m: 0,
|
|
1783
|
-
}, value: value, children: [isMultiSelectFilter && (jsxRuntime.jsx(
|
|
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 &&
|
|
1784
1730
|
`(${facetedUniqueValues.get(value)})`] }, `${index}-${value}`));
|
|
1785
1731
|
}),
|
|
1786
1732
|
],
|
|
1787
1733
|
] }))), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, setFilterValue: setFilterValue, table: table })] }));
|
|
1788
1734
|
};
|
|
1789
1735
|
|
|
1790
|
-
const MRT_FilterRangeFields = (
|
|
1791
|
-
|
|
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 })] })));
|
|
1792
1739
|
};
|
|
1793
1740
|
|
|
1794
|
-
const MRT_FilterRangeSlider = (
|
|
1795
|
-
var
|
|
1741
|
+
const MRT_FilterRangeSlider = (_a) => {
|
|
1742
|
+
var _b, _c;
|
|
1743
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1796
1744
|
const { options: { enableColumnFilterModes, localization, muiFilterSliderProps }, refs: { filterInputRefs }, } = table;
|
|
1797
1745
|
const { column } = header;
|
|
1798
1746
|
const { columnDef } = column;
|
|
1799
1747
|
const currentFilterOption = columnDef._filterFn;
|
|
1800
1748
|
const showChangeModeButton = enableColumnFilterModes && columnDef.enableColumnFilterModes !== false;
|
|
1801
|
-
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);
|
|
1802
1750
|
let [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
|
|
1803
1751
|
? [sliderProps.min, sliderProps.max]
|
|
1804
|
-
: (
|
|
1752
|
+
: (_b = column.getFacetedMinMaxValues()) !== null && _b !== void 0 ? _b : [0, 1];
|
|
1805
1753
|
//fix potential TanStack Table bugs where min or max is an array
|
|
1806
1754
|
if (Array.isArray(min))
|
|
1807
1755
|
min = min[0];
|
|
@@ -1825,7 +1773,7 @@ const MRT_FilterRangeSlider = ({ header, table, }) => {
|
|
|
1825
1773
|
}
|
|
1826
1774
|
isMounted.current = true;
|
|
1827
1775
|
}, [columnFilterValue, min, max]);
|
|
1828
|
-
return (jsxRuntime.jsxs(
|
|
1776
|
+
return (jsxRuntime.jsxs(Stack, { children: [jsxRuntime.jsx(Slider, Object.assign({ disableSwap: true, max: max, min: min, onChange: (_event, values) => {
|
|
1829
1777
|
setFilterValues(values);
|
|
1830
1778
|
}, onChangeCommitted: (_event, value) => {
|
|
1831
1779
|
if (Array.isArray(value)) {
|
|
@@ -1851,29 +1799,31 @@ const MRT_FilterRangeSlider = ({ header, table, }) => {
|
|
|
1851
1799
|
}
|
|
1852
1800
|
},
|
|
1853
1801
|
},
|
|
1854
|
-
}, 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(
|
|
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: {
|
|
1855
1803
|
fontSize: '0.75rem',
|
|
1856
1804
|
lineHeight: '0.8rem',
|
|
1857
1805
|
m: '-3px -6px',
|
|
1858
1806
|
whiteSpace: 'nowrap',
|
|
1859
1807
|
}, children: localization.filterMode.replace('{filterType}',
|
|
1860
1808
|
// @ts-ignore
|
|
1861
|
-
localization[`filter${((
|
|
1809
|
+
localization[`filter${((_c = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _c === void 0 ? void 0 : _c.toUpperCase()) +
|
|
1862
1810
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null] }));
|
|
1863
1811
|
};
|
|
1864
1812
|
|
|
1865
|
-
const MRT_TableHeadCellFilterContainer = (
|
|
1866
|
-
var
|
|
1813
|
+
const MRT_TableHeadCellFilterContainer = (_a) => {
|
|
1814
|
+
var _b;
|
|
1815
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1867
1816
|
const { getState, options: { columnFilterDisplayMode }, } = table;
|
|
1868
1817
|
const { showColumnFilters } = getState();
|
|
1869
1818
|
const { column } = header;
|
|
1870
1819
|
const { columnDef } = column;
|
|
1871
|
-
return (jsxRuntime.jsx(
|
|
1872
|
-
['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 })) })));
|
|
1873
1822
|
};
|
|
1874
1823
|
|
|
1875
|
-
const MRT_TableHeadCellFilterLabel = (
|
|
1876
|
-
var
|
|
1824
|
+
const MRT_TableHeadCellFilterLabel = (_a) => {
|
|
1825
|
+
var _b, _c, _d;
|
|
1826
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1877
1827
|
const { options: { columnFilterDisplayMode, icons: { FilterAltIcon }, localization, }, refs: { filterInputRefs }, setShowColumnFilters, } = table;
|
|
1878
1828
|
const { column } = header;
|
|
1879
1829
|
const { columnDef } = column;
|
|
@@ -1881,26 +1831,26 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1881
1831
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
1882
1832
|
const isFilterActive = (Array.isArray(filterValue) && filterValue.some(Boolean)) ||
|
|
1883
1833
|
(!!filterValue && !Array.isArray(filterValue));
|
|
1884
|
-
const isRangeFilter = ((
|
|
1834
|
+
const isRangeFilter = ((_b = columnDef.filterVariant) === null || _b === void 0 ? void 0 : _b.includes('range')) ||
|
|
1885
1835
|
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn);
|
|
1886
1836
|
const currentFilterOption = columnDef._filterFn;
|
|
1887
1837
|
const filterTooltip = columnFilterDisplayMode === 'popover' && !isFilterActive
|
|
1888
|
-
? (
|
|
1838
|
+
? (_c = localization.filterByColumn) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))
|
|
1889
1839
|
: localization.filteringByColumn
|
|
1890
1840
|
.replace('{column}', String(columnDef.header))
|
|
1891
1841
|
.replace('{filterType}', currentFilterOption
|
|
1892
1842
|
? // @ts-ignore
|
|
1893
|
-
localization[`filter${((
|
|
1843
|
+
localization[`filter${((_d = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _d === void 0 ? void 0 : _d.toUpperCase()) +
|
|
1894
1844
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
|
|
1895
1845
|
: '')
|
|
1896
1846
|
.replace('{filterValue}', `"${Array.isArray(filterValue)
|
|
1897
1847
|
? filterValue.join(`" ${isRangeFilter ? localization.and : localization.or} "`)
|
|
1898
1848
|
: filterValue}"`)
|
|
1899
1849
|
.replace('" "', '');
|
|
1900
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
|
1850
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Grow, { in: columnFilterDisplayMode === 'popover' ||
|
|
1901
1851
|
(!!filterValue && !isRangeFilter) ||
|
|
1902
1852
|
(isRangeFilter && // @ts-ignore
|
|
1903
|
-
(!!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[0]) || !!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[1]))), unmountOnExit: true, children: jsxRuntime.jsx(
|
|
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, { arrow: true, placement: "top", title: filterTooltip, children: jsxRuntime.jsx(IconButton, Object.assign({ disableRipple: true, onClick: (event) => {
|
|
1904
1854
|
if (columnFilterDisplayMode === 'popover') {
|
|
1905
1855
|
setAnchorEl(event.currentTarget);
|
|
1906
1856
|
}
|
|
@@ -1913,15 +1863,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1913
1863
|
(_b = filterInputRefs.current[`${column.id}-0`]) === null || _b === void 0 ? void 0 : _b.select();
|
|
1914
1864
|
});
|
|
1915
1865
|
event.stopPropagation();
|
|
1916
|
-
}, size: "small", sx: {
|
|
1917
|
-
height: '16px',
|
|
1918
|
-
ml: '4px',
|
|
1919
|
-
opacity: isFilterActive ? 1 : 0.3,
|
|
1920
|
-
p: '8px',
|
|
1921
|
-
transform: 'scale(0.75)',
|
|
1922
|
-
transition: 'all 150ms ease-in-out',
|
|
1923
|
-
width: '16px',
|
|
1924
|
-
}, 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: {
|
|
1925
1867
|
horizontal: 'center',
|
|
1926
1868
|
vertical: 'top',
|
|
1927
1869
|
}, onClick: (event) => event.stopPropagation(), onClose: (event) => {
|
|
@@ -1931,17 +1873,18 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1931
1873
|
}, onKeyDown: (event) => event.key === 'Enter' && setAnchorEl(null), open: !!anchorEl, transformOrigin: {
|
|
1932
1874
|
horizontal: 'center',
|
|
1933
1875
|
vertical: 'bottom',
|
|
1934
|
-
}, children: jsxRuntime.jsx(
|
|
1876
|
+
}, children: jsxRuntime.jsx(Box, { sx: { p: '1rem' }, children: jsxRuntime.jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }) }) })] }));
|
|
1935
1877
|
};
|
|
1936
1878
|
|
|
1937
|
-
const MRT_TableHeadCellGrabHandle = (
|
|
1879
|
+
const MRT_TableHeadCellGrabHandle = (_a) => {
|
|
1880
|
+
var { column, table, tableHeadCellRef } = _a, rest = __rest(_a, ["column", "table", "tableHeadCellRef"]);
|
|
1938
1881
|
const { getState, options: { enableColumnOrdering, muiColumnDragHandleProps }, setColumnOrder, setDraggingColumn, setHoveredColumn, } = table;
|
|
1939
1882
|
const { columnDef } = column;
|
|
1940
1883
|
const { columnOrder, draggingColumn, hoveredColumn } = getState();
|
|
1941
|
-
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, {
|
|
1942
1885
|
column,
|
|
1943
1886
|
table,
|
|
1944
|
-
}));
|
|
1887
|
+
})), rest);
|
|
1945
1888
|
const handleDragStart = (event) => {
|
|
1946
1889
|
var _a;
|
|
1947
1890
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
|
@@ -1965,17 +1908,18 @@ const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
|
|
1965
1908
|
return (jsxRuntime.jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
|
|
1966
1909
|
};
|
|
1967
1910
|
|
|
1968
|
-
const MRT_TableHeadCellResizeHandle = (
|
|
1969
|
-
var
|
|
1911
|
+
const MRT_TableHeadCellResizeHandle = (_a) => {
|
|
1912
|
+
var _b;
|
|
1913
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1970
1914
|
const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
|
|
1971
1915
|
const { density } = getState();
|
|
1972
1916
|
const { column } = header;
|
|
1973
|
-
return (jsxRuntime.jsx(
|
|
1917
|
+
return (jsxRuntime.jsx(Box, { className: "Mui-TableHeadCell-ResizeHandle-Wrapper", onDoubleClick: () => {
|
|
1974
1918
|
setColumnSizingInfo((old) => (Object.assign(Object.assign({}, old), { isResizingColumn: false })));
|
|
1975
1919
|
column.resetSize();
|
|
1976
1920
|
}, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), style: {
|
|
1977
1921
|
transform: column.getIsResizing() && columnResizeMode === 'onEnd'
|
|
1978
|
-
? `translateX(${(
|
|
1922
|
+
? `translateX(${(_b = getState().columnSizingInfo.deltaOffset) !== null && _b !== void 0 ? _b : 0}px)`
|
|
1979
1923
|
: undefined,
|
|
1980
1924
|
}, sx: (theme) => ({
|
|
1981
1925
|
'&:active > hr': {
|
|
@@ -1991,58 +1935,56 @@ const MRT_TableHeadCellResizeHandle = ({ header, table, }) => {
|
|
|
1991
1935
|
position: 'absolute',
|
|
1992
1936
|
px: '4px',
|
|
1993
1937
|
right: '0',
|
|
1994
|
-
}), children: jsxRuntime.jsx(
|
|
1995
|
-
borderRadius: '2px',
|
|
1996
|
-
borderWidth: '2px',
|
|
1997
|
-
height: '24px',
|
|
1998
|
-
touchAction: 'none',
|
|
1999
|
-
transition: column.getIsResizing()
|
|
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()
|
|
2000
1939
|
? undefined
|
|
2001
|
-
: 'all 150ms ease-in-out',
|
|
2002
|
-
userSelect: 'none',
|
|
2003
|
-
zIndex: 4,
|
|
2004
|
-
} }) }));
|
|
1940
|
+
: 'all 150ms ease-in-out', userSelect: 'none', zIndex: 4 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))) }) }));
|
|
2005
1941
|
};
|
|
2006
1942
|
|
|
2007
|
-
const MRT_TableHeadCellSortLabel = (
|
|
1943
|
+
const MRT_TableHeadCellSortLabel = (_a) => {
|
|
1944
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
2008
1945
|
const { getState, options: { icons: { ArrowDownwardIcon, SyncAltIcon }, localization, }, } = table;
|
|
2009
1946
|
const { column } = header;
|
|
2010
1947
|
const { columnDef } = column;
|
|
2011
|
-
const { sorting } = getState();
|
|
1948
|
+
const { isLoading, showSkeletons, sorting } = getState();
|
|
2012
1949
|
const isSorted = !!column.getIsSorted();
|
|
2013
|
-
const sortTooltip =
|
|
2014
|
-
?
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
:
|
|
2020
|
-
|
|
2021
|
-
|
|
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, { arrow: true, 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
|
+
} })))
|
|
2022
1963
|
: ArrowDownwardIcon, active: true, "aria-label": sortTooltip, direction: isSorted ? column.getIsSorted() : undefined, onClick: (e) => {
|
|
2023
1964
|
var _a;
|
|
2024
1965
|
e.stopPropagation();
|
|
2025
1966
|
(_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(e);
|
|
2026
|
-
}, sx: {
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
width: '3ch',
|
|
2031
|
-
} }) }) }));
|
|
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))) })) }) }));
|
|
2032
1972
|
};
|
|
2033
1973
|
|
|
2034
|
-
const MRT_TableHeadCell = (
|
|
2035
|
-
var
|
|
1974
|
+
const MRT_TableHeadCell = (_a) => {
|
|
1975
|
+
var _b, _c, _d, _f, _g, _h;
|
|
1976
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
2036
1977
|
const theme = styles.useTheme();
|
|
2037
1978
|
const { getState, options: { columnFilterDisplayMode, enableColumnActions, enableColumnDragging, enableColumnOrdering, enableGrouping, enableMultiSort, layoutMode, muiTableHeadCellProps, }, refs: { tableHeadCellRefs }, setHoveredColumn, } = table;
|
|
2038
1979
|
const { columnSizingInfo, density, draggingColumn, grouping, hoveredColumn, showColumnFilters, } = getState();
|
|
2039
1980
|
const { column } = header;
|
|
2040
1981
|
const { columnDef } = column;
|
|
2041
1982
|
const { columnDefType } = columnDef;
|
|
2042
|
-
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, {
|
|
2043
1984
|
column,
|
|
2044
1985
|
table,
|
|
2045
|
-
}));
|
|
1986
|
+
})), rest);
|
|
1987
|
+
const { draggingBorderColor } = getMRTTheme(table, theme);
|
|
2046
1988
|
const showColumnActions = (enableColumnActions || columnDef.enableColumnActions) &&
|
|
2047
1989
|
columnDef.enableColumnActions !== false;
|
|
2048
1990
|
const showDragHandle = enableColumnDragging !== false &&
|
|
@@ -2065,11 +2007,11 @@ const MRT_TableHeadCell = ({ header, table, }) => {
|
|
|
2065
2007
|
const draggingBorders = react.useMemo(() => {
|
|
2066
2008
|
const borderStyle = columnSizingInfo.isResizingColumn === column.id &&
|
|
2067
2009
|
!header.subHeaders.length
|
|
2068
|
-
? `2px solid ${
|
|
2010
|
+
? `2px solid ${draggingBorderColor} !important`
|
|
2069
2011
|
: (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
|
|
2070
|
-
? `1px dashed ${theme.palette.
|
|
2012
|
+
? `1px dashed ${theme.palette.grey[500]}`
|
|
2071
2013
|
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
|
2072
|
-
? `2px dashed ${
|
|
2014
|
+
? `2px dashed ${draggingBorderColor}`
|
|
2073
2015
|
: undefined;
|
|
2074
2016
|
if (columnSizingInfo.isResizingColumn === column.id) {
|
|
2075
2017
|
return { borderRight: borderStyle };
|
|
@@ -2091,12 +2033,12 @@ const MRT_TableHeadCell = ({ header, table, }) => {
|
|
|
2091
2033
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
2092
2034
|
}
|
|
2093
2035
|
};
|
|
2094
|
-
const headerElement = (
|
|
2036
|
+
const headerElement = (_b = parseFromValuesOrFunc(columnDef.Header, {
|
|
2095
2037
|
column,
|
|
2096
2038
|
header,
|
|
2097
2039
|
table,
|
|
2098
|
-
})) !== null &&
|
|
2099
|
-
return (jsxRuntime.jsxs(
|
|
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) => {
|
|
2100
2042
|
if (node) {
|
|
2101
2043
|
tableHeadCellRefs.current[column.id] = node;
|
|
2102
2044
|
}
|
|
@@ -2124,54 +2066,60 @@ const MRT_TableHeadCell = ({ header, table, }) => {
|
|
|
2124
2066
|
? 3
|
|
2125
2067
|
: column.getIsPinned() && columnDefType !== 'group'
|
|
2126
2068
|
? 2
|
|
2127
|
-
: 1 },
|
|
2069
|
+
: 1 }, getCommonMRTCellStyles({
|
|
2128
2070
|
column,
|
|
2129
2071
|
header,
|
|
2130
2072
|
table,
|
|
2131
2073
|
tableCellProps,
|
|
2132
2074
|
theme,
|
|
2133
|
-
})), draggingBorders)), children: [header.isPlaceholder
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
? '
|
|
2139
|
-
:
|
|
2140
|
-
? '
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
:
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
?
|
|
2154
|
-
: undefined,
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
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"]);
|
|
2169
2117
|
const { options: { layoutMode, muiTableHeadRowProps }, } = table;
|
|
2170
|
-
const tableRowProps = parseFromValuesOrFunc(muiTableHeadRowProps, {
|
|
2118
|
+
const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadRowProps, {
|
|
2171
2119
|
headerGroup,
|
|
2172
2120
|
table,
|
|
2173
|
-
});
|
|
2174
|
-
return (jsxRuntime.jsxs(
|
|
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) => {
|
|
2175
2123
|
const header = virtualColumns
|
|
2176
2124
|
? headerGroup.headers[headerOrVirtualHeader.index]
|
|
2177
2125
|
: headerOrVirtualHeader;
|
|
@@ -2179,62 +2127,37 @@ const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLe
|
|
|
2179
2127
|
}), virtualPaddingRight ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
|
|
2180
2128
|
};
|
|
2181
2129
|
|
|
2182
|
-
const MRT_LinearProgressBar = (
|
|
2130
|
+
const MRT_LinearProgressBar = (_a) => {
|
|
2131
|
+
var { isTopToolbar, table } = _a, rest = __rest(_a, ["isTopToolbar", "table"]);
|
|
2183
2132
|
const { getState, options: { muiLinearProgressProps }, } = table;
|
|
2184
|
-
const { showProgressBars } = getState();
|
|
2185
|
-
const linearProgressProps = parseFromValuesOrFunc(muiLinearProgressProps, {
|
|
2133
|
+
const { isSaving, showProgressBars } = getState();
|
|
2134
|
+
const linearProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiLinearProgressProps, {
|
|
2186
2135
|
isTopToolbar,
|
|
2187
2136
|
table,
|
|
2188
|
-
});
|
|
2189
|
-
return (jsxRuntime.jsx(
|
|
2137
|
+
})), rest);
|
|
2138
|
+
return (jsxRuntime.jsx(Collapse, { in: showProgressBars !== false && (showProgressBars || isSaving), mountOnEnter: true, sx: {
|
|
2190
2139
|
bottom: isTopToolbar ? 0 : undefined,
|
|
2191
2140
|
position: 'absolute',
|
|
2192
2141
|
top: !isTopToolbar ? 0 : undefined,
|
|
2193
2142
|
width: '100%',
|
|
2194
|
-
}, unmountOnExit: true, children: jsxRuntime.jsx(
|
|
2195
|
-
};
|
|
2196
|
-
|
|
2197
|
-
/******************************************************************************
|
|
2198
|
-
Copyright (c) Microsoft Corporation.
|
|
2199
|
-
|
|
2200
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2201
|
-
purpose with or without fee is hereby granted.
|
|
2202
|
-
|
|
2203
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2204
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2205
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2206
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2207
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2208
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2209
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2210
|
-
***************************************************************************** */
|
|
2211
|
-
function __rest(s, e) {
|
|
2212
|
-
var t = {};
|
|
2213
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2214
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2215
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2216
|
-
}
|
|
2217
|
-
return t;
|
|
2218
|
-
}
|
|
2219
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2220
|
-
var e = new Error(message);
|
|
2221
|
-
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)) }));
|
|
2222
2144
|
};
|
|
2223
2145
|
|
|
2224
2146
|
const defaultRowsPerPage = [5, 10, 15, 20, 25, 30, 50, 100];
|
|
2225
|
-
const MRT_TablePagination = (
|
|
2147
|
+
const MRT_TablePagination = (_a) => {
|
|
2148
|
+
var { position = 'bottom', table } = _a, rest = __rest(_a, ["position", "table"]);
|
|
2226
2149
|
const { getPrePaginationRowModel, getState, options: { enableToolbarInternalActions, icons: { ChevronLeftIcon, ChevronRightIcon, FirstPageIcon, LastPageIcon }, localization, muiPaginationProps, paginationDisplayMode, rowCount, }, setPageIndex, setPageSize, } = table;
|
|
2227
2150
|
const { pagination: { pageIndex = 0, pageSize = 10 }, showGlobalFilter, } = getState();
|
|
2228
|
-
const paginationProps = parseFromValuesOrFunc(muiPaginationProps, {
|
|
2151
|
+
const paginationProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiPaginationProps, {
|
|
2229
2152
|
table,
|
|
2230
|
-
});
|
|
2153
|
+
})), rest);
|
|
2231
2154
|
const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
|
|
2232
2155
|
const numberOfPages = Math.ceil(totalRowCount / pageSize);
|
|
2233
2156
|
const showFirstLastPageButtons = numberOfPages > 2;
|
|
2234
2157
|
const firstRowIndex = pageIndex * pageSize;
|
|
2235
2158
|
const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
|
|
2236
|
-
const
|
|
2237
|
-
return (jsxRuntime.jsxs(
|
|
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: {
|
|
2238
2161
|
alignItems: 'center',
|
|
2239
2162
|
display: 'flex',
|
|
2240
2163
|
flexWrap: 'wrap',
|
|
@@ -2247,24 +2170,25 @@ const MRT_TablePagination = ({ position = 'bottom', table, }) => {
|
|
|
2247
2170
|
? '3rem'
|
|
2248
2171
|
: undefined,
|
|
2249
2172
|
position: 'relative',
|
|
2250
|
-
px: '
|
|
2173
|
+
px: '8px',
|
|
2251
2174
|
py: '12px',
|
|
2252
2175
|
zIndex: 2,
|
|
2253
|
-
}, children: [showRowsPerPage && (jsxRuntime.jsxs(
|
|
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: {
|
|
2254
2177
|
first: FirstPageIcon,
|
|
2255
2178
|
last: LastPageIcon,
|
|
2256
2179
|
next: ChevronRightIcon,
|
|
2257
2180
|
previous: ChevronLeftIcon,
|
|
2258
|
-
} }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton },
|
|
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] }));
|
|
2259
2182
|
};
|
|
2260
2183
|
|
|
2261
|
-
const MRT_GlobalFilterTextField = (
|
|
2262
|
-
var
|
|
2184
|
+
const MRT_GlobalFilterTextField = (_a) => {
|
|
2185
|
+
var _b;
|
|
2186
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2263
2187
|
const { getState, options: { enableGlobalFilterModes, icons: { CloseIcon, SearchIcon }, localization, manualFiltering, muiSearchTextFieldProps, }, refs: { searchInputRef }, setGlobalFilter, } = table;
|
|
2264
2188
|
const { globalFilter, showGlobalFilter } = getState();
|
|
2265
|
-
const textFieldProps = parseFromValuesOrFunc(muiSearchTextFieldProps, {
|
|
2189
|
+
const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiSearchTextFieldProps, {
|
|
2266
2190
|
table,
|
|
2267
|
-
});
|
|
2191
|
+
})), rest);
|
|
2268
2192
|
const isMounted = react.useRef(false);
|
|
2269
2193
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
2270
2194
|
const [searchValue, setSearchValue] = react.useState(globalFilter !== null && globalFilter !== void 0 ? globalFilter : '');
|
|
@@ -2294,10 +2218,10 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
2294
2218
|
}
|
|
2295
2219
|
isMounted.current = true;
|
|
2296
2220
|
}, [globalFilter]);
|
|
2297
|
-
return (jsxRuntime.jsxs(
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
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, { arrow: true, 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, { arrow: true, 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) => {
|
|
2301
2225
|
searchInputRef.current = inputRef;
|
|
2302
2226
|
if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
|
|
2303
2227
|
textFieldProps.inputRef = inputRef;
|
|
@@ -2305,13 +2229,14 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
2305
2229
|
} })), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, onSelect: handleClear, setAnchorEl: setAnchorEl, table: table })] }));
|
|
2306
2230
|
};
|
|
2307
2231
|
|
|
2308
|
-
const MRT_SelectCheckbox = (
|
|
2309
|
-
var
|
|
2232
|
+
const MRT_SelectCheckbox = (_a) => {
|
|
2233
|
+
var _b;
|
|
2234
|
+
var { row, selectAll, table } = _a, rest = __rest(_a, ["row", "selectAll", "table"]);
|
|
2310
2235
|
const { getState, options: { enableMultiRowSelection, enableRowPinning, localization, muiSelectAllCheckboxProps, muiSelectCheckboxProps, rowPinningDisplayMode, selectAllMode, }, } = table;
|
|
2311
2236
|
const { density, isLoading } = getState();
|
|
2312
|
-
const checkboxProps = !row
|
|
2237
|
+
const checkboxProps = Object.assign(Object.assign({}, (!row
|
|
2313
2238
|
? parseFromValuesOrFunc(muiSelectAllCheckboxProps, { table })
|
|
2314
|
-
: parseFromValuesOrFunc(muiSelectCheckboxProps, { row, table });
|
|
2239
|
+
: parseFromValuesOrFunc(muiSelectCheckboxProps, { row, table }))), rest);
|
|
2315
2240
|
const allRowsSelected = selectAll
|
|
2316
2241
|
? selectAllMode === 'page'
|
|
2317
2242
|
? table.getIsAllPageRowsSelected()
|
|
@@ -2345,28 +2270,29 @@ const MRT_SelectCheckbox = ({ row, selectAll, table, }) => {
|
|
|
2345
2270
|
e.stopPropagation();
|
|
2346
2271
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
|
2347
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 });
|
|
2348
|
-
return (jsxRuntime.jsx(
|
|
2273
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : (selectAll
|
|
2349
2274
|
? localization.toggleSelectAll
|
|
2350
|
-
: localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(
|
|
2275
|
+
: localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(Radio, Object.assign({}, commonProps))) : (jsxRuntime.jsx(Checkbox, Object.assign({ indeterminate: selectAll
|
|
2351
2276
|
? table.getIsSomeRowsSelected() && !allRowsSelected
|
|
2352
2277
|
: row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) }));
|
|
2353
2278
|
};
|
|
2354
2279
|
|
|
2355
|
-
const MRT_ToolbarAlertBanner = (
|
|
2356
|
-
var
|
|
2280
|
+
const MRT_ToolbarAlertBanner = (_a) => {
|
|
2281
|
+
var _b, _c, _d;
|
|
2282
|
+
var { stackAlertBanner, table } = _a, rest = __rest(_a, ["stackAlertBanner", "table"]);
|
|
2357
2283
|
const { getPrePaginationRowModel, getSelectedRowModel, getState, options: { enableRowSelection, enableSelectAll, localization, muiToolbarAlertBannerChipProps, muiToolbarAlertBannerProps, positionToolbarAlertBanner, renderToolbarAlertBannerContent, rowCount, }, refs: { tablePaperRef }, } = table;
|
|
2358
2284
|
const { density, grouping, showAlertBanner } = getState();
|
|
2359
|
-
const alertProps = parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
|
|
2285
|
+
const alertProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
|
|
2360
2286
|
table,
|
|
2361
|
-
});
|
|
2287
|
+
})), rest);
|
|
2362
2288
|
const chipProps = parseFromValuesOrFunc(muiToolbarAlertBannerChipProps, {
|
|
2363
2289
|
table,
|
|
2364
2290
|
});
|
|
2365
2291
|
const selectedAlert = getSelectedRowModel().rows.length > 0
|
|
2366
|
-
? (
|
|
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())
|
|
2367
2293
|
: null;
|
|
2368
|
-
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(
|
|
2369
|
-
return (jsxRuntime.jsx(
|
|
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) => {
|
|
2370
2296
|
var _a, _b;
|
|
2371
2297
|
return (Object.assign({ '& .MuiAlert-message': {
|
|
2372
2298
|
maxWidth: `calc(${(_b = (_a = tablePaperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 360}px - 1rem)`,
|
|
@@ -2376,11 +2302,11 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
|
2376
2302
|
: positionToolbarAlertBanner === 'bottom'
|
|
2377
2303
|
? '-1rem'
|
|
2378
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)));
|
|
2379
|
-
}, children: (
|
|
2305
|
+
}, children: (_d = renderToolbarAlertBannerContent === null || renderToolbarAlertBannerContent === void 0 ? void 0 : renderToolbarAlertBannerContent({
|
|
2380
2306
|
groupedAlert,
|
|
2381
2307
|
selectedAlert,
|
|
2382
2308
|
table,
|
|
2383
|
-
})) !== null &&
|
|
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: {
|
|
2384
2310
|
p: positionToolbarAlertBanner !== 'head-overlay'
|
|
2385
2311
|
? '0.5rem 1rem'
|
|
2386
2312
|
: density === 'spacious'
|
|
@@ -2388,13 +2314,14 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
|
2388
2314
|
: density === 'comfortable'
|
|
2389
2315
|
? '0.5rem 0.75rem'
|
|
2390
2316
|
: '0.25rem 0.5rem',
|
|
2391
|
-
}, 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(
|
|
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 &&
|
|
2392
2318
|
enableSelectAll &&
|
|
2393
2319
|
positionToolbarAlertBanner === 'head-overlay' && (jsxRuntime.jsx(MRT_SelectCheckbox, { selectAll: true, table: table })), ' ', selectedAlert] }), selectedAlert && groupedAlert && jsxRuntime.jsx("br", {}), groupedAlert] })] })) })) }));
|
|
2394
2320
|
};
|
|
2395
2321
|
|
|
2396
|
-
const MRT_ToolbarDropZone = (
|
|
2397
|
-
var
|
|
2322
|
+
const MRT_ToolbarDropZone = (_a) => {
|
|
2323
|
+
var _b, _c;
|
|
2324
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2398
2325
|
const { getState, options: { enableGrouping, localization }, setHoveredColumn, setShowToolbarDropZone, } = table;
|
|
2399
2326
|
const { draggingColumn, grouping, hoveredColumn, showToolbarDropZone } = getState();
|
|
2400
2327
|
const handleDragEnter = (_event) => {
|
|
@@ -2409,35 +2336,57 @@ const MRT_ToolbarDropZone = ({ table, }) => {
|
|
|
2409
2336
|
!grouping.includes(draggingColumn.id));
|
|
2410
2337
|
}
|
|
2411
2338
|
}, [enableGrouping, draggingColumn, grouping]);
|
|
2412
|
-
return (jsxRuntime.jsx(
|
|
2413
|
-
alignItems: 'center',
|
|
2414
|
-
backdropFilter: 'blur(4px)',
|
|
2415
|
-
backgroundColor: styles.alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
|
|
2416
|
-
border: `dashed ${theme.palette.info.main} 2px`,
|
|
2417
|
-
boxSizing: 'border-box',
|
|
2418
|
-
display: 'flex',
|
|
2419
|
-
height: '100%',
|
|
2420
|
-
justifyContent: 'center',
|
|
2421
|
-
position: 'absolute',
|
|
2422
|
-
width: '100%',
|
|
2423
|
-
zIndex: 4,
|
|
2424
|
-
}), 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 : '') }) })) }));
|
|
2425
2340
|
};
|
|
2426
2341
|
|
|
2427
|
-
const
|
|
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 })) })] })] })));
|
|
2372
|
+
};
|
|
2373
|
+
|
|
2374
|
+
const MRT_ColumnPinningButtons = (_a) => {
|
|
2375
|
+
var { column, table } = _a, rest = __rest(_a, ["column", "table"]);
|
|
2428
2376
|
const { options: { icons: { PushPinIcon }, localization, }, } = table;
|
|
2429
2377
|
const handlePinColumn = (pinDirection) => {
|
|
2430
2378
|
column.pin(pinDirection);
|
|
2431
2379
|
};
|
|
2432
|
-
return (jsxRuntime.jsx(
|
|
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, { arrow: true, title: localization.unpin, children: jsxRuntime.jsx(IconButton, { onClick: () => handlePinColumn(false), size: "small", children: jsxRuntime.jsx(PushPinIcon, {}) }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { arrow: true, title: localization.pinToLeft, children: jsxRuntime.jsx(IconButton, { onClick: () => handlePinColumn('left'), size: "small", children: jsxRuntime.jsx(PushPinIcon, { style: {
|
|
2433
2381
|
transform: 'rotate(90deg)',
|
|
2434
|
-
} }) }) }), jsxRuntime.jsx(
|
|
2382
|
+
} }) }) }), jsxRuntime.jsx(Tooltip, { arrow: true, title: localization.pinToRight, children: jsxRuntime.jsx(IconButton, { onClick: () => handlePinColumn('right'), size: "small", children: jsxRuntime.jsx(PushPinIcon, { style: {
|
|
2435
2383
|
transform: 'rotate(-90deg)',
|
|
2436
|
-
} }) }) })] })) }));
|
|
2384
|
+
} }) }) })] })) })));
|
|
2437
2385
|
};
|
|
2438
2386
|
|
|
2439
|
-
const MRT_ShowHideColumnsMenuItems = (
|
|
2440
|
-
var
|
|
2387
|
+
const MRT_ShowHideColumnsMenuItems = (_a) => {
|
|
2388
|
+
var _b;
|
|
2389
|
+
var { allColumns, column, hoveredColumn, setHoveredColumn, table } = _a, rest = __rest(_a, ["allColumns", "column", "hoveredColumn", "setHoveredColumn", "table"]);
|
|
2441
2390
|
const { getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, setColumnOrder, } = table;
|
|
2442
2391
|
const { columnOrder } = getState();
|
|
2443
2392
|
const { columnDef } = column;
|
|
@@ -2474,38 +2423,30 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, column, hoveredColumn, setHo
|
|
|
2474
2423
|
setHoveredColumn(column);
|
|
2475
2424
|
}
|
|
2476
2425
|
};
|
|
2477
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
|
2478
|
-
|
|
2479
|
-
justifyContent: 'flex-start',
|
|
2480
|
-
my: 0,
|
|
2481
|
-
opacity: isDragging ? 0.5 : 1,
|
|
2482
|
-
outline: isDragging
|
|
2483
|
-
? `2px dashed ${theme.palette.divider}`
|
|
2426
|
+
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
|
|
2427
|
+
? `2px dashed ${theme.palette.grey[500]}`
|
|
2484
2428
|
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
|
2485
|
-
? `2px dashed ${theme.
|
|
2486
|
-
: 'none',
|
|
2487
|
-
outlineOffset: '-2px',
|
|
2488
|
-
pl: `${(column.depth + 0.5) * 2}rem`,
|
|
2489
|
-
py: '6px',
|
|
2490
|
-
}), children: jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2429
|
+
? `2px dashed ${getMRTTheme(table, theme).draggingBorderColor}`
|
|
2430
|
+
: 'none', outlineOffset: '-2px', pl: `${(column.depth + 0.5) * 2}rem`, py: '6px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsxRuntime.jsxs(Box, { sx: {
|
|
2491
2431
|
display: 'flex',
|
|
2492
2432
|
flexWrap: 'nowrap',
|
|
2493
2433
|
gap: '8px',
|
|
2494
2434
|
}, children: [columnDefType !== 'group' &&
|
|
2495
2435
|
enableColumnOrdering &&
|
|
2496
2436
|
!allColumns.some((col) => col.columnDef.columnDefType === 'group') &&
|
|
2497
|
-
(columnDef.enableColumnOrdering !== false ? (jsxRuntime.jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsxRuntime.jsx(
|
|
2498
|
-
(column.getCanPin() ? (jsxRuntime.jsx(MRT_ColumnPinningButtons, { column: column, table: table })) : (jsxRuntime.jsx(
|
|
2437
|
+
(columnDef.enableColumnOrdering !== false ? (jsxRuntime.jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsxRuntime.jsx(Box, { sx: { width: '28px' } }))), enableColumnPinning &&
|
|
2438
|
+
(column.getCanPin() ? (jsxRuntime.jsx(MRT_ColumnPinningButtons, { column: column, table: table })) : (jsxRuntime.jsx(Box, { sx: { width: '70px' } }))), enableHiding ? (jsxRuntime.jsx(FormControlLabel, { checked: switchChecked, componentsProps: {
|
|
2499
2439
|
typography: {
|
|
2500
2440
|
sx: {
|
|
2501
2441
|
mb: 0,
|
|
2502
2442
|
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
|
2503
2443
|
},
|
|
2504
2444
|
},
|
|
2505
|
-
}, control: jsxRuntime.jsx(
|
|
2445
|
+
}, control: jsxRuntime.jsx(Tooltip, { arrow: true, 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}`)))] }));
|
|
2506
2446
|
};
|
|
2507
2447
|
|
|
2508
|
-
const MRT_ShowHideColumnsMenu = (
|
|
2448
|
+
const MRT_ShowHideColumnsMenu = (_a) => {
|
|
2449
|
+
var { anchorEl, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "setAnchorEl", "table"]);
|
|
2509
2450
|
const { getAllColumns, getAllLeafColumns, getCenterLeafColumns, getIsAllColumnsVisible, getIsSomeColumnsPinned, getIsSomeColumnsVisible, getLeftLeafColumns, getRightLeafColumns, getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, toggleAllColumnsVisible, } = table;
|
|
2510
2451
|
const { columnOrder, columnPinning, density } = getState();
|
|
2511
2452
|
const hideAllColumns = () => {
|
|
@@ -2533,14 +2474,14 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
|
|
|
2533
2474
|
getRightLeafColumns(),
|
|
2534
2475
|
]);
|
|
2535
2476
|
const [hoveredColumn, setHoveredColumn] = react.useState(null);
|
|
2536
|
-
return (jsxRuntime.jsxs(
|
|
2477
|
+
return (jsxRuntime.jsxs(Menu, Object.assign({ MenuListProps: {
|
|
2537
2478
|
dense: density === 'compact',
|
|
2538
|
-
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl, children: [jsxRuntime.jsxs(
|
|
2479
|
+
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [jsxRuntime.jsxs(Box, { sx: {
|
|
2539
2480
|
display: 'flex',
|
|
2540
2481
|
justifyContent: 'space-between',
|
|
2541
2482
|
p: '0.5rem',
|
|
2542
2483
|
pt: 0,
|
|
2543
|
-
}, children: [enableHiding && (jsxRuntime.jsx(
|
|
2484
|
+
}, 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}`)))] })));
|
|
2544
2485
|
};
|
|
2545
2486
|
|
|
2546
2487
|
const MRT_ShowHideColumnsButton = (_a) => {
|
|
@@ -2551,7 +2492,7 @@ const MRT_ShowHideColumnsButton = (_a) => {
|
|
|
2551
2492
|
const handleClick = (event) => {
|
|
2552
2493
|
setAnchorEl(event.currentTarget);
|
|
2553
2494
|
};
|
|
2554
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
|
2495
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { arrow: true, 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 }))] }));
|
|
2555
2496
|
};
|
|
2556
2497
|
|
|
2557
2498
|
const MRT_ToggleDensePaddingButton = (_a) => {
|
|
@@ -2567,7 +2508,7 @@ const MRT_ToggleDensePaddingButton = (_a) => {
|
|
|
2567
2508
|
: 'comfortable';
|
|
2568
2509
|
setDensity(nextDensity);
|
|
2569
2510
|
};
|
|
2570
|
-
return (jsxRuntime.jsx(
|
|
2511
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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, {})) })) }));
|
|
2571
2512
|
};
|
|
2572
2513
|
|
|
2573
2514
|
const MRT_ToggleFiltersButton = (_a) => {
|
|
@@ -2578,7 +2519,7 @@ const MRT_ToggleFiltersButton = (_a) => {
|
|
|
2578
2519
|
const handleToggleShowFilters = () => {
|
|
2579
2520
|
setShowColumnFilters(!showColumnFilters);
|
|
2580
2521
|
};
|
|
2581
|
-
return (jsxRuntime.jsx(
|
|
2522
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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, {}) })) }));
|
|
2582
2523
|
};
|
|
2583
2524
|
|
|
2584
2525
|
const MRT_ToggleFullScreenButton = (_a) => {
|
|
@@ -2591,7 +2532,7 @@ const MRT_ToggleFullScreenButton = (_a) => {
|
|
|
2591
2532
|
setTooltipOpened(false);
|
|
2592
2533
|
setIsFullScreen(!isFullScreen);
|
|
2593
2534
|
};
|
|
2594
|
-
return (jsxRuntime.jsx(
|
|
2535
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, open: tooltipOpened, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen, children: 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, {}) })) }));
|
|
2595
2536
|
};
|
|
2596
2537
|
|
|
2597
2538
|
const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
@@ -2603,106 +2544,64 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
|
2603
2544
|
setShowGlobalFilter(!showGlobalFilter);
|
|
2604
2545
|
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
2605
2546
|
};
|
|
2606
|
-
return (jsxRuntime.jsx(
|
|
2547
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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, {}) })) }));
|
|
2607
2548
|
};
|
|
2608
2549
|
|
|
2609
|
-
const MRT_ToolbarInternalButtons = (
|
|
2610
|
-
var
|
|
2550
|
+
const MRT_ToolbarInternalButtons = (_a) => {
|
|
2551
|
+
var _b;
|
|
2552
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2611
2553
|
const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions, }, } = table;
|
|
2612
|
-
return (jsxRuntime.jsx(
|
|
2613
|
-
alignItems: 'center',
|
|
2614
|
-
display: 'flex',
|
|
2615
|
-
zIndex: 3,
|
|
2616
|
-
}, children: (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
|
2554
|
+
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({
|
|
2617
2555
|
table,
|
|
2618
|
-
})) !== null &&
|
|
2556
|
+
})) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters &&
|
|
2619
2557
|
enableGlobalFilter &&
|
|
2620
2558
|
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters &&
|
|
2621
2559
|
enableColumnFilters &&
|
|
2622
|
-
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 }))] })) }));
|
|
2560
|
+
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 }))] })) })));
|
|
2623
2561
|
};
|
|
2624
2562
|
|
|
2625
|
-
const commonToolbarStyles = ({ theme }) => ({
|
|
2626
|
-
alignItems: 'flex-start',
|
|
2627
|
-
backgroundColor: styles.lighten(theme.palette.background.default, 0.05),
|
|
2628
|
-
backgroundImage: 'none',
|
|
2629
|
-
display: 'grid',
|
|
2630
|
-
flexWrap: 'wrap-reverse',
|
|
2631
|
-
minHeight: '3.5rem',
|
|
2632
|
-
overflow: 'hidden',
|
|
2633
|
-
p: '0 !important',
|
|
2634
|
-
transition: 'all 150ms ease-in-out',
|
|
2635
|
-
zIndex: 1,
|
|
2636
|
-
});
|
|
2637
2563
|
const MRT_TopToolbar = ({ table, }) => {
|
|
2638
2564
|
var _a;
|
|
2639
2565
|
const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, muiTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions, }, refs: { topToolbarRef }, } = table;
|
|
2640
2566
|
const { isFullScreen, showGlobalFilter } = getState();
|
|
2641
|
-
const isMobile =
|
|
2567
|
+
const isMobile = useMediaQuery('(max-width:720px)');
|
|
2642
2568
|
const toolbarProps = parseFromValuesOrFunc(muiTopToolbarProps, { table });
|
|
2643
2569
|
const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
|
2644
|
-
return (jsxRuntime.jsxs(
|
|
2570
|
+
return (jsxRuntime.jsxs(Box, Object.assign({}, toolbarProps, { ref: (ref) => {
|
|
2645
2571
|
topToolbarRef.current = ref;
|
|
2646
2572
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
2647
2573
|
// @ts-ignore
|
|
2648
2574
|
toolbarProps.ref.current = ref;
|
|
2649
2575
|
}
|
|
2650
|
-
}, sx: (theme) => (Object.assign(Object.assign({ position: isFullScreen ? 'sticky' :
|
|
2576
|
+
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, theme })), { position: isFullScreen ? 'sticky' : 'relative', top: isFullScreen ? '0' : undefined }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [positionToolbarAlertBanner === 'top' && (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: {
|
|
2651
2577
|
alignItems: 'flex-start',
|
|
2652
2578
|
boxSizing: 'border-box',
|
|
2653
2579
|
display: 'flex',
|
|
2580
|
+
gap: '0.5rem',
|
|
2654
2581
|
justifyContent: 'space-between',
|
|
2655
2582
|
p: '0.5rem',
|
|
2656
2583
|
position: stackAlertBanner ? 'relative' : 'absolute',
|
|
2657
2584
|
right: 0,
|
|
2658
2585
|
top: 0,
|
|
2659
2586
|
width: '100%',
|
|
2660
|
-
}, 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(
|
|
2587
|
+
}, 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: {
|
|
2588
|
+
alignItems: 'center',
|
|
2661
2589
|
display: 'flex',
|
|
2662
2590
|
flexWrap: 'wrap-reverse',
|
|
2591
|
+
gap: '0.5rem',
|
|
2663
2592
|
justifyContent: 'flex-end',
|
|
2664
2593
|
}, children: [enableGlobalFilter && positionGlobalFilter === 'right' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })), jsxRuntime.jsx(MRT_ToolbarInternalButtons, { table: table })] })) : (enableGlobalFilter &&
|
|
2665
2594
|
positionGlobalFilter === 'right' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })))] }), enablePagination &&
|
|
2666
2595
|
['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 })] })));
|
|
2667
2596
|
};
|
|
2668
2597
|
|
|
2669
|
-
const
|
|
2670
|
-
|
|
2671
|
-
const { isFullScreen } = getState();
|
|
2672
|
-
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
|
2673
|
-
const toolbarProps = parseFromValuesOrFunc(muiBottomToolbarProps, { table });
|
|
2674
|
-
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
|
2675
|
-
return (jsxRuntime.jsxs(Toolbar__default["default"], Object.assign({ variant: "dense" }, toolbarProps, { ref: (node) => {
|
|
2676
|
-
if (node) {
|
|
2677
|
-
bottomToolbarRef.current = node;
|
|
2678
|
-
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
2679
|
-
// @ts-ignore
|
|
2680
|
-
toolbarProps.ref.current = node;
|
|
2681
|
-
}
|
|
2682
|
-
}
|
|
2683
|
-
}, 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: {
|
|
2684
|
-
alignItems: 'center',
|
|
2685
|
-
boxSizing: 'border-box',
|
|
2686
|
-
display: 'flex',
|
|
2687
|
-
justifyContent: 'space-between',
|
|
2688
|
-
p: '0.5rem',
|
|
2689
|
-
width: '100%',
|
|
2690
|
-
}, children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsxRuntime.jsx("span", {})), jsxRuntime.jsx(Box__default["default"], { sx: {
|
|
2691
|
-
display: 'flex',
|
|
2692
|
-
justifyContent: 'flex-end',
|
|
2693
|
-
position: stackAlertBanner ? 'relative' : 'absolute',
|
|
2694
|
-
right: 0,
|
|
2695
|
-
top: 0,
|
|
2696
|
-
}, children: enablePagination &&
|
|
2697
|
-
['both', 'bottom'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsxRuntime.jsx(MRT_TablePagination, { position: "bottom", table: table })) })] })] })));
|
|
2698
|
-
};
|
|
2699
|
-
|
|
2700
|
-
const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
|
2598
|
+
const MRT_TableHead = (_a) => {
|
|
2599
|
+
var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
2701
2600
|
const { getHeaderGroups, getSelectedRowModel, getState, options: { enableStickyHeader, layoutMode, muiTableHeadProps, positionToolbarAlertBanner, }, refs: { tableHeadRef }, } = table;
|
|
2702
2601
|
const { isFullScreen, showAlertBanner } = getState();
|
|
2703
|
-
const tableHeadProps = parseFromValuesOrFunc(muiTableHeadProps, { table });
|
|
2602
|
+
const tableHeadProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadProps, { table })), rest);
|
|
2704
2603
|
const stickyHeader = enableStickyHeader || isFullScreen;
|
|
2705
|
-
return (jsxRuntime.jsx(
|
|
2604
|
+
return (jsxRuntime.jsx(TableHead, Object.assign({}, tableHeadProps, { ref: (ref) => {
|
|
2706
2605
|
tableHeadRef.current = ref;
|
|
2707
2606
|
if (tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.ref) {
|
|
2708
2607
|
// @ts-ignore
|
|
@@ -2712,16 +2611,17 @@ const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddi
|
|
|
2712
2611
|
(showAlertBanner || getSelectedRowModel().rows.length > 0) ? (jsxRuntime.jsx("tr", { style: {
|
|
2713
2612
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
|
2714
2613
|
}, children: jsxRuntime.jsx("th", { colSpan: table.getVisibleLeafColumns().length, style: {
|
|
2715
|
-
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' :
|
|
2614
|
+
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
|
2716
2615
|
padding: 0,
|
|
2717
2616
|
}, 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)))) })));
|
|
2718
2617
|
};
|
|
2719
2618
|
|
|
2720
|
-
const MRT_Table = (
|
|
2721
|
-
var
|
|
2722
|
-
|
|
2619
|
+
const MRT_Table = (_a) => {
|
|
2620
|
+
var _b, _c, _d, _e;
|
|
2621
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2622
|
+
const { getFlatHeaders, getState, options: { columnVirtualizerInstanceRef, columnVirtualizerOptions, columns, enableColumnPinning, enableColumnVirtualization, enableStickyHeader, enableTableFooter, enableTableHead, layoutMode, memoMode, muiTableProps, }, refs: { tableContainerRef }, } = table;
|
|
2723
2623
|
const { columnPinning, columnSizing, columnSizingInfo, columnVisibility, draggingColumn, isFullScreen, } = getState();
|
|
2724
|
-
const tableProps = parseFromValuesOrFunc(muiTableProps, { table });
|
|
2624
|
+
const tableProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableProps, { table })), rest);
|
|
2725
2625
|
const columnVirtualizerProps = parseFromValuesOrFunc(columnVirtualizerOptions, { table });
|
|
2726
2626
|
const columnSizeVars = react.useMemo(() => {
|
|
2727
2627
|
const headers = getFlatHeaders();
|
|
@@ -2776,10 +2676,10 @@ const MRT_Table = ({ table, }) => {
|
|
|
2776
2676
|
let virtualPaddingLeft;
|
|
2777
2677
|
let virtualPaddingRight;
|
|
2778
2678
|
if (columnVirtualizer && (virtualColumns === null || virtualColumns === void 0 ? void 0 : virtualColumns.length)) {
|
|
2779
|
-
virtualPaddingLeft = (
|
|
2679
|
+
virtualPaddingLeft = (_c = (_b = virtualColumns[leftPinnedIndexes.length]) === null || _b === void 0 ? void 0 : _b.start) !== null && _c !== void 0 ? _c : 0;
|
|
2780
2680
|
virtualPaddingRight =
|
|
2781
2681
|
columnVirtualizer.getTotalSize() -
|
|
2782
|
-
((
|
|
2682
|
+
((_e = (_d = virtualColumns[virtualColumns.length - 1 - rightPinnedIndexes.length]) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : 0);
|
|
2783
2683
|
}
|
|
2784
2684
|
const props = {
|
|
2785
2685
|
table,
|
|
@@ -2787,12 +2687,31 @@ const MRT_Table = ({ table, }) => {
|
|
|
2787
2687
|
virtualPaddingLeft,
|
|
2788
2688
|
virtualPaddingRight,
|
|
2789
2689
|
};
|
|
2790
|
-
return (jsxRuntime.
|
|
2791
|
-
? 'fixed'
|
|
2792
|
-
: 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))] })) }));
|
|
2690
|
+
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))] })));
|
|
2793
2691
|
};
|
|
2794
2692
|
|
|
2795
|
-
const
|
|
2693
|
+
const MRT_TableLoadingOverlay = (_a) => {
|
|
2694
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2695
|
+
const { options: { localization, muiCircularProgressProps }, } = table;
|
|
2696
|
+
const circularProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCircularProgressProps, { table })), rest);
|
|
2697
|
+
return (jsxRuntime.jsx(Box, { sx: (theme) => ({
|
|
2698
|
+
alignItems: 'center',
|
|
2699
|
+
backgroundColor: styles.alpha(getMRTTheme(table, theme).baseBackgroundColor, 0.5),
|
|
2700
|
+
bottom: 0,
|
|
2701
|
+
display: 'flex',
|
|
2702
|
+
justifyContent: 'center',
|
|
2703
|
+
left: 0,
|
|
2704
|
+
maxHeight: '100vh',
|
|
2705
|
+
position: 'absolute',
|
|
2706
|
+
right: 0,
|
|
2707
|
+
top: 0,
|
|
2708
|
+
width: '100%',
|
|
2709
|
+
zIndex: 2,
|
|
2710
|
+
}), children: jsxRuntime.jsx(CircularProgress, Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) }));
|
|
2711
|
+
};
|
|
2712
|
+
|
|
2713
|
+
const MRT_EditActionButtons = (_a) => {
|
|
2714
|
+
var { row, table, variant = 'icon' } = _a, rest = __rest(_a, ["row", "table", "variant"]);
|
|
2796
2715
|
const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onCreatingRowCancel, onCreatingRowSave, onEditingRowCancel, onEditingRowSave, }, refs: { editInputRefs }, setCreatingRow, setEditingRow, } = table;
|
|
2797
2716
|
const { creatingRow, editingRow, isSaving } = getState();
|
|
2798
2717
|
const isCreating = (creatingRow === null || creatingRow === void 0 ? void 0 : creatingRow.id) === row.id;
|
|
@@ -2835,21 +2754,22 @@ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
|
|
2835
2754
|
});
|
|
2836
2755
|
}
|
|
2837
2756
|
};
|
|
2838
|
-
return (jsxRuntime.jsx(
|
|
2757
|
+
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, { arrow: true, title: localization.cancel, children: jsxRuntime.jsx(IconButton, { "aria-label": localization.cancel, onClick: handleCancel, children: jsxRuntime.jsx(CancelIcon, {}) }) }), jsxRuntime.jsx(Tooltip, { arrow: true, 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] })] })) }));
|
|
2839
2758
|
};
|
|
2840
2759
|
|
|
2841
|
-
const MRT_EditRowModal = (
|
|
2842
|
-
var
|
|
2760
|
+
const MRT_EditRowModal = (_a) => {
|
|
2761
|
+
var _b;
|
|
2762
|
+
var { open, table } = _a, rest = __rest(_a, ["open", "table"]);
|
|
2843
2763
|
const { getState, options: { localization, muiCreateRowModalProps, muiEditRowModalProps, onCreatingRowCancel, onEditingRowCancel, renderCreateRowModalContent, renderEditRowModalContent, }, setCreatingRow, setEditingRow, } = table;
|
|
2844
2764
|
const { creatingRow, editingRow } = getState();
|
|
2845
2765
|
const row = (creatingRow !== null && creatingRow !== void 0 ? creatingRow : editingRow);
|
|
2846
|
-
const dialogProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditRowModalProps, { row, table })), (creatingRow &&
|
|
2847
|
-
parseFromValuesOrFunc(muiCreateRowModalProps, { row, table })));
|
|
2766
|
+
const dialogProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditRowModalProps, { row, table })), (creatingRow &&
|
|
2767
|
+
parseFromValuesOrFunc(muiCreateRowModalProps, { row, table }))), rest);
|
|
2848
2768
|
const internalEditComponents = row
|
|
2849
2769
|
.getAllCells()
|
|
2850
2770
|
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
|
2851
2771
|
.map((cell) => (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, table: table }, cell.id)));
|
|
2852
|
-
return (jsxRuntime.jsx(
|
|
2772
|
+
return (jsxRuntime.jsx(Dialog, Object.assign({ fullWidth: true, maxWidth: "xs", onClose: (event, reason) => {
|
|
2853
2773
|
var _a;
|
|
2854
2774
|
if (creatingRow) {
|
|
2855
2775
|
onCreatingRowCancel === null || onCreatingRowCancel === void 0 ? void 0 : onCreatingRowCancel({ row, table });
|
|
@@ -2861,7 +2781,7 @@ const MRT_EditRowModal = ({ open, table, }) => {
|
|
|
2861
2781
|
}
|
|
2862
2782
|
row._valuesCache = {}; //reset values cache
|
|
2863
2783
|
(_a = dialogProps.onClose) === null || _a === void 0 ? void 0 : _a.call(dialogProps, event, reason);
|
|
2864
|
-
}, open: open }, dialogProps, { children: (
|
|
2784
|
+
}, open: open }, dialogProps, { children: (_b = ((creatingRow &&
|
|
2865
2785
|
(renderCreateRowModalContent === null || renderCreateRowModalContent === void 0 ? void 0 : renderCreateRowModalContent({
|
|
2866
2786
|
internalEditComponents,
|
|
2867
2787
|
row,
|
|
@@ -2871,23 +2791,23 @@ const MRT_EditRowModal = ({ open, table, }) => {
|
|
|
2871
2791
|
internalEditComponents,
|
|
2872
2792
|
row,
|
|
2873
2793
|
table,
|
|
2874
|
-
})))) !== null &&
|
|
2875
|
-
gap: '
|
|
2794
|
+
})))) !== 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: {
|
|
2795
|
+
gap: '32px',
|
|
2876
2796
|
paddingTop: '16px',
|
|
2877
2797
|
width: '100%',
|
|
2878
|
-
}, children: internalEditComponents }) }) }), jsxRuntime.jsx(
|
|
2798
|
+
}, children: internalEditComponents }) }) }), jsxRuntime.jsx(DialogActions, { sx: { p: '1.25rem' }, children: jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table, variant: "text" }) })] })) })));
|
|
2879
2799
|
};
|
|
2880
2800
|
|
|
2881
2801
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
|
|
2882
|
-
const MRT_TableContainer = (
|
|
2883
|
-
|
|
2802
|
+
const MRT_TableContainer = (_a) => {
|
|
2803
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2804
|
+
const { getState, options: { createDisplayMode, editDisplayMode, enableStickyHeader, muiTableContainerProps, }, refs: { bottomToolbarRef, tableContainerRef, topToolbarRef }, } = table;
|
|
2884
2805
|
const { creatingRow, editingRow, isFullScreen, isLoading, showLoadingOverlay, } = getState();
|
|
2885
|
-
const loading = (isLoading || showLoadingOverlay)
|
|
2806
|
+
const loading = showLoadingOverlay !== false && (isLoading || showLoadingOverlay);
|
|
2886
2807
|
const [totalToolbarHeight, setTotalToolbarHeight] = react.useState(0);
|
|
2887
|
-
const tableContainerProps = parseFromValuesOrFunc(muiTableContainerProps, {
|
|
2808
|
+
const tableContainerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableContainerProps, {
|
|
2888
2809
|
table,
|
|
2889
|
-
});
|
|
2890
|
-
const circularProgressProps = parseFromValuesOrFunc(muiCircularProgressProps, { table });
|
|
2810
|
+
})), rest);
|
|
2891
2811
|
useIsomorphicLayoutEffect(() => {
|
|
2892
2812
|
var _a, _b, _c, _d;
|
|
2893
2813
|
const topToolbarHeight = typeof document !== 'undefined'
|
|
@@ -2900,7 +2820,7 @@ const MRT_TableContainer = ({ table, }) => {
|
|
|
2900
2820
|
});
|
|
2901
2821
|
const createModalOpen = createDisplayMode === 'modal' && creatingRow;
|
|
2902
2822
|
const editModalOpen = editDisplayMode === 'modal' && editingRow;
|
|
2903
|
-
return (jsxRuntime.jsxs(
|
|
2823
|
+
return (jsxRuntime.jsxs(TableContainer, Object.assign({ "aria-busy": loading, "aria-describedby": loading ? 'mrt-progress' : undefined }, tableContainerProps, { ref: (node) => {
|
|
2904
2824
|
if (node) {
|
|
2905
2825
|
tableContainerRef.current = node;
|
|
2906
2826
|
if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
|
|
@@ -2912,28 +2832,16 @@ const MRT_TableContainer = ({ table, }) => {
|
|
|
2912
2832
|
? `calc(100vh - ${totalToolbarHeight}px)`
|
|
2913
2833
|
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style), sx: (theme) => (Object.assign({ maxHeight: enableStickyHeader
|
|
2914
2834
|
? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 9999px)`
|
|
2915
|
-
: undefined, maxWidth: '100%', overflow: 'auto', position: 'relative' }, parseFromValuesOrFunc(tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx, theme))), children: [loading ? (jsxRuntime.jsx(
|
|
2916
|
-
alignItems: 'center',
|
|
2917
|
-
backgroundColor: styles.alpha(styles.lighten(theme.palette.background.paper, 0.05), 0.5),
|
|
2918
|
-
bottom: 0,
|
|
2919
|
-
display: 'flex',
|
|
2920
|
-
justifyContent: 'center',
|
|
2921
|
-
left: 0,
|
|
2922
|
-
maxHeight: '100vh',
|
|
2923
|
-
position: 'absolute',
|
|
2924
|
-
right: 0,
|
|
2925
|
-
top: 0,
|
|
2926
|
-
width: '100%',
|
|
2927
|
-
zIndex: 2,
|
|
2928
|
-
}), 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 }))] })));
|
|
2835
|
+
: 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 }))] })));
|
|
2929
2836
|
};
|
|
2930
2837
|
|
|
2931
|
-
const MRT_TablePaper = (
|
|
2932
|
-
var
|
|
2838
|
+
const MRT_TablePaper = (_a) => {
|
|
2839
|
+
var _b, _c;
|
|
2840
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2933
2841
|
const { getState, options: { enableBottomToolbar, enableTopToolbar, muiTablePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table;
|
|
2934
2842
|
const { isFullScreen } = getState();
|
|
2935
|
-
const tablePaperProps = parseFromValuesOrFunc(muiTablePaperProps, { table });
|
|
2936
|
-
return (jsxRuntime.jsxs(
|
|
2843
|
+
const tablePaperProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTablePaperProps, { table })), rest);
|
|
2844
|
+
return (jsxRuntime.jsxs(Paper, Object.assign({ elevation: 2 }, tablePaperProps, { ref: (ref) => {
|
|
2937
2845
|
tablePaperRef.current = ref;
|
|
2938
2846
|
if (tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.ref) {
|
|
2939
2847
|
//@ts-ignore
|
|
@@ -2952,14 +2860,15 @@ const MRT_TablePaper = ({ table, }) => {
|
|
|
2952
2860
|
right: 0,
|
|
2953
2861
|
top: 0,
|
|
2954
2862
|
width: '100vw',
|
|
2955
|
-
zIndex:
|
|
2863
|
+
zIndex: 999,
|
|
2956
2864
|
}
|
|
2957
2865
|
: {})), 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 &&
|
|
2958
|
-
((
|
|
2959
|
-
((
|
|
2866
|
+
((_b = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(MRT_TopToolbar, { table: table }))), jsxRuntime.jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
|
|
2867
|
+
((_c = parseFromValuesOrFunc(renderBottomToolbar, { table })) !== null && _c !== void 0 ? _c : (jsxRuntime.jsx(MRT_BottomToolbar, { table: table })))] })));
|
|
2960
2868
|
};
|
|
2961
2869
|
|
|
2962
|
-
const MRT_RowPinButton = (
|
|
2870
|
+
const MRT_RowPinButton = (_a) => {
|
|
2871
|
+
var { pinningPosition, row, table } = _a, rest = __rest(_a, ["pinningPosition", "row", "table"]);
|
|
2963
2872
|
const { options: { icons: { CloseIcon, PushPinIcon }, localization, rowPinningDisplayMode, }, } = table;
|
|
2964
2873
|
const isPinned = row.getIsPinned();
|
|
2965
2874
|
const [tooltipOpened, setTooltipOpened] = react.useState(false);
|
|
@@ -2968,42 +2877,43 @@ const MRT_RowPinButton = ({ pinningPosition, row, table, }) => {
|
|
|
2968
2877
|
event.stopPropagation();
|
|
2969
2878
|
row.pin(isPinned ? false : pinningPosition);
|
|
2970
2879
|
};
|
|
2971
|
-
return (jsxRuntime.jsx(
|
|
2972
|
-
height: '24px',
|
|
2973
|
-
width: '24px',
|
|
2974
|
-
}, children: isPinned ? (jsxRuntime.jsx(CloseIcon, {})) : (jsxRuntime.jsx(PushPinIcon, { fontSize: "small", style: {
|
|
2880
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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: {
|
|
2975
2881
|
transform: `rotate(${rowPinningDisplayMode === 'sticky'
|
|
2976
2882
|
? 135
|
|
2977
2883
|
: pinningPosition === 'top'
|
|
2978
2884
|
? 180
|
|
2979
2885
|
: 0}deg)`,
|
|
2980
|
-
} })) }) }));
|
|
2886
|
+
} })) })) }));
|
|
2981
2887
|
};
|
|
2982
2888
|
|
|
2983
|
-
const MRT_TableBodyRowPinButton = (
|
|
2889
|
+
const MRT_TableBodyRowPinButton = (_a) => {
|
|
2890
|
+
var { row, table } = _a, rest = __rest(_a, ["row", "table"]);
|
|
2984
2891
|
const { getState, options: { enableRowPinning, rowPinningDisplayMode }, } = table;
|
|
2985
2892
|
const { density } = getState();
|
|
2986
2893
|
const canPin = parseFromValuesOrFunc(enableRowPinning, row);
|
|
2987
2894
|
if (!canPin)
|
|
2988
2895
|
return null;
|
|
2896
|
+
const rowPinButtonProps = Object.assign({ row,
|
|
2897
|
+
table }, rest);
|
|
2989
2898
|
if (rowPinningDisplayMode === 'top-and-bottom' && !row.getIsPinned()) {
|
|
2990
|
-
return (jsxRuntime.jsxs(
|
|
2899
|
+
return (jsxRuntime.jsxs(Box, { sx: {
|
|
2991
2900
|
display: 'flex',
|
|
2992
2901
|
flexDirection: density === 'compact' ? 'row' : 'column',
|
|
2993
|
-
}, children: [jsxRuntime.jsx(MRT_RowPinButton, { pinningPosition: "top"
|
|
2902
|
+
}, children: [jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "top" }, rowPinButtonProps)), jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "bottom" }, rowPinButtonProps))] }));
|
|
2994
2903
|
}
|
|
2995
|
-
return (jsxRuntime.jsx(MRT_RowPinButton, { pinningPosition: rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top'
|
|
2904
|
+
return (jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top' }, rowPinButtonProps)));
|
|
2996
2905
|
};
|
|
2997
2906
|
|
|
2998
|
-
const MRT_ExpandAllButton = (
|
|
2999
|
-
var
|
|
2907
|
+
const MRT_ExpandAllButton = (_a) => {
|
|
2908
|
+
var _b, _c;
|
|
2909
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
3000
2910
|
const { getCanSomeRowsExpand, getIsAllRowsExpanded, getIsSomeRowsExpanded, getState, options: { icons: { KeyboardDoubleArrowDownIcon }, localization, muiExpandAllButtonProps, renderDetailPanel, }, toggleAllRowsExpanded, } = table;
|
|
3001
2911
|
const { density, isLoading } = getState();
|
|
3002
|
-
const iconButtonProps = parseFromValuesOrFunc(muiExpandAllButtonProps, {
|
|
2912
|
+
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiExpandAllButtonProps, {
|
|
3003
2913
|
table,
|
|
3004
|
-
});
|
|
2914
|
+
})), rest);
|
|
3005
2915
|
const isAllRowsExpanded = getIsAllRowsExpanded();
|
|
3006
|
-
return (jsxRuntime.jsx(
|
|
2916
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, 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: {
|
|
3007
2917
|
transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
|
|
3008
2918
|
transition: 'transform 150ms',
|
|
3009
2919
|
} })) })) }) }));
|
|
@@ -3025,22 +2935,23 @@ const MRT_ExpandButton = ({ row, table, }) => {
|
|
|
3025
2935
|
row.toggleExpanded();
|
|
3026
2936
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
|
3027
2937
|
};
|
|
3028
|
-
return (jsxRuntime.jsx(
|
|
2938
|
+
return (jsxRuntime.jsx(Tooltip, { arrow: true, disableHoverListener: !canExpand && !renderDetailPanel, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : (isExpanded ? 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: {
|
|
3029
2939
|
transform: `rotate(${!canExpand && !renderDetailPanel ? -90 : isExpanded ? -180 : 0}deg)`,
|
|
3030
2940
|
transition: 'transform 150ms',
|
|
3031
2941
|
} })) })) }) }));
|
|
3032
2942
|
};
|
|
3033
2943
|
|
|
3034
|
-
const MRT_RowActionMenu = (
|
|
2944
|
+
const MRT_RowActionMenu = (_a) => {
|
|
2945
|
+
var { anchorEl, handleEdit, row, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "handleEdit", "row", "setAnchorEl", "table"]);
|
|
3035
2946
|
const { getState, options: { enableEditing, icons: { EditIcon }, localization, renderRowActionMenuItems, }, } = table;
|
|
3036
2947
|
const { density } = getState();
|
|
3037
|
-
return (jsxRuntime.jsxs(
|
|
2948
|
+
return (jsxRuntime.jsxs(Menu, Object.assign({ MenuListProps: {
|
|
3038
2949
|
dense: density === 'compact',
|
|
3039
|
-
}, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl, children: [parseFromValuesOrFunc(enableEditing, row) && (jsxRuntime.jsx(
|
|
2950
|
+
}, 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({
|
|
3040
2951
|
closeMenu: () => setAnchorEl(null),
|
|
3041
2952
|
row,
|
|
3042
2953
|
table,
|
|
3043
|
-
})] }));
|
|
2954
|
+
})] })));
|
|
3044
2955
|
};
|
|
3045
2956
|
|
|
3046
2957
|
const commonIconButtonStyles = {
|
|
@@ -3053,7 +2964,8 @@ const commonIconButtonStyles = {
|
|
|
3053
2964
|
transition: 'opacity 150ms',
|
|
3054
2965
|
width: '2rem',
|
|
3055
2966
|
};
|
|
3056
|
-
const MRT_ToggleRowActionMenuButton = (
|
|
2967
|
+
const MRT_ToggleRowActionMenuButton = (_a) => {
|
|
2968
|
+
var { cell, row, table } = _a, rest = __rest(_a, ["cell", "row", "table"]);
|
|
3057
2969
|
const { getState, options: { createDisplayMode, editDisplayMode, enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
|
|
3058
2970
|
const { creatingRow, editingRow } = getState();
|
|
3059
2971
|
const isCreating = (creatingRow === null || creatingRow === void 0 ? void 0 : creatingRow.id) === row.id;
|
|
@@ -3072,10 +2984,12 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
|
|
|
3072
2984
|
setAnchorEl(null);
|
|
3073
2985
|
};
|
|
3074
2986
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderRowActions && !showEditActionButtons ? (renderRowActions({ cell, row, table })) : showEditActionButtons ? (jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems &&
|
|
3075
|
-
parseFromValuesOrFunc(enableEditing, row)
|
|
2987
|
+
parseFromValuesOrFunc(enableEditing, row) &&
|
|
2988
|
+
['modal', 'row'].includes(editDisplayMode) ? (jsxRuntime.jsx(Tooltip, { arrow: true, 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, { arrow: true, 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 }));
|
|
3076
2989
|
};
|
|
3077
2990
|
|
|
3078
2991
|
const blankColProps = {
|
|
2992
|
+
children: null,
|
|
3079
2993
|
sx: {
|
|
3080
2994
|
flex: '1 0 auto',
|
|
3081
2995
|
minWidth: 0,
|
|
@@ -3469,39 +3383,39 @@ const MRT_FilterFns = Object.assign(Object.assign({}, reactTable.filterFns), { b
|
|
|
3469
3383
|
startsWith });
|
|
3470
3384
|
|
|
3471
3385
|
const MRT_Default_Icons = {
|
|
3472
|
-
ArrowDownwardIcon
|
|
3473
|
-
ArrowRightIcon
|
|
3474
|
-
CancelIcon
|
|
3475
|
-
ChevronLeftIcon
|
|
3476
|
-
ChevronRightIcon
|
|
3477
|
-
ClearAllIcon
|
|
3478
|
-
CloseIcon
|
|
3479
|
-
DensityLargeIcon
|
|
3480
|
-
DensityMediumIcon
|
|
3481
|
-
DensitySmallIcon
|
|
3482
|
-
DragHandleIcon
|
|
3483
|
-
DynamicFeedIcon
|
|
3484
|
-
EditIcon
|
|
3485
|
-
ExpandMoreIcon
|
|
3486
|
-
FilterAltIcon
|
|
3487
|
-
FilterListIcon
|
|
3488
|
-
FilterListOffIcon
|
|
3489
|
-
FirstPageIcon
|
|
3490
|
-
FullscreenExitIcon
|
|
3491
|
-
FullscreenIcon
|
|
3492
|
-
KeyboardDoubleArrowDownIcon
|
|
3493
|
-
LastPageIcon
|
|
3494
|
-
MoreHorizIcon
|
|
3495
|
-
MoreVertIcon
|
|
3496
|
-
PushPinIcon
|
|
3497
|
-
RestartAltIcon
|
|
3498
|
-
SaveIcon
|
|
3499
|
-
SearchIcon
|
|
3500
|
-
SearchOffIcon
|
|
3501
|
-
SortIcon
|
|
3502
|
-
SyncAltIcon
|
|
3503
|
-
ViewColumnIcon
|
|
3504
|
-
VisibilityOffIcon
|
|
3386
|
+
ArrowDownwardIcon,
|
|
3387
|
+
ArrowRightIcon,
|
|
3388
|
+
CancelIcon,
|
|
3389
|
+
ChevronLeftIcon,
|
|
3390
|
+
ChevronRightIcon,
|
|
3391
|
+
ClearAllIcon,
|
|
3392
|
+
CloseIcon,
|
|
3393
|
+
DensityLargeIcon,
|
|
3394
|
+
DensityMediumIcon,
|
|
3395
|
+
DensitySmallIcon,
|
|
3396
|
+
DragHandleIcon,
|
|
3397
|
+
DynamicFeedIcon,
|
|
3398
|
+
EditIcon,
|
|
3399
|
+
ExpandMoreIcon,
|
|
3400
|
+
FilterAltIcon,
|
|
3401
|
+
FilterListIcon,
|
|
3402
|
+
FilterListOffIcon,
|
|
3403
|
+
FirstPageIcon,
|
|
3404
|
+
FullscreenExitIcon,
|
|
3405
|
+
FullscreenIcon,
|
|
3406
|
+
KeyboardDoubleArrowDownIcon,
|
|
3407
|
+
LastPageIcon,
|
|
3408
|
+
MoreHorizIcon,
|
|
3409
|
+
MoreVertIcon,
|
|
3410
|
+
PushPinIcon,
|
|
3411
|
+
RestartAltIcon,
|
|
3412
|
+
SaveIcon,
|
|
3413
|
+
SearchIcon,
|
|
3414
|
+
SearchOffIcon,
|
|
3415
|
+
SortIcon,
|
|
3416
|
+
SyncAltIcon,
|
|
3417
|
+
ViewColumnIcon,
|
|
3418
|
+
VisibilityOffIcon,
|
|
3505
3419
|
};
|
|
3506
3420
|
|
|
3507
3421
|
const MRT_Localization_EN = {
|
|
@@ -3596,6 +3510,26 @@ const MRT_Localization_EN = {
|
|
|
3596
3510
|
unpinAll: 'Unpin all',
|
|
3597
3511
|
};
|
|
3598
3512
|
|
|
3513
|
+
const MRT_DefaultColumn = {
|
|
3514
|
+
filterVariant: 'text',
|
|
3515
|
+
maxSize: 1000,
|
|
3516
|
+
minSize: 40,
|
|
3517
|
+
size: 180,
|
|
3518
|
+
};
|
|
3519
|
+
const MRT_DefaultDisplayColumn = {
|
|
3520
|
+
columnDefType: 'display',
|
|
3521
|
+
enableClickToCopy: false,
|
|
3522
|
+
enableColumnActions: false,
|
|
3523
|
+
enableColumnDragging: false,
|
|
3524
|
+
enableColumnFilter: false,
|
|
3525
|
+
enableColumnOrdering: false,
|
|
3526
|
+
enableEditing: false,
|
|
3527
|
+
enableGlobalFilter: false,
|
|
3528
|
+
enableGrouping: false,
|
|
3529
|
+
enableHiding: false,
|
|
3530
|
+
enableResizing: false,
|
|
3531
|
+
enableSorting: false,
|
|
3532
|
+
};
|
|
3599
3533
|
const useMRT_TableOptions = (_a) => {
|
|
3600
3534
|
var _b;
|
|
3601
3535
|
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"]);
|
|
@@ -3673,11 +3607,7 @@ const useMRT_TableOptions = (_a) => {
|
|
|
3673
3607
|
selectAllMode, sortingFns: _sortingFns }, rest);
|
|
3674
3608
|
};
|
|
3675
3609
|
|
|
3676
|
-
const useMaterialReactTable = (tableOptions) =>
|
|
3677
|
-
const parsedTableOptions = useMRT_TableOptions(tableOptions);
|
|
3678
|
-
const tableInstance = useMRT_TableInstance(parsedTableOptions);
|
|
3679
|
-
return tableInstance;
|
|
3680
|
-
};
|
|
3610
|
+
const useMaterialReactTable = (tableOptions) => useMRT_TableInstance(useMRT_TableOptions(tableOptions));
|
|
3681
3611
|
|
|
3682
3612
|
const isTableInstanceProp = (props) => props.table !== undefined;
|
|
3683
3613
|
const MaterialReactTable = (props) => {
|
|
@@ -3696,8 +3626,6 @@ exports.MRT_BottomToolbar = MRT_BottomToolbar;
|
|
|
3696
3626
|
exports.MRT_ColumnActionMenu = MRT_ColumnActionMenu;
|
|
3697
3627
|
exports.MRT_ColumnPinningButtons = MRT_ColumnPinningButtons;
|
|
3698
3628
|
exports.MRT_CopyButton = MRT_CopyButton;
|
|
3699
|
-
exports.MRT_DefaultColumn = MRT_DefaultColumn;
|
|
3700
|
-
exports.MRT_DefaultDisplayColumn = MRT_DefaultDisplayColumn;
|
|
3701
3629
|
exports.MRT_EditActionButtons = MRT_EditActionButtons;
|
|
3702
3630
|
exports.MRT_EditCellTextField = MRT_EditCellTextField;
|
|
3703
3631
|
exports.MRT_EditRowModal = MRT_EditRowModal;
|
|
@@ -3740,6 +3668,7 @@ exports.MRT_TableHeadCellGrabHandle = MRT_TableHeadCellGrabHandle;
|
|
|
3740
3668
|
exports.MRT_TableHeadCellResizeHandle = MRT_TableHeadCellResizeHandle;
|
|
3741
3669
|
exports.MRT_TableHeadCellSortLabel = MRT_TableHeadCellSortLabel;
|
|
3742
3670
|
exports.MRT_TableHeadRow = MRT_TableHeadRow;
|
|
3671
|
+
exports.MRT_TableLoadingOverlay = MRT_TableLoadingOverlay;
|
|
3743
3672
|
exports.MRT_TablePagination = MRT_TablePagination;
|
|
3744
3673
|
exports.MRT_TablePaper = MRT_TablePaper;
|
|
3745
3674
|
exports.MRT_ToggleDensePaddingButton = MRT_ToggleDensePaddingButton;
|
|
@@ -3757,7 +3686,6 @@ exports.Memo_MRT_TableBodyCell = Memo_MRT_TableBodyCell;
|
|
|
3757
3686
|
exports.Memo_MRT_TableBodyRow = Memo_MRT_TableBodyRow;
|
|
3758
3687
|
exports.commonListItemStyles = commonListItemStyles;
|
|
3759
3688
|
exports.commonMenuItemStyles = commonMenuItemStyles;
|
|
3760
|
-
exports.commonToolbarStyles = commonToolbarStyles;
|
|
3761
3689
|
exports.createMRTColumnHelper = createMRTColumnHelper;
|
|
3762
3690
|
exports.createRow = createRow;
|
|
3763
3691
|
exports.extraIndexRangeExtractor = extraIndexRangeExtractor;
|
|
@@ -3765,7 +3693,8 @@ exports.flexRender = flexRender;
|
|
|
3765
3693
|
exports.getAllLeafColumnDefs = getAllLeafColumnDefs;
|
|
3766
3694
|
exports.getCanRankRows = getCanRankRows;
|
|
3767
3695
|
exports.getColumnId = getColumnId;
|
|
3768
|
-
exports.
|
|
3696
|
+
exports.getCommonMRTCellStyles = getCommonMRTCellStyles;
|
|
3697
|
+
exports.getCommonToolbarStyles = getCommonToolbarStyles;
|
|
3769
3698
|
exports.getDefaultColumnFilterFn = getDefaultColumnFilterFn;
|
|
3770
3699
|
exports.getDefaultColumnOrderIds = getDefaultColumnOrderIds;
|
|
3771
3700
|
exports.getIsFirstColumn = getIsFirstColumn;
|
|
@@ -3773,6 +3702,7 @@ exports.getIsFirstRightPinnedColumn = getIsFirstRightPinnedColumn;
|
|
|
3773
3702
|
exports.getIsLastColumn = getIsLastColumn;
|
|
3774
3703
|
exports.getIsLastLeftPinnedColumn = getIsLastLeftPinnedColumn;
|
|
3775
3704
|
exports.getLeadingDisplayColumnIds = getLeadingDisplayColumnIds;
|
|
3705
|
+
exports.getMRTTheme = getMRTTheme;
|
|
3776
3706
|
exports.getTotalRight = getTotalRight;
|
|
3777
3707
|
exports.getTrailingDisplayColumnIds = getTrailingDisplayColumnIds;
|
|
3778
3708
|
exports.mrtFilterOptions = mrtFilterOptions;
|