@orderingstack/front-components-product-configurator 1.4.2-beta.5 → 1.4.2-beta.7

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
@@ -8812,6 +8812,7 @@ function useEmitFilter(product) {
8812
8812
  useEffect(() => {
8813
8813
  if (value && fltCtx && !isEmpty(emit)) {
8814
8814
  setFilter(fltCtx, emit);
8815
+ setValue(`filter.${fltCtx}`, emit);
8815
8816
  }
8816
8817
  }, [value]);
8817
8818
  return {};
@@ -8902,9 +8903,11 @@ function useMenuProduct(product, parentAttrs) {
8902
8903
  const value = watch(`selected.${selCtx}.${id}`);
8903
8904
  const { selected = {} } = getValues();
8904
8905
  const valueNumber = Number(value || 0);
8906
+ const stateFilter = useStore((state) => state.filter);
8905
8907
  const isRadio = parentSelMin === "1" && parentSelMax === "1";
8906
8908
  const isCheckbox = !isRadio;
8907
8909
  const isCounter = isApiBooleanTrue(parentAllowMultiple);
8910
+ const isFilterValidated = validateProductFilter(product, stateFilter);
8908
8911
  const isDecrementEnabled = valueNumber > (isRadio ? 1 : 0);
8909
8912
  const isIncrementEnabled = isInputCounterIncrementEnabled2(product, selected) && (isInputEnabled2(product) || valueNumber);
8910
8913
  const isChecked = Number(((_a = selected == null ? void 0 : selected[selCtx]) == null ? void 0 : _a[id]) || 0) > 0;
@@ -8965,7 +8968,8 @@ function useMenuProduct(product, parentAttrs) {
8965
8968
  handleOnInputChange,
8966
8969
  inputId: `${selCtx}.${id}`,
8967
8970
  radioInputValue: id,
8968
- currency
8971
+ currency,
8972
+ isFilterValidated
8969
8973
  };
8970
8974
  }
8971
8975
  const MenuProduct = (props) => {
@@ -8990,7 +8994,8 @@ const MenuProduct = (props) => {
8990
8994
  counterValue,
8991
8995
  handleCounterIncrementQty,
8992
8996
  handleCounterDecrementQty,
8993
- currency
8997
+ currency,
8998
+ isFilterValidated
8994
8999
  } = useMenuProduct(product, parentAttrs);
8995
9000
  const {
8996
9001
  MenuProductUI
@@ -9012,7 +9017,8 @@ const MenuProduct = (props) => {
9012
9017
  handleCounterIncrementQty,
9013
9018
  handleCounterDecrementQty,
9014
9019
  currency,
9015
- parentProduct
9020
+ parentProduct,
9021
+ isFilterValidated
9016
9022
  };
9017
9023
  const MenuItemsDispatcherWrapper = /* @__PURE__ */ jsx(MenuItemsDispatcher, {
9018
9024
  productItems: product.items,
@@ -10973,5 +10979,5 @@ function ProductConfigurator(props) {
10973
10979
  })
10974
10980
  });
10975
10981
  }
10976
- export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, index_esm as hookForm, useProductData };
10982
+ export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, getProductToChangeInForm, index_esm as hookForm, selectProductsInForm, unselectProductsInForm, useProductData, validateProductFilter };
10977
10983
  //# sourceMappingURL=index.es.js.map