material-react-table 0.40.10 → 0.40.11
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
CHANGED
|
@@ -2401,7 +2401,7 @@ const MRT_EditRowModal = ({ open, row, table, }) => {
|
|
|
2401
2401
|
};
|
|
2402
2402
|
|
|
2403
2403
|
const MRT_TableRoot = (props) => {
|
|
2404
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
2404
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
2405
2405
|
const bottomToolbarRef = React.useRef(null);
|
|
2406
2406
|
const editInputRefs = React.useRef({});
|
|
2407
2407
|
const filterInputRefs = React.useRef({});
|
|
@@ -2473,7 +2473,15 @@ const MRT_TableRoot = (props) => {
|
|
|
2473
2473
|
props.positionActionsColumn,
|
|
2474
2474
|
props.renderDetailPanel,
|
|
2475
2475
|
]);
|
|
2476
|
-
const columnDefs = React.useMemo(() =>
|
|
2476
|
+
const columnDefs = React.useMemo(() => {
|
|
2477
|
+
var _a, _b;
|
|
2478
|
+
return prepareColumns([...displayColumns, ...props.columns], (_b = (_a = props.state) === null || _a === void 0 ? void 0 : _a.columnFilterFns) !== null && _b !== void 0 ? _b : columnFilterFns, props.filterFns, props.sortingFns);
|
|
2479
|
+
}, [
|
|
2480
|
+
columnFilterFns,
|
|
2481
|
+
displayColumns,
|
|
2482
|
+
props.columns,
|
|
2483
|
+
(_r = props.state) === null || _r === void 0 ? void 0 : _r.columnFilterFns,
|
|
2484
|
+
]);
|
|
2477
2485
|
const data = React.useMemo(() => {
|
|
2478
2486
|
var _a, _b, _c, _d, _e;
|
|
2479
2487
|
return (((_a = props.state) === null || _a === void 0 ? void 0 : _a.isLoading) || ((_b = props.state) === null || _b === void 0 ? void 0 : _b.showSkeletons)) &&
|
|
@@ -2489,11 +2497,11 @@ const MRT_TableRoot = (props) => {
|
|
|
2489
2497
|
});
|
|
2490
2498
|
})))
|
|
2491
2499
|
: props.data;
|
|
2492
|
-
}, [props.data, (
|
|
2500
|
+
}, [props.data, (_s = props.state) === null || _s === void 0 ? void 0 : _s.isLoading, (_t = props.state) === null || _t === void 0 ? void 0 : _t.showSkeletons]);
|
|
2493
2501
|
//@ts-ignore
|
|
2494
2502
|
const table = Object.assign(Object.assign({}, reactTable.useReactTable(Object.assign(Object.assign({ getCoreRowModel: reactTable.getCoreRowModel(), getExpandedRowModel: reactTable.getExpandedRowModel(), getFacetedRowModel: reactTable.getFacetedRowModel(), getFilteredRowModel: reactTable.getFilteredRowModel(), getGroupedRowModel: reactTable.getGroupedRowModel(), getPaginationRowModel: reactTable.getPaginationRowModel(), getSortedRowModel: reactTable.getSortedRowModel(), onColumnOrderChange: setColumnOrder, onGroupingChange: setGrouping, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows }, props), {
|
|
2495
2503
|
//@ts-ignore
|
|
2496
|
-
columns: columnDefs, data, globalFilterFn: (
|
|
2504
|
+
columns: columnDefs, data, globalFilterFn: (_v = (_u = props.filterFns) === null || _u === void 0 ? void 0 : _u[globalFilterFn]) !== null && _v !== void 0 ? _v : (_w = props.filterFns) === null || _w === void 0 ? void 0 : _w.fuzzy, initialState, state: Object.assign({ columnFilterFns,
|
|
2497
2505
|
columnOrder,
|
|
2498
2506
|
density,
|
|
2499
2507
|
draggingColumn,
|
|
@@ -2514,7 +2522,7 @@ const MRT_TableRoot = (props) => {
|
|
|
2514
2522
|
searchInputRef,
|
|
2515
2523
|
tableContainerRef,
|
|
2516
2524
|
topToolbarRef,
|
|
2517
|
-
}, setColumnFilterFns: (
|
|
2525
|
+
}, setColumnFilterFns: (_x = props.onFilterFnsChange) !== null && _x !== void 0 ? _x : setColumnFilterFns, setDensity: (_y = props.onDensityChange) !== null && _y !== void 0 ? _y : setDensity, setDraggingColumn: (_z = props.onDraggingColumnChange) !== null && _z !== void 0 ? _z : setDraggingColumn, setDraggingRow: (_0 = props.onDraggingRowChange) !== null && _0 !== void 0 ? _0 : setDraggingRow, setEditingCell: (_1 = props.onEditingCellChange) !== null && _1 !== void 0 ? _1 : setEditingCell, setEditingRow: (_2 = props.onEditingRowChange) !== null && _2 !== void 0 ? _2 : setEditingRow, setGlobalFilterFn: (_3 = props.onGlobalFilterFnChange) !== null && _3 !== void 0 ? _3 : setGlobalFilterFn, setHoveredColumn: (_4 = props.onHoveredColumnChange) !== null && _4 !== void 0 ? _4 : setHoveredColumn, setHoveredRow: (_5 = props.onHoveredRowChange) !== null && _5 !== void 0 ? _5 : setHoveredRow, setIsFullScreen: (_6 = props.onIsFullScreenChange) !== null && _6 !== void 0 ? _6 : setIsFullScreen, setShowAlertBanner: (_7 = props.onShowAlertBannerChange) !== null && _7 !== void 0 ? _7 : setShowAlertBanner, setShowFilters: (_8 = props.onShowFiltersChange) !== null && _8 !== void 0 ? _8 : setShowFilters, setShowGlobalFilter: (_9 = props.onShowGlobalFilterChange) !== null && _9 !== void 0 ? _9 : setShowGlobalFilter });
|
|
2518
2526
|
if (props.tableInstanceRef) {
|
|
2519
2527
|
props.tableInstanceRef.current = table;
|
|
2520
2528
|
}
|