material-react-table-narender 2.13.35 → 2.13.36

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.js CHANGED
@@ -2512,7 +2512,7 @@ const MRT_TableDetailPanel = (_a) => {
2512
2512
  };
2513
2513
 
2514
2514
  const MRT_TableBodyRow = (_a) => {
2515
- var _b, _c, _d, _f, _g;
2515
+ var _b, _c, _d, _f;
2516
2516
  var { columnVirtualizer, numRows, pinnedRowIds, row, rowVirtualizer, staticRowIndex, table, virtualRow } = _a, rest = __rest(_a, ["columnVirtualizer", "numRows", "pinnedRowIds", "row", "rowVirtualizer", "staticRowIndex", "table", "virtualRow"]);
2517
2517
  const theme = styles.useTheme();
2518
2518
  const { getState, options: { enableRowOrdering, enableRowPinning, enableStickyFooter, enableStickyHeader, layoutMode, memoMode, mrtTheme: { baseBackgroundColor, pinnedRowBackgroundColor, selectedRowBackgroundColor, }, muiTableBodyRowProps, renderDetailPanel, rowPinningDisplayMode, }, refs: { tableFooterRef, tableHeadRef }, setHoveredRow, } = table;
@@ -2570,8 +2570,7 @@ const MRT_TableBodyRow = (_a) => {
2570
2570
  ? `${styles.lighten(baseBackgroundColor, 0.3)}`
2571
2571
  : `${styles.darken(baseBackgroundColor, 0.3)}`
2572
2572
  : undefined;
2573
- console.log('row.id', row);
2574
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [react.createElement(TableRow__default["default"], Object.assign({ "data-index": renderDetailPanel ? staticRowIndex * 2 : staticRowIndex, "data-pinned": !!isRowPinned || undefined, "data-selected": isRowSelected || undefined, onDragEnter: handleDragEnter, onDragOver: handleDragOver, ref: (node) => {
2573
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(TableRow__default["default"], Object.assign({ "data-index": renderDetailPanel ? staticRowIndex * 2 : staticRowIndex, "data-pinned": !!isRowPinned || undefined, "data-selected": isRowSelected || undefined, onDragEnter: handleDragEnter, onDragOver: handleDragOver, ref: (node) => {
2575
2574
  if (node) {
2576
2575
  rowRef.current = node;
2577
2576
  rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement(node);
@@ -2592,30 +2591,27 @@ const MRT_TableBodyRow = (_a) => {
2592
2591
  : topPinnedIndex !== undefined && isRowPinned
2593
2592
  ? `${topPinnedIndex * rowHeight +
2594
2593
  (enableStickyHeader || isFullScreen ? tableHeadHeight - 1 : 0)}px`
2595
- : 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 }),
2596
- virtualPaddingLeft ? (jsxRuntime.jsx("td", { style: { display: 'flex', width: virtualPaddingLeft } })) : null,
2597
- (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : visibleCells).map((cellOrVirtualCell, staticColumnIndex) => {
2598
- let cell = cellOrVirtualCell;
2599
- if (columnVirtualizer) {
2600
- staticColumnIndex = cellOrVirtualCell.index;
2601
- cell = visibleCells[staticColumnIndex];
2602
- }
2603
- const props = {
2604
- cell,
2605
- numRows,
2606
- rowRef,
2607
- staticColumnIndex,
2608
- staticRowIndex,
2609
- table,
2610
- };
2611
- return cell ? (memoMode === 'cells' &&
2612
- cell.column.columnDef.columnDefType === 'data' &&
2613
- !draggingColumn &&
2614
- !draggingRow &&
2615
- (editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
2616
- (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (jsxRuntime.jsx(Memo_MRT_TableBodyCell, Object.assign({}, props), cell.id)) : (jsxRuntime.jsx(MRT_TableBodyCell, Object.assign({}, props), cell.id))) : null;
2617
- }),
2618
- virtualPaddingRight ? (jsxRuntime.jsx("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null), renderDetailPanel && !row.getIsGrouped() && (jsxRuntime.jsx(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, rowVirtualizer: rowVirtualizer, staticRowIndex: staticRowIndex, table: table, virtualRow: virtualRow }))] }));
2594
+ : 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 ? (jsxRuntime.jsx("td", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : visibleCells).map((cellOrVirtualCell, staticColumnIndex) => {
2595
+ let cell = cellOrVirtualCell;
2596
+ if (columnVirtualizer) {
2597
+ staticColumnIndex = cellOrVirtualCell.index;
2598
+ cell = visibleCells[staticColumnIndex];
2599
+ }
2600
+ const props = {
2601
+ cell,
2602
+ numRows,
2603
+ rowRef,
2604
+ staticColumnIndex,
2605
+ staticRowIndex,
2606
+ table,
2607
+ };
2608
+ return cell ? (memoMode === 'cells' &&
2609
+ cell.column.columnDef.columnDefType === 'data' &&
2610
+ !draggingColumn &&
2611
+ !draggingRow &&
2612
+ (editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
2613
+ (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (jsxRuntime.jsx(Memo_MRT_TableBodyCell, Object.assign({}, props), cell.id)) : (jsxRuntime.jsx(MRT_TableBodyCell, Object.assign({}, props), cell.id))) : null;
2614
+ }), virtualPaddingRight ? (jsxRuntime.jsx("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })), renderDetailPanel && !row.getIsGrouped() && (jsxRuntime.jsx(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, rowVirtualizer: rowVirtualizer, staticRowIndex: staticRowIndex, table: table, virtualRow: virtualRow }))] }));
2619
2615
  };
2620
2616
  const Memo_MRT_TableBodyRow = react.memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row && prev.staticRowIndex === next.staticRowIndex);
2621
2617
 
@@ -3648,7 +3644,7 @@ const MRT_TableHeadCellSortLabel = (_a) => {
3648
3644
  };
3649
3645
 
3650
3646
  const MRT_TableHeadCell = (_a) => {
3651
- var _b, _c, _d, _f, _g, _h;
3647
+ var _b, _c, _d, _f, _g, _h, _j;
3652
3648
  var { columnVirtualizer, header, staticColumnIndex, table } = _a, rest = __rest(_a, ["columnVirtualizer", "header", "staticColumnIndex", "table"]);
3653
3649
  const theme = styles.useTheme();
3654
3650
  const { getState, options: { columnFilterDisplayMode, columnResizeDirection, columnResizeMode, enableColumnActions, enableColumnDragging, enableColumnOrdering, enableColumnPinning,
@@ -3737,6 +3733,7 @@ const MRT_TableHeadCell = (_a) => {
3737
3733
  header,
3738
3734
  table,
3739
3735
  })) !== null && _b !== void 0 ? _b : columnDef.header;
3736
+ const headerTooltip = (_c = columnDef.tooltip) !== null && _c !== void 0 ? _c : columnDef.header;
3740
3737
  return (jsxRuntime.jsxs(TableCell__default["default"], Object.assign({ align: columnDefType === 'group'
3741
3738
  ? 'center'
3742
3739
  : theme.direction === 'rtl'
@@ -3781,7 +3778,7 @@ const MRT_TableHeadCell = (_a) => {
3781
3778
  theme,
3782
3779
  })), draggingBorders)), children: [header.isPlaceholder
3783
3780
  ? null
3784
- : ((_c = tableCellProps.children) !== null && _c !== void 0 ? _c : (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content", sx: {
3781
+ : ((_d = tableCellProps.children) !== null && _d !== void 0 ? _d : (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content", sx: {
3785
3782
  alignItems: 'center',
3786
3783
  display: 'flex',
3787
3784
  flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
@@ -3804,17 +3801,17 @@ const MRT_TableHeadCell = (_a) => {
3804
3801
  pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
3805
3802
  ? `${headerPL}rem`
3806
3803
  : undefined,
3807
- }, children: [jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
3808
- '&:hover': {
3809
- textOverflow: 'clip',
3810
- },
3811
- minWidth: `${Math.min((_f = (_d = columnDef.header) === null || _d === void 0 ? void 0 : _d.length) !== null && _f !== void 0 ? _f : 0, 4)}ch`,
3812
- overflow: columnDefType === 'data' ? 'hidden' : undefined,
3813
- textOverflow: 'ellipsis',
3814
- whiteSpace: ((_h = (_g = columnDef.header) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) < 20
3815
- ? 'nowrap'
3816
- : 'normal',
3817
- }, children: HeaderElement }), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsxRuntime.jsx(MRT_TableHeadCellSortLabel, { header: header, table: table }))] }), columnDefType !== 'group' && (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Actions", sx: {
3804
+ }, children: [jsxRuntime.jsx(material.Tooltip, { title: headerTooltip, placement: "top", arrow: true, children: jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
3805
+ '&:hover': {
3806
+ textOverflow: 'clip',
3807
+ },
3808
+ minWidth: `${Math.min((_g = (_f = columnDef.header) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0, 4)}ch`,
3809
+ overflow: columnDefType === 'data' ? 'hidden' : undefined,
3810
+ textOverflow: 'ellipsis',
3811
+ whiteSpace: ((_j = (_h = columnDef.header) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : 0) < 20
3812
+ ? 'nowrap'
3813
+ : 'normal',
3814
+ }, children: HeaderElement }) }), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsxRuntime.jsx(MRT_TableHeadCellSortLabel, { header: header, table: table }))] }), columnDefType !== 'group' && (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Actions", sx: {
3818
3815
  whiteSpace: 'nowrap',
3819
3816
  }, children: [showDragHandle && (jsxRuntime.jsx(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
3820
3817
  current: tableHeadCellRefs.current[column.id],