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.
- package/dist/cjs/index.js +5 -4
- 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 -4
- 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 -10
- package/src/table/MRT_Table.tsx +2 -1
package/dist/cjs/index.js
CHANGED
@@ -321,7 +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
|
324
|
+
? `var(--col-${parseCSSVarId(column.id)}-size) 0 auto`
|
325
325
|
: undefined, left: column.getIsPinned() === 'left'
|
326
326
|
? `${column.getStart('left')}px`
|
327
327
|
: undefined, ml: table.options.enableColumnVirtualization &&
|
@@ -341,11 +341,11 @@ const getCommonCellStyles = ({ column, table, tableCellProps, theme, }) => {
|
|
341
341
|
? 'sticky'
|
342
342
|
: undefined, right: column.getIsPinned() === 'right'
|
343
343
|
? `${getTotalRight(table, column)}px`
|
344
|
-
: undefined, transition: table.options.enableColumnVirtualization
|
344
|
+
: undefined, transition: table.options.enableColumnVirtualization
|
345
345
|
? 'none'
|
346
346
|
: `padding 150ms ease-in-out` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
347
347
|
? tableCellProps.sx(theme)
|
348
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { minWidth: `max(calc(var(--col-${column.id
|
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)` }));
|
349
349
|
};
|
350
350
|
const MRT_DefaultColumn = {
|
351
351
|
filterVariant: 'text',
|
@@ -367,6 +367,7 @@ const MRT_DefaultDisplayColumn = {
|
|
367
367
|
enableResizing: false,
|
368
368
|
enableSorting: false,
|
369
369
|
};
|
370
|
+
const parseCSSVarId = (id) => id.replaceAll('.', '_').replaceAll(' ', '_').replaceAll('+', '_');
|
370
371
|
|
371
372
|
const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
|
372
373
|
const itemRank = matchSorterUtils.rankItem(row.getValue(columnId), filterValue, {
|
@@ -2710,7 +2711,7 @@ const MRT_Table = ({ table }) => {
|
|
2710
2711
|
const colSizes = {};
|
2711
2712
|
for (let i = 0; i < headers.length; i++) {
|
2712
2713
|
const h = headers[i];
|
2713
|
-
colSizes[`--col-${h.column.id}-size
|
2714
|
+
colSizes[`--col-${parseCSSVarId(h.column.id)}-size`] = h.getSize();
|
2714
2715
|
}
|
2715
2716
|
return colSizes;
|
2716
2717
|
}, [columns, columnSizing, columnSizingInfo]);
|