material-react-table 1.14.0 → 2.0.0-alpha.0
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/README.md +1 -0
- package/dist/cjs/index.js +1629 -1323
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/MaterialReactTable.d.ts +7 -11
- package/dist/cjs/types/body/MRT_TableBody.d.ts +4 -5
- package/dist/cjs/types/body/MRT_TableBodyCell.d.ts +5 -5
- package/dist/cjs/types/body/MRT_TableBodyCellValue.d.ts +4 -4
- package/dist/cjs/types/body/MRT_TableBodyRow.d.ts +5 -6
- package/dist/cjs/types/body/MRT_TableBodyRowGrabHandle.d.ts +5 -5
- package/dist/cjs/types/body/MRT_TableDetailPanel.d.ts +6 -6
- package/dist/cjs/types/body/index.d.ts +6 -0
- package/dist/cjs/types/buttons/MRT_ColumnPinningButtons.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_CopyButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_EditActionButtons.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_ExpandAllButton.d.ts +3 -3
- package/dist/cjs/types/buttons/MRT_ExpandButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_ShowHideColumnsButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_ToggleFiltersButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_ToggleFullScreenButton.d.ts +7 -0
- package/dist/cjs/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -2
- package/dist/cjs/types/buttons/index.d.ts +12 -0
- package/dist/cjs/types/column.utils.d.ts +39 -51
- package/dist/cjs/types/filterFns.d.ts +14 -14
- package/dist/cjs/types/footer/MRT_TableFooter.d.ts +3 -3
- package/dist/cjs/types/footer/MRT_TableFooterCell.d.ts +4 -4
- package/dist/cjs/types/footer/MRT_TableFooterRow.d.ts +4 -4
- package/dist/cjs/types/footer/index.d.ts +3 -0
- package/dist/cjs/types/head/MRT_TableHead.d.ts +3 -3
- package/dist/cjs/types/head/MRT_TableHeadCell.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadCellFilterContainer.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadCellGrabHandle.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadCellResizeHandle.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +4 -4
- package/dist/cjs/types/head/MRT_TableHeadRow.d.ts +4 -4
- package/dist/cjs/types/head/index.d.ts +9 -0
- package/dist/cjs/types/hooks/useMRT_DisplayColumns.d.ts +9 -0
- package/dist/cjs/types/hooks/useMRT_Effects.d.ts +2 -0
- package/dist/cjs/types/hooks/useMRT_TableInstance.d.ts +2 -0
- package/dist/cjs/types/hooks/useMRT_TableOptions.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +14 -25
- package/dist/cjs/types/inputs/MRT_EditCellTextField.d.ts +2 -3
- package/dist/cjs/types/inputs/MRT_FilterCheckbox.d.ts +4 -4
- package/dist/cjs/types/inputs/MRT_FilterRangeFields.d.ts +4 -4
- package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +4 -4
- package/dist/cjs/types/inputs/MRT_FilterTextField.d.ts +4 -4
- package/dist/cjs/types/inputs/MRT_GlobalFilterTextField.d.ts +2 -2
- package/dist/cjs/types/inputs/MRT_SelectCheckbox.d.ts +4 -4
- package/dist/cjs/types/inputs/index.d.ts +7 -0
- package/dist/cjs/types/locales/ar.d.ts +2 -0
- package/dist/cjs/types/locales/bg.d.ts +2 -0
- package/dist/cjs/types/locales/et.d.ts +2 -0
- package/dist/cjs/types/locales/ko.d.ts +2 -0
- package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
- package/dist/cjs/types/menus/MRT_FilterOptionMenu.d.ts +2 -2
- package/dist/cjs/types/menus/MRT_RowActionMenu.d.ts +4 -4
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenu.d.ts +2 -2
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +2 -2
- package/dist/cjs/types/menus/index.d.ts +5 -0
- package/dist/cjs/types/modals/MRT_EditRowModal.d.ts +7 -0
- package/dist/cjs/types/modals/index.d.ts +1 -0
- package/dist/cjs/types/sortingFns.d.ts +2 -418
- package/dist/cjs/types/table/MRT_Table.d.ts +3 -3
- package/dist/cjs/types/table/MRT_TableContainer.d.ts +3 -3
- package/dist/cjs/types/table/MRT_TablePaper.d.ts +3 -3
- package/dist/cjs/types/table/index.d.ts +4 -0
- package/dist/cjs/types/toolbar/MRT_BottomToolbar.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_LinearProgressBar.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarDropZone.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarInternalButtons.d.ts +2 -2
- package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +2 -2
- package/dist/cjs/types/toolbar/index.d.ts +7 -0
- package/dist/cjs/types/types.d.ts +116 -85
- package/dist/cjs/types/useMaterialReactTable.d.ts +2 -0
- package/dist/esm/material-react-table.esm.js +1559 -1317
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/MaterialReactTable.d.ts +7 -11
- package/dist/esm/types/body/MRT_TableBody.d.ts +4 -5
- package/dist/esm/types/body/MRT_TableBodyCell.d.ts +5 -5
- package/dist/esm/types/body/MRT_TableBodyCellValue.d.ts +4 -4
- package/dist/esm/types/body/MRT_TableBodyRow.d.ts +5 -6
- package/dist/esm/types/body/MRT_TableBodyRowGrabHandle.d.ts +5 -5
- package/dist/esm/types/body/MRT_TableDetailPanel.d.ts +6 -6
- package/dist/esm/types/body/index.d.ts +6 -0
- package/dist/esm/types/buttons/MRT_ColumnPinningButtons.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_CopyButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_EditActionButtons.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_ExpandAllButton.d.ts +3 -3
- package/dist/esm/types/buttons/MRT_ExpandButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_ShowHideColumnsButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_ToggleFiltersButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_ToggleFullScreenButton.d.ts +7 -0
- package/dist/esm/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -2
- package/dist/esm/types/buttons/index.d.ts +12 -0
- package/dist/esm/types/column.utils.d.ts +39 -51
- package/dist/esm/types/filterFns.d.ts +14 -14
- package/dist/esm/types/footer/MRT_TableFooter.d.ts +3 -3
- package/dist/esm/types/footer/MRT_TableFooterCell.d.ts +4 -4
- package/dist/esm/types/footer/MRT_TableFooterRow.d.ts +4 -4
- package/dist/esm/types/footer/index.d.ts +3 -0
- package/dist/esm/types/head/MRT_TableHead.d.ts +3 -3
- package/dist/esm/types/head/MRT_TableHeadCell.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadCellFilterContainer.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadCellGrabHandle.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadCellResizeHandle.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +4 -4
- package/dist/esm/types/head/MRT_TableHeadRow.d.ts +4 -4
- package/dist/esm/types/head/index.d.ts +9 -0
- package/dist/esm/types/hooks/useMRT_DisplayColumns.d.ts +9 -0
- package/dist/esm/types/hooks/useMRT_Effects.d.ts +2 -0
- package/dist/esm/types/hooks/useMRT_TableInstance.d.ts +2 -0
- package/dist/esm/types/hooks/useMRT_TableOptions.d.ts +2 -0
- package/dist/esm/types/index.d.ts +14 -25
- package/dist/esm/types/inputs/MRT_EditCellTextField.d.ts +2 -3
- package/dist/esm/types/inputs/MRT_FilterCheckbox.d.ts +4 -4
- package/dist/esm/types/inputs/MRT_FilterRangeFields.d.ts +4 -4
- package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +4 -4
- package/dist/esm/types/inputs/MRT_FilterTextField.d.ts +4 -4
- package/dist/esm/types/inputs/MRT_GlobalFilterTextField.d.ts +2 -2
- package/dist/esm/types/inputs/MRT_SelectCheckbox.d.ts +4 -4
- package/dist/esm/types/inputs/index.d.ts +7 -0
- package/dist/esm/types/locales/ar.d.ts +2 -0
- package/dist/esm/types/locales/bg.d.ts +2 -0
- package/dist/esm/types/locales/et.d.ts +2 -0
- package/dist/esm/types/locales/ko.d.ts +2 -0
- package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +4 -4
- package/dist/esm/types/menus/MRT_FilterOptionMenu.d.ts +2 -2
- package/dist/esm/types/menus/MRT_RowActionMenu.d.ts +4 -4
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenu.d.ts +2 -2
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +2 -2
- package/dist/esm/types/menus/index.d.ts +5 -0
- package/dist/esm/types/modals/MRT_EditRowModal.d.ts +7 -0
- package/dist/esm/types/modals/index.d.ts +1 -0
- package/dist/esm/types/sortingFns.d.ts +2 -418
- package/dist/esm/types/table/MRT_Table.d.ts +3 -3
- package/dist/esm/types/table/MRT_TableContainer.d.ts +3 -3
- package/dist/esm/types/table/MRT_TablePaper.d.ts +3 -3
- package/dist/esm/types/table/index.d.ts +4 -0
- package/dist/esm/types/toolbar/MRT_BottomToolbar.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_LinearProgressBar.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_ToolbarDropZone.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_ToolbarInternalButtons.d.ts +2 -2
- package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +2 -2
- package/dist/esm/types/toolbar/index.d.ts +7 -0
- package/dist/esm/types/types.d.ts +116 -85
- package/dist/esm/types/useMaterialReactTable.d.ts +2 -0
- package/dist/index.d.ts +606 -156
- package/locales/ar.d.ts +2 -0
- package/locales/ar.esm.d.ts +2 -0
- package/locales/ar.esm.js +93 -0
- package/locales/ar.esm.js.map +1 -0
- package/locales/ar.js +97 -0
- package/locales/ar.js.map +1 -0
- package/locales/bg.d.ts +2 -0
- package/locales/bg.esm.d.ts +2 -0
- package/locales/bg.esm.js +93 -0
- package/locales/bg.esm.js.map +1 -0
- package/locales/bg.js +97 -0
- package/locales/bg.js.map +1 -0
- package/locales/cs.esm.js +1 -2
- package/locales/cs.esm.js.map +1 -1
- package/locales/cs.js +1 -2
- package/locales/cs.js.map +1 -1
- package/locales/da.esm.js +0 -1
- package/locales/da.esm.js.map +1 -1
- package/locales/da.js +0 -1
- package/locales/da.js.map +1 -1
- package/locales/de.esm.js +0 -1
- package/locales/de.esm.js.map +1 -1
- package/locales/de.js +0 -1
- package/locales/de.js.map +1 -1
- package/locales/en.esm.js +0 -1
- package/locales/en.esm.js.map +1 -1
- package/locales/en.js +0 -1
- package/locales/en.js.map +1 -1
- package/locales/es.esm.js +0 -1
- package/locales/es.esm.js.map +1 -1
- package/locales/es.js +0 -1
- package/locales/es.js.map +1 -1
- package/locales/et.d.ts +2 -0
- package/locales/et.esm.d.ts +2 -0
- package/locales/et.esm.js +93 -0
- package/locales/et.esm.js.map +1 -0
- package/locales/et.js +97 -0
- package/locales/et.js.map +1 -0
- package/locales/fa.esm.js +0 -1
- package/locales/fa.esm.js.map +1 -1
- package/locales/fa.js +0 -1
- package/locales/fa.js.map +1 -1
- package/locales/fi.esm.js +0 -1
- package/locales/fi.esm.js.map +1 -1
- package/locales/fi.js +0 -1
- package/locales/fi.js.map +1 -1
- package/locales/fr.esm.js +0 -1
- package/locales/fr.esm.js.map +1 -1
- package/locales/fr.js +0 -1
- package/locales/fr.js.map +1 -1
- package/locales/hu.esm.js +0 -1
- package/locales/hu.esm.js.map +1 -1
- package/locales/hu.js +0 -1
- package/locales/hu.js.map +1 -1
- package/locales/id.esm.js +0 -1
- package/locales/id.esm.js.map +1 -1
- package/locales/id.js +0 -1
- package/locales/id.js.map +1 -1
- package/locales/it.esm.js +0 -1
- package/locales/it.esm.js.map +1 -1
- package/locales/it.js +0 -1
- package/locales/it.js.map +1 -1
- package/locales/ja.esm.js +0 -1
- package/locales/ja.esm.js.map +1 -1
- package/locales/ja.js +0 -1
- package/locales/ja.js.map +1 -1
- package/locales/ko.d.ts +2 -0
- package/locales/ko.esm.d.ts +2 -0
- package/locales/ko.esm.js +93 -0
- package/locales/ko.esm.js.map +1 -0
- package/locales/ko.js +97 -0
- package/locales/ko.js.map +1 -0
- package/locales/nl.esm.js +0 -1
- package/locales/nl.esm.js.map +1 -1
- package/locales/nl.js +0 -1
- package/locales/nl.js.map +1 -1
- package/locales/no.esm.js +0 -1
- package/locales/no.esm.js.map +1 -1
- package/locales/no.js +0 -1
- package/locales/no.js.map +1 -1
- package/locales/pl.esm.js +0 -1
- package/locales/pl.esm.js.map +1 -1
- package/locales/pl.js +0 -1
- package/locales/pl.js.map +1 -1
- package/locales/pt-BR.esm.js +0 -1
- package/locales/pt-BR.esm.js.map +1 -1
- package/locales/pt-BR.js +0 -1
- package/locales/pt-BR.js.map +1 -1
- package/locales/pt.esm.js +0 -1
- package/locales/pt.esm.js.map +1 -1
- package/locales/pt.js +0 -1
- package/locales/pt.js.map +1 -1
- package/locales/ro.esm.js +0 -1
- package/locales/ro.esm.js.map +1 -1
- package/locales/ro.js +0 -1
- package/locales/ro.js.map +1 -1
- package/locales/ru.esm.js +0 -1
- package/locales/ru.esm.js.map +1 -1
- package/locales/ru.js +0 -1
- package/locales/ru.js.map +1 -1
- package/locales/sk.esm.js +0 -1
- package/locales/sk.esm.js.map +1 -1
- package/locales/sk.js +0 -1
- package/locales/sk.js.map +1 -1
- package/locales/sr-Cyrl-RS.esm.js +0 -1
- package/locales/sr-Cyrl-RS.esm.js.map +1 -1
- package/locales/sr-Cyrl-RS.js +0 -1
- package/locales/sr-Cyrl-RS.js.map +1 -1
- package/locales/sr-Latn-RS.esm.js +0 -1
- package/locales/sr-Latn-RS.esm.js.map +1 -1
- package/locales/sr-Latn-RS.js +0 -1
- package/locales/sr-Latn-RS.js.map +1 -1
- package/locales/sv.esm.js +0 -1
- package/locales/sv.esm.js.map +1 -1
- package/locales/sv.js +0 -1
- package/locales/sv.js.map +1 -1
- package/locales/tr.esm.js +0 -1
- package/locales/tr.esm.js.map +1 -1
- package/locales/tr.js +0 -1
- package/locales/tr.js.map +1 -1
- package/locales/uk.esm.js +0 -1
- package/locales/uk.esm.js.map +1 -1
- package/locales/uk.js +0 -1
- package/locales/uk.js.map +1 -1
- package/locales/vi.esm.js +0 -1
- package/locales/vi.esm.js.map +1 -1
- package/locales/vi.js +0 -1
- package/locales/vi.js.map +1 -1
- package/locales/zh-Hans.esm.js +7 -8
- package/locales/zh-Hans.esm.js.map +1 -1
- package/locales/zh-Hans.js +7 -8
- package/locales/zh-Hans.js.map +1 -1
- package/locales/zh-Hant.esm.js +1 -2
- package/locales/zh-Hant.esm.js.map +1 -1
- package/locales/zh-Hant.js +1 -2
- package/locales/zh-Hant.js.map +1 -1
- package/package.json +44 -42
- package/src/MaterialReactTable.tsx +31 -168
- package/src/body/MRT_TableBody.tsx +10 -23
- package/src/body/MRT_TableBodyCell.tsx +36 -39
- package/src/body/MRT_TableBodyCellValue.tsx +7 -4
- package/src/body/MRT_TableBodyRow.tsx +7 -7
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +13 -10
- package/src/body/MRT_TableDetailPanel.tsx +11 -11
- package/src/body/index.ts +6 -0
- package/src/buttons/MRT_ColumnPinningButtons.tsx +2 -4
- package/src/buttons/MRT_CopyButton.tsx +9 -9
- package/src/buttons/MRT_EditActionButtons.tsx +56 -25
- package/src/buttons/MRT_ExpandAllButton.tsx +5 -3
- package/src/buttons/MRT_ExpandButton.tsx +2 -2
- package/src/buttons/MRT_GrabHandleButton.tsx +2 -2
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +2 -5
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +2 -3
- package/src/buttons/MRT_ToggleFiltersButton.tsx +2 -5
- package/src/buttons/{MRT_FullScreenToggleButton.tsx → MRT_ToggleFullScreenButton.tsx} +13 -6
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -5
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +16 -8
- package/src/buttons/index.ts +12 -0
- package/src/column.utils.ts +96 -45
- package/src/filterFns.ts +14 -14
- package/src/footer/MRT_TableFooter.tsx +4 -4
- package/src/footer/MRT_TableFooterCell.tsx +7 -4
- package/src/footer/MRT_TableFooterRow.tsx +6 -6
- package/src/footer/index.ts +3 -0
- package/src/head/MRT_TableHead.tsx +4 -4
- package/src/head/MRT_TableHeadCell.tsx +7 -4
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +14 -12
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +9 -4
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +9 -4
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +13 -13
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +9 -4
- package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -6
- package/src/head/MRT_TableHeadRow.tsx +6 -6
- package/src/head/index.ts +9 -0
- package/src/hooks/useMRT_DisplayColumns.tsx +142 -0
- package/src/hooks/useMRT_Effects.ts +77 -0
- package/src/hooks/useMRT_TableInstance.ts +291 -0
- package/src/hooks/useMRT_TableOptions.ts +169 -0
- package/src/index.ts +16 -0
- package/src/inputs/MRT_EditCellTextField.tsx +39 -25
- package/src/inputs/MRT_FilterCheckbox.tsx +14 -11
- package/src/inputs/MRT_FilterRangeFields.tsx +7 -4
- package/src/inputs/MRT_FilterRangeSlider.tsx +18 -19
- package/src/inputs/MRT_FilterTextField.tsx +15 -15
- package/src/inputs/MRT_GlobalFilterTextField.tsx +2 -4
- package/src/inputs/MRT_SelectCheckbox.tsx +8 -4
- package/src/inputs/index.ts +7 -0
- package/src/locales/ar.ts +94 -0
- package/src/locales/bg.ts +93 -0
- package/src/{_locales → locales}/cs.ts +1 -2
- package/src/{_locales → locales}/da.ts +0 -1
- package/src/{_locales → locales}/de.ts +0 -1
- package/src/{_locales → locales}/en.ts +1 -1
- package/src/{_locales → locales}/es.ts +0 -1
- package/src/locales/et.ts +94 -0
- package/src/{_locales → locales}/fa.ts +0 -1
- package/src/{_locales → locales}/fi.ts +0 -1
- package/src/{_locales → locales}/fr.ts +0 -1
- package/src/{_locales → locales}/hu.ts +0 -1
- package/src/{_locales → locales}/id.ts +0 -1
- package/src/{_locales → locales}/it.ts +0 -1
- package/src/{_locales → locales}/ja.ts +0 -1
- package/src/locales/ko.ts +93 -0
- package/src/{_locales → locales}/nl.ts +0 -1
- package/src/{_locales → locales}/no.ts +1 -1
- package/src/{_locales → locales}/pl.ts +0 -1
- package/src/{_locales → locales}/pt-BR.ts +0 -1
- package/src/{_locales → locales}/pt.ts +0 -1
- package/src/{_locales → locales}/ro.ts +0 -1
- package/src/{_locales → locales}/ru.ts +0 -1
- package/src/{_locales → locales}/sk.ts +0 -1
- package/src/{_locales → locales}/sr-Cyrl-RS.ts +0 -1
- package/src/{_locales → locales}/sr-Latn-RS.ts +0 -1
- package/src/{_locales → locales}/sv.ts +0 -1
- package/src/{_locales → locales}/tr.ts +0 -1
- package/src/{_locales → locales}/uk.ts +0 -1
- package/src/{_locales → locales}/vi.ts +0 -1
- package/src/{_locales → locales}/zh-Hans.ts +7 -8
- package/src/{_locales → locales}/zh-Hant.ts +1 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +8 -8
- package/src/menus/MRT_FilterOptionMenu.tsx +4 -3
- package/src/menus/MRT_RowActionMenu.tsx +5 -5
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +4 -6
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +4 -4
- package/src/menus/index.ts +5 -0
- package/src/modals/MRT_EditRowModal.tsx +115 -0
- package/src/modals/index.ts +1 -0
- package/src/sortingFns.ts +2 -2
- package/src/table/MRT_Table.tsx +40 -33
- package/src/table/MRT_TableContainer.tsx +23 -5
- package/src/table/MRT_TablePaper.tsx +13 -4
- package/src/table/index.ts +4 -0
- package/src/toolbar/MRT_BottomToolbar.tsx +2 -2
- package/src/toolbar/MRT_LinearProgressBar.tsx +2 -2
- package/src/toolbar/MRT_TablePagination.tsx +2 -2
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +2 -2
- package/src/toolbar/MRT_ToolbarDropZone.tsx +2 -2
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +6 -8
- package/src/toolbar/MRT_TopToolbar.tsx +2 -2
- package/src/toolbar/index.ts +7 -0
- package/src/types.ts +765 -751
- package/src/useMaterialReactTable.ts +11 -0
- package/dist/cjs/types/body/MRT_EditRowModal.d.ts +0 -8
- package/dist/cjs/types/buttons/MRT_FullScreenToggleButton.d.ts +0 -7
- package/dist/cjs/types/table/MRT_TableRoot.d.ts +0 -1
- package/dist/esm/types/body/MRT_EditRowModal.d.ts +0 -8
- package/dist/esm/types/buttons/MRT_FullScreenToggleButton.d.ts +0 -7
- package/dist/esm/types/table/MRT_TableRoot.d.ts +0 -1
- package/src/body/MRT_EditRowModal.tsx +0 -57
- package/src/index.tsx +0 -50
- package/src/table/MRT_TableRoot.tsx +0 -421
- /package/dist/cjs/types/{_locales → locales}/cs.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/da.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/de.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/en.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/es.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/fa.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/fi.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/fr.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/hu.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/id.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/it.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/ja.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/nl.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/no.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/pl.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/pt-BR.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/pt.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/ro.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/ru.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/sk.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/sr-Cyrl-RS.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/sr-Latn-RS.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/sv.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/tr.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/uk.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/vi.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/zh-Hans.d.ts +0 -0
- /package/dist/cjs/types/{_locales → locales}/zh-Hant.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/cs.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/da.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/de.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/en.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/es.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/fa.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/fi.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/fr.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/hu.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/id.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/it.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/ja.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/nl.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/no.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/pl.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/pt-BR.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/pt.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/ro.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/ru.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/sk.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/sr-Cyrl-RS.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/sr-Latn-RS.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/sv.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/tr.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/uk.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/vi.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/zh-Hans.d.ts +0 -0
- /package/dist/esm/types/{_locales → locales}/zh-Hant.d.ts +0 -0
@@ -7,16 +7,14 @@ import { MRT_ShowHideColumnsMenuItems } from './MRT_ShowHideColumnsMenuItems';
|
|
7
7
|
import { getDefaultColumnOrderIds } from '../column.utils';
|
8
8
|
import { type MRT_Column, type MRT_TableInstance } from '../types';
|
9
9
|
|
10
|
-
interface Props<TData extends Record<string, any
|
10
|
+
interface Props<TData extends Record<string, any>> {
|
11
11
|
anchorEl: HTMLElement | null;
|
12
12
|
isSubMenu?: boolean;
|
13
13
|
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
14
14
|
table: MRT_TableInstance<TData>;
|
15
15
|
}
|
16
16
|
|
17
|
-
export const MRT_ShowHideColumnsMenu = <
|
18
|
-
TData extends Record<string, any> = {},
|
19
|
-
>({
|
17
|
+
export const MRT_ShowHideColumnsMenu = <TData extends Record<string, any>>({
|
20
18
|
anchorEl,
|
21
19
|
setAnchorEl,
|
22
20
|
table,
|
@@ -35,7 +33,7 @@ export const MRT_ShowHideColumnsMenu = <
|
|
35
33
|
options: {
|
36
34
|
enableColumnOrdering,
|
37
35
|
enableHiding,
|
38
|
-
|
36
|
+
enableColumnPinning,
|
39
37
|
localization,
|
40
38
|
},
|
41
39
|
} = table;
|
@@ -111,7 +109,7 @@ export const MRT_ShowHideColumnsMenu = <
|
|
111
109
|
{localization.resetOrder}
|
112
110
|
</Button>
|
113
111
|
)}
|
114
|
-
{
|
112
|
+
{enableColumnPinning && (
|
115
113
|
<Button
|
116
114
|
disabled={!getIsSomeColumnsPinned()}
|
117
115
|
onClick={() => table.resetColumnPinning(true)}
|
@@ -16,7 +16,7 @@ import { MRT_GrabHandleButton } from '../buttons/MRT_GrabHandleButton';
|
|
16
16
|
import { reorderColumn } from '../column.utils';
|
17
17
|
import { type MRT_Column, type MRT_TableInstance } from '../types';
|
18
18
|
|
19
|
-
interface Props<TData extends Record<string, any
|
19
|
+
interface Props<TData extends Record<string, any>> {
|
20
20
|
allColumns: MRT_Column<TData>[];
|
21
21
|
column: MRT_Column<TData>;
|
22
22
|
hoveredColumn: MRT_Column<TData> | null;
|
@@ -25,7 +25,7 @@ interface Props<TData extends Record<string, any> = {}> {
|
|
25
25
|
}
|
26
26
|
|
27
27
|
export const MRT_ShowHideColumnsMenuItems = <
|
28
|
-
TData extends Record<string, any
|
28
|
+
TData extends Record<string, any>,
|
29
29
|
>({
|
30
30
|
allColumns,
|
31
31
|
hoveredColumn,
|
@@ -38,7 +38,7 @@ export const MRT_ShowHideColumnsMenuItems = <
|
|
38
38
|
options: {
|
39
39
|
enableColumnOrdering,
|
40
40
|
enableHiding,
|
41
|
-
|
41
|
+
enableColumnPinning,
|
42
42
|
localization,
|
43
43
|
},
|
44
44
|
setColumnOrder,
|
@@ -127,7 +127,7 @@ export const MRT_ShowHideColumnsMenuItems = <
|
|
127
127
|
) : (
|
128
128
|
<Box sx={{ width: '28px' }} />
|
129
129
|
))}
|
130
|
-
{
|
130
|
+
{enableColumnPinning &&
|
131
131
|
(column.getCanPin() ? (
|
132
132
|
<MRT_ColumnPinningButtons column={column} table={table} />
|
133
133
|
) : (
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import Dialog from '@mui/material/Dialog';
|
2
|
+
import DialogActions from '@mui/material/DialogActions';
|
3
|
+
import DialogContent from '@mui/material/DialogContent';
|
4
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
5
|
+
import Stack from '@mui/material/Stack';
|
6
|
+
import { MRT_EditActionButtons } from '../buttons/MRT_EditActionButtons';
|
7
|
+
import { MRT_EditCellTextField } from '../inputs/MRT_EditCellTextField';
|
8
|
+
import { type MRT_Row, type MRT_TableInstance } from '../types';
|
9
|
+
|
10
|
+
interface Props<TData extends Record<string, any>> {
|
11
|
+
open: boolean;
|
12
|
+
table: MRT_TableInstance<TData>;
|
13
|
+
}
|
14
|
+
|
15
|
+
export const MRT_EditRowModal = <TData extends Record<string, any>>({
|
16
|
+
open,
|
17
|
+
table,
|
18
|
+
}: Props<TData>) => {
|
19
|
+
const {
|
20
|
+
getState,
|
21
|
+
options: {
|
22
|
+
localization,
|
23
|
+
onEditingRowCancel,
|
24
|
+
onCreatingRowCancel,
|
25
|
+
renderEditRowModalContent,
|
26
|
+
renderCreateRowModalContent,
|
27
|
+
muiCreateRowModalProps,
|
28
|
+
muiEditRowModalProps,
|
29
|
+
},
|
30
|
+
setEditingRow,
|
31
|
+
setCreatingRow,
|
32
|
+
} = table;
|
33
|
+
const { creatingRow, editingRow } = getState();
|
34
|
+
const row = (creatingRow ?? editingRow) as MRT_Row<TData>;
|
35
|
+
|
36
|
+
const createModalProps =
|
37
|
+
muiCreateRowModalProps instanceof Function
|
38
|
+
? muiCreateRowModalProps({ row, table })
|
39
|
+
: muiCreateRowModalProps;
|
40
|
+
|
41
|
+
const editModalProps =
|
42
|
+
muiEditRowModalProps instanceof Function
|
43
|
+
? muiEditRowModalProps({ row, table })
|
44
|
+
: muiEditRowModalProps;
|
45
|
+
|
46
|
+
const dialogProps = {
|
47
|
+
...editModalProps,
|
48
|
+
...(creatingRow && createModalProps),
|
49
|
+
};
|
50
|
+
|
51
|
+
const internalEditComponents = row
|
52
|
+
.getAllCells()
|
53
|
+
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
54
|
+
.map((cell) => (
|
55
|
+
<MRT_EditCellTextField
|
56
|
+
cell={cell as any}
|
57
|
+
key={cell.id}
|
58
|
+
table={table as any}
|
59
|
+
/>
|
60
|
+
));
|
61
|
+
|
62
|
+
return (
|
63
|
+
<Dialog
|
64
|
+
fullWidth
|
65
|
+
maxWidth="xs"
|
66
|
+
onClose={(event, reason) => {
|
67
|
+
if (creatingRow) {
|
68
|
+
onCreatingRowCancel?.({ row, table });
|
69
|
+
setCreatingRow(null);
|
70
|
+
} else {
|
71
|
+
onEditingRowCancel?.({ row, table });
|
72
|
+
setEditingRow(null);
|
73
|
+
}
|
74
|
+
row._valuesCache = {} as any; //reset values cache
|
75
|
+
dialogProps.onClose?.(event, reason);
|
76
|
+
}}
|
77
|
+
open={open}
|
78
|
+
{...dialogProps}
|
79
|
+
>
|
80
|
+
{((creatingRow &&
|
81
|
+
renderCreateRowModalContent?.({
|
82
|
+
row,
|
83
|
+
table,
|
84
|
+
internalEditComponents,
|
85
|
+
})) ||
|
86
|
+
renderEditRowModalContent?.({
|
87
|
+
row,
|
88
|
+
table,
|
89
|
+
internalEditComponents,
|
90
|
+
})) ?? (
|
91
|
+
<>
|
92
|
+
<DialogTitle sx={{ textAlign: 'center' }}>
|
93
|
+
{(creatingRow && localization.create) || localization.edit}
|
94
|
+
</DialogTitle>
|
95
|
+
<DialogContent>
|
96
|
+
<form onSubmit={(e) => e.preventDefault()}>
|
97
|
+
<Stack
|
98
|
+
sx={{
|
99
|
+
gap: '24px',
|
100
|
+
paddingTop: '16px',
|
101
|
+
width: '100%',
|
102
|
+
}}
|
103
|
+
>
|
104
|
+
{internalEditComponents}
|
105
|
+
</Stack>
|
106
|
+
</form>
|
107
|
+
</DialogContent>
|
108
|
+
<DialogActions sx={{ p: '1.25rem' }}>
|
109
|
+
<MRT_EditActionButtons row={row} table={table} variant="text" />
|
110
|
+
</DialogActions>
|
111
|
+
</>
|
112
|
+
)}
|
113
|
+
</Dialog>
|
114
|
+
);
|
115
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './MRT_EditRowModal';
|
package/src/sortingFns.ts
CHANGED
@@ -2,7 +2,7 @@ import { compareItems, type RankingInfo } from '@tanstack/match-sorter-utils';
|
|
2
2
|
import { type Row, sortingFns } from '@tanstack/react-table';
|
3
3
|
import { type MRT_Row } from './types';
|
4
4
|
|
5
|
-
const fuzzy = <TData extends Record<string, any
|
5
|
+
const fuzzy = <TData extends Record<string, any>>(
|
6
6
|
rowA: Row<TData>,
|
7
7
|
rowB: Row<TData>,
|
8
8
|
columnId: string,
|
@@ -25,7 +25,7 @@ export const MRT_SortingFns = {
|
|
25
25
|
fuzzy,
|
26
26
|
};
|
27
27
|
|
28
|
-
export const rankGlobalFuzzy = <TData extends Record<string, any
|
28
|
+
export const rankGlobalFuzzy = <TData extends Record<string, any>>(
|
29
29
|
rowA: MRT_Row<TData>,
|
30
30
|
rowB: MRT_Row<TData>,
|
31
31
|
) =>
|
package/src/table/MRT_Table.tsx
CHANGED
@@ -12,21 +12,23 @@ import { MRT_TableFooter } from '../footer/MRT_TableFooter';
|
|
12
12
|
import { parseCSSVarId } from '../column.utils';
|
13
13
|
import { type MRT_TableInstance } from '../types';
|
14
14
|
|
15
|
-
interface Props {
|
16
|
-
table: MRT_TableInstance
|
15
|
+
interface Props<TData extends Record<string, any>> {
|
16
|
+
table: MRT_TableInstance<TData>;
|
17
17
|
}
|
18
18
|
|
19
|
-
export const MRT_Table =
|
19
|
+
export const MRT_Table = <TData extends Record<string, any>>({
|
20
|
+
table,
|
21
|
+
}: Props<TData>) => {
|
20
22
|
const {
|
21
23
|
getFlatHeaders,
|
22
24
|
getState,
|
23
25
|
options: {
|
24
|
-
columns,
|
25
26
|
columnVirtualizerInstanceRef,
|
26
|
-
|
27
|
+
columnVirtualizerOptions,
|
28
|
+
columns,
|
27
29
|
enableColumnResizing,
|
28
30
|
enableColumnVirtualization,
|
29
|
-
|
31
|
+
enableColumnPinning,
|
30
32
|
enableStickyHeader,
|
31
33
|
enableTableFooter,
|
32
34
|
enableTableHead,
|
@@ -50,9 +52,9 @@ export const MRT_Table = ({ table }: Props) => {
|
|
50
52
|
: muiTableProps;
|
51
53
|
|
52
54
|
const vProps =
|
53
|
-
|
54
|
-
?
|
55
|
-
:
|
55
|
+
columnVirtualizerOptions instanceof Function
|
56
|
+
? columnVirtualizerOptions({ table })
|
57
|
+
: columnVirtualizerOptions;
|
56
58
|
|
57
59
|
const columnSizeVars = useMemo(() => {
|
58
60
|
const headers = getFlatHeaders();
|
@@ -80,7 +82,7 @@ export const MRT_Table = ({ table }: Props) => {
|
|
80
82
|
|
81
83
|
const [leftPinnedIndexes, rightPinnedIndexes] = useMemo(
|
82
84
|
() =>
|
83
|
-
enableColumnVirtualization &&
|
85
|
+
enableColumnVirtualization && enableColumnPinning
|
84
86
|
? [
|
85
87
|
table.getLeftLeafColumns().map((c) => c.getPinnedIndex()),
|
86
88
|
table
|
@@ -91,7 +93,7 @@ export const MRT_Table = ({ table }: Props) => {
|
|
91
93
|
),
|
92
94
|
]
|
93
95
|
: [[], []],
|
94
|
-
[columnPinning, enableColumnVirtualization,
|
96
|
+
[columnPinning, enableColumnVirtualization, enableColumnPinning],
|
95
97
|
);
|
96
98
|
|
97
99
|
const columnVirtualizer:
|
@@ -144,27 +146,32 @@ export const MRT_Table = ({ table }: Props) => {
|
|
144
146
|
};
|
145
147
|
|
146
148
|
return (
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
149
|
+
<>
|
150
|
+
<Table
|
151
|
+
stickyHeader={enableStickyHeader || isFullScreen}
|
152
|
+
{...tableProps}
|
153
|
+
sx={(theme) => ({
|
154
|
+
borderCollapse: 'separate',
|
155
|
+
display: layoutMode === 'grid' ? 'grid' : 'table',
|
156
|
+
tableLayout:
|
157
|
+
layoutMode !== 'grid' && enableColumnResizing ? 'fixed' : undefined,
|
158
|
+
...(tableProps?.sx instanceof Function
|
159
|
+
? tableProps.sx(theme)
|
160
|
+
: (tableProps?.sx as any)),
|
161
|
+
})}
|
162
|
+
style={{ ...columnSizeVars, ...tableProps?.style }}
|
163
|
+
>
|
164
|
+
{enableTableHead && <MRT_TableHead {...props} />}
|
165
|
+
{memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (
|
166
|
+
<Memo_MRT_TableBody
|
167
|
+
columnVirtualizer={columnVirtualizer}
|
168
|
+
{...props}
|
169
|
+
/>
|
170
|
+
) : (
|
171
|
+
<MRT_TableBody columnVirtualizer={columnVirtualizer} {...props} />
|
172
|
+
)}
|
173
|
+
{enableTableFooter && <MRT_TableFooter {...props} />}
|
174
|
+
</Table>
|
175
|
+
</>
|
169
176
|
);
|
170
177
|
};
|
@@ -1,22 +1,34 @@
|
|
1
1
|
import { useEffect, useLayoutEffect, useState } from 'react';
|
2
2
|
import TableContainer from '@mui/material/TableContainer';
|
3
3
|
import { MRT_Table } from './MRT_Table';
|
4
|
+
import { MRT_EditRowModal } from '../modals';
|
4
5
|
import { type MRT_TableInstance } from '../types';
|
5
6
|
|
6
7
|
const useIsomorphicLayoutEffect =
|
7
8
|
typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
8
9
|
|
9
|
-
interface Props {
|
10
|
-
table: MRT_TableInstance
|
10
|
+
interface Props<TData extends Record<string, any>> {
|
11
|
+
table: MRT_TableInstance<TData>;
|
11
12
|
}
|
12
13
|
|
13
|
-
export const MRT_TableContainer =
|
14
|
+
export const MRT_TableContainer = <TData extends Record<string, any>>({
|
15
|
+
table,
|
16
|
+
}: Props<TData>) => {
|
14
17
|
const {
|
15
18
|
getState,
|
16
|
-
options: {
|
19
|
+
options: {
|
20
|
+
createDisplayMode,
|
21
|
+
editDisplayMode,
|
22
|
+
enableStickyHeader,
|
23
|
+
muiTableContainerProps,
|
24
|
+
},
|
17
25
|
refs: { tableContainerRef, bottomToolbarRef, topToolbarRef },
|
18
26
|
} = table;
|
19
|
-
const {
|
27
|
+
const {
|
28
|
+
isFullScreen,
|
29
|
+
creatingRow,
|
30
|
+
editingRow,
|
31
|
+
} = getState();
|
20
32
|
|
21
33
|
const [totalToolbarHeight, setTotalToolbarHeight] = useState(0);
|
22
34
|
|
@@ -39,6 +51,9 @@ export const MRT_TableContainer = ({ table }: Props) => {
|
|
39
51
|
setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
|
40
52
|
});
|
41
53
|
|
54
|
+
const createModalOpen = createDisplayMode === 'modal' && creatingRow;
|
55
|
+
const editModalOpen = editDisplayMode === 'modal' && editingRow;
|
56
|
+
|
42
57
|
return (
|
43
58
|
<TableContainer
|
44
59
|
{...tableContainerProps}
|
@@ -69,6 +84,9 @@ export const MRT_TableContainer = ({ table }: Props) => {
|
|
69
84
|
}}
|
70
85
|
>
|
71
86
|
<MRT_Table table={table} />
|
87
|
+
{(createModalOpen || editModalOpen) && (
|
88
|
+
<MRT_EditRowModal open table={table} />
|
89
|
+
)}
|
72
90
|
</TableContainer>
|
73
91
|
);
|
74
92
|
};
|
@@ -4,11 +4,13 @@ import { MRT_BottomToolbar } from '../toolbar/MRT_BottomToolbar';
|
|
4
4
|
import { MRT_TableContainer } from './MRT_TableContainer';
|
5
5
|
import { type MRT_TableInstance } from '../types';
|
6
6
|
|
7
|
-
interface Props {
|
8
|
-
table: MRT_TableInstance
|
7
|
+
interface Props<TData extends Record<string, any>> {
|
8
|
+
table: MRT_TableInstance<TData>;
|
9
9
|
}
|
10
10
|
|
11
|
-
export const MRT_TablePaper =
|
11
|
+
export const MRT_TablePaper = <TData extends Record<string, any>>({
|
12
|
+
table,
|
13
|
+
}: Props<TData>) => {
|
12
14
|
const {
|
13
15
|
getState,
|
14
16
|
options: {
|
@@ -39,7 +41,8 @@ export const MRT_TablePaper = ({ table }: Props) => {
|
|
39
41
|
}
|
40
42
|
}}
|
41
43
|
sx={(theme) => ({
|
42
|
-
|
44
|
+
overflow: 'hidden',
|
45
|
+
transition: 'all 100ms ease-in-out',
|
43
46
|
...(tablePaperProps?.sx instanceof Function
|
44
47
|
? tablePaperProps?.sx(theme)
|
45
48
|
: (tablePaperProps?.sx as any)),
|
@@ -48,12 +51,18 @@ export const MRT_TablePaper = ({ table }: Props) => {
|
|
48
51
|
...tablePaperProps?.style,
|
49
52
|
...(isFullScreen
|
50
53
|
? {
|
54
|
+
bottom: 0,
|
51
55
|
height: '100vh',
|
56
|
+
left: 0,
|
52
57
|
margin: 0,
|
53
58
|
maxHeight: '100vh',
|
54
59
|
maxWidth: '100vw',
|
55
60
|
padding: 0,
|
61
|
+
position: 'fixed',
|
62
|
+
right: 0,
|
63
|
+
top: 0,
|
56
64
|
width: '100vw',
|
65
|
+
zIndex: 10,
|
57
66
|
}
|
58
67
|
: {}),
|
59
68
|
}}
|
@@ -9,11 +9,11 @@ import { MRT_LinearProgressBar } from './MRT_LinearProgressBar';
|
|
9
9
|
import { commonToolbarStyles } from './MRT_TopToolbar';
|
10
10
|
import { type MRT_TableInstance } from '../types';
|
11
11
|
|
12
|
-
interface Props<TData extends Record<string, any
|
12
|
+
interface Props<TData extends Record<string, any>> {
|
13
13
|
table: MRT_TableInstance<TData>;
|
14
14
|
}
|
15
15
|
|
16
|
-
export const MRT_BottomToolbar = <TData extends Record<string, any
|
16
|
+
export const MRT_BottomToolbar = <TData extends Record<string, any>>({
|
17
17
|
table,
|
18
18
|
}: Props<TData>) => {
|
19
19
|
const {
|
@@ -2,12 +2,12 @@ import Collapse from '@mui/material/Collapse';
|
|
2
2
|
import LinearProgress from '@mui/material/LinearProgress';
|
3
3
|
import { type MRT_TableInstance } from '../types';
|
4
4
|
|
5
|
-
interface Props<TData extends Record<string, any
|
5
|
+
interface Props<TData extends Record<string, any>> {
|
6
6
|
isTopToolbar: boolean;
|
7
7
|
table: MRT_TableInstance<TData>;
|
8
8
|
}
|
9
9
|
|
10
|
-
export const MRT_LinearProgressBar = <TData extends Record<string, any
|
10
|
+
export const MRT_LinearProgressBar = <TData extends Record<string, any>>({
|
11
11
|
isTopToolbar,
|
12
12
|
table,
|
13
13
|
}: Props<TData>) => {
|
@@ -2,12 +2,12 @@ import { type ChangeEvent } from 'react';
|
|
2
2
|
import TablePagination from '@mui/material/TablePagination';
|
3
3
|
import { type MRT_TableInstance } from '../types';
|
4
4
|
|
5
|
-
interface Props<TData extends Record<string, any
|
5
|
+
interface Props<TData extends Record<string, any>> {
|
6
6
|
position?: 'top' | 'bottom';
|
7
7
|
table: MRT_TableInstance<TData>;
|
8
8
|
}
|
9
9
|
|
10
|
-
export const MRT_TablePagination = <TData extends Record<string, any
|
10
|
+
export const MRT_TablePagination = <TData extends Record<string, any>>({
|
11
11
|
table,
|
12
12
|
position = 'bottom',
|
13
13
|
}: Props<TData>) => {
|
@@ -6,12 +6,12 @@ import Chip from '@mui/material/Chip';
|
|
6
6
|
import Collapse from '@mui/material/Collapse';
|
7
7
|
import { type MRT_TableInstance } from '../types';
|
8
8
|
|
9
|
-
interface Props<TData extends Record<string, any
|
9
|
+
interface Props<TData extends Record<string, any>> {
|
10
10
|
stackAlertBanner: boolean;
|
11
11
|
table: MRT_TableInstance<TData>;
|
12
12
|
}
|
13
13
|
|
14
|
-
export const MRT_ToolbarAlertBanner = <TData extends Record<string, any
|
14
|
+
export const MRT_ToolbarAlertBanner = <TData extends Record<string, any>>({
|
15
15
|
stackAlertBanner,
|
16
16
|
table,
|
17
17
|
}: Props<TData>) => {
|
@@ -5,11 +5,11 @@ import Fade from '@mui/material/Fade';
|
|
5
5
|
import Typography from '@mui/material/Typography';
|
6
6
|
import { type MRT_TableInstance } from '../types';
|
7
7
|
|
8
|
-
interface Props<TData extends Record<string, any
|
8
|
+
interface Props<TData extends Record<string, any>> {
|
9
9
|
table: MRT_TableInstance<TData>;
|
10
10
|
}
|
11
11
|
|
12
|
-
export const MRT_ToolbarDropZone = <TData extends Record<string, any
|
12
|
+
export const MRT_ToolbarDropZone = <TData extends Record<string, any>>({
|
13
13
|
table,
|
14
14
|
}: Props<TData>) => {
|
15
15
|
const {
|
@@ -1,18 +1,16 @@
|
|
1
1
|
import Box from '@mui/material/Box';
|
2
|
-
import {
|
2
|
+
import { MRT_ToggleFullScreenButton } from '../buttons/MRT_ToggleFullScreenButton';
|
3
3
|
import { MRT_ShowHideColumnsButton } from '../buttons/MRT_ShowHideColumnsButton';
|
4
4
|
import { MRT_ToggleDensePaddingButton } from '../buttons/MRT_ToggleDensePaddingButton';
|
5
5
|
import { MRT_ToggleFiltersButton } from '../buttons/MRT_ToggleFiltersButton';
|
6
6
|
import { MRT_ToggleGlobalFilterButton } from '../buttons/MRT_ToggleGlobalFilterButton';
|
7
7
|
import { type MRT_TableInstance } from '../types';
|
8
8
|
|
9
|
-
interface Props<TData extends Record<string, any
|
9
|
+
interface Props<TData extends Record<string, any>> {
|
10
10
|
table: MRT_TableInstance<TData>;
|
11
11
|
}
|
12
12
|
|
13
|
-
export const MRT_ToolbarInternalButtons = <
|
14
|
-
TData extends Record<string, any> = {},
|
15
|
-
>({
|
13
|
+
export const MRT_ToolbarInternalButtons = <TData extends Record<string, any>>({
|
16
14
|
table,
|
17
15
|
}: Props<TData>) => {
|
18
16
|
const {
|
@@ -24,7 +22,7 @@ export const MRT_ToolbarInternalButtons = <
|
|
24
22
|
enableFullScreenToggle,
|
25
23
|
enableGlobalFilter,
|
26
24
|
enableHiding,
|
27
|
-
|
25
|
+
enableColumnPinning,
|
28
26
|
initialState,
|
29
27
|
renderToolbarInternalActions,
|
30
28
|
},
|
@@ -50,14 +48,14 @@ export const MRT_ToolbarInternalButtons = <
|
|
50
48
|
{enableFilters && enableColumnFilters && (
|
51
49
|
<MRT_ToggleFiltersButton table={table} />
|
52
50
|
)}
|
53
|
-
{(enableHiding || enableColumnOrdering ||
|
51
|
+
{(enableHiding || enableColumnOrdering || enableColumnPinning) && (
|
54
52
|
<MRT_ShowHideColumnsButton table={table} />
|
55
53
|
)}
|
56
54
|
{enableDensityToggle && (
|
57
55
|
<MRT_ToggleDensePaddingButton table={table} />
|
58
56
|
)}
|
59
57
|
{enableFullScreenToggle && (
|
60
|
-
<
|
58
|
+
<MRT_ToggleFullScreenButton table={table} />
|
61
59
|
)}
|
62
60
|
</>
|
63
61
|
)}
|
@@ -24,11 +24,11 @@ export const commonToolbarStyles = ({ theme }: { theme: Theme }) => ({
|
|
24
24
|
zIndex: 1,
|
25
25
|
});
|
26
26
|
|
27
|
-
interface Props<TData extends Record<string, any
|
27
|
+
interface Props<TData extends Record<string, any>> {
|
28
28
|
table: MRT_TableInstance<TData>;
|
29
29
|
}
|
30
30
|
|
31
|
-
export const MRT_TopToolbar = <TData extends Record<string, any
|
31
|
+
export const MRT_TopToolbar = <TData extends Record<string, any>>({
|
32
32
|
table,
|
33
33
|
}: Props<TData>) => {
|
34
34
|
const {
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export * from './MRT_BottomToolbar';
|
2
|
+
export * from './MRT_LinearProgressBar';
|
3
|
+
export * from './MRT_TablePagination';
|
4
|
+
export * from './MRT_ToolbarAlertBanner';
|
5
|
+
export * from './MRT_ToolbarDropZone';
|
6
|
+
export * from './MRT_ToolbarInternalButtons';
|
7
|
+
export * from './MRT_TopToolbar';
|