material-react-table 0.38.3 → 0.38.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/body/MRT_EditRowModal.d.ts +1 -0
- package/dist/cjs/body/MRT_TableBodyRow.d.ts +1 -0
- package/dist/cjs/buttons/MRT_ColumnPinningButtons.d.ts +1 -0
- package/dist/cjs/buttons/MRT_EditActionButtons.d.ts +1 -0
- package/dist/cjs/buttons/MRT_FullScreenToggleButton.d.ts +1 -0
- package/dist/cjs/buttons/MRT_ShowHideColumnsButton.d.ts +1 -0
- package/dist/cjs/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -0
- package/dist/cjs/buttons/MRT_ToggleFiltersButton.d.ts +1 -0
- package/dist/cjs/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -0
- package/dist/cjs/index.js +15 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/inputs/MRT_EditCellTextField.d.ts +1 -0
- package/dist/cjs/inputs/MRT_GlobalFilterTextField.d.ts +1 -0
- package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +1 -0
- package/dist/cjs/menus/MRT_ShowHideColumnsMenu.d.ts +1 -0
- package/dist/cjs/table/MRT_TableRoot.d.ts +1 -0
- package/dist/esm/body/MRT_EditRowModal.d.ts +1 -0
- package/dist/esm/body/MRT_TableBodyRow.d.ts +1 -0
- package/dist/esm/buttons/MRT_ColumnPinningButtons.d.ts +1 -0
- package/dist/esm/buttons/MRT_EditActionButtons.d.ts +1 -0
- package/dist/esm/buttons/MRT_FullScreenToggleButton.d.ts +1 -0
- package/dist/esm/buttons/MRT_ShowHideColumnsButton.d.ts +1 -0
- package/dist/esm/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -0
- package/dist/esm/buttons/MRT_ToggleFiltersButton.d.ts +1 -0
- package/dist/esm/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -0
- package/dist/esm/inputs/MRT_EditCellTextField.d.ts +1 -0
- package/dist/esm/inputs/MRT_GlobalFilterTextField.d.ts +1 -0
- package/dist/esm/material-react-table.esm.js +15 -10
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +1 -0
- package/dist/esm/menus/MRT_ShowHideColumnsMenu.d.ts +1 -0
- package/dist/esm/table/MRT_TableRoot.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/body/MRT_TableBody.tsx +1 -0
- package/src/body/MRT_TableBodyCellValue.tsx +10 -11
- package/src/body/MRT_TableBodyRow.tsx +14 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { MutableRefObject, Dispatch, SetStateAction, ReactNode, DragEvent } from 'react';
|
|
2
3
|
import { ButtonProps, TextFieldProps, TableCellProps, IconButtonProps, ToolbarProps, LinearProgressProps, CheckboxProps, SkeletonProps, TableBodyProps, TableRowProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, PaperProps, TableProps, ChipProps, AlertProps } from '@mui/material';
|
|
3
4
|
import { Row, Table, TableState, ColumnDef, DeepKeys, Column, Header, HeaderGroup, Cell, SortingFn, FilterFn, TableOptions, OnChangeFn } from '@tanstack/react-table';
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.38.
|
|
2
|
+
"version": "0.38.4",
|
|
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.",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"react": "^18.2.0",
|
|
79
79
|
"react-dom": "^18.2.0",
|
|
80
80
|
"react-is": "^18.2.0",
|
|
81
|
-
"rollup": "^2.78.
|
|
81
|
+
"rollup": "^2.78.1",
|
|
82
82
|
"rollup-plugin-dts": "^4.2.2",
|
|
83
83
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
84
84
|
"size-limit": "^8.0.1",
|
|
@@ -12,8 +12,8 @@ export const MRT_TableBodyCellValue: FC<Props> = ({ cell, table }) => {
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<>
|
|
15
|
-
{cell.getIsAggregated() &&
|
|
16
|
-
? columnDef.AggregatedCell
|
|
15
|
+
{cell.getIsAggregated() && columnDef.AggregatedCell
|
|
16
|
+
? columnDef.AggregatedCell({
|
|
17
17
|
cell,
|
|
18
18
|
column,
|
|
19
19
|
row,
|
|
@@ -21,15 +21,14 @@ export const MRT_TableBodyCellValue: FC<Props> = ({ cell, table }) => {
|
|
|
21
21
|
})
|
|
22
22
|
: row.getIsGrouped() && !cell.getIsGrouped()
|
|
23
23
|
? null
|
|
24
|
-
:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
cell.renderValue())}
|
|
24
|
+
: cell.getIsGrouped() && columnDef.GroupedCell
|
|
25
|
+
? columnDef.GroupedCell({
|
|
26
|
+
cell,
|
|
27
|
+
column,
|
|
28
|
+
row,
|
|
29
|
+
table,
|
|
30
|
+
})
|
|
31
|
+
: columnDef?.Cell?.({ cell, column, row, table }) ?? cell.renderValue()}
|
|
33
32
|
</>
|
|
34
33
|
);
|
|
35
34
|
};
|
|
@@ -8,9 +8,15 @@ interface Props {
|
|
|
8
8
|
row: MRT_Row;
|
|
9
9
|
rowIndex: number;
|
|
10
10
|
table: MRT_TableInstance;
|
|
11
|
+
virtualRow?: any;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export const MRT_TableBodyRow: FC<Props> = ({
|
|
14
|
+
export const MRT_TableBodyRow: FC<Props> = ({
|
|
15
|
+
row,
|
|
16
|
+
rowIndex,
|
|
17
|
+
table,
|
|
18
|
+
virtualRow,
|
|
19
|
+
}) => {
|
|
14
20
|
const theme = useTheme();
|
|
15
21
|
const {
|
|
16
22
|
getIsSomeColumnsPinned,
|
|
@@ -31,7 +37,7 @@ export const MRT_TableBodyRow: FC<Props> = ({ row, rowIndex, table }) => {
|
|
|
31
37
|
}
|
|
32
38
|
};
|
|
33
39
|
|
|
34
|
-
const rowRef = useRef<HTMLTableRowElement>(null);
|
|
40
|
+
const rowRef = useRef<HTMLTableRowElement | null>(null);
|
|
35
41
|
|
|
36
42
|
const draggingBorder =
|
|
37
43
|
draggingRow?.id === row.id
|
|
@@ -52,7 +58,12 @@ export const MRT_TableBodyRow: FC<Props> = ({ row, rowIndex, table }) => {
|
|
|
52
58
|
onDragEnter={handleDragEnter}
|
|
53
59
|
hover
|
|
54
60
|
selected={row.getIsSelected()}
|
|
55
|
-
ref={
|
|
61
|
+
ref={(node) => {
|
|
62
|
+
rowRef.current = node;
|
|
63
|
+
if (virtualRow?.measureRef) {
|
|
64
|
+
virtualRow.measureRef = node;
|
|
65
|
+
}
|
|
66
|
+
}}
|
|
56
67
|
{...tableRowProps}
|
|
57
68
|
sx={(theme) => ({
|
|
58
69
|
backgroundColor: lighten(theme.palette.background.default, 0.06),
|