material-react-table 0.6.8 → 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 +147 -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/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 +2183 -1686
- 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 +2191 -1694
- 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 +314 -241
- package/src/body/MRT_TableBody.tsx +25 -21
- package/src/body/MRT_TableBodyCell.tsx +74 -53
- package/src/body/MRT_TableBodyRow.tsx +35 -51
- package/src/body/MRT_TableDetailPanel.tsx +16 -14
- package/src/buttons/MRT_CopyButton.tsx +36 -11
- package/src/buttons/MRT_EditActionButtons.tsx +13 -12
- package/src/buttons/MRT_ExpandAllButton.tsx +36 -28
- package/src/buttons/MRT_ExpandButton.tsx +34 -40
- 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/enums.ts +2 -1
- package/src/filtersFNs.ts +17 -3
- 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 -151
- package/src/head/MRT_TableHeadRow.tsx +15 -81
- package/src/icons.ts +3 -3
- package/src/inputs/MRT_EditCellTextField.tsx +23 -24
- package/src/inputs/MRT_FilterTextField.tsx +51 -37
- package/src/inputs/MRT_SearchTextField.tsx +63 -22
- package/src/inputs/MRT_SelectCheckbox.tsx +75 -42
- 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 +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 -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,94 +1,146 @@
|
|
|
1
|
-
import { ChangeEvent, FC, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { AlertProps, 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;
|
|
89
|
+
enabledFilterTypes?: (MRT_FILTER_TYPE | string)[];
|
|
39
90
|
filter?: MRT_FilterType | string | FilterType<D>;
|
|
40
91
|
filterSelectOptions?: (string | {
|
|
41
92
|
text: string;
|
|
42
93
|
value: string;
|
|
43
94
|
})[];
|
|
44
|
-
|
|
95
|
+
footer?: string;
|
|
96
|
+
header: string;
|
|
97
|
+
muiTableBodyCellCopyButtonProps?: ButtonProps | ((cell?: MRT_Cell<D>) => ButtonProps);
|
|
45
98
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | ((cell: MRT_Cell<D>) => TextFieldProps);
|
|
46
99
|
muiTableBodyCellProps?: TableCellProps | ((cell: MRT_Cell<D>) => TableCellProps);
|
|
47
|
-
muiTableFooterCellProps?: TableCellProps | ((column:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
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);
|
|
51
104
|
onCellEditChange?: (event: ChangeEvent<HTMLInputElement>, cell: MRT_Cell<D>) => void;
|
|
52
105
|
onFilterChange?: (event: ChangeEvent<HTMLInputElement>, filterValue: any) => void;
|
|
53
106
|
};
|
|
54
|
-
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> & {
|
|
55
108
|
columns?: MRT_ColumnInstance<D>[];
|
|
56
109
|
};
|
|
57
|
-
export declare type
|
|
58
|
-
|
|
110
|
+
export declare type MRT_Header<D extends Record<string, any> = {}> = Omit<Header<D>, 'column'> & {
|
|
111
|
+
column: MRT_ColumnInstance<D>;
|
|
59
112
|
};
|
|
60
|
-
export declare type
|
|
61
|
-
|
|
113
|
+
export declare type MRT_HeaderGroup<D extends Record<string, any> = {}> = Omit<HeaderGroup<D>, 'headers'> & {
|
|
114
|
+
headers: MRT_Header<D>[];
|
|
62
115
|
};
|
|
63
|
-
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'> & {
|
|
64
126
|
column: MRT_ColumnInstance<D>;
|
|
127
|
+
row: MRT_Row<D>;
|
|
65
128
|
};
|
|
66
129
|
export declare type MRT_FilterType = MRT_FILTER_TYPE | Function;
|
|
67
|
-
export declare type
|
|
68
|
-
currentEditingRow: MRT_Row<D> | null;
|
|
69
|
-
currentFilterTypes: {
|
|
70
|
-
[key: string]: MRT_FilterType;
|
|
71
|
-
};
|
|
72
|
-
densePadding: boolean;
|
|
73
|
-
fullScreen: boolean;
|
|
74
|
-
showFilters: boolean;
|
|
75
|
-
showSearch: boolean;
|
|
76
|
-
};
|
|
77
|
-
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> & {
|
|
78
|
-
disableColumnActions?: boolean;
|
|
79
|
-
disableColumnHiding?: boolean;
|
|
80
|
-
disableDensePaddingToggle?: boolean;
|
|
81
|
-
disableExpandAll?: boolean;
|
|
82
|
-
disableFullScreenToggle?: boolean;
|
|
83
|
-
disableSelectAll?: boolean;
|
|
84
|
-
disableSubRowTree?: boolean;
|
|
130
|
+
export declare type MaterialReactTableProps<D extends Record<string, any> = {}> = MRT_TableOptions<D> & {
|
|
85
131
|
enableClickToCopy?: boolean;
|
|
86
|
-
|
|
87
|
-
|
|
132
|
+
enableColumnActions?: boolean;
|
|
133
|
+
enableColumnPinning?: boolean;
|
|
134
|
+
enableDensePaddingToggle?: boolean;
|
|
135
|
+
enableExpandAll?: boolean;
|
|
136
|
+
enableFullScreenToggle?: boolean;
|
|
137
|
+
enablePagination?: boolean;
|
|
88
138
|
enableRowActions?: boolean;
|
|
139
|
+
enableStickyHeader?: boolean;
|
|
89
140
|
enableRowEditing?: boolean;
|
|
90
141
|
enableRowNumbers?: boolean;
|
|
91
|
-
|
|
142
|
+
enableSelectAll?: boolean;
|
|
143
|
+
enabledGlobalFilterTypes?: (MRT_FILTER_TYPE | string)[];
|
|
92
144
|
filterTypes?: {
|
|
93
145
|
[key in MRT_FILTER_TYPE]: any;
|
|
94
146
|
};
|
|
@@ -99,55 +151,68 @@ export declare type MaterialReactTableProps<D extends {} = {}> = UseTableOptions
|
|
|
99
151
|
hideToolbarTop?: boolean;
|
|
100
152
|
icons?: Partial<MRT_Icons>;
|
|
101
153
|
idPrefix?: string;
|
|
102
|
-
|
|
154
|
+
isReloading?: boolean;
|
|
103
155
|
isLoading?: boolean;
|
|
104
156
|
localization?: Partial<MRT_Localization>;
|
|
105
157
|
muiLinearProgressProps?: LinearProgressProps | ((tableInstance: MRT_TableInstance) => LinearProgressProps);
|
|
106
158
|
muiSearchTextFieldProps?: TextFieldProps;
|
|
159
|
+
muiSelectCheckboxProps?: CheckboxProps | ((isSelectAll?: boolean, row?: MRT_Row<D>, tableInstance?: MRT_TableInstance<D>) => CheckboxProps);
|
|
160
|
+
muiTableBodyCellCopyButtonProps?: ButtonProps | ((cell?: MRT_Cell<D>) => ButtonProps);
|
|
107
161
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | ((cell?: MRT_Cell<D>) => TextFieldProps);
|
|
108
162
|
muiTableBodyCellProps?: TableCellProps | ((cell?: MRT_Cell<D>) => TableCellProps);
|
|
109
163
|
muiTableBodyCellSkeletonProps?: SkeletonProps | ((cell?: MRT_Cell<D>) => SkeletonProps);
|
|
110
164
|
muiTableBodyProps?: TableBodyProps | ((tableInstance: MRT_TableInstance<D>) => TableBodyProps);
|
|
111
|
-
muiTableBodyRowProps?: TableRowProps | ((row:
|
|
165
|
+
muiTableBodyRowProps?: TableRowProps | ((row: MRT_Row<D>) => TableRowProps);
|
|
112
166
|
muiTableContainerProps?: TableContainerProps | ((tableInstance: MRT_TableInstance<D>) => TableContainerProps);
|
|
113
|
-
muiTableDetailPanelProps?: TableCellProps | ((row:
|
|
114
|
-
muiTableFooterCellProps?: TableCellProps | ((column:
|
|
115
|
-
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | ((column: Column<D>) => IconButtonProps);
|
|
167
|
+
muiTableDetailPanelProps?: TableCellProps | ((row: MRT_Row<D>) => TableCellProps);
|
|
168
|
+
muiTableFooterCellProps?: TableCellProps | ((column: MRT_ColumnInstance<D>) => TableCellProps);
|
|
116
169
|
muiTableFooterProps?: TableFooterProps | ((tableInstance: MRT_TableInstance<D>) => TableFooterProps);
|
|
117
170
|
muiTableFooterRowProps?: TableRowProps | ((footerGroup: MRT_HeaderGroup<D>) => TableRowProps);
|
|
118
|
-
|
|
119
|
-
|
|
171
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | ((column: MRT_ColumnInstance<D>) => IconButtonProps);
|
|
172
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | ((column: MRT_ColumnInstance<D>) => TextFieldProps);
|
|
173
|
+
muiTableHeadCellProps?: TableCellProps | ((column: MRT_ColumnInstance<D>) => TableCellProps);
|
|
120
174
|
muiTableHeadProps?: TableHeadProps | ((tableInstance: MRT_TableInstance<D>) => TableHeadProps);
|
|
121
|
-
muiTableHeadRowProps?: TableRowProps | ((
|
|
175
|
+
muiTableHeadRowProps?: TableRowProps | ((headerGroup: MRT_HeaderGroup<D>) => TableRowProps);
|
|
176
|
+
muiTablePaperProps?: PaperProps | ((tableInstance: MRT_TableInstance<D>) => PaperProps);
|
|
122
177
|
muiTablePaginationProps?: Partial<TablePaginationProps> | ((tableInstance: MRT_TableInstance<D>) => Partial<TablePaginationProps>);
|
|
123
178
|
muiTableProps?: TableProps | ((tableInstance: MRT_TableInstance<D>) => TableProps);
|
|
124
179
|
muiTableToolbarAlertBannerProps?: AlertProps | ((tableInstance: MRT_TableInstance<D>) => AlertProps);
|
|
125
180
|
muiTableToolbarBottomProps?: ToolbarProps | ((tableInstance: MRT_TableInstance<D>) => ToolbarProps);
|
|
126
181
|
muiTableToolbarTopProps?: ToolbarProps | ((tableInstance: MRT_TableInstance<D>) => ToolbarProps);
|
|
127
182
|
onCellClick?: (event: MouseEvent<HTMLTableCellElement>, cell: MRT_Cell<D>) => void;
|
|
128
|
-
onColumnHide?: (column:
|
|
129
|
-
onDetailPanelClick?: (event: MouseEvent<HTMLTableCellElement>, row:
|
|
183
|
+
onColumnHide?: (column: MRT_ColumnInstance<D>, hiddenColumns?: string[]) => void;
|
|
184
|
+
onDetailPanelClick?: (event: MouseEvent<HTMLTableCellElement>, row: MRT_Row<D>) => void;
|
|
130
185
|
onGlobalFilterChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
131
|
-
onRowClick?: (event: MouseEvent<HTMLTableRowElement>, row:
|
|
132
|
-
onRowEditSubmit?: (row:
|
|
133
|
-
onRowExpandChange?: (event: MouseEvent<HTMLButtonElement>, row:
|
|
134
|
-
|
|
135
|
-
|
|
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;
|
|
136
191
|
positionActionsColumn?: 'first' | 'last';
|
|
137
192
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
138
193
|
positionToolbarActions?: 'bottom' | 'top';
|
|
139
194
|
positionToolbarAlertBanner?: 'bottom' | 'top';
|
|
140
|
-
renderDetailPanel?: (row:
|
|
141
|
-
renderRowActionMenuItems?: (rowData:
|
|
142
|
-
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;
|
|
143
198
|
renderToolbarCustomActions?: (tableInstance: MRT_TableInstance<D>) => ReactNode;
|
|
144
199
|
renderToolbarInternalActions?: (tableInstance: MRT_TableInstance<D>, { MRT_ToggleSearchButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
|
|
145
|
-
MRT_ToggleSearchButton: FC<IconButtonProps
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
+
}>;
|
|
150
215
|
}) => ReactNode;
|
|
151
216
|
};
|
|
152
|
-
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;
|
|
153
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 {};
|
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",
|
package/dist/filtersFNs.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { MRT_Row } from '.';
|
|
2
|
-
export declare const
|
|
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,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 {};
|