material-react-table 0.9.7 → 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 (108) hide show
  1. package/dist/MaterialReactTable.d.ts +133 -129
  2. package/dist/body/MRT_TableBody.d.ts +1 -1
  3. package/dist/body/MRT_TableBodyCell.d.ts +1 -1
  4. package/dist/body/MRT_TableBodyRow.d.ts +1 -1
  5. package/dist/body/MRT_TableDetailPanel.d.ts +1 -1
  6. package/dist/buttons/MRT_ColumnPinningButtons.d.ts +1 -1
  7. package/dist/buttons/MRT_CopyButton.d.ts +1 -1
  8. package/dist/buttons/MRT_EditActionButtons.d.ts +1 -1
  9. package/dist/buttons/MRT_ExpandAllButton.d.ts +1 -1
  10. package/dist/buttons/MRT_ExpandButton.d.ts +1 -1
  11. package/dist/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
  12. package/dist/buttons/MRT_GrabHandleButton.d.ts +1 -1
  13. package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
  14. package/dist/buttons/MRT_ToggleColumnActionMenuButton.d.ts +1 -1
  15. package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
  16. package/dist/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
  17. package/dist/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
  18. package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +1 -1
  19. package/dist/footer/MRT_TableFooter.d.ts +1 -1
  20. package/dist/footer/MRT_TableFooterCell.d.ts +1 -1
  21. package/dist/footer/MRT_TableFooterRow.d.ts +1 -1
  22. package/dist/head/MRT_DraggableTableHeadCell.d.ts +1 -1
  23. package/dist/head/MRT_TableHead.d.ts +1 -1
  24. package/dist/head/MRT_TableHeadCell.d.ts +1 -1
  25. package/dist/head/MRT_TableHeadCellFilterContainer.d.ts +1 -1
  26. package/dist/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
  27. package/dist/head/MRT_TableHeadCellResizeHandle.d.ts +1 -1
  28. package/dist/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
  29. package/dist/head/MRT_TableHeadRow.d.ts +1 -1
  30. package/dist/inputs/MRT_EditCellTextField.d.ts +1 -1
  31. package/dist/inputs/MRT_FilterRangeFields.d.ts +1 -1
  32. package/dist/inputs/MRT_FilterTextField.d.ts +1 -1
  33. package/dist/inputs/MRT_SearchTextField.d.ts +1 -1
  34. package/dist/inputs/MRT_SelectCheckbox.d.ts +1 -1
  35. package/dist/material-react-table.cjs.development.js +526 -538
  36. package/dist/material-react-table.cjs.development.js.map +1 -1
  37. package/dist/material-react-table.cjs.production.min.js +1 -1
  38. package/dist/material-react-table.cjs.production.min.js.map +1 -1
  39. package/dist/material-react-table.esm.js +526 -538
  40. package/dist/material-react-table.esm.js.map +1 -1
  41. package/dist/menus/MRT_ColumnActionMenu.d.ts +1 -1
  42. package/dist/menus/MRT_FilterOptionMenu.d.ts +1 -1
  43. package/dist/menus/MRT_RowActionMenu.d.ts +1 -1
  44. package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +1 -1
  45. package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
  46. package/dist/table/MRT_Table.d.ts +1 -1
  47. package/dist/table/MRT_TableContainer.d.ts +1 -1
  48. package/dist/table/MRT_TablePaper.d.ts +1 -1
  49. package/dist/toolbar/MRT_LinearProgressBar.d.ts +1 -1
  50. package/dist/toolbar/MRT_TablePagination.d.ts +1 -1
  51. package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
  52. package/dist/toolbar/MRT_ToolbarBottom.d.ts +1 -1
  53. package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -1
  54. package/dist/toolbar/MRT_ToolbarTop.d.ts +1 -1
  55. package/dist/utils.d.ts +2 -2
  56. package/package.json +1 -1
  57. package/src/MaterialReactTable.tsx +148 -157
  58. package/src/body/MRT_TableBody.tsx +5 -8
  59. package/src/body/MRT_TableBodyCell.tsx +14 -18
  60. package/src/body/MRT_TableBodyRow.tsx +7 -11
  61. package/src/body/MRT_TableDetailPanel.tsx +12 -10
  62. package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -6
  63. package/src/buttons/MRT_CopyButton.tsx +5 -9
  64. package/src/buttons/MRT_EditActionButtons.tsx +4 -4
  65. package/src/buttons/MRT_ExpandAllButton.tsx +3 -3
  66. package/src/buttons/MRT_ExpandButton.tsx +4 -4
  67. package/src/buttons/MRT_FullScreenToggleButton.tsx +4 -4
  68. package/src/buttons/MRT_GrabHandleButton.tsx +3 -3
  69. package/src/buttons/MRT_ShowHideColumnsButton.tsx +4 -7
  70. package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +6 -6
  71. package/src/buttons/MRT_ToggleDensePaddingButton.tsx +4 -4
  72. package/src/buttons/MRT_ToggleFiltersButton.tsx +4 -7
  73. package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +5 -5
  74. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -9
  75. package/src/footer/MRT_TableFooter.tsx +5 -5
  76. package/src/footer/MRT_TableFooterCell.tsx +6 -6
  77. package/src/footer/MRT_TableFooterRow.tsx +5 -8
  78. package/src/head/MRT_DraggableTableHeadCell.tsx +4 -7
  79. package/src/head/MRT_TableHead.tsx +5 -5
  80. package/src/head/MRT_TableHeadCell.tsx +14 -22
  81. package/src/head/MRT_TableHeadCellFilterContainer.tsx +6 -7
  82. package/src/head/MRT_TableHeadCellFilterLabel.tsx +3 -3
  83. package/src/head/MRT_TableHeadCellResizeHandle.tsx +3 -3
  84. package/src/head/MRT_TableHeadCellSortLabel.tsx +3 -6
  85. package/src/head/MRT_TableHeadRow.tsx +6 -6
  86. package/src/inputs/MRT_EditCellTextField.tsx +10 -10
  87. package/src/inputs/MRT_FilterRangeFields.tsx +5 -13
  88. package/src/inputs/MRT_FilterTextField.tsx +10 -14
  89. package/src/inputs/MRT_SearchTextField.tsx +6 -6
  90. package/src/inputs/MRT_SelectCheckbox.tsx +10 -16
  91. package/src/menus/MRT_ColumnActionMenu.tsx +5 -5
  92. package/src/menus/MRT_FilterOptionMenu.tsx +33 -33
  93. package/src/menus/MRT_RowActionMenu.tsx +4 -4
  94. package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -6
  95. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +7 -10
  96. package/src/table/MRT_Table.tsx +7 -7
  97. package/src/table/MRT_TableContainer.tsx +5 -8
  98. package/src/table/MRT_TablePaper.tsx +7 -9
  99. package/src/table/MRT_TableRoot.tsx +13 -21
  100. package/src/toolbar/MRT_LinearProgressBar.tsx +4 -7
  101. package/src/toolbar/MRT_TablePagination.tsx +4 -4
  102. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +6 -8
  103. package/src/toolbar/MRT_ToolbarBottom.tsx +8 -8
  104. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +10 -12
  105. package/src/toolbar/MRT_ToolbarTop.tsx +10 -10
  106. package/src/utils.ts +2 -2
  107. package/dist/enums.d.ts +0 -13
  108. package/src/enums.ts +0 -13
@@ -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,10 +7,10 @@ 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
15
  getState,
16
16
  options: {
@@ -21,13 +21,13 @@ export const MRT_Table: FC<Props> = ({ tableContainerRef, tableInstance }) => {
21
21
  enableTableHead,
22
22
  muiTableProps,
23
23
  },
24
- } = tableInstance;
24
+ } = instance;
25
25
 
26
26
  const { isFullScreen } = getState();
27
27
 
28
28
  const tableProps =
29
29
  muiTableProps instanceof Function
30
- ? muiTableProps({ tableInstance })
30
+ ? muiTableProps({ instance })
31
31
  : muiTableProps;
32
32
 
33
33
  return (
@@ -42,12 +42,12 @@ export const MRT_Table: FC<Props> = ({ tableContainerRef, tableInstance }) => {
42
42
  ...tableProps?.sx,
43
43
  }}
44
44
  >
45
- {enableTableHead && <MRT_TableHead tableInstance={tableInstance} />}
45
+ {enableTableHead && <MRT_TableHead instance={instance} />}
46
46
  <MRT_TableBody
47
47
  tableContainerRef={tableContainerRef}
48
- tableInstance={tableInstance}
48
+ instance={instance}
49
49
  />
50
- {enableTableFooter && <MRT_TableFooter tableInstance={tableInstance} />}
50
+ {enableTableFooter && <MRT_TableFooter instance={instance} />}
51
51
  </Table>
52
52
  );
53
53
  };
@@ -7,10 +7,10 @@ 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
16
  options: {
@@ -19,7 +19,7 @@ export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
19
19
  muiTableContainerProps,
20
20
  tableId,
21
21
  },
22
- } = tableInstance;
22
+ } = instance;
23
23
 
24
24
  const { isFullScreen } = getState();
25
25
 
@@ -27,7 +27,7 @@ export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
27
27
 
28
28
  const tableContainerProps =
29
29
  muiTableContainerProps instanceof Function
30
- ? muiTableContainerProps({ tableInstance })
30
+ ? muiTableContainerProps({ instance })
31
31
  : muiTableContainerProps;
32
32
 
33
33
  useIsomorphicLayoutEffect(() => {
@@ -68,10 +68,7 @@ export const MRT_TableContainer: FC<Props> = ({ tableInstance }) => {
68
68
  ...tableContainerProps?.style,
69
69
  }}
70
70
  >
71
- <MRT_Table
72
- tableContainerRef={tableContainerRef}
73
- tableInstance={tableInstance}
74
- />
71
+ <MRT_Table tableContainerRef={tableContainerRef} instance={instance} />
75
72
  </TableContainer>
76
73
  );
77
74
  };
@@ -8,14 +8,14 @@ import { MRT_TableContainer } from './MRT_TableContainer';
8
8
  import type { MRT_TableInstance } from '..';
9
9
 
10
10
  interface Props {
11
- tableInstance: MRT_TableInstance;
11
+ instance: MRT_TableInstance;
12
12
  }
13
13
 
14
- export const MRT_TablePaper: FC<Props> = ({ tableInstance }) => {
14
+ export const MRT_TablePaper: FC<Props> = ({ instance }) => {
15
15
  const {
16
16
  getState,
17
17
  options: { enableToolbarBottom, enableToolbarTop, muiTablePaperProps },
18
- } = tableInstance;
18
+ } = instance;
19
19
 
20
20
  const { isFullScreen } = getState();
21
21
 
@@ -31,7 +31,7 @@ export const MRT_TablePaper: FC<Props> = ({ tableInstance }) => {
31
31
 
32
32
  const tablePaperProps =
33
33
  muiTablePaperProps instanceof Function
34
- ? muiTablePaperProps({ tableInstance })
34
+ ? muiTablePaperProps({ instance })
35
35
  : muiTablePaperProps;
36
36
 
37
37
  return (
@@ -50,11 +50,9 @@ export const MRT_TablePaper: FC<Props> = ({ tableInstance }) => {
50
50
  width: isFullScreen ? '100vw' : undefined,
51
51
  }}
52
52
  >
53
- {enableToolbarTop && <MRT_ToolbarTop tableInstance={tableInstance} />}
54
- <MRT_TableContainer tableInstance={tableInstance} />
55
- {enableToolbarBottom && (
56
- <MRT_ToolbarBottom tableInstance={tableInstance} />
57
- )}
53
+ {enableToolbarTop && <MRT_ToolbarTop instance={instance} />}
54
+ <MRT_TableContainer instance={instance} />
55
+ {enableToolbarBottom && <MRT_ToolbarBottom instance={instance} />}
58
56
  </Paper>
59
57
  </DndProvider>
60
58
  );