material-react-table 0.6.10 → 0.7.0-alpha.1
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 +142 -82
- 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/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 +7 -2
- package/dist/material-react-table.cjs.development.js +2142 -1729
- 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 +2143 -1730
- 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 +298 -242
- package/src/body/MRT_TableBody.tsx +25 -21
- package/src/body/MRT_TableBodyCell.tsx +73 -58
- package/src/body/MRT_TableBodyRow.tsx +35 -74
- package/src/body/MRT_TableDetailPanel.tsx +16 -14
- package/src/buttons/MRT_CopyButton.tsx +14 -7
- package/src/buttons/MRT_EditActionButtons.tsx +13 -12
- package/src/buttons/MRT_ExpandAllButton.tsx +24 -9
- package/src/buttons/MRT_ExpandButton.tsx +21 -14
- package/src/buttons/MRT_FullScreenToggleButton.tsx +18 -11
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +18 -7
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +17 -9
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +18 -11
- package/src/buttons/MRT_ToggleFiltersButton.tsx +16 -9
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +26 -21
- package/src/buttons/MRT_ToggleSearchButton.tsx +18 -11
- package/src/footer/MRT_TableFooter.tsx +23 -7
- package/src/footer/MRT_TableFooterCell.tsx +32 -24
- package/src/footer/MRT_TableFooterRow.tsx +20 -38
- package/src/head/MRT_TableHead.tsx +23 -7
- package/src/head/MRT_TableHeadCell.tsx +201 -152
- package/src/head/MRT_TableHeadRow.tsx +15 -103
- package/src/icons.ts +3 -3
- package/src/inputs/MRT_EditCellTextField.tsx +23 -24
- package/src/inputs/MRT_FilterTextField.tsx +51 -30
- package/src/inputs/MRT_SearchTextField.tsx +38 -21
- package/src/inputs/MRT_SelectCheckbox.tsx +34 -24
- package/src/localization.ts +13 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +129 -69
- package/src/menus/MRT_FilterTypeMenu.tsx +28 -22
- package/src/menus/MRT_RowActionMenu.tsx +16 -11
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +52 -20
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +28 -17
- package/src/table/MRT_Table.tsx +24 -14
- package/src/table/MRT_TableContainer.tsx +109 -44
- package/src/table/MRT_TablePaper.tsx +61 -0
- package/src/table/MRT_TableRoot.tsx +236 -0
- package/src/toolbar/MRT_LinearProgressBar.tsx +9 -6
- package/src/toolbar/MRT_TablePagination.tsx +28 -18
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +31 -19
- package/src/toolbar/MRT_ToolbarBottom.tsx +31 -20
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +29 -16
- package/src/toolbar/MRT_ToolbarTop.tsx +34 -27
- 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 -28
- 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 -226
|
@@ -1,96 +1,145 @@
|
|
|
1
|
-
import { ChangeEvent, FC, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { AlertProps, ButtonProps, CheckboxProps, IconButtonProps, LinearProgressProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
|
|
3
|
-
import { Cell, Column,
|
|
1
|
+
import { ChangeEvent, Dispatch, FC, MouseEvent, ReactNode, SetStateAction } from 'react';
|
|
2
|
+
import { AlertProps, ButtonProps, CheckboxProps, IconButtonProps, LinearProgressProps, PaperProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
|
|
3
|
+
import { Cell, Column, ColumnDef, DefaultGenerics, FilterType, Header, HeaderGroup, Options, Overwrite, PaginationState, Row, TableInstance, TableState } from '@tanstack/react-table';
|
|
4
4
|
import { MRT_Localization } from './localization';
|
|
5
5
|
import { MRT_Icons } from './icons';
|
|
6
6
|
import { MRT_FILTER_TYPE } from './enums';
|
|
7
|
-
export declare type MRT_TableOptions<D extends
|
|
8
|
-
columns: MRT_ColumnInterface[];
|
|
7
|
+
export declare type MRT_TableOptions<D extends Record<string, any> = {}> = Partial<Omit<Options<D>, 'columns' | 'data' | 'initialState' | 'state' | 'expandRowsFn'>> & {
|
|
8
|
+
columns: MRT_ColumnInterface<D>[];
|
|
9
9
|
data: D[];
|
|
10
|
-
initialState?: Partial<MRT_TableState
|
|
10
|
+
initialState?: Partial<MRT_TableState<D>>;
|
|
11
|
+
state?: Partial<MRT_TableState<D>>;
|
|
12
|
+
expandRowsFn?: (dataRow: D) => D[];
|
|
11
13
|
};
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
footerGroups: MRT_HeaderGroup<D>[];
|
|
15
|
-
getToggleAllRowsExpandedProps: () => void;
|
|
16
|
-
headerGroups: MRT_HeaderGroup<D>[];
|
|
17
|
-
page: MRT_Row<D>[];
|
|
18
|
-
resetResizing: () => void;
|
|
14
|
+
export interface MRT_RowModel<D extends Record<string, any> = {}> {
|
|
15
|
+
flatRows: MRT_Row<D>[];
|
|
19
16
|
rows: MRT_Row<D>[];
|
|
20
|
-
|
|
17
|
+
rowsById: {
|
|
18
|
+
[key: string]: MRT_Row<D>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit<TableInstance<Overwrite<Partial<DefaultGenerics>, {
|
|
22
|
+
Row: D;
|
|
23
|
+
}>>, 'getAllColumns' | 'getAllLeafColumns' | 'getExpandedRowModel' | 'getPaginationRowModel' | 'getPrePaginationRowModel' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
|
24
|
+
getAllColumns: () => MRT_ColumnInstance<D>[];
|
|
25
|
+
getAllLeafColumns: () => MRT_ColumnInstance<D>[];
|
|
26
|
+
getExpandedRowModel: () => MRT_RowModel;
|
|
27
|
+
getPaginationRowModel: () => MRT_RowModel;
|
|
28
|
+
getPrePaginationRowModel: () => MRT_RowModel;
|
|
29
|
+
getRowModel: () => MRT_RowModel;
|
|
30
|
+
getSelectedRowModel: () => MRT_RowModel;
|
|
31
|
+
getState: () => MRT_TableState<D>;
|
|
32
|
+
options: MaterialReactTableProps<D> & {
|
|
33
|
+
icons: MRT_Icons;
|
|
34
|
+
idPrefix: string;
|
|
35
|
+
filterTypes: {
|
|
36
|
+
[key in MRT_FILTER_TYPE]: any;
|
|
37
|
+
};
|
|
38
|
+
localization: MRT_Localization;
|
|
39
|
+
setCurrentEditingRow: Dispatch<SetStateAction<MRT_Row<D> | null>>;
|
|
40
|
+
setCurrentFilterTypes: Dispatch<SetStateAction<{
|
|
41
|
+
[key: string]: MRT_FilterType;
|
|
42
|
+
}>>;
|
|
43
|
+
setCurrentGlobalFilterType: Dispatch<SetStateAction<MRT_FILTER_TYPE>>;
|
|
44
|
+
setIsDensePadding: Dispatch<SetStateAction<boolean>>;
|
|
45
|
+
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
|
46
|
+
setShowFilters: Dispatch<SetStateAction<boolean>>;
|
|
47
|
+
setShowSearch: Dispatch<SetStateAction<boolean>>;
|
|
48
|
+
};
|
|
21
49
|
};
|
|
22
|
-
export declare type
|
|
23
|
-
|
|
50
|
+
export declare type MRT_TableState<D extends Record<string, any> = {}> = Omit<TableState, 'pagination'> & {
|
|
51
|
+
currentEditingRow: MRT_Row<D> | null;
|
|
52
|
+
currentFilterTypes: Record<string, string | Function>;
|
|
53
|
+
currentGlobalFilterType: Record<string, string | Function>;
|
|
54
|
+
isDensePadding: boolean;
|
|
55
|
+
isFullScreen: boolean;
|
|
56
|
+
showFilters: boolean;
|
|
57
|
+
showSearch: boolean;
|
|
58
|
+
pagination: Partial<PaginationState>;
|
|
59
|
+
};
|
|
60
|
+
export declare type MRT_ColumnInterface<D extends Record<string, any> = {}> = Omit<ColumnDef<D>, 'header' | 'footer' | 'columns'> & {
|
|
61
|
+
Edit?: ({ cell, tableInstance, onChange, }: {
|
|
24
62
|
cell: MRT_Cell<D>;
|
|
63
|
+
tableInstance: MRT_TableInstance<D>;
|
|
25
64
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
26
65
|
}) => ReactNode;
|
|
27
|
-
Filter?: ({
|
|
28
|
-
|
|
66
|
+
Filter?: ({ header, tableInstance, }: {
|
|
67
|
+
header: MRT_Header<D>;
|
|
68
|
+
tableInstance: MRT_TableInstance<D>;
|
|
69
|
+
}) => ReactNode;
|
|
70
|
+
Footer?: ({ footer, tableInstance, }: {
|
|
71
|
+
footer: MRT_Header<D>;
|
|
72
|
+
tableInstance: MRT_TableInstance<D>;
|
|
73
|
+
}) => ReactNode;
|
|
74
|
+
Header?: ({ header, tableInstance, }: {
|
|
75
|
+
header: MRT_Header<D>;
|
|
76
|
+
tableInstance: MRT_TableInstance<D>;
|
|
77
|
+
}) => ReactNode;
|
|
78
|
+
Cell?: ({ cell, tableInstance, }: {
|
|
79
|
+
cell: MRT_Cell<D>;
|
|
80
|
+
tableInstance: MRT_TableInstance<D>;
|
|
29
81
|
}) => ReactNode;
|
|
30
|
-
|
|
31
|
-
Header?: string;
|
|
32
|
-
accessor?: string;
|
|
82
|
+
id: keyof D | string;
|
|
33
83
|
columns?: MRT_ColumnInterface<D>[];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
84
|
+
enableClickToCopy?: boolean;
|
|
85
|
+
enableColumnActions?: boolean;
|
|
86
|
+
enableEditing?: boolean;
|
|
87
|
+
enableColumnFilters?: boolean;
|
|
88
|
+
enableHiding?: boolean;
|
|
39
89
|
enabledFilterTypes?: (MRT_FILTER_TYPE | string)[];
|
|
40
90
|
filter?: MRT_FilterType | string | FilterType<D>;
|
|
41
91
|
filterSelectOptions?: (string | {
|
|
42
92
|
text: string;
|
|
43
93
|
value: string;
|
|
44
94
|
})[];
|
|
95
|
+
footer?: string;
|
|
96
|
+
header: string;
|
|
45
97
|
muiTableBodyCellCopyButtonProps?: ButtonProps | ((cell?: MRT_Cell<D>) => ButtonProps);
|
|
46
98
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | ((cell: MRT_Cell<D>) => TextFieldProps);
|
|
47
99
|
muiTableBodyCellProps?: TableCellProps | ((cell: MRT_Cell<D>) => TableCellProps);
|
|
48
|
-
muiTableFooterCellProps?: TableCellProps | ((column:
|
|
49
|
-
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | ((column:
|
|
50
|
-
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | ((column:
|
|
51
|
-
muiTableHeadCellProps?: TableCellProps | ((column:
|
|
100
|
+
muiTableFooterCellProps?: TableCellProps | ((column: MRT_ColumnInstance<D>) => TableCellProps);
|
|
101
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | ((column: MRT_ColumnInstance<D>) => IconButtonProps);
|
|
102
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | ((column: MRT_ColumnInstance<D>) => TextFieldProps);
|
|
103
|
+
muiTableHeadCellProps?: TableCellProps | ((column: MRT_ColumnInstance<D>) => TableCellProps);
|
|
52
104
|
onCellEditChange?: (event: ChangeEvent<HTMLInputElement>, cell: MRT_Cell<D>) => void;
|
|
53
105
|
onFilterChange?: (event: ChangeEvent<HTMLInputElement>, filterValue: any) => void;
|
|
54
106
|
};
|
|
55
|
-
export declare type MRT_ColumnInstance<D extends
|
|
107
|
+
export declare type MRT_ColumnInstance<D extends Record<string, any> = {}> = Omit<Column<D>, 'header' | 'footer' | 'columns'> & MRT_ColumnInterface<D> & {
|
|
56
108
|
columns?: MRT_ColumnInstance<D>[];
|
|
57
109
|
};
|
|
58
|
-
export declare type
|
|
59
|
-
|
|
110
|
+
export declare type MRT_Header<D extends Record<string, any> = {}> = Omit<Header<D>, 'column'> & {
|
|
111
|
+
column: MRT_ColumnInstance<D>;
|
|
60
112
|
};
|
|
61
|
-
export declare type
|
|
62
|
-
|
|
113
|
+
export declare type MRT_HeaderGroup<D extends Record<string, any> = {}> = Omit<HeaderGroup<D>, 'headers'> & {
|
|
114
|
+
headers: MRT_Header<D>[];
|
|
63
115
|
};
|
|
64
|
-
export declare type
|
|
116
|
+
export declare type MRT_Row<D extends Record<string, any> = {}> = Omit<Row<D>, 'getVisibleCells' | 'getAllCells' | 'subRows' | 'original' | 'getLeftVisibleCells' | 'getRightVisibleCells' | 'getCenterVisibleCells'> & {
|
|
117
|
+
getAllCells: () => MRT_Cell<D>[];
|
|
118
|
+
getCenterVisibleCells: () => MRT_Cell<D>[];
|
|
119
|
+
getLeftVisibleCells: () => MRT_Cell<D>[];
|
|
120
|
+
getRightVisibleCells: () => MRT_Cell<D>[];
|
|
121
|
+
getVisibleCells: () => MRT_Cell<D>[];
|
|
122
|
+
subRows?: MRT_Row<D>[];
|
|
123
|
+
original: D;
|
|
124
|
+
};
|
|
125
|
+
export declare type MRT_Cell<D extends Record<string, any> = {}> = Omit<Cell<D>, 'column' | 'row'> & {
|
|
65
126
|
column: MRT_ColumnInstance<D>;
|
|
127
|
+
row: MRT_Row<D>;
|
|
66
128
|
};
|
|
67
129
|
export declare type MRT_FilterType = MRT_FILTER_TYPE | Function;
|
|
68
|
-
export declare type
|
|
69
|
-
currentEditingRow: MRT_Row<D> | null;
|
|
70
|
-
currentFilterTypes: {
|
|
71
|
-
[key: string]: MRT_FilterType;
|
|
72
|
-
};
|
|
73
|
-
currentGlobalFilterType: MRT_FilterType;
|
|
74
|
-
densePadding: boolean;
|
|
75
|
-
fullScreen: boolean;
|
|
76
|
-
showFilters: boolean;
|
|
77
|
-
showSearch: boolean;
|
|
78
|
-
};
|
|
79
|
-
export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions<D> & UseExpandedOptions<D> & UseFiltersOptions<D> & UseGlobalFiltersOptions<D> & UseGroupByOptions<D> & UsePaginationOptions<D> & UseResizeColumnsOptions<D> & UseRowSelectOptions<D> & UseRowStateOptions<D> & UseSortByOptions<D> & MRT_TableOptions<D> & {
|
|
80
|
-
disableColumnActions?: boolean;
|
|
81
|
-
disableColumnHiding?: boolean;
|
|
82
|
-
disableDensePaddingToggle?: boolean;
|
|
83
|
-
disableExpandAll?: boolean;
|
|
84
|
-
disableFullScreenToggle?: boolean;
|
|
85
|
-
disableSelectAll?: boolean;
|
|
86
|
-
disableSubRowTree?: boolean;
|
|
130
|
+
export declare type MaterialReactTableProps<D extends Record<string, any> = {}> = MRT_TableOptions<D> & {
|
|
87
131
|
enableClickToCopy?: boolean;
|
|
88
|
-
|
|
89
|
-
|
|
132
|
+
enableColumnActions?: boolean;
|
|
133
|
+
enableColumnPinning?: boolean;
|
|
134
|
+
enableDensePaddingToggle?: boolean;
|
|
135
|
+
enableExpandAll?: boolean;
|
|
136
|
+
enableFullScreenToggle?: boolean;
|
|
137
|
+
enablePagination?: boolean;
|
|
90
138
|
enableRowActions?: boolean;
|
|
139
|
+
enableStickyHeader?: boolean;
|
|
91
140
|
enableRowEditing?: boolean;
|
|
92
141
|
enableRowNumbers?: boolean;
|
|
93
|
-
|
|
142
|
+
enableSelectAll?: boolean;
|
|
94
143
|
enabledGlobalFilterTypes?: (MRT_FILTER_TYPE | string)[];
|
|
95
144
|
filterTypes?: {
|
|
96
145
|
[key in MRT_FILTER_TYPE]: any;
|
|
@@ -102,7 +151,7 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
|
|
|
102
151
|
hideToolbarTop?: boolean;
|
|
103
152
|
icons?: Partial<MRT_Icons>;
|
|
104
153
|
idPrefix?: string;
|
|
105
|
-
|
|
154
|
+
isReloading?: boolean;
|
|
106
155
|
isLoading?: boolean;
|
|
107
156
|
localization?: Partial<MRT_Localization>;
|
|
108
157
|
muiLinearProgressProps?: LinearProgressProps | ((tableInstance: MRT_TableInstance) => LinearProgressProps);
|
|
@@ -113,46 +162,57 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
|
|
|
113
162
|
muiTableBodyCellProps?: TableCellProps | ((cell?: MRT_Cell<D>) => TableCellProps);
|
|
114
163
|
muiTableBodyCellSkeletonProps?: SkeletonProps | ((cell?: MRT_Cell<D>) => SkeletonProps);
|
|
115
164
|
muiTableBodyProps?: TableBodyProps | ((tableInstance: MRT_TableInstance<D>) => TableBodyProps);
|
|
116
|
-
muiTableBodyRowProps?: TableRowProps | ((row:
|
|
165
|
+
muiTableBodyRowProps?: TableRowProps | ((row: MRT_Row<D>) => TableRowProps);
|
|
117
166
|
muiTableContainerProps?: TableContainerProps | ((tableInstance: MRT_TableInstance<D>) => TableContainerProps);
|
|
118
|
-
muiTableDetailPanelProps?: TableCellProps | ((row:
|
|
119
|
-
muiTableFooterCellProps?: TableCellProps | ((column:
|
|
167
|
+
muiTableDetailPanelProps?: TableCellProps | ((row: MRT_Row<D>) => TableCellProps);
|
|
168
|
+
muiTableFooterCellProps?: TableCellProps | ((column: MRT_ColumnInstance<D>) => TableCellProps);
|
|
120
169
|
muiTableFooterProps?: TableFooterProps | ((tableInstance: MRT_TableInstance<D>) => TableFooterProps);
|
|
121
170
|
muiTableFooterRowProps?: TableRowProps | ((footerGroup: MRT_HeaderGroup<D>) => TableRowProps);
|
|
122
|
-
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | ((column:
|
|
123
|
-
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | ((column:
|
|
124
|
-
muiTableHeadCellProps?: TableCellProps | ((column:
|
|
171
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | ((column: MRT_ColumnInstance<D>) => IconButtonProps);
|
|
172
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | ((column: MRT_ColumnInstance<D>) => TextFieldProps);
|
|
173
|
+
muiTableHeadCellProps?: TableCellProps | ((column: MRT_ColumnInstance<D>) => TableCellProps);
|
|
125
174
|
muiTableHeadProps?: TableHeadProps | ((tableInstance: MRT_TableInstance<D>) => TableHeadProps);
|
|
126
|
-
muiTableHeadRowProps?: TableRowProps | ((
|
|
175
|
+
muiTableHeadRowProps?: TableRowProps | ((headerGroup: MRT_HeaderGroup<D>) => TableRowProps);
|
|
176
|
+
muiTablePaperProps?: PaperProps | ((tableInstance: MRT_TableInstance<D>) => PaperProps);
|
|
127
177
|
muiTablePaginationProps?: Partial<TablePaginationProps> | ((tableInstance: MRT_TableInstance<D>) => Partial<TablePaginationProps>);
|
|
128
178
|
muiTableProps?: TableProps | ((tableInstance: MRT_TableInstance<D>) => TableProps);
|
|
129
179
|
muiTableToolbarAlertBannerProps?: AlertProps | ((tableInstance: MRT_TableInstance<D>) => AlertProps);
|
|
130
180
|
muiTableToolbarBottomProps?: ToolbarProps | ((tableInstance: MRT_TableInstance<D>) => ToolbarProps);
|
|
131
181
|
muiTableToolbarTopProps?: ToolbarProps | ((tableInstance: MRT_TableInstance<D>) => ToolbarProps);
|
|
132
182
|
onCellClick?: (event: MouseEvent<HTMLTableCellElement>, cell: MRT_Cell<D>) => void;
|
|
133
|
-
onColumnHide?: (column:
|
|
134
|
-
onDetailPanelClick?: (event: MouseEvent<HTMLTableCellElement>, row:
|
|
183
|
+
onColumnHide?: (column: MRT_ColumnInstance<D>, hiddenColumns?: string[]) => void;
|
|
184
|
+
onDetailPanelClick?: (event: MouseEvent<HTMLTableCellElement>, row: MRT_Row<D>) => void;
|
|
135
185
|
onGlobalFilterChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
136
|
-
onRowClick?: (event: MouseEvent<HTMLTableRowElement>, row:
|
|
137
|
-
onRowEditSubmit?: (row:
|
|
138
|
-
onRowExpandChange?: (event: MouseEvent<HTMLButtonElement>, row:
|
|
139
|
-
onSelectAllChange?: (event: ChangeEvent, selectedRows:
|
|
140
|
-
onSelectChange?: (event: ChangeEvent, row:
|
|
186
|
+
onRowClick?: (event: MouseEvent<HTMLTableRowElement>, row: MRT_Row<D>) => void;
|
|
187
|
+
onRowEditSubmit?: (row: MRT_Row<D>) => Promise<void> | void;
|
|
188
|
+
onRowExpandChange?: (event: MouseEvent<HTMLButtonElement>, row: MRT_Row<D>) => void;
|
|
189
|
+
onSelectAllChange?: (event: ChangeEvent, selectedRows: MRT_Row<D>[]) => void;
|
|
190
|
+
onSelectChange?: (event: ChangeEvent, row: MRT_Row<D>, selectedRows: MRT_Row<D>[]) => void;
|
|
141
191
|
positionActionsColumn?: 'first' | 'last';
|
|
142
192
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
143
193
|
positionToolbarActions?: 'bottom' | 'top';
|
|
144
194
|
positionToolbarAlertBanner?: 'bottom' | 'top';
|
|
145
|
-
renderDetailPanel?: (row:
|
|
146
|
-
renderRowActionMenuItems?: (rowData:
|
|
147
|
-
renderRowActions?: (row:
|
|
195
|
+
renderDetailPanel?: (row: MRT_Row<D>) => ReactNode;
|
|
196
|
+
renderRowActionMenuItems?: (rowData: MRT_Row<D>, tableInstance: MRT_TableInstance<D>, closeMenu: () => void) => ReactNode[];
|
|
197
|
+
renderRowActions?: (row: MRT_Row<D>, tableInstance: MRT_TableInstance<D>) => ReactNode;
|
|
148
198
|
renderToolbarCustomActions?: (tableInstance: MRT_TableInstance<D>) => ReactNode;
|
|
149
199
|
renderToolbarInternalActions?: (tableInstance: MRT_TableInstance<D>, { MRT_ToggleSearchButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
|
|
150
|
-
MRT_ToggleSearchButton: FC<IconButtonProps
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
200
|
+
MRT_ToggleSearchButton: FC<IconButtonProps & {
|
|
201
|
+
tableInstance: MRT_TableInstance<D>;
|
|
202
|
+
}>;
|
|
203
|
+
MRT_ToggleFiltersButton: FC<IconButtonProps & {
|
|
204
|
+
tableInstance: MRT_TableInstance<D>;
|
|
205
|
+
}>;
|
|
206
|
+
MRT_ShowHideColumnsButton: FC<IconButtonProps & {
|
|
207
|
+
tableInstance: MRT_TableInstance<D>;
|
|
208
|
+
}>;
|
|
209
|
+
MRT_ToggleDensePaddingButton: FC<IconButtonProps & {
|
|
210
|
+
tableInstance: MRT_TableInstance<D>;
|
|
211
|
+
}>;
|
|
212
|
+
MRT_FullScreenToggleButton: FC<IconButtonProps & {
|
|
213
|
+
tableInstance: MRT_TableInstance<D>;
|
|
214
|
+
}>;
|
|
155
215
|
}) => ReactNode;
|
|
156
216
|
};
|
|
157
|
-
declare const _default: <D extends
|
|
217
|
+
declare const _default: <D extends Record<string, any> = {}>({ enableColumnActions, enableColumnFilters, enableDensePaddingToggle, enableExpandAll, enableFullScreenToggle, enableGlobalFilter, enableHiding, enablePagination, enableSelectAll, enableSorting, enableStickyHeader, filterTypes, icons, localization, positionActionsColumn, positionPagination, positionToolbarActions, positionToolbarAlertBanner, ...rest }: MaterialReactTableProps<D>) => JSX.Element;
|
|
158
218
|
export default _default;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import type { MRT_Cell } from '..';
|
|
3
|
-
export declare const commonTableBodyCellStyles: (densePadding: boolean) => {
|
|
4
|
-
p: string;
|
|
5
|
-
transition: string;
|
|
6
|
-
whiteSpace: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const commonTableBodyButtonCellStyles: (densePadding: boolean) => {
|
|
9
|
-
p: string;
|
|
10
|
-
textAlign: string;
|
|
11
|
-
transition: string;
|
|
12
|
-
};
|
|
2
|
+
import type { MRT_Cell, MRT_TableInstance } from '..';
|
|
13
3
|
interface Props {
|
|
14
4
|
cell: MRT_Cell;
|
|
5
|
+
tableInstance: MRT_TableInstance;
|
|
15
6
|
}
|
|
16
7
|
export declare const MRT_TableBodyCell: FC<Props>;
|
|
17
8
|
export {};
|
|
@@ -1,7 +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
|
+
pinned: 'left' | 'center' | 'right' | 'none';
|
|
4
5
|
row: MRT_Row;
|
|
6
|
+
tableInstance: MRT_TableInstance;
|
|
5
7
|
}
|
|
6
8
|
export declare const MRT_TableBodyRow: FC<Props>;
|
|
7
9
|
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_TableDetailPanel: FC<Props>;
|
|
7
8
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { MRT_Cell } from '..';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { MRT_Cell, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
cell: MRT_Cell;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
tableInstance: MRT_TableInstance;
|
|
5
7
|
}
|
|
6
8
|
export declare const MRT_CopyButton: FC<Props>;
|
|
7
9
|
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_EditActionButtons: 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_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 {
|
|
2
|
+
import type { MRT_Header, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
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 {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MRT_Header, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
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,22 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
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
|
-
|
|
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 {
|
|
2
|
+
import type { MRT_Header, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
4
|
+
header: MRT_Header;
|
|
5
|
+
tableInstance: MRT_TableInstance;
|
|
5
6
|
}
|
|
6
7
|
export declare const MRT_FilterTextField: FC<Props>;
|
|
7
8
|
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 {};
|