@orderingstack/front-components-product-configurator 1.4.2-beta.21 → 1.4.2-beta.22

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/index.es.js CHANGED
@@ -6918,8 +6918,9 @@ function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
6918
6918
  useStore((state) => state.filter);
6919
6919
  const initialSelected = useStore((state) => state.initialSelected);
6920
6920
  const currency = useStore((state) => state.currency);
6921
- const { setValue, getValues } = useFormContext();
6922
- const { selected = {}, filter = {} } = getValues();
6921
+ const { setValue, getValues, watch } = useFormContext();
6922
+ const selected = watch("selected");
6923
+ const filter = watch("filter");
6923
6924
  const isFilterValidated = validateProductFilter(product, filter);
6924
6925
  const isOnSubmitted = useStore((state) => state.isOnSubmitted);
6925
6926
  const setValidationMap = useStore((state) => state.setValidationMap);
@@ -6945,8 +6946,8 @@ function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
6945
6946
  );
6946
6947
  console.log("LOG1 useMenuOptions useEffect productsToUnselect", productsToUnselect);
6947
6948
  console.log("LOG1 useMenuOptions useEffect productsToSelect", productsToSelect);
6948
- unselectProductsInForm(productsToUnselect, setValue);
6949
6949
  selectProductsInForm(productsToSelect, setValue, initialSelected);
6950
+ unselectProductsInForm(productsToUnselect, setValue);
6950
6951
  }, [isFilterValidated, selected]);
6951
6952
  return {
6952
6953
  isFilterValidated,
@@ -11028,7 +11029,6 @@ function ProductConfigurator(props) {
11028
11029
  const {
11029
11030
  encodedProduct,
11030
11031
  initSelected,
11031
- filter,
11032
11032
  productQuantity,
11033
11033
  setIsOnSubmittedOnTrue,
11034
11034
  getInvalidSelCtxArray,
@@ -11071,6 +11071,8 @@ function ProductConfigurator(props) {
11071
11071
  } else {
11072
11072
  console.log("selected", getValues("selected"));
11073
11073
  const decodedCleanedSelected = decodeSelected(cleanSelected(getValues("selected")));
11074
+ const filter = getValues("filter");
11075
+ console.log("filter", filter);
11074
11076
  console.log("decodedCleanedSelected: ", decodedCleanedSelected);
11075
11077
  handleAddToCart({
11076
11078
  price: countedProductPrice,