material-react-table 2.10.0 → 2.11.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 +3 -2
- package/dist/index.d.ts +144 -125
- package/dist/index.esm.js +201 -152
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +201 -149
- package/dist/index.js.map +1 -1
- package/locales/ar/index.esm.js +1 -0
- package/locales/ar/index.js +1 -0
- package/locales/az/index.esm.js +1 -0
- package/locales/az/index.js +1 -0
- package/locales/bg/index.esm.js +1 -0
- package/locales/bg/index.js +1 -0
- package/locales/cs/index.esm.js +1 -0
- package/locales/cs/index.js +1 -0
- package/locales/da/index.esm.js +1 -0
- package/locales/da/index.js +1 -0
- package/locales/de/index.esm.js +1 -0
- package/locales/de/index.js +1 -0
- package/locales/en/index.esm.js +1 -0
- package/locales/en/index.js +1 -0
- package/locales/es/index.esm.js +1 -0
- package/locales/es/index.js +1 -0
- package/locales/et/index.esm.js +1 -0
- package/locales/et/index.js +1 -0
- package/locales/fa/index.esm.js +1 -0
- package/locales/fa/index.js +1 -0
- package/locales/fi/index.esm.js +1 -0
- package/locales/fi/index.js +1 -0
- package/locales/fr/index.esm.js +1 -0
- package/locales/fr/index.js +1 -0
- package/locales/he/index.esm.js +1 -0
- package/locales/he/index.js +1 -0
- package/locales/hu/index.esm.js +1 -0
- package/locales/hu/index.js +1 -0
- package/locales/hy/index.esm.js +1 -0
- package/locales/hy/index.js +1 -0
- package/locales/id/index.esm.js +1 -0
- package/locales/id/index.js +1 -0
- package/locales/it/index.esm.js +1 -0
- package/locales/it/index.js +1 -0
- package/locales/ja/index.esm.js +1 -0
- package/locales/ja/index.js +1 -0
- package/locales/ko/index.esm.js +1 -0
- package/locales/ko/index.js +1 -0
- package/locales/nl/index.esm.js +1 -0
- package/locales/nl/index.js +1 -0
- package/locales/no/index.esm.js +1 -0
- package/locales/no/index.js +1 -0
- package/locales/np/index.esm.js +1 -0
- package/locales/np/index.js +1 -0
- package/locales/pl/index.esm.js +1 -0
- package/locales/pl/index.js +1 -0
- package/locales/pt/index.esm.js +1 -0
- package/locales/pt/index.js +1 -0
- package/locales/pt-BR/index.esm.js +1 -0
- package/locales/pt-BR/index.js +1 -0
- package/locales/ro/index.esm.js +1 -0
- package/locales/ro/index.js +1 -0
- package/locales/ru/index.esm.js +1 -0
- package/locales/ru/index.js +1 -0
- package/locales/sk/index.esm.js +1 -0
- package/locales/sk/index.js +1 -0
- package/locales/sr-Cyrl-RS/index.esm.js +1 -0
- package/locales/sr-Cyrl-RS/index.js +1 -0
- package/locales/sr-Latn-RS/index.esm.js +1 -0
- package/locales/sr-Latn-RS/index.js +1 -0
- package/locales/sv/index.esm.js +1 -0
- package/locales/sv/index.js +1 -0
- package/locales/tr/index.esm.js +1 -0
- package/locales/tr/index.js +1 -0
- package/locales/uk/index.esm.js +1 -0
- package/locales/uk/index.js +1 -0
- package/locales/vi/index.esm.js +1 -0
- package/locales/vi/index.js +1 -0
- package/locales/zh-Hans/index.esm.js +1 -0
- package/locales/zh-Hans/index.js +1 -0
- package/locales/zh-Hant/index.esm.js +1 -0
- package/locales/zh-Hant/index.js +1 -0
- package/package.json +18 -18
- package/src/components/MaterialReactTable.tsx +3 -3
- package/src/components/body/MRT_TableBody.tsx +3 -2
- package/src/components/body/MRT_TableBodyCell.tsx +4 -2
- package/src/components/body/MRT_TableBodyCellValue.tsx +5 -2
- package/src/components/body/MRT_TableBodyRow.tsx +13 -8
- package/src/components/body/MRT_TableBodyRowGrabHandle.tsx +4 -3
- package/src/components/body/MRT_TableBodyRowPinButton.tsx +3 -2
- package/src/components/body/MRT_TableDetailPanel.tsx +3 -2
- package/src/components/buttons/MRT_ColumnPinningButtons.tsx +3 -2
- package/src/components/buttons/MRT_CopyButton.tsx +3 -2
- package/src/components/buttons/MRT_EditActionButtons.tsx +3 -2
- package/src/components/buttons/MRT_ExpandAllButton.tsx +3 -2
- package/src/components/buttons/MRT_ExpandButton.tsx +3 -2
- package/src/components/buttons/MRT_GrabHandleButton.tsx +9 -15
- package/src/components/buttons/MRT_RowPinButton.tsx +3 -2
- package/src/components/buttons/MRT_ShowHideColumnsButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleDensePaddingButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleFiltersButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleFullScreenButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleGlobalFilterButton.tsx +3 -2
- package/src/components/buttons/MRT_ToggleRowActionMenuButton.tsx +3 -2
- package/src/components/footer/MRT_TableFooter.tsx +3 -2
- package/src/components/footer/MRT_TableFooterCell.tsx +3 -2
- package/src/components/footer/MRT_TableFooterRow.tsx +5 -3
- package/src/components/head/MRT_TableHead.tsx +3 -2
- package/src/components/head/MRT_TableHeadCell.tsx +3 -5
- package/src/components/head/MRT_TableHeadCellColumnActionsButton.tsx +4 -2
- package/src/components/head/MRT_TableHeadCellFilterContainer.tsx +4 -2
- package/src/components/head/MRT_TableHeadCellFilterLabel.tsx +3 -2
- package/src/components/head/MRT_TableHeadCellGrabHandle.tsx +4 -3
- package/src/components/head/MRT_TableHeadCellResizeHandle.tsx +3 -2
- package/src/components/head/MRT_TableHeadCellSortLabel.tsx +3 -2
- package/src/components/head/MRT_TableHeadRow.tsx +3 -2
- package/src/components/inputs/MRT_EditCellTextField.tsx +3 -2
- package/src/components/inputs/MRT_FilterCheckbox.tsx +3 -2
- package/src/components/inputs/MRT_FilterRangeFields.tsx +3 -2
- package/src/components/inputs/MRT_FilterRangeSlider.tsx +3 -2
- package/src/components/inputs/MRT_FilterTextField.tsx +15 -6
- package/src/components/inputs/MRT_GlobalFilterTextField.tsx +3 -2
- package/src/components/inputs/MRT_SelectCheckbox.tsx +26 -33
- package/src/components/menus/MRT_ActionMenuItem.tsx +3 -2
- package/src/components/menus/MRT_CellActionMenu.tsx +5 -4
- package/src/components/menus/MRT_ColumnActionMenu.tsx +5 -4
- package/src/components/menus/MRT_FilterOptionMenu.tsx +3 -2
- package/src/components/menus/MRT_RowActionMenu.tsx +3 -2
- package/src/components/menus/MRT_ShowHideColumnsMenu.tsx +8 -2
- package/src/components/menus/MRT_ShowHideColumnsMenuItems.tsx +7 -5
- package/src/components/modals/MRT_EditRowModal.tsx +3 -2
- package/src/components/table/MRT_Table.tsx +2 -2
- package/src/components/table/MRT_TableContainer.tsx +3 -2
- package/src/components/table/MRT_TableLoadingOverlay.tsx +11 -8
- package/src/components/table/MRT_TablePaper.tsx +3 -2
- package/src/components/toolbar/MRT_BottomToolbar.tsx +3 -2
- package/src/components/toolbar/MRT_LinearProgressBar.tsx +3 -2
- package/src/components/toolbar/MRT_TablePagination.tsx +2 -2
- package/src/components/toolbar/MRT_ToolbarAlertBanner.tsx +30 -13
- package/src/components/toolbar/MRT_ToolbarDropZone.tsx +3 -2
- package/src/components/toolbar/MRT_ToolbarInternalButtons.tsx +3 -2
- package/src/components/toolbar/MRT_TopToolbar.tsx +2 -2
- package/src/hooks/useMRT_Effects.ts +11 -11
- package/src/hooks/useMRT_Rows.ts +11 -79
- package/src/hooks/useMRT_TableInstance.ts +2 -0
- package/src/hooks/useMRT_TableOptions.ts +2 -0
- package/src/locales/ar.ts +1 -0
- package/src/locales/az.ts +1 -0
- package/src/locales/bg.ts +1 -0
- package/src/locales/cs.ts +1 -0
- package/src/locales/da.ts +1 -0
- package/src/locales/de.ts +1 -0
- package/src/locales/en.ts +1 -0
- package/src/locales/es.ts +1 -0
- package/src/locales/et.ts +1 -0
- package/src/locales/fa.ts +1 -0
- package/src/locales/fi.ts +1 -0
- package/src/locales/fr.ts +1 -0
- package/src/locales/he.ts +1 -0
- package/src/locales/hu.ts +1 -0
- package/src/locales/hy.ts +1 -0
- package/src/locales/id.ts +1 -0
- package/src/locales/it.ts +1 -0
- package/src/locales/ja.ts +1 -0
- package/src/locales/ko.ts +1 -0
- package/src/locales/nl.ts +1 -0
- package/src/locales/no.ts +1 -0
- package/src/locales/np.ts +1 -0
- package/src/locales/pl.ts +1 -0
- package/src/locales/pt-BR.ts +1 -0
- package/src/locales/pt.ts +1 -0
- package/src/locales/ro.ts +1 -0
- package/src/locales/ru.ts +1 -0
- package/src/locales/sk.ts +1 -0
- package/src/locales/sr-Cyrl-RS.ts +1 -0
- package/src/locales/sr-Latn-RS.ts +1 -0
- package/src/locales/sv.ts +1 -0
- package/src/locales/tr.ts +1 -0
- package/src/locales/uk.ts +1 -0
- package/src/locales/vi.ts +1 -0
- package/src/locales/zh-Hans.ts +1 -0
- package/src/locales/zh-Hant.ts +1 -0
- package/src/types.ts +10 -4
- package/src/utils/column.utils.ts +4 -6
- package/src/utils/displayColumn.utils.ts +1 -1
- package/src/utils/row.utils.ts +179 -21
- package/locales/am/index.d.ts +0 -3
- package/locales/am/index.esm.d.ts +0 -3
- package/locales/am/index.esm.js +0 -93
- package/locales/am/index.js +0 -97
- package/locales/am/package.json +0 -6
package/locales/vi/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const MRT_Localization_VI = {
|
|
|
10
10
|
changeSearchMode: 'Thay đổi chế độ tìm kiếm',
|
|
11
11
|
clearFilter: 'Xoá bộ lọc',
|
|
12
12
|
clearSearch: 'Xoá ô tìm kiếm',
|
|
13
|
+
clearSelection: 'Xoá lựa chọn',
|
|
13
14
|
clearSort: 'Huỷ sắp xếp',
|
|
14
15
|
clickToCopy: 'Nhấn vào để sao chép',
|
|
15
16
|
copy: 'Sao chép',
|
package/locales/zh-Hans/index.js
CHANGED
package/locales/zh-Hant/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.11.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
5
|
"description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
|
|
@@ -66,22 +66,22 @@
|
|
|
66
66
|
"@emotion/react": "^11.11.3",
|
|
67
67
|
"@emotion/styled": "^11.11.0",
|
|
68
68
|
"@faker-js/faker": "^8.4.0",
|
|
69
|
-
"@mui/icons-material": "^5.15.
|
|
70
|
-
"@mui/material": "^5.15.
|
|
71
|
-
"@mui/x-date-pickers": "^6.19.
|
|
69
|
+
"@mui/icons-material": "^5.15.7",
|
|
70
|
+
"@mui/material": "^5.15.7",
|
|
71
|
+
"@mui/x-date-pickers": "^6.19.3",
|
|
72
72
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
73
73
|
"@size-limit/preset-small-lib": "^11.0.2",
|
|
74
|
-
"@storybook/addon-a11y": "^7.6.
|
|
75
|
-
"@storybook/addon-essentials": "^7.6.
|
|
76
|
-
"@storybook/addon-interactions": "^7.6.
|
|
77
|
-
"@storybook/addon-links": "^7.6.
|
|
78
|
-
"@storybook/addon-storysource": "^7.6.
|
|
79
|
-
"@storybook/blocks": "^7.6.
|
|
80
|
-
"@storybook/react": "^7.6.
|
|
81
|
-
"@storybook/react-vite": "^7.6.
|
|
74
|
+
"@storybook/addon-a11y": "^7.6.12",
|
|
75
|
+
"@storybook/addon-essentials": "^7.6.12",
|
|
76
|
+
"@storybook/addon-interactions": "^7.6.12",
|
|
77
|
+
"@storybook/addon-links": "^7.6.12",
|
|
78
|
+
"@storybook/addon-storysource": "^7.6.12",
|
|
79
|
+
"@storybook/blocks": "^7.6.12",
|
|
80
|
+
"@storybook/react": "^7.6.12",
|
|
81
|
+
"@storybook/react-vite": "^7.6.12",
|
|
82
82
|
"@storybook/testing-library": "^0.2.2",
|
|
83
|
-
"@types/node": "^20.11.
|
|
84
|
-
"@types/react": "^18.2.
|
|
83
|
+
"@types/node": "^20.11.16",
|
|
84
|
+
"@types/react": "^18.2.52",
|
|
85
85
|
"@types/react-dom": "^18.2.18",
|
|
86
86
|
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
87
87
|
"@typescript-eslint/parser": "^6.20.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"rollup-plugin-dts": "^6.1.0",
|
|
100
100
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
101
101
|
"size-limit": "^11.0.2",
|
|
102
|
-
"storybook": "^7.6.
|
|
102
|
+
"storybook": "^7.6.12",
|
|
103
103
|
"storybook-dark-mode": "^3.0.3",
|
|
104
104
|
"tslib": "^2.6.2",
|
|
105
105
|
"typescript": "^5.3.3",
|
|
@@ -115,9 +115,9 @@
|
|
|
115
115
|
"react-dom": ">=18.0"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@tanstack/match-sorter-utils": "8.11.
|
|
119
|
-
"@tanstack/react-table": "8.11.
|
|
120
|
-
"@tanstack/react-virtual": "3.0.
|
|
118
|
+
"@tanstack/match-sorter-utils": "8.11.8",
|
|
119
|
+
"@tanstack/react-table": "8.11.8",
|
|
120
|
+
"@tanstack/react-virtual": "3.0.4",
|
|
121
121
|
"highlight-words": "1.2.2"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -11,18 +11,18 @@ type TableInstanceProp<TData extends MRT_RowData> = {
|
|
|
11
11
|
table: MRT_TableInstance<TData>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
export type MaterialReactTableProps<TData extends MRT_RowData> = Xor<
|
|
15
15
|
TableInstanceProp<TData>,
|
|
16
16
|
MRT_TableOptions<TData>
|
|
17
17
|
>;
|
|
18
18
|
|
|
19
19
|
const isTableInstanceProp = <TData extends MRT_RowData>(
|
|
20
|
-
props:
|
|
20
|
+
props: MaterialReactTableProps<TData>,
|
|
21
21
|
): props is TableInstanceProp<TData> =>
|
|
22
22
|
(props as TableInstanceProp<TData>).table !== undefined;
|
|
23
23
|
|
|
24
24
|
export const MaterialReactTable = <TData extends MRT_RowData>(
|
|
25
|
-
props:
|
|
25
|
+
props: MaterialReactTableProps<TData>,
|
|
26
26
|
) => {
|
|
27
27
|
let table: MRT_TableInstance<TData>;
|
|
28
28
|
|
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
} from '../../types';
|
|
14
14
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
15
15
|
|
|
16
|
-
interface
|
|
16
|
+
export interface MRT_TableBodyProps<TData extends MRT_RowData>
|
|
17
|
+
extends TableBodyProps {
|
|
17
18
|
columnVirtualizer?: MRT_ColumnVirtualizer;
|
|
18
19
|
table: MRT_TableInstance<TData>;
|
|
19
20
|
}
|
|
@@ -22,7 +23,7 @@ export const MRT_TableBody = <TData extends MRT_RowData>({
|
|
|
22
23
|
columnVirtualizer,
|
|
23
24
|
table,
|
|
24
25
|
...rest
|
|
25
|
-
}:
|
|
26
|
+
}: MRT_TableBodyProps<TData>) => {
|
|
26
27
|
const {
|
|
27
28
|
getBottomRows,
|
|
28
29
|
getIsSomeRowsPinned,
|
|
@@ -23,7 +23,8 @@ import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
|
23
23
|
import { MRT_CopyButton } from '../buttons/MRT_CopyButton';
|
|
24
24
|
import { MRT_EditCellTextField } from '../inputs/MRT_EditCellTextField';
|
|
25
25
|
|
|
26
|
-
interface
|
|
26
|
+
export interface MRT_TableBodyCellProps<TData extends MRT_RowData>
|
|
27
|
+
extends TableCellProps {
|
|
27
28
|
cell: MRT_Cell<TData>;
|
|
28
29
|
numRows?: number;
|
|
29
30
|
rowRef: RefObject<HTMLTableRowElement>;
|
|
@@ -40,7 +41,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
40
41
|
staticRowIndex,
|
|
41
42
|
table,
|
|
42
43
|
...rest
|
|
43
|
-
}:
|
|
44
|
+
}: MRT_TableBodyCellProps<TData>) => {
|
|
44
45
|
const theme = useTheme();
|
|
45
46
|
const {
|
|
46
47
|
getState,
|
|
@@ -298,6 +299,7 @@ export const MRT_TableBodyCell = <TData extends MRT_RowData>({
|
|
|
298
299
|
renderedCellValue: cell.renderValue() as any,
|
|
299
300
|
row,
|
|
300
301
|
rowRef,
|
|
302
|
+
staticColumnIndex,
|
|
301
303
|
staticRowIndex,
|
|
302
304
|
table,
|
|
303
305
|
})
|
|
@@ -10,9 +10,10 @@ import highlightWords from 'highlight-words';
|
|
|
10
10
|
|
|
11
11
|
const allowedTypes = ['string', 'number'];
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
export interface MRT_TableBodyCellValueProps<TData extends MRT_RowData> {
|
|
14
14
|
cell: MRT_Cell<TData>;
|
|
15
15
|
rowRef?: RefObject<HTMLTableRowElement>;
|
|
16
|
+
staticColumnIndex?: number;
|
|
16
17
|
staticRowIndex?: number;
|
|
17
18
|
table: MRT_TableInstance<TData>;
|
|
18
19
|
}
|
|
@@ -20,9 +21,10 @@ interface Props<TData extends MRT_RowData> {
|
|
|
20
21
|
export const MRT_TableBodyCellValue = <TData extends MRT_RowData>({
|
|
21
22
|
cell,
|
|
22
23
|
rowRef,
|
|
24
|
+
staticColumnIndex,
|
|
23
25
|
staticRowIndex,
|
|
24
26
|
table,
|
|
25
|
-
}:
|
|
27
|
+
}: MRT_TableBodyCellValueProps<TData>) => {
|
|
26
28
|
const {
|
|
27
29
|
getState,
|
|
28
30
|
options: { enableFilterMatchHighlighting },
|
|
@@ -113,6 +115,7 @@ export const MRT_TableBodyCellValue = <TData extends MRT_RowData>({
|
|
|
113
115
|
renderedCellValue,
|
|
114
116
|
row,
|
|
115
117
|
rowRef,
|
|
118
|
+
staticColumnIndex,
|
|
116
119
|
staticRowIndex,
|
|
117
120
|
table,
|
|
118
121
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DragEvent, memo, useMemo, useRef } from 'react';
|
|
2
2
|
import { type VirtualItem } from '@tanstack/react-virtual';
|
|
3
|
-
import TableRow from '@mui/material/TableRow';
|
|
3
|
+
import TableRow, { type TableRowProps } from '@mui/material/TableRow';
|
|
4
4
|
import {
|
|
5
5
|
type Theme,
|
|
6
6
|
alpha,
|
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
} from '../../utils/style.utils';
|
|
28
28
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
29
29
|
|
|
30
|
-
interface
|
|
30
|
+
export interface MRT_TableBodyRowProps<TData extends MRT_RowData>
|
|
31
|
+
extends TableRowProps {
|
|
31
32
|
columnVirtualizer?: MRT_ColumnVirtualizer;
|
|
32
33
|
numRows?: number;
|
|
33
34
|
pinnedRowIds?: string[];
|
|
@@ -47,7 +48,8 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
47
48
|
staticRowIndex,
|
|
48
49
|
table,
|
|
49
50
|
virtualRow,
|
|
50
|
-
|
|
51
|
+
...rest
|
|
52
|
+
}: MRT_TableBodyRowProps<TData>) => {
|
|
51
53
|
const theme = useTheme();
|
|
52
54
|
|
|
53
55
|
const {
|
|
@@ -87,11 +89,14 @@ export const MRT_TableBodyRow = <TData extends MRT_RowData>({
|
|
|
87
89
|
const isDraggingRow = draggingRow?.id === row.id;
|
|
88
90
|
const isHoveredRow = hoveredRow?.id === row.id;
|
|
89
91
|
|
|
90
|
-
const tableRowProps =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const tableRowProps = {
|
|
93
|
+
...parseFromValuesOrFunc(muiTableBodyRowProps, {
|
|
94
|
+
row,
|
|
95
|
+
staticRowIndex,
|
|
96
|
+
table,
|
|
97
|
+
}),
|
|
98
|
+
...rest,
|
|
99
|
+
};
|
|
95
100
|
|
|
96
101
|
const [bottomPinnedIndex, topPinnedIndex] = useMemo(() => {
|
|
97
102
|
if (
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
9
9
|
import { MRT_GrabHandleButton } from '../buttons/MRT_GrabHandleButton';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
export interface MRT_TableBodyRowGrabHandleProps<TData extends MRT_RowData>
|
|
12
|
+
extends IconButtonProps {
|
|
12
13
|
row: MRT_Row<TData>;
|
|
13
14
|
rowRef: RefObject<HTMLTableRowElement>;
|
|
14
15
|
table: MRT_TableInstance<TData>;
|
|
@@ -19,7 +20,7 @@ export const MRT_TableBodyRowGrabHandle = <TData extends MRT_RowData>({
|
|
|
19
20
|
rowRef,
|
|
20
21
|
table,
|
|
21
22
|
...rest
|
|
22
|
-
}:
|
|
23
|
+
}: MRT_TableBodyRowGrabHandleProps<TData>) => {
|
|
23
24
|
const {
|
|
24
25
|
options: { muiRowDragHandleProps },
|
|
25
26
|
} = table;
|
|
@@ -50,7 +51,7 @@ export const MRT_TableBodyRowGrabHandle = <TData extends MRT_RowData>({
|
|
|
50
51
|
|
|
51
52
|
return (
|
|
52
53
|
<MRT_GrabHandleButton
|
|
53
|
-
|
|
54
|
+
{...iconButtonProps}
|
|
54
55
|
location="row"
|
|
55
56
|
onDragEnd={handleDragEnd}
|
|
56
57
|
onDragStart={handleDragStart}
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
9
9
|
import { MRT_RowPinButton } from '../buttons/MRT_RowPinButton';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
export interface MRT_TableBodyRowPinButtonProps<TData extends MRT_RowData>
|
|
12
|
+
extends IconButtonProps {
|
|
12
13
|
row: MRT_Row<TData>;
|
|
13
14
|
table: MRT_TableInstance<TData>;
|
|
14
15
|
}
|
|
@@ -17,7 +18,7 @@ export const MRT_TableBodyRowPinButton = <TData extends MRT_RowData>({
|
|
|
17
18
|
row,
|
|
18
19
|
table,
|
|
19
20
|
...rest
|
|
20
|
-
}:
|
|
21
|
+
}: MRT_TableBodyRowPinButtonProps<TData>) => {
|
|
21
22
|
const {
|
|
22
23
|
getState,
|
|
23
24
|
options: { enableRowPinning, rowPinningDisplayMode },
|
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
import { getMRTTheme } from '../../utils/style.utils';
|
|
13
13
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
14
14
|
|
|
15
|
-
interface
|
|
15
|
+
export interface MRT_TableDetailPanelProps<TData extends MRT_RowData>
|
|
16
|
+
extends TableCellProps {
|
|
16
17
|
parentRowRef: RefObject<HTMLTableRowElement>;
|
|
17
18
|
row: MRT_Row<TData>;
|
|
18
19
|
rowVirtualizer?: MRT_RowVirtualizer;
|
|
@@ -29,7 +30,7 @@ export const MRT_TableDetailPanel = <TData extends MRT_RowData>({
|
|
|
29
30
|
table,
|
|
30
31
|
virtualRow,
|
|
31
32
|
...rest
|
|
32
|
-
}:
|
|
33
|
+
}: MRT_TableDetailPanelProps<TData>) => {
|
|
33
34
|
const {
|
|
34
35
|
getState,
|
|
35
36
|
getVisibleLeafColumns,
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
} from '../../types';
|
|
9
9
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
export interface MRT_ColumnPinningButtonsProps<TData extends MRT_RowData>
|
|
12
|
+
extends BoxProps {
|
|
12
13
|
column: MRT_Column<TData>;
|
|
13
14
|
table: MRT_TableInstance<TData>;
|
|
14
15
|
}
|
|
@@ -17,7 +18,7 @@ export const MRT_ColumnPinningButtons = <TData extends MRT_RowData>({
|
|
|
17
18
|
column,
|
|
18
19
|
table,
|
|
19
20
|
...rest
|
|
20
|
-
}:
|
|
21
|
+
}: MRT_ColumnPinningButtonsProps<TData>) => {
|
|
21
22
|
const {
|
|
22
23
|
options: {
|
|
23
24
|
icons: { PushPinIcon },
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
import { getCommonTooltipProps } from '../../utils/style.utils';
|
|
10
10
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
11
11
|
|
|
12
|
-
interface
|
|
12
|
+
export interface MRT_CopyButtonProps<TData extends MRT_RowData>
|
|
13
|
+
extends ButtonProps {
|
|
13
14
|
cell: MRT_Cell<TData>;
|
|
14
15
|
table: MRT_TableInstance<TData>;
|
|
15
16
|
}
|
|
@@ -18,7 +19,7 @@ export const MRT_CopyButton = <TData extends MRT_RowData>({
|
|
|
18
19
|
cell,
|
|
19
20
|
table,
|
|
20
21
|
...rest
|
|
21
|
-
}:
|
|
22
|
+
}: MRT_CopyButtonProps<TData>) => {
|
|
22
23
|
const {
|
|
23
24
|
options: { localization, muiCopyButtonProps },
|
|
24
25
|
} = table;
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
} from '../../types';
|
|
11
11
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
export interface MRT_EditActionButtonsProps<TData extends MRT_RowData>
|
|
14
|
+
extends BoxProps {
|
|
14
15
|
row: MRT_Row<TData>;
|
|
15
16
|
table: MRT_TableInstance<TData>;
|
|
16
17
|
variant?: 'icon' | 'text';
|
|
@@ -21,7 +22,7 @@ export const MRT_EditActionButtons = <TData extends MRT_RowData>({
|
|
|
21
22
|
table,
|
|
22
23
|
variant = 'icon',
|
|
23
24
|
...rest
|
|
24
|
-
}:
|
|
25
|
+
}: MRT_EditActionButtonsProps<TData>) => {
|
|
25
26
|
const {
|
|
26
27
|
getState,
|
|
27
28
|
options: {
|
|
@@ -4,14 +4,15 @@ import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
|
4
4
|
import { getCommonTooltipProps } from '../../utils/style.utils';
|
|
5
5
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
6
6
|
|
|
7
|
-
interface
|
|
7
|
+
export interface MRT_ExpandAllButtonProps<TData extends MRT_RowData>
|
|
8
|
+
extends IconButtonProps {
|
|
8
9
|
table: MRT_TableInstance<TData>;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const MRT_ExpandAllButton = <TData extends MRT_RowData>({
|
|
12
13
|
table,
|
|
13
14
|
...rest
|
|
14
|
-
}:
|
|
15
|
+
}: MRT_ExpandAllButtonProps<TData>) => {
|
|
15
16
|
const {
|
|
16
17
|
getCanSomeRowsExpand,
|
|
17
18
|
getIsAllRowsExpanded,
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
import { getCommonTooltipProps } from '../../utils/style.utils';
|
|
11
11
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
export interface MRT_ExpandButtonProps<TData extends MRT_RowData>
|
|
14
|
+
extends IconButtonProps {
|
|
14
15
|
row: MRT_Row<TData>;
|
|
15
16
|
staticRowIndex?: number;
|
|
16
17
|
table: MRT_TableInstance<TData>;
|
|
@@ -20,7 +21,7 @@ export const MRT_ExpandButton = <TData extends MRT_RowData>({
|
|
|
20
21
|
row,
|
|
21
22
|
staticRowIndex,
|
|
22
23
|
table,
|
|
23
|
-
}:
|
|
24
|
+
}: MRT_ExpandButtonProps<TData>) => {
|
|
24
25
|
const theme = useTheme();
|
|
25
26
|
const {
|
|
26
27
|
getState,
|
|
@@ -5,7 +5,8 @@ import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
|
5
5
|
import { getCommonTooltipProps } from '../../utils/style.utils';
|
|
6
6
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
7
7
|
|
|
8
|
-
interface
|
|
8
|
+
export interface MRT_GrabHandleButtonProps<TData extends MRT_RowData>
|
|
9
|
+
extends IconButtonProps {
|
|
9
10
|
iconButtonProps?: IconButtonProps;
|
|
10
11
|
location?: 'column' | 'row';
|
|
11
12
|
onDragEnd: DragEventHandler<HTMLButtonElement>;
|
|
@@ -14,13 +15,10 @@ interface Props<TData extends MRT_RowData> extends IconButtonProps {
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const MRT_GrabHandleButton = <TData extends MRT_RowData>({
|
|
17
|
-
iconButtonProps,
|
|
18
18
|
location,
|
|
19
|
-
onDragEnd,
|
|
20
|
-
onDragStart,
|
|
21
19
|
table,
|
|
22
20
|
...rest
|
|
23
|
-
}:
|
|
21
|
+
}: MRT_GrabHandleButtonProps<TData>) => {
|
|
24
22
|
const {
|
|
25
23
|
options: {
|
|
26
24
|
icons: { DragHandleIcon },
|
|
@@ -28,25 +26,21 @@ export const MRT_GrabHandleButton = <TData extends MRT_RowData>({
|
|
|
28
26
|
},
|
|
29
27
|
} = table;
|
|
30
28
|
|
|
31
|
-
const _iconButtonProps = { ...iconButtonProps, ...rest };
|
|
32
|
-
|
|
33
29
|
return (
|
|
34
30
|
<Tooltip
|
|
35
31
|
{...getCommonTooltipProps('top')}
|
|
36
|
-
title={
|
|
32
|
+
title={rest?.title ?? localization.move}
|
|
37
33
|
>
|
|
38
34
|
<IconButton
|
|
39
|
-
aria-label={
|
|
35
|
+
aria-label={rest.title ?? localization.move}
|
|
40
36
|
disableRipple
|
|
41
37
|
draggable="true"
|
|
42
38
|
size="small"
|
|
43
|
-
{...
|
|
39
|
+
{...rest}
|
|
44
40
|
onClick={(e) => {
|
|
45
41
|
e.stopPropagation();
|
|
46
|
-
|
|
42
|
+
rest?.onClick?.(e);
|
|
47
43
|
}}
|
|
48
|
-
onDragEnd={onDragEnd}
|
|
49
|
-
onDragStart={onDragStart}
|
|
50
44
|
sx={(theme) => ({
|
|
51
45
|
'&:active': {
|
|
52
46
|
cursor: 'grabbing',
|
|
@@ -57,10 +51,10 @@ export const MRT_GrabHandleButton = <TData extends MRT_RowData>({
|
|
|
57
51
|
},
|
|
58
52
|
cursor: 'grab',
|
|
59
53
|
m: '0 -0.1rem',
|
|
60
|
-
opacity: location === 'row' ? 1 : 0.
|
|
54
|
+
opacity: location === 'row' ? 1 : 0.5,
|
|
61
55
|
p: '2px',
|
|
62
56
|
transition: 'all 150ms ease-in-out',
|
|
63
|
-
...(parseFromValuesOrFunc(
|
|
57
|
+
...(parseFromValuesOrFunc(rest?.sx, theme) as any),
|
|
64
58
|
})}
|
|
65
59
|
title={undefined}
|
|
66
60
|
>
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
import { getCommonTooltipProps } from '../../utils/style.utils';
|
|
11
11
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
export interface MRT_RowPinButtonProps<TData extends MRT_RowData>
|
|
14
|
+
extends IconButtonProps {
|
|
14
15
|
pinningPosition: RowPinningPosition;
|
|
15
16
|
row: MRT_Row<TData>;
|
|
16
17
|
table: MRT_TableInstance<TData>;
|
|
@@ -21,7 +22,7 @@ export const MRT_RowPinButton = <TData extends MRT_RowData>({
|
|
|
21
22
|
row,
|
|
22
23
|
table,
|
|
23
24
|
...rest
|
|
24
|
-
}:
|
|
25
|
+
}: MRT_RowPinButtonProps<TData>) => {
|
|
25
26
|
const {
|
|
26
27
|
options: {
|
|
27
28
|
icons: { CloseIcon, PushPinIcon },
|
|
@@ -4,14 +4,15 @@ import Tooltip from '@mui/material/Tooltip';
|
|
|
4
4
|
import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
5
5
|
import { MRT_ShowHideColumnsMenu } from '../menus/MRT_ShowHideColumnsMenu';
|
|
6
6
|
|
|
7
|
-
interface
|
|
7
|
+
export interface MRT_ShowHideColumnsButtonProps<TData extends MRT_RowData>
|
|
8
|
+
extends IconButtonProps {
|
|
8
9
|
table: MRT_TableInstance<TData>;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const MRT_ShowHideColumnsButton = <TData extends MRT_RowData>({
|
|
12
13
|
table,
|
|
13
14
|
...rest
|
|
14
|
-
}:
|
|
15
|
+
}: MRT_ShowHideColumnsButtonProps<TData>) => {
|
|
15
16
|
const {
|
|
16
17
|
options: {
|
|
17
18
|
icons: { ViewColumnIcon },
|
|
@@ -2,14 +2,15 @@ import IconButton, { type IconButtonProps } from '@mui/material/IconButton';
|
|
|
2
2
|
import Tooltip from '@mui/material/Tooltip';
|
|
3
3
|
import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
export interface MRT_ToggleDensePaddingButtonProps<TData extends MRT_RowData>
|
|
6
|
+
extends IconButtonProps {
|
|
6
7
|
table: MRT_TableInstance<TData>;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export const MRT_ToggleDensePaddingButton = <TData extends MRT_RowData>({
|
|
10
11
|
table,
|
|
11
12
|
...rest
|
|
12
|
-
}:
|
|
13
|
+
}: MRT_ToggleDensePaddingButtonProps<TData>) => {
|
|
13
14
|
const {
|
|
14
15
|
getState,
|
|
15
16
|
options: {
|
|
@@ -2,14 +2,15 @@ import IconButton, { type IconButtonProps } from '@mui/material/IconButton';
|
|
|
2
2
|
import Tooltip from '@mui/material/Tooltip';
|
|
3
3
|
import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
export interface MRT_ToggleFiltersButtonProps<TData extends MRT_RowData>
|
|
6
|
+
extends IconButtonProps {
|
|
6
7
|
table: MRT_TableInstance<TData>;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export const MRT_ToggleFiltersButton = <TData extends MRT_RowData>({
|
|
10
11
|
table,
|
|
11
12
|
...rest
|
|
12
|
-
}:
|
|
13
|
+
}: MRT_ToggleFiltersButtonProps<TData>) => {
|
|
13
14
|
const {
|
|
14
15
|
getState,
|
|
15
16
|
options: {
|
|
@@ -3,14 +3,15 @@ import IconButton, { type IconButtonProps } from '@mui/material/IconButton';
|
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
|
4
4
|
import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
5
5
|
|
|
6
|
-
interface
|
|
6
|
+
export interface MRT_ToggleFullScreenButtonProps<TData extends MRT_RowData>
|
|
7
|
+
extends IconButtonProps {
|
|
7
8
|
table: MRT_TableInstance<TData>;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export const MRT_ToggleFullScreenButton = <TData extends MRT_RowData>({
|
|
11
12
|
table,
|
|
12
13
|
...rest
|
|
13
|
-
}:
|
|
14
|
+
}: MRT_ToggleFullScreenButtonProps<TData>) => {
|
|
14
15
|
const {
|
|
15
16
|
getState,
|
|
16
17
|
options: {
|
|
@@ -2,14 +2,15 @@ import IconButton, { type IconButtonProps } from '@mui/material/IconButton';
|
|
|
2
2
|
import Tooltip from '@mui/material/Tooltip';
|
|
3
3
|
import { type MRT_RowData, type MRT_TableInstance } from '../../types';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
export interface MRT_ToggleGlobalFilterButtonProps<TData extends MRT_RowData>
|
|
6
|
+
extends IconButtonProps {
|
|
6
7
|
table: MRT_TableInstance<TData>;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export const MRT_ToggleGlobalFilterButton = <TData extends MRT_RowData>({
|
|
10
11
|
table,
|
|
11
12
|
...rest
|
|
12
|
-
}:
|
|
13
|
+
}: MRT_ToggleGlobalFilterButtonProps<TData>) => {
|
|
13
14
|
const {
|
|
14
15
|
getState,
|
|
15
16
|
options: {
|
|
@@ -23,7 +23,8 @@ const commonIconButtonStyles = {
|
|
|
23
23
|
width: '2rem',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
interface
|
|
26
|
+
export interface MRT_ToggleRowActionMenuButtonProps<TData extends MRT_RowData>
|
|
27
|
+
extends IconButtonProps {
|
|
27
28
|
cell: MRT_Cell<TData>;
|
|
28
29
|
row: MRT_Row<TData>;
|
|
29
30
|
staticRowIndex?: number;
|
|
@@ -36,7 +37,7 @@ export const MRT_ToggleRowActionMenuButton = <TData extends MRT_RowData>({
|
|
|
36
37
|
staticRowIndex,
|
|
37
38
|
table,
|
|
38
39
|
...rest
|
|
39
|
-
}:
|
|
40
|
+
}: MRT_ToggleRowActionMenuButtonProps<TData>) => {
|
|
40
41
|
const {
|
|
41
42
|
getState,
|
|
42
43
|
options: {
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
} from '../../types';
|
|
8
8
|
import { parseFromValuesOrFunc } from '../../utils/utils';
|
|
9
9
|
|
|
10
|
-
interface
|
|
10
|
+
export interface MRT_TableFooterProps<TData extends MRT_RowData>
|
|
11
|
+
extends TableFooterProps {
|
|
11
12
|
columnVirtualizer?: MRT_ColumnVirtualizer;
|
|
12
13
|
table: MRT_TableInstance<TData>;
|
|
13
14
|
}
|
|
@@ -16,7 +17,7 @@ export const MRT_TableFooter = <TData extends MRT_RowData>({
|
|
|
16
17
|
columnVirtualizer,
|
|
17
18
|
table,
|
|
18
19
|
...rest
|
|
19
|
-
}:
|
|
20
|
+
}: MRT_TableFooterProps<TData>) => {
|
|
20
21
|
const {
|
|
21
22
|
getFooterGroups,
|
|
22
23
|
getState,
|