material-react-table 1.15.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1624 -1269
- 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 +6 -6
- package/dist/cjs/types/body/MRT_TableBodyRowGrabHandle.d.ts +5 -5
- package/dist/cjs/types/body/MRT_TableBodyRowPinButton.d.ts +7 -0
- package/dist/cjs/types/body/MRT_TableDetailPanel.d.ts +6 -6
- package/dist/cjs/types/body/index.d.ts +7 -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_RowPinButton.d.ts +9 -0
- 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 +13 -0
- package/dist/cjs/types/column.utils.d.ts +40 -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 +3 -2
- 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 +128 -91
- package/dist/cjs/types/useMaterialReactTable.d.ts +2 -0
- package/dist/esm/material-react-table.esm.js +1567 -1279
- 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 +6 -6
- package/dist/esm/types/body/MRT_TableBodyRowGrabHandle.d.ts +5 -5
- package/dist/esm/types/body/MRT_TableBodyRowPinButton.d.ts +7 -0
- package/dist/esm/types/body/MRT_TableDetailPanel.d.ts +6 -6
- package/dist/esm/types/body/index.d.ts +7 -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_RowPinButton.d.ts +9 -0
- 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 +13 -0
- package/dist/esm/types/column.utils.d.ts +40 -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 +3 -2
- 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 +128 -91
- package/dist/esm/types/useMaterialReactTable.d.ts +2 -0
- package/dist/index.d.ts +626 -155
- 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 +1 -1
- package/locales/en.esm.js.map +1 -1
- package/locales/en.js +1 -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/package.json +18 -16
- package/src/MaterialReactTable.tsx +31 -168
- package/src/body/MRT_TableBody.tsx +184 -93
- package/src/body/MRT_TableBodyCell.tsx +55 -56
- package/src/body/MRT_TableBodyCellValue.tsx +7 -4
- package/src/body/MRT_TableBodyRow.tsx +111 -23
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +15 -11
- package/src/body/MRT_TableBodyRowPinButton.tsx +46 -0
- package/src/body/MRT_TableDetailPanel.tsx +21 -27
- package/src/body/index.ts +7 -0
- package/src/buttons/MRT_ColumnPinningButtons.tsx +2 -4
- package/src/buttons/MRT_CopyButton.tsx +17 -23
- package/src/buttons/MRT_EditActionButtons.tsx +56 -25
- package/src/buttons/MRT_ExpandAllButton.tsx +10 -10
- package/src/buttons/MRT_ExpandButton.tsx +8 -9
- package/src/buttons/MRT_GrabHandleButton.tsx +4 -5
- package/src/buttons/MRT_RowPinButton.tsx +74 -0
- 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 +18 -11
- package/src/buttons/index.ts +13 -0
- package/src/column.utils.ts +107 -50
- package/src/filterFns.ts +14 -14
- package/src/footer/MRT_TableFooter.tsx +17 -11
- package/src/footer/MRT_TableFooterCell.tsx +14 -24
- package/src/footer/MRT_TableFooterRow.tsx +12 -13
- package/src/footer/index.ts +3 -0
- package/src/head/MRT_TableHead.tsx +15 -11
- package/src/head/MRT_TableHeadCell.tsx +16 -24
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +18 -24
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +9 -4
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +9 -4
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +13 -20
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +9 -4
- package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -6
- package/src/head/MRT_TableHeadRow.tsx +12 -13
- package/src/head/index.ts +9 -0
- package/src/hooks/useMRT_DisplayColumns.tsx +155 -0
- package/src/hooks/useMRT_Effects.ts +77 -0
- package/src/hooks/useMRT_TableInstance.ts +297 -0
- package/src/hooks/useMRT_TableOptions.ts +173 -0
- package/src/index.ts +16 -0
- package/src/inputs/MRT_EditCellTextField.tsx +47 -41
- package/src/inputs/MRT_FilterCheckbox.tsx +19 -28
- package/src/inputs/MRT_FilterRangeFields.tsx +7 -4
- package/src/inputs/MRT_FilterRangeSlider.tsx +14 -32
- package/src/inputs/MRT_FilterTextField.tsx +18 -34
- package/src/inputs/MRT_GlobalFilterTextField.tsx +6 -8
- package/src/inputs/MRT_SelectCheckbox.tsx +39 -21
- 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 +16 -17
- 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 +107 -0
- package/src/modals/index.ts +1 -0
- package/src/sortingFns.ts +6 -2
- package/src/table/MRT_Table.tsx +42 -40
- package/src/table/MRT_TableContainer.tsx +24 -12
- package/src/table/MRT_TablePaper.tsx +22 -17
- package/src/table/index.ts +4 -0
- package/src/toolbar/MRT_BottomToolbar.tsx +16 -22
- package/src/toolbar/MRT_LinearProgressBar.tsx +7 -6
- package/src/toolbar/MRT_TablePagination.tsx +7 -9
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +10 -13
- package/src/toolbar/MRT_ToolbarDropZone.tsx +2 -2
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +6 -8
- package/src/toolbar/MRT_TopToolbar.tsx +10 -16
- package/src/toolbar/index.ts +7 -0
- package/src/types.ts +803 -770
- 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/locales/tr.d.ts +0 -2
- package/locales/tr.esm.d.ts +0 -2
- package/locales/tr.esm.js +0 -94
- package/locales/tr.esm.js.map +0 -1
- package/locales/tr.js +0 -98
- package/locales/tr.js.map +0 -1
- package/locales/uk.d.ts +0 -2
- package/locales/uk.esm.d.ts +0 -2
- package/locales/uk.esm.js +0 -94
- package/locales/uk.esm.js.map +0 -1
- package/locales/uk.js +0 -98
- package/locales/uk.js.map +0 -1
- package/locales/vi.d.ts +0 -2
- package/locales/vi.esm.d.ts +0 -2
- package/locales/vi.esm.js +0 -94
- package/locales/vi.esm.js.map +0 -1
- package/locales/vi.js +0 -98
- package/locales/vi.js.map +0 -1
- package/locales/zh-Hans.d.ts +0 -2
- package/locales/zh-Hans.esm.d.ts +0 -2
- package/locales/zh-Hans.esm.js +0 -94
- package/locales/zh-Hans.esm.js.map +0 -1
- package/locales/zh-Hans.js +0 -98
- package/locales/zh-Hans.js.map +0 -1
- package/locales/zh-Hant.d.ts +0 -2
- package/locales/zh-Hant.esm.d.ts +0 -2
- package/locales/zh-Hant.esm.js +0 -94
- package/locales/zh-Hant.esm.js.map +0 -1
- package/locales/zh-Hant.js +0 -98
- package/locales/zh-Hant.js.map +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
@@ -3,12 +3,15 @@ import { MRT_TopToolbar } from '../toolbar/MRT_TopToolbar';
|
|
3
3
|
import { MRT_BottomToolbar } from '../toolbar/MRT_BottomToolbar';
|
4
4
|
import { MRT_TableContainer } from './MRT_TableContainer';
|
5
5
|
import { type MRT_TableInstance } from '../types';
|
6
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
6
7
|
|
7
|
-
interface Props {
|
8
|
-
table: MRT_TableInstance
|
8
|
+
interface Props<TData extends Record<string, any>> {
|
9
|
+
table: MRT_TableInstance<TData>;
|
9
10
|
}
|
10
11
|
|
11
|
-
export const MRT_TablePaper =
|
12
|
+
export const MRT_TablePaper = <TData extends Record<string, any>>({
|
13
|
+
table,
|
14
|
+
}: Props<TData>) => {
|
12
15
|
const {
|
13
16
|
getState,
|
14
17
|
options: {
|
@@ -22,10 +25,7 @@ export const MRT_TablePaper = ({ table }: Props) => {
|
|
22
25
|
} = table;
|
23
26
|
const { isFullScreen } = getState();
|
24
27
|
|
25
|
-
const tablePaperProps =
|
26
|
-
muiTablePaperProps instanceof Function
|
27
|
-
? muiTablePaperProps({ table })
|
28
|
-
: muiTablePaperProps;
|
28
|
+
const tablePaperProps = parseFromValuesOrFunc(muiTablePaperProps, { table });
|
29
29
|
|
30
30
|
return (
|
31
31
|
<Paper
|
@@ -39,34 +39,39 @@ export const MRT_TablePaper = ({ table }: Props) => {
|
|
39
39
|
}
|
40
40
|
}}
|
41
41
|
sx={(theme) => ({
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
: (tablePaperProps?.sx as any)),
|
42
|
+
overflow: 'hidden',
|
43
|
+
transition: 'all 100ms ease-in-out',
|
44
|
+
...(parseFromValuesOrFunc(tablePaperProps?.sx, theme) as any),
|
46
45
|
})}
|
47
46
|
style={{
|
48
47
|
...tablePaperProps?.style,
|
49
48
|
...(isFullScreen
|
50
49
|
? {
|
50
|
+
bottom: 0,
|
51
51
|
height: '100vh',
|
52
|
+
left: 0,
|
52
53
|
margin: 0,
|
53
54
|
maxHeight: '100vh',
|
54
55
|
maxWidth: '100vw',
|
55
56
|
padding: 0,
|
57
|
+
position: 'fixed',
|
58
|
+
right: 0,
|
59
|
+
top: 0,
|
56
60
|
width: '100vw',
|
61
|
+
zIndex: 10,
|
57
62
|
}
|
58
63
|
: {}),
|
59
64
|
}}
|
60
65
|
>
|
61
66
|
{enableTopToolbar &&
|
62
|
-
(renderTopToolbar
|
63
|
-
|
64
|
-
|
67
|
+
(parseFromValuesOrFunc(renderTopToolbar, { table }) ?? (
|
68
|
+
<MRT_TopToolbar table={table} />
|
69
|
+
))}
|
65
70
|
<MRT_TableContainer table={table} />
|
66
71
|
{enableBottomToolbar &&
|
67
|
-
(renderBottomToolbar
|
68
|
-
|
69
|
-
|
72
|
+
(parseFromValuesOrFunc(renderBottomToolbar, { table }) ?? (
|
73
|
+
<MRT_BottomToolbar table={table} />
|
74
|
+
))}
|
70
75
|
</Paper>
|
71
76
|
);
|
72
77
|
};
|
@@ -8,12 +8,13 @@ import { MRT_ToolbarDropZone } from './MRT_ToolbarDropZone';
|
|
8
8
|
import { MRT_LinearProgressBar } from './MRT_LinearProgressBar';
|
9
9
|
import { commonToolbarStyles } from './MRT_TopToolbar';
|
10
10
|
import { type MRT_TableInstance } from '../types';
|
11
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
11
12
|
|
12
|
-
interface Props<TData extends Record<string, any
|
13
|
+
interface Props<TData extends Record<string, any>> {
|
13
14
|
table: MRT_TableInstance<TData>;
|
14
15
|
}
|
15
16
|
|
16
|
-
export const MRT_BottomToolbar = <TData extends Record<string, any
|
17
|
+
export const MRT_BottomToolbar = <TData extends Record<string, any>>({
|
17
18
|
table,
|
18
19
|
}: Props<TData>) => {
|
19
20
|
const {
|
@@ -32,10 +33,7 @@ export const MRT_BottomToolbar = <TData extends Record<string, any> = {}>({
|
|
32
33
|
|
33
34
|
const isMobile = useMediaQuery('(max-width:720px)');
|
34
35
|
|
35
|
-
const toolbarProps =
|
36
|
-
muiBottomToolbarProps instanceof Function
|
37
|
-
? muiBottomToolbarProps({ table })
|
38
|
-
: muiBottomToolbarProps;
|
36
|
+
const toolbarProps = parseFromValuesOrFunc(muiBottomToolbarProps, { table });
|
39
37
|
|
40
38
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
41
39
|
|
@@ -52,22 +50,18 @@ export const MRT_BottomToolbar = <TData extends Record<string, any> = {}>({
|
|
52
50
|
}
|
53
51
|
}
|
54
52
|
}}
|
55
|
-
sx={(theme) =>
|
56
|
-
({
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
? toolbarProps.sx(theme)
|
68
|
-
: (toolbarProps?.sx as any)),
|
69
|
-
} as any)
|
70
|
-
}
|
53
|
+
sx={(theme) => ({
|
54
|
+
...commonToolbarStyles({ theme }),
|
55
|
+
bottom: isFullScreen ? '0' : undefined,
|
56
|
+
boxShadow: `0 1px 2px -1px ${alpha(
|
57
|
+
theme.palette.common.black,
|
58
|
+
0.1,
|
59
|
+
)} inset`,
|
60
|
+
left: 0,
|
61
|
+
position: isFullScreen ? 'fixed' : 'relative',
|
62
|
+
right: 0,
|
63
|
+
...(parseFromValuesOrFunc(toolbarProps?.sx, theme) as any),
|
64
|
+
})}
|
71
65
|
>
|
72
66
|
<MRT_LinearProgressBar isTopToolbar={false} table={table} />
|
73
67
|
{positionToolbarAlertBanner === 'bottom' && (
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import Collapse from '@mui/material/Collapse';
|
2
2
|
import LinearProgress from '@mui/material/LinearProgress';
|
3
3
|
import { type MRT_TableInstance } from '../types';
|
4
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
4
5
|
|
5
|
-
interface Props<TData extends Record<string, any
|
6
|
+
interface Props<TData extends Record<string, any>> {
|
6
7
|
isTopToolbar: boolean;
|
7
8
|
table: MRT_TableInstance<TData>;
|
8
9
|
}
|
9
10
|
|
10
|
-
export const MRT_LinearProgressBar = <TData extends Record<string, any
|
11
|
+
export const MRT_LinearProgressBar = <TData extends Record<string, any>>({
|
11
12
|
isTopToolbar,
|
12
13
|
table,
|
13
14
|
}: Props<TData>) => {
|
@@ -17,10 +18,10 @@ export const MRT_LinearProgressBar = <TData extends Record<string, any> = {}>({
|
|
17
18
|
} = table;
|
18
19
|
const { isLoading, showProgressBars } = getState();
|
19
20
|
|
20
|
-
const linearProgressProps =
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
const linearProgressProps = parseFromValuesOrFunc(muiLinearProgressProps, {
|
22
|
+
isTopToolbar,
|
23
|
+
table,
|
24
|
+
});
|
24
25
|
|
25
26
|
return (
|
26
27
|
<Collapse
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { type ChangeEvent } from 'react';
|
2
2
|
import TablePagination from '@mui/material/TablePagination';
|
3
3
|
import { type MRT_TableInstance } from '../types';
|
4
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
4
5
|
|
5
|
-
interface Props<TData extends Record<string, any
|
6
|
+
interface Props<TData extends Record<string, any>> {
|
6
7
|
position?: 'top' | 'bottom';
|
7
8
|
table: MRT_TableInstance<TData>;
|
8
9
|
}
|
9
10
|
|
10
|
-
export const MRT_TablePagination = <TData extends Record<string, any
|
11
|
+
export const MRT_TablePagination = <TData extends Record<string, any>>({
|
11
12
|
table,
|
12
13
|
position = 'bottom',
|
13
14
|
}: Props<TData>) => {
|
@@ -31,10 +32,9 @@ export const MRT_TablePagination = <TData extends Record<string, any> = {}>({
|
|
31
32
|
const totalRowCount = rowCount ?? getPrePaginationRowModel().rows.length;
|
32
33
|
const showFirstLastPageButtons = totalRowCount / pageSize > 2;
|
33
34
|
|
34
|
-
const tablePaginationProps =
|
35
|
-
|
36
|
-
|
37
|
-
: muiTablePaginationProps;
|
35
|
+
const tablePaginationProps = parseFromValuesOrFunc(muiTablePaginationProps, {
|
36
|
+
table,
|
37
|
+
});
|
38
38
|
|
39
39
|
const handleChangeRowsPerPage = (event: ChangeEvent<HTMLInputElement>) => {
|
40
40
|
setPageSize(+event.target.value);
|
@@ -101,9 +101,7 @@ export const MRT_TablePagination = <TData extends Record<string, any> = {}>({
|
|
101
101
|
: undefined,
|
102
102
|
position: 'relative',
|
103
103
|
zIndex: 2,
|
104
|
-
...(tablePaginationProps?.sx
|
105
|
-
? tablePaginationProps.sx(theme)
|
106
|
-
: (tablePaginationProps?.sx as any)),
|
104
|
+
...(parseFromValuesOrFunc(tablePaginationProps?.sx, theme) as any),
|
107
105
|
})}
|
108
106
|
/>
|
109
107
|
);
|
@@ -5,13 +5,14 @@ import Box from '@mui/material/Box';
|
|
5
5
|
import Chip from '@mui/material/Chip';
|
6
6
|
import Collapse from '@mui/material/Collapse';
|
7
7
|
import { type MRT_TableInstance } from '../types';
|
8
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
8
9
|
|
9
|
-
interface Props<TData extends Record<string, any
|
10
|
+
interface Props<TData extends Record<string, any>> {
|
10
11
|
stackAlertBanner: boolean;
|
11
12
|
table: MRT_TableInstance<TData>;
|
12
13
|
}
|
13
14
|
|
14
|
-
export const MRT_ToolbarAlertBanner = <TData extends Record<string, any
|
15
|
+
export const MRT_ToolbarAlertBanner = <TData extends Record<string, any>>({
|
15
16
|
stackAlertBanner,
|
16
17
|
table,
|
17
18
|
}: Props<TData>) => {
|
@@ -29,15 +30,13 @@ export const MRT_ToolbarAlertBanner = <TData extends Record<string, any> = {}>({
|
|
29
30
|
} = table;
|
30
31
|
const { grouping, showAlertBanner } = getState();
|
31
32
|
|
32
|
-
const alertProps =
|
33
|
-
|
34
|
-
|
35
|
-
: muiToolbarAlertBannerProps;
|
33
|
+
const alertProps = parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
|
34
|
+
table,
|
35
|
+
});
|
36
36
|
|
37
|
-
const chipProps =
|
38
|
-
|
39
|
-
|
40
|
-
: muiToolbarAlertBannerChipProps;
|
37
|
+
const chipProps = parseFromValuesOrFunc(muiToolbarAlertBannerChipProps, {
|
38
|
+
table,
|
39
|
+
});
|
41
40
|
|
42
41
|
const selectMessage =
|
43
42
|
getSelectedRowModel().rows.length > 0
|
@@ -93,9 +92,7 @@ export const MRT_ToolbarAlertBanner = <TData extends Record<string, any> = {}>({
|
|
93
92
|
top: 0,
|
94
93
|
width: '100%',
|
95
94
|
zIndex: 2,
|
96
|
-
...(alertProps?.sx
|
97
|
-
? alertProps.sx(theme)
|
98
|
-
: (alertProps?.sx as any)),
|
95
|
+
...(parseFromValuesOrFunc(alertProps?.sx, theme) as any),
|
99
96
|
})}
|
100
97
|
>
|
101
98
|
{alertProps?.title && <AlertTitle>{alertProps.title}</AlertTitle>}
|
@@ -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
|
)}
|
@@ -10,6 +10,7 @@ import { MRT_ToolbarInternalButtons } from './MRT_ToolbarInternalButtons';
|
|
10
10
|
import { MRT_ToolbarDropZone } from './MRT_ToolbarDropZone';
|
11
11
|
import { type MRT_TableInstance } from '../types';
|
12
12
|
import { type Theme } from '@mui/material/styles';
|
13
|
+
import { parseFromValuesOrFunc } from '../column.utils';
|
13
14
|
|
14
15
|
export const commonToolbarStyles = ({ theme }: { theme: Theme }) => ({
|
15
16
|
alignItems: 'flex-start',
|
@@ -24,11 +25,11 @@ export const commonToolbarStyles = ({ theme }: { theme: Theme }) => ({
|
|
24
25
|
zIndex: 1,
|
25
26
|
});
|
26
27
|
|
27
|
-
interface Props<TData extends Record<string, any
|
28
|
+
interface Props<TData extends Record<string, any>> {
|
28
29
|
table: MRT_TableInstance<TData>;
|
29
30
|
}
|
30
31
|
|
31
|
-
export const MRT_TopToolbar = <TData extends Record<string, any
|
32
|
+
export const MRT_TopToolbar = <TData extends Record<string, any>>({
|
32
33
|
table,
|
33
34
|
}: Props<TData>) => {
|
34
35
|
const {
|
@@ -51,10 +52,7 @@ export const MRT_TopToolbar = <TData extends Record<string, any> = {}>({
|
|
51
52
|
|
52
53
|
const isMobile = useMediaQuery('(max-width:720px)');
|
53
54
|
|
54
|
-
const toolbarProps =
|
55
|
-
muiTopToolbarProps instanceof Function
|
56
|
-
? muiTopToolbarProps({ table })
|
57
|
-
: muiTopToolbarProps;
|
55
|
+
const toolbarProps = parseFromValuesOrFunc(muiTopToolbarProps, { table });
|
58
56
|
|
59
57
|
const stackAlertBanner =
|
60
58
|
isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
@@ -70,16 +68,12 @@ export const MRT_TopToolbar = <TData extends Record<string, any> = {}>({
|
|
70
68
|
toolbarProps.ref.current = ref;
|
71
69
|
}
|
72
70
|
}}
|
73
|
-
sx={(theme) =>
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
? toolbarProps.sx(theme)
|
80
|
-
: (toolbarProps?.sx as any)),
|
81
|
-
} as any)
|
82
|
-
}
|
71
|
+
sx={(theme) => ({
|
72
|
+
position: isFullScreen ? 'sticky' : undefined,
|
73
|
+
top: isFullScreen ? '0' : undefined,
|
74
|
+
...commonToolbarStyles({ theme }),
|
75
|
+
...(parseFromValuesOrFunc(toolbarProps?.sx, theme) as any),
|
76
|
+
})}
|
83
77
|
>
|
84
78
|
{positionToolbarAlertBanner === 'top' && (
|
85
79
|
<MRT_ToolbarAlertBanner
|
@@ -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';
|