@inappstory/slide-api 0.1.47 → 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 +13 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6785,12 +6785,13 @@ class Slider {
|
|
|
6785
6785
|
return Promise.resolve();
|
|
6786
6786
|
return new Promise(resolve => {
|
|
6787
6787
|
const handler = (e) => {
|
|
6788
|
-
if (e.propertyName === "transform") {
|
|
6788
|
+
if (e.target === sliderTrack && e.propertyName === "transform") {
|
|
6789
|
+
sliderTrack.removeEventListener("transitionend", handler);
|
|
6789
6790
|
sliderTrack.style.transitionDuration = "0ms";
|
|
6790
6791
|
resolve();
|
|
6791
6792
|
}
|
|
6792
6793
|
};
|
|
6793
|
-
sliderTrack.addEventListener("transitionend", handler
|
|
6794
|
+
sliderTrack.addEventListener("transitionend", handler);
|
|
6794
6795
|
});
|
|
6795
6796
|
}
|
|
6796
6797
|
destroy() {
|
|
@@ -20409,7 +20410,7 @@ class ProductDetailsPurchase extends RenderableComponent {
|
|
|
20409
20410
|
onAddToCartError: this.props.onAddToCartError,
|
|
20410
20411
|
translations: this.props.translations,
|
|
20411
20412
|
});
|
|
20412
|
-
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());
|
|
20413
20414
|
}
|
|
20414
20415
|
updateProps(props) {
|
|
20415
20416
|
this.props = { ...this.props, ...props };
|
|
@@ -20809,6 +20810,7 @@ class ProductComponentsFactory {
|
|
|
20809
20810
|
},
|
|
20810
20811
|
translations: this.props.translations,
|
|
20811
20812
|
isCartSupported: params.isCartSupported,
|
|
20813
|
+
isCartQuantityEnabled: params.isCartQuantityEnabled,
|
|
20812
20814
|
onOpenUrl: () => {
|
|
20813
20815
|
if (params.product.url)
|
|
20814
20816
|
this.widgetDeps.slideApiDeps.openUrl({ type: "link", link: { type: "url", target: params.product.url } });
|
|
@@ -20913,12 +20915,12 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20913
20915
|
this.showProductDetails(params);
|
|
20914
20916
|
this.bottomSheet.open();
|
|
20915
20917
|
}
|
|
20916
|
-
showProductDetails = ({ offer, isCartSupported }) => {
|
|
20918
|
+
showProductDetails = ({ offer, isCartSupported, isCartQuantityEnabled, }) => {
|
|
20917
20919
|
const factory = new ProductComponentsFactory(this.widgetDeps, this.props);
|
|
20918
20920
|
const offerDtos = [offer, ...(offer.subOffersApi ?? [])];
|
|
20919
|
-
this.renderProductDetails({ factory, offer, offerDtos, isCartSupported });
|
|
20921
|
+
this.renderProductDetails({ factory, offer, offerDtos, isCartSupported, isCartQuantityEnabled });
|
|
20920
20922
|
};
|
|
20921
|
-
renderProductDetails({ factory, offer, offerDtos, isCartSupported, }) {
|
|
20923
|
+
renderProductDetails({ factory, offer, offerDtos, isCartSupported, isCartQuantityEnabled, }) {
|
|
20922
20924
|
const { product, relatedProducts } = this.getProductAndRelatedProducts(offer);
|
|
20923
20925
|
const productDetails = factory.createProductDetails({
|
|
20924
20926
|
product,
|
|
@@ -20932,6 +20934,7 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20932
20934
|
this.showProductCheckout();
|
|
20933
20935
|
},
|
|
20934
20936
|
isCartSupported,
|
|
20937
|
+
isCartQuantityEnabled,
|
|
20935
20938
|
});
|
|
20936
20939
|
this.updateBottomSheetContent(productDetails);
|
|
20937
20940
|
}
|
|
@@ -21550,9 +21553,10 @@ class WidgetProducts extends WidgetBase {
|
|
|
21550
21553
|
height: backgroundViewHeight + scrollViewGroupHeight,
|
|
21551
21554
|
});
|
|
21552
21555
|
const isCartEnabled = getTagData(this.element, "isCartEnabled") === "true";
|
|
21556
|
+
const isCartQuantityEnabled = !getTagData(this.element, "isCartQuantityEnabled") || getTagData(this.element, "isCartQuantityEnabled") === "true";
|
|
21553
21557
|
const isCartSupported = this.widgetDeps.slideApiDeps.isSdkSupportProductCart && isCartEnabled;
|
|
21554
21558
|
this.productsView.appendChild(bs.render());
|
|
21555
|
-
bs.open({ offer, isCartSupported });
|
|
21559
|
+
bs.open({ offer, isCartSupported, isCartQuantityEnabled });
|
|
21556
21560
|
};
|
|
21557
21561
|
createScrollView(offers) {
|
|
21558
21562
|
const scrollViewGroup = document.createElement("div");
|
|
@@ -21981,7 +21985,8 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21981
21985
|
showProductDetails = ({ offer, card }) => {
|
|
21982
21986
|
const bs = new ProductDetailsBottomSheet(this.widgetDeps, this.getBottomSheetParams());
|
|
21983
21987
|
this.mountBottomSheet(bs);
|
|
21984
|
-
|
|
21988
|
+
const isCartQuantityEnabled = !getTagData(this.element, "isCartQuantityEnabled") || getTagData(this.element, "isCartQuantityEnabled") === "true";
|
|
21989
|
+
bs.open({ offer, isCartSupported: this.isCartSupported(), isCartQuantityEnabled });
|
|
21985
21990
|
this.isBottomSheetOpened = true;
|
|
21986
21991
|
this.disableHostUIInteraction();
|
|
21987
21992
|
};
|