material-react-table 0.9.7 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MaterialReactTable.d.ts +133 -129
- package/dist/body/MRT_TableBody.d.ts +1 -1
- package/dist/body/MRT_TableBodyCell.d.ts +1 -1
- package/dist/body/MRT_TableBodyRow.d.ts +1 -1
- package/dist/body/MRT_TableDetailPanel.d.ts +1 -1
- package/dist/buttons/MRT_ColumnPinningButtons.d.ts +1 -1
- package/dist/buttons/MRT_CopyButton.d.ts +1 -1
- package/dist/buttons/MRT_EditActionButtons.d.ts +1 -1
- package/dist/buttons/MRT_ExpandAllButton.d.ts +1 -1
- package/dist/buttons/MRT_ExpandButton.d.ts +1 -1
- package/dist/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
- package/dist/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleColumnActionMenuButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +1 -1
- package/dist/footer/MRT_TableFooter.d.ts +1 -1
- package/dist/footer/MRT_TableFooterCell.d.ts +1 -1
- package/dist/footer/MRT_TableFooterRow.d.ts +1 -1
- package/dist/head/MRT_DraggableTableHeadCell.d.ts +1 -1
- package/dist/head/MRT_TableHead.d.ts +1 -1
- package/dist/head/MRT_TableHeadCell.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellFilterContainer.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellResizeHandle.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/head/MRT_TableHeadRow.d.ts +1 -1
- package/dist/inputs/MRT_EditCellTextField.d.ts +1 -1
- package/dist/inputs/MRT_FilterRangeFields.d.ts +1 -1
- package/dist/inputs/MRT_FilterTextField.d.ts +1 -1
- package/dist/inputs/MRT_SearchTextField.d.ts +1 -1
- package/dist/inputs/MRT_SelectCheckbox.d.ts +1 -1
- package/dist/material-react-table.cjs.development.js +526 -538
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +526 -538
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ColumnActionMenu.d.ts +1 -1
- package/dist/menus/MRT_FilterOptionMenu.d.ts +1 -1
- package/dist/menus/MRT_RowActionMenu.d.ts +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
- package/dist/table/MRT_Table.d.ts +1 -1
- package/dist/table/MRT_TableContainer.d.ts +1 -1
- package/dist/table/MRT_TablePaper.d.ts +1 -1
- package/dist/toolbar/MRT_LinearProgressBar.d.ts +1 -1
- package/dist/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarBottom.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarTop.d.ts +1 -1
- package/dist/utils.d.ts +2 -2
- package/package.json +1 -1
- package/src/MaterialReactTable.tsx +148 -157
- package/src/body/MRT_TableBody.tsx +5 -8
- package/src/body/MRT_TableBodyCell.tsx +14 -18
- package/src/body/MRT_TableBodyRow.tsx +7 -11
- package/src/body/MRT_TableDetailPanel.tsx +12 -10
- package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -6
- package/src/buttons/MRT_CopyButton.tsx +5 -9
- package/src/buttons/MRT_EditActionButtons.tsx +4 -4
- package/src/buttons/MRT_ExpandAllButton.tsx +3 -3
- package/src/buttons/MRT_ExpandButton.tsx +4 -4
- package/src/buttons/MRT_FullScreenToggleButton.tsx +4 -4
- package/src/buttons/MRT_GrabHandleButton.tsx +3 -3
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +4 -7
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +6 -6
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +4 -4
- package/src/buttons/MRT_ToggleFiltersButton.tsx +4 -7
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +5 -5
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -9
- package/src/footer/MRT_TableFooter.tsx +5 -5
- package/src/footer/MRT_TableFooterCell.tsx +6 -6
- package/src/footer/MRT_TableFooterRow.tsx +5 -8
- package/src/head/MRT_DraggableTableHeadCell.tsx +4 -7
- package/src/head/MRT_TableHead.tsx +5 -5
- package/src/head/MRT_TableHeadCell.tsx +14 -22
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +6 -7
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +3 -3
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +3 -3
- package/src/head/MRT_TableHeadCellSortLabel.tsx +3 -6
- package/src/head/MRT_TableHeadRow.tsx +6 -6
- package/src/inputs/MRT_EditCellTextField.tsx +10 -10
- package/src/inputs/MRT_FilterRangeFields.tsx +5 -13
- package/src/inputs/MRT_FilterTextField.tsx +10 -14
- package/src/inputs/MRT_SearchTextField.tsx +6 -6
- package/src/inputs/MRT_SelectCheckbox.tsx +10 -16
- package/src/menus/MRT_ColumnActionMenu.tsx +5 -5
- package/src/menus/MRT_FilterOptionMenu.tsx +33 -33
- package/src/menus/MRT_RowActionMenu.tsx +4 -4
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +7 -10
- package/src/table/MRT_Table.tsx +7 -7
- package/src/table/MRT_TableContainer.tsx +5 -8
- package/src/table/MRT_TablePaper.tsx +7 -9
- package/src/table/MRT_TableRoot.tsx +13 -21
- package/src/toolbar/MRT_LinearProgressBar.tsx +4 -7
- package/src/toolbar/MRT_TablePagination.tsx +4 -4
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +6 -8
- package/src/toolbar/MRT_ToolbarBottom.tsx +8 -8
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +10 -12
- package/src/toolbar/MRT_ToolbarTop.tsx +10 -10
- package/src/utils.ts +2 -2
- package/dist/enums.d.ts +0 -13
- package/src/enums.ts +0 -13
|
@@ -5,14 +5,11 @@ import { MRT_TableBodyRow } from './MRT_TableBodyRow';
|
|
|
5
5
|
import type { MRT_Row, MRT_TableInstance } from '..';
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
|
-
|
|
8
|
+
instance: MRT_TableInstance;
|
|
9
9
|
tableContainerRef: RefObject<HTMLDivElement>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const MRT_TableBody: FC<Props> = ({
|
|
13
|
-
tableInstance,
|
|
14
|
-
tableContainerRef,
|
|
15
|
-
}) => {
|
|
12
|
+
export const MRT_TableBody: FC<Props> = ({ instance, tableContainerRef }) => {
|
|
16
13
|
const {
|
|
17
14
|
getPaginationRowModel,
|
|
18
15
|
getPrePaginationRowModel,
|
|
@@ -23,13 +20,13 @@ export const MRT_TableBody: FC<Props> = ({
|
|
|
23
20
|
muiTableBodyProps,
|
|
24
21
|
virtualizerProps,
|
|
25
22
|
},
|
|
26
|
-
} =
|
|
23
|
+
} = instance;
|
|
27
24
|
|
|
28
25
|
const { isDensePadding } = getState();
|
|
29
26
|
|
|
30
27
|
const tableBodyProps =
|
|
31
28
|
muiTableBodyProps instanceof Function
|
|
32
|
-
? muiTableBodyProps({
|
|
29
|
+
? muiTableBodyProps({ instance })
|
|
33
30
|
: muiTableBodyProps;
|
|
34
31
|
|
|
35
32
|
const rows = enablePagination
|
|
@@ -72,7 +69,7 @@ export const MRT_TableBody: FC<Props> = ({
|
|
|
72
69
|
rowIndex={
|
|
73
70
|
enableRowVirtualization ? rowOrVirtualRow.index : rowIndex
|
|
74
71
|
}
|
|
75
|
-
|
|
72
|
+
instance={instance}
|
|
76
73
|
/>
|
|
77
74
|
);
|
|
78
75
|
},
|
|
@@ -10,14 +10,14 @@ interface Props {
|
|
|
10
10
|
cell: MRT_Cell;
|
|
11
11
|
enableHover?: boolean;
|
|
12
12
|
rowIndex: number;
|
|
13
|
-
|
|
13
|
+
instance: MRT_TableInstance;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const MRT_TableBodyCell: FC<Props> = ({
|
|
17
17
|
cell,
|
|
18
18
|
enableHover,
|
|
19
19
|
rowIndex,
|
|
20
|
-
|
|
20
|
+
instance,
|
|
21
21
|
}) => {
|
|
22
22
|
const {
|
|
23
23
|
getState,
|
|
@@ -35,7 +35,7 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
35
35
|
},
|
|
36
36
|
setColumnOrder,
|
|
37
37
|
setCurrentEditingCell,
|
|
38
|
-
} =
|
|
38
|
+
} = instance;
|
|
39
39
|
|
|
40
40
|
const {
|
|
41
41
|
columnOrder,
|
|
@@ -58,12 +58,12 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
58
58
|
|
|
59
59
|
const mTableCellBodyProps =
|
|
60
60
|
muiTableBodyCellProps instanceof Function
|
|
61
|
-
? muiTableBodyCellProps({ cell,
|
|
61
|
+
? muiTableBodyCellProps({ cell, instance })
|
|
62
62
|
: muiTableBodyCellProps;
|
|
63
63
|
|
|
64
64
|
const mcTableCellBodyProps =
|
|
65
65
|
columnDef.muiTableBodyCellProps instanceof Function
|
|
66
|
-
? columnDef.muiTableBodyCellProps({ cell,
|
|
66
|
+
? columnDef.muiTableBodyCellProps({ cell, instance })
|
|
67
67
|
: columnDef.muiTableBodyCellProps;
|
|
68
68
|
|
|
69
69
|
const tableCellProps = {
|
|
@@ -112,7 +112,7 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
112
112
|
const getIsLastLeftPinnedColumn = () => {
|
|
113
113
|
return (
|
|
114
114
|
column.getIsPinned() === 'left' &&
|
|
115
|
-
|
|
115
|
+
instance.getLeftLeafHeaders().length - 1 === column.getPinnedIndex()
|
|
116
116
|
);
|
|
117
117
|
};
|
|
118
118
|
|
|
@@ -122,9 +122,7 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
122
122
|
|
|
123
123
|
const getTotalRight = () => {
|
|
124
124
|
return (
|
|
125
|
-
(
|
|
126
|
-
1 -
|
|
127
|
-
column.getPinnedIndex()) *
|
|
125
|
+
(instance.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) *
|
|
128
126
|
150
|
|
129
127
|
);
|
|
130
128
|
};
|
|
@@ -132,7 +130,7 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
132
130
|
return (
|
|
133
131
|
<TableCell
|
|
134
132
|
onClick={(event: MouseEvent<HTMLTableCellElement>) =>
|
|
135
|
-
onMrtCellClick?.({ event, cell,
|
|
133
|
+
onMrtCellClick?.({ event, cell, instance })
|
|
136
134
|
}
|
|
137
135
|
onDoubleClick={handleDoubleClick}
|
|
138
136
|
{...tableCellProps}
|
|
@@ -202,28 +200,26 @@ export const MRT_TableBodyCell: FC<Props> = ({
|
|
|
202
200
|
column.id === 'mrt-row-numbers' ? (
|
|
203
201
|
rowIndex + 1
|
|
204
202
|
) : columnDefType === 'display' ? (
|
|
205
|
-
columnDef.Cell?.({ cell,
|
|
203
|
+
columnDef.Cell?.({ cell, instance })
|
|
206
204
|
) : cell.getIsPlaceholder() ||
|
|
207
205
|
(row.getIsGrouped() &&
|
|
208
206
|
column.id !==
|
|
209
207
|
row.groupingColumnId) ? null : cell.getIsAggregated() ? (
|
|
208
|
+
columnDef.AggregatedCell?.({ cell, instance }) ??
|
|
210
209
|
cell.renderAggregatedCell()
|
|
211
210
|
) : isEditing ? (
|
|
212
|
-
<MRT_EditCellTextField cell={cell}
|
|
211
|
+
<MRT_EditCellTextField cell={cell} instance={instance} />
|
|
213
212
|
) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
|
214
213
|
columnDef.enableClickToCopy !== false ? (
|
|
215
214
|
<>
|
|
216
|
-
<MRT_CopyButton cell={cell}
|
|
217
|
-
<>
|
|
218
|
-
{columnDef?.Cell?.({ cell, tableInstance }) ??
|
|
219
|
-
cell.renderCell()}
|
|
220
|
-
</>
|
|
215
|
+
<MRT_CopyButton cell={cell} instance={instance}>
|
|
216
|
+
<>{columnDef?.Cell?.({ cell, instance }) ?? cell.renderCell()}</>
|
|
221
217
|
</MRT_CopyButton>
|
|
222
218
|
{row.getIsGrouped() && <> ({row.subRows?.length})</>}
|
|
223
219
|
</>
|
|
224
220
|
) : (
|
|
225
221
|
<>
|
|
226
|
-
{columnDef?.Cell?.({ cell,
|
|
222
|
+
{columnDef?.Cell?.({ cell, instance }) ?? cell.renderCell()}
|
|
227
223
|
{row.getIsGrouped() && <> ({row.subRows?.length ?? ''})</>}
|
|
228
224
|
</>
|
|
229
225
|
)}
|
|
@@ -7,22 +7,18 @@ import type { MRT_Row, MRT_TableInstance } from '..';
|
|
|
7
7
|
interface Props {
|
|
8
8
|
row: MRT_Row;
|
|
9
9
|
rowIndex: number;
|
|
10
|
-
|
|
10
|
+
instance: MRT_TableInstance;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const MRT_TableBodyRow: FC<Props> = ({
|
|
14
|
-
row,
|
|
15
|
-
rowIndex,
|
|
16
|
-
tableInstance,
|
|
17
|
-
}) => {
|
|
13
|
+
export const MRT_TableBodyRow: FC<Props> = ({ row, rowIndex, instance }) => {
|
|
18
14
|
const {
|
|
19
15
|
getIsSomeColumnsPinned,
|
|
20
16
|
options: { muiTableBodyRowProps, onMrtRowClick, renderDetailPanel },
|
|
21
|
-
} =
|
|
17
|
+
} = instance;
|
|
22
18
|
|
|
23
19
|
const tableRowProps =
|
|
24
20
|
muiTableBodyRowProps instanceof Function
|
|
25
|
-
? muiTableBodyRowProps({ row,
|
|
21
|
+
? muiTableBodyRowProps({ row, instance })
|
|
26
22
|
: muiTableBodyRowProps;
|
|
27
23
|
|
|
28
24
|
return (
|
|
@@ -30,7 +26,7 @@ export const MRT_TableBodyRow: FC<Props> = ({
|
|
|
30
26
|
<TableRow
|
|
31
27
|
hover
|
|
32
28
|
onClick={(event: MouseEvent<HTMLTableRowElement>) =>
|
|
33
|
-
onMrtRowClick?.({ event, row,
|
|
29
|
+
onMrtRowClick?.({ event, row, instance })
|
|
34
30
|
}
|
|
35
31
|
selected={row.getIsSelected()}
|
|
36
32
|
{...tableRowProps}
|
|
@@ -54,12 +50,12 @@ export const MRT_TableBodyRow: FC<Props> = ({
|
|
|
54
50
|
key={cell.id}
|
|
55
51
|
enableHover={tableRowProps?.hover !== false}
|
|
56
52
|
rowIndex={rowIndex}
|
|
57
|
-
|
|
53
|
+
instance={instance}
|
|
58
54
|
/>
|
|
59
55
|
))}
|
|
60
56
|
</TableRow>
|
|
61
57
|
{renderDetailPanel && !row.getIsGrouped() && (
|
|
62
|
-
<MRT_TableDetailPanel row={row}
|
|
58
|
+
<MRT_TableDetailPanel row={row} instance={instance} />
|
|
63
59
|
)}
|
|
64
60
|
</>
|
|
65
61
|
);
|
|
@@ -4,10 +4,10 @@ import type { MRT_Row, MRT_TableInstance } from '..';
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
row: MRT_Row;
|
|
7
|
-
|
|
7
|
+
instance: MRT_TableInstance;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const MRT_TableDetailPanel: FC<Props> = ({ row,
|
|
10
|
+
export const MRT_TableDetailPanel: FC<Props> = ({ row, instance }) => {
|
|
11
11
|
const {
|
|
12
12
|
getVisibleLeafColumns,
|
|
13
13
|
options: {
|
|
@@ -16,16 +16,16 @@ export const MRT_TableDetailPanel: FC<Props> = ({ row, tableInstance }) => {
|
|
|
16
16
|
onMrtDetailPanelClick,
|
|
17
17
|
renderDetailPanel,
|
|
18
18
|
},
|
|
19
|
-
} =
|
|
19
|
+
} = instance;
|
|
20
20
|
|
|
21
21
|
const tableRowProps =
|
|
22
22
|
muiTableBodyRowProps instanceof Function
|
|
23
|
-
? muiTableBodyRowProps({ row,
|
|
23
|
+
? muiTableBodyRowProps({ row, instance })
|
|
24
24
|
: muiTableBodyRowProps;
|
|
25
25
|
|
|
26
26
|
const tableCellProps =
|
|
27
27
|
muiTableDetailPanelProps instanceof Function
|
|
28
|
-
? muiTableDetailPanelProps({ row,
|
|
28
|
+
? muiTableDetailPanelProps({ row, instance })
|
|
29
29
|
: muiTableDetailPanelProps;
|
|
30
30
|
|
|
31
31
|
return (
|
|
@@ -33,7 +33,7 @@ export const MRT_TableDetailPanel: FC<Props> = ({ row, tableInstance }) => {
|
|
|
33
33
|
<TableCell
|
|
34
34
|
colSpan={getVisibleLeafColumns().length}
|
|
35
35
|
onClick={(event: MouseEvent<HTMLTableCellElement>) =>
|
|
36
|
-
onMrtDetailPanelClick?.({ event, row,
|
|
36
|
+
onMrtDetailPanelClick?.({ event, row, instance })
|
|
37
37
|
}
|
|
38
38
|
{...tableCellProps}
|
|
39
39
|
sx={{
|
|
@@ -41,13 +41,15 @@ export const MRT_TableDetailPanel: FC<Props> = ({ row, tableInstance }) => {
|
|
|
41
41
|
pb: row.getIsExpanded() ? '1rem' : 0,
|
|
42
42
|
pt: row.getIsExpanded() ? '1rem' : 0,
|
|
43
43
|
transition: 'all 0.2s ease-in-out',
|
|
44
|
-
width: `${
|
|
44
|
+
width: `${instance.getTotalSize()}px`,
|
|
45
45
|
...tableCellProps?.sx,
|
|
46
46
|
}}
|
|
47
47
|
>
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
|
|
48
|
+
{renderDetailPanel && (
|
|
49
|
+
<Collapse in={row.getIsExpanded()}>
|
|
50
|
+
{renderDetailPanel({ row, instance })}
|
|
51
|
+
</Collapse>
|
|
52
|
+
)}
|
|
51
53
|
</TableCell>
|
|
52
54
|
</TableRow>
|
|
53
55
|
);
|
|
@@ -4,19 +4,16 @@ import type { MRT_Column, MRT_TableInstance } from '..';
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
column: MRT_Column;
|
|
7
|
-
|
|
7
|
+
instance: MRT_TableInstance;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const MRT_ColumnPinningButtons: FC<Props> = ({
|
|
11
|
-
column,
|
|
12
|
-
tableInstance,
|
|
13
|
-
}) => {
|
|
10
|
+
export const MRT_ColumnPinningButtons: FC<Props> = ({ column, instance }) => {
|
|
14
11
|
const {
|
|
15
12
|
options: {
|
|
16
13
|
icons: { PushPinIcon },
|
|
17
14
|
localization,
|
|
18
15
|
},
|
|
19
|
-
} =
|
|
16
|
+
} = instance;
|
|
20
17
|
|
|
21
18
|
const handlePinColumn = (pinDirection: 'left' | 'right' | false) => {
|
|
22
19
|
column.pin(pinDirection);
|
|
@@ -5,17 +5,13 @@ import { MRT_Cell, MRT_TableInstance } from '..';
|
|
|
5
5
|
interface Props {
|
|
6
6
|
cell: MRT_Cell;
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
|
|
8
|
+
instance: MRT_TableInstance;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const MRT_CopyButton: FC<Props> = ({
|
|
12
|
-
cell,
|
|
13
|
-
children,
|
|
14
|
-
tableInstance,
|
|
15
|
-
}) => {
|
|
11
|
+
export const MRT_CopyButton: FC<Props> = ({ cell, children, instance }) => {
|
|
16
12
|
const {
|
|
17
13
|
options: { localization, muiTableBodyCellCopyButtonProps },
|
|
18
|
-
} =
|
|
14
|
+
} = instance;
|
|
19
15
|
|
|
20
16
|
const { column } = cell;
|
|
21
17
|
|
|
@@ -31,14 +27,14 @@ export const MRT_CopyButton: FC<Props> = ({
|
|
|
31
27
|
|
|
32
28
|
const mTableBodyCellCopyButtonProps =
|
|
33
29
|
muiTableBodyCellCopyButtonProps instanceof Function
|
|
34
|
-
? muiTableBodyCellCopyButtonProps({ cell,
|
|
30
|
+
? muiTableBodyCellCopyButtonProps({ cell, instance })
|
|
35
31
|
: muiTableBodyCellCopyButtonProps;
|
|
36
32
|
|
|
37
33
|
const mcTableBodyCellCopyButtonProps =
|
|
38
34
|
columnDef.muiTableBodyCellCopyButtonProps instanceof Function
|
|
39
35
|
? columnDef.muiTableBodyCellCopyButtonProps({
|
|
40
36
|
cell,
|
|
41
|
-
|
|
37
|
+
instance,
|
|
42
38
|
})
|
|
43
39
|
: columnDef.muiTableBodyCellCopyButtonProps;
|
|
44
40
|
|
|
@@ -4,10 +4,10 @@ import type { MRT_Row, MRT_TableInstance } from '..';
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
row: MRT_Row;
|
|
7
|
-
|
|
7
|
+
instance: MRT_TableInstance;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const MRT_EditActionButtons: FC<Props> = ({ row,
|
|
10
|
+
export const MRT_EditActionButtons: FC<Props> = ({ row, instance }) => {
|
|
11
11
|
const {
|
|
12
12
|
getState,
|
|
13
13
|
options: {
|
|
@@ -16,7 +16,7 @@ export const MRT_EditActionButtons: FC<Props> = ({ row, tableInstance }) => {
|
|
|
16
16
|
onMrtEditRowSubmit,
|
|
17
17
|
},
|
|
18
18
|
setCurrentEditingRow,
|
|
19
|
-
} =
|
|
19
|
+
} = instance;
|
|
20
20
|
|
|
21
21
|
const { currentEditingRow } = getState();
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ export const MRT_EditActionButtons: FC<Props> = ({ row, tableInstance }) => {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const handleSave = () => {
|
|
29
|
-
onMrtEditRowSubmit?.({ row: currentEditingRow ?? row,
|
|
29
|
+
onMrtEditRowSubmit?.({ row: currentEditingRow ?? row, instance });
|
|
30
30
|
setCurrentEditingRow(null);
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -3,10 +3,10 @@ import { IconButton, Tooltip } from '@mui/material';
|
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
|
-
|
|
6
|
+
instance: MRT_TableInstance;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const MRT_ExpandAllButton: FC<Props> = ({
|
|
9
|
+
export const MRT_ExpandAllButton: FC<Props> = ({ instance }) => {
|
|
10
10
|
const {
|
|
11
11
|
getIsAllRowsExpanded,
|
|
12
12
|
getIsSomeRowsExpanded,
|
|
@@ -18,7 +18,7 @@ export const MRT_ExpandAllButton: FC<Props> = ({ tableInstance }) => {
|
|
|
18
18
|
renderDetailPanel,
|
|
19
19
|
},
|
|
20
20
|
toggleAllRowsExpanded,
|
|
21
|
-
} =
|
|
21
|
+
} = instance;
|
|
22
22
|
|
|
23
23
|
const { isDensePadding } = getState();
|
|
24
24
|
|
|
@@ -4,10 +4,10 @@ import type { MRT_Row, MRT_TableInstance } from '..';
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
row: MRT_Row;
|
|
7
|
-
|
|
7
|
+
instance: MRT_TableInstance;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const MRT_ExpandButton: FC<Props> = ({ row,
|
|
10
|
+
export const MRT_ExpandButton: FC<Props> = ({ row, instance }) => {
|
|
11
11
|
const {
|
|
12
12
|
getState,
|
|
13
13
|
options: {
|
|
@@ -16,13 +16,13 @@ export const MRT_ExpandButton: FC<Props> = ({ row, tableInstance }) => {
|
|
|
16
16
|
onMrtRowExpandChange,
|
|
17
17
|
renderDetailPanel,
|
|
18
18
|
},
|
|
19
|
-
} =
|
|
19
|
+
} = instance;
|
|
20
20
|
|
|
21
21
|
const { isDensePadding } = getState();
|
|
22
22
|
|
|
23
23
|
const handleToggleExpand = (event: MouseEvent<HTMLButtonElement>) => {
|
|
24
24
|
row.toggleExpanded();
|
|
25
|
-
onMrtRowExpandChange?.({ event, row,
|
|
25
|
+
onMrtRowExpandChange?.({ event, row, instance });
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
return (
|
|
@@ -3,11 +3,11 @@ import { IconButton, IconButtonProps, Tooltip } from '@mui/material';
|
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
|
|
5
5
|
interface Props extends IconButtonProps {
|
|
6
|
-
|
|
6
|
+
instance: MRT_TableInstance;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const MRT_FullScreenToggleButton: FC<Props> = ({
|
|
10
|
-
|
|
10
|
+
instance,
|
|
11
11
|
...rest
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
@@ -18,7 +18,7 @@ export const MRT_FullScreenToggleButton: FC<Props> = ({
|
|
|
18
18
|
onMrtToggleFullScreen,
|
|
19
19
|
},
|
|
20
20
|
setIsFullScreen,
|
|
21
|
-
} =
|
|
21
|
+
} = instance;
|
|
22
22
|
|
|
23
23
|
const { isFullScreen } = getState();
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@ export const MRT_FullScreenToggleButton: FC<Props> = ({
|
|
|
26
26
|
onMrtToggleFullScreen?.({
|
|
27
27
|
event,
|
|
28
28
|
isFullScreen: !isFullScreen,
|
|
29
|
-
|
|
29
|
+
instance,
|
|
30
30
|
});
|
|
31
31
|
setIsFullScreen(!isFullScreen);
|
|
32
32
|
};
|
|
@@ -4,17 +4,17 @@ import { MRT_TableInstance } from '..';
|
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
ref: Ref<HTMLButtonElement>;
|
|
7
|
-
|
|
7
|
+
instance: MRT_TableInstance;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const MRT_GrabHandleButton: FC<Props> = forwardRef(
|
|
11
|
-
({
|
|
11
|
+
({ instance }, ref) => {
|
|
12
12
|
const {
|
|
13
13
|
options: {
|
|
14
14
|
icons: { DragHandleIcon },
|
|
15
15
|
localization,
|
|
16
16
|
},
|
|
17
|
-
} =
|
|
17
|
+
} = instance;
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<Tooltip
|
|
@@ -4,19 +4,16 @@ import { MRT_ShowHideColumnsMenu } from '../menus/MRT_ShowHideColumnsMenu';
|
|
|
4
4
|
import { MRT_TableInstance } from '..';
|
|
5
5
|
|
|
6
6
|
interface Props extends IconButtonProps {
|
|
7
|
-
|
|
7
|
+
instance: MRT_TableInstance;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const MRT_ShowHideColumnsButton: FC<Props> = ({
|
|
11
|
-
tableInstance,
|
|
12
|
-
...rest
|
|
13
|
-
}) => {
|
|
10
|
+
export const MRT_ShowHideColumnsButton: FC<Props> = ({ instance, ...rest }) => {
|
|
14
11
|
const {
|
|
15
12
|
options: {
|
|
16
13
|
icons: { ViewColumnIcon },
|
|
17
14
|
localization,
|
|
18
15
|
},
|
|
19
|
-
} =
|
|
16
|
+
} = instance;
|
|
20
17
|
|
|
21
18
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
22
19
|
|
|
@@ -38,7 +35,7 @@ export const MRT_ShowHideColumnsButton: FC<Props> = ({
|
|
|
38
35
|
<MRT_ShowHideColumnsMenu
|
|
39
36
|
anchorEl={anchorEl}
|
|
40
37
|
setAnchorEl={setAnchorEl}
|
|
41
|
-
|
|
38
|
+
instance={instance}
|
|
42
39
|
/>
|
|
43
40
|
</>
|
|
44
41
|
);
|
|
@@ -5,12 +5,12 @@ import type { MRT_Header, MRT_TableInstance } from '..';
|
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
header: MRT_Header;
|
|
8
|
-
|
|
8
|
+
instance: MRT_TableInstance;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const MRT_ToggleColumnActionMenuButton: FC<Props> = ({
|
|
12
12
|
header,
|
|
13
|
-
|
|
13
|
+
instance,
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
16
|
options: {
|
|
@@ -18,7 +18,7 @@ export const MRT_ToggleColumnActionMenuButton: FC<Props> = ({
|
|
|
18
18
|
localization,
|
|
19
19
|
muiTableHeadCellColumnActionsButtonProps,
|
|
20
20
|
},
|
|
21
|
-
} =
|
|
21
|
+
} = instance;
|
|
22
22
|
|
|
23
23
|
const { column } = header;
|
|
24
24
|
|
|
@@ -34,14 +34,14 @@ export const MRT_ToggleColumnActionMenuButton: FC<Props> = ({
|
|
|
34
34
|
|
|
35
35
|
const mTableHeadCellColumnActionsButtonProps =
|
|
36
36
|
muiTableHeadCellColumnActionsButtonProps instanceof Function
|
|
37
|
-
? muiTableHeadCellColumnActionsButtonProps({ column,
|
|
37
|
+
? muiTableHeadCellColumnActionsButtonProps({ column, instance })
|
|
38
38
|
: muiTableHeadCellColumnActionsButtonProps;
|
|
39
39
|
|
|
40
40
|
const mcTableHeadCellColumnActionsButtonProps =
|
|
41
41
|
columnDef.muiTableHeadCellColumnActionsButtonProps instanceof Function
|
|
42
42
|
? columnDef.muiTableHeadCellColumnActionsButtonProps({
|
|
43
43
|
column,
|
|
44
|
-
|
|
44
|
+
instance,
|
|
45
45
|
})
|
|
46
46
|
: columnDef.muiTableHeadCellColumnActionsButtonProps;
|
|
47
47
|
|
|
@@ -84,7 +84,7 @@ export const MRT_ToggleColumnActionMenuButton: FC<Props> = ({
|
|
|
84
84
|
anchorEl={anchorEl}
|
|
85
85
|
header={header}
|
|
86
86
|
setAnchorEl={setAnchorEl}
|
|
87
|
-
|
|
87
|
+
instance={instance}
|
|
88
88
|
/>
|
|
89
89
|
</>
|
|
90
90
|
);
|
|
@@ -3,11 +3,11 @@ import { IconButton, IconButtonProps, Tooltip } from '@mui/material';
|
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
|
|
5
5
|
interface Props extends IconButtonProps {
|
|
6
|
-
|
|
6
|
+
instance: MRT_TableInstance;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const MRT_ToggleDensePaddingButton: FC<Props> = ({
|
|
10
|
-
|
|
10
|
+
instance,
|
|
11
11
|
...rest
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
@@ -18,7 +18,7 @@ export const MRT_ToggleDensePaddingButton: FC<Props> = ({
|
|
|
18
18
|
onMrtToggleDensePadding,
|
|
19
19
|
},
|
|
20
20
|
setIsDensePadding,
|
|
21
|
-
} =
|
|
21
|
+
} = instance;
|
|
22
22
|
|
|
23
23
|
const { isDensePadding } = getState();
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@ export const MRT_ToggleDensePaddingButton: FC<Props> = ({
|
|
|
26
26
|
onMrtToggleDensePadding?.({
|
|
27
27
|
event,
|
|
28
28
|
isDensePadding: !isDensePadding,
|
|
29
|
-
|
|
29
|
+
instance,
|
|
30
30
|
});
|
|
31
31
|
setIsDensePadding(!isDensePadding);
|
|
32
32
|
};
|
|
@@ -3,13 +3,10 @@ import { IconButton, IconButtonProps, Tooltip } from '@mui/material';
|
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
|
|
5
5
|
interface Props extends IconButtonProps {
|
|
6
|
-
|
|
6
|
+
instance: MRT_TableInstance;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const MRT_ToggleFiltersButton: FC<Props> = ({
|
|
10
|
-
tableInstance,
|
|
11
|
-
...rest
|
|
12
|
-
}) => {
|
|
9
|
+
export const MRT_ToggleFiltersButton: FC<Props> = ({ instance, ...rest }) => {
|
|
13
10
|
const {
|
|
14
11
|
getState,
|
|
15
12
|
options: {
|
|
@@ -18,7 +15,7 @@ export const MRT_ToggleFiltersButton: FC<Props> = ({
|
|
|
18
15
|
onMrtToggleShowFilters,
|
|
19
16
|
},
|
|
20
17
|
setShowFilters,
|
|
21
|
-
} =
|
|
18
|
+
} = instance;
|
|
22
19
|
|
|
23
20
|
const { showFilters } = getState();
|
|
24
21
|
|
|
@@ -26,7 +23,7 @@ export const MRT_ToggleFiltersButton: FC<Props> = ({
|
|
|
26
23
|
onMrtToggleShowFilters?.({
|
|
27
24
|
event,
|
|
28
25
|
showFilters: !showFilters,
|
|
29
|
-
|
|
26
|
+
instance,
|
|
30
27
|
});
|
|
31
28
|
setShowFilters(!showFilters);
|
|
32
29
|
};
|
|
@@ -3,11 +3,11 @@ import { IconButton, IconButtonProps, Tooltip } from '@mui/material';
|
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
|
|
5
5
|
interface Props extends IconButtonProps {
|
|
6
|
-
|
|
6
|
+
instance: MRT_TableInstance;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const MRT_ToggleGlobalFilterButton: FC<Props> = ({
|
|
10
|
-
|
|
10
|
+
instance,
|
|
11
11
|
...rest
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
@@ -20,20 +20,20 @@ export const MRT_ToggleGlobalFilterButton: FC<Props> = ({
|
|
|
20
20
|
onMrtToggleShowGlobalFilter,
|
|
21
21
|
},
|
|
22
22
|
setShowGlobalFilter,
|
|
23
|
-
} =
|
|
23
|
+
} = instance;
|
|
24
24
|
|
|
25
25
|
const { showGlobalFilter } = getState();
|
|
26
26
|
|
|
27
27
|
const textFieldProps =
|
|
28
28
|
muiSearchTextFieldProps instanceof Function
|
|
29
|
-
? muiSearchTextFieldProps({
|
|
29
|
+
? muiSearchTextFieldProps({ instance })
|
|
30
30
|
: muiSearchTextFieldProps;
|
|
31
31
|
|
|
32
32
|
const handleToggleSearch = (event: MouseEvent<HTMLButtonElement>) => {
|
|
33
33
|
onMrtToggleShowGlobalFilter?.({
|
|
34
34
|
event,
|
|
35
35
|
showGlobalFilter: !showGlobalFilter,
|
|
36
|
-
|
|
36
|
+
instance,
|
|
37
37
|
});
|
|
38
38
|
setShowGlobalFilter(!showGlobalFilter);
|
|
39
39
|
setTimeout(
|