material-react-table 1.8.2 → 1.8.4

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.
@@ -266,7 +266,7 @@ const getCommonCellStyles = ({ column, header, table, tableCellProps, theme, })
266
266
  ? 'none'
267
267
  : `padding 150ms ease-in-out` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
268
268
  ? tableCellProps.sx(theme)
269
- : tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { minWidth: `max(calc(var(--col-${parseCSSVarId((_h = header === null || header === void 0 ? void 0 : header.id) !== null && _h !== void 0 ? _h : column.id)}-size) * 1px), ${(_j = column.columnDef.minSize) !== null && _j !== void 0 ? _j : 30}px)`, width: `calc(var(--col-${parseCSSVarId((_k = header === null || header === void 0 ? void 0 : header.id) !== null && _k !== void 0 ? _k : column.id)}-size) * 1px)` }));
269
+ : tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)), { minWidth: `max(calc(var(--${header ? 'header' : 'col'}-${parseCSSVarId((_h = header === null || header === void 0 ? void 0 : header.id) !== null && _h !== void 0 ? _h : column.id)}-size) * 1px), ${(_j = column.columnDef.minSize) !== null && _j !== void 0 ? _j : 30}px)`, width: `calc(var(--${header ? 'header' : 'col'}-${parseCSSVarId((_k = header === null || header === void 0 ? void 0 : header.id) !== null && _k !== void 0 ? _k : column.id)}-size) * 1px)` }));
270
270
  };
271
271
  const MRT_DefaultColumn = {
272
272
  filterVariant: 'text',
@@ -1490,7 +1490,7 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
1490
1490
  };
1491
1491
 
1492
1492
  const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1493
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1493
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1494
1494
  const { options: { enableColumnFilterModes, columnFilterModeOptions, icons: { FilterListIcon, CloseIcon }, localization, manualFiltering, muiTableHeadCellFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
1495
1495
  const { column } = header;
1496
1496
  const { columnDef } = column;
@@ -1675,28 +1675,27 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1675
1675
  ? textFieldProps.sx(theme)
1676
1676
  : textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx))) }),
1677
1677
  (isSelectFilter || isMultiSelectFilter) && (React.createElement(MenuItem, { divider: true, disabled: true, hidden: true, value: "" },
1678
- React.createElement(Box, { sx: { opacity: 0.5 } }, filterPlaceholder))), (_k = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _k === void 0 ? void 0 :
1679
- _k.map((option) => {
1680
- var _a;
1681
- let value;
1682
- let text;
1683
- if (typeof option !== 'object') {
1684
- value = option;
1685
- text = option;
1686
- }
1687
- else {
1688
- value = option.value;
1689
- text = option.text;
1690
- }
1691
- return (React.createElement(MenuItem, { key: value, sx: {
1692
- display: 'flex',
1693
- m: 0,
1694
- alignItems: 'center',
1695
- gap: '0.5rem',
1696
- }, value: value },
1697
- isMultiSelectFilter && (React.createElement(Checkbox, { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })),
1698
- text));
1699
- })),
1678
+ React.createElement(Box, { sx: { opacity: 0.5 } }, filterPlaceholder))), (_k = textFieldProps.children) !== null && _k !== void 0 ? _k : (_l = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _l === void 0 ? void 0 : _l.map((option) => {
1679
+ var _a;
1680
+ let value;
1681
+ let text;
1682
+ if (typeof option !== 'object') {
1683
+ value = option;
1684
+ text = option;
1685
+ }
1686
+ else {
1687
+ value = option.value;
1688
+ text = option.text;
1689
+ }
1690
+ return (React.createElement(MenuItem, { key: value, sx: {
1691
+ display: 'flex',
1692
+ m: 0,
1693
+ alignItems: 'center',
1694
+ gap: '0.5rem',
1695
+ }, value: value },
1696
+ isMultiSelectFilter && (React.createElement(Checkbox, { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })),
1697
+ text));
1698
+ })),
1700
1699
  React.createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table, setFilterValue: setFilterValue })));
1701
1700
  };
1702
1701
 
@@ -2052,7 +2051,7 @@ const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddi
2052
2051
  };
2053
2052
 
2054
2053
  const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
2055
- var _a, _b;
2054
+ var _a, _b, _c;
2056
2055
  const { getState, options: { muiTableBodyCellEditTextFieldProps }, refs: { editInputRefs }, setEditingCell, setEditingRow, } = table;
2057
2056
  const { column, row } = cell;
2058
2057
  const { columnDef } = column;
@@ -2113,7 +2112,7 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
2113
2112
  var _a;
2114
2113
  e.stopPropagation();
2115
2114
  (_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
2116
- }, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleEnterKeyDown }), (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _b === void 0 ? void 0 : _b.map((option) => {
2115
+ }, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleEnterKeyDown }), (_b = textFieldProps.children) !== null && _b !== void 0 ? _b : (_c = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _c === void 0 ? void 0 : _c.map((option) => {
2117
2116
  let value;
2118
2117
  let text;
2119
2118
  if (typeof option !== 'object') {
@@ -2672,9 +2671,9 @@ const MRT_Table = ({ table }) => {
2672
2671
  const colSizes = {};
2673
2672
  for (let i = 0; i < headers.length; i++) {
2674
2673
  const header = headers[i];
2675
- const colSize = header.getSize();
2676
- colSizes[`--header-${parseCSSVarId(header.id)}-size`] = colSize;
2677
- colSizes[`--col-${parseCSSVarId(header.column.id)}-size`] = colSize;
2674
+ colSizes[`--header-${parseCSSVarId(header.id)}-size`] = header.getSize();
2675
+ colSizes[`--col-${parseCSSVarId(header.column.id)}-size`] =
2676
+ header.column.getSize();
2678
2677
  }
2679
2678
  return colSizes;
2680
2679
  }, [columns, columnSizing, columnSizingInfo, columnVisibility]);