@redsift/table 11.2.2 → 11.3.0-muiv5
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/index.d.ts +39 -30
- package/index.js +506 -383
- package/index.js.map +1 -1
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _mui_x_data_grid_pro from '@mui/x-data-grid-pro';
|
|
2
|
-
import { GridColumnTypesRecord, GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputValue, GridFilterInputMultipleValue, DataGridProProps,
|
|
3
|
-
export { GridAlignment, GridColDef, GridFilterItem, GridFilterModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
2
|
+
import { GridNativeColTypes, GridColumnTypesRecord, GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputValue, GridFilterInputMultipleValue, DataGridProProps, GridFilterModel, GridSortModel, GridSortItem, GridColumnVisibilityModel, GridPinnedColumns, GridSlotsComponent, GridSelectionModel, GridRowParams, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
3
|
+
export { GridAlignment, GridColDef, GridColumns, GridFilterItem, GridFilterModel, GridSelectionModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
4
|
import { GridInitialStatePro } from '@mui/x-data-grid-pro/models/gridStatePro';
|
|
5
5
|
import React, { ReactNode, ComponentProps, MutableRefObject, RefObject } from 'react';
|
|
6
6
|
import { TablePaginationProps } from '@mui/material';
|
|
@@ -10,19 +10,19 @@ import { GridApiPro } from '@mui/x-data-grid-pro/models/gridApiPro';
|
|
|
10
10
|
declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any, any, any>;
|
|
11
11
|
|
|
12
12
|
declare const getRsStringColumnType: () => {
|
|
13
|
-
|
|
13
|
+
extendType: GridNativeColTypes;
|
|
14
14
|
filterOperators: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
15
15
|
};
|
|
16
16
|
declare const getRsNumberColumnType: () => {
|
|
17
|
-
|
|
17
|
+
extendType: GridNativeColTypes;
|
|
18
18
|
filterOperators: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
19
19
|
};
|
|
20
|
-
declare const customColumnTypes:
|
|
20
|
+
declare const customColumnTypes: GridColumnTypesRecord;
|
|
21
21
|
|
|
22
22
|
declare const IS_BETWEEN: {
|
|
23
23
|
label: string;
|
|
24
24
|
value: string;
|
|
25
|
-
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams
|
|
25
|
+
getApplyFilterFn: (filterItem: GridFilterItem) => ((params: GridCellParams) => boolean) | null;
|
|
26
26
|
InputComponent: (props: any) => JSX.Element;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -91,8 +91,8 @@ declare const operatorList: {
|
|
|
91
91
|
string: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
92
92
|
number: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
93
93
|
boolean: _mui_x_data_grid_pro.GridFilterOperator<any, boolean | null, any>[];
|
|
94
|
-
date: _mui_x_data_grid_pro.GridFilterOperator<any, Date, any>[];
|
|
95
|
-
dateTime: _mui_x_data_grid_pro.GridFilterOperator<any, Date, any>[];
|
|
94
|
+
date: _mui_x_data_grid_pro.GridFilterOperator<any, string | Date, any>[];
|
|
95
|
+
dateTime: _mui_x_data_grid_pro.GridFilterOperator<any, string | Date, any>[];
|
|
96
96
|
singleSelect: _mui_x_data_grid_pro.GridFilterOperator<any, any, any>[];
|
|
97
97
|
rsString: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
98
98
|
rsNumber: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
@@ -115,7 +115,7 @@ declare const buildStorageKey: ({ id, version, category }: {
|
|
|
115
115
|
version: number;
|
|
116
116
|
category: Category;
|
|
117
117
|
}) => `${string}:${number}:paginationModel` | `${string}:${number}:filterModel` | `${string}:${number}:sortModel` | `${string}:${number}:visibilityModel` | `${string}:${number}:pinnedColumns` | `${string}:${number}:dimension` | `${string}:${number}:searchModel`;
|
|
118
|
-
declare const clearPreviousVersionStorage: (id: string,
|
|
118
|
+
declare const clearPreviousVersionStorage: (id: string, previousLocalStorageVersions: number[]) => void;
|
|
119
119
|
|
|
120
120
|
interface DataGridProps extends Partial<Pick<DataGridProProps, 'rows'>>, Omit<DataGridProProps, 'rows'> {
|
|
121
121
|
/** License key for MUI Datagrid Pro. */
|
|
@@ -157,11 +157,15 @@ interface StatefulDataGridProps extends DataGridProps {
|
|
|
157
157
|
};
|
|
158
158
|
/** Local Storage version, to upgrade when we want to force a clean out. */
|
|
159
159
|
localStorageVersion?: number;
|
|
160
|
+
/** Previous Local Storage versions to clean out when a new one is released. */
|
|
161
|
+
previousLocalStorageVersions?: number[];
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
declare const StatefulDataGrid: Comp<StatefulDataGridProps, HTMLDivElement>;
|
|
163
165
|
|
|
164
|
-
interface ExtendedGridPaginationModel
|
|
166
|
+
interface ExtendedGridPaginationModel {
|
|
167
|
+
page: number;
|
|
168
|
+
pageSize: number;
|
|
165
169
|
direction?: 'next' | 'back';
|
|
166
170
|
}
|
|
167
171
|
|
|
@@ -171,8 +175,6 @@ declare const encodeValue: (value: string | undefined) => string;
|
|
|
171
175
|
declare const urlSearchParamsToString: (searchParams: URLSearchParams) => string;
|
|
172
176
|
declare const numberOperatorEncoder: Record<string, string>;
|
|
173
177
|
declare const numberOperatorDecoder: Record<string, string>;
|
|
174
|
-
declare const isOperatorValueValid: (field: string, operator: OperatorValue, columns: DataGridProps['columns']) => boolean;
|
|
175
|
-
declare const isValueValid: (value: OperatorValue, field: string, columns: DataGridProps['columns'], operator: OperatorValue) => boolean;
|
|
176
178
|
/** FILTERS */
|
|
177
179
|
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel | 'invalid';
|
|
178
180
|
declare const getSearchParamsFromFilterModel: (filterModel: GridFilterModel) => URLSearchParams;
|
|
@@ -183,12 +185,13 @@ declare const getSearchParamsFromSorting: (sorting: GridSortItem[]) => URLSearch
|
|
|
183
185
|
declare const getPaginationFromString: (searchString: string) => ExtendedGridPaginationModel | 'invalid';
|
|
184
186
|
declare const getSearchParamsFromPagination: (pagination: ExtendedGridPaginationModel) => URLSearchParams;
|
|
185
187
|
/** COLUMN VISIBILITY */
|
|
186
|
-
declare const getColumnVisibilityFromString: (searchString: string, columns: DataGridProps['columns']) => GridColumnVisibilityModel | 'invalid';
|
|
187
188
|
declare const getSearchParamsFromColumnVisibility: (columnVisibility: GridColumnVisibilityModel, columns: DataGridProps['columns']) => URLSearchParams;
|
|
189
|
+
declare const getColumnVisibilityFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => GridColumnVisibilityModel | 'invalid';
|
|
188
190
|
declare const getPinnedColumnsFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => PinnedColumns | 'invalid';
|
|
189
191
|
declare const getSearchParamsFromPinnedColumns: (pinnedColumns: GridPinnedColumns) => URLSearchParams;
|
|
190
192
|
declare const getSearchParamsFromTab: (search: string) => URLSearchParams;
|
|
191
193
|
type FinalSearchInput = {
|
|
194
|
+
localStorageVersion: number;
|
|
192
195
|
filterModel: GridFilterModel;
|
|
193
196
|
sortModel: GridSortModel;
|
|
194
197
|
paginationModel: ExtendedGridPaginationModel;
|
|
@@ -197,7 +200,7 @@ type FinalSearchInput = {
|
|
|
197
200
|
search: string;
|
|
198
201
|
columns: DataGridProps['columns'];
|
|
199
202
|
};
|
|
200
|
-
declare const getFinalSearch: ({ search, filterModel, sortModel, paginationModel, columnsVisibilityModel, pinnedColumnsModel, columns, }: FinalSearchInput) => URLSearchParams;
|
|
203
|
+
declare const getFinalSearch: ({ search, localStorageVersion, filterModel, sortModel, paginationModel, columnsVisibilityModel, pinnedColumnsModel, columns, }: FinalSearchInput) => URLSearchParams;
|
|
201
204
|
type PinnedColumns = {
|
|
202
205
|
left: string[];
|
|
203
206
|
right: string[];
|
|
@@ -222,7 +225,7 @@ type ModelsTable = {
|
|
|
222
225
|
pinnedColumnsModel: PinnedColumns;
|
|
223
226
|
};
|
|
224
227
|
/** Return the state of the table given the URL and the local storage state */
|
|
225
|
-
declare const getModelsParsedOrUpdateLocalStorage: (search: string, columns: DataGridProps['columns'], historyReplace: (newSearch: string) => void, initialState: GridInitialStatePro | undefined, localStorage: ModelsLocalStorage) => ModelsTable;
|
|
228
|
+
declare const getModelsParsedOrUpdateLocalStorage: (search: string, localStorageVersion: number, columns: DataGridProps['columns'], historyReplace: (newSearch: string) => void, initialState: GridInitialStatePro | undefined, localStorage: ModelsLocalStorage) => ModelsTable;
|
|
226
229
|
type DataGridModel = {
|
|
227
230
|
filterModel: GridFilterModel;
|
|
228
231
|
sortModel: GridSortModel;
|
|
@@ -230,7 +233,7 @@ type DataGridModel = {
|
|
|
230
233
|
columnsModel: GridColumnVisibilityModel;
|
|
231
234
|
pinnedColumnsModel: GridPinnedColumns;
|
|
232
235
|
};
|
|
233
|
-
declare const updateUrl: ({ filterModel, sortModel, paginationModel, columnsModel: columnsVisibilityModel, pinnedColumnsModel }: DataGridModel, search: string, historyReplace: (newSearch: string) => void, columns: DataGridProps['columns']) => void;
|
|
236
|
+
declare const updateUrl: ({ filterModel, sortModel, paginationModel, columnsModel: columnsVisibilityModel, pinnedColumnsModel }: DataGridModel, search: string, localStorageVersion: number, historyReplace: (newSearch: string) => void, columns: DataGridProps['columns']) => void;
|
|
234
237
|
declare const areFilterModelsEquivalent: (filterModel: GridFilterModel, filterModelToMatch: GridFilterModel) => boolean;
|
|
235
238
|
|
|
236
239
|
declare const BaseButton: React.JSXElementConstructor<any>;
|
|
@@ -245,12 +248,12 @@ declare const BasePopper: React.JSXElementConstructor<any>;
|
|
|
245
248
|
declare const BaseTextField: React.JSXElementConstructor<any>;
|
|
246
249
|
|
|
247
250
|
interface CompletionResponseItem {
|
|
248
|
-
|
|
249
|
-
|
|
251
|
+
columnField: string;
|
|
252
|
+
operatorValue: string;
|
|
250
253
|
value?: string;
|
|
251
254
|
}
|
|
252
255
|
type CompletionResponse = {
|
|
253
|
-
|
|
256
|
+
linkOperator: 'and' | 'or';
|
|
254
257
|
items: CompletionResponseItem[];
|
|
255
258
|
};
|
|
256
259
|
interface LocaleText {
|
|
@@ -296,9 +299,11 @@ type ControlledPaginationProps = {
|
|
|
296
299
|
displayPagination?: boolean;
|
|
297
300
|
selectionStatus: SelectionStatus;
|
|
298
301
|
apiRef: MutableRefObject<GridApiPro>;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
+
page: number;
|
|
303
|
+
onPageChange: (page: number) => void;
|
|
304
|
+
pageSize: number;
|
|
305
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
306
|
+
rowsPerPageOptions?: number[];
|
|
302
307
|
isRowSelectable?: DataGridProps['isRowSelectable'];
|
|
303
308
|
paginationProps?: DataGridProps['paginationProps'];
|
|
304
309
|
};
|
|
@@ -309,14 +314,16 @@ type ServerSideControlledPaginationProps = {
|
|
|
309
314
|
displayRowsPerPage?: boolean;
|
|
310
315
|
displayPagination?: boolean;
|
|
311
316
|
selectionStatus: SelectionStatus;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
317
|
+
page: number;
|
|
318
|
+
onPageChange: (page: number) => void;
|
|
319
|
+
pageSize: number;
|
|
320
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
321
|
+
rowsPerPageOptions?: number[];
|
|
315
322
|
paginationProps?: DataGridProps['paginationProps'];
|
|
316
323
|
rowCount: number;
|
|
317
324
|
loading?: boolean;
|
|
318
325
|
};
|
|
319
|
-
declare const onServerSideSelectionStatusChange: (newSelectionModel:
|
|
326
|
+
declare const onServerSideSelectionStatusChange: (newSelectionModel: GridSelectionModel, apiRef: React.MutableRefObject<GridApiPro>, selectionStatus: React.MutableRefObject<SelectionStatus>, isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined, page: number, pageSize: number) => void;
|
|
320
327
|
declare const ServerSideControlledPagination: React.FC<ServerSideControlledPaginationProps>;
|
|
321
328
|
|
|
322
329
|
interface TextCellProps extends ComponentProps<'div'> {
|
|
@@ -404,13 +411,15 @@ type ToolbarWrapperProps = {
|
|
|
404
411
|
selectionStatus: React.MutableRefObject<SelectionStatus>;
|
|
405
412
|
apiRef: DataGridProps['apiRef'];
|
|
406
413
|
isRowSelectable: DataGridProps['isRowSelectable'];
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
414
|
+
page: DataGridProps['page'];
|
|
415
|
+
onPageChange: DataGridProps['onPageChange'];
|
|
416
|
+
pageSize: DataGridProps['pageSize'];
|
|
417
|
+
onPageSizeChange: DataGridProps['onPageSizeChange'];
|
|
418
|
+
rowsPerPageOptions: DataGridProps['rowsPerPageOptions'];
|
|
410
419
|
paginationProps: DataGridProps['paginationProps'];
|
|
411
420
|
paginationMode?: DataGridProps['paginationMode'];
|
|
412
421
|
rowCount?: DataGridProps['rowCount'];
|
|
413
422
|
};
|
|
414
423
|
declare const ToolbarWrapper: React.FC<ToolbarWrapperProps>;
|
|
415
424
|
|
|
416
|
-
export { BaseButton, BaseCheckbox, BaseIcon, BasePopper, BaseTextField, CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, Category, CompletionResponse, ControlledPagination, ControlledPaginationProps, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, DataGridModel, DataGridProps, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, FilterConfig, GridToolbarFilterSemanticField, GridToolbarFilterSemanticFieldProps, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, PinnedColumns, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, SelectionStatus, ServerSideControlledPagination, ServerSideControlledPaginationProps, StatefulDataGrid, StatefulDataGridProps, StyledDataGridProps, TextCell, Toolbar, ToolbarWrapper, ToolbarWrapperProps, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString,
|
|
425
|
+
export { BaseButton, BaseCheckbox, BaseIcon, BasePopper, BaseTextField, CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, Category, CompletionResponse, ControlledPagination, ControlledPaginationProps, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DIMENSION_MODEL_KEY, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, DataGridModel, DataGridProps, ENDS_WITH_ANY_OF, FILTER_MODEL_KEY, FILTER_SEARCH_KEY, FilterConfig, GridToolbarFilterSemanticField, GridToolbarFilterSemanticFieldProps, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, PAGINATION_MODEL_KEY, PINNED_COLUMNS, PinnedColumns, SORT_MODEL_KEY, STARTS_WITH_ANY_OF, SelectionStatus, ServerSideControlledPagination, ServerSideControlledPaginationProps, StatefulDataGrid, StatefulDataGridProps, StyledDataGridProps, TextCell, Toolbar, ToolbarWrapper, ToolbarWrapperProps, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPaginationFromString, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPagination, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, muiIconToDSIcon, numberOperatorDecoder, numberOperatorEncoder, onServerSideSelectionStatusChange, operatorList, updateUrl, urlSearchParamsToString };
|