material-react-table-narender 2.13.33 → 2.13.35
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 +28 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +27 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/body/MRT_TableBodyRow.tsx +3 -0
package/dist/index.esm.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { flexRender as flexRender$1, createRow as createRow$1, sortingFns, aggregationFns, filterFns, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
|
2
|
-
import { useMemo, useState, useReducer, useRef, useEffect, useCallback, memo, Fragment as Fragment$1, useLayoutEffect } from 'react';
|
2
|
+
import { useMemo, useState, useReducer, useRef, useEffect, useCallback, memo, createElement, Fragment as Fragment$1, useLayoutEffect } from 'react';
|
3
3
|
import { compareItems, rankItem, rankings } from '@tanstack/match-sorter-utils';
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
5
5
|
import IconButton from '@mui/material/IconButton';
|
@@ -2420,7 +2420,7 @@ const MRT_TableDetailPanel = (_a) => {
|
|
2420
2420
|
};
|
2421
2421
|
|
2422
2422
|
const MRT_TableBodyRow = (_a) => {
|
2423
|
-
var _b, _c, _d, _f;
|
2423
|
+
var _b, _c, _d, _f, _g;
|
2424
2424
|
var { columnVirtualizer, numRows, pinnedRowIds, row, rowVirtualizer, staticRowIndex, table, virtualRow } = _a, rest = __rest(_a, ["columnVirtualizer", "numRows", "pinnedRowIds", "row", "rowVirtualizer", "staticRowIndex", "table", "virtualRow"]);
|
2425
2425
|
const theme = useTheme();
|
2426
2426
|
const { getState, options: { enableRowOrdering, enableRowPinning, enableStickyFooter, enableStickyHeader, layoutMode, memoMode, mrtTheme: { baseBackgroundColor, pinnedRowBackgroundColor, selectedRowBackgroundColor, }, muiTableBodyRowProps, renderDetailPanel, rowPinningDisplayMode, }, refs: { tableFooterRef, tableHeadRef }, setHoveredRow, } = table;
|
@@ -2478,7 +2478,8 @@ const MRT_TableBodyRow = (_a) => {
|
|
2478
2478
|
? `${lighten(baseBackgroundColor, 0.3)}`
|
2479
2479
|
: `${darken(baseBackgroundColor, 0.3)}`
|
2480
2480
|
: undefined;
|
2481
|
-
|
2481
|
+
console.log('row.id', row);
|
2482
|
+
return (jsxs(Fragment, { children: [createElement(TableRow, Object.assign({ "data-index": renderDetailPanel ? staticRowIndex * 2 : staticRowIndex, "data-pinned": !!isRowPinned || undefined, "data-selected": isRowSelected || undefined, onDragEnter: handleDragEnter, onDragOver: handleDragOver, ref: (node) => {
|
2482
2483
|
if (node) {
|
2483
2484
|
rowRef.current = node;
|
2484
2485
|
rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement(node);
|
@@ -2499,27 +2500,30 @@ const MRT_TableBodyRow = (_a) => {
|
|
2499
2500
|
: topPinnedIndex !== undefined && isRowPinned
|
2500
2501
|
? `${topPinnedIndex * rowHeight +
|
2501
2502
|
(enableStickyHeader || isFullScreen ? tableHeadHeight - 1 : 0)}px`
|
2502
|
-
: undefined, transition: virtualRow ? 'none' : 'all 150ms ease-in-out', width: '100%', zIndex: (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) && isRowPinned ? 2 : 0 }, sx)),
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
2514
|
-
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2519
|
-
|
2520
|
-
|
2521
|
-
|
2522
|
-
|
2503
|
+
: undefined, transition: virtualRow ? 'none' : 'all 150ms ease-in-out', width: '100%', zIndex: (rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) && isRowPinned ? 2 : 0 }, sx)), key: (_g = row === null || row === void 0 ? void 0 : row.original) === null || _g === void 0 ? void 0 : _g.id }),
|
2504
|
+
virtualPaddingLeft ? (jsx("td", { style: { display: 'flex', width: virtualPaddingLeft } })) : null,
|
2505
|
+
(virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : visibleCells).map((cellOrVirtualCell, staticColumnIndex) => {
|
2506
|
+
let cell = cellOrVirtualCell;
|
2507
|
+
if (columnVirtualizer) {
|
2508
|
+
staticColumnIndex = cellOrVirtualCell.index;
|
2509
|
+
cell = visibleCells[staticColumnIndex];
|
2510
|
+
}
|
2511
|
+
const props = {
|
2512
|
+
cell,
|
2513
|
+
numRows,
|
2514
|
+
rowRef,
|
2515
|
+
staticColumnIndex,
|
2516
|
+
staticRowIndex,
|
2517
|
+
table,
|
2518
|
+
};
|
2519
|
+
return cell ? (memoMode === 'cells' &&
|
2520
|
+
cell.column.columnDef.columnDefType === 'data' &&
|
2521
|
+
!draggingColumn &&
|
2522
|
+
!draggingRow &&
|
2523
|
+
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
|
2524
|
+
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (jsx(Memo_MRT_TableBodyCell, Object.assign({}, props), cell.id)) : (jsx(MRT_TableBodyCell, Object.assign({}, props), cell.id))) : null;
|
2525
|
+
}),
|
2526
|
+
virtualPaddingRight ? (jsx("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null), renderDetailPanel && !row.getIsGrouped() && (jsx(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, rowVirtualizer: rowVirtualizer, staticRowIndex: staticRowIndex, table: table, virtualRow: virtualRow }))] }));
|
2523
2527
|
};
|
2524
2528
|
const Memo_MRT_TableBodyRow = memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row && prev.staticRowIndex === next.staticRowIndex);
|
2525
2529
|
|