@orderingstack/front-components-product-configurator 1.4.2-beta.19 → 1.4.2-beta.20
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/MenuProduct/useMenuProduct.d.ts.map +1 -1
- package/dist/hooks/useEmitFilter.d.ts.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6913,11 +6913,11 @@ const selectProductsInForm = (productToUnselect, setValueInForm, initialSelected
|
|
|
6913
6913
|
};
|
|
6914
6914
|
function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
|
|
6915
6915
|
const { selCtx, attrs = {} } = product;
|
|
6916
|
+
useStore((state) => state.filter);
|
|
6916
6917
|
const initialSelected = useStore((state) => state.initialSelected);
|
|
6917
6918
|
const currency = useStore((state) => state.currency);
|
|
6918
|
-
const { setValue, getValues
|
|
6919
|
-
const selected =
|
|
6920
|
-
const filter = watch("filter") || {};
|
|
6919
|
+
const { setValue, getValues } = useFormContext();
|
|
6920
|
+
const { selected = {}, filter = {} } = getValues();
|
|
6921
6921
|
const isFilterValidated = validateProductFilter(product, filter);
|
|
6922
6922
|
const isOnSubmitted = useStore((state) => state.isOnSubmitted);
|
|
6923
6923
|
const setValidationMap = useStore((state) => state.setValidationMap);
|
|
@@ -6946,7 +6946,7 @@ function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
|
|
|
6946
6946
|
console.log({ productsToUnselect });
|
|
6947
6947
|
unselectProductsInForm(productsToUnselect, setValue);
|
|
6948
6948
|
selectProductsInForm(productsToSelect, setValue, initialSelected);
|
|
6949
|
-
}, [isFilterValidated]);
|
|
6949
|
+
}, [isFilterValidated, initialSelected]);
|
|
6950
6950
|
return {
|
|
6951
6951
|
isFilterValidated,
|
|
6952
6952
|
selected,
|