material-react-table 1.5.0-beta.2 → 1.5.0

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/cjs/index.js CHANGED
@@ -320,9 +320,7 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
320
320
  : undefined, ml: table.options.enableColumnVirtualization &&
321
321
  column.getIsPinned() === 'left' &&
322
322
  column.getPinnedIndex() === 0
323
- ? `-${column.getSize() *
324
- ((_b = (_a = table.getState().columnPinning.left) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1) *
325
- 1.2}px`
323
+ ? `-${column.getSize() * ((_b = (_a = table.getState().columnPinning.left) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1)}px`
326
324
  : undefined, mr: table.options.enableColumnVirtualization &&
327
325
  column.getIsPinned() === 'right' &&
328
326
  column.getPinnedIndex() === table.getVisibleLeafColumns().length - 1
@@ -2618,6 +2616,8 @@ const MRT_Table = ({ table }) => {
2618
2616
  //get first 16 column widths and average them
2619
2617
  const averageColumnWidth = React.useMemo(() => {
2620
2618
  var _a, _b, _c, _d;
2619
+ if (!enableColumnVirtualization)
2620
+ return 0;
2621
2621
  const columnsWidths = (_d = (_c = (_b = (_a = table
2622
2622
  .getRowModel()
2623
2623
  .rows[0]) === null || _a === void 0 ? void 0 : _a.getCenterVisibleCells()) === null || _b === void 0 ? void 0 : _b.slice(0, 16)) === null || _c === void 0 ? void 0 : _c.map((cell) => cell.column.getSize() * 1.2)) !== null && _d !== void 0 ? _d : [];