material-react-table 0.31.0 → 0.32.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.
Files changed (137) hide show
  1. package/README.md +3 -4
  2. package/dist/{MaterialReactTable.d.ts → cjs/MaterialReactTable.d.ts} +494 -486
  3. package/dist/{body → cjs/body}/MRT_TableBody.d.ts +8 -8
  4. package/dist/{body → cjs/body}/MRT_TableBodyCell.d.ts +11 -11
  5. package/dist/{body → cjs/body}/MRT_TableBodyRow.d.ts +9 -9
  6. package/dist/{body → cjs/body}/MRT_TableBodyRowGrabHandle.d.ts +9 -9
  7. package/dist/{body → cjs/body}/MRT_TableDetailPanel.d.ts +8 -8
  8. package/dist/{buttons → cjs/buttons}/MRT_ColumnPinningButtons.d.ts +8 -8
  9. package/dist/{buttons → cjs/buttons}/MRT_CopyButton.d.ts +9 -9
  10. package/dist/{buttons → cjs/buttons}/MRT_EditActionButtons.d.ts +8 -8
  11. package/dist/{buttons → cjs/buttons}/MRT_ExpandAllButton.d.ts +7 -7
  12. package/dist/{buttons → cjs/buttons}/MRT_ExpandButton.d.ts +8 -8
  13. package/dist/{buttons → cjs/buttons}/MRT_FullScreenToggleButton.d.ts +8 -8
  14. package/dist/{buttons → cjs/buttons}/MRT_GrabHandleButton.d.ts +11 -11
  15. package/dist/{buttons → cjs/buttons}/MRT_ShowHideColumnsButton.d.ts +8 -8
  16. package/dist/{buttons → cjs/buttons}/MRT_ToggleDensePaddingButton.d.ts +8 -8
  17. package/dist/{buttons → cjs/buttons}/MRT_ToggleFiltersButton.d.ts +8 -8
  18. package/dist/{buttons → cjs/buttons}/MRT_ToggleGlobalFilterButton.d.ts +8 -8
  19. package/dist/{buttons → cjs/buttons}/MRT_ToggleRowActionMenuButton.d.ts +8 -8
  20. package/dist/{column.utils.d.ts → cjs/column.utils.d.ts} +12 -11
  21. package/dist/{filtersFns.d.ts → cjs/filtersFns.d.ts} +68 -68
  22. package/dist/{footer → cjs/footer}/MRT_TableFooter.d.ts +7 -7
  23. package/dist/{footer → cjs/footer}/MRT_TableFooterCell.d.ts +8 -8
  24. package/dist/{footer → cjs/footer}/MRT_TableFooterRow.d.ts +8 -8
  25. package/dist/{head → cjs/head}/MRT_TableHead.d.ts +7 -7
  26. package/dist/{head → cjs/head}/MRT_TableHeadCell.d.ts +8 -8
  27. package/dist/{head → cjs/head}/MRT_TableHeadCellColumnActionsButton.d.ts +8 -8
  28. package/dist/{head → cjs/head}/MRT_TableHeadCellFilterContainer.d.ts +8 -8
  29. package/dist/{head → cjs/head}/MRT_TableHeadCellFilterLabel.d.ts +8 -8
  30. package/dist/{head → cjs/head}/MRT_TableHeadCellGrabHandle.d.ts +9 -9
  31. package/dist/{head → cjs/head}/MRT_TableHeadCellResizeHandle.d.ts +8 -8
  32. package/dist/{head → cjs/head}/MRT_TableHeadCellSortLabel.d.ts +8 -8
  33. package/dist/{head → cjs/head}/MRT_TableHeadRow.d.ts +8 -8
  34. package/dist/{icons.d.ts → cjs/icons.d.ts} +33 -33
  35. package/dist/cjs/index.d.ts +3 -0
  36. package/dist/cjs/index.min.js +51 -0
  37. package/dist/cjs/index.min.js.map +1 -0
  38. package/dist/{inputs → cjs/inputs}/MRT_EditCellTextField.d.ts +8 -8
  39. package/dist/{inputs → cjs/inputs}/MRT_FilterRangeFields.d.ts +8 -8
  40. package/dist/{inputs → cjs/inputs}/MRT_FilterTextField.d.ts +9 -9
  41. package/dist/{inputs → cjs/inputs}/MRT_GlobalFilterTextField.d.ts +7 -7
  42. package/dist/{inputs → cjs/inputs}/MRT_SelectCheckbox.d.ts +9 -9
  43. package/dist/{localization.d.ts → cjs/localization.d.ts} +82 -82
  44. package/dist/{menus → cjs/menus}/MRT_ColumnActionMenu.d.ts +20 -20
  45. package/dist/{menus → cjs/menus}/MRT_FilterOptionMenu.d.ts +18 -18
  46. package/dist/{menus → cjs/menus}/MRT_RowActionMenu.d.ts +11 -11
  47. package/dist/{menus → cjs/menus}/MRT_ShowHideColumnsMenu.d.ts +10 -10
  48. package/dist/{menus → cjs/menus}/MRT_ShowHideColumnsMenuItems.d.ts +12 -12
  49. package/dist/{sortingFns.d.ts → cjs/sortingFns.d.ts} +12 -12
  50. package/dist/{table → cjs/table}/MRT_Table.d.ts +8 -8
  51. package/dist/{table → cjs/table}/MRT_TableContainer.d.ts +7 -7
  52. package/dist/{table → cjs/table}/MRT_TablePaper.d.ts +7 -7
  53. package/dist/{table → cjs/table}/MRT_TableRoot.d.ts +3 -3
  54. package/dist/{toolbar → cjs/toolbar}/MRT_LinearProgressBar.d.ts +8 -8
  55. package/dist/{toolbar → cjs/toolbar}/MRT_TablePagination.d.ts +8 -8
  56. package/dist/{toolbar → cjs/toolbar}/MRT_ToolbarAlertBanner.d.ts +8 -8
  57. package/dist/{toolbar → cjs/toolbar}/MRT_ToolbarBottom.d.ts +7 -7
  58. package/dist/{toolbar → cjs/toolbar}/MRT_ToolbarDropZone.d.ts +7 -7
  59. package/dist/{toolbar → cjs/toolbar}/MRT_ToolbarInternalButtons.d.ts +7 -7
  60. package/dist/{toolbar → cjs/toolbar}/MRT_ToolbarTop.d.ts +21 -21
  61. package/dist/esm/MaterialReactTable.d.ts +494 -0
  62. package/dist/esm/body/MRT_TableBody.d.ts +8 -0
  63. package/dist/esm/body/MRT_TableBodyCell.d.ts +11 -0
  64. package/dist/esm/body/MRT_TableBodyRow.d.ts +9 -0
  65. package/dist/esm/body/MRT_TableBodyRowGrabHandle.d.ts +9 -0
  66. package/dist/esm/body/MRT_TableDetailPanel.d.ts +8 -0
  67. package/dist/esm/buttons/MRT_ColumnPinningButtons.d.ts +8 -0
  68. package/dist/esm/buttons/MRT_CopyButton.d.ts +9 -0
  69. package/dist/esm/buttons/MRT_EditActionButtons.d.ts +8 -0
  70. package/dist/esm/buttons/MRT_ExpandAllButton.d.ts +7 -0
  71. package/dist/esm/buttons/MRT_ExpandButton.d.ts +8 -0
  72. package/dist/esm/buttons/MRT_FullScreenToggleButton.d.ts +8 -0
  73. package/dist/esm/buttons/MRT_GrabHandleButton.d.ts +11 -0
  74. package/dist/esm/buttons/MRT_ShowHideColumnsButton.d.ts +8 -0
  75. package/dist/esm/buttons/MRT_ToggleDensePaddingButton.d.ts +8 -0
  76. package/dist/esm/buttons/MRT_ToggleFiltersButton.d.ts +8 -0
  77. package/dist/esm/buttons/MRT_ToggleGlobalFilterButton.d.ts +8 -0
  78. package/dist/esm/buttons/MRT_ToggleRowActionMenuButton.d.ts +8 -0
  79. package/dist/esm/column.utils.d.ts +12 -0
  80. package/dist/esm/filtersFns.d.ts +68 -0
  81. package/dist/esm/footer/MRT_TableFooter.d.ts +7 -0
  82. package/dist/esm/footer/MRT_TableFooterCell.d.ts +8 -0
  83. package/dist/esm/footer/MRT_TableFooterRow.d.ts +8 -0
  84. package/dist/esm/head/MRT_TableHead.d.ts +7 -0
  85. package/dist/esm/head/MRT_TableHeadCell.d.ts +8 -0
  86. package/dist/esm/head/MRT_TableHeadCellColumnActionsButton.d.ts +8 -0
  87. package/dist/esm/head/MRT_TableHeadCellFilterContainer.d.ts +8 -0
  88. package/dist/esm/head/MRT_TableHeadCellFilterLabel.d.ts +8 -0
  89. package/dist/esm/head/MRT_TableHeadCellGrabHandle.d.ts +9 -0
  90. package/dist/esm/head/MRT_TableHeadCellResizeHandle.d.ts +8 -0
  91. package/dist/esm/head/MRT_TableHeadCellSortLabel.d.ts +8 -0
  92. package/dist/esm/head/MRT_TableHeadRow.d.ts +8 -0
  93. package/dist/esm/icons.d.ts +33 -0
  94. package/dist/esm/index.d.ts +3 -0
  95. package/dist/esm/inputs/MRT_EditCellTextField.d.ts +8 -0
  96. package/dist/esm/inputs/MRT_FilterRangeFields.d.ts +8 -0
  97. package/dist/esm/inputs/MRT_FilterTextField.d.ts +9 -0
  98. package/dist/esm/inputs/MRT_GlobalFilterTextField.d.ts +7 -0
  99. package/dist/esm/inputs/MRT_SelectCheckbox.d.ts +9 -0
  100. package/dist/esm/localization.d.ts +82 -0
  101. package/dist/esm/material-react-table.esm.min.js +51 -0
  102. package/dist/esm/material-react-table.esm.min.js.map +1 -0
  103. package/dist/esm/menus/MRT_ColumnActionMenu.d.ts +20 -0
  104. package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +18 -0
  105. package/dist/esm/menus/MRT_RowActionMenu.d.ts +11 -0
  106. package/dist/esm/menus/MRT_ShowHideColumnsMenu.d.ts +10 -0
  107. package/dist/esm/menus/MRT_ShowHideColumnsMenuItems.d.ts +12 -0
  108. package/dist/esm/sortingFns.d.ts +12 -0
  109. package/dist/esm/table/MRT_Table.d.ts +8 -0
  110. package/dist/esm/table/MRT_TableContainer.d.ts +7 -0
  111. package/dist/esm/table/MRT_TablePaper.d.ts +7 -0
  112. package/dist/esm/table/MRT_TableRoot.d.ts +3 -0
  113. package/dist/esm/toolbar/MRT_LinearProgressBar.d.ts +8 -0
  114. package/dist/esm/toolbar/MRT_TablePagination.d.ts +8 -0
  115. package/dist/esm/toolbar/MRT_ToolbarAlertBanner.d.ts +8 -0
  116. package/dist/esm/toolbar/MRT_ToolbarBottom.d.ts +7 -0
  117. package/dist/esm/toolbar/MRT_ToolbarDropZone.d.ts +7 -0
  118. package/dist/esm/toolbar/MRT_ToolbarInternalButtons.d.ts +7 -0
  119. package/dist/esm/toolbar/MRT_ToolbarTop.d.ts +21 -0
  120. package/dist/index.d.ts +686 -7
  121. package/package.json +24 -25
  122. package/src/MaterialReactTable.tsx +17 -4
  123. package/src/body/MRT_TableBodyCell.tsx +6 -3
  124. package/src/column.utils.ts +20 -0
  125. package/src/footer/MRT_TableFooterCell.tsx +1 -0
  126. package/src/head/MRT_TableHeadCell.tsx +4 -3
  127. package/src/index.tsx +0 -6
  128. package/src/inputs/MRT_EditCellTextField.tsx +1 -1
  129. package/src/inputs/MRT_FilterTextField.tsx +1 -1
  130. package/src/table/MRT_TableRoot.tsx +1 -16
  131. package/dist/index.js +0 -8
  132. package/dist/material-react-table.cjs.development.js +0 -3992
  133. package/dist/material-react-table.cjs.development.js.map +0 -1
  134. package/dist/material-react-table.cjs.production.min.js +0 -2
  135. package/dist/material-react-table.cjs.production.min.js.map +0 -1
  136. package/dist/material-react-table.esm.js +0 -3985
  137. package/dist/material-react-table.esm.js.map +0 -1
@@ -0,0 +1,494 @@
1
+ import { ChangeEvent, Dispatch, DragEvent, FC, FocusEvent, ReactNode, SetStateAction } from 'react';
2
+ import type { AlertProps, ButtonProps, CheckboxProps, IconButtonProps, LinearProgressProps, PaperProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
3
+ import type { Cell, Column, ColumnDef, CoreColumnDefAccessorKey, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
4
+ import type { VirtualizerOptions } from '@tanstack/react-virtual';
5
+ import { MRT_Localization } from './localization';
6
+ import { MRT_Icons } from './icons';
7
+ import { MRT_FilterFns } from './filtersFns';
8
+ import { MRT_SortingFns } from './sortingFns';
9
+ declare type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
10
+ export interface MRT_RowModel<TData extends Record<string, any> = {}> {
11
+ flatRows: MRT_Row<TData>[];
12
+ rows: MRT_Row<TData>[];
13
+ rowsById: {
14
+ [key: string]: MRT_Row<TData>;
15
+ };
16
+ }
17
+ export declare type MRT_TableInstance<TData extends Record<string, any> = {}> = Omit<Table<TData>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getCenterLeafColumns' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
18
+ getAllColumns: () => MRT_Column<TData>[];
19
+ getAllFlatColumns: () => MRT_Column<TData>[];
20
+ getAllLeafColumns: () => MRT_Column<TData>[];
21
+ getCenterLeafColumns: () => MRT_Column<TData>[];
22
+ getColumn: (columnId: string) => MRT_Column<TData>;
23
+ getExpandedRowModel: () => MRT_RowModel<TData>;
24
+ getFlatHeaders: () => MRT_Header<TData>[];
25
+ getLeftLeafColumns: () => MRT_Column<TData>[];
26
+ getPaginationRowModel: () => MRT_RowModel<TData>;
27
+ getPreFilteredRowModel: () => MRT_RowModel<TData>;
28
+ getPrePaginationRowModel: () => MRT_RowModel<TData>;
29
+ getRightLeafColumns: () => MRT_Column<TData>[];
30
+ getRowModel: () => MRT_RowModel<TData>;
31
+ getSelectedRowModel: () => MRT_RowModel<TData>;
32
+ getState: () => MRT_TableState<TData>;
33
+ options: MaterialReactTableProps<TData> & {
34
+ icons: MRT_Icons;
35
+ tableId: string;
36
+ localization: MRT_Localization;
37
+ };
38
+ setCurrentDraggingColumn: Dispatch<SetStateAction<MRT_Column<TData> | null>>;
39
+ setCurrentDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null>>;
40
+ setCurrentEditingCell: Dispatch<SetStateAction<MRT_Cell | null>>;
41
+ setCurrentEditingRow: Dispatch<SetStateAction<MRT_Row | null>>;
42
+ setCurrentFilterFns: Dispatch<SetStateAction<{
43
+ [key: string]: MRT_FilterOption;
44
+ }>>;
45
+ setCurrentGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
46
+ setCurrentHoveredColumn: Dispatch<SetStateAction<MRT_Column<TData> | {
47
+ id: string;
48
+ } | null>>;
49
+ setCurrentHoveredRow: Dispatch<SetStateAction<MRT_Row<TData> | {
50
+ id: string;
51
+ } | null>>;
52
+ setDensity: Dispatch<SetStateAction<'comfortable' | 'compact' | 'spacious'>>;
53
+ setIsFullScreen: Dispatch<SetStateAction<boolean>>;
54
+ setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
55
+ setShowFilters: Dispatch<SetStateAction<boolean>>;
56
+ setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
57
+ };
58
+ export declare type MRT_TableState<TData extends Record<string, any> = {}> = TableState & {
59
+ currentDraggingColumn: MRT_Column<TData> | null;
60
+ currentDraggingRow: MRT_Row<TData> | null;
61
+ currentEditingCell: MRT_Cell<TData> | null;
62
+ currentEditingRow: MRT_Row<TData> | null;
63
+ currentFilterFns: Record<string, MRT_FilterOption>;
64
+ currentGlobalFilterFn: Record<string, MRT_FilterOption>;
65
+ currentHoveredColumn: MRT_Column<TData> | {
66
+ id: string;
67
+ } | null;
68
+ currentHoveredRow: MRT_Row<TData> | {
69
+ id: string;
70
+ } | null;
71
+ density: 'comfortable' | 'compact' | 'spacious';
72
+ isFullScreen: boolean;
73
+ isLoading: boolean;
74
+ showAlertBanner: boolean;
75
+ showColumnFilters: boolean;
76
+ showGlobalFilter: boolean;
77
+ showProgressBars: boolean;
78
+ showSkeletons: boolean;
79
+ };
80
+ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnDef<TData, unknown>, 'aggregatedCell' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
81
+ AggregatedCell?: ({ cell, column, table, }: {
82
+ cell: MRT_Cell<TData>;
83
+ column: MRT_Column<TData>;
84
+ table: MRT_TableInstance<TData>;
85
+ }) => ReactNode;
86
+ Cell?: ({ cell, column, table, }: {
87
+ cell: MRT_Cell<TData>;
88
+ column: MRT_Column<TData>;
89
+ table: MRT_TableInstance<TData>;
90
+ }) => ReactNode;
91
+ Edit?: ({ cell, column, table, }: {
92
+ cell: MRT_Cell<TData>;
93
+ column: MRT_Column<TData>;
94
+ table: MRT_TableInstance<TData>;
95
+ }) => ReactNode;
96
+ Filter?: ({ column, header, table, }: {
97
+ column: MRT_Column<TData>;
98
+ header: MRT_Header<TData>;
99
+ table: MRT_TableInstance<TData>;
100
+ }) => ReactNode;
101
+ Footer?: ReactNode | (({ column, footer, table, }: {
102
+ column: MRT_Column<TData>;
103
+ footer: MRT_Header<TData>;
104
+ table: MRT_TableInstance<TData>;
105
+ }) => ReactNode);
106
+ Header?: ReactNode | (({ column, header, table, }: {
107
+ column: MRT_Column<TData>;
108
+ header: MRT_Header<TData>;
109
+ table: MRT_TableInstance<TData>;
110
+ }) => ReactNode);
111
+ /**
112
+ * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
113
+ * Specify a function here to point to the correct property in the data object.
114
+ *
115
+ * @example accessorFn: (row) => row.username
116
+ */
117
+ accessorFn?: (row: TData) => any;
118
+ /**
119
+ * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
120
+ * Specify which key in the row this column should use to access the correct data.
121
+ * Also supports Deep Key Dot Notation.
122
+ *
123
+ * @example accessorKey: 'username' //simple
124
+ * @example accessorKey: 'name.firstName' //deep key dot notation
125
+ */
126
+ accessorKey?: CoreColumnDefAccessorKey<TData, unknown>['accessorKey'];
127
+ /**
128
+ * Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
129
+ * Leave this blank if you are just creating a normal data column.
130
+ *
131
+ * @default 'data'
132
+ *
133
+ * @example columnDefType: 'display'
134
+ */
135
+ columnDefType?: 'data' | 'display' | 'group';
136
+ columnFilterModeOptions?: MRT_FilterOption[] | null;
137
+ columns?: MRT_ColumnDef<TData>[];
138
+ enableClickToCopy?: boolean;
139
+ enableColumnActions?: boolean;
140
+ enableColumnDragging?: boolean;
141
+ enableColumnFilterChangeMode?: boolean;
142
+ enableColumnOrdering?: boolean;
143
+ enableEditing?: boolean;
144
+ filterFn?: MRT_FilterFn<TData>;
145
+ filterSelectOptions?: (string | {
146
+ text: string;
147
+ value: string;
148
+ })[];
149
+ filterVariant?: 'text' | 'select' | 'multi-select' | 'range';
150
+ /**
151
+ * footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
152
+ */
153
+ footer?: string;
154
+ /**
155
+ * header must be a string. If you want custom JSX to render the header, you can also specify a `Header` option. (Capital H)
156
+ */
157
+ header: string;
158
+ /**
159
+ * Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
160
+ *
161
+ * If you have also specified an `accessorFn`, MRT still needs to have a valid `id` to be able to identify the column uniquely.
162
+ *
163
+ * `id` defaults to the `accessorKey` or `header` if not specified.
164
+ *
165
+ * @default gets set to the same value as `accessorKey` by default
166
+ */
167
+ id?: LiteralUnion<string & keyof TData>;
168
+ muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
169
+ table: MRT_TableInstance<TData>;
170
+ cell: MRT_Cell<TData>;
171
+ }) => ButtonProps);
172
+ muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
173
+ table: MRT_TableInstance<TData>;
174
+ cell: MRT_Cell<TData>;
175
+ }) => TextFieldProps);
176
+ muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
177
+ table: MRT_TableInstance<TData>;
178
+ cell: MRT_Cell<TData>;
179
+ }) => TableCellProps);
180
+ muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
181
+ table: MRT_TableInstance<TData>;
182
+ column: MRT_Column<TData>;
183
+ }) => TableCellProps);
184
+ muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ table, column, }: {
185
+ table: MRT_TableInstance<TData>;
186
+ column: MRT_Column<TData>;
187
+ }) => IconButtonProps);
188
+ muiTableHeadCellDragHandleProps?: IconButtonProps | (({ table, column, }: {
189
+ table: MRT_TableInstance<TData>;
190
+ column: MRT_Column<TData>;
191
+ }) => IconButtonProps);
192
+ muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, rangeFilterIndex, }: {
193
+ table: MRT_TableInstance<TData>;
194
+ column: MRT_Column<TData>;
195
+ rangeFilterIndex?: number;
196
+ }) => TextFieldProps);
197
+ muiTableHeadCellProps?: TableCellProps | (({ table, column, }: {
198
+ table: MRT_TableInstance<TData>;
199
+ column: MRT_Column<TData>;
200
+ }) => TableCellProps);
201
+ onCellEditBlur?: ({ cell, event, table, }: {
202
+ event: FocusEvent<HTMLInputElement>;
203
+ cell: MRT_Cell<TData>;
204
+ table: MRT_TableInstance<TData>;
205
+ }) => void;
206
+ onCellEditChange?: ({ cell, event, table, }: {
207
+ event: ChangeEvent<HTMLInputElement>;
208
+ cell: MRT_Cell<TData>;
209
+ table: MRT_TableInstance<TData>;
210
+ }) => void;
211
+ sortingFn?: MRT_SortingFn;
212
+ };
213
+ export declare type MRT_DefinedColumnDef<TData extends Record<string, any> = {}> = Omit<MRT_ColumnDef<TData>, 'id'> & {
214
+ id: string;
215
+ _filterFn: MRT_FilterOption;
216
+ };
217
+ export declare type MRT_Column<TData extends Record<string, any> = {}> = Omit<Column<TData, unknown>, 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'> & {
218
+ columnDef: MRT_DefinedColumnDef<TData>;
219
+ columns?: MRT_Column<TData>[];
220
+ filterFn?: MRT_FilterFn<TData>;
221
+ footer: string;
222
+ header: string;
223
+ };
224
+ export declare type MRT_Header<TData extends Record<string, any> = {}> = Omit<Header<TData, unknown>, 'column'> & {
225
+ column: MRT_Column<TData>;
226
+ };
227
+ export declare type MRT_HeaderGroup<TData extends Record<string, any> = {}> = Omit<HeaderGroup<TData>, 'headers'> & {
228
+ headers: MRT_Header<TData>[];
229
+ };
230
+ export declare type MRT_Row<TData extends Record<string, any> = {}> = Omit<Row<TData>, 'getVisibleCells' | 'getAllCells' | 'subRows' | '_valuesCache'> & {
231
+ getAllCells: () => MRT_Cell<TData>[];
232
+ getVisibleCells: () => MRT_Cell<TData>[];
233
+ subRows?: MRT_Row<TData>[];
234
+ _valuesCache?: TData;
235
+ };
236
+ export declare type MRT_Cell<TData extends Record<string, any> = {}> = Omit<Cell<TData, unknown>, 'column' | 'row'> & {
237
+ column: MRT_Column<TData>;
238
+ row: MRT_Row<TData>;
239
+ };
240
+ export declare type MRT_SortingOption = LiteralUnion<string & keyof typeof MRT_SortingFns>;
241
+ export declare type MRT_SortingFn<TData extends Record<string, any> = {}> = SortingFn<TData> | MRT_SortingOption;
242
+ export declare type MRT_FilterOption = LiteralUnion<string & keyof typeof MRT_FilterFns>;
243
+ export declare type MRT_FilterFn<TData extends Record<string, any> = {}> = FilterFn<TData> | MRT_FilterOption;
244
+ export declare type MRT_DisplayColumnIds = 'mrt-row-drag' | 'mrt-row-actions' | 'mrt-row-expand' | 'mrt-row-select' | 'mrt-row-numbers';
245
+ /**
246
+ * `columns` and `data` props are the only required props, but there are over 150 other optional props.
247
+ *
248
+ * See more info on creating columns and data on the official docs site:
249
+ * @link https://www.material-react-table.com/docs/usage
250
+ *
251
+ * See the full props list on the official docs site:
252
+ * @link https://www.material-react-table.com/docs/api/props
253
+ */
254
+ export declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = Omit<Partial<TableOptions<TData>>, 'columns' | 'data' | 'initialState' | 'state' | 'expandRowsFn'> & {
255
+ displayColumnDefOptions?: Partial<{
256
+ [key in MRT_DisplayColumnIds]: Partial<MRT_ColumnDef>;
257
+ }>;
258
+ columnFilterModeOptions?: (MRT_FilterOption | string)[] | null;
259
+ columns: MRT_ColumnDef<TData>[];
260
+ data: TData[];
261
+ editingMode?: 'table' | 'row' | 'cell';
262
+ enableClickToCopy?: boolean;
263
+ enableColumnActions?: boolean;
264
+ enableColumnDragging?: boolean;
265
+ enableColumnFilterChangeMode?: boolean;
266
+ enableColumnOrdering?: boolean;
267
+ enableDensityToggle?: boolean;
268
+ enableEditing?: boolean;
269
+ enableExpandAll?: boolean;
270
+ enableFullScreenToggle?: boolean;
271
+ enableGlobalFilterChangeMode?: boolean;
272
+ enableGlobalFilterRankedResults?: boolean;
273
+ enablePagination?: boolean;
274
+ enableRowActions?: boolean;
275
+ enableRowDragging?: boolean;
276
+ enableRowNumbers?: boolean;
277
+ enableRowOrdering?: boolean;
278
+ enableRowVirtualization?: boolean;
279
+ enableSelectAll?: boolean;
280
+ enableStickyHeader?: boolean;
281
+ enableTableFooter?: boolean;
282
+ enableTableHead?: boolean;
283
+ enableToolbarBottom?: boolean;
284
+ enableToolbarInternalActions?: boolean;
285
+ enableToolbarTop?: boolean;
286
+ enabledGlobalFilterOptions?: (MRT_FilterOption | string)[] | null;
287
+ expandRowsFn?: (dataRow: TData) => TData[];
288
+ icons?: Partial<MRT_Icons>;
289
+ initialState?: Partial<MRT_TableState<TData>>;
290
+ localization?: Partial<MRT_Localization>;
291
+ muiExpandAllButtonProps?: IconButtonProps | (({ table }: {
292
+ table: MRT_TableInstance<TData>;
293
+ }) => IconButtonProps);
294
+ muiExpandButtonProps?: IconButtonProps | (({ table, }: {
295
+ table: MRT_TableInstance<TData>;
296
+ row: MRT_Row<TData>;
297
+ }) => IconButtonProps);
298
+ muiLinearProgressProps?: LinearProgressProps | (({ isTopToolbar, table, }: {
299
+ isTopToolbar: boolean;
300
+ table: MRT_TableInstance<TData>;
301
+ }) => LinearProgressProps);
302
+ muiSearchTextFieldProps?: TextFieldProps | (({ table }: {
303
+ table: MRT_TableInstance<TData>;
304
+ }) => TextFieldProps);
305
+ muiSelectAllCheckboxProps?: CheckboxProps | (({ table }: {
306
+ table: MRT_TableInstance<TData>;
307
+ }) => CheckboxProps);
308
+ muiSelectCheckboxProps?: CheckboxProps | (({ table, row, }: {
309
+ table: MRT_TableInstance<TData>;
310
+ row: MRT_Row<TData>;
311
+ }) => CheckboxProps);
312
+ muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
313
+ table: MRT_TableInstance<TData>;
314
+ cell: MRT_Cell<TData>;
315
+ }) => ButtonProps);
316
+ muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
317
+ table: MRT_TableInstance<TData>;
318
+ cell: MRT_Cell<TData>;
319
+ }) => TextFieldProps);
320
+ muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
321
+ table: MRT_TableInstance<TData>;
322
+ cell: MRT_Cell<TData>;
323
+ }) => TableCellProps);
324
+ muiTableBodyCellSkeletonProps?: SkeletonProps | (({ table, cell, }: {
325
+ table: MRT_TableInstance<TData>;
326
+ cell: MRT_Cell<TData>;
327
+ }) => SkeletonProps);
328
+ muiTableBodyProps?: TableBodyProps | (({ table }: {
329
+ table: MRT_TableInstance<TData>;
330
+ }) => TableBodyProps);
331
+ muiTableBodyRowDragHandleProps?: IconButtonProps | (({ table, row, }: {
332
+ table: MRT_TableInstance<TData>;
333
+ row: MRT_Row<TData>;
334
+ }) => IconButtonProps);
335
+ muiTableBodyRowProps?: TableRowProps | (({ table, row, }: {
336
+ table: MRT_TableInstance<TData>;
337
+ row: MRT_Row<TData>;
338
+ }) => TableRowProps);
339
+ muiTableContainerProps?: TableContainerProps | (({ table, }: {
340
+ table: MRT_TableInstance<TData>;
341
+ }) => TableContainerProps);
342
+ muiTableDetailPanelProps?: TableCellProps | (({ table, row, }: {
343
+ table: MRT_TableInstance<TData>;
344
+ row: MRT_Row<TData>;
345
+ }) => TableCellProps);
346
+ muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
347
+ table: MRT_TableInstance<TData>;
348
+ column: MRT_Column<TData>;
349
+ }) => TableCellProps);
350
+ muiTableFooterProps?: TableFooterProps | (({ table }: {
351
+ table: MRT_TableInstance<TData>;
352
+ }) => TableFooterProps);
353
+ muiTableFooterRowProps?: TableRowProps | (({ table, footerGroup, }: {
354
+ table: MRT_TableInstance<TData>;
355
+ footerGroup: MRT_HeaderGroup<TData>;
356
+ }) => TableRowProps);
357
+ muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ table, column, }: {
358
+ table: MRT_TableInstance<TData>;
359
+ column: MRT_Column<TData>;
360
+ }) => IconButtonProps);
361
+ muiTableHeadCellDragHandleProps?: IconButtonProps | (({ table, column, }: {
362
+ table: MRT_TableInstance<TData>;
363
+ column: MRT_Column<TData>;
364
+ }) => IconButtonProps);
365
+ muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, rangeFilterIndex, }: {
366
+ table: MRT_TableInstance<TData>;
367
+ column: MRT_Column<TData>;
368
+ rangeFilterIndex?: number;
369
+ }) => TextFieldProps);
370
+ muiTableHeadCellProps?: TableCellProps | (({ table, column, }: {
371
+ table: MRT_TableInstance<TData>;
372
+ column: MRT_Column<TData>;
373
+ }) => TableCellProps);
374
+ muiTableHeadProps?: TableHeadProps | (({ table }: {
375
+ table: MRT_TableInstance<TData>;
376
+ }) => TableHeadProps);
377
+ muiTableHeadRowProps?: TableRowProps | (({ table, headerGroup, }: {
378
+ table: MRT_TableInstance<TData>;
379
+ headerGroup: MRT_HeaderGroup<TData>;
380
+ }) => TableRowProps);
381
+ muiTablePaginationProps?: Partial<TablePaginationProps> | (({ table, }: {
382
+ table: MRT_TableInstance<TData>;
383
+ }) => Partial<TablePaginationProps>);
384
+ muiTablePaperProps?: PaperProps | (({ table }: {
385
+ table: MRT_TableInstance<TData>;
386
+ }) => PaperProps);
387
+ muiTableProps?: TableProps | (({ table }: {
388
+ table: MRT_TableInstance<TData>;
389
+ }) => TableProps);
390
+ muiTableToolbarAlertBannerProps?: AlertProps | (({ table }: {
391
+ table: MRT_TableInstance<TData>;
392
+ }) => AlertProps);
393
+ muiTableToolbarBottomProps?: ToolbarProps | (({ table }: {
394
+ table: MRT_TableInstance<TData>;
395
+ }) => ToolbarProps);
396
+ muiTableToolbarTopProps?: ToolbarProps | (({ table }: {
397
+ table: MRT_TableInstance<TData>;
398
+ }) => ToolbarProps);
399
+ onCellEditBlur?: ({ cell, event, table, }: {
400
+ event: FocusEvent<HTMLInputElement>;
401
+ cell: MRT_Cell<TData>;
402
+ table: MRT_TableInstance<TData>;
403
+ }) => void;
404
+ onCellEditChange?: ({ cell, event, table, }: {
405
+ event: ChangeEvent<HTMLInputElement>;
406
+ cell: MRT_Cell<TData>;
407
+ table: MRT_TableInstance<TData>;
408
+ }) => void;
409
+ onColumnDrop?: ({ event, draggedColumn, targetColumn, }: {
410
+ event: DragEvent<HTMLButtonElement>;
411
+ draggedColumn: MRT_Column<TData>;
412
+ targetColumn: MRT_Column<TData> | {
413
+ id: string;
414
+ } | null;
415
+ }) => void;
416
+ onCurrentDraggingColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
417
+ onCurrentDraggingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
418
+ onCurrentEditingCellChange?: OnChangeFn<MRT_Cell<TData> | null>;
419
+ onCurrentEditingRowChange?: OnChangeFn<MRT_Row<TData> | null>;
420
+ onCurrentFilterFnsChange?: OnChangeFn<{
421
+ [key: string]: MRT_FilterOption;
422
+ }>;
423
+ onCurrentGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
424
+ onCurrentHoveredColumnChange?: OnChangeFn<MRT_Column<TData> | null>;
425
+ onCurrentHoveredRowChange?: OnChangeFn<MRT_Row<TData> | null>;
426
+ onDensityChange?: OnChangeFn<boolean>;
427
+ onEditRowSubmit?: ({ row, table, }: {
428
+ row: MRT_Row<TData>;
429
+ table: MRT_TableInstance<TData>;
430
+ }) => Promise<void> | void;
431
+ onIsFullScreenChange?: OnChangeFn<boolean>;
432
+ onRowDrop?: ({ event, draggedRow, targetRow, }: {
433
+ event: DragEvent<HTMLButtonElement>;
434
+ draggedRow: MRT_Row<TData>;
435
+ targetRow: MRT_Row<TData> | {
436
+ id: string;
437
+ } | null;
438
+ }) => void;
439
+ onShowAlertBannerChange?: OnChangeFn<boolean>;
440
+ onShowFiltersChange?: OnChangeFn<boolean>;
441
+ onShowGlobalFilterChange?: OnChangeFn<boolean>;
442
+ onTableInstanceChange?: (table: MRT_TableInstance<TData>) => void;
443
+ positionActionsColumn?: 'first' | 'last';
444
+ positionExpandColumn?: 'first' | 'last';
445
+ positionGlobalFilter?: 'left' | 'right';
446
+ positionPagination?: 'bottom' | 'top' | 'both';
447
+ positionToolbarAlertBanner?: 'bottom' | 'top' | 'none';
448
+ positionToolbarDropZone?: 'bottom' | 'top' | 'none' | 'both';
449
+ renderDetailPanel?: ({ row, table, }: {
450
+ row: MRT_Row<TData>;
451
+ table: MRT_TableInstance<TData>;
452
+ }) => ReactNode;
453
+ renderRowActionMenuItems?: ({ closeMenu, row, table, }: {
454
+ closeMenu: () => void;
455
+ row: MRT_Row<TData>;
456
+ table: MRT_TableInstance<TData>;
457
+ }) => ReactNode[];
458
+ renderRowActions?: ({ row, table, }: {
459
+ row: MRT_Row<TData>;
460
+ table: MRT_TableInstance<TData>;
461
+ }) => ReactNode;
462
+ renderToolbarBottomCustomActions?: ({ table, }: {
463
+ table: MRT_TableInstance<TData>;
464
+ }) => ReactNode;
465
+ renderToolbarInternalActions?: ({ table, MRT_ToggleGlobalFilterButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
466
+ table: MRT_TableInstance<TData>;
467
+ MRT_ToggleGlobalFilterButton: FC<IconButtonProps & {
468
+ table: MRT_TableInstance<TData>;
469
+ }>;
470
+ MRT_ToggleFiltersButton: FC<IconButtonProps & {
471
+ table: MRT_TableInstance<TData>;
472
+ }>;
473
+ MRT_ShowHideColumnsButton: FC<IconButtonProps & {
474
+ table: MRT_TableInstance<TData>;
475
+ }>;
476
+ MRT_ToggleDensePaddingButton: FC<IconButtonProps & {
477
+ table: MRT_TableInstance<TData>;
478
+ }>;
479
+ MRT_FullScreenToggleButton: FC<IconButtonProps & {
480
+ table: MRT_TableInstance<TData>;
481
+ }>;
482
+ }) => ReactNode;
483
+ renderToolbarTopCustomActions?: ({ table, }: {
484
+ table: MRT_TableInstance<TData>;
485
+ }) => ReactNode;
486
+ rowCount?: number;
487
+ rowNumberMode?: 'original' | 'static';
488
+ selectAllMode?: 'all' | 'page';
489
+ state?: Partial<MRT_TableState<TData>>;
490
+ tableId?: string;
491
+ virtualizerProps?: Partial<VirtualizerOptions<HTMLDivElement, HTMLTableRowElement>>;
492
+ };
493
+ declare const _default: <TData extends Record<string, any> = {}>({ autoResetExpanded, columnResizeMode, defaultColumn, editingMode, enableColumnActions, enableColumnFilterChangeMode, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGlobalFilterChangeMode, enableGlobalFilterRankedResults, enableGrouping, enableHiding, enableMultiRowSelection, enableMultiSort, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarBottom, enableToolbarInternalActions, enableToolbarTop, icons, localization, positionActionsColumn, positionExpandColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, rowNumberMode, selectAllMode, ...rest }: MaterialReactTableProps<TData>) => JSX.Element;
494
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { FC, RefObject } from 'react';
2
+ import type { MRT_TableInstance } from '..';
3
+ interface Props {
4
+ table: MRT_TableInstance;
5
+ tableContainerRef: RefObject<HTMLDivElement>;
6
+ }
7
+ export declare const MRT_TableBody: FC<Props>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { FC, RefObject } from 'react';
2
+ import type { MRT_Cell, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ cell: MRT_Cell;
5
+ enableHover?: boolean;
6
+ rowIndex: number;
7
+ rowRef: RefObject<HTMLTableRowElement>;
8
+ table: MRT_TableInstance;
9
+ }
10
+ export declare const MRT_TableBodyCell: FC<Props>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ row: MRT_Row;
5
+ rowIndex: number;
6
+ table: MRT_TableInstance;
7
+ }
8
+ export declare const MRT_TableBodyRow: FC<Props>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC, RefObject } from 'react';
2
+ import { MRT_Cell, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ cell: MRT_Cell;
5
+ rowRef: RefObject<HTMLTableRowElement>;
6
+ table: MRT_TableInstance;
7
+ }
8
+ export declare const MRT_TableBodyRowGrabHandle: FC<Props>;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ row: MRT_Row;
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_TableDetailPanel: FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import type { MRT_Column, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ column: MRT_Column;
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ColumnPinningButtons: FC<Props>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { MRT_Cell, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ cell: MRT_Cell;
5
+ children: ReactNode;
6
+ table: MRT_TableInstance;
7
+ }
8
+ export declare const MRT_CopyButton: FC<Props>;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ row: MRT_Row;
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_EditActionButtons: FC<Props>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { MRT_TableInstance } from '..';
3
+ interface Props {
4
+ table: MRT_TableInstance;
5
+ }
6
+ export declare const MRT_ExpandAllButton: FC<Props>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ row: MRT_Row;
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ExpandButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
4
+ interface Props extends IconButtonProps {
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_FullScreenToggleButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { IconButtonProps } from '@mui/material';
2
+ import { DragEventHandler, FC } from 'react';
3
+ import { MRT_TableInstance } from '..';
4
+ interface Props {
5
+ iconButtonProps?: IconButtonProps;
6
+ onDragStart: DragEventHandler<HTMLButtonElement>;
7
+ onDragEnd: DragEventHandler<HTMLButtonElement>;
8
+ table: MRT_TableInstance;
9
+ }
10
+ export declare const MRT_GrabHandleButton: FC<Props>;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
4
+ interface Props extends IconButtonProps {
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ShowHideColumnsButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
4
+ interface Props extends IconButtonProps {
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ToggleDensePaddingButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
4
+ interface Props extends IconButtonProps {
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ToggleFiltersButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { MRT_TableInstance } from '..';
4
+ interface Props extends IconButtonProps {
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ToggleGlobalFilterButton: FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import type { MRT_Row, MRT_TableInstance } from '..';
3
+ interface Props {
4
+ row: MRT_Row;
5
+ table: MRT_TableInstance;
6
+ }
7
+ export declare const MRT_ToggleRowActionMenuButton: FC<Props>;
8
+ export {};