material-react-table 2.0.0 → 2.0.2

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": "2.0.0",
2
+ "version": "2.0.2",
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,25 +66,25 @@
66
66
  "@emotion/react": "^11.11.1",
67
67
  "@emotion/styled": "^11.11.0",
68
68
  "@faker-js/faker": "^8.2.0",
69
- "@mui/icons-material": "^5.14.15",
70
- "@mui/material": "^5.14.15",
69
+ "@mui/icons-material": "^5.14.16",
70
+ "@mui/material": "^5.14.16",
71
71
  "@mui/x-date-pickers": "^6.17.0",
72
72
  "@rollup/plugin-typescript": "^11.1.5",
73
73
  "@size-limit/preset-small-lib": "^10.0.1",
74
- "@storybook/addon-a11y": "^7.5.1",
75
- "@storybook/addon-essentials": "^7.5.1",
76
- "@storybook/addon-interactions": "^7.5.1",
77
- "@storybook/addon-links": "^7.5.1",
78
- "@storybook/addon-storysource": "^7.5.1",
79
- "@storybook/blocks": "^7.5.1",
80
- "@storybook/react": "^7.5.1",
81
- "@storybook/react-vite": "^7.5.1",
74
+ "@storybook/addon-a11y": "^7.5.2",
75
+ "@storybook/addon-essentials": "^7.5.2",
76
+ "@storybook/addon-interactions": "^7.5.2",
77
+ "@storybook/addon-links": "^7.5.2",
78
+ "@storybook/addon-storysource": "^7.5.2",
79
+ "@storybook/blocks": "^7.5.2",
80
+ "@storybook/react": "^7.5.2",
81
+ "@storybook/react-vite": "^7.5.2",
82
82
  "@storybook/testing-library": "^0.2.2",
83
- "@types/node": "^20.8.9",
83
+ "@types/node": "^20.8.10",
84
84
  "@types/react": "^18.2.33",
85
85
  "@types/react-dom": "^18.2.14",
86
- "@typescript-eslint/eslint-plugin": "^6.9.0",
87
- "@typescript-eslint/parser": "^6.9.0",
86
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
87
+ "@typescript-eslint/parser": "^6.9.1",
88
88
  "@vitejs/plugin-react": "^4.1.0",
89
89
  "eslint": "^8.52.0",
90
90
  "eslint-plugin-mui-path-imports": "^0.0.15",
@@ -97,7 +97,7 @@
97
97
  "rollup-plugin-dts": "^6.1.0",
98
98
  "rollup-plugin-peer-deps-external": "^2.2.4",
99
99
  "size-limit": "^10.0.1",
100
- "storybook": "^7.5.1",
100
+ "storybook": "^7.5.2",
101
101
  "storybook-dark-mode": "^3.0.1",
102
102
  "tslib": "^2.6.2",
103
103
  "typescript": "^5.2.2",
@@ -102,8 +102,8 @@ export const MRT_TableHeadCellFilterLabel = <TData extends MRT_RowData = {}>({
102
102
  setShowColumnFilters(true);
103
103
  }
104
104
  queueMicrotask(() => {
105
- filterInputRefs.current[`${column.id}-0`]?.focus();
106
- filterInputRefs.current[`${column.id}-0`]?.select();
105
+ filterInputRefs.current[`${column.id}-0`]?.focus?.();
106
+ filterInputRefs.current[`${column.id}-0`]?.select?.();
107
107
  });
108
108
  event.stopPropagation();
109
109
  }}
@@ -36,7 +36,7 @@ export const MRT_TableHeadRow = <TData extends MRT_RowData>({
36
36
  headerGroup,
37
37
  table,
38
38
  }),
39
- rest,
39
+ ...rest,
40
40
  };
41
41
 
42
42
  return (
@@ -33,6 +33,7 @@ export const MRT_RowActionMenu = <TData extends MRT_RowData>({
33
33
  const {
34
34
  getState,
35
35
  options: {
36
+ editDisplayMode,
36
37
  enableEditing,
37
38
  icons: { EditIcon },
38
39
  localization,
@@ -52,16 +53,17 @@ export const MRT_RowActionMenu = <TData extends MRT_RowData>({
52
53
  open={!!anchorEl}
53
54
  {...rest}
54
55
  >
55
- {parseFromValuesOrFunc(enableEditing, row) && (
56
- <MenuItem onClick={handleEdit} sx={commonMenuItemStyles}>
57
- <Box sx={commonListItemStyles}>
58
- <ListItemIcon>
59
- <EditIcon />
60
- </ListItemIcon>
61
- {localization.edit}
62
- </Box>
63
- </MenuItem>
64
- )}
56
+ {parseFromValuesOrFunc(enableEditing, row) &&
57
+ ['modal', 'row'].includes(editDisplayMode!) && (
58
+ <MenuItem onClick={handleEdit} sx={commonMenuItemStyles}>
59
+ <Box sx={commonListItemStyles}>
60
+ <ListItemIcon>
61
+ <EditIcon />
62
+ </ListItemIcon>
63
+ {localization.edit}
64
+ </Box>
65
+ </MenuItem>
66
+ )}
65
67
  {renderRowActionMenuItems?.({
66
68
  closeMenu: () => setAnchorEl(null),
67
69
  row,
@@ -135,7 +135,8 @@ export const MRT_TablePagination = <TData extends MRT_RowData>({
135
135
  <>
136
136
  <Typography
137
137
  align="center"
138
- sx={{ mb: 0, minWidth: '8ch', mx: '4px' }}
138
+ component="span"
139
+ sx={{ m: '0 4px', minWidth: '8ch' }}
139
140
  variant="body2"
140
141
  >{`${
141
142
  lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()