@zonos/elements 1.3.84 → 1.3.85
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/cjs/{cart-a06f18e2.js → cart-fc426d98.js} +86 -141
- package/dist/cjs/{createCustomEvent-8d9cf9ac.js → createCustomEvent-354c8e63.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-078f3cef.js → paypal-1fe5ed0c.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +30 -13
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +12 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +2 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -2
- package/dist/collection/components/store/checkout/stripe.js +1 -0
- package/dist/collection/components/store/hello/localization.js +1 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +4 -7
- package/dist/collection/components/store/translationStore/strings.base.js +4 -7
- package/dist/collection/components/store/translationStore/strings.chinese.js +4 -7
- package/dist/collection/components/store/translationStore/strings.danish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.dutch.js +4 -7
- package/dist/collection/components/store/translationStore/strings.french.js +4 -7
- package/dist/collection/components/store/translationStore/strings.german.js +4 -7
- package/dist/collection/components/store/translationStore/strings.hebrew.js +4 -7
- package/dist/collection/components/store/translationStore/strings.indonesian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.italian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.japanese.js +4 -7
- package/dist/collection/components/store/translationStore/strings.korean.js +4 -7
- package/dist/collection/components/store/translationStore/strings.norwegian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.polish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.portuguese.js +4 -7
- package/dist/collection/components/store/translationStore/strings.russian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.spanish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.swedish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.turkish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +4 -7
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -2
- package/dist/collection/components/utils/getContrastColor.js +8 -3
- package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
- package/dist/esm/{cart-40e0d619.js → cart-6c44367a.js} +86 -141
- package/dist/esm/{createCustomEvent-1f615c82.js → createCustomEvent-ec15a4a7.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-a45fb0bb.js → paypal-a562a640.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +30 -13
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +4 -4
- package/dist/esm-es5/cart-6c44367a.js +1 -0
- package/dist/esm-es5/{createCustomEvent-1f615c82.js → createCustomEvent-ec15a4a7.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-a45fb0bb.js → paypal-a562a640.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.base.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.danish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.french.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.german.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.italian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.korean.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.polish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.russian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +2 -5
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-60c543e7.entry.js → p-01604d44.entry.js} +1 -1
- package/dist/zonos-elements/{p-47d5a081.system.js → p-08fee913.system.js} +1 -1
- package/dist/zonos-elements/{p-e2adfe87.system.js → p-092961f1.system.js} +1 -1
- package/dist/zonos-elements/{p-78ca17aa.system.entry.js → p-133595ff.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d325c13.system.entry.js → p-1eb59b7c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c224f43a.system.entry.js → p-35b6b151.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c3314b3b.entry.js → p-3b3cb2a4.entry.js} +1 -1
- package/dist/zonos-elements/{p-ba10b830.entry.js → p-51e2df70.entry.js} +1 -1
- package/dist/zonos-elements/{p-e563eb3f.entry.js → p-5ba198b3.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac6562c7.system.entry.js → p-5ebde561.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ec8ff301.system.entry.js → p-63a33354.system.entry.js} +1 -1
- package/dist/zonos-elements/p-64b67900.entry.js +1 -0
- package/dist/zonos-elements/p-6b7fa35e.system.js +1 -0
- package/dist/zonos-elements/{p-1348c46d.js → p-710ac059.js} +1 -1
- package/dist/zonos-elements/{p-b1381434.system.entry.js → p-76013796.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5ef15d65.system.entry.js → p-7b4a5b9b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-181de82e.entry.js → p-95241447.entry.js} +1 -1
- package/dist/zonos-elements/p-a26a8ca5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-019b202c.entry.js → p-a858a304.entry.js} +1 -1
- package/dist/zonos-elements/{p-0a15de43.entry.js → p-b5316c2c.entry.js} +1 -1
- package/dist/zonos-elements/{p-3d9a0e52.system.js → p-b9645c27.system.js} +1 -1
- package/dist/zonos-elements/{p-7096814b.system.entry.js → p-c37b99dd.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-b39b794a.js → p-cbb742ab.js} +1 -1
- package/dist/zonos-elements/{p-9367aeca.system.entry.js → p-d7b341e3.system.entry.js} +1 -1
- package/dist/zonos-elements/p-de6c2a4a.entry.js +1 -0
- package/dist/zonos-elements/{p-9013751a.entry.js → p-e78c2429.entry.js} +1 -1
- package/dist/zonos-elements/p-ee8b5e53.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-40e0d619.js +0 -1
- package/dist/zonos-elements/p-189a2cae.entry.js +0 -1
- package/dist/zonos-elements/p-c1fbe220.js +0 -1
- package/dist/zonos-elements/p-d043cf10.system.entry.js +0 -1
- package/dist/zonos-elements/p-d31368f1.entry.js +0 -1
- package/dist/zonos-elements/p-e6f2948c.system.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
100
|
-
const cdnUrl = "https://v1.3.
|
|
100
|
+
const cdnUrl = "https://v1.3.85.js.zonos.com";
|
|
101
101
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
102
102
|
if (!qaUrl &&
|
|
103
103
|
(cdnUrl.includes('test.') ||
|
|
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
|
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
})();
|
|
284
|
-
const ZONOS_URL = "https://v1.3.
|
|
285
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
286
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
287
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
284
|
+
const ZONOS_URL = "https://v1.3.85.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.85";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.85";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.85";
|
|
288
288
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
289
289
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
290
290
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
299
299
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
300
300
|
Zonos._paypalMockResponse = null;
|
|
301
301
|
Zonos.isBigCommerce = false;
|
|
302
|
-
Zonos.releaseDate = "
|
|
302
|
+
Zonos.releaseDate = "1728761799096";
|
|
303
303
|
Zonos.isLegacyCheckout = false;
|
|
304
304
|
/**
|
|
305
305
|
* By default, the package will load from npm
|
|
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
307
307
|
Zonos.isNpm = true;
|
|
308
308
|
Zonos.zonosQaUrl = null;
|
|
309
309
|
Zonos.zonosQaUrlApi = null;
|
|
310
|
-
Zonos.version = `v${"1.3.
|
|
310
|
+
Zonos.version = `v${"1.3.85"}`;
|
|
311
311
|
Zonos.modeAlerted = false;
|
|
312
312
|
Zonos.cartData = null;
|
|
313
313
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-fc426d98.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-1fe5ed0c.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
10
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
10
|
+
const createCustomEvent = require('./createCustomEvent-354c8e63.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-5a64574c.js');
|
|
12
12
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -31,11 +31,13 @@ const ZonosCartItems = class {
|
|
|
31
31
|
const nonRestrictedItems = cart.cartStore.items.filter(item => !item.isRestricted);
|
|
32
32
|
return (index.h(index.Host, { key: '7bdf8d1972edb2d11669441b3d8ec6643fca1f4b', class: "zonos--cart-items zonos--elements" }, index.h("table", { key: '1c2fe6d444ea93e40b981a8935d16192bf61928c', class: "zonos--cart-table" }, index.h("tbody", { key: '84279bea6821077bf117a7a13ca497155276c622' }, nonRestrictedItems.map(item => {
|
|
33
33
|
const itemImg = item.imageUrl;
|
|
34
|
+
// Split the name by <br> tag
|
|
35
|
+
const namesWithNewLine = item.name.split(/<br\s*\/*>/);
|
|
34
36
|
return (index.h("tr", { class: "zonos--cart-item" }, index.h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (index.h("img", { alt: item.name, onError: () => {
|
|
35
37
|
this.errorImages = [...this.errorImages, itemImg];
|
|
36
38
|
}, src: item.imageUrl, style: {
|
|
37
39
|
'min-width': '40px',
|
|
38
|
-
}, width: 40 })) : (index.h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), index.h("td", { class: "zonos--column zonos--cart-item-name" }, index.h("zonos-text", { type: "label" },
|
|
40
|
+
}, width: 40 })) : (index.h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), index.h("td", { class: "zonos--column zonos--cart-item-name" }, index.h("div", null, namesWithNewLine.map(name => (index.h("zonos-text", { type: "label" }, name)))), index.h("zonos-text", { textColor: "gray-600", type: "caption" }, cart.translate('Quantity'), ": ", item.quantity)), index.h("td", { class: "zonos--column zonos--cart-item-price" }, index.h("zonos-text", { type: "semiBoldLabel", weight: 600 }, cart.currencyFormat({
|
|
39
41
|
amount: item.amount * rate * item.quantity,
|
|
40
42
|
currency: cart.cartStore.currency,
|
|
41
43
|
})))));
|
|
@@ -540,6 +542,7 @@ const ZonosCheckoutPayment = class {
|
|
|
540
542
|
this.showErrorBanner = false;
|
|
541
543
|
}
|
|
542
544
|
render() {
|
|
545
|
+
var _a;
|
|
543
546
|
if (!cart.stripeStore.stripeElements) {
|
|
544
547
|
return null;
|
|
545
548
|
}
|
|
@@ -549,16 +552,24 @@ const ZonosCheckoutPayment = class {
|
|
|
549
552
|
}
|
|
550
553
|
const isTestMode = createCustomEvent.getIsTestMode();
|
|
551
554
|
const hasPaypalEnabled = paypal.paypalStoreHasPaypalEnabled();
|
|
552
|
-
|
|
555
|
+
const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
556
|
+
return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
|
|
557
|
+
if (!hasPaypalEnabled) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
this.continueClickHandler();
|
|
561
|
+
}, size: "lg",
|
|
553
562
|
// use primary type when on mobile mode
|
|
554
563
|
variant: this.submitBtnType }, cart.translate('Pay [orderTotal]', {
|
|
555
564
|
orderTotal: cart.currencyFormat({
|
|
556
565
|
amount: cart.cartStore.total,
|
|
557
566
|
currency: cart.cartStore.currency,
|
|
558
567
|
}),
|
|
559
|
-
}))
|
|
568
|
+
}))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
560
569
|
this.paypalSessionDone.emit(orderId);
|
|
561
|
-
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit()
|
|
570
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
571
|
+
display: isPaypalTabSelected ? 'block' : 'none',
|
|
572
|
+
} })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, cart.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, cart.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, cart.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, cart.translate('Failure'), " (****0002)")), index.h("zonos-notification", null))))));
|
|
562
573
|
}
|
|
563
574
|
};
|
|
564
575
|
ZonosCheckoutPayment.style = ZonosCheckoutPaymentStyle0;
|
|
@@ -576,9 +587,14 @@ const getContrastColor = ({ backgroundColor, color, }) => {
|
|
|
576
587
|
if (isDarkColor.isDarkColor(color)) {
|
|
577
588
|
return '#ffffff';
|
|
578
589
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
590
|
+
const newDarkerColor = isDarkColor.tinycolor(color).darken(25).toHexString();
|
|
591
|
+
const newLigherColor = isDarkColor.tinycolor(color).lighten(25).toHexString();
|
|
592
|
+
// get readibility of the color
|
|
593
|
+
const isNewColorContrastEnough = paypal.isContrastColor({
|
|
594
|
+
backgroundColor1: backgroundColor,
|
|
595
|
+
backgroundColor2: newDarkerColor,
|
|
596
|
+
});
|
|
597
|
+
return isNewColorContrastEnough ? newDarkerColor : newLigherColor;
|
|
582
598
|
};
|
|
583
599
|
|
|
584
600
|
const TabCheckmark = `<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1069,7 +1085,7 @@ const ChevronUpIcon = `<svg width="25" height="24" viewBox="0 0 25 24" fill="non
|
|
|
1069
1085
|
</svg>
|
|
1070
1086
|
`;
|
|
1071
1087
|
|
|
1072
|
-
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:
|
|
1088
|
+
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;z-index:1;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:transparent;width:100%;border:none;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping{margin-bottom:0}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::before,.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::after{content:\"\";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping .zonos--title-wrapper.sc-zonos-shipping{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}.sc-zonos-shipping-h .zonos--dap-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}";
|
|
1073
1089
|
const ZonosShippingStyle0 = zonosShippingCss;
|
|
1074
1090
|
|
|
1075
1091
|
const ZonosShipping = class {
|
|
@@ -1212,12 +1228,13 @@ const ZonosShipping = class {
|
|
|
1212
1228
|
if (this.showErrorBanner) {
|
|
1213
1229
|
this.showErrorBanner = !this.handleValidate();
|
|
1214
1230
|
}
|
|
1215
|
-
return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }),
|
|
1231
|
+
return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), (!!this.serviceLevelsDAP.length ||
|
|
1232
|
+
!defaultShownServiceLevels.length) && (index.h("button", { class: classes.classes([
|
|
1216
1233
|
'zonos--shipping-options-collapse-trigger',
|
|
1217
1234
|
this.collapsedDAPOptions && 'collapsed',
|
|
1218
1235
|
]), onClick: () => {
|
|
1219
1236
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
1220
|
-
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non
|
|
1237
|
+
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: 'fdc7807bc26ec718cb51e23dbb9e4ccf286e6d91', class: "zonos--group-btn" }, index.h("zonos-button", { key: '7f1f43317f4734333df48bd244d0bf44f4cd252e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
1221
1238
|
// use primary type when on mobile mode
|
|
1222
1239
|
variant: this.submitBtnType }, cart.translate('Go to payment'))))));
|
|
1223
1240
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
|
+
const paypal = require('./paypal-1fe5ed0c.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
9
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
9
|
+
const createCustomEvent = require('./createCustomEvent-354c8e63.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
12
12
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-fc426d98.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fc426d98.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-fc426d98.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
|
-
const paypal = require('./paypal-
|
|
10
|
+
const paypal = require('./paypal-1fe5ed0c.js');
|
|
11
11
|
require('./isDarkColor-5efc8367.js');
|
|
12
12
|
require('./getBorderRadius-5a64574c.js');
|
|
13
13
|
|
|
@@ -91,7 +91,7 @@ const ZonosPayment = class {
|
|
|
91
91
|
// Create and mount the Authentication Element in ${type} mode
|
|
92
92
|
const paymentElement = cart.stripeStore.stripePaymentElement ||
|
|
93
93
|
this.stripeElements.create('payment', {
|
|
94
|
-
layout: '
|
|
94
|
+
layout: 'tabs',
|
|
95
95
|
});
|
|
96
96
|
const paymentElementContainer = this.el.querySelector('.zonos--payment-component');
|
|
97
97
|
if (!paymentElementContainer) {
|
|
@@ -110,7 +110,7 @@ const ZonosPayment = class {
|
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
112
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
113
|
-
return (index.h(index.Host, { key: '
|
|
113
|
+
return (index.h(index.Host, { key: 'cf616ec959fd1b7396ed86b23561f459e0da8722', class: "zonos--payment zonos--elements" }, this.titleText && (index.h("zonos-text", { key: 'e5564db71ba2c0d67d372cb1804d6d462cdf1b33', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("div", { key: '3ea47f2c0a541590210d181bc73ecb3fb27e7783', class: "zonos--payment-component" }), index.h("div", { key: 'd3a46a127448568caf4309806e88556594075c12', class: "zonos--payment-paypal-container" })));
|
|
114
114
|
}
|
|
115
115
|
get el() { return index.getElement(this); }
|
|
116
116
|
static get watchers() { return {
|
package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js
CHANGED
|
@@ -13,11 +13,13 @@ export class ZonosCartItems {
|
|
|
13
13
|
const nonRestrictedItems = cartStore.items.filter(item => !item.isRestricted);
|
|
14
14
|
return (h(Host, { key: '7bdf8d1972edb2d11669441b3d8ec6643fca1f4b', class: "zonos--cart-items zonos--elements" }, h("table", { key: '1c2fe6d444ea93e40b981a8935d16192bf61928c', class: "zonos--cart-table" }, h("tbody", { key: '84279bea6821077bf117a7a13ca497155276c622' }, nonRestrictedItems.map(item => {
|
|
15
15
|
const itemImg = item.imageUrl;
|
|
16
|
+
// Split the name by <br> tag
|
|
17
|
+
const namesWithNewLine = item.name.split(/<br\s*\/*>/);
|
|
16
18
|
return (h("tr", { class: "zonos--cart-item" }, h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (h("img", { alt: item.name, onError: () => {
|
|
17
19
|
this.errorImages = [...this.errorImages, itemImg];
|
|
18
20
|
}, src: item.imageUrl, style: {
|
|
19
21
|
'min-width': '40px',
|
|
20
|
-
}, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label" },
|
|
22
|
+
}, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("div", null, namesWithNewLine.map(name => (h("zonos-text", { type: "label" }, name)))), h("zonos-text", { textColor: "gray-600", type: "caption" }, translate('Quantity'), ": ", item.quantity)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel", weight: 600 }, currencyFormat({
|
|
21
23
|
amount: item.amount * rate * item.quantity,
|
|
22
24
|
currency: cartStore.currency,
|
|
23
25
|
})))));
|
|
@@ -42,6 +42,7 @@ export class ZonosCheckoutPayment {
|
|
|
42
42
|
this.showErrorBanner = false;
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
+
var _a;
|
|
45
46
|
if (!stripeStore.stripeElements) {
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
@@ -51,16 +52,24 @@ export class ZonosCheckoutPayment {
|
|
|
51
52
|
}
|
|
52
53
|
const isTestMode = getIsTestMode();
|
|
53
54
|
const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
|
|
54
|
-
|
|
55
|
+
const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
56
|
+
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
|
|
57
|
+
if (!hasPaypalEnabled) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.continueClickHandler();
|
|
61
|
+
}, size: "lg",
|
|
55
62
|
// use primary type when on mobile mode
|
|
56
63
|
variant: this.submitBtnType }, translate('Pay [orderTotal]', {
|
|
57
64
|
orderTotal: currencyFormat({
|
|
58
65
|
amount: cartStore.total,
|
|
59
66
|
currency: cartStore.currency,
|
|
60
67
|
}),
|
|
61
|
-
}))
|
|
68
|
+
}))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
62
69
|
this.paypalSessionDone.emit(orderId);
|
|
63
|
-
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit()
|
|
70
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
71
|
+
display: isPaypalTabSelected ? 'block' : 'none',
|
|
72
|
+
} })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
|
|
64
73
|
}
|
|
65
74
|
static get is() { return "zonos-checkout-payment"; }
|
|
66
75
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css
CHANGED
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
display: flex;
|
|
78
78
|
justify-content: center;
|
|
79
79
|
bottom: 0;
|
|
80
|
+
z-index: 1;
|
|
80
81
|
margin-top: 12px;
|
|
81
82
|
background: var(--primary-color, var(--zonos-elements-gray-0));
|
|
82
83
|
}
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
flex-direction: row;
|
|
94
95
|
gap: 24px;
|
|
95
96
|
align-items: center;
|
|
96
|
-
background:
|
|
97
|
+
background: transparent;
|
|
97
98
|
width: 100%;
|
|
98
99
|
border: none;
|
|
99
100
|
cursor: pointer;
|
|
@@ -146,12 +146,13 @@ export class ZonosShipping {
|
|
|
146
146
|
if (this.showErrorBanner) {
|
|
147
147
|
this.showErrorBanner = !this.handleValidate();
|
|
148
148
|
}
|
|
149
|
-
return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }),
|
|
149
|
+
return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), (!!this.serviceLevelsDAP.length ||
|
|
150
|
+
!defaultShownServiceLevels.length) && (h("button", { class: classes([
|
|
150
151
|
'zonos--shipping-options-collapse-trigger',
|
|
151
152
|
this.collapsedDAPOptions && 'collapsed',
|
|
152
153
|
]), onClick: () => {
|
|
153
154
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
154
|
-
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non
|
|
155
|
+
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: 'fdc7807bc26ec718cb51e23dbb9e4ccf286e6d91', class: "zonos--group-btn" }, h("zonos-button", { key: '7f1f43317f4734333df48bd244d0bf44f4cd252e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
155
156
|
// use primary type when on mobile mode
|
|
156
157
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
157
158
|
}
|
|
@@ -210,7 +210,7 @@ const initLocalizationStore = async () => {
|
|
|
210
210
|
if (!localizationStore.selectedCountryCode &&
|
|
211
211
|
devSites.some(site => window.location.origin.includes(site))) {
|
|
212
212
|
// update selected country code in store
|
|
213
|
-
localizationStoreUpdateSelectedCountryCode('
|
|
213
|
+
localizationStoreUpdateSelectedCountryCode('CA');
|
|
214
214
|
}
|
|
215
215
|
localizationStore.localizationLoaded = true;
|
|
216
216
|
};
|
|
@@ -137,8 +137,8 @@ export const stringsArabic = {
|
|
|
137
137
|
Hide: {
|
|
138
138
|
value: 'اخفِ',
|
|
139
139
|
},
|
|
140
|
-
'Hide non
|
|
141
|
-
value: 'إخفاء
|
|
140
|
+
'Hide non-prepaid options': {
|
|
141
|
+
value: 'إخفاء الخيارات غير المدفوعة مسبقًا',
|
|
142
142
|
},
|
|
143
143
|
'Invalid promo code': {
|
|
144
144
|
value: 'رمز ترويجي غير صالح',
|
|
@@ -284,8 +284,8 @@ export const stringsArabic = {
|
|
|
284
284
|
Show: {
|
|
285
285
|
value: 'عرض',
|
|
286
286
|
},
|
|
287
|
-
'Show non
|
|
288
|
-
value: 'عرض
|
|
287
|
+
'Show non-prepaid options': {
|
|
288
|
+
value: 'عرض الخيارات غير المدفوعة مسبقًا',
|
|
289
289
|
},
|
|
290
290
|
'Something went wrong.': {
|
|
291
291
|
value: 'حدث خطأ ما.',
|
|
@@ -386,9 +386,6 @@ export const stringsArabic = {
|
|
|
386
386
|
days: {
|
|
387
387
|
value: 'أيام',
|
|
388
388
|
},
|
|
389
|
-
or: {
|
|
390
|
-
value: 'أو',
|
|
391
|
-
},
|
|
392
389
|
'restricted items': {
|
|
393
390
|
value: 'عناصر مقيدة',
|
|
394
391
|
},
|
|
@@ -137,8 +137,8 @@ export const stringsBase = {
|
|
|
137
137
|
Hide: {
|
|
138
138
|
value: 'Hide',
|
|
139
139
|
},
|
|
140
|
-
'Hide non
|
|
141
|
-
value: 'Hide non
|
|
140
|
+
'Hide non-prepaid options': {
|
|
141
|
+
value: 'Hide non-prepaid options',
|
|
142
142
|
},
|
|
143
143
|
'Invalid promo code': {
|
|
144
144
|
value: 'Invalid promo code',
|
|
@@ -284,8 +284,8 @@ export const stringsBase = {
|
|
|
284
284
|
Show: {
|
|
285
285
|
value: 'Show',
|
|
286
286
|
},
|
|
287
|
-
'Show non
|
|
288
|
-
value: 'Show non
|
|
287
|
+
'Show non-prepaid options': {
|
|
288
|
+
value: 'Show non-prepaid options',
|
|
289
289
|
},
|
|
290
290
|
'Something went wrong.': {
|
|
291
291
|
value: 'Something went wrong.',
|
|
@@ -386,9 +386,6 @@ export const stringsBase = {
|
|
|
386
386
|
days: {
|
|
387
387
|
value: 'days',
|
|
388
388
|
},
|
|
389
|
-
or: {
|
|
390
|
-
value: 'or',
|
|
391
|
-
},
|
|
392
389
|
'restricted items': {
|
|
393
390
|
value: 'restricted items',
|
|
394
391
|
},
|
|
@@ -137,8 +137,8 @@ export const stringsChinese = {
|
|
|
137
137
|
Hide: {
|
|
138
138
|
value: '隐藏',
|
|
139
139
|
},
|
|
140
|
-
'Hide non
|
|
141
|
-
value: '
|
|
140
|
+
'Hide non-prepaid options': {
|
|
141
|
+
value: '隐藏非预付选项',
|
|
142
142
|
},
|
|
143
143
|
'Invalid promo code': {
|
|
144
144
|
value: '无效的促销代码',
|
|
@@ -284,8 +284,8 @@ export const stringsChinese = {
|
|
|
284
284
|
Show: {
|
|
285
285
|
value: '显示',
|
|
286
286
|
},
|
|
287
|
-
'Show non
|
|
288
|
-
value: '
|
|
287
|
+
'Show non-prepaid options': {
|
|
288
|
+
value: '显示非预付选项',
|
|
289
289
|
},
|
|
290
290
|
'Something went wrong.': {
|
|
291
291
|
value: '出了些问题。',
|
|
@@ -386,9 +386,6 @@ export const stringsChinese = {
|
|
|
386
386
|
days: {
|
|
387
387
|
value: '天',
|
|
388
388
|
},
|
|
389
|
-
or: {
|
|
390
|
-
value: '或',
|
|
391
|
-
},
|
|
392
389
|
'restricted items': {
|
|
393
390
|
value: '限制物品',
|
|
394
391
|
},
|
|
@@ -137,8 +137,8 @@ export const stringsDanish = {
|
|
|
137
137
|
Hide: {
|
|
138
138
|
value: 'Skjul',
|
|
139
139
|
},
|
|
140
|
-
'Hide non
|
|
141
|
-
value: 'Skjul ikke-forudbetalte
|
|
140
|
+
'Hide non-prepaid options': {
|
|
141
|
+
value: 'Skjul ikke-forudbetalte muligheder',
|
|
142
142
|
},
|
|
143
143
|
'Invalid promo code': {
|
|
144
144
|
value: 'Ugyldig kampagnekode',
|
|
@@ -284,8 +284,8 @@ export const stringsDanish = {
|
|
|
284
284
|
Show: {
|
|
285
285
|
value: 'Vis',
|
|
286
286
|
},
|
|
287
|
-
'Show non
|
|
288
|
-
value: 'Vis ikke
|
|
287
|
+
'Show non-prepaid options': {
|
|
288
|
+
value: 'Vis ikke-forudbetalte muligheder',
|
|
289
289
|
},
|
|
290
290
|
'Something went wrong.': {
|
|
291
291
|
value: 'Noget gik galt.',
|
|
@@ -386,9 +386,6 @@ export const stringsDanish = {
|
|
|
386
386
|
days: {
|
|
387
387
|
value: 'dage',
|
|
388
388
|
},
|
|
389
|
-
or: {
|
|
390
|
-
value: 'eller',
|
|
391
|
-
},
|
|
392
389
|
'restricted items': {
|
|
393
390
|
value: 'begrænsede genstande',
|
|
394
391
|
},
|
|
@@ -137,8 +137,8 @@ export const stringsDutch = {
|
|
|
137
137
|
Hide: {
|
|
138
138
|
value: 'Verbergen',
|
|
139
139
|
},
|
|
140
|
-
'Hide non
|
|
141
|
-
value: 'Verberg niet-
|
|
140
|
+
'Hide non-prepaid options': {
|
|
141
|
+
value: 'Verberg niet-vooruitbetaalde opties',
|
|
142
142
|
},
|
|
143
143
|
'Invalid promo code': {
|
|
144
144
|
value: 'Ongeldige promotiecode',
|
|
@@ -284,8 +284,8 @@ export const stringsDutch = {
|
|
|
284
284
|
Show: {
|
|
285
285
|
value: 'Tonen',
|
|
286
286
|
},
|
|
287
|
-
'Show non
|
|
288
|
-
value: 'Toon niet-vooruitbetaalde
|
|
287
|
+
'Show non-prepaid options': {
|
|
288
|
+
value: 'Toon niet-vooruitbetaalde opties',
|
|
289
289
|
},
|
|
290
290
|
'Something went wrong.': {
|
|
291
291
|
value: 'Er is iets misgegaan.',
|
|
@@ -386,9 +386,6 @@ export const stringsDutch = {
|
|
|
386
386
|
days: {
|
|
387
387
|
value: 'dagen',
|
|
388
388
|
},
|
|
389
|
-
or: {
|
|
390
|
-
value: 'of',
|
|
391
|
-
},
|
|
392
389
|
'restricted items': {
|
|
393
390
|
value: 'beperkte items',
|
|
394
391
|
},
|