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/dist/index.js
    CHANGED
    
    | 
         @@ -1943,9 +1943,9 @@ const MRT_TableHeadCellFilterLabel = (_a) => { 
     | 
|
| 
       1943 
1943 
     | 
    
         
             
                                                setShowColumnFilters(true);
         
     | 
| 
       1944 
1944 
     | 
    
         
             
                                            }
         
     | 
| 
       1945 
1945 
     | 
    
         
             
                                            queueMicrotask(() => {
         
     | 
| 
       1946 
     | 
    
         
            -
                                                var _a, _b;
         
     | 
| 
       1947 
     | 
    
         
            -
                                                (_a = filterInputRefs.current[`${column.id}-0`]) === null || _a === void 0 ? void 0 : _a.focus();
         
     | 
| 
       1948 
     | 
    
         
            -
                                                ( 
     | 
| 
      
 1946 
     | 
    
         
            +
                                                var _a, _b, _c, _d;
         
     | 
| 
      
 1947 
     | 
    
         
            +
                                                (_b = (_a = filterInputRefs.current[`${column.id}-0`]) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
         
     | 
| 
      
 1948 
     | 
    
         
            +
                                                (_d = (_c = filterInputRefs.current[`${column.id}-0`]) === null || _c === void 0 ? void 0 : _c.select) === null || _d === void 0 ? void 0 : _d.call(_c);
         
     | 
| 
       1949 
1949 
     | 
    
         
             
                                            });
         
     | 
| 
       1950 
1950 
     | 
    
         
             
                                            event.stopPropagation();
         
     | 
| 
       1951 
1951 
     | 
    
         
             
                                        }, size: "small" }, rest, { sx: (theme) => (Object.assign({ height: '16px', ml: '4px', opacity: isFilterActive ? 1 : 0.3, p: '8px', transform: 'scale(0.75)', transition: 'all 150ms ease-in-out', width: '16px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsxRuntime.jsx(FilterAltIcon, {}) })) }) }) }), jsxRuntime.jsx(Popover__default["default"], { anchorEl: anchorEl, anchorOrigin: {
         
     | 
| 
         @@ -2205,7 +2205,7 @@ const MRT_TableHeadRow = (_a) => { 
     | 
|
| 
       2205 
2205 
     | 
    
         
             
                const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadRowProps, {
         
     | 
| 
       2206 
2206 
     | 
    
         
             
                    headerGroup,
         
     | 
| 
       2207 
2207 
     | 
    
         
             
                    table,
         
     | 
| 
       2208 
     | 
    
         
            -
                })),  
     | 
| 
      
 2208 
     | 
    
         
            +
                })), rest);
         
     | 
| 
       2209 
2209 
     | 
    
         
             
                return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, boxShadow: `4px 0 8px ${material.alpha(theme.palette.common.black, 0.1)}`, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, top: 0 }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : headerGroup.headers).map((headerOrVirtualHeader) => {
         
     | 
| 
       2210 
2210 
     | 
    
         
             
                            const header = virtualColumns
         
     | 
| 
       2211 
2211 
     | 
    
         
             
                                ? headerGroup.headers[headerOrVirtualHeader.index]
         
     | 
| 
         @@ -2265,7 +2265,7 @@ const MRT_TablePagination = (_a) => { 
     | 
|
| 
       2265 
2265 
     | 
    
         
             
                                    last: LastPageIcon,
         
     | 
| 
       2266 
2266 
     | 
    
         
             
                                    next: ChevronRightIcon,
         
     | 
| 
       2267 
2267 
     | 
    
         
             
                                    previous: ChevronLeftIcon,
         
     | 
| 
       2268 
     | 
    
         
            -
                                } }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography__default["default"], { align: "center", sx: {  
     | 
| 
      
 2268 
     | 
    
         
            +
                                } }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography__default["default"], { align: "center", component: "span", sx: { m: '0 4px', minWidth: '8ch' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxRuntime.jsxs(Box__default["default"], { gap: "xs", children: [showFirstButton && (jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToFirstPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(0), size: "small", children: jsxRuntime.jsx(FirstPageIcon, {}) })), jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToPreviousPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(pageIndex - 1), size: "small", children: jsxRuntime.jsx(ChevronLeftIcon, {}) }), jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToNextPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(pageIndex + 1), size: "small", children: jsxRuntime.jsx(ChevronRightIcon, {}) }), showLastButton && (jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToLastPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(numberOfPages - 1), size: "small", children: jsxRuntime.jsx(LastPageIcon, {}) }))] })] })) : null] }));
         
     | 
| 
       2269 
2269 
     | 
    
         
             
            };
         
     | 
| 
       2270 
2270 
     | 
    
         | 
| 
       2271 
2271 
     | 
    
         
             
            const MRT_GlobalFilterTextField = (_a) => {
         
     | 
| 
         @@ -3035,11 +3035,12 @@ const MRT_ExpandButton = ({ row, table, }) => { 
     | 
|
| 
       3035 
3035 
     | 
    
         | 
| 
       3036 
3036 
     | 
    
         
             
            const MRT_RowActionMenu = (_a) => {
         
     | 
| 
       3037 
3037 
     | 
    
         
             
                var { anchorEl, handleEdit, row, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "handleEdit", "row", "setAnchorEl", "table"]);
         
     | 
| 
       3038 
     | 
    
         
            -
                const { getState, options: { enableEditing, icons: { EditIcon }, localization, renderRowActionMenuItems, }, } = table;
         
     | 
| 
      
 3038 
     | 
    
         
            +
                const { getState, options: { editDisplayMode, enableEditing, icons: { EditIcon }, localization, renderRowActionMenuItems, }, } = table;
         
     | 
| 
       3039 
3039 
     | 
    
         
             
                const { density } = getState();
         
     | 
| 
       3040 
3040 
     | 
    
         
             
                return (jsxRuntime.jsxs(Menu__default["default"], Object.assign({ MenuListProps: {
         
     | 
| 
       3041 
3041 
     | 
    
         
             
                        dense: density === 'compact',
         
     | 
| 
       3042 
     | 
    
         
            -
                    }, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [parseFromValuesOrFunc(enableEditing, row) && 
     | 
| 
      
 3042 
     | 
    
         
            +
                    }, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [parseFromValuesOrFunc(enableEditing, row) &&
         
     | 
| 
      
 3043 
     | 
    
         
            +
                            ['modal', 'row'].includes(editDisplayMode) && (jsxRuntime.jsx(MenuItem__default["default"], { onClick: handleEdit, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(EditIcon, {}) }), localization.edit] }) })), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 : renderRowActionMenuItems({
         
     | 
| 
       3043 
3044 
     | 
    
         
             
                            closeMenu: () => setAnchorEl(null),
         
     | 
| 
       3044 
3045 
     | 
    
         
             
                            row,
         
     | 
| 
       3045 
3046 
     | 
    
         
             
                            table,
         
     |