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.
@@ -129,6 +129,7 @@ var MRT_DefaultLocalization_EN = {
129
129
  toggleSelectRow: 'Toggle select row',
130
130
  ungroupByColumn: 'Ungroup by {column}',
131
131
  unpin: 'Unpin',
132
+ unpinAll: 'Unpin all',
132
133
  unsorted: 'Unsorted'
133
134
  };
134
135
 
@@ -235,21 +236,21 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
235
236
  }));
236
237
  };
237
238
 
238
- var MRT_FILTER_TYPE;
239
+ var MRT_FILTER_OPTION;
239
240
 
240
- (function (MRT_FILTER_TYPE) {
241
- MRT_FILTER_TYPE["BEST_MATCH"] = "bestMatch";
242
- MRT_FILTER_TYPE["BEST_MATCH_FIRST"] = "bestMatchFirst";
243
- MRT_FILTER_TYPE["CONTAINS"] = "contains";
244
- MRT_FILTER_TYPE["EMPTY"] = "empty";
245
- MRT_FILTER_TYPE["ENDS_WITH"] = "endsWith";
246
- MRT_FILTER_TYPE["EQUALS"] = "equals";
247
- MRT_FILTER_TYPE["GREATER_THAN"] = "greaterThan";
248
- MRT_FILTER_TYPE["LESS_THAN"] = "lessThan";
249
- MRT_FILTER_TYPE["NOT_EMPTY"] = "notEmpty";
250
- MRT_FILTER_TYPE["NOT_EQUALS"] = "notEquals";
251
- MRT_FILTER_TYPE["STARTS_WITH"] = "startsWith";
252
- })(MRT_FILTER_TYPE || (MRT_FILTER_TYPE = {}));
241
+ (function (MRT_FILTER_OPTION) {
242
+ MRT_FILTER_OPTION["BEST_MATCH"] = "bestMatch";
243
+ MRT_FILTER_OPTION["BEST_MATCH_FIRST"] = "bestMatchFirst";
244
+ MRT_FILTER_OPTION["CONTAINS"] = "contains";
245
+ MRT_FILTER_OPTION["EMPTY"] = "empty";
246
+ MRT_FILTER_OPTION["ENDS_WITH"] = "endsWith";
247
+ MRT_FILTER_OPTION["EQUALS"] = "equals";
248
+ MRT_FILTER_OPTION["GREATER_THAN"] = "greaterThan";
249
+ MRT_FILTER_OPTION["LESS_THAN"] = "lessThan";
250
+ MRT_FILTER_OPTION["NOT_EMPTY"] = "notEmpty";
251
+ MRT_FILTER_OPTION["NOT_EQUALS"] = "notEquals";
252
+ MRT_FILTER_OPTION["STARTS_WITH"] = "startsWith";
253
+ })(MRT_FILTER_OPTION || (MRT_FILTER_OPTION = {}));
253
254
 
254
255
  var bestMatchFirst = function bestMatchFirst(rows, columnIds, filterValue) {
255
256
  return matchSorter.matchSorter(rows, filterValue.toString().trim(), {
@@ -387,7 +388,7 @@ var commonMenuItemStyles = {
387
388
  my: 0,
388
389
  alignItems: 'center'
389
390
  };
390
- var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
391
+ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
391
392
  var anchorEl = _ref.anchorEl,
392
393
  header = _ref.header,
393
394
  onSelect = _ref.onSelect,
@@ -395,97 +396,97 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
395
396
  tableInstance = _ref.tableInstance;
396
397
  var getState = tableInstance.getState,
397
398
  _tableInstance$option = tableInstance.options,
398
- enabledGlobalFilterTypes = _tableInstance$option.enabledGlobalFilterTypes,
399
+ enabledGlobalFilterOptions = _tableInstance$option.enabledGlobalFilterOptions,
399
400
  localization = _tableInstance$option.localization,
400
- setCurrentFilterTypes = tableInstance.setCurrentFilterTypes,
401
- setCurrentGlobalFilterType = tableInstance.setCurrentGlobalFilterType;
401
+ setCurrentFilterFns = tableInstance.setCurrentFilterFns,
402
+ setCurrentGlobalFilterFn = tableInstance.setCurrentGlobalFilterFn;
402
403
 
403
404
  var _getState = getState(),
404
405
  isDensePadding = _getState.isDensePadding,
405
- currentFilterTypes = _getState.currentFilterTypes,
406
- currentGlobalFilterType = _getState.currentGlobalFilterType;
406
+ currentFilterFns = _getState.currentFilterFns,
407
+ currentGlobalFilterFn = _getState.currentGlobalFilterFn;
407
408
 
408
- var filterTypes = React.useMemo(function () {
409
+ var filterOptions = React.useMemo(function () {
409
410
  return [{
410
- type: MRT_FILTER_TYPE.BEST_MATCH_FIRST,
411
+ type: MRT_FILTER_OPTION.BEST_MATCH_FIRST,
411
412
  label: localization.filterBestMatchFirst,
412
413
  divider: false,
413
414
  fn: bestMatchFirst
414
415
  }, {
415
- type: MRT_FILTER_TYPE.BEST_MATCH,
416
+ type: MRT_FILTER_OPTION.BEST_MATCH,
416
417
  label: localization.filterBestMatch,
417
418
  divider: !!header,
418
419
  fn: bestMatch
419
420
  }, {
420
- type: MRT_FILTER_TYPE.CONTAINS,
421
+ type: MRT_FILTER_OPTION.CONTAINS,
421
422
  label: localization.filterContains,
422
423
  divider: false,
423
424
  fn: contains
424
425
  }, {
425
- type: MRT_FILTER_TYPE.STARTS_WITH,
426
+ type: MRT_FILTER_OPTION.STARTS_WITH,
426
427
  label: localization.filterStartsWith,
427
428
  divider: false,
428
429
  fn: startsWith
429
430
  }, {
430
- type: MRT_FILTER_TYPE.ENDS_WITH,
431
+ type: MRT_FILTER_OPTION.ENDS_WITH,
431
432
  label: localization.filterEndsWith,
432
433
  divider: true,
433
434
  fn: endsWith
434
435
  }, {
435
- type: MRT_FILTER_TYPE.EQUALS,
436
+ type: MRT_FILTER_OPTION.EQUALS,
436
437
  label: localization.filterEquals,
437
438
  divider: false,
438
439
  fn: equals
439
440
  }, {
440
- type: MRT_FILTER_TYPE.NOT_EQUALS,
441
+ type: MRT_FILTER_OPTION.NOT_EQUALS,
441
442
  label: localization.filterNotEquals,
442
443
  divider: true,
443
444
  fn: notEquals
444
445
  }, {
445
- type: MRT_FILTER_TYPE.GREATER_THAN,
446
+ type: MRT_FILTER_OPTION.GREATER_THAN,
446
447
  label: localization.filterGreaterThan,
447
448
  divider: false,
448
449
  fn: greaterThan
449
450
  }, {
450
- type: MRT_FILTER_TYPE.LESS_THAN,
451
+ type: MRT_FILTER_OPTION.LESS_THAN,
451
452
  label: localization.filterLessThan,
452
453
  divider: true,
453
454
  fn: lessThan
454
455
  }, {
455
- type: MRT_FILTER_TYPE.EMPTY,
456
+ type: MRT_FILTER_OPTION.EMPTY,
456
457
  label: localization.filterEmpty,
457
458
  divider: false,
458
459
  fn: empty
459
460
  }, {
460
- type: MRT_FILTER_TYPE.NOT_EMPTY,
461
+ type: MRT_FILTER_OPTION.NOT_EMPTY,
461
462
  label: localization.filterNotEmpty,
462
463
  divider: false,
463
464
  fn: notEmpty
464
465
  }].filter(function (filterType) {
465
- 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);
466
+ 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);
466
467
  });
467
468
  }, []);
468
469
 
469
470
  var handleSelectFilterType = function handleSelectFilterType(value) {
470
471
  if (header) {
471
- setCurrentFilterTypes(function (prev) {
472
+ setCurrentFilterFns(function (prev) {
472
473
  var _extends2;
473
474
 
474
475
  return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = value, _extends2));
475
476
  });
476
477
 
477
- if ([MRT_FILTER_TYPE.EMPTY, MRT_FILTER_TYPE.NOT_EMPTY].includes(value)) {
478
+ if ([MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(value)) {
478
479
  header.column.setColumnFilterValue(' ');
479
480
  }
480
481
  } else {
481
- setCurrentGlobalFilterType(value);
482
+ setCurrentGlobalFilterFn(value);
482
483
  }
483
484
 
484
485
  setAnchorEl(null);
485
486
  onSelect == null ? void 0 : onSelect();
486
487
  };
487
488
 
488
- var filterType = !!header ? currentFilterTypes[header.id] : currentGlobalFilterType;
489
+ var filterType = !!header ? currentFilterFns[header.id] : currentGlobalFilterFn;
489
490
  return React__default.createElement(material.Menu, {
490
491
  anchorEl: anchorEl,
491
492
  anchorOrigin: {
@@ -499,7 +500,7 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
499
500
  MenuListProps: {
500
501
  dense: isDensePadding
501
502
  }
502
- }, filterTypes.map(function (_ref2, index) {
503
+ }, filterOptions.map(function (_ref2, index) {
503
504
  var type = _ref2.type,
504
505
  label = _ref2.label,
505
506
  divider = _ref2.divider,
@@ -517,6 +518,57 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
517
518
  }));
518
519
  };
519
520
 
521
+ var MRT_ColumnPinningButtons = function MRT_ColumnPinningButtons(_ref) {
522
+ var column = _ref.column,
523
+ tableInstance = _ref.tableInstance;
524
+ var getState = tableInstance.getState,
525
+ _tableInstance$option = tableInstance.options,
526
+ PushPinIcon = _tableInstance$option.icons.PushPinIcon,
527
+ localization = _tableInstance$option.localization;
528
+
529
+ var _getState = getState(),
530
+ columnOrder = _getState.columnOrder;
531
+
532
+ var handlePinColumn = function handlePinColumn(pinDirection) {
533
+ column.pin(pinDirection);
534
+
535
+ if (column.columnDefType === 'display') {
536
+ tableInstance.setColumnOrder([column.id].concat(columnOrder));
537
+ }
538
+ };
539
+
540
+ var pinned = column.getIsPinned();
541
+ return React__default.createElement(material.Box, {
542
+ sx: {
543
+ mr: '8px'
544
+ }
545
+ }, React__default.createElement(material.Tooltip, {
546
+ arrow: true,
547
+ title: pinned === 'left' ? localization.unpin : localization.pinToLeft
548
+ }, React__default.createElement(material.IconButton, {
549
+ onClick: function onClick() {
550
+ return handlePinColumn(pinned === 'left' ? false : 'left');
551
+ },
552
+ size: "small"
553
+ }, React__default.createElement(PushPinIcon, {
554
+ style: {
555
+ transform: pinned === 'left' ? 'rotate(0)' : 'rotate(90deg)'
556
+ }
557
+ }))), React__default.createElement(material.Tooltip, {
558
+ arrow: true,
559
+ title: pinned === 'right' ? localization.unpin : localization.pinToRight
560
+ }, React__default.createElement(material.IconButton, {
561
+ onClick: function onClick() {
562
+ return handlePinColumn(pinned === 'right' ? false : 'right');
563
+ },
564
+ size: "small"
565
+ }, React__default.createElement(PushPinIcon, {
566
+ style: {
567
+ transform: pinned === 'right' ? 'rotate(0)' : 'rotate(-90deg)'
568
+ }
569
+ }))));
570
+ };
571
+
520
572
  var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
521
573
  var _column$columns2;
522
574
 
@@ -524,7 +576,9 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
524
576
  isSubMenu = _ref.isSubMenu,
525
577
  tableInstance = _ref.tableInstance;
526
578
  var getState = tableInstance.getState,
527
- onToggleColumnVisibility = tableInstance.options.onToggleColumnVisibility;
579
+ _tableInstance$option = tableInstance.options,
580
+ onToggleColumnVisibility = _tableInstance$option.onToggleColumnVisibility,
581
+ enablePinning = _tableInstance$option.enablePinning;
528
582
 
529
583
  var _getState = getState(),
530
584
  columnVisibility = _getState.columnVisibility;
@@ -552,10 +606,17 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
552
606
  };
553
607
 
554
608
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.MenuItem, {
555
- sx: _extends({}, commonMenuItemStyles$1, {
556
- pl: (column.depth + 0.5) * 2 + "rem"
557
- })
558
- }, React__default.createElement(material.FormControlLabel, {
609
+ sx: {
610
+ alignItems: 'center',
611
+ justifyContent: 'flex-start',
612
+ my: 0,
613
+ pl: (column.depth + 0.5) * 2 + "rem",
614
+ py: '6px'
615
+ }
616
+ }, !isSubMenu && enablePinning && React__default.createElement(MRT_ColumnPinningButtons, {
617
+ column: column,
618
+ tableInstance: tableInstance
619
+ }), React__default.createElement(material.FormControlLabel, {
559
620
  componentsProps: {
560
621
  typography: {
561
622
  sx: {
@@ -592,7 +653,9 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
592
653
  getState = tableInstance.getState,
593
654
  toggleAllColumnsVisible = tableInstance.toggleAllColumnsVisible,
594
655
  getAllLeafColumns = tableInstance.getAllLeafColumns,
595
- localization = tableInstance.options.localization;
656
+ _tableInstance$option = tableInstance.options,
657
+ localization = _tableInstance$option.localization,
658
+ enablePinning = _tableInstance$option.enablePinning;
596
659
 
597
660
  var _getState = getState(),
598
661
  isDensePadding = _getState.isDensePadding;
@@ -616,9 +679,9 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
616
679
  });
617
680
  return getIsSomeColumnsPinned() ? [].concat(dataColumns.filter(function (c) {
618
681
  return c.getIsPinned() === 'left';
619
- }), dataColumns.filter(function (c) {
682
+ }), [null], dataColumns.filter(function (c) {
620
683
  return c.getIsPinned() === false;
621
- }), dataColumns.filter(function (c) {
684
+ }), [null], dataColumns.filter(function (c) {
622
685
  return c.getIsPinned() === 'right';
623
686
  })) : dataColumns;
624
687
  }, [getAllColumns(), getState().columnPinning, getIsSomeColumnsPinned()]);
@@ -641,7 +704,12 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
641
704
  }, !isSubMenu && React__default.createElement(material.Button, {
642
705
  disabled: !getIsSomeColumnsVisible(),
643
706
  onClick: hideAllColumns
644
- }, localization.hideAll), React__default.createElement(material.Button, {
707
+ }, localization.hideAll), !isSubMenu && enablePinning && React__default.createElement(material.Button, {
708
+ disabled: !getIsSomeColumnsPinned(),
709
+ onClick: function onClick() {
710
+ return tableInstance.setColumnPinning({});
711
+ }
712
+ }, localization.unpinAll), React__default.createElement(material.Button, {
645
713
  disabled: getIsAllColumnsVisible(),
646
714
  onClick: function onClick() {
647
715
  return toggleAllColumnsVisible(true);
@@ -654,11 +722,13 @@ var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
654
722
  tableInstance: tableInstance
655
723
  });
656
724
  }), React__default.createElement(material.Divider, null), allDataColumns.map(function (column, index) {
657
- return React__default.createElement(MRT_ShowHideColumnsMenuItems, {
725
+ return column ? React__default.createElement(MRT_ShowHideColumnsMenuItems, {
658
726
  column: column,
659
727
  isSubMenu: isSubMenu,
660
728
  key: index + "-" + column.id,
661
729
  tableInstance: tableInstance
730
+ }) : React__default.createElement(material.Divider, {
731
+ key: index + "-divider"
662
732
  });
663
733
  }));
664
734
  };
@@ -843,7 +913,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
843
913
  sx: {
844
914
  p: 0
845
915
  }
846
- }, React__default.createElement(ArrowRightIcon, null))), React__default.createElement(MRT_FilterTypeMenu, {
916
+ }, React__default.createElement(ArrowRightIcon, null))), React__default.createElement(MRT_FilterOptionMenu, {
847
917
  anchorEl: filterMenuAnchorEl,
848
918
  header: header,
849
919
  key: 2,
@@ -1257,7 +1327,7 @@ var MRT_SearchTextField = function MRT_SearchTextField(_ref) {
1257
1327
  sx: _extends({
1258
1328
  justifySelf: 'end'
1259
1329
  }, textFieldProps == null ? void 0 : textFieldProps.sx)
1260
- })), React__default.createElement(MRT_FilterTypeMenu, {
1330
+ })), React__default.createElement(MRT_FilterOptionMenu, {
1261
1331
  anchorEl: anchorEl,
1262
1332
  setAnchorEl: setAnchorEl,
1263
1333
  tableInstance: tableInstance
@@ -1755,11 +1825,11 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1755
1825
  idPrefix = _tableInstance$option.idPrefix,
1756
1826
  localization = _tableInstance$option.localization,
1757
1827
  muiTableHeadCellFilterTextFieldProps = _tableInstance$option.muiTableHeadCellFilterTextFieldProps,
1758
- setCurrentFilterTypes = tableInstance.setCurrentFilterTypes;
1828
+ setCurrentFilterFns = tableInstance.setCurrentFilterFns;
1759
1829
  var column = header.column;
1760
1830
 
1761
1831
  var _getState = getState(),
1762
- currentFilterTypes = _getState.currentFilterTypes;
1832
+ currentFilterFns = _getState.currentFilterFns;
1763
1833
 
1764
1834
  var _useState = React.useState(null),
1765
1835
  anchorEl = _useState[0],
@@ -1798,10 +1868,10 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1798
1868
  var handleClearFilterChip = function handleClearFilterChip() {
1799
1869
  setFilterValue('');
1800
1870
  column.setColumnFilterValue(undefined);
1801
- setCurrentFilterTypes(function (prev) {
1871
+ setCurrentFilterFns(function (prev) {
1802
1872
  var _extends2;
1803
1873
 
1804
- return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = MRT_FILTER_TYPE.BEST_MATCH, _extends2));
1874
+ return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = MRT_FILTER_OPTION.BEST_MATCH, _extends2));
1805
1875
  });
1806
1876
  };
1807
1877
 
@@ -1813,10 +1883,10 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1813
1883
  }
1814
1884
 
1815
1885
  var filterId = "mrt-" + idPrefix + "-" + header.id + "-filter-text-field";
1816
- var filterType = currentFilterTypes == null ? void 0 : currentFilterTypes[header.id];
1886
+ var filterFn = currentFilterFns == null ? void 0 : currentFilterFns[header.id];
1817
1887
  var isSelectFilter = !!column.filterSelectOptions;
1818
- var filterChipLabel = !(filterType instanceof Function) && [MRT_FILTER_TYPE.EMPTY, MRT_FILTER_TYPE.NOT_EMPTY].includes(filterType) ? //@ts-ignore
1819
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))] : '';
1888
+ var filterChipLabel = !(filterFn instanceof Function) && [MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(filterFn) ? //@ts-ignore
1889
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))] : '';
1820
1890
  var filterPlaceholder = (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(column.header));
1821
1891
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.TextField, Object.assign({
1822
1892
  fullWidth: true,
@@ -1831,9 +1901,9 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1831
1901
  },
1832
1902
  helperText: React__default.createElement("label", {
1833
1903
  htmlFor: filterId
1834
- }, filterType instanceof Function ? (_localization$filterM = localization.filterMode.replace('{filterType}', // @ts-ignore
1835
- (_localization$ = localization["filter" + (filterType.name.charAt(0).toUpperCase() + filterType.name.slice(1))]) != null ? _localization$ : '')) != null ? _localization$filterM : '' : localization.filterMode.replace('{filterType}', // @ts-ignore
1836
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))])),
1904
+ }, filterFn instanceof Function ? (_localization$filterM = localization.filterMode.replace('{filterType}', // @ts-ignore
1905
+ (_localization$ = localization["filter" + (filterFn.name.charAt(0).toUpperCase() + filterFn.name.slice(1))]) != null ? _localization$ : '')) != null ? _localization$filterM : '' : localization.filterMode.replace('{filterType}', // @ts-ignore
1906
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))])),
1837
1907
  FormHelperTextProps: {
1838
1908
  sx: {
1839
1909
  fontSize: '0.6rem',
@@ -1920,7 +1990,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1920
1990
  key: value,
1921
1991
  value: value
1922
1992
  }, text);
1923
- })), React__default.createElement(MRT_FilterTypeMenu, {
1993
+ })), React__default.createElement(MRT_FilterOptionMenu, {
1924
1994
  anchorEl: anchorEl,
1925
1995
  header: header,
1926
1996
  setAnchorEl: setAnchorEl,
@@ -2022,9 +2092,9 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2022
2092
  var tableCellProps = _extends({}, header.getHeaderProps(), mTableHeadCellProps, mcTableHeadCellProps);
2023
2093
 
2024
2094
  var sortTooltip = !!column.getIsSorted() ? column.getIsSorted() === 'desc' ? localization.sortedByColumnDesc.replace('{column}', column.header) : localization.sortedByColumnAsc.replace('{column}', column.header) : localization.unsorted;
2025
- var filterType = (_getState2 = getState()) == null ? void 0 : (_getState2$currentFil = _getState2.currentFilterTypes) == null ? void 0 : _getState2$currentFil[header.id];
2026
- var filterTooltip = !!column.getColumnFilterValue() ? localization.filteringByColumn.replace('{column}', String(column.header)).replace('{filterType}', filterType instanceof Function ? '' : // @ts-ignore
2027
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))]).replace('{filterValue}', column.getColumnFilterValue()).replace('" "', '') : localization.showHideFilters;
2095
+ var filterFn = (_getState2 = getState()) == null ? void 0 : (_getState2$currentFil = _getState2.currentFilterFns) == null ? void 0 : _getState2$currentFil[header.id];
2096
+ var filterTooltip = !!column.getColumnFilterValue() ? localization.filteringByColumn.replace('{column}', String(column.header)).replace('{filterType}', filterFn instanceof Function ? '' : // @ts-ignore
2097
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))]).replace('{filterValue}', column.getColumnFilterValue()).replace('" "', '') : localization.showHideFilters;
2028
2098
  var headerElement = (_column$Header = column == null ? void 0 : column.Header == null ? void 0 : column.Header({
2029
2099
  header: header,
2030
2100
  tableInstance: tableInstance
@@ -2660,10 +2730,10 @@ var MRT_Table = function MRT_Table(_ref) {
2660
2730
  tableInstance = _ref.tableInstance;
2661
2731
  var getTableProps = tableInstance.getTableProps,
2662
2732
  _tableInstance$option = tableInstance.options,
2663
- muiTableProps = _tableInstance$option.muiTableProps,
2664
- enableTableHead = _tableInstance$option.enableTableHead,
2733
+ enableStickyHeader = _tableInstance$option.enableStickyHeader,
2665
2734
  enableTableFooter = _tableInstance$option.enableTableFooter,
2666
- enableStickyHeader = _tableInstance$option.enableStickyHeader;
2735
+ enableTableHead = _tableInstance$option.enableTableHead,
2736
+ muiTableProps = _tableInstance$option.muiTableProps;
2667
2737
  var mTableProps = muiTableProps instanceof Function ? muiTableProps({
2668
2738
  tableInstance: tableInstance
2669
2739
  }) : muiTableProps;
@@ -2699,7 +2769,6 @@ var commonBoxStyles = function commonBoxStyles(_ref) {
2699
2769
  var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2700
2770
  var tableInstance = _ref2.tableInstance;
2701
2771
  var getCenterTableWidth = tableInstance.getCenterTableWidth,
2702
- getIsSomeColumnsPinned = tableInstance.getIsSomeColumnsPinned,
2703
2772
  getLeftTableWidth = tableInstance.getLeftTableWidth,
2704
2773
  getRightTableWidth = tableInstance.getRightTableWidth,
2705
2774
  getState = tableInstance.getState,
@@ -2710,8 +2779,7 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2710
2779
  muiTableContainerProps = _tableInstance$option.muiTableContainerProps;
2711
2780
 
2712
2781
  var _getState = getState(),
2713
- isFullScreen = _getState.isFullScreen,
2714
- columnPinning = _getState.columnPinning;
2782
+ isFullScreen = _getState.isFullScreen;
2715
2783
 
2716
2784
  var _useState = React.useState(0),
2717
2785
  totalToolbarHeight = _useState[0],
@@ -2727,6 +2795,8 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2727
2795
  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;
2728
2796
  setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
2729
2797
  });
2798
+ var isSomeColumnsPinnedLeft = !!tableInstance.getLeftFlatHeaders().length;
2799
+ var isSomeColumnsPinnedRight = !!tableInstance.getRightFlatHeaders().length;
2730
2800
  return React__default.createElement(material.TableContainer, Object.assign({}, tableContainerProps, {
2731
2801
  sx: _extends({
2732
2802
  maxWidth: '100%',
@@ -2736,19 +2806,17 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2736
2806
  style: {
2737
2807
  maxHeight: isFullScreen ? "calc(100vh - " + totalToolbarHeight + "px)" : undefined
2738
2808
  }
2739
- }), enablePinning && getIsSomeColumnsPinned() ? React__default.createElement(material.Box, {
2809
+ }), enablePinning && isSomeColumnsPinnedLeft || isSomeColumnsPinnedRight ? React__default.createElement(material.Box, {
2740
2810
  sx: {
2741
2811
  display: 'grid',
2742
2812
  gridTemplateColumns: getLeftTableWidth() + "fr " + getCenterTableWidth() + "fr " + getRightTableWidth() + "fr"
2743
2813
  }
2744
2814
  }, React__default.createElement(material.Box, {
2745
2815
  sx: function sx(theme) {
2746
- var _columnPinning$left;
2747
-
2748
2816
  return commonBoxStyles({
2749
2817
  pinned: 'left',
2750
2818
  theme: theme,
2751
- visible: !!((_columnPinning$left = columnPinning.left) != null && _columnPinning$left.length)
2819
+ visible: isSomeColumnsPinnedLeft
2752
2820
  });
2753
2821
  }
2754
2822
  }, React__default.createElement(MRT_Table, {
@@ -2757,7 +2825,8 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2757
2825
  })), React__default.createElement(material.Box, {
2758
2826
  sx: function sx(theme) {
2759
2827
  return commonBoxStyles({
2760
- theme: theme
2828
+ theme: theme,
2829
+ visible: !!tableInstance.getCenterFlatHeaders().length
2761
2830
  });
2762
2831
  }
2763
2832
  }, React__default.createElement(MRT_Table, {
@@ -2765,12 +2834,10 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
2765
2834
  tableInstance: tableInstance
2766
2835
  })), React__default.createElement(material.Box, {
2767
2836
  sx: function sx(theme) {
2768
- var _columnPinning$right;
2769
-
2770
2837
  return commonBoxStyles({
2771
2838
  pinned: 'right',
2772
2839
  theme: theme,
2773
- visible: !!((_columnPinning$right = columnPinning.right) != null && _columnPinning$right.length)
2840
+ visible: isSomeColumnsPinnedRight
2774
2841
  });
2775
2842
  }
2776
2843
  }, React__default.createElement(MRT_Table, {
@@ -2858,19 +2925,19 @@ var getAllLeafColumnDefs = function getAllLeafColumnDefs(columns) {
2858
2925
  return !col.columns;
2859
2926
  });
2860
2927
  };
2861
- var createGroup = function createGroup(table, column, currentFilterTypes) {
2928
+ var createGroup = function createGroup(table, column, currentFilterFns) {
2862
2929
  var _column$columns;
2863
2930
 
2864
2931
  return table.createGroup(_extends({}, column, {
2865
2932
  columns: column == null ? void 0 : (_column$columns = column.columns) == null ? void 0 : _column$columns.map == null ? void 0 : _column$columns.map(function (col) {
2866
- return col.columns ? createGroup(table, col, currentFilterTypes) : createDataColumn(table, col, currentFilterTypes);
2933
+ return col.columns ? createGroup(table, col, currentFilterFns) : createDataColumn(table, col, currentFilterFns);
2867
2934
  })
2868
2935
  }));
2869
2936
  };
2870
- var createDataColumn = function createDataColumn(table, column, currentFilterTypes) {
2937
+ var createDataColumn = function createDataColumn(table, column, currentFilterFns) {
2871
2938
  return (// @ts-ignore
2872
2939
  table.createDataColumn(column.id, _extends({
2873
- filterFn: currentFilterTypes[column.id] instanceof Function ? currentFilterTypes[column.id] : defaultFilterFNs[currentFilterTypes[column.id]]
2940
+ filterFn: currentFilterFns[column.id] instanceof Function ? currentFilterFns[column.id] : defaultFilterFNs[currentFilterFns[column.id]]
2874
2941
  }, column))
2875
2942
  );
2876
2943
  };
@@ -2879,7 +2946,7 @@ var createDisplayColumn = function createDisplayColumn(table, column) {
2879
2946
  };
2880
2947
 
2881
2948
  var MRT_TableRoot = function MRT_TableRoot(props) {
2882
- 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;
2949
+ 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;
2883
2950
 
2884
2951
  var _useState = React.useState(props.idPrefix),
2885
2952
  idPrefix = _useState[0],
@@ -2890,54 +2957,77 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
2890
2957
 
2891
2958
  return setIdPrefix((_props$idPrefix = props.idPrefix) != null ? _props$idPrefix : Math.random().toString(36).substring(2, 9));
2892
2959
  }, [props.idPrefix]);
2960
+ var initialState = React.useMemo(function () {
2961
+ if (!props.enablePersistentState || !props.idPrefix) {
2962
+ return props.initialState;
2963
+ }
2964
+
2965
+ if (typeof window === 'undefined') {
2966
+ {
2967
+ 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');
2968
+ }
2969
+
2970
+ return props.initialState;
2971
+ }
2972
+
2973
+ var storedState = props.persistentStateMode === 'localStorage' ? localStorage.getItem("mrt-" + idPrefix + "-table-state") : props.persistentStateMode === 'sessionStorage' ? sessionStorage.getItem("mrt-" + idPrefix + "-table-state") : '{}';
2974
+
2975
+ if (storedState) {
2976
+ var parsedState = JSON.parse(storedState);
2893
2977
 
2894
- var _useState2 = React.useState((_props$initialState$c = (_props$initialState = props.initialState) == null ? void 0 : _props$initialState.currentEditingCell) != null ? _props$initialState$c : null),
2978
+ if (parsedState) {
2979
+ return _extends({}, props.initialState, parsedState);
2980
+ }
2981
+ }
2982
+
2983
+ return props.initialState;
2984
+ }, []);
2985
+
2986
+ var _useState2 = React.useState((_initialState$current = initialState == null ? void 0 : initialState.currentEditingCell) != null ? _initialState$current : null),
2895
2987
  currentEditingCell = _useState2[0],
2896
2988
  setCurrentEditingCell = _useState2[1];
2897
2989
 
2898
- var _useState3 = React.useState((_props$initialState$c2 = (_props$initialState2 = props.initialState) == null ? void 0 : _props$initialState2.currentEditingRow) != null ? _props$initialState$c2 : null),
2990
+ var _useState3 = React.useState((_initialState$current2 = initialState == null ? void 0 : initialState.currentEditingRow) != null ? _initialState$current2 : null),
2899
2991
  currentEditingRow = _useState3[0],
2900
2992
  setCurrentEditingRow = _useState3[1];
2901
2993
 
2902
- var _useState4 = React.useState((_props$initialState$i = (_props$initialState3 = props.initialState) == null ? void 0 : _props$initialState3.isDensePadding) != null ? _props$initialState$i : false),
2994
+ var _useState4 = React.useState((_initialState$isDense = initialState == null ? void 0 : initialState.isDensePadding) != null ? _initialState$isDense : false),
2903
2995
  isDensePadding = _useState4[0],
2904
2996
  setIsDensePadding = _useState4[1];
2905
2997
 
2906
- var _useState5 = React.useState((_props$initialState$i2 = (_props$initialState4 = props.initialState) == null ? void 0 : _props$initialState4.isFullScreen) != null ? _props$initialState$i2 : false),
2998
+ var _useState5 = React.useState((_initialState$isFullS = initialState == null ? void 0 : initialState.isFullScreen) != null ? _initialState$isFullS : false),
2907
2999
  isFullScreen = _useState5[0],
2908
3000
  setIsFullScreen = _useState5[1];
2909
3001
 
2910
- var _useState6 = React.useState((_props$initialState$s = (_props$initialState5 = props.initialState) == null ? void 0 : _props$initialState5.showFilters) != null ? _props$initialState$s : false),
3002
+ var _useState6 = React.useState((_initialState$showFil = initialState == null ? void 0 : initialState.showFilters) != null ? _initialState$showFil : false),
2911
3003
  showFilters = _useState6[0],
2912
3004
  setShowFilters = _useState6[1];
2913
3005
 
2914
- var _useState7 = React.useState((_props$initialState$s2 = (_props$initialState6 = props.initialState) == null ? void 0 : _props$initialState6.showGlobalFilter) != null ? _props$initialState$s2 : false),
3006
+ var _useState7 = React.useState((_initialState$showGlo = initialState == null ? void 0 : initialState.showGlobalFilter) != null ? _initialState$showGlo : false),
2915
3007
  showGlobalFilter = _useState7[0],
2916
3008
  setShowGlobalFilter = _useState7[1];
2917
3009
 
2918
3010
  var _useState8 = React.useState({
2919
- 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,
2920
- 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,
2921
- 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
3011
+ pageIndex: (_initialState$paginat = initialState == null ? void 0 : (_initialState$paginat2 = initialState.pagination) == null ? void 0 : _initialState$paginat2.pageIndex) != null ? _initialState$paginat : 0,
3012
+ pageSize: (_initialState$paginat3 = initialState == null ? void 0 : (_initialState$paginat4 = initialState.pagination) == null ? void 0 : _initialState$paginat4.pageSize) != null ? _initialState$paginat3 : 10,
3013
+ pageCount: (_initialState$paginat5 = initialState == null ? void 0 : (_initialState$paginat6 = initialState.pagination) == null ? void 0 : _initialState$paginat6.pageCount) != null ? _initialState$paginat5 : -1
2922
3014
  }),
2923
3015
  pagination = _useState8[0],
2924
3016
  setPagination = _useState8[1];
2925
3017
 
2926
3018
  var _useState9 = React.useState(function () {
2927
3019
  return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (c) {
2928
- var _ref, _c$filter, _props$initialState10, _props$initialState11, _c$filterSelectOption, _ref2;
3020
+ var _ref, _c$filterFn, _initialState$current3, _c$filterSelectOption, _ref2;
2929
3021
 
2930
- 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) {
2931
- return cf.id === c.id;
2932
- })) != null ? _ref : !!((_c$filterSelectOption = c.filterSelectOptions) != null && _c$filterSelectOption.length) ? MRT_FILTER_TYPE.EQUALS : MRT_FILTER_TYPE.BEST_MATCH, _ref2;
3022
+ 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;
2933
3023
  })));
2934
3024
  }),
2935
- currentFilterTypes = _useState9[0],
2936
- setCurrentFilterTypes = _useState9[1];
3025
+ currentFilterFns = _useState9[0],
3026
+ setCurrentFilterFns = _useState9[1];
2937
3027
 
2938
- var _useState10 = React.useState((_props$globalFilterTy = props.globalFilterType) != null ? _props$globalFilterTy : MRT_FILTER_TYPE.BEST_MATCH_FIRST),
2939
- currentGlobalFilterType = _useState10[0],
2940
- setCurrentGlobalFilterType = _useState10[1];
3028
+ var _useState10 = React.useState((_props$globalFilterFn = props.globalFilterFn) != null ? _props$globalFilterFn : MRT_FILTER_OPTION.BEST_MATCH_FIRST),
3029
+ currentGlobalFilterFn = _useState10[0],
3030
+ setCurrentGlobalFilterFn = _useState10[1];
2941
3031
 
2942
3032
  var table = React.useMemo(function () {
2943
3033
  return reactTable.createTable();
@@ -3011,9 +3101,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3011
3101
  }, [props.editingMode, props.enableEditing, props.enableExpandAll, props.enableExpanded, props.enableGrouping, props.enableRowActions, props.enableRowNumbers, props.enableRowSelection, props.enableSelectAll, props.localization, table]);
3012
3102
  var columns = React.useMemo(function () {
3013
3103
  return table.createColumns([].concat(displayColumns, props.columns.map(function (column) {
3014
- return column.columns ? createGroup(table, column, currentFilterTypes) : createDataColumn(table, column, currentFilterTypes);
3104
+ return column.columns ? createGroup(table, column, currentFilterFns) : createDataColumn(table, column, currentFilterFns);
3015
3105
  })));
3016
- }, [table, props.columns, currentFilterTypes]);
3106
+ }, [table, props.columns, currentFilterFns]);
3017
3107
  var data = React.useMemo(function () {
3018
3108
  return props.isLoading && !props.data.length ? [].concat(Array(10).fill(null)).map(function () {
3019
3109
  return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (c) {
@@ -3026,7 +3116,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3026
3116
 
3027
3117
  var tableInstance = _extends({}, reactTable.useTableInstance(table, _extends({
3028
3118
  //@ts-ignore
3029
- filterTypes: defaultFilterFNs,
3119
+ filterFns: defaultFilterFNs,
3030
3120
  getColumnFilteredRowModel: reactTable.getColumnFilteredRowModelSync(),
3031
3121
  getCoreRowModel: reactTable.getCoreRowModelSync(),
3032
3122
  getExpandedRowModel: reactTable.getExpandedRowModel(),
@@ -3037,8 +3127,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3037
3127
  getSubRows: function getSubRows(originalRow) {
3038
3128
  return originalRow.subRows;
3039
3129
  },
3040
- globalFilterType: currentGlobalFilterType,
3041
- idPrefix: idPrefix,
3130
+ globalFilterFn: currentGlobalFilterFn,
3042
3131
  onPaginationChange: function onPaginationChange(updater) {
3043
3132
  return setPagination(function (old) {
3044
3133
  return reactTable.functionalUpdate(updater, old);
@@ -3047,11 +3136,14 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3047
3136
  }, props, {
3048
3137
  columns: columns,
3049
3138
  data: data,
3139
+ idPrefix: idPrefix,
3140
+ //@ts-ignore
3141
+ initialState: initialState,
3050
3142
  state: _extends({
3051
3143
  currentEditingCell: currentEditingCell,
3052
3144
  currentEditingRow: currentEditingRow,
3053
- currentFilterTypes: currentFilterTypes,
3054
- currentGlobalFilterType: currentGlobalFilterType,
3145
+ currentFilterFns: currentFilterFns,
3146
+ currentGlobalFilterFn: currentGlobalFilterFn,
3055
3147
  isDensePadding: isDensePadding,
3056
3148
  isFullScreen: isFullScreen,
3057
3149
  //@ts-ignore
@@ -3064,36 +3156,61 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3064
3156
  setCurrentEditingCell: setCurrentEditingCell,
3065
3157
  //@ts-ignore
3066
3158
  setCurrentEditingRow: setCurrentEditingRow,
3067
- setCurrentFilterTypes: setCurrentFilterTypes,
3068
- setCurrentGlobalFilterType: setCurrentGlobalFilterType,
3159
+ setCurrentFilterFns: setCurrentFilterFns,
3160
+ //@ts-ignore
3161
+ setCurrentGlobalFilterFn: setCurrentGlobalFilterFn,
3069
3162
  setIsDensePadding: setIsDensePadding,
3070
3163
  setIsFullScreen: setIsFullScreen,
3071
3164
  setShowFilters: setShowFilters,
3072
3165
  setShowGlobalFilter: setShowGlobalFilter
3073
3166
  });
3074
3167
 
3168
+ React.useEffect(function () {
3169
+ if (typeof window === 'undefined' || !props.enablePersistentState) {
3170
+ return;
3171
+ }
3172
+
3173
+ if (!props.idPrefix && "development" !== 'production') {
3174
+ console.warn('a unique idPrefix prop is required for persistent table state to work');
3175
+ return;
3176
+ }
3177
+
3178
+ var itemArgs = ["mrt-" + idPrefix + "-table-state", JSON.stringify(tableInstance.getState())];
3179
+
3180
+ if (props.persistentStateMode === 'localStorage') {
3181
+ var _localStorage;
3182
+
3183
+ (_localStorage = localStorage).setItem.apply(_localStorage, itemArgs);
3184
+ } else if (props.persistentStateMode === 'sessionStorage') {
3185
+ var _sessionStorage;
3186
+
3187
+ (_sessionStorage = sessionStorage).setItem.apply(_sessionStorage, itemArgs);
3188
+ }
3189
+ }, [props.enablePersistentState, props.idPrefix, props.persistentStateMode, tableInstance]);
3075
3190
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.Dialog, {
3076
- TransitionComponent: material.Grow,
3077
3191
  PaperComponent: material.Box,
3192
+ TransitionComponent: material.Grow,
3078
3193
  disablePortal: true,
3079
3194
  fullScreen: true,
3080
3195
  keepMounted: false,
3081
3196
  onClose: function onClose() {
3082
- return tableInstance.setIsFullScreen(false);
3197
+ return setIsFullScreen(false);
3083
3198
  },
3084
- open: tableInstance.getState().isFullScreen,
3199
+ open: isFullScreen,
3085
3200
  transitionDuration: 400
3086
3201
  }, React__default.createElement(MRT_TablePaper, {
3087
3202
  tableInstance: tableInstance
3088
- })), !tableInstance.getState().isFullScreen && React__default.createElement(MRT_TablePaper, {
3203
+ })), !isFullScreen && React__default.createElement(MRT_TablePaper, {
3089
3204
  tableInstance: tableInstance
3090
3205
  }));
3091
3206
  };
3092
3207
 
3093
- 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"];
3208
+ 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"];
3094
3209
  var MaterialReactTable = (function (_ref) {
3095
3210
  var _ref$autoResetExpande = _ref.autoResetExpanded,
3096
3211
  autoResetExpanded = _ref$autoResetExpande === void 0 ? false : _ref$autoResetExpande,
3212
+ _ref$autoResetSorting = _ref.autoResetSorting,
3213
+ autoResetSorting = _ref$autoResetSorting === void 0 ? false : _ref$autoResetSorting,
3097
3214
  _ref$columnResizeMode = _ref.columnResizeMode,
3098
3215
  columnResizeMode = _ref$columnResizeMode === void 0 ? 'onEnd' : _ref$columnResizeMode,
3099
3216
  _ref$editingMode = _ref.editingMode,
@@ -3138,6 +3255,8 @@ var MaterialReactTable = (function (_ref) {
3138
3255
  enableToolbarTop = _ref$enableToolbarTop === void 0 ? true : _ref$enableToolbarTop,
3139
3256
  icons = _ref.icons,
3140
3257
  localization = _ref.localization,
3258
+ _ref$persistentStateM = _ref.persistentStateMode,
3259
+ persistentStateMode = _ref$persistentStateM === void 0 ? 'sessionStorage' : _ref$persistentStateM,
3141
3260
  _ref$positionActionsC = _ref.positionActionsColumn,
3142
3261
  positionActionsColumn = _ref$positionActionsC === void 0 ? 'first' : _ref$positionActionsC,
3143
3262
  _ref$positionPaginati = _ref.positionPagination,
@@ -3150,6 +3269,7 @@ var MaterialReactTable = (function (_ref) {
3150
3269
 
3151
3270
  return React__default.createElement(MRT_TableRoot, Object.assign({
3152
3271
  autoResetExpanded: autoResetExpanded,
3272
+ autoResetSorting: autoResetSorting,
3153
3273
  columnResizeMode: columnResizeMode,
3154
3274
  editingMode: editingMode,
3155
3275
  enableColumnActions: enableColumnActions,
@@ -3173,6 +3293,7 @@ var MaterialReactTable = (function (_ref) {
3173
3293
  enableToolbarTop: enableToolbarTop,
3174
3294
  icons: _extends({}, MRT_Default_Icons, icons),
3175
3295
  localization: _extends({}, MRT_DefaultLocalization_EN, localization),
3296
+ persistentStateMode: persistentStateMode,
3176
3297
  positionActionsColumn: positionActionsColumn,
3177
3298
  positionPagination: positionPagination,
3178
3299
  positionToolbarActions: positionToolbarActions,