@redsift/table-pro 12.5.4
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/CONTRIBUTING.md +435 -0
- package/_internal/BaseComponents.js +3 -0
- package/_internal/BaseComponents.js.map +1 -0
- package/_internal/BaseIconButton.js +126 -0
- package/_internal/BaseIconButton.js.map +1 -0
- package/_internal/BaseTextField.js +26 -0
- package/_internal/BaseTextField.js.map +1 -0
- package/_internal/DataGrid.js +2 -0
- package/_internal/DataGrid.js.map +1 -0
- package/_internal/DataGrid2.js +507 -0
- package/_internal/DataGrid2.js.map +1 -0
- package/_internal/GridToolbarFilterSemanticField.js +2 -0
- package/_internal/GridToolbarFilterSemanticField.js.map +1 -0
- package/_internal/GridToolbarFilterSemanticField2.js +6962 -0
- package/_internal/GridToolbarFilterSemanticField2.js.map +1 -0
- package/_internal/Pagination.js +2 -0
- package/_internal/Pagination.js.map +1 -0
- package/_internal/ServerSideControlledPagination.js +324 -0
- package/_internal/ServerSideControlledPagination.js.map +1 -0
- package/_internal/StatefulDataGrid.js +2 -0
- package/_internal/StatefulDataGrid.js.map +1 -0
- package/_internal/StatefulDataGrid2.js +3237 -0
- package/_internal/StatefulDataGrid2.js.map +1 -0
- package/_internal/TextCell.js +2 -0
- package/_internal/TextCell.js.map +1 -0
- package/_internal/TextCell2.js +66 -0
- package/_internal/TextCell2.js.map +1 -0
- package/_internal/Toolbar.js +2 -0
- package/_internal/Toolbar.js.map +1 -0
- package/_internal/Toolbar2.js +102 -0
- package/_internal/Toolbar2.js.map +1 -0
- package/_internal/ToolbarWrapper.js +2 -0
- package/_internal/ToolbarWrapper.js.map +1 -0
- package/_internal/ToolbarWrapper2.js +53 -0
- package/_internal/ToolbarWrapper2.js.map +1 -0
- package/_internal/_rollupPluginBabelHelpers.js +93 -0
- package/_internal/_rollupPluginBabelHelpers.js.map +1 -0
- package/_internal/useControlledDatagridState.js +170 -0
- package/_internal/useControlledDatagridState.js.map +1 -0
- package/index.d.ts +1223 -0
- package/index.js +721 -0
- package/index.js.map +1 -0
- package/package.json +96 -0
- package/style/index.css +7 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,1223 @@
|
|
|
1
|
+
import { GridColTypeDef, GridColType, GridColDef, GridFilterOperator, GridFilterInputSingleSelect, GridFilterInputMultipleSingleSelect, GridRowId, GridRowSelectionModel, DataGridProProps, GridFilterModel, GridPaginationModel, GridSortModel, GridColumnVisibilityModel, GridPinnedColumnFields, GridInitialState, GridSlotsComponent, GridApiPro, GridCallbackDetails, GridRowParams, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
2
|
+
export { GridAlignment, GridColDef, GridFilterItem, GridFilterModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
|
+
import * as _mui_x_data_grid from '@mui/x-data-grid';
|
|
4
|
+
import React$1, { Ref, ReactElement, ComponentProps, ReactNode, MutableRefObject, RefObject } from 'react';
|
|
5
|
+
import { TablePaginationProps } from '@mui/material';
|
|
6
|
+
|
|
7
|
+
declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid.GridColDef;
|
|
8
|
+
|
|
9
|
+
declare const getRsStringColumnType: () => GridColTypeDef;
|
|
10
|
+
declare const getRsNumberColumnType: () => GridColTypeDef;
|
|
11
|
+
declare const getRsSingleSelectColumnType: () => GridColTypeDef;
|
|
12
|
+
declare const getRsSingleSelectWithShortOperatorListColumnType: () => GridColTypeDef;
|
|
13
|
+
declare const getRsMultipleSelectColumnType: () => GridColTypeDef;
|
|
14
|
+
declare const getRsMultipleSelectWithShortOperatorListColumnType: () => GridColTypeDef;
|
|
15
|
+
declare const customColumnTypes: Record<GridColType | string, GridColTypeDef>;
|
|
16
|
+
|
|
17
|
+
type StringOperatorName = 'contains' | 'doesNotContain' | 'equals' | 'doesNotEqual' | 'startsWith' | 'doesNotStartWith' | 'endsWith' | 'doesNotEndWith' | 'isEmpty' | 'isNotEmpty' | 'isAnyOf' | 'isNotAnyOf' | 'containsAnyOf' | 'doesNotContainAnyOf' | 'startsWithAnyOf' | 'doesNotStartWithAnyOf' | 'endsWithAnyOf' | 'doesNotEndWithAnyOf';
|
|
18
|
+
type NumberOperatorName = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'isEmpty' | 'isNotEmpty' | 'isBetween';
|
|
19
|
+
type DateOperatorName = 'is' | 'not' | 'after' | 'onOrAfter' | 'before' | 'onOrBefore' | 'isEmpty' | 'isNotEmpty' | 'isBetween';
|
|
20
|
+
type SingleSelectOperatorName = 'is' | 'isNot' | 'isAnyOf' | 'isNotAnyOf' | 'isEmpty' | 'isNotEmpty';
|
|
21
|
+
type MultiSelectOperatorName = 'has' | 'doesNotHave' | 'hasAnyOf' | 'hasAllOf' | 'doesNotHaveAnyOf' | 'hasOnly' | 'isEmpty' | 'isNotEmpty';
|
|
22
|
+
type TagsOperatorName = 'has' | 'doesNotHave' | 'hasAnyOf' | 'hasAllOf' | 'doesNotHaveAnyOf' | 'hasOnly' | 'containsAnyOf' | 'doesNotContainAnyOf' | 'isEmpty' | 'isNotEmpty';
|
|
23
|
+
type ColumnType = 'string' | 'number' | 'date' | 'dateTime' | 'singleSelect' | 'multiSelect' | 'tags';
|
|
24
|
+
type BuiltInOptions<TOperatorName extends string> = {
|
|
25
|
+
compact?: boolean;
|
|
26
|
+
exclude?: TOperatorName[];
|
|
27
|
+
extend?: GridFilterOperator[];
|
|
28
|
+
caseSensitive?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type OverrideOptions = {
|
|
31
|
+
operators: GridFilterOperator[];
|
|
32
|
+
};
|
|
33
|
+
type StringColumnOptions = BuiltInOptions<StringOperatorName> | OverrideOptions;
|
|
34
|
+
type NumberColumnOptions = Omit<BuiltInOptions<NumberOperatorName>, 'caseSensitive'> | OverrideOptions;
|
|
35
|
+
type DateColumnOptions = Omit<BuiltInOptions<DateOperatorName>, 'caseSensitive'> | OverrideOptions;
|
|
36
|
+
type SingleSelectColumnOptions = BuiltInOptions<SingleSelectOperatorName> | OverrideOptions;
|
|
37
|
+
type MultiSelectColumnOptions = BuiltInOptions<MultiSelectOperatorName> | OverrideOptions;
|
|
38
|
+
type TagsColumnOptions = BuiltInOptions<TagsOperatorName> | OverrideOptions;
|
|
39
|
+
type ColumnOptions<T extends ColumnType> = T extends 'string' ? StringColumnOptions : T extends 'number' ? NumberColumnOptions : T extends 'date' | 'dateTime' ? DateColumnOptions : T extends 'singleSelect' ? SingleSelectColumnOptions : T extends 'multiSelect' ? MultiSelectColumnOptions : T extends 'tags' ? TagsColumnOptions : never;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a column configuration with the appropriate MUI type and filter operators
|
|
42
|
+
* for the given column type. Spread the result into your column definition.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* const columns = [
|
|
47
|
+
* { ...createColumn('string'), field: 'name', headerName: 'Name' },
|
|
48
|
+
* { ...createColumn('number'), field: 'price', headerName: 'Price' },
|
|
49
|
+
* { ...createColumn('singleSelect', { compact: true }), field: 'status', valueOptions: ['active', 'inactive'] },
|
|
50
|
+
* { ...createColumn('multiSelect'), field: 'tags', valueOptions: ['a', 'b', 'c'] },
|
|
51
|
+
* { ...createColumn('tags'), field: 'labels', headerName: 'Labels' },
|
|
52
|
+
* ];
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function createColumn<T extends ColumnType>(type: T, options?: ColumnOptions<T>): Partial<GridColDef>;
|
|
56
|
+
|
|
57
|
+
declare const ARRAY_IS_EMPTY: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
58
|
+
declare const ARRAY_IS_NOT_EMPTY: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
59
|
+
|
|
60
|
+
declare const DATE_IS_BETWEEN: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
61
|
+
|
|
62
|
+
declare const getGridDateOperatorsExtended: (showTime?: boolean) => GridFilterOperator[];
|
|
63
|
+
|
|
64
|
+
declare const IS_BETWEEN: GridFilterOperator<any, number, any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
65
|
+
|
|
66
|
+
declare const getGridNumericOperators: () => GridFilterOperator<any, unknown, any>[];
|
|
67
|
+
|
|
68
|
+
declare const DOES_NOT_CONTAIN: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
69
|
+
|
|
70
|
+
declare const DOES_NOT_END_WITH: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
71
|
+
|
|
72
|
+
declare const DOES_NOT_EQUAL: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
73
|
+
|
|
74
|
+
declare const DOES_NOT_HAVE: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
75
|
+
declare const DOES_NOT_HAVE_WITH_SELECT: {
|
|
76
|
+
InputComponent: typeof GridFilterInputSingleSelect;
|
|
77
|
+
label?: string;
|
|
78
|
+
headerLabel?: string;
|
|
79
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
80
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
81
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
82
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
83
|
+
requiresFilterValue?: boolean;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
declare const DOES_NOT_START_WITH: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
87
|
+
|
|
88
|
+
declare const HAS: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
89
|
+
declare const HAS_WITH_SELECT: {
|
|
90
|
+
InputComponent: typeof GridFilterInputSingleSelect;
|
|
91
|
+
label?: string;
|
|
92
|
+
headerLabel?: string;
|
|
93
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
94
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
95
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
96
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
97
|
+
requiresFilterValue?: boolean;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
declare const HAS_ONLY: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
101
|
+
declare const HAS_ONLY_WITH_SELECT: {
|
|
102
|
+
InputComponent: typeof GridFilterInputSingleSelect;
|
|
103
|
+
label?: string;
|
|
104
|
+
headerLabel?: string;
|
|
105
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
106
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
107
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
108
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
109
|
+
requiresFilterValue?: boolean;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
declare const IS: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
113
|
+
declare const IS_WITH_SELECT: {
|
|
114
|
+
InputComponent: typeof GridFilterInputSingleSelect;
|
|
115
|
+
label?: string;
|
|
116
|
+
headerLabel?: string;
|
|
117
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
118
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
119
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
120
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
121
|
+
requiresFilterValue?: boolean;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
declare const IS_NOT: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
125
|
+
declare const IS_NOT_WITH_SELECT: {
|
|
126
|
+
InputComponent: typeof GridFilterInputSingleSelect;
|
|
127
|
+
label?: string;
|
|
128
|
+
headerLabel?: string;
|
|
129
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
130
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
131
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
132
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
133
|
+
requiresFilterValue?: boolean;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
declare const getGridStringOperators: () => GridFilterOperator<any, unknown, any>[];
|
|
137
|
+
|
|
138
|
+
declare const CONTAINS_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
139
|
+
|
|
140
|
+
declare const DOES_NOT_CONTAIN_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
141
|
+
|
|
142
|
+
declare const DOES_NOT_END_WITH_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
143
|
+
|
|
144
|
+
declare const DOES_NOT_HAVE_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
145
|
+
declare const DOES_NOT_HAVE_ANY_OF_WITH_SELECT: {
|
|
146
|
+
InputComponent: typeof GridFilterInputMultipleSingleSelect;
|
|
147
|
+
label?: string;
|
|
148
|
+
headerLabel?: string;
|
|
149
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
150
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
151
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
152
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
153
|
+
requiresFilterValue?: boolean;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
declare const DOES_NOT_START_WITH_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
157
|
+
|
|
158
|
+
declare const ENDS_WITH_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
159
|
+
|
|
160
|
+
declare const HAS_ALL_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
161
|
+
declare const HAS_ALL_OF_WITH_SELECT: {
|
|
162
|
+
InputComponent: typeof GridFilterInputMultipleSingleSelect;
|
|
163
|
+
label?: string;
|
|
164
|
+
headerLabel?: string;
|
|
165
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
166
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
167
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
168
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
169
|
+
requiresFilterValue?: boolean;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
declare const HAS_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
173
|
+
declare const HAS_ANY_OF_WITH_SELECT: {
|
|
174
|
+
InputComponent: typeof GridFilterInputMultipleSingleSelect;
|
|
175
|
+
label?: string;
|
|
176
|
+
headerLabel?: string;
|
|
177
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
178
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
179
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
180
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
181
|
+
requiresFilterValue?: boolean;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
declare const IS_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
185
|
+
declare const IS_ANY_OF_WITH_SELECT: {
|
|
186
|
+
InputComponent: typeof GridFilterInputMultipleSingleSelect;
|
|
187
|
+
label?: string;
|
|
188
|
+
headerLabel?: string;
|
|
189
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
190
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
191
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
192
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
193
|
+
requiresFilterValue?: boolean;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
declare const IS_ANY_OF_I: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
197
|
+
declare const IS_ANY_OF_I_WITH_SELECT: {
|
|
198
|
+
InputComponent: typeof GridFilterInputMultipleSingleSelect;
|
|
199
|
+
label?: string;
|
|
200
|
+
headerLabel?: string;
|
|
201
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
202
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
203
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
204
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
205
|
+
requiresFilterValue?: boolean;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
declare const IS_NOT_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
209
|
+
declare const IS_NOT_ANY_OF_WITH_SELECT: {
|
|
210
|
+
InputComponent: typeof GridFilterInputMultipleSingleSelect;
|
|
211
|
+
label?: string;
|
|
212
|
+
headerLabel?: string;
|
|
213
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
214
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
215
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
216
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
217
|
+
requiresFilterValue?: boolean;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
declare const STARTS_WITH_ANY_OF: GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps>;
|
|
221
|
+
|
|
222
|
+
declare const getGridStringArrayOperators: () => GridFilterOperator<any, unknown, any>[];
|
|
223
|
+
declare const getGridStringArrayOperatorsWithSelect: () => GridFilterOperator<any, unknown, any>[];
|
|
224
|
+
declare const getGridStringArrayOperatorsWithSelectOnStringArrayColumns: () => GridFilterOperator<any, unknown, any>[];
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Wraps a filter operator's `getApplyFilterFn` to lowercase both the cell value
|
|
228
|
+
* and the filter value before comparison, making the operator case-insensitive.
|
|
229
|
+
*
|
|
230
|
+
* Only affects string-based values — numbers, dates, and booleans pass through unchanged.
|
|
231
|
+
*/
|
|
232
|
+
declare const wrapCaseInsensitive: (operator: GridFilterOperator) => GridFilterOperator;
|
|
233
|
+
/**
|
|
234
|
+
* Applies case-insensitive wrapping to an array of filter operators.
|
|
235
|
+
*/
|
|
236
|
+
declare const makeCaseInsensitive: (operators: GridFilterOperator[]) => GridFilterOperator[];
|
|
237
|
+
|
|
238
|
+
declare const operatorList: {
|
|
239
|
+
string: _mui_x_data_grid.GridFilterOperator<any, string | number | null, any, _mui_x_data_grid.GridFilterInputValueProps>[];
|
|
240
|
+
number: _mui_x_data_grid.GridFilterOperator<any, string | number | null, any, _mui_x_data_grid.GridFilterInputValueProps & {
|
|
241
|
+
type?: "number";
|
|
242
|
+
}>[];
|
|
243
|
+
boolean: _mui_x_data_grid.GridFilterOperator<any, boolean | null, any, _mui_x_data_grid.GridFilterInputValueProps>[];
|
|
244
|
+
date: _mui_x_data_grid.GridFilterOperator<any, Date, any, _mui_x_data_grid.GridFilterInputDateProps>[];
|
|
245
|
+
dateTime: _mui_x_data_grid.GridFilterOperator<any, Date, any, _mui_x_data_grid.GridFilterInputDateProps>[];
|
|
246
|
+
singleSelect: _mui_x_data_grid.GridFilterOperator<any, any, any, _mui_x_data_grid.GridFilterInputValueProps>[];
|
|
247
|
+
rsString: _mui_x_data_grid.GridFilterOperator<any, unknown, any, _mui_x_data_grid.GridFilterInputValueProps>[];
|
|
248
|
+
rsNumber: _mui_x_data_grid.GridFilterOperator<any, unknown, any, _mui_x_data_grid.GridFilterInputValueProps>[];
|
|
249
|
+
rsSingleSelect: (_mui_x_data_grid.GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps> | {
|
|
250
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputSingleSelect;
|
|
251
|
+
label?: string;
|
|
252
|
+
headerLabel?: string;
|
|
253
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
254
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
255
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
256
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
257
|
+
requiresFilterValue?: boolean;
|
|
258
|
+
} | {
|
|
259
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputMultipleSingleSelect;
|
|
260
|
+
label?: string;
|
|
261
|
+
headerLabel?: string;
|
|
262
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
263
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
264
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
265
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
266
|
+
requiresFilterValue?: boolean;
|
|
267
|
+
})[];
|
|
268
|
+
rsSingleSelectWithShortOperatorList: ({
|
|
269
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputSingleSelect;
|
|
270
|
+
label?: string;
|
|
271
|
+
headerLabel?: string;
|
|
272
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
273
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
274
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
275
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
276
|
+
requiresFilterValue?: boolean;
|
|
277
|
+
} | {
|
|
278
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputMultipleSingleSelect;
|
|
279
|
+
label?: string;
|
|
280
|
+
headerLabel?: string;
|
|
281
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
282
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
283
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
284
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
285
|
+
requiresFilterValue?: boolean;
|
|
286
|
+
})[];
|
|
287
|
+
rsMultipleSelect: (_mui_x_data_grid.GridFilterOperator<any, string | string[], any, _mui_x_data_grid.GridFilterInputValueProps> | {
|
|
288
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputSingleSelect;
|
|
289
|
+
label?: string;
|
|
290
|
+
headerLabel?: string;
|
|
291
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
292
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
293
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
294
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
295
|
+
requiresFilterValue?: boolean;
|
|
296
|
+
} | {
|
|
297
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputMultipleSingleSelect;
|
|
298
|
+
label?: string;
|
|
299
|
+
headerLabel?: string;
|
|
300
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
301
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
302
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
303
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
304
|
+
requiresFilterValue?: boolean;
|
|
305
|
+
})[];
|
|
306
|
+
rsMultipleSelectWithShortOperatorList: ({
|
|
307
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputSingleSelect;
|
|
308
|
+
label?: string;
|
|
309
|
+
headerLabel?: string;
|
|
310
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
311
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
312
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
313
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
314
|
+
requiresFilterValue?: boolean;
|
|
315
|
+
} | {
|
|
316
|
+
InputComponent: typeof _mui_x_data_grid.GridFilterInputMultipleSingleSelect;
|
|
317
|
+
label?: string;
|
|
318
|
+
headerLabel?: string;
|
|
319
|
+
value: _mui_x_data_grid.GridFilterItem["operator"];
|
|
320
|
+
getApplyFilterFn: _mui_x_data_grid.GetApplyFilterFn<any, string | string[], any>;
|
|
321
|
+
InputComponentProps?: Partial<_mui_x_data_grid.GridFilterInputValueProps> | undefined;
|
|
322
|
+
getValueAsString?: (value: _mui_x_data_grid.GridFilterItem["value"]) => string;
|
|
323
|
+
requiresFilterValue?: boolean;
|
|
324
|
+
})[];
|
|
325
|
+
rsStringArray: _mui_x_data_grid.GridFilterOperator<any, unknown, any, _mui_x_data_grid.GridFilterInputValueProps>[];
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
declare function getCompletion(text: string, role: string, openai_api_key: string | undefined, model?: string): Promise<string>;
|
|
329
|
+
|
|
330
|
+
declare const PAGINATION_MODEL_KEY = "paginationModel";
|
|
331
|
+
declare const FILTER_MODEL_KEY = "filterModel";
|
|
332
|
+
declare const SORT_MODEL_KEY = "sortModel";
|
|
333
|
+
declare const VISIBILITY_MODEL_KEY = "visibilityModel";
|
|
334
|
+
declare const PINNED_COLUMNS = "pinnedColumns";
|
|
335
|
+
declare const DIMENSION_MODEL_KEY = "dimension";
|
|
336
|
+
declare const FILTER_SEARCH_KEY = "searchModel";
|
|
337
|
+
declare const DENSITY_MODEL_KEY = "densityModel";
|
|
338
|
+
declare const COLUMN_ORDER_MODEL_KEY = "columnOrderModel";
|
|
339
|
+
declare const CATEGORIES: readonly ["paginationModel", "filterModel", "sortModel", "visibilityModel", "dimension", "searchModel", "pinnedColumns", "densityModel", "columnOrderModel"];
|
|
340
|
+
type Category = (typeof CATEGORIES)[number];
|
|
341
|
+
/**
|
|
342
|
+
* Build the localStorage key for a specific grid state category.
|
|
343
|
+
* Consumers can use this to read or clear individual state entries directly.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```ts
|
|
347
|
+
* const key = buildStorageKey({ id: pathname, version: 2, category: DENSITY_MODEL_KEY });
|
|
348
|
+
* localStorage.removeItem(key);
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
declare const buildStorageKey: ({ id, version, category }: {
|
|
352
|
+
id: string;
|
|
353
|
+
version: number;
|
|
354
|
+
category: Category;
|
|
355
|
+
}) => `${string}:${number}:paginationModel` | `${string}:${number}:filterModel` | `${string}:${number}:sortModel` | `${string}:${number}:visibilityModel` | `${string}:${number}:pinnedColumns` | `${string}:${number}:dimension` | `${string}:${number}:searchModel` | `${string}:${number}:densityModel` | `${string}:${number}:columnOrderModel`;
|
|
356
|
+
declare const clearPreviousVersionStorage: (id: string, previousLocalStorageVersions: number[]) => void;
|
|
357
|
+
/**
|
|
358
|
+
* Clear localStorage keys for all versions from 0 to `maxVersion` (inclusive).
|
|
359
|
+
* Useful when the consumer wants to wipe all persisted grid state regardless of which version is active.
|
|
360
|
+
*/
|
|
361
|
+
declare const clearAllVersionStorage: (id: string, maxVersion: number) => void;
|
|
362
|
+
/**
|
|
363
|
+
* Fully reset a `StatefulDataGrid` — clear localStorage for the given versions
|
|
364
|
+
* and strip all grid-owned URL params (`_*` and `v=`), preserving any non-grid params.
|
|
365
|
+
*
|
|
366
|
+
* Call from within a component where the router values are available:
|
|
367
|
+
* ```ts
|
|
368
|
+
* const { search, historyReplace } = useMyRouter();
|
|
369
|
+
* resetStatefulDataGridState({ id: 'myGrid', versions: [0, 1, 2], search, historyReplace });
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
declare const resetStatefulDataGridState: ({ id, versions, search, historyReplace, }: {
|
|
373
|
+
id: string;
|
|
374
|
+
versions: number[];
|
|
375
|
+
search: string;
|
|
376
|
+
historyReplace: (newSearch: string) => void;
|
|
377
|
+
}) => void;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Type for legacy array-based row selection (v7 and earlier)
|
|
381
|
+
*/
|
|
382
|
+
type LegacyRowSelectionModel = GridRowId[];
|
|
383
|
+
/**
|
|
384
|
+
* Type that accepts both legacy array format and new v8 object format
|
|
385
|
+
*/
|
|
386
|
+
type RowSelectionModelInput = LegacyRowSelectionModel | GridRowSelectionModel;
|
|
387
|
+
/**
|
|
388
|
+
* Default empty row selection model for MUI DataGrid v8+
|
|
389
|
+
* In v8, GridRowSelectionModel changed from GridRowId[] to { type: 'include' | 'exclude'; ids: Set<GridRowId> }
|
|
390
|
+
*/
|
|
391
|
+
declare const EMPTY_ROW_SELECTION_MODEL: GridRowSelectionModel;
|
|
392
|
+
/**
|
|
393
|
+
* Creates a new row selection model with the given ids
|
|
394
|
+
*/
|
|
395
|
+
declare const createRowSelectionModel: (ids: GridRowId[] | Set<GridRowId>) => GridRowSelectionModel;
|
|
396
|
+
/**
|
|
397
|
+
* Normalizes a row selection model input to the v8 GridRowSelectionModel format.
|
|
398
|
+
* Accepts both legacy array format (v7) and new object format (v8).
|
|
399
|
+
* This allows consumers to continue using arrays while internally using the v8 format.
|
|
400
|
+
*/
|
|
401
|
+
declare const normalizeRowSelectionModel: (input: RowSelectionModelInput | undefined | null) => GridRowSelectionModel;
|
|
402
|
+
/**
|
|
403
|
+
* Gets the size/count of selected rows from a selection model
|
|
404
|
+
*/
|
|
405
|
+
declare const getSelectionCount: (model: GridRowSelectionModel) => number;
|
|
406
|
+
/**
|
|
407
|
+
* Checks if a row is selected in the given selection model
|
|
408
|
+
*/
|
|
409
|
+
declare const isRowSelected: (model: GridRowSelectionModel, rowId: GridRowId) => boolean;
|
|
410
|
+
/**
|
|
411
|
+
* Converts a selection model to an array of selected row IDs
|
|
412
|
+
* Note: For 'exclude' type, this only returns the ids that are explicitly excluded,
|
|
413
|
+
* not the actual selected rows (which would require knowing all row ids)
|
|
414
|
+
*/
|
|
415
|
+
declare const getSelectedIds: (model: GridRowSelectionModel) => GridRowId[];
|
|
416
|
+
|
|
417
|
+
/** Component Type. */
|
|
418
|
+
type Comp<P, T = HTMLElement> = {
|
|
419
|
+
(props: P & {
|
|
420
|
+
ref?: Ref<T>;
|
|
421
|
+
}): ReactElement | null;
|
|
422
|
+
/** React component type. */
|
|
423
|
+
readonly $$typeof?: symbol;
|
|
424
|
+
/** Component name. */
|
|
425
|
+
displayName?: string;
|
|
426
|
+
/** Component base class name. */
|
|
427
|
+
className?: string;
|
|
428
|
+
};
|
|
429
|
+
/** Get types of the values of a record. */
|
|
430
|
+
type ValueOf<T extends Record<any, any>> = T[keyof T];
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Color palette.
|
|
434
|
+
*/
|
|
435
|
+
declare const Theme: {
|
|
436
|
+
readonly light: "light";
|
|
437
|
+
readonly dark: "dark";
|
|
438
|
+
};
|
|
439
|
+
type Theme = ValueOf<typeof Theme>;
|
|
440
|
+
declare const NotificationsColorPalette: {
|
|
441
|
+
readonly question: "question";
|
|
442
|
+
readonly 'no-data': "no-data";
|
|
443
|
+
readonly success: "success";
|
|
444
|
+
readonly warning: "warning";
|
|
445
|
+
readonly info: "info";
|
|
446
|
+
readonly primary: "primary";
|
|
447
|
+
readonly secondary: "secondary";
|
|
448
|
+
readonly error: "error";
|
|
449
|
+
};
|
|
450
|
+
type NotificationsColorPalette = ValueOf<typeof NotificationsColorPalette>;
|
|
451
|
+
declare const ProductColorPalette: {
|
|
452
|
+
readonly asm: "asm";
|
|
453
|
+
readonly 'brand-trust': "brand-trust";
|
|
454
|
+
readonly certificates: "certificates";
|
|
455
|
+
readonly ondmarc: "ondmarc";
|
|
456
|
+
readonly pulse: "pulse";
|
|
457
|
+
readonly radar: "radar";
|
|
458
|
+
readonly 'rojo-ds': "rojo-ds";
|
|
459
|
+
readonly 'vendor-secure': "vendor-secure";
|
|
460
|
+
readonly website: "website";
|
|
461
|
+
};
|
|
462
|
+
type ProductColorPalette = ValueOf<typeof ProductColorPalette>;
|
|
463
|
+
|
|
464
|
+
declare const AlignSelf: {
|
|
465
|
+
readonly auto: "auto";
|
|
466
|
+
readonly normal: "normal";
|
|
467
|
+
readonly start: "start";
|
|
468
|
+
readonly end: "end";
|
|
469
|
+
readonly center: "center";
|
|
470
|
+
readonly 'flex-start': "flex-start";
|
|
471
|
+
readonly 'flex-end': "flex-end";
|
|
472
|
+
readonly 'self-start': "self-start";
|
|
473
|
+
readonly 'self-end': "self-end";
|
|
474
|
+
readonly baseline: "baseline";
|
|
475
|
+
readonly stretch: "stretch";
|
|
476
|
+
};
|
|
477
|
+
type AlignSelf = ValueOf<typeof AlignSelf>;
|
|
478
|
+
interface LayoutProps {
|
|
479
|
+
/** When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex">MDN</a>. */
|
|
480
|
+
flex?: string;
|
|
481
|
+
/** When used in a flex layout, specifies how the element will grow to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow">MDN</a>. */
|
|
482
|
+
flexGrow?: number;
|
|
483
|
+
/** When used in a flex layout, specifies how the element will shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink">MDN</a>. */
|
|
484
|
+
flexShrink?: number;
|
|
485
|
+
/** When used in a flex layout, specifies the initial main size of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex_basis">MDN</a>. */
|
|
486
|
+
flexBasis?: string;
|
|
487
|
+
/** Overrides the alignItems property of a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-self">MDN</a>. */
|
|
488
|
+
alignSelf?: AlignSelf;
|
|
489
|
+
/** Specifies how the element is justified inside a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self">MDN</a>. */
|
|
490
|
+
justifySelf?: string;
|
|
491
|
+
/** The layout order for the element within a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/order">MDN</a>. */
|
|
492
|
+
order?: number;
|
|
493
|
+
/** When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area">MDN</a>. */
|
|
494
|
+
gridArea?: string;
|
|
495
|
+
/** When used in a grid layout, specifies the column the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column">MDN</a>. */
|
|
496
|
+
gridColumn?: string;
|
|
497
|
+
/** When used in a grid layout, specifies the row the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row">MDN</a>. */
|
|
498
|
+
gridRow?: string;
|
|
499
|
+
/** When used in a grid layout, specifies the starting column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start">MDN</a>. */
|
|
500
|
+
gridColumnStart?: string;
|
|
501
|
+
/** When used in a grid layout, specifies the ending column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end">MDN</a>. */
|
|
502
|
+
gridColumnEnd?: string;
|
|
503
|
+
/** When used in a grid layout, specifies the starting row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start">MDN</a>. */
|
|
504
|
+
gridRowStart?: string;
|
|
505
|
+
/** When used in a grid layout, specifies the ending row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end">MDN</a>. */
|
|
506
|
+
gridRowEnd?: string;
|
|
507
|
+
}
|
|
508
|
+
interface SpacingProps {
|
|
509
|
+
/** The margin for all four sides of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin">MDN</a>. */
|
|
510
|
+
margin?: string;
|
|
511
|
+
/** The margin for the bottom side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom">MDN</a>. */
|
|
512
|
+
marginBottom?: string;
|
|
513
|
+
/** The margin for the left side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left">MDN</a>. */
|
|
514
|
+
marginLeft?: string;
|
|
515
|
+
/** The margin for the right side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right">MDN</a>. */
|
|
516
|
+
marginRight?: string;
|
|
517
|
+
/** The margin for the top side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top">MDN</a>. */
|
|
518
|
+
marginTop?: string;
|
|
519
|
+
}
|
|
520
|
+
interface PositioningProps {
|
|
521
|
+
/** Specifies how the element is positioned. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position">MDN</a>. */
|
|
522
|
+
position?: string;
|
|
523
|
+
/** The top position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/top">MDN</a>. */
|
|
524
|
+
top?: string;
|
|
525
|
+
/** The bottom position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/bottom">MDN</a>. */
|
|
526
|
+
bottom?: string;
|
|
527
|
+
/** The left position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/left">MDN</a>. Consider using start instead for RTL support. */
|
|
528
|
+
left?: string;
|
|
529
|
+
/** The right position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/right">MDN</a>. Consider using start instead for RTL support. */
|
|
530
|
+
right?: string;
|
|
531
|
+
/** The stacking order for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/z-index">MDN</a>. */
|
|
532
|
+
zIndex?: string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Component size.
|
|
537
|
+
*/
|
|
538
|
+
declare const IconSize: {
|
|
539
|
+
readonly xsmall: "xsmall";
|
|
540
|
+
readonly small: "small";
|
|
541
|
+
readonly medium: "medium";
|
|
542
|
+
readonly large: "large";
|
|
543
|
+
readonly xlarge: "xlarge";
|
|
544
|
+
readonly xxlarge: "xxlarge";
|
|
545
|
+
};
|
|
546
|
+
type IconSize = ValueOf<typeof IconSize>;
|
|
547
|
+
type IconDimensions = {
|
|
548
|
+
width?: number;
|
|
549
|
+
height?: number;
|
|
550
|
+
fontSize?: number;
|
|
551
|
+
lineHeight?: number;
|
|
552
|
+
};
|
|
553
|
+
/**
|
|
554
|
+
* Component props.
|
|
555
|
+
*/
|
|
556
|
+
interface IconProps extends ComponentProps<'span'>, LayoutProps, SpacingProps, PositioningProps {
|
|
557
|
+
/** Indicates whether the element is exposed to an accessibility API. */
|
|
558
|
+
'aria-hidden'?: boolean | 'false' | 'true';
|
|
559
|
+
/** A screen reader only label for the Icon. */
|
|
560
|
+
'aria-label'?: string;
|
|
561
|
+
/** Color variant. Either from color palette or hex or rgb strings. */
|
|
562
|
+
color?: NotificationsColorPalette | ProductColorPalette | (string & {});
|
|
563
|
+
/** Whether the icon has a badge attached to it. */
|
|
564
|
+
badge?: ReactElement;
|
|
565
|
+
/**
|
|
566
|
+
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
567
|
+
* Can also be a ReactElement.
|
|
568
|
+
*/
|
|
569
|
+
icon: string | string[] | ReactElement;
|
|
570
|
+
/**
|
|
571
|
+
* Icon size.
|
|
572
|
+
* @default 'medium'
|
|
573
|
+
*/
|
|
574
|
+
size?: IconSize | IconDimensions;
|
|
575
|
+
/** Additional properties to forward to the SVG tag. */
|
|
576
|
+
svgProps?: ComponentProps<'svg'>;
|
|
577
|
+
/** Theme. */
|
|
578
|
+
theme?: Theme;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Component variant.
|
|
583
|
+
*/
|
|
584
|
+
declare const ShieldVariant: {
|
|
585
|
+
readonly success: "success";
|
|
586
|
+
readonly successLocked: "successLocked";
|
|
587
|
+
readonly successUnlocked: "successUnlocked";
|
|
588
|
+
readonly fail: "fail";
|
|
589
|
+
readonly failLocked: "failLocked";
|
|
590
|
+
readonly failUnlocked: "failUnlocked";
|
|
591
|
+
readonly warning: "warning";
|
|
592
|
+
readonly warningLocked: "warningLocked";
|
|
593
|
+
readonly warningUnlocked: "warningUnlocked";
|
|
594
|
+
readonly ignored: "ignored";
|
|
595
|
+
readonly noData: "noData";
|
|
596
|
+
readonly question: "question";
|
|
597
|
+
readonly email: "email";
|
|
598
|
+
};
|
|
599
|
+
type ShieldVariant = ValueOf<typeof ShieldVariant>;
|
|
600
|
+
|
|
601
|
+
interface DataGridProps extends Partial<Pick<DataGridProProps, 'rows'>>, Omit<DataGridProProps, 'rows'> {
|
|
602
|
+
/** License key for MUI Datagrid Pro. */
|
|
603
|
+
license?: string;
|
|
604
|
+
/**
|
|
605
|
+
* Height. A default one is set to prevent rendering all rows.
|
|
606
|
+
* @default '500px'
|
|
607
|
+
*/
|
|
608
|
+
height?: string;
|
|
609
|
+
/** Toolbar. A default one is provided but every button from this default Toolbar can be customized and the entire Toolbar can be replaced. */
|
|
610
|
+
toolbar?: ReactNode;
|
|
611
|
+
/** Whether the Toolbar is displayed or not. */
|
|
612
|
+
hideToolbar?: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* Indicates how to display pagination.
|
|
615
|
+
* @default 'both'
|
|
616
|
+
*/
|
|
617
|
+
paginationPlacement?: 'top' | 'bottom' | 'both' | 'none';
|
|
618
|
+
/** Props to forward to the pagination component. */
|
|
619
|
+
paginationProps?: Omit<TablePaginationProps, 'component' | 'count' | 'page' | 'onPageChange' | 'rowsPerPage' | 'onRowsPerPageChange' | 'rowsPerPageOptions' | 'paginationMode'>;
|
|
620
|
+
/** Theme. */
|
|
621
|
+
theme?: Theme;
|
|
622
|
+
}
|
|
623
|
+
type SelectionStatus = {
|
|
624
|
+
type: 'page' | 'table' | 'other' | 'none';
|
|
625
|
+
numberOfSelectedRows: number;
|
|
626
|
+
numberOfSelectedRowsInPage?: number;
|
|
627
|
+
page?: number;
|
|
628
|
+
pageSize?: number;
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
type StyledDataGridProps = {
|
|
632
|
+
$height?: string;
|
|
633
|
+
$theme?: DataGridProps['theme'];
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* DataGrid displays tabular data with sorting, filtering, pagination, and row selection.
|
|
638
|
+
* Built on MUI X DataGrid Pro with Red Sift styling and theming.
|
|
639
|
+
*
|
|
640
|
+
* Requires MUI X Pro license key (set via `MUI_LICENSE_KEY` env variable).
|
|
641
|
+
*
|
|
642
|
+
* Use `createColumn()` to get pre-configured column definitions with typed filter operators.
|
|
643
|
+
* Supported types: `string`, `number`, `date`, `dateTime`, `singleSelect`, `multiSelect`, `tags`.
|
|
644
|
+
* For `boolean` columns, use `type: 'boolean'` directly (no createColumn wrapper needed).
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* // Basic data grid with typed columns
|
|
648
|
+
* <DataGrid
|
|
649
|
+
* columns={[
|
|
650
|
+
* { ...createColumn('number'), field: 'id', headerName: 'ID', width: 90 },
|
|
651
|
+
* { ...createColumn('string'), field: 'name', headerName: 'Name', width: 150 },
|
|
652
|
+
* { ...createColumn('string'), field: 'email', headerName: 'Email', flex: 1 },
|
|
653
|
+
* ]}
|
|
654
|
+
* rows={users}
|
|
655
|
+
* />
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
* // Custom cell renderer with Shield component
|
|
659
|
+
* const columns = [
|
|
660
|
+
* { field: 'domain', headerName: 'Domain' },
|
|
661
|
+
* {
|
|
662
|
+
* field: 'status',
|
|
663
|
+
* headerName: 'Status',
|
|
664
|
+
* renderCell: ({ value }) => (
|
|
665
|
+
* <Shield variant={value === 'active' ? 'success' : 'fail'}>
|
|
666
|
+
* {value}
|
|
667
|
+
* </Shield>
|
|
668
|
+
* ),
|
|
669
|
+
* },
|
|
670
|
+
* ];
|
|
671
|
+
* <DataGrid columns={columns} rows={data} />
|
|
672
|
+
*
|
|
673
|
+
* @example
|
|
674
|
+
* // With pagination and sorting
|
|
675
|
+
* <DataGrid
|
|
676
|
+
* columns={columns}
|
|
677
|
+
* rows={data}
|
|
678
|
+
* pagination
|
|
679
|
+
* paginationModel={{ page: 0, pageSize: 25 }}
|
|
680
|
+
* pageSizeOptions={[10, 25, 50]}
|
|
681
|
+
* sortModel={[{ field: 'createdAt', sort: 'desc' }]}
|
|
682
|
+
* />
|
|
683
|
+
*
|
|
684
|
+
* @example
|
|
685
|
+
* // With row selection and checkbox
|
|
686
|
+
* <DataGrid
|
|
687
|
+
* columns={columns}
|
|
688
|
+
* rows={data}
|
|
689
|
+
* checkboxSelection
|
|
690
|
+
* rowSelectionModel={selectedIds}
|
|
691
|
+
* onRowSelectionModelChange={setSelectedIds}
|
|
692
|
+
* />
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* // Server-side pagination
|
|
696
|
+
* <DataGrid
|
|
697
|
+
* columns={columns}
|
|
698
|
+
* rows={pageData}
|
|
699
|
+
* pagination
|
|
700
|
+
* paginationMode="server"
|
|
701
|
+
* rowCount={totalRows}
|
|
702
|
+
* paginationModel={{ page, pageSize }}
|
|
703
|
+
* pageSizeOptions={[10, 25, 50]}
|
|
704
|
+
* onPaginationModelChange={setPaginationModel}
|
|
705
|
+
* />
|
|
706
|
+
*/
|
|
707
|
+
declare const DataGrid: Comp<DataGridProps, HTMLDivElement>;
|
|
708
|
+
|
|
709
|
+
interface StatefulDataGridProps extends DataGridProps {
|
|
710
|
+
/** Hook returning pathname, search params and a method to update query params. */
|
|
711
|
+
useRouter: () => {
|
|
712
|
+
pathname: string;
|
|
713
|
+
search: string;
|
|
714
|
+
historyReplace: (newSearch: string) => void;
|
|
715
|
+
};
|
|
716
|
+
/** Local Storage version, to upgrade when we want to force a clean out. */
|
|
717
|
+
localStorageVersion?: number;
|
|
718
|
+
/** Previous Local Storage versions to clean out when a new one is released. */
|
|
719
|
+
previousLocalStorageVersions?: number[];
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* StatefulDataGrid extends DataGrid with automatic state persistence to localStorage.
|
|
724
|
+
* Preserves filters, sorting, pagination, column visibility, and column widths
|
|
725
|
+
* across page refreshes.
|
|
726
|
+
*
|
|
727
|
+
* Use when users need persistent table preferences. Requires unique `localStorageKey`.
|
|
728
|
+
*
|
|
729
|
+
* @example
|
|
730
|
+
* // Basic stateful grid (persists to localStorage)
|
|
731
|
+
* <StatefulDataGrid
|
|
732
|
+
* localStorageKey="users-table"
|
|
733
|
+
* columns={columns}
|
|
734
|
+
* rows={users}
|
|
735
|
+
* pagination
|
|
736
|
+
* />
|
|
737
|
+
*
|
|
738
|
+
* @example
|
|
739
|
+
* // With version migration (clears old preferences)
|
|
740
|
+
* <StatefulDataGrid
|
|
741
|
+
* localStorageKey="reports-table"
|
|
742
|
+
* localStorageVersion="v2"
|
|
743
|
+
* previousLocalStorageVersions={['v1']}
|
|
744
|
+
* columns={columns}
|
|
745
|
+
* rows={reports}
|
|
746
|
+
* />
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* // With URL state sync (shareable filtered views)
|
|
750
|
+
* <StatefulDataGrid
|
|
751
|
+
* localStorageKey="domains-table"
|
|
752
|
+
* useRouter={true}
|
|
753
|
+
* columns={columns}
|
|
754
|
+
* rows={domains}
|
|
755
|
+
* pagination
|
|
756
|
+
* />
|
|
757
|
+
*
|
|
758
|
+
* @example
|
|
759
|
+
* // All features combined
|
|
760
|
+
* <StatefulDataGrid
|
|
761
|
+
* localStorageKey="audit-log"
|
|
762
|
+
* localStorageVersion="v3"
|
|
763
|
+
* previousLocalStorageVersions={['v1', 'v2']}
|
|
764
|
+
* useRouter={true}
|
|
765
|
+
* columns={columns}
|
|
766
|
+
* rows={logs}
|
|
767
|
+
* pagination
|
|
768
|
+
* pageSize={50}
|
|
769
|
+
* checkboxSelection
|
|
770
|
+
* />
|
|
771
|
+
*/
|
|
772
|
+
declare const StatefulDataGrid: Comp<StatefulDataGridProps, HTMLDivElement>;
|
|
773
|
+
|
|
774
|
+
interface ExtendedGridFilterModel extends GridFilterModel {
|
|
775
|
+
quickFilterValues?: string[];
|
|
776
|
+
}
|
|
777
|
+
interface ExtendedGridPaginationModel extends GridPaginationModel {
|
|
778
|
+
direction?: 'next' | 'back';
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
type OperatorValue = string | string[] | undefined;
|
|
782
|
+
/**
|
|
783
|
+
* Converts internal bracket notation to display-friendly dot notation.
|
|
784
|
+
*
|
|
785
|
+
* Display format (CloudFront-safe, no brackets):
|
|
786
|
+
* - `field[operator]=value` → `field.operator=value` (value URL-encoded if needed)
|
|
787
|
+
* - `field[isAnyOf]=list[a,b,c]` → `field.isAnyOf=a,b,c` (comma-separated, values URL-encoded)
|
|
788
|
+
* - `_sortColumn=[field,desc]` → `_sortColumn=field.desc`
|
|
789
|
+
* - `_pagination=[0,25,next]` → `_pagination=0.25.next`
|
|
790
|
+
* - `_pinnedColumnsLeft=[a,b,c]` → `_pinnedColumnsLeft=a,b,c` (comma-separated)
|
|
791
|
+
* - `_columnVisibility=[a,b,c]` → `_columnVisibility=a,b,c` (comma-separated)
|
|
792
|
+
*/
|
|
793
|
+
declare const convertToDisplayFormat: (search: string) => string;
|
|
794
|
+
/**
|
|
795
|
+
* Converts display-friendly dot notation back to internal bracket notation.
|
|
796
|
+
*
|
|
797
|
+
* Internal format (server-side compatible):
|
|
798
|
+
* - `field.operator=value` → `_field[operator,type]=value`
|
|
799
|
+
* - `field.isAnyOf=a,b,c` → `_field[isAnyOf,type]=list[a,b,c]`
|
|
800
|
+
* - `_sortColumn=field.desc` → `_sortColumn=[field,desc]`
|
|
801
|
+
* - `_pagination=0.25.next` → `_pagination=[0,25,next]`
|
|
802
|
+
* - `_pinnedColumnsLeft=a,b,c` → `_pinnedColumnsLeft=[a,b,c]`
|
|
803
|
+
* - `_columnVisibility=a,b,c` → `_columnVisibility=[a,b,c]`
|
|
804
|
+
*/
|
|
805
|
+
declare const convertFromDisplayFormat: (search: string, columns: DataGridProps["columns"]) => string;
|
|
806
|
+
/**
|
|
807
|
+
* Detects if search string is in display format and converts it to internal format.
|
|
808
|
+
*/
|
|
809
|
+
declare const getDecodedSearchFromUrl: (search: string, columns: DataGridProps["columns"]) => string;
|
|
810
|
+
/**
|
|
811
|
+
* Builds a display-format query string from internal format.
|
|
812
|
+
*/
|
|
813
|
+
declare const buildQueryParamsString: (search: string) => string;
|
|
814
|
+
/**
|
|
815
|
+
* Compares two search strings for equality, ignoring parameter order.
|
|
816
|
+
* This prevents infinite update loops when the same parameters appear in different order.
|
|
817
|
+
*/
|
|
818
|
+
declare const areSearchStringsEqual: (search1: string, search2: string) => boolean;
|
|
819
|
+
declare const decodeValue: (value: string) => OperatorValue;
|
|
820
|
+
declare const encodeValue: (value: string | string[] | undefined) => string;
|
|
821
|
+
declare const urlSearchParamsToString: (searchParams: URLSearchParams) => string;
|
|
822
|
+
declare const numberOperatorEncoder: Record<string, string>;
|
|
823
|
+
declare const numberOperatorDecoder: Record<string, string>;
|
|
824
|
+
declare const isOperatorValueValid: (field: string, operator: OperatorValue, columns: DataGridProps["columns"]) => boolean;
|
|
825
|
+
declare const isValueValid: (value: OperatorValue, field: string, columns: DataGridProps["columns"], operator: OperatorValue) => boolean;
|
|
826
|
+
/** FILTERS */
|
|
827
|
+
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps["columns"]) => ExtendedGridFilterModel | "invalid";
|
|
828
|
+
declare const getSearchParamsFromFilterModel: (filterModel: ExtendedGridFilterModel) => URLSearchParams;
|
|
829
|
+
/** SORT */
|
|
830
|
+
declare const getSortingFromString: (searchString: string, columns: DataGridProps["columns"]) => GridSortModel | "invalid";
|
|
831
|
+
declare const getSearchParamsFromSorting: (sorting: GridSortModel) => URLSearchParams;
|
|
832
|
+
/** PAGINATION */
|
|
833
|
+
declare const getPaginationFromString: (searchString: string) => ExtendedGridPaginationModel | "invalid";
|
|
834
|
+
declare const getSearchParamsFromPagination: (pagination: ExtendedGridPaginationModel) => URLSearchParams;
|
|
835
|
+
/** COLUMN VISIBILITY */
|
|
836
|
+
declare const getColumnVisibilityFromString: (searchString: string, columns: DataGridProps["columns"]) => GridColumnVisibilityModel | "invalid";
|
|
837
|
+
declare const getSearchParamsFromColumnVisibility: (columnVisibility: GridColumnVisibilityModel, columns: DataGridProps["columns"]) => URLSearchParams;
|
|
838
|
+
declare const getPinnedColumnsFromString: (notParsed: string, tableColumns: DataGridProps["columns"]) => PinnedColumns | "invalid";
|
|
839
|
+
declare const getSearchParamsFromPinnedColumns: (pinnedColumns: GridPinnedColumnFields) => URLSearchParams;
|
|
840
|
+
declare const getSearchParamsFromTab: (search: string) => URLSearchParams;
|
|
841
|
+
/** DENSITY */
|
|
842
|
+
type GridDensityValue = 'compact' | 'standard' | 'comfortable';
|
|
843
|
+
declare const getDensityFromString: (searchString: string) => GridDensityValue | "invalid";
|
|
844
|
+
declare const getSearchParamsFromDensity: (density: GridDensityValue) => URLSearchParams;
|
|
845
|
+
declare const getDensityModel: (search: string, localStorageDensity: string, setLocalStorageDensity: (density: string) => void, initialState: GridInitialState | undefined, isNewVersion: boolean) => GridDensityValue;
|
|
846
|
+
/** COLUMN ORDER */
|
|
847
|
+
type ColumnOrderModel = string[];
|
|
848
|
+
declare const getColumnOrderFromString: (searchString: string) => ColumnOrderModel | "invalid";
|
|
849
|
+
declare const getSearchParamsFromColumnOrder: (columnOrder: ColumnOrderModel) => URLSearchParams;
|
|
850
|
+
type FinalSearchInput = {
|
|
851
|
+
localStorageVersion: number;
|
|
852
|
+
filterModel: GridFilterModel;
|
|
853
|
+
sortModel: GridSortModel;
|
|
854
|
+
paginationModel: ExtendedGridPaginationModel;
|
|
855
|
+
columnsVisibilityModel: GridColumnVisibilityModel;
|
|
856
|
+
pinnedColumnsModel: GridPinnedColumnFields;
|
|
857
|
+
density: GridDensityValue;
|
|
858
|
+
columnOrderModel: ColumnOrderModel;
|
|
859
|
+
defaultColumnOrder: ColumnOrderModel;
|
|
860
|
+
search: string;
|
|
861
|
+
columns: DataGridProps['columns'];
|
|
862
|
+
};
|
|
863
|
+
declare const getFinalSearch: ({ search, localStorageVersion, filterModel, sortModel, paginationModel, columnsVisibilityModel, pinnedColumnsModel, density, columnOrderModel, defaultColumnOrder, columns, }: FinalSearchInput) => URLSearchParams;
|
|
864
|
+
type PinnedColumns = {
|
|
865
|
+
left: string[];
|
|
866
|
+
right: string[];
|
|
867
|
+
};
|
|
868
|
+
type ModelsLocalStorage = {
|
|
869
|
+
localStorageFilters: string;
|
|
870
|
+
setLocalStorageFilters: (search: string) => void;
|
|
871
|
+
localStorageSorting: string;
|
|
872
|
+
setLocalStorageSorting: (search: string) => void;
|
|
873
|
+
localStoragePagination: string;
|
|
874
|
+
setLocalStoragePagination: (search: string) => void;
|
|
875
|
+
localStorageColumnsVisibility: string;
|
|
876
|
+
setLocalStorageColumnsVisibility: (search: string) => void;
|
|
877
|
+
localStoragePinnedColumns: string;
|
|
878
|
+
setLocalStoragePinnedColumns: (search: string) => void;
|
|
879
|
+
localStorageDensity: string;
|
|
880
|
+
setLocalStorageDensity: (density: string) => void;
|
|
881
|
+
localStorageColumnOrder: string;
|
|
882
|
+
setLocalStorageColumnOrder: (value: string) => void;
|
|
883
|
+
};
|
|
884
|
+
type ModelsTable = {
|
|
885
|
+
filterModel: GridFilterModel;
|
|
886
|
+
sortModel: GridSortModel;
|
|
887
|
+
paginationModel: ExtendedGridPaginationModel;
|
|
888
|
+
columnVisibilityModel: GridColumnVisibilityModel;
|
|
889
|
+
pinnedColumnsModel: PinnedColumns;
|
|
890
|
+
density: GridDensityValue;
|
|
891
|
+
columnOrderModel: ColumnOrderModel;
|
|
892
|
+
/** The display-format search string the URL should have. Null if no update needed. */
|
|
893
|
+
pendingSearch: string | null;
|
|
894
|
+
};
|
|
895
|
+
/** Return the state of the table given the URL and the local storage state */
|
|
896
|
+
declare const getModelsParsedOrUpdateLocalStorage: (search: string, localStorageVersion: number, columns: DataGridProps["columns"], initialState: GridInitialState | undefined, localStorage: ModelsLocalStorage) => ModelsTable;
|
|
897
|
+
type DataGridModel = {
|
|
898
|
+
filterModel: GridFilterModel;
|
|
899
|
+
sortModel: GridSortModel;
|
|
900
|
+
paginationModel: ExtendedGridPaginationModel;
|
|
901
|
+
columnsModel: GridColumnVisibilityModel;
|
|
902
|
+
pinnedColumnsModel: GridPinnedColumnFields;
|
|
903
|
+
density: GridDensityValue;
|
|
904
|
+
columnOrderModel: ColumnOrderModel;
|
|
905
|
+
defaultColumnOrder: ColumnOrderModel;
|
|
906
|
+
};
|
|
907
|
+
declare const updateUrl: ({ filterModel, sortModel, paginationModel, columnsModel: columnsVisibilityModel, pinnedColumnsModel, density, columnOrderModel, defaultColumnOrder, }: DataGridModel, search: string, localStorageVersion: number, historyReplace: (newSearch: string) => void, columns: DataGridProps["columns"]) => void;
|
|
908
|
+
declare const areFilterModelsEquivalent: (filterModel: GridFilterModel, filterModelToMatch: GridFilterModel) => boolean;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* A React Router v5 / connected-react-router adapter for `StatefulDataGrid.useRouter`.
|
|
912
|
+
*
|
|
913
|
+
* Defers `history.replace` via `queueMicrotask` to avoid the
|
|
914
|
+
* "Cannot update during an existing state transition" warning
|
|
915
|
+
* that connected-react-router triggers when the grid synchronises
|
|
916
|
+
* URL state during render.
|
|
917
|
+
*
|
|
918
|
+
* Also coalesces multiple `historyReplace` calls within the same microtask
|
|
919
|
+
* by computing per-call deltas against the captured `search` snapshot and
|
|
920
|
+
* merging them into the live URL. This prevents handler stomping when the
|
|
921
|
+
* grid fires several model-change handlers in the same render (e.g. a
|
|
922
|
+
* pivot change re-emits a synthetic column-visibility change alongside a
|
|
923
|
+
* filter change): without coalescing, each handler would compute a full
|
|
924
|
+
* new search from the same captured snapshot, and the second
|
|
925
|
+
* `history.replace` would clobber the first — dropping any keys (such as
|
|
926
|
+
* the filter just typed) that the second handler didn't know about.
|
|
927
|
+
*
|
|
928
|
+
* @example
|
|
929
|
+
* ```tsx
|
|
930
|
+
* import { createReactRouterV5Adapter } from '@redsift/table-pro';
|
|
931
|
+
*
|
|
932
|
+
* const useRouter = createReactRouterV5Adapter(history);
|
|
933
|
+
*
|
|
934
|
+
* <StatefulDataGrid useRouter={useRouter} … />
|
|
935
|
+
* ```
|
|
936
|
+
*/
|
|
937
|
+
/** Minimal subset of React Router v5 `history` used by the adapter. */
|
|
938
|
+
interface ReactRouterV5History {
|
|
939
|
+
location: {
|
|
940
|
+
pathname: string;
|
|
941
|
+
search: string;
|
|
942
|
+
};
|
|
943
|
+
replace: (path: {
|
|
944
|
+
pathname: string;
|
|
945
|
+
search: string;
|
|
946
|
+
}) => void;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Create a `useRouter` hook compatible with `StatefulDataGrid` from a
|
|
950
|
+
* React Router v5 `history` object.
|
|
951
|
+
*/
|
|
952
|
+
declare const createReactRouterV5Adapter: (history: ReactRouterV5History) => (() => {
|
|
953
|
+
pathname: string;
|
|
954
|
+
search: string;
|
|
955
|
+
historyReplace: (newSearch: string) => void;
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
interface UseLinkedFilterModelOptions {
|
|
959
|
+
/** Starting filter model. Defaults to `{ items: [] }`. */
|
|
960
|
+
initialFilterModel?: GridFilterModel;
|
|
961
|
+
/**
|
|
962
|
+
* Debounce window (ms) applied to changes coming from the DataGrid filter panel.
|
|
963
|
+
* Card-driven changes via `setMultiSelect` / `setBoolean` are never debounced.
|
|
964
|
+
* Defaults to `300`. Pass `0` to disable.
|
|
965
|
+
*/
|
|
966
|
+
debounceMs?: number;
|
|
967
|
+
/** Optional callback fired on every settled filter model change. */
|
|
968
|
+
onChange?: (model: GridFilterModel) => void;
|
|
969
|
+
}
|
|
970
|
+
interface UseLinkedFilterModelReturn {
|
|
971
|
+
/** Current filter model. Pass to DataGrid `filterModel` and read for DataCard derivations. */
|
|
972
|
+
filterModel: GridFilterModel;
|
|
973
|
+
/** Bind to DataGrid `onFilterModelChange`. Debounced for panel changes. */
|
|
974
|
+
onFilterModelChange: (model: GridFilterModel) => void;
|
|
975
|
+
/** Read selected values for an `isAnyOf` / `hasAnyOf` field. Empty array when not set. */
|
|
976
|
+
getSelected: (field: string) => string[];
|
|
977
|
+
/** Read the raw filter value for a field (e.g. boolean toggles). */
|
|
978
|
+
getValue: (field: string) => unknown;
|
|
979
|
+
/** Set a multi-select filter from a DataCard. Empty array clears the field. */
|
|
980
|
+
setMultiSelect: (field: string, values: string[], operator?: string) => void;
|
|
981
|
+
/** Set a boolean filter. Pass `null` to clear. */
|
|
982
|
+
setBoolean: (field: string, value: boolean | null) => void;
|
|
983
|
+
/** Remove a single field from the filter model. */
|
|
984
|
+
clearField: (field: string) => void;
|
|
985
|
+
/** Reset the filter model to the initial value. */
|
|
986
|
+
reset: () => void;
|
|
987
|
+
/**
|
|
988
|
+
* Whether a field's filter was set externally (DataGrid filter panel) rather than
|
|
989
|
+
* via this hook's setters. Useful for disabling the corresponding DataCard so the
|
|
990
|
+
* panel and card don't fight over the same field.
|
|
991
|
+
*/
|
|
992
|
+
isFieldExternallyControlled: (field: string) => boolean;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Bridge a DataGrid `filterModel` and the DataCards that drive (and reflect) it.
|
|
996
|
+
*
|
|
997
|
+
* Without this hook, every drilldowned datagrid page hand-rolls the same plumbing:
|
|
998
|
+
* derive selections from `filterModel`, write them back via raw `setFilterModel`
|
|
999
|
+
* mutations, debounce panel changes, and track which fields the panel "owns" so
|
|
1000
|
+
* cards don't fight the panel for control. SOFA-6 shipped this logic ad hoc and
|
|
1001
|
+
* got it wrong (no debounce, prop-drilled state, no panel/card reconciliation).
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* const filter = useLinkedFilterModel();
|
|
1005
|
+
*
|
|
1006
|
+
* <DataCard.Listbox
|
|
1007
|
+
* values={filter.getSelected('Category')}
|
|
1008
|
+
* onChange={(values) => filter.setMultiSelect('Category', values)}
|
|
1009
|
+
* isDisabled={filter.isFieldExternallyControlled('Category')}
|
|
1010
|
+
* >
|
|
1011
|
+
* {…}
|
|
1012
|
+
* </DataCard.Listbox>
|
|
1013
|
+
*
|
|
1014
|
+
* <DataGrid filterModel={filter.filterModel} onFilterModelChange={filter.onFilterModelChange} />
|
|
1015
|
+
*/
|
|
1016
|
+
declare function useLinkedFilterModel(options?: UseLinkedFilterModelOptions): UseLinkedFilterModelReturn;
|
|
1017
|
+
|
|
1018
|
+
declare const BaseButton: React$1.JSXElementConstructor<any>;
|
|
1019
|
+
|
|
1020
|
+
declare const BaseCheckbox: React$1.JSXElementConstructor<any>;
|
|
1021
|
+
|
|
1022
|
+
declare const muiIconToDSIcon: Partial<Record<keyof GridSlotsComponent, string>>;
|
|
1023
|
+
declare const BaseIcon: React$1.JSXElementConstructor<any>;
|
|
1024
|
+
|
|
1025
|
+
declare const BaseIconButton: React$1.JSXElementConstructor<any>;
|
|
1026
|
+
|
|
1027
|
+
declare const BaseTextField: React$1.JSXElementConstructor<any>;
|
|
1028
|
+
|
|
1029
|
+
interface CompletionResponseItem {
|
|
1030
|
+
field: string;
|
|
1031
|
+
operator: string;
|
|
1032
|
+
value?: string;
|
|
1033
|
+
}
|
|
1034
|
+
type CompletionResponse = {
|
|
1035
|
+
logicOperator: 'and' | 'or';
|
|
1036
|
+
items: CompletionResponseItem[];
|
|
1037
|
+
};
|
|
1038
|
+
interface LocaleText {
|
|
1039
|
+
textLabel?: string;
|
|
1040
|
+
textPlaceholder?: string;
|
|
1041
|
+
buttonAriaLabel?: string;
|
|
1042
|
+
buttonText?: string;
|
|
1043
|
+
powerText?: string;
|
|
1044
|
+
powerTooltipContent?: string;
|
|
1045
|
+
errorText?: string;
|
|
1046
|
+
}
|
|
1047
|
+
interface FilterConfigColumn {
|
|
1048
|
+
field: string;
|
|
1049
|
+
type?: string;
|
|
1050
|
+
description?: string;
|
|
1051
|
+
}
|
|
1052
|
+
interface FilterConfig {
|
|
1053
|
+
columns: FilterConfigColumn[];
|
|
1054
|
+
typeOperators: Record<string, string[]>;
|
|
1055
|
+
notes: string;
|
|
1056
|
+
openaiApiKey?: string;
|
|
1057
|
+
completionFunc?: (nlpFilterConfig: FilterConfig, prompt: string, model: string) => Promise<CompletionResponse>;
|
|
1058
|
+
}
|
|
1059
|
+
interface GridToolbarFilterSemanticFieldProps extends ComponentProps<'form'> {
|
|
1060
|
+
nlpFilterConfig: FilterConfig;
|
|
1061
|
+
onFilterModelChange?: (filterModel: GridFilterModel) => void;
|
|
1062
|
+
dateFormat?: string;
|
|
1063
|
+
defaultModel?: string;
|
|
1064
|
+
defaultFilter?: CompletionResponse;
|
|
1065
|
+
disablePower?: boolean;
|
|
1066
|
+
localeText?: LocaleText;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
declare const DEFAULT_OPERATORS: {
|
|
1070
|
+
string: string[];
|
|
1071
|
+
number: string[];
|
|
1072
|
+
boolean: string[];
|
|
1073
|
+
date: string[];
|
|
1074
|
+
};
|
|
1075
|
+
/**
|
|
1076
|
+
* The GridToolbarFilterSemanticField component.
|
|
1077
|
+
*/
|
|
1078
|
+
declare const GridToolbarFilterSemanticField: Comp<GridToolbarFilterSemanticFieldProps, HTMLFormElement>;
|
|
1079
|
+
|
|
1080
|
+
type ControlledPaginationProps = {
|
|
1081
|
+
displaySelection?: boolean;
|
|
1082
|
+
displayRowsPerPage?: boolean;
|
|
1083
|
+
displayPagination?: boolean;
|
|
1084
|
+
selectionStatus: SelectionStatus;
|
|
1085
|
+
apiRef: MutableRefObject<GridApiPro | null>;
|
|
1086
|
+
paginationModel: GridPaginationModel;
|
|
1087
|
+
onPaginationModelChange: (model: GridPaginationModel, details: GridCallbackDetails<'pagination'>) => void;
|
|
1088
|
+
pageSizeOptions?: number[];
|
|
1089
|
+
isRowSelectable?: DataGridProps['isRowSelectable'];
|
|
1090
|
+
paginationProps?: DataGridProps['paginationProps'];
|
|
1091
|
+
};
|
|
1092
|
+
declare const ControlledPagination: React$1.FC<ControlledPaginationProps>;
|
|
1093
|
+
|
|
1094
|
+
type ServerSideControlledPaginationProps = {
|
|
1095
|
+
displaySelection?: boolean;
|
|
1096
|
+
displayRowsPerPage?: boolean;
|
|
1097
|
+
displayPagination?: boolean;
|
|
1098
|
+
selectionStatus: SelectionStatus;
|
|
1099
|
+
paginationModel: GridPaginationModel;
|
|
1100
|
+
onPaginationModelChange: (model: GridPaginationModel, details: GridCallbackDetails<'pagination'>) => void;
|
|
1101
|
+
pageSizeOptions?: number[];
|
|
1102
|
+
paginationProps?: DataGridProps['paginationProps'];
|
|
1103
|
+
rowCount: number;
|
|
1104
|
+
loading?: boolean;
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* Get the IDs of all selectable rows currently loaded in the grid (i.e. the current page for server-side).
|
|
1108
|
+
*/
|
|
1109
|
+
declare const getSelectableRowIdsInPage: (apiRef: React$1.MutableRefObject<GridApiPro>, isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined) => GridRowId[];
|
|
1110
|
+
/**
|
|
1111
|
+
* Intercept MUI's `onRowSelectionModelChange` for server-side pagination to fix the
|
|
1112
|
+
* header checkbox behavior when cross-page selections exist.
|
|
1113
|
+
*
|
|
1114
|
+
* Problem: With `checkboxSelectionVisibleOnly=false` and `keepNonExistentRowsSelected`,
|
|
1115
|
+
* the header checkbox shows "indeterminate" when rows from other pages are selected but
|
|
1116
|
+
* none on the current page. Clicking it makes MUI deselect everything (treating it as a
|
|
1117
|
+
* global toggle-off), but the user's intent is to select the current page.
|
|
1118
|
+
*
|
|
1119
|
+
* Fix: When MUI empties the selection model and the previous status was 'other' (cross-page
|
|
1120
|
+
* selections with 0 selected on current page), we merge all current page rows with the
|
|
1121
|
+
* existing cross-page selections instead.
|
|
1122
|
+
*/
|
|
1123
|
+
declare const fixServerSideHeaderCheckboxSelection: (newSelectionModel: GridRowSelectionModel, previousSelectionModel: GridRowSelectionModel, selectionStatus: React$1.MutableRefObject<SelectionStatus>, apiRef: React$1.MutableRefObject<GridApiPro>, isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined) => GridRowSelectionModel;
|
|
1124
|
+
declare const onServerSideSelectionStatusChange: (newSelectionModel: GridRowSelectionModel, apiRef: React$1.MutableRefObject<GridApiPro | null>, selectionStatus: React$1.MutableRefObject<SelectionStatus>, forceUpdate: React$1.Dispatch<React$1.SetStateAction<number>>, isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined, page: number, pageSize: number) => void;
|
|
1125
|
+
declare const ServerSideControlledPagination: React$1.FC<ServerSideControlledPaginationProps>;
|
|
1126
|
+
|
|
1127
|
+
interface TextCellProps extends ComponentProps<'div'> {
|
|
1128
|
+
/** Including Badge Component. */
|
|
1129
|
+
badge?: ReactNode;
|
|
1130
|
+
/**
|
|
1131
|
+
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
1132
|
+
* Can also be a ReactElement.
|
|
1133
|
+
*/
|
|
1134
|
+
leftIcon?: IconProps['icon'];
|
|
1135
|
+
/** Left Icon Color variant. */
|
|
1136
|
+
leftIconColor?: NotificationsColorPalette | ProductColorPalette | (string & {});
|
|
1137
|
+
/**
|
|
1138
|
+
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
1139
|
+
* Can also be a ReactElement.
|
|
1140
|
+
*/
|
|
1141
|
+
rightIcon?: IconProps['icon'];
|
|
1142
|
+
/** Right Icon Color variant. */
|
|
1143
|
+
rightIconColor?: NotificationsColorPalette | ProductColorPalette | (string & {});
|
|
1144
|
+
/** Shield variant. */
|
|
1145
|
+
shieldVariant?: ShieldVariant;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
/**
|
|
1149
|
+
* The Cell component.
|
|
1150
|
+
*/
|
|
1151
|
+
declare const TextCell: Comp<TextCellProps, HTMLDivElement>;
|
|
1152
|
+
|
|
1153
|
+
type GridToolbarColumnsButtonProps = React.ComponentProps<typeof GridToolbarColumnsButton>;
|
|
1154
|
+
type GridToolbarDensitySelectorProps = React.ComponentProps<typeof GridToolbarDensitySelector>;
|
|
1155
|
+
type GridToolbarFilterSemanticProps = Omit<GridToolbarFilterSemanticFieldProps, 'ref'>;
|
|
1156
|
+
interface ToolbarProps {
|
|
1157
|
+
/** Props to forward to the column button. */
|
|
1158
|
+
columnsButtonProps?: GridToolbarColumnsButtonProps;
|
|
1159
|
+
/** Column button ref. */
|
|
1160
|
+
columnsButtonRef?: RefObject<HTMLButtonElement>;
|
|
1161
|
+
/** Props to forward to the density button. */
|
|
1162
|
+
densityButtonProps?: GridToolbarDensitySelectorProps;
|
|
1163
|
+
/** Density button ref. */
|
|
1164
|
+
densityButtonRef?: RefObject<HTMLButtonElement>;
|
|
1165
|
+
/** Props to forward to the export button. */
|
|
1166
|
+
exportButtonProps?: GridToolbarExportProps;
|
|
1167
|
+
/** Export button ref. */
|
|
1168
|
+
exportButtonRef?: RefObject<HTMLButtonElement>;
|
|
1169
|
+
/** Props to forward to the filter button. */
|
|
1170
|
+
filterButtonProps?: GridToolbarFilterButtonProps;
|
|
1171
|
+
/** Filter button ref. */
|
|
1172
|
+
filterButtonRef?: RefObject<HTMLButtonElement>;
|
|
1173
|
+
/** Whether the columns button is displayed or not. */
|
|
1174
|
+
hasColumnsButton?: boolean;
|
|
1175
|
+
/** Whether the density button is displayed or not. */
|
|
1176
|
+
hasDensityButton?: boolean;
|
|
1177
|
+
/** Whether the export button is displayed or not. */
|
|
1178
|
+
hasExportButton?: boolean;
|
|
1179
|
+
/** Whether the filter button is displayed or not. */
|
|
1180
|
+
hasFilterButton?: boolean;
|
|
1181
|
+
/** Configuration object for NLP filter. undefined if disabled. */
|
|
1182
|
+
onFilterModelChange?: (filterModel: GridFilterModel) => void;
|
|
1183
|
+
semanticFilterProps?: GridToolbarFilterSemanticProps;
|
|
1184
|
+
/** Whether you want to show the quick filter or not. */
|
|
1185
|
+
showQuickFilter?: boolean;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
/**
|
|
1189
|
+
* Temporary workaround for a type mismatch between react 17 and 18
|
|
1190
|
+
* https://github.com/mui/material-ui/issues/35287#issuecomment-1337250566
|
|
1191
|
+
*/
|
|
1192
|
+
declare global {
|
|
1193
|
+
namespace React {
|
|
1194
|
+
interface DOMAttributes<T> {
|
|
1195
|
+
onResize?: React.ReactEventHandler<T> | undefined;
|
|
1196
|
+
onResizeCapture?: React.ReactEventHandler<T> | undefined;
|
|
1197
|
+
nonce?: string | undefined;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
/** ------ */
|
|
1202
|
+
declare const Toolbar: React$1.FC<ToolbarProps>;
|
|
1203
|
+
|
|
1204
|
+
type ToolbarWrapperProps = {
|
|
1205
|
+
hideToolbar: DataGridProps['hideToolbar'];
|
|
1206
|
+
RenderedToolbar: React$1.JSXElementConstructor<any>;
|
|
1207
|
+
filterModel: DataGridProps['filterModel'];
|
|
1208
|
+
onFilterModelChange: DataGridProps['onFilterModelChange'];
|
|
1209
|
+
pagination: DataGridProps['pagination'];
|
|
1210
|
+
paginationPlacement: DataGridProps['paginationPlacement'];
|
|
1211
|
+
selectionStatus: SelectionStatus;
|
|
1212
|
+
apiRef: DataGridProps['apiRef'];
|
|
1213
|
+
isRowSelectable: DataGridProps['isRowSelectable'];
|
|
1214
|
+
paginationModel: DataGridProps['paginationModel'];
|
|
1215
|
+
onPaginationModelChange: DataGridProps['onPaginationModelChange'];
|
|
1216
|
+
pageSizeOptions: DataGridProps['pageSizeOptions'];
|
|
1217
|
+
paginationProps: DataGridProps['paginationProps'];
|
|
1218
|
+
paginationMode?: DataGridProps['paginationMode'];
|
|
1219
|
+
rowCount?: DataGridProps['rowCount'];
|
|
1220
|
+
};
|
|
1221
|
+
declare const ToolbarWrapper: React$1.FC<ToolbarWrapperProps>;
|
|
1222
|
+
|
|
1223
|
+
export { ARRAY_IS_EMPTY, ARRAY_IS_NOT_EMPTY, BaseButton, BaseCheckbox, BaseIcon, BaseIconButton, BaseTextField, CATEGORIES, COLUMN_ORDER_MODEL_KEY, CONTAINS_ANY_OF, Category, ColumnOptions, ColumnOrderModel, ColumnType, CompletionResponse, ControlledPagination, ControlledPaginationProps, DATE_IS_BETWEEN, DEFAULT_OPERATORS, DENSITY_MODEL_KEY, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_CONTAIN_ANY_OF, DOES_NOT_END_WITH, DOES_NOT_END_WITH_ANY_OF, DOES_NOT_EQUAL, DOES_NOT_HAVE, DOES_NOT_HAVE_ANY_OF, DOES_NOT_HAVE_ANY_OF_WITH_SELECT, DOES_NOT_HAVE_WITH_SELECT, DOES_NOT_START_WITH, DOES_NOT_START_WITH_ANY_OF, DataGrid, DataGridModel, DataGridProps, DateOperatorName, EMPTY_ROW_SELECTION_MODEL, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, FilterConfig, FilterConfigColumn, GridDensityValue, GridToolbarFilterSemanticField, GridToolbarFilterSemanticFieldProps, HAS, HAS_ALL_OF, HAS_ALL_OF_WITH_SELECT, HAS_ANY_OF, HAS_ANY_OF_WITH_SELECT, HAS_ONLY, HAS_ONLY_WITH_SELECT, HAS_WITH_SELECT, IS, IS_ANY_OF, IS_ANY_OF_I, IS_ANY_OF_I_WITH_SELECT, IS_ANY_OF_WITH_SELECT, IS_BETWEEN, IS_NOT, IS_NOT_ANY_OF, IS_NOT_ANY_OF_WITH_SELECT, IS_NOT_WITH_SELECT, IS_WITH_SELECT, LegacyRowSelectionModel, MultiSelectOperatorName, NumberOperatorName, PAGINATION_MODEL_KEY, PINNED_COLUMNS, PinnedColumns, ReactRouterV5History, RowSelectionModelInput, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, SelectionStatus, ServerSideControlledPagination, ServerSideControlledPaginationProps, SingleSelectOperatorName, StatefulDataGrid, StatefulDataGridProps, StringOperatorName, StyledDataGridProps, TagsOperatorName, TextCell, Toolbar, ToolbarWrapper, ToolbarWrapperProps, UseLinkedFilterModelOptions, UseLinkedFilterModelReturn, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, areSearchStringsEqual, buildQueryParamsString, buildStorageKey, clearAllVersionStorage, clearPreviousVersionStorage, convertFromDisplayFormat, convertToDisplayFormat, createColumn, createReactRouterV5Adapter, createRowSelectionModel, customColumnTypes, decodeValue, encodeValue, fixServerSideHeaderCheckboxSelection, getColumnOrderFromString, getColumnVisibilityFromString, getCompletion, getDecodedSearchFromUrl, getDensityFromString, getDensityModel, getFilterModelFromString, getFinalSearch, getGridDateOperatorsExtended, getGridNumericOperators, getGridStringArrayOperators, getGridStringArrayOperatorsWithSelect, getGridStringArrayOperatorsWithSelectOnStringArrayColumns, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsMultipleSelectColumnType, getRsMultipleSelectWithShortOperatorListColumnType, getRsNumberColumnType, getRsSingleSelectColumnType, getRsSingleSelectWithShortOperatorListColumnType, getRsStringColumnType, getSearchParamsFromColumnOrder, getSearchParamsFromColumnVisibility, getSearchParamsFromDensity, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSelectableRowIdsInPage, getSelectedIds, getSelectionCount, getSortingFromString, isOperatorValueValid, isRowSelected, isValueValid, makeCaseInsensitive, muiIconToDSIcon, normalizeRowSelectionModel, numberOperatorDecoder, numberOperatorEncoder, onServerSideSelectionStatusChange, operatorList, resetStatefulDataGridState, updateUrl, urlSearchParamsToString, useLinkedFilterModel, wrapCaseInsensitive };
|