@dooherceg/material-react-table 4.1.8 → 4.1.10

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