material-react-table 0.6.9 → 0.7.0-alpha.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.
Files changed (108) hide show
  1. package/README.md +29 -19
  2. package/dist/MaterialReactTable.d.ts +314 -108
  3. package/dist/body/MRT_TableBody.d.ts +3 -0
  4. package/dist/body/MRT_TableBodyCell.d.ts +2 -11
  5. package/dist/body/MRT_TableBodyRow.d.ts +3 -1
  6. package/dist/body/MRT_TableDetailPanel.d.ts +2 -1
  7. package/dist/buttons/MRT_CopyButton.d.ts +2 -1
  8. package/dist/buttons/MRT_EditActionButtons.d.ts +2 -1
  9. package/dist/buttons/MRT_ExpandAllButton.d.ts +2 -0
  10. package/dist/buttons/MRT_ExpandButton.d.ts +2 -1
  11. package/dist/buttons/MRT_FullScreenToggleButton.d.ts +2 -0
  12. package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +2 -0
  13. package/dist/buttons/MRT_ToggleColumnActionMenuButton.d.ts +3 -2
  14. package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -0
  15. package/dist/buttons/MRT_ToggleFiltersButton.d.ts +2 -0
  16. package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -1
  17. package/dist/buttons/MRT_ToggleSearchButton.d.ts +2 -0
  18. package/dist/enums.d.ts +2 -1
  19. package/dist/filtersFNs.d.ts +13 -5
  20. package/dist/footer/MRT_TableFooter.d.ts +3 -0
  21. package/dist/footer/MRT_TableFooterCell.d.ts +3 -2
  22. package/dist/footer/MRT_TableFooterRow.d.ts +2 -1
  23. package/dist/head/MRT_TableHead.d.ts +3 -0
  24. package/dist/head/MRT_TableHeadCell.d.ts +4 -18
  25. package/dist/head/MRT_TableHeadRow.d.ts +2 -1
  26. package/dist/icons.d.ts +1 -1
  27. package/dist/inputs/MRT_EditCellTextField.d.ts +2 -1
  28. package/dist/inputs/MRT_FilterTextField.d.ts +3 -2
  29. package/dist/inputs/MRT_SearchTextField.d.ts +2 -0
  30. package/dist/inputs/MRT_SelectCheckbox.d.ts +2 -1
  31. package/dist/localization.d.ts +10 -2
  32. package/dist/material-react-table.cjs.development.js +2286 -2459
  33. package/dist/material-react-table.cjs.development.js.map +1 -1
  34. package/dist/material-react-table.cjs.production.min.js +1 -1
  35. package/dist/material-react-table.cjs.production.min.js.map +1 -1
  36. package/dist/material-react-table.esm.js +2288 -2461
  37. package/dist/material-react-table.esm.js.map +1 -1
  38. package/dist/menus/MRT_ColumnActionMenu.d.ts +3 -2
  39. package/dist/menus/MRT_FilterTypeMenu.d.ts +4 -3
  40. package/dist/menus/MRT_RowActionMenu.d.ts +3 -2
  41. package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +2 -0
  42. package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +2 -1
  43. package/dist/table/MRT_Table.d.ts +3 -0
  44. package/dist/table/MRT_TableContainer.d.ts +2 -0
  45. package/dist/table/MRT_TablePaper.d.ts +7 -0
  46. package/dist/table/MRT_TableRoot.d.ts +3 -0
  47. package/dist/toolbar/MRT_LinearProgressBar.d.ts +2 -0
  48. package/dist/toolbar/MRT_TablePagination.d.ts +2 -0
  49. package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +2 -0
  50. package/dist/toolbar/MRT_ToolbarBottom.d.ts +2 -0
  51. package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +2 -0
  52. package/dist/toolbar/MRT_ToolbarTop.d.ts +4 -2
  53. package/dist/utils.d.ts +12 -2
  54. package/package.json +29 -30
  55. package/src/MaterialReactTable.tsx +614 -297
  56. package/src/body/MRT_TableBody.tsx +26 -22
  57. package/src/body/MRT_TableBodyCell.tsx +79 -55
  58. package/src/body/MRT_TableBodyRow.tsx +37 -67
  59. package/src/body/MRT_TableDetailPanel.tsx +21 -17
  60. package/src/buttons/MRT_CopyButton.tsx +34 -10
  61. package/src/buttons/MRT_EditActionButtons.tsx +16 -13
  62. package/src/buttons/MRT_ExpandAllButton.tsx +36 -28
  63. package/src/buttons/MRT_ExpandButton.tsx +35 -41
  64. package/src/buttons/MRT_FullScreenToggleButton.tsx +18 -11
  65. package/src/buttons/MRT_ShowHideColumnsButton.tsx +18 -7
  66. package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +22 -11
  67. package/src/buttons/MRT_ToggleDensePaddingButton.tsx +18 -11
  68. package/src/buttons/MRT_ToggleFiltersButton.tsx +16 -9
  69. package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +31 -26
  70. package/src/buttons/MRT_ToggleSearchButton.tsx +24 -12
  71. package/src/enums.ts +2 -1
  72. package/src/filtersFNs.ts +17 -3
  73. package/src/footer/MRT_TableFooter.tsx +24 -8
  74. package/src/footer/MRT_TableFooterCell.tsx +34 -26
  75. package/src/footer/MRT_TableFooterRow.tsx +21 -39
  76. package/src/head/MRT_TableHead.tsx +24 -8
  77. package/src/head/MRT_TableHeadCell.tsx +185 -142
  78. package/src/head/MRT_TableHeadRow.tsx +16 -93
  79. package/src/icons.ts +3 -3
  80. package/src/inputs/MRT_EditCellTextField.tsx +39 -24
  81. package/src/inputs/MRT_FilterTextField.tsx +53 -39
  82. package/src/inputs/MRT_SearchTextField.tsx +71 -25
  83. package/src/inputs/MRT_SelectCheckbox.tsx +42 -30
  84. package/src/localization.ts +20 -4
  85. package/src/menus/MRT_ColumnActionMenu.tsx +129 -69
  86. package/src/menus/MRT_FilterTypeMenu.tsx +55 -23
  87. package/src/menus/MRT_RowActionMenu.tsx +22 -15
  88. package/src/menus/MRT_ShowHideColumnsMenu.tsx +52 -20
  89. package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +27 -17
  90. package/src/table/MRT_Table.tsx +25 -15
  91. package/src/table/MRT_TableContainer.tsx +106 -45
  92. package/src/table/MRT_TablePaper.tsx +65 -0
  93. package/src/table/MRT_TableRoot.tsx +239 -0
  94. package/src/toolbar/MRT_LinearProgressBar.tsx +10 -7
  95. package/src/toolbar/MRT_TablePagination.tsx +33 -19
  96. package/src/toolbar/MRT_ToolbarAlertBanner.tsx +33 -20
  97. package/src/toolbar/MRT_ToolbarBottom.tsx +32 -21
  98. package/src/toolbar/MRT_ToolbarInternalButtons.tsx +34 -20
  99. package/src/toolbar/MRT_ToolbarTop.tsx +36 -29
  100. package/src/utils.ts +37 -8
  101. package/dist/head/MRT_TableHeadCellActions.d.ts +0 -5
  102. package/dist/table/MRT_TableSpacerCell.d.ts +0 -6
  103. package/dist/useMRT.d.ts +0 -27
  104. package/src/@types/faker.d.ts +0 -4
  105. package/src/@types/react-table-config.d.ts +0 -53
  106. package/src/head/MRT_TableHeadCellActions.tsx +0 -29
  107. package/src/table/MRT_TableSpacerCell.tsx +0 -20
  108. package/src/useMRT.tsx +0 -215
@@ -1,6 +1,8 @@
1
1
  import { FC } from 'react';
2
2
  import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
3
4
  interface Props extends IconButtonProps {
5
+ tableInstance: MRT_TableInstance;
4
6
  }
5
7
  export declare const MRT_FullScreenToggleButton: FC<Props>;
6
8
  export {};
@@ -1,6 +1,8 @@
1
1
  import { FC } from 'react';
2
2
  import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
3
4
  interface Props extends IconButtonProps {
5
+ tableInstance: MRT_TableInstance;
4
6
  }
5
7
  export declare const MRT_ShowHideColumnsButton: FC<Props>;
6
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_HeaderGroup } from '..';
2
+ import type { MRT_Header, MRT_TableInstance } from '..';
3
3
  interface Props {
4
- column: MRT_HeaderGroup;
4
+ header: MRT_Header;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_ToggleColumnActionMenuButton: FC<Props>;
7
8
  export {};
@@ -1,6 +1,8 @@
1
1
  import { FC } from 'react';
2
2
  import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
3
4
  interface Props extends IconButtonProps {
5
+ tableInstance: MRT_TableInstance;
4
6
  }
5
7
  export declare const MRT_ToggleDensePaddingButton: FC<Props>;
6
8
  export {};
@@ -1,6 +1,8 @@
1
1
  import { FC } from 'react';
2
2
  import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
3
4
  interface Props extends IconButtonProps {
5
+ tableInstance: MRT_TableInstance;
4
6
  }
5
7
  export declare const MRT_ToggleFiltersButton: FC<Props>;
6
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_Row } from '..';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  row: MRT_Row;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_ToggleRowActionMenuButton: FC<Props>;
7
8
  export {};
@@ -1,6 +1,8 @@
1
1
  import { FC } from 'react';
2
2
  import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
3
4
  interface Props extends IconButtonProps {
5
+ tableInstance: MRT_TableInstance;
4
6
  }
5
7
  export declare const MRT_ToggleSearchButton: FC<Props>;
6
8
  export {};
package/dist/enums.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export declare enum MRT_FILTER_TYPE {
2
+ BEST_MATCH = "bestMatch",
3
+ BEST_MATCH_FIRST = "bestMatchFirst",
2
4
  CONTAINS = "contains",
3
5
  EMPTY = "empty",
4
6
  ENDS_WITH = "endsWith",
5
7
  EQUALS = "equals",
6
- FUZZY = "fuzzy",
7
8
  GREATER_THAN = "greaterThan",
8
9
  LESS_THAN = "lessThan",
9
10
  NOT_EMPTY = "notEmpty",
@@ -1,5 +1,9 @@
1
1
  import { MRT_Row } from '.';
2
- export declare const fuzzy: {
2
+ export declare const bestMatchFirst: {
3
+ (rows: MRT_Row[], columnIds: string[] | string, filterValue: string | number): MRT_Row<{}>[];
4
+ autoRemove(val: any): boolean;
5
+ };
6
+ export declare const bestMatch: {
3
7
  (rows: MRT_Row[], columnIds: string[] | string, filterValue: string | number): MRT_Row<{}>[];
4
8
  autoRemove(val: any): boolean;
5
9
  };
@@ -40,6 +44,14 @@ export declare const notEmpty: {
40
44
  autoRemove(val: any): boolean;
41
45
  };
42
46
  export declare const defaultFilterFNs: {
47
+ bestMatch: {
48
+ (rows: MRT_Row[], columnIds: string[] | string, filterValue: string | number): MRT_Row<{}>[];
49
+ autoRemove(val: any): boolean;
50
+ };
51
+ bestMatchFirst: {
52
+ (rows: MRT_Row[], columnIds: string[] | string, filterValue: string | number): MRT_Row<{}>[];
53
+ autoRemove(val: any): boolean;
54
+ };
43
55
  contains: {
44
56
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
45
57
  autoRemove(val: any): boolean;
@@ -56,10 +68,6 @@ export declare const defaultFilterFNs: {
56
68
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
57
69
  autoRemove(val: any): boolean;
58
70
  };
59
- fuzzy: {
60
- (rows: MRT_Row[], columnIds: string[] | string, filterValue: string | number): MRT_Row<{}>[];
61
- autoRemove(val: any): boolean;
62
- };
63
71
  greaterThan: {
64
72
  (rows: MRT_Row[], id: string, filterValue: string | number): MRT_Row<{}>[];
65
73
  autoRemove(val: any): boolean;
@@ -1,5 +1,8 @@
1
1
  import { FC } from 'react';
2
+ import type { MRT_TableInstance } from '..';
2
3
  interface Props {
4
+ pinned: 'left' | 'center' | 'right' | 'none';
5
+ tableInstance: MRT_TableInstance;
3
6
  }
4
7
  export declare const MRT_TableFooter: FC<Props>;
5
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_HeaderGroup } from '..';
2
+ import type { MRT_Header, MRT_TableInstance } from '..';
3
3
  interface Props {
4
- column: MRT_HeaderGroup;
4
+ footer: MRT_Header;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_TableFooterCell: FC<Props>;
7
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_HeaderGroup } from '..';
2
+ import type { MRT_HeaderGroup, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  footerGroup: MRT_HeaderGroup;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_TableFooterRow: FC<Props>;
7
8
  export {};
@@ -1,5 +1,8 @@
1
1
  import { FC } from 'react';
2
+ import type { MRT_TableInstance } from '..';
2
3
  interface Props {
4
+ pinned: 'left' | 'center' | 'right' | 'none';
5
+ tableInstance: MRT_TableInstance;
3
6
  }
4
7
  export declare const MRT_TableHead: FC<Props>;
5
8
  export {};
@@ -1,22 +1,8 @@
1
- import { CSSProperties, FC } from 'react';
2
- import type { MRT_HeaderGroup } from '..';
3
- export declare const commonTableHeadCellStyles: (densePadding: boolean, enableColumnResizing?: boolean | undefined, widths?: {
4
- maxWidth?: CSSProperties['maxWidth'];
5
- minWidth?: CSSProperties['minWidth'];
6
- width?: CSSProperties['width'];
7
- } | undefined) => {
8
- maxWidth?: CSSProperties['maxWidth'];
9
- minWidth?: CSSProperties['minWidth'];
10
- width?: CSSProperties['width'];
11
- fontWeight: string;
12
- height: string;
13
- p: string;
14
- pt: string;
15
- transition: string;
16
- verticalAlign: string;
17
- };
1
+ import { FC } from 'react';
2
+ import type { MRT_Header, MRT_TableInstance } from '..';
18
3
  interface Props {
19
- column: MRT_HeaderGroup;
4
+ header: MRT_Header;
5
+ tableInstance: MRT_TableInstance;
20
6
  }
21
7
  export declare const MRT_TableHeadCell: FC<Props>;
22
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_HeaderGroup } from '..';
2
+ import type { MRT_HeaderGroup, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  headerGroup: MRT_HeaderGroup;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_TableHeadRow: FC<Props>;
7
8
  export {};
package/dist/icons.d.ts CHANGED
@@ -4,7 +4,6 @@ export interface MRT_Icons {
4
4
  CheckBoxIcon: any;
5
5
  ClearAllIcon: any;
6
6
  CloseIcon: any;
7
- ContentCopyIcon: any;
8
7
  DensityMediumIcon: any;
9
8
  DensitySmallIcon: any;
10
9
  DoubleArrowDownIcon: any;
@@ -20,6 +19,7 @@ export interface MRT_Icons {
20
19
  FullscreenIcon: any;
21
20
  MoreHorizIcon: any;
22
21
  MoreVertIcon: any;
22
+ PushPinIcon: any;
23
23
  SaveIcon: any;
24
24
  SearchIcon: any;
25
25
  SearchOffIcon: any;
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_Cell } from '..';
2
+ import type { MRT_Cell, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  cell: MRT_Cell;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_EditCellTextField: FC<Props>;
7
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_HeaderGroup } from '..';
2
+ import type { MRT_Header, MRT_TableInstance } from '..';
3
3
  interface Props {
4
- column: MRT_HeaderGroup;
4
+ header: MRT_Header;
5
+ tableInstance: MRT_TableInstance;
5
6
  }
6
7
  export declare const MRT_FilterTextField: FC<Props>;
7
8
  export {};
@@ -1,5 +1,7 @@
1
1
  import { FC } from 'react';
2
+ import { MRT_TableInstance } from '..';
2
3
  interface Props {
4
+ tableInstance: MRT_TableInstance;
3
5
  }
4
6
  export declare const MRT_SearchTextField: FC<Props>;
5
7
  export {};
@@ -1,8 +1,9 @@
1
1
  import { FC } from 'react';
2
- import type { MRT_Row } from '..';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
3
  interface Props {
4
4
  row?: MRT_Row;
5
5
  selectAll?: boolean;
6
+ tableInstance: MRT_TableInstance;
6
7
  }
7
8
  export declare const MRT_SelectCheckbox: FC<Props>;
8
9
  export {};
@@ -2,6 +2,7 @@ export interface MRT_Localization {
2
2
  actions: string;
3
3
  cancel: string;
4
4
  changeFilterMode: string;
5
+ changeSearchMode: string;
5
6
  clearFilter: string;
6
7
  clearSearch: string;
7
8
  clearSort: string;
@@ -11,12 +12,13 @@ export interface MRT_Localization {
11
12
  edit: string;
12
13
  expand: string;
13
14
  expandAll: string;
15
+ filterBestMatch: string;
16
+ filterBestMatchFirst: string;
14
17
  filterByColumn: string;
15
18
  filterContains: string;
16
19
  filterEmpty: string;
17
20
  filterEndsWith: string;
18
21
  filterEquals: string;
19
- filterFuzzy: string;
20
22
  filterGreaterThan: string;
21
23
  filterLessThan: string;
22
24
  filterMode: string;
@@ -28,13 +30,18 @@ export interface MRT_Localization {
28
30
  groupedBy: string;
29
31
  hideAll: string;
30
32
  hideColumn: string;
33
+ pinToLeft: string;
34
+ pinToRight: string;
31
35
  rowActions: string;
36
+ rowNumber: string;
37
+ rowNumbers: string;
32
38
  save: string;
33
39
  search: string;
40
+ select: string;
34
41
  selectedCountOfRowCountRowsSelected: string;
35
42
  showAll: string;
36
- showHideColumns: string;
37
43
  showAllColumns: string;
44
+ showHideColumns: string;
38
45
  showHideFilters: string;
39
46
  showHideSearch: string;
40
47
  sortByColumnAsc: string;
@@ -45,5 +52,6 @@ export interface MRT_Localization {
45
52
  toggleSelectAll: string;
46
53
  toggleSelectRow: string;
47
54
  ungroupByColumn: string;
55
+ unpin: string;
48
56
  }
49
57
  export declare const MRT_DefaultLocalization_EN: MRT_Localization;