material-react-table 0.7.4 → 0.7.5

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.
@@ -228,21 +228,21 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
228
228
  }));
229
229
  };
230
230
 
231
- var MRT_FILTER_TYPE;
232
-
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 = {}));
231
+ var MRT_FILTER_OPTION;
232
+
233
+ (function (MRT_FILTER_OPTION) {
234
+ MRT_FILTER_OPTION["BEST_MATCH"] = "bestMatch";
235
+ MRT_FILTER_OPTION["BEST_MATCH_FIRST"] = "bestMatchFirst";
236
+ MRT_FILTER_OPTION["CONTAINS"] = "contains";
237
+ MRT_FILTER_OPTION["EMPTY"] = "empty";
238
+ MRT_FILTER_OPTION["ENDS_WITH"] = "endsWith";
239
+ MRT_FILTER_OPTION["EQUALS"] = "equals";
240
+ MRT_FILTER_OPTION["GREATER_THAN"] = "greaterThan";
241
+ MRT_FILTER_OPTION["LESS_THAN"] = "lessThan";
242
+ MRT_FILTER_OPTION["NOT_EMPTY"] = "notEmpty";
243
+ MRT_FILTER_OPTION["NOT_EQUALS"] = "notEquals";
244
+ MRT_FILTER_OPTION["STARTS_WITH"] = "startsWith";
245
+ })(MRT_FILTER_OPTION || (MRT_FILTER_OPTION = {}));
246
246
 
247
247
  var bestMatchFirst = function bestMatchFirst(rows, columnIds, filterValue) {
248
248
  return matchSorter(rows, filterValue.toString().trim(), {
@@ -380,7 +380,7 @@ var commonMenuItemStyles = {
380
380
  my: 0,
381
381
  alignItems: 'center'
382
382
  };
383
- var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
383
+ var MRT_FilterOptionMenu = function MRT_FilterOptionMenu(_ref) {
384
384
  var anchorEl = _ref.anchorEl,
385
385
  header = _ref.header,
386
386
  onSelect = _ref.onSelect,
@@ -388,97 +388,97 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
388
388
  tableInstance = _ref.tableInstance;
389
389
  var getState = tableInstance.getState,
390
390
  _tableInstance$option = tableInstance.options,
391
- enabledGlobalFilterTypes = _tableInstance$option.enabledGlobalFilterTypes,
391
+ enabledGlobalFilterOptions = _tableInstance$option.enabledGlobalFilterOptions,
392
392
  localization = _tableInstance$option.localization,
393
- setCurrentFilterTypes = tableInstance.setCurrentFilterTypes,
394
- setCurrentGlobalFilterType = tableInstance.setCurrentGlobalFilterType;
393
+ setCurrentFilterFns = tableInstance.setCurrentFilterFns,
394
+ setCurrentGlobalFilterFn = tableInstance.setCurrentGlobalFilterFn;
395
395
 
396
396
  var _getState = getState(),
397
397
  isDensePadding = _getState.isDensePadding,
398
- currentFilterTypes = _getState.currentFilterTypes,
399
- currentGlobalFilterType = _getState.currentGlobalFilterType;
398
+ currentFilterFns = _getState.currentFilterFns,
399
+ currentGlobalFilterFn = _getState.currentGlobalFilterFn;
400
400
 
401
- var filterTypes = useMemo(function () {
401
+ var filterOptions = useMemo(function () {
402
402
  return [{
403
- type: MRT_FILTER_TYPE.BEST_MATCH_FIRST,
403
+ type: MRT_FILTER_OPTION.BEST_MATCH_FIRST,
404
404
  label: localization.filterBestMatchFirst,
405
405
  divider: false,
406
406
  fn: bestMatchFirst
407
407
  }, {
408
- type: MRT_FILTER_TYPE.BEST_MATCH,
408
+ type: MRT_FILTER_OPTION.BEST_MATCH,
409
409
  label: localization.filterBestMatch,
410
410
  divider: !!header,
411
411
  fn: bestMatch
412
412
  }, {
413
- type: MRT_FILTER_TYPE.CONTAINS,
413
+ type: MRT_FILTER_OPTION.CONTAINS,
414
414
  label: localization.filterContains,
415
415
  divider: false,
416
416
  fn: contains
417
417
  }, {
418
- type: MRT_FILTER_TYPE.STARTS_WITH,
418
+ type: MRT_FILTER_OPTION.STARTS_WITH,
419
419
  label: localization.filterStartsWith,
420
420
  divider: false,
421
421
  fn: startsWith
422
422
  }, {
423
- type: MRT_FILTER_TYPE.ENDS_WITH,
423
+ type: MRT_FILTER_OPTION.ENDS_WITH,
424
424
  label: localization.filterEndsWith,
425
425
  divider: true,
426
426
  fn: endsWith
427
427
  }, {
428
- type: MRT_FILTER_TYPE.EQUALS,
428
+ type: MRT_FILTER_OPTION.EQUALS,
429
429
  label: localization.filterEquals,
430
430
  divider: false,
431
431
  fn: equals
432
432
  }, {
433
- type: MRT_FILTER_TYPE.NOT_EQUALS,
433
+ type: MRT_FILTER_OPTION.NOT_EQUALS,
434
434
  label: localization.filterNotEquals,
435
435
  divider: true,
436
436
  fn: notEquals
437
437
  }, {
438
- type: MRT_FILTER_TYPE.GREATER_THAN,
438
+ type: MRT_FILTER_OPTION.GREATER_THAN,
439
439
  label: localization.filterGreaterThan,
440
440
  divider: false,
441
441
  fn: greaterThan
442
442
  }, {
443
- type: MRT_FILTER_TYPE.LESS_THAN,
443
+ type: MRT_FILTER_OPTION.LESS_THAN,
444
444
  label: localization.filterLessThan,
445
445
  divider: true,
446
446
  fn: lessThan
447
447
  }, {
448
- type: MRT_FILTER_TYPE.EMPTY,
448
+ type: MRT_FILTER_OPTION.EMPTY,
449
449
  label: localization.filterEmpty,
450
450
  divider: false,
451
451
  fn: empty
452
452
  }, {
453
- type: MRT_FILTER_TYPE.NOT_EMPTY,
453
+ type: MRT_FILTER_OPTION.NOT_EMPTY,
454
454
  label: localization.filterNotEmpty,
455
455
  divider: false,
456
456
  fn: notEmpty
457
457
  }].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);
458
+ 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
459
  });
460
460
  }, []);
461
461
 
462
462
  var handleSelectFilterType = function handleSelectFilterType(value) {
463
463
  if (header) {
464
- setCurrentFilterTypes(function (prev) {
464
+ setCurrentFilterFns(function (prev) {
465
465
  var _extends2;
466
466
 
467
467
  return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = value, _extends2));
468
468
  });
469
469
 
470
- if ([MRT_FILTER_TYPE.EMPTY, MRT_FILTER_TYPE.NOT_EMPTY].includes(value)) {
470
+ if ([MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(value)) {
471
471
  header.column.setColumnFilterValue(' ');
472
472
  }
473
473
  } else {
474
- setCurrentGlobalFilterType(value);
474
+ setCurrentGlobalFilterFn(value);
475
475
  }
476
476
 
477
477
  setAnchorEl(null);
478
478
  onSelect == null ? void 0 : onSelect();
479
479
  };
480
480
 
481
- var filterType = !!header ? currentFilterTypes[header.id] : currentGlobalFilterType;
481
+ var filterType = !!header ? currentFilterFns[header.id] : currentGlobalFilterFn;
482
482
  return React.createElement(Menu, {
483
483
  anchorEl: anchorEl,
484
484
  anchorOrigin: {
@@ -492,7 +492,7 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
492
492
  MenuListProps: {
493
493
  dense: isDensePadding
494
494
  }
495
- }, filterTypes.map(function (_ref2, index) {
495
+ }, filterOptions.map(function (_ref2, index) {
496
496
  var type = _ref2.type,
497
497
  label = _ref2.label,
498
498
  divider = _ref2.divider,
@@ -836,7 +836,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
836
836
  sx: {
837
837
  p: 0
838
838
  }
839
- }, React.createElement(ArrowRightIcon, null))), React.createElement(MRT_FilterTypeMenu, {
839
+ }, React.createElement(ArrowRightIcon, null))), React.createElement(MRT_FilterOptionMenu, {
840
840
  anchorEl: filterMenuAnchorEl,
841
841
  header: header,
842
842
  key: 2,
@@ -1250,7 +1250,7 @@ var MRT_SearchTextField = function MRT_SearchTextField(_ref) {
1250
1250
  sx: _extends({
1251
1251
  justifySelf: 'end'
1252
1252
  }, textFieldProps == null ? void 0 : textFieldProps.sx)
1253
- })), React.createElement(MRT_FilterTypeMenu, {
1253
+ })), React.createElement(MRT_FilterOptionMenu, {
1254
1254
  anchorEl: anchorEl,
1255
1255
  setAnchorEl: setAnchorEl,
1256
1256
  tableInstance: tableInstance
@@ -1748,11 +1748,11 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1748
1748
  idPrefix = _tableInstance$option.idPrefix,
1749
1749
  localization = _tableInstance$option.localization,
1750
1750
  muiTableHeadCellFilterTextFieldProps = _tableInstance$option.muiTableHeadCellFilterTextFieldProps,
1751
- setCurrentFilterTypes = tableInstance.setCurrentFilterTypes;
1751
+ setCurrentFilterFns = tableInstance.setCurrentFilterFns;
1752
1752
  var column = header.column;
1753
1753
 
1754
1754
  var _getState = getState(),
1755
- currentFilterTypes = _getState.currentFilterTypes;
1755
+ currentFilterFns = _getState.currentFilterFns;
1756
1756
 
1757
1757
  var _useState = useState(null),
1758
1758
  anchorEl = _useState[0],
@@ -1791,10 +1791,10 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1791
1791
  var handleClearFilterChip = function handleClearFilterChip() {
1792
1792
  setFilterValue('');
1793
1793
  column.setColumnFilterValue(undefined);
1794
- setCurrentFilterTypes(function (prev) {
1794
+ setCurrentFilterFns(function (prev) {
1795
1795
  var _extends2;
1796
1796
 
1797
- return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = MRT_FILTER_TYPE.BEST_MATCH, _extends2));
1797
+ return _extends({}, prev, (_extends2 = {}, _extends2[header.id] = MRT_FILTER_OPTION.BEST_MATCH, _extends2));
1798
1798
  });
1799
1799
  };
1800
1800
 
@@ -1806,10 +1806,10 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1806
1806
  }
1807
1807
 
1808
1808
  var filterId = "mrt-" + idPrefix + "-" + header.id + "-filter-text-field";
1809
- var filterType = currentFilterTypes == null ? void 0 : currentFilterTypes[header.id];
1809
+ var filterFn = currentFilterFns == null ? void 0 : currentFilterFns[header.id];
1810
1810
  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))] : '';
1811
+ var filterChipLabel = !(filterFn instanceof Function) && [MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(filterFn) ? //@ts-ignore
1812
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))] : '';
1813
1813
  var filterPlaceholder = (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(column.header));
1814
1814
  return React.createElement(React.Fragment, null, React.createElement(TextField, Object.assign({
1815
1815
  fullWidth: true,
@@ -1824,9 +1824,9 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1824
1824
  },
1825
1825
  helperText: React.createElement("label", {
1826
1826
  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))])),
1827
+ }, filterFn instanceof Function ? (_localization$filterM = localization.filterMode.replace('{filterType}', // @ts-ignore
1828
+ (_localization$ = localization["filter" + (filterFn.name.charAt(0).toUpperCase() + filterFn.name.slice(1))]) != null ? _localization$ : '')) != null ? _localization$filterM : '' : localization.filterMode.replace('{filterType}', // @ts-ignore
1829
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))])),
1830
1830
  FormHelperTextProps: {
1831
1831
  sx: {
1832
1832
  fontSize: '0.6rem',
@@ -1913,7 +1913,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
1913
1913
  key: value,
1914
1914
  value: value
1915
1915
  }, text);
1916
- })), React.createElement(MRT_FilterTypeMenu, {
1916
+ })), React.createElement(MRT_FilterOptionMenu, {
1917
1917
  anchorEl: anchorEl,
1918
1918
  header: header,
1919
1919
  setAnchorEl: setAnchorEl,
@@ -2015,9 +2015,9 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
2015
2015
  var tableCellProps = _extends({}, header.getHeaderProps(), mTableHeadCellProps, mcTableHeadCellProps);
2016
2016
 
2017
2017
  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;
2018
+ var filterFn = (_getState2 = getState()) == null ? void 0 : (_getState2$currentFil = _getState2.currentFilterFns) == null ? void 0 : _getState2$currentFil[header.id];
2019
+ var filterTooltip = !!column.getColumnFilterValue() ? localization.filteringByColumn.replace('{column}', String(column.header)).replace('{filterType}', filterFn instanceof Function ? '' : // @ts-ignore
2020
+ localization["filter" + (filterFn.charAt(0).toUpperCase() + filterFn.slice(1))]).replace('{filterValue}', column.getColumnFilterValue()).replace('" "', '') : localization.showHideFilters;
2021
2021
  var headerElement = (_column$Header = column == null ? void 0 : column.Header == null ? void 0 : column.Header({
2022
2022
  header: header,
2023
2023
  tableInstance: tableInstance
@@ -2851,19 +2851,19 @@ var getAllLeafColumnDefs = function getAllLeafColumnDefs(columns) {
2851
2851
  return !col.columns;
2852
2852
  });
2853
2853
  };
2854
- var createGroup = function createGroup(table, column, currentFilterTypes) {
2854
+ var createGroup = function createGroup(table, column, currentFilterFns) {
2855
2855
  var _column$columns;
2856
2856
 
2857
2857
  return table.createGroup(_extends({}, column, {
2858
2858
  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);
2859
+ return col.columns ? createGroup(table, col, currentFilterFns) : createDataColumn(table, col, currentFilterFns);
2860
2860
  })
2861
2861
  }));
2862
2862
  };
2863
- var createDataColumn = function createDataColumn(table, column, currentFilterTypes) {
2863
+ var createDataColumn = function createDataColumn(table, column, currentFilterFns) {
2864
2864
  return (// @ts-ignore
2865
2865
  table.createDataColumn(column.id, _extends({
2866
- filterFn: currentFilterTypes[column.id] instanceof Function ? currentFilterTypes[column.id] : defaultFilterFNs[currentFilterTypes[column.id]]
2866
+ filterFn: currentFilterFns[column.id] instanceof Function ? currentFilterFns[column.id] : defaultFilterFNs[currentFilterFns[column.id]]
2867
2867
  }, column))
2868
2868
  );
2869
2869
  };
@@ -2872,7 +2872,7 @@ var createDisplayColumn = function createDisplayColumn(table, column) {
2872
2872
  };
2873
2873
 
2874
2874
  var MRT_TableRoot = function MRT_TableRoot(props) {
2875
- 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$globalFilterTy;
2875
+ 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
2876
 
2877
2877
  var _useState = useState(props.idPrefix),
2878
2878
  idPrefix = _useState[0],
@@ -2943,17 +2943,17 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
2943
2943
 
2944
2944
  var _useState9 = useState(function () {
2945
2945
  return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (c) {
2946
- var _ref, _c$filter, _initialState$current3, _c$filterSelectOption, _ref2;
2946
+ var _ref, _c$filterFn, _initialState$current3, _c$filterSelectOption, _ref2;
2947
2947
 
2948
- return _ref2 = {}, _ref2[c.id] = (_ref = (_c$filter = c.filter) != null ? _c$filter : initialState == null ? void 0 : (_initialState$current3 = initialState.currentFilterTypes) == null ? void 0 : _initialState$current3[c.id]) != null ? _ref : !!((_c$filterSelectOption = c.filterSelectOptions) != null && _c$filterSelectOption.length) ? MRT_FILTER_TYPE.EQUALS : MRT_FILTER_TYPE.BEST_MATCH, _ref2;
2948
+ 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;
2949
2949
  })));
2950
2950
  }),
2951
- currentFilterTypes = _useState9[0],
2952
- setCurrentFilterTypes = _useState9[1];
2951
+ currentFilterFns = _useState9[0],
2952
+ setCurrentFilterFns = _useState9[1];
2953
2953
 
2954
- var _useState10 = useState((_props$globalFilterTy = props.globalFilterType) != null ? _props$globalFilterTy : MRT_FILTER_TYPE.BEST_MATCH_FIRST),
2955
- currentGlobalFilterType = _useState10[0],
2956
- setCurrentGlobalFilterType = _useState10[1];
2954
+ var _useState10 = useState((_props$globalFilterFn = props.globalFilterFn) != null ? _props$globalFilterFn : MRT_FILTER_OPTION.BEST_MATCH_FIRST),
2955
+ currentGlobalFilterFn = _useState10[0],
2956
+ setCurrentGlobalFilterFn = _useState10[1];
2957
2957
 
2958
2958
  var table = useMemo(function () {
2959
2959
  return createTable();
@@ -3027,9 +3027,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3027
3027
  }, [props.editingMode, props.enableEditing, props.enableExpandAll, props.enableExpanded, props.enableGrouping, props.enableRowActions, props.enableRowNumbers, props.enableRowSelection, props.enableSelectAll, props.localization, table]);
3028
3028
  var columns = useMemo(function () {
3029
3029
  return table.createColumns([].concat(displayColumns, props.columns.map(function (column) {
3030
- return column.columns ? createGroup(table, column, currentFilterTypes) : createDataColumn(table, column, currentFilterTypes);
3030
+ return column.columns ? createGroup(table, column, currentFilterFns) : createDataColumn(table, column, currentFilterFns);
3031
3031
  })));
3032
- }, [table, props.columns, currentFilterTypes]);
3032
+ }, [table, props.columns, currentFilterFns]);
3033
3033
  var data = useMemo(function () {
3034
3034
  return props.isLoading && !props.data.length ? [].concat(Array(10).fill(null)).map(function () {
3035
3035
  return Object.assign.apply(Object, [{}].concat(getAllLeafColumnDefs(props.columns).map(function (c) {
@@ -3042,7 +3042,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3042
3042
 
3043
3043
  var tableInstance = _extends({}, useTableInstance(table, _extends({
3044
3044
  //@ts-ignore
3045
- filterTypes: defaultFilterFNs,
3045
+ filterFns: defaultFilterFNs,
3046
3046
  getColumnFilteredRowModel: getColumnFilteredRowModelSync(),
3047
3047
  getCoreRowModel: getCoreRowModelSync(),
3048
3048
  getExpandedRowModel: getExpandedRowModel(),
@@ -3053,7 +3053,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3053
3053
  getSubRows: function getSubRows(originalRow) {
3054
3054
  return originalRow.subRows;
3055
3055
  },
3056
- globalFilterType: currentGlobalFilterType,
3056
+ globalFilterFn: currentGlobalFilterFn,
3057
3057
  onPaginationChange: function onPaginationChange(updater) {
3058
3058
  return setPagination(function (old) {
3059
3059
  return functionalUpdate(updater, old);
@@ -3068,8 +3068,8 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3068
3068
  state: _extends({
3069
3069
  currentEditingCell: currentEditingCell,
3070
3070
  currentEditingRow: currentEditingRow,
3071
- currentFilterTypes: currentFilterTypes,
3072
- currentGlobalFilterType: currentGlobalFilterType,
3071
+ currentFilterFns: currentFilterFns,
3072
+ currentGlobalFilterFn: currentGlobalFilterFn,
3073
3073
  isDensePadding: isDensePadding,
3074
3074
  isFullScreen: isFullScreen,
3075
3075
  //@ts-ignore
@@ -3082,8 +3082,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3082
3082
  setCurrentEditingCell: setCurrentEditingCell,
3083
3083
  //@ts-ignore
3084
3084
  setCurrentEditingRow: setCurrentEditingRow,
3085
- setCurrentFilterTypes: setCurrentFilterTypes,
3086
- setCurrentGlobalFilterType: setCurrentGlobalFilterType,
3085
+ setCurrentFilterFns: setCurrentFilterFns,
3086
+ //@ts-ignore
3087
+ setCurrentGlobalFilterFn: setCurrentGlobalFilterFn,
3087
3088
  setIsDensePadding: setIsDensePadding,
3088
3089
  setIsFullScreen: setIsFullScreen,
3089
3090
  setShowFilters: setShowFilters,
@@ -3113,27 +3114,29 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
3113
3114
  }
3114
3115
  }, [props.enablePersistentState, props.idPrefix, props.persistentStateMode, tableInstance]);
3115
3116
  return React.createElement(React.Fragment, null, React.createElement(Dialog, {
3116
- TransitionComponent: Grow,
3117
3117
  PaperComponent: Box,
3118
+ TransitionComponent: Grow,
3118
3119
  disablePortal: true,
3119
3120
  fullScreen: true,
3120
3121
  keepMounted: false,
3121
3122
  onClose: function onClose() {
3122
- return tableInstance.setIsFullScreen(false);
3123
+ return setIsFullScreen(false);
3123
3124
  },
3124
- open: tableInstance.getState().isFullScreen,
3125
+ open: isFullScreen,
3125
3126
  transitionDuration: 400
3126
3127
  }, React.createElement(MRT_TablePaper, {
3127
3128
  tableInstance: tableInstance
3128
- })), !tableInstance.getState().isFullScreen && React.createElement(MRT_TablePaper, {
3129
+ })), !isFullScreen && React.createElement(MRT_TablePaper, {
3129
3130
  tableInstance: tableInstance
3130
3131
  }));
3131
3132
  };
3132
3133
 
3133
- 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", "persistentStateMode", "positionActionsColumn", "positionPagination", "positionToolbarActions", "positionToolbarAlertBanner"];
3134
+ 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"];
3134
3135
  var MaterialReactTable = (function (_ref) {
3135
3136
  var _ref$autoResetExpande = _ref.autoResetExpanded,
3136
3137
  autoResetExpanded = _ref$autoResetExpande === void 0 ? false : _ref$autoResetExpande,
3138
+ _ref$autoResetSorting = _ref.autoResetSorting,
3139
+ autoResetSorting = _ref$autoResetSorting === void 0 ? false : _ref$autoResetSorting,
3137
3140
  _ref$columnResizeMode = _ref.columnResizeMode,
3138
3141
  columnResizeMode = _ref$columnResizeMode === void 0 ? 'onEnd' : _ref$columnResizeMode,
3139
3142
  _ref$editingMode = _ref.editingMode,
@@ -3192,6 +3195,7 @@ var MaterialReactTable = (function (_ref) {
3192
3195
 
3193
3196
  return React.createElement(MRT_TableRoot, Object.assign({
3194
3197
  autoResetExpanded: autoResetExpanded,
3198
+ autoResetSorting: autoResetSorting,
3195
3199
  columnResizeMode: columnResizeMode,
3196
3200
  editingMode: editingMode,
3197
3201
  enableColumnActions: enableColumnActions,