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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.15.0",
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.0",
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.9",
69
- "@mui/material": "^5.14.10",
70
- "@rollup/plugin-babel": "^6.0.3",
71
- "@rollup/plugin-node-resolve": "^15.2.1",
72
- "@rollup/plugin-typescript": "^11.1.4",
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.5",
75
- "@storybook/addon-essentials": "^7.4.5",
76
- "@storybook/addon-interactions": "^7.4.5",
77
- "@storybook/addon-links": "^7.4.5",
78
- "@storybook/addon-storysource": "^7.4.5",
79
- "@storybook/blocks": "^7.4.5",
80
- "@storybook/react": "^7.4.5",
81
- "@storybook/react-vite": "^7.4.5",
82
- "@storybook/testing-library": "^0.2.1",
83
- "@types/node": "^20.7.0",
84
- "@types/react": "^18.2.22",
85
- "@types/react-dom": "^18.2.7",
86
- "@typescript-eslint/eslint-plugin": "^6.7.3",
87
- "@typescript-eslint/parser": "^6.7.3",
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.50.0",
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.2",
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.5",
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.9"
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.3",
117
- "@tanstack/react-virtual": "3.0.0-beta.60",
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
- ) : (isLoading || showSkeletons) && cell.getValue() === null ? (
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 memoMode === 'cells' &&
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
- <Memo_MRT_TableBodyCell key={cell.id} {...props} />
130
- ) : (
131
- <MRT_TableBodyCell key={cell.id} {...props} />
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 ?? isAllRowsExpanded
39
- ? localization.collapseAll
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 ?? isExpanded
48
- ? localization.collapse
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.showHideFilters}
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 = column.getIsSorted()
30
- ? column.getIsSorted() === 'desc'
30
+ const sortTooltip = sorted
31
+ ? sorted === 'desc'
31
32
  ? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
32
33
  : localization.sortedByColumnAsc.replace('{column}', columnDef.header)
33
- : localization.unsorted;
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={!!column.getIsSorted()}
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 }} />