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.
@@ -241,9 +241,7 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
|
|
241
241
|
: undefined, ml: table.options.enableColumnVirtualization &&
|
242
242
|
column.getIsPinned() === 'left' &&
|
243
243
|
column.getPinnedIndex() === 0
|
244
|
-
? `-${column.getSize() *
|
245
|
-
((_b = (_a = table.getState().columnPinning.left) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1) *
|
246
|
-
1.2}px`
|
244
|
+
? `-${column.getSize() * ((_b = (_a = table.getState().columnPinning.left) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1)}px`
|
247
245
|
: undefined, mr: table.options.enableColumnVirtualization &&
|
248
246
|
column.getIsPinned() === 'right' &&
|
249
247
|
column.getPinnedIndex() === table.getVisibleLeafColumns().length - 1
|
@@ -2539,6 +2537,8 @@ const MRT_Table = ({ table }) => {
|
|
2539
2537
|
//get first 16 column widths and average them
|
2540
2538
|
const averageColumnWidth = useMemo(() => {
|
2541
2539
|
var _a, _b, _c, _d;
|
2540
|
+
if (!enableColumnVirtualization)
|
2541
|
+
return 0;
|
2542
2542
|
const columnsWidths = (_d = (_c = (_b = (_a = table
|
2543
2543
|
.getRowModel()
|
2544
2544
|
.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 : [];
|