material-react-table 1.4.2 → 1.4.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.
@@ -54,7 +54,7 @@ import useMediaQuery from '@mui/material/useMediaQuery';
54
54
  import Collapse from '@mui/material/Collapse';
55
55
  import InputAdornment from '@mui/material/InputAdornment';
56
56
  import TextField from '@mui/material/TextField';
57
- import debounce from '@mui/material/utils/debounce';
57
+ import { debounce } from '@mui/material/utils';
58
58
  import LinearProgress from '@mui/material/LinearProgress';
59
59
  import TablePagination from '@mui/material/TablePagination';
60
60
  import Alert from '@mui/material/Alert';
@@ -1447,7 +1447,7 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
1447
1447
  };
1448
1448
 
1449
1449
  const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1450
- var _a, _b, _c, _d, _e, _f, _g, _h;
1450
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1451
1451
  const { options: { enableColumnFilterModes, columnFilterModeOptions, icons: { FilterListIcon, CloseIcon }, localization, manualFiltering, muiTableHeadCellFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
1452
1452
  const { column } = header;
1453
1453
  const { columnDef } = column;
@@ -1478,13 +1478,13 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1478
1478
  (currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
1479
1479
  : '';
1480
1480
  const filterPlaceholder = !isRangeFilter
1481
- ? (_c = localization.filterByColumn) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))
1481
+ ? (_c = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.placeholder) !== null && _c !== void 0 ? _c : (_d = localization.filterByColumn) === null || _d === void 0 ? void 0 : _d.replace('{column}', String(columnDef.header))
1482
1482
  : rangeFilterIndex === 0
1483
1483
  ? localization.min
1484
1484
  : rangeFilterIndex === 1
1485
1485
  ? localization.max
1486
1486
  : '';
1487
- const allowedColumnFilterOptions = (_d = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _d !== void 0 ? _d : columnFilterModeOptions;
1487
+ const allowedColumnFilterOptions = (_e = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _e !== void 0 ? _e : columnFilterModeOptions;
1488
1488
  const showChangeModeButton = enableColumnFilterModes &&
1489
1489
  columnDef.enableColumnFilterModes !== false &&
1490
1490
  !rangeFilterIndex &&
@@ -1554,7 +1554,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1554
1554
  isMounted.current = true;
1555
1555
  }, [column.getFilterValue()]);
1556
1556
  if (columnDef.Filter) {
1557
- return (React.createElement(React.Fragment, null, (_e = columnDef.Filter) === null || _e === void 0 ? void 0 : _e.call(columnDef, { column, header, rangeFilterIndex, table })));
1557
+ return (React.createElement(React.Fragment, null, (_f = columnDef.Filter) === null || _f === void 0 ? void 0 : _f.call(columnDef, { column, header, rangeFilterIndex, table })));
1558
1558
  }
1559
1559
  return (React.createElement(React.Fragment, null,
1560
1560
  React.createElement(TextField, Object.assign({ fullWidth: true, inputProps: {
@@ -1566,7 +1566,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1566
1566
  title: filterPlaceholder,
1567
1567
  }, helperText: showChangeModeButton ? (React.createElement("label", null, localization.filterMode.replace('{filterType}',
1568
1568
  // @ts-ignore
1569
- localization[`filter${((_f = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _f === void 0 ? void 0 : _f.toUpperCase()) +
1569
+ localization[`filter${((_g = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _g === void 0 ? void 0 : _g.toUpperCase()) +
1570
1570
  (currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]))) : null, FormHelperTextProps: {
1571
1571
  sx: {
1572
1572
  fontSize: '0.75rem',
@@ -1583,7 +1583,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1583
1583
  React.createElement(FilterListIcon, null)))),
1584
1584
  filterChipLabel && (React.createElement(Chip, { onDelete: handleClearEmptyFilterChip, label: filterChipLabel })))) : null,
1585
1585
  endAdornment: !filterChipLabel && (React.createElement(InputAdornment, { position: "end" },
1586
- React.createElement(Tooltip, { arrow: true, placement: "right", title: (_g = localization.clearFilter) !== null && _g !== void 0 ? _g : '' },
1586
+ React.createElement(Tooltip, { arrow: true, placement: "right", title: (_h = localization.clearFilter) !== null && _h !== void 0 ? _h : '' },
1587
1587
  React.createElement("span", null,
1588
1588
  React.createElement(IconButton, { "aria-label": localization.clearFilter, disabled: !(filterValue === null || filterValue === void 0 ? void 0 : filterValue.length), onClick: handleClear, size: "small", sx: {
1589
1589
  height: '1.75rem',
@@ -1620,8 +1620,8 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1620
1620
  ? textFieldProps.sx(theme)
1621
1621
  : textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx))) }),
1622
1622
  (isSelectFilter || isMultiSelectFilter) && (React.createElement(MenuItem, { divider: true, disabled: true, hidden: true, value: "" },
1623
- React.createElement(Box, { sx: { opacity: 0.5 } }, filterPlaceholder))), (_h = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _h === void 0 ? void 0 :
1624
- _h.map((option) => {
1623
+ React.createElement(Box, { sx: { opacity: 0.5 } }, filterPlaceholder))), (_j = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _j === void 0 ? void 0 :
1624
+ _j.map((option) => {
1625
1625
  var _a;
1626
1626
  let value;
1627
1627
  let text;