@orderingstack/front-components-product-configurator 1.4.2-beta.20 → 1.4.2-beta.21
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/dist/components/MenuOptions/useMenuOptions.d.ts.map +1 -1
- package/dist/components/ProductConfigurator/ProductConfigurator.d.ts.map +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7 -7
- package/dist/index.es.js.map +1 -1
- package/dist/utils/filter.d.ts +1 -1
- package/dist/utils/filter.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6895,12 +6895,14 @@ const getProductToChangeInForm = (product, isFilterValidated) => {
|
|
|
6895
6895
|
return { productsToSelect, productsToUnselect };
|
|
6896
6896
|
};
|
|
6897
6897
|
const unselectProductsInForm = (productsToUnselect, setValueInForm) => {
|
|
6898
|
+
console.log("LOG1 productsToUnselect", productsToUnselect);
|
|
6898
6899
|
productsToUnselect.map(({ selCtx, id }) => {
|
|
6899
6900
|
setValueInForm(`selected.${selCtx}.${id}`, false);
|
|
6900
6901
|
});
|
|
6901
6902
|
};
|
|
6902
|
-
const selectProductsInForm = (
|
|
6903
|
-
|
|
6903
|
+
const selectProductsInForm = (productToSelect, setValueInForm, initialSelectedState) => {
|
|
6904
|
+
console.log("LOG1 productToSelect", productToSelect);
|
|
6905
|
+
productToSelect.map(({ selCtx, id }) => {
|
|
6904
6906
|
var _a;
|
|
6905
6907
|
const productInInitialState = (_a = initialSelectedState[selCtx]) == null ? void 0 : _a[id];
|
|
6906
6908
|
if (productInInitialState) {
|
|
@@ -6937,16 +6939,15 @@ function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
|
|
|
6937
6939
|
parentKind
|
|
6938
6940
|
});
|
|
6939
6941
|
useEffect(() => {
|
|
6940
|
-
console.log("isFilterValidated useEffect");
|
|
6941
6942
|
const { productsToSelect, productsToUnselect } = getProductToChangeInForm(
|
|
6942
6943
|
product,
|
|
6943
6944
|
isFilterValidated
|
|
6944
6945
|
);
|
|
6945
|
-
console.log(
|
|
6946
|
-
console.log(
|
|
6946
|
+
console.log("LOG1 useMenuOptions useEffect productsToUnselect", productsToUnselect);
|
|
6947
|
+
console.log("LOG1 useMenuOptions useEffect productsToSelect", productsToSelect);
|
|
6947
6948
|
unselectProductsInForm(productsToUnselect, setValue);
|
|
6948
6949
|
selectProductsInForm(productsToSelect, setValue, initialSelected);
|
|
6949
|
-
}, [isFilterValidated,
|
|
6950
|
+
}, [isFilterValidated, selected]);
|
|
6950
6951
|
return {
|
|
6951
6952
|
isFilterValidated,
|
|
6952
6953
|
selected,
|
|
@@ -11049,7 +11050,6 @@ function ProductConfigurator(props) {
|
|
|
11049
11050
|
setValidationMap(validationMapNew);
|
|
11050
11051
|
}
|
|
11051
11052
|
});
|
|
11052
|
-
console.log("ProductConfigurator initSelected", initSelected);
|
|
11053
11053
|
const methods = useForm({
|
|
11054
11054
|
defaultValues: {
|
|
11055
11055
|
selected: initSelected
|