@dooherceg/material-react-table 4.1.8 → 4.1.9

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
@@ -14544,10 +14544,17 @@ const MRT_TableBodyCell = ({
14544
14544
  const size = column.getSize();
14545
14545
  setSkeletonWidth(columnDefType === 'display' ? size / 2 : Math.round(Math.random() * (size - size / 3) + size / 3));
14546
14546
  }, [isLoading, showSkeletons]);
14547
+
14548
+ // Asserted with `!important` so this always wins over a consumer's own
14549
+ // `MuiTableCell`/`MuiTableRow` theme overrides (e.g. the common MUI docs
14550
+ // pattern of stripping the last row's border via `&:last-child td`) —
14551
+ // the last row keeping its bottom border is part of MRT's own visual
14552
+ // contract, not something a host app's table theme should be able to undo.
14553
+ const isLastRow = !!numRows && staticRowIndex === numRows - 1;
14554
+ const lastRowBorderBottom = isLastRow ? `1px solid ${theme.palette.divider} !important` : undefined;
14547
14555
  const draggingBorders = react.useMemo(() => {
14548
14556
  const isFirstColumn = column.getIsFirstColumn();
14549
14557
  const isLastColumn = column.getIsLastColumn();
14550
- const isLastRow = numRows && staticRowIndex === numRows - 1;
14551
14558
  const isResizingColumn = isResizingThisColumn;
14552
14559
  const showResizeBorder = isResizingColumn && columnResizeMode === 'onChange';
14553
14560
  const borderStyle = showResizeBorder ? `2px solid ${draggingBorderColor} !important` : isDraggingColumn || isDraggingRow ? `1px dashed ${theme.palette.grey[500]} !important` : isHoveredColumn || isHoveredRow || isResizingColumn ? `2px dashed ${draggingBorderColor} !important` : undefined;
@@ -14559,12 +14566,12 @@ const MRT_TableBodyCell = ({
14559
14566
  };
14560
14567
  }
14561
14568
  return borderStyle ? {
14562
- borderBottom: isDraggingRow || isHoveredRow || isLastRow && !isResizingColumn ? borderStyle : undefined,
14569
+ borderBottom: isDraggingRow || isHoveredRow || isLastRow && !isResizingColumn ? borderStyle : lastRowBorderBottom,
14563
14570
  borderLeft: isDraggingColumn || isHoveredColumn || (isDraggingRow || isHoveredRow) && isFirstColumn ? borderStyle : undefined,
14564
14571
  borderRight: isDraggingColumn || isHoveredColumn || (isDraggingRow || isHoveredRow) && isLastColumn ? borderStyle : undefined,
14565
14572
  borderTop: isDraggingRow || isHoveredRow ? borderStyle : undefined
14566
14573
  } : undefined;
14567
- }, [isResizingThisColumn, isDraggingColumn, isDraggingRow, isHoveredColumn, isHoveredRow, staticRowIndex]);
14574
+ }, [isResizingThisColumn, isDraggingColumn, isDraggingRow, isHoveredColumn, isHoveredRow, isLastRow, lastRowBorderBottom]);
14568
14575
  const isColumnPinned = enableColumnPinning && columnDef.columnDefType !== 'group' && column.getIsPinned();
14569
14576
  const isRightClickable = parseFromValuesOrFunc(enableCellActions, cell);
14570
14577
  const cellValueProps = {
@@ -14611,6 +14618,7 @@ const MRT_TableBodyCell = ({
14611
14618
  textOverflow: 'clip'
14612
14619
  },
14613
14620
  alignItems: layoutMode?.startsWith('grid') ? 'center' : undefined,
14621
+ borderBottom: lastRowBorderBottom,
14614
14622
  cursor: isRightClickable ? 'context-menu' : 'inherit',
14615
14623
  outline: isActionCell ? `1px solid ${theme_0.palette.grey[500]}` : undefined,
14616
14624
  outlineOffset: '-1px',