@redsift/table 11.0.0-muiv5-alpha.0 → 11.0.0-muiv5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +84 -3
- package/index.js +4855 -4772
- package/index.js.map +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import * as _mui_x_data_grid_pro from '@mui/x-data-grid-pro';
|
|
2
|
-
import { GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputValue, GridFilterInputMultipleValue, DataGridProProps, GridPinnedColumns, GridFilterModel, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
2
|
+
import { GridNativeColTypes, GridColumnTypesRecord, GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputValue, GridFilterInputMultipleValue, DataGridProProps, GridPinnedColumns, GridFilterModel, GridSortModel, GridSortItem, GridColumnVisibilityModel, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
3
3
|
export { GridAlignment, GridColDef, GridColumns, GridFilterItem, GridFilterModel, GridSelectionModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
|
-
import { Theme, Comp, IconProps, NotificationsColorPalette, ProductColorPalette, ShieldVariant } from '@redsift/design-system';
|
|
5
4
|
import React, { ReactNode, ComponentProps, RefObject } from 'react';
|
|
6
5
|
import { TablePaginationProps } from '@mui/material';
|
|
6
|
+
import { Theme, Comp, IconProps, NotificationsColorPalette, ProductColorPalette, ShieldVariant } from '@redsift/design-system';
|
|
7
7
|
|
|
8
8
|
declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any, any, any>;
|
|
9
9
|
|
|
10
|
+
declare const getRsStringColumnType: () => {
|
|
11
|
+
extendType: GridNativeColTypes;
|
|
12
|
+
filterOperators: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
13
|
+
};
|
|
14
|
+
declare const getRsNumberColumnType: () => {
|
|
15
|
+
extendType: GridNativeColTypes;
|
|
16
|
+
filterOperators: _mui_x_data_grid_pro.GridFilterOperator<any, string | number | null, any>[];
|
|
17
|
+
};
|
|
18
|
+
declare const customColumnTypes: GridColumnTypesRecord;
|
|
19
|
+
|
|
10
20
|
declare const IS_BETWEEN: {
|
|
11
21
|
label: string;
|
|
12
22
|
value: string;
|
|
@@ -89,6 +99,22 @@ declare const operatorList: {
|
|
|
89
99
|
|
|
90
100
|
declare function getCompletion(text: string, role: string, openai_api_key: string | undefined, model?: string): Promise<string>;
|
|
91
101
|
|
|
102
|
+
declare const PAGINATION_MODEL_KEY = "paginationModel";
|
|
103
|
+
declare const FILTER_MODEL_KEY = "filterModel";
|
|
104
|
+
declare const SORT_MODEL_KEY = "sortModel";
|
|
105
|
+
declare const VISIBILITY_MODEL_KEY = "visibilityModel";
|
|
106
|
+
declare const PINNED_COLUMNS = "pinnedColumns";
|
|
107
|
+
declare const DIMENSION_MODEL_KEY = "dimension";
|
|
108
|
+
declare const FILTER_SEARCH_KEY = "searchModel";
|
|
109
|
+
declare const CATEGORIES: readonly ["paginationModel", "filterModel", "sortModel", "visibilityModel", "dimension", "searchModel", "pinnedColumns"];
|
|
110
|
+
type Category = (typeof CATEGORIES)[number];
|
|
111
|
+
declare const buildStorageKey: ({ id, version, category }: {
|
|
112
|
+
id: string;
|
|
113
|
+
version: number;
|
|
114
|
+
category: Category;
|
|
115
|
+
}) => `${string}:${number}:paginationModel` | `${string}:${number}:filterModel` | `${string}:${number}:sortModel` | `${string}:${number}:visibilityModel` | `${string}:${number}:pinnedColumns` | `${string}:${number}:dimension` | `${string}:${number}:searchModel`;
|
|
116
|
+
declare const clearPreviousVersionStorage: (id: string, currentVersion: number) => void;
|
|
117
|
+
|
|
92
118
|
interface DataGridProps extends Partial<Pick<DataGridProProps, 'rows'>>, Omit<DataGridProProps, 'rows'> {
|
|
93
119
|
/** License key for MUI Datagrid Pro. */
|
|
94
120
|
license?: string;
|
|
@@ -130,6 +156,61 @@ type StyledDataGridProps = {
|
|
|
130
156
|
|
|
131
157
|
declare const DataGrid: Comp<DataGridProps, HTMLDivElement>;
|
|
132
158
|
|
|
159
|
+
type OperatorValue = string | string[];
|
|
160
|
+
declare const decodeValue: (value: string) => OperatorValue;
|
|
161
|
+
declare const encodeValue: (value: string | undefined) => string;
|
|
162
|
+
declare const urlSearchParamsToString: (searchParams: URLSearchParams) => string;
|
|
163
|
+
declare const numberOperatorEncoder: Record<string, string>;
|
|
164
|
+
declare const numberOperatorDecoder: Record<string, string>;
|
|
165
|
+
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel;
|
|
166
|
+
declare const getSearchParamsFromFilterModel: (filterModel: GridFilterModel) => URLSearchParams;
|
|
167
|
+
declare const getSortingFromString: (notParsed: string, columns: DataGridProps['columns']) => GridSortModel | null;
|
|
168
|
+
declare const getSearchParamsFromSorting: (sorting: GridSortItem[]) => URLSearchParams;
|
|
169
|
+
declare const getSearchParamsFromColumnVisibility: (columnVisibility: GridColumnVisibilityModel, columns: DataGridProps['columns']) => URLSearchParams;
|
|
170
|
+
declare const getColumnVisibilityFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => GridColumnVisibilityModel | null;
|
|
171
|
+
declare const getPinnedColumnsFromString: (notParsed: string, tableColumns: DataGridProps['columns']) => PinnedColumns | null;
|
|
172
|
+
declare const getSearchParamsFromPinnedColumns: (pinnedColumns: GridPinnedColumns) => URLSearchParams;
|
|
173
|
+
declare const getSearchParamsFromTab: (search: string) => URLSearchParams;
|
|
174
|
+
type FinalSearchInput = {
|
|
175
|
+
filterModel: GridFilterModel;
|
|
176
|
+
sortModel: GridSortModel;
|
|
177
|
+
columnsVisibilityModel: GridColumnVisibilityModel;
|
|
178
|
+
pinnedColumnsModel: GridPinnedColumns;
|
|
179
|
+
search: string;
|
|
180
|
+
columns: DataGridProps['columns'];
|
|
181
|
+
};
|
|
182
|
+
declare const getFinalSearch: ({ search, filterModel, sortModel, columnsVisibilityModel, pinnedColumnsModel, columns, }: FinalSearchInput) => URLSearchParams;
|
|
183
|
+
type PinnedColumns = {
|
|
184
|
+
left: string[];
|
|
185
|
+
right: string[];
|
|
186
|
+
};
|
|
187
|
+
type ModelsLocalStorage = {
|
|
188
|
+
localStorageFilters: string;
|
|
189
|
+
setLocalStorageFilters: (search: string) => void;
|
|
190
|
+
localStorageSorting: string;
|
|
191
|
+
setLocalStorageSorting: (search: string) => void;
|
|
192
|
+
localStorageColumnsVisibility: string;
|
|
193
|
+
setLocalStorageColumnsVisibility: (search: string) => void;
|
|
194
|
+
localStoragePinnedColumns: string;
|
|
195
|
+
setLocalStoragePinnedColumns: (search: string) => void;
|
|
196
|
+
};
|
|
197
|
+
type ModelsTable = {
|
|
198
|
+
filterModel: GridFilterModel;
|
|
199
|
+
sortModel: GridSortModel;
|
|
200
|
+
columnVisibilityModel: GridColumnVisibilityModel;
|
|
201
|
+
pinnedColumnsModel: PinnedColumns;
|
|
202
|
+
};
|
|
203
|
+
/** Return the state of the table given the URL and the local storage state */
|
|
204
|
+
declare const getModelsParsedOrUpdateLocalStorage: (search: string, columns: DataGridProps['columns'], historyReplace: (newSearch: string) => void, localStorage: ModelsLocalStorage) => ModelsTable;
|
|
205
|
+
type DataGridModel = {
|
|
206
|
+
filterModel: GridFilterModel;
|
|
207
|
+
sortModel: GridSortModel;
|
|
208
|
+
columnsModel: GridColumnVisibilityModel;
|
|
209
|
+
pinnedColumnsModel: GridPinnedColumns;
|
|
210
|
+
};
|
|
211
|
+
declare const updateUrl: ({ filterModel, sortModel, columnsModel: columnsVisibilityModel, pinnedColumnsModel }: DataGridModel, search: string, historyReplace: (newSearch: string) => void, columns: DataGridProps['columns']) => void;
|
|
212
|
+
declare const areFilterModelsEquivalent: (filterModel: GridFilterModel, filterModelToMatch: GridFilterModel) => boolean;
|
|
213
|
+
|
|
133
214
|
interface CompletionResponseItem {
|
|
134
215
|
columnField: string;
|
|
135
216
|
operatorValue: string;
|
|
@@ -251,4 +332,4 @@ interface TextCellProps extends ComponentProps<'div'> {
|
|
|
251
332
|
*/
|
|
252
333
|
declare const TextCell: Comp<TextCellProps, HTMLDivElement>;
|
|
253
334
|
|
|
254
|
-
export { CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, CompletionResponse, DEFAULT_OPERATORS, DETAIL_PANEL_TOGGLE_COL_DEF, DOES_NOT_CONTAIN, DOES_NOT_EQUAL, DataGrid, DataGridProps, ENDS_WITH_ANY_OF, FilterConfig, GridToolbarFilterSemanticField, GridToolbarFilterSemanticFieldProps, IS_ANY_OF, IS_BETWEEN, IS_NOT_ANY_OF, STARTS_WITH_ANY_OF, SelectionStatus, StyledDataGridProps, TextCell, Toolbar, getCompletion, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, operatorList };
|
|
335
|
+
export { CATEGORIES, CONTAINS_ANY_OF, CONTAINS_ANY_OF_I, Category, CompletionResponse, 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, StyledDataGridProps, TextCell, Toolbar, VISIBILITY_MODEL_KEY, areFilterModelsEquivalent, buildStorageKey, clearPreviousVersionStorage, customColumnTypes, decodeValue, encodeValue, getColumnVisibilityFromString, getCompletion, getFilterModelFromString, getFinalSearch, getGridNumericOperators, getGridStringArrayOperators, getGridStringOperators, getModelsParsedOrUpdateLocalStorage, getPinnedColumnsFromString, getRsNumberColumnType, getRsStringColumnType, getSearchParamsFromColumnVisibility, getSearchParamsFromFilterModel, getSearchParamsFromPinnedColumns, getSearchParamsFromSorting, getSearchParamsFromTab, getSortingFromString, numberOperatorDecoder, numberOperatorEncoder, operatorList, updateUrl, urlSearchParamsToString };
|