material-react-table 1.7.1 → 1.7.3

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.
@@ -137,3 +137,4 @@ export declare const MRT_DefaultDisplayColumn: {
137
137
  readonly enableResizing: false;
138
138
  readonly enableSorting: false;
139
139
  };
140
+ export declare const parseCSSVarId: (id: string) => string;
@@ -243,7 +243,7 @@ const getCommonCellStyles = ({ column, table, tableCellProps, theme, }) => {
243
243
  : getIsFirstRightPinnedColumn(column)
244
244
  ? `4px 0 8px -6px ${alpha(theme.palette.common.black, 0.2)} inset`
245
245
  : undefined, display: table.options.layoutMode === 'grid' ? 'flex' : 'table-cell', flex: table.options.layoutMode === 'grid'
246
- ? `var(--col-${column.id.replaceAll('.', '_')}-size) 0 auto`
246
+ ? `var(--col-${parseCSSVarId(column.id)}-size) 0 auto`
247
247
  : undefined, left: column.getIsPinned() === 'left'
248
248
  ? `${column.getStart('left')}px`
249
249
  : undefined, ml: table.options.enableColumnVirtualization &&
@@ -263,11 +263,11 @@ const getCommonCellStyles = ({ column, table, tableCellProps, theme, }) => {
263
263
  ? 'sticky'
264
264
  : undefined, right: column.getIsPinned() === 'right'
265
265
  ? `${getTotalRight(table, column)}px`
266
- : undefined, transition: table.options.enableColumnVirtualization || column.getIsResizing()
266
+ : undefined, transition: table.options.enableColumnVirtualization
267
267
  ? 'none'
268
268
  : `padding 150ms ease-in-out` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
269
269
  ? tableCellProps.sx(theme)
270
- : tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { minWidth: `max(calc(var(--col-${column.id.replaceAll('.', '_')}-size) * 1px), ${(_g = column.columnDef.minSize) !== null && _g !== void 0 ? _g : 30}px)`, width: `calc(var(--col-${column.id.replaceAll('.', '_')}-size) * 1px)` }));
270
+ : tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { minWidth: `max(calc(var(--col-${parseCSSVarId(column.id)}-size) * 1px), ${(_g = column.columnDef.minSize) !== null && _g !== void 0 ? _g : 30}px)`, width: `calc(var(--col-${parseCSSVarId(column.id)}-size) * 1px)` }));
271
271
  };
272
272
  const MRT_DefaultColumn = {
273
273
  filterVariant: 'text',
@@ -289,6 +289,7 @@ const MRT_DefaultDisplayColumn = {
289
289
  enableResizing: false,
290
290
  enableSorting: false,
291
291
  };
292
+ const parseCSSVarId = (id) => id.replaceAll('.', '_').replaceAll(' ', '_').replaceAll('+', '_');
292
293
 
293
294
  const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
294
295
  const itemRank = rankItem(row.getValue(columnId), filterValue, {
@@ -2632,7 +2633,7 @@ const MRT_Table = ({ table }) => {
2632
2633
  const colSizes = {};
2633
2634
  for (let i = 0; i < headers.length; i++) {
2634
2635
  const h = headers[i];
2635
- colSizes[`--col-${h.column.id}-size`.replaceAll('.', '_')] = h.getSize();
2636
+ colSizes[`--col-${parseCSSVarId(h.column.id)}-size`] = h.getSize();
2636
2637
  }
2637
2638
  return colSizes;
2638
2639
  }, [columns, columnSizing, columnSizingInfo]);