@orderingstack/front-components-product-configurator 1.5.1-beta.3 → 1.5.1-beta.4

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
@@ -6926,18 +6926,29 @@ const selectProductsInForm = (productToSelect, setValueInForm, initialSelectedSt
6926
6926
  });
6927
6927
  };
6928
6928
  function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
6929
+ const { selCtx, attrs = {} } = product;
6929
6930
  const initialSelected = useStore((state) => state.initialSelected);
6930
6931
  const currency = useStore((state) => state.currency);
6931
6932
  const { setValue, getValues } = useFormContext();
6932
6933
  const { selected = {}, filter = {} } = getValues();
6933
6934
  const isFilterValidated = validateProductFilter(product, filter);
6934
6935
  const isOnSubmitted = useStore((state) => state.isOnSubmitted);
6935
- useStore((state) => state.setValidationMap);
6936
+ const setValidationMap = useStore((state) => state.setValidationMap);
6936
6937
  const [selCnt, qtyCnt] = getSelCtxCntFromSelectedState(
6937
6938
  product.selCtx,
6938
6939
  selected,
6939
6940
  product.items
6940
6941
  );
6942
+ setValidationMap({
6943
+ productSelCtx: selCtx,
6944
+ attrs,
6945
+ actualQtyCnt: qtyCnt,
6946
+ actualSelCnt: selCnt,
6947
+ nestedLvl,
6948
+ isPassedFiltering: isFilterValidated,
6949
+ parentSelCtx,
6950
+ parentKind
6951
+ });
6941
6952
  useEffect(() => {
6942
6953
  const { productsToSelect, productsToUnselect } = getProductToChangeInForm(
6943
6954
  product,
@@ -8574,7 +8585,7 @@ const MenuOptions = (props) => {
8574
8585
  selCnt,
8575
8586
  qtyCnt,
8576
8587
  currency
8577
- } = useMenuOptions(optionsItem);
8588
+ } = useMenuOptions(optionsItem, nestedLvl, parentKind, parentSelCtx);
8578
8589
  const {
8579
8590
  MenuOptionsUI
8580
8591
  } = useComponents();