@zonos/elements 1.3.281 → 1.3.283
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-3313cb0c.js → cart-a1c00090.js} +2 -1
- package/dist/cjs/{collect-2659c5af.js → collect-e61eafca.js} +2 -2
- package/dist/cjs/getMissingRequiredShippingFields-a6c4f625.js +50 -0
- package/dist/cjs/{hasInclusivePrice-d132daaa.js → hasInclusivePrice-e7b57e02.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-26f52c07.js → invoice-ead45797.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-6189080f.js → localization-783849c8.js} +242 -0
- package/dist/cjs/{paypal-f6a256b5.js → paypal-e1548f40.js} +2 -2
- package/dist/cjs/{placeTestOrder-695f2b32.js → placeTestOrder-d99b1fe2.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-fe56094f.js → renderCheckoutCurrency-c942fcba.js} +2 -2
- package/dist/cjs/{zonos-address-display_8.cjs.entry.js → zonos-address-completion-dialog_7.cjs.entry.js} +225 -192
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +157 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +73 -12
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +9 -9
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +89 -20
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +6 -6
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -8
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +14 -14
- package/dist/cjs/zonos-invoice.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-policy-consent_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.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/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.css +105 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.js +341 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +11 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +5 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +52 -2
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +3 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +5 -5
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +2 -2
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +3 -3
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +2 -2
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
- package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +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.js +2 -2
- 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/zonos-skeleton.js +1 -1
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +17 -5
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +1 -1
- package/dist/collection/components/store/hello/localization.js +2 -0
- package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
- package/dist/collection/components/store/translationStore/strings.base.js +12 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
- package/dist/collection/components/store/translationStore/strings.french.js +12 -0
- package/dist/collection/components/store/translationStore/strings.german.js +12 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +11 -6
- 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 +52 -48
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/applyAddressCompletion.js +23 -0
- package/dist/collection/components/utils/checkout/buildAddressContacts.js +57 -0
- package/dist/collection/components/utils/checkout/getAddressCountryOptions.js +23 -0
- package/dist/collection/components/utils/checkout/getMissingRequiredShippingFields.js +44 -0
- package/dist/esm/{cart-c66ec17e.js → cart-93c36159.js} +2 -2
- package/dist/esm/{collect-915fd59d.js → collect-42d4757a.js} +2 -2
- package/dist/esm/getMissingRequiredShippingFields-ebdccdcf.js +47 -0
- package/dist/esm/{hasInclusivePrice-6fd935f3.js → hasInclusivePrice-4c12548f.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-2a17c93c.js → invoice-71471339.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-6d36209f.js → localization-754e7e8b.js} +242 -0
- package/dist/esm/{paypal-cae1d404.js → paypal-b1410e02.js} +2 -2
- package/dist/esm/{placeTestOrder-955269d2.js → placeTestOrder-4267cafd.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-951386a5.js → renderCheckoutCurrency-9a81e41c.js} +2 -2
- package/dist/esm/{zonos-address-display_8.entry.js → zonos-address-completion-dialog_7.entry.js} +226 -192
- package/dist/esm/zonos-address-display_2.entry.js +152 -0
- package/dist/esm/zonos-address_4.entry.js +73 -12
- package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +9 -9
- package/dist/esm/zonos-cart-items_12.entry.js +90 -21
- package/dist/esm/zonos-checkbox_2.entry.js +5 -5
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -6
- package/dist/esm/zonos-collect-finish_6.entry.js +19 -19
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +3 -3
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +6 -6
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -8
- package/dist/esm/zonos-invoice-finish_5.entry.js +14 -14
- package/dist/esm/zonos-invoice.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-policy-consent_2.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.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-c66ec17e.js → cart-93c36159.js} +1 -1
- package/dist/esm-es5/{collect-915fd59d.js → collect-42d4757a.js} +1 -1
- package/dist/esm-es5/getMissingRequiredShippingFields-ebdccdcf.js +1 -0
- package/dist/esm-es5/{hasInclusivePrice-6fd935f3.js → hasInclusivePrice-4c12548f.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-2a17c93c.js → invoice-71471339.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-754e7e8b.js +1 -0
- package/dist/esm-es5/{paypal-cae1d404.js → paypal-b1410e02.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-955269d2.js → placeTestOrder-4267cafd.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-951386a5.js → renderCheckoutCurrency-9a81e41c.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -0
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.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-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.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-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.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 +123 -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-address-completion-dialog/zonos-address-completion-dialog.d.ts +75 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +16 -0
- package/dist/types/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.d.ts +1 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/hello/localization.d.ts +7 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +9 -13
- package/dist/types/components/utils/checkout/applyAddressCompletion.d.ts +25 -0
- package/dist/types/components/utils/checkout/buildAddressContacts.d.ts +21 -0
- package/dist/types/components/utils/checkout/getAddressCountryOptions.d.ts +29 -0
- package/dist/types/components/utils/checkout/getMissingRequiredShippingFields.d.ts +35 -0
- package/dist/types/components.d.ts +97 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-09da3c76.entry.js → p-007ff76a.entry.js} +1 -1
- package/dist/zonos-elements/{p-5aee5de5.system.entry.js → p-05cb0a0d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-065f3f66.system.entry.js +1 -0
- package/dist/zonos-elements/p-07c21940.entry.js +1 -0
- package/dist/zonos-elements/p-0d183f19.system.js +1 -0
- package/dist/zonos-elements/p-1180a97c.system.entry.js +1 -0
- package/dist/zonos-elements/p-19bbf4b3.js +1 -0
- package/dist/zonos-elements/{p-ee3c7b11.system.entry.js → p-1af510ea.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1cff471a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-0ad6a92b.system.entry.js → p-21489ff1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-734d646b.entry.js → p-21f7d57b.entry.js} +1 -1
- package/dist/zonos-elements/p-22f7120a.system.js +1 -0
- package/dist/zonos-elements/{p-b5f67807.entry.js → p-26bf0c31.entry.js} +1 -1
- package/dist/zonos-elements/p-2837bfd2.js +1 -0
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-86d6961c.system.entry.js → p-29ca1415.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2aebcfa8.system.entry.js +1 -0
- package/dist/zonos-elements/{p-8c54aaec.entry.js → p-32b53999.entry.js} +1 -1
- package/dist/zonos-elements/{p-c15476a1.system.entry.js → p-333f6018.system.entry.js} +1 -1
- package/dist/zonos-elements/p-33dd7dab.entry.js +1 -0
- package/dist/zonos-elements/{p-060c521b.system.entry.js → p-342b062d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a5f8dc19.js → p-38881097.js} +1 -1
- package/dist/zonos-elements/{p-38879af9.entry.js → p-39399f67.entry.js} +1 -1
- package/dist/zonos-elements/{p-683ec0bf.entry.js → p-3d902845.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6773627.entry.js → p-3dcb3794.entry.js} +1 -1
- package/dist/zonos-elements/p-4a5fa892.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a34269b1.system.entry.js → p-4a73906a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5677d31f.entry.js → p-4b9c7803.entry.js} +1 -1
- package/dist/zonos-elements/{p-54a8d4cf.system.entry.js → p-4dba0e9b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1992fd91.entry.js → p-55c5977b.entry.js} +1 -1
- package/dist/zonos-elements/{p-179caaea.system.entry.js → p-58da55e6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-59824ac6.entry.js +1 -0
- package/dist/zonos-elements/{p-f156e2e5.system.entry.js → p-59e4e0b6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a44591f6.system.entry.js → p-5a37683b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-36b311f9.system.entry.js → p-5b11bbca.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-717cbe90.system.js → p-5fceef56.system.js} +1 -1
- package/dist/zonos-elements/{p-8005e102.system.js → p-602de72d.system.js} +1 -1
- package/dist/zonos-elements/{p-39695a8b.system.js → p-6325ee77.system.js} +1 -1
- package/dist/zonos-elements/p-67251274.system.js +1 -0
- package/dist/zonos-elements/{p-4441c451.entry.js → p-69871ab6.entry.js} +1 -1
- package/dist/zonos-elements/p-6be4c473.entry.js +1 -0
- package/dist/zonos-elements/p-72280783.system.js +1 -0
- package/dist/zonos-elements/{p-746bdebe.entry.js → p-73d1a554.entry.js} +1 -1
- package/dist/zonos-elements/{p-e0ec0aa3.system.entry.js → p-76a75da9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-26ca8ce7.js → p-76cdf517.js} +1 -1
- package/dist/zonos-elements/{p-a3d3ce5d.system.entry.js → p-781b3345.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1577a739.js → p-8eaf1316.js} +1 -1
- package/dist/zonos-elements/{p-99e8743e.system.entry.js → p-8fa3a8f8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b406bb39.entry.js → p-944282af.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e6bbf0b.system.entry.js → p-97f15546.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-727387ed.entry.js → p-9ceb3d1c.entry.js} +1 -1
- package/dist/zonos-elements/{p-3246d120.js → p-a2fe995b.js} +1 -1
- package/dist/zonos-elements/{p-4c3f5fda.system.entry.js → p-aa7589de.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b0482924.entry.js +1 -0
- package/dist/zonos-elements/{p-ddf68916.system.js → p-b567448d.system.js} +1 -1
- package/dist/zonos-elements/{p-edf613ea.entry.js → p-b7a03b08.entry.js} +1 -1
- package/dist/zonos-elements/{p-15097876.system.entry.js → p-b93013f7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3f6fe80a.system.entry.js → p-c43130a7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c515bc23.system.js +1 -0
- package/dist/zonos-elements/{p-732e7373.system.entry.js → p-c634546a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6df6cb8a.entry.js → p-c8a48cce.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e058b4e.entry.js → p-cb376f03.entry.js} +1 -1
- package/dist/zonos-elements/{p-8308f7d6.system.entry.js → p-cc35d5f8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f314217a.system.js → p-cd5638b2.system.js} +2 -2
- package/dist/zonos-elements/{p-56fc3210.js → p-d68425ad.js} +1 -1
- package/dist/zonos-elements/{p-03fda4a8.entry.js → p-d74eda59.entry.js} +1 -1
- package/dist/zonos-elements/{p-30067eed.entry.js → p-d93f4837.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7a45f6c.entry.js → p-dcf8ab79.entry.js} +1 -1
- package/dist/zonos-elements/{p-4efd7178.entry.js → p-e0cbc7c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-40b96482.system.entry.js → p-e2057ab0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e2b8936a.js +1 -0
- package/dist/zonos-elements/{p-dd6da3de.entry.js → p-e3d0d8ff.entry.js} +1 -1
- package/dist/zonos-elements/{p-5a61c301.system.entry.js → p-e8159288.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e1aad7d.entry.js → p-e8bb4f3b.entry.js} +1 -1
- package/dist/zonos-elements/{p-a23d3b3f.system.entry.js → p-e99654c1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d4201d5.entry.js → p-ef2c264c.entry.js} +1 -1
- package/dist/zonos-elements/{p-429ab545.system.entry.js → p-f1dbeb85.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2825431d.entry.js → p-f2431e47.entry.js} +1 -1
- package/dist/zonos-elements/{p-29c1703c.system.entry.js → p-f2511b86.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-156891c5.js → p-f9f3155b.js} +1 -1
- package/dist/zonos-elements/{p-08e78d79.entry.js → p-fa80a973.entry.js} +1 -1
- package/dist/zonos-elements/{p-f59514e9.entry.js → p-fc45b3a5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/localization-6d36209f.js +0 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +0 -1
- package/dist/zonos-elements/p-0ac1aa87.system.js +0 -1
- package/dist/zonos-elements/p-1ee5f392.entry.js +0 -1
- package/dist/zonos-elements/p-6df034d6.entry.js +0 -1
- package/dist/zonos-elements/p-71cb16da.system.entry.js +0 -1
- package/dist/zonos-elements/p-8051403a.js +0 -1
- package/dist/zonos-elements/p-9448d960.js +0 -1
- package/dist/zonos-elements/p-a6535773.system.entry.js +0 -1
- package/dist/zonos-elements/p-ae30e6c0.system.entry.js +0 -1
- package/dist/zonos-elements/p-bf942ef0.system.js +0 -1
- package/dist/zonos-elements/p-c345d1f5.system.js +0 -1
- package/dist/zonos-elements/p-d4337686.entry.js +0 -1
- package/dist/zonos-elements/p-df8b8827.entry.js +0 -1
- package/dist/zonos-elements/p-e210edd9.system.js +0 -1
- package/dist/zonos-elements/p-f3e1a6a7.system.entry.js +0 -1
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b1f95d96.js');
|
|
6
|
-
const localization = require('./localization-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
6
|
+
const localization = require('./localization-783849c8.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-fee716c9.js');
|
|
8
|
+
const getMissingRequiredShippingFields = require('./getMissingRequiredShippingFields-a6c4f625.js');
|
|
9
9
|
const classes = require('./classes-b7918f56.js');
|
|
10
|
+
const cart = require('./cart-a1c00090.js');
|
|
11
|
+
const RemoveIcon$1 = require('./RemoveIcon-081ac073.js');
|
|
12
|
+
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
10
13
|
const getBorderRadius = require('./getBorderRadius-4da24d7c.js');
|
|
11
|
-
const zonosStore = require('./zonosStore-fee716c9.js');
|
|
12
|
-
const RemoveIcon$2 = require('./RemoveIcon-081ac073.js');
|
|
13
14
|
const throttle = require('./throttle-34f7abf1.js');
|
|
14
15
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
15
16
|
const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-7d19556c.js');
|
|
@@ -20,31 +21,132 @@ const isDarkColor = require('./isDarkColor-ebc74b4d.js');
|
|
|
20
21
|
require('./debounce-9a712c79.js');
|
|
21
22
|
require('./ShortAddressCode-bec338b0.js');
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
-
const
|
|
24
|
+
const zonosAddressCompletionDialogCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:24px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-bottom:5px;gap:20px;-ms-scroll-chaining:chained;overscroll-behavior:auto}:host .zonos--selected-address{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--completion-fields{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}:host .zonos--completion-name-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--completion-name-row zonos-input{-ms-flex:1;flex:1}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--completion-name-row{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--submit-btn{-ms-flex-order:1;order:1}";
|
|
25
|
+
const ZonosAddressCompletionDialogStyle0 = zonosAddressCompletionDialogCss;
|
|
25
26
|
|
|
26
|
-
const
|
|
27
|
+
const ZonosAddressCompletionDialog = class {
|
|
27
28
|
constructor(hostRef) {
|
|
28
29
|
index.registerInstance(this, hostRef);
|
|
30
|
+
this.closeCompletionDialog = index.createEvent(this, "closeCompletionDialog", 7);
|
|
31
|
+
this.completionSubmit = index.createEvent(this, "completionSubmit", 7);
|
|
32
|
+
/**
|
|
33
|
+
* Whether or not the continue button is loading
|
|
34
|
+
*/
|
|
35
|
+
this.continueLoading = false;
|
|
36
|
+
/**
|
|
37
|
+
* Whether or not the dialog is open
|
|
38
|
+
*/
|
|
39
|
+
this.dialogOpen = false;
|
|
40
|
+
/**
|
|
41
|
+
* Whether or not the dialog is rendered in mobile mode
|
|
42
|
+
*/
|
|
43
|
+
this.isMobile = false;
|
|
44
|
+
/**
|
|
45
|
+
* The Zonos-required fields still missing from the selected address
|
|
46
|
+
*/
|
|
47
|
+
this.missingFields = [];
|
|
48
|
+
/**
|
|
49
|
+
* Local values for the captured fields, keyed by the missing field key
|
|
50
|
+
*/
|
|
51
|
+
this.values = {};
|
|
52
|
+
/**
|
|
53
|
+
* Whether to show validation errors (after a submit attempt with empty fields)
|
|
54
|
+
*/
|
|
55
|
+
this.showError = false;
|
|
56
|
+
this.isFieldMissing = (key) => this.missingFields.some(field => field.key === key);
|
|
57
|
+
/**
|
|
58
|
+
* A captured field is valid when it has a value. Postal code additionally enforces the same
|
|
59
|
+
* minimum length as the landed-cost readiness / detection check, so the dialog can't emit a
|
|
60
|
+
* too-short postal code that would still be considered "missing" downstream.
|
|
61
|
+
*/
|
|
62
|
+
this.isFieldValid = (key) => {
|
|
63
|
+
var _a, _b, _c;
|
|
64
|
+
if (key === 'postal_code') {
|
|
65
|
+
return (((_b = (_a = this.values.postal_code) === null || _a === void 0 ? void 0 : _a.trim().length) !== null && _b !== void 0 ? _b : 0) >= getMissingRequiredShippingFields.MIN_POSTAL_CODE_LENGTH);
|
|
66
|
+
}
|
|
67
|
+
return !!((_c = this.values[key]) === null || _c === void 0 ? void 0 : _c.trim());
|
|
68
|
+
};
|
|
69
|
+
this.getFieldError = (key) => this.showError && !this.isFieldValid(key);
|
|
70
|
+
this.updateValue = (key, value) => {
|
|
71
|
+
this.values = Object.assign(Object.assign({}, this.values), { [key]: value });
|
|
72
|
+
// Once the customer starts fixing the fields, re-evaluate whether errors remain
|
|
73
|
+
if (this.showError) {
|
|
74
|
+
this.showError = !this.isComplete();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
this.isComplete = () => this.missingFields.every(field => {
|
|
78
|
+
// A missing last name also requires a first name (both are edited together).
|
|
79
|
+
if (field.key === 'lastName') {
|
|
80
|
+
return this.isFieldValid('firstName') && this.isFieldValid('lastName');
|
|
81
|
+
}
|
|
82
|
+
return this.isFieldValid(field.key);
|
|
83
|
+
});
|
|
84
|
+
this.submitHandler = () => {
|
|
85
|
+
if (!this.isComplete()) {
|
|
86
|
+
this.showError = true;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.completionSubmit.emit(this.values);
|
|
90
|
+
};
|
|
91
|
+
this.renderInput = ({ key, label, }) => (index.h("zonos-input", { class: `zonos--completion-input zonos--completion-${key}`, inputLabel: label, inputValue: this.values[key] || '', isError: this.getFieldError(key), onInputChange: (event) => this.updateValue(key, event.detail) }));
|
|
92
|
+
this.renderField = (key, label) => {
|
|
93
|
+
if (!this.isFieldMissing(key)) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return this.renderInput({ key, label });
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* When the last name is missing, render both first and last name inputs so the customer can
|
|
100
|
+
* correct the full name together (Link's single name input often yields only a first name).
|
|
101
|
+
*/
|
|
102
|
+
this.renderNameFields = () => {
|
|
103
|
+
if (!this.isFieldMissing('lastName')) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return (index.h("div", { class: "zonos--completion-name-row" }, this.renderInput({
|
|
107
|
+
key: 'firstName',
|
|
108
|
+
label: localization.translate('First name'),
|
|
109
|
+
}), this.renderInput({
|
|
110
|
+
key: 'lastName',
|
|
111
|
+
label: localization.translate('Last name'),
|
|
112
|
+
})));
|
|
113
|
+
};
|
|
29
114
|
}
|
|
30
|
-
|
|
115
|
+
/**
|
|
116
|
+
* The dialog stays mounted, so clear any previously-entered values whenever it opens.
|
|
117
|
+
* Without this, values typed for one address could be reapplied to a different address
|
|
118
|
+
* the next time the dialog opens.
|
|
119
|
+
*/
|
|
120
|
+
// Only reset on open, not on `shippingAddress`: the parent rebuilds that prop object on
|
|
121
|
+
// every render, and watching it would wipe in-progress input while the dialog is open.
|
|
122
|
+
async watchDialogOpen(isOpen) {
|
|
31
123
|
var _a;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
? localization.translate('Shipping')
|
|
42
|
-
: localization.translate('Billing'))), index.h("div", { class: "zonos--address-group" }, name && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ bold: true, content: name }))), email && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: email }))), phone && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: phone }))), line1 && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line1 }))), line2 && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line2 }))), index.h("div", { class: "zonos--address-line" }, city && renderEnteredInfoText({ content: city }), state && renderEnteredInfoText({ content: state }), postal_code && renderEnteredInfoText({ content: postal_code })), shippingZoneCountry && (index.h("div", { class: "zonos--address-line" }, index.h("zonos-country-flag", { class: "zonos--country-flag", countryCode: shippingZoneCountry.code }), ' ', renderEnteredInfoText({
|
|
43
|
-
content: shippingZoneCountry.displayName,
|
|
44
|
-
}))))));
|
|
124
|
+
if (isOpen) {
|
|
125
|
+
// Wait for shippingAddress prop to be updated before resetting the values
|
|
126
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
127
|
+
// When the last name is missing we also let the customer edit the first name, so prefill
|
|
128
|
+
// it from the current (often first-name-only) address value.
|
|
129
|
+
const { firstName } = cart.extractName({ name: (_a = this.shippingAddress) === null || _a === void 0 ? void 0 : _a.name });
|
|
130
|
+
this.values = this.isFieldMissing('lastName') ? { firstName } : {};
|
|
131
|
+
this.showError = false;
|
|
132
|
+
}
|
|
45
133
|
}
|
|
134
|
+
render() {
|
|
135
|
+
const submitBtnColor = this.submitBtnColor || zonosStore.zonosStore.appearance.colorSecondary;
|
|
136
|
+
// dialog background is white, so a white button needs an outline to stay visible
|
|
137
|
+
const submitBtnType = submitBtnColor === '#ffffff'
|
|
138
|
+
? 'outline'
|
|
139
|
+
: this.submitBtnType || 'standard';
|
|
140
|
+
return (index.h(index.Host, { key: '9a89376022ebd8f5793882fb13a3502deca001f8', class: classes.classes([
|
|
141
|
+
'zonos--address-completion-dialog zonos--elements',
|
|
142
|
+
this.isMobile && 'mobile',
|
|
143
|
+
]) }, index.h("zonos-dialog", { key: '00ff3912a7bf8d021441440f0de2825b49f7b78e', isLoading: false, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeCompletionDialog.emit(), open: this.dialogOpen, width: "568px" }, index.h("div", { key: '1ba1cd333bd1f362a77f1f114ac50c309ed5ccd6', class: "zonos--body" }, index.h("div", { key: 'ccf9f54ff4b26e5443ff5c8276e5c5d36aac332b', class: "zonos--dialog-header" }, index.h("div", { key: '01e073aa559c4040a6599aefb3bf8cb967928929', class: "zonos--dialog-title" }, index.h("zonos-text", { key: '8472a72f6274646bb87d150c82722f93c861ae72', type: "title" }, localization.translate('Complete your shipping address')), index.h("zonos-button", { key: 'e9a6c2cbc3d64bf87e94850c1126119687f75e7d', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1.RemoveIcon }), noBackground: true, onClick: () => this.closeCompletionDialog.emit(), title: "Close checkout dialog" })), index.h("zonos-text", { key: 'c9ff785b746810f0c266071ee9a3f433ad645a2b' }, localization.translate('This saved address is missing information required to ship internationally. Please add the details below.'))), index.h("div", { key: '86e2b0da7dbcd1370b80fc8c53e8a7de4c11ed74', class: "zonos--group" }, index.h("div", { key: '1542bb7f0b9df16f5ce36d38dc9408a1b3e836a7', class: "zonos--selected-address" }, index.h("zonos-text", { key: '2572e3e44a9c81f6694e4939de39951ec659c8fa', class: "zonos--selected-label", type: "semiBoldLabel" }, localization.translate('Selected address')), index.h("zonos-address-display", { key: '8781622b3d057cfbdba59e13d5fabf76f3a7a7dd', addressType: "shipping", currentAddress: this.shippingAddress })), index.h("div", { key: 'ac3a5f6566c2179045a784b661b7e82c7b371a3f', class: "zonos--completion-fields" }, this.renderNameFields(), this.renderField('state', localization.translate('State/Province')), this.renderField('postal_code', localization.translate('Postal code')))), index.h("div", { key: '1007d7f6c671fbd94dd3027332d2d7ac1edeef6e', class: "zonos--group-btn" }, index.h("div", { key: '22fe2c8d03d7b3c680eea2b4afebf1868b5b6c0b', class: "zonos--button-wrapper" }, index.h("zonos-button", { key: 'dbcf1aa175992bff762ecc36108bf94090b7df0e', class: "zonos--cancel-btn", onClick: () => this.closeCompletionDialog.emit(), variant: "subtle" }, localization.translate('Cancel')), index.h("zonos-button", { key: '63b0f966565e86ea9bac640b2fa690287c94b11f', backgroundColor: this.submitBtnColor, class: "zonos--submit-btn", loading: this.continueLoading, onClick: () => this.submitHandler(), size: "sm", variant: submitBtnType }, localization.translate('Save and continue'))))))));
|
|
144
|
+
}
|
|
145
|
+
static get watchers() { return {
|
|
146
|
+
"dialogOpen": ["watchDialogOpen"]
|
|
147
|
+
}; }
|
|
46
148
|
};
|
|
47
|
-
|
|
149
|
+
ZonosAddressCompletionDialog.style = ZonosAddressCompletionDialogStyle0;
|
|
48
150
|
|
|
49
151
|
const zonosAddressFormCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";
|
|
50
152
|
const ZonosAddressFormStyle0 = zonosAddressFormCss;
|
|
@@ -76,15 +178,15 @@ const ZonosAddressForm = class {
|
|
|
76
178
|
const { firstName, lastName } = cart.extractName({
|
|
77
179
|
name,
|
|
78
180
|
});
|
|
79
|
-
return (index.h(index.Host, { key: '
|
|
181
|
+
return (index.h(index.Host, { key: '44edb799473e427b08e17d6d20f08a028a3cc688', class: "zonos--address-form zonos--elements" }, index.h("div", { key: '99c2d5b58464bebd7bb3e5c2a4ac3aa04d80b47f', class: "zonos--title" }, index.h("zonos-text", { key: '5a86048c7d768b795db1416182e2b22458924601', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
80
182
|
? localization.translate('Shipping')
|
|
81
|
-
: localization.translate('Billing'))), index.h("div", { key: '
|
|
183
|
+
: localization.translate('Billing'))), index.h("div", { key: 'a907058d970cb6674b403f79c0946e36a0e61f69', class: "zonos--address-group" }, index.h("div", { key: 'fad2f71614c6963015f95e74e297c58a4adee95b', class: "zonos--contact" }, index.h("zonos-text", { key: '0c661050b1b95da56af1046fac39c7fa6de18685', type: "label" }, localization.translate('Contact')), index.h("zonos-input", { key: '3e35a5f9d4bca373ef9403da0de53ea895aca61f', class: "zonos--form-email", inputLabel: localization.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: '093cdcc771b4ade381a392a1023d9d037d4e3e35', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: 'e9d957551070a855179b78da655beaf3b4e731e2', class: "zonos--form-first-name", inputLabel: localization.translate('First name'), inputValue: firstName, isError: containsNonLatinChars.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
82
184
|
key: 'name',
|
|
83
185
|
value: `${e.detail} ${lastName}`,
|
|
84
|
-
}) }), index.h("zonos-input", { key: '
|
|
186
|
+
}) }), index.h("zonos-input", { key: '0b86805e872607d367446f5e6ef074974f9840c2', class: "zonos--form-last-name", inputLabel: localization.translate('Last name'), inputValue: lastName, isError: containsNonLatinChars.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
85
187
|
key: 'name',
|
|
86
188
|
value: `${firstName} ${e.detail}`,
|
|
87
|
-
}) }))), index.h("div", { key: '
|
|
189
|
+
}) }))), index.h("div", { key: '6447f55e8d173d18cd46cba829527c4d487631a2', class: "zonos--address" }, index.h("zonos-text", { key: '18ef146cc44f658524c6535e851281b62249fa26', type: "label" }, localization.translate('Address')), index.h("zonos-input", { key: '95cfb115c4304e8a142ab2e952fc8c4bfbe39e43', class: "zonos--form-country", inputLabel: localization.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'e3774713ec0b0e861981aa9f2c62f6749125e174', class: "zonos--form-line1", inputLabel: localization.translate('Address line 1'), inputValue: line1, isError: containsNonLatinChars.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '0d1fce85ad42e42b266ad411d4e3a96e4b8b8bf3', class: "zonos--form-line2", inputLabel: localization.translate('Address line 2'), inputValue: line2, isError: containsNonLatinChars.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: '5d5e740b711ff65a0366a6c4891f22684f32c74b', class: "zonos--address-row" }, index.h("zonos-input", { key: '8f124a91865c59096ba5c624ec229a3d1545c985', class: "zonos--form-city", inputLabel: localization.translate('City'), inputValue: city, isError: containsNonLatinChars.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), this.currentAddress.state && (index.h("zonos-input", { key: '50e852953ba88573929a200bce4c67fab2146245', class: "zonos--form-state", inputLabel: localization.translate('State/Province'), inputValue: state, isError: containsNonLatinChars.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) }))), index.h("zonos-input", { key: '74c17f1d1a77af3f90100a6832b2c8fe7bdca24e', class: "zonos--form-postal-code", inputLabel: localization.translate('Postal code'), inputValue: postal_code, isError: containsNonLatinChars.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '20775c4a944fe9305446898109637e5b38229a1d', class: "zonos--form-phone", inputLabel: localization.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
88
190
|
}
|
|
89
191
|
static get watchers() { return {
|
|
90
192
|
"translatedAddress": ["watchCurrentAddress"]
|
|
@@ -92,7 +194,7 @@ const ZonosAddressForm = class {
|
|
|
92
194
|
};
|
|
93
195
|
ZonosAddressForm.style = ZonosAddressFormStyle0;
|
|
94
196
|
|
|
95
|
-
const RemoveIcon
|
|
197
|
+
const RemoveIcon = `<svg color="var(--zonos-elements-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
96
198
|
|
|
97
199
|
const zonosAddressSuggestionsCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:relative}:host .wrapper{position:absolute;margin-top:4px;top:100%;left:0;right:0;z-index:3;max-height:300px;overflow-y:auto;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));-webkit-box-shadow:var(--zonos-elements-shadow-select-active);box-shadow:var(--zonos-elements-shadow-select-active);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;list-style:none;padding:0;background-color:var(--zonos-elements-surface-color)}:host .wrapper .option{padding:8px;background-color:var(--zonos-elements-surface-color);outline:none;border:none;text-align:left}:host .wrapper .option.last-hovered{background-color:var(--zonos-elements-gray-100)}:host .wrapper .option .highlight{font-weight:600;color:var(--zonos-elements-gray-1000)}:host .wrapper>.powered-by{padding:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}:host .wrapper>.powered-by .powered-by-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;gap:5px;-ms-flex:1;flex:1}:host .wrapper>.suggestion{cursor:pointer}:host .wrapper>.suggestion:hover{background-color:var(--zonos-elements-gray-100)}";
|
|
98
200
|
const ZonosAddressSuggestionsStyle0 = zonosAddressSuggestionsCss;
|
|
@@ -170,9 +272,9 @@ const ZonosAddressSuggestions = class {
|
|
|
170
272
|
return segments;
|
|
171
273
|
}
|
|
172
274
|
render() {
|
|
173
|
-
return (index.h(index.Host, { key: '
|
|
275
|
+
return (index.h(index.Host, { key: '20e095515d18016bd1f538bd345ed58aafe8518f', class: "zonos--address-suggestions", role: "group", style: {
|
|
174
276
|
'--zonos--border-radius': getBorderRadius.getBorderRadius(),
|
|
175
|
-
} }, index.h("ul", { key: '
|
|
277
|
+
} }, index.h("ul", { key: 'f43e0820d29fc5ef96ab42402e370dc6ce381e66', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (index.h("li", { key: 'd8ff4f7b53ea5fac8f42f1c13b2255ca2ea5d5e8', "aria-selected": false, class: "powered-by option", role: "option" }, index.h("div", { key: '2431de3e4e5241e5d74f552051a5d3d4954624a5', class: "powered-by-container" }, index.h("zonos-text", { key: '48de6d435ffef45f60ebb4ef6c4b2eaf5bdee821', type: "caption" }, "Suggestions powered by"), index.h("zonos-text", { key: 'b0e8f2986d4f85daa2fd53b7ea812d296d28a164', type: "semiBoldLabel" }, "Google")), index.h("zonos-button", { key: 'e62245b99bcdc192a4ee98511c8a4a0efad6ea92', "aria-label": "Clear suggestions", icon: index.h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => {
|
|
176
278
|
this.localSuggestions = [];
|
|
177
279
|
} }))), this.localSuggestions.map(suggestion => (
|
|
178
280
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
@@ -355,7 +457,7 @@ const ZonosAddressUpdateDialog = class {
|
|
|
355
457
|
return (index.h(index.Host, { key: '655845cef04f4af526b1a1c4e49243c4f2b4c7f6', class: classes.classes([
|
|
356
458
|
'zonos--address-update-dialog zonos--elements',
|
|
357
459
|
this.isMobile && 'mobile',
|
|
358
|
-
]) }, index.h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, index.h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, index.h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, index.h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, index.h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, localization.translate('Update your address')), index.h("zonos-button", { key: '474cc2421cd3150daa46bfe215da6ae7df9c6087', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$
|
|
460
|
+
]) }, index.h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, index.h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, index.h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, index.h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, index.h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, localization.translate('Update your address')), index.h("zonos-button", { key: '474cc2421cd3150daa46bfe215da6ae7df9c6087', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1.RemoveIcon }), noBackground: true, onClick: () => this.closeUpdateDialogHandler(), title: "Close checkout dialog" })), index.h("zonos-text", { key: '6d019250cce57e8b30dd790a184df7273bdb234f' }, localization.translate('To ensure delivery all address details must be in Latin characters.'))), index.h("div", { key: '80ee681844f4f4f43fce69d977b634b1fbc3d5f5', class: "zonos--group" }, index.h("zonos-text", { key: '940e510eceec156a74f32de84cf58ffebd796435', class: "zonos--what-you-entered", type: "semiBoldLabel" }, localization.translate('What you entered')), index.h("div", { key: 'f626127f5c399c29ab1022deb66aaee8f8a49601', class: "zonos--address-display-group" }, index.h("zonos-address-display", { key: '9dfcba1037325c3a1f9e82b8e4797e7872dd7e3f', addressType: "shipping", currentAddress: shipping }), billing && (index.h("zonos-address-display", { key: 'fee8ae2c6786d735133c2a0a42f3e3d40d7f9ea9', addressType: "billing", currentAddress: billing }))), index.h("div", { key: '5a82195018ff8cdfd1126f4424062a26c25ee757', class: "zonos--address-form-section" }, index.h("zonos-text", { key: 'f694dfad166697e4c034cea51057133b69b1c144', type: "semiBoldLabel" }, localization.translate('Translated address')), index.h("zonos-address-form", { key: '4a99c841cf4800de43c612cce3d56d956d02c22f', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
|
|
359
461
|
const address = e.detail;
|
|
360
462
|
this.translatedShippingAddressState =
|
|
361
463
|
this.buildTranslateAddressState({
|
|
@@ -398,6 +500,30 @@ const isValidZip = ({ countryFields, zip, }) => {
|
|
|
398
500
|
return countryFields.zipRequired && !!zip;
|
|
399
501
|
};
|
|
400
502
|
|
|
503
|
+
const hasCountries = (countries) => !!countries && Object.keys(countries).length > 0;
|
|
504
|
+
/**
|
|
505
|
+
* Builds the country options for an address form's country dropdown.
|
|
506
|
+
*
|
|
507
|
+
* Shipping addresses are restricted to the merchant's shipping zone, since we
|
|
508
|
+
* can only fulfill orders to those countries. Billing addresses are not — a
|
|
509
|
+
* shopper's card can be billed to any country, so restricting the billing
|
|
510
|
+
* country prevents them from checking out at all (05CHECK-915).
|
|
511
|
+
*
|
|
512
|
+
* When the full country list is unavailable we fall back to the shipping zone
|
|
513
|
+
* so the dropdown is never empty.
|
|
514
|
+
*/
|
|
515
|
+
const getAddressCountryOptions = ({ allCountries, shippingZoneCountries, type, }) => {
|
|
516
|
+
const countries = type === 'billing' && hasCountries(allCountries)
|
|
517
|
+
? allCountries
|
|
518
|
+
: shippingZoneCountries;
|
|
519
|
+
return Object.values(countries || {})
|
|
520
|
+
.map(country => ({
|
|
521
|
+
label: country.displayName,
|
|
522
|
+
value: country.code,
|
|
523
|
+
}))
|
|
524
|
+
.sort((a, b) => a.label.localeCompare(b.label));
|
|
525
|
+
};
|
|
526
|
+
|
|
401
527
|
const mergeAddress = ({ addresses, delimiter = ' ', }) => {
|
|
402
528
|
// Remove duplicate addresses
|
|
403
529
|
const addressSet = new Set(addresses.filter(Boolean));
|
|
@@ -462,14 +588,6 @@ const ZonosAddress = class {
|
|
|
462
588
|
* Whether to start google place suggestions
|
|
463
589
|
*/
|
|
464
590
|
this.startGooglePlaceSuggestions = false;
|
|
465
|
-
/**
|
|
466
|
-
* List of countries to show in the address element
|
|
467
|
-
*/
|
|
468
|
-
this.shipToCountries = null;
|
|
469
|
-
/**
|
|
470
|
-
* Shipping zones from localization
|
|
471
|
-
*/
|
|
472
|
-
this.shippingZones = null;
|
|
473
591
|
this.city = '';
|
|
474
592
|
this.country = '';
|
|
475
593
|
this.firstName = '';
|
|
@@ -509,6 +627,14 @@ const ZonosAddress = class {
|
|
|
509
627
|
* Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
|
|
510
628
|
*/
|
|
511
629
|
this.isAutoCompleteAdjusted = false;
|
|
630
|
+
/**
|
|
631
|
+
* Memoized country options, keyed on the store references they derive from.
|
|
632
|
+
* `render()` runs on every keystroke, and rebuilding the list each time would
|
|
633
|
+
* re-sort ~244 countries and hand `zonos-stripe-select` a new array identity,
|
|
634
|
+
* re-rendering it needlessly. `@stencil/store` replaces these references
|
|
635
|
+
* wholesale rather than mutating them, so reference equality is a safe key.
|
|
636
|
+
*/
|
|
637
|
+
this.countryOptionsCache = null;
|
|
512
638
|
// Create a single throttled instance that persists
|
|
513
639
|
this.throttledGetAddressSuggestions = throttle.throttle_1(() => {
|
|
514
640
|
if (zonosStore.zonosStore.checkoutAddressService) {
|
|
@@ -660,6 +786,28 @@ const ZonosAddress = class {
|
|
|
660
786
|
this.onStoreCheckoutSessionIdChangedSubscription = localization.storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
|
|
661
787
|
};
|
|
662
788
|
}
|
|
789
|
+
getCountryOptions() {
|
|
790
|
+
const { allCountries, shippingZoneCountries } = localization.localizationStore;
|
|
791
|
+
const cache = this.countryOptionsCache;
|
|
792
|
+
if (cache &&
|
|
793
|
+
cache.allCountries === allCountries &&
|
|
794
|
+
cache.shippingZoneCountries === shippingZoneCountries &&
|
|
795
|
+
cache.type === this.type) {
|
|
796
|
+
return cache.options;
|
|
797
|
+
}
|
|
798
|
+
const options = getAddressCountryOptions({
|
|
799
|
+
allCountries,
|
|
800
|
+
shippingZoneCountries,
|
|
801
|
+
type: this.type,
|
|
802
|
+
});
|
|
803
|
+
this.countryOptionsCache = {
|
|
804
|
+
allCountries,
|
|
805
|
+
options,
|
|
806
|
+
shippingZoneCountries,
|
|
807
|
+
type: this.type,
|
|
808
|
+
};
|
|
809
|
+
return options;
|
|
810
|
+
}
|
|
663
811
|
getStripeAddressInstance() {
|
|
664
812
|
if (this.type === 'billing') {
|
|
665
813
|
return {
|
|
@@ -1086,24 +1234,19 @@ const ZonosAddress = class {
|
|
|
1086
1234
|
this.initAddressSuggestions();
|
|
1087
1235
|
this.initDefaultCustomAddressForm();
|
|
1088
1236
|
}
|
|
1089
|
-
shippingZonesChanged() {
|
|
1090
|
-
this.shippingZones = localization.localizationStore.shippingZoneCountries;
|
|
1091
|
-
this.shipToCountries = Object.values(this.shippingZones || {})
|
|
1092
|
-
.map(country => ({
|
|
1093
|
-
label: country.displayName,
|
|
1094
|
-
value: country.code,
|
|
1095
|
-
}))
|
|
1096
|
-
.sort((a, b) => {
|
|
1097
|
-
return a.label.localeCompare(b.label);
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
1237
|
renderCustomAddressForm() {
|
|
1101
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
1102
|
-
const
|
|
1238
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1239
|
+
const _s = this.getCustomAddressErrors(), { showError } = _s, customAddressErrors = __rest(_s, ["showError"]);
|
|
1103
1240
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
1104
1241
|
const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
|
|
1105
|
-
|
|
1106
|
-
|
|
1242
|
+
/**
|
|
1243
|
+
* Billing addresses are not limited to the shipping zone: a shopper's card
|
|
1244
|
+
* can be billed to any country, so restricting it would block them from
|
|
1245
|
+
* checking out entirely (05CHECK-915).
|
|
1246
|
+
*/
|
|
1247
|
+
const countryOptions = this.getCountryOptions();
|
|
1248
|
+
const firstCountry = countryOptions[0];
|
|
1249
|
+
const stateOptions = Object.entries(((_a = this.countryField) === null || _a === void 0 ? void 0 : _a.regions) || {})
|
|
1107
1250
|
.map(([label, region]) => ({
|
|
1108
1251
|
label,
|
|
1109
1252
|
value: region.interpayCode,
|
|
@@ -1137,7 +1280,7 @@ const ZonosAddress = class {
|
|
|
1137
1280
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1138
1281
|
*/
|
|
1139
1282
|
this.lastName = event.detail;
|
|
1140
|
-
}, required: true }), index.h("zonos-stripe-select", { "aria-required": "true", autoComplete:
|
|
1283
|
+
}, required: true }), index.h("zonos-stripe-select", { "aria-required": "true", autoComplete: `${this.type} country`, class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
|
|
1141
1284
|
this.countryChanged(event.detail);
|
|
1142
1285
|
// revalidate the postal code since with empty value so it would reset the customAddressErrors
|
|
1143
1286
|
this.validate({
|
|
@@ -1166,9 +1309,9 @@ const ZonosAddress = class {
|
|
|
1166
1309
|
this.city = '';
|
|
1167
1310
|
this.state = '';
|
|
1168
1311
|
this.postalCode = '';
|
|
1169
|
-
}, options:
|
|
1312
|
+
}, options: countryOptions, required: true, selectLabel: localization.translate('Country'), selectedValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
1170
1313
|
localization.localizationStore.selectedCountryCode ||
|
|
1171
|
-
(firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), index.h("div", { class: "zonos--custom-address-form-line1-wrapper" }, index.h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete:
|
|
1314
|
+
(firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), index.h("div", { class: "zonos--custom-address-form-line1-wrapper" }, index.h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete: `${this.type} address-line1`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.line1 : undefined, inputLabel: localization.translate('Address line 1'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line1, name: "address-line1", onInputChange: (event) => {
|
|
1172
1315
|
this.validate({
|
|
1173
1316
|
type: this.type,
|
|
1174
1317
|
value: event.detail,
|
|
@@ -1199,9 +1342,9 @@ const ZonosAddress = class {
|
|
|
1199
1342
|
}, suggestions: this.addressSuggestions, type: this.type })), index.h("div", { "aria-label": "Additional address details", class: classes.classes([
|
|
1200
1343
|
'zonos--custom-address-form-additional-fields',
|
|
1201
1344
|
countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
|
|
1202
|
-
]), role: "group" }, index.h("zonos-stripe-input", { "aria-required": "false", autoComplete:
|
|
1345
|
+
]), role: "group" }, index.h("zonos-stripe-input", { "aria-required": "false", autoComplete: `${this.type} address-line2`, class: "zonos--custom-address-form-input", inputLabel: localization.translate(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
|
|
1203
1346
|
this.line2 = event.detail;
|
|
1204
|
-
} }), ((
|
|
1347
|
+
} }), ((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.cityShow) && (index.h("zonos-stripe-input", { "aria-required": ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityRequired) ? 'true' : 'false', autoComplete: `${this.type} address-level2`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: localization.translate(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
|
|
1205
1348
|
this.validate({
|
|
1206
1349
|
type: this.type,
|
|
1207
1350
|
value: event.detail,
|
|
@@ -1215,7 +1358,7 @@ const ZonosAddress = class {
|
|
|
1215
1358
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1216
1359
|
*/
|
|
1217
1360
|
this.city = event.detail;
|
|
1218
|
-
}, required: (
|
|
1361
|
+
}, required: (_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityRequired })), index.h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_g = this.countryField) === null || _g === void 0 ? void 0 : _g.stateShow) && (index.h("zonos-stripe-select", { "aria-required": ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateRequired) ? 'true' : 'false', autoComplete: `${this.type} address-level1`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
|
|
1219
1362
|
this.validate({
|
|
1220
1363
|
type: this.type,
|
|
1221
1364
|
value: event.detail,
|
|
@@ -1229,9 +1372,9 @@ const ZonosAddress = class {
|
|
|
1229
1372
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1230
1373
|
*/
|
|
1231
1374
|
this.state = event.detail;
|
|
1232
|
-
}, options: stateOptions, required: (
|
|
1375
|
+
}, options: stateOptions, required: (_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired, selectLabel: localization.translate(((_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.zipShow) && (index.h("zonos-stripe-input", { "aria-describedby": ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipFormat)
|
|
1233
1376
|
? `zip-format-${this.type}`
|
|
1234
|
-
: undefined, "aria-required": ((
|
|
1377
|
+
: undefined, "aria-required": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipRequired) ? 'true' : 'false', autoComplete: `${this.type} postal-code`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: localization.translate(((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', name: "postalCode", onInputChange: (event) => {
|
|
1235
1378
|
this.validate({
|
|
1236
1379
|
type: this.type,
|
|
1237
1380
|
value: event.detail,
|
|
@@ -1245,7 +1388,7 @@ const ZonosAddress = class {
|
|
|
1245
1388
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1246
1389
|
*/
|
|
1247
1390
|
this.postalCode = event.detail;
|
|
1248
|
-
}, required: (
|
|
1391
|
+
}, required: (_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipRequired, title: `${this.type} zip code` }))), index.h("zonos-stripe-phone-input", { autoComplete: `${this.type} tel`, class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_r = zonosStore.zonosStore.genericSettings) === null || _r === void 0 ? void 0 : _r.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: localization.translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
|
|
1249
1392
|
const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
|
|
1250
1393
|
// Validate the phone number
|
|
1251
1394
|
this.validate({
|
|
@@ -1286,14 +1429,6 @@ const ZonosAddress = class {
|
|
|
1286
1429
|
}
|
|
1287
1430
|
componentDidLoad() {
|
|
1288
1431
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
1289
|
-
this.shipToCountries = Object.values(localization.localizationStore.shippingZoneCountries || {})
|
|
1290
|
-
.map(country => ({
|
|
1291
|
-
label: country.displayName,
|
|
1292
|
-
value: country.code,
|
|
1293
|
-
}))
|
|
1294
|
-
.sort((a, b) => {
|
|
1295
|
-
return a.label.localeCompare(b.label);
|
|
1296
|
-
});
|
|
1297
1432
|
this.isDirtyAddress =
|
|
1298
1433
|
!!stripeAddressEventData &&
|
|
1299
1434
|
stripeAddressEventData.value.address.line1.length > 0;
|
|
@@ -1306,7 +1441,6 @@ const ZonosAddress = class {
|
|
|
1306
1441
|
}
|
|
1307
1442
|
render() {
|
|
1308
1443
|
var _a;
|
|
1309
|
-
this.shippingZones = localization.localizationStore.shippingZoneCountries;
|
|
1310
1444
|
this.addressService = zonosStore.zonosStore.checkoutAddressService;
|
|
1311
1445
|
if ((_a = cart.stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) {
|
|
1312
1446
|
this.isAddressFilled = true;
|
|
@@ -1316,10 +1450,10 @@ const ZonosAddress = class {
|
|
|
1316
1450
|
this.country = localization.localizationStore.selectedCountryCode;
|
|
1317
1451
|
}
|
|
1318
1452
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1319
|
-
return (index.h(index.Host, { key: '
|
|
1453
|
+
return (index.h(index.Host, { key: '5baf00df63a693613f493a84c906898080dcbfa2', class: classes.classes([
|
|
1320
1454
|
'zonos--address zonos--elements',
|
|
1321
1455
|
`zonos--${this.type}-address`,
|
|
1322
|
-
]) }, index.h("zonos-text", { key: '
|
|
1456
|
+
]) }, index.h("zonos-text", { key: 'f5079e30a1eadceffaac7fef5aa5296b1f9f480b', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("slot", { key: 'fcbd1bac9e06e91c9e4a229d63852df9fea08c58', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
|
|
1323
1457
|
}
|
|
1324
1458
|
get el() { return index.getElement(this); }
|
|
1325
1459
|
static get watchers() { return {
|
|
@@ -1335,121 +1469,11 @@ const ZonosAddress = class {
|
|
|
1335
1469
|
"phone": ["formFieldsChanged"],
|
|
1336
1470
|
"postalCode": ["formFieldsChanged"],
|
|
1337
1471
|
"state": ["formFieldsChanged"],
|
|
1338
|
-
"addressService": ["shouldEnabledCustomAddressChanged"]
|
|
1339
|
-
"shippingZones": ["shippingZonesChanged"]
|
|
1472
|
+
"addressService": ["shouldEnabledCustomAddressChanged"]
|
|
1340
1473
|
}; }
|
|
1341
1474
|
};
|
|
1342
1475
|
ZonosAddress.style = ZonosCustomAddressStyle0;
|
|
1343
1476
|
|
|
1344
|
-
const RemoveIcon = `<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>`;
|
|
1345
|
-
|
|
1346
|
-
const zonosDialogCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:4px;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--loading-text,:host .zonos--loading-title{max-width:100%;padding:0 32px;text-align:center}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";
|
|
1347
|
-
const ZonosDialogStyle0 = zonosDialogCss;
|
|
1348
|
-
|
|
1349
|
-
const ZonosDialog = class {
|
|
1350
|
-
constructor(hostRef) {
|
|
1351
|
-
index.registerInstance(this, hostRef);
|
|
1352
|
-
this.closeDialog = index.createEvent(this, "closeDialog", 3);
|
|
1353
|
-
/**
|
|
1354
|
-
* Whether or not the dialog is open
|
|
1355
|
-
* @default false
|
|
1356
|
-
*/
|
|
1357
|
-
this.open = false;
|
|
1358
|
-
/**
|
|
1359
|
-
* The header text for the dialog
|
|
1360
|
-
*/
|
|
1361
|
-
this.headerText = '';
|
|
1362
|
-
/**
|
|
1363
|
-
* The width of the dialog
|
|
1364
|
-
* @default 460px
|
|
1365
|
-
*/
|
|
1366
|
-
this.width = '460px';
|
|
1367
|
-
/**
|
|
1368
|
-
* Whether or not to show the header
|
|
1369
|
-
* @default false
|
|
1370
|
-
*/
|
|
1371
|
-
this.noHeader = false;
|
|
1372
|
-
/**
|
|
1373
|
-
* Whether or not to have body padding
|
|
1374
|
-
* @default false
|
|
1375
|
-
*/
|
|
1376
|
-
this.noBodyPadding = false;
|
|
1377
|
-
/**
|
|
1378
|
-
* Whether or not to have body padding
|
|
1379
|
-
* @default false
|
|
1380
|
-
*/
|
|
1381
|
-
this.noBorder = false;
|
|
1382
|
-
/**
|
|
1383
|
-
* Whether or not to show the close button
|
|
1384
|
-
* @default false
|
|
1385
|
-
*/
|
|
1386
|
-
this.noCloseButton = false;
|
|
1387
|
-
/**
|
|
1388
|
-
* Whether or not to close the dialog when clicking outside of it
|
|
1389
|
-
* @default false
|
|
1390
|
-
*/
|
|
1391
|
-
this.noClickOutside = false;
|
|
1392
|
-
/**
|
|
1393
|
-
* Flag to determine if the checkout is on mobile
|
|
1394
|
-
*/
|
|
1395
|
-
this.mobile = false;
|
|
1396
|
-
/**
|
|
1397
|
-
* Load loading spinner for the dialog or not
|
|
1398
|
-
*/
|
|
1399
|
-
this.isLoading = true;
|
|
1400
|
-
this.isMobile = false;
|
|
1401
|
-
this.isMobileMode = () => {
|
|
1402
|
-
return this.mobile || window.innerWidth <= 768;
|
|
1403
|
-
};
|
|
1404
|
-
this.closeButtonHandler = () => {
|
|
1405
|
-
// Only do the action if the dialog is open
|
|
1406
|
-
if (!this.open) {
|
|
1407
|
-
return;
|
|
1408
|
-
}
|
|
1409
|
-
this.closeDialog.emit();
|
|
1410
|
-
};
|
|
1411
|
-
this.clickOutsideDialogHandler = (event) => {
|
|
1412
|
-
if (event.target === event.currentTarget && !this.noClickOutside) {
|
|
1413
|
-
this.closeDialog.emit();
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
}
|
|
1417
|
-
handleWindowResize() {
|
|
1418
|
-
this.isMobile = this.isMobileMode();
|
|
1419
|
-
}
|
|
1420
|
-
handleKeyDown(ev) {
|
|
1421
|
-
if (ev.key === 'Escape') {
|
|
1422
|
-
this.closeButtonHandler();
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
componentDidLoad() {
|
|
1426
|
-
this.isMobile = this.isMobileMode();
|
|
1427
|
-
}
|
|
1428
|
-
render() {
|
|
1429
|
-
const borderStyle = getBorderRadius.getBorderRadius({
|
|
1430
|
-
overrideBorderStyle: this.borderStyle,
|
|
1431
|
-
});
|
|
1432
|
-
return (index.h(index.Host, { key: '75ec5025b26d1c68daa95198bfe4defa9b4fccbb', class: classes.classes([
|
|
1433
|
-
'zonos--elements',
|
|
1434
|
-
this.open && 'open',
|
|
1435
|
-
this.isLoading && 'is-loading',
|
|
1436
|
-
this.noBorder && 'no-border',
|
|
1437
|
-
this.isMobile && 'mobile',
|
|
1438
|
-
]), style: {
|
|
1439
|
-
'--zonos--border-radius': borderStyle,
|
|
1440
|
-
'--zonos--font-family': zonosStore.zonosStoreFontFamily(),
|
|
1441
|
-
'--zonos--height': this.height || 'initial',
|
|
1442
|
-
'--zonos--min-height': this.minHeight || '500px',
|
|
1443
|
-
'--zonos--width': this.width,
|
|
1444
|
-
} }, index.h("div", { key: '5d10176ce2b772fb8fd29f43ff45eb8ec0e4f891', class: "zonos--backdrop" }), index.h("div", { key: '2aa211aebf328b30d69cc32030964c68d9114380', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, index.h("div", { key: 'ae077f398158ca708065bf3f2cc60c36730e16df', class: "zonos--dialog" }, this.isLoading && (index.h("div", { key: 'b11ef43cb4a663495bfd5dfe636df98fb692f2e3', class: "zonos--loading" }, index.h("zonos-spinner", { key: 'df7b43c923a59ab16d56c56034f19e2ebf367c68', size: 30 }), this.loadingTitle && (index.h("zonos-text", { key: 'c2a9c49f41272ae535a2dfc3f6c97d91552729a2', class: "zonos--loading-title", size: "l", weight: 700 }, this.loadingTitle)), this.loadingText && (index.h("zonos-text", { key: 'c5a4be389ec0c5c8b9e7b126d69f39b334bd9c7c', class: "zonos--loading-text" }, this.loadingText)))), (this.headerText || !this.noCloseButton) && (index.h("div", { key: '21884f1a119c2b1d241b746ae27f9ebe68795b94', class: "zonos--header" }, this.headerText && (index.h("h3", { key: '77036606a70a57f250facdd1b95726c35807c151', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (index.h("zonos-button", { key: '93eafa70b68ebbc0be89b6cec54aadba9bdb91ef', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, title: "Close dialog", variant: "subtle" })))), index.h("div", { key: '182ed04b1a14981aa5b679da8a1a556fcc413137', class: classes.classes([
|
|
1445
|
-
'zonos--body',
|
|
1446
|
-
this.noBodyPadding && 'zonos--no-body-padding',
|
|
1447
|
-
]) }, index.h("slot", { key: '65ad39c50b318b39e585301de2aeea6ef61db487' })), index.h("slot", { key: 'a60bb6eeee719852350584d6ff983d699f6ae84e', name: "dialog-footer" })))));
|
|
1448
|
-
}
|
|
1449
|
-
static get assetsDirs() { return ["assets"]; }
|
|
1450
|
-
};
|
|
1451
|
-
ZonosDialog.style = ZonosDialogStyle0;
|
|
1452
|
-
|
|
1453
1477
|
// This file is a workaround for a bug in web browsers' "native"
|
|
1454
1478
|
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
1455
1479
|
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
@@ -7343,6 +7367,15 @@ const ZonosStripePhoneInput = class {
|
|
|
7343
7367
|
this.updatePhoneFormatter();
|
|
7344
7368
|
};
|
|
7345
7369
|
}
|
|
7370
|
+
onCountryCodeChange() {
|
|
7371
|
+
/**
|
|
7372
|
+
* Re-derive the dial code when the address country changes, otherwise a
|
|
7373
|
+
* shopper who changes country keeps the previous country's dial code — for
|
|
7374
|
+
* example a US billing address on a Mexico shipment would send a US phone
|
|
7375
|
+
* number prefixed with +52 (05CHECK-915).
|
|
7376
|
+
*/
|
|
7377
|
+
this.initPhoneNumberValue();
|
|
7378
|
+
}
|
|
7346
7379
|
onCountryOptionsChange() {
|
|
7347
7380
|
// Re-initialize the phone number value when the country options change
|
|
7348
7381
|
this.initPhoneNumberValue();
|
|
@@ -7422,27 +7455,28 @@ const ZonosStripePhoneInput = class {
|
|
|
7422
7455
|
.filter(Boolean)
|
|
7423
7456
|
.sort((a, b) => a.displayName.localeCompare(b.displayName))
|
|
7424
7457
|
: [];
|
|
7425
|
-
return (index.h(index.Host, { key: '
|
|
7458
|
+
return (index.h(index.Host, { key: '14478c1db0acc4651d9433f71fefa8bd18b28a61', class: classes.classes([
|
|
7426
7459
|
'zonos--phone-input zonos--elements',
|
|
7427
7460
|
isDark && 'dark',
|
|
7428
|
-
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: '
|
|
7461
|
+
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: 'cdc9f75fa9a8fd81ab565614729d33b3b54b1ba9', class: classes.classes([
|
|
7429
7462
|
'zonos--label-wrapper',
|
|
7430
7463
|
this.disabled && 'disabled',
|
|
7431
7464
|
this.isFocused && 'focused',
|
|
7432
7465
|
hasContent && 'has-content',
|
|
7433
7466
|
this.error && 'has-error',
|
|
7434
7467
|
this.inputLabel && 'has-label',
|
|
7435
|
-
]) }, index.h("select", { key: '
|
|
7468
|
+
]) }, index.h("select", { key: 'a34d728be2b100874a2fb2a91e12b77988602b3a', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
|
|
7436
7469
|
var _a;
|
|
7437
7470
|
return (index.h("option", { key: option.countryCode, selected: option.countryCode === ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.countryCode), value: option.countryCode }, option.displayName, " (+", option.phoneCode, ")"));
|
|
7438
|
-
})), index.h("div", { key: '
|
|
7471
|
+
})), index.h("div", { key: 'c8d76a0a1e9ca245f03a853440a691e1bb478093', class: "zonos--input-group" }, index.h("div", { key: '51ccfb533bb4560061c63aaed368fb6488cf9d87', class: "zonos--select-wrapper" }, index.h("div", { key: 'cd50bc9c8f2fd407f47e5bfd3eba18a3f8fe721f', class: "zonos--country-select" }, index.h("div", { key: '05581057f31568b3d50b054e9c7fbbad5be7c27a', class: "zonos--country-select-content" }, this.selectedCountry && (index.h("div", { key: '04c5abdc6fdf7e71585896b426ec1ab00dc11f66', class: "zonos--country-select-selected" }, index.h("div", { key: '6750556068dbad185fadfba36268417974a43865', class: "zonos--country-flag-wrapper" }, index.h("zonos-country-flag", { key: 'a611a41490d68f2763ae43ad0fd5c0c498d16bfe', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), index.h("div", { key: 'eab8a6353cd865cffb1576f14fee6edd5dbd3383', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), index.h("div", { key: 'b3b4b8c407ed68305b467590921bc57925077acd', class: "zonos--select-chevron-wrapper" }, index.h("zonos-icon", { key: '7bc52fdcaf76bf6416d33442e844057b8d6e8121', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon$1, iconColor: "gray-800" }))))), index.h("div", { key: 'd0ad07b902ef0ff675a515c07ec6597c0d0b0aa2', class: classes.classes([
|
|
7439
7472
|
'zonos--input-container',
|
|
7440
7473
|
this.inputLabel && 'has-label',
|
|
7441
7474
|
hasContent && 'has-content',
|
|
7442
|
-
]) }, index.h("input", Object.assign({ key: '
|
|
7475
|
+
]) }, index.h("input", Object.assign({ key: '5b12c7a228bf9736856c9ebf8ff7898cf0fc1889' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: "zonos--floated-input", disabled: this.disabled, id: this.inputId, onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handlePhoneChange, placeholder: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.phonePlaceholder) || '', ref: el => (this.inputRef = el), type: "tel" })), this.inputLabel && (index.h("div", { key: '04482f4bc210fb7ee6047972043f6b1942b25142', class: "zonos--floated-label" }, index.h("label", { key: '345c8e9d7ebc4aa8891c86a77a51f9bbd0088044', htmlFor: this.inputId }, this.inputLabel || localization.translate('Phone number'))))))), this.error && (index.h("zonos-text", { key: 'cd8805f31cc6b2c9d6052f4c11190dba1f242945', textColor: "red-600" }, this.error))));
|
|
7443
7476
|
}
|
|
7444
7477
|
get el() { return index.getElement(this); }
|
|
7445
7478
|
static get watchers() { return {
|
|
7479
|
+
"countryCode": ["onCountryCodeChange"],
|
|
7446
7480
|
"countryOptions": ["onCountryOptionsChange"],
|
|
7447
7481
|
"selectedCountry": ["onSelectedCountryChange"],
|
|
7448
7482
|
"inputValue": ["onPhoneNumberChange"]
|
|
@@ -7585,11 +7619,10 @@ const ZonosStripeSelect = class {
|
|
|
7585
7619
|
};
|
|
7586
7620
|
ZonosStripeSelect.style = ZonosStripeSelectStyle0;
|
|
7587
7621
|
|
|
7588
|
-
exports.
|
|
7622
|
+
exports.zonos_address_completion_dialog = ZonosAddressCompletionDialog;
|
|
7589
7623
|
exports.zonos_address_form = ZonosAddressForm;
|
|
7590
7624
|
exports.zonos_address_suggestions = ZonosAddressSuggestions;
|
|
7591
7625
|
exports.zonos_address_update_dialog = ZonosAddressUpdateDialog;
|
|
7592
7626
|
exports.zonos_custom_address = ZonosAddress;
|
|
7593
|
-
exports.zonos_dialog = ZonosDialog;
|
|
7594
7627
|
exports.zonos_stripe_phone_input = ZonosStripePhoneInput;
|
|
7595
7628
|
exports.zonos_stripe_select = ZonosStripeSelect;
|