material-react-table 1.15.0 → 1.15.1
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 +2 -2
- package/dist/cjs/index.js +15 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/material-react-table.esm.js +15 -18
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/package.json +27 -27
- package/src/body/MRT_TableBodyCell.tsx +1 -1
- package/src/body/MRT_TableBodyRow.tsx +7 -5
- package/src/buttons/MRT_ExpandAllButton.tsx +2 -3
- package/src/buttons/MRT_ExpandButton.tsx +2 -3
- package/src/buttons/MRT_FullScreenToggleButton.tsx +1 -1
- package/src/footer/MRT_TableFooterRow.tsx +2 -2
- package/src/head/MRT_TableHeadCellSortLabel.tsx +8 -9
- package/src/head/MRT_TableHeadRow.tsx +2 -2
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "1.15.
|
2
|
+
"version": "1.15.1",
|
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.",
|
@@ -60,33 +60,33 @@
|
|
60
60
|
"storybook:dev": "storybook dev -p 6006"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
|
-
"@babel/core": "^7.23.
|
63
|
+
"@babel/core": "^7.23.2",
|
64
64
|
"@babel/preset-react": "^7.22.15",
|
65
65
|
"@emotion/react": "^11.11.1",
|
66
66
|
"@emotion/styled": "^11.11.0",
|
67
67
|
"@faker-js/faker": "^8.1.0",
|
68
|
-
"@mui/icons-material": "^5.14.
|
69
|
-
"@mui/material": "^5.14.
|
70
|
-
"@rollup/plugin-babel": "^6.0.
|
71
|
-
"@rollup/plugin-node-resolve": "^15.2.
|
72
|
-
"@rollup/plugin-typescript": "^11.1.
|
68
|
+
"@mui/icons-material": "^5.14.13",
|
69
|
+
"@mui/material": "^5.14.13",
|
70
|
+
"@rollup/plugin-babel": "^6.0.4",
|
71
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
72
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
73
73
|
"@size-limit/preset-small-lib": "^9.0.0",
|
74
|
-
"@storybook/addon-a11y": "^7.4.
|
75
|
-
"@storybook/addon-essentials": "^7.4.
|
76
|
-
"@storybook/addon-interactions": "^7.4.
|
77
|
-
"@storybook/addon-links": "^7.4.
|
78
|
-
"@storybook/addon-storysource": "^7.4.
|
79
|
-
"@storybook/blocks": "^7.4.
|
80
|
-
"@storybook/react": "^7.4.
|
81
|
-
"@storybook/react-vite": "^7.4.
|
82
|
-
"@storybook/testing-library": "^0.2.
|
83
|
-
"@types/node": "^20.
|
84
|
-
"@types/react": "^18.2.
|
85
|
-
"@types/react-dom": "^18.2.
|
86
|
-
"@typescript-eslint/eslint-plugin": "^6.7.
|
87
|
-
"@typescript-eslint/parser": "^6.7.
|
74
|
+
"@storybook/addon-a11y": "^7.4.6",
|
75
|
+
"@storybook/addon-essentials": "^7.4.6",
|
76
|
+
"@storybook/addon-interactions": "^7.4.6",
|
77
|
+
"@storybook/addon-links": "^7.4.6",
|
78
|
+
"@storybook/addon-storysource": "^7.4.6",
|
79
|
+
"@storybook/blocks": "^7.4.6",
|
80
|
+
"@storybook/react": "^7.4.6",
|
81
|
+
"@storybook/react-vite": "^7.4.6",
|
82
|
+
"@storybook/testing-library": "^0.2.2",
|
83
|
+
"@types/node": "^20.8.6",
|
84
|
+
"@types/react": "^18.2.28",
|
85
|
+
"@types/react-dom": "^18.2.13",
|
86
|
+
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
87
|
+
"@typescript-eslint/parser": "^6.7.5",
|
88
88
|
"@vitejs/plugin-react": "^4.1.0",
|
89
|
-
"eslint": "^8.
|
89
|
+
"eslint": "^8.51.0",
|
90
90
|
"eslint-plugin-mui-path-imports": "^0.0.15",
|
91
91
|
"prop-types": "^15.8.1",
|
92
92
|
"react": "^18.2.0",
|
@@ -94,14 +94,14 @@
|
|
94
94
|
"react-is": "^18.2.0",
|
95
95
|
"rollup": "^2.79.1",
|
96
96
|
"rollup-plugin-copy": "^3.5.0",
|
97
|
-
"rollup-plugin-dts": "^6.0
|
97
|
+
"rollup-plugin-dts": "^6.1.0",
|
98
98
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
99
99
|
"size-limit": "^9.0.0",
|
100
|
-
"storybook": "^7.4.
|
100
|
+
"storybook": "^7.4.6",
|
101
101
|
"storybook-dark-mode": "^3.0.1",
|
102
102
|
"tslib": "^2.6.2",
|
103
103
|
"typescript": "^5.2.2",
|
104
|
-
"vite": "^4.4.
|
104
|
+
"vite": "^4.4.11"
|
105
105
|
},
|
106
106
|
"peerDependencies": {
|
107
107
|
"@emotion/react": ">=11",
|
@@ -113,8 +113,8 @@
|
|
113
113
|
},
|
114
114
|
"dependencies": {
|
115
115
|
"@tanstack/match-sorter-utils": "8.8.4",
|
116
|
-
"@tanstack/react-table": "8.10.
|
117
|
-
"@tanstack/react-virtual": "3.0.0-beta.
|
116
|
+
"@tanstack/react-table": "8.10.7",
|
117
|
+
"@tanstack/react-virtual": "3.0.0-beta.65",
|
118
118
|
"highlight-words": "1.2.2"
|
119
119
|
}
|
120
120
|
}
|
@@ -253,7 +253,7 @@ export const MRT_TableBodyCell = ({
|
|
253
253
|
<>
|
254
254
|
{cell.getIsPlaceholder() ? (
|
255
255
|
columnDef.PlaceholderCell?.({ cell, column, row, table }) ?? null
|
256
|
-
) :
|
256
|
+
) : isLoading || showSkeletons ? (
|
257
257
|
<Skeleton
|
258
258
|
animation="wave"
|
259
259
|
height={20}
|
@@ -120,16 +120,18 @@ export const MRT_TableBodyRow = ({
|
|
120
120
|
? (cellOrVirtualCell as VirtualItem)
|
121
121
|
: undefined,
|
122
122
|
};
|
123
|
-
return
|
123
|
+
return cell ? (
|
124
|
+
memoMode === 'cells' &&
|
124
125
|
cell.column.columnDef.columnDefType === 'data' &&
|
125
126
|
!draggingColumn &&
|
126
127
|
!draggingRow &&
|
127
128
|
editingCell?.id !== cell.id &&
|
128
129
|
editingRow?.id !== row.id ? (
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
130
|
+
<Memo_MRT_TableBodyCell key={cell.id} {...props} />
|
131
|
+
) : (
|
132
|
+
<MRT_TableBodyCell key={cell.id} {...props} />
|
133
|
+
)
|
134
|
+
) : null;
|
133
135
|
})}
|
134
136
|
{virtualPaddingRight ? (
|
135
137
|
<td style={{ display: 'flex', width: virtualPaddingRight }} />
|
@@ -35,9 +35,8 @@ export const MRT_ExpandAllButton = ({ table }: Props) => {
|
|
35
35
|
enterDelay={1000}
|
36
36
|
enterNextDelay={1000}
|
37
37
|
title={
|
38
|
-
iconButtonProps?.title ??
|
39
|
-
|
40
|
-
: localization.expandAll
|
38
|
+
iconButtonProps?.title ??
|
39
|
+
(isAllRowsExpanded ? localization.collapseAll : localization.expandAll)
|
41
40
|
}
|
42
41
|
>
|
43
42
|
<span>
|
@@ -44,9 +44,8 @@ export const MRT_ExpandButton = <TData extends Record<string, any> = {}>({
|
|
44
44
|
enterDelay={1000}
|
45
45
|
enterNextDelay={1000}
|
46
46
|
title={
|
47
|
-
iconButtonProps?.title ??
|
48
|
-
|
49
|
-
: localization.expand
|
47
|
+
iconButtonProps?.title ??
|
48
|
+
(isExpanded ? localization.collapse : localization.expand)
|
50
49
|
}
|
51
50
|
>
|
52
51
|
<span>
|
@@ -31,7 +31,7 @@ export const MRT_FullScreenToggleButton = <
|
|
31
31
|
return (
|
32
32
|
<Tooltip arrow title={rest?.title ?? localization.toggleFullScreen}>
|
33
33
|
<IconButton
|
34
|
-
aria-label={localization.
|
34
|
+
aria-label={localization.toggleFullScreen}
|
35
35
|
onClick={handleToggleFullScreen}
|
36
36
|
{...rest}
|
37
37
|
title={undefined}
|
@@ -63,9 +63,9 @@ export const MRT_TableFooterRow = ({
|
|
63
63
|
? footerGroup.headers[footerOrVirtualFooter.index]
|
64
64
|
: (footerOrVirtualFooter as MRT_Header);
|
65
65
|
|
66
|
-
return (
|
66
|
+
return footer ? (
|
67
67
|
<MRT_TableFooterCell footer={footer} key={footer.id} table={table} />
|
68
|
-
);
|
68
|
+
) : null;
|
69
69
|
})}
|
70
70
|
{virtualPaddingRight ? (
|
71
71
|
<th style={{ display: 'flex', width: virtualPaddingRight }} />
|
@@ -25,12 +25,15 @@ export const MRT_TableHeadCellSortLabel = ({
|
|
25
25
|
const { column } = header;
|
26
26
|
const { columnDef } = column;
|
27
27
|
const { sorting } = getState();
|
28
|
+
const sorted = column.getIsSorted();
|
28
29
|
|
29
|
-
const sortTooltip =
|
30
|
-
?
|
30
|
+
const sortTooltip = sorted
|
31
|
+
? sorted === 'desc'
|
31
32
|
? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
|
32
33
|
: localization.sortedByColumnAsc.replace('{column}', columnDef.header)
|
33
|
-
:
|
34
|
+
: column.getNextSortingOrder() === 'desc'
|
35
|
+
? localization.sortByColumnDesc.replace('{column}', columnDef.header)
|
36
|
+
: localization.sortByColumnAsc.replace('{column}', columnDef.header);
|
34
37
|
|
35
38
|
return (
|
36
39
|
<Tooltip arrow placement="top" title={sortTooltip}>
|
@@ -40,12 +43,8 @@ export const MRT_TableHeadCellSortLabel = ({
|
|
40
43
|
>
|
41
44
|
<TableSortLabel
|
42
45
|
aria-label={sortTooltip}
|
43
|
-
active={!!
|
44
|
-
direction={
|
45
|
-
column.getIsSorted()
|
46
|
-
? (column.getIsSorted() as 'asc' | 'desc')
|
47
|
-
: undefined
|
48
|
-
}
|
46
|
+
active={!!sorted}
|
47
|
+
direction={sorted ? (sorted as 'asc' | 'desc') : undefined}
|
49
48
|
sx={{
|
50
49
|
flex: '0 0',
|
51
50
|
width: '2.4ch',
|
@@ -53,9 +53,9 @@ export const MRT_TableHeadRow = ({
|
|
53
53
|
? headerGroup.headers[headerOrVirtualHeader.index]
|
54
54
|
: (headerOrVirtualHeader as MRT_Header);
|
55
55
|
|
56
|
-
return (
|
56
|
+
return header ? (
|
57
57
|
<MRT_TableHeadCell header={header} key={header.id} table={table} />
|
58
|
-
);
|
58
|
+
) : null;
|
59
59
|
})}
|
60
60
|
{virtualPaddingRight ? (
|
61
61
|
<th style={{ display: 'flex', width: virtualPaddingRight }} />
|