@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.js
CHANGED
|
@@ -20408,7 +20408,7 @@ class ProductDetailsPurchase extends RenderableComponent {
|
|
|
20408
20408
|
onAddToCartError: this.props.onAddToCartError,
|
|
20409
20409
|
translations: this.props.translations,
|
|
20410
20410
|
});
|
|
20411
|
-
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());
|
|
20411
|
+
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());
|
|
20412
20412
|
}
|
|
20413
20413
|
updateProps(props) {
|
|
20414
20414
|
this.props = { ...this.props, ...props };
|
|
@@ -20808,6 +20808,7 @@ class ProductComponentsFactory {
|
|
|
20808
20808
|
},
|
|
20809
20809
|
translations: this.props.translations,
|
|
20810
20810
|
isCartSupported: params.isCartSupported,
|
|
20811
|
+
isCartQuantityEnabled: params.isCartQuantityEnabled,
|
|
20811
20812
|
onOpenUrl: () => {
|
|
20812
20813
|
if (params.product.url)
|
|
20813
20814
|
this.widgetDeps.slideApiDeps.openUrl({ type: "link", link: { type: "url", target: params.product.url } });
|
|
@@ -20912,12 +20913,12 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20912
20913
|
this.showProductDetails(params);
|
|
20913
20914
|
this.bottomSheet.open();
|
|
20914
20915
|
}
|
|
20915
|
-
showProductDetails = ({ offer, isCartSupported }) => {
|
|
20916
|
+
showProductDetails = ({ offer, isCartSupported, isCartQuantityEnabled, }) => {
|
|
20916
20917
|
const factory = new ProductComponentsFactory(this.widgetDeps, this.props);
|
|
20917
20918
|
const offerDtos = [offer, ...(offer.subOffersApi ?? [])];
|
|
20918
|
-
this.renderProductDetails({ factory, offer, offerDtos, isCartSupported });
|
|
20919
|
+
this.renderProductDetails({ factory, offer, offerDtos, isCartSupported, isCartQuantityEnabled });
|
|
20919
20920
|
};
|
|
20920
|
-
renderProductDetails({ factory, offer, offerDtos, isCartSupported, }) {
|
|
20921
|
+
renderProductDetails({ factory, offer, offerDtos, isCartSupported, isCartQuantityEnabled, }) {
|
|
20921
20922
|
const { product, relatedProducts } = this.getProductAndRelatedProducts(offer);
|
|
20922
20923
|
const productDetails = factory.createProductDetails({
|
|
20923
20924
|
product,
|
|
@@ -20931,6 +20932,7 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20931
20932
|
this.showProductCheckout();
|
|
20932
20933
|
},
|
|
20933
20934
|
isCartSupported,
|
|
20935
|
+
isCartQuantityEnabled,
|
|
20934
20936
|
});
|
|
20935
20937
|
this.updateBottomSheetContent(productDetails);
|
|
20936
20938
|
}
|
|
@@ -21549,9 +21551,10 @@ class WidgetProducts extends WidgetBase {
|
|
|
21549
21551
|
height: backgroundViewHeight + scrollViewGroupHeight,
|
|
21550
21552
|
});
|
|
21551
21553
|
const isCartEnabled = getTagData(this.element, "isCartEnabled") === "true";
|
|
21554
|
+
const isCartQuantityEnabled = !getTagData(this.element, "isCartQuantityEnabled") || getTagData(this.element, "isCartQuantityEnabled") === "true";
|
|
21552
21555
|
const isCartSupported = this.widgetDeps.slideApiDeps.isSdkSupportProductCart && isCartEnabled;
|
|
21553
21556
|
this.productsView.appendChild(bs.render());
|
|
21554
|
-
bs.open({ offer, isCartSupported });
|
|
21557
|
+
bs.open({ offer, isCartSupported, isCartQuantityEnabled });
|
|
21555
21558
|
};
|
|
21556
21559
|
createScrollView(offers) {
|
|
21557
21560
|
const scrollViewGroup = document.createElement("div");
|
|
@@ -21980,7 +21983,8 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21980
21983
|
showProductDetails = ({ offer, card }) => {
|
|
21981
21984
|
const bs = new ProductDetailsBottomSheet(this.widgetDeps, this.getBottomSheetParams());
|
|
21982
21985
|
this.mountBottomSheet(bs);
|
|
21983
|
-
|
|
21986
|
+
const isCartQuantityEnabled = !getTagData(this.element, "isCartQuantityEnabled") || getTagData(this.element, "isCartQuantityEnabled") === "true";
|
|
21987
|
+
bs.open({ offer, isCartSupported: this.isCartSupported(), isCartQuantityEnabled });
|
|
21984
21988
|
this.isBottomSheetOpened = true;
|
|
21985
21989
|
this.disableHostUIInteraction();
|
|
21986
21990
|
};
|