material-react-table 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +2 -0
  2. package/dist/MaterialReactTable.d.ts +144 -128
  3. package/dist/body/MRT_TableBody.d.ts +1 -1
  4. package/dist/body/MRT_TableBodyCell.d.ts +1 -1
  5. package/dist/body/MRT_TableBodyRow.d.ts +1 -1
  6. package/dist/body/MRT_TableDetailPanel.d.ts +1 -1
  7. package/dist/buttons/MRT_ColumnPinningButtons.d.ts +1 -1
  8. package/dist/buttons/MRT_CopyButton.d.ts +1 -1
  9. package/dist/buttons/MRT_EditActionButtons.d.ts +1 -1
  10. package/dist/buttons/MRT_ExpandAllButton.d.ts +1 -1
  11. package/dist/buttons/MRT_ExpandButton.d.ts +1 -1
  12. package/dist/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
  13. package/dist/buttons/MRT_GrabHandleButton.d.ts +1 -1
  14. package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
  15. package/dist/buttons/MRT_ToggleColumnActionMenuButton.d.ts +1 -1
  16. package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
  17. package/dist/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
  18. package/dist/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
  19. package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +1 -1
  20. package/dist/footer/MRT_TableFooter.d.ts +1 -1
  21. package/dist/footer/MRT_TableFooterCell.d.ts +1 -1
  22. package/dist/footer/MRT_TableFooterRow.d.ts +1 -1
  23. package/dist/head/MRT_DraggableTableHeadCell.d.ts +1 -1
  24. package/dist/head/MRT_TableHead.d.ts +1 -1
  25. package/dist/head/MRT_TableHeadCell.d.ts +1 -1
  26. package/dist/head/MRT_TableHeadCellFilterContainer.d.ts +1 -1
  27. package/dist/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  28. package/dist/head/MRT_TableHeadCellResizeHandle.d.ts +1 -1
  29. package/dist/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  30. package/dist/head/MRT_TableHeadRow.d.ts +1 -1
  31. package/dist/inputs/MRT_EditCellTextField.d.ts +1 -1
  32. package/dist/inputs/MRT_FilterRangeFields.d.ts +1 -1
  33. package/dist/inputs/MRT_FilterTextField.d.ts +1 -1
  34. package/dist/inputs/MRT_SearchTextField.d.ts +1 -1
  35. package/dist/inputs/MRT_SelectCheckbox.d.ts +1 -1
  36. package/dist/material-react-table.cjs.development.js +569 -573
  37. package/dist/material-react-table.cjs.development.js.map +1 -1
  38. package/dist/material-react-table.cjs.production.min.js +1 -1
  39. package/dist/material-react-table.cjs.production.min.js.map +1 -1
  40. package/dist/material-react-table.esm.js +569 -573
  41. package/dist/material-react-table.esm.js.map +1 -1
  42. package/dist/menus/MRT_ColumnActionMenu.d.ts +1 -1
  43. package/dist/menus/MRT_FilterOptionMenu.d.ts +1 -1
  44. package/dist/menus/MRT_RowActionMenu.d.ts +1 -1
  45. package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +1 -1
  46. package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  47. package/dist/table/MRT_Table.d.ts +1 -1
  48. package/dist/table/MRT_TableContainer.d.ts +1 -1
  49. package/dist/table/MRT_TablePaper.d.ts +2 -2
  50. package/dist/toolbar/MRT_LinearProgressBar.d.ts +1 -1
  51. package/dist/toolbar/MRT_TablePagination.d.ts +1 -1
  52. package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
  53. package/dist/toolbar/MRT_ToolbarBottom.d.ts +1 -1
  54. package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -1
  55. package/dist/toolbar/MRT_ToolbarTop.d.ts +1 -1
  56. package/dist/utils.d.ts +2 -2
  57. package/package.json +1 -1
  58. package/src/MaterialReactTable.tsx +159 -157
  59. package/src/body/MRT_TableBody.tsx +12 -9
  60. package/src/body/MRT_TableBodyCell.tsx +15 -21
  61. package/src/body/MRT_TableBodyRow.tsx +7 -7
  62. package/src/body/MRT_TableDetailPanel.tsx +14 -11
  63. package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -6
  64. package/src/buttons/MRT_CopyButton.tsx +5 -9
  65. package/src/buttons/MRT_EditActionButtons.tsx +4 -4
  66. package/src/buttons/MRT_ExpandAllButton.tsx +3 -3
  67. package/src/buttons/MRT_ExpandButton.tsx +4 -4
  68. package/src/buttons/MRT_FullScreenToggleButton.tsx +4 -4
  69. package/src/buttons/MRT_GrabHandleButton.tsx +3 -3
  70. package/src/buttons/MRT_ShowHideColumnsButton.tsx +4 -7
  71. package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +6 -6
  72. package/src/buttons/MRT_ToggleDensePaddingButton.tsx +4 -4
  73. package/src/buttons/MRT_ToggleFiltersButton.tsx +4 -7
  74. package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +5 -5
  75. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -9
  76. package/src/footer/MRT_TableFooter.tsx +5 -5
  77. package/src/footer/MRT_TableFooterCell.tsx +6 -6
  78. package/src/footer/MRT_TableFooterRow.tsx +5 -8
  79. package/src/head/MRT_DraggableTableHeadCell.tsx +4 -7
  80. package/src/head/MRT_TableHead.tsx +5 -5
  81. package/src/head/MRT_TableHeadCell.tsx +15 -25
  82. package/src/head/MRT_TableHeadCellFilterContainer.tsx +6 -7
  83. package/src/head/MRT_TableHeadCellFilterLabel.tsx +3 -3
  84. package/src/head/MRT_TableHeadCellResizeHandle.tsx +3 -3
  85. package/src/head/MRT_TableHeadCellSortLabel.tsx +3 -6
  86. package/src/head/MRT_TableHeadRow.tsx +6 -6
  87. package/src/inputs/MRT_EditCellTextField.tsx +10 -10
  88. package/src/inputs/MRT_FilterRangeFields.tsx +5 -13
  89. package/src/inputs/MRT_FilterTextField.tsx +10 -14
  90. package/src/inputs/MRT_SearchTextField.tsx +6 -6
  91. package/src/inputs/MRT_SelectCheckbox.tsx +10 -16
  92. package/src/menus/MRT_ColumnActionMenu.tsx +5 -5
  93. package/src/menus/MRT_FilterOptionMenu.tsx +33 -33
  94. package/src/menus/MRT_RowActionMenu.tsx +4 -4
  95. package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
  96. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +7 -10
  97. package/src/table/MRT_Table.tsx +14 -9
  98. package/src/table/MRT_TableContainer.tsx +16 -12
  99. package/src/table/MRT_TablePaper.tsx +8 -14
  100. package/src/table/MRT_TableRoot.tsx +25 -30
  101. package/src/toolbar/MRT_LinearProgressBar.tsx +4 -7
  102. package/src/toolbar/MRT_TablePagination.tsx +4 -4
  103. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +6 -8
  104. package/src/toolbar/MRT_ToolbarBottom.tsx +8 -8
  105. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +10 -12
  106. package/src/toolbar/MRT_ToolbarTop.tsx +11 -10
  107. package/src/utils.ts +2 -2
  108. package/dist/enums.d.ts +0 -13
  109. package/src/enums.ts +0 -13
@@ -15,20 +15,19 @@ import {
15
15
  TextFieldProps,
16
16
  Tooltip,
17
17
  } from '@mui/material';
18
- import type { MRT_Header, MRT_TableInstance } from '..';
19
18
  import { MRT_FilterOptionMenu } from '../menus/MRT_FilterOptionMenu';
20
- import { MRT_FILTER_OPTION } from '../enums';
19
+ import type { MRT_Header, MRT_TableInstance } from '..';
21
20
 
22
21
  interface Props {
23
22
  header: MRT_Header;
24
23
  inputIndex?: number;
25
- tableInstance: MRT_TableInstance;
24
+ instance: MRT_TableInstance;
26
25
  }
27
26
 
28
27
  export const MRT_FilterTextField: FC<Props> = ({
29
28
  header,
30
29
  inputIndex,
31
- tableInstance,
30
+ instance,
32
31
  }) => {
33
32
  const {
34
33
  getState,
@@ -39,7 +38,7 @@ export const MRT_FilterTextField: FC<Props> = ({
39
38
  muiTableHeadCellFilterTextFieldProps,
40
39
  },
41
40
  setCurrentFilterFns,
42
- } = tableInstance;
41
+ } = instance;
43
42
 
44
43
  const { column } = header;
45
44
 
@@ -51,14 +50,14 @@ export const MRT_FilterTextField: FC<Props> = ({
51
50
 
52
51
  const mTableHeadCellFilterTextFieldProps =
53
52
  muiTableHeadCellFilterTextFieldProps instanceof Function
54
- ? muiTableHeadCellFilterTextFieldProps({ column, tableInstance })
53
+ ? muiTableHeadCellFilterTextFieldProps({ column, instance })
55
54
  : muiTableHeadCellFilterTextFieldProps;
56
55
 
57
56
  const mcTableHeadCellFilterTextFieldProps =
58
57
  columnDef.muiTableHeadCellFilterTextFieldProps instanceof Function
59
58
  ? columnDef.muiTableHeadCellFilterTextFieldProps({
60
59
  column,
61
- tableInstance,
60
+ instance,
62
61
  })
63
62
  : columnDef.muiTableHeadCellFilterTextFieldProps;
64
63
 
@@ -110,12 +109,12 @@ export const MRT_FilterTextField: FC<Props> = ({
110
109
  column.setFilterValue(undefined);
111
110
  setCurrentFilterFns((prev) => ({
112
111
  ...prev,
113
- [header.id]: MRT_FILTER_OPTION.FUZZY,
112
+ [header.id]: 'fuzzy',
114
113
  }));
115
114
  };
116
115
 
117
116
  if (columnDef.Filter) {
118
- return <>{columnDef.Filter?.({ header, tableInstance })}</>;
117
+ return <>{columnDef.Filter?.({ header, instance })}</>;
119
118
  }
120
119
 
121
120
  const filterId = `mrt-${tableId}-${header.id}-filter-text-field${
@@ -124,10 +123,7 @@ export const MRT_FilterTextField: FC<Props> = ({
124
123
  const filterFn = currentFilterFns?.[header.id];
125
124
  const isSelectFilter = !!columnDef.filterSelectOptions;
126
125
  const filterChipLabel =
127
- !(filterFn instanceof Function) &&
128
- [MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(
129
- filterFn as MRT_FILTER_OPTION,
130
- )
126
+ !(filterFn instanceof Function) && ['empty', 'notEmpty'].includes(filterFn)
131
127
  ? //@ts-ignore
132
128
  localization[
133
129
  `filter${filterFn.charAt(0).toUpperCase() + filterFn.slice(1)}`
@@ -292,7 +288,7 @@ export const MRT_FilterTextField: FC<Props> = ({
292
288
  anchorEl={anchorEl}
293
289
  header={header}
294
290
  setAnchorEl={setAnchorEl}
295
- tableInstance={tableInstance}
291
+ instance={instance}
296
292
  />
297
293
  </>
298
294
  );
@@ -17,10 +17,10 @@ import { MRT_FilterOptionMenu } from '../menus/MRT_FilterOptionMenu';
17
17
  import { MRT_TableInstance } from '..';
18
18
 
19
19
  interface Props {
20
- tableInstance: MRT_TableInstance;
20
+ instance: MRT_TableInstance;
21
21
  }
22
22
 
23
- export const MRT_SearchTextField: FC<Props> = ({ tableInstance }) => {
23
+ export const MRT_SearchTextField: FC<Props> = ({ instance }) => {
24
24
  const {
25
25
  getState,
26
26
  setGlobalFilter,
@@ -31,7 +31,7 @@ export const MRT_SearchTextField: FC<Props> = ({ tableInstance }) => {
31
31
  muiSearchTextFieldProps,
32
32
  onMrtGlobalFilterValueChange,
33
33
  },
34
- } = tableInstance;
34
+ } = instance;
35
35
 
36
36
  const { globalFilter, showGlobalFilter } = getState();
37
37
 
@@ -41,7 +41,7 @@ export const MRT_SearchTextField: FC<Props> = ({ tableInstance }) => {
41
41
  const handleChange = useCallback(
42
42
  debounce((event: ChangeEvent<HTMLInputElement>) => {
43
43
  setGlobalFilter(event.target.value ?? undefined);
44
- onMrtGlobalFilterValueChange?.({ event, tableInstance });
44
+ onMrtGlobalFilterValueChange?.({ event, instance });
45
45
  }, 200),
46
46
  [],
47
47
  );
@@ -57,7 +57,7 @@ export const MRT_SearchTextField: FC<Props> = ({ tableInstance }) => {
57
57
 
58
58
  const textFieldProps =
59
59
  muiSearchTextFieldProps instanceof Function
60
- ? muiSearchTextFieldProps({ tableInstance })
60
+ ? muiSearchTextFieldProps({ instance })
61
61
  : muiSearchTextFieldProps;
62
62
 
63
63
  return (
@@ -108,7 +108,7 @@ export const MRT_SearchTextField: FC<Props> = ({ tableInstance }) => {
108
108
  <MRT_FilterOptionMenu
109
109
  anchorEl={anchorEl}
110
110
  setAnchorEl={setAnchorEl}
111
- tableInstance={tableInstance}
111
+ instance={instance}
112
112
  />
113
113
  </Collapse>
114
114
  );
@@ -5,14 +5,10 @@ import type { MRT_Row, MRT_TableInstance } from '..';
5
5
  interface Props {
6
6
  row?: MRT_Row;
7
7
  selectAll?: boolean;
8
- tableInstance: MRT_TableInstance;
8
+ instance: MRT_TableInstance;
9
9
  }
10
10
 
11
- export const MRT_SelectCheckbox: FC<Props> = ({
12
- row,
13
- selectAll,
14
- tableInstance,
15
- }) => {
11
+ export const MRT_SelectCheckbox: FC<Props> = ({ row, selectAll, instance }) => {
16
12
  const {
17
13
  getRowModel,
18
14
  getSelectedRowModel,
@@ -24,21 +20,21 @@ export const MRT_SelectCheckbox: FC<Props> = ({
24
20
  onMrtSelectAllChange,
25
21
  selectAllMode,
26
22
  },
27
- } = tableInstance;
23
+ } = instance;
28
24
 
29
25
  const { isDensePadding } = getState();
30
26
 
31
27
  const handleSelectChange = (event: ChangeEvent<HTMLInputElement>) => {
32
28
  if (selectAll) {
33
29
  if (selectAllMode === 'all') {
34
- tableInstance.getToggleAllRowsSelectedHandler()(event as any);
30
+ instance.getToggleAllRowsSelectedHandler()(event as any);
35
31
  } else if (selectAllMode === 'page') {
36
- tableInstance.getToggleAllPageRowsSelectedHandler()(event as any);
32
+ instance.getToggleAllPageRowsSelectedHandler()(event as any);
37
33
  }
38
34
  onMrtSelectAllChange?.({
39
35
  event,
40
36
  selectedRows: event.target.checked ? getRowModel().flatRows : [],
41
- tableInstance,
37
+ instance,
42
38
  });
43
39
  } else if (row) {
44
40
  row?.getToggleSelectedHandler()(event as any);
@@ -50,14 +46,14 @@ export const MRT_SelectCheckbox: FC<Props> = ({
50
46
  : getSelectedRowModel().flatRows.filter(
51
47
  (selectedRow) => selectedRow.id !== row.id,
52
48
  ),
53
- tableInstance,
49
+ instance,
54
50
  });
55
51
  }
56
52
  };
57
53
 
58
54
  const checkboxProps =
59
55
  muiSelectCheckboxProps instanceof Function
60
- ? muiSelectCheckboxProps({ isSelectAll: !!selectAll, row, tableInstance })
56
+ ? muiSelectCheckboxProps({ isSelectAll: !!selectAll, row, instance })
61
57
  : muiSelectCheckboxProps;
62
58
 
63
59
  return (
@@ -71,13 +67,11 @@ export const MRT_SelectCheckbox: FC<Props> = ({
71
67
  >
72
68
  <Checkbox
73
69
  checked={
74
- selectAll
75
- ? tableInstance.getIsAllRowsSelected()
76
- : row?.getIsSelected()
70
+ selectAll ? instance.getIsAllRowsSelected() : row?.getIsSelected()
77
71
  }
78
72
  indeterminate={
79
73
  selectAll
80
- ? tableInstance.getIsSomeRowsSelected()
74
+ ? instance.getIsSomeRowsSelected()
81
75
  : row?.getIsSomeSelected()
82
76
  }
83
77
  inputProps={{
@@ -20,14 +20,14 @@ interface Props {
20
20
  anchorEl: HTMLElement | null;
21
21
  header: MRT_Header;
22
22
  setAnchorEl: (anchorEl: HTMLElement | null) => void;
23
- tableInstance: MRT_TableInstance;
23
+ instance: MRT_TableInstance;
24
24
  }
25
25
 
26
26
  export const MRT_ColumnActionMenu: FC<Props> = ({
27
27
  anchorEl,
28
28
  header,
29
29
  setAnchorEl,
30
- tableInstance,
30
+ instance,
31
31
  }) => {
32
32
  const {
33
33
  getState,
@@ -56,7 +56,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
56
56
  localization,
57
57
  },
58
58
  setShowFilters,
59
- } = tableInstance;
59
+ } = instance;
60
60
 
61
61
  const { column } = header;
62
62
 
@@ -249,7 +249,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
249
249
  key={2}
250
250
  onSelect={handleFilterByColumn}
251
251
  setAnchorEl={setFilterMenuAnchorEl}
252
- tableInstance={tableInstance}
252
+ instance={instance}
253
253
  />,
254
254
  ]}
255
255
  {enableGrouping &&
@@ -377,7 +377,7 @@ export const MRT_ColumnActionMenu: FC<Props> = ({
377
377
  isSubMenu
378
378
  key={2}
379
379
  setAnchorEl={setShowHideColumnsMenuAnchorEl}
380
- tableInstance={tableInstance}
380
+ instance={instance}
381
381
  />,
382
382
  ]}
383
383
  </Menu>
@@ -1,7 +1,11 @@
1
1
  import React, { FC, useMemo } from 'react';
2
2
  import { Menu, MenuItem } from '@mui/material';
3
- import type { MRT_FilterFn, MRT_Header, MRT_TableInstance } from '..';
4
- import { MRT_FILTER_OPTION } from '../enums';
3
+ import type {
4
+ MRT_FilterFn,
5
+ MRT_FILTER_OPTION,
6
+ MRT_Header,
7
+ MRT_TableInstance,
8
+ } from '..';
5
9
  import {
6
10
  between,
7
11
  contains,
@@ -27,7 +31,7 @@ interface Props {
27
31
  header?: MRT_Header;
28
32
  onSelect?: () => void;
29
33
  setAnchorEl: (anchorEl: HTMLElement | null) => void;
30
- tableInstance: MRT_TableInstance;
34
+ instance: MRT_TableInstance;
31
35
  }
32
36
 
33
37
  export const MRT_FilterOptionMenu: FC<Props> = ({
@@ -35,14 +39,14 @@ export const MRT_FilterOptionMenu: FC<Props> = ({
35
39
  header,
36
40
  onSelect,
37
41
  setAnchorEl,
38
- tableInstance,
42
+ instance,
39
43
  }) => {
40
44
  const {
41
45
  getState,
42
46
  options: { enabledGlobalFilterOptions, localization },
43
47
  setCurrentFilterFns,
44
48
  setCurrentGlobalFilterFn,
45
- } = tableInstance;
49
+ } = instance;
46
50
 
47
51
  const { isDensePadding, currentFilterFns, currentGlobalFilterFn } =
48
52
  getState();
@@ -51,76 +55,71 @@ export const MRT_FilterOptionMenu: FC<Props> = ({
51
55
 
52
56
  const { columnDef } = column ?? {};
53
57
 
54
- const filterOptions: {
55
- option: MRT_FILTER_OPTION;
56
- label: string;
57
- divider: boolean;
58
- fn: Function;
59
- }[] = useMemo(
58
+ const filterOptions = useMemo(
60
59
  () =>
61
60
  [
62
61
  {
63
- option: MRT_FILTER_OPTION.FUZZY,
62
+ option: 'fuzzy',
64
63
  label: localization.filterFuzzy,
65
64
  divider: false,
66
65
  fn: fuzzy,
67
66
  },
68
67
  {
69
- option: MRT_FILTER_OPTION.CONTAINS,
68
+ option: 'contains',
70
69
  label: localization.filterContains,
71
70
  divider: false,
72
71
  fn: contains,
73
72
  },
74
73
  {
75
- option: MRT_FILTER_OPTION.STARTS_WITH,
74
+ option: 'startsWith',
76
75
  label: localization.filterStartsWith,
77
76
  divider: false,
78
77
  fn: startsWith,
79
78
  },
80
79
  {
81
- option: MRT_FILTER_OPTION.ENDS_WITH,
80
+ option: 'endsWith',
82
81
  label: localization.filterEndsWith,
83
82
  divider: true,
84
83
  fn: endsWith,
85
84
  },
86
85
  {
87
- option: MRT_FILTER_OPTION.EQUALS,
86
+ option: 'equals',
88
87
  label: localization.filterEquals,
89
88
  divider: false,
90
89
  fn: equals,
91
90
  },
92
91
  {
93
- option: MRT_FILTER_OPTION.NOT_EQUALS,
92
+ option: 'notEquals',
94
93
  label: localization.filterNotEquals,
95
94
  divider: true,
96
95
  fn: notEquals,
97
96
  },
98
97
  {
99
- option: MRT_FILTER_OPTION.BETWEEN,
98
+ option: 'between',
100
99
  label: localization.filterBetween,
101
100
  divider: false,
102
101
  fn: between,
103
102
  },
104
103
  {
105
- option: MRT_FILTER_OPTION.GREATER_THAN,
104
+ option: 'greaterThan',
106
105
  label: localization.filterGreaterThan,
107
106
  divider: false,
108
107
  fn: greaterThan,
109
108
  },
110
109
  {
111
- option: MRT_FILTER_OPTION.LESS_THAN,
110
+ option: 'lessThan',
112
111
  label: localization.filterLessThan,
113
112
  divider: true,
114
113
  fn: lessThan,
115
114
  },
116
115
  {
117
- option: MRT_FILTER_OPTION.EMPTY,
116
+ option: 'empty',
118
117
  label: localization.filterEmpty,
119
118
  divider: false,
120
119
  fn: empty,
121
120
  },
122
121
  {
123
- option: MRT_FILTER_OPTION.NOT_EMPTY,
122
+ option: 'notEmpty',
124
123
  label: localization.filterNotEmpty,
125
124
  divider: false,
126
125
  fn: notEmpty,
@@ -131,24 +130,25 @@ export const MRT_FilterOptionMenu: FC<Props> = ({
131
130
  columnDef.enabledColumnFilterOptions.includes(filterType.option)
132
131
  : (!enabledGlobalFilterOptions ||
133
132
  enabledGlobalFilterOptions.includes(filterType.option)) &&
134
- [MRT_FILTER_OPTION.FUZZY, MRT_FILTER_OPTION.CONTAINS].includes(
135
- filterType.option,
136
- ),
137
- ),
133
+ ['fuzzy', 'contains'].includes(filterType.option),
134
+ ) as Array<{
135
+ option: MRT_FILTER_OPTION;
136
+ label: string;
137
+ divider: boolean;
138
+ fn: Function;
139
+ }>,
138
140
  [],
139
141
  );
140
142
 
141
- const handleSelectFilterType = (value: MRT_FILTER_OPTION) => {
143
+ const handleSelectFilterType = (value: string) => {
142
144
  if (header && column) {
143
145
  setCurrentFilterFns((prev: { [key: string]: MRT_FilterFn }) => ({
144
146
  ...prev,
145
147
  [header.id]: value,
146
148
  }));
147
- if (
148
- [MRT_FILTER_OPTION.EMPTY, MRT_FILTER_OPTION.NOT_EMPTY].includes(value)
149
- ) {
149
+ if (['empty', 'notEmpty'].includes(value)) {
150
150
  column.setFilterValue(' ');
151
- } else if (value === MRT_FILTER_OPTION.BETWEEN) {
151
+ } else if (value === 'between') {
152
152
  column.setFilterValue(['', '']);
153
153
  } else {
154
154
  column.setFilterValue('');
@@ -178,10 +178,10 @@ export const MRT_FilterOptionMenu: FC<Props> = ({
178
178
  <MenuItem
179
179
  divider={divider}
180
180
  key={index}
181
- onClick={() => handleSelectFilterType(option)}
181
+ onClick={() => handleSelectFilterType(option as string)}
182
182
  selected={option === filterOption || fn === filterOption}
183
183
  sx={commonMenuItemStyles}
184
- value={option}
184
+ value={option as string}
185
185
  >
186
186
  {label}
187
187
  </MenuItem>
@@ -11,7 +11,7 @@ interface Props {
11
11
  handleEdit: () => void;
12
12
  row: MRT_Row;
13
13
  setAnchorEl: (anchorEl: HTMLElement | null) => void;
14
- tableInstance: MRT_TableInstance;
14
+ instance: MRT_TableInstance;
15
15
  }
16
16
 
17
17
  export const MRT_RowActionMenu: FC<Props> = ({
@@ -19,7 +19,7 @@ export const MRT_RowActionMenu: FC<Props> = ({
19
19
  handleEdit,
20
20
  row,
21
21
  setAnchorEl,
22
- tableInstance,
22
+ instance,
23
23
  }) => {
24
24
  const {
25
25
  getState,
@@ -29,7 +29,7 @@ export const MRT_RowActionMenu: FC<Props> = ({
29
29
  localization,
30
30
  renderRowActionMenuItems,
31
31
  },
32
- } = tableInstance;
32
+ } = instance;
33
33
 
34
34
  const { isDensePadding } = getState();
35
35
 
@@ -54,7 +54,7 @@ export const MRT_RowActionMenu: FC<Props> = ({
54
54
  )}
55
55
  {renderRowActionMenuItems?.({
56
56
  row,
57
- tableInstance,
57
+ instance,
58
58
  closeMenu: () => setAnchorEl(null),
59
59
  })}
60
60
  </Menu>
@@ -7,14 +7,14 @@ interface Props {
7
7
  anchorEl: HTMLElement | null;
8
8
  isSubMenu?: boolean;
9
9
  setAnchorEl: (anchorEl: HTMLElement | null) => void;
10
- tableInstance: MRT_TableInstance;
10
+ instance: MRT_TableInstance;
11
11
  }
12
12
 
13
13
  export const MRT_ShowHideColumnsMenu: FC<Props> = ({
14
14
  anchorEl,
15
15
  isSubMenu,
16
16
  setAnchorEl,
17
- tableInstance,
17
+ instance,
18
18
  }) => {
19
19
  const {
20
20
  getAllColumns,
@@ -28,7 +28,7 @@ export const MRT_ShowHideColumnsMenu: FC<Props> = ({
28
28
  getState,
29
29
  toggleAllColumnsVisible,
30
30
  options: { localization, enablePinning, enableColumnOrdering },
31
- } = tableInstance;
31
+ } = instance;
32
32
 
33
33
  const { isDensePadding, columnOrder, columnPinning } = getState();
34
34
 
@@ -88,14 +88,14 @@ export const MRT_ShowHideColumnsMenu: FC<Props> = ({
88
88
  </Button>
89
89
  )}
90
90
  {!isSubMenu && enableColumnOrdering && (
91
- <Button onClick={() => tableInstance.resetColumnOrder()}>
91
+ <Button onClick={() => instance.resetColumnOrder()}>
92
92
  {localization.resetOrder}
93
93
  </Button>
94
94
  )}
95
95
  {!isSubMenu && enablePinning && (
96
96
  <Button
97
97
  disabled={!getIsSomeColumnsPinned()}
98
- onClick={() => tableInstance.resetColumnPinning(true)}
98
+ onClick={() => instance.resetColumnPinning(true)}
99
99
  >
100
100
  {localization.unpinAll}
101
101
  </Button>
@@ -114,7 +114,7 @@ export const MRT_ShowHideColumnsMenu: FC<Props> = ({
114
114
  column={column}
115
115
  isSubMenu={isSubMenu}
116
116
  key={`${index}-${column.id}`}
117
- tableInstance={tableInstance}
117
+ instance={instance}
118
118
  />
119
119
  ))}
120
120
  </Menu>
@@ -10,20 +10,20 @@ interface Props {
10
10
  allColumns: MRT_Column[];
11
11
  column: MRT_Column;
12
12
  isSubMenu?: boolean;
13
- tableInstance: MRT_TableInstance;
13
+ instance: MRT_TableInstance;
14
14
  }
15
15
 
16
16
  export const MRT_ShowHideColumnsMenuItems: FC<Props> = ({
17
17
  allColumns,
18
18
  column,
19
19
  isSubMenu,
20
- tableInstance,
20
+ instance,
21
21
  }) => {
22
22
  const {
23
23
  getState,
24
24
  options: { enableColumnOrdering, onMrtToggleColumnVisibility },
25
25
  setColumnOrder,
26
- } = tableInstance;
26
+ } = instance;
27
27
 
28
28
  const { columnOrder, columnVisibility } = getState();
29
29
 
@@ -59,7 +59,7 @@ export const MRT_ShowHideColumnsMenuItems: FC<Props> = ({
59
59
  onMrtToggleColumnVisibility?.({
60
60
  column,
61
61
  columnVisibility,
62
- tableInstance,
62
+ instance,
63
63
  });
64
64
  };
65
65
 
@@ -89,14 +89,11 @@ export const MRT_ShowHideColumnsMenuItems: FC<Props> = ({
89
89
  !allColumns.some((col) => col.columnDefType === 'group') && (
90
90
  <MRT_GrabHandleButton
91
91
  ref={dragRef as Ref<HTMLButtonElement>}
92
- tableInstance={tableInstance}
92
+ instance={instance}
93
93
  />
94
94
  )}
95
95
  {!isSubMenu && column.getCanPin() && (
96
- <MRT_ColumnPinningButtons
97
- column={column}
98
- tableInstance={tableInstance}
99
- />
96
+ <MRT_ColumnPinningButtons column={column} instance={instance} />
100
97
  )}
101
98
  <FormControlLabel
102
99
  componentsProps={{
@@ -125,7 +122,7 @@ export const MRT_ShowHideColumnsMenuItems: FC<Props> = ({
125
122
  key={`${i}-${c.id}`}
126
123
  column={c}
127
124
  isSubMenu={isSubMenu}
128
- tableInstance={tableInstance}
125
+ instance={instance}
129
126
  />
130
127
  ))}
131
128
  </>
@@ -7,11 +7,12 @@ import { MRT_TableInstance } from '..';
7
7
 
8
8
  interface Props {
9
9
  tableContainerRef: RefObject<HTMLDivElement>;
10
- tableInstance: MRT_TableInstance;
10
+ instance: MRT_TableInstance;
11
11
  }
12
12
 
13
- export const MRT_Table: FC<Props> = ({ tableContainerRef, tableInstance }) => {
13
+ export const MRT_Table: FC<Props> = ({ tableContainerRef, instance }) => {
14
14
  const {
15
+ getState,
15
16
  options: {
16
17
  enableColumnResizing,
17
18
  enableRowVirtualization,
@@ -20,29 +21,33 @@ export const MRT_Table: FC<Props> = ({ tableContainerRef, tableInstance }) => {
20
21
  enableTableHead,
21
22
  muiTableProps,
22
23
  },
23
- } = tableInstance;
24
+ } = instance;
25
+
26
+ const { isFullScreen } = getState();
24
27
 
25
28
  const tableProps =
26
29
  muiTableProps instanceof Function
27
- ? muiTableProps({ tableInstance })
30
+ ? muiTableProps({ instance })
28
31
  : muiTableProps;
29
32
 
30
33
  return (
31
34
  <Table
32
- stickyHeader={enableStickyHeader}
35
+ stickyHeader={
36
+ enableStickyHeader || enableRowVirtualization || isFullScreen
37
+ }
33
38
  {...tableProps}
34
39
  sx={{
35
40
  tableLayout:
36
- enableColumnResizing || enableRowVirtualization ? 'fixed' : undefined,
41
+ enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto',
37
42
  ...tableProps?.sx,
38
43
  }}
39
44
  >
40
- {enableTableHead && <MRT_TableHead tableInstance={tableInstance} />}
45
+ {enableTableHead && <MRT_TableHead instance={instance} />}
41
46
  <MRT_TableBody
42
47
  tableContainerRef={tableContainerRef}
43
- tableInstance={tableInstance}
48
+ instance={instance}
44
49
  />
45
- {enableTableFooter && <MRT_TableFooter tableInstance={tableInstance} />}
50
+ {enableTableFooter && <MRT_TableFooter instance={instance} />}
46
51
  </Table>
47
52
  );
48
53
  };
@@ -7,14 +7,19 @@ const useIsomorphicLayoutEffect =
7
7
  typeof window !== 'undefined' ? useLayoutEffect : useEffect;
8
8
 
9
9
  interface Props {
10
- tableInstance: MRT_TableInstance;
10
+ instance: MRT_TableInstance;
11
11
  }
12
12
 
13
- export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
13
+ export const MRT_TableContainer: FC<Props> = ({ instance }) => {
14
14
  const {
15
15
  getState,
16
- options: { enableStickyHeader, muiTableContainerProps, tableId },
17
- } = tableInstance;
16
+ options: {
17
+ enableStickyHeader,
18
+ enableRowVirtualization,
19
+ muiTableContainerProps,
20
+ tableId,
21
+ },
22
+ } = instance;
18
23
 
19
24
  const { isFullScreen } = getState();
20
25
 
@@ -22,7 +27,7 @@ export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
22
27
 
23
28
  const tableContainerProps =
24
29
  muiTableContainerProps instanceof Function
25
- ? muiTableContainerProps({ tableInstance })
30
+ ? muiTableContainerProps({ instance })
26
31
  : muiTableContainerProps;
27
32
 
28
33
  useIsomorphicLayoutEffect(() => {
@@ -49,9 +54,10 @@ export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
49
54
  ref={tableContainerRef}
50
55
  sx={{
51
56
  maxWidth: '100%',
52
- maxHeight: enableStickyHeader
53
- ? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 2000px)`
54
- : undefined,
57
+ maxHeight:
58
+ enableStickyHeader || enableRowVirtualization
59
+ ? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 9999px)`
60
+ : undefined,
55
61
  overflow: 'auto',
56
62
  ...tableContainerProps?.sx,
57
63
  }}
@@ -59,12 +65,10 @@ export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
59
65
  maxHeight: isFullScreen
60
66
  ? `calc(100vh - ${totalToolbarHeight}px)`
61
67
  : undefined,
68
+ ...tableContainerProps?.style,
62
69
  }}
63
70
  >
64
- <MRT_Table
65
- tableContainerRef={tableContainerRef}
66
- tableInstance={tableInstance}
67
- />
71
+ <MRT_Table tableContainerRef={tableContainerRef} instance={instance} />
68
72
  </TableContainer>
69
73
  );
70
74
  };