@inappstory/slide-api 0.1.48 → 0.1.49
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.cjs +10 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20410,7 +20410,7 @@ class ProductDetailsPurchase extends RenderableComponent {
|
|
|
20410
20410
|
onAddToCartError: this.props.onAddToCartError,
|
|
20411
20411
|
translations: this.props.translations,
|
|
20412
20412
|
});
|
|
20413
|
-
return h("div", { class: "ias-product-details__purchase" }, h("div", { class: "ias-product-details__price-box" }, this.price.render(), this.counter.render()), this.action.render());
|
|
20413
|
+
return h("div", { class: "ias-product-details__purchase" }, h("div", { class: "ias-product-details__price-box" }, this.price.render(), this.props.isCartQuantityEnabled ? this.counter.render() : null), this.action.render());
|
|
20414
20414
|
}
|
|
20415
20415
|
updateProps(props) {
|
|
20416
20416
|
this.props = { ...this.props, ...props };
|
|
@@ -20810,6 +20810,7 @@ class ProductComponentsFactory {
|
|
|
20810
20810
|
},
|
|
20811
20811
|
translations: this.props.translations,
|
|
20812
20812
|
isCartSupported: params.isCartSupported,
|
|
20813
|
+
isCartQuantityEnabled: params.isCartQuantityEnabled,
|
|
20813
20814
|
onOpenUrl: () => {
|
|
20814
20815
|
if (params.product.url)
|
|
20815
20816
|
this.widgetDeps.slideApiDeps.openUrl({ type: "link", link: { type: "url", target: params.product.url } });
|
|
@@ -20914,12 +20915,12 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20914
20915
|
this.showProductDetails(params);
|
|
20915
20916
|
this.bottomSheet.open();
|
|
20916
20917
|
}
|
|
20917
|
-
showProductDetails = ({ offer, isCartSupported }) => {
|
|
20918
|
+
showProductDetails = ({ offer, isCartSupported, isCartQuantityEnabled, }) => {
|
|
20918
20919
|
const factory = new ProductComponentsFactory(this.widgetDeps, this.props);
|
|
20919
20920
|
const offerDtos = [offer, ...(offer.subOffersApi ?? [])];
|
|
20920
|
-
this.renderProductDetails({ factory, offer, offerDtos, isCartSupported });
|
|
20921
|
+
this.renderProductDetails({ factory, offer, offerDtos, isCartSupported, isCartQuantityEnabled });
|
|
20921
20922
|
};
|
|
20922
|
-
renderProductDetails({ factory, offer, offerDtos, isCartSupported, }) {
|
|
20923
|
+
renderProductDetails({ factory, offer, offerDtos, isCartSupported, isCartQuantityEnabled, }) {
|
|
20923
20924
|
const { product, relatedProducts } = this.getProductAndRelatedProducts(offer);
|
|
20924
20925
|
const productDetails = factory.createProductDetails({
|
|
20925
20926
|
product,
|
|
@@ -20933,6 +20934,7 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20933
20934
|
this.showProductCheckout();
|
|
20934
20935
|
},
|
|
20935
20936
|
isCartSupported,
|
|
20937
|
+
isCartQuantityEnabled,
|
|
20936
20938
|
});
|
|
20937
20939
|
this.updateBottomSheetContent(productDetails);
|
|
20938
20940
|
}
|
|
@@ -21551,9 +21553,10 @@ class WidgetProducts extends WidgetBase {
|
|
|
21551
21553
|
height: backgroundViewHeight + scrollViewGroupHeight,
|
|
21552
21554
|
});
|
|
21553
21555
|
const isCartEnabled = getTagData(this.element, "isCartEnabled") === "true";
|
|
21556
|
+
const isCartQuantityEnabled = !getTagData(this.element, "isCartQuantityEnabled") || getTagData(this.element, "isCartQuantityEnabled") === "true";
|
|
21554
21557
|
const isCartSupported = this.widgetDeps.slideApiDeps.isSdkSupportProductCart && isCartEnabled;
|
|
21555
21558
|
this.productsView.appendChild(bs.render());
|
|
21556
|
-
bs.open({ offer, isCartSupported });
|
|
21559
|
+
bs.open({ offer, isCartSupported, isCartQuantityEnabled });
|
|
21557
21560
|
};
|
|
21558
21561
|
createScrollView(offers) {
|
|
21559
21562
|
const scrollViewGroup = document.createElement("div");
|
|
@@ -21982,7 +21985,8 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21982
21985
|
showProductDetails = ({ offer, card }) => {
|
|
21983
21986
|
const bs = new ProductDetailsBottomSheet(this.widgetDeps, this.getBottomSheetParams());
|
|
21984
21987
|
this.mountBottomSheet(bs);
|
|
21985
|
-
|
|
21988
|
+
const isCartQuantityEnabled = !getTagData(this.element, "isCartQuantityEnabled") || getTagData(this.element, "isCartQuantityEnabled") === "true";
|
|
21989
|
+
bs.open({ offer, isCartSupported: this.isCartSupported(), isCartQuantityEnabled });
|
|
21986
21990
|
this.isBottomSheetOpened = true;
|
|
21987
21991
|
this.disableHostUIInteraction();
|
|
21988
21992
|
};
|