material-react-table 1.11.4 → 1.12.0-beta.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 -1
- package/dist/cjs/index.js +770 -1004
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/MaterialReactTable.d.ts +4 -743
- package/dist/cjs/types/_locales/cs.d.ts +1 -1
- package/dist/cjs/types/_locales/da.d.ts +1 -1
- package/dist/cjs/types/_locales/de.d.ts +1 -1
- package/dist/cjs/types/_locales/en.d.ts +1 -1
- package/dist/cjs/types/_locales/es.d.ts +1 -1
- package/dist/cjs/types/_locales/fa.d.ts +1 -1
- package/dist/cjs/types/_locales/fi.d.ts +1 -1
- package/dist/cjs/types/_locales/fr.d.ts +1 -1
- package/dist/cjs/types/_locales/hu.d.ts +1 -1
- package/dist/cjs/types/_locales/id.d.ts +1 -1
- package/dist/cjs/types/_locales/it.d.ts +1 -1
- package/dist/cjs/types/_locales/ja.d.ts +1 -1
- package/dist/cjs/types/_locales/nl.d.ts +1 -1
- package/dist/cjs/types/_locales/pl.d.ts +1 -1
- package/dist/cjs/types/_locales/pt-BR.d.ts +1 -1
- package/dist/cjs/types/_locales/pt.d.ts +1 -1
- package/dist/cjs/types/_locales/ro.d.ts +1 -1
- package/dist/cjs/types/_locales/ru.d.ts +1 -1
- package/dist/cjs/types/_locales/sk.d.ts +1 -1
- package/dist/cjs/types/_locales/sr-Cyrl-RS.d.ts +1 -1
- package/dist/cjs/types/_locales/sr-Latn-RS.d.ts +1 -1
- package/dist/cjs/types/_locales/sv.d.ts +1 -1
- package/dist/cjs/types/_locales/tr.d.ts +1 -1
- package/dist/cjs/types/_locales/uk.d.ts +1 -1
- package/dist/cjs/types/_locales/vi.d.ts +1 -1
- package/dist/cjs/types/_locales/zh-Hans.d.ts +1 -1
- package/dist/cjs/types/_locales/zh-Hant.d.ts +1 -1
- package/dist/cjs/types/body/MRT_EditRowModal.d.ts +2 -3
- package/dist/cjs/types/body/MRT_TableBody.d.ts +4 -4
- package/dist/cjs/types/body/MRT_TableBodyCell.d.ts +5 -5
- package/dist/cjs/types/body/MRT_TableBodyCellValue.d.ts +2 -3
- package/dist/cjs/types/body/MRT_TableBodyRow.d.ts +5 -5
- package/dist/cjs/types/body/MRT_TableBodyRowGrabHandle.d.ts +3 -3
- package/dist/cjs/types/body/MRT_TableDetailPanel.d.ts +4 -4
- package/dist/cjs/types/buttons/MRT_ColumnPinningButtons.d.ts +2 -3
- package/dist/cjs/types/buttons/MRT_CopyButton.d.ts +3 -3
- package/dist/cjs/types/buttons/MRT_EditActionButtons.d.ts +2 -3
- package/dist/cjs/types/buttons/MRT_ExpandAllButton.d.ts +2 -3
- package/dist/cjs/types/buttons/MRT_ExpandButton.d.ts +2 -3
- package/dist/cjs/types/buttons/MRT_FullScreenToggleButton.d.ts +3 -4
- package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +4 -4
- package/dist/cjs/types/buttons/MRT_ShowHideColumnsButton.d.ts +3 -4
- package/dist/cjs/types/buttons/MRT_ToggleDensePaddingButton.d.ts +3 -4
- package/dist/cjs/types/buttons/MRT_ToggleFiltersButton.d.ts +3 -4
- package/dist/cjs/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +3 -4
- package/dist/cjs/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -3
- package/dist/cjs/types/column.utils.d.ts +10 -10
- package/dist/cjs/types/filterFns.d.ts +1 -1
- package/dist/cjs/types/footer/MRT_TableFooter.d.ts +3 -4
- package/dist/cjs/types/footer/MRT_TableFooterCell.d.ts +2 -3
- package/dist/cjs/types/footer/MRT_TableFooterRow.d.ts +3 -4
- package/dist/cjs/types/head/MRT_TableHead.d.ts +3 -4
- package/dist/cjs/types/head/MRT_TableHeadCell.d.ts +2 -3
- package/dist/cjs/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +2 -3
- package/dist/cjs/types/head/MRT_TableHeadCellFilterContainer.d.ts +2 -3
- package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +2 -3
- package/dist/cjs/types/head/MRT_TableHeadCellGrabHandle.d.ts +3 -3
- package/dist/cjs/types/head/MRT_TableHeadCellResizeHandle.d.ts +2 -3
- package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +3 -4
- package/dist/cjs/types/head/MRT_TableHeadRow.d.ts +3 -4
- package/dist/cjs/types/index.d.ts +6 -4
- package/dist/cjs/types/inputs/MRT_EditCellTextField.d.ts +2 -3
- package/dist/cjs/types/inputs/MRT_FilterCheckbox.d.ts +2 -3
- package/dist/cjs/types/inputs/MRT_FilterRangeFields.d.ts +2 -3
- package/dist/cjs/types/inputs/MRT_FilterTextField.d.ts +2 -3
- package/dist/cjs/types/inputs/MRT_GlobalFilterTextField.d.ts +2 -3
- package/dist/cjs/types/inputs/MRT_SelectCheckbox.d.ts +2 -3
- package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +2 -3
- package/dist/cjs/types/menus/MRT_FilterOptionMenu.d.ts +2 -3
- package/dist/cjs/types/menus/MRT_RowActionMenu.d.ts +3 -3
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenu.d.ts +2 -3
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +3 -3
- package/dist/cjs/types/sortingFns.d.ts +17 -17
- package/dist/cjs/types/table/MRT_Table.d.ts +2 -3
- package/dist/cjs/types/table/MRT_TableContainer.d.ts +2 -3
- package/dist/cjs/types/table/MRT_TablePaper.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_BottomToolbar.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_LinearProgressBar.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_ToolbarDropZone.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_ToolbarInternalButtons.d.ts +2 -3
- package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +3 -4
- package/dist/cjs/types/types.d.ts +745 -0
- package/dist/esm/material-react-table.esm.js +691 -925
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/MaterialReactTable.d.ts +4 -743
- package/dist/esm/types/_locales/cs.d.ts +1 -1
- package/dist/esm/types/_locales/da.d.ts +1 -1
- package/dist/esm/types/_locales/de.d.ts +1 -1
- package/dist/esm/types/_locales/en.d.ts +1 -1
- package/dist/esm/types/_locales/es.d.ts +1 -1
- package/dist/esm/types/_locales/fa.d.ts +1 -1
- package/dist/esm/types/_locales/fi.d.ts +1 -1
- package/dist/esm/types/_locales/fr.d.ts +1 -1
- package/dist/esm/types/_locales/hu.d.ts +1 -1
- package/dist/esm/types/_locales/id.d.ts +1 -1
- package/dist/esm/types/_locales/it.d.ts +1 -1
- package/dist/esm/types/_locales/ja.d.ts +1 -1
- package/dist/esm/types/_locales/nl.d.ts +1 -1
- package/dist/esm/types/_locales/pl.d.ts +1 -1
- package/dist/esm/types/_locales/pt-BR.d.ts +1 -1
- package/dist/esm/types/_locales/pt.d.ts +1 -1
- package/dist/esm/types/_locales/ro.d.ts +1 -1
- package/dist/esm/types/_locales/ru.d.ts +1 -1
- package/dist/esm/types/_locales/sk.d.ts +1 -1
- package/dist/esm/types/_locales/sr-Cyrl-RS.d.ts +1 -1
- package/dist/esm/types/_locales/sr-Latn-RS.d.ts +1 -1
- package/dist/esm/types/_locales/sv.d.ts +1 -1
- package/dist/esm/types/_locales/tr.d.ts +1 -1
- package/dist/esm/types/_locales/uk.d.ts +1 -1
- package/dist/esm/types/_locales/vi.d.ts +1 -1
- package/dist/esm/types/_locales/zh-Hans.d.ts +1 -1
- package/dist/esm/types/_locales/zh-Hant.d.ts +1 -1
- package/dist/esm/types/body/MRT_EditRowModal.d.ts +2 -3
- package/dist/esm/types/body/MRT_TableBody.d.ts +4 -4
- package/dist/esm/types/body/MRT_TableBodyCell.d.ts +5 -5
- package/dist/esm/types/body/MRT_TableBodyCellValue.d.ts +2 -3
- package/dist/esm/types/body/MRT_TableBodyRow.d.ts +5 -5
- package/dist/esm/types/body/MRT_TableBodyRowGrabHandle.d.ts +3 -3
- package/dist/esm/types/body/MRT_TableDetailPanel.d.ts +4 -4
- package/dist/esm/types/buttons/MRT_ColumnPinningButtons.d.ts +2 -3
- package/dist/esm/types/buttons/MRT_CopyButton.d.ts +3 -3
- package/dist/esm/types/buttons/MRT_EditActionButtons.d.ts +2 -3
- package/dist/esm/types/buttons/MRT_ExpandAllButton.d.ts +2 -3
- package/dist/esm/types/buttons/MRT_ExpandButton.d.ts +2 -3
- package/dist/esm/types/buttons/MRT_FullScreenToggleButton.d.ts +3 -4
- package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +4 -4
- package/dist/esm/types/buttons/MRT_ShowHideColumnsButton.d.ts +3 -4
- package/dist/esm/types/buttons/MRT_ToggleDensePaddingButton.d.ts +3 -4
- package/dist/esm/types/buttons/MRT_ToggleFiltersButton.d.ts +3 -4
- package/dist/esm/types/buttons/MRT_ToggleGlobalFilterButton.d.ts +3 -4
- package/dist/esm/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -3
- package/dist/esm/types/column.utils.d.ts +10 -10
- package/dist/esm/types/filterFns.d.ts +1 -1
- package/dist/esm/types/footer/MRT_TableFooter.d.ts +3 -4
- package/dist/esm/types/footer/MRT_TableFooterCell.d.ts +2 -3
- package/dist/esm/types/footer/MRT_TableFooterRow.d.ts +3 -4
- package/dist/esm/types/head/MRT_TableHead.d.ts +3 -4
- package/dist/esm/types/head/MRT_TableHeadCell.d.ts +2 -3
- package/dist/esm/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +2 -3
- package/dist/esm/types/head/MRT_TableHeadCellFilterContainer.d.ts +2 -3
- package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +2 -3
- package/dist/esm/types/head/MRT_TableHeadCellGrabHandle.d.ts +3 -3
- package/dist/esm/types/head/MRT_TableHeadCellResizeHandle.d.ts +2 -3
- package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +3 -4
- package/dist/esm/types/head/MRT_TableHeadRow.d.ts +3 -4
- package/dist/esm/types/index.d.ts +6 -4
- package/dist/esm/types/inputs/MRT_EditCellTextField.d.ts +2 -3
- package/dist/esm/types/inputs/MRT_FilterCheckbox.d.ts +2 -3
- package/dist/esm/types/inputs/MRT_FilterRangeFields.d.ts +2 -3
- package/dist/esm/types/inputs/MRT_FilterTextField.d.ts +2 -3
- package/dist/esm/types/inputs/MRT_GlobalFilterTextField.d.ts +2 -3
- package/dist/esm/types/inputs/MRT_SelectCheckbox.d.ts +2 -3
- package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +2 -3
- package/dist/esm/types/menus/MRT_FilterOptionMenu.d.ts +2 -3
- package/dist/esm/types/menus/MRT_RowActionMenu.d.ts +3 -3
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenu.d.ts +2 -3
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +3 -3
- package/dist/esm/types/sortingFns.d.ts +17 -17
- package/dist/esm/types/table/MRT_Table.d.ts +2 -3
- package/dist/esm/types/table/MRT_TableContainer.d.ts +2 -3
- package/dist/esm/types/table/MRT_TablePaper.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_BottomToolbar.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_LinearProgressBar.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_ToolbarDropZone.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_ToolbarInternalButtons.d.ts +2 -3
- package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +3 -4
- package/dist/esm/types/types.d.ts +745 -0
- package/dist/index.d.ts +40 -35
- package/locales/cs.d.ts +1 -1
- package/locales/cs.esm.d.ts +1 -1
- package/locales/da.d.ts +1 -1
- package/locales/da.esm.d.ts +1 -1
- package/locales/de.d.ts +1 -1
- package/locales/de.esm.d.ts +1 -1
- package/locales/en.d.ts +1 -1
- package/locales/en.esm.d.ts +1 -1
- package/locales/es.d.ts +1 -1
- package/locales/es.esm.d.ts +1 -1
- package/locales/fa.d.ts +1 -1
- package/locales/fa.esm.d.ts +1 -1
- package/locales/fi.d.ts +1 -1
- package/locales/fi.esm.d.ts +1 -1
- package/locales/fr.d.ts +1 -1
- package/locales/fr.esm.d.ts +1 -1
- package/locales/hu.d.ts +1 -1
- package/locales/hu.esm.d.ts +1 -1
- package/locales/id.d.ts +1 -1
- package/locales/id.esm.d.ts +1 -1
- package/locales/it.d.ts +1 -1
- package/locales/it.esm.d.ts +1 -1
- package/locales/ja.d.ts +1 -1
- package/locales/ja.esm.d.ts +1 -1
- package/locales/nl.d.ts +1 -1
- package/locales/nl.esm.d.ts +1 -1
- package/locales/pl.d.ts +1 -1
- package/locales/pl.esm.d.ts +1 -1
- package/locales/pt-BR.d.ts +1 -1
- package/locales/pt-BR.esm.d.ts +1 -1
- package/locales/pt.d.ts +1 -1
- package/locales/pt.esm.d.ts +1 -1
- package/locales/ro.d.ts +1 -1
- package/locales/ro.esm.d.ts +1 -1
- package/locales/ru.d.ts +1 -1
- package/locales/ru.esm.d.ts +1 -1
- package/locales/sk.d.ts +1 -1
- package/locales/sk.esm.d.ts +1 -1
- package/locales/sr-Cyrl-RS.d.ts +1 -1
- package/locales/sr-Cyrl-RS.esm.d.ts +1 -1
- package/locales/sr-Latn-RS.d.ts +1 -1
- package/locales/sr-Latn-RS.esm.d.ts +1 -1
- package/locales/sv.d.ts +1 -1
- package/locales/sv.esm.d.ts +1 -1
- package/locales/tr.d.ts +1 -1
- package/locales/tr.esm.d.ts +1 -1
- package/locales/uk.d.ts +1 -1
- package/locales/uk.esm.d.ts +1 -1
- package/locales/vi.d.ts +1 -1
- package/locales/vi.esm.d.ts +1 -1
- package/locales/zh-Hans.d.ts +1 -1
- package/locales/zh-Hans.esm.d.ts +1 -1
- package/locales/zh-Hant.d.ts +1 -1
- package/locales/zh-Hant.esm.d.ts +1 -1
- package/package.json +35 -17
- package/src/MaterialReactTable.tsx +10 -984
- package/src/_locales/cs.ts +1 -1
- package/src/_locales/da.ts +1 -1
- package/src/_locales/de.ts +1 -1
- package/src/_locales/en.ts +1 -1
- package/src/_locales/es.ts +1 -1
- package/src/_locales/fa.ts +1 -1
- package/src/_locales/fi.ts +1 -1
- package/src/_locales/fr.ts +1 -1
- package/src/_locales/hu.ts +1 -1
- package/src/_locales/id.ts +1 -1
- package/src/_locales/it.ts +1 -1
- package/src/_locales/ja.ts +1 -1
- package/src/_locales/nl.ts +1 -1
- package/src/_locales/pl.ts +1 -1
- package/src/_locales/pt-BR.ts +1 -1
- package/src/_locales/pt.ts +1 -1
- package/src/_locales/ro.ts +1 -1
- package/src/_locales/ru.ts +1 -1
- package/src/_locales/sk.ts +1 -1
- package/src/_locales/sr-Cyrl-RS.ts +1 -1
- package/src/_locales/sr-Latn-RS.ts +1 -1
- package/src/_locales/sv.ts +1 -1
- package/src/_locales/tr.ts +1 -1
- package/src/_locales/uk.ts +1 -1
- package/src/_locales/vi.ts +1 -1
- package/src/_locales/zh-Hans.ts +1 -1
- package/src/_locales/zh-Hant.ts +1 -1
- package/src/body/MRT_EditRowModal.tsx +1 -2
- package/src/body/MRT_TableBody.tsx +2 -2
- package/src/body/MRT_TableBodyCell.tsx +6 -6
- package/src/body/MRT_TableBodyCellValue.tsx +2 -2
- package/src/body/MRT_TableBodyRow.tsx +3 -3
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +2 -2
- package/src/body/MRT_TableDetailPanel.tsx +3 -3
- package/src/buttons/MRT_ColumnPinningButtons.tsx +1 -2
- package/src/buttons/MRT_CopyButton.tsx +2 -2
- package/src/buttons/MRT_EditActionButtons.tsx +1 -2
- package/src/buttons/MRT_ExpandAllButton.tsx +1 -2
- package/src/buttons/MRT_ExpandButton.tsx +2 -2
- package/src/buttons/MRT_FullScreenToggleButton.tsx +2 -3
- package/src/buttons/MRT_GrabHandleButton.tsx +3 -3
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +3 -3
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +2 -3
- package/src/buttons/MRT_ToggleFiltersButton.tsx +2 -3
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +2 -3
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +2 -2
- package/src/column.utils.ts +23 -22
- package/src/filterFns.ts +1 -1
- package/src/footer/MRT_TableFooter.tsx +2 -3
- package/src/footer/MRT_TableFooterCell.tsx +1 -2
- package/src/footer/MRT_TableFooterRow.tsx +2 -3
- package/src/head/MRT_TableHead.tsx +2 -3
- package/src/head/MRT_TableHeadCell.tsx +3 -3
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +2 -2
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +1 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +2 -2
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +2 -2
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +1 -2
- package/src/head/MRT_TableHeadCellSortLabel.tsx +2 -3
- package/src/head/MRT_TableHeadRow.tsx +2 -3
- package/src/index.tsx +7 -5
- package/src/inputs/MRT_EditCellTextField.tsx +3 -3
- package/src/inputs/MRT_FilterCheckbox.tsx +2 -3
- package/src/inputs/MRT_FilterRangeFields.tsx +1 -2
- package/src/inputs/MRT_FilterTextField.tsx +5 -5
- package/src/inputs/MRT_GlobalFilterTextField.tsx +4 -4
- package/src/inputs/MRT_SelectCheckbox.tsx +3 -3
- package/src/menus/MRT_ColumnActionMenu.tsx +3 -2
- package/src/menus/MRT_FilterOptionMenu.tsx +8 -8
- package/src/menus/MRT_RowActionMenu.tsx +2 -2
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +2 -2
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +2 -8
- package/src/sortingFns.ts +1 -1
- package/src/table/MRT_Table.tsx +2 -2
- package/src/table/MRT_TableContainer.tsx +2 -2
- package/src/table/MRT_TablePaper.tsx +1 -2
- package/src/table/MRT_TableRoot.tsx +16 -16
- package/src/toolbar/MRT_BottomToolbar.tsx +1 -2
- package/src/toolbar/MRT_LinearProgressBar.tsx +1 -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 +1 -2
- package/src/toolbar/MRT_TopToolbar.tsx +2 -3
- package/src/types.ts +981 -0
@@ -1,7 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
2
|
+
import { useMemo, useState, useRef, useCallback, useEffect, Fragment as Fragment$1, memo, useLayoutEffect } from 'react';
|
2
3
|
import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
3
|
-
import { alpha, lighten, useTheme, darken } from '@mui/material/styles';
|
4
4
|
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
5
|
+
import { alpha, lighten, useTheme, darken } from '@mui/material/styles';
|
5
6
|
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
6
7
|
import ArrowRightIcon from '@mui/icons-material/ArrowRight';
|
7
8
|
import CancelIcon from '@mui/icons-material/Cancel';
|
@@ -100,6 +101,104 @@ function __rest(s, e) {
|
|
100
101
|
|
101
102
|
const MRT_AggregationFns = Object.assign({}, aggregationFns);
|
102
103
|
|
104
|
+
const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
|
105
|
+
const itemRank = rankItem(row.getValue(columnId), filterValue, {
|
106
|
+
threshold: rankings.MATCHES,
|
107
|
+
});
|
108
|
+
addMeta(itemRank);
|
109
|
+
return itemRank.passed;
|
110
|
+
};
|
111
|
+
fuzzy$1.autoRemove = (val) => !val;
|
112
|
+
const contains = (row, id, filterValue) => row
|
113
|
+
.getValue(id)
|
114
|
+
.toString()
|
115
|
+
.toLowerCase()
|
116
|
+
.trim()
|
117
|
+
.includes(filterValue.toString().toLowerCase().trim());
|
118
|
+
contains.autoRemove = (val) => !val;
|
119
|
+
const startsWith = (row, id, filterValue) => row
|
120
|
+
.getValue(id)
|
121
|
+
.toString()
|
122
|
+
.toLowerCase()
|
123
|
+
.trim()
|
124
|
+
.startsWith(filterValue.toString().toLowerCase().trim());
|
125
|
+
startsWith.autoRemove = (val) => !val;
|
126
|
+
const endsWith = (row, id, filterValue) => row
|
127
|
+
.getValue(id)
|
128
|
+
.toString()
|
129
|
+
.toLowerCase()
|
130
|
+
.trim()
|
131
|
+
.endsWith(filterValue.toString().toLowerCase().trim());
|
132
|
+
endsWith.autoRemove = (val) => !val;
|
133
|
+
const equals = (row, id, filterValue) => row.getValue(id).toString().toLowerCase().trim() ===
|
134
|
+
filterValue.toString().toLowerCase().trim();
|
135
|
+
equals.autoRemove = (val) => !val;
|
136
|
+
const notEquals = (row, id, filterValue) => row.getValue(id).toString().toLowerCase().trim() !==
|
137
|
+
filterValue.toString().toLowerCase().trim();
|
138
|
+
notEquals.autoRemove = (val) => !val;
|
139
|
+
const greaterThan = (row, id, filterValue) => !isNaN(+filterValue) && !isNaN(+row.getValue(id))
|
140
|
+
? +row.getValue(id) > +filterValue
|
141
|
+
: row.getValue(id).toString().toLowerCase().trim() >
|
142
|
+
filterValue.toString().toLowerCase().trim();
|
143
|
+
greaterThan.autoRemove = (val) => !val;
|
144
|
+
const greaterThanOrEqualTo = (row, id, filterValue) => equals(row, id, filterValue) || greaterThan(row, id, filterValue);
|
145
|
+
greaterThanOrEqualTo.autoRemove = (val) => !val;
|
146
|
+
const lessThan = (row, id, filterValue) => !isNaN(+filterValue) && !isNaN(+row.getValue(id))
|
147
|
+
? +row.getValue(id) < +filterValue
|
148
|
+
: row.getValue(id).toString().toLowerCase().trim() <
|
149
|
+
filterValue.toString().toLowerCase().trim();
|
150
|
+
lessThan.autoRemove = (val) => !val;
|
151
|
+
const lessThanOrEqualTo = (row, id, filterValue) => equals(row, id, filterValue) || lessThan(row, id, filterValue);
|
152
|
+
lessThanOrEqualTo.autoRemove = (val) => !val;
|
153
|
+
const between = (row, id, filterValues) => (['', undefined].includes(filterValues[0]) ||
|
154
|
+
greaterThan(row, id, filterValues[0])) &&
|
155
|
+
((!isNaN(+filterValues[0]) &&
|
156
|
+
!isNaN(+filterValues[1]) &&
|
157
|
+
+filterValues[0] > +filterValues[1]) ||
|
158
|
+
['', undefined].includes(filterValues[1]) ||
|
159
|
+
lessThan(row, id, filterValues[1]));
|
160
|
+
between.autoRemove = (val) => !val;
|
161
|
+
const betweenInclusive = (row, id, filterValues) => (['', undefined].includes(filterValues[0]) ||
|
162
|
+
greaterThanOrEqualTo(row, id, filterValues[0])) &&
|
163
|
+
((!isNaN(+filterValues[0]) &&
|
164
|
+
!isNaN(+filterValues[1]) &&
|
165
|
+
+filterValues[0] > +filterValues[1]) ||
|
166
|
+
['', undefined].includes(filterValues[1]) ||
|
167
|
+
lessThanOrEqualTo(row, id, filterValues[1]));
|
168
|
+
betweenInclusive.autoRemove = (val) => !val;
|
169
|
+
const empty = (row, id, _filterValue) => !row.getValue(id).toString().trim();
|
170
|
+
empty.autoRemove = (val) => !val;
|
171
|
+
const notEmpty = (row, id, _filterValue) => !!row.getValue(id).toString().trim();
|
172
|
+
notEmpty.autoRemove = (val) => !val;
|
173
|
+
const MRT_FilterFns = Object.assign(Object.assign({}, filterFns), { between,
|
174
|
+
betweenInclusive,
|
175
|
+
contains,
|
176
|
+
empty,
|
177
|
+
endsWith,
|
178
|
+
equals,
|
179
|
+
fuzzy: fuzzy$1,
|
180
|
+
greaterThan,
|
181
|
+
greaterThanOrEqualTo,
|
182
|
+
lessThan,
|
183
|
+
lessThanOrEqualTo,
|
184
|
+
notEmpty,
|
185
|
+
notEquals,
|
186
|
+
startsWith });
|
187
|
+
|
188
|
+
const fuzzy = (rowA, rowB, columnId) => {
|
189
|
+
let dir = 0;
|
190
|
+
if (rowA.columnFiltersMeta[columnId]) {
|
191
|
+
dir = compareItems(rowA.columnFiltersMeta[columnId], rowB.columnFiltersMeta[columnId]);
|
192
|
+
}
|
193
|
+
// Provide a fallback for when the item ranks are equal
|
194
|
+
return dir === 0
|
195
|
+
? sortingFns.alphanumeric(rowA, rowB, columnId)
|
196
|
+
: dir;
|
197
|
+
};
|
198
|
+
const MRT_SortingFns = Object.assign(Object.assign({}, sortingFns), { fuzzy });
|
199
|
+
const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
|
200
|
+
Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
|
201
|
+
|
103
202
|
const getColumnId = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
|
104
203
|
const getAllLeafColumnDefs = (columns) => {
|
105
204
|
const allLeafColumnDefs = [];
|
@@ -167,8 +266,9 @@ const reorderColumn = (draggedColumn, targetColumn, columnOrder) => {
|
|
167
266
|
if (draggedColumn.getCanPin()) {
|
168
267
|
draggedColumn.pin(targetColumn.getIsPinned());
|
169
268
|
}
|
170
|
-
|
171
|
-
|
269
|
+
const newColumnOrder = [...columnOrder];
|
270
|
+
newColumnOrder.splice(newColumnOrder.indexOf(targetColumn.id), 0, newColumnOrder.splice(newColumnOrder.indexOf(draggedColumn.id), 1)[0]);
|
271
|
+
return newColumnOrder;
|
172
272
|
};
|
173
273
|
const showExpandColumn = (props, grouping) => !!(props.enableExpanding ||
|
174
274
|
(props.enableGrouping && (grouping === undefined || (grouping === null || grouping === void 0 ? void 0 : grouping.length))) ||
|
@@ -303,90 +403,6 @@ const MRT_DefaultDisplayColumn = {
|
|
303
403
|
};
|
304
404
|
const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
|
305
405
|
|
306
|
-
const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
|
307
|
-
const itemRank = rankItem(row.getValue(columnId), filterValue, {
|
308
|
-
threshold: rankings.MATCHES,
|
309
|
-
});
|
310
|
-
addMeta(itemRank);
|
311
|
-
return itemRank.passed;
|
312
|
-
};
|
313
|
-
fuzzy$1.autoRemove = (val) => !val;
|
314
|
-
const contains = (row, id, filterValue) => row
|
315
|
-
.getValue(id)
|
316
|
-
.toString()
|
317
|
-
.toLowerCase()
|
318
|
-
.trim()
|
319
|
-
.includes(filterValue.toString().toLowerCase().trim());
|
320
|
-
contains.autoRemove = (val) => !val;
|
321
|
-
const startsWith = (row, id, filterValue) => row
|
322
|
-
.getValue(id)
|
323
|
-
.toString()
|
324
|
-
.toLowerCase()
|
325
|
-
.trim()
|
326
|
-
.startsWith(filterValue.toString().toLowerCase().trim());
|
327
|
-
startsWith.autoRemove = (val) => !val;
|
328
|
-
const endsWith = (row, id, filterValue) => row
|
329
|
-
.getValue(id)
|
330
|
-
.toString()
|
331
|
-
.toLowerCase()
|
332
|
-
.trim()
|
333
|
-
.endsWith(filterValue.toString().toLowerCase().trim());
|
334
|
-
endsWith.autoRemove = (val) => !val;
|
335
|
-
const equals = (row, id, filterValue) => row.getValue(id).toString().toLowerCase().trim() ===
|
336
|
-
filterValue.toString().toLowerCase().trim();
|
337
|
-
equals.autoRemove = (val) => !val;
|
338
|
-
const notEquals = (row, id, filterValue) => row.getValue(id).toString().toLowerCase().trim() !==
|
339
|
-
filterValue.toString().toLowerCase().trim();
|
340
|
-
notEquals.autoRemove = (val) => !val;
|
341
|
-
const greaterThan = (row, id, filterValue) => !isNaN(+filterValue) && !isNaN(+row.getValue(id))
|
342
|
-
? +row.getValue(id) > +filterValue
|
343
|
-
: row.getValue(id).toString().toLowerCase().trim() >
|
344
|
-
filterValue.toString().toLowerCase().trim();
|
345
|
-
greaterThan.autoRemove = (val) => !val;
|
346
|
-
const greaterThanOrEqualTo = (row, id, filterValue) => equals(row, id, filterValue) || greaterThan(row, id, filterValue);
|
347
|
-
greaterThanOrEqualTo.autoRemove = (val) => !val;
|
348
|
-
const lessThan = (row, id, filterValue) => !isNaN(+filterValue) && !isNaN(+row.getValue(id))
|
349
|
-
? +row.getValue(id) < +filterValue
|
350
|
-
: row.getValue(id).toString().toLowerCase().trim() <
|
351
|
-
filterValue.toString().toLowerCase().trim();
|
352
|
-
lessThan.autoRemove = (val) => !val;
|
353
|
-
const lessThanOrEqualTo = (row, id, filterValue) => equals(row, id, filterValue) || lessThan(row, id, filterValue);
|
354
|
-
lessThanOrEqualTo.autoRemove = (val) => !val;
|
355
|
-
const between = (row, id, filterValues) => (['', undefined].includes(filterValues[0]) ||
|
356
|
-
greaterThan(row, id, filterValues[0])) &&
|
357
|
-
((!isNaN(+filterValues[0]) &&
|
358
|
-
!isNaN(+filterValues[1]) &&
|
359
|
-
+filterValues[0] > +filterValues[1]) ||
|
360
|
-
['', undefined].includes(filterValues[1]) ||
|
361
|
-
lessThan(row, id, filterValues[1]));
|
362
|
-
between.autoRemove = (val) => !val;
|
363
|
-
const betweenInclusive = (row, id, filterValues) => (['', undefined].includes(filterValues[0]) ||
|
364
|
-
greaterThanOrEqualTo(row, id, filterValues[0])) &&
|
365
|
-
((!isNaN(+filterValues[0]) &&
|
366
|
-
!isNaN(+filterValues[1]) &&
|
367
|
-
+filterValues[0] > +filterValues[1]) ||
|
368
|
-
['', undefined].includes(filterValues[1]) ||
|
369
|
-
lessThanOrEqualTo(row, id, filterValues[1]));
|
370
|
-
betweenInclusive.autoRemove = (val) => !val;
|
371
|
-
const empty = (row, id, _filterValue) => !row.getValue(id).toString().trim();
|
372
|
-
empty.autoRemove = (val) => !val;
|
373
|
-
const notEmpty = (row, id, _filterValue) => !!row.getValue(id).toString().trim();
|
374
|
-
notEmpty.autoRemove = (val) => !val;
|
375
|
-
const MRT_FilterFns = Object.assign(Object.assign({}, filterFns), { between,
|
376
|
-
betweenInclusive,
|
377
|
-
contains,
|
378
|
-
empty,
|
379
|
-
endsWith,
|
380
|
-
equals,
|
381
|
-
fuzzy: fuzzy$1,
|
382
|
-
greaterThan,
|
383
|
-
greaterThanOrEqualTo,
|
384
|
-
lessThan,
|
385
|
-
lessThanOrEqualTo,
|
386
|
-
notEmpty,
|
387
|
-
notEquals,
|
388
|
-
startsWith });
|
389
|
-
|
390
406
|
const MRT_Default_Icons = {
|
391
407
|
ArrowDownwardIcon,
|
392
408
|
ArrowRightIcon,
|
@@ -418,19 +434,97 @@ const MRT_Default_Icons = {
|
|
418
434
|
VisibilityOffIcon,
|
419
435
|
};
|
420
436
|
|
421
|
-
const
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
437
|
+
const MRT_Localization_EN = {
|
438
|
+
actions: 'Actions',
|
439
|
+
and: 'and',
|
440
|
+
cancel: 'Cancel',
|
441
|
+
changeFilterMode: 'Change filter mode',
|
442
|
+
changeSearchMode: 'Change search mode',
|
443
|
+
clearFilter: 'Clear filter',
|
444
|
+
clearSearch: 'Clear search',
|
445
|
+
clearSort: 'Clear sort',
|
446
|
+
clickToCopy: 'Click to copy',
|
447
|
+
collapse: 'Collapse',
|
448
|
+
collapseAll: 'Collapse all',
|
449
|
+
columnActions: 'Column Actions',
|
450
|
+
copiedToClipboard: 'Copied to clipboard',
|
451
|
+
dropToGroupBy: 'Drop to group by {column}',
|
452
|
+
edit: 'Edit',
|
453
|
+
expand: 'Expand',
|
454
|
+
expandAll: 'Expand all',
|
455
|
+
filterArrIncludes: 'Includes',
|
456
|
+
filterArrIncludesAll: 'Includes all',
|
457
|
+
filterArrIncludesSome: 'Includes',
|
458
|
+
filterBetween: 'Between',
|
459
|
+
filterBetweenInclusive: 'Between Inclusive',
|
460
|
+
filterByColumn: 'Filter by {column}',
|
461
|
+
filterContains: 'Contains',
|
462
|
+
filterEmpty: 'Empty',
|
463
|
+
filterEndsWith: 'Ends With',
|
464
|
+
filterEquals: 'Equals',
|
465
|
+
filterEqualsString: 'Equals',
|
466
|
+
filterFuzzy: 'Fuzzy',
|
467
|
+
filterGreaterThan: 'Greater Than',
|
468
|
+
filterGreaterThanOrEqualTo: 'Greater Than Or Equal To',
|
469
|
+
filterInNumberRange: 'Between',
|
470
|
+
filterIncludesString: 'Contains',
|
471
|
+
filterIncludesStringSensitive: 'Contains',
|
472
|
+
filterLessThan: 'Less Than',
|
473
|
+
filterLessThanOrEqualTo: 'Less Than Or Equal To',
|
474
|
+
filterMode: 'Filter Mode: {filterType}',
|
475
|
+
filterNotEmpty: 'Not Empty',
|
476
|
+
filterNotEquals: 'Not Equals',
|
477
|
+
filterStartsWith: 'Starts With',
|
478
|
+
filterWeakEquals: 'Equals',
|
479
|
+
filteringByColumn: 'Filtering by {column} - {filterType} {filterValue}',
|
480
|
+
goToFirstPage: 'Go to first page',
|
481
|
+
goToLastPage: 'Go to last page',
|
482
|
+
goToNextPage: 'Go to next page',
|
483
|
+
goToPreviousPage: 'Go to previous page',
|
484
|
+
grab: 'Grab',
|
485
|
+
groupByColumn: 'Group by {column}',
|
486
|
+
groupedBy: 'Grouped by ',
|
487
|
+
hideAll: 'Hide all',
|
488
|
+
hideColumn: 'Hide {column} column',
|
489
|
+
max: 'Max',
|
490
|
+
min: 'Min',
|
491
|
+
move: 'Move',
|
492
|
+
noRecordsToDisplay: 'No records to display',
|
493
|
+
noResultsFound: 'No results found',
|
494
|
+
of: 'of',
|
495
|
+
or: 'or',
|
496
|
+
pinToLeft: 'Pin to left',
|
497
|
+
pinToRight: 'Pin to right',
|
498
|
+
resetColumnSize: 'Reset column size',
|
499
|
+
resetOrder: 'Reset order',
|
500
|
+
rowActions: 'Row Actions',
|
501
|
+
rowNumber: '#',
|
502
|
+
rowNumbers: 'Row Numbers',
|
503
|
+
rowsPerPage: 'Rows per page',
|
504
|
+
save: 'Save',
|
505
|
+
search: 'Search',
|
506
|
+
selectedCountOfRowCountRowsSelected: '{selectedCount} of {rowCount} row(s) selected',
|
507
|
+
select: 'Select',
|
508
|
+
showAll: 'Show all',
|
509
|
+
showAllColumns: 'Show all columns',
|
510
|
+
showHideColumns: 'Show/Hide columns',
|
511
|
+
showHideFilters: 'Show/Hide filters',
|
512
|
+
showHideSearch: 'Show/Hide search',
|
513
|
+
sortByColumnAsc: 'Sort by {column} ascending',
|
514
|
+
sortByColumnDesc: 'Sort by {column} descending',
|
515
|
+
sortedByColumnAsc: 'Sorted by {column} ascending',
|
516
|
+
sortedByColumnDesc: 'Sorted by {column} descending',
|
517
|
+
thenBy: ', then by ',
|
518
|
+
toggleDensity: 'Toggle density',
|
519
|
+
toggleFullScreen: 'Toggle full screen',
|
520
|
+
toggleSelectAll: 'Toggle select all',
|
521
|
+
toggleSelectRow: 'Toggle select row',
|
522
|
+
toggleVisibility: 'Toggle visibility',
|
523
|
+
ungroupByColumn: 'Ungroup by {column}',
|
524
|
+
unpin: 'Unpin',
|
525
|
+
unpinAll: 'Unpin all',
|
526
|
+
unsorted: 'Unsorted',
|
430
527
|
};
|
431
|
-
const MRT_SortingFns = Object.assign(Object.assign({}, sortingFns), { fuzzy });
|
432
|
-
const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
|
433
|
-
Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
|
434
528
|
|
435
529
|
const MRT_ExpandAllButton = ({ table }) => {
|
436
530
|
var _a, _b;
|
@@ -440,16 +534,14 @@ const MRT_ExpandAllButton = ({ table }) => {
|
|
440
534
|
? muiExpandAllButtonProps({ table })
|
441
535
|
: muiExpandAllButtonProps;
|
442
536
|
const isAllRowsExpanded = getIsAllRowsExpanded();
|
443
|
-
return (
|
537
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: ((_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : isAllRowsExpanded)
|
444
538
|
? localization.collapseAll
|
445
|
-
: localization.expandAll },
|
446
|
-
React.createElement("span", null,
|
447
|
-
React.createElement(IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!isAllRowsExpanded) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
539
|
+
: localization.expandAll }, { children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!isAllRowsExpanded) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
448
540
|
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
449
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }
|
450
|
-
|
451
|
-
|
452
|
-
|
541
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }, { children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsx(KeyboardDoubleArrowDownIcon, { style: {
|
542
|
+
transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
|
543
|
+
transition: 'transform 150ms',
|
544
|
+
} })) })) }) })));
|
453
545
|
};
|
454
546
|
|
455
547
|
const MRT_ExpandButton = ({ row, table, }) => {
|
@@ -467,16 +559,14 @@ const MRT_ExpandButton = ({ row, table, }) => {
|
|
467
559
|
row.toggleExpanded();
|
468
560
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
469
561
|
};
|
470
|
-
return (
|
562
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, disableHoverListener: !canExpand && !renderDetailPanel, enterDelay: 1000, enterNextDelay: 1000, title: ((_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : isExpanded)
|
471
563
|
? localization.collapse
|
472
|
-
: localization.expand },
|
473
|
-
React.createElement("span", null,
|
474
|
-
React.createElement(IconButton, Object.assign({ "aria-label": localization.expand, disabled: !canExpand && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem' }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
564
|
+
: localization.expand }, { children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.expand, disabled: !canExpand && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem' }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
475
565
|
? iconButtonProps.sx(theme)
|
476
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }
|
477
|
-
|
478
|
-
|
479
|
-
|
566
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }, { children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsx(ExpandMoreIcon, { style: {
|
567
|
+
transform: `rotate(${!canExpand && !renderDetailPanel ? -90 : isExpanded ? -180 : 0}deg)`,
|
568
|
+
transition: 'transform 150ms',
|
569
|
+
} })) })) }) })));
|
480
570
|
};
|
481
571
|
|
482
572
|
const mrtFilterOptions = (localization) => [
|
@@ -643,33 +733,31 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
643
733
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
644
734
|
};
|
645
735
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
646
|
-
return (
|
736
|
+
return (jsx(Menu, Object.assign({ anchorEl: anchorEl, anchorOrigin: { vertical: 'center', horizontal: 'right' }, onClose: () => setAnchorEl(null), open: !!anchorEl, MenuListProps: {
|
647
737
|
dense: density === 'compact',
|
648
|
-
} }, (_d = (header && column && columnDef
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
React.createElement(Box, { sx: { fontSize: '1.25rem', width: '2ch' } }, symbol),
|
672
|
-
label)))));
|
738
|
+
} }, { children: (_d = (header && column && columnDef
|
739
|
+
? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
740
|
+
column: column,
|
741
|
+
internalFilterOptions,
|
742
|
+
onSelectFilterMode: handleSelectFilterMode,
|
743
|
+
table,
|
744
|
+
})) !== null && _c !== void 0 ? _c : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
|
745
|
+
column: column,
|
746
|
+
internalFilterOptions,
|
747
|
+
onSelectFilterMode: handleSelectFilterMode,
|
748
|
+
table,
|
749
|
+
})
|
750
|
+
: renderGlobalFilterModeMenuItems === null || renderGlobalFilterModeMenuItems === void 0 ? void 0 : renderGlobalFilterModeMenuItems({
|
751
|
+
internalFilterOptions,
|
752
|
+
onSelectFilterMode: handleSelectFilterMode,
|
753
|
+
table,
|
754
|
+
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (jsxs(MenuItem, Object.assign({ divider: divider, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
755
|
+
alignItems: 'center',
|
756
|
+
display: 'flex',
|
757
|
+
gap: '2ch',
|
758
|
+
my: 0,
|
759
|
+
py: '6px',
|
760
|
+
}, value: option }, { children: [jsx(Box, Object.assign({ sx: { fontSize: '1.25rem', width: '2ch' } }, { children: symbol })), label] }), index))) })));
|
673
761
|
};
|
674
762
|
|
675
763
|
const commonMenuItemStyles = {
|
@@ -743,121 +831,60 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
743
831
|
!isSelectFilter &&
|
744
832
|
(allowedColumnFilterOptions === undefined ||
|
745
833
|
!!(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.length));
|
746
|
-
return (
|
834
|
+
return (jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
747
835
|
dense: density === 'compact',
|
748
|
-
} }, (_d = (_c = (_b = columnDef.renderColumnActionsMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
?
|
785
|
-
|
786
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
787
|
-
React.createElement(ListItemIcon, null,
|
788
|
-
React.createElement(FilterListIcon, null)), (_g = localization.filterByColumn) === null || _g === void 0 ? void 0 :
|
789
|
-
_g.replace('{column}', String(columnDef.header))),
|
790
|
-
showFilterModeSubMenu && (React.createElement(IconButton, { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 } },
|
791
|
-
React.createElement(ArrowRightIcon, null)))),
|
792
|
-
showFilterModeSubMenu && (React.createElement(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, key: 2, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table })),
|
793
|
-
].filter(Boolean),
|
794
|
-
enableGrouping &&
|
795
|
-
column.getCanGroup() && [
|
796
|
-
React.createElement(MenuItem, { divider: enablePinning, key: 0, onClick: handleGroupByColumn, sx: commonMenuItemStyles },
|
797
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
798
|
-
React.createElement(ListItemIcon, null,
|
799
|
-
React.createElement(DynamicFeedIcon, null)), (_h = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _h === void 0 ? void 0 :
|
800
|
-
_h.replace('{column}', String(columnDef.header)))),
|
801
|
-
],
|
802
|
-
enablePinning &&
|
803
|
-
column.getCanPin() && [
|
804
|
-
React.createElement(MenuItem, { disabled: column.getIsPinned() === 'left' || !column.getCanPin(), key: 0, onClick: () => handlePinColumn('left'), sx: commonMenuItemStyles },
|
805
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
806
|
-
React.createElement(ListItemIcon, null,
|
807
|
-
React.createElement(PushPinIcon, { style: { transform: 'rotate(90deg)' } })),
|
808
|
-
localization.pinToLeft)),
|
809
|
-
React.createElement(MenuItem, { disabled: column.getIsPinned() === 'right' || !column.getCanPin(), key: 1, onClick: () => handlePinColumn('right'), sx: commonMenuItemStyles },
|
810
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
811
|
-
React.createElement(ListItemIcon, null,
|
812
|
-
React.createElement(PushPinIcon, { style: { transform: 'rotate(-90deg)' } })),
|
813
|
-
localization.pinToRight)),
|
814
|
-
React.createElement(MenuItem, { disabled: !column.getIsPinned(), divider: enableHiding, key: 2, onClick: () => handlePinColumn(false), sx: commonMenuItemStyles },
|
815
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
816
|
-
React.createElement(ListItemIcon, null,
|
817
|
-
React.createElement(PushPinIcon, null)),
|
818
|
-
localization.unpin)),
|
819
|
-
],
|
820
|
-
enableColumnResizing &&
|
821
|
-
column.getCanResize() && [
|
822
|
-
React.createElement(MenuItem, { disabled: !columnSizing[column.id], key: 0, onClick: handleResetColumnSize, sx: commonMenuItemStyles },
|
823
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
824
|
-
React.createElement(ListItemIcon, null,
|
825
|
-
React.createElement(RestartAltIcon, null)),
|
826
|
-
localization.resetColumnSize)),
|
827
|
-
],
|
828
|
-
enableHiding && [
|
829
|
-
React.createElement(MenuItem, { disabled: !column.getCanHide(), key: 0, onClick: handleHideColumn, sx: commonMenuItemStyles },
|
830
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
831
|
-
React.createElement(ListItemIcon, null,
|
832
|
-
React.createElement(VisibilityOffIcon, null)), (_j = localization.hideColumn) === null || _j === void 0 ? void 0 :
|
833
|
-
_j.replace('{column}', String(columnDef.header)))),
|
834
|
-
React.createElement(MenuItem, { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
835
|
-
.length, key: 1, onClick: handleShowAllColumns, sx: commonMenuItemStyles },
|
836
|
-
React.createElement(Box, { sx: commonListItemStyles },
|
837
|
-
React.createElement(ListItemIcon, null,
|
838
|
-
React.createElement(ViewColumnIcon, null)), (_k = localization.showAllColumns) === null || _k === void 0 ? void 0 :
|
839
|
-
_k.replace('{column}', String(columnDef.header)))),
|
840
|
-
]));
|
836
|
+
} }, { children: [(_d = (_c = (_b = columnDef.renderColumnActionsMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
837
|
+
closeMenu: () => setAnchorEl(null),
|
838
|
+
column,
|
839
|
+
table,
|
840
|
+
})) !== null && _c !== void 0 ? _c : renderColumnActionsMenuItems === null || renderColumnActionsMenuItems === void 0 ? void 0 : renderColumnActionsMenuItems({
|
841
|
+
closeMenu: () => setAnchorEl(null),
|
842
|
+
column,
|
843
|
+
table,
|
844
|
+
})) !== null && _d !== void 0 ? _d : (enableSorting &&
|
845
|
+
column.getCanSort() &&
|
846
|
+
[
|
847
|
+
enableSortingRemoval !== false && (jsx(MenuItem, Object.assign({ disabled: !column.getIsSorted(), onClick: handleClearSort, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(ClearAllIcon, {}) }), localization.clearSort] })) }), 0)),
|
848
|
+
jsx(MenuItem, Object.assign({ disabled: column.getIsSorted() === 'asc', onClick: handleSortAsc, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(SortIcon, { style: { transform: 'rotate(180deg) scaleX(-1)' } }) }), (_e = localization.sortByColumnAsc) === null || _e === void 0 ? void 0 : _e.replace('{column}', String(columnDef.header))] })) }), 1),
|
849
|
+
jsx(MenuItem, Object.assign({ divider: enableColumnFilters || enableGrouping || enableHiding, disabled: column.getIsSorted() === 'desc', onClick: handleSortDesc, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(SortIcon, {}) }), (_f = localization.sortByColumnDesc) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))] })) }), 2),
|
850
|
+
].filter(Boolean)), enableColumnFilters &&
|
851
|
+
column.getCanFilter() &&
|
852
|
+
[
|
853
|
+
jsx(MenuItem, Object.assign({ disabled: !column.getFilterValue(), onClick: handleClearFilter, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(FilterListOffIcon, {}) }), localization.clearFilter] })) }), 0),
|
854
|
+
jsxs(MenuItem, Object.assign({ disabled: showColumnFilters && !enableColumnFilterModes, divider: enableGrouping || enableHiding, onClick: showColumnFilters
|
855
|
+
? handleOpenFilterModeMenu
|
856
|
+
: handleFilterByColumn, sx: commonMenuItemStyles }, { children: [jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(FilterListIcon, {}) }), (_g = localization.filterByColumn) === null || _g === void 0 ? void 0 : _g.replace('{column}', String(columnDef.header))] })), showFilterModeSubMenu && (jsx(IconButton, Object.assign({ onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 } }, { children: jsx(ArrowRightIcon, {}) })))] }), 1),
|
857
|
+
showFilterModeSubMenu && (jsx(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table }, 2)),
|
858
|
+
].filter(Boolean), enableGrouping &&
|
859
|
+
column.getCanGroup() && [
|
860
|
+
jsx(MenuItem, Object.assign({ divider: enablePinning, onClick: handleGroupByColumn, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(DynamicFeedIcon, {}) }), (_h = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _h === void 0 ? void 0 : _h.replace('{column}', String(columnDef.header))] })) }), 0),
|
861
|
+
], enablePinning &&
|
862
|
+
column.getCanPin() && [
|
863
|
+
jsx(MenuItem, Object.assign({ disabled: column.getIsPinned() === 'left' || !column.getCanPin(), onClick: () => handlePinColumn('left'), sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(PushPinIcon, { style: { transform: 'rotate(90deg)' } }) }), localization.pinToLeft] })) }), 0),
|
864
|
+
jsx(MenuItem, Object.assign({ disabled: column.getIsPinned() === 'right' || !column.getCanPin(), onClick: () => handlePinColumn('right'), sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(PushPinIcon, { style: { transform: 'rotate(-90deg)' } }) }), localization.pinToRight] })) }), 1),
|
865
|
+
jsx(MenuItem, Object.assign({ disabled: !column.getIsPinned(), divider: enableHiding, onClick: () => handlePinColumn(false), sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(PushPinIcon, {}) }), localization.unpin] })) }), 2),
|
866
|
+
], enableColumnResizing &&
|
867
|
+
column.getCanResize() && [
|
868
|
+
jsx(MenuItem, Object.assign({ disabled: !columnSizing[column.id], onClick: handleResetColumnSize, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(RestartAltIcon, {}) }), localization.resetColumnSize] })) }), 0),
|
869
|
+
], enableHiding && [
|
870
|
+
jsx(MenuItem, Object.assign({ disabled: !column.getCanHide(), onClick: handleHideColumn, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(VisibilityOffIcon, {}) }), (_j = localization.hideColumn) === null || _j === void 0 ? void 0 : _j.replace('{column}', String(columnDef.header))] })) }), 0),
|
871
|
+
jsx(MenuItem, Object.assign({ disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
872
|
+
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(ViewColumnIcon, {}) }), (_k = localization.showAllColumns) === null || _k === void 0 ? void 0 : _k.replace('{column}', String(columnDef.header))] })) }), 1),
|
873
|
+
]] })));
|
841
874
|
};
|
842
875
|
|
843
876
|
const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) => {
|
844
877
|
const { getState, options: { icons: { EditIcon }, enableEditing, localization, renderRowActionMenuItems, }, } = table;
|
845
878
|
const { density } = getState();
|
846
|
-
return (
|
879
|
+
return (jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: !!anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), MenuListProps: {
|
847
880
|
dense: density === 'compact',
|
848
|
-
} },
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
localization.edit))), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 :
|
856
|
-
renderRowActionMenuItems({
|
857
|
-
row,
|
858
|
-
table,
|
859
|
-
closeMenu: () => setAnchorEl(null),
|
860
|
-
})));
|
881
|
+
} }, { children: [enableEditing instanceof Function
|
882
|
+
? enableEditing(row)
|
883
|
+
: enableEditing && (jsx(MenuItem, Object.assign({ onClick: handleEdit, sx: commonMenuItemStyles }, { children: jsxs(Box, Object.assign({ sx: commonListItemStyles }, { children: [jsx(ListItemIcon, { children: jsx(EditIcon, {}) }), localization.edit] })) }))), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 : renderRowActionMenuItems({
|
884
|
+
row,
|
885
|
+
table,
|
886
|
+
closeMenu: () => setAnchorEl(null),
|
887
|
+
})] })));
|
861
888
|
};
|
862
889
|
|
863
890
|
const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
@@ -884,15 +911,7 @@ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
|
884
911
|
values: (_b = editingRow === null || editingRow === void 0 ? void 0 : editingRow._valuesCache) !== null && _b !== void 0 ? _b : Object.assign({}, row.original),
|
885
912
|
});
|
886
913
|
};
|
887
|
-
return (
|
888
|
-
React.createElement(Tooltip, { arrow: true, title: localization.cancel },
|
889
|
-
React.createElement(IconButton, { "aria-label": localization.cancel, onClick: handleCancel },
|
890
|
-
React.createElement(CancelIcon, null))),
|
891
|
-
React.createElement(Tooltip, { arrow: true, title: localization.save },
|
892
|
-
React.createElement(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSave },
|
893
|
-
React.createElement(SaveIcon, null))))) : (React.createElement(React.Fragment, null,
|
894
|
-
React.createElement(Button, { onClick: handleCancel }, localization.cancel),
|
895
|
-
React.createElement(Button, { onClick: handleSave, variant: "contained" }, localization.save)))));
|
914
|
+
return (jsx(Box, Object.assign({ onClick: (e) => e.stopPropagation(), sx: { display: 'flex', gap: '0.75rem' } }, { children: variant === 'icon' ? (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({ arrow: true, title: localization.cancel }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.cancel, onClick: handleCancel }, { children: jsx(CancelIcon, {}) })) })), jsx(Tooltip, Object.assign({ arrow: true, title: localization.save }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.save, color: "info", onClick: handleSave }, { children: jsx(SaveIcon, {}) })) }))] })) : (jsxs(Fragment, { children: [jsx(Button, Object.assign({ onClick: handleCancel }, { children: localization.cancel })), jsx(Button, Object.assign({ onClick: handleSave, variant: "contained" }, { children: localization.save }))] })) })));
|
896
915
|
};
|
897
916
|
|
898
917
|
const commonIconButtonStyles = {
|
@@ -919,16 +938,10 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
|
|
919
938
|
setEditingRow(Object.assign({}, row));
|
920
939
|
setAnchorEl(null);
|
921
940
|
};
|
922
|
-
return (
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
React.createElement(IconButton, { "aria-label": localization.edit, sx: commonIconButtonStyles, onClick: handleStartEditMode },
|
927
|
-
React.createElement(EditIcon, null)))) : renderRowActionMenuItems ? (React.createElement(React.Fragment, null,
|
928
|
-
React.createElement(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions },
|
929
|
-
React.createElement(IconButton, { "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles },
|
930
|
-
React.createElement(MoreHorizIcon, null))),
|
931
|
-
React.createElement(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table }))) : null));
|
941
|
+
return (jsx(Fragment, { children: renderRowActions ? (renderRowActions({ cell, row, table })) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) && editingMode === 'row' ? (jsx(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems &&
|
942
|
+
(enableEditing instanceof Function
|
943
|
+
? enableEditing(row)
|
944
|
+
: enableEditing) ? (jsx(Tooltip, Object.assign({ placement: "right", arrow: true, title: localization.edit }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.edit, sx: commonIconButtonStyles, onClick: handleStartEditMode }, { children: jsx(EditIcon, {}) })) }))) : renderRowActionMenuItems ? (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles }, { children: jsx(MoreHorizIcon, {}) })) })), jsx(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table })] })) : null }));
|
932
945
|
};
|
933
946
|
|
934
947
|
const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
@@ -962,11 +975,11 @@ const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
|
962
975
|
}, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.5rem', width: density === 'compact' ? '1.75rem' : '2.5rem', m: density !== 'compact' ? '-0.4rem' : undefined }, ((checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx) instanceof Function
|
963
976
|
? checkboxProps.sx(theme)
|
964
977
|
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))), title: undefined });
|
965
|
-
return (
|
978
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _a !== void 0 ? _a : (selectAll
|
966
979
|
? localization.toggleSelectAll
|
967
|
-
: localization.toggleSelectRow) }, enableMultiRowSelection === false ? (
|
968
|
-
|
969
|
-
|
980
|
+
: localization.toggleSelectRow) }, { children: enableMultiRowSelection === false ? (jsx(Radio, Object.assign({}, commonProps))) : (jsx(Checkbox, Object.assign({ indeterminate: selectAll
|
981
|
+
? table.getIsSomeRowsSelected() && !allRowsSelected
|
982
|
+
: row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) })));
|
970
983
|
};
|
971
984
|
|
972
985
|
const MRT_GlobalFilterTextField = ({ table, }) => {
|
@@ -1005,24 +1018,15 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
1005
1018
|
}
|
1006
1019
|
isMounted.current = true;
|
1007
1020
|
}, [globalFilter]);
|
1008
|
-
return (
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
React.createElement(IconButton, { "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small" },
|
1018
|
-
React.createElement(CloseIcon, null)))))),
|
1019
|
-
} }, textFieldProps, { inputRef: (inputRef) => {
|
1020
|
-
searchInputRef.current = inputRef;
|
1021
|
-
if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
|
1022
|
-
textFieldProps.inputRef = inputRef;
|
1023
|
-
}
|
1024
|
-
} })),
|
1025
|
-
React.createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table, onSelect: handleClear })));
|
1021
|
+
return (jsxs(Collapse, Object.assign({ in: showGlobalFilter, orientation: "horizontal", unmountOnExit: true, mountOnEnter: true }, { children: [jsx(TextField, Object.assign({ placeholder: localization.search, onChange: handleChange, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard", InputProps: {
|
1022
|
+
startAdornment: enableGlobalFilterModes ? (jsx(InputAdornment, Object.assign({ position: "start" }, { children: jsx(Tooltip, Object.assign({ arrow: true, title: localization.changeSearchMode }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.changeSearchMode, onClick: handleGlobalFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' } }, { children: jsx(SearchIcon, {}) })) })) }))) : (jsx(SearchIcon, { style: { marginRight: '4px' } })),
|
1023
|
+
endAdornment: (jsx(InputAdornment, Object.assign({ position: "end" }, { children: jsx(Tooltip, Object.assign({ arrow: true, title: (_a = localization.clearSearch) !== null && _a !== void 0 ? _a : '' }, { children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small" }, { children: jsx(CloseIcon, {}) })) }) })) }))),
|
1024
|
+
} }, textFieldProps, { inputRef: (inputRef) => {
|
1025
|
+
searchInputRef.current = inputRef;
|
1026
|
+
if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
|
1027
|
+
textFieldProps.inputRef = inputRef;
|
1028
|
+
}
|
1029
|
+
} })), jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table, onSelect: handleClear })] })));
|
1026
1030
|
};
|
1027
1031
|
|
1028
1032
|
const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
|
@@ -1031,13 +1035,12 @@ const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
|
|
1031
1035
|
const linearProgressProps = muiLinearProgressProps instanceof Function
|
1032
1036
|
? muiLinearProgressProps({ isTopToolbar, table })
|
1033
1037
|
: muiLinearProgressProps;
|
1034
|
-
return (
|
1038
|
+
return (jsx(Collapse, Object.assign({ in: isLoading || showProgressBars, mountOnEnter: true, unmountOnExit: true, sx: {
|
1035
1039
|
bottom: isTopToolbar ? 0 : undefined,
|
1036
1040
|
position: 'absolute',
|
1037
1041
|
top: !isTopToolbar ? 0 : undefined,
|
1038
1042
|
width: '100%',
|
1039
|
-
} },
|
1040
|
-
React.createElement(LinearProgress, Object.assign({ "aria-label": "Loading", "aria-busy": "true", sx: { position: 'relative' } }, linearProgressProps))));
|
1043
|
+
} }, { children: jsx(LinearProgress, Object.assign({ "aria-label": "Loading", "aria-busy": "true", sx: { position: 'relative' } }, linearProgressProps)) })));
|
1041
1044
|
};
|
1042
1045
|
|
1043
1046
|
const MRT_TablePagination = ({ table, position = 'bottom', }) => {
|
@@ -1051,7 +1054,7 @@ const MRT_TablePagination = ({ table, position = 'bottom', }) => {
|
|
1051
1054
|
const handleChangeRowsPerPage = (event) => {
|
1052
1055
|
setPageSize(+event.target.value);
|
1053
1056
|
};
|
1054
|
-
return (
|
1057
|
+
return (jsx(TablePagination, Object.assign({ component: "div", count: totalRowCount, getItemAriaLabel: (type) => type === 'first'
|
1055
1058
|
? localization.goToFirstPage
|
1056
1059
|
: type === 'last'
|
1057
1060
|
? localization.goToLastPage
|
@@ -1092,27 +1095,14 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
1092
1095
|
const selectMessage = getSelectedRowModel().rows.length > 0
|
1093
1096
|
? (_b = (_a = localization.selectedCountOfRowCountRowsSelected) === null || _a === void 0 ? void 0 : _a.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) === null || _b === void 0 ? void 0 : _b.replace('{rowCount}', (rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length).toString())
|
1094
1097
|
: null;
|
1095
|
-
const groupedByMessage = grouping.length > 0 ? (
|
1096
|
-
|
1097
|
-
' ',
|
1098
|
-
grouping.map((columnId, index) => (React.createElement(Fragment, { key: `${index}-${columnId}` },
|
1099
|
-
index > 0 ? localization.thenBy : '',
|
1100
|
-
React.createElement(Chip, Object.assign({ label: table.getColumn(columnId).columnDef.header, onDelete: () => table.getColumn(columnId).toggleGrouping() }, chipProps))))))) : null;
|
1101
|
-
return (React.createElement(Collapse, { in: showAlertBanner || !!selectMessage || !!groupedByMessage, timeout: stackAlertBanner ? 200 : 0 },
|
1102
|
-
React.createElement(Alert, Object.assign({ color: "info", icon: false }, alertProps, { sx: (theme) => (Object.assign({ borderRadius: 0, fontSize: '1rem', left: 0, p: 0, position: 'relative', mb: stackAlertBanner
|
1098
|
+
const groupedByMessage = grouping.length > 0 ? (jsxs("span", { children: [localization.groupedBy, ' ', grouping.map((columnId, index) => (jsxs(Fragment$1, { children: [index > 0 ? localization.thenBy : '', jsx(Chip, Object.assign({ label: table.getColumn(columnId).columnDef.header, onDelete: () => table.getColumn(columnId).toggleGrouping() }, chipProps))] }, `${index}-${columnId}`)))] })) : null;
|
1099
|
+
return (jsx(Collapse, Object.assign({ in: showAlertBanner || !!selectMessage || !!groupedByMessage, timeout: stackAlertBanner ? 200 : 0 }, { children: jsxs(Alert, Object.assign({ color: "info", icon: false }, alertProps, { sx: (theme) => (Object.assign({ borderRadius: 0, fontSize: '1rem', left: 0, p: 0, position: 'relative', mb: stackAlertBanner
|
1103
1100
|
? 0
|
1104
1101
|
: positionToolbarAlertBanner === 'bottom'
|
1105
1102
|
? '-1rem'
|
1106
1103
|
: undefined, right: 0, top: 0, width: '100%', zIndex: 2 }, ((alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx) instanceof Function
|
1107
1104
|
? alertProps.sx(theme)
|
1108
|
-
: alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx))) }),
|
1109
|
-
(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && React.createElement(AlertTitle, null, alertProps.title),
|
1110
|
-
React.createElement(Box, { sx: { p: '0.5rem 1rem' } }, alertProps === null || alertProps === void 0 ? void 0 :
|
1111
|
-
alertProps.children,
|
1112
|
-
(alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectMessage || groupedByMessage) && (React.createElement("br", null)),
|
1113
|
-
selectMessage,
|
1114
|
-
selectMessage && groupedByMessage && React.createElement("br", null),
|
1115
|
-
groupedByMessage))));
|
1105
|
+
: alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx))) }, { children: [(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && jsx(AlertTitle, { children: alertProps.title }), jsxs(Box, Object.assign({ sx: { p: '0.5rem 1rem' } }, { children: [alertProps === null || alertProps === void 0 ? void 0 : alertProps.children, (alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectMessage || groupedByMessage) && (jsx("br", {})), selectMessage, selectMessage && groupedByMessage && jsx("br", {}), groupedByMessage] }))] })) })));
|
1116
1106
|
};
|
1117
1107
|
|
1118
1108
|
const MRT_FullScreenToggleButton = (_a) => {
|
@@ -1123,8 +1113,7 @@ const MRT_FullScreenToggleButton = (_a) => {
|
|
1123
1113
|
const handleToggleFullScreen = () => {
|
1124
1114
|
setIsFullScreen(!isFullScreen);
|
1125
1115
|
};
|
1126
|
-
return (
|
1127
|
-
React.createElement(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleFullScreen }, rest, { title: undefined }), isFullScreen ? React.createElement(FullscreenExitIcon, null) : React.createElement(FullscreenIcon, null))));
|
1116
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleFullScreen }, rest, { title: undefined }, { children: isFullScreen ? jsx(FullscreenExitIcon, {}) : jsx(FullscreenIcon, {}) })) })));
|
1128
1117
|
};
|
1129
1118
|
|
1130
1119
|
const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
@@ -1132,26 +1121,17 @@ const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
|
1132
1121
|
const handlePinColumn = (pinDirection) => {
|
1133
1122
|
column.pin(pinDirection);
|
1134
1123
|
};
|
1135
|
-
return (
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
React.createElement(PushPinIcon, { style: {
|
1141
|
-
transform: 'rotate(90deg)',
|
1142
|
-
} }))),
|
1143
|
-
React.createElement(Tooltip, { arrow: true, title: localization.pinToRight },
|
1144
|
-
React.createElement(IconButton, { onClick: () => handlePinColumn('right'), size: "small" },
|
1145
|
-
React.createElement(PushPinIcon, { style: {
|
1146
|
-
transform: 'rotate(-90deg)',
|
1147
|
-
} })))))));
|
1124
|
+
return (jsx(Box, Object.assign({ sx: { minWidth: '70px', textAlign: 'center' } }, { children: column.getIsPinned() ? (jsx(Tooltip, Object.assign({ arrow: true, title: localization.unpin }, { children: jsx(IconButton, Object.assign({ onClick: () => handlePinColumn(false), size: "small" }, { children: jsx(PushPinIcon, {}) })) }))) : (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({ arrow: true, title: localization.pinToLeft }, { children: jsx(IconButton, Object.assign({ onClick: () => handlePinColumn('left'), size: "small" }, { children: jsx(PushPinIcon, { style: {
|
1125
|
+
transform: 'rotate(90deg)',
|
1126
|
+
} }) })) })), jsx(Tooltip, Object.assign({ arrow: true, title: localization.pinToRight }, { children: jsx(IconButton, Object.assign({ onClick: () => handlePinColumn('right'), size: "small" }, { children: jsx(PushPinIcon, { style: {
|
1127
|
+
transform: 'rotate(-90deg)',
|
1128
|
+
} }) })) }))] })) })));
|
1148
1129
|
};
|
1149
1130
|
|
1150
1131
|
const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table, }) => {
|
1151
1132
|
var _a;
|
1152
1133
|
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
1153
|
-
return (
|
1154
|
-
React.createElement(IconButton, Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
|
1134
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.move }, { children: jsx(IconButton, Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
|
1155
1135
|
var _a;
|
1156
1136
|
e.stopPropagation();
|
1157
1137
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, e);
|
@@ -1162,8 +1142,7 @@ const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table,
|
|
1162
1142
|
cursor: 'grabbing',
|
1163
1143
|
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
1164
1144
|
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
1165
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined })
|
1166
|
-
React.createElement(DragHandleIcon, null))));
|
1145
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }, { children: jsx(DragHandleIcon, {}) })) })));
|
1167
1146
|
};
|
1168
1147
|
|
1169
1148
|
const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredColumn, column, table, }) => {
|
@@ -1204,42 +1183,35 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
1204
1183
|
setHoveredColumn(column);
|
1205
1184
|
}
|
1206
1185
|
};
|
1207
|
-
return (
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
sx: {
|
1236
|
-
mb: 0,
|
1237
|
-
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
1238
|
-
},
|
1239
|
-
},
|
1240
|
-
}, checked: switchChecked, control: React.createElement(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.toggleVisibility },
|
1241
|
-
React.createElement(Switch, null)), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (React.createElement(Typography, { sx: { alignSelf: 'center' } }, columnDef.header)))), (_a = column.columns) === null || _a === void 0 ? void 0 :
|
1242
|
-
_a.map((c, i) => (React.createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, key: `${i}-${c.id}`, setHoveredColumn: setHoveredColumn, table: table })))));
|
1186
|
+
return (jsxs(Fragment, { children: [jsx(MenuItem, Object.assign({ disableRipple: true, ref: menuItemRef, onDragEnter: handleDragEnter, sx: (theme) => ({
|
1187
|
+
alignItems: 'center',
|
1188
|
+
justifyContent: 'flex-start',
|
1189
|
+
my: 0,
|
1190
|
+
opacity: isDragging ? 0.5 : 1,
|
1191
|
+
outlineOffset: '-2px',
|
1192
|
+
outline: isDragging
|
1193
|
+
? `2px dashed ${theme.palette.divider}`
|
1194
|
+
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
1195
|
+
? `2px dashed ${theme.palette.primary.main}`
|
1196
|
+
: 'none',
|
1197
|
+
pl: `${(column.depth + 0.5) * 2}rem`,
|
1198
|
+
py: '6px',
|
1199
|
+
}) }, { children: jsxs(Box, Object.assign({ sx: {
|
1200
|
+
display: 'flex',
|
1201
|
+
flexWrap: 'nowrap',
|
1202
|
+
gap: '8px',
|
1203
|
+
} }, { children: [columnDefType !== 'group' &&
|
1204
|
+
enableColumnOrdering &&
|
1205
|
+
!allColumns.some((col) => col.columnDef.columnDefType === 'group') &&
|
1206
|
+
(columnDef.enableColumnOrdering !== false ? (jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsx(Box, { sx: { width: '28px' } }))), enablePinning &&
|
1207
|
+
(column.getCanPin() ? (jsx(MRT_ColumnPinningButtons, { column: column, table: table })) : (jsx(Box, { sx: { width: '70px' } }))), enableHiding ? (jsx(FormControlLabel, { componentsProps: {
|
1208
|
+
typography: {
|
1209
|
+
sx: {
|
1210
|
+
mb: 0,
|
1211
|
+
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
1212
|
+
},
|
1213
|
+
},
|
1214
|
+
}, checked: switchChecked, control: jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.toggleVisibility }, { children: jsx(Switch, {}) })), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (jsx(Typography, Object.assign({ sx: { alignSelf: 'center' } }, { children: columnDef.header })))] })) })), (_a = column.columns) === null || _a === void 0 ? void 0 : _a.map((c, i) => (jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
|
1243
1215
|
};
|
1244
1216
|
|
1245
1217
|
const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
|
@@ -1270,21 +1242,14 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
|
|
1270
1242
|
getRightLeafColumns(),
|
1271
1243
|
]);
|
1272
1244
|
const [hoveredColumn, setHoveredColumn] = useState(null);
|
1273
|
-
return (
|
1245
|
+
return (jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
1274
1246
|
dense: density === 'compact',
|
1275
|
-
} },
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
} },
|
1282
|
-
enableHiding && (React.createElement(Button, { disabled: !getIsSomeColumnsVisible(), onClick: hideAllColumns }, localization.hideAll)),
|
1283
|
-
enableColumnOrdering && (React.createElement(Button, { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options)) }, localization.resetOrder)),
|
1284
|
-
enablePinning && (React.createElement(Button, { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true) }, localization.unpinAll)),
|
1285
|
-
enableHiding && (React.createElement(Button, { disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true) }, localization.showAll))),
|
1286
|
-
React.createElement(Divider, null),
|
1287
|
-
allColumns.map((column, index) => (React.createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, key: `${index}-${column.id}`, setHoveredColumn: setHoveredColumn, table: table })))));
|
1247
|
+
} }, { children: [jsxs(Box, Object.assign({ sx: {
|
1248
|
+
display: 'flex',
|
1249
|
+
justifyContent: 'space-between',
|
1250
|
+
p: '0.5rem',
|
1251
|
+
pt: 0,
|
1252
|
+
} }, { children: [enableHiding && (jsx(Button, Object.assign({ disabled: !getIsSomeColumnsVisible(), onClick: hideAllColumns }, { children: localization.hideAll }))), enableColumnOrdering && (jsx(Button, Object.assign({ onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options)) }, { children: localization.resetOrder }))), enablePinning && (jsx(Button, Object.assign({ disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true) }, { children: localization.unpinAll }))), enableHiding && (jsx(Button, Object.assign({ disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true) }, { children: localization.showAll })))] })), jsx(Divider, {}), allColumns.map((column, index) => (jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${index}-${column.id}`)))] })));
|
1288
1253
|
};
|
1289
1254
|
|
1290
1255
|
const MRT_ShowHideColumnsButton = (_a) => {
|
@@ -1295,11 +1260,7 @@ const MRT_ShowHideColumnsButton = (_a) => {
|
|
1295
1260
|
const handleClick = (event) => {
|
1296
1261
|
setAnchorEl(event.currentTarget);
|
1297
1262
|
};
|
1298
|
-
return (
|
1299
|
-
React.createElement(Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns },
|
1300
|
-
React.createElement(IconButton, Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined }),
|
1301
|
-
React.createElement(ViewColumnIcon, null))),
|
1302
|
-
anchorEl && (React.createElement(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))));
|
1263
|
+
return (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({ arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined }, { children: jsx(ViewColumnIcon, {}) })) })), anchorEl && (jsx(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))] }));
|
1303
1264
|
};
|
1304
1265
|
|
1305
1266
|
const MRT_ToggleDensePaddingButton = (_a) => {
|
@@ -1315,8 +1276,7 @@ const MRT_ToggleDensePaddingButton = (_a) => {
|
|
1315
1276
|
: 'comfortable';
|
1316
1277
|
setDensity(nextDensity);
|
1317
1278
|
};
|
1318
|
-
return (
|
1319
|
-
React.createElement(IconButton, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined }), density === 'compact' ? (React.createElement(DensitySmallIcon, null)) : density === 'comfortable' ? (React.createElement(DensityMediumIcon, null)) : (React.createElement(DensityLargeIcon, null)))));
|
1279
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined }, { children: density === 'compact' ? (jsx(DensitySmallIcon, {})) : density === 'comfortable' ? (jsx(DensityMediumIcon, {})) : (jsx(DensityLargeIcon, {})) })) })));
|
1320
1280
|
};
|
1321
1281
|
|
1322
1282
|
const MRT_ToggleFiltersButton = (_a) => {
|
@@ -1327,8 +1287,7 @@ const MRT_ToggleFiltersButton = (_a) => {
|
|
1327
1287
|
const handleToggleShowFilters = () => {
|
1328
1288
|
setShowColumnFilters(!showColumnFilters);
|
1329
1289
|
};
|
1330
|
-
return (
|
1331
|
-
React.createElement(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined }), showColumnFilters ? React.createElement(FilterListOffIcon, null) : React.createElement(FilterListIcon, null))));
|
1290
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined }, { children: showColumnFilters ? jsx(FilterListOffIcon, {}) : jsx(FilterListIcon, {}) })) })));
|
1332
1291
|
};
|
1333
1292
|
|
1334
1293
|
const MRT_ToggleGlobalFilterButton = (_a) => {
|
@@ -1340,27 +1299,21 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
1340
1299
|
setShowGlobalFilter(!showGlobalFilter);
|
1341
1300
|
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
1342
1301
|
};
|
1343
|
-
return (
|
1344
|
-
React.createElement(IconButton, Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter, onClick: handleToggleSearch }, rest, { title: undefined }), showGlobalFilter ? React.createElement(SearchOffIcon, null) : React.createElement(SearchIcon, null))));
|
1302
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch }, { children: jsx(IconButton, Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter, onClick: handleToggleSearch }, rest, { title: undefined }, { children: showGlobalFilter ? jsx(SearchOffIcon, {}) : jsx(SearchIcon, {}) })) })));
|
1345
1303
|
};
|
1346
1304
|
|
1347
1305
|
const MRT_ToolbarInternalButtons = ({ table, }) => {
|
1348
1306
|
var _a;
|
1349
1307
|
const { options: { enableColumnFilters, enableColumnOrdering, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, enablePinning, initialState, renderToolbarInternalActions, }, } = table;
|
1350
|
-
return (
|
1308
|
+
return (jsx(Box, Object.assign({ sx: {
|
1351
1309
|
alignItems: 'center',
|
1352
1310
|
display: 'flex',
|
1353
1311
|
zIndex: 3,
|
1354
|
-
} }, (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (React.createElement(MRT_ToggleGlobalFilterButton, { table: table })),
|
1360
|
-
enableFilters && enableColumnFilters && (React.createElement(MRT_ToggleFiltersButton, { table: table })),
|
1361
|
-
(enableHiding || enableColumnOrdering || enablePinning) && (React.createElement(MRT_ShowHideColumnsButton, { table: table })),
|
1362
|
-
enableDensityToggle && (React.createElement(MRT_ToggleDensePaddingButton, { table: table })),
|
1363
|
-
enableFullScreenToggle && (React.createElement(MRT_FullScreenToggleButton, { table: table }))))));
|
1312
|
+
} }, { children: (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
1313
|
+
table,
|
1314
|
+
})) !== null && _a !== void 0 ? _a : (jsxs(Fragment, { children: [enableFilters &&
|
1315
|
+
enableGlobalFilter &&
|
1316
|
+
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters && enableColumnFilters && (jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enablePinning) && (jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsx(MRT_FullScreenToggleButton, { table: table }))] })) })));
|
1364
1317
|
};
|
1365
1318
|
|
1366
1319
|
const MRT_ToolbarDropZone = ({ table, }) => {
|
@@ -1379,8 +1332,7 @@ const MRT_ToolbarDropZone = ({ table, }) => {
|
|
1379
1332
|
!grouping.includes(draggingColumn.id));
|
1380
1333
|
}
|
1381
1334
|
}, [enableGrouping, draggingColumn, grouping]);
|
1382
|
-
return (
|
1383
|
-
React.createElement(Box, { className: "Mui-ToolbarDropZone", sx: (theme) => ({
|
1335
|
+
return (jsx(Fade, Object.assign({ in: showToolbarDropZone }, { children: jsx(Box, Object.assign({ className: "Mui-ToolbarDropZone", sx: (theme) => ({
|
1384
1336
|
alignItems: 'center',
|
1385
1337
|
backgroundColor: alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
|
1386
1338
|
backdropFilter: 'blur(4px)',
|
@@ -1392,8 +1344,7 @@ const MRT_ToolbarDropZone = ({ table, }) => {
|
|
1392
1344
|
position: 'absolute',
|
1393
1345
|
width: '100%',
|
1394
1346
|
zIndex: 4,
|
1395
|
-
}), onDragEnter: handleDragEnter },
|
1396
|
-
React.createElement(Typography, { fontStyle: "italic" }, localization.dropToGroupBy.replace('{column}', (_b = (_a = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _a === void 0 ? void 0 : _a.header) !== null && _b !== void 0 ? _b : '')))));
|
1347
|
+
}), onDragEnter: handleDragEnter }, { children: jsx(Typography, Object.assign({ fontStyle: "italic" }, { children: localization.dropToGroupBy.replace('{column}', (_b = (_a = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _a === void 0 ? void 0 : _a.header) !== null && _b !== void 0 ? _b : '') })) })) })));
|
1397
1348
|
};
|
1398
1349
|
|
1399
1350
|
const commonToolbarStyles = ({ theme }) => ({
|
@@ -1417,7 +1368,7 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
1417
1368
|
? muiTopToolbarProps({ table })
|
1418
1369
|
: muiTopToolbarProps;
|
1419
1370
|
const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
1420
|
-
return (
|
1371
|
+
return (jsxs(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (ref) => {
|
1421
1372
|
topToolbarRef.current = ref;
|
1422
1373
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
1423
1374
|
// @ts-ignore
|
@@ -1425,32 +1376,23 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
1425
1376
|
}
|
1426
1377
|
}, sx: (theme) => (Object.assign(Object.assign({ position: isFullScreen ? 'sticky' : undefined, top: isFullScreen ? '0' : undefined }, commonToolbarStyles({ theme })), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
1427
1378
|
? toolbarProps.sx(theme)
|
1428
|
-
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }),
|
1429
|
-
|
1430
|
-
|
1431
|
-
React.createElement(Box, { sx: {
|
1432
|
-
alignItems: 'flex-start',
|
1433
|
-
boxSizing: 'border-box',
|
1434
|
-
display: 'flex',
|
1435
|
-
justifyContent: 'space-between',
|
1436
|
-
p: '0.5rem',
|
1437
|
-
position: stackAlertBanner ? 'relative' : 'absolute',
|
1438
|
-
right: 0,
|
1439
|
-
top: 0,
|
1440
|
-
width: '100%',
|
1441
|
-
} },
|
1442
|
-
enableGlobalFilter && positionGlobalFilter === 'left' && (React.createElement(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : React.createElement("span", null),
|
1443
|
-
enableToolbarInternalActions ? (React.createElement(Box, { sx: {
|
1379
|
+
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }, { children: [positionToolbarAlertBanner === 'top' && (jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'top'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsx(MRT_ToolbarDropZone, { table: table })), jsxs(Box, Object.assign({ sx: {
|
1380
|
+
alignItems: 'flex-start',
|
1381
|
+
boxSizing: 'border-box',
|
1444
1382
|
display: 'flex',
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1383
|
+
justifyContent: 'space-between',
|
1384
|
+
p: '0.5rem',
|
1385
|
+
position: stackAlertBanner ? 'relative' : 'absolute',
|
1386
|
+
right: 0,
|
1387
|
+
top: 0,
|
1388
|
+
width: '100%',
|
1389
|
+
} }, { children: [enableGlobalFilter && positionGlobalFilter === 'left' && (jsx(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : jsx("span", {}), enableToolbarInternalActions ? (jsxs(Box, Object.assign({ sx: {
|
1390
|
+
display: 'flex',
|
1391
|
+
flexWrap: 'wrap-reverse',
|
1392
|
+
justifyContent: 'flex-end',
|
1393
|
+
} }, { children: [enableGlobalFilter && positionGlobalFilter === 'right' && (jsx(MRT_GlobalFilterTextField, { table: table })), jsx(MRT_ToolbarInternalButtons, { table: table })] }))) : (enableGlobalFilter &&
|
1394
|
+
positionGlobalFilter === 'right' && (jsx(MRT_GlobalFilterTextField, { table: table })))] })), enablePagination &&
|
1395
|
+
['top', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsx(MRT_TablePagination, { table: table, position: "top" })), jsx(MRT_LinearProgressBar, { isTopToolbar: true, table: table })] })));
|
1454
1396
|
};
|
1455
1397
|
|
1456
1398
|
const MRT_BottomToolbar = ({ table, }) => {
|
@@ -1461,7 +1403,7 @@ const MRT_BottomToolbar = ({ table, }) => {
|
|
1461
1403
|
? muiBottomToolbarProps({ table })
|
1462
1404
|
: muiBottomToolbarProps;
|
1463
1405
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
1464
|
-
return (
|
1406
|
+
return (jsxs(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (node) => {
|
1465
1407
|
if (node) {
|
1466
1408
|
bottomToolbarRef.current = node;
|
1467
1409
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
@@ -1471,27 +1413,21 @@ const MRT_BottomToolbar = ({ table, }) => {
|
|
1471
1413
|
}
|
1472
1414
|
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, commonToolbarStyles({ theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${alpha(theme.palette.common.black, 0.1)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
1473
1415
|
? toolbarProps.sx(theme)
|
1474
|
-
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }),
|
1475
|
-
|
1476
|
-
|
1477
|
-
['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (React.createElement(MRT_ToolbarDropZone, { table: table })),
|
1478
|
-
React.createElement(Box, { sx: {
|
1479
|
-
alignItems: 'center',
|
1480
|
-
boxSizing: 'border-box',
|
1481
|
-
display: 'flex',
|
1482
|
-
justifyContent: 'space-between',
|
1483
|
-
p: '0.5rem',
|
1484
|
-
width: '100%',
|
1485
|
-
} },
|
1486
|
-
renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (React.createElement("span", null)),
|
1487
|
-
React.createElement(Box, { sx: {
|
1416
|
+
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }, { children: [jsx(MRT_LinearProgressBar, { isTopToolbar: false, table: table }), positionToolbarAlertBanner === 'bottom' && (jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsx(MRT_ToolbarDropZone, { table: table })), jsxs(Box, Object.assign({ sx: {
|
1417
|
+
alignItems: 'center',
|
1418
|
+
boxSizing: 'border-box',
|
1488
1419
|
display: 'flex',
|
1489
|
-
justifyContent: '
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1420
|
+
justifyContent: 'space-between',
|
1421
|
+
p: '0.5rem',
|
1422
|
+
width: '100%',
|
1423
|
+
} }, { children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsx("span", {})), jsx(Box, Object.assign({ sx: {
|
1424
|
+
display: 'flex',
|
1425
|
+
justifyContent: 'flex-end',
|
1426
|
+
position: stackAlertBanner ? 'relative' : 'absolute',
|
1427
|
+
right: 0,
|
1428
|
+
top: 0,
|
1429
|
+
} }, { children: enablePagination &&
|
1430
|
+
['bottom', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsx(MRT_TablePagination, { table: table, position: "bottom" })) }))] }))] })));
|
1495
1431
|
};
|
1496
1432
|
|
1497
1433
|
const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
@@ -1515,15 +1451,11 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
1515
1451
|
})
|
1516
1452
|
: columnDef.muiTableHeadCellColumnActionsButtonProps;
|
1517
1453
|
const iconButtonProps = Object.assign(Object.assign({}, mTableHeadCellColumnActionsButtonProps), mcTableHeadCellColumnActionsButtonProps);
|
1518
|
-
return (
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
? iconButtonProps.sx(theme)
|
1524
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
1525
|
-
React.createElement(MoreVertIcon, null))),
|
1526
|
-
anchorEl && (React.createElement(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))));
|
1454
|
+
return (jsxs(Fragment, { children: [jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.columnActions }, { children: jsx(IconButton, Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ height: '2rem', m: '-8px -4px', opacity: 0.5, transform: 'scale(0.85) translateX(-4px)', transition: 'opacity 150ms', width: '2rem', '&:hover': {
|
1455
|
+
opacity: 1,
|
1456
|
+
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
1457
|
+
? iconButtonProps.sx(theme)
|
1458
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }, { children: jsx(MoreVertIcon, {}) })) })), anchorEl && (jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
|
1527
1459
|
};
|
1528
1460
|
|
1529
1461
|
const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
@@ -1646,100 +1578,83 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
1646
1578
|
isMounted.current = true;
|
1647
1579
|
}, [column.getFilterValue()]);
|
1648
1580
|
if (columnDef.Filter) {
|
1649
|
-
return (
|
1581
|
+
return (jsx(Fragment, { children: (_f = columnDef.Filter) === null || _f === void 0 ? void 0 : _f.call(columnDef, { column, header, rangeFilterIndex, table }) }));
|
1650
1582
|
}
|
1651
|
-
return (
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
},
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1583
|
+
return (jsxs(Fragment, { children: [jsxs(TextField, Object.assign({ fullWidth: true, inputProps: {
|
1584
|
+
disabled: !!filterChipLabel,
|
1585
|
+
sx: {
|
1586
|
+
textOverflow: 'ellipsis',
|
1587
|
+
width: filterChipLabel ? 0 : undefined,
|
1588
|
+
},
|
1589
|
+
title: filterPlaceholder,
|
1590
|
+
}, helperText: showChangeModeButton ? (jsx("label", { children: localization.filterMode.replace('{filterType}',
|
1591
|
+
// @ts-ignore
|
1592
|
+
localization[`filter${((_g = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _g === void 0 ? void 0 : _g.toUpperCase()) +
|
1593
|
+
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null, FormHelperTextProps: {
|
1594
|
+
sx: {
|
1595
|
+
fontSize: '0.75rem',
|
1596
|
+
lineHeight: '0.8rem',
|
1597
|
+
whiteSpace: 'nowrap',
|
1598
|
+
},
|
1599
|
+
}, margin: "none", placeholder: filterChipLabel || isSelectFilter || isMultiSelectFilter
|
1600
|
+
? undefined
|
1601
|
+
: filterPlaceholder, onChange: handleChange, onClick: (e) => e.stopPropagation(), select: isSelectFilter || isMultiSelectFilter, value: filterValue !== null && filterValue !== void 0 ? filterValue : '', variant: "standard", InputProps: {
|
1602
|
+
startAdornment: showChangeModeButton ? (jsxs(InputAdornment, Object.assign({ position: "start" }, { children: [jsx(Tooltip, Object.assign({ arrow: true, title: localization.changeFilterMode }, { children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.changeFilterMode, onClick: handleFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' } }, { children: jsx(FilterListIcon, {}) })) }) })), filterChipLabel && (jsx(Chip, { onDelete: handleClearEmptyFilterChip, label: filterChipLabel }))] }))) : null,
|
1603
|
+
endAdornment: !filterChipLabel && (jsx(InputAdornment, Object.assign({ position: "end" }, { children: jsx(Tooltip, Object.assign({ arrow: true, placement: "right", title: (_h = localization.clearFilter) !== null && _h !== void 0 ? _h : '' }, { children: jsx("span", { children: jsx(IconButton, Object.assign({ "aria-label": localization.clearFilter, disabled: !((_j = filterValue === null || filterValue === void 0 ? void 0 : filterValue.toString()) === null || _j === void 0 ? void 0 : _j.length), onClick: handleClear, size: "small", sx: {
|
1604
|
+
height: '1.75rem',
|
1605
|
+
width: '1.75rem',
|
1606
|
+
} }, { children: jsx(CloseIcon, {}) })) }) })) }))),
|
1607
|
+
}, SelectProps: {
|
1608
|
+
displayEmpty: true,
|
1609
|
+
multiple: isMultiSelectFilter,
|
1610
|
+
renderValue: isMultiSelectFilter
|
1611
|
+
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsx(Box, Object.assign({ sx: { opacity: 0.5 } }, { children: filterPlaceholder }))) : (jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' } }, { children: selected === null || selected === void 0 ? void 0 : selected.map((value) => {
|
1612
|
+
var _a;
|
1613
|
+
const selectedValue = (_a = columnDef.filterSelectOptions) === null || _a === void 0 ? void 0 : _a.find((option) => option instanceof Object
|
1614
|
+
? option.value === value
|
1615
|
+
: option === value);
|
1616
|
+
return (jsx(Chip, { label: selectedValue instanceof Object
|
1617
|
+
? selectedValue.text
|
1618
|
+
: selectedValue }, value));
|
1619
|
+
}) })))
|
1620
|
+
: undefined,
|
1621
|
+
} }, textFieldProps, { inputRef: (inputRef) => {
|
1622
|
+
filterInputRefs.current[`${column.id}-${rangeFilterIndex !== null && rangeFilterIndex !== void 0 ? rangeFilterIndex : 0}`] =
|
1623
|
+
inputRef;
|
1624
|
+
if (textFieldProps.inputRef) {
|
1625
|
+
textFieldProps.inputRef = inputRef;
|
1626
|
+
}
|
1627
|
+
}, sx: (theme) => (Object.assign({ p: 0, minWidth: isRangeFilter
|
1628
|
+
? '100px'
|
1629
|
+
: !filterChipLabel
|
1630
|
+
? '120px'
|
1631
|
+
: 'auto', width: 'calc(100% + 4px)', mx: '-2px', '& .MuiSelect-icon': {
|
1632
|
+
mr: '1.5rem',
|
1633
|
+
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
1634
|
+
? textFieldProps.sx(theme)
|
1635
|
+
: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx))) }, { children: [(isSelectFilter || isMultiSelectFilter) && (jsx(MenuItem, Object.assign({ divider: true, disabled: true, hidden: true, value: "" }, { children: jsx(Box, Object.assign({ sx: { opacity: 0.5 } }, { children: filterPlaceholder })) }))), (_k = textFieldProps.children) !== null && _k !== void 0 ? _k : (_l = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _l === void 0 ? void 0 : _l.map((option) => {
|
1690
1636
|
var _a;
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
:
|
1708
|
-
? '120px'
|
1709
|
-
: 'auto', width: 'calc(100% + 4px)', mx: '-2px', '& .MuiSelect-icon': {
|
1710
|
-
mr: '1.5rem',
|
1711
|
-
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
1712
|
-
? textFieldProps.sx(theme)
|
1713
|
-
: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx))) }),
|
1714
|
-
(isSelectFilter || isMultiSelectFilter) && (React.createElement(MenuItem, { divider: true, disabled: true, hidden: true, value: "" },
|
1715
|
-
React.createElement(Box, { sx: { opacity: 0.5 } }, filterPlaceholder))), (_k = textFieldProps.children) !== null && _k !== void 0 ? _k : (_l = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _l === void 0 ? void 0 : _l.map((option) => {
|
1716
|
-
var _a;
|
1717
|
-
let value;
|
1718
|
-
let text;
|
1719
|
-
if (typeof option !== 'object') {
|
1720
|
-
value = option;
|
1721
|
-
text = option;
|
1722
|
-
}
|
1723
|
-
else {
|
1724
|
-
value = option.value;
|
1725
|
-
text = option.text;
|
1726
|
-
}
|
1727
|
-
return (React.createElement(MenuItem, { key: value, sx: {
|
1728
|
-
display: 'flex',
|
1729
|
-
m: 0,
|
1730
|
-
alignItems: 'center',
|
1731
|
-
gap: '0.5rem',
|
1732
|
-
}, value: value },
|
1733
|
-
isMultiSelectFilter && (React.createElement(Checkbox, { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })),
|
1734
|
-
text));
|
1735
|
-
})),
|
1736
|
-
React.createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table, setFilterValue: setFilterValue })));
|
1637
|
+
let value;
|
1638
|
+
let text;
|
1639
|
+
if (typeof option !== 'object') {
|
1640
|
+
value = option;
|
1641
|
+
text = option;
|
1642
|
+
}
|
1643
|
+
else {
|
1644
|
+
value = option.value;
|
1645
|
+
text = option.text;
|
1646
|
+
}
|
1647
|
+
return (jsxs(MenuItem, Object.assign({ sx: {
|
1648
|
+
display: 'flex',
|
1649
|
+
m: 0,
|
1650
|
+
alignItems: 'center',
|
1651
|
+
gap: '0.5rem',
|
1652
|
+
}, value: value }, { children: [isMultiSelectFilter && (jsx(Checkbox, { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })), text] }), value));
|
1653
|
+
})] })), jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table, setFilterValue: setFilterValue })] }));
|
1737
1654
|
};
|
1738
1655
|
|
1739
1656
|
const MRT_FilterRangeFields = ({ header, table }) => {
|
1740
|
-
return (
|
1741
|
-
React.createElement(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }),
|
1742
|
-
React.createElement(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })));
|
1657
|
+
return (jsxs(Box, Object.assign({ sx: { display: 'grid', gridTemplateColumns: '6fr 6fr', gap: '1rem' } }, { children: [jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }), jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })] })));
|
1743
1658
|
};
|
1744
1659
|
|
1745
1660
|
const MRT_FilterCheckbox = ({ column, table }) => {
|
@@ -1761,8 +1676,7 @@ const MRT_FilterCheckbox = ({ column, table }) => {
|
|
1761
1676
|
: columnDef.muiTableHeadCellFilterCheckboxProps;
|
1762
1677
|
const checkboxProps = Object.assign(Object.assign({}, mTableHeadCellFilterCheckboxProps), mcTableHeadCellFilterCheckboxProps);
|
1763
1678
|
const filterLabel = (_a = localization.filterByColumn) === null || _a === void 0 ? void 0 : _a.replace('{column}', columnDef.header);
|
1764
|
-
return (
|
1765
|
-
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, Object.assign({ checked: column.getFilterValue() === 'true', indeterminate: column.getFilterValue() === undefined, color: column.getFilterValue() === undefined ? 'default' : 'primary', size: density === 'compact' ? 'small' : 'medium' }, checkboxProps, { onClick: (e) => {
|
1679
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : filterLabel }, { children: jsx(FormControlLabel, { control: jsx(Checkbox, Object.assign({ checked: column.getFilterValue() === 'true', indeterminate: column.getFilterValue() === undefined, color: column.getFilterValue() === undefined ? 'default' : 'primary', size: density === 'compact' ? 'small' : 'medium' }, checkboxProps, { onClick: (e) => {
|
1766
1680
|
var _a;
|
1767
1681
|
e.stopPropagation();
|
1768
1682
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
@@ -1776,7 +1690,7 @@ const MRT_FilterCheckbox = ({ column, table }) => {
|
|
1776
1690
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onChange) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e, checked);
|
1777
1691
|
}, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, ((checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx) instanceof Function
|
1778
1692
|
? checkboxProps.sx(theme)
|
1779
|
-
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))) })), disableTypography: true, label: (_c = checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, sx: { color: 'text.secondary', mt: '-4px', fontWeight: 'normal' }, title: undefined })));
|
1693
|
+
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))) })), disableTypography: true, label: (_c = checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, sx: { color: 'text.secondary', mt: '-4px', fontWeight: 'normal' }, title: undefined }) })));
|
1780
1694
|
};
|
1781
1695
|
|
1782
1696
|
const MRT_TableHeadCellFilterContainer = ({ header, table }) => {
|
@@ -1784,8 +1698,8 @@ const MRT_TableHeadCellFilterContainer = ({ header, table }) => {
|
|
1784
1698
|
const { showColumnFilters } = getState();
|
1785
1699
|
const { column } = header;
|
1786
1700
|
const { columnDef } = column;
|
1787
|
-
return (
|
1788
|
-
|
1701
|
+
return (jsx(Collapse, Object.assign({ in: showColumnFilters, mountOnEnter: true, unmountOnExit: true }, { children: columnDef.filterVariant === 'checkbox' ? (jsx(MRT_FilterCheckbox, { column: column, table: table })) : columnDef.filterVariant === 'range' ||
|
1702
|
+
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsx(MRT_FilterTextField, { header: header, table: table })) })));
|
1789
1703
|
};
|
1790
1704
|
|
1791
1705
|
const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
@@ -1806,12 +1720,9 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1806
1720
|
? column.getFilterValue().join(`" ${isRangeFilter ? localization.and : localization.or} "`)
|
1807
1721
|
: column.getFilterValue()}"`)
|
1808
1722
|
.replace('" "', '');
|
1809
|
-
return (
|
1723
|
+
return (jsx(Grow, Object.assign({ unmountOnExit: true, in: (!!column.getFilterValue() && !isRangeFilter) ||
|
1810
1724
|
(isRangeFilter && // @ts-ignore
|
1811
|
-
(!!((_b = column.getFilterValue()) === null || _b === void 0 ? void 0 : _b[0]) || !!((_c = column.getFilterValue()) === null || _c === void 0 ? void 0 : _c[1]))) },
|
1812
|
-
React.createElement(Box, { component: "span", sx: { flex: '0 0' } },
|
1813
|
-
React.createElement(Tooltip, { arrow: true, placement: "top", title: filterTooltip },
|
1814
|
-
React.createElement(IconButton, { disableRipple: true, onClick: (event) => {
|
1725
|
+
(!!((_b = column.getFilterValue()) === null || _b === void 0 ? void 0 : _b[0]) || !!((_c = column.getFilterValue()) === null || _c === void 0 ? void 0 : _c[1]))) }, { children: jsx(Box, Object.assign({ component: "span", sx: { flex: '0 0' } }, { children: jsx(Tooltip, Object.assign({ arrow: true, placement: "top", title: filterTooltip }, { children: jsx(IconButton, Object.assign({ disableRipple: true, onClick: (event) => {
|
1815
1726
|
setShowColumnFilters(true);
|
1816
1727
|
queueMicrotask(() => {
|
1817
1728
|
var _a, _b;
|
@@ -1826,8 +1737,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1826
1737
|
p: '2px',
|
1827
1738
|
transform: 'scale(0.66)',
|
1828
1739
|
width: '12px',
|
1829
|
-
} },
|
1830
|
-
React.createElement(FilterAltIcon, null))))));
|
1740
|
+
} }, { children: jsx(FilterAltIcon, {}) })) })) })) })));
|
1831
1741
|
};
|
1832
1742
|
|
1833
1743
|
const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
@@ -1861,7 +1771,7 @@ const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
|
1861
1771
|
setDraggingColumn(null);
|
1862
1772
|
setHoveredColumn(null);
|
1863
1773
|
};
|
1864
|
-
return (
|
1774
|
+
return (jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragStart: handleDragStart, onDragEnd: handleDragEnd, table: table }));
|
1865
1775
|
};
|
1866
1776
|
|
1867
1777
|
const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
@@ -1869,7 +1779,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
1869
1779
|
const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
|
1870
1780
|
const { density } = getState();
|
1871
1781
|
const { column } = header;
|
1872
|
-
return (
|
1782
|
+
return (jsx(Box, Object.assign({ className: "Mui-TableHeadCell-ResizeHandle-Wrapper", onDoubleClick: () => {
|
1873
1783
|
setColumnSizingInfo((old) => (Object.assign(Object.assign({}, old), { isResizingColumn: false })));
|
1874
1784
|
column.resetSize();
|
1875
1785
|
}, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), sx: (theme) => ({
|
@@ -1886,8 +1796,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
1886
1796
|
transform: column.getIsResizing() && columnResizeMode === 'onEnd'
|
1887
1797
|
? `translateX(${(_a = getState().columnSizingInfo.deltaOffset) !== null && _a !== void 0 ? _a : 0}px)`
|
1888
1798
|
: undefined,
|
1889
|
-
} },
|
1890
|
-
React.createElement(Divider, { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: {
|
1799
|
+
} }, { children: jsx(Divider, { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: {
|
1891
1800
|
borderRadius: '2px',
|
1892
1801
|
borderWidth: '2px',
|
1893
1802
|
height: '24px',
|
@@ -1897,7 +1806,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
1897
1806
|
: 'all 150ms ease-in-out',
|
1898
1807
|
userSelect: 'none',
|
1899
1808
|
zIndex: 4,
|
1900
|
-
} })));
|
1809
|
+
} }) })));
|
1901
1810
|
};
|
1902
1811
|
|
1903
1812
|
const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
@@ -1910,9 +1819,7 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
1910
1819
|
? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
|
1911
1820
|
: localization.sortedByColumnAsc.replace('{column}', columnDef.header)
|
1912
1821
|
: localization.unsorted;
|
1913
|
-
return (
|
1914
|
-
React.createElement(Badge, { badgeContent: sorting.length > 1 ? column.getSortIndex() + 1 : 0, overlap: "circular" },
|
1915
|
-
React.createElement(TableSortLabel, { "aria-label": sortTooltip, active: !!column.getIsSorted(), direction: column.getIsSorted()
|
1822
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, placement: "top", title: sortTooltip }, { children: jsx(Badge, Object.assign({ badgeContent: sorting.length > 1 ? column.getSortIndex() + 1 : 0, overlap: "circular" }, { children: jsx(TableSortLabel, { "aria-label": sortTooltip, active: !!column.getIsSorted(), direction: column.getIsSorted()
|
1916
1823
|
? column.getIsSorted()
|
1917
1824
|
: undefined, sx: {
|
1918
1825
|
flex: '0 0',
|
@@ -1924,7 +1831,7 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
1924
1831
|
var _a;
|
1925
1832
|
e.stopPropagation();
|
1926
1833
|
(_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(e);
|
1927
|
-
} }))));
|
1834
|
+
} }) })) })));
|
1928
1835
|
};
|
1929
1836
|
|
1930
1837
|
const MRT_TableHeadCell = ({ header, table }) => {
|
@@ -1988,7 +1895,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
1988
1895
|
table,
|
1989
1896
|
})
|
1990
1897
|
: (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Header) !== null && _b !== void 0 ? _b : columnDef.header;
|
1991
|
-
return (
|
1898
|
+
return (jsxs(TableCell, Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: header.colSpan, onDragEnter: handleDragEnter, ref: (node) => {
|
1992
1899
|
if (node) {
|
1993
1900
|
tableHeadCellRefs.current[column.id] = node;
|
1994
1901
|
}
|
@@ -2018,49 +1925,39 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
2018
1925
|
table,
|
2019
1926
|
tableCellProps,
|
2020
1927
|
theme,
|
2021
|
-
})), draggingBorders)) }
|
2022
|
-
header.isPlaceholder ? null : (React.createElement(Box, { className: "Mui-TableHeadCell-Content", sx: {
|
2023
|
-
alignItems: 'center',
|
2024
|
-
display: 'flex',
|
2025
|
-
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
2026
|
-
justifyContent: columnDefType === 'group' || (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
2027
|
-
? 'center'
|
2028
|
-
: column.getCanResize()
|
2029
|
-
? 'space-between'
|
2030
|
-
: 'flex-start',
|
2031
|
-
position: 'relative',
|
2032
|
-
width: '100%',
|
2033
|
-
} },
|
2034
|
-
React.createElement(Box, { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
|
1928
|
+
})), draggingBorders)) }, { children: [header.isPlaceholder ? null : (jsxs(Box, Object.assign({ className: "Mui-TableHeadCell-Content", sx: {
|
2035
1929
|
alignItems: 'center',
|
2036
|
-
cursor: column.getCanSort() && columnDefType !== 'group'
|
2037
|
-
? 'pointer'
|
2038
|
-
: undefined,
|
2039
1930
|
display: 'flex',
|
2040
1931
|
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
1932
|
+
justifyContent: columnDefType === 'group' || (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
1933
|
+
? 'center'
|
1934
|
+
: column.getCanResize()
|
1935
|
+
? 'space-between'
|
1936
|
+
: 'flex-start',
|
1937
|
+
position: 'relative',
|
1938
|
+
width: '100%',
|
1939
|
+
} }, { children: [jsxs(Box, Object.assign({ className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
|
1940
|
+
alignItems: 'center',
|
1941
|
+
cursor: column.getCanSort() && columnDefType !== 'group'
|
1942
|
+
? 'pointer'
|
1943
|
+
: undefined,
|
1944
|
+
display: 'flex',
|
1945
|
+
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
1946
|
+
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
1947
|
+
pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
1948
|
+
? `${headerPL}rem`
|
1949
|
+
: undefined,
|
1950
|
+
} }, { children: [jsx(Box, Object.assign({ className: "Mui-TableHeadCell-Content-Wrapper", sx: {
|
1951
|
+
minWidth: `${Math.min((_d = (_c = columnDef.header) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0, 5)}ch`,
|
1952
|
+
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
1953
|
+
textOverflow: 'ellipsis',
|
1954
|
+
whiteSpace: ((_g = (_f = columnDef.header) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0) < 20 ? 'nowrap' : 'normal',
|
1955
|
+
'&:hover': {
|
1956
|
+
textOverflow: 'clip',
|
1957
|
+
},
|
1958
|
+
}, title: columnDefType === 'data' ? columnDef.header : undefined }, { children: headerElement })), column.getCanSort() && (jsx(MRT_TableHeadCellSortLabel, { header: header, table: table, tableCellProps: tableCellProps })), column.getCanFilter() && (jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table }))] })), columnDefType !== 'group' && (jsxs(Box, Object.assign({ className: "Mui-TableHeadCell-Content-Actions", sx: { whiteSpace: 'nowrap' } }, { children: [showDragHandle && (jsx(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
|
1959
|
+
current: tableHeadCellRefs.current[column.id],
|
1960
|
+
} })), showColumnActions && (jsx(MRT_TableHeadCellColumnActionsButton, { header: header, table: table }))] }))), column.getCanResize() && (jsx(MRT_TableHeadCellResizeHandle, { header: header, table: table }))] }))), column.getCanFilter() && (jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }))] })));
|
2064
1961
|
};
|
2065
1962
|
|
2066
1963
|
const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
@@ -2068,17 +1965,14 @@ const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLe
|
|
2068
1965
|
const tableRowProps = muiTableHeadRowProps instanceof Function
|
2069
1966
|
? muiTableHeadRowProps({ headerGroup, table })
|
2070
1967
|
: muiTableHeadRowProps;
|
2071
|
-
return (
|
1968
|
+
return (jsxs(TableRow, Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.04), boxShadow: `4px 0 8px ${alpha(theme.palette.common.black, 0.1)}`, display: layoutMode === 'grid' ? 'flex' : 'table-row', top: 0 }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2072
1969
|
? tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx(theme)
|
2073
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))) }),
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
return (React.createElement(MRT_TableHeadCell, { header: header, key: header.id, table: table }));
|
2080
|
-
}),
|
2081
|
-
virtualPaddingRight ? (React.createElement("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null));
|
1970
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))) }, { children: [virtualPaddingLeft ? (jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : headerGroup.headers).map((headerOrVirtualHeader) => {
|
1971
|
+
const header = virtualColumns
|
1972
|
+
? headerGroup.headers[headerOrVirtualHeader.index]
|
1973
|
+
: headerOrVirtualHeader;
|
1974
|
+
return (jsx(MRT_TableHeadCell, { header: header, table: table }, header.id));
|
1975
|
+
}), virtualPaddingRight ? (jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
|
2082
1976
|
};
|
2083
1977
|
|
2084
1978
|
const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
@@ -2088,9 +1982,9 @@ const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddi
|
|
2088
1982
|
? muiTableHeadProps({ table })
|
2089
1983
|
: muiTableHeadProps;
|
2090
1984
|
const stickyHeader = enableStickyHeader || isFullScreen;
|
2091
|
-
return (
|
1985
|
+
return (jsx(TableHead, Object.assign({}, tableHeadProps, { sx: (theme) => (Object.assign({ display: layoutMode === 'grid' ? 'grid' : 'table-row-group', opacity: 0.97, position: stickyHeader ? 'sticky' : 'relative', top: stickyHeader && layoutMode === 'grid' ? 0 : undefined, zIndex: stickyHeader ? 2 : undefined }, ((tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx) instanceof Function
|
2092
1986
|
? tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx(theme)
|
2093
|
-
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))) }
|
1987
|
+
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))) }, { children: getHeaderGroups().map((headerGroup) => (jsx(MRT_TableHeadRow, { headerGroup: headerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, headerGroup.id))) })));
|
2094
1988
|
};
|
2095
1989
|
|
2096
1990
|
const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
@@ -2140,9 +2034,9 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
2140
2034
|
}
|
2141
2035
|
};
|
2142
2036
|
if (columnDef.Edit) {
|
2143
|
-
return
|
2037
|
+
return jsx(Fragment, { children: (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table }) });
|
2144
2038
|
}
|
2145
|
-
return (
|
2039
|
+
return (jsx(TextField, Object.assign({ disabled: (columnDef.enableEditing instanceof Function
|
2146
2040
|
? columnDef.enableEditing(row)
|
2147
2041
|
: columnDef.enableEditing) === false, fullWidth: true, inputRef: (inputRef) => {
|
2148
2042
|
if (inputRef) {
|
@@ -2155,24 +2049,24 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
2155
2049
|
var _a;
|
2156
2050
|
e.stopPropagation();
|
2157
2051
|
(_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
|
2158
|
-
}, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleEnterKeyDown }
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
|
2166
|
-
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2052
|
+
}, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleEnterKeyDown }, { children: (_b = textFieldProps.children) !== null && _b !== void 0 ? _b : (_c = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
2053
|
+
let value;
|
2054
|
+
let text;
|
2055
|
+
if (typeof option !== 'object') {
|
2056
|
+
value = option;
|
2057
|
+
text = option;
|
2058
|
+
}
|
2059
|
+
else {
|
2060
|
+
value = option.value;
|
2061
|
+
text = option.text;
|
2062
|
+
}
|
2063
|
+
return (jsx(MenuItem, Object.assign({ sx: {
|
2064
|
+
display: 'flex',
|
2065
|
+
m: 0,
|
2066
|
+
alignItems: 'center',
|
2067
|
+
gap: '0.5rem',
|
2068
|
+
}, value: value }, { children: text }), value));
|
2069
|
+
}) })));
|
2176
2070
|
};
|
2177
2071
|
|
2178
2072
|
const MRT_CopyButton = ({ cell, children, table, }) => {
|
@@ -2199,10 +2093,9 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
2199
2093
|
})
|
2200
2094
|
: columnDef.muiTableBodyCellCopyButtonProps;
|
2201
2095
|
const buttonProps = Object.assign(Object.assign({}, mTableBodyCellCopyButtonProps), mcTableBodyCellCopyButtonProps);
|
2202
|
-
return (
|
2203
|
-
React.createElement(Button, Object.assign({ onClick: (e) => handleCopy(e, cell.getValue()), size: "small", type: "button", variant: "text" }, buttonProps, { sx: (theme) => (Object.assign({ backgroundColor: 'transparent', border: 'none', color: 'inherit', cursor: 'copy', fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', m: '-0.25rem', minWidth: 'unset', textAlign: 'inherit', textTransform: 'inherit' }, ((buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx) instanceof Function
|
2096
|
+
return (jsx(Tooltip, Object.assign({ arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _a !== void 0 ? _a : (copied ? localization.copiedToClipboard : localization.clickToCopy) }, { children: jsx(Button, Object.assign({ onClick: (e) => handleCopy(e, cell.getValue()), size: "small", type: "button", variant: "text" }, buttonProps, { sx: (theme) => (Object.assign({ backgroundColor: 'transparent', border: 'none', color: 'inherit', cursor: 'copy', fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', m: '-0.25rem', minWidth: 'unset', textAlign: 'inherit', textTransform: 'inherit' }, ((buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx) instanceof Function
|
2204
2097
|
? buttonProps.sx(theme)
|
2205
|
-
: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))), title: undefined }
|
2098
|
+
: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))), title: undefined }, { children: children })) })));
|
2206
2099
|
};
|
2207
2100
|
|
2208
2101
|
const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table }) => {
|
@@ -2223,7 +2116,7 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table }) => {
|
|
2223
2116
|
table.setDraggingRow(null);
|
2224
2117
|
table.setHoveredRow(null);
|
2225
2118
|
};
|
2226
|
-
return (
|
2119
|
+
return (jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragStart: handleDragStart, onDragEnd: handleDragEnd, table: table }));
|
2227
2120
|
};
|
2228
2121
|
|
2229
2122
|
const allowedTypes = ['string', 'number'];
|
@@ -2271,16 +2164,16 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2271
2164
|
matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
|
2272
2165
|
});
|
2273
2166
|
if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
|
2274
|
-
renderedCellValue = (
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2167
|
+
renderedCellValue = (jsx("span", Object.assign({ "aria-label": renderedCellValue, role: "note" }, { children: (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (jsx(Box, Object.assign({ "aria-hidden": "true", component: "span", sx: match
|
2168
|
+
? {
|
2169
|
+
backgroundColor: (theme) => theme.palette.mode === 'dark'
|
2170
|
+
? darken(theme.palette.warning.dark, 0.25)
|
2171
|
+
: lighten(theme.palette.warning.light, 0.5),
|
2172
|
+
borderRadius: '2px',
|
2173
|
+
color: (theme) => theme.palette.mode === 'dark' ? 'white' : 'black',
|
2174
|
+
padding: '2px 1px',
|
2175
|
+
}
|
2176
|
+
: undefined }, { children: text }), key)))) !== null && _c !== void 0 ? _c : renderedCellValue })));
|
2284
2177
|
}
|
2285
2178
|
}
|
2286
2179
|
if (columnDef.Cell && !isGroupedValue) {
|
@@ -2292,7 +2185,7 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2292
2185
|
table,
|
2293
2186
|
});
|
2294
2187
|
}
|
2295
|
-
return
|
2188
|
+
return jsx(Fragment, { children: renderedCellValue });
|
2296
2189
|
};
|
2297
2190
|
|
2298
2191
|
const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, table, virtualCell, }) => {
|
@@ -2387,7 +2280,7 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
2387
2280
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
2388
2281
|
}
|
2389
2282
|
};
|
2390
|
-
return (
|
2283
|
+
return (jsx(TableCell, Object.assign({ "data-index": virtualCell === null || virtualCell === void 0 ? void 0 : virtualCell.index, ref: (node) => {
|
2391
2284
|
if (node) {
|
2392
2285
|
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
2393
2286
|
}
|
@@ -2419,26 +2312,19 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
2419
2312
|
table,
|
2420
2313
|
theme,
|
2421
2314
|
tableCellProps,
|
2422
|
-
})), draggingBorders)) }),
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
})) : isEditing ? (React.createElement(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
2436
|
-
columnDef.enableClickToCopy !== false ? (React.createElement(MRT_CopyButton, { cell: cell, table: table },
|
2437
|
-
React.createElement(MRT_TableBodyCellValue, { cell: cell, table: table }))) : (React.createElement(MRT_TableBodyCellValue, { cell: cell, table: table })),
|
2438
|
-
cell.getIsGrouped() && !columnDef.GroupedCell && (React.createElement(React.Fragment, null,
|
2439
|
-
" (", (_d = row.subRows) === null || _d === void 0 ? void 0 :
|
2440
|
-
_d.length,
|
2441
|
-
")")))));
|
2315
|
+
})), draggingBorders)) }, { children: jsxs(Fragment, { children: [cell.getIsPlaceholder() ? ((_b = (_a = columnDef.PlaceholderCell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) !== null && _b !== void 0 ? _b : null) : isLoading || showSkeletons ? (jsx(Skeleton, Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, skeletonProps))) : enableRowNumbers &&
|
2316
|
+
rowNumberMode === 'static' &&
|
2317
|
+
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (jsx(MRT_TableBodyRowGrabHandle, { cell: cell, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
|
2318
|
+
(column.id === 'mrt-row-select' ||
|
2319
|
+
column.id === 'mrt-row-expand' ||
|
2320
|
+
!row.getIsGrouped()) ? ((_c = columnDef.Cell) === null || _c === void 0 ? void 0 : _c.call(columnDef, {
|
2321
|
+
cell,
|
2322
|
+
renderedCellValue: cell.renderValue(),
|
2323
|
+
column,
|
2324
|
+
row,
|
2325
|
+
table,
|
2326
|
+
})) : isEditing ? (jsx(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
2327
|
+
columnDef.enableClickToCopy !== false ? (jsx(MRT_CopyButton, Object.assign({ cell: cell, table: table }, { children: jsx(MRT_TableBodyCellValue, { cell: cell, table: table }) }))) : (jsx(MRT_TableBodyCellValue, { cell: cell, table: table })), cell.getIsGrouped() && !columnDef.GroupedCell && (jsxs(Fragment, { children: [" (", (_d = row.subRows) === null || _d === void 0 ? void 0 : _d.length, ")"] }))] }) })));
|
2442
2328
|
};
|
2443
2329
|
const Memo_MRT_TableBodyCell = memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
|
2444
2330
|
|
@@ -2456,7 +2342,7 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
|
|
2456
2342
|
const tableCellProps = muiTableDetailPanelProps instanceof Function
|
2457
2343
|
? muiTableDetailPanelProps({ row, table })
|
2458
2344
|
: muiTableDetailPanelProps;
|
2459
|
-
return (
|
2345
|
+
return (jsx(TableRow, Object.assign({ className: "Mui-TableBodyCell-DetailPanel" }, tableRowProps, { sx: (theme) => {
|
2460
2346
|
var _a, _b;
|
2461
2347
|
return (Object.assign({ display: layoutMode === 'grid' ? 'flex' : 'table-row', position: virtualRow ? 'absolute' : undefined, top: virtualRow
|
2462
2348
|
? `${(_b = (_a = parentRowRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.height}px`
|
@@ -2465,12 +2351,11 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
|
|
2465
2351
|
: undefined, width: '100%', zIndex: virtualRow ? 2 : undefined }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2466
2352
|
? tableRowProps.sx(theme)
|
2467
2353
|
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)));
|
2468
|
-
} }),
|
2469
|
-
React.createElement(TableCell, Object.assign({ className: "Mui-TableBodyCell-DetailPanel", colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ backgroundColor: virtualRow
|
2354
|
+
} }, { children: jsx(TableCell, Object.assign({ className: "Mui-TableBodyCell-DetailPanel", colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ backgroundColor: virtualRow
|
2470
2355
|
? lighten(theme.palette.background.default, 0.06)
|
2471
2356
|
: undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: layoutMode === 'grid' ? 'flex' : 'table-cell', pb: row.getIsExpanded() ? '1rem' : 0, pt: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
2472
2357
|
? tableCellProps.sx(theme)
|
2473
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }
|
2358
|
+
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }, { children: renderDetailPanel && (jsx(Collapse, Object.assign({ in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true }, { children: !isLoading && renderDetailPanel({ row, table }) }))) })) })));
|
2474
2359
|
};
|
2475
2360
|
|
2476
2361
|
const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
|
@@ -2485,51 +2370,46 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, row, row
|
|
2485
2370
|
}
|
2486
2371
|
};
|
2487
2372
|
const rowRef = useRef(null);
|
2488
|
-
return (
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
}
|
2494
|
-
|
2495
|
-
|
2496
|
-
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2501
|
-
|
2502
|
-
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2523
|
-
|
2524
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
!
|
2528
|
-
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
|
2529
|
-
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (React.createElement(Memo_MRT_TableBodyCell, Object.assign({}, props))) : (React.createElement(MRT_TableBodyCell, Object.assign({}, props)));
|
2530
|
-
}),
|
2531
|
-
virtualPaddingRight ? (React.createElement("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null),
|
2532
|
-
renderDetailPanel && !row.getIsGrouped() && (React.createElement(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, rowIndex: rowIndex, table: table, virtualRow: virtualRow }))));
|
2373
|
+
return (jsxs(Fragment, { children: [jsxs(TableRow, Object.assign({ "data-index": virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.index, onDragEnter: handleDragEnter, selected: row.getIsSelected(), ref: (node) => {
|
2374
|
+
if (node) {
|
2375
|
+
rowRef.current = node;
|
2376
|
+
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
2377
|
+
}
|
2378
|
+
} }, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.06), boxSizing: 'border-box', display: layoutMode === 'grid' ? 'flex' : 'table-row', opacity: (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id || (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id ? 0.5 : 1, position: virtualRow ? 'absolute' : undefined, transition: virtualRow ? 'none' : 'all 150ms ease-in-out', top: virtualRow ? 0 : undefined, width: '100%', '&:hover td': {
|
2379
|
+
backgroundColor: (tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.hover) !== false
|
2380
|
+
? row.getIsSelected()
|
2381
|
+
? `${alpha(theme.palette.primary.main, 0.2)}`
|
2382
|
+
: theme.palette.mode === 'dark'
|
2383
|
+
? `${lighten(theme.palette.background.default, 0.12)}`
|
2384
|
+
: `${darken(theme.palette.background.default, 0.05)}`
|
2385
|
+
: undefined,
|
2386
|
+
} }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2387
|
+
? tableRowProps.sx(theme)
|
2388
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))), style: Object.assign({ transform: virtualRow
|
2389
|
+
? `translateY(${virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.start}px)`
|
2390
|
+
: undefined }, tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style) }, { children: [virtualPaddingLeft ? (jsx("td", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : row.getVisibleCells()).map((cellOrVirtualCell) => {
|
2391
|
+
const cell = columnVirtualizer
|
2392
|
+
? row.getVisibleCells()[cellOrVirtualCell.index]
|
2393
|
+
: cellOrVirtualCell;
|
2394
|
+
const props = {
|
2395
|
+
cell,
|
2396
|
+
key: cell.id,
|
2397
|
+
measureElement: columnVirtualizer === null || columnVirtualizer === void 0 ? void 0 : columnVirtualizer.measureElement,
|
2398
|
+
numRows,
|
2399
|
+
rowIndex,
|
2400
|
+
rowRef,
|
2401
|
+
table,
|
2402
|
+
virtualCell: columnVirtualizer
|
2403
|
+
? cellOrVirtualCell
|
2404
|
+
: undefined,
|
2405
|
+
};
|
2406
|
+
return memoMode === 'cells' &&
|
2407
|
+
cell.column.columnDef.columnDefType === 'data' &&
|
2408
|
+
!draggingColumn &&
|
2409
|
+
!draggingRow &&
|
2410
|
+
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
|
2411
|
+
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (jsx(Memo_MRT_TableBodyCell, Object.assign({}, props))) : (jsx(MRT_TableBodyCell, Object.assign({}, props)));
|
2412
|
+
}), virtualPaddingRight ? (jsx("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })), renderDetailPanel && !row.getIsGrouped() && (jsx(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, rowIndex: rowIndex, table: table, virtualRow: virtualRow }))] }));
|
2533
2413
|
};
|
2534
2414
|
const Memo_MRT_TableBodyRow = memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row && prev.rowIndex === next.rowIndex);
|
2535
2415
|
|
@@ -2596,43 +2476,42 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
2596
2476
|
const virtualRows = rowVirtualizer
|
2597
2477
|
? rowVirtualizer.getVirtualItems()
|
2598
2478
|
: undefined;
|
2599
|
-
return (
|
2479
|
+
return (jsx(TableBody, Object.assign({}, tableBodyProps, { sx: (theme) => (Object.assign({ display: layoutMode === 'grid' ? 'grid' : 'table-row-group', height: rowVirtualizer
|
2600
2480
|
? `${rowVirtualizer.getTotalSize()}px`
|
2601
2481
|
: 'inherit', minHeight: !rows.length ? '100px' : undefined, position: 'relative' }, ((tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx) instanceof Function
|
2602
2482
|
? tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx(theme)
|
2603
|
-
: tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx))) }
|
2604
|
-
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
|
2628
|
-
|
2629
|
-
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
}))))));
|
2483
|
+
: tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx))) }, { children: (_a = tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.children) !== null && _a !== void 0 ? _a : (!rows.length ? (jsx("tr", Object.assign({ style: { display: layoutMode === 'grid' ? 'grid' : 'table-row' } }, { children: jsx("td", Object.assign({ colSpan: table.getVisibleLeafColumns().length, style: {
|
2484
|
+
display: layoutMode === 'grid' ? 'grid' : 'table-cell',
|
2485
|
+
} }, { children: (_b = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _b !== void 0 ? _b : (jsx(Typography, Object.assign({ sx: {
|
2486
|
+
color: 'text.secondary',
|
2487
|
+
fontStyle: 'italic',
|
2488
|
+
maxWidth: `min(100vw, ${(_d = (_c = tablePaperRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 360}px)`,
|
2489
|
+
py: '2rem',
|
2490
|
+
textAlign: 'center',
|
2491
|
+
width: '100%',
|
2492
|
+
} }, { children: globalFilter || columnFilters.length
|
2493
|
+
? localization.noResultsFound
|
2494
|
+
: localization.noRecordsToDisplay }))) })) }))) : (jsx(Fragment, { children: (virtualRows !== null && virtualRows !== void 0 ? virtualRows : rows).map((rowOrVirtualRow, rowIndex) => {
|
2495
|
+
const row = rowVirtualizer
|
2496
|
+
? rows[rowOrVirtualRow.index]
|
2497
|
+
: rowOrVirtualRow;
|
2498
|
+
const props = {
|
2499
|
+
columnVirtualizer,
|
2500
|
+
key: row.id,
|
2501
|
+
measureElement: rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement,
|
2502
|
+
numRows: rows.length,
|
2503
|
+
row,
|
2504
|
+
rowIndex: rowVirtualizer ? rowOrVirtualRow.index : rowIndex,
|
2505
|
+
table,
|
2506
|
+
virtualColumns,
|
2507
|
+
virtualPaddingLeft,
|
2508
|
+
virtualPaddingRight,
|
2509
|
+
virtualRow: rowVirtualizer
|
2510
|
+
? rowOrVirtualRow
|
2511
|
+
: undefined,
|
2512
|
+
};
|
2513
|
+
return memoMode === 'rows' ? (jsx(Memo_MRT_TableBodyRow, Object.assign({}, props))) : (jsx(MRT_TableBodyRow, Object.assign({}, props)));
|
2514
|
+
}) }))) })));
|
2636
2515
|
};
|
2637
2516
|
const Memo_MRT_TableBody = memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
|
2638
2517
|
|
@@ -2650,7 +2529,7 @@ const MRT_TableFooterCell = ({ footer, table }) => {
|
|
2650
2529
|
? columnDef.muiTableFooterCellProps({ column, table })
|
2651
2530
|
: columnDef.muiTableFooterCellProps;
|
2652
2531
|
const tableCellProps = Object.assign(Object.assign({}, mTableFooterCellProps), mcTableFooterCellProps);
|
2653
|
-
return (
|
2532
|
+
return (jsx(TableCell, Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: footer.colSpan, variant: "head" }, tableCellProps, { sx: (theme) => (Object.assign({ display: layoutMode === 'grid' ? 'grid' : 'table-cell', fontWeight: 'bold', justifyContent: columnDefType === 'group' ? 'center' : undefined, p: density === 'compact'
|
2654
2533
|
? '0.5rem'
|
2655
2534
|
: density === 'comfortable'
|
2656
2535
|
? '1rem'
|
@@ -2659,16 +2538,15 @@ const MRT_TableFooterCell = ({ footer, table }) => {
|
|
2659
2538
|
table,
|
2660
2539
|
theme,
|
2661
2540
|
tableCellProps,
|
2662
|
-
}))) }
|
2663
|
-
|
2664
|
-
|
2665
|
-
|
2666
|
-
|
2667
|
-
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2671
|
-
: columnDef.Footer)) !== null && _b !== void 0 ? _b : columnDef.footer) !== null && _c !== void 0 ? _c : null)));
|
2541
|
+
}))) }, { children: jsx(Fragment, { children: footer.isPlaceholder
|
2542
|
+
? null
|
2543
|
+
: (_c = (_b = (columnDef.Footer instanceof Function
|
2544
|
+
? (_a = columnDef.Footer) === null || _a === void 0 ? void 0 : _a.call(columnDef, {
|
2545
|
+
column,
|
2546
|
+
footer,
|
2547
|
+
table,
|
2548
|
+
})
|
2549
|
+
: columnDef.Footer)) !== null && _b !== void 0 ? _b : columnDef.footer) !== null && _c !== void 0 ? _c : null }) })));
|
2672
2550
|
};
|
2673
2551
|
|
2674
2552
|
const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
@@ -2682,17 +2560,14 @@ const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPadding
|
|
2682
2560
|
const tableRowProps = muiTableFooterRowProps instanceof Function
|
2683
2561
|
? muiTableFooterRowProps({ footerGroup, table })
|
2684
2562
|
: muiTableFooterRowProps;
|
2685
|
-
return (
|
2563
|
+
return (jsxs(TableRow, Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.04), display: layoutMode === 'grid' ? 'flex' : 'table-row', width: '100%' }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2686
2564
|
? tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx(theme)
|
2687
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))) }),
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2693
|
-
return (React.createElement(MRT_TableFooterCell, { footer: footer, key: footer.id, table: table }));
|
2694
|
-
}),
|
2695
|
-
virtualPaddingRight ? (React.createElement("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null));
|
2565
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))) }, { children: [virtualPaddingLeft ? (jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : footerGroup.headers).map((footerOrVirtualFooter) => {
|
2566
|
+
const footer = virtualColumns
|
2567
|
+
? footerGroup.headers[footerOrVirtualFooter.index]
|
2568
|
+
: footerOrVirtualFooter;
|
2569
|
+
return (jsx(MRT_TableFooterCell, { footer: footer, table: table }, footer.id));
|
2570
|
+
}), virtualPaddingRight ? (jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
|
2696
2571
|
};
|
2697
2572
|
|
2698
2573
|
const MRT_TableFooter = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
@@ -2702,13 +2577,13 @@ const MRT_TableFooter = ({ table, virtualColumns, virtualPaddingLeft, virtualPad
|
|
2702
2577
|
? muiTableFooterProps({ table })
|
2703
2578
|
: muiTableFooterProps;
|
2704
2579
|
const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
|
2705
|
-
return (
|
2580
|
+
return (jsx(TableFooter, Object.assign({}, tableFooterProps, { sx: (theme) => (Object.assign({ bottom: stickFooter ? 0 : undefined, display: layoutMode === 'grid' ? 'grid' : 'table-row-group', opacity: stickFooter ? 0.97 : undefined, outline: stickFooter
|
2706
2581
|
? theme.palette.mode === 'light'
|
2707
2582
|
? `1px solid ${theme.palette.grey[300]}`
|
2708
2583
|
: `1px solid ${theme.palette.grey[700]}`
|
2709
2584
|
: undefined, position: stickFooter ? 'sticky' : undefined, zIndex: stickFooter ? 1 : undefined }, ((tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx) instanceof Function
|
2710
2585
|
? tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx(theme)
|
2711
|
-
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx))) }
|
2586
|
+
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx))) }, { children: getFooterGroups().map((footerGroup) => (jsx(MRT_TableFooterRow, { footerGroup: footerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, footerGroup.id))) })));
|
2712
2587
|
};
|
2713
2588
|
|
2714
2589
|
const MRT_Table = ({ table }) => {
|
@@ -2779,12 +2654,9 @@ const MRT_Table = ({ table }) => {
|
|
2779
2654
|
virtualPaddingLeft,
|
2780
2655
|
virtualPaddingRight,
|
2781
2656
|
};
|
2782
|
-
return (
|
2657
|
+
return (jsxs(Table, Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: layoutMode === 'grid' ? 'grid' : 'table', tableLayout: layoutMode !== 'grid' && enableColumnResizing ? 'fixed' : undefined }, ((tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx) instanceof Function
|
2783
2658
|
? tableProps.sx(theme)
|
2784
|
-
: tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx))), style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style) }),
|
2785
|
-
enableTableHead && React.createElement(MRT_TableHead, Object.assign({}, props)),
|
2786
|
-
memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (React.createElement(Memo_MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))) : (React.createElement(MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))),
|
2787
|
-
enableTableFooter && React.createElement(MRT_TableFooter, Object.assign({}, props))));
|
2659
|
+
: tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx))), style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style) }, { children: [enableTableHead && jsx(MRT_TableHead, Object.assign({}, props)), memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (jsx(Memo_MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))) : (jsx(MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))), enableTableFooter && jsx(MRT_TableFooter, Object.assign({}, props))] })));
|
2788
2660
|
};
|
2789
2661
|
|
2790
2662
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
@@ -2805,7 +2677,7 @@ const MRT_TableContainer = ({ table }) => {
|
|
2805
2677
|
: 0;
|
2806
2678
|
setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
|
2807
2679
|
});
|
2808
|
-
return (
|
2680
|
+
return (jsx(TableContainer, Object.assign({}, tableContainerProps, { ref: (node) => {
|
2809
2681
|
if (node) {
|
2810
2682
|
tableContainerRef.current = node;
|
2811
2683
|
if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
|
@@ -2819,8 +2691,7 @@ const MRT_TableContainer = ({ table }) => {
|
|
2819
2691
|
? tableContainerProps.sx(theme)
|
2820
2692
|
: tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx))), style: Object.assign({ maxHeight: isFullScreen
|
2821
2693
|
? `calc(100vh - ${totalToolbarHeight}px)`
|
2822
|
-
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style) })
|
2823
|
-
React.createElement(MRT_Table, { table: table })));
|
2694
|
+
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style) }, { children: jsx(MRT_Table, { table: table }) })));
|
2824
2695
|
};
|
2825
2696
|
|
2826
2697
|
const MRT_TablePaper = ({ table }) => {
|
@@ -2829,7 +2700,7 @@ const MRT_TablePaper = ({ table }) => {
|
|
2829
2700
|
const tablePaperProps = muiTablePaperProps instanceof Function
|
2830
2701
|
? muiTablePaperProps({ table })
|
2831
2702
|
: muiTablePaperProps;
|
2832
|
-
return (
|
2703
|
+
return (jsxs(Paper, Object.assign({ elevation: 2 }, tablePaperProps, { ref: (ref) => {
|
2833
2704
|
tablePaperRef.current = ref;
|
2834
2705
|
if (tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.ref) {
|
2835
2706
|
//@ts-ignore
|
@@ -2846,35 +2717,26 @@ const MRT_TablePaper = ({ table }) => {
|
|
2846
2717
|
padding: 0,
|
2847
2718
|
width: '100vw',
|
2848
2719
|
}
|
2849
|
-
: {})) }
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
(renderBottomToolbar instanceof Function
|
2857
|
-
? renderBottomToolbar({ table })
|
2858
|
-
: renderBottomToolbar !== null && renderBottomToolbar !== void 0 ? renderBottomToolbar : React.createElement(MRT_BottomToolbar, { table: table }))));
|
2720
|
+
: {})) }, { children: [enableTopToolbar &&
|
2721
|
+
(renderTopToolbar instanceof Function
|
2722
|
+
? renderTopToolbar({ table })
|
2723
|
+
: renderTopToolbar !== null && renderTopToolbar !== void 0 ? renderTopToolbar : jsx(MRT_TopToolbar, { table: table })), jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
|
2724
|
+
(renderBottomToolbar instanceof Function
|
2725
|
+
? renderBottomToolbar({ table })
|
2726
|
+
: renderBottomToolbar !== null && renderBottomToolbar !== void 0 ? renderBottomToolbar : jsx(MRT_BottomToolbar, { table: table }))] })));
|
2859
2727
|
};
|
2860
2728
|
|
2861
2729
|
const MRT_EditRowModal = ({ open, row, table, }) => {
|
2862
2730
|
const { options: { localization }, } = table;
|
2863
|
-
return (
|
2864
|
-
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
|
2869
|
-
|
2870
|
-
|
2871
|
-
|
2872
|
-
} }, row
|
2873
|
-
.getAllCells()
|
2874
|
-
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
2875
|
-
.map((cell) => (React.createElement(MRT_EditCellTextField, { cell: cell, key: cell.id, showLabel: true, table: table })))))),
|
2876
|
-
React.createElement(DialogActions, { sx: { p: '1.25rem' } },
|
2877
|
-
React.createElement(MRT_EditActionButtons, { row: row, table: table, variant: "text" }))));
|
2731
|
+
return (jsxs(Dialog, Object.assign({ open: open }, { children: [jsx(DialogTitle, Object.assign({ textAlign: "center" }, { children: localization.edit })), jsx(DialogContent, { children: jsx("form", Object.assign({ onSubmit: (e) => e.preventDefault() }, { children: jsx(Stack, Object.assign({ sx: {
|
2732
|
+
gap: '1.5rem',
|
2733
|
+
minWidth: { xs: '300px', sm: '360px', md: '400px' },
|
2734
|
+
pt: '1rem',
|
2735
|
+
width: '100%',
|
2736
|
+
} }, { children: row
|
2737
|
+
.getAllCells()
|
2738
|
+
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
2739
|
+
.map((cell) => (jsx(MRT_EditCellTextField, { cell: cell, showLabel: true, table: table }, cell.id))) })) })) }), jsx(DialogActions, Object.assign({ sx: { p: '1.25rem' } }, { children: jsx(MRT_EditActionButtons, { row: row, table: table, variant: "text" }) }))] })));
|
2878
2740
|
};
|
2879
2741
|
|
2880
2742
|
const MRT_TableRoot = (props) => {
|
@@ -2922,13 +2784,13 @@ const MRT_TableRoot = (props) => {
|
|
2922
2784
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
2923
2785
|
return [
|
2924
2786
|
((_b = (_a = props.state) === null || _a === void 0 ? void 0 : _a.columnOrder) !== null && _b !== void 0 ? _b : columnOrder).includes('mrt-row-drag') && Object.assign(Object.assign(Object.assign({ header: props.localization.move, size: 60 }, props.defaultDisplayColumn), (_c = props.displayColumnDefOptions) === null || _c === void 0 ? void 0 : _c['mrt-row-drag']), { id: 'mrt-row-drag' }),
|
2925
|
-
((_e = (_d = props.state) === null || _d === void 0 ? void 0 : _d.columnOrder) !== null && _e !== void 0 ? _e : columnOrder).includes('mrt-row-actions') && Object.assign(Object.assign(Object.assign({ Cell: ({ cell, row }) => (
|
2787
|
+
((_e = (_d = props.state) === null || _d === void 0 ? void 0 : _d.columnOrder) !== null && _e !== void 0 ? _e : columnOrder).includes('mrt-row-actions') && Object.assign(Object.assign(Object.assign({ Cell: ({ cell, row }) => (jsx(MRT_ToggleRowActionMenuButton, { cell: cell, row: row, table: table })), header: props.localization.actions, size: 70 }, props.defaultDisplayColumn), (_f = props.displayColumnDefOptions) === null || _f === void 0 ? void 0 : _f['mrt-row-actions']), { id: 'mrt-row-actions' }),
|
2926
2788
|
((_h = (_g = props.state) === null || _g === void 0 ? void 0 : _g.columnOrder) !== null && _h !== void 0 ? _h : columnOrder).includes('mrt-row-expand') &&
|
2927
|
-
showExpandColumn(props, (_k = (_j = props.state) === null || _j === void 0 ? void 0 : _j.grouping) !== null && _k !== void 0 ? _k : grouping) && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (
|
2928
|
-
? () =>
|
2789
|
+
showExpandColumn(props, (_k = (_j = props.state) === null || _j === void 0 ? void 0 : _j.grouping) !== null && _k !== void 0 ? _k : grouping) && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (jsx(MRT_ExpandButton, { row: row, table: table })), Header: props.enableExpandAll
|
2790
|
+
? () => jsx(MRT_ExpandAllButton, { table: table })
|
2929
2791
|
: null, header: props.localization.expand, size: 60 }, props.defaultDisplayColumn), (_l = props.displayColumnDefOptions) === null || _l === void 0 ? void 0 : _l['mrt-row-expand']), { id: 'mrt-row-expand' }),
|
2930
|
-
((_o = (_m = props.state) === null || _m === void 0 ? void 0 : _m.columnOrder) !== null && _o !== void 0 ? _o : columnOrder).includes('mrt-row-select') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (
|
2931
|
-
? () =>
|
2792
|
+
((_o = (_m = props.state) === null || _m === void 0 ? void 0 : _m.columnOrder) !== null && _o !== void 0 ? _o : columnOrder).includes('mrt-row-select') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (jsx(MRT_SelectCheckbox, { row: row, table: table })), Header: props.enableSelectAll && props.enableMultiRowSelection
|
2793
|
+
? () => jsx(MRT_SelectCheckbox, { selectAll: true, table: table })
|
2932
2794
|
: null, header: props.localization.select, size: 60 }, props.defaultDisplayColumn), (_p = props.displayColumnDefOptions) === null || _p === void 0 ? void 0 : _p['mrt-row-select']), { id: 'mrt-row-select' }),
|
2933
2795
|
((_r = (_q = props.state) === null || _q === void 0 ? void 0 : _q.columnOrder) !== null && _r !== void 0 ? _r : columnOrder).includes('mrt-row-numbers') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => row.index + 1, Header: () => props.localization.rowNumber, header: props.localization.rowNumbers, size: 60 }, props.defaultDisplayColumn), (_s = props.displayColumnDefOptions) === null || _s === void 0 ? void 0 : _s['mrt-row-numbers']), { id: 'mrt-row-numbers' }),
|
2934
2796
|
].filter(Boolean);
|
@@ -3049,103 +2911,7 @@ const MRT_TableRoot = (props) => {
|
|
3049
2911
|
table.setPageIndex(Math.floor(totalRowCount / pageSize));
|
3050
2912
|
}
|
3051
2913
|
}, [props.rowCount, table.getPrePaginationRowModel().rows.length]);
|
3052
|
-
return (
|
3053
|
-
React.createElement(Dialog, { PaperComponent: Box, TransitionComponent: !props.enableRowVirtualization ? Grow : undefined, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => table.setIsFullScreen(false), open: table.getState().isFullScreen, transitionDuration: 400 },
|
3054
|
-
React.createElement(MRT_TablePaper, { table: table })),
|
3055
|
-
!table.getState().isFullScreen && (React.createElement(MRT_TablePaper, { table: table })),
|
3056
|
-
editingRow && props.editingMode === 'modal' && (React.createElement(MRT_EditRowModal, { row: editingRow, table: table, open: true }))));
|
3057
|
-
};
|
3058
|
-
|
3059
|
-
const MRT_Localization_EN = {
|
3060
|
-
actions: 'Actions',
|
3061
|
-
and: 'and',
|
3062
|
-
cancel: 'Cancel',
|
3063
|
-
changeFilterMode: 'Change filter mode',
|
3064
|
-
changeSearchMode: 'Change search mode',
|
3065
|
-
clearFilter: 'Clear filter',
|
3066
|
-
clearSearch: 'Clear search',
|
3067
|
-
clearSort: 'Clear sort',
|
3068
|
-
clickToCopy: 'Click to copy',
|
3069
|
-
collapse: 'Collapse',
|
3070
|
-
collapseAll: 'Collapse all',
|
3071
|
-
columnActions: 'Column Actions',
|
3072
|
-
copiedToClipboard: 'Copied to clipboard',
|
3073
|
-
dropToGroupBy: 'Drop to group by {column}',
|
3074
|
-
edit: 'Edit',
|
3075
|
-
expand: 'Expand',
|
3076
|
-
expandAll: 'Expand all',
|
3077
|
-
filterArrIncludes: 'Includes',
|
3078
|
-
filterArrIncludesAll: 'Includes all',
|
3079
|
-
filterArrIncludesSome: 'Includes',
|
3080
|
-
filterBetween: 'Between',
|
3081
|
-
filterBetweenInclusive: 'Between Inclusive',
|
3082
|
-
filterByColumn: 'Filter by {column}',
|
3083
|
-
filterContains: 'Contains',
|
3084
|
-
filterEmpty: 'Empty',
|
3085
|
-
filterEndsWith: 'Ends With',
|
3086
|
-
filterEquals: 'Equals',
|
3087
|
-
filterEqualsString: 'Equals',
|
3088
|
-
filterFuzzy: 'Fuzzy',
|
3089
|
-
filterGreaterThan: 'Greater Than',
|
3090
|
-
filterGreaterThanOrEqualTo: 'Greater Than Or Equal To',
|
3091
|
-
filterInNumberRange: 'Between',
|
3092
|
-
filterIncludesString: 'Contains',
|
3093
|
-
filterIncludesStringSensitive: 'Contains',
|
3094
|
-
filterLessThan: 'Less Than',
|
3095
|
-
filterLessThanOrEqualTo: 'Less Than Or Equal To',
|
3096
|
-
filterMode: 'Filter Mode: {filterType}',
|
3097
|
-
filterNotEmpty: 'Not Empty',
|
3098
|
-
filterNotEquals: 'Not Equals',
|
3099
|
-
filterStartsWith: 'Starts With',
|
3100
|
-
filterWeakEquals: 'Equals',
|
3101
|
-
filteringByColumn: 'Filtering by {column} - {filterType} {filterValue}',
|
3102
|
-
goToFirstPage: 'Go to first page',
|
3103
|
-
goToLastPage: 'Go to last page',
|
3104
|
-
goToNextPage: 'Go to next page',
|
3105
|
-
goToPreviousPage: 'Go to previous page',
|
3106
|
-
grab: 'Grab',
|
3107
|
-
groupByColumn: 'Group by {column}',
|
3108
|
-
groupedBy: 'Grouped by ',
|
3109
|
-
hideAll: 'Hide all',
|
3110
|
-
hideColumn: 'Hide {column} column',
|
3111
|
-
max: 'Max',
|
3112
|
-
min: 'Min',
|
3113
|
-
move: 'Move',
|
3114
|
-
noRecordsToDisplay: 'No records to display',
|
3115
|
-
noResultsFound: 'No results found',
|
3116
|
-
of: 'of',
|
3117
|
-
or: 'or',
|
3118
|
-
pinToLeft: 'Pin to left',
|
3119
|
-
pinToRight: 'Pin to right',
|
3120
|
-
resetColumnSize: 'Reset column size',
|
3121
|
-
resetOrder: 'Reset order',
|
3122
|
-
rowActions: 'Row Actions',
|
3123
|
-
rowNumber: '#',
|
3124
|
-
rowNumbers: 'Row Numbers',
|
3125
|
-
rowsPerPage: 'Rows per page',
|
3126
|
-
save: 'Save',
|
3127
|
-
search: 'Search',
|
3128
|
-
selectedCountOfRowCountRowsSelected: '{selectedCount} of {rowCount} row(s) selected',
|
3129
|
-
select: 'Select',
|
3130
|
-
showAll: 'Show all',
|
3131
|
-
showAllColumns: 'Show all columns',
|
3132
|
-
showHideColumns: 'Show/Hide columns',
|
3133
|
-
showHideFilters: 'Show/Hide filters',
|
3134
|
-
showHideSearch: 'Show/Hide search',
|
3135
|
-
sortByColumnAsc: 'Sort by {column} ascending',
|
3136
|
-
sortByColumnDesc: 'Sort by {column} descending',
|
3137
|
-
sortedByColumnAsc: 'Sorted by {column} ascending',
|
3138
|
-
sortedByColumnDesc: 'Sorted by {column} descending',
|
3139
|
-
thenBy: ', then by ',
|
3140
|
-
toggleDensity: 'Toggle density',
|
3141
|
-
toggleFullScreen: 'Toggle full screen',
|
3142
|
-
toggleSelectAll: 'Toggle select all',
|
3143
|
-
toggleSelectRow: 'Toggle select row',
|
3144
|
-
toggleVisibility: 'Toggle visibility',
|
3145
|
-
ungroupByColumn: 'Ungroup by {column}',
|
3146
|
-
unpin: 'Unpin',
|
3147
|
-
unpinAll: 'Unpin all',
|
3148
|
-
unsorted: 'Unsorted',
|
2914
|
+
return (jsxs(Fragment, { children: [jsx(Dialog, Object.assign({ PaperComponent: Box, TransitionComponent: !props.enableRowVirtualization ? Grow : undefined, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => table.setIsFullScreen(false), open: table.getState().isFullScreen, transitionDuration: 400 }, { children: jsx(MRT_TablePaper, { table: table }) })), !table.getState().isFullScreen && (jsx(MRT_TablePaper, { table: table })), editingRow && props.editingMode === 'modal' && (jsx(MRT_EditRowModal, { row: editingRow, table: table, open: true }))] }));
|
3149
2915
|
};
|
3150
2916
|
|
3151
2917
|
const MaterialReactTable = (_a) => {
|
@@ -3173,8 +2939,8 @@ const MaterialReactTable = (_a) => {
|
|
3173
2939
|
manualPagination = true;
|
3174
2940
|
manualSorting = true;
|
3175
2941
|
}
|
3176
|
-
return (
|
2942
|
+
return (jsx(MRT_TableRoot, Object.assign({ aggregationFns: _aggregationFns, autoResetExpanded: autoResetExpanded, columnResizeMode: columnResizeMode, defaultColumn: _defaultColumn, defaultDisplayColumn: _defaultDisplayColumn, editingMode: editingMode, enableBottomToolbar: enableBottomToolbar, enableColumnActions: enableColumnActions, enableColumnFilters: enableColumnFilters, enableColumnOrdering: enableColumnOrdering, enableColumnResizing: enableColumnResizing, enableDensityToggle: enableDensityToggle, enableExpandAll: enableExpandAll, enableFilterMatchHighlighting: enableFilterMatchHighlighting, enableFilters: enableFilters, enableFullScreenToggle: enableFullScreenToggle, enableGlobalFilter: enableGlobalFilter, enableGlobalFilterRankedResults: enableGlobalFilterRankedResults, enableGrouping: enableGrouping, enableHiding: enableHiding, enableMultiRowSelection: enableMultiRowSelection, enableMultiSort: enableMultiSort, enablePagination: enablePagination, enablePinning: enablePinning, enableRowSelection: enableRowSelection, enableSelectAll: enableSelectAll, enableSorting: enableSorting, enableStickyHeader: enableStickyHeader, enableTableFooter: enableTableFooter, enableTableHead: enableTableHead, enableToolbarInternalActions: enableToolbarInternalActions, enableTopToolbar: enableTopToolbar, filterFns: _filterFns, icons: _icons, layoutMode: layoutMode, localization: _localization, manualFiltering: manualFiltering, manualGrouping: manualGrouping, manualPagination: manualPagination, manualSorting: manualSorting, positionActionsColumn: positionActionsColumn, positionExpandColumn: positionExpandColumn, positionGlobalFilter: positionGlobalFilter, positionPagination: positionPagination, positionToolbarAlertBanner: positionToolbarAlertBanner, positionToolbarDropZone: positionToolbarDropZone, rowNumberMode: rowNumberMode, selectAllMode: selectAllMode, sortingFns: _sortingFns }, rest)));
|
3177
2943
|
};
|
3178
2944
|
|
3179
|
-
export { MRT_AggregationFns, MRT_BottomToolbar, MRT_CopyButton, MRT_EditActionButtons, MRT_ExpandButton, MRT_FilterFns, MRT_FilterOptionMenu, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_GrabHandleButton, MRT_ShowHideColumnsButton, MRT_SortingFns, MRT_TableHeadCellFilterContainer, MRT_TablePagination, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MaterialReactTable as default };
|
2945
|
+
export { MRT_AggregationFns, MRT_BottomToolbar, MRT_CopyButton, MRT_EditActionButtons, MRT_ExpandButton, MRT_FilterFns, MRT_FilterOptionMenu, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_GrabHandleButton, MRT_ShowHideColumnsButton, MRT_SortingFns, MRT_TableHeadCellFilterContainer, MRT_TablePagination, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MRT_ToggleRowActionMenuButton, MRT_ToolbarAlertBanner, MRT_ToolbarDropZone, MRT_ToolbarInternalButtons, MRT_TopToolbar, MaterialReactTable, MaterialReactTable as default };
|
3180
2946
|
//# sourceMappingURL=material-react-table.esm.js.map
|