material-react-table 1.7.2 → 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.
- package/dist/cjs/index.js +5 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/column.utils.d.ts +1 -0
- package/dist/esm/material-react-table.esm.js +5 -10
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/column.utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/column.utils.ts +11 -13
- package/src/table/MRT_Table.tsx +2 -3
package/dist/cjs/index.js
CHANGED
@@ -321,9 +321,7 @@ const getCommonCellStyles = ({ column, table, tableCellProps, theme, }) => {
|
|
321
321
|
: getIsFirstRightPinnedColumn(column)
|
322
322
|
? `4px 0 8px -6px ${styles.alpha(theme.palette.common.black, 0.2)} inset`
|
323
323
|
: undefined, display: table.options.layoutMode === 'grid' ? 'flex' : 'table-cell', flex: table.options.layoutMode === 'grid'
|
324
|
-
? `var(--col-${column.id
|
325
|
-
.replaceAll('.', '_')
|
326
|
-
.replaceAll(' ', '_')}-size) 0 auto`
|
324
|
+
? `var(--col-${parseCSSVarId(column.id)}-size) 0 auto`
|
327
325
|
: undefined, left: column.getIsPinned() === 'left'
|
328
326
|
? `${column.getStart('left')}px`
|
329
327
|
: undefined, ml: table.options.enableColumnVirtualization &&
|
@@ -343,15 +341,11 @@ const getCommonCellStyles = ({ column, table, tableCellProps, theme, }) => {
|
|
343
341
|
? 'sticky'
|
344
342
|
: undefined, right: column.getIsPinned() === 'right'
|
345
343
|
? `${getTotalRight(table, column)}px`
|
346
|
-
: undefined, transition: table.options.enableColumnVirtualization
|
344
|
+
: undefined, transition: table.options.enableColumnVirtualization
|
347
345
|
? 'none'
|
348
346
|
: `padding 150ms ease-in-out` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
349
347
|
? tableCellProps.sx(theme)
|
350
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { minWidth: `max(calc(var(--col-${column.id
|
351
|
-
.replaceAll('.', '_')
|
352
|
-
.replaceAll(' ', '_')}-size) * 1px), ${(_g = column.columnDef.minSize) !== null && _g !== void 0 ? _g : 30}px)`, width: `calc(var(--col-${column.id
|
353
|
-
.replaceAll('.', '_')
|
354
|
-
.replaceAll(' ', '_')}-size) * 1px)` }));
|
348
|
+
: 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)` }));
|
355
349
|
};
|
356
350
|
const MRT_DefaultColumn = {
|
357
351
|
filterVariant: 'text',
|
@@ -373,6 +367,7 @@ const MRT_DefaultDisplayColumn = {
|
|
373
367
|
enableResizing: false,
|
374
368
|
enableSorting: false,
|
375
369
|
};
|
370
|
+
const parseCSSVarId = (id) => id.replaceAll('.', '_').replaceAll(' ', '_').replaceAll('+', '_');
|
376
371
|
|
377
372
|
const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
|
378
373
|
const itemRank = matchSorterUtils.rankItem(row.getValue(columnId), filterValue, {
|
@@ -2716,7 +2711,7 @@ const MRT_Table = ({ table }) => {
|
|
2716
2711
|
const colSizes = {};
|
2717
2712
|
for (let i = 0; i < headers.length; i++) {
|
2718
2713
|
const h = headers[i];
|
2719
|
-
colSizes[`--col-${h.column.id}-size
|
2714
|
+
colSizes[`--col-${parseCSSVarId(h.column.id)}-size`] = h.getSize();
|
2720
2715
|
}
|
2721
2716
|
return colSizes;
|
2722
2717
|
}, [columns, columnSizing, columnSizingInfo]);
|