material-react-table 0.6.3 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,8 +31,9 @@ export declare type MRT_ColumnInterface<D extends {} = {}> = ColumnInterface<D>
31
31
  Header?: string;
32
32
  accessor?: string;
33
33
  columns?: MRT_ColumnInterface<D>[];
34
+ disableEditing?: boolean;
34
35
  disableFilters?: boolean;
35
- editable?: boolean;
36
+ disableCellCopyButton?: boolean;
36
37
  filter?: MRT_FilterType | string | FilterType<D>;
37
38
  filterSelectOptions?: (string | {
38
39
  text: string;
@@ -78,6 +79,7 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
78
79
  disableFullScreenToggle?: boolean;
79
80
  disableSelectAll?: boolean;
80
81
  disableSubRowTree?: boolean;
82
+ enableCellCopyButtons?: boolean;
81
83
  enableColumnGrouping?: boolean;
82
84
  enableColumnResizing?: boolean;
83
85
  enableRowActions?: boolean;
@@ -119,7 +121,7 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
119
121
  muiTableToolbarBottomProps?: ToolbarProps | ((tableInstance: MRT_TableInstance<D>) => ToolbarProps);
120
122
  muiTableToolbarTopProps?: ToolbarProps | ((tableInstance: MRT_TableInstance<D>) => ToolbarProps);
121
123
  onCellClick?: (event: MouseEvent<HTMLTableCellElement>, cell: MRT_Cell<D>) => void;
122
- onColumnHide?: (column: Column<D>, visibleColumns: Column<D>[]) => void;
124
+ onColumnHide?: (column: Column<D>, hiddenColumns?: string[]) => void;
123
125
  onDetailPanelClick?: (event: MouseEvent<HTMLTableCellElement>, row: Row<D>) => void;
124
126
  onGlobalFilterChange?: (event: ChangeEvent<HTMLInputElement>) => void;
125
127
  onRowClick?: (event: MouseEvent<HTMLTableRowElement>, row: Row<D>) => void;
@@ -143,5 +145,5 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
143
145
  MRT_FullScreenToggleButton: FC<IconButtonProps>;
144
146
  }) => ReactNode;
145
147
  };
146
- declare const _default: <D extends {}>({ defaultColumn, filterTypes, globalFilter, icons, localization, positionActionsColumn, positionPagination, positionToolbarActions, positionToolbarAlertBanner, ...rest }: MaterialReactTableProps<D>) => JSX.Element;
148
+ declare const _default: <D extends {} = {}>({ defaultColumn, filterTypes, globalFilter, icons, localization, positionActionsColumn, positionPagination, positionToolbarActions, positionToolbarAlertBanner, ...rest }: MaterialReactTableProps<D>) => JSX.Element;
147
149
  export default _default;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { MRT_Cell } from '..';
3
+ interface Props {
4
+ cell: MRT_Cell;
5
+ }
6
+ export declare const MRT_CopyButton: FC<Props>;
7
+ export {};
@@ -1,41 +1,41 @@
1
1
  import { MRT_Row } from '.';
2
- export declare const fuzzyFilterFN: {
2
+ export declare const fuzzy: {
3
3
  (rows: MRT_Row[], columnIds: string[] | string, filterValue: string | number): MRT_Row<{}>[];
4
4
  autoRemove(val: any): boolean;
5
5
  };
6
- export declare const containsFilterFN: {
6
+ export declare const contains: {
7
7
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
8
8
  autoRemove(val: any): boolean;
9
9
  };
10
- export declare const startsWithFilterFN: {
10
+ export declare const startsWith: {
11
11
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
12
12
  autoRemove(val: any): boolean;
13
13
  };
14
- export declare const endsWithFilterFN: {
14
+ export declare const endsWith: {
15
15
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
16
16
  autoRemove(val: any): boolean;
17
17
  };
18
- export declare const equalsFilterFN: {
18
+ export declare const equals: {
19
19
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
20
20
  autoRemove(val: any): boolean;
21
21
  };
22
- export declare const notEqualsFilterFN: {
22
+ export declare const notEquals: {
23
23
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
24
24
  autoRemove(val: any): boolean;
25
25
  };
26
- export declare const greaterThanFilterFN: {
26
+ export declare const greaterThan: {
27
27
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
28
28
  autoRemove(val: any): boolean;
29
29
  };
30
- export declare const lessThanFilterFN: {
30
+ export declare const lessThan: {
31
31
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
32
32
  autoRemove(val: any): boolean;
33
33
  };
34
- export declare const emptyFilterFN: {
34
+ export declare const empty: {
35
35
  (rows: MRT_Row[], id: string, _filterValue: string | number): MRT_Row<{}>[];
36
36
  autoRemove(val: any): boolean;
37
37
  };
38
- export declare const notEmptyFilterFN: {
38
+ export declare const notEmpty: {
39
39
  (rows: MRT_Row[], id: string, _filterValue: string | number): MRT_Row<{}>[];
40
40
  autoRemove(val: any): boolean;
41
41
  };
package/dist/icons.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  export interface MRT_Icons {
2
2
  ArrowRightIcon: any;
3
3
  CancelIcon: any;
4
+ CheckBoxIcon: any;
4
5
  ClearAllIcon: any;
5
6
  CloseIcon: any;
7
+ ContentCopyIcon: any;
6
8
  DensityMediumIcon: any;
7
9
  DensitySmallIcon: any;
8
10
  DoubleArrowDownIcon: any;
@@ -5,7 +5,9 @@ export interface MRT_Localization {
5
5
  clearFilter: string;
6
6
  clearSearch: string;
7
7
  clearSort: string;
8
+ clickToCopy: string;
8
9
  columnActions: string;
10
+ copiedToClipboard: string;
9
11
  edit: string;
10
12
  expand: string;
11
13
  expandAll: string;
@@ -11,8 +11,10 @@ var material = require('@mui/material');
11
11
  var matchSorter = require('match-sorter');
12
12
  var ArrowRightIcon = _interopDefault(require('@mui/icons-material/ArrowRight'));
13
13
  var CancelIcon = _interopDefault(require('@mui/icons-material/Cancel'));
14
+ var CheckBoxIcon = _interopDefault(require('@mui/icons-material/CheckBox'));
14
15
  var ClearAllIcon = _interopDefault(require('@mui/icons-material/ClearAll'));
15
16
  var CloseIcon = _interopDefault(require('@mui/icons-material/Close'));
17
+ var ContentCopyIcon = _interopDefault(require('@mui/icons-material/ContentCopy'));
16
18
  var DensityMediumIcon = _interopDefault(require('@mui/icons-material/DensityMedium'));
17
19
  var DensitySmallIcon = _interopDefault(require('@mui/icons-material/DensitySmall'));
18
20
  var DoubleArrowDownIcon = _interopDefault(require('@mui/icons-material/KeyboardDoubleArrowDown'));
@@ -190,7 +192,7 @@ var MaterialReactTableProvider = function MaterialReactTableProvider(props) {
190
192
  return applyFiltersToColumns(props.columns);
191
193
  }, [props.columns, applyFiltersToColumns]);
192
194
  var data = React.useMemo(function () {
193
- return !props.isLoading || !!props.data.length ? props.data : [].concat(Array(10)).map(function (_) {
195
+ return !props.isLoading || !!props.data.length ? props.data : [].concat(Array(10).fill(null)).map(function (_) {
194
196
  return Object.assign.apply(Object, [{}].concat(findLowestLevelCols(props.columns).map(function (c) {
195
197
  var _ref3;
196
198
 
@@ -267,7 +269,7 @@ var MRT_FILTER_TYPE;
267
269
  MRT_FILTER_TYPE["STARTS_WITH"] = "startsWith";
268
270
  })(MRT_FILTER_TYPE || (MRT_FILTER_TYPE = {}));
269
271
 
270
- var fuzzyFilterFN = function fuzzyFilterFN(rows, columnIds, filterValue) {
272
+ var fuzzy = function fuzzy(rows, columnIds, filterValue) {
271
273
  return matchSorter.matchSorter(rows, filterValue.toString().trim(), {
272
274
  keys: Array.isArray(columnIds) ? columnIds.map(function (c) {
273
275
  return "values." + c;
@@ -278,111 +280,111 @@ var fuzzyFilterFN = function fuzzyFilterFN(rows, columnIds, filterValue) {
278
280
  });
279
281
  };
280
282
 
281
- fuzzyFilterFN.autoRemove = function (val) {
283
+ fuzzy.autoRemove = function (val) {
282
284
  return !val;
283
285
  };
284
286
 
285
- var containsFilterFN = function containsFilterFN(rows, id, filterValue) {
287
+ var contains = function contains(rows, id, filterValue) {
286
288
  return rows.filter(function (row) {
287
289
  return row.values[id].toString().toLowerCase().trim().includes(filterValue.toString().toLowerCase().trim());
288
290
  });
289
291
  };
290
292
 
291
- containsFilterFN.autoRemove = function (val) {
293
+ contains.autoRemove = function (val) {
292
294
  return !val;
293
295
  };
294
296
 
295
- var startsWithFilterFN = function startsWithFilterFN(rows, id, filterValue) {
297
+ var startsWith = function startsWith(rows, id, filterValue) {
296
298
  return rows.filter(function (row) {
297
299
  return row.values[id].toString().toLowerCase().trim().startsWith(filterValue.toString().toLowerCase().trim());
298
300
  });
299
301
  };
300
302
 
301
- startsWithFilterFN.autoRemove = function (val) {
303
+ startsWith.autoRemove = function (val) {
302
304
  return !val;
303
305
  };
304
306
 
305
- var endsWithFilterFN = function endsWithFilterFN(rows, id, filterValue) {
307
+ var endsWith = function endsWith(rows, id, filterValue) {
306
308
  return rows.filter(function (row) {
307
309
  return row.values[id].toString().toLowerCase().trim().endsWith(filterValue.toString().toLowerCase().trim());
308
310
  });
309
311
  };
310
312
 
311
- endsWithFilterFN.autoRemove = function (val) {
313
+ endsWith.autoRemove = function (val) {
312
314
  return !val;
313
315
  };
314
316
 
315
- var equalsFilterFN = function equalsFilterFN(rows, id, filterValue) {
317
+ var equals = function equals(rows, id, filterValue) {
316
318
  return rows.filter(function (row) {
317
319
  return row.values[id].toString().toLowerCase().trim() === filterValue.toString().toLowerCase().trim();
318
320
  });
319
321
  };
320
322
 
321
- equalsFilterFN.autoRemove = function (val) {
323
+ equals.autoRemove = function (val) {
322
324
  return !val;
323
325
  };
324
326
 
325
- var notEqualsFilterFN = function notEqualsFilterFN(rows, id, filterValue) {
327
+ var notEquals = function notEquals(rows, id, filterValue) {
326
328
  return rows.filter(function (row) {
327
329
  return row.values[id].toString().toLowerCase().trim() !== filterValue.toString().toLowerCase().trim();
328
330
  });
329
331
  };
330
332
 
331
- notEqualsFilterFN.autoRemove = function (val) {
333
+ notEquals.autoRemove = function (val) {
332
334
  return !val;
333
335
  };
334
336
 
335
- var greaterThanFilterFN = function greaterThanFilterFN(rows, id, filterValue) {
337
+ var greaterThan = function greaterThan(rows, id, filterValue) {
336
338
  return rows.filter(function (row) {
337
339
  return !isNaN(+filterValue) && !isNaN(+row.values[id]) ? +row.values[id] > +filterValue : row.values[id].toString().toLowerCase().trim() > filterValue.toString().toLowerCase().trim();
338
340
  });
339
341
  };
340
342
 
341
- greaterThanFilterFN.autoRemove = function (val) {
343
+ greaterThan.autoRemove = function (val) {
342
344
  return !val;
343
345
  };
344
346
 
345
- var lessThanFilterFN = function lessThanFilterFN(rows, id, filterValue) {
347
+ var lessThan = function lessThan(rows, id, filterValue) {
346
348
  return rows.filter(function (row) {
347
349
  return !isNaN(+filterValue) && !isNaN(+row.values[id]) ? +row.values[id] < +filterValue : row.values[id].toString().toLowerCase().trim() < filterValue.toString().toLowerCase().trim();
348
350
  });
349
351
  };
350
352
 
351
- lessThanFilterFN.autoRemove = function (val) {
353
+ lessThan.autoRemove = function (val) {
352
354
  return !val;
353
355
  };
354
356
 
355
- var emptyFilterFN = function emptyFilterFN(rows, id, _filterValue) {
357
+ var empty = function empty(rows, id, _filterValue) {
356
358
  return rows.filter(function (row) {
357
359
  return !row.values[id].toString().toLowerCase().trim();
358
360
  });
359
361
  };
360
362
 
361
- emptyFilterFN.autoRemove = function (val) {
363
+ empty.autoRemove = function (val) {
362
364
  return !val;
363
365
  };
364
366
 
365
- var notEmptyFilterFN = function notEmptyFilterFN(rows, id, _filterValue) {
367
+ var notEmpty = function notEmpty(rows, id, _filterValue) {
366
368
  return rows.filter(function (row) {
367
369
  return !!row.values[id].toString().toLowerCase().trim();
368
370
  });
369
371
  };
370
372
 
371
- notEmptyFilterFN.autoRemove = function (val) {
373
+ notEmpty.autoRemove = function (val) {
372
374
  return !val;
373
375
  };
374
376
 
375
377
  var defaultFilterFNs = {
376
- contains: containsFilterFN,
377
- empty: emptyFilterFN,
378
- endsWith: endsWithFilterFN,
379
- equals: equalsFilterFN,
380
- fuzzy: fuzzyFilterFN,
381
- greaterThan: greaterThanFilterFN,
382
- lessThan: lessThanFilterFN,
383
- notEmpty: notEmptyFilterFN,
384
- notEquals: notEqualsFilterFN,
385
- startsWith: startsWithFilterFN
378
+ contains: contains,
379
+ empty: empty,
380
+ endsWith: endsWith,
381
+ equals: equals,
382
+ fuzzy: fuzzy,
383
+ greaterThan: greaterThan,
384
+ lessThan: lessThan,
385
+ notEmpty: notEmpty,
386
+ notEquals: notEquals,
387
+ startsWith: startsWith
386
388
  };
387
389
 
388
390
  var commonMenuItemStyles = {
@@ -406,53 +408,55 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
406
408
  type: MRT_FILTER_TYPE.FUZZY,
407
409
  label: localization.filterFuzzy,
408
410
  divider: false,
409
- fn: fuzzyFilterFN
411
+ fn: fuzzy
410
412
  }, {
411
413
  type: MRT_FILTER_TYPE.CONTAINS,
412
414
  label: localization.filterContains,
413
415
  divider: true,
414
- fn: containsFilterFN
416
+ fn: contains
415
417
  }, {
416
418
  type: MRT_FILTER_TYPE.STARTS_WITH,
417
419
  label: localization.filterStartsWith,
418
420
  divider: false,
419
- fn: startsWithFilterFN
421
+ fn: startsWith
420
422
  }, {
421
423
  type: MRT_FILTER_TYPE.ENDS_WITH,
422
424
  label: localization.filterEndsWith,
423
425
  divider: true,
424
- fn: endsWithFilterFN
426
+ fn: endsWith
425
427
  }, {
426
428
  type: MRT_FILTER_TYPE.EQUALS,
427
429
  label: localization.filterEquals,
428
430
  divider: false,
429
- fn: equalsFilterFN
431
+ fn: equals
430
432
  }, {
431
433
  type: MRT_FILTER_TYPE.NOT_EQUALS,
432
434
  label: localization.filterNotEquals,
433
435
  divider: true,
434
- fn: notEqualsFilterFN
436
+ fn: notEquals
435
437
  }, {
436
438
  type: MRT_FILTER_TYPE.GREATER_THAN,
437
439
  label: localization.filterGreaterThan,
438
440
  divider: false,
439
- fn: greaterThanFilterFN
441
+ fn: greaterThan
440
442
  }, {
441
443
  type: MRT_FILTER_TYPE.LESS_THAN,
442
444
  label: localization.filterLessThan,
443
445
  divider: true,
444
- fn: lessThanFilterFN
446
+ fn: lessThan
445
447
  }, {
446
448
  type: MRT_FILTER_TYPE.EMPTY,
447
449
  label: localization.filterEmpty,
448
450
  divider: false,
449
- fn: emptyFilterFN
451
+ fn: empty
450
452
  }, {
451
453
  type: MRT_FILTER_TYPE.NOT_EMPTY,
452
454
  label: localization.filterNotEmpty,
453
455
  divider: false,
454
- fn: notEmptyFilterFN
455
- }];
456
+ fn: notEmpty
457
+ }].filter(function (filterType) {
458
+ return !column.filterTypes || column.filterTypes.includes(filterType.type);
459
+ });
456
460
  }, []);
457
461
 
458
462
  var handleSelectFilterType = function handleSelectFilterType(value) {
@@ -503,7 +507,7 @@ var MRT_FilterTypeMenu = function MRT_FilterTypeMenu(_ref) {
503
507
  };
504
508
 
505
509
  var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
506
- var _localization$filterB, _localization$clearFi, _column$filterSelectO;
510
+ var _localization$filterB, _localization$filterM, _localization$, _localization$clearFi, _column$filterSelectO;
507
511
 
508
512
  var column = _ref.column;
509
513
 
@@ -561,6 +565,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
561
565
  }));
562
566
  }
563
567
 
568
+ var filterId = "mrt-" + idPrefix + "-" + column.id + "-filter-text-field";
564
569
  var filterType = tableInstance.state.currentFilterTypes[column.id];
565
570
  var isSelectFilter = !!column.filterSelectOptions;
566
571
  var filterChipLabel = !(filterType instanceof Function) && [MRT_FILTER_TYPE.EMPTY, MRT_FILTER_TYPE.NOT_EMPTY].includes(filterType) ? //@ts-ignore
@@ -568,7 +573,7 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
568
573
  var filterPlaceholder = (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(column.Header));
569
574
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.TextField, Object.assign({
570
575
  fullWidth: true,
571
- id: "mrt-" + idPrefix + "-" + column.id + "-filter-text-field",
576
+ id: filterId,
572
577
  inputProps: {
573
578
  disabled: !!filterChipLabel,
574
579
  sx: {
@@ -577,8 +582,11 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
577
582
  },
578
583
  title: filterPlaceholder
579
584
  },
580
- helperText: filterType instanceof Function ? '' : localization.filterMode.replace('{filterType}', // @ts-ignore
581
- localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))]),
585
+ helperText: React__default.createElement("label", {
586
+ htmlFor: filterId
587
+ }, filterType instanceof Function ? (_localization$filterM = localization.filterMode.replace('{filterType}', // @ts-ignore
588
+ (_localization$ = localization["filter" + (filterType.name.charAt(0).toUpperCase() + filterType.name.slice(1))]) != null ? _localization$ : '')) != null ? _localization$filterM : '' : localization.filterMode.replace('{filterType}', // @ts-ignore
589
+ localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))])),
582
590
  FormHelperTextProps: {
583
591
  sx: {
584
592
  fontSize: '0.6rem',
@@ -686,6 +694,11 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
686
694
 
687
695
  var column = _ref.column,
688
696
  isSubMenu = _ref.isSubMenu;
697
+
698
+ var _useMRT = useMRT(),
699
+ onColumnHide = _useMRT.onColumnHide,
700
+ tableInstance = _useMRT.tableInstance;
701
+
689
702
  var isParentHeader = !!(column != null && (_column$columns = column.columns) != null && _column$columns.length);
690
703
  var allChildColumnsVisible = isParentHeader && !!((_column$columns2 = column.columns) != null && _column$columns2.every(function (childColumn) {
691
704
  return childColumn.isVisible;
@@ -702,6 +715,8 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
702
715
  } else {
703
716
  column.toggleHidden();
704
717
  }
718
+
719
+ onColumnHide == null ? void 0 : onColumnHide(column, tableInstance.state.hiddenColumns);
705
720
  };
706
721
 
707
722
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.MenuItem, {
@@ -784,7 +799,6 @@ var commonMenuItemStyles$1 = {
784
799
  };
785
800
  var commonListItemStyles = {
786
801
  display: 'flex',
787
- gap: '0.75rem',
788
802
  alignItems: 'center'
789
803
  };
790
804
  var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
@@ -893,14 +907,14 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
893
907
  sx: commonMenuItemStyles$1
894
908
  }, React__default.createElement(material.Box, {
895
909
  sx: commonListItemStyles
896
- }, React__default.createElement(ClearAllIcon, null), localization.clearSort)), React__default.createElement(material.MenuItem, {
910
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(ClearAllIcon, null)), localization.clearSort)), React__default.createElement(material.MenuItem, {
897
911
  disabled: column.isSorted && !column.isSortedDesc,
898
912
  key: 1,
899
913
  onClick: handleSortAsc,
900
914
  sx: commonMenuItemStyles$1
901
915
  }, React__default.createElement(material.Box, {
902
916
  sx: commonListItemStyles
903
- }, React__default.createElement(SortIcon, null), (_localization$sortByC = localization.sortByColumnAsc) == null ? void 0 : _localization$sortByC.replace('{column}', String(column.Header)))), React__default.createElement(material.MenuItem, {
917
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, null)), (_localization$sortByC = localization.sortByColumnAsc) == null ? void 0 : _localization$sortByC.replace('{column}', String(column.Header)))), React__default.createElement(material.MenuItem, {
904
918
  divider: !disableFilters || enableColumnGrouping || !disableColumnHiding,
905
919
  key: 2,
906
920
  disabled: column.isSorted && column.isSortedDesc,
@@ -908,25 +922,25 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
908
922
  sx: commonMenuItemStyles$1
909
923
  }, React__default.createElement(material.Box, {
910
924
  sx: commonListItemStyles
911
- }, React__default.createElement(SortIcon, {
925
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(SortIcon, {
912
926
  style: {
913
927
  transform: 'rotate(180deg) scaleX(-1)'
914
928
  }
915
- }), (_localization$sortByC2 = localization.sortByColumnDesc) == null ? void 0 : _localization$sortByC2.replace('{column}', String(column.Header))))], !disableFilters && column.canFilter && [React__default.createElement(material.MenuItem, {
929
+ })), (_localization$sortByC2 = localization.sortByColumnDesc) == null ? void 0 : _localization$sortByC2.replace('{column}', String(column.Header))))], !disableFilters && column.canFilter && [React__default.createElement(material.MenuItem, {
916
930
  disabled: !column.filterValue,
917
931
  key: 0,
918
932
  onClick: handleClearFilter,
919
933
  sx: commonMenuItemStyles$1
920
934
  }, React__default.createElement(material.Box, {
921
935
  sx: commonListItemStyles
922
- }, React__default.createElement(FilterListOffIcon, null), localization.clearFilter)), React__default.createElement(material.MenuItem, {
936
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(FilterListOffIcon, null)), localization.clearFilter)), React__default.createElement(material.MenuItem, {
923
937
  divider: enableColumnGrouping || !disableColumnHiding,
924
938
  key: 1,
925
939
  onClick: handleFilterByColumn,
926
940
  sx: commonMenuItemStyles$1
927
941
  }, React__default.createElement(material.Box, {
928
942
  sx: commonListItemStyles
929
- }, React__default.createElement(FilterListIcon, null), (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(column.Header))), !column.filterSelectOptions && React__default.createElement(material.IconButton, {
943
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(FilterListIcon, null)), (_localization$filterB = localization.filterByColumn) == null ? void 0 : _localization$filterB.replace('{column}', String(column.Header))), !column.filterSelectOptions && React__default.createElement(material.IconButton, {
930
944
  onClick: handleOpenFilterModeMenu,
931
945
  onMouseEnter: handleOpenFilterModeMenu,
932
946
  size: "small",
@@ -946,20 +960,20 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
946
960
  sx: commonMenuItemStyles$1
947
961
  }, React__default.createElement(material.Box, {
948
962
  sx: commonListItemStyles
949
- }, React__default.createElement(DynamicFeedIcon, null), (_localization = localization[column.isGrouped ? 'ungroupByColumn' : 'groupByColumn']) == null ? void 0 : _localization.replace('{column}', String(column.Header))))], !disableColumnHiding && [React__default.createElement(material.MenuItem, {
963
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(DynamicFeedIcon, null)), (_localization = localization[column.isGrouped ? 'ungroupByColumn' : 'groupByColumn']) == null ? void 0 : _localization.replace('{column}', String(column.Header))))], !disableColumnHiding && [React__default.createElement(material.MenuItem, {
950
964
  key: 0,
951
965
  onClick: handleHideColumn,
952
966
  sx: commonMenuItemStyles$1
953
967
  }, React__default.createElement(material.Box, {
954
968
  sx: commonListItemStyles
955
- }, React__default.createElement(VisibilityOffIcon, null), (_localization$hideCol = localization.hideColumn) == null ? void 0 : _localization$hideCol.replace('{column}', String(column.Header)))), React__default.createElement(material.MenuItem, {
969
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(VisibilityOffIcon, null)), (_localization$hideCol = localization.hideColumn) == null ? void 0 : _localization$hideCol.replace('{column}', String(column.Header)))), React__default.createElement(material.MenuItem, {
956
970
  disabled: !((_tableInstance$state$ = tableInstance.state.hiddenColumns) != null && _tableInstance$state$.length),
957
971
  key: 1,
958
972
  onClick: handleShowAllColumns,
959
973
  sx: commonMenuItemStyles$1
960
974
  }, React__default.createElement(material.Box, {
961
975
  sx: commonListItemStyles
962
- }, React__default.createElement(ViewColumnIcon, null), (_localization$showAll = localization.showAllColumns) == null ? void 0 : _localization$showAll.replace('{column}', String(column.Header))), !column.filterSelectOptions && React__default.createElement(material.IconButton, {
976
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(ViewColumnIcon, null)), (_localization$showAll = localization.showAllColumns) == null ? void 0 : _localization$showAll.replace('{column}', String(column.Header))), !column.filterSelectOptions && React__default.createElement(material.IconButton, {
963
977
  onClick: handleOpenShowHideColumnsMenu,
964
978
  onMouseEnter: handleOpenShowHideColumnsMenu,
965
979
  size: "small",
@@ -1164,7 +1178,7 @@ var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
1164
1178
  style: _extends({}, muiTableBodyCellEditTextFieldProps == null ? void 0 : muiTableBodyCellEditTextFieldProps.style, (_cell$column$muiTable = cell.column.muiTableBodyCellEditTextFieldProps) == null ? void 0 : _cell$column$muiTable.style)
1165
1179
  });
1166
1180
 
1167
- if (cell.column.editable && cell.column.Edit) {
1181
+ if (!cell.column.disableEditing && cell.column.Edit) {
1168
1182
  return React__default.createElement(React__default.Fragment, null, cell.column.Edit(_extends({}, textFieldProps, {
1169
1183
  cell: cell
1170
1184
  })));
@@ -1182,6 +1196,52 @@ var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
1182
1196
  }, textFieldProps));
1183
1197
  };
1184
1198
 
1199
+ var MRT_CopyButton = function MRT_CopyButton(_ref) {
1200
+ var cell = _ref.cell;
1201
+
1202
+ var _useMRT = useMRT(),
1203
+ _useMRT$icons = _useMRT.icons,
1204
+ CheckBoxIcon = _useMRT$icons.CheckBoxIcon,
1205
+ ContentCopyIcon = _useMRT$icons.ContentCopyIcon,
1206
+ localization = _useMRT.localization;
1207
+
1208
+ var _useState = React.useState(false),
1209
+ copied = _useState[0],
1210
+ setCopied = _useState[1];
1211
+
1212
+ var handleCopy = function handleCopy(text) {
1213
+ navigator.clipboard.writeText(text);
1214
+ setCopied(true);
1215
+ setTimeout(function () {
1216
+ return setCopied(false);
1217
+ }, 2000);
1218
+ };
1219
+
1220
+ return React__default.createElement(material.Tooltip, {
1221
+ arrow: true,
1222
+ title: copied ? localization.copiedToClipboard : localization.clickToCopy
1223
+ }, React__default.createElement(material.IconButton, {
1224
+ "aria-label": localization.clickToCopy,
1225
+ onClick: function onClick() {
1226
+ return handleCopy(cell.value);
1227
+ },
1228
+ size: "small",
1229
+ sx: {
1230
+ opacity: 0.05,
1231
+ m: '0 0.5rem',
1232
+ transition: 'all 0.2s ease-in-out',
1233
+ '&:hover': {
1234
+ opacity: 1
1235
+ }
1236
+ }
1237
+ }, copied ? React__default.createElement(CheckBoxIcon, {
1238
+ color: "success",
1239
+ fontSize: "small"
1240
+ }) : React__default.createElement(ContentCopyIcon, {
1241
+ fontSize: "small"
1242
+ })));
1243
+ };
1244
+
1185
1245
  var commonTableBodyCellStyles = function commonTableBodyCellStyles(densePadding) {
1186
1246
  return {
1187
1247
  p: densePadding ? '0.5rem' : '1rem',
@@ -1200,6 +1260,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
1200
1260
  var cell = _ref.cell;
1201
1261
 
1202
1262
  var _useMRT = useMRT(),
1263
+ enableCellCopyButtons = _useMRT.enableCellCopyButtons,
1203
1264
  isLoading = _useMRT.isLoading,
1204
1265
  muiTableBodyCellProps = _useMRT.muiTableBodyCellProps,
1205
1266
  muiTableBodyCellSkeletonProps = _useMRT.muiTableBodyCellSkeletonProps,
@@ -1225,9 +1286,15 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
1225
1286
  animation: "wave",
1226
1287
  height: 20,
1227
1288
  width: Math.random() * (120 - 60) + 60
1228
- }, muiTableBodyCellSkeletonProps)) : (currentEditingRow == null ? void 0 : currentEditingRow.id) === cell.row.id ? React__default.createElement(MRT_EditCellTextField, {
1289
+ }, muiTableBodyCellSkeletonProps)) : !cell.column.disableEditing && (currentEditingRow == null ? void 0 : currentEditingRow.id) === cell.row.id ? React__default.createElement(MRT_EditCellTextField, {
1290
+ cell: cell
1291
+ }) : cell.isPlaceholder ? null : cell.isAggregated ? cell.render('Aggregated') : cell.isGrouped ? React__default.createElement("span", null, cell.render('Cell'), " (", cell.row.subRows.length, ")") : enableCellCopyButtons && !cell.column.disableCellCopyButton ? React__default.createElement(material.Box, {
1292
+ sx: {
1293
+ whiteSpace: 'nowrap'
1294
+ }
1295
+ }, cell.render('Cell'), React__default.createElement(MRT_CopyButton, {
1229
1296
  cell: cell
1230
- }) : cell.isPlaceholder ? null : cell.isAggregated ? cell.render('Aggregated') : cell.isGrouped ? React__default.createElement("span", null, cell.render('Cell'), " (", cell.row.subRows.length, ")") : cell.render('Cell'));
1297
+ })) : cell.render('Cell'));
1231
1298
  };
1232
1299
 
1233
1300
  var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
@@ -1421,9 +1488,18 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
1421
1488
  var _useMRT = useMRT(),
1422
1489
  ExpandMoreIcon = _useMRT.icons.ExpandMoreIcon,
1423
1490
  localization = _useMRT.localization,
1491
+ onRowExpandChange = _useMRT.onRowExpandChange,
1424
1492
  renderDetailPanel = _useMRT.renderDetailPanel,
1425
1493
  densePadding = _useMRT.tableInstance.state.densePadding;
1426
1494
 
1495
+ var handleToggleExpand = function handleToggleExpand(event) {
1496
+ var _row$getToggleRowExpa;
1497
+
1498
+ // @ts-ignore
1499
+ (_row$getToggleRowExpa = row.getToggleRowExpandedProps()) == null ? void 0 : _row$getToggleRowExpa.onClick(event);
1500
+ onRowExpandChange == null ? void 0 : onRowExpandChange(event, row);
1501
+ };
1502
+
1427
1503
  return React__default.createElement(material.TableCell, {
1428
1504
  size: "small",
1429
1505
  sx: _extends({}, commonTableBodyButtonCellStyles(densePadding), {
@@ -1434,7 +1510,9 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
1434
1510
  "aria-label": localization.expand,
1435
1511
  disabled: !row.canExpand && !renderDetailPanel,
1436
1512
  title: localization.expand
1437
- }, row.getToggleRowExpandedProps()), React__default.createElement(ExpandMoreIcon, {
1513
+ }, row.getToggleRowExpandedProps(), {
1514
+ onClick: handleToggleExpand
1515
+ }), React__default.createElement(ExpandMoreIcon, {
1438
1516
  style: {
1439
1517
  transform: "rotate(" + (!row.canExpand && !renderDetailPanel ? -90 : row.isExpanded ? -180 : 0) + "deg)",
1440
1518
  transition: 'transform 0.2s'
@@ -1469,7 +1547,9 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
1469
1547
  }, enableRowEditing && React__default.createElement(material.MenuItem, {
1470
1548
  onClick: handleEdit,
1471
1549
  sx: commonMenuItemStyles$1
1472
- }, React__default.createElement(EditIcon, null), localization.edit), (_renderRowActionMenuI = renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems(row, tableInstance, function () {
1550
+ }, React__default.createElement(material.Box, {
1551
+ sx: commonListItemStyles
1552
+ }, React__default.createElement(material.ListItemIcon, null, React__default.createElement(EditIcon, null)), localization.edit)), (_renderRowActionMenuI = renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems(row, tableInstance, function () {
1473
1553
  return setAnchorEl(null);
1474
1554
  })) != null ? _renderRowActionMenuI : null);
1475
1555
  };
@@ -2392,14 +2472,9 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
2392
2472
  hover: true,
2393
2473
  onClick: function onClick(event) {
2394
2474
  return onRowClick == null ? void 0 : onRowClick(event, row);
2395
- }
2396
- }, tableRowProps, {
2397
- sx: function sx(theme) {
2398
- return _extends({
2399
- backgroundColor: row.isSelected ? material.alpha(theme.palette.primary.light, 0.1) : 'transparent'
2400
- }, tableRowProps == null ? void 0 : tableRowProps.sx);
2401
- }
2402
- }), enableRowNumbers && React__default.createElement(material.TableCell, {
2475
+ },
2476
+ selected: row.isSelected
2477
+ }, tableRowProps), enableRowNumbers && React__default.createElement(material.TableCell, {
2403
2478
  sx: _extends({}, commonTableBodyCellStyles(densePadding))
2404
2479
  }, row.index + 1), (enableRowActions || enableRowEditing) && positionActionsColumn === 'first' && React__default.createElement(MRT_ToggleRowActionMenuButton, {
2405
2480
  row: row
@@ -2978,7 +3053,7 @@ var MRT_TableContainer = function MRT_TableContainer() {
2978
3053
  height: fullScreen ? '100%' : undefined,
2979
3054
  left: fullScreen ? '0' : undefined,
2980
3055
  m: fullScreen ? '0' : undefined,
2981
- overflowY: 'hidden',
3056
+ overflowY: !fullScreen ? 'hidden' : undefined,
2982
3057
  position: fullScreen ? 'fixed' : undefined,
2983
3058
  right: fullScreen ? '0' : undefined,
2984
3059
  top: fullScreen ? '0' : undefined,
@@ -3001,7 +3076,9 @@ var MRT_DefaultLocalization_EN = {
3001
3076
  clearFilter: 'Clear filter',
3002
3077
  clearSearch: 'Clear search',
3003
3078
  clearSort: 'Clear sort',
3079
+ clickToCopy: 'Click to copy',
3004
3080
  columnActions: 'Column Actions',
3081
+ copiedToClipboard: 'Copied to clipboard',
3005
3082
  edit: 'Edit',
3006
3083
  expand: 'Expand',
3007
3084
  expandAll: 'Expand all',
@@ -3044,8 +3121,10 @@ var MRT_DefaultLocalization_EN = {
3044
3121
  var MRT_Default_Icons = {
3045
3122
  ArrowRightIcon: ArrowRightIcon,
3046
3123
  CancelIcon: CancelIcon,
3124
+ CheckBoxIcon: CheckBoxIcon,
3047
3125
  ClearAllIcon: ClearAllIcon,
3048
3126
  CloseIcon: CloseIcon,
3127
+ ContentCopyIcon: ContentCopyIcon,
3049
3128
  DensityMediumIcon: DensityMediumIcon,
3050
3129
  DensitySmallIcon: DensitySmallIcon,
3051
3130
  DoubleArrowDownIcon: DoubleArrowDownIcon,