material-react-table 0.34.1 → 0.35.0

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.
@@ -559,7 +559,7 @@ const getDefaultColumnFilterFn = (columnDef) => {
559
559
  return 'fuzzy';
560
560
  };
561
561
 
562
- const MRT_ShowHideColumnsMenuItems = ({ allColumns, currentHoveredColumn, setCurrentHoveredColumn, column, isSubMenu, table, }) => {
562
+ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredColumn, column, isSubMenu, table, }) => {
563
563
  var _a;
564
564
  const { getState, options: { enableColumnOrdering, enableHiding, enablePinning, localization, }, setColumnOrder, } = table;
565
565
  const { columnOrder } = getState();
@@ -587,14 +587,14 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, currentHoveredColumn, setCur
587
587
  };
588
588
  const handleDragEnd = (_e) => {
589
589
  setIsDragging(false);
590
- setCurrentHoveredColumn(null);
591
- if (currentHoveredColumn) {
592
- setColumnOrder(reorderColumn(column, currentHoveredColumn, columnOrder));
590
+ setHoveredColumn(null);
591
+ if (hoveredColumn) {
592
+ setColumnOrder(reorderColumn(column, hoveredColumn, columnOrder));
593
593
  }
594
594
  };
595
595
  const handleDragEnter = (_e) => {
596
596
  if (!isDragging) {
597
- setCurrentHoveredColumn(column);
597
+ setHoveredColumn(column);
598
598
  }
599
599
  };
600
600
  return (React.createElement(React.Fragment, null,
@@ -605,7 +605,7 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, currentHoveredColumn, setCur
605
605
  opacity: isDragging ? 0.5 : 1,
606
606
  outline: isDragging
607
607
  ? `1px dashed ${theme.palette.divider}`
608
- : (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === column.id
608
+ : (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
609
609
  ? `2px dashed ${theme.palette.primary.main}`
610
610
  : 'none',
611
611
  pl: `${(column.depth + 0.5) * 2}rem`,
@@ -635,7 +635,7 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, currentHoveredColumn, setCur
635
635
  React.createElement(Switch, null)), disabled: (isSubMenu && switchChecked) ||
636
636
  !column.getCanHide() ||
637
637
  column.getIsGrouped(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (React.createElement(Typography, { sx: { alignSelf: 'center' } }, columnDef.header)))), (_a = column.columns) === null || _a === void 0 ? void 0 :
638
- _a.map((c, i) => (React.createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, currentHoveredColumn: currentHoveredColumn, isSubMenu: isSubMenu, key: `${i}-${c.id}`, setCurrentHoveredColumn: setCurrentHoveredColumn, table: table })))));
638
+ _a.map((c, i) => (React.createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, isSubMenu: isSubMenu, key: `${i}-${c.id}`, setHoveredColumn: setHoveredColumn, table: table })))));
639
639
  };
640
640
 
641
641
  const MRT_ShowHideColumnsMenu = ({ anchorEl, isSubMenu, setAnchorEl, table, }) => {
@@ -665,7 +665,7 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, isSubMenu, setAnchorEl, table, }) =
665
665
  getLeftLeafColumns(),
666
666
  getRightLeafColumns(),
667
667
  ]);
668
- const [currentHoveredColumn, setCurrentHoveredColumn] = useState(null);
668
+ const [hoveredColumn, setHoveredColumn] = useState(null);
669
669
  return (React.createElement(Menu, { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
670
670
  dense: density === 'compact',
671
671
  } },
@@ -680,7 +680,7 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, isSubMenu, setAnchorEl, table, }) =
680
680
  !isSubMenu && enablePinning && (React.createElement(Button, { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true) }, localization.unpinAll)),
681
681
  React.createElement(Button, { disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true) }, localization.showAll)),
682
682
  React.createElement(Divider, null),
683
- allColumns.map((column, index) => (React.createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, currentHoveredColumn: currentHoveredColumn, isSubMenu: isSubMenu, key: `${index}-${column.id}`, setCurrentHoveredColumn: setCurrentHoveredColumn, table: table })))));
683
+ allColumns.map((column, index) => (React.createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, isSubMenu: isSubMenu, key: `${index}-${column.id}`, setHoveredColumn: setHoveredColumn, table: table })))));
684
684
  };
685
685
 
686
686
  const commonMenuItemStyles = {
@@ -873,16 +873,20 @@ const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) =
873
873
  };
874
874
 
875
875
  const MRT_EditActionButtons = ({ row, table }) => {
876
- const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onEditRowSubmit, }, setCurrentEditingRow, } = table;
877
- const { currentEditingRow } = getState();
876
+ const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onEditRowSubmit, }, setEditingRow, } = table;
877
+ const { editingRow } = getState();
878
878
  const handleCancel = () => {
879
- var _a;
880
- row._valuesCache = (_a = row.original) !== null && _a !== void 0 ? _a : {};
881
- setCurrentEditingRow(null);
879
+ row._valuesCache = Object.assign({}, row.original);
880
+ setEditingRow(null);
882
881
  };
883
882
  const handleSave = () => {
884
- onEditRowSubmit === null || onEditRowSubmit === void 0 ? void 0 : onEditRowSubmit({ row: currentEditingRow !== null && currentEditingRow !== void 0 ? currentEditingRow : row, table });
885
- setCurrentEditingRow(null);
883
+ var _a;
884
+ onEditRowSubmit === null || onEditRowSubmit === void 0 ? void 0 : onEditRowSubmit({
885
+ row: editingRow !== null && editingRow !== void 0 ? editingRow : row,
886
+ table,
887
+ values: (_a = editingRow === null || editingRow === void 0 ? void 0 : editingRow._valuesCache) !== null && _a !== void 0 ? _a : Object.assign({}, row.original),
888
+ });
889
+ setEditingRow(null);
886
890
  };
887
891
  return (React.createElement(Box, { sx: { display: 'flex', gap: '0.75rem' } },
888
892
  React.createElement(Tooltip, { arrow: true, title: localization.cancel },
@@ -904,8 +908,8 @@ const commonIconButtonStyles = {
904
908
  },
905
909
  };
906
910
  const MRT_ToggleRowActionMenuButton = ({ row, table }) => {
907
- const { getState, options: { enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setCurrentEditingRow, } = table;
908
- const { currentEditingRow } = getState();
911
+ const { getState, options: { enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
912
+ const { editingRow } = getState();
909
913
  const [anchorEl, setAnchorEl] = useState(null);
910
914
  const handleOpenRowActionMenu = (event) => {
911
915
  event.stopPropagation();
@@ -913,10 +917,10 @@ const MRT_ToggleRowActionMenuButton = ({ row, table }) => {
913
917
  setAnchorEl(event.currentTarget);
914
918
  };
915
919
  const handleStartEditMode = () => {
916
- setCurrentEditingRow(Object.assign({}, row));
920
+ setEditingRow(Object.assign({}, row));
917
921
  setAnchorEl(null);
918
922
  };
919
- return (React.createElement(React.Fragment, null, renderRowActions ? (React.createElement(React.Fragment, null, renderRowActions({ row, table }))) : row.id === (currentEditingRow === null || currentEditingRow === void 0 ? void 0 : currentEditingRow.id) ? (React.createElement(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems && enableEditing ? (React.createElement(Tooltip, { placement: "right", arrow: true, title: localization.edit },
923
+ 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 },
920
924
  React.createElement(IconButton, { sx: commonIconButtonStyles, onClick: handleStartEditMode },
921
925
  React.createElement(EditIcon, null)))) : renderRowActionMenuItems ? (React.createElement(React.Fragment, null,
922
926
  React.createElement(Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions },
@@ -1146,15 +1150,15 @@ const MRT_ToolbarInternalButtons = ({ table }) => {
1146
1150
 
1147
1151
  const MRT_ToolbarDropZone = ({ table }) => {
1148
1152
  var _a, _b;
1149
- const { getState, options: { enableGrouping, localization }, setCurrentHoveredColumn, } = table;
1150
- const { currentDraggingColumn, currentHoveredColumn } = getState();
1153
+ const { getState, options: { enableGrouping, localization }, setHoveredColumn, } = table;
1154
+ const { draggingColumn, hoveredColumn } = getState();
1151
1155
  const handleDragEnter = (_event) => {
1152
- setCurrentHoveredColumn({ id: 'drop-zone' });
1156
+ setHoveredColumn({ id: 'drop-zone' });
1153
1157
  };
1154
- return (React.createElement(Fade, { unmountOnExit: true, mountOnEnter: true, in: !!enableGrouping && !!currentDraggingColumn },
1158
+ return (React.createElement(Fade, { unmountOnExit: true, mountOnEnter: true, in: !!enableGrouping && !!draggingColumn },
1155
1159
  React.createElement(Box, { sx: (theme) => ({
1156
1160
  alignItems: 'center',
1157
- backgroundColor: alpha(theme.palette.info.main, (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
1161
+ backgroundColor: alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
1158
1162
  border: `dashed ${theme.palette.info.main} 2px`,
1159
1163
  display: 'flex',
1160
1164
  justifyContent: 'center',
@@ -1163,7 +1167,7 @@ const MRT_ToolbarDropZone = ({ table }) => {
1163
1167
  width: 'calc(100% - 4px)',
1164
1168
  zIndex: 2,
1165
1169
  }), onDragEnter: handleDragEnter },
1166
- React.createElement(Typography, null, localization.dropToGroupBy.replace('{column}', (_b = (_a = currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.columnDef) === null || _a === void 0 ? void 0 : _a.header) !== null && _b !== void 0 ? _b : '')))));
1170
+ React.createElement(Typography, null, localization.dropToGroupBy.replace('{column}', (_b = (_a = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _a === void 0 ? void 0 : _a.header) !== null && _b !== void 0 ? _b : '')))));
1167
1171
  };
1168
1172
 
1169
1173
  const commonToolbarStyles = ({ theme }) => ({
@@ -1493,9 +1497,9 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
1493
1497
  };
1494
1498
 
1495
1499
  const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
1496
- const { getState, options: { enableColumnOrdering, muiTableHeadCellDragHandleProps, onColumnDrop, }, setColumnOrder, setCurrentDraggingColumn, setCurrentHoveredColumn, } = table;
1500
+ const { getState, options: { enableColumnOrdering, muiTableHeadCellDragHandleProps, onColumnDrop, }, setColumnOrder, setDraggingColumn, setHoveredColumn, } = table;
1497
1501
  const { columnDef } = column;
1498
- const { currentHoveredColumn, currentDraggingColumn, columnOrder } = getState();
1502
+ const { hoveredColumn, draggingColumn, columnOrder } = getState();
1499
1503
  const mIconButtonProps = muiTableHeadCellDragHandleProps instanceof Function
1500
1504
  ? muiTableHeadCellDragHandleProps({ column, table })
1501
1505
  : muiTableHeadCellDragHandleProps;
@@ -1504,25 +1508,25 @@ const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
1504
1508
  : columnDef.muiTableHeadCellDragHandleProps;
1505
1509
  const iconButtonProps = Object.assign(Object.assign({}, mIconButtonProps), mcIconButtonProps);
1506
1510
  const handleDragStart = (e) => {
1507
- setCurrentDraggingColumn(column);
1511
+ setDraggingColumn(column);
1508
1512
  e.dataTransfer.setDragImage(tableHeadCellRef.current, 0, 0);
1509
1513
  };
1510
1514
  const handleDragEnd = (event) => {
1511
1515
  onColumnDrop === null || onColumnDrop === void 0 ? void 0 : onColumnDrop({
1512
1516
  event,
1513
1517
  draggedColumn: column,
1514
- targetColumn: currentHoveredColumn,
1518
+ targetColumn: hoveredColumn,
1515
1519
  });
1516
- if ((currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === 'drop-zone') {
1520
+ if ((hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone') {
1517
1521
  column.toggleGrouping();
1518
1522
  }
1519
1523
  else if (enableColumnOrdering &&
1520
- currentHoveredColumn &&
1521
- (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) !== (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id)) {
1522
- setColumnOrder(reorderColumn(column, currentHoveredColumn, columnOrder));
1524
+ hoveredColumn &&
1525
+ (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) !== (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id)) {
1526
+ setColumnOrder(reorderColumn(column, hoveredColumn, columnOrder));
1523
1527
  }
1524
- setCurrentDraggingColumn(null);
1525
- setCurrentHoveredColumn(null);
1528
+ setDraggingColumn(null);
1529
+ setHoveredColumn(null);
1526
1530
  };
1527
1531
  return (React.createElement(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragStart: handleDragStart, onDragEnd: handleDragEnd, table: table }));
1528
1532
  };
@@ -1580,8 +1584,8 @@ const MRT_TableHeadCellSortLabel = ({ header, table }) => {
1580
1584
  const MRT_TableHeadCell = ({ header, table }) => {
1581
1585
  var _a, _b, _c, _d;
1582
1586
  const theme = useTheme();
1583
- const { getState, options: { enableColumnActions, enableColumnDragging, enableColumnOrdering, enableColumnResizing, enableGrouping, enableMultiSort, muiTableHeadCellProps, }, setCurrentHoveredColumn, } = table;
1584
- const { density, currentDraggingColumn, currentHoveredColumn, showColumnFilters, } = getState();
1587
+ const { getState, options: { enableColumnActions, enableColumnDragging, enableColumnOrdering, enableColumnResizing, enableGrouping, enableMultiSort, muiTableHeadCellProps, }, setHoveredColumn, } = table;
1588
+ const { density, draggingColumn, hoveredColumn, showColumnFilters } = getState();
1585
1589
  const { column } = header;
1586
1590
  const { columnDef } = column;
1587
1591
  const { columnDefType } = columnDef;
@@ -1603,16 +1607,16 @@ const MRT_TableHeadCell = ({ header, table }) => {
1603
1607
  return ((table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 150);
1604
1608
  };
1605
1609
  const handleDragEnter = (_e) => {
1606
- if (enableGrouping && (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === 'drop-zone') {
1607
- setCurrentHoveredColumn(null);
1610
+ if (enableGrouping && (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone') {
1611
+ setHoveredColumn(null);
1608
1612
  }
1609
- if (enableColumnOrdering && currentDraggingColumn) {
1610
- setCurrentHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
1613
+ if (enableColumnOrdering && draggingColumn) {
1614
+ setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
1611
1615
  }
1612
1616
  };
1613
- const draggingBorder = (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id) === column.id
1617
+ const draggingBorder = (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
1614
1618
  ? `1px dashed ${theme.palette.text.secondary}`
1615
- : (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === column.id
1619
+ : (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
1616
1620
  ? `2px dashed ${theme.palette.primary.main}`
1617
1621
  : undefined;
1618
1622
  const draggingBorders = draggingBorder
@@ -1640,8 +1644,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
1640
1644
  ? `-4px 0 4px -2px ${alpha(theme.palette.common.black, 0.1)}`
1641
1645
  : undefined, fontWeight: 'bold', left: column.getIsPinned() === 'left'
1642
1646
  ? `${column.getStart('left')}px`
1643
- : undefined, overflow: 'visible', opacity: (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id) === column.id ||
1644
- (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === column.id
1647
+ : undefined, overflow: 'visible', opacity: (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id || (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
1645
1648
  ? 0.5
1646
1649
  : 1, p: density === 'compact'
1647
1650
  ? '0.5rem'
@@ -1663,7 +1666,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
1663
1666
  ? '0.25'
1664
1667
  : density === 'comfortable'
1665
1668
  ? '.75rem'
1666
- : '1.25rem', right: column.getIsPinned() === 'right' ? `${getTotalRight()}px` : undefined, transition: `all ${enableColumnResizing ? 0 : '0.2s'} ease-in-out`, userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined, verticalAlign: 'top', zIndex: column.getIsResizing() || (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id) === column.id
1669
+ : '1.25rem', right: column.getIsPinned() === 'right' ? `${getTotalRight()}px` : undefined, transition: `all ${enableColumnResizing ? 0 : '0.2s'} ease-in-out`, userSelect: enableMultiSort && column.getCanSort() ? 'none' : undefined, verticalAlign: 'top', zIndex: column.getIsResizing() || (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
1667
1670
  ? 3
1668
1671
  : column.getIsPinned() && columnDefType !== 'group'
1669
1672
  ? 2
@@ -2221,27 +2224,28 @@ function calculateRange(_ref4) {
2221
2224
 
2222
2225
  const MRT_EditCellTextField = ({ cell, table }) => {
2223
2226
  var _a;
2224
- const { getState, options: { tableId, enableEditing, muiTableBodyCellEditTextFieldProps, onCellEditBlur, onCellEditChange, }, setCurrentEditingCell, setCurrentEditingRow, } = table;
2227
+ const { getState, options: { tableId, muiTableBodyCellEditTextFieldProps, onCellEditBlur, onCellEditChange, }, setEditingCell, setEditingRow, } = table;
2225
2228
  const { column, row } = cell;
2226
2229
  const { columnDef } = column;
2227
- const [value, setValue] = useState(cell.getValue());
2230
+ const { editingRow } = getState();
2231
+ const [value, setValue] = useState(() => cell.getValue());
2228
2232
  const handleChange = (event) => {
2229
2233
  var _a;
2230
2234
  setValue(event.target.value);
2231
- (_a = columnDef.onCellEditChange) === null || _a === void 0 ? void 0 : _a.call(columnDef, { event, cell, table });
2232
- onCellEditChange === null || onCellEditChange === void 0 ? void 0 : onCellEditChange({ event, cell, table });
2235
+ (_a = columnDef.onCellEditChange) === null || _a === void 0 ? void 0 : _a.call(columnDef, { event, cell, table, value });
2236
+ onCellEditChange === null || onCellEditChange === void 0 ? void 0 : onCellEditChange({ event, cell, table, value });
2233
2237
  };
2234
2238
  const handleBlur = (event) => {
2235
2239
  var _a;
2236
- if (getState().currentEditingRow) {
2240
+ if (editingRow) {
2237
2241
  if (!row._valuesCache)
2238
2242
  row._valuesCache = {};
2239
2243
  row._valuesCache[column.id] = value;
2240
- setCurrentEditingRow(Object.assign({}, getState().currentEditingRow));
2244
+ setEditingRow(Object.assign({}, editingRow));
2241
2245
  }
2242
- setCurrentEditingCell(null);
2243
- (_a = columnDef.onCellEditBlur) === null || _a === void 0 ? void 0 : _a.call(columnDef, { event, cell, table });
2244
- onCellEditBlur === null || onCellEditBlur === void 0 ? void 0 : onCellEditBlur({ event, cell, table });
2246
+ setEditingCell(null);
2247
+ (_a = columnDef.onCellEditBlur) === null || _a === void 0 ? void 0 : _a.call(columnDef, { event, cell, table, value });
2248
+ onCellEditBlur === null || onCellEditBlur === void 0 ? void 0 : onCellEditBlur({ event, cell, table, value });
2245
2249
  };
2246
2250
  const mTableBodyCellEditTextFieldProps = muiTableBodyCellEditTextFieldProps instanceof Function
2247
2251
  ? muiTableBodyCellEditTextFieldProps({ cell, table })
@@ -2253,10 +2257,10 @@ const MRT_EditCellTextField = ({ cell, table }) => {
2253
2257
  })
2254
2258
  : columnDef.muiTableBodyCellEditTextFieldProps;
2255
2259
  const textFieldProps = Object.assign(Object.assign({}, mTableBodyCellEditTextFieldProps), mcTableBodyCellEditTextFieldProps);
2256
- if (enableEditing && columnDef.enableEditing !== false && columnDef.Edit) {
2260
+ if (columnDef.Edit) {
2257
2261
  return React.createElement(React.Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, table }));
2258
2262
  }
2259
- return (React.createElement(TextField, Object.assign({ id: `mrt-${tableId}-edit-cell-text-field-${cell.id}`, margin: "dense", onBlur: handleBlur, onChange: handleChange, onClick: (e) => e.stopPropagation(), placeholder: columnDef.header, value: value, variant: "standard" }, textFieldProps)));
2263
+ 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)));
2260
2264
  };
2261
2265
 
2262
2266
  const MRT_CopyButton = ({ cell, children, table }) => {
@@ -2292,16 +2296,16 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table, }) => {
2292
2296
  : muiTableBodyRowDragHandleProps;
2293
2297
  const handleDragStart = (e) => {
2294
2298
  e.dataTransfer.setDragImage(rowRef.current, 0, 0);
2295
- table.setCurrentDraggingRow(cell.row);
2299
+ table.setDraggingRow(cell.row);
2296
2300
  };
2297
2301
  const handleDragEnd = (event) => {
2298
2302
  onRowDrop === null || onRowDrop === void 0 ? void 0 : onRowDrop({
2299
2303
  event,
2300
- draggedRow: table.getState().currentDraggingRow,
2301
- targetRow: table.getState().currentHoveredRow,
2304
+ draggedRow: table.getState().draggingRow,
2305
+ targetRow: table.getState().hoveredRow,
2302
2306
  });
2303
- table.setCurrentDraggingRow(null);
2304
- table.setCurrentHoveredRow(null);
2307
+ table.setDraggingRow(null);
2308
+ table.setHoveredRow(null);
2305
2309
  };
2306
2310
  return (React.createElement(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragStart: handleDragStart, onDragEnd: handleDragEnd, table: table }));
2307
2311
  };
@@ -2309,8 +2313,8 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table, }) => {
2309
2313
  const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
2310
2314
  var _a, _b, _c, _d, _f, _g, _h, _j;
2311
2315
  const theme = useTheme();
2312
- const { getState, options: { editingMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enablePagination, enableRowNumbers, muiTableBodyCellProps, muiTableBodyCellSkeletonProps, rowNumberMode, tableId, }, setCurrentEditingCell, setCurrentHoveredColumn, } = table;
2313
- const { currentDraggingColumn, currentEditingCell, currentEditingRow, currentHoveredColumn, density, isLoading, showSkeletons, } = getState();
2316
+ const { getState, options: { editingMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enablePagination, enableRowNumbers, muiTableBodyCellProps, muiTableBodyCellSkeletonProps, rowNumberMode, tableId, }, setEditingCell, setHoveredColumn, } = table;
2317
+ const { draggingColumn, editingCell, editingRow, hoveredColumn, density, isLoading, showSkeletons, } = getState();
2314
2318
  const { column, row } = cell;
2315
2319
  const { columnDef } = column;
2316
2320
  const { columnDefType } = columnDef;
@@ -2325,8 +2329,8 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
2325
2329
  columnDef.enableEditing !== false;
2326
2330
  const isEditing = isEditable &&
2327
2331
  (editingMode === 'table' ||
2328
- (currentEditingRow === null || currentEditingRow === void 0 ? void 0 : currentEditingRow.id) === row.id ||
2329
- (currentEditingCell === null || currentEditingCell === void 0 ? void 0 : currentEditingCell.id) === cell.id);
2332
+ (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id ||
2333
+ (editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) === cell.id);
2330
2334
  const [skeletonWidth, setSkeletonWidth] = useState(0);
2331
2335
  useEffect(() => setSkeletonWidth(isLoading || showSkeletons
2332
2336
  ? columnDefType === 'display'
@@ -2338,7 +2342,7 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
2338
2342
  if ((enableEditing || columnDef.enableEditing) &&
2339
2343
  columnDef.enableEditing !== false &&
2340
2344
  editingMode === 'cell') {
2341
- setCurrentEditingCell(cell);
2345
+ setEditingCell(cell);
2342
2346
  setTimeout(() => {
2343
2347
  const textField = document.getElementById(`mrt-${tableId}-edit-cell-text-field-${cell.id}`);
2344
2348
  if (textField) {
@@ -2359,16 +2363,16 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
2359
2363
  return ((table.getRightLeafHeaders().length - 1 - column.getPinnedIndex()) * 150);
2360
2364
  };
2361
2365
  const handleDragEnter = (_e) => {
2362
- if (enableGrouping && (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === 'drop-zone') {
2363
- setCurrentHoveredColumn(null);
2366
+ if (enableGrouping && (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone') {
2367
+ setHoveredColumn(null);
2364
2368
  }
2365
- if (enableColumnOrdering && currentDraggingColumn) {
2366
- setCurrentHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
2369
+ if (enableColumnOrdering && draggingColumn) {
2370
+ setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
2367
2371
  }
2368
2372
  };
2369
- const draggingBorder = (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id) === column.id
2373
+ const draggingBorder = (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
2370
2374
  ? `1px dashed ${theme.palette.text.secondary}`
2371
- : (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === column.id
2375
+ : (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
2372
2376
  ? `2px dashed ${theme.palette.primary.main}`
2373
2377
  : undefined;
2374
2378
  const draggingBorders = draggingBorder
@@ -2394,8 +2398,7 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
2394
2398
  ? `-4px 0 4px -2px ${alpha(theme.palette.common.black, 0.1)}`
2395
2399
  : undefined, cursor: isEditable && editingMode === 'cell' ? 'pointer' : 'text', left: column.getIsPinned() === 'left'
2396
2400
  ? `${column.getStart('left')}px`
2397
- : undefined, opacity: (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id) === column.id ||
2398
- (currentHoveredColumn === null || currentHoveredColumn === void 0 ? void 0 : currentHoveredColumn.id) === column.id
2401
+ : undefined, opacity: (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id || (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
2399
2402
  ? 0.5
2400
2403
  : 1, overflow: 'hidden', p: density === 'compact'
2401
2404
  ? columnDefType === 'display'
@@ -2414,7 +2417,7 @@ const MRT_TableBodyCell = ({ cell, enableHover, rowIndex, rowRef, table, }) => {
2414
2417
  : density === 'comfortable'
2415
2418
  ? 0.75
2416
2419
  : 1.25)}rem`
2417
- : undefined, position: column.getIsPinned() ? 'sticky' : 'relative', right: column.getIsPinned() === 'right' ? `${getTotalRight()}px` : undefined, textOverflow: columnDefType !== 'display' ? 'ellipsis' : undefined, transition: 'all 0.2s ease-in-out', whiteSpace: density === 'compact' ? 'nowrap' : 'normal', zIndex: (currentDraggingColumn === null || currentDraggingColumn === void 0 ? void 0 : currentDraggingColumn.id) === column.id
2420
+ : undefined, position: column.getIsPinned() ? 'sticky' : 'relative', right: column.getIsPinned() === 'right' ? `${getTotalRight()}px` : undefined, textOverflow: columnDefType !== 'display' ? 'ellipsis' : undefined, transition: 'all 0.2s ease-in-out', whiteSpace: density === 'compact' ? 'nowrap' : 'normal', zIndex: (draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.id) === column.id
2418
2421
  ? 2
2419
2422
  : column.getIsPinned()
2420
2423
  ? 1
@@ -2460,20 +2463,20 @@ const MRT_TableDetailPanel = ({ row, table }) => {
2460
2463
  const MRT_TableBodyRow = ({ row, rowIndex, table }) => {
2461
2464
  var _a, _b;
2462
2465
  const theme = useTheme();
2463
- const { getIsSomeColumnsPinned, getState, options: { enableRowOrdering, muiTableBodyRowProps, renderDetailPanel }, setCurrentHoveredRow, } = table;
2464
- const { currentDraggingRow, currentHoveredRow } = getState();
2466
+ const { getIsSomeColumnsPinned, getState, options: { enableRowOrdering, muiTableBodyRowProps, renderDetailPanel }, setHoveredRow, } = table;
2467
+ const { draggingRow, hoveredRow } = getState();
2465
2468
  const tableRowProps = muiTableBodyRowProps instanceof Function
2466
2469
  ? muiTableBodyRowProps({ row, table })
2467
2470
  : muiTableBodyRowProps;
2468
2471
  const handleDragEnter = (_e) => {
2469
- if (enableRowOrdering && currentDraggingRow) {
2470
- setCurrentHoveredRow(row);
2472
+ if (enableRowOrdering && draggingRow) {
2473
+ setHoveredRow(row);
2471
2474
  }
2472
2475
  };
2473
2476
  const rowRef = useRef(null);
2474
- const draggingBorder = (currentDraggingRow === null || currentDraggingRow === void 0 ? void 0 : currentDraggingRow.id) === row.id
2477
+ const draggingBorder = (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id
2475
2478
  ? `1px dashed ${theme.palette.text.secondary}`
2476
- : (currentHoveredRow === null || currentHoveredRow === void 0 ? void 0 : currentHoveredRow.id) === row.id
2479
+ : (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id
2477
2480
  ? `2px dashed ${theme.palette.primary.main}`
2478
2481
  : undefined;
2479
2482
  const draggingBorders = draggingBorder
@@ -2482,10 +2485,7 @@ const MRT_TableBodyRow = ({ row, rowIndex, table }) => {
2482
2485
  }
2483
2486
  : undefined;
2484
2487
  return (React.createElement(React.Fragment, null,
2485
- React.createElement(TableRow, Object.assign({ onDragEnter: handleDragEnter, hover: true, selected: row.getIsSelected(), ref: rowRef }, tableRowProps, { sx: (theme) => (Object.assign(Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.06), opacity: (currentDraggingRow === null || currentDraggingRow === void 0 ? void 0 : currentDraggingRow.id) === row.id ||
2486
- (currentHoveredRow === null || currentHoveredRow === void 0 ? void 0 : currentHoveredRow.id) === row.id
2487
- ? 0.5
2488
- : 1, transition: 'all 0.2s ease-in-out', '&:hover td': {
2488
+ React.createElement(TableRow, Object.assign({ onDragEnter: handleDragEnter, hover: true, selected: row.getIsSelected(), ref: rowRef }, tableRowProps, { sx: (theme) => (Object.assign(Object.assign({ backgroundColor: lighten(theme.palette.background.default, 0.06), opacity: (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id || (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id ? 0.5 : 1, transition: 'all 0.2s ease-in-out', '&:hover td': {
2489
2489
  backgroundColor: (tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.hover) !== false && getIsSomeColumnsPinned()
2490
2490
  ? theme.palette.mode === 'dark'
2491
2491
  ? `${lighten(theme.palette.background.default, 0.12)}`
@@ -2692,7 +2692,7 @@ const MRT_TablePaper = ({ table }) => {
2692
2692
  };
2693
2693
 
2694
2694
  const MRT_TableRoot = (props) => {
2695
- 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;
2695
+ 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, _8;
2696
2696
  const [tableId, setIdPrefix] = useState(props.tableId);
2697
2697
  useEffect(() => { var _a; return setIdPrefix((_a = props.tableId) !== null && _a !== void 0 ? _a : Math.random().toString(36).substring(2, 9)); }, [props.tableId]);
2698
2698
  const initialState = useMemo(() => {
@@ -2700,31 +2700,34 @@ const MRT_TableRoot = (props) => {
2700
2700
  const initState = (_a = props.initialState) !== null && _a !== void 0 ? _a : {};
2701
2701
  initState.columnOrder =
2702
2702
  (_b = initState.columnOrder) !== null && _b !== void 0 ? _b : getDefaultColumnOrderIds(props);
2703
+ initState.columnFilterFns = Object.assign({}, ...getAllLeafColumnDefs(props.columns).map((col) => {
2704
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2705
+ return ({
2706
+ [(_d = (_b = (_a = col.id) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : (_c = col.accessorKey) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '']: col.filterFn instanceof Function
2707
+ ? (_e = col.filterFn.name) !== null && _e !== void 0 ? _e : 'custom'
2708
+ : (_m = (_f = col.filterFn) !== null && _f !== void 0 ? _f : (_g = initialState === null || initialState === void 0 ? void 0 : initialState.columnFilterFns) === null || _g === void 0 ? void 0 : _g[(_l = (_j = (_h = col.id) === null || _h === void 0 ? void 0 : _h.toString()) !== null && _j !== void 0 ? _j : (_k = col.accessorKey) === null || _k === void 0 ? void 0 : _k.toString()) !== null && _l !== void 0 ? _l : '']) !== null && _m !== void 0 ? _m : getDefaultColumnFilterFn(col),
2709
+ });
2710
+ }));
2711
+ initState.globalFilterFn =
2712
+ props.globalFilterFn instanceof String
2713
+ ? props.globalFilterFn
2714
+ : 'fuzzy';
2703
2715
  return initState;
2704
2716
  }, []);
2705
- const [columnOrder, setColumnOrder] = useState((_a = initialState.columnOrder) !== null && _a !== void 0 ? _a : []);
2706
- const [currentDraggingColumn, setCurrentDraggingColumn] = useState((_b = initialState.currentDraggingColumn) !== null && _b !== void 0 ? _b : null);
2707
- const [currentDraggingRow, setCurrentDraggingRow] = useState((_c = initialState.currentDraggingRow) !== null && _c !== void 0 ? _c : null);
2708
- const [currentEditingCell, setCurrentEditingCell] = useState((_d = initialState.currentEditingCell) !== null && _d !== void 0 ? _d : null);
2709
- const [currentEditingRow, setCurrentEditingRow] = useState((_e = initialState.currentEditingRow) !== null && _e !== void 0 ? _e : null);
2710
- const [currentHoveredColumn, setCurrentHoveredColumn] = useState((_f = initialState.currentHoveredColumn) !== null && _f !== void 0 ? _f : null);
2711
- const [currentHoveredRow, setCurrentHoveredRow] = useState((_g = initialState.currentHoveredRow) !== null && _g !== void 0 ? _g : null);
2712
- const [density, setDensity] = useState((_h = initialState === null || initialState === void 0 ? void 0 : initialState.density) !== null && _h !== void 0 ? _h : 'comfortable');
2713
- const [isFullScreen, setIsFullScreen] = useState((_j = initialState === null || initialState === void 0 ? void 0 : initialState.isFullScreen) !== null && _j !== void 0 ? _j : false);
2714
- const [showAlertBanner, setShowAlertBanner] = useState((_l = (_k = props.initialState) === null || _k === void 0 ? void 0 : _k.showAlertBanner) !== null && _l !== void 0 ? _l : false);
2715
- const [showColumnFilters, setShowFilters] = useState((_m = initialState === null || initialState === void 0 ? void 0 : initialState.showColumnFilters) !== null && _m !== void 0 ? _m : false);
2716
- const [showGlobalFilter, setShowGlobalFilter] = useState((_o = initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) !== null && _o !== void 0 ? _o : false);
2717
- const [columnFilterFns, setColumnFilterFns] = useState(() => Object.assign({}, ...getAllLeafColumnDefs(props.columns).map((col) => {
2718
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2719
- return ({
2720
- [(_d = (_b = (_a = col.id) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : (_c = col.accessorKey) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '']: col.filterFn instanceof Function
2721
- ? (_e = col.filterFn.name) !== null && _e !== void 0 ? _e : 'custom'
2722
- : (_m = (_f = col.filterFn) !== null && _f !== void 0 ? _f : (_g = initialState === null || initialState === void 0 ? void 0 : initialState.columnFilterFns) === null || _g === void 0 ? void 0 : _g[(_l = (_j = (_h = col.id) === null || _h === void 0 ? void 0 : _h.toString()) !== null && _j !== void 0 ? _j : (_k = col.accessorKey) === null || _k === void 0 ? void 0 : _k.toString()) !== null && _l !== void 0 ? _l : '']) !== null && _m !== void 0 ? _m : getDefaultColumnFilterFn(col),
2723
- });
2724
- })));
2725
- const [globalFilterFn, setGlobalFilterFn] = useState(props.globalFilterFn instanceof String
2726
- ? props.globalFilterFn
2727
- : 'fuzzy');
2717
+ const [columnFilterFns, setColumnFilterFns] = useState((_a = initialState.columnFilterFns) !== null && _a !== void 0 ? _a : {});
2718
+ const [columnOrder, setColumnOrder] = useState((_b = initialState.columnOrder) !== null && _b !== void 0 ? _b : []);
2719
+ const [density, setDensity] = useState((_c = initialState === null || initialState === void 0 ? void 0 : initialState.density) !== null && _c !== void 0 ? _c : 'comfortable');
2720
+ const [draggingColumn, setDraggingColumn] = useState((_d = initialState.draggingColumn) !== null && _d !== void 0 ? _d : null);
2721
+ const [draggingRow, setDraggingRow] = useState((_e = initialState.draggingRow) !== null && _e !== void 0 ? _e : null);
2722
+ const [editingCell, setEditingCell] = useState((_f = initialState.editingCell) !== null && _f !== void 0 ? _f : null);
2723
+ const [editingRow, setEditingRow] = useState((_g = initialState.editingRow) !== null && _g !== void 0 ? _g : null);
2724
+ const [globalFilterFn, setGlobalFilterFn] = useState((_h = initialState.globalFilterFn) !== null && _h !== void 0 ? _h : 'fuzzy');
2725
+ const [hoveredColumn, setHoveredColumn] = useState((_j = initialState.hoveredColumn) !== null && _j !== void 0 ? _j : null);
2726
+ const [hoveredRow, setHoveredRow] = useState((_k = initialState.hoveredRow) !== null && _k !== void 0 ? _k : null);
2727
+ const [isFullScreen, setIsFullScreen] = useState((_l = initialState === null || initialState === void 0 ? void 0 : initialState.isFullScreen) !== null && _l !== void 0 ? _l : false);
2728
+ const [showAlertBanner, setShowAlertBanner] = useState((_o = (_m = props.initialState) === null || _m === void 0 ? void 0 : _m.showAlertBanner) !== null && _o !== void 0 ? _o : false);
2729
+ const [showColumnFilters, setShowFilters] = useState((_p = initialState === null || initialState === void 0 ? void 0 : initialState.showColumnFilters) !== null && _p !== void 0 ? _p : false);
2730
+ const [showGlobalFilter, setShowGlobalFilter] = useState((_q = initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) !== null && _q !== void 0 ? _q : false);
2728
2731
  const displayColumns = useMemo(() => {
2729
2732
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2730
2733
  return [
@@ -2751,8 +2754,6 @@ const MRT_TableRoot = (props) => {
2751
2754
  props.enableRowSelection,
2752
2755
  props.enableSelectAll,
2753
2756
  props.localization,
2754
- props.muiTableBodyCellProps,
2755
- props.muiTableHeadCellProps,
2756
2757
  props.positionActionsColumn,
2757
2758
  ]);
2758
2759
  const columnDefs = useMemo(() => prepareColumns([...displayColumns, ...props.columns], columnFilterFns, props.filterFns, props.sortingFns), [columnFilterFns, displayColumns, props.columns]);
@@ -2771,26 +2772,24 @@ const MRT_TableRoot = (props) => {
2771
2772
  });
2772
2773
  })))
2773
2774
  : props.data;
2774
- }, [props.data, (_p = props.state) === null || _p === void 0 ? void 0 : _p.isLoading, (_q = props.state) === null || _q === void 0 ? void 0 : _q.showSkeletons]);
2775
+ }, [props.data, (_r = props.state) === null || _r === void 0 ? void 0 : _r.isLoading, (_s = props.state) === null || _s === void 0 ? void 0 : _s.showSkeletons]);
2775
2776
  //@ts-ignore
2776
2777
  const table = Object.assign(Object.assign({}, useReactTable(Object.assign(Object.assign({ getCoreRowModel: getCoreRowModel(), getExpandedRowModel: getExpandedRowModel(), getFacetedRowModel: getFacetedRowModel(), getFilteredRowModel: getFilteredRowModel(), getGroupedRowModel: getGroupedRowModel(), getPaginationRowModel: getPaginationRowModel(), getSortedRowModel: getSortedRowModel(), onColumnOrderChange: setColumnOrder, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows }, props), {
2777
2778
  //@ts-ignore
2778
- columns: columnDefs, data, globalFilterFn:
2779
- //@ts-ignore
2780
- (_r = props.filterFns[globalFilterFn]) !== null && _r !== void 0 ? _r : props.filterFns.fuzzy, initialState, state: Object.assign({ columnOrder,
2781
- currentDraggingColumn,
2782
- currentDraggingRow,
2783
- currentEditingCell,
2784
- currentEditingRow,
2785
- columnFilterFns,
2786
- globalFilterFn,
2787
- currentHoveredColumn,
2788
- currentHoveredRow,
2779
+ columns: columnDefs, data, globalFilterFn: (_u = (_t = props.filterFns) === null || _t === void 0 ? void 0 : _t[globalFilterFn]) !== null && _u !== void 0 ? _u : (_v = props.filterFns) === null || _v === void 0 ? void 0 : _v.fuzzy, initialState, state: Object.assign({ columnFilterFns,
2780
+ columnOrder,
2789
2781
  density,
2782
+ draggingColumn,
2783
+ draggingRow,
2784
+ editingCell,
2785
+ editingRow,
2786
+ globalFilterFn,
2787
+ hoveredColumn,
2788
+ hoveredRow,
2790
2789
  isFullScreen,
2791
2790
  showAlertBanner,
2792
2791
  showColumnFilters,
2793
- showGlobalFilter }, props.state), tableId }))), { setCurrentDraggingColumn: (_s = props.onCurrentDraggingColumnChange) !== null && _s !== void 0 ? _s : setCurrentDraggingColumn, setCurrentDraggingRow: (_t = props.onCurrentDraggingRowChange) !== null && _t !== void 0 ? _t : setCurrentDraggingRow, setCurrentEditingCell: (_u = props.onCurrentEditingCellChange) !== null && _u !== void 0 ? _u : setCurrentEditingCell, setCurrentEditingRow: (_v = props.onCurrentEditingRowChange) !== null && _v !== void 0 ? _v : setCurrentEditingRow, setColumnFilterFns: (_w = props.onCurrentFilterFnsChange) !== null && _w !== void 0 ? _w : setColumnFilterFns, setGlobalFilterFn: (_x = props.onCurrentGlobalFilterFnChange) !== null && _x !== void 0 ? _x : setGlobalFilterFn, setCurrentHoveredColumn: (_y = props.onCurrentHoveredColumnChange) !== null && _y !== void 0 ? _y : setCurrentHoveredColumn, setCurrentHoveredRow: (_z = props.onCurrentHoveredRowChange) !== null && _z !== void 0 ? _z : setCurrentHoveredRow, setDensity: (_0 = props.onDensityChange) !== null && _0 !== void 0 ? _0 : setDensity, setIsFullScreen: (_1 = props.onIsFullScreenChange) !== null && _1 !== void 0 ? _1 : setIsFullScreen, setShowAlertBanner: (_2 = props.onShowAlertBannerChange) !== null && _2 !== void 0 ? _2 : setShowAlertBanner, setShowFilters: (_3 = props.onShowFiltersChange) !== null && _3 !== void 0 ? _3 : setShowFilters, setShowGlobalFilter: (_4 = props.onShowGlobalFilterChange) !== null && _4 !== void 0 ? _4 : setShowGlobalFilter });
2792
+ showGlobalFilter }, props.state), tableId }))), { setColumnFilterFns: (_w = props.onFilterFnsChange) !== null && _w !== void 0 ? _w : setColumnFilterFns, setDensity: (_x = props.onDensityChange) !== null && _x !== void 0 ? _x : setDensity, setDraggingColumn: (_y = props.onDraggingColumnChange) !== null && _y !== void 0 ? _y : setDraggingColumn, setDraggingRow: (_z = props.onDraggingRowChange) !== null && _z !== void 0 ? _z : setDraggingRow, setEditingCell: (_0 = props.onEditingCellChange) !== null && _0 !== void 0 ? _0 : setEditingCell, setEditingRow: (_1 = props.onEditingRowChange) !== null && _1 !== void 0 ? _1 : setEditingRow, setGlobalFilterFn: (_2 = props.onGlobalFilterFnChange) !== null && _2 !== void 0 ? _2 : setGlobalFilterFn, setHoveredColumn: (_3 = props.onHoveredColumnChange) !== null && _3 !== void 0 ? _3 : setHoveredColumn, setHoveredRow: (_4 = props.onHoveredRowChange) !== null && _4 !== void 0 ? _4 : setHoveredRow, setIsFullScreen: (_5 = props.onIsFullScreenChange) !== null && _5 !== void 0 ? _5 : setIsFullScreen, setShowAlertBanner: (_6 = props.onShowAlertBannerChange) !== null && _6 !== void 0 ? _6 : setShowAlertBanner, setShowFilters: (_7 = props.onShowFiltersChange) !== null && _7 !== void 0 ? _7 : setShowFilters, setShowGlobalFilter: (_8 = props.onShowGlobalFilterChange) !== null && _8 !== void 0 ? _8 : setShowGlobalFilter });
2794
2793
  return (React.createElement(React.Fragment, null,
2795
2794
  React.createElement(Dialog, { PaperComponent: Box, TransitionComponent: Grow, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => setIsFullScreen(false), open: isFullScreen, transitionDuration: 400 },
2796
2795
  React.createElement(MRT_TablePaper, { table: table })),