@trackunit/filters-filter-bar 0.0.429 → 0.0.431
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.cjs.js +5 -2
- package/index.esm.js +5 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1014,7 +1014,10 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, initialState,
|
|
|
1014
1014
|
if (storedFilters && storedFilters !== "undefined") {
|
|
1015
1015
|
const loadedFilterBarConfig = JSON.parse(storedFilters);
|
|
1016
1016
|
if (validateFilter(loadedFilterBarConfig, filterDefinitionsValues)) {
|
|
1017
|
-
initialFilterBarConfig =
|
|
1017
|
+
initialFilterBarConfig = {
|
|
1018
|
+
...loadedFilterBarConfig,
|
|
1019
|
+
initialState: initialState || loadedFilterBarConfig.initialState,
|
|
1020
|
+
};
|
|
1018
1021
|
}
|
|
1019
1022
|
}
|
|
1020
1023
|
//WHY WE NEED THIS?
|
|
@@ -1090,7 +1093,7 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, initialState,
|
|
|
1090
1093
|
return (filter === null || filter === void 0 ? void 0 : filter.find(f => f.value === value)) !== undefined || false;
|
|
1091
1094
|
},
|
|
1092
1095
|
};
|
|
1093
|
-
}, [filterBarConfig]);
|
|
1096
|
+
}, [filterBarConfig.initialState, filterBarConfig.name, filterBarConfig.values]);
|
|
1094
1097
|
const filterMapActions = react.useMemo(() => {
|
|
1095
1098
|
// Reset an individual filter to its initial state
|
|
1096
1099
|
const resetIndividualFilterToInitialState = (key) => {
|
package/index.esm.js
CHANGED
|
@@ -1012,7 +1012,10 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, initialState,
|
|
|
1012
1012
|
if (storedFilters && storedFilters !== "undefined") {
|
|
1013
1013
|
const loadedFilterBarConfig = JSON.parse(storedFilters);
|
|
1014
1014
|
if (validateFilter(loadedFilterBarConfig, filterDefinitionsValues)) {
|
|
1015
|
-
initialFilterBarConfig =
|
|
1015
|
+
initialFilterBarConfig = {
|
|
1016
|
+
...loadedFilterBarConfig,
|
|
1017
|
+
initialState: initialState || loadedFilterBarConfig.initialState,
|
|
1018
|
+
};
|
|
1016
1019
|
}
|
|
1017
1020
|
}
|
|
1018
1021
|
//WHY WE NEED THIS?
|
|
@@ -1088,7 +1091,7 @@ const useFilterBar = ({ name, onValuesChange, filterBarDefinition, initialState,
|
|
|
1088
1091
|
return (filter === null || filter === void 0 ? void 0 : filter.find(f => f.value === value)) !== undefined || false;
|
|
1089
1092
|
},
|
|
1090
1093
|
};
|
|
1091
|
-
}, [filterBarConfig]);
|
|
1094
|
+
}, [filterBarConfig.initialState, filterBarConfig.name, filterBarConfig.values]);
|
|
1092
1095
|
const filterMapActions = useMemo(() => {
|
|
1093
1096
|
// Reset an individual filter to its initial state
|
|
1094
1097
|
const resetIndividualFilterToInitialState = (key) => {
|