@zonos/elements 1.3.218 → 1.3.219
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/buildCartItemsByTempCart-309fcebf.js +28 -0
- package/dist/cjs/{cart-c54d05ce.js → cart-9a2b32e4.js} +90 -47
- package/dist/cjs/cleanHtmlMarkdown-577d0a77.js +999 -0
- package/dist/cjs/index.cjs.js +19 -9
- package/dist/cjs/isCollectMobileTablet-7e57fd90.js +172 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/localization-b12edb2a.js +738 -0
- package/dist/cjs/{paypal-d36b5dd1.js → paypal-e80871d0.js} +12 -8
- package/dist/cjs/placeTestOrder-8222fe95.js +93 -0
- package/dist/cjs/{localization-ab7e1902.js → translationStore-20a6d8bf.js} +963 -734
- package/dist/cjs/zonos-address_11.cjs.entry.js +102 -72
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/{zonos-banner.cjs.entry.js → zonos-banner_2.cjs.entry.js} +40 -0
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/{zonos-cart-items_14.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +73 -1292
- package/dist/cjs/zonos-checkout.cjs.entry.js +25 -48
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +92 -0
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +810 -0
- package/dist/cjs/zonos-collect.cjs.entry.js +468 -0
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +168 -0
- package/dist/cjs/zonos-controller.cjs.entry.js +84 -28
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +11 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +15 -5
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +34 -33
- package/dist/cjs/zonos-hello.cjs.entry.js +8 -7
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -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-stripe-input.cjs.entry.js +8 -5
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- 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/collection-manifest.json +10 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -1
- package/dist/collection/components/checkout/zonos-collect/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/assets/empty-item.jpeg +0 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.css +60 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +39 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/RemoveIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/SuccessIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.css +84 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +403 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/chevronDownIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/globe.svg +3 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconDark.svg +10 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconLight.svg +10 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosWordmark.svg +7 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.css +152 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +164 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronUpIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.css +109 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +194 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/CheckmarkLineIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/RemoveLineIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.css +98 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +369 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.css +68 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +151 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.css +78 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +115 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +349 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +547 -0
- 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 +3 -3
- 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-h-stack/zonos-h-stack.css +38 -0
- package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +63 -0
- 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-loading-overlay/zonos-loading-overlay.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-skeleton/assets/RemoveLineIcon.svg +3 -0
- package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.css +40 -0
- package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +102 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +8 -5
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
- package/dist/collection/components/common/zonos-text/zonos-text.css +1 -0
- 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 +91 -25
- package/dist/collection/components/paypal/zonos-paypal-payment.js +13 -2
- package/dist/collection/components/store/checkout/cart.js +36 -15
- package/dist/collection/components/store/checkout/collect.js +157 -0
- package/dist/collection/components/store/checkout/paypal.js +4 -2
- package/dist/collection/components/store/checkout/stripe.js +31 -12
- package/dist/collection/components/store/translationStore/strings.arabic.js +48 -0
- package/dist/collection/components/store/translationStore/strings.base.js +48 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +48 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +48 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +48 -0
- package/dist/collection/components/store/translationStore/strings.french.js +48 -0
- package/dist/collection/components/store/translationStore/strings.german.js +48 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +48 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +48 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +48 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +48 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +48 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +48 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +48 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +48 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +48 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +48 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +48 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +48 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +48 -0
- package/dist/collection/components/store/translationStore.js +2 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +35 -18
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +15 -2
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/initCollect.js +15 -0
- package/dist/collection/components/utils/checkout/isCollectMobileTablet.js +10 -0
- package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -1
- package/dist/collection/components/utils/renderFallback.js +7 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +5 -1
- package/dist/collection/scripts/_zonosBase.js +7 -1
- package/dist/collection/types/checkout/api/PartyInfo.js +1 -0
- package/dist/collection/types/generated/graphql.internal.types.js +103 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/buildCartItemsByTempCart-c4488f73.js +26 -0
- package/dist/esm/{cart-bb0ee971.js → cart-acf4ebf5.js} +68 -27
- package/dist/esm/cleanHtmlMarkdown-b5b18743.js +997 -0
- package/dist/esm/index.js +19 -9
- package/dist/esm/isCollectMobileTablet-b72b81c5.js +165 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/localization-8646f526.js +719 -0
- package/dist/esm/{paypal-bd4520eb.js → paypal-2fa930eb.js} +7 -4
- package/dist/esm/placeTestOrder-d1ad9cf6.js +90 -0
- package/dist/esm/{localization-d8326254.js → translationStore-c9743292.js} +963 -718
- package/dist/esm/zonos-address_11.entry.js +71 -41
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/{zonos-banner.entry.js → zonos-banner_2.entry.js} +40 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/{zonos-cart-items_14.entry.js → zonos-cart-items_12.entry.js} +23 -1240
- package/dist/esm/zonos-checkout.entry.js +6 -29
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +86 -0
- package/dist/esm/zonos-collect-finish_6.entry.js +801 -0
- package/dist/esm/zonos-collect.entry.js +464 -0
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-confirm-dialog_2.entry.js +163 -0
- package/dist/esm/zonos-controller.entry.js +84 -28
- package/dist/esm/zonos-country-flag.entry.js +2 -1
- package/dist/esm/zonos-country-select_4.entry.js +11 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +15 -5
- package/dist/esm/zonos-hello-dialog.entry.js +6 -5
- package/dist/esm/zonos-hello.entry.js +2 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +6 -5
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +9 -6
- package/dist/esm/zonos-text.entry.js +1 -1
- 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/buildCartItemsByTempCart-c4488f73.js +1 -0
- package/dist/esm-es5/cart-acf4ebf5.js +1 -0
- package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/isCollectMobileTablet-b72b81c5.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-8646f526.js +1 -0
- package/dist/esm-es5/paypal-2fa930eb.js +17 -0
- package/dist/esm-es5/placeTestOrder-d1ad9cf6.js +1 -0
- package/dist/esm-es5/translationStore-c9743292.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner_2.entry.js +1 -0
- package/dist/esm-es5/zonos-button_3.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-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -0
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -0
- package/dist/esm-es5/zonos-collect.entry.js +1 -0
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -0
- 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-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-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-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.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.d.ts +470 -3
- 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-collect/zonos-collect-cart-items/zonos-collect-cart-items.d.ts +4 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.d.ts +49 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.d.ts +25 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.d.ts +29 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.d.ts +62 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.d.ts +22 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.d.ts +10 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect.d.ts +86 -0
- package/dist/types/components/common/zonos-h-stack/zonos-h-stack.d.ts +9 -0
- package/dist/types/components/common/zonos-skeleton/zonos-skeleton.d.ts +17 -0
- package/dist/types/components/main/zonos-controller.d.ts +5 -0
- package/dist/types/components/paypal/zonos-paypal-payment.d.ts +3 -0
- package/dist/types/components/store/checkout/cart.d.ts +23 -3
- package/dist/types/components/store/checkout/collect.d.ts +21 -0
- package/dist/types/components/store/checkout/paypal.d.ts +4 -3
- package/dist/types/components/store/checkout/stripe.d.ts +6 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +48 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +48 -0
- package/dist/types/components/store/translationStore.d.ts +2 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +1 -2
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +2 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/checkout/initCollect.d.ts +1 -0
- package/dist/types/components/utils/checkout/isCollectMobileTablet.d.ts +4 -0
- package/dist/types/components/utils/renderFallback.d.ts +6 -0
- package/dist/types/components.d.ts +401 -2
- package/dist/types/scripts/_zonosBase.d.ts +5 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
- package/dist/types/types/checkout/api/CreateParty.d.ts +24 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -1
- package/dist/types/types/checkout/api/PartyInfo.d.ts +24 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +431 -9
- package/dist/types/types/generated/graphql.internal.types.ts +428 -10
- package/dist/types/types/index.d.ts +1 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-288761b1.system.entry.js → p-009c3ac5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c7d5d45d.entry.js → p-03980f76.entry.js} +1 -1
- package/dist/zonos-elements/p-07bea979.system.js +1 -0
- package/dist/zonos-elements/p-0cec2dd2.system.entry.js +1 -0
- package/dist/zonos-elements/p-0d6c6a38.entry.js +1 -0
- package/dist/zonos-elements/p-0ef2a242.js +1 -0
- package/dist/zonos-elements/p-106ae0f1.entry.js +1 -0
- package/dist/zonos-elements/p-10797d2b.system.entry.js +1 -0
- package/dist/zonos-elements/p-195b33b6.system.entry.js +1 -0
- package/dist/zonos-elements/p-1fe5d4da.system.entry.js +1 -0
- package/dist/zonos-elements/{p-da4c01da.system.entry.js → p-2323ff0f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-23293a0b.entry.js +1 -0
- package/dist/zonos-elements/{p-62813488.entry.js → p-23735db6.entry.js} +1 -1
- package/dist/zonos-elements/{p-ebaaaee9.entry.js → p-26573347.entry.js} +1 -1
- package/dist/zonos-elements/{p-e640e8b8.entry.js → p-29499a5f.entry.js} +1 -1
- package/dist/zonos-elements/p-29c80a34.js +1 -0
- package/dist/zonos-elements/{p-edc77ea1.entry.js → p-2a9681b4.entry.js} +1 -1
- package/dist/zonos-elements/{p-3f31901f.entry.js → p-2c9381be.entry.js} +1 -1
- package/dist/zonos-elements/p-2cc031b3.js +17 -0
- package/dist/zonos-elements/{p-7ab62a26.system.entry.js → p-34a37ce7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3c9714a8.system.entry.js +1 -0
- package/dist/zonos-elements/p-485416ec.js +1 -0
- package/dist/zonos-elements/p-56ee6d4b.system.entry.js +1 -0
- package/dist/zonos-elements/p-58afbe2b.entry.js +1 -0
- package/dist/zonos-elements/p-5e372fb9.entry.js +1 -0
- package/dist/zonos-elements/p-5ff4f9df.system.js +1 -0
- package/dist/zonos-elements/{p-92cc26b7.system.entry.js → p-60c61982.system.entry.js} +1 -1
- package/dist/zonos-elements/p-61c2c336.entry.js +1 -0
- package/dist/zonos-elements/p-6696617a.system.entry.js +1 -0
- package/dist/zonos-elements/p-6761091e.entry.js +1 -0
- package/dist/zonos-elements/p-6761286d.js +1 -0
- package/dist/zonos-elements/p-69451a50.system.js +1 -0
- package/dist/zonos-elements/p-69fd1b88.js +1 -0
- package/dist/zonos-elements/p-6dd63754.system.js +1 -0
- package/dist/zonos-elements/p-6e8aae27.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1c45cd15.entry.js → p-70b81bbc.entry.js} +1 -1
- package/dist/zonos-elements/{p-eeb01de6.system.entry.js → p-750b7f32.system.entry.js} +1 -1
- package/dist/zonos-elements/p-772ac0b7.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/p-81e23f30.system.js +1 -0
- package/dist/zonos-elements/p-873b698a.entry.js +1 -0
- package/dist/zonos-elements/p-87e2a777.entry.js +1 -0
- package/dist/zonos-elements/p-8ca25e6c.entry.js +1 -0
- package/dist/zonos-elements/p-909d36bf.entry.js +1 -0
- package/dist/zonos-elements/p-95461a1b.system.entry.js +1 -0
- package/dist/zonos-elements/p-986ebccc.js +1 -0
- package/dist/zonos-elements/p-9c0b78bf.system.entry.js +1 -0
- package/dist/zonos-elements/p-a61a9b65.system.entry.js +1 -0
- package/dist/zonos-elements/p-a7204d41.entry.js +1 -0
- package/dist/zonos-elements/p-aca272ea.entry.js +1 -0
- package/dist/zonos-elements/p-b12ec9f2.system.entry.js +1 -0
- package/dist/zonos-elements/p-b1bd9fe7.system.entry.js +1 -0
- package/dist/zonos-elements/p-b2ae8eb7.system.js +1 -0
- package/dist/zonos-elements/{p-77666360.entry.js → p-b5406d26.entry.js} +1 -1
- package/dist/zonos-elements/p-bfbc081f.entry.js +1 -0
- package/dist/zonos-elements/p-c0a54cf6.system.js +1 -0
- package/dist/zonos-elements/p-c3c9b089.entry.js +1 -0
- package/dist/zonos-elements/p-c8784a01.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7b5de646.entry.js → p-d045e2e5.entry.js} +1 -1
- package/dist/zonos-elements/p-d26cffba.entry.js +1 -0
- package/dist/zonos-elements/{p-544c173a.system.entry.js → p-d351ece6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d63696ac.system.js +17 -0
- package/dist/zonos-elements/p-ddb29c2a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d6fa2dc2.entry.js → p-dfb92907.entry.js} +1 -1
- package/dist/zonos-elements/{p-714c28b1.system.entry.js → p-e2a45188.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1ac8bfbb.system.entry.js → p-e455f060.system.entry.js} +1 -1
- package/dist/zonos-elements/p-eb54ece4.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a98b1e8d.entry.js → p-efa6203f.entry.js} +1 -1
- package/dist/zonos-elements/{p-59eaebe3.system.entry.js → p-f0be0ca9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f129a83b.system.entry.js +1 -0
- package/dist/zonos-elements/p-f17fde5f.system.js +1 -0
- package/dist/zonos-elements/{p-47ffacd8.system.entry.js → p-f74a6b78.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/zonos-card.cjs.entry.js +0 -49
- package/dist/esm/zonos-card.entry.js +0 -45
- package/dist/esm-es5/cart-bb0ee971.js +0 -1
- package/dist/esm-es5/localization-d8326254.js +0 -1
- package/dist/esm-es5/paypal-bd4520eb.js +0 -17
- package/dist/esm-es5/zonos-banner.entry.js +0 -1
- package/dist/esm-es5/zonos-card.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_14.entry.js +0 -1
- package/dist/zonos-elements/p-043f57e8.system.entry.js +0 -1
- package/dist/zonos-elements/p-0631d2b9.js +0 -1
- package/dist/zonos-elements/p-0a6ac265.system.js +0 -1
- package/dist/zonos-elements/p-0f041dc5.system.entry.js +0 -1
- package/dist/zonos-elements/p-1432a217.system.entry.js +0 -1
- package/dist/zonos-elements/p-1b51b738.system.entry.js +0 -1
- package/dist/zonos-elements/p-3a1513ae.system.entry.js +0 -1
- package/dist/zonos-elements/p-3b8d11dd.entry.js +0 -1
- package/dist/zonos-elements/p-4333afcb.entry.js +0 -1
- package/dist/zonos-elements/p-4d0d89da.system.entry.js +0 -1
- package/dist/zonos-elements/p-5dd9cb44.system.entry.js +0 -1
- package/dist/zonos-elements/p-605a21ac.entry.js +0 -1
- package/dist/zonos-elements/p-674981ad.system.js +0 -1
- package/dist/zonos-elements/p-6d090b53.entry.js +0 -1
- package/dist/zonos-elements/p-73c8c551.system.entry.js +0 -1
- package/dist/zonos-elements/p-795d223d.entry.js +0 -1
- package/dist/zonos-elements/p-8218ff62.system.entry.js +0 -1
- package/dist/zonos-elements/p-82f80c8a.entry.js +0 -1
- package/dist/zonos-elements/p-88f7256d.js +0 -1
- package/dist/zonos-elements/p-8b083884.entry.js +0 -1
- package/dist/zonos-elements/p-a449940d.entry.js +0 -1
- package/dist/zonos-elements/p-a5a4ad2f.entry.js +0 -1
- package/dist/zonos-elements/p-a5d45585.system.entry.js +0 -1
- package/dist/zonos-elements/p-a751e819.system.entry.js +0 -1
- package/dist/zonos-elements/p-ad556be6.entry.js +0 -1
- package/dist/zonos-elements/p-b4792af0.entry.js +0 -1
- package/dist/zonos-elements/p-b9ff6458.entry.js +0 -1
- package/dist/zonos-elements/p-d3dbae8c.system.js +0 -1
- package/dist/zonos-elements/p-d55aec11.system.entry.js +0 -1
- package/dist/zonos-elements/p-ebb9b902.system.js +0 -17
- package/dist/zonos-elements/p-ef1ce617.system.entry.js +0 -1
- package/dist/zonos-elements/p-ef75da6f.js +0 -17
- package/dist/zonos-elements/p-f3dbe934.entry.js +0 -1
- package/dist/zonos-elements/p-f741407e.system.entry.js +0 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: normal;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
8
|
+
}
|
|
9
|
+
:host img {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
}
|
|
12
|
+
:host dl,
|
|
13
|
+
:host dd,
|
|
14
|
+
:host h1,
|
|
15
|
+
:host h2,
|
|
16
|
+
:host h3,
|
|
17
|
+
:host h4,
|
|
18
|
+
:host h5,
|
|
19
|
+
:host h6,
|
|
20
|
+
:host hr,
|
|
21
|
+
:host figure,
|
|
22
|
+
:host p,
|
|
23
|
+
:host pre {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* All sets of variable are here */
|
|
28
|
+
/* smooth font rendering */
|
|
29
|
+
:host {
|
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host {
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
flex: 1;
|
|
39
|
+
}
|
|
40
|
+
:host .zonos--title {
|
|
41
|
+
margin-bottom: 24px;
|
|
42
|
+
}
|
|
43
|
+
:host .zonos--group {
|
|
44
|
+
margin-bottom: 20px;
|
|
45
|
+
overflow: auto;
|
|
46
|
+
padding: 5px;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
flex: 1;
|
|
50
|
+
overscroll-behavior: contain;
|
|
51
|
+
}
|
|
52
|
+
:host .zonos--group::-webkit-scrollbar {
|
|
53
|
+
width: 10px;
|
|
54
|
+
}
|
|
55
|
+
:host .zonos--group::-webkit-scrollbar-track {
|
|
56
|
+
background: var(--zonos-elements-gray-50);
|
|
57
|
+
}
|
|
58
|
+
:host .zonos--group::-webkit-scrollbar-thumb {
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
background: #cccccc;
|
|
61
|
+
border: 3px solid transparent;
|
|
62
|
+
background-clip: content-box;
|
|
63
|
+
}
|
|
64
|
+
:host .zonos--group::-webkit-scrollbar-thumb:hover {
|
|
65
|
+
background: #d6d6d6;
|
|
66
|
+
}
|
|
67
|
+
:host .zonos--payment-error-banner {
|
|
68
|
+
margin-bottom: 8px;
|
|
69
|
+
}
|
|
70
|
+
:host .zonos--error-banner {
|
|
71
|
+
margin-bottom: 16px;
|
|
72
|
+
}
|
|
73
|
+
:host zonos-button {
|
|
74
|
+
box-shadow: 0 0 1px 0 var(--zonos-elements-gray-600);
|
|
75
|
+
}
|
|
76
|
+
:host .zonos--pay-in-base-currency-btn {
|
|
77
|
+
box-shadow: none;
|
|
78
|
+
}
|
|
79
|
+
:host .zonos--group-btn {
|
|
80
|
+
position: sticky;
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: 12px;
|
|
85
|
+
bottom: -5px;
|
|
86
|
+
padding-top: 12px;
|
|
87
|
+
background: var(--zonos--primary-color, var(--zonos-elements-gray-0));
|
|
88
|
+
}
|
|
89
|
+
:host .zonos--group-btn zonos-text {
|
|
90
|
+
text-align: center;
|
|
91
|
+
}
|
|
92
|
+
:host .zonos--group-btn zonos-button {
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
:host .zonos--test-cards {
|
|
96
|
+
margin-top: auto;
|
|
97
|
+
padding-top: 16px;
|
|
98
|
+
}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
|
+
import { cartStore, cartStoreNextStep, cartStoreOnChange, } from "../../../store/checkout/cart";
|
|
3
|
+
import { collectStore } from "../../../store/checkout/collect";
|
|
4
|
+
import { paypalInitScript, paypalStore, } from "../../../store/checkout/paypal";
|
|
5
|
+
import { stripeStore } from "../../../store/checkout/stripe";
|
|
6
|
+
import { translate } from "../../../store/translationStore";
|
|
7
|
+
import { zonosStore } from "../../../store/zonosStore";
|
|
8
|
+
import { placeTestOrder } from "../../../utils/api/placeTestOrder";
|
|
9
|
+
import { getIsStagingMode } from "../../../utils/checkout/getIsStagingMode";
|
|
10
|
+
import { getIsTestMode } from "../../../utils/checkout/getIsTestMode";
|
|
11
|
+
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
12
|
+
import { log } from "../../../utils/logging/log";
|
|
13
|
+
import { submitGtag } from "../../../utils/submitGtag";
|
|
14
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
15
|
+
import CheckmarkLineIcon from "./assets/CheckmarkLineIcon.svg";
|
|
16
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
17
|
+
import RemoveLineIcon from "./assets/RemoveLineIcon.svg";
|
|
18
|
+
export class ZonosCollectPayment {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.storeUnsubscribeList = [];
|
|
21
|
+
/**
|
|
22
|
+
* Whether or not the continue button is loading
|
|
23
|
+
*/
|
|
24
|
+
this.continueLoading = false;
|
|
25
|
+
/**
|
|
26
|
+
* Show error banner when the form is not complete, and user clicks on `Submit` button
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
this.showErrorBanner = false;
|
|
30
|
+
/**
|
|
31
|
+
* Show payment error banner when the payment is failed
|
|
32
|
+
*/
|
|
33
|
+
this.hasStripePaymentError = false;
|
|
34
|
+
/**
|
|
35
|
+
* Error message when the staging order creation is failed
|
|
36
|
+
*/
|
|
37
|
+
this.stagingOrderCreateErrorMessage = '';
|
|
38
|
+
/**
|
|
39
|
+
* Internal state to handle continue loading
|
|
40
|
+
*/
|
|
41
|
+
this.internalContinueLoading = this.continueLoading;
|
|
42
|
+
this.handleValidate = () => {
|
|
43
|
+
var _a;
|
|
44
|
+
return !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* handler for continue button click
|
|
48
|
+
*/
|
|
49
|
+
this.continueClickHandler = async ({ currencyCode, }) => {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
if (!this.handleValidate()) {
|
|
52
|
+
// Attempt to get the value of the billing address element to validate the form
|
|
53
|
+
void ((_a = stripeStore.stripeBillingAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
|
|
54
|
+
this.showErrorBanner = true;
|
|
55
|
+
// Attempt to submit the form so the missing input error will be shown in Stripe
|
|
56
|
+
void ((_b = stripeStore.stripeElements) === null || _b === void 0 ? void 0 : _b.submit());
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
(_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
60
|
+
behavior: 'smooth',
|
|
61
|
+
});
|
|
62
|
+
}, 10);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
stripeStore.checkoutSettlementCurrency = currencyCode;
|
|
66
|
+
// submit google tag when the form is complete
|
|
67
|
+
submitGtag('zonos-checkout-payment-info');
|
|
68
|
+
this.continueClicked.emit();
|
|
69
|
+
};
|
|
70
|
+
this.copyCardToClipboard = async (cardNumber) => {
|
|
71
|
+
try {
|
|
72
|
+
await navigator.clipboard.writeText(cardNumber);
|
|
73
|
+
}
|
|
74
|
+
catch (_a) {
|
|
75
|
+
// Copy happens in the iframe and it's not allowed to copy to the clipboard
|
|
76
|
+
const hiddenTextarea = document.createElement('textarea');
|
|
77
|
+
hiddenTextarea.style.position = 'fixed';
|
|
78
|
+
hiddenTextarea.style.left = '-1000px';
|
|
79
|
+
hiddenTextarea.style.top = '-1000px';
|
|
80
|
+
hiddenTextarea.style.width = '1px';
|
|
81
|
+
hiddenTextarea.style.height = '1px';
|
|
82
|
+
hiddenTextarea.value = cardNumber;
|
|
83
|
+
hiddenTextarea.id = 'zonos-copy-card-number';
|
|
84
|
+
document.body.appendChild(hiddenTextarea);
|
|
85
|
+
hiddenTextarea.select();
|
|
86
|
+
// Have to use deprecated method execCommand because it's the only way to copy to the clipboard in the iframe
|
|
87
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
88
|
+
document.execCommand('copy');
|
|
89
|
+
document.body.removeChild(hiddenTextarea);
|
|
90
|
+
}
|
|
91
|
+
window.Zonos.showNotification({
|
|
92
|
+
message: translate('Card number copied to clipboard'),
|
|
93
|
+
timeout: 4000,
|
|
94
|
+
type: 'success',
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
this.placeTestOrder = async () => {
|
|
98
|
+
this.internalContinueLoading = true;
|
|
99
|
+
const { errors } = await placeTestOrder();
|
|
100
|
+
if (errors.length) {
|
|
101
|
+
this.stagingOrderCreateErrorMessage =
|
|
102
|
+
errors[0] || 'Failed to create staging order. Please try again.';
|
|
103
|
+
this.internalContinueLoading = false;
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this.internalContinueLoading = false;
|
|
107
|
+
// continue to the next step
|
|
108
|
+
cartStoreNextStep();
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
continueLoadingWatcher() {
|
|
112
|
+
this.internalContinueLoading = this.continueLoading;
|
|
113
|
+
}
|
|
114
|
+
stripePaymentErrorWatcher() {
|
|
115
|
+
if (this.hasStripePaymentError) {
|
|
116
|
+
setTimeout(() => {
|
|
117
|
+
var _a;
|
|
118
|
+
// scroll to the top of the page when the payment error is shown
|
|
119
|
+
(_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
120
|
+
behavior: 'smooth',
|
|
121
|
+
});
|
|
122
|
+
}, 50);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
componentWillLoad() {
|
|
126
|
+
this.storeUnsubscribeList = [
|
|
127
|
+
cartStoreOnChange('currency', () => {
|
|
128
|
+
// start init paypal with the presentment currency when landed cost is fetched
|
|
129
|
+
void paypalInitScript({
|
|
130
|
+
currency: cartStore.currency,
|
|
131
|
+
});
|
|
132
|
+
}),
|
|
133
|
+
];
|
|
134
|
+
// start init paypal with the presentment currency when landed cost is fetched
|
|
135
|
+
void paypalInitScript({
|
|
136
|
+
currency: cartStore.currency,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
disconnectedCallback() {
|
|
140
|
+
this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
|
|
141
|
+
}
|
|
142
|
+
render() {
|
|
143
|
+
var _a;
|
|
144
|
+
this.hasStripePaymentError = stripeStore.hasPaymentError;
|
|
145
|
+
if (!stripeStore.stripeElements) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
if (!stripeStore.clientSecret) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
// start validate on typing after error banner is shown, and hide it if the form is complete
|
|
152
|
+
if (this.showErrorBanner) {
|
|
153
|
+
this.showErrorBanner = !this.handleValidate();
|
|
154
|
+
}
|
|
155
|
+
const isTestMode = getIsTestMode();
|
|
156
|
+
const isStagingMode = cartStore.isStagingMode || getIsStagingMode();
|
|
157
|
+
const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
158
|
+
const renderPayment = () => {
|
|
159
|
+
if (isStagingMode) {
|
|
160
|
+
// If in mobile, use the theme from the store since the UI is solely by theme
|
|
161
|
+
const theme = zonosStore.appearance.theme;
|
|
162
|
+
return (h(Fragment, null, this.stagingOrderCreateErrorMessage && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), h("zonos-empty-state-payment", { emptyStateText: translate('No payment method needed for staging'), theme: theme }), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
|
|
163
|
+
void this.placeTestOrder();
|
|
164
|
+
}, size: "lg",
|
|
165
|
+
// use primary type when on mobile mode
|
|
166
|
+
variant: this.submitBtnType }, translate('Place test order')))));
|
|
167
|
+
}
|
|
168
|
+
if (stripeStore.isFetchingSession ||
|
|
169
|
+
collectStore.isFetchingShippingInfo) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
|
|
173
|
+
translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
174
|
+
stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
|
|
175
|
+
stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
|
|
176
|
+
if (!cartStore.checkoutSession) {
|
|
177
|
+
log('Checkout session is not found');
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
await this.continueClickHandler({
|
|
181
|
+
currencyCode: cartStore.checkoutSession.subtotals
|
|
182
|
+
.presentmentCurrencyCode,
|
|
183
|
+
});
|
|
184
|
+
}, size: "lg",
|
|
185
|
+
// use primary type when on mobile mode
|
|
186
|
+
variant: this.submitBtnType }, translate('Pay [orderTotal]', {
|
|
187
|
+
orderTotal: renderCheckoutCurrency({
|
|
188
|
+
amount: collectStore.amountDutyTaxFeeTotal || 0,
|
|
189
|
+
isForeign: true,
|
|
190
|
+
}),
|
|
191
|
+
})), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
|
|
192
|
+
stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
|
|
193
|
+
stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
|
|
194
|
+
await this.continueClickHandler({
|
|
195
|
+
currencyCode: 'USD',
|
|
196
|
+
});
|
|
197
|
+
}, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
198
|
+
this.paypalSessionDone.emit(orderId);
|
|
199
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
200
|
+
display: isPaypalTabSelected ? 'block' : 'none',
|
|
201
|
+
} })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null)))));
|
|
202
|
+
};
|
|
203
|
+
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), renderPayment())));
|
|
204
|
+
}
|
|
205
|
+
static get is() { return "zonos-collect-payment"; }
|
|
206
|
+
static get encapsulation() { return "scoped"; }
|
|
207
|
+
static get originalStyleUrls() {
|
|
208
|
+
return {
|
|
209
|
+
"$": ["zonos-collect-payment.scss"]
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
static get styleUrls() {
|
|
213
|
+
return {
|
|
214
|
+
"$": ["zonos-collect-payment.css"]
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
static get properties() {
|
|
218
|
+
return {
|
|
219
|
+
"submitBtnType": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "HTMLZonosButtonElement['variant']",
|
|
224
|
+
"resolved": "\"danger\" | \"outline\" | \"primary\" | \"standard\" | \"subtle\" | \"success\" | \"warning\" | undefined",
|
|
225
|
+
"references": {
|
|
226
|
+
"HTMLZonosButtonElement": {
|
|
227
|
+
"location": "global",
|
|
228
|
+
"id": "global::HTMLZonosButtonElement"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"required": false,
|
|
233
|
+
"optional": true,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "Whether or not the checkout is in mobile mode"
|
|
237
|
+
},
|
|
238
|
+
"getter": false,
|
|
239
|
+
"setter": false,
|
|
240
|
+
"attribute": "submit-btn-type",
|
|
241
|
+
"reflect": false
|
|
242
|
+
},
|
|
243
|
+
"continueLoading": {
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"mutable": false,
|
|
246
|
+
"complexType": {
|
|
247
|
+
"original": "boolean",
|
|
248
|
+
"resolved": "boolean",
|
|
249
|
+
"references": {}
|
|
250
|
+
},
|
|
251
|
+
"required": false,
|
|
252
|
+
"optional": false,
|
|
253
|
+
"docs": {
|
|
254
|
+
"tags": [],
|
|
255
|
+
"text": "Whether or not the continue button is loading"
|
|
256
|
+
},
|
|
257
|
+
"getter": false,
|
|
258
|
+
"setter": false,
|
|
259
|
+
"attribute": "continue-loading",
|
|
260
|
+
"reflect": false,
|
|
261
|
+
"defaultValue": "false"
|
|
262
|
+
},
|
|
263
|
+
"submitBtnColor": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string | undefined",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": true,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": "Submit button main color"
|
|
276
|
+
},
|
|
277
|
+
"getter": false,
|
|
278
|
+
"setter": false,
|
|
279
|
+
"attribute": "submit-btn-color",
|
|
280
|
+
"reflect": false
|
|
281
|
+
},
|
|
282
|
+
"overridePrimaryColor": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "string",
|
|
287
|
+
"resolved": "string | undefined",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": true,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": "Primary color to override primary color from appearance primary color in setting."
|
|
295
|
+
},
|
|
296
|
+
"getter": false,
|
|
297
|
+
"setter": false,
|
|
298
|
+
"attribute": "override-primary-color",
|
|
299
|
+
"reflect": false
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
static get states() {
|
|
304
|
+
return {
|
|
305
|
+
"showErrorBanner": {},
|
|
306
|
+
"hasStripePaymentError": {},
|
|
307
|
+
"stagingOrderCreateErrorMessage": {},
|
|
308
|
+
"internalContinueLoading": {}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
static get events() {
|
|
312
|
+
return [{
|
|
313
|
+
"method": "continueClicked",
|
|
314
|
+
"name": "continueClicked",
|
|
315
|
+
"bubbles": true,
|
|
316
|
+
"cancelable": true,
|
|
317
|
+
"composed": true,
|
|
318
|
+
"docs": {
|
|
319
|
+
"tags": [],
|
|
320
|
+
"text": "Event to emit when the continue button is clicked"
|
|
321
|
+
},
|
|
322
|
+
"complexType": {
|
|
323
|
+
"original": "void",
|
|
324
|
+
"resolved": "void",
|
|
325
|
+
"references": {}
|
|
326
|
+
}
|
|
327
|
+
}, {
|
|
328
|
+
"method": "paypalSessionFailed",
|
|
329
|
+
"name": "paypalSessionFailed",
|
|
330
|
+
"bubbles": true,
|
|
331
|
+
"cancelable": true,
|
|
332
|
+
"composed": true,
|
|
333
|
+
"docs": {
|
|
334
|
+
"tags": [],
|
|
335
|
+
"text": "Event to emit when the paypal session failed"
|
|
336
|
+
},
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "void",
|
|
339
|
+
"resolved": "void",
|
|
340
|
+
"references": {}
|
|
341
|
+
}
|
|
342
|
+
}, {
|
|
343
|
+
"method": "paypalSessionDone",
|
|
344
|
+
"name": "paypalSessionDone",
|
|
345
|
+
"bubbles": true,
|
|
346
|
+
"cancelable": true,
|
|
347
|
+
"composed": true,
|
|
348
|
+
"docs": {
|
|
349
|
+
"tags": [],
|
|
350
|
+
"text": "Event to emit when the paypal session is done"
|
|
351
|
+
},
|
|
352
|
+
"complexType": {
|
|
353
|
+
"original": "string",
|
|
354
|
+
"resolved": "string",
|
|
355
|
+
"references": {}
|
|
356
|
+
}
|
|
357
|
+
}];
|
|
358
|
+
}
|
|
359
|
+
static get elementRef() { return "ele"; }
|
|
360
|
+
static get watchers() {
|
|
361
|
+
return [{
|
|
362
|
+
"propName": "continueLoading",
|
|
363
|
+
"methodName": "continueLoadingWatcher"
|
|
364
|
+
}, {
|
|
365
|
+
"propName": "hasStripePaymentError",
|
|
366
|
+
"methodName": "stripePaymentErrorWatcher"
|
|
367
|
+
}];
|
|
368
|
+
}
|
|
369
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: normal;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
8
|
+
}
|
|
9
|
+
:host img {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
}
|
|
12
|
+
:host dl,
|
|
13
|
+
:host dd,
|
|
14
|
+
:host h1,
|
|
15
|
+
:host h2,
|
|
16
|
+
:host h3,
|
|
17
|
+
:host h4,
|
|
18
|
+
:host h5,
|
|
19
|
+
:host h6,
|
|
20
|
+
:host hr,
|
|
21
|
+
:host figure,
|
|
22
|
+
:host p,
|
|
23
|
+
:host pre {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* All sets of variable are here */
|
|
28
|
+
/* smooth font rendering */
|
|
29
|
+
:host {
|
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host {
|
|
35
|
+
position: sticky;
|
|
36
|
+
top: 0;
|
|
37
|
+
background-color: var(--zonos-elements-gray-0);
|
|
38
|
+
z-index: 1;
|
|
39
|
+
}
|
|
40
|
+
:host .zonos--total-pay {
|
|
41
|
+
margin: 8px 0 24px;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-grow: 1;
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 48px;
|
|
47
|
+
}
|
|
48
|
+
:host .zonos--total-pay::after {
|
|
49
|
+
content: "";
|
|
50
|
+
position: relative;
|
|
51
|
+
height: 1px;
|
|
52
|
+
width: 100%;
|
|
53
|
+
background: var(--zonos-elements-gray-200);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host(.mobile),
|
|
57
|
+
:host(.tablet) {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
padding: 4px 0;
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
position: relative;
|
|
64
|
+
}
|
|
65
|
+
:host(.mobile) .zonos--total-pay,
|
|
66
|
+
:host(.tablet) .zonos--total-pay {
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { collectStore } from "../../../store/checkout/collect";
|
|
3
|
+
import { translate } from "../../../store/translationStore";
|
|
4
|
+
import { zonosStore } from "../../../store/zonosStore";
|
|
5
|
+
import { isCollectMobile, isCollectTablet, } from "../../../utils/checkout/isCollectMobileTablet";
|
|
6
|
+
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
7
|
+
import { classes } from "../../../utils/classes";
|
|
8
|
+
import { renderFallback } from "../../../utils/renderFallback";
|
|
9
|
+
export class ZonosCollectReview {
|
|
10
|
+
constructor() {
|
|
11
|
+
/**
|
|
12
|
+
* Whether or not the component is being rendered with mobile styles
|
|
13
|
+
*/
|
|
14
|
+
this.mobile = false;
|
|
15
|
+
/**
|
|
16
|
+
* Whether or not the component is being rendered with tablet styles
|
|
17
|
+
*/
|
|
18
|
+
this.tablet = false;
|
|
19
|
+
/**
|
|
20
|
+
* Whether or not to show the collapse icon
|
|
21
|
+
* This is controled from the collapsed state of the zonos-collapse component
|
|
22
|
+
* to show the collapse icon
|
|
23
|
+
*/
|
|
24
|
+
this.collapsed = false;
|
|
25
|
+
this.isMobile = false;
|
|
26
|
+
this.isTablet = false;
|
|
27
|
+
this.isLoading = true;
|
|
28
|
+
}
|
|
29
|
+
handleWindowResize() {
|
|
30
|
+
this.isMobile = isCollectMobile(this.mobile);
|
|
31
|
+
this.isTablet = isCollectTablet(this.tablet);
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() {
|
|
34
|
+
this.handleWindowResize();
|
|
35
|
+
// Wait for the data to load
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
this.isLoading = false;
|
|
38
|
+
}, 1000);
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
const titleTextColor = this.isMobile ? 'gray-1000' : 'gray-800';
|
|
42
|
+
return (h(Host, { key: '0ad612b9bd517bde855d648cd49c853f0e76c584', class: classes([
|
|
43
|
+
'zonos--collect-review zonos--elements',
|
|
44
|
+
this.isMobile && 'mobile',
|
|
45
|
+
this.isTablet && 'tablet',
|
|
46
|
+
]) }, h("div", { key: 'e7f6ba00c7129d537cabd37ed0583e4385bd3e4b', class: "zonos--title" }, h("zonos-text", { key: 'eda6c8358bde6ecf2b200878b0c3cb52d71d3abe', textColor: titleTextColor, type: 'semiBoldLabel' }, translate('Pay [organizationName]', {
|
|
47
|
+
organizationName: zonosStore.organizationName,
|
|
48
|
+
}))), h("div", { key: '7247a4bc5d030c3fa605946a6acb9c9698055633', class: "zonos--total-pay" }, renderFallback({
|
|
49
|
+
content: (h("zonos-text", { type: 'secondaryPageHeader' }, renderCheckoutCurrency({
|
|
50
|
+
amount: collectStore.amountDutyTaxFeeTotal || 0,
|
|
51
|
+
isForeign: false,
|
|
52
|
+
}))),
|
|
53
|
+
isLoading: collectStore.isFetchingShippingInfo,
|
|
54
|
+
skeletonHeight: '36px',
|
|
55
|
+
skeletonWidth: '150px',
|
|
56
|
+
}))));
|
|
57
|
+
}
|
|
58
|
+
static get is() { return "zonos-collect-review"; }
|
|
59
|
+
static get encapsulation() { return "shadow"; }
|
|
60
|
+
static get originalStyleUrls() {
|
|
61
|
+
return {
|
|
62
|
+
"$": ["zonos-collect-review.scss"]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
static get styleUrls() {
|
|
66
|
+
return {
|
|
67
|
+
"$": ["zonos-collect-review.css"]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get assetsDirs() { return ["assets"]; }
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
"mobile": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "boolean",
|
|
78
|
+
"resolved": "boolean",
|
|
79
|
+
"references": {}
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"optional": false,
|
|
83
|
+
"docs": {
|
|
84
|
+
"tags": [],
|
|
85
|
+
"text": "Whether or not the component is being rendered with mobile styles"
|
|
86
|
+
},
|
|
87
|
+
"getter": false,
|
|
88
|
+
"setter": false,
|
|
89
|
+
"attribute": "mobile",
|
|
90
|
+
"reflect": false,
|
|
91
|
+
"defaultValue": "false"
|
|
92
|
+
},
|
|
93
|
+
"tablet": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "boolean",
|
|
98
|
+
"resolved": "boolean",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "Whether or not the component is being rendered with tablet styles"
|
|
106
|
+
},
|
|
107
|
+
"getter": false,
|
|
108
|
+
"setter": false,
|
|
109
|
+
"attribute": "tablet",
|
|
110
|
+
"reflect": false,
|
|
111
|
+
"defaultValue": "false"
|
|
112
|
+
},
|
|
113
|
+
"collapsed": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "boolean",
|
|
118
|
+
"resolved": "boolean",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "Whether or not to show the collapse icon\nThis is controled from the collapsed state of the zonos-collapse component\nto show the collapse icon"
|
|
126
|
+
},
|
|
127
|
+
"getter": false,
|
|
128
|
+
"setter": false,
|
|
129
|
+
"attribute": "collapsed",
|
|
130
|
+
"reflect": false,
|
|
131
|
+
"defaultValue": "false"
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
static get states() {
|
|
136
|
+
return {
|
|
137
|
+
"isMobile": {},
|
|
138
|
+
"isTablet": {},
|
|
139
|
+
"isLoading": {}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static get listeners() {
|
|
143
|
+
return [{
|
|
144
|
+
"name": "resize",
|
|
145
|
+
"method": "handleWindowResize",
|
|
146
|
+
"target": "window",
|
|
147
|
+
"capture": false,
|
|
148
|
+
"passive": true
|
|
149
|
+
}];
|
|
150
|
+
}
|
|
151
|
+
}
|