material-react-table 0.6.9 → 0.7.0-alpha.2
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/dist/MaterialReactTable.d.ts +308 -107
- package/dist/body/MRT_TableBody.d.ts +3 -0
- package/dist/body/MRT_TableBodyCell.d.ts +2 -11
- package/dist/body/MRT_TableBodyRow.d.ts +3 -1
- package/dist/body/MRT_TableDetailPanel.d.ts +2 -1
- package/dist/buttons/MRT_CopyButton.d.ts +4 -2
- package/dist/buttons/MRT_EditActionButtons.d.ts +2 -1
- package/dist/buttons/MRT_ExpandAllButton.d.ts +2 -0
- package/dist/buttons/MRT_ExpandButton.d.ts +2 -1
- package/dist/buttons/MRT_FullScreenToggleButton.d.ts +2 -0
- package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +2 -0
- package/dist/buttons/MRT_ToggleColumnActionMenuButton.d.ts +3 -2
- package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +2 -0
- package/dist/buttons/MRT_ToggleFiltersButton.d.ts +2 -0
- package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +2 -1
- package/dist/buttons/MRT_ToggleSearchButton.d.ts +2 -0
- package/dist/enums.d.ts +2 -1
- package/dist/filtersFNs.d.ts +13 -5
- package/dist/footer/MRT_TableFooter.d.ts +3 -0
- package/dist/footer/MRT_TableFooterCell.d.ts +3 -2
- package/dist/footer/MRT_TableFooterRow.d.ts +2 -1
- package/dist/head/MRT_TableHead.d.ts +3 -0
- package/dist/head/MRT_TableHeadCell.d.ts +4 -18
- package/dist/head/MRT_TableHeadRow.d.ts +2 -1
- package/dist/icons.d.ts +1 -1
- package/dist/inputs/MRT_EditCellTextField.d.ts +2 -1
- package/dist/inputs/MRT_FilterTextField.d.ts +3 -2
- package/dist/inputs/MRT_SearchTextField.d.ts +2 -0
- package/dist/inputs/MRT_SelectCheckbox.d.ts +2 -1
- package/dist/localization.d.ts +9 -2
- package/dist/material-react-table.cjs.development.js +2258 -2470
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +2260 -2472
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ColumnActionMenu.d.ts +3 -2
- package/dist/menus/MRT_FilterTypeMenu.d.ts +4 -3
- package/dist/menus/MRT_RowActionMenu.d.ts +3 -2
- package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +2 -0
- package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +2 -1
- package/dist/table/MRT_Table.d.ts +3 -0
- package/dist/table/MRT_TableContainer.d.ts +2 -0
- package/dist/table/MRT_TablePaper.d.ts +7 -0
- package/dist/table/MRT_TableRoot.d.ts +3 -0
- package/dist/toolbar/MRT_LinearProgressBar.d.ts +2 -0
- package/dist/toolbar/MRT_TablePagination.d.ts +2 -0
- package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +2 -0
- package/dist/toolbar/MRT_ToolbarBottom.d.ts +2 -0
- package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +2 -0
- package/dist/toolbar/MRT_ToolbarTop.d.ts +4 -2
- package/dist/utils.d.ts +12 -2
- package/package.json +27 -28
- package/src/MaterialReactTable.tsx +598 -295
- package/src/body/MRT_TableBody.tsx +26 -22
- package/src/body/MRT_TableBodyCell.tsx +76 -55
- package/src/body/MRT_TableBodyRow.tsx +37 -67
- package/src/body/MRT_TableDetailPanel.tsx +21 -17
- package/src/buttons/MRT_CopyButton.tsx +36 -11
- package/src/buttons/MRT_EditActionButtons.tsx +16 -13
- package/src/buttons/MRT_ExpandAllButton.tsx +36 -28
- package/src/buttons/MRT_ExpandButton.tsx +35 -41
- package/src/buttons/MRT_FullScreenToggleButton.tsx +18 -11
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +18 -7
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +22 -11
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +18 -11
- package/src/buttons/MRT_ToggleFiltersButton.tsx +16 -9
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +27 -22
- package/src/buttons/MRT_ToggleSearchButton.tsx +24 -12
- package/src/enums.ts +2 -1
- package/src/filtersFNs.ts +17 -3
- package/src/footer/MRT_TableFooter.tsx +24 -8
- package/src/footer/MRT_TableFooterCell.tsx +34 -26
- package/src/footer/MRT_TableFooterRow.tsx +21 -39
- package/src/head/MRT_TableHead.tsx +24 -8
- package/src/head/MRT_TableHeadCell.tsx +185 -142
- package/src/head/MRT_TableHeadRow.tsx +16 -93
- package/src/icons.ts +3 -3
- package/src/inputs/MRT_EditCellTextField.tsx +23 -24
- package/src/inputs/MRT_FilterTextField.tsx +53 -39
- package/src/inputs/MRT_SearchTextField.tsx +71 -25
- package/src/inputs/MRT_SelectCheckbox.tsx +42 -30
- package/src/localization.ts +19 -4
- package/src/menus/MRT_ColumnActionMenu.tsx +129 -69
- package/src/menus/MRT_FilterTypeMenu.tsx +55 -23
- package/src/menus/MRT_RowActionMenu.tsx +21 -14
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +52 -20
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +27 -17
- package/src/table/MRT_Table.tsx +25 -15
- package/src/table/MRT_TableContainer.tsx +106 -45
- package/src/table/MRT_TablePaper.tsx +65 -0
- package/src/table/MRT_TableRoot.tsx +236 -0
- package/src/toolbar/MRT_LinearProgressBar.tsx +10 -7
- package/src/toolbar/MRT_TablePagination.tsx +30 -19
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +33 -20
- package/src/toolbar/MRT_ToolbarBottom.tsx +32 -21
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +34 -20
- package/src/toolbar/MRT_ToolbarTop.tsx +36 -29
- package/src/utils.ts +37 -8
- package/dist/head/MRT_TableHeadCellActions.d.ts +0 -5
- package/dist/table/MRT_TableSpacerCell.d.ts +0 -6
- package/dist/useMRT.d.ts +0 -27
- package/src/@types/faker.d.ts +0 -4
- package/src/@types/react-table-config.d.ts +0 -53
- package/src/head/MRT_TableHeadCellActions.tsx +0 -29
- package/src/table/MRT_TableSpacerCell.tsx +0 -20
- package/src/useMRT.tsx +0 -215
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MRT_Header, MRT_TableInstance } from '..';
|
|
3
3
|
export declare const commonMenuItemStyles: {
|
|
4
4
|
py: string;
|
|
5
5
|
my: number;
|
|
@@ -12,8 +12,9 @@ export declare const commonListItemStyles: {
|
|
|
12
12
|
};
|
|
13
13
|
interface Props {
|
|
14
14
|
anchorEl: HTMLElement | null;
|
|
15
|
-
|
|
15
|
+
header: MRT_Header;
|
|
16
16
|
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
17
|
+
tableInstance: MRT_TableInstance;
|
|
17
18
|
}
|
|
18
19
|
export declare const MRT_ColumnActionMenu: FC<Props>;
|
|
19
20
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MRT_Header, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
anchorEl: HTMLElement | null;
|
|
5
|
-
|
|
6
|
-
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
5
|
+
header?: MRT_Header;
|
|
7
6
|
onSelect?: () => void;
|
|
7
|
+
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
8
|
+
tableInstance: MRT_TableInstance;
|
|
8
9
|
}
|
|
9
10
|
export declare const MRT_FilterTypeMenu: FC<Props>;
|
|
10
11
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
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
|
anchorEl: HTMLElement | null;
|
|
5
|
+
handleEdit: () => void;
|
|
5
6
|
row: MRT_Row;
|
|
6
7
|
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
7
|
-
|
|
8
|
+
tableInstance: MRT_TableInstance;
|
|
8
9
|
}
|
|
9
10
|
export declare const MRT_RowActionMenu: FC<Props>;
|
|
10
11
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { MRT_TableInstance } from '..';
|
|
2
3
|
interface Props {
|
|
3
4
|
anchorEl: HTMLElement | null;
|
|
4
5
|
isSubMenu?: boolean;
|
|
5
6
|
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
7
|
+
tableInstance: MRT_TableInstance;
|
|
6
8
|
}
|
|
7
9
|
export declare const MRT_ShowHideColumnsMenu: FC<Props>;
|
|
8
10
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import type { MRT_ColumnInstance } from '..';
|
|
2
|
+
import type { MRT_ColumnInstance, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
column: MRT_ColumnInstance;
|
|
5
5
|
isSubMenu?: boolean;
|
|
6
|
+
tableInstance: MRT_TableInstance;
|
|
6
7
|
}
|
|
7
8
|
export declare const MRT_ShowHideColumnsMenuItems: FC<Props>;
|
|
8
9
|
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Theme } from '@mui/material';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
|
-
export declare const commonToolbarStyles: (theme
|
|
4
|
+
export declare const commonToolbarStyles: ({ theme }: {
|
|
5
|
+
theme: Theme;
|
|
6
|
+
}) => {
|
|
5
7
|
backgroundColor: string;
|
|
6
8
|
backgroundImage: string;
|
|
7
9
|
display: string;
|
|
8
|
-
opacity: number;
|
|
9
10
|
p: string;
|
|
10
11
|
width: string;
|
|
11
12
|
zIndex: number;
|
|
12
13
|
};
|
|
13
14
|
interface Props {
|
|
15
|
+
tableInstance: MRT_TableInstance;
|
|
14
16
|
}
|
|
15
17
|
export declare const MRT_ToolbarTop: FC<Props>;
|
|
16
18
|
export {};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ColumnDef, Table } from '@tanstack/react-table';
|
|
2
|
+
import { MRT_ColumnInterface, MRT_FilterType } from '.';
|
|
3
|
+
export declare const getAllLeafColumnDefs: (columns: MRT_ColumnInterface[]) => MRT_ColumnInterface[];
|
|
4
|
+
export declare const createGroup: <D extends Record<string, any> = {}>(table: Table<D>, column: MRT_ColumnInterface<D>, currentFilterTypes: {
|
|
5
|
+
[key: string]: MRT_FilterType;
|
|
6
|
+
}) => ColumnDef<D>;
|
|
7
|
+
export declare const createDataColumn: <D extends Record<string, any> = {}>(table: Table<D>, column: MRT_ColumnInterface<D>, currentFilterTypes: {
|
|
8
|
+
[key: string]: MRT_FilterType;
|
|
9
|
+
}) => ColumnDef<D>;
|
|
10
|
+
export declare const createDisplayColumn: <D extends Record<string, any> = {}>(table: Table<D>, column: Pick<MRT_ColumnInterface<D>, "footer" | "columns" | "id" | "accessorKey" | "accessorFn" | "cell" | "meta" | "enableHiding" | "defaultCanHide" | "defaultIsVisible" | "enablePinning" | "defaultCanPin" | "filterType" | "enableAllFilters" | "enableColumnFilter" | "enableGlobalFilter" | "defaultCanFilter" | "defaultCanColumnFilter" | "defaultCanGlobalFilter" | "sortType" | "sortDescFirst" | "enableSorting" | "enableMultiSort" | "defaultCanSort" | "invertSorting" | "sortUndefined" | "aggregationType" | "aggregateValue" | "aggregatedCell" | "enableGrouping" | "defaultCanGroup" | "enableResizing" | "defaultCanResize" | "width" | "minWidth" | "maxWidth" | "Edit" | "Filter" | "Footer" | "Header" | "Cell" | "enableClickToCopy" | "enableColumnActions" | "enableEditing" | "enabledFilterTypes" | "filter" | "filterSelectOptions" | "muiTableBodyCellCopyButtonProps" | "muiTableBodyCellEditTextFieldProps" | "muiTableBodyCellProps" | "muiTableFooterCellProps" | "muiTableHeadCellColumnActionsButtonProps" | "muiTableHeadCellFilterTextFieldProps" | "muiTableHeadCellProps" | "onCellEditChange" | "onColumnFilterValueChange"> & {
|
|
11
|
+
header?: string | undefined;
|
|
12
|
+
}) => ColumnDef<D>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.7.0-alpha.2",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "material-react-table",
|
|
5
5
|
"description": "A fully featured Material-UI implementation of react-table, inspired by material-table and the mui DataGrid, written from the ground up in TypeScript.",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "tsdx build && size-limit && rm -rf material-react-table-docs/node_modules/material-react-table/dist && cp -r dist material-react-table-docs/node_modules/material-react-table/ && cp -r src material-react-table-docs/node_modules/material-react-table/ && cp -r package.json material-react-table-docs/node_modules/material-react-table/package.json",
|
|
32
32
|
"build-storybook": "build-storybook",
|
|
33
33
|
"format": "prettier -w .",
|
|
34
|
-
"lint": "
|
|
34
|
+
"lint": "eslint .",
|
|
35
35
|
"prepare": "tsdx build",
|
|
36
36
|
"size": "size-limit",
|
|
37
37
|
"start": "tsdx watch",
|
|
@@ -47,58 +47,57 @@
|
|
|
47
47
|
"size-limit": [
|
|
48
48
|
{
|
|
49
49
|
"path": "dist/material-react-table.cjs.production.min.js",
|
|
50
|
-
"limit": "
|
|
50
|
+
"limit": "40 KB"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"path": "dist/material-react-table.esm.js",
|
|
54
|
-
"limit": "
|
|
54
|
+
"limit": "40 KB"
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@babel/core": "^7.17.
|
|
59
|
-
"@emotion/react": "^11.
|
|
58
|
+
"@babel/core": "^7.17.9",
|
|
59
|
+
"@emotion/react": "^11.9.0",
|
|
60
60
|
"@emotion/styled": "^11.8.1",
|
|
61
|
-
"@etchteam/storybook-addon-status": "^4.2.
|
|
62
|
-
"@faker-js/faker": "^6.
|
|
63
|
-
"@mui/icons-material": "^5.
|
|
64
|
-
"@mui/material": "^5.
|
|
61
|
+
"@etchteam/storybook-addon-status": "^4.2.1",
|
|
62
|
+
"@faker-js/faker": "^6.1.2",
|
|
63
|
+
"@mui/icons-material": "^5.6.1",
|
|
64
|
+
"@mui/material": "^5.6.1",
|
|
65
65
|
"@size-limit/preset-small-lib": "^7.0.8",
|
|
66
|
-
"@storybook/addon-a11y": "^6.4.
|
|
67
|
-
"@storybook/addon-actions": "^6.4.
|
|
66
|
+
"@storybook/addon-a11y": "^6.4.22",
|
|
67
|
+
"@storybook/addon-actions": "^6.4.22",
|
|
68
68
|
"@storybook/addon-console": "^1.2.3",
|
|
69
|
-
"@storybook/addon-essentials": "^6.4.
|
|
69
|
+
"@storybook/addon-essentials": "^6.4.22",
|
|
70
70
|
"@storybook/addon-info": "^5.3.21",
|
|
71
|
-
"@storybook/addon-links": "^6.4.
|
|
72
|
-
"@storybook/addon-storysource": "^6.4.
|
|
73
|
-
"@storybook/addons": "^6.4.
|
|
74
|
-
"@storybook/react": "^6.4.
|
|
75
|
-
"@types/
|
|
76
|
-
"@types/react": "^17.0.
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
71
|
+
"@storybook/addon-links": "^6.4.22",
|
|
72
|
+
"@storybook/addon-storysource": "^6.4.22",
|
|
73
|
+
"@storybook/addons": "^6.4.22",
|
|
74
|
+
"@storybook/react": "^6.4.22",
|
|
75
|
+
"@types/react": "^17.0.41",
|
|
76
|
+
"@types/react-dom": "^17.0.14",
|
|
77
|
+
"babel-loader": "^8.2.4",
|
|
78
|
+
"eslint": "^8.13.0",
|
|
79
|
+
"eslint-plugin-react-hooks": "^4.4.0",
|
|
80
80
|
"husky": "^7.0.4",
|
|
81
|
-
"prettier": "^2.6.
|
|
81
|
+
"prettier": "^2.6.2",
|
|
82
82
|
"react": "^17.0.2",
|
|
83
83
|
"react-dom": "^17.0.2",
|
|
84
84
|
"react-is": "^17.0.2",
|
|
85
|
-
"react-table": "^7.7.0",
|
|
86
85
|
"size-limit": "^7.0.8",
|
|
87
|
-
"storybook-addon-paddings": "^4.
|
|
86
|
+
"storybook-addon-paddings": "^4.3.0",
|
|
88
87
|
"storybook-dark-mode": "^1.0.9",
|
|
89
88
|
"tsdx": "^0.14.1",
|
|
90
89
|
"tslib": "^2.3.1",
|
|
91
|
-
"typescript": "^4.6.
|
|
90
|
+
"typescript": "^4.6.3"
|
|
92
91
|
},
|
|
93
92
|
"peerDependencies": {
|
|
94
93
|
"@emotion/react": ">=11",
|
|
95
94
|
"@emotion/styled": ">=11",
|
|
96
95
|
"@mui/icons-material": ">=5",
|
|
97
96
|
"@mui/material": ">=5",
|
|
98
|
-
"react": ">=16.8"
|
|
99
|
-
"react-table": ">=7"
|
|
97
|
+
"react": ">=16.8"
|
|
100
98
|
},
|
|
101
99
|
"dependencies": {
|
|
100
|
+
"@tanstack/react-table": "^8.0.0-alpha.26",
|
|
102
101
|
"match-sorter": "^6.3.1"
|
|
103
102
|
}
|
|
104
103
|
}
|