@orderingstack/front-components-product-configurator 1.4.2-beta.1 → 1.4.2-beta.2
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/MenuProduct/useMenuProduct.d.ts.map +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +13 -0
- package/dist/index.es.js.map +1 -1
- package/dist/utils/setSelected.d.ts +1 -0
- package/dist/utils/setSelected.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -8913,6 +8913,19 @@ function useMenuProduct(product, parentAttrs) {
|
|
|
8913
8913
|
setValue(`selected.${selCtx}.${id}`, `${decrementedValue}`);
|
|
8914
8914
|
if (isCheckbox && decrementedValue === 0) {
|
|
8915
8915
|
setValue(`selected.${selCtx}.${id}`, false);
|
|
8916
|
+
const checkSubProducts = (items) => {
|
|
8917
|
+
if (!Array.isArray(items))
|
|
8918
|
+
return;
|
|
8919
|
+
items.map((product2) => {
|
|
8920
|
+
const { selCtx: selCtx2 } = product2;
|
|
8921
|
+
const changedSelCtx = getValues(`selected.${selCtx2}`);
|
|
8922
|
+
if (changedSelCtx) {
|
|
8923
|
+
removeProductFromState(selCtx2, getValues, setValue);
|
|
8924
|
+
}
|
|
8925
|
+
checkSubProducts(product2.items);
|
|
8926
|
+
});
|
|
8927
|
+
};
|
|
8928
|
+
checkSubProducts(product.items);
|
|
8916
8929
|
}
|
|
8917
8930
|
};
|
|
8918
8931
|
const handleOnInputChange = (e2) => {
|