@zonos/elements 1.3.81 → 1.3.82
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-97e693e4.js → cart-ba540c8e.js} +349 -64
- package/dist/cjs/{createCustomEvent-777b3fa7.js → createCustomEvent-1fd24ad8.js} +1 -3
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-16029169.js → paypal-6bbe55a7.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +11 -11
- package/dist/cjs/zonos-badge.cjs.entry.js +44 -0
- 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-badge_13.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +54 -69
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -4
- 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 +9 -9
- 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-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
- 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 +4 -4
- 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-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +10 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +73 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +8 -9
- package/dist/collection/components/common/zonos-badge/assets/RemoveLineIcon.svg +3 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.css +3 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +43 -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 +8 -7
- 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 -3
- 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-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 +17 -1
- package/dist/collection/components/store/checkout/stripe.js +119 -65
- package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
- package/dist/collection/components/store/translationStore/strings.base.js +9 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
- package/dist/collection/components/store/translationStore/strings.french.js +9 -0
- package/dist/collection/components/store/translationStore/strings.german.js +9 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
- 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/api/prepCalculateLandedCost.js +22 -0
- package/dist/collection/components/utils/api/trackConversionEvent.js +0 -2
- package/dist/collection/components/utils/api/triggerBuildLandedCost.js +1 -0
- package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +1 -1
- package/dist/esm/{cart-9bf6dece.js → cart-7df78f9f.js} +347 -65
- package/dist/esm/{createCustomEvent-a18e45a2.js → createCustomEvent-fcec608e.js} +1 -3
- package/dist/esm/index.js +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-edab4cee.js → paypal-a27aad03.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +11 -11
- package/dist/esm/zonos-badge.entry.js +40 -0
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card.entry.js +4 -4
- package/dist/esm/{zonos-badge_13.entry.js → zonos-cart-items_12.entry.js} +56 -70
- package/dist/esm/zonos-checkout.entry.js +4 -4
- 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 +9 -9
- 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-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- 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 +4 -4
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/cart-7df78f9f.js +1 -0
- package/dist/esm-es5/{createCustomEvent-a18e45a2.js → createCustomEvent-fcec608e.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-edab4cee.js → paypal-a27aad03.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -0
- 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_12.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-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-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/scripts/index.d.ts +45 -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-cart-subtotal/zonos-cart-subtotal.d.ts +12 -0
- package/dist/types/components/common/zonos-badge/zonos-badge.d.ts +9 -0
- package/dist/types/components/store/checkout/cart.d.ts +8 -1
- package/dist/types/components/store/checkout/stripe.d.ts +12 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +1 -0
- package/dist/types/components/utils/checkout/sortServiceLevelOptions.d.ts +3 -2
- package/dist/types/components.d.ts +34 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +2 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +12 -0
- package/dist/types/types/generated/graphql.internal.types.ts +9 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-264fbd27.entry.js → p-112a969c.entry.js} +1 -1
- package/dist/zonos-elements/{p-e3cb74fd.system.js → p-15651b06.system.js} +1 -1
- package/dist/zonos-elements/p-1a92ff9a.system.entry.js +1 -0
- package/dist/zonos-elements/p-2024313c.js +1 -0
- package/dist/zonos-elements/{p-1e4f7997.system.entry.js → p-22e81fee.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8cbbdd53.system.entry.js → p-270cc182.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d775bd42.entry.js → p-2c5e2163.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b8c8e0c.system.entry.js → p-2d2edb5a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2d2ff962.entry.js +1 -0
- package/dist/zonos-elements/{p-2a47d2cc.system.entry.js → p-38886017.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-811ed9bf.system.entry.js → p-4097a25b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-41f42a5c.entry.js → p-42636c5a.entry.js} +1 -1
- package/dist/zonos-elements/{p-92ba4082.system.entry.js → p-43e2de45.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d26d827d.system.js → p-4683797b.system.js} +1 -1
- package/dist/zonos-elements/{p-8dae668f.system.entry.js → p-4e06a2bb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-25633055.entry.js → p-58832515.entry.js} +1 -1
- package/dist/zonos-elements/{p-95f0ffd1.system.entry.js → p-59806a8e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-19fc5e11.system.entry.js → p-5d186fc7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-51f8c3d5.system.entry.js → p-5d4bde9c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3fc05a8.entry.js → p-6a5d714a.entry.js} +1 -1
- package/dist/zonos-elements/{p-fca6f444.entry.js → p-6a83b682.entry.js} +1 -1
- package/dist/zonos-elements/p-85600e22.system.entry.js +1 -0
- package/dist/zonos-elements/{p-bc4a147d.entry.js → p-8dd38974.entry.js} +1 -1
- package/dist/zonos-elements/p-8fd6ae63.js +1 -0
- package/dist/zonos-elements/{p-49478dba.system.js → p-957b1c1b.system.js} +1 -1
- package/dist/zonos-elements/{p-7be7bd28.entry.js → p-997c8f07.entry.js} +1 -1
- package/dist/zonos-elements/{p-97f0d9d2.entry.js → p-a4cdd4f2.entry.js} +1 -1
- package/dist/zonos-elements/p-aa899bf7.entry.js +1 -0
- package/dist/zonos-elements/{p-7ca0622f.js → p-acabfc47.js} +1 -1
- package/dist/zonos-elements/{p-a3e2592b.system.entry.js → p-ae7526a2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6de38759.entry.js → p-afad2fae.entry.js} +1 -1
- package/dist/zonos-elements/{p-e468f85e.entry.js → p-b09c3702.entry.js} +1 -1
- package/dist/zonos-elements/{p-a2fedd1c.entry.js → p-bf84416a.entry.js} +1 -1
- package/dist/zonos-elements/{p-a033685e.system.entry.js → p-c2b7b670.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-fac38f60.entry.js → p-cd17565d.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3200d5c.entry.js → p-cfd53396.entry.js} +1 -1
- package/dist/zonos-elements/{p-214724f8.system.entry.js → p-cffe7cc8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f7b5ae86.system.entry.js → p-d48f3bd3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ba05f1d6.system.entry.js → p-d621f462.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-df4deb97.entry.js → p-df83e30b.entry.js} +1 -1
- package/dist/zonos-elements/p-e7eb0a92.system.js +1 -0
- package/dist/zonos-elements/{p-f4765417.entry.js → p-e93b511f.entry.js} +1 -1
- package/dist/zonos-elements/{p-747eed39.entry.js → p-ea68ee1f.entry.js} +1 -1
- package/dist/zonos-elements/{p-de93cc65.system.entry.js → p-f68c38d8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d56f87ab.system.entry.js → p-f7bbdd0c.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-9bf6dece.js +0 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +0 -1
- package/dist/zonos-elements/p-23358611.js +0 -1
- package/dist/zonos-elements/p-62044821.system.js +0 -1
- package/dist/zonos-elements/p-6b4fec5a.js +0 -1
- package/dist/zonos-elements/p-6f821997.entry.js +0 -1
- package/dist/zonos-elements/p-d08ed3ea.system.entry.js +0 -1
|
@@ -27,17 +27,17 @@ const ZonosInput = class {
|
|
|
27
27
|
this.inputChange.emit(newValue);
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (index.h(index.Host, { key: '
|
|
30
|
+
return (index.h(index.Host, { key: '1ad1bc4853aa4f4c251e1ab8ac45be8d1e3e98b6', class: classes.classes([
|
|
31
31
|
'zonos--input zonos--elements',
|
|
32
32
|
this.inputSize,
|
|
33
33
|
this.isError && 'has-error',
|
|
34
34
|
]), style: {
|
|
35
35
|
'--border-radius': getBorderRadius.getBorderRadius(),
|
|
36
36
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
37
|
-
} }, index.h("div", { key: '
|
|
37
|
+
} }, index.h("div", { key: 'd2fe3cd5800983913523ab6fce01b19d57c94d9c', class: classes.classes([
|
|
38
38
|
'zonos--label-wrapper',
|
|
39
39
|
this.isDisabled && 'disabled',
|
|
40
|
-
]) }, index.h("input", { key: '
|
|
40
|
+
]) }, index.h("input", { key: 'e0493952e9171c24164f847be23a4462572df336', class: classes.classes([
|
|
41
41
|
'zonos--floated-input',
|
|
42
42
|
!!this.inputLabel && 'has-label',
|
|
43
43
|
this.inputValue && 'has-content',
|
|
@@ -45,7 +45,7 @@ const ZonosInput = class {
|
|
|
45
45
|
]), disabled: this.isDisabled, onInput: e => {
|
|
46
46
|
const input = e.target;
|
|
47
47
|
this.inputChange.emit(input.value);
|
|
48
|
-
}, placeholder: this.inputPlaceholder, type: "text", value: this.value }), index.h("label", { key: '
|
|
48
|
+
}, placeholder: this.inputPlaceholder, type: "text", value: this.value }), index.h("label", { key: 'f9733fa1eafc29354d3d6b045a05542927f3a5e1', class: "zonos--floated-label", "data-label": this.inputLabel }))));
|
|
49
49
|
}
|
|
50
50
|
get el() { return index.getElement(this); }
|
|
51
51
|
static get watchers() { return {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-ba540c8e.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -31,9 +31,9 @@ const ZonosLanguageSelect = class {
|
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
33
|
const { selectedLocale } = cart.localizationStore;
|
|
34
|
-
return (index.h(index.Host, { key: '
|
|
34
|
+
return (index.h(index.Host, { key: 'bea77d8916a999eade4d1201adbf37803b65901a', class: "zonos--elements", style: {
|
|
35
35
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
36
|
-
} }, index.h("div", { key: '
|
|
36
|
+
} }, index.h("div", { key: '7c16efd7518f5952dac402c1fc2993e110d78fef', class: "zonos--language-select" }, index.h("zonos-select-dialog-header", { key: '52c7626a8378bd7c956a3fa9d339a263f686f80a', handleOnClose: () => this.handleOnClose(), label: cart.translate('Select a language') }), index.h("div", { key: '6c00ad9b3270ae435ee32600651600a0a237ff07', class: "zonos--language-select-content" }, ILanguage.languages.map(language => (index.h("button", { class: "zonos--language-select-button", onClick: () => this.languageSelected(language.code) }, index.h("zonos-text", { textColor: "gray-800" }, language.translatedLabel), language.code === selectedLocale && (index.h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 16 })))))))));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
ZonosLanguageSelect.style = ZonosLanguageSelectStyle0;
|
|
@@ -50,9 +50,9 @@ const ZonosSelectDialogHeader = class {
|
|
|
50
50
|
this.label = '';
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
|
-
return (index.h(index.Host, { key: '
|
|
53
|
+
return (index.h(index.Host, { key: 'a1b2433a81210b6a0a78be3cb027f885cd870d2c', class: "zonos--elements", style: {
|
|
54
54
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
55
|
-
} }, index.h("zonos-v-stack", { key: '
|
|
55
|
+
} }, index.h("zonos-v-stack", { key: 'a9e61575c6c6c34c6097dd937dea7c199130f7f0', class: "zonos--select-dialog-header-wrapper", spacing: 8 }, index.h("div", { key: '266b89174f64825bec793bd30d44c1f75f220b1f', class: "zonos--select-dialog-header" }, index.h("zonos-text", { key: '7fd1f62f22610a2601497e897e98d5f5e0437601', type: "boldLabel" }, this.label), index.h("zonos-button", { key: 'afa95565fae19d97e038885f5244ee292f960a69', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close select dialog", content: RemoveIcon, size: 20 }), noBackground: true, onClick: () => this.handleOnClose() })), index.h("slot", { key: 'c28af84460321290623f17120ef1583aaf898105' }))));
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
ZonosSelectDialogHeader.style = ZonosSelectDialogHeaderStyle0;
|
|
@@ -16,7 +16,7 @@ const ZonosLink = class {
|
|
|
16
16
|
this.linkTitle = undefined;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (index.h(index.Host, { key: '
|
|
19
|
+
return (index.h(index.Host, { key: '86fc4a9a03329f66e7f635669ca95d1372a62446', class: "zonos--elements" }, index.h("a", { key: 'ff257fcff1ffcc7e7c659969df96e551afb7146c', href: this.href, rel: this.rel, target: this.target, title: this.linkTitle }, index.h("slot", { key: 'f5906c958642d7e5f4e7bb913febf778995a7dc6' }))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
ZonosLink.style = ZonosLinkStyle0;
|
|
@@ -19,11 +19,11 @@ const ZonosLogo = class {
|
|
|
19
19
|
const filterColor = this.theme === 'DARK'
|
|
20
20
|
? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'
|
|
21
21
|
: 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';
|
|
22
|
-
return (index.h(index.Host, { key: '
|
|
22
|
+
return (index.h(index.Host, { key: 'f20974d5ff501108c4a52d01773ab20219c8d389', class: classes.classes(['zonos--elements zonos--logo']), style: {
|
|
23
23
|
'--filter-color': filterColor,
|
|
24
24
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
25
25
|
'--width': this.width,
|
|
26
|
-
} }, index.h("img", { key: '
|
|
26
|
+
} }, index.h("img", { key: 'd7acc90de67c51594abd44903c9fcb0b3e10a8bc', alt: "Zonos Logo", src: index.getAssetPath('./assets/ZonosLogo.png') })));
|
|
27
27
|
}
|
|
28
28
|
static get assetsDirs() { return ["assets"]; }
|
|
29
29
|
};
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-ba540c8e.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
|
-
const paypal = require('./paypal-
|
|
10
|
+
const paypal = require('./paypal-6bbe55a7.js');
|
|
11
11
|
require('./isDarkColor-5efc8367.js');
|
|
12
12
|
require('./getBorderRadius-5a64574c.js');
|
|
13
13
|
|
|
@@ -110,7 +110,7 @@ const ZonosPayment = class {
|
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
112
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
113
|
-
return (index.h(index.Host, { key: '
|
|
113
|
+
return (index.h(index.Host, { key: 'c461a967d00b2d96fa70aaaf1651b435cdcd84bd', class: "zonos--payment zonos--elements" }, this.titleText && (index.h("zonos-text", { key: '44da1d89ce19f7174cad1214ab9463f0b1174c0d', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("div", { key: 'b9e3491b48d9ede19a5cdef639bd47e6bf0ba742', class: "zonos--payment-component" }), index.h("div", { key: '578516ce1ca1dc01eebb2268bb5449613e14298f', class: "zonos--payment-paypal-container" })));
|
|
114
114
|
}
|
|
115
115
|
get el() { return index.getElement(this); }
|
|
116
116
|
static get watchers() { return {
|
|
@@ -164,7 +164,7 @@ const ZonosPaypalPayment = class {
|
|
|
164
164
|
void this.loadPaypal();
|
|
165
165
|
}
|
|
166
166
|
render() {
|
|
167
|
-
return (index.h(index.Host, { key: '
|
|
167
|
+
return (index.h(index.Host, { key: '6bfc962de500edbb105b7eb899711e48def78167', class: "zonos--paypal-payment zonos--elements" }, index.h("div", { key: '92d1b1c416f5e233c54e50d47129be375ef0a68b', class: "zonos--payment-paypal-container" })));
|
|
168
168
|
}
|
|
169
169
|
get el() { return index.getElement(this); }
|
|
170
170
|
};
|
|
@@ -16,10 +16,10 @@ const ZonosTooltip = class {
|
|
|
16
16
|
this.showTooltip = false;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (index.h(index.Host, { key: '
|
|
19
|
+
return (index.h(index.Host, { key: '091516a0a68f8b4ab2580a8118900c34b39e931c', class: "zonos--elements" }, index.h("div", { key: '77769b18201f87d601d5bdb860a4bc8c84bb4e90', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, index.h("slot", { key: '139c1de415b94e12b8d575e3662cba9faf56cb2f' }), index.h("div", { key: '60c38adf74e9b776001844c2205ac87a4562b525', class: classes.classes([
|
|
20
20
|
this.showTooltip && 'zonos--show-tooltip',
|
|
21
21
|
'zonos--tooltip-content',
|
|
22
|
-
]) }, index.h("zonos-text", { key: '
|
|
22
|
+
]) }, index.h("zonos-text", { key: 'bb87c44ee7831c24b47c43b17d2b04c79112e900', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), index.h("zonos-text", { key: '5d114d284a15a1661e926bfe5fae9251513c7370', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
ZonosTooltip.style = ZonosTooltipStyle0;
|
|
@@ -15,9 +15,9 @@ const VStack = class {
|
|
|
15
15
|
this.spacing = 24;
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (index.h(index.Host, { key: '
|
|
18
|
+
return (index.h(index.Host, { key: 'fca41f57f80879bf7cb32fa7858777a26a36755d', style: {
|
|
19
19
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
20
|
-
} }, index.h("div", { key: '
|
|
20
|
+
} }, index.h("div", { key: '8b608328327817a540c56dca58ad32ebe622d48e', class: classes.classes(['vstack']), style: { 'grid-row-gap': `${this.spacing}px` } }, index.h("slot", { key: 'c29eeb4c2d0f781bdca44d355d2da75e15576d86' }))));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
VStack.style = ZonosVStackStyle0;
|
package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js
CHANGED
|
@@ -17,7 +17,7 @@ export class ZonosCartItems {
|
|
|
17
17
|
this.errorImages = [...this.errorImages, itemImg];
|
|
18
18
|
}, src: item.imageUrl, style: {
|
|
19
19
|
'min-width': '40px',
|
|
20
|
-
}, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label"
|
|
20
|
+
}, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label" }, item.name), h("zonos-text", { textColor: "gray-600", type: "caption" }, translate('Quantity'), ": ", item.quantity)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel", weight: 600 }, currencyFormat({
|
|
21
21
|
amount: item.amount * rate * item.quantity,
|
|
22
22
|
currency: cartStore.currency,
|
|
23
23
|
})))));
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
gap: 8px;
|
|
55
55
|
}
|
|
56
56
|
:host .zonos--cart-subtotal-title,
|
|
57
|
-
:host .zonos--cart-subtotal-price
|
|
57
|
+
:host .zonos--cart-subtotal-price,
|
|
58
|
+
:host .zonos--cart-promo-code-col {
|
|
58
59
|
border-bottom: 1px solid var(--zonos-elements-gray-200);
|
|
59
60
|
}
|
|
60
61
|
:host .zonos--cart-duty-tax-price {
|
|
@@ -72,4 +73,12 @@
|
|
|
72
73
|
:host .zonos--cart-subtotal-price zonos-text,
|
|
73
74
|
:host .zonos--cart-pay-total zonos-text {
|
|
74
75
|
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
:host .zonos--cart-promo-code-input-wrapper {
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: 16px;
|
|
80
|
+
align-items: center;
|
|
81
|
+
}
|
|
82
|
+
:host .zonos--cart-promo-code-input {
|
|
83
|
+
flex: 1;
|
|
75
84
|
}
|
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
import { Fragment, h, Host } from "@stencil/core";
|
|
2
2
|
import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
|
|
3
|
+
import { stripeStoreApplyPromoCode, stripeStoreRemovePromoCode, } from "../../../store/checkout/stripe";
|
|
3
4
|
import { translate } from "../../../store/translationStore";
|
|
4
5
|
import { currencyFormat } from "../../../utils/hello/currencyConversion/currencyFormat";
|
|
5
6
|
export class ZonosCartSubtotal {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.submitBtnType = undefined;
|
|
9
|
+
this.submitBtnColor = undefined;
|
|
10
|
+
this.loading = false;
|
|
11
|
+
}
|
|
6
12
|
render() {
|
|
13
|
+
var _a, _b, _c, _d, _e;
|
|
7
14
|
const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
|
|
8
15
|
// Show 0 for subtotal and total when all items are restricted
|
|
9
16
|
const total = cartStoreHasOneEligibleItem() ? cartStore.total : 0;
|
|
10
17
|
const subtotal = cartStoreHasOneEligibleItem() ? cartStore.subtotal : 0;
|
|
18
|
+
const appliedPromoCode = (_e = (_d = (_c = (_b = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.find(Boolean)) === null || _b === void 0 ? void 0 : _b.landedCost.appliedAdjustments) === null || _c === void 0 ? void 0 : _c.find(x => { var _a; return ((_a = x.adjustment) === null || _a === void 0 ? void 0 : _a.source) === 'PROMO_CODE'; })) === null || _d === void 0 ? void 0 : _d.adjustment) === null || _e === void 0 ? void 0 : _e.name;
|
|
19
|
+
const applyPromoCode = async () => {
|
|
20
|
+
// Promo code apply button is clicked
|
|
21
|
+
cartStore.promoCodeApplied = true;
|
|
22
|
+
// Reset promo code highlight error state
|
|
23
|
+
cartStore.promoCodeError = false;
|
|
24
|
+
this.loading = true;
|
|
25
|
+
await stripeStoreApplyPromoCode();
|
|
26
|
+
this.loading = false;
|
|
27
|
+
};
|
|
28
|
+
const removePromoCode = async () => {
|
|
29
|
+
// Reset promo code highlight error state
|
|
30
|
+
cartStore.promoCodeError = false;
|
|
31
|
+
this.loading = true;
|
|
32
|
+
await stripeStoreRemovePromoCode();
|
|
33
|
+
this.loading = false;
|
|
34
|
+
};
|
|
11
35
|
const renderShippingInfo = () => {
|
|
12
36
|
if (!cartStore.selectedShippingOption) {
|
|
13
37
|
return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Shipping')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('No shipping method selected'))));
|
|
@@ -27,7 +51,7 @@ export class ZonosCartSubtotal {
|
|
|
27
51
|
amount: cartStore.dutiesTaxFees,
|
|
28
52
|
currency: cartStore.currency,
|
|
29
53
|
})
|
|
30
|
-
: '-')))), !!cartStore.adjustmentTotal && (h("tr", { class: "zonos--row zonos--cart-duties" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Discounts')))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, currencyFormat({
|
|
54
|
+
: '-')))), cartStore.step !== 'customer-info' && (h("tr", { class: "zonos--row zonos--cart-promo-code" }, h("td", { class: "zonos--column" }), !!appliedPromoCode ? (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-promo-code-col" }, this.loading ? (h("zonos-spinner", { size: 16 })) : (h("zonos-badge", { dismissHandler: () => removePromoCode() }, cartStore.promoCode))), h("td", { class: "zonos--column zonos--cart-promo-code-col" }))) : (h("td", { class: "zonos--column zonos--cart-promo-code-col", colSpan: 2 }, h("div", { class: "zonos--cart-promo-code-input-wrapper" }, h("zonos-input", { class: "zonos--cart-promo-code-input", inputLabel: translate('Add promotional code'), inputValue: cartStore.promoCode, isError: cartStore.promoCodeError, onInputChange: e => (cartStore.promoCode = e.detail.trim()) }), h("zonos-button", { loading: this.loading, onClick: () => applyPromoCode(), variant: "primary" }, translate('Apply'))))))), !!cartStore.adjustmentTotal && (h("tr", { class: "zonos--row zonos--cart-duties" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Discounts')))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, currencyFormat({
|
|
31
55
|
amount: cartStore.adjustmentTotal,
|
|
32
56
|
currency: cartStore.currency,
|
|
33
57
|
}))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, currencyFormat({
|
|
@@ -48,4 +72,52 @@ export class ZonosCartSubtotal {
|
|
|
48
72
|
};
|
|
49
73
|
}
|
|
50
74
|
static get assetsDirs() { return ["assets"]; }
|
|
75
|
+
static get properties() {
|
|
76
|
+
return {
|
|
77
|
+
"submitBtnType": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "HTMLZonosButtonElement['variant']",
|
|
82
|
+
"resolved": "\"danger\" | \"outline\" | \"primary\" | \"standard\" | \"subtle\" | \"success\" | \"warning\" | undefined",
|
|
83
|
+
"references": {
|
|
84
|
+
"HTMLZonosButtonElement": {
|
|
85
|
+
"location": "global",
|
|
86
|
+
"id": "global::HTMLZonosButtonElement"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": true,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Button type of the submit button"
|
|
95
|
+
},
|
|
96
|
+
"attribute": "submit-btn-type",
|
|
97
|
+
"reflect": false
|
|
98
|
+
},
|
|
99
|
+
"submitBtnColor": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string | undefined",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": true,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Button color of the submit button"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "submit-btn-color",
|
|
114
|
+
"reflect": false
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
static get states() {
|
|
119
|
+
return {
|
|
120
|
+
"loading": {}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
51
123
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
2
|
import { cartStore } from "../../../store/checkout/cart";
|
|
3
3
|
import { paypalStore, paypalStoreReset, } from "../../../store/checkout/paypal";
|
|
4
|
-
import { stripeStore, stripeStoreMessageBasedOnStatus, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
|
|
4
|
+
import { stripeStore, stripeStoreMessageBasedOnStatus, stripeStoreReset, stripeStoreResetPromoCode, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
|
|
5
5
|
import { translate } from "../../../store/translationStore";
|
|
6
6
|
import { zonosStore } from "../../../store/zonosStore";
|
|
7
7
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
@@ -195,6 +195,8 @@ export class ZonosCheckoutFinish {
|
|
|
195
195
|
// wait this to finish before resetting store and checkout session id
|
|
196
196
|
await this.getPullOrder();
|
|
197
197
|
}
|
|
198
|
+
// reset promo when checkout is finished
|
|
199
|
+
stripeStoreResetPromoCode();
|
|
198
200
|
this.isLoading = false;
|
|
199
201
|
stripeStoreReset();
|
|
200
202
|
paypalStoreReset();
|
|
@@ -233,11 +235,11 @@ export class ZonosCheckoutFinish {
|
|
|
233
235
|
var _a, _b;
|
|
234
236
|
const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || getGraphQlShortId((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
|
|
235
237
|
const isTestMode = getIsTestMode();
|
|
236
|
-
return (h(Host, { key: '
|
|
238
|
+
return (h(Host, { key: '9939772d4ce4213978ae6b02b4cd5345d15dbdfd', class: "zonos--checkout-finish zonos--elements", style: {
|
|
237
239
|
'--border-radius': getBorderRadius({
|
|
238
240
|
overrideBorderStyle: this.borderRadius,
|
|
239
241
|
}),
|
|
240
|
-
} }, this.isLoading && (h("div", { key: '
|
|
242
|
+
} }, this.isLoading && (h("div", { key: '491d4d0ba3dc487d448606009a30a5ce8d3bb86e', class: "loading-wrapper" }, h("zonos-spinner", { key: '3179aeb472d3e70628d3f1e3e2b76ed3d622145d' }))), !this.isLoading && (h("div", { key: '6044c9d1ac7599d9168f944dcf82028669fd1f37', class: "zonos--finish-details" }, h("div", { key: 'd22ec981a73db08e4871c8babe29f9a09a5bc29d', 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: 'bfef33fd319456253e07c3ef3f81da1b85414df9', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("div", { key: 'f056c93644d1f9defa263f59111874f154293b51', class: "zonos--order-number" }, "Order #", orderId)), h("zonos-text", { key: '69d38c4640943a5cfdcef5ea6951ddec9c7b8a84', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: 'fbb2d1cc0baab99a3312f2077c28cb9d51b4eb44', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: '7b63fd838f850ce6a5acf4970fa66657ca05e235', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '85035826e36d52ccf8c77aa6ba6e27173fccdaa6', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'd3848fdbdf1380dce49fcbc2b2903d99ce65247d', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
|
|
241
243
|
}
|
|
242
244
|
static get is() { return "zonos-checkout-finish"; }
|
|
243
245
|
static get encapsulation() { return "shadow"; }
|
|
@@ -602,7 +602,7 @@ export class ZonosCheckout {
|
|
|
602
602
|
} }), h("zonos-collapse", {
|
|
603
603
|
// only collapsible on mobile
|
|
604
604
|
collapsed: this.collapseReviewMobile && this.isMobile
|
|
605
|
-
}, h("zonos-cart-items", null), this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal",
|
|
605
|
+
}, 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
|
|
606
606
|
? Object.assign(Object.assign({}, cartStore.error), { type: 'error' }) : undefined, storybookForceStatus: this.storybookPaymentStatusOverride }))), h("zonos-checkout-footer", { "data-theme": rightSideTheme, mobile: this.isMobile,
|
|
607
607
|
/**
|
|
608
608
|
* For this component, use slot instead of passing JSX through prop of other component. Because
|
|
@@ -2,7 +2,6 @@ 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 { sortServiceLevelOptions } from "../../../utils/checkout/sortServiceLevelOptions";
|
|
6
5
|
import { currencyFormat } from "../../../utils/hello/currencyConversion/currencyFormat";
|
|
7
6
|
import { submitGtag } from "../../../utils/submitGtag";
|
|
8
7
|
export class ZonosShipping {
|
|
@@ -81,8 +80,7 @@ export class ZonosShipping {
|
|
|
81
80
|
};
|
|
82
81
|
})) || []);
|
|
83
82
|
})) || [];
|
|
84
|
-
|
|
85
|
-
this.serviceLevels = sortServiceLevelOptions(serviceLevels);
|
|
83
|
+
this.serviceLevels = serviceLevels;
|
|
86
84
|
};
|
|
87
85
|
this.continueLoading = false;
|
|
88
86
|
this.submitBtnColor = undefined;
|
|
@@ -101,12 +99,13 @@ export class ZonosShipping {
|
|
|
101
99
|
return;
|
|
102
100
|
}
|
|
103
101
|
const firstServiceLevel = this.serviceLevels.find(Boolean);
|
|
104
|
-
if (firstServiceLevel) {
|
|
105
|
-
|
|
106
|
-
void this.handleRadioSelected({
|
|
107
|
-
detail: firstServiceLevel,
|
|
108
|
-
});
|
|
102
|
+
if (!firstServiceLevel) {
|
|
103
|
+
return;
|
|
109
104
|
}
|
|
105
|
+
// preselect the first shipping method
|
|
106
|
+
void this.handleRadioSelected({
|
|
107
|
+
detail: firstServiceLevel,
|
|
108
|
+
});
|
|
110
109
|
}
|
|
111
110
|
render() {
|
|
112
111
|
var _a, _b, _c;
|
|
@@ -114,7 +113,7 @@ export class ZonosShipping {
|
|
|
114
113
|
if (this.showErrorBanner) {
|
|
115
114
|
this.showErrorBanner = !this.handleValidate();
|
|
116
115
|
}
|
|
117
|
-
return (h(Host, { key: '
|
|
116
|
+
return (h(Host, { key: '8b65a52f870ea2274ebca2a007d3dd15d019bc40', class: "zonos--shipping zonos--elements" }, h("div", { key: '0c0d7b7d156ee6a7a1914bbcfb4f835efb8900ba', class: "zonos--group" }, h("zonos-text", { key: '3a761f88410f83eb3b4fdf91351c3ab7fcb65548', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.length) && (h("zonos-banner", { key: '717aa9228e46f55ad6df5788abca033830431576', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'ece89e491a72c39eea128aaf6cbefe71242ef651', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_b = this.serviceLevels) === null || _b === void 0 ? void 0 : _b.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.'), intent: "error" })) : (h("zonos-shipping-rich-radio", { initialSelectedValue: (_c = this.selectedShippingMethod) === null || _c === void 0 ? void 0 : _c.value, items: this.serviceLevels, onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { key: 'f5f64b048cbf2faf582d3167c7cc2e6f1722323a', class: "zonos--group-btn" }, h("zonos-button", { key: '994b883f870cbad249bc311bf25c2d2e946a3ccb', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
118
117
|
// use primary type when on mobile mode
|
|
119
118
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
120
119
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8282 5.17184C11.0235 5.3671 11.0235 5.68368 10.8282 5.87894L8.70688 8.00026L10.8282 10.1216C11.0235 10.3168 11.0235 10.6334 10.8282 10.8287C10.6329 11.024 10.3164 11.024 10.1211 10.8287L7.99978 8.70737L5.87846 10.8287C5.68319 11.024 5.36661 11.024 5.17135 10.8287C4.97609 10.6334 4.97609 10.3168 5.17135 10.1216L7.29267 8.00026L5.17135 5.87894C4.97609 5.68368 4.97609 5.3671 5.17135 5.17184C5.36661 4.97658 5.68319 4.97658 5.87846 5.17184L7.99978 7.29316L10.1211 5.17184C10.3164 4.97658 10.6329 4.97658 10.8282 5.17184Z" fill="var(--zonos-elements-gray-800)"/>
|
|
3
|
+
</svg>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { zonosStoreFontFamily } from "../../store/zonosStore";
|
|
3
3
|
import { classes } from "../../utils/classes";
|
|
4
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
5
|
+
import RemoveLineIcon from "./assets/RemoveLineIcon.svg";
|
|
4
6
|
export class ZonosBadge {
|
|
5
7
|
constructor() {
|
|
6
8
|
this.bold = false;
|
|
@@ -9,18 +11,20 @@ export class ZonosBadge {
|
|
|
9
11
|
this.iconRight = false;
|
|
10
12
|
this.size = 'default';
|
|
11
13
|
this.rounded = false;
|
|
14
|
+
this.loading = false;
|
|
15
|
+
this.dismissHandler = undefined;
|
|
12
16
|
}
|
|
13
17
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: '9704ae6d10af4b720e1edf9ccc0263d4463e64f2', class: classes(['zonos--elements zonos--badge']), style: {
|
|
15
19
|
'--font-family': zonosStoreFontFamily(),
|
|
16
|
-
} }, h("div", { key: '
|
|
20
|
+
} }, h("div", { key: 'e395b7477591edff91059aefc4d3858f45d61098', class: classes([
|
|
17
21
|
'zonos--badge-content',
|
|
18
22
|
this.badgeColor,
|
|
19
23
|
this.rounded && 'rounded',
|
|
20
24
|
this.iconRight && 'icon-right',
|
|
21
25
|
this.size,
|
|
22
26
|
this.bold && 'bold',
|
|
23
|
-
]) }, this.icon, h("zonos-text", { key: '
|
|
27
|
+
]) }, this.icon, h("zonos-text", { key: '92eeb162849c9036bb102012e14fb6476b34b411', textColor: `${this.badgeColor}-800` }, h("slot", { key: '3a52067262d1ba34eb5952dc2f2eaeeb1daa624c' })), this.dismissHandler && (h("zonos-icon", { key: '7bb94d2b2204c81e7c21e31fe2769de2e0f0c19b', "aria-label": "Remove promo code", class: "zonos--badge-dismiss", content: RemoveLineIcon, onClick: () => { var _a; return (_a = this.dismissHandler) === null || _a === void 0 ? void 0 : _a.call(this); } })))));
|
|
24
28
|
}
|
|
25
29
|
static get is() { return "zonos-badge"; }
|
|
26
30
|
static get encapsulation() { return "shadow"; }
|
|
@@ -169,6 +173,42 @@ export class ZonosBadge {
|
|
|
169
173
|
"attribute": "rounded",
|
|
170
174
|
"reflect": false,
|
|
171
175
|
"defaultValue": "false"
|
|
176
|
+
},
|
|
177
|
+
"loading": {
|
|
178
|
+
"type": "boolean",
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "boolean",
|
|
182
|
+
"resolved": "boolean",
|
|
183
|
+
"references": {}
|
|
184
|
+
},
|
|
185
|
+
"required": false,
|
|
186
|
+
"optional": false,
|
|
187
|
+
"docs": {
|
|
188
|
+
"tags": [{
|
|
189
|
+
"name": "default",
|
|
190
|
+
"text": "false"
|
|
191
|
+
}],
|
|
192
|
+
"text": "Whether or not the badge is loading"
|
|
193
|
+
},
|
|
194
|
+
"attribute": "loading",
|
|
195
|
+
"reflect": false,
|
|
196
|
+
"defaultValue": "false"
|
|
197
|
+
},
|
|
198
|
+
"dismissHandler": {
|
|
199
|
+
"type": "unknown",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "() => void",
|
|
203
|
+
"resolved": "(() => void) | undefined",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": true,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": "Callback for when the badge is dismissed. Also determines if dismiss icon shown."
|
|
211
|
+
}
|
|
172
212
|
}
|
|
173
213
|
};
|
|
174
214
|
}
|
|
@@ -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: 'c8e781921a30afccbbe3dd187632aa06135420df', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
|
|
125
125
|
'--background-color': backgroundColor,
|
|
126
126
|
'--border-radius': borderStyle,
|
|
127
127
|
'--color': color,
|
|
128
128
|
'--font-family': zonosStoreFontFamily(),
|
|
129
|
-
}) }, h("button", { key: '
|
|
129
|
+
}) }, h("button", { key: '1783400cd4ae43832789ba63649b7962d7e08d6c', 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: '7f1c3907f9dbbc42613db7b976d358d477caaac4', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: 'be0002a169ebf26eb4bbf65f5a057840a90fe937', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: '4204bc86e934884015fcd09be7ffe79931f5c112', 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: 'eb938f526afeb2d8c70b3ce6d5e219fb82dccd4b', style: {
|
|
26
26
|
'--font-family': zonosStoreFontFamily(),
|
|
27
|
-
} }, h("div", { key: '
|
|
27
|
+
} }, h("div", { key: 'd1c94fc6d2f2bc4fa157901116209a0ec2b2c6bc', class: classes(['styled-card']), style: {
|
|
28
28
|
'--background-color': backgroundColor,
|
|
29
29
|
'--border-radius': borderRadius,
|
|
30
30
|
padding: this.spacing,
|
|
31
|
-
} }, this.label && (h("header", { key: '
|
|
31
|
+
} }, this.label && (h("header", { key: 'c91e1e4620f6c16a51cb0240528cf17de5f65192', class: "card-header", style: { padding: this.spacing } }, h("zonos-text", { key: 'c0516125052b5369f49fa90696f0f1ff9707cd76', type: "subheader" }, this.label), h("h-stack", { key: '025ee9b66a9f0d354efe41e16cbe7f78ea74cdf5', spacing: 8 }, this.actions))), h("slot", { key: '27805390a0d386f68f65cd23f86e04c5489eb291' }), (this.footerActions || this.footerContent) && (h("footer", { key: '7a6d615316e46f32f2dd70988c425edb99089fd9', 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: '72c6cba3976cfcaf693af897db891c015bba7cd6' }, this.footerContent), h("h-stack", { key: 'c52f116dae77617934090a33a89602f0f4bd5c5a', 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: '8613d885c639d01671743dbdb0583c390718c732', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
40
40
|
'--background-color': backgroundColor,
|
|
41
41
|
'--border-radius': borderStyle,
|
|
42
42
|
'--font-family': zonosStoreFontFamily(),
|
|
43
43
|
'--size': `${this.size}px`,
|
|
44
|
-
} }, h("label", { key: '
|
|
44
|
+
} }, h("label", { key: '803434d7a63e1735bf0ef15a9e4c7fb515bfff41', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: 'a19a46a896597f4c47d4ec790a21b5133c13b952', 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: '7f4b933f9626bc05f052d79fa25a0c46ee16f492', class: "checkmark-container" }, h("svg", { key: '775d0b011a1430f712e8f633e2850d6f6e193f36', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'eef97178731ac1bf9885d5cfd57afa514c20df5f', "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: '0f72347f0b21817cd176393219374008a056b590', size: this.fontSize }, this.label)))));
|
|
47
47
|
}
|
|
48
48
|
static get is() { return "zonos-checkbox"; }
|
|
49
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -52,28 +52,29 @@ export class ZonosCheckoutProgressTabs {
|
|
|
52
52
|
render() {
|
|
53
53
|
const selectedStep = cartStore.step;
|
|
54
54
|
const labelSelectedColor = this.tabColor || zonosStore.appearance.colorSecondary;
|
|
55
|
+
const backgroundColor = this.backgroundColor || zonosStore.appearance.colorPrimary || '';
|
|
55
56
|
// If the background color and the tab color are not contrat enough, increase the contrast of the label color
|
|
56
|
-
const contrastLabelColor =
|
|
57
|
+
const contrastLabelColor = backgroundColor && labelSelectedColor
|
|
57
58
|
? getContrastColor({
|
|
58
|
-
backgroundColor: isColorVariable(
|
|
59
|
+
backgroundColor: isColorVariable(backgroundColor)
|
|
59
60
|
? window
|
|
60
61
|
.getComputedStyle(this.ele)
|
|
61
|
-
.getPropertyValue(`--zonos-elements-${
|
|
62
|
-
:
|
|
62
|
+
.getPropertyValue(`--zonos-elements-${backgroundColor.replace('--zonos-elements-', '')}`)
|
|
63
|
+
: backgroundColor,
|
|
63
64
|
color: labelSelectedColor,
|
|
64
65
|
})
|
|
65
66
|
: labelSelectedColor;
|
|
66
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'f7310a3631e3a1061d8f08af0fc7337fb0a6be26', class: "zonos--elements", style: {
|
|
67
68
|
'--color': contrastLabelColor,
|
|
68
69
|
'--progress-percent': this.getTotalSuccessStep(),
|
|
69
|
-
} }, h("div", { key: '
|
|
70
|
+
} }, h("div", { key: 'fafce1662609cf7c966d9062ef55594d43e58643', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
|
|
70
71
|
const isSelected = tab.value === selectedStep;
|
|
71
72
|
return (h("button", { class: classes([
|
|
72
73
|
'zonos--tab-item',
|
|
73
74
|
tab.value === selectedStep && 'selected',
|
|
74
75
|
tab.isDone && 'done',
|
|
75
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-1200', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1200' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, translate(tab.label))));
|
|
76
|
-
})), h("div", { key: '
|
|
77
|
+
})), h("div", { key: '3d2a5c5289a694bf6ec8e93ba15ee4f79123d149', class: "zonos--tab-progress" }, h("div", { key: '7d6ea3e0c81cdb354ccf31748bf88d1937037c52', class: "zonos--progress-bar-fill" }))));
|
|
77
78
|
}
|
|
78
79
|
static get is() { return "zonos-checkout-progress-tabs"; }
|
|
79
80
|
static get encapsulation() { return "shadow"; }
|