material-react-table 0.7.3 → 0.7.6

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.
@@ -28,7 +28,7 @@ import SortIcon from '@mui/icons-material/Sort';
28
28
  import ViewColumnIcon from '@mui/icons-material/ViewColumn';
29
29
  import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
30
30
  import { createTable, useTableInstance, getColumnFilteredRowModelSync, getCoreRowModelSync, getExpandedRowModel, getGlobalFilteredRowModelSync, getGroupedRowModelSync, getPaginationRowModel, getSortedRowModelSync, functionalUpdate } from '@tanstack/react-table';
31
- import { IconButton, Menu, MenuItem, FormControlLabel, Switch, Box, Button, Divider, ListItemIcon, Tooltip, Checkbox, debounce, Collapse, TextField, InputAdornment, TablePagination, useMediaQuery, Chip, Alert, LinearProgress, Toolbar, alpha, TableCell, TableSortLabel, TableRow, TableHead, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, Grow } from '@mui/material';
31
+ import { IconButton, Menu, MenuItem, Box, Tooltip, FormControlLabel, Switch, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, TablePagination, useMediaQuery, Chip, Alert, LinearProgress, Toolbar, alpha, TableCell, TableSortLabel, TableRow, TableHead, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, Grow } from '@mui/material';
32
32
  import { matchSorter } from 'match-sorter';
33
33
 
34
34
  function _extends() {
@@ -122,6 +122,7 @@ var MRT_DefaultLocalization_EN = {
122
122
  toggleSelectRow: 'Toggle select row',
123
123
  ungroupByColumn: 'Ungroup by {column}',
124
124
  unpin: 'Unpin',
125
+ unpinAll: 'Unpin all',
125
126
  unsorted: 'Unsorted'
126
127
  };
127
128
 
@@ -228,21 +229,21 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
228
229
  }));
229
230
  };
230
231
 
231
- var MRT_FILTER_TYPE;
232
+ var MRT_FILTER_OPTION;
232
233
 
233
- (function (MRT_FILTER_TYPE) {
234
- MRT_FILTER_TYPE["BEST_MATCH"] = "bestMatch";
235
- MRT_FILTER_TYPE["BEST_MATCH_FIRST"] = "bestMatchFirst";
236
- MRT_FILTER_TYPE["CONTAINS"] = "contains";
237
- MRT_FILTER_TYPE["EMPTY"] = "empty";
238
- MRT_FILTER_TYPE["ENDS_WITH"] = "endsWith";
239
- MRT_FILTER_TYPE["EQUALS"] = "equals";
240
- MRT_FILTER_TYPE["GREATER_THAN"] = "greaterThan";
241
- MRT_FILTER_TYPE["LESS_THAN"] = "lessThan";
242
- MRT_FILTER_TYPE["NOT_EMPTY"] = "notEmpty";
243
- MRT_FILTER_TYPE["NOT_EQUALS"] = "notEquals";
244
- MRT_FILTER_TYPE["STARTS_WITH"] = "startsWith";
245
- })(MRT_FILTER_TYPE || (MRT_FILTER_TYPE = {}));
234
+ (function (MRT_FILTER_OPTION) {
235
+ MRT_FILTER_OPTION["BEST_MATCH"] = "bestMatch";
236
+ MRT_FILTER_OPTION["BEST_MATCH_FIRST"] = "bestMatchFirst";
237
+ MRT_FILTER_OPTION["CONTAINS"] = "contains";
238
+ MRT_FILTER_OPTION["EMPTY"] = "empty";
239
+ MRT_FILTER_OPTION["ENDS_WITH"] = "endsWith";
240
+ MRT_FILTER_OPTION["EQUALS"] = "equals";
241
+ MRT_FILTER_OPTION["GREATER_THAN"] = "greaterThan";
242
+ MRT_FILTER_OPTION["LESS_THAN"] = "lessThan";
243
+ MRT_FILTER_OPTION["NOT_EMPTY"] = "notEmpty";
244
+ MRT_FILTER_OPTION["NOT_EQUALS"] = "notEquals";
245
+ MRT_FILTER_OPTION["STARTS_WITH"] = "startsWith";
246
+ })(MRT_FILTER_OPTION || (MRT_FILTER_OPTION = {}));
246
247
 
247
248
  var bestMatchFirst = function bestMatchFirst(rows, columnIds, filterValue) {
248
249
  return matchSorter(rows, filterValue.toString().trim(), {
@@ -380,7 +381,7 @@ var commonMenuItemStyles = {
380
381
  my: 0,
381
382
  alignItems: 'center'
382
383
  };
383
- var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
384
+ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
384
385
  var anchorEl = _ref.anchorEl,
385
386
  header = _ref.header,
386
387
  onSelect = _ref.onSelect,
@@ -388,97 +389,97 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
388
389
  tableInstance = _ref.tableInstance;
389
390
  var getState = tableInstance.getState,
390
391
  _tableInstance$option = tableInstance.options,
391
- enabledGlobalFilterTypes = _tableInstance$option.enabledGlobalFilterTypes,
392
+ enabledGlobalFilterOptions = _tableInstance$option.enabledGlobalFilterOptions,
392
393
  localization = _tableInstance$option.localization,
393
- setCurrentFilterTypes = tableInstance.setCurrentFilterTypes,
394
- setCurrentGlobalFilterType = tableInstance.setCurrentGlobalFilterType;
394
+ setCurrentFilterFns = tableInstance.setCurrentFilterFns,
395
+ setCurrentGlobalFilterFn = tableInstance.setCurrentGlobalFilterFn;
395
396
 
396
397
  var _getState = getState(),
397
398
  isDensePadding = _getState.isDensePadding,
398
- currentFilterTypes = _getState.currentFilterTypes,
399
- currentGlobalFilterType = _getState.currentGlobalFilterType;
399
+ currentFilterFns = _getState.currentFilterFns,
400
+ currentGlobalFilterFn = _getState.currentGlobalFilterFn;
400
401
 
401
- var filterTypes = useMemo(function () {
402
+ var filterOptions = useMemo(function () {
402
403
  return [{
403
- type: MRT_FILTER_TYPE.BEST_MATCH_FIRST,
404
+ type: MRT_FILTER_OPTION.BEST_MATCH_FIRST,
404
405
  label: localization.filterBestMatchFirst,
405
406
  divider: false,
406
407
  fn: bestMatchFirst
407
408
  }, {
408
- type: MRT_FILTER_TYPE.BEST_MATCH,
409
+ type: MRT_FILTER_OPTION.BEST_MATCH,
409
410
  label: localization.filterBestMatch,
410
411
  divider: !!header,
411
412
  fn: bestMatch
412
413
  }, {
413
- type: MRT_FILTER_TYPE.CONTAINS,
414
+ type: MRT_FILTER_OPTION.CONTAINS,
414
415
  label: localization.filterContains,
415
416
  divider: false,
416
417
  fn: contains
417
418
  }, {
418
- type: MRT_FILTER_TYPE.STARTS_WITH,
419
+ type: MRT_FILTER_OPTION.STARTS_WITH,
419
420
  label: localization.filterStartsWith,
420
421
  divider: false,
421
422
  fn: startsWith
422
423
  }, {
423
- type: MRT_FILTER_TYPE.ENDS_WITH,
424
+ type: MRT_FILTER_OPTION.ENDS_WITH,
424
425
  label: localization.filterEndsWith,
425
426
  divider: true,
426
427
  fn: endsWith
427
428
  }, {
428
- type: MRT_FILTER_TYPE.EQUALS,
429
+ type: MRT_FILTER_OPTION.EQUALS,
429
430
  label: localization.filterEquals,
430
431
  divider: false,
431
432
  fn: equals
432
433
  }, {
433
- type: MRT_FILTER_TYPE.NOT_EQUALS,
434
+ type: MRT_FILTER_OPTION.NOT_EQUALS,
434
435
  label: localization.filterNotEquals,
435
436
  divider: true,
436
437
  fn: notEquals
437
438
  }, {
438
- type: MRT_FILTER_TYPE.GREATER_THAN,
439
+ type: MRT_FILTER_OPTION.GREATER_THAN,
439
440
  label: localization.filterGreaterThan,
440
441
  divider: false,
441
442
  fn: greaterThan
442
443
  }, {
443
- type: MRT_FILTER_TYPE.LESS_THAN,
444
+ type: MRT_FILTER_OPTION.LESS_THAN,
444
445
  label: localization.filterLessThan,
445
446
  divider: true,
446
447
  fn: lessThan
447
448
  }, {
448
- type: MRT_FILTER_TYPE.EMPTY,
449
+ type: MRT_FILTER_OPTION.EMPTY,
449
450
  label: localization.filterEmpty,
450
451
  divider: false,
451
452
  fn: empty
452
453
  }, {
453
- type: MRT_FILTER_TYPE.NOT_EMPTY,
454
+ type: MRT_FILTER_OPTION.NOT_EMPTY,
454
455
  label: localization.filterNotEmpty,
455
456
  divider: false,
456
457
  fn: notEmpty
457
458
  }].filter(function (filterType) {
458
- return header ? !header.column.enabledColumnFilterTypes || header.column.enabledColumnFilterTypes.includes(filterType.type) : (!enabledGlobalFilterTypes || enabledGlobalFilterTypes.includes(filterType.type)) && [MRT_FILTER_TYPE.BEST_MATCH_FIRST, MRT_FILTER_TYPE.BEST_MATCH].includes(filterType.type);
459
+ return header ? !header.column.enabledColumnFilterOptions || header.column.enabledColumnFilterOptions.includes(filterType.type) : (!enabledGlobalFilterOptions || enabledGlobalFilterOptions.includes(filterType.type)) && [MRT_FILTER_OPTION.BEST_MATCH_FIRST, MRT_FILTER_OPTION.BEST_MATCH].includes(filterType.type);
459
460
  });
460
461
  }, []);
461
462
 
462
463
  var handleSelectFilterType = function handleSelectFilterType(value) {
463
464
  if (header) {
464
- setCurrentFilterTypes(function (prev) {
465
+ setCurrentFilterFns(function (prev) {
465
466
  var _extends2;
466
467
 
467
468
  return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = value, _extends2));
468
469
  });
469
470
 
470
- if ([MRT_FILTER_TYPE.EMPTY, MRT_FILTER_TYPE.NOT_EMPTY].includes(value)) {
471
+ if ([MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(value)) {
471
472
  header.column.setColumnFilterValue(' ');
472
473
  }
473
474
  } else {
474
- setCurrentGlobalFilterType(value);
475
+ setCurrentGlobalFilterFn(value);
475
476
  }
476
477
 
477
478
  setAnchorEl(null);
478
479
  onSelect == null ? void 0 : onSelect();
479
480
  };
480
481
 
481
- var filterType = !!header ? currentFilterTypes[header.id] : currentGlobalFilterType;
482
+ var filterType = !!header ? currentFilterFns[header.id] : currentGlobalFilterFn;
482
483
  return React.createElement(Menu, {
483
484
  anchorEl: anchorEl,
484
485
  anchorOrigin: {
@@ -492,7 +493,7 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
492
493
  MenuListProps: {
493
494
  dense: isDensePadding
494
495
  }
495
- }, filterTypes.map(function (_ref2, index) {
496
+ }, filterOptions.map(function (_ref2, index) {
496
497
  var type = _ref2.type,
497
498
  label = _ref2.label,
498
499
  divider = _ref2.divider,
@@ -510,6 +511,57 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
510
511
  }));
511
512
  };
512
513
 
514
+ var MRT_ColumnPinningButtons = function MRT_ColumnPinningButtons(_ref) {
515
+ var column = _ref.column,
516
+ tableInstance = _ref.tableInstance;
517
+ var getState = tableInstance.getState,
518
+ _tableInstance$option = tableInstance.options,
519
+ PushPinIcon = _tableInstance$option.icons.PushPinIcon,
520
+ localization = _tableInstance$option.localization;
521
+
522
+ var _getState = getState(),
523
+ columnOrder = _getState.columnOrder;
524
+
525
+ var handlePinColumn = function handlePinColumn(pinDirection) {
526
+ column.pin(pinDirection);
527
+
528
+ if (column.columnDefType === 'display') {
529
+ tableInstance.setColumnOrder([column.id].concat(columnOrder));
530
+ }
531
+ };
532
+
533
+ var pinned = column.getIsPinned();
534
+ return React.createElement(Box, {
535
+ sx: {
536
+ mr: '8px'
537
+ }
538
+ }, React.createElement(Tooltip, {
539
+ arrow: true,
540
+ title: pinned === 'left' ? localization.unpin : localization.pinToLeft
541
+ }, React.createElement(IconButton, {
542
+ onClick: function onClick() {
543
+ return handlePinColumn(pinned === 'left' ? false : 'left');
544
+ },
545
+ size: "small"
546
+ }, React.createElement(PushPinIcon, {
547
+ style: {
548
+ transform: pinned === 'left' ? 'rotate(0)' : 'rotate(90deg)'
549
+ }
550
+ }))), React.createElement(Tooltip, {
551
+ arrow: true,
552
+ title: pinned === 'right' ? localization.unpin : localization.pinToRight
553
+ }, React.createElement(IconButton, {
554
+ onClick: function onClick() {
555
+ return handlePinColumn(pinned === 'right' ? false : 'right');
556
+ },
557
+ size: "small"
558
+ }, React.createElement(PushPinIcon, {
559
+ style: {
560
+ transform: pinned === 'right' ? 'rotate(0)' : 'rotate(-90deg)'
561
+ }
562
+ }))));
563
+ };
564
+
513
565
  var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
514
566
  var _column$columns2;
515
567
 
@@ -517,7 +569,9 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
517
569
  isSubMenu = _ref.isSubMenu,
518
570
  tableInstance = _ref.tableInstance;
519
571
  var getState = tableInstance.getState,
520
- onToggleColumnVisibility = tableInstance.options.onToggleColumnVisibility;
572
+ _tableInstance$option = tableInstance.options,
573
+ onToggleColumnVisibility = _tableInstance$option.onToggleColumnVisibility,
574
+ enablePinning = _tableInstance$option.enablePinning;
521
575
 
522
576
  var _getState = getState(),
523
577
  columnVisibility = _getState.columnVisibility;
@@ -545,10 +599,17 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
545
599
  };
546
600
 
547
601
  return React.createElement(React.Fragment, null, React.createElement(MenuItem, {
548
- sx: _extends({}, commonMenuItemStyles$1, {
549
- pl: (column.depth + 0.5) * 2 + "rem"
550
- })
551
- }, React.createElement(FormControlLabel, {
602
+ sx: {
603
+ alignItems: 'center',
604
+ justifyContent: 'flex-start',
605
+ my: 0,
606
+ pl: (column.depth + 0.5) * 2 + "rem",
607
+ py: '6px'
608
+ }
609
+ }, !isSubMenu && enablePinning && React.createElement(MRT_ColumnPinningButtons, {
610
+ column: column,
611
+ tableInstance: tableInstance
612
+ }), React.createElement(FormControlLabel, {
552
613
  componentsProps: {
553
614
  typography: {
554
615
  sx: {
@@ -585,7 +646,9 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
585
646
  getState = tableInstance.getState,
586
647
  toggleAllColumnsVisible = tableInstance.toggleAllColumnsVisible,
587
648
  getAllLeafColumns = tableInstance.getAllLeafColumns,
588
- localization = tableInstance.options.localization;
649
+ _tableInstance$option = tableInstance.options,
650
+ localization = _tableInstance$option.localization,
651
+ enablePinning = _tableInstance$option.enablePinning;
589
652
 
590
653
  var _getState = getState(),
591
654
  isDensePadding = _getState.isDensePadding;
@@ -609,9 +672,9 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
609
672
  });
610
673
  return getIsSomeColumnsPinned() ? [].concat(dataColumns.filter(function (c) {
611
674
  return c.getIsPinned() === 'left';
612
- }), dataColumns.filter(function (c) {
675
+ }), [null], dataColumns.filter(function (c) {
613
676
  return c.getIsPinned() === false;
614
- }), dataColumns.filter(function (c) {
677
+ }), [null], dataColumns.filter(function (c) {
615
678
  return c.getIsPinned() === 'right';
616
679
  })) : dataColumns;
617
680
  }, [getAllColumns(), getState().columnPinning, getIsSomeColumnsPinned()]);
@@ -634,7 +697,12 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
634
697
  }, !isSubMenu && React.createElement(Button, {
635
698
  disabled: !getIsSomeColumnsVisible(),
636
699
  onClick: hideAllColumns
637
- }, localization.hideAll), React.createElement(Button, {
700
+ }, localization.hideAll), !isSubMenu && enablePinning && React.createElement(Button, {
701
+ disabled: !getIsSomeColumnsPinned(),
702
+ onClick: function onClick() {
703
+ return tableInstance.setColumnPinning({});
704
+ }
705
+ }, localization.unpinAll), React.createElement(Button, {
638
706
  disabled: getIsAllColumnsVisible(),
639
707
  onClick: function onClick() {
640
708
  return toggleAllColumnsVisible(true);
@@ -647,11 +715,13 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
647
715
  tableInstance: tableInstance
648
716
  });
649
717
  }), React.createElement(Divider, null), allDataColumns.map(function (column, index) {
650
- return React.createElement(MRT_ShowHideColumnsMenuItems, {
718
+ return column ? React.createElement(MRT_ShowHideColumnsMenuItems, {
651
719
  column: column,
652
720
  isSubMenu: isSubMenu,
653
721
  key: index + "-" + column.id,
654
722
  tableInstance: tableInstance
723
+ }) : React.createElement(Divider, {
724
+ key: index + "-divider"
655
725
  });
656
726
  }));
657
727
  };
@@ -836,7 +906,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
836
906
  sx: {
837
907
  p: 0
838
908
  }
839
- }, React.createElement(ArrowRightIcon, null))), React.createElement(MRT_FilterTypeMenu, {
909
+ }, React.createElement(ArrowRightIcon, null))), React.createElement(MRT_FilterOptionMenu, {
840
910
  anchorEl: filterMenuAnchorEl,
841
911
  header: header,
842
912
  key: 2,
@@ -1250,7 +1320,7 @@ var MRT_SearchTextField = function MRT_SearchTextField(_ref) {
1250
1320
  sx: _extends({
1251
1321
  justifySelf: 'end'
1252
1322
  }, textFieldProps == null ? void 0 : textFieldProps.sx)
1253
- })), React.createElement(MRT_FilterTypeMenu, {
1323
+ })), React.createElement(MRT_FilterOptionMenu, {
1254
1324
  anchorEl: anchorEl,
1255
1325
  setAnchorEl: setAnchorEl,
1256
1326
  tableInstance: tableInstance
@@ -1748,11 +1818,11 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1748
1818
  idPrefix = _tableInstance$option.idPrefix,
1749
1819
  localization = _tableInstance$option.localization,
1750
1820
  muiTableHeadCellFilterTextFieldProps = _tableInstance$option.muiTableHeadCellFilterTextFieldProps,
1751
- setCurrentFilterTypes = tableInstance.setCurrentFilterTypes;
1821
+ setCurrentFilterFns = tableInstance.setCurrentFilterFns;
1752
1822
  var column = header.column;
1753
1823
 
1754
1824
  var _getState = getState(),
1755
- currentFilterTypes = _getState.currentFilterTypes;
1825
+ currentFilterFns = _getState.currentFilterFns;
1756
1826
 
1757
1827
  var _useState = useState(null),
1758
1828
  anchorEl = _useState[0],
@@ -1791,10 +1861,10 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1791
1861
  var handleClearFilterChip = function handleClearFilterChip() {
1792
1862
  setFilterValue('');
1793
1863
  column.setColumnFilterValue(undefined);
1794
- setCurrentFilterTypes(function (prev) {
1864
+ setCurrentFilterFns(function (prev) {
1795
1865
  var _extends2;
1796
1866
 
1797
- return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = MRT_FILTER_TYPE.BEST_MATCH, _extends2));
1867
+ return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = MRT_FILTER_OPTION.BEST_MATCH, _extends2));
1798
1868
  });
1799
1869
  };
1800
1870
 
@@ -1806,10 +1876,10 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1806
1876
  }
1807
1877
 
1808
1878
  var filterId = "mrt-" + idPrefix + "-" + header.id + "-filter-text-field";
1809
- var filterType = currentFilterTypes == null ? void 0 : currentFilterTypes[header.id];
1879
+ var filterFn = currentFilterFns == null ? void 0 : currentFilterFns[header.id];
1810
1880
  var isSelectFilter = !!column.filterSelectOptions;
1811
- var filterChipLabel = !(filterType instanceof Function) && [MRT_FILTER_TYPE.EMPTY, MRT_FILTER_TYPE.NOT_EMPTY].includes(filterType) ? //@ts-ignore
1812
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))] : '';
1881
+ var filterChipLabel = !(filterFn instanceof Function) && [MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(filterFn) ? //@ts-ignore
1882
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))] : '';
1813
1883
  var filterPlaceholder = (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(column.header));
1814
1884
  return React.createElement(React.Fragment, null, React.createElement(TextField, Object.assign({
1815
1885
  fullWidth: true,
@@ -1824,9 +1894,9 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1824
1894
  },
1825
1895
  helperText: React.createElement("label", {
1826
1896
  htmlFor: filterId
1827
- }, filterType instanceof Function ? (_localization$filterM = localization.filterMode.replace('{filterType}', // @ts-ignore
1828
- (_localization$ = localization["filter" + (filterType.name.charAt(0).toUpperCase() + filterType.name.slice(1))]) != null ? _localization$ : '')) != null ? _localization$filterM : '' : localization.filterMode.replace('{filterType}', // @ts-ignore
1829
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))])),
1897
+ }, filterFn instanceof Function ? (_localization$filterM = localization.filterMode.replace('{filterType}', // @ts-ignore
1898
+ (_localization$ = localization["filter" + (filterFn.name.charAt(0).toUpperCase() + filterFn.name.slice(1))]) != null ? _localization$ : '')) != null ? _localization$filterM : '' : localization.filterMode.replace('{filterType}', // @ts-ignore
1899
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))])),
1830
1900
  FormHelperTextProps: {
1831
1901
  sx: {
1832
1902
  fontSize: '0.6rem',
@@ -1913,7 +1983,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1913
1983
  key: value,
1914
1984
  value: value
1915
1985
  }, text);
1916
- })), React.createElement(MRT_FilterTypeMenu, {
1986
+ })), React.createElement(MRT_FilterOptionMenu, {
1917
1987
  anchorEl: anchorEl,
1918
1988
  header: header,
1919
1989
  setAnchorEl: setAnchorEl,
@@ -2015,9 +2085,9 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2015
2085
  var tableCellProps = _extends({}, header.getHeaderProps(), mTableHeadCellProps, mcTableHeadCellProps);
2016
2086
 
2017
2087
  var sortTooltip = !!column.getIsSorted() ? column.getIsSorted() === 'desc' ? localization.sortedByColumnDesc.replace('{column}', column.header) : localization.sortedByColumnAsc.replace('{column}', column.header) : localization.unsorted;
2018
- var filterType = (_getState2 = getState()) == null ? void 0 : (_getState2$currentFil = _getState2.currentFilterTypes) == null ? void 0 : _getState2$currentFil[header.id];
2019
- var filterTooltip = !!column.getColumnFilterValue() ? localization.filteringByColumn.replace('{column}', String(column.header)).replace('{filterType}', filterType instanceof Function ? '' : // @ts-ignore
2020
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))]).replace('{filterValue}', column.getColumnFilterValue()).replace('" "', '') : localization.showHideFilters;
2088
+ var filterFn = (_getState2 = getState()) == null ? void 0 : (_getState2$currentFil = _getState2.currentFilterFns) == null ? void 0 : _getState2$currentFil[header.id];
2089
+ var filterTooltip = !!column.getColumnFilterValue() ? localization.filteringByColumn.replace('{column}', String(column.header)).replace('{filterType}', filterFn instanceof Function ? '' : // @ts-ignore
2090
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))]).replace('{filterValue}', column.getColumnFilterValue()).replace('" "', '') : localization.showHideFilters;
2021
2091
  var headerElement = (_column$Header = column == null ? void 0 : column.Header == null ? void 0 : column.Header({
2022
2092
  header: header,
2023
2093
  tableInstance: tableInstance
@@ -2653,10 +2723,10 @@ var MRT_Table = function MRT_Table(_ref) {
2653
2723
  tableInstance = _ref.tableInstance;
2654
2724
  var getTableProps = tableInstance.getTableProps,
2655
2725
  _tableInstance$option = tableInstance.options,
2656
- muiTableProps = _tableInstance$option.muiTableProps,
2657
- enableTableHead = _tableInstance$option.enableTableHead,
2726
+ enableStickyHeader = _tableInstance$option.enableStickyHeader,
2658
2727
  enableTableFooter = _tableInstance$option.enableTableFooter,
2659
- enableStickyHeader = _tableInstance$option.enableStickyHeader;
2728
+ enableTableHead = _tableInstance$option.enableTableHead,
2729
+ muiTableProps = _tableInstance$option.muiTableProps;
2660
2730
  var mTableProps = muiTableProps instanceof Function ? muiTableProps({
2661
2731
  tableInstance: tableInstance
2662
2732
  }) : muiTableProps;
@@ -2692,7 +2762,6 @@ var commonBoxStyles = function commonBoxStyles(_ref) {
2692
2762
  var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2693
2763
  var tableInstance = _ref2.tableInstance;
2694
2764
  var getCenterTableWidth = tableInstance.getCenterTableWidth,
2695
- getIsSomeColumnsPinned = tableInstance.getIsSomeColumnsPinned,
2696
2765
  getLeftTableWidth = tableInstance.getLeftTableWidth,
2697
2766
  getRightTableWidth = tableInstance.getRightTableWidth,
2698
2767
  getState = tableInstance.getState,
@@ -2703,8 +2772,7 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2703
2772
  muiTableContainerProps = _tableInstance$option.muiTableContainerProps;
2704
2773
 
2705
2774
  var _getState = getState(),
2706
- isFullScreen = _getState.isFullScreen,
2707
- columnPinning = _getState.columnPinning;
2775
+ isFullScreen = _getState.isFullScreen;
2708
2776
 
2709
2777
  var _useState = useState(0),
2710
2778
  totalToolbarHeight = _useState[0],
@@ -2720,6 +2788,8 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2720
2788
  var bottomToolbarHeight = typeof document !== 'undefined' ? (_document$getElementB3 = (_document2 = document) == null ? void 0 : (_document2$getElement = _document2.getElementById("mrt-" + idPrefix + "-toolbar-bottom")) == null ? void 0 : _document2$getElement.offsetHeight) != null ? _document$getElementB3 : 0 : 0;
2721
2789
  setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
2722
2790
  });
2791
+ var isSomeColumnsPinnedLeft = !!tableInstance.getLeftFlatHeaders().length;
2792
+ var isSomeColumnsPinnedRight = !!tableInstance.getRightFlatHeaders().length;
2723
2793
  return React.createElement(TableContainer, Object.assign({}, tableContainerProps, {
2724
2794
  sx: _extends({
2725
2795
  maxWidth: '100%',
@@ -2729,19 +2799,17 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2729
2799
  style: {
2730
2800
  maxHeight: isFullScreen ? "calc(100vh - " + totalToolbarHeight + "px)" : undefined
2731
2801
  }
2732
- }), enablePinning && getIsSomeColumnsPinned() ? React.createElement(Box, {
2802
+ }), enablePinning && isSomeColumnsPinnedLeft || isSomeColumnsPinnedRight ? React.createElement(Box, {
2733
2803
  sx: {
2734
2804
  display: 'grid',
2735
2805
  gridTemplateColumns: getLeftTableWidth() + "fr " + getCenterTableWidth() + "fr " + getRightTableWidth() + "fr"
2736
2806
  }
2737
2807
  }, React.createElement(Box, {
2738
2808
  sx: function sx(theme) {
2739
- var _columnPinning$left;
2740
-
2741
2809
  return commonBoxStyles({
2742
2810
  pinned: 'left',
2743
2811
  theme: theme,
2744
- visible: !!((_columnPinning$left = columnPinning.left) != null && _columnPinning$left.length)
2812
+ visible: isSomeColumnsPinnedLeft
2745
2813
  });
2746
2814
  }
2747
2815
  }, React.createElement(MRT_Table, {
@@ -2750,7 +2818,8 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2750
2818
  })), React.createElement(Box, {
2751
2819
  sx: function sx(theme) {
2752
2820
  return commonBoxStyles({
2753
- theme: theme
2821
+ theme: theme,
2822
+ visible: !!tableInstance.getCenterFlatHeaders().length
2754
2823
  });
2755
2824
  }
2756
2825
  }, React.createElement(MRT_Table, {
@@ -2758,12 +2827,10 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2758
2827
  tableInstance: tableInstance
2759
2828
  })), React.createElement(Box, {
2760
2829
  sx: function sx(theme) {
2761
- var _columnPinning$right;
2762
-
2763
2830
  return commonBoxStyles({
2764
2831
  pinned: 'right',
2765
2832
  theme: theme,
2766
- visible: !!((_columnPinning$right = columnPinning.right) != null && _columnPinning$right.length)
2833
+ visible: isSomeColumnsPinnedRight
2767
2834
  });
2768
2835
  }
2769
2836
  }, React.createElement(MRT_Table, {
@@ -2851,19 +2918,19 @@ var getAllLeafColumnDefs = function getAllLeafColumnDefs(columns) {
2851
2918
  return !col.columns;
2852
2919
  });
2853
2920
  };
2854
- var createGroup = function createGroup(table, column, currentFilterTypes) {
2921
+ var createGroup = function createGroup(table, column, currentFilterFns) {
2855
2922
  var _column$columns;
2856
2923
 
2857
2924
  return table.createGroup(_extends({}, column, {
2858
2925
  columns: column == null ? void 0 : (_column$columns = column.columns) == null ? void 0 : _column$columns.map == null ? void 0 : _column$columns.map(function (col) {
2859
- return col.columns ? createGroup(table, col, currentFilterTypes) : createDataColumn(table, col, currentFilterTypes);
2926
+ return col.columns ? createGroup(table, col, currentFilterFns) : createDataColumn(table, col, currentFilterFns);
2860
2927
  })
2861
2928
  }));
2862
2929
  };
2863
- var createDataColumn = function createDataColumn(table, column, currentFilterTypes) {
2930
+ var createDataColumn = function createDataColumn(table, column, currentFilterFns) {
2864
2931
  return (// @ts-ignore
2865
2932
  table.createDataColumn(column.id, _extends({
2866
- filterFn: currentFilterTypes[column.id] instanceof Function ? currentFilterTypes[column.id] : defaultFilterFNs[currentFilterTypes[column.id]]
2933
+ filterFn: currentFilterFns[column.id] instanceof Function ? currentFilterFns[column.id] : defaultFilterFNs[currentFilterFns[column.id]]
2867
2934
  }, column))
2868
2935
  );
2869
2936
  };
@@ -2872,7 +2939,7 @@ var createDisplayColumn = function createDisplayColumn(table, column) {
2872
2939
  };
2873
2940
 
2874
2941
  var MRT_TableRoot = function MRT_TableRoot(props) {
2875
- var _props$initialState$c, _props$initialState, _props$initialState$c2, _props$initialState2, _props$initialState$i, _props$initialState3, _props$initialState$i2, _props$initialState4, _props$initialState$s, _props$initialState5, _props$initialState$s2, _props$initialState6, _props$initialState$p, _props$initialState7, _props$initialState7$, _props$initialState$p2, _props$initialState8, _props$initialState8$, _props$initialState$p3, _props$initialState9, _props$initialState9$, _props$globalFilterTy;
2942
+ var _initialState$current, _initialState$current2, _initialState$isDense, _initialState$isFullS, _initialState$showFil, _initialState$showGlo, _initialState$paginat, _initialState$paginat2, _initialState$paginat3, _initialState$paginat4, _initialState$paginat5, _initialState$paginat6, _props$globalFilterFn;
2876
2943
 
2877
2944
  var _useState = useState(props.idPrefix),
2878
2945
  idPrefix = _useState[0],
@@ -2883,54 +2950,77 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
2883
2950
 
2884
2951
  return setIdPrefix((_props$idPrefix = props.idPrefix) != null ? _props$idPrefix : Math.random().toString(36).substring(2, 9));
2885
2952
  }, [props.idPrefix]);
2953
+ var initialState = useMemo(function () {
2954
+ if (!props.enablePersistentState || !props.idPrefix) {
2955
+ return props.initialState;
2956
+ }
2957
+
2958
+ if (typeof window === 'undefined') {
2959
+ if (process.env.NODE_ENV !== 'production') {
2960
+ console.error('The MRT Persistent Table State feature is not supported if using SSR, but you can wrap your <MaterialReactTable /> in a MUI <NoSsr> tags to let it work');
2961
+ }
2962
+
2963
+ return props.initialState;
2964
+ }
2965
+
2966
+ var storedState = props.persistentStateMode === 'localStorage' ? localStorage.getItem("mrt-" + idPrefix + "-table-state") : props.persistentStateMode === 'sessionStorage' ? sessionStorage.getItem("mrt-" + idPrefix + "-table-state") : '{}';
2967
+
2968
+ if (storedState) {
2969
+ var parsedState = JSON.parse(storedState);
2886
2970
 
2887
- var _useState2 = useState((_props$initialState$c = (_props$initialState = props.initialState) == null ? void 0 : _props$initialState.currentEditingCell) != null ? _props$initialState$c : null),
2971
+ if (parsedState) {
2972
+ return _extends({}, props.initialState, parsedState);
2973
+ }
2974
+ }
2975
+
2976
+ return props.initialState;
2977
+ }, []);
2978
+
2979
+ var _useState2 = useState((_initialState$current = initialState == null ? void 0 : initialState.currentEditingCell) != null ? _initialState$current : null),
2888
2980
  currentEditingCell = _useState2[0],
2889
2981
  setCurrentEditingCell = _useState2[1];
2890
2982
 
2891
- var _useState3 = useState((_props$initialState$c2 = (_props$initialState2 = props.initialState) == null ? void 0 : _props$initialState2.currentEditingRow) != null ? _props$initialState$c2 : null),
2983
+ var _useState3 = useState((_initialState$current2 = initialState == null ? void 0 : initialState.currentEditingRow) != null ? _initialState$current2 : null),
2892
2984
  currentEditingRow = _useState3[0],
2893
2985
  setCurrentEditingRow = _useState3[1];
2894
2986
 
2895
- var _useState4 = useState((_props$initialState$i = (_props$initialState3 = props.initialState) == null ? void 0 : _props$initialState3.isDensePadding) != null ? _props$initialState$i : false),
2987
+ var _useState4 = useState((_initialState$isDense = initialState == null ? void 0 : initialState.isDensePadding) != null ? _initialState$isDense : false),
2896
2988
  isDensePadding = _useState4[0],
2897
2989
  setIsDensePadding = _useState4[1];
2898
2990
 
2899
- var _useState5 = useState((_props$initialState$i2 = (_props$initialState4 = props.initialState) == null ? void 0 : _props$initialState4.isFullScreen) != null ? _props$initialState$i2 : false),
2991
+ var _useState5 = useState((_initialState$isFullS = initialState == null ? void 0 : initialState.isFullScreen) != null ? _initialState$isFullS : false),
2900
2992
  isFullScreen = _useState5[0],
2901
2993
  setIsFullScreen = _useState5[1];
2902
2994
 
2903
- var _useState6 = useState((_props$initialState$s = (_props$initialState5 = props.initialState) == null ? void 0 : _props$initialState5.showFilters) != null ? _props$initialState$s : false),
2995
+ var _useState6 = useState((_initialState$showFil = initialState == null ? void 0 : initialState.showFilters) != null ? _initialState$showFil : false),
2904
2996
  showFilters = _useState6[0],
2905
2997
  setShowFilters = _useState6[1];
2906
2998
 
2907
- var _useState7 = useState((_props$initialState$s2 = (_props$initialState6 = props.initialState) == null ? void 0 : _props$initialState6.showGlobalFilter) != null ? _props$initialState$s2 : false),
2999
+ var _useState7 = useState((_initialState$showGlo = initialState == null ? void 0 : initialState.showGlobalFilter) != null ? _initialState$showGlo : false),
2908
3000
  showGlobalFilter = _useState7[0],
2909
3001
  setShowGlobalFilter = _useState7[1];
2910
3002
 
2911
3003
  var _useState8 = useState({
2912
- pageIndex: (_props$initialState$p = (_props$initialState7 = props.initialState) == null ? void 0 : (_props$initialState7$ = _props$initialState7.pagination) == null ? void 0 : _props$initialState7$.pageIndex) != null ? _props$initialState$p : 0,
2913
- pageSize: (_props$initialState$p2 = (_props$initialState8 = props.initialState) == null ? void 0 : (_props$initialState8$ = _props$initialState8.pagination) == null ? void 0 : _props$initialState8$.pageSize) != null ? _props$initialState$p2 : 10,
2914
- pageCount: (_props$initialState$p3 = (_props$initialState9 = props.initialState) == null ? void 0 : (_props$initialState9$ = _props$initialState9.pagination) == null ? void 0 : _props$initialState9$.pageCount) != null ? _props$initialState$p3 : -1
3004
+ pageIndex: (_initialState$paginat = initialState == null ? void 0 : (_initialState$paginat2 = initialState.pagination) == null ? void 0 : _initialState$paginat2.pageIndex) != null ? _initialState$paginat : 0,
3005
+ pageSize: (_initialState$paginat3 = initialState == null ? void 0 : (_initialState$paginat4 = initialState.pagination) == null ? void 0 : _initialState$paginat4.pageSize) != null ? _initialState$paginat3 : 10,
3006
+ pageCount: (_initialState$paginat5 = initialState == null ? void 0 : (_initialState$paginat6 = initialState.pagination) == null ? void 0 : _initialState$paginat6.pageCount) != null ? _initialState$paginat5 : -1
2915
3007
  }),
2916
3008
  pagination = _useState8[0],
2917
3009
  setPagination = _useState8[1];
2918
3010
 
2919
3011
  var _useState9 = useState(function () {
2920
3012
  return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (c) {
2921
- var _ref, _c$filter, _props$initialState10, _props$initialState11, _c$filterSelectOption, _ref2;
3013
+ var _ref, _c$filterFn, _initialState$current3, _c$filterSelectOption, _ref2;
2922
3014
 
2923
- return _ref2 = {}, _ref2[c.id] = (_ref = (_c$filter = c.filter) != null ? _c$filter : props == null ? void 0 : (_props$initialState10 = props.initialState) == null ? void 0 : (_props$initialState11 = _props$initialState10.columnFilters) == null ? void 0 : _props$initialState11.find(function (cf) {
2924
- return cf.id === c.id;
2925
- })) != null ? _ref : !!((_c$filterSelectOption = c.filterSelectOptions) != null && _c$filterSelectOption.length) ? MRT_FILTER_TYPE.EQUALS : MRT_FILTER_TYPE.BEST_MATCH, _ref2;
3015
+ return _ref2 = {}, _ref2[c.id] = (_ref = (_c$filterFn = c.filterFn) != null ? _c$filterFn : initialState == null ? void 0 : (_initialState$current3 = initialState.currentFilterFns) == null ? void 0 : _initialState$current3[c.id]) != null ? _ref : !!((_c$filterSelectOption = c.filterSelectOptions) != null && _c$filterSelectOption.length) ? MRT_FILTER_OPTION.EQUALS : MRT_FILTER_OPTION.BEST_MATCH, _ref2;
2926
3016
  })));
2927
3017
  }),
2928
- currentFilterTypes = _useState9[0],
2929
- setCurrentFilterTypes = _useState9[1];
3018
+ currentFilterFns = _useState9[0],
3019
+ setCurrentFilterFns = _useState9[1];
2930
3020
 
2931
- var _useState10 = useState((_props$globalFilterTy = props.globalFilterType) != null ? _props$globalFilterTy : MRT_FILTER_TYPE.BEST_MATCH_FIRST),
2932
- currentGlobalFilterType = _useState10[0],
2933
- setCurrentGlobalFilterType = _useState10[1];
3021
+ var _useState10 = useState((_props$globalFilterFn = props.globalFilterFn) != null ? _props$globalFilterFn : MRT_FILTER_OPTION.BEST_MATCH_FIRST),
3022
+ currentGlobalFilterFn = _useState10[0],
3023
+ setCurrentGlobalFilterFn = _useState10[1];
2934
3024
 
2935
3025
  var table = useMemo(function () {
2936
3026
  return createTable();
@@ -3004,9 +3094,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3004
3094
  }, [props.editingMode, props.enableEditing, props.enableExpandAll, props.enableExpanded, props.enableGrouping, props.enableRowActions, props.enableRowNumbers, props.enableRowSelection, props.enableSelectAll, props.localization, table]);
3005
3095
  var columns = useMemo(function () {
3006
3096
  return table.createColumns([].concat(displayColumns, props.columns.map(function (column) {
3007
- return column.columns ? createGroup(table, column, currentFilterTypes) : createDataColumn(table, column, currentFilterTypes);
3097
+ return column.columns ? createGroup(table, column, currentFilterFns) : createDataColumn(table, column, currentFilterFns);
3008
3098
  })));
3009
- }, [table, props.columns, currentFilterTypes]);
3099
+ }, [table, props.columns, currentFilterFns]);
3010
3100
  var data = useMemo(function () {
3011
3101
  return props.isLoading && !props.data.length ? [].concat(Array(10).fill(null)).map(function () {
3012
3102
  return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (c) {
@@ -3019,7 +3109,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3019
3109
 
3020
3110
  var tableInstance = _extends({}, useTableInstance(table, _extends({
3021
3111
  //@ts-ignore
3022
- filterTypes: defaultFilterFNs,
3112
+ filterFns: defaultFilterFNs,
3023
3113
  getColumnFilteredRowModel: getColumnFilteredRowModelSync(),
3024
3114
  getCoreRowModel: getCoreRowModelSync(),
3025
3115
  getExpandedRowModel: getExpandedRowModel(),
@@ -3030,8 +3120,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3030
3120
  getSubRows: function getSubRows(originalRow) {
3031
3121
  return originalRow.subRows;
3032
3122
  },
3033
- globalFilterType: currentGlobalFilterType,
3034
- idPrefix: idPrefix,
3123
+ globalFilterFn: currentGlobalFilterFn,
3035
3124
  onPaginationChange: function onPaginationChange(updater) {
3036
3125
  return setPagination(function (old) {
3037
3126
  return functionalUpdate(updater, old);
@@ -3040,11 +3129,14 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3040
3129
  }, props, {
3041
3130
  columns: columns,
3042
3131
  data: data,
3132
+ idPrefix: idPrefix,
3133
+ //@ts-ignore
3134
+ initialState: initialState,
3043
3135
  state: _extends({
3044
3136
  currentEditingCell: currentEditingCell,
3045
3137
  currentEditingRow: currentEditingRow,
3046
- currentFilterTypes: currentFilterTypes,
3047
- currentGlobalFilterType: currentGlobalFilterType,
3138
+ currentFilterFns: currentFilterFns,
3139
+ currentGlobalFilterFn: currentGlobalFilterFn,
3048
3140
  isDensePadding: isDensePadding,
3049
3141
  isFullScreen: isFullScreen,
3050
3142
  //@ts-ignore
@@ -3057,36 +3149,61 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3057
3149
  setCurrentEditingCell: setCurrentEditingCell,
3058
3150
  //@ts-ignore
3059
3151
  setCurrentEditingRow: setCurrentEditingRow,
3060
- setCurrentFilterTypes: setCurrentFilterTypes,
3061
- setCurrentGlobalFilterType: setCurrentGlobalFilterType,
3152
+ setCurrentFilterFns: setCurrentFilterFns,
3153
+ //@ts-ignore
3154
+ setCurrentGlobalFilterFn: setCurrentGlobalFilterFn,
3062
3155
  setIsDensePadding: setIsDensePadding,
3063
3156
  setIsFullScreen: setIsFullScreen,
3064
3157
  setShowFilters: setShowFilters,
3065
3158
  setShowGlobalFilter: setShowGlobalFilter
3066
3159
  });
3067
3160
 
3161
+ useEffect(function () {
3162
+ if (typeof window === 'undefined' || !props.enablePersistentState) {
3163
+ return;
3164
+ }
3165
+
3166
+ if (!props.idPrefix && process.env.NODE_ENV !== 'production') {
3167
+ console.warn('a unique idPrefix prop is required for persistent table state to work');
3168
+ return;
3169
+ }
3170
+
3171
+ var itemArgs = ["mrt-" + idPrefix + "-table-state", JSON.stringify(tableInstance.getState())];
3172
+
3173
+ if (props.persistentStateMode === 'localStorage') {
3174
+ var _localStorage;
3175
+
3176
+ (_localStorage = localStorage).setItem.apply(_localStorage, itemArgs);
3177
+ } else if (props.persistentStateMode === 'sessionStorage') {
3178
+ var _sessionStorage;
3179
+
3180
+ (_sessionStorage = sessionStorage).setItem.apply(_sessionStorage, itemArgs);
3181
+ }
3182
+ }, [props.enablePersistentState, props.idPrefix, props.persistentStateMode, tableInstance]);
3068
3183
  return React.createElement(React.Fragment, null, React.createElement(Dialog, {
3069
- TransitionComponent: Grow,
3070
3184
  PaperComponent: Box,
3185
+ TransitionComponent: Grow,
3071
3186
  disablePortal: true,
3072
3187
  fullScreen: true,
3073
3188
  keepMounted: false,
3074
3189
  onClose: function onClose() {
3075
- return tableInstance.setIsFullScreen(false);
3190
+ return setIsFullScreen(false);
3076
3191
  },
3077
- open: tableInstance.getState().isFullScreen,
3192
+ open: isFullScreen,
3078
3193
  transitionDuration: 400
3079
3194
  }, React.createElement(MRT_TablePaper, {
3080
3195
  tableInstance: tableInstance
3081
- })), !tableInstance.getState().isFullScreen && React.createElement(MRT_TablePaper, {
3196
+ })), !isFullScreen && React.createElement(MRT_TablePaper, {
3082
3197
  tableInstance: tableInstance
3083
3198
  }));
3084
3199
  };
3085
3200
 
3086
- var _excluded$5 = ["autoResetExpanded", "columnResizeMode", "editingMode", "enableColumnActions", "enableColumnFilters", "enableColumnResizing", "enableDensePaddingToggle", "enableExpandAll", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableHiding", "enableMultiRowSelection", "enablePagination", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarBottom", "enableToolbarInternalActions", "enableToolbarTop", "icons", "localization", "positionActionsColumn", "positionPagination", "positionToolbarActions", "positionToolbarAlertBanner"];
3201
+ var _excluded$5 = ["autoResetExpanded", "autoResetSorting", "columnResizeMode", "editingMode", "enableColumnActions", "enableColumnFilters", "enableColumnResizing", "enableDensePaddingToggle", "enableExpandAll", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableHiding", "enableMultiRowSelection", "enablePagination", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarBottom", "enableToolbarInternalActions", "enableToolbarTop", "icons", "localization", "persistentStateMode", "positionActionsColumn", "positionPagination", "positionToolbarActions", "positionToolbarAlertBanner"];
3087
3202
  var MaterialReactTable = (function (_ref) {
3088
3203
  var _ref$autoResetExpande = _ref.autoResetExpanded,
3089
3204
  autoResetExpanded = _ref$autoResetExpande === void 0 ? false : _ref$autoResetExpande,
3205
+ _ref$autoResetSorting = _ref.autoResetSorting,
3206
+ autoResetSorting = _ref$autoResetSorting === void 0 ? false : _ref$autoResetSorting,
3090
3207
  _ref$columnResizeMode = _ref.columnResizeMode,
3091
3208
  columnResizeMode = _ref$columnResizeMode === void 0 ? 'onEnd' : _ref$columnResizeMode,
3092
3209
  _ref$editingMode = _ref.editingMode,
@@ -3131,6 +3248,8 @@ var MaterialReactTable = (function (_ref) {
3131
3248
  enableToolbarTop = _ref$enableToolbarTop === void 0 ? true : _ref$enableToolbarTop,
3132
3249
  icons = _ref.icons,
3133
3250
  localization = _ref.localization,
3251
+ _ref$persistentStateM = _ref.persistentStateMode,
3252
+ persistentStateMode = _ref$persistentStateM === void 0 ? 'sessionStorage' : _ref$persistentStateM,
3134
3253
  _ref$positionActionsC = _ref.positionActionsColumn,
3135
3254
  positionActionsColumn = _ref$positionActionsC === void 0 ? 'first' : _ref$positionActionsC,
3136
3255
  _ref$positionPaginati = _ref.positionPagination,
@@ -3143,6 +3262,7 @@ var MaterialReactTable = (function (_ref) {
3143
3262
 
3144
3263
  return React.createElement(MRT_TableRoot, Object.assign({
3145
3264
  autoResetExpanded: autoResetExpanded,
3265
+ autoResetSorting: autoResetSorting,
3146
3266
  columnResizeMode: columnResizeMode,
3147
3267
  editingMode: editingMode,
3148
3268
  enableColumnActions: enableColumnActions,
@@ -3166,6 +3286,7 @@ var MaterialReactTable = (function (_ref) {
3166
3286
  enableToolbarTop: enableToolbarTop,
3167
3287
  icons: _extends({}, MRT_Default_Icons, icons),
3168
3288
  localization: _extends({}, MRT_DefaultLocalization_EN, localization),
3289
+ persistentStateMode: persistentStateMode,
3169
3290
  positionActionsColumn: positionActionsColumn,
3170
3291
  positionPagination: positionPagination,
3171
3292
  positionToolbarActions: positionToolbarActions,