@redsift/table 11.1.2 → 11.1.3
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 +1 -1
- package/index.js +4 -10
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ declare const numberOperatorDecoder: Record<string, string>;
|
|
|
175
175
|
declare const isOperatorValueValid: (field: string, operator: OperatorValue, columns: DataGridProps['columns']) => boolean;
|
|
176
176
|
declare const isValueValid: (value: OperatorValue, field: string, columns: DataGridProps['columns'], operator: OperatorValue) => boolean;
|
|
177
177
|
/** FILTERS */
|
|
178
|
-
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel;
|
|
178
|
+
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel | 'invalid';
|
|
179
179
|
declare const getSearchParamsFromFilterModel: (filterModel: GridFilterModel) => URLSearchParams;
|
|
180
180
|
/** SORT */
|
|
181
181
|
declare const getSortingFromString: (searchString: string, columns: DataGridProps['columns']) => GridSortModel | null;
|
package/index.js
CHANGED
|
@@ -18131,10 +18131,7 @@ const isValueValid = (value, field, columns, operator) => {
|
|
|
18131
18131
|
// unicodeDomain[contains]=a&unicodeDomain[contains]=dsa&logicOperator=and&tab=ignored
|
|
18132
18132
|
const getFilterModelFromString = (searchString, columns) => {
|
|
18133
18133
|
if (!searchString) {
|
|
18134
|
-
return
|
|
18135
|
-
items: [],
|
|
18136
|
-
logicOperator: GridLogicOperator.And
|
|
18137
|
-
};
|
|
18134
|
+
return 'invalid';
|
|
18138
18135
|
}
|
|
18139
18136
|
let logicOperator = GridLogicOperator.And;
|
|
18140
18137
|
const searchParams = new URLSearchParams();
|
|
@@ -18196,10 +18193,7 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18196
18193
|
// return the empty filterModel (this will trigger the localStorage)
|
|
18197
18194
|
// and will pick up the last valid search
|
|
18198
18195
|
if (isInvalid) {
|
|
18199
|
-
return
|
|
18200
|
-
items: [],
|
|
18201
|
-
logicOperator: GridLogicOperator.And
|
|
18202
|
-
};
|
|
18196
|
+
return 'invalid';
|
|
18203
18197
|
}
|
|
18204
18198
|
return {
|
|
18205
18199
|
items,
|
|
@@ -18231,7 +18225,7 @@ const getSearchParamsFromFilterModel = filterModel => {
|
|
|
18231
18225
|
// - if we don't have that, return an empty FilterModel
|
|
18232
18226
|
const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFilters) => {
|
|
18233
18227
|
const filterModelFromSearch = getFilterModelFromString(search, columns);
|
|
18234
|
-
if (filterModelFromSearch
|
|
18228
|
+
if (filterModelFromSearch !== 'invalid') {
|
|
18235
18229
|
const searchFromFilterModel = getSearchParamsFromFilterModel(filterModelFromSearch);
|
|
18236
18230
|
const searchString = urlSearchParamsToString(searchFromFilterModel);
|
|
18237
18231
|
if (searchString !== localStorageFilters) {
|
|
@@ -18240,7 +18234,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
|
|
|
18240
18234
|
return filterModelFromSearch;
|
|
18241
18235
|
}
|
|
18242
18236
|
const filterModelFromLocalStorage = getFilterModelFromString(localStorageFilters, columns);
|
|
18243
|
-
if (filterModelFromLocalStorage) {
|
|
18237
|
+
if (filterModelFromLocalStorage !== 'invalid') {
|
|
18244
18238
|
return filterModelFromLocalStorage;
|
|
18245
18239
|
}
|
|
18246
18240
|
return {
|