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
@@ -1,14 +1,15 @@
|
|
1
|
-
import { type Dispatch, type MutableRefObject, type ReactNode, type SetStateAction } from 'react';
|
1
|
+
import { type Dispatch, type MutableRefObject, type ReactNode, type RefObject, type SetStateAction } from 'react';
|
2
2
|
import { type AlertProps } from '@mui/material/Alert';
|
3
3
|
import { type ButtonProps } from '@mui/material/Button';
|
4
4
|
import { type CheckboxProps } from '@mui/material/Checkbox';
|
5
5
|
import { type ChipProps } from '@mui/material/Chip';
|
6
|
+
import { type DialogProps } from '@mui/material/Dialog';
|
6
7
|
import { type IconButtonProps } from '@mui/material/IconButton';
|
7
8
|
import { type LinearProgressProps } from '@mui/material/LinearProgress';
|
8
9
|
import { type PaperProps } from '@mui/material/Paper';
|
9
10
|
import { type RadioProps } from '@mui/material/Radio';
|
10
11
|
import { type SkeletonProps } from '@mui/material/Skeleton';
|
11
|
-
import { type SliderProps } from '@mui/material';
|
12
|
+
import { type SliderProps } from '@mui/material/Slider';
|
12
13
|
import { type TableBodyProps } from '@mui/material/TableBody';
|
13
14
|
import { type TableCellProps } from '@mui/material/TableCell';
|
14
15
|
import { type TableContainerProps } from '@mui/material/TableContainer';
|
@@ -26,12 +27,17 @@ import { type MRT_FilterFns } from './filterFns';
|
|
26
27
|
import { type MRT_SortingFns } from './sortingFns';
|
27
28
|
import { type MRT_Icons } from './icons';
|
28
29
|
export type { MRT_Icons };
|
29
|
-
type
|
30
|
+
export type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
31
|
+
export type Prettify<T> = {
|
30
32
|
[K in keyof T]: T[K];
|
31
|
-
} &
|
32
|
-
type
|
33
|
+
} & unknown;
|
34
|
+
export type Xor<A, B> = Prettify<A & {
|
35
|
+
[k in keyof B]?: never;
|
36
|
+
}> | Prettify<B & {
|
37
|
+
[k in keyof A]?: never;
|
38
|
+
}>;
|
33
39
|
export type MRT_DensityState = 'comfortable' | 'compact' | 'spacious';
|
34
|
-
export type
|
40
|
+
export type MRT_ColumnFilterFnsState = Record<string, MRT_FilterOption>;
|
35
41
|
export type { ColumnFiltersState as MRT_ColumnFiltersState, ColumnOrderState as MRT_ColumnOrderState, ColumnPinningState as MRT_ColumnPinningState, ColumnSizingInfoState as MRT_ColumnSizingInfoState, ColumnSizingState as MRT_ColumnSizingState, ExpandedState as MRT_ExpandedState, GroupingState as MRT_GroupingState, PaginationState as MRT_PaginationState, RowSelectionState as MRT_RowSelectionState, SortingState as MRT_SortingState, Updater as MRT_Updater, VirtualItem as MRT_VirtualItem, Virtualizer as MRT_Virtualizer, VirtualizerOptions as MRT_VirtualizerOptions, VisibilityState as MRT_VisibilityState, };
|
36
42
|
export interface MRT_Localization {
|
37
43
|
actions: string;
|
@@ -43,6 +49,7 @@ export interface MRT_Localization {
|
|
43
49
|
clearSearch: string;
|
44
50
|
clearSort: string;
|
45
51
|
clickToCopy: string;
|
52
|
+
create?: string;
|
46
53
|
collapse: string;
|
47
54
|
collapseAll: string;
|
48
55
|
columnActions: string;
|
@@ -122,16 +129,15 @@ export interface MRT_Localization {
|
|
122
129
|
ungroupByColumn: string;
|
123
130
|
unpin: string;
|
124
131
|
unpinAll: string;
|
125
|
-
unsorted: string;
|
126
132
|
}
|
127
|
-
export interface MRT_RowModel<TData extends Record<string, any
|
133
|
+
export interface MRT_RowModel<TData extends Record<string, any>> {
|
128
134
|
flatRows: MRT_Row<TData>[];
|
129
135
|
rows: MRT_Row<TData>[];
|
130
136
|
rowsById: {
|
131
137
|
[key: string]: MRT_Row<TData>;
|
132
138
|
};
|
133
139
|
}
|
134
|
-
export type MRT_TableInstance<TData extends Record<string, any
|
140
|
+
export type MRT_TableInstance<TData extends Record<string, any>> = Omit<Table<TData>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getCenterLeafColumns' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getHeaderGroups' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
135
141
|
getAllColumns: () => MRT_Column<TData>[];
|
136
142
|
getAllFlatColumns: () => MRT_Column<TData>[];
|
137
143
|
getAllLeafColumns: () => MRT_Column<TData>[];
|
@@ -139,6 +145,7 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> = Prettify
|
|
139
145
|
getColumn: (columnId: string) => MRT_Column<TData>;
|
140
146
|
getExpandedRowModel: () => MRT_RowModel<TData>;
|
141
147
|
getFlatHeaders: () => MRT_Header<TData>[];
|
148
|
+
getHeaderGroups: () => MRT_HeaderGroup<TData>[];
|
142
149
|
getLeftLeafColumns: () => MRT_Column<TData>[];
|
143
150
|
getPaginationRowModel: () => MRT_RowModel<TData>;
|
144
151
|
getPreFilteredRowModel: () => MRT_RowModel<TData>;
|
@@ -147,10 +154,7 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> = Prettify
|
|
147
154
|
getRowModel: () => MRT_RowModel<TData>;
|
148
155
|
getSelectedRowModel: () => MRT_RowModel<TData>;
|
149
156
|
getState: () => MRT_TableState<TData>;
|
150
|
-
options:
|
151
|
-
icons: MRT_Icons;
|
152
|
-
localization: MRT_Localization;
|
153
|
-
};
|
157
|
+
options: MRT_DefinedTableOptions<TData>;
|
154
158
|
refs: {
|
155
159
|
bottomToolbarRef: MutableRefObject<HTMLDivElement>;
|
156
160
|
editInputRefs: MutableRefObject<Record<string, HTMLInputElement>>;
|
@@ -161,7 +165,8 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> = Prettify
|
|
161
165
|
tablePaperRef: MutableRefObject<HTMLDivElement>;
|
162
166
|
topToolbarRef: MutableRefObject<HTMLDivElement>;
|
163
167
|
};
|
164
|
-
|
168
|
+
setCreatingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | true>>;
|
169
|
+
setColumnFilterFns: Dispatch<SetStateAction<MRT_ColumnFilterFnsState>>;
|
165
170
|
setDensity: Dispatch<SetStateAction<MRT_DensityState>>;
|
166
171
|
setDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
|
167
172
|
setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
|
@@ -179,9 +184,14 @@ export type MRT_TableInstance<TData extends Record<string, any> = {}> = Prettify
|
|
179
184
|
setShowColumnFilters: Dispatch<SetStateAction<boolean>>;
|
180
185
|
setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
|
181
186
|
setShowToolbarDropZone: Dispatch<SetStateAction<boolean>>;
|
182
|
-
}
|
183
|
-
export type
|
184
|
-
|
187
|
+
};
|
188
|
+
export type MRT_DefinedTableOptions<TData extends Record<string, any>> = MRT_TableOptions<TData> & {
|
189
|
+
localization: MRT_Localization;
|
190
|
+
icons: MRT_Icons;
|
191
|
+
};
|
192
|
+
export type MRT_TableState<TData extends Record<string, any>> = TableState & {
|
193
|
+
columnFilterFns: MRT_ColumnFilterFnsState;
|
194
|
+
creatingRow: MRT_Row<TData> | null;
|
185
195
|
density: MRT_DensityState;
|
186
196
|
draggingColumn: MRT_Column<TData> | null;
|
187
197
|
draggingRow: MRT_Row<TData> | null;
|
@@ -196,14 +206,15 @@ export type MRT_TableState<TData extends Record<string, any> = {}> = Prettify<Ta
|
|
196
206
|
} | null;
|
197
207
|
isFullScreen: boolean;
|
198
208
|
isLoading: boolean;
|
209
|
+
isSaving: boolean;
|
199
210
|
showAlertBanner: boolean;
|
200
211
|
showColumnFilters: boolean;
|
201
212
|
showGlobalFilter: boolean;
|
202
213
|
showProgressBars: boolean;
|
203
214
|
showSkeletons: boolean;
|
204
215
|
showToolbarDropZone: boolean;
|
205
|
-
}
|
206
|
-
export type MRT_ColumnDef<TData extends Record<string, any
|
216
|
+
};
|
217
|
+
export type MRT_ColumnDef<TData extends Record<string, any>> = Omit<ColumnDef<TData, unknown>, 'accessorKey' | 'aggregatedCell' | 'aggregationFn' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
|
207
218
|
AggregatedCell?: (props: {
|
208
219
|
cell: MRT_Cell<TData>;
|
209
220
|
column: MRT_Column<TData>;
|
@@ -215,6 +226,7 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnD
|
|
215
226
|
renderedCellValue: number | string | ReactNode;
|
216
227
|
column: MRT_Column<TData>;
|
217
228
|
row: MRT_Row<TData>;
|
229
|
+
rowRef?: RefObject<HTMLTableRowElement>;
|
218
230
|
table: MRT_TableInstance<TData>;
|
219
231
|
}) => ReactNode;
|
220
232
|
Edit?: (props: {
|
@@ -266,7 +278,7 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnD
|
|
266
278
|
* @example accessorKey: 'username' //simple
|
267
279
|
* @example accessorKey: 'name.firstName' //deep key dot notation
|
268
280
|
*/
|
269
|
-
accessorKey?: DeepKeys<TData>;
|
281
|
+
accessorKey?: (string & {}) | DeepKeys<TData>;
|
270
282
|
aggregationFn?: MRT_AggregationFn<TData> | Array<MRT_AggregationFn<TData>>;
|
271
283
|
/**
|
272
284
|
* Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
|
@@ -315,13 +327,13 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnD
|
|
315
327
|
* @default gets set to the same value as `accessorKey` by default
|
316
328
|
*/
|
317
329
|
id?: LiteralUnion<string & keyof TData>;
|
318
|
-
|
330
|
+
muiCopyButtonProps?: ButtonProps | ((props: {
|
319
331
|
cell: MRT_Cell<TData>;
|
320
332
|
column: MRT_Column<TData>;
|
321
333
|
row: MRT_Row<TData>;
|
322
334
|
table: MRT_TableInstance<TData>;
|
323
335
|
}) => ButtonProps);
|
324
|
-
|
336
|
+
muiEditTextFieldProps?: TextFieldProps | ((props: {
|
325
337
|
cell: MRT_Cell<TData>;
|
326
338
|
column: MRT_Column<TData>;
|
327
339
|
row: MRT_Row<TData>;
|
@@ -337,24 +349,24 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnD
|
|
337
349
|
table: MRT_TableInstance<TData>;
|
338
350
|
column: MRT_Column<TData>;
|
339
351
|
}) => TableCellProps);
|
340
|
-
|
352
|
+
muiColumnActionsButtonProps?: IconButtonProps | ((props: {
|
341
353
|
table: MRT_TableInstance<TData>;
|
342
354
|
column: MRT_Column<TData>;
|
343
355
|
}) => IconButtonProps);
|
344
|
-
|
356
|
+
muiColumnDragHandleProps?: IconButtonProps | ((props: {
|
345
357
|
table: MRT_TableInstance<TData>;
|
346
358
|
column: MRT_Column<TData>;
|
347
359
|
}) => IconButtonProps);
|
348
|
-
|
360
|
+
muiFilterCheckboxProps?: CheckboxProps | ((props: {
|
349
361
|
column: MRT_Column<TData>;
|
350
362
|
table: MRT_TableInstance<TData>;
|
351
363
|
}) => CheckboxProps);
|
352
|
-
|
364
|
+
muiFilterTextFieldProps?: TextFieldProps | ((props: {
|
353
365
|
table: MRT_TableInstance<TData>;
|
354
366
|
column: MRT_Column<TData>;
|
355
367
|
rangeFilterIndex?: number;
|
356
368
|
}) => TextFieldProps);
|
357
|
-
|
369
|
+
muiFilterSliderProps?: SliderProps | ((props: {
|
358
370
|
table: MRT_TableInstance<TData>;
|
359
371
|
column: MRT_Column<TData>;
|
360
372
|
}) => TextFieldProps);
|
@@ -376,40 +388,40 @@ export type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnD
|
|
376
388
|
}) => ReactNode[];
|
377
389
|
sortingFn?: MRT_SortingFn<TData>;
|
378
390
|
};
|
379
|
-
export type MRT_DefinedColumnDef<TData extends Record<string, any
|
391
|
+
export type MRT_DefinedColumnDef<TData extends Record<string, any>> = Omit<MRT_ColumnDef<TData>, 'id' | 'defaultDisplayColumn'> & {
|
380
392
|
defaultDisplayColumn: Partial<MRT_ColumnDef<TData>>;
|
381
393
|
id: string;
|
382
394
|
_filterFn: MRT_FilterOption;
|
383
395
|
};
|
384
|
-
export type MRT_Column<TData extends Record<string, any
|
396
|
+
export type MRT_Column<TData extends Record<string, any>> = Omit<Column<TData, unknown>, 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'> & {
|
385
397
|
columnDef: MRT_DefinedColumnDef<TData>;
|
386
398
|
columns?: MRT_Column<TData>[];
|
387
399
|
filterFn?: MRT_FilterFn<TData>;
|
388
400
|
footer: string;
|
389
401
|
header: string;
|
390
402
|
};
|
391
|
-
export type MRT_Header<TData extends Record<string, any
|
403
|
+
export type MRT_Header<TData extends Record<string, any>> = Omit<Header<TData, unknown>, 'column'> & {
|
392
404
|
column: MRT_Column<TData>;
|
393
|
-
}
|
394
|
-
export type MRT_HeaderGroup<TData extends Record<string, any
|
405
|
+
};
|
406
|
+
export type MRT_HeaderGroup<TData extends Record<string, any>> = Omit<HeaderGroup<TData>, 'headers'> & {
|
395
407
|
headers: MRT_Header<TData>[];
|
396
|
-
}
|
397
|
-
export type MRT_Row<TData extends Record<string, any
|
408
|
+
};
|
409
|
+
export type MRT_Row<TData extends Record<string, any>> = Omit<Row<TData>, 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'> & {
|
398
410
|
getAllCells: () => MRT_Cell<TData>[];
|
399
411
|
getVisibleCells: () => MRT_Cell<TData>[];
|
400
412
|
subRows?: MRT_Row<TData>[];
|
401
413
|
_valuesCache: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
|
402
|
-
}
|
403
|
-
export type MRT_Cell<TData extends Record<string, any
|
414
|
+
};
|
415
|
+
export type MRT_Cell<TData extends Record<string, any>> = Omit<Cell<TData, unknown>, 'column' | 'row'> & {
|
404
416
|
column: MRT_Column<TData>;
|
405
417
|
row: MRT_Row<TData>;
|
406
|
-
}
|
418
|
+
};
|
407
419
|
export type MRT_AggregationOption = string & keyof typeof MRT_AggregationFns;
|
408
|
-
export type MRT_AggregationFn<TData extends Record<string, any
|
420
|
+
export type MRT_AggregationFn<TData extends Record<string, any>> = AggregationFn<TData> | MRT_AggregationOption;
|
409
421
|
export type MRT_SortingOption = LiteralUnion<string & keyof typeof MRT_SortingFns>;
|
410
|
-
export type MRT_SortingFn<TData extends Record<string, any
|
422
|
+
export type MRT_SortingFn<TData extends Record<string, any>> = SortingFn<TData> | MRT_SortingOption;
|
411
423
|
export type MRT_FilterOption = LiteralUnion<string & keyof typeof MRT_FilterFns>;
|
412
|
-
export type MRT_FilterFn<TData extends Record<string, any
|
424
|
+
export type MRT_FilterFn<TData extends Record<string, any>> = FilterFn<TData> | MRT_FilterOption;
|
413
425
|
export type MRT_InternalFilterOption = {
|
414
426
|
option: string;
|
415
427
|
symbol: string;
|
@@ -417,7 +429,6 @@ export type MRT_InternalFilterOption = {
|
|
417
429
|
divider: boolean;
|
418
430
|
};
|
419
431
|
export type MRT_DisplayColumnIds = 'mrt-row-actions' | 'mrt-row-drag' | 'mrt-row-expand' | 'mrt-row-numbers' | 'mrt-row-select';
|
420
|
-
export type MRT_CreateTableFeature<TData extends Record<string, any> = {}, TFeature = any> = (table: MRT_TableInstance<TData>) => TFeature;
|
421
432
|
/**
|
422
433
|
* `columns` and `data` props are the only required props, but there are over 170 other optional props.
|
423
434
|
*
|
@@ -427,7 +438,7 @@ export type MRT_CreateTableFeature<TData extends Record<string, any> = {}, TFeat
|
|
427
438
|
* See the full props list on the official docs site:
|
428
439
|
* @link https://www.material-react-table.com/docs/api/props
|
429
440
|
*/
|
430
|
-
export type
|
441
|
+
export type MRT_TableOptions<TData extends Record<string, any>> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'defaultColumn' | 'enableRowSelection' | 'expandRowsFn' | 'getRowId' | 'globalFilterFn' | 'initialState' | 'onStateChange' | 'state'> & {
|
431
442
|
columnFilterModeOptions?: Array<LiteralUnion<string & MRT_FilterOption>> | null;
|
432
443
|
/**
|
433
444
|
* The columns to display in the table. `accessorKey`s or `accessorFn`s must match keys in the `data` prop.
|
@@ -440,6 +451,10 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
440
451
|
* @link https://www.material-react-table.com/docs/api/column-options
|
441
452
|
*/
|
442
453
|
columns: MRT_ColumnDef<TData>[];
|
454
|
+
columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableCellElement> | null>;
|
455
|
+
columnVirtualizerOptions?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>> | ((props: {
|
456
|
+
table: MRT_TableInstance<TData>;
|
457
|
+
}) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>);
|
443
458
|
/**
|
444
459
|
* Pass your data as an array of objects. Objects can theoretically be any shape, but it's best to keep them consistent.
|
445
460
|
*
|
@@ -456,9 +471,13 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
456
471
|
*/
|
457
472
|
defaultDisplayColumn?: Partial<MRT_ColumnDef<TData>>;
|
458
473
|
displayColumnDefOptions?: Partial<{
|
459
|
-
[key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef
|
474
|
+
[key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef<TData>>;
|
460
475
|
}>;
|
461
|
-
|
476
|
+
createDisplayMode?: 'modal' | 'row' | 'custom';
|
477
|
+
editDisplayMode?: 'modal' | 'row' | 'cell' | 'table' | 'custom';
|
478
|
+
columnFilterDisplayMode?: 'subheader' | 'popover' | 'custom';
|
479
|
+
paginationDisplayMode?: 'default' | 'pages' | 'custom';
|
480
|
+
selectDisplayMode?: 'checkbox' | 'radio' | 'switch';
|
462
481
|
enableBottomToolbar?: boolean;
|
463
482
|
enableClickToCopy?: boolean;
|
464
483
|
enableColumnActions?: boolean;
|
@@ -536,13 +555,13 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
536
555
|
table: MRT_TableInstance<TData>;
|
537
556
|
row: MRT_Row<TData>;
|
538
557
|
}) => CheckboxProps | RadioProps);
|
539
|
-
|
558
|
+
muiCopyButtonProps?: ButtonProps | ((props: {
|
540
559
|
cell: MRT_Cell<TData>;
|
541
560
|
column: MRT_Column<TData>;
|
542
561
|
row: MRT_Row<TData>;
|
543
562
|
table: MRT_TableInstance<TData>;
|
544
563
|
}) => ButtonProps);
|
545
|
-
|
564
|
+
muiEditTextFieldProps?: TextFieldProps | ((props: {
|
546
565
|
cell: MRT_Cell<TData>;
|
547
566
|
column: MRT_Column<TData>;
|
548
567
|
row: MRT_Row<TData>;
|
@@ -554,7 +573,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
554
573
|
row: MRT_Row<TData>;
|
555
574
|
table: MRT_TableInstance<TData>;
|
556
575
|
}) => TableCellProps);
|
557
|
-
|
576
|
+
muiSkeletonProps?: SkeletonProps | ((props: {
|
558
577
|
cell: MRT_Cell<TData>;
|
559
578
|
column: MRT_Column<TData>;
|
560
579
|
row: MRT_Row<TData>;
|
@@ -563,7 +582,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
563
582
|
muiTableBodyProps?: TableBodyProps | ((props: {
|
564
583
|
table: MRT_TableInstance<TData>;
|
565
584
|
}) => TableBodyProps);
|
566
|
-
|
585
|
+
muiRowDragHandleProps?: IconButtonProps | ((props: {
|
567
586
|
table: MRT_TableInstance<TData>;
|
568
587
|
row: MRT_Row<TData>;
|
569
588
|
}) => IconButtonProps);
|
@@ -576,7 +595,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
576
595
|
muiTableContainerProps?: TableContainerProps | ((props: {
|
577
596
|
table: MRT_TableInstance<TData>;
|
578
597
|
}) => TableContainerProps);
|
579
|
-
|
598
|
+
muiDetailPanelProps?: TableCellProps | ((props: {
|
580
599
|
table: MRT_TableInstance<TData>;
|
581
600
|
row: MRT_Row<TData>;
|
582
601
|
}) => TableCellProps);
|
@@ -591,27 +610,35 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
591
610
|
table: MRT_TableInstance<TData>;
|
592
611
|
footerGroup: MRT_HeaderGroup<TData>;
|
593
612
|
}) => TableRowProps);
|
594
|
-
|
613
|
+
muiColumnActionsButtonProps?: IconButtonProps | ((props: {
|
595
614
|
table: MRT_TableInstance<TData>;
|
596
615
|
column: MRT_Column<TData>;
|
597
616
|
}) => IconButtonProps);
|
598
|
-
|
617
|
+
muiColumnDragHandleProps?: IconButtonProps | ((props: {
|
599
618
|
table: MRT_TableInstance<TData>;
|
600
619
|
column: MRT_Column<TData>;
|
601
620
|
}) => IconButtonProps);
|
602
|
-
|
621
|
+
muiFilterCheckboxProps?: CheckboxProps | ((props: {
|
603
622
|
column: MRT_Column<TData>;
|
604
623
|
table: MRT_TableInstance<TData>;
|
605
624
|
}) => CheckboxProps);
|
606
|
-
|
625
|
+
muiFilterTextFieldProps?: TextFieldProps | ((props: {
|
607
626
|
table: MRT_TableInstance<TData>;
|
608
627
|
column: MRT_Column<TData>;
|
609
628
|
rangeFilterIndex?: number;
|
610
629
|
}) => TextFieldProps);
|
611
|
-
|
630
|
+
muiFilterSliderProps?: SliderProps | ((props: {
|
612
631
|
table: MRT_TableInstance<TData>;
|
613
632
|
column: MRT_Column<TData>;
|
614
633
|
}) => TextFieldProps);
|
634
|
+
muiCreateRowModalProps?: DialogProps | ((props: {
|
635
|
+
row: MRT_Row<TData>;
|
636
|
+
table: MRT_TableInstance<TData>;
|
637
|
+
}) => DialogProps);
|
638
|
+
muiEditRowModalProps?: DialogProps | ((props: {
|
639
|
+
row: MRT_Row<TData>;
|
640
|
+
table: MRT_TableInstance<TData>;
|
641
|
+
}) => DialogProps);
|
615
642
|
muiTableHeadCellProps?: TableCellProps | ((props: {
|
616
643
|
table: MRT_TableInstance<TData>;
|
617
644
|
column: MRT_Column<TData>;
|
@@ -641,6 +668,20 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
641
668
|
muiTopToolbarProps?: ToolbarProps | ((props: {
|
642
669
|
table: MRT_TableInstance<TData>;
|
643
670
|
}) => ToolbarProps);
|
671
|
+
onCreatingRowCancel?: (props: {
|
672
|
+
row: MRT_Row<TData>;
|
673
|
+
table: MRT_TableInstance<TData>;
|
674
|
+
}) => void;
|
675
|
+
onCreatingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
676
|
+
onCreatingRowSave?: (props: {
|
677
|
+
exitCreatingMode: () => void;
|
678
|
+
row: MRT_Row<TData>;
|
679
|
+
table: MRT_TableInstance<TData>;
|
680
|
+
values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
|
681
|
+
}) => void;
|
682
|
+
onColumnFilterFnsChange?: OnChangeFn<{
|
683
|
+
[key: string]: MRT_FilterOption;
|
684
|
+
}>;
|
644
685
|
onDensityChange?: OnChangeFn<MRT_DensityState>;
|
645
686
|
onDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
|
646
687
|
onDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
@@ -649,19 +690,20 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
649
690
|
row: MRT_Row<TData>;
|
650
691
|
table: MRT_TableInstance<TData>;
|
651
692
|
}) => void;
|
693
|
+
onEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
652
694
|
onEditingRowSave?: (props: {
|
653
695
|
exitEditingMode: () => void;
|
654
696
|
row: MRT_Row<TData>;
|
655
697
|
table: MRT_TableInstance<TData>;
|
656
698
|
values: Record<LiteralUnion<string & DeepKeys<TData>>, any>;
|
657
699
|
}) => Promise<void> | void;
|
658
|
-
onEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
|
659
|
-
onColumnFilterFnsChange?: OnChangeFn<{
|
660
|
-
[key: string]: MRT_FilterOption;
|
661
|
-
}>;
|
662
700
|
onGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
|
663
|
-
onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> |
|
664
|
-
|
701
|
+
onHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | {
|
702
|
+
id: string;
|
703
|
+
} | null>;
|
704
|
+
onHoveredRowChange?: OnChangeFn<MRT_Row<TData> | {
|
705
|
+
id: string;
|
706
|
+
} | null>;
|
665
707
|
onIsFullScreenChange?: OnChangeFn<boolean>;
|
666
708
|
onShowAlertBannerChange?: OnChangeFn<boolean>;
|
667
709
|
onShowColumnFiltersChange?: OnChangeFn<boolean>;
|
@@ -679,6 +721,16 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
679
721
|
renderBottomToolbarCustomActions?: (props: {
|
680
722
|
table: MRT_TableInstance<TData>;
|
681
723
|
}) => ReactNode;
|
724
|
+
renderCreateRowModalContent?: (props: {
|
725
|
+
internalEditComponents: ReactNode[];
|
726
|
+
row: MRT_Row<TData>;
|
727
|
+
table: MRT_TableInstance<TData>;
|
728
|
+
}) => ReactNode;
|
729
|
+
renderEditRowModalContent?: (props: {
|
730
|
+
internalEditComponents: ReactNode[];
|
731
|
+
row: MRT_Row<TData>;
|
732
|
+
table: MRT_TableInstance<TData>;
|
733
|
+
}) => ReactNode;
|
682
734
|
renderColumnActionsMenuItems?: (props: {
|
683
735
|
column: MRT_Column<TData>;
|
684
736
|
closeMenu: () => void;
|
@@ -724,34 +776,13 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> = Pr
|
|
724
776
|
}) => ReactNode;
|
725
777
|
rowCount?: number;
|
726
778
|
rowNumberMode?: 'original' | 'static';
|
779
|
+
rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableRowElement> | null>;
|
780
|
+
rowVirtualizerOptions?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>> | ((props: {
|
781
|
+
table: MRT_TableInstance<TData>;
|
782
|
+
}) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
|
727
783
|
selectAllMode?: 'all' | 'page';
|
728
784
|
/**
|
729
785
|
* Manage state externally any way you want, then pass it back into MRT.
|
730
786
|
*/
|
731
787
|
state?: Partial<MRT_TableState<TData>>;
|
732
|
-
/**
|
733
|
-
* Sequence of features important any dependent feature must be defined first
|
734
|
-
*/
|
735
|
-
tableFeatures?: Array<MRT_CreateTableFeature<TData>>;
|
736
|
-
/**
|
737
|
-
* Get access to the table instance via a ref to read state or call built-in methods
|
738
|
-
*/
|
739
|
-
tableInstanceRef?: MutableRefObject<MRT_TableInstance<TData> | null>;
|
740
|
-
/**
|
741
|
-
* @deprecated Use `rowVirtualizerInstanceRef` instead
|
742
|
-
*/
|
743
|
-
virtualizerInstanceRef?: any;
|
744
|
-
/**
|
745
|
-
* @deprecated Use `rowVirtualizerProps` instead
|
746
|
-
*/
|
747
|
-
virtualizerProps?: any;
|
748
|
-
}> & {
|
749
|
-
columnVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableCellElement> | null>;
|
750
|
-
columnVirtualizerProps?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>> | ((props: {
|
751
|
-
table: MRT_TableInstance<TData>;
|
752
|
-
}) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableCellElement>>);
|
753
|
-
rowVirtualizerInstanceRef?: MutableRefObject<Virtualizer<HTMLDivElement, HTMLTableRowElement> | null>;
|
754
|
-
rowVirtualizerProps?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>> | ((props: {
|
755
|
-
table: MRT_TableInstance<TData>;
|
756
|
-
}) => Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>);
|
757
788
|
};
|