material-react-table 2.12.1 → 2.13.1

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/index.js CHANGED
@@ -54,6 +54,7 @@ var ViewColumnIcon = require('@mui/icons-material/ViewColumn');
54
54
  var VisibilityOffIcon = require('@mui/icons-material/VisibilityOff');
55
55
  var reactVirtual = require('@tanstack/react-virtual');
56
56
  var Paper = require('@mui/material/Paper');
57
+ var material = require('@mui/material');
57
58
  var TableContainer = require('@mui/material/TableContainer');
58
59
  var Table = require('@mui/material/Table');
59
60
  var TableBody = require('@mui/material/TableBody');
@@ -747,7 +748,7 @@ const MRT_EditActionButtons = (_a) => {
747
748
  }
748
749
  };
749
750
  return (jsxRuntime.jsx(Box__default["default"], { onClick: (e) => e.stopPropagation(), sx: (theme) => (Object.assign({ display: 'flex', gap: '0.75rem' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: variant === 'icon' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { title: localization.cancel, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.cancel, onClick: handleCancel, children: jsxRuntime.jsx(CancelIcon, {}) }) }), ((isCreating && onCreatingRowSave) ||
750
- (isEditing && onEditingRowSave)) && (jsxRuntime.jsx(Tooltip__default["default"], { title: localization.save, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.save, color: "info", onClick: handleSubmitRow, children: isSaving ? jsxRuntime.jsx(CircularProgress__default["default"], { size: 18 }) : jsxRuntime.jsx(SaveIcon, {}) }) }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button__default["default"], { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxRuntime.jsxs(Button__default["default"], { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsxRuntime.jsx(CircularProgress__default["default"], { color: "inherit", size: 18 }), localization.save] })] })) }));
751
+ (isEditing && onEditingRowSave)) && (jsxRuntime.jsx(Tooltip__default["default"], { title: localization.save, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.save, color: "info", disabled: isSaving, onClick: handleSubmitRow, children: isSaving ? jsxRuntime.jsx(CircularProgress__default["default"], { size: 18 }) : jsxRuntime.jsx(SaveIcon, {}) }) }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button__default["default"], { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxRuntime.jsxs(Button__default["default"], { disabled: isSaving, onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsxRuntime.jsx(CircularProgress__default["default"], { color: "inherit", size: 18 }), localization.save] })] })) }));
751
752
  };
752
753
 
753
754
  const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
@@ -1416,11 +1417,12 @@ const useMRT_TableOptions = (_a) => {
1416
1417
  ? reactTable.getFacetedMinMaxValues()
1417
1418
  : undefined, getFacetedRowModel: enableFacetedValues ? reactTable.getFacetedRowModel() : undefined, getFacetedUniqueValues: enableFacetedValues
1418
1419
  ? reactTable.getFacetedUniqueValues()
1419
- : undefined, getFilteredRowModel: enableColumnFilters || enableGlobalFilter || enableFilters
1420
+ : undefined, getFilteredRowModel: (enableColumnFilters || enableGlobalFilter || enableFilters) &&
1421
+ !manualFiltering
1420
1422
  ? reactTable.getFilteredRowModel()
1421
- : undefined, getGroupedRowModel: enableGrouping ? reactTable.getGroupedRowModel() : undefined, getPaginationRowModel: enablePagination
1423
+ : undefined, getGroupedRowModel: enableGrouping && !manualGrouping ? reactTable.getGroupedRowModel() : undefined, getPaginationRowModel: enablePagination && !manualPagination
1422
1424
  ? reactTable.getPaginationRowModel()
1423
- : undefined, getSortedRowModel: enableSorting ? reactTable.getSortedRowModel() : undefined, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows, icons,
1425
+ : undefined, getSortedRowModel: enableSorting && !manualSorting ? reactTable.getSortedRowModel() : undefined, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows, icons,
1424
1426
  layoutMode,
1425
1427
  localization,
1426
1428
  manualFiltering,
@@ -1856,6 +1858,8 @@ const MRT_TableBodyCellValue = ({ cell, rowRef, staticColumnIndex, staticRowInde
1856
1858
  column,
1857
1859
  row,
1858
1860
  table,
1861
+ staticColumnIndex,
1862
+ staticRowIndex,
1859
1863
  })
1860
1864
  : row.getIsGrouped() && !cell.getIsGrouped()
1861
1865
  ? null
@@ -1865,6 +1869,8 @@ const MRT_TableBodyCellValue = ({ cell, rowRef, staticColumnIndex, staticRowInde
1865
1869
  column,
1866
1870
  row,
1867
1871
  table,
1872
+ staticColumnIndex,
1873
+ staticRowIndex,
1868
1874
  })
1869
1875
  : undefined;
1870
1876
  const isGroupedValue = renderedCellValue !== undefined;
@@ -2020,9 +2026,7 @@ const MRT_EditCellTextField = (_a) => {
2020
2026
  : {})), textFieldProps.InputProps), { sx: (theme) => {
2021
2027
  var _a;
2022
2028
  return (Object.assign({ mb: 0 }, parseFromValuesOrFunc((_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.sx, theme)));
2023
- } }), SelectProps: {
2024
- MenuProps: { disableScrollLock: true },
2025
- }, inputProps: Object.assign({ autoComplete: 'new-password' }, textFieldProps.inputProps), onBlur: handleBlur, onChange: handleChange, onClick: (e) => {
2029
+ } }), SelectProps: Object.assign({ MenuProps: { disableScrollLock: true } }, textFieldProps.SelectProps), inputProps: Object.assign({ autoComplete: 'new-password' }, textFieldProps.inputProps), onBlur: handleBlur, onChange: handleChange, onClick: (e) => {
2026
2030
  var _a;
2027
2031
  e.stopPropagation();
2028
2032
  (_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
@@ -2131,6 +2135,8 @@ const MRT_TableBodyCell = (_a) => {
2131
2135
  const cellValueProps = {
2132
2136
  cell,
2133
2137
  table,
2138
+ staticColumnIndex,
2139
+ staticRowIndex,
2134
2140
  };
2135
2141
  const handleDoubleClick = (event) => {
2136
2142
  var _a;
@@ -4185,6 +4191,7 @@ const MRT_TablePaper = (_a) => {
4185
4191
  const { getState, options: { enableBottomToolbar, enableTopToolbar, mrtTheme: { baseBackgroundColor }, muiTablePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table;
4186
4192
  const { isFullScreen } = getState();
4187
4193
  const paperProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTablePaperProps, { table })), rest);
4194
+ const theme = material.useTheme();
4188
4195
  return (jsxRuntime.jsxs(Paper__default["default"], Object.assign({ elevation: 2 }, paperProps, { ref: (ref) => {
4189
4196
  tablePaperRef.current = ref;
4190
4197
  if (paperProps === null || paperProps === void 0 ? void 0 : paperProps.ref) {
@@ -4204,7 +4211,7 @@ const MRT_TablePaper = (_a) => {
4204
4211
  right: 0,
4205
4212
  top: 0,
4206
4213
  width: '100dvw',
4207
- zIndex: 999,
4214
+ zIndex: theme.zIndex.modal,
4208
4215
  }
4209
4216
  : {})), paperProps === null || paperProps === void 0 ? void 0 : paperProps.style), sx: (theme) => (Object.assign({ backgroundColor: baseBackgroundColor, backgroundImage: 'unset', overflow: 'hidden', transition: 'all 100ms ease-in-out' }, parseFromValuesOrFunc(paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx, theme))), children: [enableTopToolbar &&
4210
4217
  ((_b = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(MRT_TopToolbar, { table: table }))), jsxRuntime.jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&