@zonos/elements 1.3.184 → 1.3.186
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-3d0c0f0b.js → cart-f9df3ac8.js} +3209 -10
- package/dist/cjs/debounce-3eaa4f7e.js +357 -0
- package/dist/cjs/{getBorderRadius-94ef609c.js → getBorderRadius-87f3b69c.js} +1 -1
- package/dist/cjs/getGenericSettingsOverride-c0ca32b9.js +104 -0
- package/dist/cjs/helpers-5bdbb68c.js +100 -0
- package/dist/cjs/{index-2f90486e.js → index-0993f42d.js} +15 -3
- package/dist/cjs/index.cjs.js +19 -8
- package/dist/cjs/{isDarkColor-ec4a4e7d.js → isDarkColor-d0c67c3d.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{paypal-9eaa9196.js → paypal-5e73c8f5.js} +3 -3
- package/dist/cjs/zonos-address_11.cjs.entry.js +7919 -0
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +18 -7
- package/dist/cjs/zonos-card.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +113 -21
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +225 -7
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +2 -2
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +8 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
- package/dist/cjs/zonos-hello.cjs.entry.js +7 -358
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- 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-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +31 -12
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-toggle.cjs.entry.js +4 -4
- package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
- package/dist/cjs/{zonosStore-3812b318.js → zonosStore-adc42868.js} +2 -1
- package/dist/collection/collection-manifest.json +4 -0
- 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-checkout.css +11 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +22 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +162 -17
- package/dist/collection/components/common/zonos-button/zonos-button.js +14 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +5 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +2 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +0 -6
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +2 -2
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +2 -3
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +105 -8
- package/dist/collection/components/common/zonos-stripe-phone-input/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.css +222 -0
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +481 -0
- package/dist/collection/components/common/zonos-stripe-select/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/common/zonos-stripe-select/assets/RemoveLineIcon.svg +1 -0
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.css +178 -0
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +455 -0
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +24 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +24 -7
- package/dist/collection/components/store/translationStore/strings.arabic.js +159 -0
- package/dist/collection/components/store/translationStore/strings.base.js +161 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +159 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +159 -0
- package/dist/collection/components/store/translationStore/strings.french.js +159 -0
- package/dist/collection/components/store/translationStore/strings.german.js +159 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +159 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +159 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +159 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +159 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +159 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +159 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +159 -0
- package/dist/collection/components/store/zonosStore.js +1 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/assets/RemoveIcon.svg +1 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.css +86 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +192 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +67 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +980 -0
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/getGenericSettingsOverride.js +10 -0
- package/dist/collection/components/utils/api/getZonosSettings.js +7 -1
- package/dist/collection/components/utils/checkout/form/helpers.js +95 -0
- package/dist/collection/components/utils/checkout/form/isValidZip.js +18 -0
- package/dist/collection/components/utils/iframe/CheckoutAddressService.js +193 -0
- package/dist/collection/components/utils/iframe/IframeHelpers.js +86 -0
- package/dist/collection/components/utils/mergeAddress.js +5 -0
- package/dist/collection/constants/phone-formats.js +658 -0
- package/dist/collection/scripts/_getCartInfoById.js +7 -1
- package/dist/collection/scripts/_zonosBase.js +7 -0
- package/dist/collection/types/CountryFields.js +1 -0
- package/dist/collection/types/checkout/form/CustomAddressErrors.js +1 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
- package/dist/collection/types/generated/graphql.internal.types.js +96 -0
- package/dist/collection/types/index.js +0 -1
- package/dist/esm/{cart-3fb04f1f.js → cart-4725a63b.js} +3209 -10
- package/dist/esm/debounce-3cf0793c.js +355 -0
- package/dist/esm/{getBorderRadius-ada3ccad.js → getBorderRadius-a9a48f79.js} +1 -1
- package/dist/esm/getGenericSettingsOverride-0bc3e118.js +99 -0
- package/dist/esm/helpers-2f6955b1.js +97 -0
- package/dist/esm/{index-d82f06f2.js → index-a457c60c.js} +15 -3
- package/dist/esm/index.js +19 -8
- package/dist/esm/{isDarkColor-446fccb7.js → isDarkColor-62cbddb5.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{paypal-1f2e863c.js → paypal-a09943f4.js} +3 -3
- package/dist/esm/zonos-address_11.entry.js +7905 -0
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +18 -7
- package/dist/esm/zonos-card.entry.js +3 -3
- package/dist/esm/zonos-cart-items_13.entry.js +113 -21
- package/dist/esm/zonos-checkout.entry.js +9 -7
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +225 -7
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +3 -3
- package/dist/esm/zonos-empty-state-payment_4.entry.js +8 -8
- package/dist/esm/zonos-hello-dialog.entry.js +9 -9
- package/dist/esm/zonos-hello.entry.js +6 -357
- package/dist/esm/zonos-input.entry.js +3 -3
- 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-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.entry.js +31 -12
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-toggle.entry.js +4 -4
- package/dist/esm/zonos-tooltip.entry.js +3 -3
- package/dist/esm/zonos-v-stack.entry.js +4 -4
- package/dist/esm/{zonosStore-d3c5a0a5.js → zonosStore-1ce34e04.js} +2 -1
- package/dist/esm-es5/cart-4725a63b.js +1 -0
- package/dist/esm-es5/debounce-3cf0793c.js +1 -0
- package/dist/esm-es5/{getBorderRadius-ada3ccad.js → getBorderRadius-a9a48f79.js} +1 -1
- package/dist/esm-es5/getGenericSettingsOverride-0bc3e118.js +1 -0
- package/dist/esm-es5/helpers-2f6955b1.js +1 -0
- package/dist/esm-es5/index-a457c60c.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-446fccb7.js → isDarkColor-62cbddb5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-1f2e863c.js → paypal-a09943f4.js} +1 -1
- package/dist/esm-es5/zonos-address_11.entry.js +1 -0
- 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_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-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-d3c5a0a5.js → zonosStore-1ce34e04.js} +1 -1
- package/dist/scripts/index.d.ts +3985 -3371
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +4 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +28 -1
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +4 -0
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
- package/dist/types/components/common/zonos-stripe-input/zonos-stripe-input.d.ts +22 -0
- package/dist/types/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.d.ts +88 -0
- package/dist/types/components/common/zonos-stripe-select/zonos-stripe-select.d.ts +86 -0
- package/dist/types/components/main/zonos-controller.d.ts +1 -0
- package/dist/types/components/store/checkout/stripe.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +159 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +159 -0
- package/dist/types/components/store/zonosStore.d.ts +6 -1
- package/dist/types/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.d.ts +38 -0
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +150 -0
- package/dist/types/components/utils/api/getGenericSettingsOverride.d.ts +5 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/getZonosSettings.d.ts +2 -2
- package/dist/types/components/utils/checkout/form/helpers.d.ts +19 -0
- package/dist/types/components/utils/checkout/form/isValidZip.d.ts +5 -0
- package/dist/types/components/utils/iframe/CheckoutAddressService.d.ts +38 -0
- package/dist/types/components/utils/iframe/IframeHelpers.d.ts +81 -0
- package/dist/types/components/utils/mergeAddress.d.ts +4 -0
- package/dist/types/components/utils/resetToSelectedTab.d.ts +1 -1
- package/dist/types/components.d.ts +472 -4
- package/dist/types/constants/phone-formats.d.ts +5 -0
- package/dist/types/environment.d.ts +1 -1
- package/dist/types/scripts/_zonosBase.d.ts +13 -1
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
- package/dist/types/types/CountryFields.d.ts +40 -0
- package/dist/types/types/checkout/form/CustomAddressErrors.d.ts +13 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +164 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +145 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +127 -0
- package/dist/types/types/generated/graphql.internal.types.ts +155 -0
- package/dist/types/types/global.d.ts +1 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/utils/ZonosSettings.d.ts +17 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-4622cca6.entry.js → p-0104d3ba.entry.js} +1 -1
- package/dist/zonos-elements/{p-7cb87ea7.system.entry.js → p-04303b56.system.entry.js} +1 -1
- package/dist/zonos-elements/p-06f798ee.system.js +1 -0
- package/dist/zonos-elements/p-0bf6e163.system.entry.js +1 -0
- package/dist/zonos-elements/p-0c676de4.entry.js +1 -0
- package/dist/zonos-elements/{p-739014f8.system.entry.js → p-0fdd7034.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a1cfbd0a.js → p-17299200.js} +1 -1
- package/dist/zonos-elements/p-175e242e.entry.js +1 -0
- package/dist/zonos-elements/{p-58f660d4.system.entry.js → p-1b29bc5f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fe2c27c4.entry.js → p-1e612c29.entry.js} +1 -1
- package/dist/zonos-elements/{p-98aa88b1.js → p-2097fae5.js} +1 -1
- package/dist/zonos-elements/{p-81084be5.system.entry.js → p-240ee490.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2416aaa1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-cedf08f0.entry.js → p-313ef896.entry.js} +1 -1
- package/dist/zonos-elements/{p-fa65b53d.entry.js → p-314fbfe1.entry.js} +1 -1
- package/dist/zonos-elements/{p-5187ba8f.system.js → p-31e90130.system.js} +1 -1
- package/dist/zonos-elements/{p-4ca666ea.system.entry.js → p-341f40c2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d49c6a3e.system.entry.js → p-35f33601.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4160bbc2.system.js +1 -0
- package/dist/zonos-elements/p-43633269.system.js +2 -0
- package/dist/zonos-elements/p-443b5db2.entry.js +1 -0
- package/dist/zonos-elements/p-46d3e378.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3d221556.system.entry.js → p-488ad646.system.entry.js} +1 -1
- package/dist/zonos-elements/p-53ffdb91.js +1 -0
- package/dist/zonos-elements/p-56b56caa.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3eac4b10.entry.js → p-5f896e9a.entry.js} +1 -1
- package/dist/zonos-elements/{p-e8c70c7d.system.entry.js → p-609c32a3.system.entry.js} +1 -1
- package/dist/zonos-elements/p-64ea232c.system.entry.js +1 -0
- package/dist/zonos-elements/{p-f378b4d3.system.entry.js → p-678ccc3f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8048932d.entry.js → p-67b904c2.entry.js} +1 -1
- package/dist/zonos-elements/p-6b40da70.system.js +1 -0
- package/dist/zonos-elements/p-6fd6af48.system.entry.js +1 -0
- package/dist/zonos-elements/p-70d4d436.entry.js +1 -0
- package/dist/zonos-elements/{p-64dbc282.entry.js → p-818d6f17.entry.js} +1 -1
- package/dist/zonos-elements/{p-b5b9aa6c.entry.js → p-81ee1683.entry.js} +1 -1
- package/dist/zonos-elements/{p-236f32c8.system.entry.js → p-89fcd305.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4fa8524.system.entry.js → p-94a80d93.system.entry.js} +1 -1
- package/dist/zonos-elements/p-961620ae.entry.js +1 -0
- package/dist/zonos-elements/{p-4eff2f8a.system.entry.js → p-98e4a965.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5bebcfc2.system.js → p-9913c186.system.js} +1 -1
- package/dist/zonos-elements/{p-29e8c9e8.system.entry.js → p-991c85f1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-995761ea.system.entry.js +1 -0
- package/dist/zonos-elements/p-9a7a9b1c.entry.js +1 -0
- package/dist/zonos-elements/{p-d367c9ae.system.entry.js → p-9f7b9d66.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-587568b5.entry.js → p-aaff5dcc.entry.js} +1 -1
- package/dist/zonos-elements/{p-3731e7f5.entry.js → p-abc66a0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb294265.entry.js → p-aca3a2bb.entry.js} +1 -1
- package/dist/zonos-elements/{p-69f84611.entry.js → p-b2241919.entry.js} +1 -1
- package/dist/zonos-elements/p-b5edee66.system.js +1 -0
- package/dist/zonos-elements/p-b610f70c.system.js +1 -0
- package/dist/zonos-elements/{p-69255ed2.system.js → p-bbbaea3a.system.js} +1 -1
- package/dist/zonos-elements/p-c04b3f14.system.js +1 -0
- package/dist/zonos-elements/p-c137dc82.js +2 -0
- package/dist/zonos-elements/{p-be9e1818.system.entry.js → p-c140a0bd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-de221545.entry.js → p-cf6ae7dc.entry.js} +1 -1
- package/dist/zonos-elements/{p-90633d63.entry.js → p-d0f4b6c3.entry.js} +1 -1
- package/dist/zonos-elements/{p-112aecac.js → p-de462b9b.js} +2 -2
- package/dist/zonos-elements/{p-107b08c1.entry.js → p-e5d081d8.entry.js} +1 -1
- package/dist/zonos-elements/p-e7b0c156.js +1 -0
- package/dist/zonos-elements/{p-30fdcbee.js → p-e892fb29.js} +1 -1
- package/dist/zonos-elements/p-e90cb997.entry.js +1 -0
- package/dist/zonos-elements/{p-db3f381d.entry.js → p-e91b244c.entry.js} +1 -1
- package/dist/zonos-elements/{p-41dfc828.entry.js → p-e99354d5.entry.js} +1 -1
- package/dist/zonos-elements/p-ea6d87a1.system.js +1 -0
- package/dist/zonos-elements/p-eef5b0cc.js +1 -0
- package/dist/zonos-elements/{p-d0944cc8.system.entry.js → p-f3f27bf2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0e63259c.system.entry.js → p-f4cc688e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc6d9f7d.entry.js → p-f7d3e48b.entry.js} +1 -1
- package/dist/zonos-elements/p-fa6de0f3.js +1 -0
- package/dist/zonos-elements/{p-c5c8f803.system.entry.js → p-fd348fd4.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +3 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +0 -772
- package/dist/esm/zonos-address_7.entry.js +0 -762
- package/dist/esm-es5/cart-3fb04f1f.js +0 -1
- package/dist/esm-es5/index-d82f06f2.js +0 -2
- package/dist/esm-es5/zonos-address_7.entry.js +0 -1
- package/dist/zonos-elements/p-09041efe.entry.js +0 -1
- package/dist/zonos-elements/p-16e4cdb1.entry.js +0 -1
- package/dist/zonos-elements/p-43feb95e.entry.js +0 -1
- package/dist/zonos-elements/p-46f6e5e9.system.js +0 -1
- package/dist/zonos-elements/p-4caffd96.system.js +0 -2
- package/dist/zonos-elements/p-642bf613.system.entry.js +0 -1
- package/dist/zonos-elements/p-6c0c8722.system.entry.js +0 -1
- package/dist/zonos-elements/p-7decb19b.entry.js +0 -1
- package/dist/zonos-elements/p-829f6a40.entry.js +0 -1
- package/dist/zonos-elements/p-8f640b28.entry.js +0 -1
- package/dist/zonos-elements/p-a69dbe14.js +0 -1
- package/dist/zonos-elements/p-ab68ad11.js +0 -2
- package/dist/zonos-elements/p-b1020237.system.js +0 -1
- package/dist/zonos-elements/p-bc0f885e.system.entry.js +0 -1
- package/dist/zonos-elements/p-c6d96a42.system.js +0 -1
- package/dist/zonos-elements/p-ce853f8f.system.entry.js +0 -1
- package/dist/zonos-elements/p-d5d39db4.system.entry.js +0 -1
- package/dist/zonos-elements/p-e4f8114a.system.js +0 -1
- package/dist/zonos-elements/p-e99e75dd.system.entry.js +0 -1
- package/dist/zonos-elements/p-f66a5c7c.system.entry.js +0 -1
- package/dist/zonos-elements/p-febb90e0.entry.js +0 -1
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
import { translate } from "../../store/translationStore";
|
|
3
|
+
import { zonosStore, zonosStoreFontFamily, } from "../../store/zonosStore";
|
|
4
|
+
import { inheritAriaAttributes, inheritAttributes, } from "../../utils/checkout/form/helpers";
|
|
5
|
+
import { classes } from "../../utils/classes";
|
|
6
|
+
import { getBorderRadius } from "../../utils/getBorderRadius";
|
|
7
|
+
import { isDarkColor } from "../../utils/isDarkColor";
|
|
8
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
9
|
+
import ChevronDownIcon from "./assets/ChevronDownIcon.svg";
|
|
10
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
11
|
+
import RemoveLineIcon from "./assets/RemoveLineIcon.svg";
|
|
12
|
+
let selectId = 0;
|
|
13
|
+
export class ZonosStripeSelect {
|
|
14
|
+
constructor() {
|
|
15
|
+
/**
|
|
16
|
+
* Inherited attributes from the host element
|
|
17
|
+
*/
|
|
18
|
+
this.inheritedAttributes = {};
|
|
19
|
+
this.selectId = `zonos--select-${++selectId}`;
|
|
20
|
+
this.handleClear = (e) => {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
this.internalValue = '';
|
|
23
|
+
this.selectChange.emit('');
|
|
24
|
+
this.el.selectedValue = '';
|
|
25
|
+
this.el.dispatchEvent(new Event('change'));
|
|
26
|
+
};
|
|
27
|
+
this.name = undefined;
|
|
28
|
+
this.selectedValue = '';
|
|
29
|
+
this.selectLabel = undefined;
|
|
30
|
+
this.overridePrimaryColor = undefined;
|
|
31
|
+
this.overrideSecondaryColor = undefined;
|
|
32
|
+
this.isDisabled = false;
|
|
33
|
+
this.isError = false;
|
|
34
|
+
this.error = '';
|
|
35
|
+
this.selectPlaceholder = '';
|
|
36
|
+
this.options = [];
|
|
37
|
+
this.autoComplete = '';
|
|
38
|
+
this.value = '';
|
|
39
|
+
this.required = false;
|
|
40
|
+
this.isClearable = false;
|
|
41
|
+
this.minWidth = undefined;
|
|
42
|
+
this.internalValue = this.selectedValue;
|
|
43
|
+
this.internalOptions = this.options;
|
|
44
|
+
}
|
|
45
|
+
onOptionsChange(newValue) {
|
|
46
|
+
this.internalOptions = newValue;
|
|
47
|
+
}
|
|
48
|
+
onSelectedValueChange(newValue) {
|
|
49
|
+
this.internalValue = newValue;
|
|
50
|
+
this.selectChange.emit(newValue);
|
|
51
|
+
this.value = newValue;
|
|
52
|
+
// If the value is not found in the options, clear the value to force user to select an option
|
|
53
|
+
this.handleNotFoundOption(newValue);
|
|
54
|
+
}
|
|
55
|
+
onValueChange(newValue) {
|
|
56
|
+
this.internalValue = newValue;
|
|
57
|
+
// If the value is not found in the options, clear the value to force user to select an option
|
|
58
|
+
this.handleNotFoundOption(newValue);
|
|
59
|
+
}
|
|
60
|
+
// If the value is not found in the options, clear the value to force user to select an option
|
|
61
|
+
handleNotFoundOption(value) {
|
|
62
|
+
const foundOption = this.internalOptions.find(option => option.value === value || option.label === value);
|
|
63
|
+
if (!foundOption) {
|
|
64
|
+
this.internalValue = '';
|
|
65
|
+
this.selectChange.emit('');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
componentWillLoad() {
|
|
69
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes(this.el, [
|
|
70
|
+
'tabindex',
|
|
71
|
+
'title',
|
|
72
|
+
'data-form-type',
|
|
73
|
+
'dir',
|
|
74
|
+
]));
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
const primaryColor = this.overridePrimaryColor || zonosStore.appearance.colorPrimary;
|
|
78
|
+
const secondaryColor = this.overrideSecondaryColor || zonosStore.appearance.colorSecondary;
|
|
79
|
+
const isDark = primaryColor && isDarkColor(primaryColor);
|
|
80
|
+
const fontSize = zonosStore.appearance.fontSizeInputValue || 16;
|
|
81
|
+
const hasContent = this.internalValue || this.selectPlaceholder;
|
|
82
|
+
const showClearButton = this.isClearable && this.internalValue && !this.isDisabled;
|
|
83
|
+
return (h(Host, { key: 'f5b178d5cbd48e9aff8701764a1fde4de03a6569', class: classes([
|
|
84
|
+
'zonos--select zonos--elements',
|
|
85
|
+
isDark && 'dark',
|
|
86
|
+
this.isError && 'has-error',
|
|
87
|
+
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: 'd7b3b8148777aa61f15c1489f44871589aadf00f', class: classes([
|
|
88
|
+
'zonos--label-wrapper',
|
|
89
|
+
this.isDisabled && 'disabled',
|
|
90
|
+
]) }, h("select", Object.assign({ key: '629f7437fa445634db0589f217acb59b59e558d3' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: classes([
|
|
91
|
+
'zonos--floated-select',
|
|
92
|
+
!!this.selectLabel && 'has-label',
|
|
93
|
+
hasContent && 'has-content',
|
|
94
|
+
this.isError && 'has-error',
|
|
95
|
+
]), disabled: this.isDisabled, id: this.selectId, name: this.name, onChange: e => {
|
|
96
|
+
const select = e.target;
|
|
97
|
+
this.selectChange.emit(select.value);
|
|
98
|
+
this.selectedValue = select.value;
|
|
99
|
+
this.el.dispatchEvent(new Event('change'));
|
|
100
|
+
}, required: this.required }), h("option", { key: '9b50f769fc79f136b7b77916edd71acdcda199b7', disabled: true, selected: !this.internalValue, value: "" }, this.selectPlaceholder || translate('Select')), this.internalOptions.map(option => (h("option", { key: option.value, selected: this.internalValue === option.value ||
|
|
101
|
+
// Sometimes google returns the label not the code for some countries
|
|
102
|
+
this.internalValue === option.label, value: option.value }, option.label)))), h("div", { key: '0ff44083dee7939d6f7bc2372990ccbef6066fed', class: "zonos--floated-label" }, h("label", { key: '8f9965fa3de61b705fa95e7ddc68013a3027464d', htmlFor: this.selectId }, this.selectLabel)), h("div", { key: '09aa1851295b86e30488ca69720d58d1246ad67c', class: "zonos--actions-wrapper" }, showClearButton && (h("button", { key: '1db5be171f74849cedc3a8804bac23fdfa43aaa5', "aria-label": "Clear selection", class: "zonos--clear-button", onClick: this.handleClear, tabIndex: 0, type: "button" }, h("zonos-icon", { key: '2ca7e2da61eef16d6feb74c4d6a6198f1762ad16', class: "zonos--clear-icon", content: RemoveLineIcon, iconColor: "gray-1200" }))), h("zonos-icon", { key: 'c0050a27a619cb9b844282be841a320648f9d008', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon, iconColor: "gray-800" }))), this.error && (h("zonos-text", { key: 'c0a3eb551533c4cb24f92ad6fd7a4b44cd24044c', textColor: "red-600" }, this.error))));
|
|
103
|
+
}
|
|
104
|
+
static get is() { return "zonos-stripe-select"; }
|
|
105
|
+
static get encapsulation() { return "shadow"; }
|
|
106
|
+
static get originalStyleUrls() {
|
|
107
|
+
return {
|
|
108
|
+
"$": ["zonos-stripe-select.scss"]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
static get styleUrls() {
|
|
112
|
+
return {
|
|
113
|
+
"$": ["zonos-stripe-select.css"]
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
static get properties() {
|
|
117
|
+
return {
|
|
118
|
+
"name": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string | undefined",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": true,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": "Name of the select"
|
|
131
|
+
},
|
|
132
|
+
"getter": false,
|
|
133
|
+
"setter": false,
|
|
134
|
+
"attribute": "name",
|
|
135
|
+
"reflect": false
|
|
136
|
+
},
|
|
137
|
+
"selectedValue": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"mutable": false,
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "string",
|
|
142
|
+
"resolved": "string",
|
|
143
|
+
"references": {}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": false,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": "Selected value of the select"
|
|
150
|
+
},
|
|
151
|
+
"getter": false,
|
|
152
|
+
"setter": false,
|
|
153
|
+
"attribute": "selected-value",
|
|
154
|
+
"reflect": false,
|
|
155
|
+
"defaultValue": "''"
|
|
156
|
+
},
|
|
157
|
+
"selectLabel": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": false,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": true,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Select label"
|
|
170
|
+
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
173
|
+
"attribute": "select-label",
|
|
174
|
+
"reflect": false
|
|
175
|
+
},
|
|
176
|
+
"overridePrimaryColor": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"mutable": false,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "string",
|
|
181
|
+
"resolved": "string | undefined",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": true,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": "Primary color to override primary color from appearance primary color in setting."
|
|
189
|
+
},
|
|
190
|
+
"getter": false,
|
|
191
|
+
"setter": false,
|
|
192
|
+
"attribute": "override-primary-color",
|
|
193
|
+
"reflect": false
|
|
194
|
+
},
|
|
195
|
+
"overrideSecondaryColor": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string | undefined",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": true,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Secondary color to override secondary color from appearance secondary color in setting"
|
|
208
|
+
},
|
|
209
|
+
"getter": false,
|
|
210
|
+
"setter": false,
|
|
211
|
+
"attribute": "override-secondary-color",
|
|
212
|
+
"reflect": false
|
|
213
|
+
},
|
|
214
|
+
"isDisabled": {
|
|
215
|
+
"type": "boolean",
|
|
216
|
+
"mutable": false,
|
|
217
|
+
"complexType": {
|
|
218
|
+
"original": "boolean",
|
|
219
|
+
"resolved": "boolean",
|
|
220
|
+
"references": {}
|
|
221
|
+
},
|
|
222
|
+
"required": false,
|
|
223
|
+
"optional": false,
|
|
224
|
+
"docs": {
|
|
225
|
+
"tags": [],
|
|
226
|
+
"text": "Disables the select"
|
|
227
|
+
},
|
|
228
|
+
"getter": false,
|
|
229
|
+
"setter": false,
|
|
230
|
+
"attribute": "is-disabled",
|
|
231
|
+
"reflect": false,
|
|
232
|
+
"defaultValue": "false"
|
|
233
|
+
},
|
|
234
|
+
"isError": {
|
|
235
|
+
"type": "boolean",
|
|
236
|
+
"mutable": false,
|
|
237
|
+
"complexType": {
|
|
238
|
+
"original": "boolean",
|
|
239
|
+
"resolved": "boolean",
|
|
240
|
+
"references": {}
|
|
241
|
+
},
|
|
242
|
+
"required": false,
|
|
243
|
+
"optional": false,
|
|
244
|
+
"docs": {
|
|
245
|
+
"tags": [],
|
|
246
|
+
"text": "Error state of the select"
|
|
247
|
+
},
|
|
248
|
+
"getter": false,
|
|
249
|
+
"setter": false,
|
|
250
|
+
"attribute": "is-error",
|
|
251
|
+
"reflect": false,
|
|
252
|
+
"defaultValue": "false"
|
|
253
|
+
},
|
|
254
|
+
"error": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"mutable": false,
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "string",
|
|
259
|
+
"resolved": "string",
|
|
260
|
+
"references": {}
|
|
261
|
+
},
|
|
262
|
+
"required": false,
|
|
263
|
+
"optional": false,
|
|
264
|
+
"docs": {
|
|
265
|
+
"tags": [],
|
|
266
|
+
"text": "Error message of the select"
|
|
267
|
+
},
|
|
268
|
+
"getter": false,
|
|
269
|
+
"setter": false,
|
|
270
|
+
"attribute": "error",
|
|
271
|
+
"reflect": false,
|
|
272
|
+
"defaultValue": "''"
|
|
273
|
+
},
|
|
274
|
+
"selectPlaceholder": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"mutable": false,
|
|
277
|
+
"complexType": {
|
|
278
|
+
"original": "string",
|
|
279
|
+
"resolved": "string",
|
|
280
|
+
"references": {}
|
|
281
|
+
},
|
|
282
|
+
"required": false,
|
|
283
|
+
"optional": false,
|
|
284
|
+
"docs": {
|
|
285
|
+
"tags": [],
|
|
286
|
+
"text": "Placeholder for the select"
|
|
287
|
+
},
|
|
288
|
+
"getter": false,
|
|
289
|
+
"setter": false,
|
|
290
|
+
"attribute": "select-placeholder",
|
|
291
|
+
"reflect": false,
|
|
292
|
+
"defaultValue": "''"
|
|
293
|
+
},
|
|
294
|
+
"options": {
|
|
295
|
+
"type": "unknown",
|
|
296
|
+
"mutable": false,
|
|
297
|
+
"complexType": {
|
|
298
|
+
"original": "SelectOption[]",
|
|
299
|
+
"resolved": "SelectOption[]",
|
|
300
|
+
"references": {
|
|
301
|
+
"SelectOption": {
|
|
302
|
+
"location": "global",
|
|
303
|
+
"id": "global::SelectOption"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"required": false,
|
|
308
|
+
"optional": false,
|
|
309
|
+
"docs": {
|
|
310
|
+
"tags": [],
|
|
311
|
+
"text": "Options for the select. Must be set using a query selector."
|
|
312
|
+
},
|
|
313
|
+
"getter": false,
|
|
314
|
+
"setter": false,
|
|
315
|
+
"defaultValue": "[]"
|
|
316
|
+
},
|
|
317
|
+
"autoComplete": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"mutable": false,
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "string",
|
|
322
|
+
"resolved": "string",
|
|
323
|
+
"references": {}
|
|
324
|
+
},
|
|
325
|
+
"required": false,
|
|
326
|
+
"optional": false,
|
|
327
|
+
"docs": {
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": "The autoComplete attribute for the select."
|
|
330
|
+
},
|
|
331
|
+
"getter": false,
|
|
332
|
+
"setter": false,
|
|
333
|
+
"attribute": "auto-complete",
|
|
334
|
+
"reflect": false,
|
|
335
|
+
"defaultValue": "''"
|
|
336
|
+
},
|
|
337
|
+
"value": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"mutable": true,
|
|
340
|
+
"complexType": {
|
|
341
|
+
"original": "string",
|
|
342
|
+
"resolved": "string",
|
|
343
|
+
"references": {}
|
|
344
|
+
},
|
|
345
|
+
"required": false,
|
|
346
|
+
"optional": false,
|
|
347
|
+
"docs": {
|
|
348
|
+
"tags": [],
|
|
349
|
+
"text": "The value of the select."
|
|
350
|
+
},
|
|
351
|
+
"getter": false,
|
|
352
|
+
"setter": false,
|
|
353
|
+
"attribute": "value",
|
|
354
|
+
"reflect": false,
|
|
355
|
+
"defaultValue": "''"
|
|
356
|
+
},
|
|
357
|
+
"required": {
|
|
358
|
+
"type": "boolean",
|
|
359
|
+
"mutable": false,
|
|
360
|
+
"complexType": {
|
|
361
|
+
"original": "boolean",
|
|
362
|
+
"resolved": "boolean | undefined",
|
|
363
|
+
"references": {}
|
|
364
|
+
},
|
|
365
|
+
"required": false,
|
|
366
|
+
"optional": true,
|
|
367
|
+
"docs": {
|
|
368
|
+
"tags": [],
|
|
369
|
+
"text": "Whether the select is required"
|
|
370
|
+
},
|
|
371
|
+
"getter": false,
|
|
372
|
+
"setter": false,
|
|
373
|
+
"attribute": "required",
|
|
374
|
+
"reflect": false,
|
|
375
|
+
"defaultValue": "false"
|
|
376
|
+
},
|
|
377
|
+
"isClearable": {
|
|
378
|
+
"type": "boolean",
|
|
379
|
+
"mutable": false,
|
|
380
|
+
"complexType": {
|
|
381
|
+
"original": "boolean",
|
|
382
|
+
"resolved": "boolean",
|
|
383
|
+
"references": {}
|
|
384
|
+
},
|
|
385
|
+
"required": false,
|
|
386
|
+
"optional": false,
|
|
387
|
+
"docs": {
|
|
388
|
+
"tags": [],
|
|
389
|
+
"text": "Whether the select can be cleared"
|
|
390
|
+
},
|
|
391
|
+
"getter": false,
|
|
392
|
+
"setter": false,
|
|
393
|
+
"attribute": "is-clearable",
|
|
394
|
+
"reflect": false,
|
|
395
|
+
"defaultValue": "false"
|
|
396
|
+
},
|
|
397
|
+
"minWidth": {
|
|
398
|
+
"type": "string",
|
|
399
|
+
"mutable": false,
|
|
400
|
+
"complexType": {
|
|
401
|
+
"original": "string",
|
|
402
|
+
"resolved": "string | undefined",
|
|
403
|
+
"references": {}
|
|
404
|
+
},
|
|
405
|
+
"required": false,
|
|
406
|
+
"optional": true,
|
|
407
|
+
"docs": {
|
|
408
|
+
"tags": [],
|
|
409
|
+
"text": "Minimum width of the select"
|
|
410
|
+
},
|
|
411
|
+
"getter": false,
|
|
412
|
+
"setter": false,
|
|
413
|
+
"attribute": "min-width",
|
|
414
|
+
"reflect": false
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
static get states() {
|
|
419
|
+
return {
|
|
420
|
+
"internalValue": {},
|
|
421
|
+
"internalOptions": {}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
static get events() {
|
|
425
|
+
return [{
|
|
426
|
+
"method": "selectChange",
|
|
427
|
+
"name": "selectChange",
|
|
428
|
+
"bubbles": true,
|
|
429
|
+
"cancelable": true,
|
|
430
|
+
"composed": true,
|
|
431
|
+
"docs": {
|
|
432
|
+
"tags": [],
|
|
433
|
+
"text": "Event to emit when select value changes"
|
|
434
|
+
},
|
|
435
|
+
"complexType": {
|
|
436
|
+
"original": "string",
|
|
437
|
+
"resolved": "string",
|
|
438
|
+
"references": {}
|
|
439
|
+
}
|
|
440
|
+
}];
|
|
441
|
+
}
|
|
442
|
+
static get elementRef() { return "el"; }
|
|
443
|
+
static get watchers() {
|
|
444
|
+
return [{
|
|
445
|
+
"propName": "options",
|
|
446
|
+
"methodName": "onOptionsChange"
|
|
447
|
+
}, {
|
|
448
|
+
"propName": "selectedValue",
|
|
449
|
+
"methodName": "onSelectedValueChange"
|
|
450
|
+
}, {
|
|
451
|
+
"propName": "value",
|
|
452
|
+
"methodName": "onValueChange"
|
|
453
|
+
}];
|
|
454
|
+
}
|
|
455
|
+
}
|
|
@@ -7,9 +7,9 @@ export class ZonosToggle {
|
|
|
7
7
|
this.value = undefined;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '8426e15a4596ecd6fc2cab945cdb2f0c4fe1ac79', class: classes(['zonos--elements zonos--toggle']), style: {
|
|
11
11
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: 'e26f354255febe40918b30100ed5d42410a30413', class: "wrapper" }, this.options.map(option => {
|
|
13
13
|
const selected = option.value === this.value;
|
|
14
14
|
return (h("button", { class: classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
|
|
15
15
|
this.toggleChanged.emit(option.value);
|
|
@@ -7,10 +7,10 @@ export class ZonosTooltip {
|
|
|
7
7
|
this.showTooltip = false;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'fbd7f669ae886586c2512b00975fc5acf1e40eca', class: "zonos--elements" }, h("div", { key: '618d6ff79308540f5eeb3d8a23e7c520fb35a91a', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, h("slot", { key: '303eaf31b4b3dc9fd35ed0db252be84274b7d46c' }), h("div", { key: '7429949912c8e3fb683ab4cbc4958d8fb6b2fd81', class: classes([
|
|
11
11
|
this.showTooltip && 'zonos--show-tooltip',
|
|
12
12
|
'zonos--tooltip-content',
|
|
13
|
-
]) }, h("zonos-text", { key: '
|
|
13
|
+
]) }, h("zonos-text", { key: '31704a564bb877fac16c1ab11a686e9ba72940ea', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), h("zonos-text", { key: '1e2cafbfaf769b30256c8d4609953961bcd10a06', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-tooltip"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class VStack {
|
|
|
7
7
|
this.spacing = 24;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'b591378d641a09bac2c4fab00c8c1977ae21a14c', style: {
|
|
11
11
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: 'c9f3b482ace4b36813fa5412dd497c0deea7e3c0', class: classes(['vstack']), style: { 'grid-row-gap': `${this.spacing}px` } }, h("slot", { key: '75cf9b483367945bc57279b76519205c8f0901eb' }))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "zonos-v-stack"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,12 +56,12 @@ export class ZonosVirtualScroll {
|
|
|
56
56
|
} }, this.renderItem(i)));
|
|
57
57
|
accHeight += itemHeight;
|
|
58
58
|
}
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '294ce5251b10f4779b7113d16a98845153f50c72' }, h("div", { key: '4a8b0032df979568ebf1f20356cb0aa13e2a742a',
|
|
60
60
|
// to capture scroll action
|
|
61
61
|
class: "scroller", style: {
|
|
62
62
|
height: `${this.totalHeight}px`,
|
|
63
63
|
width: `${W}px`,
|
|
64
|
-
} }), h("div", { key: '
|
|
64
|
+
} }), h("div", { key: 'c162402da38f659edf5d8de18229a7a6eeed89db',
|
|
65
65
|
// to display items
|
|
66
66
|
class: "item-container", ref: el => (this.container = el), style: {
|
|
67
67
|
height: `${this.totalHeight}px`,
|
|
@@ -10,7 +10,7 @@ export class ZonosComponent {
|
|
|
10
10
|
return format(this.first, this.middle, this.last);
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return h("div", { key: '
|
|
13
|
+
return h("div", { key: 'c35d0331d2d3724792e82b1d0a22d096fbbcddb7' }, "Hello, World! I'm ", this.getText());
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-component"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -18,9 +18,9 @@ export class ZonosHelloDialogFooter {
|
|
|
18
18
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
19
19
|
// Only use gray-0 (white) when the background color is dark (apply inverted color if the element is using dark theme variable)
|
|
20
20
|
const mainColor = primaryColor && isDarkColor(primaryColor) ? 'white' : 'black';
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'c346c1f0dff9e6f5b4399ae9a82216d3804f6df5', class: "zonos--elements" }, h("div", { key: '928406c88c458360530d20f6d0dd1e0563c27c99', class: "zonos--hello-dialog-footer", style: {
|
|
22
22
|
'--zonos--primary-color': primaryColor,
|
|
23
|
-
} }, h("a", { key: '
|
|
23
|
+
} }, h("a", { key: '273303784ffec118ac20e280e91c575bb1c002ac', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '50ac525028c2b4081a47cbec44c45448d9b2c1d4', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), h("div", { key: '96118c74b078d06065e5cef80962ffb3ad3c5f3e', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: 'd30aec7d60dc9b67f4a3babfda89b2620c667224', buttonColor: mainColor, icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: 'd64c7ae9af7d55057b580977750bf7f28c03710e', buttonColor: mainColor, icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "zonos-hello-dialog-footer"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -232,18 +232,18 @@ export class ZonosHelloDialog {
|
|
|
232
232
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
233
233
|
const currentPage = this.getCurrentPageEnum();
|
|
234
234
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
235
|
-
return (h(Host, { key: '
|
|
235
|
+
return (h(Host, { key: '0345651f8cf8b06b95b21e5ad2cc427339932229', class: "zonos--elements" }, h("div", { key: '4089308c6460f903130eb4d99b03a7e65937973d', class: classes([
|
|
236
236
|
'zonos--hello-dialog',
|
|
237
237
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
238
238
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
239
239
|
!!this.mobileLocationOverride &&
|
|
240
240
|
'zonos--hello-dialog-mobile-override',
|
|
241
241
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
242
|
-
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '
|
|
242
|
+
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '8f5dcc0f0bbd4e3f103105baab5b3d87636930f3' }, h("div", { key: '04b20f5394ddf48861ee97cde4d13000c5765348', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: '176b0173785632b211affb603380f7fef9fa0027', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: 'b21f5ab0438f8f5ab922800047bae222d6738e0e', spacing: 24 }, h("zonos-country-flag", { key: 'd153054f02852e8c565997a118f2bea8e5834bc0', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: 'b6f6f630f44ed19eca3ee62baaca9b22867635d5', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: '47b5d0a2dd74f39337b4d5a5a968a94ead40a45e', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: '9038333f6574e110b6f860ffa0e3b6ebdad81dc0', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: '8afaf9eb87813ace65475467d422f150b487fe30', spacing: 8 }, this.restrictedItems.map(item => {
|
|
243
243
|
var _a;
|
|
244
244
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
245
|
-
}), h("zonos-card", { key: '
|
|
246
|
-
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '
|
|
245
|
+
}), h("zonos-card", { key: '522ba22b8709a962fd7c39ae4e1386b2a696072c', spacing: "12px" }, h("zonos-v-stack", { key: '86fa97265982e6ca5bf9aa078b845c99056d55bf', spacing: 12 }, hasInclusivePrices ? (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: InclusivePricingIcon }), h("zonos-text", null, inclusivePriceMessage))) : (h(Fragment, null, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
246
|
+
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '7421346614aed925f25e3571cbe935045e392615', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: '35560fe611d0424186e79aa1ff56f15c89d122b6' }, h("zonos-country-select", { key: 'c437335dcbcfcf74dab7baeddf663cc216f0b377', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: '4692f2be013dc35e821cf1ee9c20d05cf0de9d8e' }, h("zonos-language-select", { key: '19337a5bb390beb9f7629e577f296f2c9f806c98', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
247
247
|
}
|
|
248
248
|
static get is() { return "zonos-hello-dialog"; }
|
|
249
249
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,6 +7,8 @@ import { getZonosSettings } from "../utils/api/getZonosSettings";
|
|
|
7
7
|
import { initCheckout } from "../utils/checkout/initCheckout";
|
|
8
8
|
import { handleFetch } from "../utils/handleFetch";
|
|
9
9
|
import { initHello } from "../utils/hello/initHello";
|
|
10
|
+
import { CheckoutAddressService } from "../utils/iframe/CheckoutAddressService";
|
|
11
|
+
import { iframeServices, injectPrivateIframe, } from "../utils/iframe/IframeHelpers";
|
|
10
12
|
import { log } from "../utils/logging/log";
|
|
11
13
|
export class ZonosController {
|
|
12
14
|
constructor() {
|
|
@@ -117,6 +119,25 @@ export class ZonosController {
|
|
|
117
119
|
document.body.appendChild(scriptToInject);
|
|
118
120
|
});
|
|
119
121
|
}
|
|
122
|
+
async initGooglePlacesService(settings) {
|
|
123
|
+
const genericSettings = settings === null || settings === void 0 ? void 0 : settings.genericSettings;
|
|
124
|
+
if (!genericSettings) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const signedPayload = genericSettings.signedTokenGooglePlaces;
|
|
128
|
+
if (!signedPayload) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// Create private iframe to load google places api
|
|
132
|
+
injectPrivateIframe({
|
|
133
|
+
id: iframeServices.GOOGLE_PLACES,
|
|
134
|
+
onload: () => {
|
|
135
|
+
// init checkout address service
|
|
136
|
+
zonosStore.checkoutAddressService = new CheckoutAddressService();
|
|
137
|
+
},
|
|
138
|
+
src: `${process.env.NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL}/iframe/google-maps?signedToken=${signedPayload}`,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
120
141
|
async componentWillLoad() {
|
|
121
142
|
this.initHistoryListener();
|
|
122
143
|
zonosStore.zonosApiKey = this.zonosApiKey;
|
|
@@ -201,6 +222,8 @@ export class ZonosController {
|
|
|
201
222
|
this.stripeInitEvent.emit({
|
|
202
223
|
publishableKey: publishableKey.token,
|
|
203
224
|
});
|
|
225
|
+
// init google places service
|
|
226
|
+
void this.initGooglePlacesService(json);
|
|
204
227
|
})();
|
|
205
228
|
}
|
|
206
229
|
/**
|
|
@@ -251,7 +274,7 @@ export class ZonosController {
|
|
|
251
274
|
zonosStore.organizationName = organizationName;
|
|
252
275
|
}
|
|
253
276
|
render() {
|
|
254
|
-
return h(Host, { key: '
|
|
277
|
+
return h(Host, { key: '525180de311aea6ffaf2ecaa3fc35befd6bd9142', class: "zonos--elements" });
|
|
255
278
|
}
|
|
256
279
|
static get is() { return "zonos-controller"; }
|
|
257
280
|
static get encapsulation() { return "shadow"; }
|
|
@@ -41,7 +41,7 @@ export class ZonosPaypalPayment {
|
|
|
41
41
|
void this.loadPaypal();
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '093fd3a8fb9cc021243ca5feff2737f1b1c10b7c', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: '686412f4de97c57a309e6134312641c481c5a9fe', class: "zonos--payment-paypal-container" })));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "zonos-paypal-payment"; }
|
|
47
47
|
static get encapsulation() { return "scoped"; }
|