material-react-table 1.7.1 → 1.7.2

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.1",
2
+ "version": "1.7.2",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript.",
@@ -263,7 +263,9 @@ export const getCommonCellStyles = ({
263
263
  display: table.options.layoutMode === 'grid' ? 'flex' : 'table-cell',
264
264
  flex:
265
265
  table.options.layoutMode === 'grid'
266
- ? `var(--col-${column.id.replaceAll('.', '_')}-size) 0 auto`
266
+ ? `var(--col-${column.id
267
+ .replaceAll('.', '_')
268
+ .replaceAll(' ', '_')}-size) 0 auto`
267
269
  : undefined,
268
270
  left:
269
271
  column.getIsPinned() === 'left'
@@ -307,11 +309,12 @@ export const getCommonCellStyles = ({
307
309
  ...(tableCellProps?.sx instanceof Function
308
310
  ? tableCellProps.sx(theme)
309
311
  : (tableCellProps?.sx as any)),
310
- minWidth: `max(calc(var(--col-${column.id.replaceAll(
311
- '.',
312
- '_',
313
- )}-size) * 1px), ${column.columnDef.minSize ?? 30}px)`,
314
- width: `calc(var(--col-${column.id.replaceAll('.', '_')}-size) * 1px)`,
312
+ minWidth: `max(calc(var(--col-${column.id
313
+ .replaceAll('.', '_')
314
+ .replaceAll(' ', '_')}-size) * 1px), ${column.columnDef.minSize ?? 30}px)`,
315
+ width: `calc(var(--col-${column.id
316
+ .replaceAll('.', '_')
317
+ .replaceAll(' ', '_')}-size) * 1px)`,
315
318
  });
316
319
 
317
320
  export const MRT_DefaultColumn = {
@@ -58,7 +58,9 @@ export const MRT_Table = ({ table }: Props) => {
58
58
  const colSizes: { [key: string]: number } = {};
59
59
  for (let i = 0; i < headers.length; i++) {
60
60
  const h = headers[i];
61
- colSizes[`--col-${h.column.id}-size`.replaceAll('.', '_')] = h.getSize();
61
+ colSizes[
62
+ `--col-${h.column.id}-size`.replaceAll('.', '_').replaceAll(' ', '_')
63
+ ] = h.getSize();
62
64
  }
63
65
  return colSizes;
64
66
  }, [columns, columnSizing, columnSizingInfo]);