@zonos/elements 1.3.203 → 1.3.205
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-0d91ad0b.js → cart-193af95a.js} +6 -5
- package/dist/cjs/{debounce-94e1b7ff.js → debounce-0b9c0f8a.js} +1 -1
- package/dist/cjs/{getBorderRadius-8d3b1049.js → getBorderRadius-c424eb05.js} +1 -1
- package/dist/cjs/{index-0993f42d.js → index-1c710d00.js} +455 -377
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{isDarkColor-bcf49625.js → isDarkColor-35e8daec.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{localization-2f17c95f.js → localization-88da0959.js} +1 -1
- package/dist/cjs/{paypal-9953115b.js → paypal-8525404c.js} +4 -4
- package/dist/cjs/zonos-address_11.cjs.entry.js +321 -142
- package/dist/cjs/zonos-badge.cjs.entry.js +26 -4
- package/dist/cjs/zonos-banner.cjs.entry.js +6 -5
- package/dist/cjs/zonos-button_3.cjs.entry.js +89 -24
- package/dist/cjs/zonos-card.cjs.entry.js +10 -9
- package/dist/cjs/zonos-cart-items_14.cjs.entry.js +193 -74
- package/dist/cjs/zonos-checkout.cjs.entry.js +91 -35
- package/dist/cjs/zonos-collapse.cjs.entry.js +8 -2
- package/dist/cjs/zonos-component.cjs.entry.js +10 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -8
- package/dist/cjs/zonos-country-flag.cjs.entry.js +8 -4
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +52 -24
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +11 -10
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +21 -13
- package/dist/cjs/zonos-hello.cjs.entry.js +29 -17
- package/dist/cjs/zonos-input.cjs.entry.js +18 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +15 -4
- package/dist/cjs/zonos-link.cjs.entry.js +4 -4
- package/dist/cjs/zonos-logo.cjs.entry.js +8 -2
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +8 -8
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +25 -9
- package/dist/cjs/zonos-text.cjs.entry.js +11 -4
- package/dist/cjs/zonos-toggle.cjs.entry.js +5 -3
- package/dist/cjs/zonos-tooltip.cjs.entry.js +7 -1
- package/dist/cjs/zonos-v-stack.cjs.entry.js +6 -2
- package/dist/cjs/{zonosStore-9264749e.js → zonosStore-7c1e1bc1.js} +4 -5
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +0 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +24 -13
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +6 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +14 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +25 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.js +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +84 -28
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +54 -17
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +8 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +20 -12
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +24 -2
- package/dist/collection/components/common/zonos-banner/zonos-banner.js +4 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +69 -18
- package/dist/collection/components/common/zonos-card/zonos-card.js +7 -6
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +15 -2
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +8 -2
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +6 -0
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +34 -9
- package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +5 -1
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +6 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +6 -0
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +48 -14
- package/dist/collection/components/common/zonos-icon/zonos-icon.js +12 -1
- package/dist/collection/components/common/zonos-input/zonos-input.js +15 -1
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +5 -1
- package/dist/collection/components/common/zonos-link/zonos-link.js +3 -3
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +7 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +6 -0
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +4 -4
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +7 -0
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +5 -5
- package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +4 -1
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +21 -5
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +19 -14
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +37 -12
- package/dist/collection/components/common/zonos-text/zonos-text.js +9 -2
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +3 -1
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +6 -0
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +4 -0
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -7
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +9 -0
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +25 -13
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +8 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +0 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +17 -9
- package/dist/collection/components/main/zonos-controller.js +0 -4
- package/dist/collection/components/store/checkout/stripe.js +2 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +21 -8
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +13 -5
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +123 -53
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +11 -6
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -2
- package/dist/collection/types/generated/graphql.internal.types.js +4 -0
- package/dist/esm/{cart-db61eb95.js → cart-a921e0b7.js} +7 -6
- package/dist/esm/{debounce-3a9f27a0.js → debounce-eaee3a94.js} +1 -1
- package/dist/esm/{getBorderRadius-78b28b4d.js → getBorderRadius-b18c924f.js} +1 -1
- package/dist/esm/{index-a457c60c.js → index-5ea9f81d.js} +455 -377
- package/dist/esm/index.js +7 -7
- package/dist/esm/{isDarkColor-31dd7dff.js → isDarkColor-d8bb8659.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{localization-bf7224aa.js → localization-a2b8f9ed.js} +1 -1
- package/dist/esm/{paypal-2e0ffb07.js → paypal-67d51f03.js} +4 -4
- package/dist/esm/zonos-address_11.entry.js +321 -142
- package/dist/esm/zonos-badge.entry.js +26 -4
- package/dist/esm/zonos-banner.entry.js +6 -5
- package/dist/esm/zonos-button_3.entry.js +89 -24
- package/dist/esm/zonos-card.entry.js +10 -9
- package/dist/esm/zonos-cart-items_14.entry.js +193 -74
- package/dist/esm/zonos-checkout.entry.js +91 -35
- package/dist/esm/zonos-collapse.entry.js +8 -2
- package/dist/esm/zonos-component.entry.js +10 -1
- package/dist/esm/zonos-controller.entry.js +6 -8
- package/dist/esm/zonos-country-flag.entry.js +8 -4
- package/dist/esm/zonos-country-select_4.entry.js +52 -24
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/zonos-empty-state-payment_4.entry.js +11 -10
- package/dist/esm/zonos-hello-dialog.entry.js +21 -13
- package/dist/esm/zonos-hello.entry.js +29 -17
- package/dist/esm/zonos-input.entry.js +18 -4
- package/dist/esm/zonos-language-select_2.entry.js +15 -4
- package/dist/esm/zonos-link.entry.js +4 -4
- package/dist/esm/zonos-logo.entry.js +8 -2
- package/dist/esm/zonos-shipping-rich-radio.entry.js +8 -8
- package/dist/esm/zonos-stripe-input.entry.js +25 -9
- package/dist/esm/zonos-text.entry.js +11 -4
- package/dist/esm/zonos-toggle.entry.js +5 -3
- package/dist/esm/zonos-tooltip.entry.js +7 -1
- package/dist/esm/zonos-v-stack.entry.js +6 -2
- package/dist/esm/{zonosStore-d10a829f.js → zonosStore-1e015fa5.js} +4 -5
- package/dist/esm-es5/{cart-db61eb95.js → cart-a921e0b7.js} +1 -1
- package/dist/esm-es5/{debounce-3a9f27a0.js → debounce-eaee3a94.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-78b28b4d.js → getBorderRadius-b18c924f.js} +1 -1
- package/dist/esm-es5/index-5ea9f81d.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-31dd7dff.js → isDarkColor-d8bb8659.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{localization-bf7224aa.js → localization-a2b8f9ed.js} +1 -1
- package/dist/esm-es5/{paypal-2e0ffb07.js → paypal-67d51f03.js} +1 -1
- 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.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-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-shipping-rich-radio.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/esm-es5/{zonosStore-d10a829f.js → zonosStore-1e015fa5.js} +1 -1
- package/dist/scripts/index.d.ts +4 -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/stripe/zonos-custom-address/zonos-custom-address.d.ts +1 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- 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 +9 -0
- package/dist/types/types/generated/graphql.internal.types.ts +10 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-019f8637.entry.js +1 -0
- package/dist/zonos-elements/p-02da743b.system.js +2 -0
- package/dist/zonos-elements/{p-df4c46a6.entry.js → p-05a91fe6.entry.js} +1 -1
- package/dist/zonos-elements/p-0c4c8d63.entry.js +1 -0
- package/dist/zonos-elements/{p-5d0f7364.system.js → p-0d2df4d2.system.js} +1 -1
- package/dist/zonos-elements/p-0d7af8be.system.entry.js +1 -0
- package/dist/zonos-elements/p-12cd9d3a.entry.js +1 -0
- package/dist/zonos-elements/{p-d42dfd32.system.js → p-1327b935.system.js} +1 -1
- package/dist/zonos-elements/p-1640d77f.js +2 -0
- package/dist/zonos-elements/{p-3d82a352.js → p-16678764.js} +1 -1
- package/dist/zonos-elements/p-16e858f9.entry.js +1 -0
- package/dist/zonos-elements/{p-c291bac1.entry.js → p-18149db1.entry.js} +1 -1
- package/dist/zonos-elements/{p-db025dfc.system.entry.js → p-1ad099ec.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c5fcbc92.system.entry.js → p-1bc09abe.system.entry.js} +1 -1
- package/dist/zonos-elements/p-20ac92e1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d46349d3.system.entry.js → p-22cb6880.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c9aa902e.system.entry.js → p-2866fd29.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0693422b.system.js → p-28fcd277.system.js} +1 -1
- package/dist/zonos-elements/p-3196bf98.entry.js +1 -0
- package/dist/zonos-elements/p-3afc27ef.entry.js +1 -0
- package/dist/zonos-elements/p-3c921768.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ea6d87a1.system.js → p-3ee44728.system.js} +1 -1
- package/dist/zonos-elements/{p-be5afc91.system.entry.js → p-4329f616.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-715d0f59.system.entry.js → p-43b72ad6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8d0d488.system.entry.js → p-469ccc66.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4a3bb31d.entry.js +1 -0
- package/dist/zonos-elements/{p-80bbd9c0.system.entry.js → p-4fb88ebc.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5fbaa153.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7cd09f1f.system.js → p-69577745.system.js} +1 -1
- package/dist/zonos-elements/p-6d467dfb.entry.js +1 -0
- package/dist/zonos-elements/{p-3284f459.system.entry.js → p-719e14a8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fbe36bc8.system.entry.js → p-7234f876.system.entry.js} +1 -1
- package/dist/zonos-elements/p-74bcb5cc.entry.js +1 -0
- package/dist/zonos-elements/{p-27987298.system.entry.js → p-7777d85f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-aa1193bc.entry.js → p-848e08e8.entry.js} +1 -1
- package/dist/zonos-elements/{p-ab176281.system.entry.js → p-858b7908.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f255e822.js → p-8609e956.js} +1 -1
- package/dist/zonos-elements/p-87e807b4.entry.js +1 -0
- package/dist/zonos-elements/{p-cdd3087f.system.entry.js → p-8debefec.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d99d9e00.js → p-8e000d8d.js} +1 -1
- package/dist/zonos-elements/p-90c185ac.entry.js +1 -0
- package/dist/zonos-elements/p-91fc6911.entry.js +1 -0
- package/dist/zonos-elements/{p-851c642e.system.entry.js → p-93aeba62.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9b8a5372.entry.js +1 -0
- package/dist/zonos-elements/{p-cb823c4d.system.js → p-9e9ac7a2.system.js} +1 -1
- package/dist/zonos-elements/p-9fa17353.js +1 -0
- package/dist/zonos-elements/{p-01987cb2.system.entry.js → p-a0f570ea.system.entry.js} +1 -1
- package/dist/zonos-elements/p-abc83d01.entry.js +1 -0
- package/dist/zonos-elements/{p-45ebc788.entry.js → p-b21b0330.entry.js} +1 -1
- package/dist/zonos-elements/{p-488ad646.system.entry.js → p-b50eaeac.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b922c441.system.js +1 -0
- package/dist/zonos-elements/{p-6b6a9dd6.system.js → p-be53e893.system.js} +1 -1
- package/dist/zonos-elements/{p-c50b3100.system.js → p-c666d557.system.js} +1 -1
- package/dist/zonos-elements/{p-f891d470.entry.js → p-c988cf84.entry.js} +1 -1
- package/dist/zonos-elements/{p-26a634a5.system.entry.js → p-d649fb9a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-dcbd57df.entry.js +1 -0
- package/dist/zonos-elements/p-dd0f8f06.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a9307caa.js → p-dfe7d1dd.js} +1 -1
- package/dist/zonos-elements/p-e0587eeb.entry.js +1 -0
- package/dist/zonos-elements/p-e0ebbefe.entry.js +1 -0
- package/dist/zonos-elements/{p-72f37935.js → p-e337fa88.js} +1 -1
- package/dist/zonos-elements/{p-d6a10007.entry.js → p-e5152c04.entry.js} +1 -1
- package/dist/zonos-elements/p-eb2560b6.system.entry.js +1 -0
- package/dist/zonos-elements/p-ebe08e44.entry.js +1 -0
- package/dist/zonos-elements/{p-452070af.system.entry.js → p-eca09508.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e26c9e83.js → p-ed20f2f7.js} +1 -1
- package/dist/zonos-elements/{p-5c74e5c9.system.entry.js → p-ee7a661d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f98276ed.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +50 -40
- package/dist/esm-es5/index-a457c60c.js +0 -2
- package/dist/zonos-elements/p-04b43dd5.entry.js +0 -1
- package/dist/zonos-elements/p-06f25f75.entry.js +0 -1
- package/dist/zonos-elements/p-0c62cfb3.entry.js +0 -1
- package/dist/zonos-elements/p-1dcdb65f.system.entry.js +0 -1
- package/dist/zonos-elements/p-25970cb8.system.entry.js +0 -1
- package/dist/zonos-elements/p-2bb8ca7d.system.entry.js +0 -1
- package/dist/zonos-elements/p-2f70d0eb.entry.js +0 -1
- package/dist/zonos-elements/p-411b8e10.entry.js +0 -1
- package/dist/zonos-elements/p-43633269.system.js +0 -2
- package/dist/zonos-elements/p-4c81112f.entry.js +0 -1
- package/dist/zonos-elements/p-4efa8187.js +0 -1
- package/dist/zonos-elements/p-5170bc41.entry.js +0 -1
- package/dist/zonos-elements/p-54cdc47f.system.entry.js +0 -1
- package/dist/zonos-elements/p-7ae5cd60.entry.js +0 -1
- package/dist/zonos-elements/p-8d870d4c.entry.js +0 -1
- package/dist/zonos-elements/p-9af5e93a.entry.js +0 -1
- package/dist/zonos-elements/p-bc8bda92.entry.js +0 -1
- package/dist/zonos-elements/p-c137dc82.js +0 -2
- package/dist/zonos-elements/p-c3d2422e.entry.js +0 -1
- package/dist/zonos-elements/p-c767242b.entry.js +0 -1
- package/dist/zonos-elements/p-cf6ae7dc.entry.js +0 -1
- package/dist/zonos-elements/p-d2165441.system.entry.js +0 -1
- package/dist/zonos-elements/p-dcd6acd4.system.entry.js +0 -1
- package/dist/zonos-elements/p-dd1cfa74.entry.js +0 -1
- package/dist/zonos-elements/p-dfd1ba1d.entry.js +0 -1
- package/dist/zonos-elements/p-e68d5219.entry.js +0 -1
- package/dist/zonos-elements/p-ef3e05e5.system.js +0 -1
- package/dist/zonos-elements/p-f655ec36.entry.js +0 -1
- package/dist/zonos-elements/p-fcc2e712.entry.js +0 -1
|
@@ -6,16 +6,11 @@ import { h, Host } from "@stencil/core";
|
|
|
6
6
|
*/
|
|
7
7
|
export class ZonosVirtualScroll {
|
|
8
8
|
constructor() {
|
|
9
|
+
this.scrollTop = 0;
|
|
10
|
+
this.totalHeight = 1;
|
|
9
11
|
this.scrollListener = (_ev) => {
|
|
10
12
|
this.scrollTop = this.ele.scrollTop;
|
|
11
13
|
};
|
|
12
|
-
this.container = undefined;
|
|
13
|
-
this.renderItem = undefined;
|
|
14
|
-
this.itemWidth = undefined;
|
|
15
|
-
this.fallbackItemHeight = undefined;
|
|
16
|
-
this.itemHeights = undefined;
|
|
17
|
-
this.scrollTop = 0;
|
|
18
|
-
this.totalHeight = 1;
|
|
19
14
|
}
|
|
20
15
|
updateTotalHeight() {
|
|
21
16
|
this.totalHeight = this.itemHeights.reduce((acc, height) => acc + (height || this.fallbackItemHeight), 0);
|
|
@@ -2,8 +2,17 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
import { format } from "../../../utils/format";
|
|
3
3
|
export class ZonosComponent {
|
|
4
4
|
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* The first name
|
|
7
|
+
*/
|
|
5
8
|
this.first = '';
|
|
9
|
+
/**
|
|
10
|
+
* The middle name
|
|
11
|
+
*/
|
|
6
12
|
this.middle = '';
|
|
13
|
+
/**
|
|
14
|
+
* The last name
|
|
15
|
+
*/
|
|
7
16
|
this.last = '';
|
|
8
17
|
}
|
|
9
18
|
getText() {
|
|
@@ -19,6 +19,31 @@ import { mergeConfig } from "../../utils/mergeConfig";
|
|
|
19
19
|
const PEEK_MESSAGE_CLOSE_DELAY_MS = 3000;
|
|
20
20
|
export class ZonosHello {
|
|
21
21
|
constructor() {
|
|
22
|
+
this.showPeekMessage = false;
|
|
23
|
+
this.zonosStoreHelloSettings = zonosStore.helloSettings;
|
|
24
|
+
this.showDialog = false;
|
|
25
|
+
this.peekMessage = '';
|
|
26
|
+
this.initialUrl = '';
|
|
27
|
+
/**
|
|
28
|
+
* This array will hold all restricted items handled by Hello thus far
|
|
29
|
+
*/
|
|
30
|
+
this.allRestrictedItems = [];
|
|
31
|
+
/**
|
|
32
|
+
* This array will hold all products handled by Hello thus far
|
|
33
|
+
*/
|
|
34
|
+
this.allFoundProducts = [];
|
|
35
|
+
/**
|
|
36
|
+
* This array will hold all products currently on the page
|
|
37
|
+
*/
|
|
38
|
+
this.productsOnPage = [];
|
|
39
|
+
/**
|
|
40
|
+
* Hello widget is rendered on the screen, this should only triggered once
|
|
41
|
+
*/
|
|
42
|
+
this.isHelloWidgetRendered = false;
|
|
43
|
+
/**
|
|
44
|
+
* Determine if the window is mobile
|
|
45
|
+
*/
|
|
46
|
+
this.isMobile = false;
|
|
22
47
|
this.getHelloPeekMessage = (organizationName) => {
|
|
23
48
|
const isRestrictionPage = zonosStore.currentHelloPage === 'productDetail' ||
|
|
24
49
|
zonosStore.currentHelloPage === 'productList';
|
|
@@ -193,19 +218,6 @@ export class ZonosHello {
|
|
|
193
218
|
}
|
|
194
219
|
return showForCountries === null || showForCountries === void 0 ? void 0 : showForCountries.includes(localizationStore.selectedCountryCode || '');
|
|
195
220
|
};
|
|
196
|
-
this.mobileLocationOverride = undefined;
|
|
197
|
-
this.animateFromLeftOverride = undefined;
|
|
198
|
-
this.appearanceSettingsOverride = undefined;
|
|
199
|
-
this.showPeekMessage = false;
|
|
200
|
-
this.zonosStoreHelloSettings = zonosStore.helloSettings;
|
|
201
|
-
this.showDialog = false;
|
|
202
|
-
this.peekMessage = '';
|
|
203
|
-
this.initialUrl = '';
|
|
204
|
-
this.allRestrictedItems = [];
|
|
205
|
-
this.allFoundProducts = [];
|
|
206
|
-
this.productsOnPage = [];
|
|
207
|
-
this.isHelloWidgetRendered = false;
|
|
208
|
-
this.isMobile = false;
|
|
209
221
|
}
|
|
210
222
|
/**
|
|
211
223
|
* Get the country list the hello widget's country select is using
|
|
@@ -8,8 +8,15 @@ import Globe from "./assets/globe.svg";
|
|
|
8
8
|
import ZonosIcon from "./assets/zonosIcon.svg";
|
|
9
9
|
export class ZonosHelloDialogFooter {
|
|
10
10
|
constructor() {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Whether or not the country select dialog is open
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
12
15
|
this.setShowCountrySelect = () => { };
|
|
16
|
+
/**
|
|
17
|
+
* Whether or not the language select dialog is open
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
13
20
|
this.setShowLanguageSelect = () => { };
|
|
14
21
|
}
|
|
15
22
|
render() {
|
|
@@ -26,6 +26,23 @@ const dutyTaxMessage_AU_lowValueGST = `${translate('The low-value GST law passed
|
|
|
26
26
|
})}`;
|
|
27
27
|
export class ZonosHelloDialog {
|
|
28
28
|
constructor() {
|
|
29
|
+
/**
|
|
30
|
+
* Whether or not the dialog is open
|
|
31
|
+
*/
|
|
32
|
+
this.isOpen = false;
|
|
33
|
+
/**
|
|
34
|
+
* The function to set the open state
|
|
35
|
+
* @default () => {}
|
|
36
|
+
*/
|
|
37
|
+
this.setIsOpen = () => { };
|
|
38
|
+
/**
|
|
39
|
+
* Item restrictions array if any
|
|
40
|
+
* @default []
|
|
41
|
+
*/
|
|
42
|
+
this.restrictedItems = [];
|
|
43
|
+
this.welcomeMessage = 'Welcome to our Demo App!';
|
|
44
|
+
this.showCountrySelect = false;
|
|
45
|
+
this.showLanguageSelect = false;
|
|
29
46
|
this.clickOutsideDialogHandler = (e) => {
|
|
30
47
|
if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {
|
|
31
48
|
this.setIsOpen(false);
|
|
@@ -190,15 +207,6 @@ export class ZonosHelloDialog {
|
|
|
190
207
|
return null;
|
|
191
208
|
}
|
|
192
209
|
};
|
|
193
|
-
this.isOpen = false;
|
|
194
|
-
this.setIsOpen = () => { };
|
|
195
|
-
this.mobileLocationOverride = undefined;
|
|
196
|
-
this.animateFromLeftOverride = undefined;
|
|
197
|
-
this.appearanceSettings = undefined;
|
|
198
|
-
this.restrictedItems = [];
|
|
199
|
-
this.welcomeMessage = 'Welcome to our Demo App!';
|
|
200
|
-
this.showCountrySelect = false;
|
|
201
|
-
this.showLanguageSelect = false;
|
|
202
210
|
}
|
|
203
211
|
globalClickHandler(e) {
|
|
204
212
|
this.clickOutsideDialogHandler(e);
|
|
@@ -11,10 +11,6 @@ import { CheckoutAddressService } from "../utils/iframe/CheckoutAddressService";
|
|
|
11
11
|
import { iframeServices, injectPrivateIframe, } from "../utils/iframe/IframeHelpers";
|
|
12
12
|
import { log } from "../utils/logging/log";
|
|
13
13
|
export class ZonosController {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.config = undefined;
|
|
16
|
-
this.zonosApiKey = undefined;
|
|
17
|
-
}
|
|
18
14
|
/**
|
|
19
15
|
* Method to initialize checkout element
|
|
20
16
|
*/
|
|
@@ -691,7 +691,8 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
691
691
|
if (errors.length || !json) {
|
|
692
692
|
const messages = (_a = errors.find(error => error.message)) === null || _a === void 0 ? void 0 : _a.message;
|
|
693
693
|
// check if the error is related to expired cart and thow error so we can show error message accordingly
|
|
694
|
-
if (
|
|
694
|
+
if (Array.isArray(messages) &&
|
|
695
|
+
messages.some(message => message.message === 'Cart is expired.')) {
|
|
695
696
|
throw new Error('Cart is expired.');
|
|
696
697
|
}
|
|
697
698
|
logError('Error occurred when creating checkout session', JSON.stringify(errors, null, 2));
|
|
@@ -20,6 +20,27 @@ export class ZonosAddress {
|
|
|
20
20
|
* Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
|
|
21
21
|
*/
|
|
22
22
|
this.isAutoCompleteAdjusted = false;
|
|
23
|
+
/**
|
|
24
|
+
* Default address for stripe
|
|
25
|
+
*/
|
|
26
|
+
this.defaultAddress = [];
|
|
27
|
+
/**
|
|
28
|
+
* Error message for tax id input
|
|
29
|
+
*/
|
|
30
|
+
this.taxIdErrorMessage = '';
|
|
31
|
+
this.stripe = window.Zonos.stripe;
|
|
32
|
+
/**
|
|
33
|
+
* Check if the address is dirty or not to scroll into view. When the component is mounted, if the data is filled with address line 1, it's considered dirty
|
|
34
|
+
*/
|
|
35
|
+
this.isDirtyAddress = false;
|
|
36
|
+
/**
|
|
37
|
+
* Local address event for stripe address element
|
|
38
|
+
*/
|
|
39
|
+
this.isAddressFilled = false;
|
|
40
|
+
/**
|
|
41
|
+
* Local checkout session id to check if the address is filled after checkout is loaded
|
|
42
|
+
*/
|
|
43
|
+
this.checkoutSessionId = storageStore.checkoutSessionId;
|
|
23
44
|
/**
|
|
24
45
|
* Check if the tracking event is sent
|
|
25
46
|
*/
|
|
@@ -32,14 +53,6 @@ export class ZonosAddress {
|
|
|
32
53
|
onCheckoutSessionIdChange();
|
|
33
54
|
this.onStoreCheckoutSessionIdChangedSubscription = storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
|
|
34
55
|
};
|
|
35
|
-
this.type = undefined;
|
|
36
|
-
this.titleText = undefined;
|
|
37
|
-
this.defaultAddress = [];
|
|
38
|
-
this.taxIdErrorMessage = '';
|
|
39
|
-
this.stripe = window.Zonos.stripe;
|
|
40
|
-
this.isDirtyAddress = false;
|
|
41
|
-
this.isAddressFilled = false;
|
|
42
|
-
this.checkoutSessionId = storageStore.checkoutSessionId;
|
|
43
56
|
}
|
|
44
57
|
getStripeAddressInstance() {
|
|
45
58
|
if (this.type === 'billing') {
|
|
@@ -9,6 +9,19 @@ import RemoveIcon from "./assets/RemoveIcon.svg";
|
|
|
9
9
|
*/
|
|
10
10
|
export class ZonosAddressSuggestions {
|
|
11
11
|
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* Suggestions to display
|
|
14
|
+
*/
|
|
15
|
+
this.suggestions = [];
|
|
16
|
+
/**
|
|
17
|
+
* Selected suggestion id
|
|
18
|
+
*/
|
|
19
|
+
this.selectedSuggestionId = null;
|
|
20
|
+
/**
|
|
21
|
+
* Local suggestions to display
|
|
22
|
+
*/
|
|
23
|
+
this.localSuggestions = [];
|
|
24
|
+
this.lastHoveredSuggestionId = null;
|
|
12
25
|
/**
|
|
13
26
|
* Handle clicks outside of the suggestions component
|
|
14
27
|
*/
|
|
@@ -17,11 +30,6 @@ export class ZonosAddressSuggestions {
|
|
|
17
30
|
this.localSuggestions = [];
|
|
18
31
|
}
|
|
19
32
|
};
|
|
20
|
-
this.type = undefined;
|
|
21
|
-
this.suggestions = [];
|
|
22
|
-
this.selectedSuggestionId = null;
|
|
23
|
-
this.localSuggestions = [];
|
|
24
|
-
this.lastHoveredSuggestionId = null;
|
|
25
33
|
}
|
|
26
34
|
suggestionsChanged() {
|
|
27
35
|
var _a, _b;
|
|
@@ -31,6 +31,74 @@ import { countryRequireTaxId, shipToTaxIdLabels, } from "../../../types/checkout
|
|
|
31
31
|
export class ZonosAddress {
|
|
32
32
|
constructor() {
|
|
33
33
|
this.onStoreCheckoutSessionIdChangedSubscription = () => { };
|
|
34
|
+
/**
|
|
35
|
+
* Default address for stripe
|
|
36
|
+
*/
|
|
37
|
+
this.defaultAddress = [];
|
|
38
|
+
/**
|
|
39
|
+
* Error message for tax id input
|
|
40
|
+
*/
|
|
41
|
+
this.taxIdErrorMessage = '';
|
|
42
|
+
this.stripe = window.Zonos.stripe;
|
|
43
|
+
/**
|
|
44
|
+
* Check if the address is dirty or not to scroll into view. When the component is mounted, if the data is filled with address line 1, it's considered dirty
|
|
45
|
+
*/
|
|
46
|
+
this.isDirtyAddress = false;
|
|
47
|
+
/**
|
|
48
|
+
* Local address event for stripe address element
|
|
49
|
+
*/
|
|
50
|
+
this.isAddressFilled = false;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the address line 1 is already entered greater than 3 characters once
|
|
53
|
+
*/
|
|
54
|
+
this.isAddressLine1Entered = false;
|
|
55
|
+
/**
|
|
56
|
+
* Address suggestions from google place api
|
|
57
|
+
*/
|
|
58
|
+
this.addressSuggestions = [];
|
|
59
|
+
/**
|
|
60
|
+
* Country fields for the current country
|
|
61
|
+
*/
|
|
62
|
+
this.countryField = null;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to start google place suggestions
|
|
65
|
+
*/
|
|
66
|
+
this.startGooglePlaceSuggestions = false;
|
|
67
|
+
/**
|
|
68
|
+
* List of countries to show in the address element
|
|
69
|
+
*/
|
|
70
|
+
this.shipToCountries = null;
|
|
71
|
+
/**
|
|
72
|
+
* Shipping zones from localization
|
|
73
|
+
*/
|
|
74
|
+
this.shippingZones = null;
|
|
75
|
+
this.city = '';
|
|
76
|
+
this.country = '';
|
|
77
|
+
this.firstName = '';
|
|
78
|
+
this.lastName = '';
|
|
79
|
+
this.line1 = '';
|
|
80
|
+
this.line2 = null;
|
|
81
|
+
this.phone = '';
|
|
82
|
+
this.postalCode = '';
|
|
83
|
+
this.state = '';
|
|
84
|
+
this.cityError = '';
|
|
85
|
+
this.stateError = '';
|
|
86
|
+
this.postalCodeError = '';
|
|
87
|
+
this.phoneError = '';
|
|
88
|
+
this.firstNameError = '';
|
|
89
|
+
this.lastNameError = '';
|
|
90
|
+
/**
|
|
91
|
+
* Whether the address element is loaded
|
|
92
|
+
*/
|
|
93
|
+
this.isFirstInitialization = true;
|
|
94
|
+
/**
|
|
95
|
+
* Address service instance
|
|
96
|
+
*/
|
|
97
|
+
this.addressService = null;
|
|
98
|
+
/**
|
|
99
|
+
* Local checkout session id to check if the address is filled after checkout is loaded
|
|
100
|
+
*/
|
|
101
|
+
this.checkoutSessionId = storageStore.checkoutSessionId;
|
|
34
102
|
/**
|
|
35
103
|
* Whether the suggestion is clicked
|
|
36
104
|
*/
|
|
@@ -193,37 +261,6 @@ export class ZonosAddress {
|
|
|
193
261
|
onCheckoutSessionIdChange();
|
|
194
262
|
this.onStoreCheckoutSessionIdChangedSubscription = storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
|
|
195
263
|
};
|
|
196
|
-
this.type = undefined;
|
|
197
|
-
this.titleText = undefined;
|
|
198
|
-
this.defaultAddress = [];
|
|
199
|
-
this.taxIdErrorMessage = '';
|
|
200
|
-
this.stripe = window.Zonos.stripe;
|
|
201
|
-
this.isDirtyAddress = false;
|
|
202
|
-
this.isAddressFilled = false;
|
|
203
|
-
this.isAddressLine1Entered = false;
|
|
204
|
-
this.addressSuggestions = [];
|
|
205
|
-
this.countryField = null;
|
|
206
|
-
this.startGooglePlaceSuggestions = false;
|
|
207
|
-
this.shipToCountries = null;
|
|
208
|
-
this.shippingZones = null;
|
|
209
|
-
this.city = '';
|
|
210
|
-
this.country = '';
|
|
211
|
-
this.firstName = '';
|
|
212
|
-
this.lastName = '';
|
|
213
|
-
this.line1 = '';
|
|
214
|
-
this.line2 = null;
|
|
215
|
-
this.phone = '';
|
|
216
|
-
this.postalCode = '';
|
|
217
|
-
this.state = '';
|
|
218
|
-
this.cityError = '';
|
|
219
|
-
this.stateError = '';
|
|
220
|
-
this.postalCodeError = '';
|
|
221
|
-
this.phoneError = '';
|
|
222
|
-
this.firstNameError = '';
|
|
223
|
-
this.lastNameError = '';
|
|
224
|
-
this.isFirstInitialization = true;
|
|
225
|
-
this.addressService = null;
|
|
226
|
-
this.checkoutSessionId = storageStore.checkoutSessionId;
|
|
227
264
|
}
|
|
228
265
|
getStripeAddressInstance() {
|
|
229
266
|
if (this.type === 'billing') {
|
|
@@ -289,12 +326,7 @@ export class ZonosAddress {
|
|
|
289
326
|
}
|
|
290
327
|
getIsComplete() {
|
|
291
328
|
const { city, firstName, lastName, line1, phone, postalCode, state } = this.getCustomAddressErrors();
|
|
292
|
-
|
|
293
|
-
if (!this.line1 ||
|
|
294
|
-
!this.postalCode ||
|
|
295
|
-
!this.firstName ||
|
|
296
|
-
!this.lastName ||
|
|
297
|
-
!this.phone) {
|
|
329
|
+
if (!this.line1 || !this.firstName || !this.lastName || !this.phone) {
|
|
298
330
|
return false;
|
|
299
331
|
}
|
|
300
332
|
// has any errors from any of the fields
|
|
@@ -607,6 +639,20 @@ export class ZonosAddress {
|
|
|
607
639
|
valueType: 'phone',
|
|
608
640
|
});
|
|
609
641
|
}
|
|
642
|
+
countryChanged(countryCode) {
|
|
643
|
+
var _a, _b;
|
|
644
|
+
const countryFields = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryFields;
|
|
645
|
+
const countryFieldCountryCode = countryFields === null || countryFields === void 0 ? void 0 : countryFields[countryCode];
|
|
646
|
+
// If the country code of countryFields are the same as current selected country code, do nothing
|
|
647
|
+
if (((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.countryCode) === this.country) {
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
if (countryFields && countryFieldCountryCode) {
|
|
651
|
+
this.countryField = countryFieldCountryCode;
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
this.countryField = null;
|
|
655
|
+
}
|
|
610
656
|
shouldEnabledCustomAddressChanged() {
|
|
611
657
|
// Only initialize the address suggestions if the address service is not already initialized
|
|
612
658
|
this.initAddressSuggestions();
|
|
@@ -624,16 +670,12 @@ export class ZonosAddress {
|
|
|
624
670
|
});
|
|
625
671
|
}
|
|
626
672
|
renderCustomAddressForm() {
|
|
627
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s
|
|
628
|
-
const
|
|
673
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
674
|
+
const _t = this.getCustomAddressErrors(), { showError } = _t, customAddressErrors = __rest(_t, ["showError"]);
|
|
629
675
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
630
676
|
const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
|
|
631
|
-
this.
|
|
632
|
-
|
|
633
|
-
? (_c = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.countryFields) === null || _c === void 0 ? void 0 : _c[countryCode]
|
|
634
|
-
: null;
|
|
635
|
-
const firstCountry = (_d = this.shipToCountries) === null || _d === void 0 ? void 0 : _d[0];
|
|
636
|
-
const stateOptions = Object.entries(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.regions) || {})
|
|
677
|
+
const firstCountry = (_a = this.shipToCountries) === null || _a === void 0 ? void 0 : _a[0];
|
|
678
|
+
const stateOptions = Object.entries(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.regions) || {})
|
|
637
679
|
.map(([label, region]) => ({
|
|
638
680
|
label,
|
|
639
681
|
value: region.interpayCode,
|
|
@@ -668,6 +710,30 @@ export class ZonosAddress {
|
|
|
668
710
|
*/
|
|
669
711
|
this.lastName = event.detail;
|
|
670
712
|
}, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: "shipping country", class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
|
|
713
|
+
this.countryChanged(event.detail);
|
|
714
|
+
// revalidate the postal code since with empty value so it would reset the customAddressErrors
|
|
715
|
+
this.validate({
|
|
716
|
+
type: this.type,
|
|
717
|
+
value: '',
|
|
718
|
+
valueType: 'postalCode',
|
|
719
|
+
});
|
|
720
|
+
this.validate({
|
|
721
|
+
type: this.type,
|
|
722
|
+
value: '',
|
|
723
|
+
valueType: 'city',
|
|
724
|
+
});
|
|
725
|
+
this.validate({
|
|
726
|
+
type: this.type,
|
|
727
|
+
value: '',
|
|
728
|
+
valueType: 'state',
|
|
729
|
+
});
|
|
730
|
+
/**
|
|
731
|
+
* Order of operations is important here:
|
|
732
|
+
* 1. validate() updates all input error states
|
|
733
|
+
* 2. Setting postalCode triggers @Watch('postalCode')
|
|
734
|
+
* 3. getIsComplete() checks customAddressErrors state
|
|
735
|
+
* Therefore, we must update the value after validation to ensure correct error state
|
|
736
|
+
*/
|
|
671
737
|
this.country = event.detail;
|
|
672
738
|
this.city = '';
|
|
673
739
|
this.state = '';
|
|
@@ -705,9 +771,9 @@ export class ZonosAddress {
|
|
|
705
771
|
}, suggestions: this.addressSuggestions, type: this.type })), h("div", { "aria-label": "Additional address details", class: classes([
|
|
706
772
|
'zonos--custom-address-form-additional-fields',
|
|
707
773
|
countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
|
|
708
|
-
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((
|
|
774
|
+
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
|
|
709
775
|
this.line2 = event.detail;
|
|
710
|
-
} }), ((
|
|
776
|
+
} }), ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
|
|
711
777
|
this.validate({
|
|
712
778
|
type: this.type,
|
|
713
779
|
value: event.detail,
|
|
@@ -721,7 +787,7 @@ export class ZonosAddress {
|
|
|
721
787
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
722
788
|
*/
|
|
723
789
|
this.city = event.detail;
|
|
724
|
-
}, required: (
|
|
790
|
+
}, required: (_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired) ? 'true' : 'false', autoComplete: "shipping address-level1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
|
|
725
791
|
this.validate({
|
|
726
792
|
type: this.type,
|
|
727
793
|
value: event.detail,
|
|
@@ -735,9 +801,9 @@ export class ZonosAddress {
|
|
|
735
801
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
736
802
|
*/
|
|
737
803
|
this.state = event.detail;
|
|
738
|
-
}, options: stateOptions, required: (
|
|
804
|
+
}, options: stateOptions, required: (_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateRequired, selectLabel: translate(((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipFormat)
|
|
739
805
|
? `zip-format-${this.type}`
|
|
740
|
-
: undefined, "aria-required": ((
|
|
806
|
+
: undefined, "aria-required": ((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', onInputChange: (event) => {
|
|
741
807
|
this.validate({
|
|
742
808
|
type: this.type,
|
|
743
809
|
value: event.detail,
|
|
@@ -751,7 +817,7 @@ export class ZonosAddress {
|
|
|
751
817
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
752
818
|
*/
|
|
753
819
|
this.postalCode = event.detail;
|
|
754
|
-
}, required: (
|
|
820
|
+
}, required: (_r = this.countryField) === null || _r === void 0 ? void 0 : _r.zipRequired }))), h("zonos-stripe-phone-input", { autoComplete: "shipping tel", class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_s = zonosStore.genericSettings) === null || _s === void 0 ? void 0 : _s.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
|
|
755
821
|
const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
|
|
756
822
|
// Validate the phone number
|
|
757
823
|
this.validate({
|
|
@@ -808,6 +874,7 @@ export class ZonosAddress {
|
|
|
808
874
|
this.isFirstInitialization = false;
|
|
809
875
|
// subscribe to checkout session id changes from storage store
|
|
810
876
|
this.onStoreCheckoutSessionIdChanged();
|
|
877
|
+
this.countryChanged((stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) || 'US');
|
|
811
878
|
}
|
|
812
879
|
render() {
|
|
813
880
|
var _a;
|
|
@@ -821,10 +888,10 @@ export class ZonosAddress {
|
|
|
821
888
|
this.country = localizationStore.selectedCountryCode;
|
|
822
889
|
}
|
|
823
890
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
824
|
-
return (h(Host, { key: '
|
|
891
|
+
return (h(Host, { key: 'd66b492bb6eb663ce3311012de3cc14e9848e41e', class: classes([
|
|
825
892
|
'zonos--address zonos--elements',
|
|
826
893
|
`zonos--${this.type}-address`,
|
|
827
|
-
]) }, h("zonos-text", { key: '
|
|
894
|
+
]) }, h("zonos-text", { key: '4ab2a112115c951719063f94247d1d85f16faec8', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
828
895
|
}
|
|
829
896
|
static get is() { return "zonos-custom-address"; }
|
|
830
897
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1037,6 +1104,9 @@ export class ZonosAddress {
|
|
|
1037
1104
|
}, {
|
|
1038
1105
|
"propName": "state",
|
|
1039
1106
|
"methodName": "formFieldsChanged"
|
|
1107
|
+
}, {
|
|
1108
|
+
"propName": "country",
|
|
1109
|
+
"methodName": "countryChanged"
|
|
1040
1110
|
}, {
|
|
1041
1111
|
"propName": "addressService",
|
|
1042
1112
|
"methodName": "shouldEnabledCustomAddressChanged"
|
package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js
CHANGED
|
@@ -12,6 +12,17 @@ import { validateEmailValue } from "../../utils/validateEmailValue";
|
|
|
12
12
|
*/
|
|
13
13
|
export class ZonosLinkAuthentication {
|
|
14
14
|
constructor() {
|
|
15
|
+
/**
|
|
16
|
+
* Default email for stripe
|
|
17
|
+
*/
|
|
18
|
+
this.defaultEmail = null;
|
|
19
|
+
/**
|
|
20
|
+
* Email error text to dispaly
|
|
21
|
+
*/
|
|
22
|
+
this.isEmailError = false;
|
|
23
|
+
this.stripe = stripeStore.stripe;
|
|
24
|
+
this.isStagingMode = cartStore.isStagingMode;
|
|
25
|
+
this.clientSecret = stripeStore.clientSecret;
|
|
15
26
|
this.setCustomEmailInputToLinkEvent = (emailValue) => {
|
|
16
27
|
// check if the email is valid
|
|
17
28
|
const isValid = validateEmailValue(emailValue);
|
|
@@ -31,12 +42,6 @@ export class ZonosLinkAuthentication {
|
|
|
31
42
|
this.setCustomEmailInputToLinkEvent(inputValue);
|
|
32
43
|
(_a = this.linkAuthenticationChange) === null || _a === void 0 ? void 0 : _a.emit();
|
|
33
44
|
};
|
|
34
|
-
this.titleText = undefined;
|
|
35
|
-
this.defaultEmail = null;
|
|
36
|
-
this.isEmailError = false;
|
|
37
|
-
this.stripe = stripeStore.stripe;
|
|
38
|
-
this.isStagingMode = cartStore.isStagingMode;
|
|
39
|
-
this.clientSecret = stripeStore.clientSecret;
|
|
40
45
|
}
|
|
41
46
|
watchIsStagingMode() {
|
|
42
47
|
// Wait for the DOM to be ready before re-initializing Link element
|
|
@@ -8,11 +8,10 @@ import { logError } from "../../utils/logging/logError";
|
|
|
8
8
|
*/
|
|
9
9
|
export class ZonosPayment {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.trackingSent = false;
|
|
12
|
-
this.titleText = undefined;
|
|
13
11
|
this.stripe = stripeStore.stripe;
|
|
14
12
|
this.stripeElements = stripeStore.stripeElements;
|
|
15
13
|
this.isPaymentInfoFilled = false;
|
|
14
|
+
this.trackingSent = false;
|
|
16
15
|
}
|
|
17
16
|
watchIsPaymentInfoFilled() {
|
|
18
17
|
var _a;
|
|
@@ -335,6 +335,10 @@ export const checkoutSessionCreationModeType = {
|
|
|
335
335
|
WithPaymentIntent: 'WITH_PAYMENT_INTENT',
|
|
336
336
|
WithoutPaymentIntent: 'WITHOUT_PAYMENT_INTENT',
|
|
337
337
|
};
|
|
338
|
+
export const checkoutSessionPartyReferenceType = {
|
|
339
|
+
Destination: 'DESTINATION',
|
|
340
|
+
Payor: 'PAYOR',
|
|
341
|
+
};
|
|
338
342
|
export const checkoutStatus = {
|
|
339
343
|
Disabled: 'DISABLED',
|
|
340
344
|
Enabled: 'ENABLED',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z as zonosStore, c as createStore } from './zonosStore-
|
|
2
|
-
import { s as storageStore, l as localizationStore, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-
|
|
1
|
+
import { z as zonosStore, c as createStore } from './zonosStore-1e015fa5.js';
|
|
2
|
+
import { s as storageStore, l as localizationStore, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-a2b8f9ed.js';
|
|
3
3
|
import { l as log, f as fallbackApiList, h as handleFetch, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, d as allLogs, b as logError, j as jsonParse } from './handleFetch-621e45bc.js';
|
|
4
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
5
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
4
|
+
import { i as isDarkColor } from './isDarkColor-d8bb8659.js';
|
|
5
|
+
import { g as getBorderRadius } from './getBorderRadius-b18c924f.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Extract value from translated object
|
|
@@ -1266,7 +1266,8 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
1266
1266
|
if (errors.length || !json) {
|
|
1267
1267
|
const messages = (_a = errors.find(error => error.message)) === null || _a === void 0 ? void 0 : _a.message;
|
|
1268
1268
|
// check if the error is related to expired cart and thow error so we can show error message accordingly
|
|
1269
|
-
if (
|
|
1269
|
+
if (Array.isArray(messages) &&
|
|
1270
|
+
messages.some(message => message.message === 'Cart is expired.')) {
|
|
1270
1271
|
throw new Error('Cart is expired.');
|
|
1271
1272
|
}
|
|
1272
1273
|
logError('Error occurred when creating checkout session', JSON.stringify(errors, null, 2));
|
|
@@ -1915,4 +1916,4 @@ const cartStoreResetTabItems = () => {
|
|
|
1915
1916
|
cartStoreResetSelectedShippingOption();
|
|
1916
1917
|
};
|
|
1917
1918
|
|
|
1918
|
-
export { cartStoreHasOneEligibleItem as A, stripeStoreApplyPromoCode as B, stripeStoreRemovePromoCode as C, stripeStoreResetPromoCode as D, stripeStoreMessageBasedOnStatus as E, stripeStoreTranslateAddressToLatin as F, cartStoreUpdateSelectedShippingOption as G, cartStoreGetShippingTransitInfo as H, sortServiceLevelOptionsByAmount as I, cartStoreGetMethod as J, stripeStoreCleanupDomesticShippingSession as a, stripeStoreSaveDomesticShippingSession as b,
|
|
1919
|
+
export { cartStoreHasOneEligibleItem as A, stripeStoreApplyPromoCode as B, stripeStoreRemovePromoCode as C, stripeStoreResetPromoCode as D, stripeStoreMessageBasedOnStatus as E, stripeStoreTranslateAddressToLatin as F, cartStoreUpdateSelectedShippingOption as G, cartStoreGetShippingTransitInfo as H, sortServiceLevelOptionsByAmount as I, cartStoreGetMethod as J, stripeStoreCleanupDomesticShippingSession as a, stripeStoreSaveDomesticShippingSession as b, stripeStore as c, stripeStoreRetrievePayment as d, cartStore as e, cartStoreUpdateItems as f, cartStoreReset as g, cartStoreResetTabItems as h, initStripeElements as i, cartStoreClearCheckoutInterval as j, stripeStoreInitCheckoutSession as k, stripeStoreGetPaymentIntent as l, cartStoreStartCheckoutInterval as m, getCheckoutSessionBody as n, cartStoreUpdateToErrorState as o, cartStoreSetCheckoutSession as p, stripeStorePrefetchLandedCost as q, cartStoreNextStep as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStoreUpdateCheckoutSessionBaseCurrency as u, stripeStoreHandleInventoryCheck as v, stripeStoreConfirmPayment as w, stripeStoreHandleInventoryRefund as x, stripeStoreReset as y, validateCheckoutSession as z };
|