material-react-table 0.5.6 → 0.5.7
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/material-react-table.cjs.development.js +154 -137
- 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 +155 -138
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ColumnActionMenu.d.ts +4 -0
- package/package.json +3 -4
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +2 -0
- package/src/menus/MRT_ColumnActionMenu.tsx +9 -9
- package/src/menus/MRT_FilterTypeMenu.tsx +3 -0
- package/src/menus/MRT_RowActionMenu.tsx +6 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.5.
|
|
2
|
+
"version": "0.5.7",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
5
|
"description": "A fully featured Material-UI implementation of react-table, inspired by material-table and the mui DataGrid, written from the ground up in TypeScript.",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"analyze": "size-limit --why",
|
|
31
|
-
"build": "tsdx build && size-limit",
|
|
31
|
+
"build": "tsdx build && size-limit && cp -r dist material-react-table-docs/node_modules/material-react-table/dist && cp -r src material-react-table-docs/node_modules/material-react-table/src && cp -r package.json material-react-table-docs/node_modules/material-react-table/package.json",
|
|
32
32
|
"build-storybook": "build-storybook",
|
|
33
33
|
"format": "prettier -w .",
|
|
34
34
|
"lint": "tsdx lint",
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
"size": "size-limit",
|
|
37
37
|
"start": "tsdx watch",
|
|
38
38
|
"storybook": "start-storybook -p 6006",
|
|
39
|
-
"test": "tsdx test --passWithNoTests"
|
|
40
|
-
"upgrade": "ncu -u && npm i"
|
|
39
|
+
"test": "tsdx test --passWithNoTests"
|
|
41
40
|
},
|
|
42
41
|
"husky": {
|
|
43
42
|
"hooks": {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { useMRT } from '../useMRT';
|
|
12
12
|
import { MRT_ShowHideColumnsMenu } from '../menus/MRT_ShowHideColumnsMenu';
|
|
13
13
|
import { MRT_ColumnInstance } from '..';
|
|
14
|
+
import { commonMenuItemStyles } from '../menus/MRT_ColumnActionMenu';
|
|
14
15
|
|
|
15
16
|
interface Props extends IconButtonProps {}
|
|
16
17
|
|
|
@@ -47,6 +48,7 @@ export const MRT_ShowHideColumnsButton: FC<Props> = ({ ...rest }) => {
|
|
|
47
48
|
dense: tableInstance.state.densePadding,
|
|
48
49
|
disablePadding: true,
|
|
49
50
|
}}
|
|
51
|
+
sx={commonMenuItemStyles}
|
|
50
52
|
>
|
|
51
53
|
<Box
|
|
52
54
|
sx={{
|
|
@@ -10,9 +10,9 @@ import { useMRT } from '../useMRT';
|
|
|
10
10
|
import { MRT_HeaderGroup } from '..';
|
|
11
11
|
import { MRT_FilterTypeMenu } from './MRT_FilterTypeMenu';
|
|
12
12
|
|
|
13
|
-
const commonMenuItemStyles = {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export const commonMenuItemStyles = {
|
|
14
|
+
py: '0 !important',
|
|
15
|
+
my: '0 !important',
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
interface Props {
|
|
@@ -115,7 +115,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
|
|
|
115
115
|
<ListItemIcon>
|
|
116
116
|
<ClearAllIcon />
|
|
117
117
|
</ListItemIcon>
|
|
118
|
-
<ListItemText>
|
|
118
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
119
119
|
{localization.columnActionMenuItemClearSort}
|
|
120
120
|
</ListItemText>
|
|
121
121
|
</MenuItem>,
|
|
@@ -128,7 +128,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
|
|
|
128
128
|
<ListItemIcon>
|
|
129
129
|
<SortIcon />
|
|
130
130
|
</ListItemIcon>
|
|
131
|
-
<ListItemText>
|
|
131
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
132
132
|
{localization.columnActionMenuItemSortAsc?.replace(
|
|
133
133
|
'{column}',
|
|
134
134
|
String(column.Header),
|
|
@@ -147,7 +147,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
|
|
|
147
147
|
<ListItemIcon>
|
|
148
148
|
<SortIcon style={{ transform: 'rotate(180deg) scaleX(-1)' }} />
|
|
149
149
|
</ListItemIcon>
|
|
150
|
-
<ListItemText>
|
|
150
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
151
151
|
{localization.columnActionMenuItemSortDesc?.replace(
|
|
152
152
|
'{column}',
|
|
153
153
|
String(column.Header),
|
|
@@ -166,7 +166,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
|
|
|
166
166
|
<ListItemIcon>
|
|
167
167
|
<FilterListIcon />
|
|
168
168
|
</ListItemIcon>
|
|
169
|
-
<ListItemText>
|
|
169
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
170
170
|
{localization.filterTextFieldPlaceholder?.replace(
|
|
171
171
|
'{column}',
|
|
172
172
|
String(column.Header),
|
|
@@ -200,7 +200,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
|
|
|
200
200
|
<ListItemIcon>
|
|
201
201
|
<DynamicFeedIcon />
|
|
202
202
|
</ListItemIcon>
|
|
203
|
-
<ListItemText>
|
|
203
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
204
204
|
{localization[
|
|
205
205
|
column.isGrouped
|
|
206
206
|
? 'columnActionMenuItemUnGroupBy'
|
|
@@ -214,7 +214,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
|
|
|
214
214
|
<ListItemIcon>
|
|
215
215
|
<VisibilityOffIcon />
|
|
216
216
|
</ListItemIcon>
|
|
217
|
-
<ListItemText>
|
|
217
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
218
218
|
{localization.columnActionMenuItemHideColumn?.replace(
|
|
219
219
|
'{column}',
|
|
220
220
|
String(column.Header),
|
|
@@ -2,6 +2,8 @@ import React, { FC, useMemo } from 'react';
|
|
|
2
2
|
import { Menu, MenuItem } from '@mui/material';
|
|
3
3
|
import { useMRT } from '../useMRT';
|
|
4
4
|
import { MRT_FilterType, MRT_HeaderGroup } from '..';
|
|
5
|
+
import { commonMenuItemStyles } from './MRT_ColumnActionMenu';
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
interface Props {
|
|
7
9
|
anchorEl: HTMLElement | null;
|
|
@@ -100,6 +102,7 @@ export const MRT_FilterTypeMenu: FC<Props> = ({
|
|
|
100
102
|
onClick={() => handleSelectFilterType(type)}
|
|
101
103
|
selected={type === filterType}
|
|
102
104
|
value={type}
|
|
105
|
+
sx={commonMenuItemStyles}
|
|
103
106
|
>
|
|
104
107
|
{label}
|
|
105
108
|
</MenuItem>
|
|
@@ -2,6 +2,8 @@ import React, { FC } from 'react';
|
|
|
2
2
|
import { ListItemIcon, ListItemText, Menu, MenuItem } from '@mui/material';
|
|
3
3
|
import { useMRT } from '../useMRT';
|
|
4
4
|
import { MRT_Row } from '..';
|
|
5
|
+
import { commonMenuItemStyles } from './MRT_ColumnActionMenu';
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
interface Props {
|
|
7
9
|
anchorEl: HTMLElement | null;
|
|
@@ -35,11 +37,13 @@ export const MRT_RowActionMenu: FC<Props> = ({
|
|
|
35
37
|
}}
|
|
36
38
|
>
|
|
37
39
|
{enableRowEditing && (
|
|
38
|
-
<MenuItem onClick={handleEdit}>
|
|
40
|
+
<MenuItem onClick={handleEdit} sx={commonMenuItemStyles}>
|
|
39
41
|
<ListItemIcon>
|
|
40
42
|
<EditIcon />
|
|
41
43
|
</ListItemIcon>
|
|
42
|
-
<ListItemText
|
|
44
|
+
<ListItemText sx={commonMenuItemStyles}>
|
|
45
|
+
{localization.rowActionMenuItemEdit}
|
|
46
|
+
</ListItemText>
|
|
43
47
|
</MenuItem>
|
|
44
48
|
)}
|
|
45
49
|
{renderRowActionMenuItems?.(row, tableInstance, () =>
|