material-react-table 0.35.2 → 0.36.2

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.
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
2
1
  import type { MRT_Cell, MRT_TableInstance } from '..';
3
- interface Props {
4
- cell: MRT_Cell;
5
- table: MRT_TableInstance;
2
+ interface Props<TData extends Record<string, any> = {}> {
3
+ cell: MRT_Cell<TData>;
4
+ table: MRT_TableInstance<TData>;
5
+ showLabel?: boolean;
6
6
  }
7
- export declare const MRT_EditCellTextField: FC<Props>;
7
+ export declare const MRT_EditCellTextField: <TData extends Record<string, any> = {}>({ cell, showLabel, table, }: Props<TData>) => JSX.Element;
8
8
  export {};
@@ -1,4 +1,4 @@
1
- import { ChangeEvent, Dispatch, DragEvent, FocusEvent, ReactNode, SetStateAction } from 'react';
1
+ import { Dispatch, DragEvent, ReactNode, SetStateAction } from 'react';
2
2
  import type { AlertProps, ButtonProps, CheckboxProps, IconButtonProps, LinearProgressProps, PaperProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
3
3
  import type { Cell, Column, ColumnDef, DeepKeys, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
4
4
  import type { Options as VirtualizerOptions } from 'react-virtual';
@@ -165,15 +165,15 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
165
165
  * @default gets set to the same value as `accessorKey` by default
166
166
  */
167
167
  id?: LiteralUnion<string & keyof TData>;
168
- muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
168
+ muiTableBodyCellCopyButtonProps?: ButtonProps | (({ cell, table, }: {
169
169
  table: MRT_TableInstance<TData>;
170
170
  cell: MRT_Cell<TData>;
171
171
  }) => ButtonProps);
172
- muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
173
- table: MRT_TableInstance<TData>;
172
+ muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ cell, table, }: {
174
173
  cell: MRT_Cell<TData>;
174
+ table: MRT_TableInstance<TData>;
175
175
  }) => TextFieldProps);
176
- muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
176
+ muiTableBodyCellProps?: TableCellProps | (({ cell, table, }: {
177
177
  table: MRT_TableInstance<TData>;
178
178
  cell: MRT_Cell<TData>;
179
179
  }) => TableCellProps);
@@ -198,18 +198,6 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
198
198
  table: MRT_TableInstance<TData>;
199
199
  column: MRT_Column<TData>;
200
200
  }) => TableCellProps);
201
- onCellEditBlur?: ({ cell, event, table, value, }: {
202
- event: FocusEvent<HTMLInputElement>;
203
- cell: MRT_Cell<TData>;
204
- table: MRT_TableInstance<TData>;
205
- value: string;
206
- }) => void;
207
- onCellEditChange?: ({ cell, event, table, value, }: {
208
- event: ChangeEvent<HTMLInputElement>;
209
- cell: MRT_Cell<TData>;
210
- table: MRT_TableInstance<TData>;
211
- value: string;
212
- }) => void;
213
201
  sortingFn?: MRT_SortingFn;
214
202
  };
215
203
  export declare type MRT_DefinedColumnDef<TData extends Record<string, any> = {}> = Omit<MRT_ColumnDef<TData>, 'id'> & {
@@ -261,7 +249,7 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
261
249
  displayColumnDefOptions?: Partial<{
262
250
  [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef>;
263
251
  }>;
264
- editingMode?: 'table' | 'row' | 'cell';
252
+ editingMode?: 'table' | 'modal' | 'row' | 'cell';
265
253
  enableBottomToolbar?: boolean;
266
254
  enableClickToCopy?: boolean;
267
255
  enableColumnActions?: boolean;
@@ -317,9 +305,9 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
317
305
  table: MRT_TableInstance<TData>;
318
306
  cell: MRT_Cell<TData>;
319
307
  }) => ButtonProps);
320
- muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
321
- table: MRT_TableInstance<TData>;
308
+ muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ cell, table, }: {
322
309
  cell: MRT_Cell<TData>;
310
+ table: MRT_TableInstance<TData>;
323
311
  }) => TextFieldProps);
324
312
  muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
325
313
  table: MRT_TableInstance<TData>;
@@ -400,18 +388,6 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
400
388
  muiTableTopToolbarProps?: ToolbarProps | (({ table }: {
401
389
  table: MRT_TableInstance<TData>;
402
390
  }) => ToolbarProps);
403
- onCellEditBlur?: ({ cell, event, table, value, }: {
404
- event: FocusEvent<HTMLInputElement>;
405
- cell: MRT_Cell<TData>;
406
- table: MRT_TableInstance<TData>;
407
- value: string;
408
- }) => void;
409
- onCellEditChange?: ({ cell, event, table, value, }: {
410
- event: ChangeEvent<HTMLInputElement>;
411
- cell: MRT_Cell<TData>;
412
- table: MRT_TableInstance<TData>;
413
- value: string;
414
- }) => void;
415
391
  onColumnDrop?: ({ event, draggedColumn, targetColumn, }: {
416
392
  event: DragEvent<HTMLButtonElement>;
417
393
  draggedColumn: MRT_Column<TData>;
@@ -0,0 +1,8 @@
1
+ import type { MRT_Row, MRT_TableInstance } from '..';
2
+ interface Props<TData extends Record<string, any> = {}> {
3
+ open: boolean;
4
+ row: MRT_Row<TData>;
5
+ table: MRT_TableInstance<TData>;
6
+ }
7
+ export declare const MRT_EditRowModal: <TData extends Record<string, any> = {}>({ open, row, table, }: Props<TData>) => JSX.Element;
8
+ export {};
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
2
1
  import type { MRT_Row, MRT_TableInstance } from '..';
3
- interface Props {
4
- row: MRT_Row;
5
- table: MRT_TableInstance;
2
+ interface Props<TData extends Record<string, any> = {}> {
3
+ row: MRT_Row<TData>;
4
+ table: MRT_TableInstance<TData>;
5
+ variant?: 'icon' | 'text';
6
6
  }
7
- export declare const MRT_EditActionButtons: FC<Props>;
7
+ export declare const MRT_EditActionButtons: <TData extends Record<string, any> = {}>({ row, table, variant, }: Props<TData>) => JSX.Element;
8
8
  export {};
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
2
1
  import type { MRT_Cell, MRT_TableInstance } from '..';
3
- interface Props {
4
- cell: MRT_Cell;
5
- table: MRT_TableInstance;
2
+ interface Props<TData extends Record<string, any> = {}> {
3
+ cell: MRT_Cell<TData>;
4
+ table: MRT_TableInstance<TData>;
5
+ showLabel?: boolean;
6
6
  }
7
- export declare const MRT_EditCellTextField: FC<Props>;
7
+ export declare const MRT_EditCellTextField: <TData extends Record<string, any> = {}>({ cell, showLabel, table, }: Props<TData>) => JSX.Element;
8
8
  export {};
@@ -2,7 +2,7 @@ import React, { useMemo, useRef, useState, useCallback, Fragment, useEffect, use
2
2
  import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
3
3
  import { ArrowRight, Cancel, CheckBox, ClearAll, Close, DensityLarge, DensityMedium, DensitySmall, DragHandle, DynamicFeed, Edit, ExpandLess, ExpandMore, FilterAlt, FilterAltOff, FilterList, FilterListOff, FullscreenExit, Fullscreen, KeyboardDoubleArrowDown, MoreHoriz, MoreVert, PushPin, RestartAlt, Save, Search, SearchOff, Sort, ViewColumn, VisibilityOff } from '@mui/icons-material';
4
4
  import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
5
- import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten, ListItemText, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog } from '@mui/material';
5
+ import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten, ListItemText, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, DialogTitle, DialogContent, Stack, DialogActions } from '@mui/material';
6
6
  import { useVirtual } from 'react-virtual';
7
7
 
8
8
  /******************************************************************************
@@ -522,29 +522,37 @@ const reorderColumn = (draggedColumn, targetColumn, columnOrder) => {
522
522
  columnOrder.splice(columnOrder.indexOf(targetColumn.id), 0, columnOrder.splice(columnOrder.indexOf(draggedColumn.id), 1)[0]);
523
523
  return [...columnOrder];
524
524
  };
525
- const getLeadingDisplayColumnIds = (props) => [
526
- (props.enableRowDragging || props.enableRowOrdering) && 'mrt-row-drag',
527
- ((props.positionActionsColumn === 'first' && props.enableRowActions) ||
528
- (props.enableEditing && props.editingMode === 'row')) &&
529
- 'mrt-row-actions',
530
- props.positionExpandColumn === 'first' &&
531
- (props.enableExpanding ||
532
- props.enableGrouping ||
533
- props.renderDetailPanel) &&
534
- 'mrt-row-expand',
535
- props.enableRowSelection && 'mrt-row-select',
536
- props.enableRowNumbers && 'mrt-row-numbers',
537
- ].filter(Boolean);
538
- const getTrailingDisplayColumnIds = (props) => [
539
- ((props.positionActionsColumn === 'last' && props.enableRowActions) ||
540
- (props.enableEditing && props.editingMode === 'row')) &&
541
- 'mrt-row-actions',
542
- props.positionExpandColumn === 'last' &&
543
- (props.enableExpanding ||
544
- props.enableGrouping ||
545
- props.renderDetailPanel) &&
546
- 'mrt-row-expand',
547
- ];
525
+ const getLeadingDisplayColumnIds = (props) => {
526
+ var _a;
527
+ return [
528
+ (props.enableRowDragging || props.enableRowOrdering) && 'mrt-row-drag',
529
+ ((props.positionActionsColumn === 'first' && props.enableRowActions) ||
530
+ (props.enableEditing &&
531
+ ['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
532
+ 'mrt-row-actions',
533
+ props.positionExpandColumn === 'first' &&
534
+ (props.enableExpanding ||
535
+ props.enableGrouping ||
536
+ props.renderDetailPanel) &&
537
+ 'mrt-row-expand',
538
+ props.enableRowSelection && 'mrt-row-select',
539
+ props.enableRowNumbers && 'mrt-row-numbers',
540
+ ].filter(Boolean);
541
+ };
542
+ const getTrailingDisplayColumnIds = (props) => {
543
+ var _a;
544
+ return [
545
+ ((props.positionActionsColumn === 'last' && props.enableRowActions) ||
546
+ (props.enableEditing &&
547
+ ['row', 'modal'].includes((_a = props.editingMode) !== null && _a !== void 0 ? _a : ''))) &&
548
+ 'mrt-row-actions',
549
+ props.positionExpandColumn === 'last' &&
550
+ (props.enableExpanding ||
551
+ props.enableGrouping ||
552
+ props.renderDetailPanel) &&
553
+ 'mrt-row-expand',
554
+ ];
555
+ };
548
556
  const getDefaultColumnOrderIds = (props) => [
549
557
  ...getLeadingDisplayColumnIds(props),
550
558
  ...getAllLeafColumnDefs(props.columns).map((columnDef) => getColumnId(columnDef)),
@@ -873,11 +881,10 @@ const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) =
873
881
  })));
874
882
  };
875
883
 
876
- const MRT_EditActionButtons = ({ row, table }) => {
884
+ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
877
885
  const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onEditingRowSave, }, setEditingRow, } = table;
878
886
  const { editingRow } = getState();
879
887
  const handleCancel = () => {
880
- row._valuesCache = Object.assign({}, row.original);
881
888
  setEditingRow(null);
882
889
  };
883
890
  const handleSave = () => {
@@ -889,13 +896,15 @@ const MRT_EditActionButtons = ({ row, table }) => {
889
896
  });
890
897
  setEditingRow(null);
891
898
  };
892
- return (React.createElement(Box, { sx: { display: 'flex', gap: '0.75rem' } },
899
+ return (React.createElement(Box, { sx: { display: 'flex', gap: '0.75rem' } }, variant === 'icon' ? (React.createElement(React.Fragment, null,
893
900
  React.createElement(Tooltip, { arrow: true, title: localization.cancel },
894
901
  React.createElement(IconButton, { "aria-label": localization.cancel, onClick: handleCancel },
895
902
  React.createElement(CancelIcon, null))),
896
903
  React.createElement(Tooltip, { arrow: true, title: localization.save },
897
904
  React.createElement(IconButton, { "aria-label": localization.save, color: "info", onClick: handleSave },
898
- React.createElement(SaveIcon, null)))));
905
+ React.createElement(SaveIcon, null))))) : (React.createElement(React.Fragment, null,
906
+ React.createElement(Button, { onClick: handleCancel }, localization.cancel),
907
+ React.createElement(Button, { onClick: handleSave, variant: "contained" }, localization.save)))));
899
908
  };
900
909
 
901
910
  const commonIconButtonStyles = {
@@ -909,7 +918,7 @@ const commonIconButtonStyles = {
909
918
  },
910
919
  };
911
920
  const MRT_ToggleRowActionMenuButton = ({ row, table }) => {
912
- const { getState, options: { enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
921
+ const { getState, options: { editingMode, enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
913
922
  const { editingRow } = getState();
914
923
  const [anchorEl, setAnchorEl] = useState(null);
915
924
  const handleOpenRowActionMenu = (event) => {
@@ -921,7 +930,7 @@ const MRT_ToggleRowActionMenuButton = ({ row, table }) => {
921
930
  setEditingRow(Object.assign({}, row));
922
931
  setAnchorEl(null);
923
932
  };
924
- return (React.createElement(React.Fragment, null, renderRowActions ? (React.createElement(React.Fragment, null, renderRowActions({ row, table }))) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) ? (React.createElement(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems && enableEditing ? (React.createElement(Tooltip, { placement: "right", arrow: true, title: localization.edit },
933
+ return (React.createElement(React.Fragment, null, renderRowActions ? (React.createElement(React.Fragment, null, renderRowActions({ row, table }))) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) && editingMode === 'row' ? (React.createElement(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems && enableEditing ? (React.createElement(Tooltip, { placement: "right", arrow: true, title: localization.edit },
925
934
  React.createElement(IconButton, { sx: commonIconButtonStyles, onClick: handleStartEditMode },
926
935
  React.createElement(EditIcon, null)))) : renderRowActionMenuItems ? (React.createElement(React.Fragment, null,
927
936
  React.createElement(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions },
@@ -1731,31 +1740,13 @@ const MRT_TableHead = ({ table }) => {
1731
1740
  return (React.createElement(TableHead, Object.assign({}, tableHeadProps), getHeaderGroups().map((headerGroup) => (React.createElement(MRT_TableHeadRow, { headerGroup: headerGroup, key: headerGroup.id, table: table })))));
1732
1741
  };
1733
1742
 
1734
- const MRT_EditCellTextField = ({ cell, table }) => {
1743
+ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
1735
1744
  var _a;
1736
- const { getState, options: { tableId, muiTableBodyCellEditTextFieldProps, onCellEditBlur, onCellEditChange, }, setEditingCell, setEditingRow, } = table;
1737
- const { column, row } = cell;
1745
+ const { getState, options: { tableId, muiTableBodyCellEditTextFieldProps }, setEditingCell, setEditingRow, } = table;
1746
+ const { column } = cell;
1738
1747
  const { columnDef } = column;
1739
1748
  const { editingRow } = getState();
1740
1749
  const [value, setValue] = useState(() => cell.getValue());
1741
- const handleChange = (event) => {
1742
- var _a;
1743
- setValue(event.target.value);
1744
- (_a = columnDef.onCellEditChange) === null || _a === void 0 ? void 0 : _a.call(columnDef, { event, cell, table, value });
1745
- onCellEditChange === null || onCellEditChange === void 0 ? void 0 : onCellEditChange({ event, cell, table, value });
1746
- };
1747
- const handleBlur = (event) => {
1748
- var _a;
1749
- if (editingRow) {
1750
- if (!row._valuesCache)
1751
- row._valuesCache = {};
1752
- row._valuesCache[column.id] = value;
1753
- setEditingRow(Object.assign({}, editingRow));
1754
- }
1755
- setEditingCell(null);
1756
- (_a = columnDef.onCellEditBlur) === null || _a === void 0 ? void 0 : _a.call(columnDef, { event, cell, table, value });
1757
- onCellEditBlur === null || onCellEditBlur === void 0 ? void 0 : onCellEditBlur({ event, cell, table, value });
1758
- };
1759
1750
  const mTableBodyCellEditTextFieldProps = muiTableBodyCellEditTextFieldProps instanceof Function
1760
1751
  ? muiTableBodyCellEditTextFieldProps({ cell, table })
1761
1752
  : muiTableBodyCellEditTextFieldProps;
@@ -1766,10 +1757,23 @@ const MRT_EditCellTextField = ({ cell, table }) => {
1766
1757
  })
1767
1758
  : columnDef.muiTableBodyCellEditTextFieldProps;
1768
1759
  const textFieldProps = Object.assign(Object.assign({}, mTableBodyCellEditTextFieldProps), mcTableBodyCellEditTextFieldProps);
1760
+ const handleChange = (event) => {
1761
+ var _a;
1762
+ (_a = textFieldProps.onChange) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, event);
1763
+ setValue(event.target.value);
1764
+ };
1765
+ const handleBlur = (event) => {
1766
+ var _a;
1767
+ (_a = textFieldProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, event);
1768
+ if (editingRow) {
1769
+ setEditingRow(Object.assign(Object.assign({}, editingRow), { _valuesCache: Object.assign(Object.assign({}, editingRow._valuesCache), { [column.id]: value }) }));
1770
+ }
1771
+ setEditingCell(null);
1772
+ };
1769
1773
  if (columnDef.Edit) {
1770
1774
  return React.createElement(React.Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, table }));
1771
1775
  }
1772
- return (React.createElement(TextField, Object.assign({ id: `mrt-${tableId}-edit-cell-text-field-${cell.id}`, margin: "none", onBlur: handleBlur, onChange: handleChange, onClick: (e) => e.stopPropagation(), placeholder: columnDef.header, value: value, variant: "standard" }, textFieldProps)));
1776
+ return (React.createElement(TextField, Object.assign({ disabled: columnDef.enableEditing === false, fullWidth: true, id: `mrt-${tableId}-edit-cell-text-field-${cell.id}`, label: showLabel ? column.columnDef.header : undefined, margin: "none", onClick: (e) => e.stopPropagation(), placeholder: columnDef.header, value: value, variant: "standard" }, textFieldProps, { onBlur: handleBlur, onChange: handleChange })));
1773
1777
  };
1774
1778
 
1775
1779
  const MRT_CopyButton = ({ cell, children, table }) => {
@@ -1837,6 +1841,7 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
1837
1841
  const isEditable = (enableEditing || columnDef.enableEditing) &&
1838
1842
  columnDef.enableEditing !== false;
1839
1843
  const isEditing = isEditable &&
1844
+ editingMode !== 'modal' &&
1840
1845
  (editingMode === 'table' ||
1841
1846
  (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id ||
1842
1847
  (editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) === cell.id);
@@ -1931,10 +1936,13 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
1931
1936
  : column.getIsPinned()
1932
1937
  ? 1
1933
1938
  : undefined, '&:hover': {
1934
- backgroundColor: enableHover && enableEditing && editingMode !== 'row'
1939
+ backgroundColor: enableHover &&
1940
+ enableEditing &&
1941
+ columnDef.enableEditing !== false &&
1942
+ ['table', 'cell'].includes(editingMode !== null && editingMode !== void 0 ? editingMode : '')
1935
1943
  ? theme.palette.mode === 'dark'
1936
- ? `${lighten(theme.palette.background.default, 0.13)} !important`
1937
- : `${darken(theme.palette.background.default, 0.07)} !important`
1944
+ ? `${lighten(theme.palette.background.default, 0.2)} !important`
1945
+ : `${darken(theme.palette.background.default, 0.1)} !important`
1938
1946
  : undefined,
1939
1947
  } }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
1940
1948
  ? tableCellProps.sx(theme)
@@ -1942,14 +1950,22 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
1942
1950
  } }),
1943
1951
  React.createElement(React.Fragment, null, cell.getIsPlaceholder() ? null : isLoading || showSkeletons ? (React.createElement(Skeleton, Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, muiTableBodyCellSkeletonProps))) : enableRowNumbers &&
1944
1952
  rowNumberMode === 'static' &&
1945
- column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (React.createElement(MRT_TableBodyRowGrabHandle, { cell: cell, rowRef: rowRef, table: table })) : columnDefType === 'display' ? ((_a = columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, table })) : isEditing ? (React.createElement(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
1953
+ column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (React.createElement(MRT_TableBodyRowGrabHandle, { cell: cell, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
1954
+ (column.id === 'mrt-row-select' ||
1955
+ column.id === 'mrt-row-expand' ||
1956
+ !row.getIsGrouped()) ? ((_a = columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, table })) : isEditing ? (React.createElement(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
1946
1957
  columnDef.enableClickToCopy !== false ? (React.createElement(React.Fragment, null,
1947
1958
  React.createElement(MRT_CopyButton, { cell: cell, table: table },
1948
- React.createElement(React.Fragment, null, (_c = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, table })) !== null && _c !== void 0 ? _c : cell.renderValue())),
1959
+ React.createElement(React.Fragment, null, row.getIsGrouped() && !cell.getIsGrouped()
1960
+ ? null
1961
+ : (_c = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, table })) !== null && _c !== void 0 ? _c : cell.renderValue())),
1949
1962
  cell.getIsGrouped() && React.createElement(React.Fragment, null,
1950
1963
  " (", (_d = row.subRows) === null || _d === void 0 ? void 0 :
1951
1964
  _d.length,
1952
- ")"))) : (React.createElement(React.Fragment, null, (_g = (_f = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _f === void 0 ? void 0 : _f.call(columnDef, { cell, column, table })) !== null && _g !== void 0 ? _g : cell.renderValue(),
1965
+ ")"))) : (React.createElement(React.Fragment, null,
1966
+ row.getIsGrouped() && !cell.getIsGrouped()
1967
+ ? null
1968
+ : (_g = (_f = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Cell) === null || _f === void 0 ? void 0 : _f.call(columnDef, { cell, column, table })) !== null && _g !== void 0 ? _g : cell.renderValue(),
1953
1969
  cell.getIsGrouped() && React.createElement(React.Fragment, null,
1954
1970
  " (", (_j = (_h = row.subRows) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : '',
1955
1971
  ")"))))));
@@ -2200,6 +2216,23 @@ const MRT_TablePaper = ({ table }) => {
2200
2216
  enableBottomToolbar && React.createElement(MRT_BottomToolbar, { table: table })));
2201
2217
  };
2202
2218
 
2219
+ const MRT_EditRowModal = ({ open, row, table, }) => {
2220
+ const { options: { localization }, } = table;
2221
+ return (React.createElement(Dialog, { open: open },
2222
+ React.createElement(DialogTitle, { textAlign: "center" }, localization.edit),
2223
+ React.createElement(DialogContent, null,
2224
+ React.createElement(Stack, { sx: {
2225
+ width: '100%',
2226
+ minWidth: { xs: '300px', sm: '360px', md: '400px' },
2227
+ gap: '1.5rem',
2228
+ } }, row
2229
+ .getVisibleCells()
2230
+ .filter((cell) => cell.column.columnDef.columnDefType === 'data')
2231
+ .map((cell) => (React.createElement(MRT_EditCellTextField, { cell: cell, key: cell.id, showLabel: true, table: table }))))),
2232
+ React.createElement(DialogActions, { sx: { p: '1.25rem' } },
2233
+ React.createElement(MRT_EditActionButtons, { row: row, table: table, variant: "text" }))));
2234
+ };
2235
+
2203
2236
  const MRT_TableRoot = (props) => {
2204
2237
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
2205
2238
  const [tableId, setIdPrefix] = useState(props.tableId);
@@ -2301,7 +2334,8 @@ const MRT_TableRoot = (props) => {
2301
2334
  return (React.createElement(React.Fragment, null,
2302
2335
  React.createElement(Dialog, { PaperComponent: Box, TransitionComponent: Grow, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => setIsFullScreen(false), open: isFullScreen, transitionDuration: 400 },
2303
2336
  React.createElement(MRT_TablePaper, { table: table })),
2304
- !isFullScreen && React.createElement(MRT_TablePaper, { table: table })));
2337
+ !isFullScreen && React.createElement(MRT_TablePaper, { table: table }),
2338
+ editingRow && props.editingMode === 'modal' && (React.createElement(MRT_EditRowModal, { row: editingRow, table: table, open: true }))));
2305
2339
  };
2306
2340
 
2307
2341
  var MaterialReactTable = (_a) => {