material-react-table 1.15.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/dist/cjs/index.js +1626 -1324
- 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 +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 +115 -84
- package/dist/cjs/types/useMaterialReactTable.d.ts +2 -0
- package/dist/esm/material-react-table.esm.js +1556 -1318
- 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 +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 +115 -84
- package/dist/esm/types/useMaterialReactTable.d.ts +2 -0
- package/dist/index.d.ts +598 -148
- 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 +10 -8
- package/src/MaterialReactTable.tsx +31 -168
- package/src/body/MRT_TableBody.tsx +10 -23
- package/src/body/MRT_TableBodyCell.tsx +35 -38
- 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 +6 -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 +781 -765
- 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
@@ -3,19 +3,19 @@ import Button from '@mui/material/Button';
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
4
4
|
import { type MRT_Cell, type MRT_TableInstance } from '../types';
|
5
5
|
|
6
|
-
interface Props<TData extends Record<string, any
|
6
|
+
interface Props<TData extends Record<string, any>> {
|
7
7
|
cell: MRT_Cell<TData>;
|
8
8
|
children: ReactNode;
|
9
9
|
table: MRT_TableInstance<TData>;
|
10
10
|
}
|
11
11
|
|
12
|
-
export const MRT_CopyButton = <TData extends Record<string, any
|
12
|
+
export const MRT_CopyButton = <TData extends Record<string, any>>({
|
13
13
|
cell,
|
14
14
|
children,
|
15
15
|
table,
|
16
16
|
}: Props<TData>) => {
|
17
17
|
const {
|
18
|
-
options: { localization,
|
18
|
+
options: { localization, muiCopyButtonProps },
|
19
19
|
} = table;
|
20
20
|
const { column, row } = cell;
|
21
21
|
const { columnDef } = column;
|
@@ -30,19 +30,19 @@ export const MRT_CopyButton = <TData extends Record<string, any> = {}>({
|
|
30
30
|
};
|
31
31
|
|
32
32
|
const mTableBodyCellCopyButtonProps =
|
33
|
-
|
34
|
-
?
|
35
|
-
:
|
33
|
+
muiCopyButtonProps instanceof Function
|
34
|
+
? muiCopyButtonProps({ cell, column, row, table })
|
35
|
+
: muiCopyButtonProps;
|
36
36
|
|
37
37
|
const mcTableBodyCellCopyButtonProps =
|
38
|
-
columnDef.
|
39
|
-
? columnDef.
|
38
|
+
columnDef.muiCopyButtonProps instanceof Function
|
39
|
+
? columnDef.muiCopyButtonProps({
|
40
40
|
cell,
|
41
41
|
column,
|
42
42
|
row,
|
43
43
|
table,
|
44
44
|
})
|
45
|
-
: columnDef.
|
45
|
+
: columnDef.muiCopyButtonProps;
|
46
46
|
|
47
47
|
const buttonProps = {
|
48
48
|
...mTableBodyCellCopyButtonProps,
|
@@ -2,15 +2,16 @@ import Box from '@mui/material/Box';
|
|
2
2
|
import Button from '@mui/material/Button';
|
3
3
|
import IconButton from '@mui/material/IconButton';
|
4
4
|
import Tooltip from '@mui/material/Tooltip';
|
5
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
5
6
|
import { type MRT_Row, type MRT_TableInstance } from '../types';
|
6
7
|
|
7
|
-
interface Props<TData extends Record<string, any
|
8
|
+
interface Props<TData extends Record<string, any>> {
|
8
9
|
row: MRT_Row<TData>;
|
9
10
|
table: MRT_TableInstance<TData>;
|
10
11
|
variant?: 'icon' | 'text';
|
11
12
|
}
|
12
13
|
|
13
|
-
export const MRT_EditActionButtons = <TData extends Record<string, any
|
14
|
+
export const MRT_EditActionButtons = <TData extends Record<string, any>>({
|
14
15
|
row,
|
15
16
|
table,
|
16
17
|
variant = 'icon',
|
@@ -20,36 +21,59 @@ export const MRT_EditActionButtons = <TData extends Record<string, any> = {}>({
|
|
20
21
|
options: {
|
21
22
|
icons: { CancelIcon, SaveIcon },
|
22
23
|
localization,
|
24
|
+
onCreatingRowCancel,
|
25
|
+
onCreatingRowSave,
|
23
26
|
onEditingRowSave,
|
24
27
|
onEditingRowCancel,
|
25
28
|
},
|
26
29
|
refs: { editInputRefs },
|
30
|
+
setCreatingRow,
|
27
31
|
setEditingRow,
|
28
32
|
} = table;
|
29
|
-
const { editingRow } = getState();
|
33
|
+
const { creatingRow, editingRow, isSaving } = getState();
|
34
|
+
|
35
|
+
const isCreating = creatingRow?.id === row.id;
|
36
|
+
const isEditing = editingRow?.id === row.id;
|
30
37
|
|
31
38
|
const handleCancel = () => {
|
32
|
-
|
33
|
-
|
39
|
+
if (isCreating) {
|
40
|
+
onCreatingRowCancel?.({ row, table });
|
41
|
+
setCreatingRow(null);
|
42
|
+
} else if (isEditing) {
|
43
|
+
onEditingRowCancel?.({ row, table });
|
44
|
+
setEditingRow(null);
|
45
|
+
}
|
46
|
+
row._valuesCache = {} as any; //reset values cache
|
34
47
|
};
|
35
48
|
|
36
|
-
const
|
49
|
+
const handleSubmitRow = () => {
|
37
50
|
//look for auto-filled input values
|
38
|
-
Object.values(editInputRefs?.current)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
Object.values(editInputRefs?.current)
|
52
|
+
.filter((inputRef) => row.id === inputRef?.name?.split('_')?.[0])
|
53
|
+
?.forEach((input) => {
|
54
|
+
if (
|
55
|
+
input.value !== undefined &&
|
56
|
+
Object.hasOwn(row?._valuesCache as object, input.name)
|
57
|
+
) {
|
58
|
+
// @ts-ignore
|
59
|
+
row._valuesCache[input.name] = input.value;
|
60
|
+
}
|
61
|
+
});
|
62
|
+
if (isCreating)
|
63
|
+
onCreatingRowSave?.({
|
64
|
+
exitCreatingMode: () => setCreatingRow(null),
|
65
|
+
row,
|
66
|
+
table,
|
67
|
+
values: row._valuesCache,
|
68
|
+
});
|
69
|
+
else if (isEditing) {
|
70
|
+
onEditingRowSave?.({
|
71
|
+
exitEditingMode: () => setEditingRow(null),
|
72
|
+
row,
|
73
|
+
table,
|
74
|
+
values: row?._valuesCache,
|
75
|
+
});
|
76
|
+
}
|
53
77
|
};
|
54
78
|
|
55
79
|
return (
|
@@ -68,16 +92,23 @@ export const MRT_EditActionButtons = <TData extends Record<string, any> = {}>({
|
|
68
92
|
<IconButton
|
69
93
|
aria-label={localization.save}
|
70
94
|
color="info"
|
71
|
-
onClick={
|
95
|
+
onClick={handleSubmitRow}
|
72
96
|
>
|
73
|
-
<SaveIcon />
|
97
|
+
{isSaving ? <CircularProgress size={18} /> : <SaveIcon />}
|
74
98
|
</IconButton>
|
75
99
|
</Tooltip>
|
76
100
|
</>
|
77
101
|
) : (
|
78
102
|
<>
|
79
|
-
<Button onClick={handleCancel}>
|
80
|
-
|
103
|
+
<Button sx={{ minWidth: '100px' }} onClick={handleCancel}>
|
104
|
+
{localization.cancel}
|
105
|
+
</Button>
|
106
|
+
<Button
|
107
|
+
sx={{ minWidth: '100px' }}
|
108
|
+
onClick={handleSubmitRow}
|
109
|
+
variant="contained"
|
110
|
+
>
|
111
|
+
{isSaving && <CircularProgress color="inherit" size={18} />}
|
81
112
|
{localization.save}
|
82
113
|
</Button>
|
83
114
|
</>
|
@@ -2,11 +2,13 @@ import IconButton from '@mui/material/IconButton';
|
|
2
2
|
import Tooltip from '@mui/material/Tooltip';
|
3
3
|
import { type MRT_TableInstance } from '../types';
|
4
4
|
|
5
|
-
interface Props {
|
6
|
-
table: MRT_TableInstance
|
5
|
+
interface Props<TData extends Record<string, any>> {
|
6
|
+
table: MRT_TableInstance<TData>;
|
7
7
|
}
|
8
8
|
|
9
|
-
export const MRT_ExpandAllButton =
|
9
|
+
export const MRT_ExpandAllButton = <TData extends Record<string, any>>({
|
10
|
+
table,
|
11
|
+
}: Props<TData>) => {
|
10
12
|
const {
|
11
13
|
getIsAllRowsExpanded,
|
12
14
|
getIsSomeRowsExpanded,
|
@@ -3,12 +3,12 @@ import IconButton from '@mui/material/IconButton';
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
4
4
|
import { type MRT_Row, type MRT_TableInstance } from '../types';
|
5
5
|
|
6
|
-
interface Props<TData extends Record<string, any
|
6
|
+
interface Props<TData extends Record<string, any>> {
|
7
7
|
row: MRT_Row<TData>;
|
8
8
|
table: MRT_TableInstance<TData>;
|
9
9
|
}
|
10
10
|
|
11
|
-
export const MRT_ExpandButton = <TData extends Record<string, any
|
11
|
+
export const MRT_ExpandButton = <TData extends Record<string, any>>({
|
12
12
|
row,
|
13
13
|
table,
|
14
14
|
}: Props<TData>) => {
|
@@ -4,14 +4,14 @@ import Tooltip from '@mui/material/Tooltip';
|
|
4
4
|
import { type IconButtonProps } from '@mui/material/IconButton';
|
5
5
|
import { type MRT_TableInstance } from '../types';
|
6
6
|
|
7
|
-
interface Props<TData extends Record<string, any
|
7
|
+
interface Props<TData extends Record<string, any>> {
|
8
8
|
iconButtonProps?: IconButtonProps;
|
9
9
|
onDragStart: DragEventHandler<HTMLButtonElement>;
|
10
10
|
onDragEnd: DragEventHandler<HTMLButtonElement>;
|
11
11
|
table: MRT_TableInstance<TData>;
|
12
12
|
}
|
13
13
|
|
14
|
-
export const MRT_GrabHandleButton = <TData extends Record<string, any
|
14
|
+
export const MRT_GrabHandleButton = <TData extends Record<string, any>>({
|
15
15
|
iconButtonProps,
|
16
16
|
onDragEnd,
|
17
17
|
onDragStart,
|
@@ -5,14 +5,11 @@ import Tooltip from '@mui/material/Tooltip';
|
|
5
5
|
import { MRT_ShowHideColumnsMenu } from '../menus/MRT_ShowHideColumnsMenu';
|
6
6
|
import { type MRT_TableInstance } from '../types';
|
7
7
|
|
8
|
-
interface Props<TData extends Record<string, any
|
9
|
-
extends IconButtonProps {
|
8
|
+
interface Props<TData extends Record<string, any>> extends IconButtonProps {
|
10
9
|
table: MRT_TableInstance<TData>;
|
11
10
|
}
|
12
11
|
|
13
|
-
export const MRT_ShowHideColumnsButton = <
|
14
|
-
TData extends Record<string, any> = {},
|
15
|
-
>({
|
12
|
+
export const MRT_ShowHideColumnsButton = <TData extends Record<string, any>>({
|
16
13
|
table,
|
17
14
|
...rest
|
18
15
|
}: Props<TData>) => {
|
@@ -3,13 +3,12 @@ import { type IconButtonProps } from '@mui/material/IconButton';
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
4
4
|
import { type MRT_TableInstance } from '../types';
|
5
5
|
|
6
|
-
interface Props<TData extends Record<string, any
|
7
|
-
extends IconButtonProps {
|
6
|
+
interface Props<TData extends Record<string, any>> extends IconButtonProps {
|
8
7
|
table: MRT_TableInstance<TData>;
|
9
8
|
}
|
10
9
|
|
11
10
|
export const MRT_ToggleDensePaddingButton = <
|
12
|
-
TData extends Record<string, any
|
11
|
+
TData extends Record<string, any>,
|
13
12
|
>({
|
14
13
|
table,
|
15
14
|
...rest
|
@@ -3,14 +3,11 @@ import { type IconButtonProps } from '@mui/material/IconButton';
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
4
4
|
import { type MRT_TableInstance } from '../types';
|
5
5
|
|
6
|
-
interface Props<TData extends Record<string, any
|
7
|
-
extends IconButtonProps {
|
6
|
+
interface Props<TData extends Record<string, any>> extends IconButtonProps {
|
8
7
|
table: MRT_TableInstance<TData>;
|
9
8
|
}
|
10
9
|
|
11
|
-
export const MRT_ToggleFiltersButton = <
|
12
|
-
TData extends Record<string, any> = {},
|
13
|
-
>({
|
10
|
+
export const MRT_ToggleFiltersButton = <TData extends Record<string, any>>({
|
14
11
|
table,
|
15
12
|
...rest
|
16
13
|
}: Props<TData>) => {
|
@@ -2,15 +2,13 @@ import IconButton from '@mui/material/IconButton';
|
|
2
2
|
import { type IconButtonProps } from '@mui/material/IconButton';
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
4
4
|
import { type MRT_TableInstance } from '../types';
|
5
|
+
import { useState } from 'react';
|
5
6
|
|
6
|
-
interface Props<TData extends Record<string, any
|
7
|
-
extends IconButtonProps {
|
7
|
+
interface Props<TData extends Record<string, any>> extends IconButtonProps {
|
8
8
|
table: MRT_TableInstance<TData>;
|
9
9
|
}
|
10
10
|
|
11
|
-
export const
|
12
|
-
TData extends Record<string, any> = {},
|
13
|
-
>({
|
11
|
+
export const MRT_ToggleFullScreenButton = <TData extends Record<string, any>>({
|
14
12
|
table,
|
15
13
|
...rest
|
16
14
|
}: Props<TData>) => {
|
@@ -24,15 +22,24 @@ export const MRT_FullScreenToggleButton = <
|
|
24
22
|
} = table;
|
25
23
|
const { isFullScreen } = getState();
|
26
24
|
|
25
|
+
const [tooltipOpened, setTooltipOpened] = useState(false);
|
26
|
+
|
27
27
|
const handleToggleFullScreen = () => {
|
28
|
+
setTooltipOpened(false);
|
28
29
|
setIsFullScreen(!isFullScreen);
|
29
30
|
};
|
30
31
|
|
31
32
|
return (
|
32
|
-
<Tooltip
|
33
|
+
<Tooltip
|
34
|
+
open={tooltipOpened}
|
35
|
+
arrow
|
36
|
+
title={rest?.title ?? localization.toggleFullScreen}
|
37
|
+
>
|
33
38
|
<IconButton
|
34
39
|
aria-label={localization.showHideFilters}
|
35
40
|
onClick={handleToggleFullScreen}
|
41
|
+
onMouseEnter={() => setTooltipOpened(true)}
|
42
|
+
onMouseLeave={() => setTooltipOpened(false)}
|
36
43
|
{...rest}
|
37
44
|
title={undefined}
|
38
45
|
>
|
@@ -1,15 +1,13 @@
|
|
1
|
-
import IconButton from '@mui/material/IconButton';
|
2
|
-
import { type IconButtonProps } from '@mui/material/IconButton';
|
1
|
+
import IconButton, { type IconButtonProps } from '@mui/material/IconButton';
|
3
2
|
import Tooltip from '@mui/material/Tooltip';
|
4
3
|
import { type MRT_TableInstance } from '../types';
|
5
4
|
|
6
|
-
interface Props<TData extends Record<string, any
|
7
|
-
extends IconButtonProps {
|
5
|
+
interface Props<TData extends Record<string, any>> extends IconButtonProps {
|
8
6
|
table: MRT_TableInstance<TData>;
|
9
7
|
}
|
10
8
|
|
11
9
|
export const MRT_ToggleGlobalFilterButton = <
|
12
|
-
TData extends Record<string, any
|
10
|
+
TData extends Record<string, any>,
|
13
11
|
>({
|
14
12
|
table,
|
15
13
|
...rest
|
@@ -16,14 +16,14 @@ const commonIconButtonStyles = {
|
|
16
16
|
},
|
17
17
|
};
|
18
18
|
|
19
|
-
interface Props<TData extends Record<string, any
|
19
|
+
interface Props<TData extends Record<string, any>> {
|
20
20
|
cell: MRT_Cell<TData>;
|
21
21
|
row: MRT_Row<TData>;
|
22
22
|
table: MRT_TableInstance<TData>;
|
23
23
|
}
|
24
24
|
|
25
25
|
export const MRT_ToggleRowActionMenuButton = <
|
26
|
-
TData extends Record<string, any
|
26
|
+
TData extends Record<string, any>,
|
27
27
|
>({
|
28
28
|
cell,
|
29
29
|
row,
|
@@ -32,7 +32,8 @@ export const MRT_ToggleRowActionMenuButton = <
|
|
32
32
|
const {
|
33
33
|
getState,
|
34
34
|
options: {
|
35
|
-
|
35
|
+
createDisplayMode,
|
36
|
+
editDisplayMode,
|
36
37
|
enableEditing,
|
37
38
|
icons: { EditIcon, MoreHorizIcon },
|
38
39
|
localization,
|
@@ -42,7 +43,14 @@ export const MRT_ToggleRowActionMenuButton = <
|
|
42
43
|
setEditingRow,
|
43
44
|
} = table;
|
44
45
|
|
45
|
-
const { editingRow } = getState();
|
46
|
+
const { creatingRow, editingRow } = getState();
|
47
|
+
|
48
|
+
const isCreating = creatingRow?.id === row.id;
|
49
|
+
const isEditing = editingRow?.id === row.id;
|
50
|
+
|
51
|
+
const showEditActionButtons =
|
52
|
+
(isCreating && createDisplayMode === 'row') ||
|
53
|
+
(isEditing && editDisplayMode === 'row');
|
46
54
|
|
47
55
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
48
56
|
|
@@ -60,9 +68,9 @@ export const MRT_ToggleRowActionMenuButton = <
|
|
60
68
|
|
61
69
|
return (
|
62
70
|
<>
|
63
|
-
{renderRowActions ? (
|
71
|
+
{renderRowActions && !showEditActionButtons ? (
|
64
72
|
renderRowActions({ cell, row, table })
|
65
|
-
) :
|
73
|
+
) : showEditActionButtons ? (
|
66
74
|
<MRT_EditActionButtons row={row} table={table} />
|
67
75
|
) : !renderRowActionMenuItems &&
|
68
76
|
(enableEditing instanceof Function
|
@@ -97,9 +105,9 @@ export const MRT_ToggleRowActionMenuButton = <
|
|
97
105
|
<MRT_RowActionMenu
|
98
106
|
anchorEl={anchorEl}
|
99
107
|
handleEdit={handleStartEditMode}
|
100
|
-
row={row
|
108
|
+
row={row}
|
101
109
|
setAnchorEl={setAnchorEl}
|
102
|
-
table={table
|
110
|
+
table={table}
|
103
111
|
/>
|
104
112
|
</>
|
105
113
|
) : null}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export * from './MRT_ColumnPinningButtons';
|
2
|
+
export * from './MRT_CopyButton';
|
3
|
+
export * from './MRT_EditActionButtons';
|
4
|
+
export * from './MRT_ExpandAllButton';
|
5
|
+
export * from './MRT_ExpandButton';
|
6
|
+
export * from './MRT_ToggleFullScreenButton';
|
7
|
+
export * from './MRT_GrabHandleButton';
|
8
|
+
export * from './MRT_ShowHideColumnsButton';
|
9
|
+
export * from './MRT_ToggleDensePaddingButton';
|
10
|
+
export * from './MRT_ToggleFiltersButton';
|
11
|
+
export * from './MRT_ToggleGlobalFilterButton';
|
12
|
+
export * from './MRT_ToggleRowActionMenuButton';
|