material-react-table 1.8.4 → 1.8.5

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 CHANGED
@@ -319,7 +319,7 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
319
319
  : getIsFirstRightPinnedColumn(column)
320
320
  ? `4px 0 8px -6px ${styles.alpha(theme.palette.common.black, 0.2)} inset`
321
321
  : undefined, display: table.options.layoutMode === 'grid' ? 'flex' : 'table-cell', flex: table.options.layoutMode === 'grid'
322
- ? `var(--col-${parseCSSVarId((_a = header === null || header === void 0 ? void 0 : header.id) !== null && _a !== void 0 ? _a : column.id)}-size) 0 auto`
322
+ ? `var(--${header ? 'header' : 'col'}-${parseCSSVarId((_a = header === null || header === void 0 ? void 0 : header.id) !== null && _a !== void 0 ? _a : column.id)}-size) 0 auto`
323
323
  : undefined, left: column.getIsPinned() === 'left'
324
324
  ? `${column.getStart('left')}px`
325
325
  : undefined, ml: table.options.enableColumnVirtualization &&
@@ -365,12 +365,7 @@ const MRT_DefaultDisplayColumn = {
365
365
  enableResizing: false,
366
366
  enableSorting: false,
367
367
  };
368
- const parseCSSVarId = (id) => id
369
- .replaceAll('.', '_')
370
- .replaceAll(' ', '_')
371
- .replaceAll('+', '_')
372
- .replaceAll('(', '_')
373
- .replaceAll(')', '_');
368
+ const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
374
369
 
375
370
  const fuzzy$1 = (row, columnId, filterValue, addMeta) => {
376
371
  const itemRank = matchSorterUtils.rankItem(row.getValue(columnId), filterValue, {
@@ -521,7 +516,7 @@ const MRT_ExpandAllButton = ({ table }) => {
521
516
  } }))))));
522
517
  };
523
518
 
524
- const MRT_ExpandButton = ({ row, table }) => {
519
+ const MRT_ExpandButton = ({ row, table, }) => {
525
520
  var _a, _b;
526
521
  const { getState, options: { icons: { ExpandMoreIcon }, localization, muiExpandButtonProps, renderDetailPanel, }, } = table;
527
522
  const { density } = getState();
@@ -1909,7 +1904,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
1909
1904
  const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
1910
1905
  const { density } = getState();
1911
1906
  const { column } = header;
1912
- return (React__default["default"].createElement(Box__default["default"], { onDoubleClick: () => {
1907
+ return (React__default["default"].createElement(Box__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Wrapper", onDoubleClick: () => {
1913
1908
  setColumnSizingInfo((old) => (Object.assign(Object.assign({}, old), { isResizingColumn: false })));
1914
1909
  column.resetSize();
1915
1910
  }, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), sx: (theme) => ({
@@ -1927,7 +1922,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
1927
1922
  ? `translateX(${(_a = getState().columnSizingInfo.deltaOffset) !== null && _a !== void 0 ? _a : 0}px)`
1928
1923
  : undefined,
1929
1924
  } },
1930
- React__default["default"].createElement(Divider__default["default"], { flexItem: true, orientation: "vertical", sx: {
1925
+ React__default["default"].createElement(Divider__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: {
1931
1926
  borderRadius: '2px',
1932
1927
  borderWidth: '2px',
1933
1928
  height: '24px',
@@ -2748,9 +2743,9 @@ const MRT_Table = ({ table }) => {
2748
2743
  const colSizes = {};
2749
2744
  for (let i = 0; i < headers.length; i++) {
2750
2745
  const header = headers[i];
2751
- colSizes[`--header-${parseCSSVarId(header.id)}-size`] = header.getSize();
2752
- colSizes[`--col-${parseCSSVarId(header.column.id)}-size`] =
2753
- header.column.getSize();
2746
+ const colSize = header.getSize();
2747
+ colSizes[`--header-${parseCSSVarId(header.id)}-size`] = colSize;
2748
+ colSizes[`--col-${parseCSSVarId(header.column.id)}-size`] = colSize;
2754
2749
  }
2755
2750
  return colSizes;
2756
2751
  }, [columns, columnSizing, columnSizingInfo, columnVisibility]);
@@ -3190,10 +3185,12 @@ exports.MRT_AggregationFns = MRT_AggregationFns;
3190
3185
  exports.MRT_BottomToolbar = MRT_BottomToolbar;
3191
3186
  exports.MRT_CopyButton = MRT_CopyButton;
3192
3187
  exports.MRT_EditActionButtons = MRT_EditActionButtons;
3188
+ exports.MRT_ExpandButton = MRT_ExpandButton;
3193
3189
  exports.MRT_FilterFns = MRT_FilterFns;
3194
3190
  exports.MRT_FilterOptionMenu = MRT_FilterOptionMenu;
3195
3191
  exports.MRT_FullScreenToggleButton = MRT_FullScreenToggleButton;
3196
3192
  exports.MRT_GlobalFilterTextField = MRT_GlobalFilterTextField;
3193
+ exports.MRT_GrabHandleButton = MRT_GrabHandleButton;
3197
3194
  exports.MRT_ShowHideColumnsButton = MRT_ShowHideColumnsButton;
3198
3195
  exports.MRT_SortingFns = MRT_SortingFns;
3199
3196
  exports.MRT_TablePagination = MRT_TablePagination;