@zonos/elements 1.3.99 → 1.3.101
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-ba56e884.js → cart-8a7426ab.js} +1 -1
- package/dist/cjs/{createCustomEvent-56d8ca50.js → createCustomEvent-32315aa3.js} +1 -1
- package/dist/cjs/index.cjs.js +9 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-184805ac.js → paypal-afaff757.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +4 -4
- package/dist/cjs/zonos-button_3.cjs.entry.js +1 -1
- package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-cart-items_13.cjs.entry.js} +116 -31
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -5
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +5 -5
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- 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/cjs/zonos-toggle.cjs.entry.js +32 -0
- package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +6 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +14 -13
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.js +41 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +19 -6
- package/dist/collection/components/common/zonos-button/zonos-button.css +2 -2
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.css +79 -0
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +92 -0
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +1 -1
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +1 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/getDisplayCurrency.js +9 -0
- package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +31 -0
- package/dist/collection/scripts/_zonosBase.js +2 -0
- package/dist/collection/types/common-ui/Toggle.js +1 -0
- package/dist/esm/{cart-b7bbf95b.js → cart-3ea28cb4.js} +1 -1
- package/dist/esm/{createCustomEvent-4bfd1290.js → createCustomEvent-58dee713.js} +1 -1
- package/dist/esm/index.js +9 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-5eaa95d4.js → paypal-2c061943.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +4 -4
- package/dist/esm/zonos-button_3.entry.js +1 -1
- package/dist/esm/{zonos-cart-items_12.entry.js → zonos-cart-items_13.entry.js} +116 -32
- package/dist/esm/zonos-checkout.entry.js +5 -5
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +5 -5
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- 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/zonos-toggle.entry.js +28 -0
- package/dist/esm/zonos-tooltip.entry.js +3 -3
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/{cart-b7bbf95b.js → cart-3ea28cb4.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-4bfd1290.js → createCustomEvent-58dee713.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-5eaa95d4.js → paypal-2c061943.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -0
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.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-elements.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/esm-es5/zonos-toggle.entry.js +1 -0
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/scripts/index.d.ts +74 -0
- 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/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.d.ts +5 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +2 -0
- package/dist/types/components/common/zonos-toggle/zonos-toggle.d.ts +17 -0
- package/dist/types/components/store/checkout/cart.d.ts +4 -0
- package/dist/types/components/utils/checkout/getDisplayCurrency.d.ts +1 -0
- package/dist/types/components/utils/checkout/renderCheckoutCurrency.d.ts +10 -0
- package/dist/types/components.d.ts +63 -0
- package/dist/types/scripts/_zonosBase.d.ts +7 -0
- package/dist/types/types/common-ui/Toggle.d.ts +5 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-004e7de3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7aa41ee0.system.entry.js → p-059e3dc1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0761b386.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5657fa8b.entry.js → p-0b9e2866.entry.js} +1 -1
- package/dist/zonos-elements/{p-89ba9d89.entry.js → p-0bb121ff.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c06d4d9.system.entry.js → p-1776cc80.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7ac03155.js → p-1a0a4174.js} +1 -1
- package/dist/zonos-elements/{p-93e2a2ed.system.entry.js → p-1a89c199.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-afad2fae.entry.js → p-1a9a51bf.entry.js} +1 -1
- package/dist/zonos-elements/p-1b1f2e33.system.entry.js +1 -0
- package/dist/zonos-elements/p-1e921c35.js +1 -0
- package/dist/zonos-elements/{p-22e81fee.system.entry.js → p-32c29205.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c5bd3dd0.system.js → p-360c8c41.system.js} +1 -1
- package/dist/zonos-elements/{p-10392331.entry.js → p-36eaad7e.entry.js} +1 -1
- package/dist/zonos-elements/{p-5400d785.entry.js → p-4af472bf.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea68ee1f.entry.js → p-4eb3e354.entry.js} +1 -1
- package/dist/zonos-elements/{p-01cb4d70.system.entry.js → p-5c892684.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b3c1a516.entry.js → p-65b46761.entry.js} +1 -1
- package/dist/zonos-elements/p-71fe8da9.entry.js +1 -0
- package/dist/zonos-elements/p-72595eda.system.js +1 -0
- package/dist/zonos-elements/{p-2b62fe10.system.entry.js → p-77b74009.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fe6d226f.system.entry.js → p-87d1ae39.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2156c4b3.entry.js → p-8821c276.entry.js} +1 -1
- package/dist/zonos-elements/{p-32bc9718.entry.js → p-89aeef91.entry.js} +1 -1
- package/dist/zonos-elements/{p-74014018.system.entry.js → p-939d363c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ff3bd453.entry.js → p-a7b8efc4.entry.js} +1 -1
- package/dist/zonos-elements/{p-10b7320c.system.entry.js → p-b4e88de9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c60675df.entry.js → p-b5af39b4.entry.js} +1 -1
- package/dist/zonos-elements/{p-c1494500.system.js → p-be195761.system.js} +1 -1
- package/dist/zonos-elements/{p-38886017.system.entry.js → p-bfd73737.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f6dad0d3.entry.js → p-c3677d1b.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/p-cf88af9c.entry.js +1 -0
- package/dist/zonos-elements/{p-3e29a09d.system.entry.js → p-d04d1517.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d343e994.entry.js +1 -0
- package/dist/zonos-elements/{p-0450d72d.js → p-d72a8183.js} +1 -1
- package/dist/zonos-elements/{p-6df9bd63.system.js → p-df3ccf9b.system.js} +2 -2
- package/dist/zonos-elements/{p-8615f779.system.entry.js → p-f234b5dc.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.css +22 -22
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
- package/dist/zonos-elements/p-38c109e5.system.entry.js +0 -1
- package/dist/zonos-elements/p-9bf95d37.system.entry.js +0 -1
- package/dist/zonos-elements/p-bcbf4821.entry.js +0 -1
- package/dist/zonos-elements/p-cf5d6cbe.system.js +0 -1
- package/dist/zonos-elements/p-d8cbd4ea.js +0 -1
- package/dist/zonos-elements/p-ecb8676d.entry.js +0 -1
|
@@ -109,11 +109,13 @@
|
|
|
109
109
|
:host .zonos--right {
|
|
110
110
|
position: relative;
|
|
111
111
|
}
|
|
112
|
-
:host .zonos--right .zonos--
|
|
112
|
+
:host .zonos--right .zonos--right-actions {
|
|
113
113
|
position: absolute;
|
|
114
114
|
right: 24px;
|
|
115
115
|
top: 24px;
|
|
116
116
|
z-index: 2;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
117
119
|
}
|
|
118
120
|
:host .zonos--wrapper {
|
|
119
121
|
overflow: auto;
|
|
@@ -606,7 +606,7 @@ export class ZonosCheckout {
|
|
|
606
606
|
'--primary-color': !this.isMobile ? colorPrimary : '',
|
|
607
607
|
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: async () => {
|
|
608
608
|
await this.handleStripePaymentContinue();
|
|
609
|
-
}, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
609
|
+
}, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), h("div", { class: "zonos--right-actions" }, window.Zonos.showBaseForeign && (h("zonos-currency-toggle", null)), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() }))), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
610
610
|
// do nothing if it's not mobile
|
|
611
611
|
if (!this.isMobile) {
|
|
612
612
|
return;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { cartStore } from "../../../store/checkout/cart";
|
|
3
|
+
export class ZonosCurrencyToggle {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.errorImages = [];
|
|
6
|
+
}
|
|
7
|
+
async handleToggleChanged(changedValue) {
|
|
8
|
+
var _a;
|
|
9
|
+
const targetCurrency = (_a = cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.targetCurrencyCode;
|
|
10
|
+
cartStore.displayBaseCurrency = targetCurrency !== changedValue;
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
const { exchangeRate } = cartStore;
|
|
14
|
+
const options = exchangeRate &&
|
|
15
|
+
exchangeRate.sourceCurrencyCode !== exchangeRate.targetCurrencyCode
|
|
16
|
+
? ([
|
|
17
|
+
{
|
|
18
|
+
label: exchangeRate.sourceCurrencyCode,
|
|
19
|
+
value: exchangeRate.sourceCurrencyCode,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: exchangeRate.targetCurrencyCode,
|
|
23
|
+
value: exchangeRate.targetCurrencyCode,
|
|
24
|
+
},
|
|
25
|
+
])
|
|
26
|
+
: [];
|
|
27
|
+
// If there is only one currency, don't show the toggle
|
|
28
|
+
if (!options.length) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return (h(Host, { class: "zonos--currency-toggle zonos--elements" }, h("zonos-toggle", { onToggleChanged: e => this.handleToggleChanged(e.detail), options: options, value: cartStore.displayBaseCurrency ? options[0].value : options[1].value })));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "zonos-currency-toggle"; }
|
|
34
|
+
static get encapsulation() { return "shadow"; }
|
|
35
|
+
static get assetsDirs() { return ["assets"]; }
|
|
36
|
+
static get states() {
|
|
37
|
+
return {
|
|
38
|
+
"errorImages": {}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -3,8 +3,8 @@ import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout
|
|
|
3
3
|
import { translate } from "../../../store/translationStore";
|
|
4
4
|
import { zonosStore } from "../../../store/zonosStore";
|
|
5
5
|
import { isCheckoutMobile } from "../../../utils/checkout/isCheckoutMobile";
|
|
6
|
+
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
6
7
|
import { classes } from "../../../utils/classes";
|
|
7
|
-
import { currencyFormat } from "../../../utils/hello/currencyConversion/currencyFormat";
|
|
8
8
|
/** These assets need to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */
|
|
9
9
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
10
10
|
import ChevronDownIcon from "./assets/ChevronDownIcon.svg";
|
|
@@ -44,9 +44,9 @@ export class ZonosReview {
|
|
|
44
44
|
this.isMobile && 'mobile',
|
|
45
45
|
]) }, h("div", { class: "zonos--title" }, h("zonos-text", { textColor: titleTextColor, type: titleTextType }, translate('Pay [organizationName]', {
|
|
46
46
|
organizationName: zonosStore.organizationName,
|
|
47
|
-
})), renderCollapseIcon()), h("div", { class: "zonos--total-pay" }, h("zonos-text", { type: totalTextType },
|
|
47
|
+
})), renderCollapseIcon()), h("div", { class: "zonos--total-pay" }, h("zonos-text", { type: totalTextType }, renderCheckoutCurrency({
|
|
48
48
|
amount: total,
|
|
49
|
-
|
|
49
|
+
isForeign: true,
|
|
50
50
|
})))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "zonos-review"; }
|
|
@@ -2,9 +2,9 @@ import { h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { cartStore, cartStoreGetShippingTransitInfo, cartStoreUpdateSelectedShippingOption, } from "../../../store/checkout/cart";
|
|
3
3
|
import { translate } from "../../../store/translationStore";
|
|
4
4
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
5
|
+
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
5
6
|
import { sortServiceLevelOptionsByAmount } from "../../../utils/checkout/sortServiceLevelOptionsByAmount";
|
|
6
7
|
import { classes } from "../../../utils/classes";
|
|
7
|
-
import { currencyFormat } from "../../../utils/hello/currencyConversion/currencyFormat";
|
|
8
8
|
import { submitGtag } from "../../../utils/submitGtag";
|
|
9
9
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
10
10
|
import ChevronUpIcon from "./assets/ChevronUpIcon.svg";
|
|
@@ -84,9 +84,9 @@ export class ZonosShipping {
|
|
|
84
84
|
label: `${item.displayName}${this.getLandedCostMethodLabelSuffix(landedCost.landedCost.method)}`,
|
|
85
85
|
landedCostId: landedCost.landedCostId,
|
|
86
86
|
method: landedCost.landedCost.method,
|
|
87
|
-
price:
|
|
87
|
+
price: renderCheckoutCurrency({
|
|
88
88
|
amount: shippingAmount,
|
|
89
|
-
|
|
89
|
+
isForeign: true,
|
|
90
90
|
}),
|
|
91
91
|
shipmentRatingId: item.id,
|
|
92
92
|
sublabel,
|
|
@@ -116,6 +116,13 @@ export class ZonosShipping {
|
|
|
116
116
|
this.collapsedDAPOptions = false;
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
+
this.isCurrencyToggled = () => {
|
|
120
|
+
if (this.displayBaseCurrency !== cartStore.displayBaseCurrency) {
|
|
121
|
+
this.displayBaseCurrency = cartStore.displayBaseCurrency;
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
};
|
|
119
126
|
this.preselectFirstShippingMethod = () => {
|
|
120
127
|
this.initServiceLevels();
|
|
121
128
|
const selectedServiceLevel = this.serviceLevelsAll.find(item => { var _a; return item.shipmentRatingId === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
|
|
@@ -143,6 +150,7 @@ export class ZonosShipping {
|
|
|
143
150
|
this.serviceLevelsDAP = [];
|
|
144
151
|
this.serviceLevelsOther = [];
|
|
145
152
|
this.serviceLevelsAll = [];
|
|
153
|
+
this.displayBaseCurrency = false;
|
|
146
154
|
}
|
|
147
155
|
componentWillLoad() {
|
|
148
156
|
this.preselectFirstShippingMethod();
|
|
@@ -152,6 +160,10 @@ export class ZonosShipping {
|
|
|
152
160
|
// re-init service levels if the shipping data is outdated (promo code applied)
|
|
153
161
|
this.preselectFirstShippingMethod();
|
|
154
162
|
}
|
|
163
|
+
// re-init service levels if the currency is toggled
|
|
164
|
+
else if (this.isCurrencyToggled()) {
|
|
165
|
+
this.initServiceLevels();
|
|
166
|
+
}
|
|
155
167
|
const defaultShownServiceLevels = [
|
|
156
168
|
...this.serviceLevelsDDP,
|
|
157
169
|
...this.serviceLevelsOther,
|
|
@@ -160,13 +172,13 @@ export class ZonosShipping {
|
|
|
160
172
|
if (this.showErrorBanner) {
|
|
161
173
|
this.showErrorBanner = !this.handleValidate();
|
|
162
174
|
}
|
|
163
|
-
return (h(Host, { key: '
|
|
175
|
+
return (h(Host, { key: '186cd73af5a86fdeafd0213f8923907d43167a66', class: "zonos--shipping zonos--elements" }, h("div", { key: '88681a6f08bdde1788a546cb1311ace4f065d408', class: "zonos--group" }, h("zonos-text", { key: '75deb5b42546d7b8d615d5613f687f9b0778377d', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!this.serviceLevelsAll.length && (h("zonos-banner", { key: '07669e8782f210132e8d170729a430035c7d6d7c', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '869c3df8762f6c704bfac40c0b9a7a16e845045e', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !this.serviceLevelsAll.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 }), !!defaultShownServiceLevels.length &&
|
|
164
176
|
!!this.serviceLevelsDAP.length && (h("button", { class: classes([
|
|
165
177
|
'zonos--shipping-options-collapse-trigger',
|
|
166
178
|
this.collapsedDAPOptions && 'collapsed',
|
|
167
179
|
]), onClick: () => {
|
|
168
180
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
169
|
-
} }, 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: '
|
|
181
|
+
} }, 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: '571b9856c2dc767b082adb154c3f75f49366199d', class: "zonos--group-btn" }, h("zonos-button", { key: '4153a317ffa612867cf55763f586a58abda0473b', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
170
182
|
// use primary type when on mobile mode
|
|
171
183
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
172
184
|
}
|
|
@@ -252,7 +264,8 @@ export class ZonosShipping {
|
|
|
252
264
|
"serviceLevelsDDP": {},
|
|
253
265
|
"serviceLevelsDAP": {},
|
|
254
266
|
"serviceLevelsOther": {},
|
|
255
|
-
"serviceLevelsAll": {}
|
|
267
|
+
"serviceLevelsAll": {},
|
|
268
|
+
"displayBaseCurrency": {}
|
|
256
269
|
};
|
|
257
270
|
}
|
|
258
271
|
static get events() {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
cursor: pointer;
|
|
70
70
|
white-space: nowrap;
|
|
71
71
|
padding: 8px 24px;
|
|
72
|
-
color: var(--color, var(--zonos-elements-gray-
|
|
72
|
+
color: var(--color, var(--zonos-elements-gray-1000));
|
|
73
73
|
margin: 1px;
|
|
74
74
|
/** Button size */
|
|
75
75
|
}
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
}
|
|
140
140
|
:host button.override-background {
|
|
141
141
|
background-color: var(--background-color, var(--zonos-elements-gray-0));
|
|
142
|
-
color: var(--color, var(--zonos-elements-gray-
|
|
142
|
+
color: var(--color, var(--zonos-elements-gray-1000));
|
|
143
143
|
outline: 1px solid var(--background-color, var(--zonos-elements-gray-0));
|
|
144
144
|
}
|
|
145
145
|
:host button.override-background:disabled {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: var(--font-family, Inter), Inter;
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: normal;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
font-family: var(--font-family, Inter), Inter;
|
|
8
|
+
}
|
|
9
|
+
:host img {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
}
|
|
12
|
+
:host dl,
|
|
13
|
+
:host dd,
|
|
14
|
+
:host h1,
|
|
15
|
+
:host h2,
|
|
16
|
+
:host h3,
|
|
17
|
+
:host h4,
|
|
18
|
+
:host h5,
|
|
19
|
+
:host h6,
|
|
20
|
+
:host hr,
|
|
21
|
+
:host figure,
|
|
22
|
+
:host p,
|
|
23
|
+
:host pre {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* All sets of variable are here */
|
|
28
|
+
/* smooth font rendering */
|
|
29
|
+
:host {
|
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
}
|
|
37
|
+
:host .wrapper {
|
|
38
|
+
position: relative;
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
background-color: var(--zonos-elements-gray-50);
|
|
41
|
+
display: flex;
|
|
42
|
+
}
|
|
43
|
+
:host .zonos--toggle-selected-slider {
|
|
44
|
+
z-index: 1;
|
|
45
|
+
position: absolute;
|
|
46
|
+
background-color: var(--zonos-elements-raised-surface-color);
|
|
47
|
+
height: 100%;
|
|
48
|
+
/* Light/Shadows/Button */
|
|
49
|
+
box-shadow: var(--zonos-elements-shadow-button-standard);
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
animation: translate 0.3s ease-in-out;
|
|
52
|
+
}
|
|
53
|
+
:host .zonos--option {
|
|
54
|
+
background: transparent;
|
|
55
|
+
border: 0;
|
|
56
|
+
z-index: 2;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
padding: 4px 12px;
|
|
59
|
+
border-radius: 6px;
|
|
60
|
+
transition: var(--zonos-elements-transition);
|
|
61
|
+
font-size: var(--zonos-elements-font-size-base);
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
color: var(--zonos-elements-text-color-secondary);
|
|
64
|
+
}
|
|
65
|
+
:host .zonos--option:focus {
|
|
66
|
+
outline: none;
|
|
67
|
+
}
|
|
68
|
+
:host .zonos--option:hover:not(.selected) {
|
|
69
|
+
color: var(--zonos-elements-text-color);
|
|
70
|
+
}
|
|
71
|
+
:host .zonos--option.selected {
|
|
72
|
+
color: var(--zonos-elements-text-color);
|
|
73
|
+
background-color: var(--zonos-elements-raised-surface-color);
|
|
74
|
+
height: 100%;
|
|
75
|
+
/* Light/Shadows/Button */
|
|
76
|
+
box-shadow: var(--zonos-elements-shadow-button-standard);
|
|
77
|
+
border-radius: 6px;
|
|
78
|
+
animation: translate 0.3s ease-in-out;
|
|
79
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
import { zonosStoreFontFamily } from "../../store/zonosStore";
|
|
3
|
+
import { classes } from "../../utils/classes";
|
|
4
|
+
export class ZonosToggle {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.options = [];
|
|
7
|
+
this.value = undefined;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, { key: '6af4c4574aed8e5a8d12e20d403f0e681429ce45', class: classes(['zonos--elements zonos--toggle']), style: {
|
|
11
|
+
'--font-family': zonosStoreFontFamily(),
|
|
12
|
+
} }, h("div", { key: '8535f709cb6f2a2ad30cbaf782fc6d20363ca1dc', class: "wrapper" }, this.options.map(option => {
|
|
13
|
+
const selected = option.value === this.value;
|
|
14
|
+
return (h("button", { class: classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
|
|
15
|
+
this.toggleChanged.emit(option.value);
|
|
16
|
+
} }, option.label));
|
|
17
|
+
}))));
|
|
18
|
+
}
|
|
19
|
+
static get is() { return "zonos-toggle"; }
|
|
20
|
+
static get encapsulation() { return "shadow"; }
|
|
21
|
+
static get originalStyleUrls() {
|
|
22
|
+
return {
|
|
23
|
+
"$": ["zonos-toggle.scss"]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
static get styleUrls() {
|
|
27
|
+
return {
|
|
28
|
+
"$": ["zonos-toggle.css"]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static get properties() {
|
|
32
|
+
return {
|
|
33
|
+
"options": {
|
|
34
|
+
"type": "unknown",
|
|
35
|
+
"mutable": false,
|
|
36
|
+
"complexType": {
|
|
37
|
+
"original": "ToggleItem<string>[]",
|
|
38
|
+
"resolved": "ToggleItem<string>[]",
|
|
39
|
+
"references": {
|
|
40
|
+
"ToggleItem": {
|
|
41
|
+
"location": "import",
|
|
42
|
+
"path": "src/types/common-ui/Toggle",
|
|
43
|
+
"id": "src/types/common-ui/Toggle.ts::ToggleItem"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": false,
|
|
48
|
+
"optional": false,
|
|
49
|
+
"docs": {
|
|
50
|
+
"tags": [],
|
|
51
|
+
"text": "Options for the toggle"
|
|
52
|
+
},
|
|
53
|
+
"defaultValue": "[]"
|
|
54
|
+
},
|
|
55
|
+
"value": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"mutable": false,
|
|
58
|
+
"complexType": {
|
|
59
|
+
"original": "string",
|
|
60
|
+
"resolved": "string",
|
|
61
|
+
"references": {}
|
|
62
|
+
},
|
|
63
|
+
"required": true,
|
|
64
|
+
"optional": false,
|
|
65
|
+
"docs": {
|
|
66
|
+
"tags": [],
|
|
67
|
+
"text": "The selected option"
|
|
68
|
+
},
|
|
69
|
+
"attribute": "value",
|
|
70
|
+
"reflect": false
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static get events() {
|
|
75
|
+
return [{
|
|
76
|
+
"method": "toggleChanged",
|
|
77
|
+
"name": "toggleChanged",
|
|
78
|
+
"bubbles": true,
|
|
79
|
+
"cancelable": true,
|
|
80
|
+
"composed": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Event emitted when the toggle changes"
|
|
84
|
+
},
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "string",
|
|
87
|
+
"resolved": "string",
|
|
88
|
+
"references": {}
|
|
89
|
+
}
|
|
90
|
+
}];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -7,10 +7,10 @@ export class ZonosTooltip {
|
|
|
7
7
|
this.showTooltip = false;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '214a19120cd770e0477c82fc9b25bd813bf05463', class: "zonos--elements" }, h("div", { key: 'cccee37a2e9a41dcb34427a652a83241277a54fd', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, h("slot", { key: '67a0541e0bce6f73655b240973d51f9b6acca46b' }), h("div", { key: '6ce5cd0b9ecb34c4542d5ca9463e26347cf13a5a', class: classes([
|
|
11
11
|
this.showTooltip && 'zonos--show-tooltip',
|
|
12
12
|
'zonos--tooltip-content',
|
|
13
|
-
]) }, h("zonos-text", { key: '
|
|
13
|
+
]) }, h("zonos-text", { key: '377287cc5ea7cd6840203dfef0e1cbee64621b98', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), h("zonos-text", { key: 'a7f46dedc27427fced022bbbd33f65428cb98f82', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-tooltip"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class VStack {
|
|
|
7
7
|
this.spacing = 24;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'b8c901920bc5f0822e1a14d68fceb4b0a71de8d0', style: {
|
|
11
11
|
'--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: '64db301d73963c2df229737bfa8c5d680ca748f2', class: classes(['vstack']), style: { 'grid-row-gap': `${this.spacing}px` } }, h("slot", { key: '9381e547ba984aac20197e309c1893c95f817986' }))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "zonos-v-stack"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,12 +56,12 @@ export class ZonosVirtualScroll {
|
|
|
56
56
|
} }, this.renderItem(i)));
|
|
57
57
|
accHeight += itemHeight;
|
|
58
58
|
}
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: 'f04bc43b1784b031c065bf4b2730bd84d0be7d01' }, h("div", { key: 'c852f9ea58489bf33e33d5b60ab39083d041861e',
|
|
60
60
|
// to capture scroll action
|
|
61
61
|
class: "scroller", style: {
|
|
62
62
|
height: `${this.totalHeight}px`,
|
|
63
63
|
width: `${W}px`,
|
|
64
|
-
} }), h("div", { key: '
|
|
64
|
+
} }), h("div", { key: 'd2c5b796c4f83e6532c237c67434f14fcc435a5d',
|
|
65
65
|
// to display items
|
|
66
66
|
class: "item-container", ref: el => (this.container = el), style: {
|
|
67
67
|
height: `${this.totalHeight}px`,
|
|
@@ -10,7 +10,7 @@ export class ZonosComponent {
|
|
|
10
10
|
return format(this.first, this.middle, this.last);
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return h("div", { key: '
|
|
13
|
+
return h("div", { key: '680750af83db9bbfb563fe37d1dc631e6ec60e32' }, "Hello, World! I'm ", this.getText());
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-component"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -18,9 +18,9 @@ export class ZonosHelloDialogFooter {
|
|
|
18
18
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
19
19
|
// Only use gray-0 (white) when the background color is dark (apply inverted color if the element is using dark theme variable)
|
|
20
20
|
const mainColor = primaryColor && isDarkColor(primaryColor) ? 'white' : 'black';
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: '10507bbc2c86294a173c72bbc963e6b6a6150ab8', class: "zonos--elements" }, h("div", { key: '9be6b8d019954c89d5ee1611495bc31e37c737f0', class: "zonos--hello-dialog-footer", style: {
|
|
22
22
|
'--primary-color': primaryColor,
|
|
23
|
-
} }, h("a", { key: '
|
|
23
|
+
} }, h("a", { key: 'e0f0a04cdfcfb8e6e3639818e7a0950e81930b93', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '4f39f90ead546f871b97e47e27965eca56ca927b', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), h("div", { key: 'dc0e8be893d1ed5038272e7311276e81f62f0c57', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: '7a969188a4026505639a86ffbc077d1a8ae6d069', buttonColor: mainColor, icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: 'fd46f01bcfd1c03599998f3c6844d0395d263004', buttonColor: mainColor, icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "zonos-hello-dialog-footer"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -232,18 +232,18 @@ export class ZonosHelloDialog {
|
|
|
232
232
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
233
233
|
const currentPage = this.getCurrentPageEnum();
|
|
234
234
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
235
|
-
return (h(Host, { key: '
|
|
235
|
+
return (h(Host, { key: 'e14037c6b8c7f2799647175dbddc66d65d0325f8', class: "zonos--elements" }, h("div", { key: 'fda45028c0c2023f84eef20303c5b62dc07eb889', class: classes([
|
|
236
236
|
'zonos--hello-dialog',
|
|
237
237
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
238
238
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
239
239
|
!!this.mobileLocationOverride &&
|
|
240
240
|
'zonos--hello-dialog-mobile-override',
|
|
241
241
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
242
|
-
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '
|
|
242
|
+
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: 'bb483bbb96679486f9a624fe42f322c2d2e0c94c' }, h("div", { key: '58e5d779f0958ddcd1f36bc172c656fc99e34607', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: '69c8e383ebd2c2571114235e1e5e03e97af3899b', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: '88655783f3891bb7148ea49e5eaa36746c49ff4b', spacing: 24 }, h("zonos-country-flag", { key: 'c63cf9ef2a435ea28cddf0dcb89d51594bf45047', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: '2c0ef7490b12996cf18229ad12e293be2feeb737', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: '869918eac5dc67eb6c6e148966bf46eaa1922a14', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: '8ab9d963ed850824ffa8431e1335d7dc61d1208e', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: '944a27a00bd4f617656be97f31e6cf8f3933e45f', spacing: 8 }, this.restrictedItems.map(item => {
|
|
243
243
|
var _a;
|
|
244
244
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
245
|
-
}), h("zonos-card", { key: '
|
|
246
|
-
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '
|
|
245
|
+
}), h("zonos-card", { key: '0e348230d4455b63292f91a2de0294bfcf9d192b', spacing: "12px" }, h("zonos-v-stack", { key: '9ccc2ab76764f1a369731854c15959c60c8646e3', spacing: 12 }, hasInclusivePrices ? (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: InclusivePricingIcon }), h("zonos-text", null, inclusivePriceMessage))) : (h(Fragment, null, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
246
|
+
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: 'ea448dda0303f72ba039f19d961dfcde9bb3d0d0', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: 'ff7c4495a0688f94a9b88ed7fe1c4a52715fbd40' }, h("zonos-country-select", { key: '11f8b9f49c1ca945dcc97263c9163d23ee78482e', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: '5e6a458a658c33e1dd68a519efa489b5445fb358' }, h("zonos-language-select", { key: 'd319a4e87bd669f10e8b337561804ff73ca097ac', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
247
247
|
}
|
|
248
248
|
static get is() { return "zonos-hello-dialog"; }
|
|
249
249
|
static get encapsulation() { return "shadow"; }
|
|
@@ -204,7 +204,7 @@ export class ZonosController {
|
|
|
204
204
|
zonosStore.organizationName = organizationName;
|
|
205
205
|
}
|
|
206
206
|
render() {
|
|
207
|
-
return h(Host, { key: '
|
|
207
|
+
return h(Host, { key: '4fbe37aa73ee16150bf40bdcc3bf5d0d0c092482', class: "zonos--elements" });
|
|
208
208
|
}
|
|
209
209
|
static get is() { return "zonos-controller"; }
|
|
210
210
|
static get encapsulation() { return "shadow"; }
|
|
@@ -41,7 +41,7 @@ export class ZonosPaypalPayment {
|
|
|
41
41
|
void this.loadPaypal();
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '23a85e68d356392c530adc7d006cbe4ffc5ff87c', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: '1488f9507505eaea91141c09265295acff6ca085', class: "zonos--payment-paypal-container" })));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "zonos-paypal-payment"; }
|
|
47
47
|
static get encapsulation() { return "scoped"; }
|
|
@@ -12,7 +12,7 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
|
12
12
|
checkoutSessionTimeoutShow: false,
|
|
13
13
|
checkoutTimeoutInterval: null,
|
|
14
14
|
currency: 'USD',
|
|
15
|
-
|
|
15
|
+
displayBaseCurrency: false,
|
|
16
16
|
dutiesTaxesFees: null,
|
|
17
17
|
dutiesTaxesFeesEstimate: null,
|
|
18
18
|
error: null,
|
|
@@ -138,7 +138,7 @@ export class ZonosAddress {
|
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
140
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
141
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: '23c06d9f7740b43f58f946f92a5357931e6fe256', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '7eed670aa6fbb3eba5a25394f7e02d9cb7aa3bd8', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '61e461713bebb42c8f989a7e08e7bc62a572ace8', class: "zonos--address-component" })));
|
|
142
142
|
}
|
|
143
143
|
static get is() { return "zonos-address"; }
|
|
144
144
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js
CHANGED
|
@@ -42,7 +42,7 @@ export class ZonosLinkAuthentication {
|
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
44
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '0aaba985027ef855e981049783641b38ec1b1afd', class: "zonos--link-authentication zonos--elements" }, h("zonos-text", { key: '8fbb7a2f95c02d975f4b94c70e68be764d53d76e', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'adc585cf1fa7ea763e9c5ae4e5be623b2d8f6627', class: "zonos--link-authentication-component" })));
|
|
46
46
|
}
|
|
47
47
|
static get is() { return "zonos-link-authentication"; }
|
|
48
48
|
static get encapsulation() { return "scoped"; }
|
|
@@ -36,7 +36,7 @@ export class ZonosPayment {
|
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
38
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'b0f902ab028fc148e5ac2e6b6620844aa88329f0', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: '826ddc56d763a6064e4ba5bd331853950d68a8b5', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '4f987cfa5d2d1d2b0db48f435f9119095b1a7373', class: "zonos--payment-component" }), h("div", { key: 'bbdfdeee14b9a919b896bbe525763d850739cb4a', class: "zonos--payment-paypal-container" })));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "zonos-payment"; }
|
|
42
42
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { cartStore } from "../../store/checkout/cart";
|
|
2
|
+
export const getDisplayCurrency = () => {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
const shouldDisplayBaseCurrency = cartStore.displayBaseCurrency;
|
|
5
|
+
const displayCurrency = shouldDisplayBaseCurrency && ((_a = cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.sourceCurrencyCode)
|
|
6
|
+
? (_b = cartStore.exchangeRate) === null || _b === void 0 ? void 0 : _b.sourceCurrencyCode
|
|
7
|
+
: cartStore.currency;
|
|
8
|
+
return displayCurrency;
|
|
9
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cartStore } from "../../store/checkout/cart";
|
|
2
|
+
import { getDisplayCurrency } from "./getDisplayCurrency";
|
|
3
|
+
import { currencyFormat } from "../hello/currencyConversion/currencyFormat";
|
|
4
|
+
/**
|
|
5
|
+
* Unified currency rendering for checkout amounts.
|
|
6
|
+
* @note This is only to display, not for calculations.
|
|
7
|
+
*/
|
|
8
|
+
export const renderCheckoutCurrency = ({ amount, isForeign }) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const targetRate = ((_a = cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.rate) || 1;
|
|
11
|
+
const shouldDisplayBaseCurrency = cartStore.displayBaseCurrency;
|
|
12
|
+
const displayCurrency = getDisplayCurrency();
|
|
13
|
+
if (isForeign) {
|
|
14
|
+
// Amount is in foreign currency, divide by the rate to convert it to the base currency if displaying in base currency
|
|
15
|
+
const displayAmount = shouldDisplayBaseCurrency
|
|
16
|
+
? amount / targetRate
|
|
17
|
+
: amount;
|
|
18
|
+
return currencyFormat({
|
|
19
|
+
amount: displayAmount,
|
|
20
|
+
currency: displayCurrency,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// Amount is already in base currency, need to multiply rate to convert to foreign currency if display in foreign currency
|
|
24
|
+
const displayAmount = shouldDisplayBaseCurrency
|
|
25
|
+
? amount
|
|
26
|
+
: amount * targetRate;
|
|
27
|
+
return currencyFormat({
|
|
28
|
+
amount: displayAmount,
|
|
29
|
+
currency: displayCurrency,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -44,6 +44,8 @@ Zonos._paypalMockResponse = null;
|
|
|
44
44
|
Zonos.isBigCommerce = false;
|
|
45
45
|
Zonos.releaseDate = process.env.NEXT_PUBLIC_RELEASE_DATE;
|
|
46
46
|
Zonos.isLegacyCheckout = false;
|
|
47
|
+
Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
48
|
+
window.location.search.includes('zonosShowBaseForeign');
|
|
47
49
|
/**
|
|
48
50
|
* By default, the package will load from npm
|
|
49
51
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9684,7 +9684,7 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
|
9684
9684
|
checkoutSessionTimeoutShow: false,
|
|
9685
9685
|
checkoutTimeoutInterval: null,
|
|
9686
9686
|
currency: 'USD',
|
|
9687
|
-
|
|
9687
|
+
displayBaseCurrency: false,
|
|
9688
9688
|
dutiesTaxesFees: null,
|
|
9689
9689
|
dutiesTaxesFeesEstimate: null,
|
|
9690
9690
|
error: null,
|