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/dist/index.esm.js +8 -7
 - package/dist/index.esm.js.map +1 -1
 - package/dist/index.js +8 -7
 - package/dist/index.js.map +1 -1
 - package/package.json +15 -15
 - package/src/head/MRT_TableHeadCellFilterLabel.tsx +2 -2
 - package/src/head/MRT_TableHeadRow.tsx +1 -1
 - package/src/menus/MRT_RowActionMenu.tsx +12 -10
 - package/src/toolbar/MRT_TablePagination.tsx +2 -1
 
    
        package/package.json
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            {
         
     | 
| 
       2 
     | 
    
         
            -
              "version": "2.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. 
     | 
| 
       70 
     | 
    
         
            -
                "@mui/material": "^5.14. 
     | 
| 
      
 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. 
     | 
| 
       75 
     | 
    
         
            -
                "@storybook/addon-essentials": "^7.5. 
     | 
| 
       76 
     | 
    
         
            -
                "@storybook/addon-interactions": "^7.5. 
     | 
| 
       77 
     | 
    
         
            -
                "@storybook/addon-links": "^7.5. 
     | 
| 
       78 
     | 
    
         
            -
                "@storybook/addon-storysource": "^7.5. 
     | 
| 
       79 
     | 
    
         
            -
                "@storybook/blocks": "^7.5. 
     | 
| 
       80 
     | 
    
         
            -
                "@storybook/react": "^7.5. 
     | 
| 
       81 
     | 
    
         
            -
                "@storybook/react-vite": "^7.5. 
     | 
| 
      
 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. 
     | 
| 
      
 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. 
     | 
| 
       87 
     | 
    
         
            -
                "@typescript-eslint/parser": "^6.9. 
     | 
| 
      
 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. 
     | 
| 
      
 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 
     | 
    
         
             
                          }}
         
     | 
| 
         @@ -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 
     | 
    
         
            -
                     
     | 
| 
       57 
     | 
    
         
            -
                      < 
     | 
| 
       58 
     | 
    
         
            -
                        < 
     | 
| 
       59 
     | 
    
         
            -
                          < 
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       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 
     | 
    
         
            -
                         
     | 
| 
      
 138 
     | 
    
         
            +
                        component="span"
         
     | 
| 
      
 139 
     | 
    
         
            +
                        sx={{ m: '0 4px', minWidth: '8ch' }}
         
     | 
| 
       139 
140 
     | 
    
         
             
                        variant="body2"
         
     | 
| 
       140 
141 
     | 
    
         
             
                      >{`${
         
     | 
| 
       141 
142 
     | 
    
         
             
                        lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()
         
     |