@orderingstack/front-components-product-configurator 1.4.2-beta.4 → 1.4.2-beta.6

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
@@ -6686,6 +6686,7 @@ function useProductConfigurator(product) {
6686
6686
  return {
6687
6687
  encodedProduct,
6688
6688
  initSelected,
6689
+ initFilter,
6689
6690
  filter,
6690
6691
  setCurrency,
6691
6692
  setIsOnSubmittedOnTrue,
@@ -8804,13 +8805,14 @@ function Counter(props) {
8804
8805
  });
8805
8806
  }
8806
8807
  function useEmitFilter(product) {
8807
- const { watch } = useFormContext();
8808
+ const { watch, setValue } = useFormContext();
8808
8809
  const setFilter = useStore((state) => state.setFilter);
8809
8810
  const { id, selCtx, emit = {}, fltCtx } = product;
8810
8811
  const value = watch(`selected.${selCtx}.${id}`);
8811
8812
  useEffect(() => {
8812
8813
  if (value && fltCtx && !isEmpty(emit)) {
8813
8814
  setFilter(fltCtx, emit);
8815
+ setValue(`filter.${fltCtx}`, emit);
8814
8816
  }
8815
8817
  }, [value]);
8816
8818
  return {};
@@ -9226,10 +9228,12 @@ const DisplayState = () => {
9226
9228
  watch
9227
9229
  } = useFormContext();
9228
9230
  const selected = watch("selected");
9231
+ const filter = watch("filter");
9229
9232
  const validationMap = useStore((state) => state.validationMap);
9230
9233
  console.log({
9231
9234
  selected,
9232
- validationMap
9235
+ validationMap,
9236
+ filter
9233
9237
  });
9234
9238
  return /* @__PURE__ */ jsxs("div", {
9235
9239
  className: "flex flex-col items-center py-4",
@@ -10884,6 +10888,7 @@ function ProductConfigurator(props) {
10884
10888
  const {
10885
10889
  encodedProduct,
10886
10890
  initSelected,
10891
+ initFilter,
10887
10892
  filter,
10888
10893
  productQuantity,
10889
10894
  setIsOnSubmittedOnTrue,
@@ -10908,7 +10913,8 @@ function ProductConfigurator(props) {
10908
10913
  });
10909
10914
  const methods = useForm({
10910
10915
  defaultValues: {
10911
- selected: initSelected
10916
+ selected: initSelected,
10917
+ filter: initFilter
10912
10918
  }
10913
10919
  });
10914
10920
  const {
@@ -10968,5 +10974,5 @@ function ProductConfigurator(props) {
10968
10974
  })
10969
10975
  });
10970
10976
  }
10971
- export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, index_esm as hookForm, useProductData };
10977
+ export { ContextType, MainView, ProductConfigurator, ProductKinds, ProductTypes, SelMinSelMaxStatus, getProductToChangeInForm, index_esm as hookForm, selectProductsInForm, unselectProductsInForm, useProductData, validateProductFilter };
10972
10978
  //# sourceMappingURL=index.es.js.map