@orderingstack/front-components-product-configurator 1.4.2-beta.24 → 1.4.2-beta.26
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 +5 -7
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6915,12 +6915,10 @@ const selectProductsInForm = (productToSelect, setValueInForm, initialSelectedSt
|
|
|
6915
6915
|
};
|
|
6916
6916
|
function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
|
|
6917
6917
|
const { selCtx, attrs = {} } = product;
|
|
6918
|
-
useStore((state) => state.filter);
|
|
6919
6918
|
const initialSelected = useStore((state) => state.initialSelected);
|
|
6920
6919
|
const currency = useStore((state) => state.currency);
|
|
6921
|
-
const { setValue, getValues
|
|
6922
|
-
const selected =
|
|
6923
|
-
const filter = watch("filter");
|
|
6920
|
+
const { setValue, getValues } = useFormContext();
|
|
6921
|
+
const { selected = {}, filter = {} } = getValues();
|
|
6924
6922
|
const isFilterValidated = validateProductFilter(product, filter);
|
|
6925
6923
|
const isOnSubmitted = useStore((state) => state.isOnSubmitted);
|
|
6926
6924
|
const setValidationMap = useStore((state) => state.setValidationMap);
|
|
@@ -6947,9 +6945,9 @@ function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
|
|
|
6947
6945
|
console.log("LOG1 useMenuOptions useEffect isFilterValidated", isFilterValidated, product);
|
|
6948
6946
|
console.log("LOG1 useMenuOptions useEffect productsToUnselect", productsToUnselect);
|
|
6949
6947
|
console.log("LOG1 useMenuOptions useEffect productsToSelect", productsToSelect);
|
|
6950
|
-
selectProductsInForm(productsToSelect, setValue, initialSelected);
|
|
6951
6948
|
unselectProductsInForm(productsToUnselect, setValue);
|
|
6952
|
-
|
|
6949
|
+
selectProductsInForm(productsToSelect, setValue, initialSelected);
|
|
6950
|
+
}, [isFilterValidated]);
|
|
6953
6951
|
return {
|
|
6954
6952
|
isFilterValidated,
|
|
6955
6953
|
selected,
|
|
@@ -11115,5 +11113,5 @@ function ProductConfigurator(props) {
|
|
|
11115
11113
|
})
|
|
11116
11114
|
});
|
|
11117
11115
|
}
|
|
11118
|
-
export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, getProductToChangeInForm, index_esm as hookForm, selectProductsInForm, unselectProductsInForm, useProductData, validateProductFilter };
|
|
11116
|
+
export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, getProductToChangeInForm, index_esm as hookForm, selectProductsInForm, unselectProductsInForm, useMenuOptions, useProductData, validateProductFilter };
|
|
11119
11117
|
//# sourceMappingURL=index.es.js.map
|