@redsift/table 11.1.2-muiv5 → 11.1.3-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 +1 -1
- package/index.js +4 -10
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -185,7 +185,7 @@ declare const urlSearchParamsToString: (searchParams: URLSearchParams) => string
|
|
|
185
185
|
declare const numberOperatorEncoder: Record<string, string>;
|
|
186
186
|
declare const numberOperatorDecoder: Record<string, string>;
|
|
187
187
|
/** FILTERS */
|
|
188
|
-
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel;
|
|
188
|
+
declare const getFilterModelFromString: (searchString: string, columns: DataGridProps['columns']) => GridFilterModel | 'invalid';
|
|
189
189
|
declare const getSearchParamsFromFilterModel: (filterModel: GridFilterModel) => URLSearchParams;
|
|
190
190
|
/** SORT */
|
|
191
191
|
declare const getSortingFromString: (searchString: string, columns: DataGridProps['columns']) => GridSortModel | null;
|
package/index.js
CHANGED
|
@@ -18134,10 +18134,7 @@ const isValueValid = (value, columnField, columns, operatorValue) => {
|
|
|
18134
18134
|
// unicodeDomain[contains]=a&unicodeDomain[contains]=dsa&logicOperator=and&tab=ignored
|
|
18135
18135
|
const getFilterModelFromString = (searchString, columns) => {
|
|
18136
18136
|
if (!searchString) {
|
|
18137
|
-
return
|
|
18138
|
-
items: [],
|
|
18139
|
-
linkOperator: GridLinkOperator.And
|
|
18140
|
-
};
|
|
18137
|
+
return 'invalid';
|
|
18141
18138
|
}
|
|
18142
18139
|
let linkOperator = GridLinkOperator.And;
|
|
18143
18140
|
const searchParams = new URLSearchParams();
|
|
@@ -18199,10 +18196,7 @@ const getFilterModelFromString = (searchString, columns) => {
|
|
|
18199
18196
|
// return the empty filterModel (this will trigger the localStorage)
|
|
18200
18197
|
// and will pick up the last valid search
|
|
18201
18198
|
if (isInvalid) {
|
|
18202
|
-
return
|
|
18203
|
-
items: [],
|
|
18204
|
-
linkOperator: GridLinkOperator.And
|
|
18205
|
-
};
|
|
18199
|
+
return 'invalid';
|
|
18206
18200
|
}
|
|
18207
18201
|
return {
|
|
18208
18202
|
items,
|
|
@@ -18234,7 +18228,7 @@ const getSearchParamsFromFilterModel = filterModel => {
|
|
|
18234
18228
|
// - if we don't have that, return an empty FilterModel
|
|
18235
18229
|
const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFilters) => {
|
|
18236
18230
|
const filterModelFromSearch = getFilterModelFromString(search, columns);
|
|
18237
|
-
if (filterModelFromSearch
|
|
18231
|
+
if (filterModelFromSearch !== 'invalid') {
|
|
18238
18232
|
const searchFromFilterModel = getSearchParamsFromFilterModel(filterModelFromSearch);
|
|
18239
18233
|
const searchString = urlSearchParamsToString(searchFromFilterModel);
|
|
18240
18234
|
if (searchString !== localStorageFilters) {
|
|
@@ -18243,7 +18237,7 @@ const getFilterModel = (search, columns, localStorageFilters, setLocalStorageFil
|
|
|
18243
18237
|
return filterModelFromSearch;
|
|
18244
18238
|
}
|
|
18245
18239
|
const filterModelFromLocalStorage = getFilterModelFromString(localStorageFilters, columns);
|
|
18246
|
-
if (filterModelFromLocalStorage) {
|
|
18240
|
+
if (filterModelFromLocalStorage !== 'invalid') {
|
|
18247
18241
|
return filterModelFromLocalStorage;
|
|
18248
18242
|
}
|
|
18249
18243
|
return {
|