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