material-react-table 1.5.6 → 1.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/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/table/MRT_TableRoot.d.ts +1 -1
- package/dist/esm/material-react-table.esm.js +8 -6
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/table/MRT_TableRoot.d.ts +1 -1
- package/package.json +1 -1
- package/src/body/MRT_TableBodyRow.tsx +1 -1
- package/src/table/MRT_TableRoot.tsx +1 -1
- package/src/toolbar/MRT_BottomToolbar.tsx +7 -5
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_FilterOption, MRT_Row, MRT_TableInstance, MRT_TableState, MaterialReactTableProps
|
2
|
+
import type { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_FilterOption, MRT_Localization, MRT_Row, MRT_TableInstance, MRT_TableState, MaterialReactTableProps } from '..';
|
3
3
|
export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/react-table").TableOptions<TData>>, "state" | "data" | "onStateChange" | "initialState" | "getRowId" | "columns" | "defaultColumn" | "globalFilterFn" | "enableRowSelection" | "expandRowsFn"> & {
|
4
4
|
columnFilterModeOptions?: (string & MRT_FilterOption)[] | null | undefined;
|
5
5
|
columns: MRT_ColumnDef<TData>[];
|
@@ -1397,11 +1397,13 @@ const MRT_BottomToolbar = ({ table }) => {
|
|
1397
1397
|
? muiBottomToolbarProps({ table })
|
1398
1398
|
: muiBottomToolbarProps;
|
1399
1399
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
1400
|
-
return (React.createElement(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1400
|
+
return (React.createElement(Toolbar, Object.assign({ variant: "dense" }, toolbarProps, { ref: (node) => {
|
1401
|
+
if (node) {
|
1402
|
+
bottomToolbarRef.current = node;
|
1403
|
+
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
1404
|
+
// @ts-ignore
|
1405
|
+
toolbarProps.ref.current = node;
|
1406
|
+
}
|
1405
1407
|
}
|
1406
1408
|
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, commonToolbarStyles({ theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${alpha(theme.palette.common.black, 0.1)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
1407
1409
|
? toolbarProps.sx(theme)
|
@@ -2371,7 +2373,7 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, row, row
|
|
2371
2373
|
virtualPaddingRight ? (React.createElement("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null),
|
2372
2374
|
renderDetailPanel && !row.getIsGrouped() && (React.createElement(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, table: table, virtualRow: virtualRow }))));
|
2373
2375
|
};
|
2374
|
-
const Memo_MRT_TableBodyRow = memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row);
|
2376
|
+
const Memo_MRT_TableBodyRow = memo(MRT_TableBodyRow, (prev, next) => (prev.row === next.row && prev.rowIndex === next.rowIndex));
|
2375
2377
|
|
2376
2378
|
const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
2377
2379
|
var _a, _b, _c;
|