@zonos/elements 1.3.132 → 1.3.134
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/{CheckoutConfig-1d38a21d.js → CheckoutConfig-165db6b6.js} +1 -1
- package/dist/cjs/{cart-1bab358a.js → cart-0f32f556.js} +1 -1
- package/dist/cjs/{handleFetch-a8dfb07c.js → handleFetch-4a90f091.js} +1 -1
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-f1874626.js → paypal-045033fb.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +11 -18
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +39 -22
- package/dist/cjs/zonos-checkout.cjs.entry.js +36 -6
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +6 -6
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +5 -5
- package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +25 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +34 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +2 -2
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
- package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -10
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- 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/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +2 -2
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +1 -1
- package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
- package/dist/collection/types/generated/graphql.internal.types.js +1 -0
- package/dist/esm/{CheckoutConfig-56c63bdf.js → CheckoutConfig-930107d4.js} +1 -1
- package/dist/esm/{cart-a5a8ec74.js → cart-3e0e4d5c.js} +1 -1
- package/dist/esm/{handleFetch-40fc3562.js → handleFetch-22cb914b.js} +1 -1
- package/dist/esm/index.js +10 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-828b4297.js → paypal-7f41ff20.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +11 -18
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card.entry.js +4 -4
- package/dist/esm/zonos-cart-items_13.entry.js +39 -22
- package/dist/esm/zonos-checkout.entry.js +36 -6
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +3 -3
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +6 -6
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +6 -6
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +5 -5
- package/dist/esm/zonos-toggle.entry.js +2 -2
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/{CheckoutConfig-56c63bdf.js → CheckoutConfig-930107d4.js} +1 -1
- package/dist/esm-es5/{cart-a5a8ec74.js → cart-3e0e4d5c.js} +1 -1
- package/dist/esm-es5/handleFetch-22cb914b.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-828b4297.js → paypal-7f41ff20.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.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-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.entry.js +1 -1
- 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.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-checkout-finish/zonos-checkout-finish.d.ts +9 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +27 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +43 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.ts +2 -4
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-f0ea7e98.system.entry.js → p-05826697.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0082eefd.system.entry.js → p-1360c4b5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb6d1e26.system.entry.js → p-1393d259.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4953542e.system.entry.js → p-16e5df29.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4794c0ab.system.js → p-1856c3fa.system.js} +1 -1
- package/dist/zonos-elements/{p-22458c90.system.entry.js → p-1ac0f941.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3cfa90d1.system.entry.js → p-22d099fb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d963d9d4.entry.js → p-22e2f162.entry.js} +1 -1
- package/dist/zonos-elements/{p-92fbf9e6.entry.js → p-234b3f74.entry.js} +1 -1
- package/dist/zonos-elements/{p-c39dc3e9.system.entry.js → p-24488838.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3a89fb48.system.entry.js → p-31a776aa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-31e85dce.system.entry.js → p-3a5fb01a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-937d08c1.entry.js → p-3f2ea446.entry.js} +1 -1
- package/dist/zonos-elements/{p-db70f65a.system.entry.js → p-49cecdf9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bdc7e244.system.entry.js → p-4b680c1e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3efbcf88.system.entry.js → p-5775cd68.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7b2ee5b0.js → p-69045ca3.js} +1 -1
- package/dist/zonos-elements/{p-f7f481be.entry.js → p-6b8db2d3.entry.js} +1 -1
- package/dist/zonos-elements/{p-34471cab.system.js → p-798bb828.system.js} +1 -1
- package/dist/zonos-elements/{p-0cf44851.entry.js → p-84df573a.entry.js} +1 -1
- package/dist/zonos-elements/{p-fe899c47.entry.js → p-856bf7a4.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9a565d0.entry.js → p-85fbb5f0.entry.js} +1 -1
- package/dist/zonos-elements/p-860e46ab.js +1 -0
- package/dist/zonos-elements/{p-dd517bcb.js → p-8759f66b.js} +1 -1
- package/dist/zonos-elements/{p-78227a4e.system.entry.js → p-887b05eb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-817741b7.entry.js → p-897c809a.entry.js} +1 -1
- package/dist/zonos-elements/{p-db5e0d2b.entry.js → p-95f26bc3.entry.js} +1 -1
- package/dist/zonos-elements/p-99d47e1c.entry.js +1 -0
- package/dist/zonos-elements/{p-4170b042.entry.js → p-a0cc4dd2.entry.js} +1 -1
- package/dist/zonos-elements/p-a0de6e0f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-296aee8a.system.entry.js → p-a28f3298.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f61c142c.system.entry.js → p-aaa3addd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0cfab69e.entry.js → p-acae88db.entry.js} +1 -1
- package/dist/zonos-elements/p-acb45eb6.system.entry.js +1 -0
- package/dist/zonos-elements/{p-40579074.entry.js → p-b1bb00a8.entry.js} +1 -1
- package/dist/zonos-elements/{p-68cfdd01.system.entry.js → p-b500f0d1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0e067b2e.entry.js → p-b6fea87a.entry.js} +1 -1
- package/dist/zonos-elements/{p-942a0605.js → p-b7307c61.js} +1 -1
- package/dist/zonos-elements/{p-fb6cf324.entry.js → p-b9e4e410.entry.js} +1 -1
- package/dist/zonos-elements/{p-40596087.system.js → p-bb418544.system.js} +1 -1
- package/dist/zonos-elements/{p-6b00344a.entry.js → p-bbd5119f.entry.js} +1 -1
- package/dist/zonos-elements/{p-320e7cb9.system.entry.js → p-be468605.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c127846c.entry.js → p-bec4d2c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-e5f27005.system.entry.js → p-c0719959.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-e933cbf0.system.entry.js → p-de020c11.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-311f6702.entry.js → p-e44ab8b8.entry.js} +1 -1
- package/dist/zonos-elements/p-e9db73d9.entry.js +1 -0
- package/dist/zonos-elements/{p-1da0c1cb.entry.js → p-f9f48476.entry.js} +1 -1
- package/dist/zonos-elements/{p-81bb0bde.system.js → p-fa790aaf.system.js} +1 -1
- package/dist/zonos-elements/p-fb7d8b52.entry.js +1 -0
- package/dist/zonos-elements/p-febc72e7.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-40fc3562.js +0 -1
- package/dist/zonos-elements/p-0cfb97ae.js +0 -1
- package/dist/zonos-elements/p-3972da4c.entry.js +0 -1
- package/dist/zonos-elements/p-6305e92c.system.js +0 -1
- package/dist/zonos-elements/p-76f17790.entry.js +0 -1
- package/dist/zonos-elements/p-8aaada48.system.entry.js +0 -1
- package/dist/zonos-elements/p-a0614f3a.system.entry.js +0 -1
- package/dist/zonos-elements/p-b2641a83.entry.js +0 -1
|
@@ -56,13 +56,22 @@ export class ZonosCheckoutFinish {
|
|
|
56
56
|
}
|
|
57
57
|
window.location.href = url;
|
|
58
58
|
};
|
|
59
|
+
this.isRedirectBehavior = () => {
|
|
60
|
+
const { successBehavior } = zonosStore.checkoutSettings;
|
|
61
|
+
return (successBehavior === 'REDIRECT_TO_SUCCESS_PAGE' ||
|
|
62
|
+
!!cartStore.externalConfirmationPageURL);
|
|
63
|
+
};
|
|
59
64
|
/**
|
|
60
65
|
* It would make more sense to have keep shopping button if the success behavior is not redirecting to a different page
|
|
61
66
|
*/
|
|
62
67
|
this.shouldRenderKeepShoppingButton = () => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
return !this.isRedirectBehavior();
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Should render close button for redirect behavior when the success behavior is redirecting to a different page
|
|
72
|
+
*/
|
|
73
|
+
this.shouldRenderCloseButtonForRedirectBehavior = () => {
|
|
74
|
+
return this.isRedirectBehavior();
|
|
66
75
|
};
|
|
67
76
|
this.handleSuccessBehavior = async () => {
|
|
68
77
|
var _a, _b;
|
|
@@ -86,14 +95,20 @@ export class ZonosCheckoutFinish {
|
|
|
86
95
|
];
|
|
87
96
|
// stop loading spinner to show the redirecting notification
|
|
88
97
|
this.isLoading = false;
|
|
98
|
+
// Make the close button to spin
|
|
99
|
+
this.isWaitingToRedirect = true;
|
|
89
100
|
// override title if notification type is success
|
|
90
101
|
this.useOverrideSuccessNotification();
|
|
91
102
|
// attempt to pull order info before redirecting
|
|
92
103
|
await this.getPullOrder();
|
|
93
104
|
// If order is still not ready, should not redirect with no order id as merchant would show an error page and customer may think the order was not placed and retry
|
|
94
105
|
if (!this.order) {
|
|
106
|
+
log('=== Order info not found, not redirecting, hide spinner for close button', 'error');
|
|
107
|
+
// Allow user to close the modal
|
|
108
|
+
this.isWaitingToRedirect = false;
|
|
95
109
|
return;
|
|
96
110
|
}
|
|
111
|
+
this.isWaitingToRedirect = false;
|
|
97
112
|
const legacyOrderNumber = ((_b = (_a = this.order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value) || null;
|
|
98
113
|
const queryParams = new URLSearchParams();
|
|
99
114
|
if (this.order.id) {
|
|
@@ -132,6 +147,7 @@ export class ZonosCheckoutFinish {
|
|
|
132
147
|
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
133
148
|
const maxRetries = parseFloat(new URLSearchParams(window.location.search).get('maxPollingRetries') ||
|
|
134
149
|
'0') || MAX_RETRIES;
|
|
150
|
+
log(`=== Polling order (${attempts} attemps)`, 'info');
|
|
135
151
|
if (
|
|
136
152
|
// Order found and was regular checkout user
|
|
137
153
|
(order && !isLegacyCheckout) ||
|
|
@@ -303,6 +319,7 @@ export class ZonosCheckoutFinish {
|
|
|
303
319
|
this.notificationMessages = [];
|
|
304
320
|
this.notificationActionText = translate('Keep shopping');
|
|
305
321
|
this.order = null;
|
|
322
|
+
this.isWaitingToRedirect = true;
|
|
306
323
|
}
|
|
307
324
|
componentDidLoad() {
|
|
308
325
|
// Reset local storage for placed order info
|
|
@@ -324,12 +341,12 @@ export class ZonosCheckoutFinish {
|
|
|
324
341
|
}
|
|
325
342
|
render() {
|
|
326
343
|
const isTestMode = getIsTestMode();
|
|
327
|
-
return (h(Host, { key: '
|
|
344
|
+
return (h(Host, { key: '9c674bb1bcb7092f95aef959219da8d692bc2e05', class: "zonos--checkout-finish zonos--elements", style: {
|
|
328
345
|
'--zonos--border-radius': getBorderRadius({
|
|
329
346
|
overrideBorderStyle: this.borderRadius,
|
|
330
347
|
}),
|
|
331
|
-
} }, !this.isLoading && (h("div", { key: '
|
|
332
|
-
this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '
|
|
348
|
+
} }, !this.isLoading && (h("div", { key: '93e895750b6c5999b98d9b935a69e7d0cbc5b299', class: "zonos--finish-details" }, h("div", { key: 'bdbcaaebceca8684b82cac779294ebd4e24ba5be', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'cb2d9fe1fee223009cfa9ed626412f3955e0dbe6', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: 'dbe3e7c64f16be7202768e82f0a822ca700785ef', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '236865b9375c9813da53e1fa3ae54e55ceed1b7a', loading: this.isWaitingToRedirect, onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Close'))), !window.Zonos.isLegacyCheckout &&
|
|
349
|
+
this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '8b7f92e8d32ae14bf3470154db960f93b3d812f6', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'cf35bd1f5e8b6318b4dee4d72dd3124ec44e3de1', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '940f58f8983d3f66eda5bc06049047615a153083', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '2423551be1dcdffc987ec19f632a7faec804bc2d', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
|
|
333
350
|
}
|
|
334
351
|
static get is() { return "zonos-checkout-finish"; }
|
|
335
352
|
static get encapsulation() { return "shadow"; }
|
|
@@ -417,7 +434,8 @@ export class ZonosCheckoutFinish {
|
|
|
417
434
|
"notificationTitle": {},
|
|
418
435
|
"notificationMessages": {},
|
|
419
436
|
"notificationActionText": {},
|
|
420
|
-
"order": {}
|
|
437
|
+
"order": {},
|
|
438
|
+
"isWaitingToRedirect": {}
|
|
421
439
|
};
|
|
422
440
|
}
|
|
423
441
|
static get events() {
|
|
@@ -33,10 +33,10 @@ export class ZonosCheckoutFooter {
|
|
|
33
33
|
const languageLabel = (_a = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
|
|
34
34
|
// reverse color when on desktop. With the coversheet backdrop, the color should be white
|
|
35
35
|
const colorDesktop = this.dataTheme === 'LIGHT' && !this.mobile ? 'gray-0' : 'gray-1000';
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '348667bda79c9d8c69f1481262f3dd74068b4f16', class: classes(['zonos--elements', this.isMobile && 'mobile']) }, h("div", { key: '8751d01d35e0ca75ab4f3866d2964fbbe9cabd91', class: "zonos--checkout-footer" }, h("div", { key: '0745cc39cb134d0dee746d6e8dbe75192c226e7b', class: "zonos--checkout-locale-wrapper" }, h("zonos-button", { key: 'a1a6ba67ad35c4e3e04959e5895a959c5b3fa4b3', buttonColor: colorDesktop, class: "zonos--checkout-footer-language-button", icon: h("zonos-icon", { "aria-label": "Language select", content: Globe, iconColor: colorDesktop }), onClick: () => this.toggleLanguageDialog(), variant: "subtle" }, languageLabel), h("div", { key: 'e82c276c99eb723af2be002f8f749bf7e6e005c3', class: classes([
|
|
37
37
|
'zonos--checkout-footer-dialog',
|
|
38
38
|
this.showLanguageDialog && 'zonos--checkout-footer-dialog-open',
|
|
39
|
-
]) }, h("zonos-language-select", { key: '
|
|
39
|
+
]) }, h("zonos-language-select", { key: '06b1f71758b9a33472abfda47c5fb130b8474179', handleOnClose: () => this.toggleLanguageDialog() }))), h("div", { key: 'b004d2333b89c6e002023a161b24738e0508f631', class: "zonos--checkout-footer-icon-wrapper" }, h("a", { key: 'f2bfc5e8d20756634285e754272422241220c13f', href: "https://zonos.com/docs/legal/zonos-privacy-policy", target: "_blank" }, h("zonos-text", { key: '714bb78e7c7a20db9c94ff04397f16cf947f3dba', textColor: colorDesktop }, "Privacy policy")), h("div", { key: '072d318b06cf86a8d7e75184b2386042ce1a3329', class: "zonos--checkout-footer-logo" }, h("zonos-text", { key: '9c85ede9edd9217cd45bce8277f9ce042dce75ee', textColor: colorDesktop }, "Powered by"), h("a", { key: '2f5a8fbf27c9a3137bba6a2bf52976f4c5bab780', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'e59cc91b07f606e034d0909b50a8ac735c84f38c', autoHeight: true, content: ZonosIcon, iconColor: colorDesktop, size: 108 })))))));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "zonos-checkout-footer"; }
|
|
42
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,6 +16,7 @@ import { watchBigcommerceDomesticCheckout } from "../../utils/checkout/watchBigc
|
|
|
16
16
|
import { classes } from "../../utils/classes";
|
|
17
17
|
import { createCustomEvent } from "../../utils/createCustomEvent";
|
|
18
18
|
import { getBorderRadius } from "../../utils/getBorderRadius";
|
|
19
|
+
import { handleFetch } from "../../utils/handleFetch";
|
|
19
20
|
import { getZCountryUrlParam } from "../../utils/hello/getZCountryUrlParam";
|
|
20
21
|
import { isDarkColor } from "../../utils/isDarkColor";
|
|
21
22
|
import { jsonParse } from "../../utils/jsonParse";
|
|
@@ -43,6 +44,7 @@ export class ZonosCheckout {
|
|
|
43
44
|
* Listener for locale change in localization store
|
|
44
45
|
*/
|
|
45
46
|
this.onChangeLocaleListener = () => { };
|
|
47
|
+
this.isRedirectAfterOrder = false;
|
|
46
48
|
this.applyStripeTheme = async () => {
|
|
47
49
|
var _a, _b, _c, _d;
|
|
48
50
|
const theme = ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) || zonosStore.appearance.theme;
|
|
@@ -241,6 +243,9 @@ export class ZonosCheckout {
|
|
|
241
243
|
}
|
|
242
244
|
// apply theme to stripe elements
|
|
243
245
|
await this.applyStripeTheme();
|
|
246
|
+
this.isRedirectAfterOrder =
|
|
247
|
+
zonosStore.checkoutSettings.successBehavior ===
|
|
248
|
+
'REDIRECT_TO_SUCCESS_PAGE' || !!cartStore.externalConfirmationPageURL;
|
|
244
249
|
return true;
|
|
245
250
|
}
|
|
246
251
|
reloadCheckoutSession() {
|
|
@@ -271,6 +276,22 @@ export class ZonosCheckout {
|
|
|
271
276
|
confirmProceedWithOrderDuplication() {
|
|
272
277
|
// Reset the placed order info
|
|
273
278
|
this.placedOrderInfo = null;
|
|
279
|
+
if (!cartStore.checkoutSessionId) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
// Record the order duplication consent so we know user did see the notification and proceed with the order duplication
|
|
283
|
+
void handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
|
|
284
|
+
body: {
|
|
285
|
+
id: cartStore.checkoutSessionId,
|
|
286
|
+
metadata: [
|
|
287
|
+
{
|
|
288
|
+
key: 'orderDuplicationConsent',
|
|
289
|
+
value: '1',
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
method: 'POST',
|
|
294
|
+
});
|
|
274
295
|
}
|
|
275
296
|
handleCancelOrderDuplication() {
|
|
276
297
|
var _a;
|
|
@@ -701,6 +722,15 @@ export class ZonosCheckout {
|
|
|
701
722
|
handleAddressChange() {
|
|
702
723
|
stripeStoreReset();
|
|
703
724
|
}
|
|
725
|
+
handleOpenChange() {
|
|
726
|
+
// disable scroll on the body when dialog is open
|
|
727
|
+
if (this.open) {
|
|
728
|
+
document.body.style.overflow = 'hidden';
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
document.body.style.overflow = 'auto';
|
|
732
|
+
}
|
|
733
|
+
}
|
|
704
734
|
componentWillLoad() {
|
|
705
735
|
void this.init();
|
|
706
736
|
this.isMobile = isCheckoutMobile(this.mobile);
|
|
@@ -786,7 +816,7 @@ export class ZonosCheckout {
|
|
|
786
816
|
} }), h("zonos-collapse", {
|
|
787
817
|
// only collapsible on mobile
|
|
788
818
|
collapsed: this.collapseReviewMobile && this.isMobile
|
|
789
|
-
}, h("zonos-cart-items", null), this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", { submitBtnColor: submitButtonColor }), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))))), h("zonos-cart-restricted-items", null), !this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", null), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))))))), (cartStore.step === 'finish' || cartStore.step === 'error') && (h("div", { class: "zonos--done", "data-theme": rightSideTheme }, h("div", { class: "zonos--header" }, renderLogo(), h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.handleFinishClick(), theme: rightSideTheme })), h("zonos-checkout-finish", { borderRadius: style, onCloseClick: () => this.handleFinishClick(), overrideNotification: cartStore.step === 'error' && !!cartStore.error
|
|
819
|
+
}, h("zonos-cart-items", null), this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", { submitBtnColor: submitButtonColor }), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))))), h("zonos-cart-restricted-items", null), !this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", null), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))))))), (cartStore.step === 'finish' || cartStore.step === 'error') && (h("div", { class: "zonos--done", "data-theme": rightSideTheme }, h("div", { class: "zonos--header" }, renderLogo(), !this.isRedirectAfterOrder && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.handleFinishClick(), theme: rightSideTheme }))), h("zonos-checkout-finish", { borderRadius: style, onCloseClick: () => this.handleFinishClick(), overrideNotification: cartStore.step === 'error' && !!cartStore.error
|
|
790
820
|
? Object.assign(Object.assign({}, cartStore.error), { type: 'error' }) : undefined, storybookForceStatus: this.storybookPaymentStatusOverride }))), h("zonos-checkout-footer", { "data-theme": rightSideTheme, mobile: this.isMobile,
|
|
791
821
|
/**
|
|
792
822
|
* For this component, use slot instead of passing JSX through prop of other component. Because
|
|
@@ -1082,6 +1112,9 @@ export class ZonosCheckout {
|
|
|
1082
1112
|
}, {
|
|
1083
1113
|
"propName": "defaultAddress",
|
|
1084
1114
|
"methodName": "handleAddressChange"
|
|
1115
|
+
}, {
|
|
1116
|
+
"propName": "open",
|
|
1117
|
+
"methodName": "handleOpenChange"
|
|
1085
1118
|
}];
|
|
1086
1119
|
}
|
|
1087
1120
|
static get listeners() {
|
|
@@ -169,13 +169,13 @@ export class ZonosShipping {
|
|
|
169
169
|
if (this.showErrorBanner) {
|
|
170
170
|
this.showErrorBanner = !this.handleValidate();
|
|
171
171
|
}
|
|
172
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: '2a2502057e42ab9599273aa20fecad1e4a624616', class: "zonos--shipping zonos--elements" }, h("div", { key: 'b8e2c23a7092c1bce11497b9e0829fe966a10e0e', class: "zonos--group" }, h("zonos-text", { key: '5ce02ba2ba39c878262e0d3a0f1ac98b6759296d', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!this.serviceLevelsAll.length && (h("zonos-banner", { key: '8309265ef50d333aca63e32f41d0ca09a73777f7', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '55ccd680f24867269ec806e0a2e20c3edb4c70ea', 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 &&
|
|
173
173
|
!!this.serviceLevelsDAP.length && (h("button", { class: classes([
|
|
174
174
|
'zonos--shipping-options-collapse-trigger',
|
|
175
175
|
this.collapsedDAPOptions && 'collapsed',
|
|
176
176
|
]), onClick: () => {
|
|
177
177
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
178
|
-
} }, 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: '
|
|
178
|
+
} }, 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: '83a39e45d68dc4267efbf5392e3b18b75fd9cfe9', class: "zonos--group-btn" }, h("zonos-button", { key: '8872a09e5562f4165f10137cd549da1180c8d37c', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
179
179
|
// use primary type when on mobile mode
|
|
180
180
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
181
181
|
}
|
|
@@ -15,16 +15,16 @@ export class ZonosBadge {
|
|
|
15
15
|
this.dismissHandler = undefined;
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: 'ece8d31a527ef8fbd014669176c293798948c377', class: classes(['zonos--elements zonos--badge']), style: {
|
|
19
19
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
20
|
-
} }, h("div", { key: '
|
|
20
|
+
} }, h("div", { key: 'ae8c2e468abcf3c9aac336ccc28da4166ebd87f3', class: classes([
|
|
21
21
|
'zonos--badge-content',
|
|
22
22
|
this.badgeColor,
|
|
23
23
|
this.rounded && 'rounded',
|
|
24
24
|
this.iconRight && 'icon-right',
|
|
25
25
|
this.size,
|
|
26
26
|
this.bold && 'bold',
|
|
27
|
-
]) }, this.icon, h("zonos-text", { key: '
|
|
27
|
+
]) }, this.icon, h("zonos-text", { key: 'a1e710722e04c5ca32bc9c2731815da7de450ee0', textColor: `${this.badgeColor}-800` }, h("slot", { key: 'c3a277e50a1619899e76934e2f994c82dae5ddee' })), this.dismissHandler && (h("zonos-icon", { key: 'ee9fe774fdd59d94082bed6eb38d9f96ce33c67c', "aria-label": "Remove action", class: "zonos--badge-dismiss", content: RemoveLineIcon, onClick: () => { var _a; return (_a = this.dismissHandler) === null || _a === void 0 ? void 0 : _a.call(this); } })))));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "zonos-badge"; }
|
|
30
30
|
static get encapsulation() { return "shadow"; }
|
|
@@ -121,12 +121,12 @@ export class ZonosButton {
|
|
|
121
121
|
const borderStyle = getBorderRadius({
|
|
122
122
|
overrideBorderStyle: this.borderStyle,
|
|
123
123
|
});
|
|
124
|
-
return (h(Host, { key: '
|
|
124
|
+
return (h(Host, { key: '8228acc5ae59602336dc70227b3cc8c54e7455ed', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
|
|
125
125
|
'--zonos--background-color': backgroundColor,
|
|
126
126
|
'--zonos--border-radius': borderStyle,
|
|
127
127
|
'--zonos--color': color,
|
|
128
128
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
129
|
-
}) }, h("button", { key: '
|
|
129
|
+
}) }, h("button", { key: '0875fde30fd6d60a49a4850fd5d55450549664a7', class: classes([
|
|
130
130
|
this.hasIcon && 'has-icon',
|
|
131
131
|
this.hasContent && 'has-content',
|
|
132
132
|
this.noBackground && 'no-background',
|
|
@@ -141,7 +141,7 @@ export class ZonosButton {
|
|
|
141
141
|
backgroundColor && variant === 'standard' && 'override-background',
|
|
142
142
|
]), disabled: disabled, style: {
|
|
143
143
|
justifyContent: this.justifyContent,
|
|
144
|
-
} }, this.loading && (h("div", { key: '
|
|
144
|
+
} }, this.loading && (h("div", { key: '15f53929fe9d1bcc49c5b36a29a8c15d8673321f', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: '56c605d60ad2046a5075ab48712d7e0faeb83bc2', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: '1fd882d57cd362e8ccc79e8c21498d290062d31d', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
|
|
145
145
|
}
|
|
146
146
|
static get is() { return "zonos-button"; }
|
|
147
147
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,16 +22,16 @@ export class ZonosCard {
|
|
|
22
22
|
customRoundRadius: `${this.borderRadius}px`,
|
|
23
23
|
overrideBorderStyle: 'ROUNDED',
|
|
24
24
|
});
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '28c01fb7c6cb96ddeae955f2dd8a7820a921f84a', style: {
|
|
26
26
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
27
|
-
} }, h("div", { key: '
|
|
27
|
+
} }, h("div", { key: '6b23cbc03edf841f8243d766083265f9da9a207a', class: classes(['styled-card']), style: {
|
|
28
28
|
'--zonos--background-color': backgroundColor,
|
|
29
29
|
'--zonos--border-radius': borderRadius,
|
|
30
30
|
padding: this.spacing,
|
|
31
|
-
} }, this.label && (h("header", { key: '
|
|
31
|
+
} }, this.label && (h("header", { key: '1b5d4007d73c1351bd92c8d39ccc3db37718dfdf', class: "card-header", style: { padding: this.spacing } }, h("zonos-text", { key: '0fcbf910bd3ff5b37e35ca57202f2aded644c21f', type: "subheader" }, this.label), h("h-stack", { key: '64104e8d79e35adc420a6fa57204d70e8d84606d', spacing: 8 }, this.actions))), h("slot", { key: '64e7072f30efb2c60ac754512a03648125e1388c' }), (this.footerActions || this.footerContent) && (h("footer", { key: '7ab89016f8dbb8f5af65b28e2095163e8f908c86', class: "card-footer", style: {
|
|
32
32
|
height: this.footerHeight ? `${this.footerHeight}px` : 'auto',
|
|
33
33
|
padding: this.spacing,
|
|
34
|
-
} }, h("div", { key: '
|
|
34
|
+
} }, h("div", { key: 'd04e37cf5af9dd0e560f687837e0f2a56bd120ed' }, this.footerContent), h("h-stack", { key: '234c78bb23f4124809c86df4c78fb4f5f6832884', spacing: 8 }, this.footerActions))))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "zonos-card"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -36,14 +36,14 @@ export class ZonosCheckbox {
|
|
|
36
36
|
customRoundRadius: '4px',
|
|
37
37
|
overrideBorderStyle: this.borderStyle,
|
|
38
38
|
});
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'a5ac0531735ec33f61886845af2ca061dc08ddd3', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
40
40
|
'--zonos--background-color': backgroundColor,
|
|
41
41
|
'--zonos--border-radius': borderStyle,
|
|
42
42
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
43
43
|
'--zonos--size': `${this.size}px`,
|
|
44
|
-
} }, h("label", { key: '
|
|
44
|
+
} }, h("label", { key: 'a43282ec66f0bf45aadea3be194f37dfb71bcae3', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: '1249ee568cd5b503bf40ccfbabd698ad8079f1cb', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
|
|
45
45
|
this.checkboxSelected.emit(e.target.checked);
|
|
46
|
-
}, type: "checkbox" }), h("span", { key: '
|
|
46
|
+
}, type: "checkbox" }), h("span", { key: '65b6fb17e7ebb7160ce891d3f86a8ca0453a2f87', class: "checkmark-container" }, h("svg", { key: '9e58246871517832dfae28a92d9c4177e09eb095', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'c11830908d0dbfc929b77025b42a930f243cc587', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { key: 'af6464b76512b252b0adf24d04b17884f7af60f4', size: this.fontSize }, this.label)))));
|
|
47
47
|
}
|
|
48
48
|
static get is() { return "zonos-checkbox"; }
|
|
49
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -64,17 +64,17 @@ export class ZonosCheckoutProgressTabs {
|
|
|
64
64
|
color: labelSelectedColor,
|
|
65
65
|
})
|
|
66
66
|
: labelSelectedColor;
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '9470ce01401994f374045f8017403c532032a018', class: "zonos--elements", style: {
|
|
68
68
|
'--zonos--color': contrastLabelColor,
|
|
69
69
|
'--zonos--progress-percent': this.getTotalSuccessStep(),
|
|
70
|
-
} }, h("div", { key: '
|
|
70
|
+
} }, h("div", { key: '0008a7049833c6a149c236b692bb9bdfb30e2fb9', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
|
|
71
71
|
const isSelected = tab.value === selectedStep;
|
|
72
72
|
return (h("button", { class: classes([
|
|
73
73
|
'zonos--tab-item',
|
|
74
74
|
tab.value === selectedStep && 'selected',
|
|
75
75
|
tab.isDone && 'done',
|
|
76
76
|
]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cartStore.step = tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, translate(tab.label))));
|
|
77
|
-
})), h("div", { key: '
|
|
77
|
+
})), h("div", { key: 'ebc812e43e69a0e30814ad87697cd189cec773bf', class: "zonos--tab-progress" }, h("div", { key: '8a526bd9f0def3558e8652d408b001fbd0f1b332', class: "zonos--progress-bar-fill" }))));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "zonos-checkout-progress-tabs"; }
|
|
80
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -42,10 +42,10 @@ export class ZonosCollapse {
|
|
|
42
42
|
// set overflow to hidden to prevent content from showing when collapsed
|
|
43
43
|
this.el.style.overflow = 'hidden';
|
|
44
44
|
}
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '441ae4124bc658957136dae338ab1b22a72f7458', class: 'zonos--elements zonos--collapse', style: {
|
|
46
46
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
47
47
|
height: this.getElementHeight(),
|
|
48
|
-
} }, h("div", { key: '
|
|
48
|
+
} }, h("div", { key: 'a2771dd846a0e3b5e476d7c8a555539da292a6d6' }, h("iframe", { key: 'a4a140435d6bac406c144a01b9cb6702e8e60474', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: '4c91a4473d3ea25b7dfd4c54a2dbdbeca4439d12' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "zonos-collapse"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -83,13 +83,13 @@ export class ZonosConfirmDialog {
|
|
|
83
83
|
const borderStyle = getBorderRadius();
|
|
84
84
|
// Get theme for the update dialog, inherit from the theme, no from this component theme
|
|
85
85
|
const theme = getZonosStoreTheme(zonosStore.appearance.theme);
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: 'b53eb5a4ba60e5ca33e5b9295d8ce19425008b8d', class: classes([this.dialogOpen && 'open', 'zonos--elements']), "data-dialog-type": this.dialogType, "data-theme": theme, style: {
|
|
87
87
|
'--zonos--border-radius': borderStyle,
|
|
88
88
|
'--zonos--dialog-width': `${this.dialogWidth}px`,
|
|
89
89
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
90
|
-
} }, h("div", { key: '
|
|
90
|
+
} }, h("div", { key: '46c0992f489fb28fad0d66096ec2b1510211610e', class: "zonos--backdrop", tabIndex: -1 }), h("div", { key: '090956fa755d30988a24ca394b0347dff88863ac', "aria-hidden": "true", class: classes(['zonos--confirm-layout', this.dialogIntent]), onClick: e => this.clickOutsideDialogHandler(e) }, h("div", { key: '57d5f2426877eed074c8f28a5435f0c26eb39d3d', class: "zonos--confirm-dialog", onBlur: () => {
|
|
91
91
|
this.focusDialog();
|
|
92
|
-
} }, h("div", { key: '
|
|
92
|
+
} }, h("div", { key: '9989ec7f2b2485643cb0f06a4e36bc988b545a20', class: "wrapper" }, h("div", { key: '2f94abade0676cd863477c3b2030c0c04a746fbe', class: "icon-wrapper" }, this.renderIcon()), h("div", { key: '8826ac1a2ee3f54d2ae4b093f95137d42391221e', class: "content" }, h("div", { key: '02666146c0099cdc2828e22fcbb33baaf06c9a0f', class: "title" }, h("zonos-text", { key: '858617e7f7a56cbded100e3b27e359968bccd782', type: "subheader" }, this.dialogTitle)), this.dialogSubtitle && (h("div", { key: '5a897b7ff97ac9aa0b9118dc8b3aef3a12bf06fd', class: "subtitle" }, h("zonos-text", { key: '0bf9a781fa402b7c2c76005b896e25edf566f033', textColor: "gray-800" }, this.dialogSubtitle)))), h("div", { key: '25bbcb0b33dc39bd892293f41100754b387d3128', class: "footer" }, this.dialogType === 'confirm' && (h("zonos-button", { key: '23cd44b20343f21c71e0167d0fddb1d2440a6245', backgroundColor: "gray-0", class: "cancel-button", onClick: () => this.closeDialogHandler(), size: "lg", withBoxShadow: true }, this.dialogCancelBtnText || translate('Cancel'))), h("zonos-button", { key: '4ca070aca6b34a7d6841fd034177bc557eadd7f8', class: "confirm-button", onClick: () => this.confirmDialogHandler(), size: "lg", variant: this.getButtonConfirmVariant() }, this.dialogConfirmBtnText)))))));
|
|
93
93
|
}
|
|
94
94
|
static get is() { return "zonos-confirm-dialog"; }
|
|
95
95
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,9 +44,9 @@ export class ZonosCountrySelect {
|
|
|
44
44
|
? fuseObject.map(country => country.item)
|
|
45
45
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
46
46
|
const isEmpty = !filteredCountries.length;
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: 'ba350a068e05a5f98aba19702aa1fb485cbd7672', class: "zonos--elements", style: {
|
|
48
48
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
49
|
-
} }, h("div", { key: '
|
|
49
|
+
} }, h("div", { key: 'e997a8d0fa0d25c5f3eb3f5a8bc5cdb154fd788f', class: "zonos--country-select" }, h("zonos-v-stack", { key: '332297ccdf0ea81bdfaee93f448d4dc02fb9f960', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '66e86a39b9c309f63d509c8320e333c5b139ec94', handleOnClose: () => this.handleOnClose(), label: translate('Select a country') }, h("input", { key: '64b67b4b797b6df43a40830b41d33271de437abc', autocomplete: "off", autofocus: "autofocus", class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: translate('Search countries'), value: this.inputValue }))), h("div", { key: '10d2f74f30e782e867bb555957c74b52ec651889', class: "zonos--country-select-content" }, isEmpty && (h("zonos-text", { key: '875e8b15495df5fafe3b02dd11ab1b5f4b9650e3', class: "no-country", textColor: "gray-800" }, translate('No countries found'))), h("zonos-virtual-scroll", { key: 'aff0ae431a5350996cffa1188ed5d9338a8ca840', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index => {
|
|
50
50
|
const country = filteredCountries[index];
|
|
51
51
|
if (!country) {
|
|
52
52
|
return null;
|
|
@@ -8,9 +8,9 @@ export class ZonosCustomMessage {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const messageWithLinks = formatStringWithLinks(this.message);
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '11d2b3542e2637730acd686cb6f1bc53eb388a9a', class: "zonos--elements", style: {
|
|
12
12
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, this.message && (h("zonos-card", { key: '
|
|
13
|
+
} }, this.message && (h("zonos-card", { key: 'a0596fc233b89fba65df031575144b82dbb9a2c5', class: "zonos--custom-message", spacing: "12px" }, h("div", { key: 'eab51ba2e971e8d52abdd72e90d90ad251c034ad', class: "zonos--flex-message" }, h("zonos-icon", { key: '7f0f05190f5453399ab151ecc7bcdabf3e105709', "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { key: '3b750eebd76d5f41874525ffc53ba3ca87244253', innerHTML: messageWithLinks }))))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-custom-message"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -49,17 +49,10 @@ export class ZonosDialog {
|
|
|
49
49
|
this.isMobile = this.isMobileMode();
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
|
-
// disable scroll on the body when dialog is open
|
|
53
|
-
if (this.open) {
|
|
54
|
-
document.body.style.overflow = 'hidden';
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
document.body.style.overflow = 'auto';
|
|
58
|
-
}
|
|
59
52
|
const borderStyle = getBorderRadius({
|
|
60
53
|
overrideBorderStyle: this.borderStyle,
|
|
61
54
|
});
|
|
62
|
-
return (h(Host, { key: '
|
|
55
|
+
return (h(Host, { key: '506cffe43252a55397dc49ff230311ab38b7f049', class: classes([
|
|
63
56
|
'zonos--elements',
|
|
64
57
|
this.open && 'open',
|
|
65
58
|
this.isLoading && 'is-loading',
|
|
@@ -71,10 +64,10 @@ export class ZonosDialog {
|
|
|
71
64
|
'--zonos--height': this.height || 'initial',
|
|
72
65
|
'--zonos--min-height': this.minHeight || '500px',
|
|
73
66
|
'--zonos--width': this.width,
|
|
74
|
-
} }, h("div", { key: '
|
|
67
|
+
} }, h("div", { key: '42944e3338f04feca7cbc928bb12ebeba555c6a5', class: "zonos--backdrop" }), h("div", { key: 'b4e17568fbee4cbe15f745bf49efaab8d1be8b6e', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: '255c11f4c3dc5d2f28703b35a774f1d63078f0b0', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '48f1d08a3d2bbeb765be73f2c65dd566dbceebe4', class: "zonos--loading" }, h("zonos-spinner", { key: 'e0250720aefea8b5ac13000cd61a980e0e09e42f', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: 'bccb4783b92d4b90ab67faacbc6f888af3f52aa5', class: "zonos--header" }, this.headerText && (h("h3", { key: '79c0da7d43317142d177a03629cb3916d9f7923f', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: 'c835b4a928867c66aed65e0204503553cfe410eb', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), h("div", { key: '2c9612b655676ac82fb6a7cec268dd12ad0bd8f0', class: classes([
|
|
75
68
|
'zonos--body',
|
|
76
69
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
77
|
-
]) }, h("slot", { key: '
|
|
70
|
+
]) }, h("slot", { key: '035123e25049b21951bcfd0a765dd1eca0c50c99' })), h("slot", { key: '3b40b61cb3a234348689f33ce2376d58fbc2f0e7', name: "dialog-footer" })))));
|
|
78
71
|
}
|
|
79
72
|
static get is() { return "zonos-dialog"; }
|
|
80
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -17,17 +17,17 @@ export class ZonosInput {
|
|
|
17
17
|
this.inputChange.emit(newValue);
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '70d14250b09b4c2e8e865c00d10015f6d0f9a8da', class: classes([
|
|
21
21
|
'zonos--input zonos--elements',
|
|
22
22
|
this.inputSize,
|
|
23
23
|
this.isError && 'has-error',
|
|
24
24
|
]), style: {
|
|
25
25
|
'--zonos--border-radius': getBorderRadius(),
|
|
26
26
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
27
|
-
} }, h("div", { key: '
|
|
27
|
+
} }, h("div", { key: '1a7020e339f23c1aba8004b613ac4252a51e0686', class: classes([
|
|
28
28
|
'zonos--label-wrapper',
|
|
29
29
|
this.isDisabled && 'disabled',
|
|
30
|
-
]) }, h("input", { key: '
|
|
30
|
+
]) }, h("input", { key: '6a4ffdb5c8f2d0058bc7ebde5427a749cedd62d1', class: classes([
|
|
31
31
|
'zonos--floated-input',
|
|
32
32
|
!!this.inputLabel && 'has-label',
|
|
33
33
|
this.inputValue && 'has-content',
|
|
@@ -35,7 +35,7 @@ export class ZonosInput {
|
|
|
35
35
|
]), disabled: this.isDisabled, onInput: e => {
|
|
36
36
|
const input = e.target;
|
|
37
37
|
this.inputChange.emit(input.value);
|
|
38
|
-
}, placeholder: this.inputPlaceholder, type: "text", value: this.value }), h("label", { key: '
|
|
38
|
+
}, placeholder: this.inputPlaceholder, type: "text", value: this.value }), h("label", { key: '62408e5b16c51f9ccb88066e384391fc7c96f0ec', class: "zonos--floated-label", "data-label": this.inputLabel }))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "zonos-input"; }
|
|
41
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,9 +16,9 @@ export class ZonosLanguageSelect {
|
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
18
|
const { selectedLocale } = localizationStore;
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '38bd8435fdeb1a017b9ed7253d599b99f370a0b6', class: "zonos--elements", style: {
|
|
20
20
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
21
|
-
} }, h("div", { key: '
|
|
21
|
+
} }, h("div", { key: 'c7cffeecf5da28e323f60a5b4e3b292cfbe900bc', class: "zonos--language-select" }, h("zonos-select-dialog-header", { key: '331f76a0a0a57cbd9dbd282ba854956c183a75dd', handleOnClose: () => this.handleOnClose(), label: translate('Select a language') }), h("div", { key: '15743243ddbfb50dd533cf91254d6e41db7597a5', class: "zonos--language-select-content" }, languages.map(language => (h("button", { class: "zonos--language-select-button", onClick: () => this.languageSelected(language.code) }, h("zonos-text", { textColor: "gray-800" }, language.translatedLabel), language.code === selectedLocale && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 16 })))))))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "zonos-language-select"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,7 +7,7 @@ export class ZonosLink {
|
|
|
7
7
|
this.linkTitle = undefined;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '9c08d2689b011f162ef47271bd50e9e1fc2d177f', class: "zonos--elements" }, h("a", { key: 'ad0a8003308783081a7070bb9f06cd2387bb3a78', href: this.href, rel: this.rel, target: this.target, title: this.linkTitle }, h("slot", { key: 'd54f21f0f36196b9b5a0bf7f63a989e9dd1c411e' }))));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "zonos-link"; }
|
|
13
13
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,11 +10,11 @@ export class ZonosLogo {
|
|
|
10
10
|
const filterColor = this.theme === 'DARK'
|
|
11
11
|
? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'
|
|
12
12
|
: 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'ef19703a0588e4010e50c2e4bef5abe9eb48efc7', class: classes(['zonos--elements zonos--logo']), style: {
|
|
14
14
|
'--zonos--filter-color': filterColor,
|
|
15
15
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
16
16
|
'--zonos--width': this.width,
|
|
17
|
-
} }, h("img", { key: '
|
|
17
|
+
} }, h("img", { key: 'b14760baccb072ab399d11432fbc4c3c9c8ee876', alt: "Zonos Logo", src: getAssetPath('./assets/ZonosLogo.png') })));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "zonos-logo"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|
|
@@ -14,11 +14,11 @@ export class ZonosRestState {
|
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
16
|
const imageUrl = this.getImageRestState();
|
|
17
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: 'f7c1a1268bff06d00acbc20d0fc0b2a16d01398c', class: classes(['zonos--elements zonos--restState']), style: {
|
|
18
18
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
19
|
-
} }, h("div", { key: '
|
|
19
|
+
} }, h("div", { key: '0b66ca94e47e24b49af7e92ba5b34f70a9fe7f6b', class: "zonos--restState-image" }, h("img", { key: '22cfd5958bd55f5ebe0373f8afc2c332b66ed57b', alt: this.restStateType, onError: () => {
|
|
20
20
|
this.isErrorImageLoad = true;
|
|
21
|
-
}, src: imageUrl })), h("div", { key: '
|
|
21
|
+
}, src: imageUrl })), h("div", { key: '90f11551b07b4cc3597b336b932e9968aac9cb78', class: "content" }, h("zonos-text", { key: '23195baa5b5850adf26c948b1f65aec5a267ab88', class: "title", type: "boldSubheader" }, this.restStateTitle), h("zonos-text", { key: '333cb489d5e0df33062f8c64976c77f6130e36c6', class: "subtitle" }, this.restStateSubtitle)), h("div", { key: 'a1b7b14e0ca75914f4586bce93a93df767bc54e9', class: "action" }, h("slot", { key: '0edd004d97fc997147526ef56b581971eb1309f4' }))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "zonos-rest-state"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js
CHANGED
|
@@ -8,9 +8,9 @@ export class ZonosSelectDialogHeader {
|
|
|
8
8
|
this.label = '';
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '82ed89ddf7915df04bad887c887edb2cdd116ff8', class: "zonos--elements", style: {
|
|
12
12
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, h("zonos-v-stack", { key: '
|
|
13
|
+
} }, h("zonos-v-stack", { key: '6c91fb64db203a773f2fb375059173f2e0a4b7db', class: "zonos--select-dialog-header-wrapper", spacing: 8 }, h("div", { key: 'b26a23574556b119e27bf5fb0cb5308709b0eb73', class: "zonos--select-dialog-header" }, h("zonos-text", { key: '3347503084cae69ccfca1fe5a503174e2acecc3c', type: "boldLabel" }, this.label), h("zonos-button", { key: '66e91d6c0a46407cc88c4d269d880eaa27b650db', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close select dialog", content: RemoveIcon, size: 20 }), noBackground: true, onClick: () => this.handleOnClose() })), h("slot", { key: '2db7470d4893918939dd54d2f2e994f49517def9' }))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-select-dialog-header"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class ZonosToggle {
|
|
|
7
7
|
this.value = undefined;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '4b224821c94249757cbd19e27a75af29c9fbab25', class: classes(['zonos--elements zonos--toggle']), style: {
|
|
11
11
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: 'e8a3a44ccfebef2f06d94938c19aaf640d844d9e', class: "wrapper" }, this.options.map(option => {
|
|
13
13
|
const selected = option.value === this.value;
|
|
14
14
|
return (h("button", { class: classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
|
|
15
15
|
this.toggleChanged.emit(option.value);
|