material-react-table 1.0.0-beta.7 → 1.0.0-rc.0
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/README.md +21 -21
- package/dist/cjs/MaterialReactTable.d.ts +112 -7
- package/dist/cjs/_locales/en.d.ts +2 -0
- package/dist/cjs/_locales/pt-BR.d.ts +2 -0
- package/dist/cjs/column.utils.d.ts +6 -0
- package/dist/cjs/head/MRT_TableHeadCellSortLabel.d.ts +2 -0
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +226 -82
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/inputs/MRT_FilterCheckbox.d.ts +8 -0
- package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +3 -3
- package/dist/cjs/table/MRT_TableRoot.d.ts +254 -2
- package/dist/cjs/toolbar/MRT_TablePagination.d.ts +3 -4
- package/dist/cjs/toolbar/MRT_ToolbarInternalButtons.d.ts +3 -4
- package/dist/cjs/toolbar/MRT_TopToolbar.d.ts +1 -0
- package/dist/esm/MaterialReactTable.d.ts +112 -7
- package/dist/esm/_locales/en.d.ts +2 -0
- package/dist/esm/_locales/pt-BR.d.ts +2 -0
- package/dist/esm/column.utils.d.ts +6 -0
- package/dist/esm/head/MRT_TableHeadCellSortLabel.d.ts +2 -0
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/inputs/MRT_FilterCheckbox.d.ts +8 -0
- package/dist/esm/material-react-table.esm.js +226 -84
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +3 -3
- package/dist/esm/table/MRT_TableRoot.d.ts +254 -2
- package/dist/esm/toolbar/MRT_TablePagination.d.ts +3 -4
- package/dist/esm/toolbar/MRT_ToolbarInternalButtons.d.ts +3 -4
- package/dist/esm/toolbar/MRT_TopToolbar.d.ts +1 -0
- package/dist/index.d.ts +61 -28
- package/locales/en.d.ts +2 -0
- package/locales/en.esm.d.ts +2 -0
- package/locales/en.esm.js +92 -0
- package/locales/en.esm.js.map +1 -0
- package/locales/en.js +96 -0
- package/locales/en.js.map +1 -0
- package/locales/pt-BR.d.ts +2 -0
- package/locales/pt-BR.esm.d.ts +2 -0
- package/locales/pt-BR.esm.js +92 -0
- package/locales/pt-BR.esm.js.map +1 -0
- package/locales/pt-BR.js +96 -0
- package/locales/pt-BR.js.map +1 -0
- package/package.json +13 -11
- package/src/MaterialReactTable.tsx +205 -67
- package/src/_locales/de.ts +1 -0
- package/src/{localization.ts → _locales/en.ts} +8 -84
- package/src/_locales/es.ts +1 -0
- package/src/_locales/fr.ts +1 -0
- package/src/_locales/hi.ts +1 -0
- package/src/_locales/id.ts +1 -0
- package/src/_locales/ja.ts +1 -0
- package/src/_locales/nl.ts +1 -0
- package/src/_locales/pt-BR.ts +92 -0
- package/src/_locales/pt.ts +1 -0
- package/src/_locales/ru.ts +1 -0
- package/src/_locales/uk.ts +1 -0
- package/src/_locales/vi.ts +1 -0
- package/src/_locales/zh.ts +1 -0
- package/src/body/MRT_EditRowModal.tsx +3 -2
- package/src/body/MRT_TableBodyCell.tsx +1 -1
- package/src/body/MRT_TableBodyRow.tsx +1 -1
- package/src/body/MRT_TableDetailPanel.tsx +1 -1
- package/src/buttons/MRT_ExpandAllButton.tsx +1 -1
- package/src/buttons/MRT_ExpandButton.tsx +1 -1
- package/src/buttons/MRT_GrabHandleButton.tsx +1 -1
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +7 -2
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +1 -1
- package/src/column.utils.ts +28 -3
- package/src/footer/MRT_TableFooter.tsx +1 -1
- package/src/head/MRT_TableHead.tsx +10 -2
- package/src/head/MRT_TableHeadCell.tsx +10 -2
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +1 -1
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +7 -3
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +5 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +1 -1
- package/src/head/MRT_TableHeadCellSortLabel.tsx +11 -3
- package/src/index.tsx +6 -3
- package/src/inputs/MRT_FilterCheckbox.tsx +96 -0
- package/src/inputs/MRT_FilterTextField.tsx +19 -13
- package/src/inputs/MRT_GlobalFilterTextField.tsx +18 -5
- package/src/inputs/MRT_SelectCheckbox.tsx +16 -7
- package/src/menus/MRT_FilterOptionMenu.tsx +19 -2
- package/src/table/MRT_TablePaper.tsx +27 -21
- package/src/table/MRT_TableRoot.tsx +27 -8
- package/src/toolbar/MRT_BottomToolbar.tsx +4 -1
- package/src/toolbar/MRT_TablePagination.tsx +45 -8
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +2 -1
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -4
- package/src/toolbar/MRT_TopToolbar.tsx +2 -1
- package/dist/cjs/localization.d.ts +0 -84
- package/dist/esm/localization.d.ts +0 -84
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { MRT_Header, MRT_InternalFilterOption, MRT_TableInstance } from '..';
|
|
2
|
-
import { MRT_Localization } from '../localization';
|
|
1
|
+
import type { MRT_Header, MRT_InternalFilterOption, MRT_Localization, MRT_TableInstance } from '..';
|
|
3
2
|
export declare const mrtFilterOptions: (localization: MRT_Localization) => MRT_InternalFilterOption[];
|
|
4
3
|
interface Props<TData extends Record<string, any> = {}> {
|
|
5
4
|
anchorEl: HTMLElement | null;
|
|
6
5
|
header?: MRT_Header<TData>;
|
|
7
6
|
onSelect?: () => void;
|
|
8
7
|
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
8
|
+
setFilterValue?: (filterValue: any) => void;
|
|
9
9
|
table: MRT_TableInstance<TData>;
|
|
10
10
|
}
|
|
11
|
-
export declare const MRT_FilterOptionMenu: <TData extends Record<string, any> = {}>({ anchorEl, header, onSelect, setAnchorEl, table, }: Props<TData>) => JSX.Element;
|
|
11
|
+
export declare const MRT_FilterOptionMenu: <TData extends Record<string, any> = {}>({ anchorEl, header, onSelect, setAnchorEl, setFilterValue, table, }: Props<TData>) => JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,2 +1,254 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MRT_Cell, MRT_Column, MRT_ColumnDef, MRT_FilterOption, MRT_Row, MRT_TableInstance, MRT_TableState, MaterialReactTableProps, MRT_Localization } from '..';
|
|
3
|
+
export declare const MRT_TableRoot: <TData extends Record<string, any> = {}>(props: Omit<Partial<import("@tanstack/table-core").TableOptions<TData>>, "state" | "data" | "onStateChange" | "initialState" | "columns" | "defaultColumn" | "enableRowSelection" | "expandRowsFn"> & {
|
|
4
|
+
columnFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined;
|
|
5
|
+
columns: MRT_ColumnDef<TData>[];
|
|
6
|
+
data: TData[];
|
|
7
|
+
defaultColumn?: Partial<MRT_ColumnDef<TData>> | undefined;
|
|
8
|
+
defaultDisplayColumn?: Partial<MRT_ColumnDef<TData>> | undefined;
|
|
9
|
+
displayColumnDefOptions?: Partial<{
|
|
10
|
+
"mrt-row-drag": Partial<MRT_ColumnDef<{}>>;
|
|
11
|
+
"mrt-row-actions": Partial<MRT_ColumnDef<{}>>;
|
|
12
|
+
"mrt-row-expand": Partial<MRT_ColumnDef<{}>>;
|
|
13
|
+
"mrt-row-select": Partial<MRT_ColumnDef<{}>>;
|
|
14
|
+
"mrt-row-numbers": Partial<MRT_ColumnDef<{}>>;
|
|
15
|
+
}> | undefined;
|
|
16
|
+
editingMode?: "cell" | "row" | "table" | "modal" | undefined;
|
|
17
|
+
enableBottomToolbar?: boolean | undefined;
|
|
18
|
+
enableClickToCopy?: boolean | undefined;
|
|
19
|
+
enableColumnActions?: boolean | undefined;
|
|
20
|
+
enableColumnDragging?: boolean | undefined;
|
|
21
|
+
enableColumnFilterModes?: boolean | undefined;
|
|
22
|
+
enableColumnOrdering?: boolean | undefined;
|
|
23
|
+
enableDensityToggle?: boolean | undefined;
|
|
24
|
+
enableEditing?: boolean | undefined;
|
|
25
|
+
enableExpandAll?: boolean | undefined;
|
|
26
|
+
enableFullScreenToggle?: boolean | undefined;
|
|
27
|
+
enableGlobalFilterModes?: boolean | undefined;
|
|
28
|
+
enableGlobalFilterRankedResults?: boolean | undefined;
|
|
29
|
+
enablePagination?: boolean | undefined;
|
|
30
|
+
enableRowActions?: boolean | undefined;
|
|
31
|
+
enableRowDragging?: boolean | undefined;
|
|
32
|
+
enableRowNumbers?: boolean | undefined;
|
|
33
|
+
enableRowOrdering?: boolean | undefined;
|
|
34
|
+
enableRowSelection?: boolean | ((row: MRT_Row<TData>) => boolean) | undefined;
|
|
35
|
+
enableRowVirtualization?: boolean | undefined;
|
|
36
|
+
enableSelectAll?: boolean | undefined;
|
|
37
|
+
enableStickyFooter?: boolean | undefined;
|
|
38
|
+
enableStickyHeader?: boolean | undefined;
|
|
39
|
+
enableTableFooter?: boolean | undefined;
|
|
40
|
+
enableTableHead?: boolean | undefined;
|
|
41
|
+
enableToolbarInternalActions?: boolean | undefined;
|
|
42
|
+
enableTopToolbar?: boolean | undefined;
|
|
43
|
+
globalFilterModeOptions?: (string | (string & Record<never, never>))[] | null | undefined;
|
|
44
|
+
expandRowsFn?: ((dataRow: TData) => TData[]) | undefined;
|
|
45
|
+
icons?: Partial<import("..").MRT_Icons> | undefined;
|
|
46
|
+
initialState?: Partial<MRT_TableState<TData>> | undefined;
|
|
47
|
+
localization?: Partial<MRT_Localization> | undefined;
|
|
48
|
+
muiBottomToolbarProps?: import("@mui/material").ToolbarProps<"div", {}> | (({ table }: {
|
|
49
|
+
table: MRT_TableInstance<TData>;
|
|
50
|
+
}) => import("@mui/material").ToolbarProps<"div", {}>) | undefined;
|
|
51
|
+
muiExpandAllButtonProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table }: {
|
|
52
|
+
table: MRT_TableInstance<TData>;
|
|
53
|
+
}) => import("@mui/material").IconButtonProps<"button", {}>) | undefined;
|
|
54
|
+
muiExpandButtonProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ row, table, }: {
|
|
55
|
+
table: MRT_TableInstance<TData>;
|
|
56
|
+
row: MRT_Row<TData>;
|
|
57
|
+
}) => import("@mui/material").IconButtonProps<"button", {}>) | undefined;
|
|
58
|
+
muiLinearProgressProps?: import("@mui/material").LinearProgressProps | (({ isTopToolbar, table, }: {
|
|
59
|
+
isTopToolbar: boolean;
|
|
60
|
+
table: MRT_TableInstance<TData>;
|
|
61
|
+
}) => import("@mui/material").LinearProgressProps) | undefined;
|
|
62
|
+
muiSearchTextFieldProps?: import("@mui/material").TextFieldProps | (({ table }: {
|
|
63
|
+
table: MRT_TableInstance<TData>;
|
|
64
|
+
}) => import("@mui/material").TextFieldProps) | undefined;
|
|
65
|
+
muiSelectAllCheckboxProps?: import("@mui/material").CheckboxProps | (({ table }: {
|
|
66
|
+
table: MRT_TableInstance<TData>;
|
|
67
|
+
}) => import("@mui/material").CheckboxProps) | undefined;
|
|
68
|
+
muiSelectCheckboxProps?: import("@mui/material").CheckboxProps | (({ table, row, }: {
|
|
69
|
+
table: MRT_TableInstance<TData>;
|
|
70
|
+
row: MRT_Row<TData>;
|
|
71
|
+
}) => import("@mui/material").CheckboxProps) | undefined;
|
|
72
|
+
muiTableBodyCellCopyButtonProps?: import("@mui/material").ButtonProps<"button", {}> | (({ cell, column, row, table, }: {
|
|
73
|
+
cell: MRT_Cell<TData>;
|
|
74
|
+
column: MRT_Column<TData>;
|
|
75
|
+
row: MRT_Row<TData>;
|
|
76
|
+
table: MRT_TableInstance<TData>;
|
|
77
|
+
}) => import("@mui/material").ButtonProps<"button", {}>) | undefined;
|
|
78
|
+
muiTableBodyCellEditTextFieldProps?: import("@mui/material").TextFieldProps | (({ cell, column, row, table, }: {
|
|
79
|
+
cell: MRT_Cell<TData>;
|
|
80
|
+
column: MRT_Column<TData>;
|
|
81
|
+
row: MRT_Row<TData>;
|
|
82
|
+
table: MRT_TableInstance<TData>;
|
|
83
|
+
}) => import("@mui/material").TextFieldProps) | undefined;
|
|
84
|
+
muiTableBodyCellProps?: import("@mui/material").TableCellProps | (({ cell, column, row, table, }: {
|
|
85
|
+
cell: MRT_Cell<TData>;
|
|
86
|
+
column: MRT_Column<TData>;
|
|
87
|
+
row: MRT_Row<TData>;
|
|
88
|
+
table: MRT_TableInstance<TData>;
|
|
89
|
+
}) => import("@mui/material").TableCellProps) | undefined;
|
|
90
|
+
muiTableBodyCellSkeletonProps?: import("@mui/material").SkeletonProps<"span", {}> | (({ cell, column, row, table, }: {
|
|
91
|
+
cell: MRT_Cell<TData>;
|
|
92
|
+
column: MRT_Column<TData>;
|
|
93
|
+
row: MRT_Row<TData>;
|
|
94
|
+
table: MRT_TableInstance<TData>;
|
|
95
|
+
}) => import("@mui/material").SkeletonProps<"span", {}>) | undefined;
|
|
96
|
+
muiTableBodyProps?: import("@mui/material").TableBodyProps<"tbody", {}> | (({ table }: {
|
|
97
|
+
table: MRT_TableInstance<TData>;
|
|
98
|
+
}) => import("@mui/material").TableBodyProps<"tbody", {}>) | undefined;
|
|
99
|
+
muiTableBodyRowDragHandleProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table, row, }: {
|
|
100
|
+
table: MRT_TableInstance<TData>;
|
|
101
|
+
row: MRT_Row<TData>;
|
|
102
|
+
}) => import("@mui/material").IconButtonProps<"button", {}>) | undefined;
|
|
103
|
+
muiTableBodyRowProps?: import("@mui/material").TableRowProps<"tr", {}> | (({ table, row, }: {
|
|
104
|
+
table: MRT_TableInstance<TData>;
|
|
105
|
+
row: MRT_Row<TData>;
|
|
106
|
+
}) => import("@mui/material").TableRowProps<"tr", {}>) | undefined;
|
|
107
|
+
muiTableContainerProps?: import("@mui/material").TableContainerProps<"div", {}> | (({ table, }: {
|
|
108
|
+
table: MRT_TableInstance<TData>;
|
|
109
|
+
}) => import("@mui/material").TableContainerProps<"div", {}>) | undefined;
|
|
110
|
+
muiTableDetailPanelProps?: import("@mui/material").TableCellProps | (({ table, row, }: {
|
|
111
|
+
table: MRT_TableInstance<TData>;
|
|
112
|
+
row: MRT_Row<TData>;
|
|
113
|
+
}) => import("@mui/material").TableCellProps) | undefined;
|
|
114
|
+
muiTableFooterCellProps?: import("@mui/material").TableCellProps | (({ table, column, }: {
|
|
115
|
+
table: MRT_TableInstance<TData>;
|
|
116
|
+
column: MRT_Column<TData>;
|
|
117
|
+
}) => import("@mui/material").TableCellProps) | undefined;
|
|
118
|
+
muiTableFooterProps?: import("@mui/material").TableFooterProps<"tfoot", {}> | (({ table }: {
|
|
119
|
+
table: MRT_TableInstance<TData>;
|
|
120
|
+
}) => import("@mui/material").TableFooterProps<"tfoot", {}>) | undefined;
|
|
121
|
+
muiTableFooterRowProps?: import("@mui/material").TableRowProps<"tr", {}> | (({ table, footerGroup, }: {
|
|
122
|
+
table: MRT_TableInstance<TData>;
|
|
123
|
+
footerGroup: import("..").MRT_HeaderGroup<TData>;
|
|
124
|
+
}) => import("@mui/material").TableRowProps<"tr", {}>) | undefined;
|
|
125
|
+
muiTableHeadCellColumnActionsButtonProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table, column, }: {
|
|
126
|
+
table: MRT_TableInstance<TData>;
|
|
127
|
+
column: MRT_Column<TData>;
|
|
128
|
+
}) => import("@mui/material").IconButtonProps<"button", {}>) | undefined;
|
|
129
|
+
muiTableHeadCellDragHandleProps?: import("@mui/material").IconButtonProps<"button", {}> | (({ table, column, }: {
|
|
130
|
+
table: MRT_TableInstance<TData>;
|
|
131
|
+
column: MRT_Column<TData>;
|
|
132
|
+
}) => import("@mui/material").IconButtonProps<"button", {}>) | undefined;
|
|
133
|
+
muiTableHeadCellFilterCheckboxProps?: import("@mui/material").CheckboxProps | (({ column, table, }: {
|
|
134
|
+
column: MRT_Column<TData>;
|
|
135
|
+
table: MRT_TableInstance<TData>;
|
|
136
|
+
}) => import("@mui/material").CheckboxProps) | undefined;
|
|
137
|
+
muiTableHeadCellFilterTextFieldProps?: import("@mui/material").TextFieldProps | (({ table, column, rangeFilterIndex, }: {
|
|
138
|
+
table: MRT_TableInstance<TData>;
|
|
139
|
+
column: MRT_Column<TData>;
|
|
140
|
+
rangeFilterIndex?: number | undefined;
|
|
141
|
+
}) => import("@mui/material").TextFieldProps) | undefined;
|
|
142
|
+
muiTableHeadCellProps?: import("@mui/material").TableCellProps | (({ table, column, }: {
|
|
143
|
+
table: MRT_TableInstance<TData>;
|
|
144
|
+
column: MRT_Column<TData>;
|
|
145
|
+
}) => import("@mui/material").TableCellProps) | undefined;
|
|
146
|
+
muiTableHeadProps?: import("@mui/material").TableHeadProps<"thead", {}> | (({ table }: {
|
|
147
|
+
table: MRT_TableInstance<TData>;
|
|
148
|
+
}) => import("@mui/material").TableHeadProps<"thead", {}>) | undefined;
|
|
149
|
+
muiTableHeadRowProps?: import("@mui/material").TableRowProps<"tr", {}> | (({ table, headerGroup, }: {
|
|
150
|
+
table: MRT_TableInstance<TData>;
|
|
151
|
+
headerGroup: import("..").MRT_HeaderGroup<TData>;
|
|
152
|
+
}) => import("@mui/material").TableRowProps<"tr", {}>) | undefined;
|
|
153
|
+
muiTablePaginationProps?: Partial<import("@mui/material").TablePaginationProps<React.JSXElementConstructor<import("@mui/material").TablePaginationBaseProps>, {}>> | (({ table, }: {
|
|
154
|
+
table: MRT_TableInstance<TData>;
|
|
155
|
+
}) => Partial<import("@mui/material").TablePaginationProps<React.JSXElementConstructor<import("@mui/material").TablePaginationBaseProps>, {}>>) | undefined;
|
|
156
|
+
muiTablePaperProps?: import("@mui/material").PaperProps<"div", {}> | (({ table }: {
|
|
157
|
+
table: MRT_TableInstance<TData>;
|
|
158
|
+
}) => import("@mui/material").PaperProps<"div", {}>) | undefined;
|
|
159
|
+
muiTableProps?: import("@mui/material").TableProps<"table", {}> | (({ table }: {
|
|
160
|
+
table: MRT_TableInstance<TData>;
|
|
161
|
+
}) => import("@mui/material").TableProps<"table", {}>) | undefined;
|
|
162
|
+
muiToolbarAlertBannerChipProps?: import("@mui/material").ChipProps<"div", {}> | (({ table }: {
|
|
163
|
+
table: MRT_TableInstance<TData>;
|
|
164
|
+
}) => import("@mui/material").ChipProps<"div", {}>) | undefined;
|
|
165
|
+
muiToolbarAlertBannerProps?: import("@mui/material").AlertProps | (({ table }: {
|
|
166
|
+
table: MRT_TableInstance<TData>;
|
|
167
|
+
}) => import("@mui/material").AlertProps) | undefined;
|
|
168
|
+
muiTopToolbarProps?: import("@mui/material").ToolbarProps<"div", {}> | (({ table }: {
|
|
169
|
+
table: MRT_TableInstance<TData>;
|
|
170
|
+
}) => import("@mui/material").ToolbarProps<"div", {}>) | undefined;
|
|
171
|
+
onDensityChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined;
|
|
172
|
+
onDraggingColumnChange?: import("@tanstack/table-core").OnChangeFn<MRT_Column<TData> | null> | undefined;
|
|
173
|
+
onDraggingRowChange?: import("@tanstack/table-core").OnChangeFn<MRT_Row<TData> | null> | undefined;
|
|
174
|
+
onEditingCellChange?: import("@tanstack/table-core").OnChangeFn<MRT_Cell<TData> | null> | undefined;
|
|
175
|
+
onEditingRowSave?: (({ exitEditingMode, row, table, values, }: {
|
|
176
|
+
exitEditingMode: () => void;
|
|
177
|
+
row: MRT_Row<TData>;
|
|
178
|
+
table: MRT_TableInstance<TData>;
|
|
179
|
+
values: Record<(string & Record<never, never>) | (string & import("@tanstack/table-core").DeepKeys<TData>), any>;
|
|
180
|
+
}) => void | Promise<void>) | undefined;
|
|
181
|
+
onEditingRowChange?: import("@tanstack/table-core").OnChangeFn<MRT_Row<TData> | null> | undefined;
|
|
182
|
+
onFilterFnsChange?: import("@tanstack/table-core").OnChangeFn<{
|
|
183
|
+
[key: string]: MRT_FilterOption;
|
|
184
|
+
}> | undefined;
|
|
185
|
+
onGlobalFilterFnChange?: import("@tanstack/table-core").OnChangeFn<MRT_FilterOption> | undefined;
|
|
186
|
+
onHoveredColumnChange?: import("@tanstack/table-core").OnChangeFn<MRT_Column<TData> | null> | undefined;
|
|
187
|
+
onHoveredRowChange?: import("@tanstack/table-core").OnChangeFn<MRT_Row<TData> | null> | undefined;
|
|
188
|
+
onIsFullScreenChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined;
|
|
189
|
+
onShowAlertBannerChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined;
|
|
190
|
+
onShowFiltersChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined;
|
|
191
|
+
onShowGlobalFilterChange?: import("@tanstack/table-core").OnChangeFn<boolean> | undefined;
|
|
192
|
+
positionActionsColumn?: "first" | "last" | undefined;
|
|
193
|
+
positionExpandColumn?: "first" | "last" | undefined;
|
|
194
|
+
positionGlobalFilter?: "left" | "right" | undefined;
|
|
195
|
+
positionPagination?: "bottom" | "top" | "both" | undefined;
|
|
196
|
+
positionToolbarAlertBanner?: "bottom" | "top" | "none" | undefined;
|
|
197
|
+
positionToolbarDropZone?: "bottom" | "top" | "none" | "both" | undefined;
|
|
198
|
+
renderBottomToolbar?: React.ReactNode | (({ table }: {
|
|
199
|
+
table: MRT_TableInstance<TData>;
|
|
200
|
+
}) => React.ReactNode);
|
|
201
|
+
renderBottomToolbarCustomActions?: (({ table, }: {
|
|
202
|
+
table: MRT_TableInstance<TData>;
|
|
203
|
+
}) => React.ReactNode) | undefined;
|
|
204
|
+
renderColumnActionsMenuItems?: (({ column, closeMenu, table, }: {
|
|
205
|
+
column: MRT_Column<TData>;
|
|
206
|
+
closeMenu: () => void;
|
|
207
|
+
table: MRT_TableInstance<TData>;
|
|
208
|
+
}) => React.ReactNode[]) | undefined;
|
|
209
|
+
renderColumnFilterModeMenuItems?: (({ column, internalFilterOptions, onSelectFilterMode, table, }: {
|
|
210
|
+
column: MRT_Column<TData>;
|
|
211
|
+
internalFilterOptions: import("..").MRT_InternalFilterOption[];
|
|
212
|
+
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
213
|
+
table: MRT_TableInstance<TData>;
|
|
214
|
+
}) => React.ReactNode[]) | undefined;
|
|
215
|
+
renderDetailPanel?: (({ row, table, }: {
|
|
216
|
+
row: MRT_Row<TData>;
|
|
217
|
+
table: MRT_TableInstance<TData>;
|
|
218
|
+
}) => React.ReactNode) | undefined;
|
|
219
|
+
renderGlobalFilterModeMenuItems?: (({ internalFilterOptions, onSelectFilterMode, table, }: {
|
|
220
|
+
internalFilterOptions: import("..").MRT_InternalFilterOption[];
|
|
221
|
+
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
222
|
+
table: MRT_TableInstance<TData>;
|
|
223
|
+
}) => React.ReactNode[]) | undefined;
|
|
224
|
+
renderRowActionMenuItems?: (({ closeMenu, row, table, }: {
|
|
225
|
+
closeMenu: () => void;
|
|
226
|
+
row: MRT_Row<TData>;
|
|
227
|
+
table: MRT_TableInstance<TData>;
|
|
228
|
+
}) => React.ReactNode[]) | undefined;
|
|
229
|
+
renderRowActions?: (({ cell, row, table, }: {
|
|
230
|
+
cell: MRT_Cell<TData>;
|
|
231
|
+
row: MRT_Row<TData>;
|
|
232
|
+
table: MRT_TableInstance<TData>;
|
|
233
|
+
}) => React.ReactNode) | undefined;
|
|
234
|
+
renderToolbarInternalActions?: (({ table, }: {
|
|
235
|
+
table: MRT_TableInstance<TData>;
|
|
236
|
+
}) => React.ReactNode) | undefined;
|
|
237
|
+
renderTopToolbar?: React.ReactNode | (({ table }: {
|
|
238
|
+
table: MRT_TableInstance<TData>;
|
|
239
|
+
}) => React.ReactNode);
|
|
240
|
+
renderTopToolbarCustomActions?: (({ table, }: {
|
|
241
|
+
table: MRT_TableInstance<TData>;
|
|
242
|
+
}) => React.ReactNode) | undefined;
|
|
243
|
+
rowCount?: number | undefined;
|
|
244
|
+
rowNumberMode?: "original" | "static" | undefined;
|
|
245
|
+
selectAllMode?: "all" | "page" | undefined;
|
|
246
|
+
state?: Partial<MRT_TableState<TData>> | undefined;
|
|
247
|
+
tableInstanceRef?: React.MutableRefObject<MRT_TableInstance<TData> | null> | undefined;
|
|
248
|
+
virtualizerProps?: Partial<import("react-virtual").Options<HTMLDivElement>> | (({ table, }: {
|
|
249
|
+
table: MRT_TableInstance<TData>;
|
|
250
|
+
}) => Partial<import("react-virtual").Options<HTMLDivElement>>) | undefined;
|
|
251
|
+
virtualizerInstanceRef?: React.MutableRefObject<import("..").Virtualizer | null> | undefined;
|
|
252
|
+
} & {
|
|
253
|
+
localization: MRT_Localization;
|
|
254
|
+
}) => JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import { MRT_TableInstance } from '..';
|
|
3
|
-
interface Props {
|
|
4
|
-
table: MRT_TableInstance;
|
|
2
|
+
interface Props<TData extends Record<string, any> = {}> {
|
|
5
3
|
position: 'top' | 'bottom';
|
|
4
|
+
table: MRT_TableInstance<TData>;
|
|
6
5
|
}
|
|
7
|
-
export declare const MRT_TablePagination:
|
|
6
|
+
export declare const MRT_TablePagination: <TData extends Record<string, any> = {}>({ table, position, }: Props<TData>) => JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import type { MRT_TableInstance } from '..';
|
|
3
|
-
interface Props {
|
|
4
|
-
table: MRT_TableInstance
|
|
2
|
+
interface Props<TData extends Record<string, any> = {}> {
|
|
3
|
+
table: MRT_TableInstance<TData>;
|
|
5
4
|
}
|
|
6
|
-
export declare const MRT_ToolbarInternalButtons:
|
|
5
|
+
export declare const MRT_ToolbarInternalButtons: <TData extends Record<string, any> = {}>({ table, }: Props<TData>) => JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -4,9 +4,97 @@ import type { Cell, Column, ColumnDef, DeepKeys, FilterFn, Header, HeaderGroup,
|
|
|
4
4
|
import type { Options as VirtualizerOptions, VirtualItem } from 'react-virtual';
|
|
5
5
|
import { MRT_Icons } from './icons';
|
|
6
6
|
import { MRT_FilterFns } from './filterFns';
|
|
7
|
-
import { MRT_Localization } from './localization';
|
|
8
7
|
import { MRT_SortingFns } from './sortingFns';
|
|
9
8
|
declare type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
|
9
|
+
export interface MRT_Localization {
|
|
10
|
+
actions: string;
|
|
11
|
+
and: string;
|
|
12
|
+
cancel: string;
|
|
13
|
+
changeFilterMode: string;
|
|
14
|
+
changeSearchMode: string;
|
|
15
|
+
clearFilter: string;
|
|
16
|
+
clearSearch: string;
|
|
17
|
+
clearSort: string;
|
|
18
|
+
clickToCopy: string;
|
|
19
|
+
columnActions: string;
|
|
20
|
+
copiedToClipboard: string;
|
|
21
|
+
dropToGroupBy: string;
|
|
22
|
+
edit: string;
|
|
23
|
+
expand: string;
|
|
24
|
+
expandAll: string;
|
|
25
|
+
filterArrIncludes: string;
|
|
26
|
+
filterArrIncludesAll: string;
|
|
27
|
+
filterArrIncludesSome: string;
|
|
28
|
+
filterBetween: string;
|
|
29
|
+
filterBetweenInclusive: string;
|
|
30
|
+
filterByColumn: string;
|
|
31
|
+
filterContains: string;
|
|
32
|
+
filterEmpty: string;
|
|
33
|
+
filterEndsWith: string;
|
|
34
|
+
filterEquals: string;
|
|
35
|
+
filterEqualsString: string;
|
|
36
|
+
filterFuzzy: string;
|
|
37
|
+
filterGreaterThan: string;
|
|
38
|
+
filterGreaterThanOrEqualTo: string;
|
|
39
|
+
filterInNumberRange: string;
|
|
40
|
+
filterIncludesString: string;
|
|
41
|
+
filterIncludesStringSensitive: string;
|
|
42
|
+
filterLessThan: string;
|
|
43
|
+
filterLessThanOrEqualTo: string;
|
|
44
|
+
filterMode: string;
|
|
45
|
+
filterNotEmpty: string;
|
|
46
|
+
filterNotEquals: string;
|
|
47
|
+
filterStartsWith: string;
|
|
48
|
+
filterWeakEquals: string;
|
|
49
|
+
filteringByColumn: string;
|
|
50
|
+
goToFirstPage: string;
|
|
51
|
+
goToLastPage: string;
|
|
52
|
+
goToNextPage: string;
|
|
53
|
+
goToPreviousPage: string;
|
|
54
|
+
grab: string;
|
|
55
|
+
groupByColumn: string;
|
|
56
|
+
groupedBy: string;
|
|
57
|
+
hideAll: string;
|
|
58
|
+
hideColumn: string;
|
|
59
|
+
max: string;
|
|
60
|
+
min: string;
|
|
61
|
+
move: string;
|
|
62
|
+
noRecordsToDisplay: string;
|
|
63
|
+
noResultsFound: string;
|
|
64
|
+
of: string;
|
|
65
|
+
or: string;
|
|
66
|
+
pinToLeft: string;
|
|
67
|
+
pinToRight: string;
|
|
68
|
+
resetColumnSize: string;
|
|
69
|
+
resetOrder: string;
|
|
70
|
+
rowActions: string;
|
|
71
|
+
rowNumber: string;
|
|
72
|
+
rowNumbers: string;
|
|
73
|
+
rowsPerPage: string;
|
|
74
|
+
save: string;
|
|
75
|
+
search: string;
|
|
76
|
+
select: string;
|
|
77
|
+
selectedCountOfRowCountRowsSelected: string;
|
|
78
|
+
showAll: string;
|
|
79
|
+
showAllColumns: string;
|
|
80
|
+
showHideColumns: string;
|
|
81
|
+
showHideFilters: string;
|
|
82
|
+
showHideSearch: string;
|
|
83
|
+
sortByColumnAsc: string;
|
|
84
|
+
sortByColumnDesc: string;
|
|
85
|
+
sortedByColumnAsc: string;
|
|
86
|
+
sortedByColumnDesc: string;
|
|
87
|
+
thenBy: string;
|
|
88
|
+
toggleDensity: string;
|
|
89
|
+
toggleFullScreen: string;
|
|
90
|
+
toggleSelectAll: string;
|
|
91
|
+
toggleSelectRow: string;
|
|
92
|
+
toggleVisibility: string;
|
|
93
|
+
ungroupByColumn: string;
|
|
94
|
+
unpin: string;
|
|
95
|
+
unpinAll: string;
|
|
96
|
+
unsorted: string;
|
|
97
|
+
}
|
|
10
98
|
export interface MRT_RowModel<TData extends Record<string, any> = {}> {
|
|
11
99
|
flatRows: MRT_Row<TData>[];
|
|
12
100
|
rows: MRT_Row<TData>[];
|
|
@@ -104,9 +192,10 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
|
104
192
|
row: MRT_Row<TData>;
|
|
105
193
|
table: MRT_TableInstance<TData>;
|
|
106
194
|
}) => ReactNode;
|
|
107
|
-
Filter?: ({ column, header, table, }: {
|
|
195
|
+
Filter?: ({ column, header, rangeFilterIndex, table, }: {
|
|
108
196
|
column: MRT_Column<TData>;
|
|
109
197
|
header: MRT_Header<TData>;
|
|
198
|
+
rangeFilterIndex?: number;
|
|
110
199
|
table: MRT_TableInstance<TData>;
|
|
111
200
|
}) => ReactNode;
|
|
112
201
|
Footer?: ReactNode | (({ column, footer, table, }: {
|
|
@@ -163,7 +252,7 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
|
163
252
|
text: string;
|
|
164
253
|
value: any;
|
|
165
254
|
})[];
|
|
166
|
-
filterVariant?: 'text' | 'select' | 'multi-select' | 'range';
|
|
255
|
+
filterVariant?: 'text' | 'select' | 'multi-select' | 'range' | 'checkbox';
|
|
167
256
|
/**
|
|
168
257
|
* footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
|
|
169
258
|
*/
|
|
@@ -194,9 +283,11 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
|
194
283
|
row: MRT_Row<TData>;
|
|
195
284
|
table: MRT_TableInstance<TData>;
|
|
196
285
|
}) => TextFieldProps);
|
|
197
|
-
muiTableBodyCellProps?: TableCellProps | (({ cell, table, }: {
|
|
198
|
-
table: MRT_TableInstance<TData>;
|
|
286
|
+
muiTableBodyCellProps?: TableCellProps | (({ cell, column, row, table, }: {
|
|
199
287
|
cell: MRT_Cell<TData>;
|
|
288
|
+
column: MRT_Column<TData>;
|
|
289
|
+
row: MRT_Row<TData>;
|
|
290
|
+
table: MRT_TableInstance<TData>;
|
|
200
291
|
}) => TableCellProps);
|
|
201
292
|
muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
|
|
202
293
|
table: MRT_TableInstance<TData>;
|
|
@@ -210,6 +301,10 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
|
210
301
|
table: MRT_TableInstance<TData>;
|
|
211
302
|
column: MRT_Column<TData>;
|
|
212
303
|
}) => IconButtonProps);
|
|
304
|
+
muiTableHeadCellFilterCheckboxProps?: CheckboxProps | (({ column, table, }: {
|
|
305
|
+
column: MRT_Column<TData>;
|
|
306
|
+
table: MRT_TableInstance<TData>;
|
|
307
|
+
}) => CheckboxProps);
|
|
213
308
|
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, rangeFilterIndex, }: {
|
|
214
309
|
table: MRT_TableInstance<TData>;
|
|
215
310
|
column: MRT_Column<TData>;
|
|
@@ -406,6 +501,10 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
|
|
|
406
501
|
table: MRT_TableInstance<TData>;
|
|
407
502
|
column: MRT_Column<TData>;
|
|
408
503
|
}) => IconButtonProps);
|
|
504
|
+
muiTableHeadCellFilterCheckboxProps?: CheckboxProps | (({ column, table, }: {
|
|
505
|
+
column: MRT_Column<TData>;
|
|
506
|
+
table: MRT_TableInstance<TData>;
|
|
507
|
+
}) => CheckboxProps);
|
|
409
508
|
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, rangeFilterIndex, }: {
|
|
410
509
|
table: MRT_TableInstance<TData>;
|
|
411
510
|
column: MRT_Column<TData>;
|
|
@@ -467,6 +566,9 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
|
|
|
467
566
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
468
567
|
positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
|
|
469
568
|
positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
|
|
569
|
+
renderBottomToolbar?: ReactNode | (({ table }: {
|
|
570
|
+
table: MRT_TableInstance<TData>;
|
|
571
|
+
}) => ReactNode);
|
|
470
572
|
renderBottomToolbarCustomActions?: ({ table, }: {
|
|
471
573
|
table: MRT_TableInstance<TData>;
|
|
472
574
|
}) => ReactNode;
|
|
@@ -503,6 +605,9 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
|
|
|
503
605
|
renderToolbarInternalActions?: ({ table, }: {
|
|
504
606
|
table: MRT_TableInstance<TData>;
|
|
505
607
|
}) => ReactNode;
|
|
608
|
+
renderTopToolbar?: ReactNode | (({ table }: {
|
|
609
|
+
table: MRT_TableInstance<TData>;
|
|
610
|
+
}) => ReactNode);
|
|
506
611
|
renderTopToolbarCustomActions?: ({ table, }: {
|
|
507
612
|
table: MRT_TableInstance<TData>;
|
|
508
613
|
}) => ReactNode;
|
|
@@ -523,5 +628,5 @@ export declare type Virtualizer = {
|
|
|
523
628
|
scrollToIndex: (index: number, options?: any | undefined) => void;
|
|
524
629
|
measure: () => void;
|
|
525
630
|
};
|
|
526
|
-
declare const
|
|
527
|
-
export default
|
|
631
|
+
declare const MaterialReactTable: <TData extends Record<string, any> = {}>({ aggregationFns, autoResetExpanded, columnResizeMode, defaultColumn, defaultDisplayColumn, editingMode, enableBottomToolbar, enableColumnActions, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGlobalFilterRankedResults, enableGrouping, enableHiding, enableMultiRowSelection, enableMultiSort, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarInternalActions, enableTopToolbar, filterFns, icons, localization, positionActionsColumn, positionExpandColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, rowNumberMode, selectAllMode, sortingFns, ...rest }: MaterialReactTableProps<TData>) => JSX.Element;
|
|
632
|
+
export default MaterialReactTable;
|
|
@@ -103,3 +103,9 @@ export declare const getCommonCellStyles: ({ column, header, table, tableCellPro
|
|
|
103
103
|
tableCellProps: TableCellProps;
|
|
104
104
|
theme: Theme;
|
|
105
105
|
}) => any;
|
|
106
|
+
export declare const MRT_DefaultColumn: {
|
|
107
|
+
minSize: number;
|
|
108
|
+
maxSize: number;
|
|
109
|
+
size: number;
|
|
110
|
+
};
|
|
111
|
+
export declare const MRT_DefaultDisplayColumn: Partial<MRT_ColumnDef>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { TableCellProps } from '@mui/material';
|
|
2
3
|
import { MRT_Header, MRT_TableInstance } from '..';
|
|
3
4
|
interface Props {
|
|
4
5
|
header: MRT_Header;
|
|
5
6
|
table: MRT_TableInstance;
|
|
7
|
+
tableCellProps?: TableCellProps;
|
|
6
8
|
}
|
|
7
9
|
export declare const MRT_TableHeadCellSortLabel: FC<Props>;
|
|
8
10
|
export {};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,13 +2,14 @@ import MaterialReactTable from './MaterialReactTable';
|
|
|
2
2
|
export default MaterialReactTable;
|
|
3
3
|
export * from './MaterialReactTable';
|
|
4
4
|
import type { MRT_Icons } from './icons';
|
|
5
|
-
|
|
6
|
-
export type { MRT_Localization, MRT_Icons };
|
|
5
|
+
export type { MRT_Icons };
|
|
7
6
|
import { MRT_CopyButton } from './buttons/MRT_CopyButton';
|
|
8
7
|
import { MRT_FullScreenToggleButton } from './buttons/MRT_FullScreenToggleButton';
|
|
9
8
|
import { MRT_GlobalFilterTextField } from './inputs/MRT_GlobalFilterTextField';
|
|
10
9
|
import { MRT_ShowHideColumnsButton } from './buttons/MRT_ShowHideColumnsButton';
|
|
10
|
+
import { MRT_TablePagination } from './toolbar/MRT_TablePagination';
|
|
11
11
|
import { MRT_ToggleDensePaddingButton } from './buttons/MRT_ToggleDensePaddingButton';
|
|
12
12
|
import { MRT_ToggleFiltersButton } from './buttons/MRT_ToggleFiltersButton';
|
|
13
13
|
import { MRT_ToggleGlobalFilterButton } from './buttons/MRT_ToggleGlobalFilterButton';
|
|
14
|
-
|
|
14
|
+
import { MRT_ToolbarInternalButtons } from './toolbar/MRT_ToolbarInternalButtons';
|
|
15
|
+
export { MRT_CopyButton, MRT_FullScreenToggleButton, MRT_GlobalFilterTextField, MRT_ShowHideColumnsButton, MRT_TablePagination, MRT_ToggleDensePaddingButton, MRT_ToggleFiltersButton, MRT_ToggleGlobalFilterButton, MRT_ToolbarInternalButtons, };
|