@orderingstack/front-components-product-configurator 1.4.2-beta.31 → 1.4.2-beta.33
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/components/ProductConfigurator/useProductConfigurator.d.ts +1 -0
- package/dist/components/ProductConfigurator/useProductConfigurator.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 +11 -10
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6839,7 +6839,7 @@ function useProductConfigurator(product) {
|
|
|
6839
6839
|
const setIsOnSubmittedOnTrue = useStore(
|
|
6840
6840
|
(state) => state.setIsOnSubmittedOnTrue
|
|
6841
6841
|
);
|
|
6842
|
-
useStore((state) => state.refreshFormDt);
|
|
6842
|
+
const refreshFormDt = useStore((state) => state.refreshFormDt);
|
|
6843
6843
|
const getInvalidSelCtxArray = useStore((state) => state.getInvalidSelCtxArray);
|
|
6844
6844
|
const getValidationMap = useStore((state) => state.getValidationMap);
|
|
6845
6845
|
const increaseProductQuantity = () => {
|
|
@@ -6867,7 +6867,8 @@ function useProductConfigurator(product) {
|
|
|
6867
6867
|
productQuantity,
|
|
6868
6868
|
getValidationMap,
|
|
6869
6869
|
increaseProductQuantity,
|
|
6870
|
-
decreaseProductQuantity
|
|
6870
|
+
decreaseProductQuantity,
|
|
6871
|
+
refreshFormDt
|
|
6871
6872
|
};
|
|
6872
6873
|
}
|
|
6873
6874
|
const validateProductFilter = (product, stateFilter) => {
|
|
@@ -9119,19 +9120,19 @@ function useMenuProduct(product, parentAttrs, nestedLvl, parentPriduct) {
|
|
|
9119
9120
|
const {
|
|
9120
9121
|
target: { checked, name: selCtx2, defaultValue: productId }
|
|
9121
9122
|
} = e2;
|
|
9122
|
-
const otherGroupItems = (_a2 = parentPriduct == null ? void 0 : parentPriduct.items) == null ? void 0 : _a2.filter((x2) => x2.id !== product.id);
|
|
9123
|
-
for (const key of Object.keys(selected || {})) {
|
|
9124
|
-
const isItemToClear = (otherGroupItems == null ? void 0 : otherGroupItems.some((x2) => !!findProductInParentProductBySelCtx(x2, key))) ? key : false;
|
|
9125
|
-
console.log("isImportantItem", isItemToClear);
|
|
9126
|
-
if (isItemToClear) {
|
|
9127
|
-
setValue(`selected.${key}`, false);
|
|
9128
|
-
}
|
|
9129
|
-
}
|
|
9130
9123
|
selectUnselectProduct(setValue, getValues, product, checked, unregister, nestedLvl);
|
|
9131
9124
|
if (isRadio) {
|
|
9132
9125
|
console.log("handleOnInputChange radio", selCtx2, productId);
|
|
9133
9126
|
const selectedContextName = "selected." + selCtx2.replace("radio.", "").split(".")[0];
|
|
9134
9127
|
setValue(selectedContextName, { [productId]: "1" });
|
|
9128
|
+
const otherGroupItems = (_a2 = parentPriduct == null ? void 0 : parentPriduct.items) == null ? void 0 : _a2.filter((x2) => x2.id !== product.id);
|
|
9129
|
+
for (const key of Object.keys(selected || {})) {
|
|
9130
|
+
const isItemToClear = (otherGroupItems == null ? void 0 : otherGroupItems.some((x2) => !!findProductInParentProductBySelCtx(x2, key))) ? key : false;
|
|
9131
|
+
console.log("isImportantItem", isItemToClear);
|
|
9132
|
+
if (isItemToClear) {
|
|
9133
|
+
setValue(`selected.${key}`, false);
|
|
9134
|
+
}
|
|
9135
|
+
}
|
|
9135
9136
|
refreshForm();
|
|
9136
9137
|
}
|
|
9137
9138
|
};
|