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 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
- return (jsxs(Fragment, { children: [jsxs(TableRow, Object.assign({ "data-index": renderDetailPanel ? staticRowIndex * 2 : staticRowIndex, "data-pinned": !!isRowPinned || undefined, "data-selected": isRowSelected || undefined, onDragEnter: handleDragEnter, onDragOver: handleDragOver, ref: (node) => {
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)), children: [virtualPaddingLeft ? (jsx("td", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : visibleCells).map((cellOrVirtualCell, staticColumnIndex) => {
2503
- let cell = cellOrVirtualCell;
2504
- if (columnVirtualizer) {
2505
- staticColumnIndex = cellOrVirtualCell.index;
2506
- cell = visibleCells[staticColumnIndex];
2507
- }
2508
- const props = {
2509
- cell,
2510
- numRows,
2511
- rowRef,
2512
- staticColumnIndex,
2513
- staticRowIndex,
2514
- table,
2515
- };
2516
- return cell ? (memoMode === 'cells' &&
2517
- cell.column.columnDef.columnDefType === 'data' &&
2518
- !draggingColumn &&
2519
- !draggingRow &&
2520
- (editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
2521
- (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;
2522
- }), 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 }))] }));
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