material-react-table 0.40.7 → 0.40.10

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.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Material React Table
2
2
 
3
+ __Built with [Material UI <sup>V5</sup>](https://mui.com) and [TanStack Table <sup>V8</sup>](https://tanstack.com/table/v8)__
4
+
5
+ _Quickly Create React Data Tables with Material Design_
6
+
3
7
  <a href="https://npmjs.com/package/material-react-table" target="_blank">
4
8
  <img alt="" src="https://badgen.net/npm/v/material-react-table?color=blue" />
5
9
  </a>
@@ -19,8 +23,6 @@
19
23
  <img alt="" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" />
20
24
  </a>
21
25
 
22
- ---
23
-
24
26
  ## About
25
27
 
26
28
  > This project is still in alpha, but is expected to enter beta by August 2022, and a stable 1.0 release shortly thereafter.
@@ -36,12 +38,10 @@ View the [Docs Website](https://www.material-react-table.com/)
36
38
 
37
39
  See all [Props and Options](https://www.material-react-table.com/docs/api)
38
40
 
39
- ---
40
-
41
41
  ## Quick Examples
42
42
 
43
43
  - [Basic Table](https://www.material-react-table.com/docs/examples/basic/) (See Default Features)
44
- - [Minimal Table](https://www.material-react-table.com/docs/examples/minimal/) (Turn off Features)
44
+ - [Minimal Table](https://www.material-react-table.com/docs/examples/minimal/) (Turn off Features like Pagination, Sorting, Filtering, and Toolbars)
45
45
  - [Advanced Table](https://www.material-react-table.com/docs/examples/advanced/) (See some of the Advanced Features)
46
46
  - [Aggregation/Grouping](https://www.material-react-table.com/docs/examples/aggregation-and-grouping/) (Aggregation features such as Sum, Average, Count, etc.)
47
47
  - [Data Export Table](https://www.material-react-table.com/docs/examples/data-export/) (Export to CSV, Excel, etc.)
@@ -53,8 +53,6 @@ See all [Props and Options](https://www.material-react-table.com/docs/api)
53
53
 
54
54
  View additional [storybook examples](https://www.material-react-table.dev/)
55
55
 
56
- ---
57
-
58
56
  ## Features (All Features work and are MVP, but are still being polished)
59
57
 
60
58
  _All features can easily be enabled/disabled_
@@ -91,8 +89,6 @@ _All features can easily be enabled/disabled_
91
89
  - [x] Tree Data / Expanding Sub-rows
92
90
  - [x] Virtualization (react-virtual)
93
91
 
94
- ---
95
-
96
92
  ## Getting Started
97
93
 
98
94
  ### Installation
@@ -113,13 +109,11 @@ npm install material-react-table
113
109
 
114
110
  > _`@tanstack/react-table`, `@tanstack/react-virtual`, and `@tanstack/match-sorter-utils`_ are internal dependencies, so you don't need to install them yourself.
115
111
 
116
- ---
117
-
118
112
  ### Usage
119
113
 
120
114
  > Read the full usage docs [here](https://www.material-react-table.com/docs/getting-started/usage/)
121
115
 
122
- ```tsx
116
+ ```jsx
123
117
  import React, { useMemo, useState, useEffect } from 'react';
124
118
  import MaterialReactTable from 'material-react-table';
125
119
 
@@ -178,8 +172,6 @@ export default function App() {
178
172
 
179
173
  _Open in [Code Sandbox](https://codesandbox.io/s/simple-material-react-table-example-t5c3ji)_
180
174
 
181
- ---
182
-
183
175
  ## Contributors
184
176
 
185
177
  <a href="https://github.com/kevinvandy/material-react-table/graphs/contributors">
@@ -130,7 +130,7 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
130
130
  *
131
131
  * @example accessorFn: (row) => row.username
132
132
  */
133
- accessorFn?: (row: TData) => any;
133
+ accessorFn?: (originalRow: TData) => any;
134
134
  /**
135
135
  * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
136
136
  * Specify which key in the row this column should use to access the correct data.
@@ -160,7 +160,7 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
160
160
  filterFn?: MRT_FilterFn<TData>;
161
161
  filterSelectOptions?: (string | {
162
162
  text: string;
163
- value: string;
163
+ value: any;
164
164
  })[];
165
165
  filterVariant?: 'text' | 'select' | 'multi-select' | 'range';
166
166
  /**
@@ -181,9 +181,11 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
181
181
  * @default gets set to the same value as `accessorKey` by default
182
182
  */
183
183
  id?: LiteralUnion<string & keyof TData>;
184
- muiTableBodyCellCopyButtonProps?: ButtonProps | (({ cell, table, }: {
185
- table: MRT_TableInstance<TData>;
184
+ muiTableBodyCellCopyButtonProps?: ButtonProps | (({ cell, column, row, table, }: {
186
185
  cell: MRT_Cell<TData>;
186
+ column: MRT_Column<TData>;
187
+ row: MRT_Row<TData>;
188
+ table: MRT_TableInstance<TData>;
187
189
  }) => ButtonProps);
188
190
  muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ cell, column, row, table, }: {
189
191
  cell: MRT_Cell<TData>;
package/dist/cjs/index.js CHANGED
@@ -256,16 +256,17 @@ const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFil
256
256
  Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
257
257
 
258
258
  const MRT_ExpandAllButton = ({ table }) => {
259
+ var _a;
259
260
  const { getIsAllRowsExpanded, getIsSomeRowsExpanded, getCanSomeRowsExpand, getState, options: { icons: { KeyboardDoubleArrowDownIcon }, localization, muiExpandAllButtonProps, renderDetailPanel, }, toggleAllRowsExpanded, } = table;
260
261
  const { density } = getState();
261
262
  const iconButtonProps = muiExpandAllButtonProps instanceof Function
262
263
  ? muiExpandAllButtonProps({ table })
263
264
  : muiExpandAllButtonProps;
264
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.expandAll },
265
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.expandAll },
265
266
  React__default["default"].createElement("span", null,
266
267
  React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.expandAll, disabled: !getCanSomeRowsExpand() && !renderDetailPanel, onClick: () => toggleAllRowsExpanded(!getIsAllRowsExpanded()) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
267
268
  ? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
268
- : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))) }),
269
+ : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
269
270
  React__default["default"].createElement(KeyboardDoubleArrowDownIcon, { style: {
270
271
  transform: `rotate(${getIsAllRowsExpanded()
271
272
  ? -180
@@ -277,6 +278,7 @@ const MRT_ExpandAllButton = ({ table }) => {
277
278
  };
278
279
 
279
280
  const MRT_ExpandButton = ({ row, table }) => {
281
+ var _a;
280
282
  const { getState, options: { icons: { ExpandMoreIcon }, localization, muiExpandButtonProps, renderDetailPanel, }, } = table;
281
283
  const { density } = getState();
282
284
  const iconButtonProps = muiExpandButtonProps instanceof Function
@@ -288,11 +290,11 @@ const MRT_ExpandButton = ({ row, table }) => {
288
290
  row.toggleExpanded();
289
291
  (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
290
292
  };
291
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.expand },
293
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.expand },
292
294
  React__default["default"].createElement("span", null,
293
295
  React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.expand, disabled: !row.getCanExpand() && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem' }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
294
296
  ? iconButtonProps.sx(theme)
295
- : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))) }),
297
+ : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
296
298
  React__default["default"].createElement(ExpandMoreIcon, { style: {
297
299
  transform: `rotate(${!row.getCanExpand() && !renderDetailPanel
298
300
  ? -90
@@ -472,8 +474,9 @@ const MRT_ColumnPinningButtons = ({ column, table, }) => {
472
474
  };
473
475
 
474
476
  const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table, }) => {
477
+ var _a;
475
478
  const { options: { icons: { DragHandleIcon }, localization, }, } = table;
476
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: localization.move },
479
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.move },
477
480
  React__default["default"].createElement(material.IconButton, Object.assign({ disableRipple: true, draggable: "true", onDragStart: onDragStart, onDragEnd: onDragEnd, size: "small" }, iconButtonProps, { onClick: (e) => {
478
481
  var _a;
479
482
  e.stopPropagation();
@@ -485,7 +488,7 @@ const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table,
485
488
  cursor: 'grabbing',
486
489
  } }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
487
490
  ? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
488
- : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))) }),
491
+ : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
489
492
  React__default["default"].createElement(DragHandleIcon, null))));
490
493
  };
491
494
 
@@ -981,6 +984,7 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
981
984
  };
982
985
 
983
986
  const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
987
+ var _a;
984
988
  const { getState, options: { localization, muiSelectCheckboxProps, muiSelectAllCheckboxProps, selectAllMode, }, } = table;
985
989
  const { density } = getState();
986
990
  const checkboxProps = !row
@@ -990,7 +994,9 @@ const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
990
994
  : muiSelectCheckboxProps instanceof Function
991
995
  ? muiSelectCheckboxProps({ row, table })
992
996
  : muiSelectCheckboxProps;
993
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: selectAll ? localization.toggleSelectAll : localization.toggleSelectRow },
997
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _a !== void 0 ? _a : (selectAll
998
+ ? localization.toggleSelectAll
999
+ : localization.toggleSelectRow) },
994
1000
  React__default["default"].createElement(material.Checkbox, Object.assign({ checked: selectAll ? table.getIsAllRowsSelected() : row === null || row === void 0 ? void 0 : row.getIsSelected(), indeterminate: selectAll ? table.getIsSomeRowsSelected() : row === null || row === void 0 ? void 0 : row.getIsSomeSelected(), inputProps: {
995
1001
  'aria-label': selectAll
996
1002
  ? localization.toggleSelectAll
@@ -1005,7 +1011,7 @@ const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
1005
1011
  (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
1006
1012
  }, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.5rem', width: density === 'compact' ? '1.75rem' : '2.5rem', m: density !== 'compact' ? '-0.4rem' : undefined }, ((checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx) instanceof Function
1007
1013
  ? checkboxProps.sx(theme)
1008
- : checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))) }))));
1014
+ : checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))), title: undefined }))));
1009
1015
  };
1010
1016
 
1011
1017
  const MRT_GlobalFilterTextField = ({ table, }) => {
@@ -1123,17 +1129,19 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
1123
1129
  };
1124
1130
 
1125
1131
  const MRT_FullScreenToggleButton = (_a) => {
1132
+ var _b;
1126
1133
  var { table } = _a, rest = __rest(_a, ["table"]);
1127
1134
  const { getState, options: { icons: { FullscreenExitIcon, FullscreenIcon }, localization, }, setIsFullScreen, } = table;
1128
1135
  const { isFullScreen } = getState();
1129
1136
  const handleToggleFullScreen = () => {
1130
1137
  setIsFullScreen(!isFullScreen);
1131
1138
  };
1132
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.toggleFullScreen },
1133
- React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleFullScreen }, rest), isFullScreen ? React__default["default"].createElement(FullscreenExitIcon, null) : React__default["default"].createElement(FullscreenIcon, null))));
1139
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen },
1140
+ React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleFullScreen }, rest, { title: undefined }), isFullScreen ? React__default["default"].createElement(FullscreenExitIcon, null) : React__default["default"].createElement(FullscreenIcon, null))));
1134
1141
  };
1135
1142
 
1136
1143
  const MRT_ShowHideColumnsButton = (_a) => {
1144
+ var _b;
1137
1145
  var { table } = _a, rest = __rest(_a, ["table"]);
1138
1146
  const { options: { icons: { ViewColumnIcon }, localization, }, } = table;
1139
1147
  const [anchorEl, setAnchorEl] = React.useState(null);
@@ -1141,13 +1149,14 @@ const MRT_ShowHideColumnsButton = (_a) => {
1141
1149
  setAnchorEl(event.currentTarget);
1142
1150
  };
1143
1151
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1144
- React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.showHideColumns },
1145
- React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest),
1152
+ React__default["default"].createElement(material.Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns },
1153
+ React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined }),
1146
1154
  React__default["default"].createElement(ViewColumnIcon, null))),
1147
1155
  React__default["default"].createElement(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table })));
1148
1156
  };
1149
1157
 
1150
1158
  const MRT_ToggleDensePaddingButton = (_a) => {
1159
+ var _b;
1151
1160
  var { table } = _a, rest = __rest(_a, ["table"]);
1152
1161
  const { getState, options: { icons: { DensityLargeIcon, DensityMediumIcon, DensitySmallIcon }, localization, }, setDensity, } = table;
1153
1162
  const { density } = getState();
@@ -1159,22 +1168,24 @@ const MRT_ToggleDensePaddingButton = (_a) => {
1159
1168
  : 'comfortable';
1160
1169
  setDensity(nextDensity);
1161
1170
  };
1162
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.toggleDensity },
1163
- React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest), density === 'compact' ? (React__default["default"].createElement(DensitySmallIcon, null)) : density === 'comfortable' ? (React__default["default"].createElement(DensityMediumIcon, null)) : (React__default["default"].createElement(DensityLargeIcon, null)))));
1171
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity },
1172
+ React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined }), density === 'compact' ? (React__default["default"].createElement(DensitySmallIcon, null)) : density === 'comfortable' ? (React__default["default"].createElement(DensityMediumIcon, null)) : (React__default["default"].createElement(DensityLargeIcon, null)))));
1164
1173
  };
1165
1174
 
1166
1175
  const MRT_ToggleFiltersButton = (_a) => {
1176
+ var _b;
1167
1177
  var { table } = _a, rest = __rest(_a, ["table"]);
1168
1178
  const { getState, options: { icons: { FilterListIcon, FilterListOffIcon }, localization, }, setShowFilters, } = table;
1169
1179
  const { showColumnFilters } = getState();
1170
1180
  const handleToggleShowFilters = () => {
1171
1181
  setShowFilters(!showColumnFilters);
1172
1182
  };
1173
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.showHideFilters },
1174
- React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest), showColumnFilters ? React__default["default"].createElement(FilterListOffIcon, null) : React__default["default"].createElement(FilterListIcon, null))));
1183
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters },
1184
+ React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined }), showColumnFilters ? React__default["default"].createElement(FilterListOffIcon, null) : React__default["default"].createElement(FilterListIcon, null))));
1175
1185
  };
1176
1186
 
1177
1187
  const MRT_ToggleGlobalFilterButton = (_a) => {
1188
+ var _b;
1178
1189
  var { table } = _a, rest = __rest(_a, ["table"]);
1179
1190
  const { getState, options: { icons: { SearchIcon, SearchOffIcon }, localization, }, refs: { searchInputRef }, setShowGlobalFilter, } = table;
1180
1191
  const { showGlobalFilter } = getState();
@@ -1182,8 +1193,8 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
1182
1193
  setShowGlobalFilter(!showGlobalFilter);
1183
1194
  queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
1184
1195
  };
1185
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: localization.showHideSearch },
1186
- React__default["default"].createElement(material.IconButton, Object.assign({ onClick: handleToggleSearch }, rest), showGlobalFilter ? React__default["default"].createElement(SearchOffIcon, null) : React__default["default"].createElement(SearchIcon, null))));
1196
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch },
1197
+ React__default["default"].createElement(material.IconButton, Object.assign({ onClick: handleToggleSearch }, rest, { title: undefined }), showGlobalFilter ? React__default["default"].createElement(SearchOffIcon, null) : React__default["default"].createElement(SearchIcon, null))));
1187
1198
  };
1188
1199
 
1189
1200
  const MRT_ToolbarInternalButtons = ({ table }) => {
@@ -1315,6 +1326,7 @@ const MRT_BottomToolbar = ({ table }) => {
1315
1326
  };
1316
1327
 
1317
1328
  const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
1329
+ var _a;
1318
1330
  const { options: { icons: { MoreVertIcon }, localization, muiTableHeadCellColumnActionsButtonProps, }, } = table;
1319
1331
  const { column } = header;
1320
1332
  const { columnDef } = column;
@@ -1335,12 +1347,12 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
1335
1347
  : columnDef.muiTableHeadCellColumnActionsButtonProps;
1336
1348
  const iconButtonProps = Object.assign(Object.assign({}, mTableHeadCellColumnActionsButtonProps), mcTableHeadCellColumnActionsButtonProps);
1337
1349
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
1338
- React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: localization.columnActions },
1350
+ React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.columnActions },
1339
1351
  React__default["default"].createElement(material.IconButton, Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ height: '2rem', mt: '-0.2rem', opacity: 0.5, transition: 'opacity 0.2s', width: '2rem', '&:hover': {
1340
1352
  opacity: 1,
1341
1353
  } }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
1342
1354
  ? iconButtonProps.sx(theme)
1343
- : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))) }),
1355
+ : iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
1344
1356
  React__default["default"].createElement(MoreVertIcon, null))),
1345
1357
  React__default["default"].createElement(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table })));
1346
1358
  };
@@ -1484,7 +1496,15 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
1484
1496
  displayEmpty: true,
1485
1497
  multiple: isMultiSelectFilter,
1486
1498
  renderValue: isMultiSelectFilter
1487
- ? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (React__default["default"].createElement(material.Box, { sx: { opacity: 0.5 } }, filterPlaceholder)) : (React__default["default"].createElement(material.Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' } }, selected === null || selected === void 0 ? void 0 : selected.map((value) => (React__default["default"].createElement(material.Chip, { key: value, label: value })))))
1499
+ ? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (React__default["default"].createElement(material.Box, { sx: { opacity: 0.5 } }, filterPlaceholder)) : (React__default["default"].createElement(material.Box, { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' } }, selected === null || selected === void 0 ? void 0 : selected.map((value) => {
1500
+ var _a;
1501
+ const selectedValue = (_a = columnDef.filterSelectOptions) === null || _a === void 0 ? void 0 : _a.find((option) => option instanceof Object
1502
+ ? option.value === value
1503
+ : option === value);
1504
+ return (React__default["default"].createElement(material.Chip, { key: value, label: selectedValue instanceof Object
1505
+ ? selectedValue.text
1506
+ : selectedValue }));
1507
+ })))
1488
1508
  : undefined,
1489
1509
  } }, textFieldProps, { inputRef: (inputRef) => {
1490
1510
  filterInputRefs.current[`${column.id}-${rangeFilterIndex !== null && rangeFilterIndex !== void 0 ? rangeFilterIndex : 0}`] =
@@ -1875,6 +1895,7 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
1875
1895
  };
1876
1896
 
1877
1897
  const MRT_CopyButton = ({ cell, children, table, }) => {
1898
+ var _a;
1878
1899
  const { options: { localization, muiTableBodyCellCopyButtonProps }, } = table;
1879
1900
  const { column, row } = cell;
1880
1901
  const { columnDef } = column;
@@ -1891,14 +1912,16 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
1891
1912
  const mcTableBodyCellCopyButtonProps = columnDef.muiTableBodyCellCopyButtonProps instanceof Function
1892
1913
  ? columnDef.muiTableBodyCellCopyButtonProps({
1893
1914
  cell,
1915
+ column,
1916
+ row,
1894
1917
  table,
1895
1918
  })
1896
1919
  : columnDef.muiTableBodyCellCopyButtonProps;
1897
1920
  const buttonProps = Object.assign(Object.assign({}, mTableBodyCellCopyButtonProps), mcTableBodyCellCopyButtonProps);
1898
- return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: copied ? localization.copiedToClipboard : localization.clickToCopy },
1921
+ return (React__default["default"].createElement(material.Tooltip, { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _a !== void 0 ? _a : (copied ? localization.copiedToClipboard : localization.clickToCopy) },
1899
1922
  React__default["default"].createElement(material.Button, Object.assign({ onClick: (e) => handleCopy(e, cell.getValue()), size: "small", type: "button", variant: "text" }, buttonProps, { sx: (theme) => (Object.assign({ backgroundColor: 'transparent', border: 'none', color: 'inherit', cursor: 'copy', fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', m: '-0.25rem', minWidth: 'unset', textAlign: 'inherit', textTransform: 'inherit' }, ((buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx) instanceof Function
1900
1923
  ? buttonProps.sx(theme)
1901
- : buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))) }), children)));
1924
+ : buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))), title: undefined }), children)));
1902
1925
  };
1903
1926
 
1904
1927
  const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table, }) => {
@@ -2162,7 +2185,8 @@ const MRT_TableBody = ({ table, tableContainerRef }) => {
2162
2185
  !Object.values(sorting).some(Boolean)) {
2163
2186
  const rankedRows = getPrePaginationRowModel().rows.sort((a, b) => rankGlobalFuzzy(a, b));
2164
2187
  if (enablePagination) {
2165
- return rankedRows.slice(pagination.pageIndex, pagination.pageSize);
2188
+ const start = pagination.pageIndex * pagination.pageSize;
2189
+ return rankedRows.slice(start, start + pagination.pageSize);
2166
2190
  }
2167
2191
  return rankedRows;
2168
2192
  }
@@ -2175,6 +2199,8 @@ const MRT_TableBody = ({ table, tableContainerRef }) => {
2175
2199
  ? getPrePaginationRowModel().rows
2176
2200
  : getRowModel().rows,
2177
2201
  globalFilter,
2202
+ pagination.pageIndex,
2203
+ pagination.pageSize,
2178
2204
  ]);
2179
2205
  const virtualizer = enableRowVirtualization
2180
2206
  ? reactVirtual.useVirtual(Object.assign({ size: rows.length, parentRef: tableContainerRef, overscan: 15 }, vProps))