@ikas/storefront 5.0.0-beta.9 → 5.0.1
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/build/analytics/analytics.d.ts +4 -0
- package/build/analytics/analytics.js +1 -1
- package/build/analytics/facebookPixel.d.ts +1 -0
- package/build/analytics/facebookPixel.js +1 -1
- package/build/analytics/googleAnalytics.d.ts +1 -0
- package/build/analytics/googleAnalytics.js +1 -1
- package/build/analytics/googleTagManager.d.ts +12 -21
- package/build/analytics/googleTagManager.js +1 -1
- package/build/analytics/head/index.js +1 -1
- package/build/analytics/ikas.d.ts +2 -1
- package/build/analytics/ikas.js +1 -1
- package/build/analytics/tiktokPixel.d.ts +1 -0
- package/build/analytics/tiktokPixel.js +1 -1
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +13 -2
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.d.ts +7 -0
- package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.js +1 -0
- package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/style.module.scss.js +1 -0
- package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +1 -0
- package/build/components/checkout/components/cart-summary/cart-item/index.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/style.module.scss.js +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/svg/arrow-down.d.ts +2 -0
- package/build/components/checkout/components/cart-summary/cart-item/svg/arrow-down.js +1 -0
- package/build/components/checkout/components/cart-summary/index.d.ts +11 -0
- package/build/components/checkout/components/cart-summary/index.js +1 -1
- package/build/components/checkout/components/cart-summary/style.module.scss.js +1 -1
- package/build/components/checkout/components/credit-card-form/model.js +1 -1
- package/build/components/checkout/components/customer-addresses/index.js +1 -1
- package/build/components/checkout/components/customer-addresses/model.js +1 -1
- package/build/components/checkout/components/customer-addresses/style.module.scss.js +1 -1
- package/build/components/checkout/components/epaykolay-button/index.d.ts +5 -0
- package/build/components/checkout/components/epaykolay-button/index.js +1 -0
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -0
- package/build/components/checkout/components/error/customer-account-disabled-error/index.d.ts +8 -0
- package/build/components/checkout/components/error/customer-account-disabled-error/index.js +1 -0
- package/build/components/checkout/components/error/customer-login-required-error/index.js +1 -1
- package/build/components/checkout/components/error/index.js +1 -1
- package/build/components/checkout/components/form-item/index.js +1 -1
- package/build/components/checkout/components/form-item/model.js +1 -1
- package/build/components/checkout/components/notification-box/index.d.ts +2 -0
- package/build/components/checkout/components/notification-box/index.js +1 -1
- package/build/components/checkout/components/offer-product/index.js +1 -1
- package/build/components/checkout/components/paypal/index.d.ts +7 -0
- package/build/components/checkout/components/paypal/index.js +1 -0
- package/build/components/checkout/components/paypal/style.module.scss.js +1 -0
- package/build/components/checkout/components/product-files/index.d.ts +7 -0
- package/build/components/checkout/components/product-files/index.js +1 -0
- package/build/components/checkout/components/product-files/style.module.scss.js +1 -0
- package/build/components/checkout/components/quick-registration/model.js +1 -1
- package/build/components/checkout/components/select-box/index.d.ts +1 -0
- package/build/components/checkout/components/select-box/index.js +1 -1
- package/build/components/checkout/components/stripe/index.js +1 -1
- package/build/components/checkout/components/svg/epaykolay.d.ts +6 -0
- package/build/components/checkout/components/svg/epaykolay.js +1 -0
- package/build/components/checkout/components/toggle/index.d.ts +1 -0
- package/build/components/checkout/components/toggle/index.js +1 -1
- package/build/components/checkout/components/toggle/style.module.scss.js +1 -1
- package/build/components/checkout/index.d.ts +2 -0
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +44 -17
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/steps/step-payment/index.js +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.js +1 -1
- package/build/components/checkout/steps/step-payment/style.module.scss.js +1 -1
- package/build/components/checkout/steps/step-shipping/index.js +1 -1
- package/build/components/checkout/steps/step-success/index.js +1 -1
- package/build/components/checkout/steps/step-success/style.module.scss.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/google-captcha/index.js +1 -1
- package/build/components/link/index.js +1 -1
- package/build/components/page/head.js +1 -1
- package/build/components/page/index.js +1 -1
- package/build/components/page-editor/ThemeComponentEditor.js +1 -1
- package/build/components/page-editor/model.d.ts +1 -0
- package/build/components/page-editor/model.js +1 -1
- package/build/hooks/useCustomerReviews.js +1 -1
- package/build/hooks/useStore.js +1 -1
- package/build/index.js +1 -1
- package/build/models/data/cart/available-shipping-method/estimated-delivery-time/index.d.ts +6 -0
- package/build/models/data/cart/available-shipping-method/estimated-delivery-time/index.js +1 -0
- package/build/models/data/cart/available-shipping-method/index.d.ts +2 -0
- package/build/models/data/cart/available-shipping-method/index.js +1 -1
- package/build/models/data/category/conditions/index.d.ts +21 -0
- package/build/models/data/category/conditions/index.js +1 -0
- package/build/models/data/category/index.d.ts +3 -0
- package/build/models/data/category/index.js +1 -1
- package/build/models/data/checkout/index.d.ts +2 -2
- package/build/models/data/checkout-settings/index.d.ts +2 -1
- package/build/models/data/checkout-settings/index.js +1 -1
- package/build/models/data/checkout-settings/price/index.d.ts +2 -1
- package/build/models/data/checkout-settings/price/index.js +1 -1
- package/build/models/data/contact-form/index.d.ts +1 -0
- package/build/models/data/contact-form/index.js +1 -1
- package/build/models/data/customer/address/ikas-localized-customer-address.d.ts +26 -12
- package/build/models/data/customer/address/ikas-localized-customer-address.js +1 -1
- package/build/models/data/customer/address/index.d.ts +5 -0
- package/build/models/data/customer/address/index.js +1 -1
- package/build/models/data/customer/address/region/index.d.ts +6 -0
- package/build/models/data/customer/address/region/index.js +1 -0
- package/build/models/data/customer/index.d.ts +7 -0
- package/build/models/data/customer/index.js +1 -1
- package/build/models/data/customer/price-list-rule/filter/index.d.ts +7 -0
- package/build/models/data/customer/price-list-rule/filter/index.js +1 -0
- package/build/models/data/customer/price-list-rule/index.d.ts +10 -0
- package/build/models/data/customer/price-list-rule/index.js +1 -0
- package/build/models/data/customer/review/index.d.ts +1 -0
- package/build/models/data/customer/review/index.js +1 -1
- package/build/models/data/favorite-product/index.d.ts +2 -0
- package/build/models/data/favorite-product/index.js +1 -1
- package/build/models/data/filter-category/index.d.ts +4 -0
- package/build/models/data/filter-category/index.js +1 -1
- package/build/models/data/html-meta-data/translations/index.d.ts +1 -0
- package/build/models/data/html-meta-data/translations/index.js +1 -1
- package/build/models/data/image/index.d.ts +1 -0
- package/build/models/data/image/index.js +1 -1
- package/build/models/data/index.d.ts +15 -1
- package/build/models/data/order/address/ikas-localized-order-address.d.ts +48 -18
- package/build/models/data/order/address/ikas-localized-order-address.js +1 -1
- package/build/models/data/order/address/index.d.ts +5 -0
- package/build/models/data/order/address/index.js +1 -1
- package/build/models/data/order/address/region/index.d.ts +6 -0
- package/build/models/data/order/address/region/index.js +1 -0
- package/build/models/data/order/index.d.ts +3 -0
- package/build/models/data/order/index.js +1 -1
- package/build/models/data/order/line-item/index.d.ts +5 -0
- package/build/models/data/order/line-item/index.js +1 -1
- package/build/models/data/order/line-item/variant/bundle-product/bundle-variant/index.d.ts +33 -0
- package/build/models/data/order/line-item/variant/bundle-product/bundle-variant/index.js +1 -0
- package/build/models/data/order/line-item/variant/bundle-product/index.d.ts +15 -0
- package/build/models/data/order/line-item/variant/bundle-product/index.js +1 -0
- package/build/models/data/order/line-item/variant/index.d.ts +4 -0
- package/build/models/data/order/line-item/variant/index.js +1 -1
- package/build/models/data/order/transaction/index.d.ts +1 -0
- package/build/models/data/order/transaction/index.js +1 -1
- package/build/models/data/order/transaction/payment-method-detail/index.d.ts +1 -0
- package/build/models/data/order/transaction/payment-method-detail/index.js +1 -1
- package/build/models/data/product/campaign-offer/index.d.ts +15 -0
- package/build/models/data/product/campaign-offer/index.js +1 -0
- package/build/models/data/product/filter/index.d.ts +2 -0
- package/build/models/data/product/filter/index.js +1 -1
- package/build/models/data/product/group/index.d.ts +11 -0
- package/build/models/data/product/group/index.js +1 -0
- package/build/models/data/product/group/translation/index.d.ts +13 -0
- package/build/models/data/product/group/translation/index.js +1 -0
- package/build/models/data/product/group/value/index.d.ts +7 -0
- package/build/models/data/product/group/value/index.js +1 -0
- package/build/models/data/product/image/index.d.ts +1 -0
- package/build/models/data/product/image/index.js +1 -1
- package/build/models/data/product/index.d.ts +34 -1
- package/build/models/data/product/index.js +1 -1
- package/build/models/data/product/variant/bundle-settings/bundle-product/index.d.ts +28 -0
- package/build/models/data/product/variant/bundle-settings/bundle-product/index.js +1 -0
- package/build/models/data/product/variant/bundle-settings/index.d.ts +8 -0
- package/build/models/data/product/variant/bundle-settings/index.js +1 -0
- package/build/models/data/product/variant/index.d.ts +35 -3
- package/build/models/data/product/variant/index.js +1 -1
- package/build/models/data/product/variant/price/index.d.ts +26 -0
- package/build/models/data/product/variant/price/index.js +1 -1
- package/build/models/data/product/variant/price/product-campaign-price/index.d.ts +6 -0
- package/build/models/data/product/variant/price/product-campaign-price/index.js +1 -0
- package/build/models/data/product-file/index.d.ts +8 -0
- package/build/models/data/product-file/index.js +1 -0
- package/build/models/data/shipping-zone/index.d.ts +9 -0
- package/build/models/data/shipping-zone/index.js +1 -0
- package/build/models/data/shipping-zone/state/city/district/index.d.ts +7 -0
- package/build/models/data/shipping-zone/state/city/district/index.js +1 -0
- package/build/models/data/shipping-zone/state/city/district/region/index.d.ts +6 -0
- package/build/models/data/shipping-zone/state/city/district/region/index.js +1 -0
- package/build/models/data/shipping-zone/state/city/index.d.ts +8 -0
- package/build/models/data/shipping-zone/state/city/index.js +1 -0
- package/build/models/data/shipping-zone/state/index.d.ts +9 -0
- package/build/models/data/shipping-zone/state/index.js +1 -0
- package/build/models/data/storefront/b2b-settings/index.d.ts +8 -0
- package/build/models/data/storefront/b2b-settings/index.js +1 -0
- package/build/models/data/storefront/index-page-seo-setting/index.d.ts +17 -0
- package/build/models/data/storefront/index-page-seo-setting/index.js +1 -0
- package/build/models/data/storefront/index.d.ts +6 -1
- package/build/models/data/storefront/index.js +1 -1
- package/build/models/data/theme-json/component/index.d.ts +2 -0
- package/build/models/data/theme-json/component/index.js +1 -1
- package/build/models/data/theme-json/component/prop/index.d.ts +2 -0
- package/build/models/data/theme-json/component/prop/index.js +1 -1
- package/build/models/data/theme-json/custom-data/index.d.ts +2 -0
- package/build/models/data/theme-json/custom-data/index.js +1 -1
- package/build/models/data/theme-json/index.js +1 -1
- package/build/models/data/video/index.d.ts +11 -0
- package/build/models/data/video/index.js +1 -0
- package/build/models/ui/blog-category-list/index.js +1 -1
- package/build/models/ui/brand-list/index.js +1 -1
- package/build/models/ui/category-list/index.js +1 -1
- package/build/models/ui/customer-review-list/index.js +1 -1
- package/build/models/ui/customer-review-summary-list/index.js +1 -1
- package/build/models/ui/index.d.ts +1 -1
- package/build/models/ui/product-attribute-list/index.js +1 -1
- package/build/models/ui/product-list/index.d.ts +25 -3
- package/build/models/ui/product-list/index.js +1 -1
- package/build/models/ui/raffle-list/index.js +1 -1
- package/build/models/ui/validator/form/account-info.js +1 -1
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/models/ui/validator/form/contact-form.d.ts +6 -0
- package/build/models/ui/validator/form/contact-form.js +1 -1
- package/build/models/ui/validator/form/ikas-address.d.ts +46 -20
- package/build/models/ui/validator/form/ikas-address.js +1 -1
- package/build/models/ui/validator/form/login.d.ts +7 -4
- package/build/models/ui/validator/form/login.js +1 -1
- package/build/models/ui/validator/form/register.d.ts +10 -1
- package/build/models/ui/validator/form/register.js +1 -1
- package/build/page-data-init/index.d.ts +9 -1
- package/build/page-data-init/index.js +1 -1
- package/build/pages/account/activate.d.ts +4 -0
- package/build/pages/account/activate.js +1 -0
- package/build/pages/checkout.js +1 -1
- package/build/pages/home.js +1 -1
- package/build/pages/index.d.ts +1 -0
- package/build/store/base.d.ts +1 -0
- package/build/store/base.js +1 -1
- package/build/store/blog/index.js +1 -1
- package/build/store/brand/index.js +1 -1
- package/build/store/cart/index.d.ts +6 -2
- package/build/store/cart/index.js +1 -1
- package/build/store/category/index.js +1 -1
- package/build/store/checkout/index.d.ts +7 -2
- package/build/store/checkout/index.js +1 -1
- package/build/store/customer/api.d.ts +5 -1
- package/build/store/customer/api.js +1 -1
- package/build/store/customer/index.d.ts +25 -5
- package/build/store/customer/index.js +1 -1
- package/build/store/html-meta-data/index.js +1 -1
- package/build/store/index.d.ts +1 -1
- package/build/store/location/index.d.ts +2 -1
- package/build/store/location/index.js +1 -1
- package/build/store/product/index.d.ts +4 -1
- package/build/store/product/index.js +1 -1
- package/build/utils/constants.js +1 -1
- package/build/utils/helper.d.ts +1 -0
- package/build/utils/helper.js +1 -1
- package/package.json +18 -14
- package/build/analytics/googleUniversal.d.ts +0 -9
- package/build/analytics/googleUniversal.js +0 -1
- package/build/ext/@builder.io/partytown/integration/index.mjs.js +0 -1
- package/build/ext/@builder.io/partytown/react/index.mjs.js +0 -1
- package/build/models/data/checkout/country-settings-model.d.ts +0 -141
- package/build/models/data/checkout/country-settings-model.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import r from"lodash/sortBy";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout/country-settings-model.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import{IkasOrderAddressCity as o}from"../../../../models/data/order/address/city/index.js";import{IkasOrderAddressCountry as n}from"../../../../models/data/order/address/country/index.js";import{IkasOrderAddressDistrict as d}from"../../../../models/data/order/address/district/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import{stringSorter as a,capitalize as l}from"../../../../utils/helper.js";import{FREE_TEXT_CITY_COUNTRY_LIST as u,DISTRICT_HIDDEN_COUNTRY_LIST as m}from"../../../../utils/constants.js";import c from"../../../../store/location/index.js";import{IkasStorefrontConfig as p}from"@ikas/storefront-config";var h=function(){function h(i){var r=this;this.isCorporate=!1,this.isErrorsVisible=!1,this.allowedCountryIds=null,this.allowCorporateInfo=!1,this.allowTitleChange=!1,this.firstNameChangeCallback=null,this.lastNameChangeCallback=null,this.countries=[],this.states=[],this.cities=[],this.districts=[],this.myCountryCode=null,this.fillDropdownOptions=function(){return t(r,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.listCountries()];case 1:return t.sent(),[4,this.listStates()];case 2:return t.sent(),[4,this.listCities()];case 3:return t.sent(),[4,this.listDistricts()];case 4:return t.sent(),[2]}}))}))},this.listCountries=function(){return t(r,void 0,void 0,(function(){var t,i,s,r,o,n,d,a,l=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),this.myCountryCode?[3,2]:[4,c.getMyCountry()];case 1:t=e.sent(),this.myCountryCode=t.data,e.label=2;case 2:return[4,c.listCountry({id:(null===(d=this.allowedCountryIds)||void 0===d?void 0:d.length)?{in:this.allowedCountryIds}:void 0,locale:p.getCurrentLocale()})];case 3:return i=e.sent(),s=i.data||[],r=p.getCurrentRouting(),(null===(a=null==r?void 0:r.countryCodes)||void 0===a?void 0:a.length)?s=s.filter((function(t){var e;return t.iso2&&(null===(e=r.countryCodes)||void 0===e?void 0:e.includes(t.iso2))})):(o=p.getRoutings().filter((function(t){return t.id!==p.getStorefrontRoutingId()})),s=s.filter((function(t){return t.iso2&&!o.some((function(e){var i;return null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2)}))}))),this.countries=s,1!==this.countries.length||this.country?this.countries.length&&this.myCountryCode&&!this.country&&((n=this.countries.find((function(t){return t.iso2===l.myCountryCode})))?this.onCountryChange(n.id):this.onCountryChange(this.countries[0].id)):this.onCountryChange(this.countries[0].id),[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},this.listStates=function(){return t(r,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.country)||void 0===i?void 0:i.id))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listState({countryId:{eq:this.country.id},locale:p.getCurrentLocale()})];case 2:return t=e.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.listCities=function(){return t(r,void 0,void 0,(function(){var t,i,s;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.state)||void 0===i?void 0:i.id)||!(null===(s=this.country)||void 0===s?void 0:s.id))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listCity({stateId:{eq:this.state.id},countryId:{eq:this.country.id}})];case 2:return t=e.sent(),this.cities=t.data||[],[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.listDistricts=function(){return t(r,void 0,void 0,(function(){var t,i,s,r;return e(this,(function(e){switch(e.label){case 0:if(!(null===(i=this.city)||void 0===i?void 0:i.id)||this.isDistrictHidden)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,c.listDistrict({cityId:{eq:this.city.id},stateId:(null===(s=this.state)||void 0===s?void 0:s.id)?{eq:null===(r=this.state)||void 0===r?void 0:r.id}:void 0})];case 2:return t=e.sent(),this.districts=t.data||[],this.districts.length?this.address.isDistrictRequired=!0:this.address.isDistrictRequired=!1,[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},this.modelToOption=function(t){return{label:t.name,value:t.id+""}},this.onFirstNameChange=function(t){r.firstNameChangeCallback&&r.firstNameChangeCallback(t),r.address.firstName=t},this.onLastNameChange=function(t){r.lastNameChangeCallback&&r.lastNameChangeCallback(t),r.address.lastName=t},this.onPhoneChange=function(t){r.address.phone=t},this.onIdentityNumberChange=function(t){t?t.length<=11&&(r.address.identityNumber=t):r.address.identityNumber=""},this.onAddressTitleChange=function(t){r.address.title=t},this.onAddressLine1Change=function(t){r.address.addressLine1=t},this.onAddressLine2Change=function(t){r.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){r.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=r.country)||void 0===e?void 0:e.id)!==t){var i=r.countries.find((function(e){return e.id===t}));r.address.country=new n({id:(null==i?void 0:i.id)||null,name:(null==i?void 0:i.name)||"",code:(null==i?void 0:i.iso3)||null,iso2:(null==i?void 0:i.iso2)||null,iso3:(null==i?void 0:i.iso3)||null}),r.address.state=null,r.address.city=null,r.address.district=null,r.address.phone=null,r.states=[],r.cities=[],r.districts=[],r.listStates()}},this.onStateChange=function(t){var e;if((null===(e=r.state)||void 0===e?void 0:e.id)!==t){var i=r.states.find((function(e){return e.id===t}));r.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},r.address.isFreeTextCity||(r.address.city=null,r.cities=[],r.listCities()),r.address.isFreeTextDistrict||(r.address.district=null,r.districts=[])}},this.onCityChange=function(t){var e;if((null===(e=r.city)||void 0===e?void 0:e.id)!==t){var i=r.cities.find((function(e){return e.id===t}));r.address.city=new o({id:i.id,name:i.name}),r.address.isFreeTextDistrict||(r.address.district=null,r.districts=[],r.listDistricts())}},this.onCityInputChange=function(t){r.districts=[],r.address.city=new o({id:void 0,name:t})},this.onDistrictChange=function(t){var e;if((null===(e=r.district)||void 0===e?void 0:e.id)!==t){var i=r.districts.find((function(e){return e.id===t}));r.address.district=new d({id:i.id,name:i.name})}},this.onDistrictInputChange=function(t){r.address.district=new d({id:void 0,name:t})},this.onCorporateChange=function(t){r.isCorporate=t,t||(r.address.company=null,r.address.taxNumber=null,r.address.taxOffice=null)},this.onCompanyChange=function(t){r.address.company=t},this.onTaxNumberChange=function(t){r.address.taxNumber=t},this.onTaxOfficeChange=function(t){r.address.taxOffice=t},this.address=i.address,this.isCorporate=i.isCorporate||!1,this.isErrorsVisible=i.isErrorsVisible||!1,this.isCustomerAddress=i.isCustomerAddress||!1,this.allowedCountryIds=i.allowedCountryIds,this.allowCorporateInfo=i.allowCorporateInfo||!1,this.allowTitleChange=i.allowTitleChange||!1,this.firstNameChangeCallback=i.firstNameChangeCallback||null,this.lastNameChangeCallback=i.lastNameChangeCallback||null,s(this,{firstNameChangeCallback:!1,lastNameChangeCallback:!1}),this.fillDropdownOptions()}return Object.defineProperty(h.prototype,"firstName",{get:function(){return this.address.firstName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"lastName",{get:function(){return this.address.lastName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"phone",{get:function(){return this.address.phone},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"identityNumber",{get:function(){return this.address.identityNumber},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"country",{get:function(){return this.address.country},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this.address.state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"city",{get:function(){return this.address.city},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"district",{get:function(){return this.address.district},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"countryOptions",{get:function(){var t=this.countries.map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"stateOptions",{get:function(){var t=this.states.map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"cityOptions",{get:function(){return r(this.cities,"order").map(this.modelToOption)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"districtOptions",{get:function(){var t=this.districts.map((function(t){return i(i({},t),{name:l(t.name)})})).map(this.modelToOption);return t.sort((function(t,e){return a(t.label,e.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isFreeTextCity",{get:function(){var t=this;return u.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isDistrictHidden",{get:function(){var t=this;return m.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e.toLowerCase()}))},enumerable:!1,configurable:!0}),h}();export{h as default};
|
|
1
|
+
import{__awaiter as t,__generator as i,__assign as e}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o}from"mobx";import s from"lodash/sortBy";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import{IkasOrderAddressCity as r}from"../../../../models/data/order/address/city/index.js";import{IkasOrderAddressCountry as n}from"../../../../models/data/order/address/country/index.js";import{IkasOrderAddressDistrict as d}from"../../../../models/data/order/address/district/index.js";import{IkasOrderAddressRegion as a}from"../../../../models/data/order/address/region/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import{stringSorter as l,capitalize as u}from"../../../../utils/helper.js";import{FREE_TEXT_CITY_COUNTRY_LIST as c,DISTRICT_HIDDEN_COUNTRY_LIST as m}from"../../../../utils/constants.js";import p from"../../../../store/location/index.js";import{IkasStorefrontConfig as h}from"@ikas/storefront-config";var f=function(){function f(e){var s=this;this.isCorporate=!1,this.isErrorsVisible=!1,this.allowedCountryIds=null,this.allowCorporateInfo=!1,this.allowTitleChange=!1,this.firstNameChangeCallback=null,this.lastNameChangeCallback=null,this.countries=[],this.states=[],this.cities=[],this.districts=[],this.myCountryCode=null,this.fillDropdownOptions=function(){return t(s,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.listCountries()];case 1:return t.sent(),[4,this.listStates()];case 2:return t.sent(),[4,this.listCities()];case 3:return t.sent(),[4,this.listDistricts()];case 4:return t.sent(),[2]}}))}))},this.listCountries=function(){return t(s,void 0,void 0,(function(){var t,e,o,s,r,n,d,a,l=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),this.myCountryCode?[3,2]:[4,p.getMyCountry()];case 1:t=i.sent(),this.myCountryCode=t.data,i.label=2;case 2:return[4,p.listCountry({id:(null===(d=this.allowedCountryIds)||void 0===d?void 0:d.length)?{in:this.allowedCountryIds}:void 0,locale:h.getCurrentLocale()})];case 3:return e=i.sent(),o=e.data||[],s=h.getCurrentRouting(),(null===(a=null==s?void 0:s.countryCodes)||void 0===a?void 0:a.length)?o=o.filter((function(t){var i;return t.iso2&&(null===(i=s.countryCodes)||void 0===i?void 0:i.includes(t.iso2))})):(r=h.getRoutings().filter((function(t){return t.id!==h.getStorefrontRoutingId()})),o=o.filter((function(t){return t.iso2&&!r.some((function(i){var e;return null===(e=i.countryCodes)||void 0===e?void 0:e.includes(t.iso2)}))}))),this.countries=o,1!==this.countries.length||this.country?this.countries.length&&this.myCountryCode&&!this.country&&((n=this.countries.find((function(t){return t.iso2===l.myCountryCode})))?this.onCountryChange(n.id):this.onCountryChange(this.countries[0].id)):this.onCountryChange(this.countries[0].id),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}}))}))},this.listStates=function(){return t(s,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,p.listState({countryId:{eq:this.country.id},locale:h.getCurrentLocale()})];case 2:return t=i.sent(),this.states=t.data||[],this.hasState||this.onStateChange(this.states[0].id),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.listCities=function(){return t(s,void 0,void 0,(function(){var t,e,o;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.state)||void 0===e?void 0:e.id)||!(null===(o=this.country)||void 0===o?void 0:o.id))return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,p.listCity({stateId:{eq:this.state.id},countryId:{eq:this.country.id}})];case 2:return t=i.sent(),this.cities=t.data||[],[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.listDistricts=function(){return t(s,void 0,void 0,(function(){var t,e,o,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.city)||void 0===e?void 0:e.id)||this.isDistrictHidden)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,p.listDistrict({cityId:{eq:this.city.id},stateId:(null===(o=this.state)||void 0===o?void 0:o.id)?{eq:null===(s=this.state)||void 0===s?void 0:s.id}:void 0})];case 2:return t=i.sent(),this.districts=t.data||[],this.districts.length?this.address.isDistrictRequired=!0:this.address.isDistrictRequired=!1,[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))},this.modelToOption=function(t){return{label:t.name,value:t.id+""}},this.onFirstNameChange=function(t){s.firstNameChangeCallback&&s.firstNameChangeCallback(t),s.address.firstName=t},this.onLastNameChange=function(t){s.lastNameChangeCallback&&s.lastNameChangeCallback(t),s.address.lastName=t},this.onPhoneChange=function(t){s.address.phone=t},this.onIdentityNumberChange=function(t){t?t.length<=11&&(s.address.identityNumber=t):s.address.identityNumber=""},this.onAddressTitleChange=function(t){s.address.title=t},this.onAddressLine1Change=function(t){s.address.addressLine1=t},this.onAddressLine2Change=function(t){s.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){s.address.postalCode=t},this.onCountryChange=function(t){var i;if((null===(i=s.country)||void 0===i?void 0:i.id)!==t){var e=s.countries.find((function(i){return i.id===t}));s.address.country=new n({id:(null==e?void 0:e.id)||null,name:(null==e?void 0:e.name)||"",code:(null==e?void 0:e.iso3)||null,iso2:(null==e?void 0:e.iso2)||null,iso3:(null==e?void 0:e.iso3)||null}),s.address.state=null,s.address.city=null,s.address.district=null,s.address.phone=null,s.states=[],s.cities=[],s.districts=[],s.listStates()}},this.onStateChange=function(t){var i;if((null===(i=s.state)||void 0===i?void 0:i.id)!==t){var e=s.states.find((function(i){return i.id===t}));s.address.state={id:e.id,name:null==e?void 0:e.name,code:null==e?void 0:e.stateCode},s.address.isFreeTextCity||(s.address.city=null,s.cities=[],s.listCities()),s.address.isFreeTextDistrict||(s.address.district=null,s.districts=[])}},this.onCityChange=function(t){var i;if((null===(i=s.city)||void 0===i?void 0:i.id)!==t){var e=s.cities.find((function(i){return i.id===t}));s.address.city=new r({id:e.id,name:e.name}),s.address.isFreeTextDistrict||(s.address.district=null,s.districts=[],s.listDistricts())}},this.onCityInputChange=function(t){s.districts=[],s.address.city=new r({id:void 0,name:t})},this.onDistrictChange=function(t){var i;if((null===(i=s.district)||void 0===i?void 0:i.id)!==t){var e=s.districts.find((function(i){return i.id===t}));s.address.district=new d({id:e.id,name:e.name}),s.address.region=null}},this.onDistrictInputChange=function(t){s.address.district=new d({id:void 0,name:t})},this.onRegionChange=function(t){var i,e,o;if((null===(i=s.region)||void 0===i?void 0:i.id)!==t){var r=null===(o=null===(e=s.shippingZoneDistrict)||void 0===e?void 0:e.regions)||void 0===o?void 0:o.find((function(i){return i.id===t}));s.address.region=new a({id:r.id,name:r.name})}},this.onCorporateChange=function(t){s.isCorporate=t,t||(s.address.company=null,s.address.taxNumber=null,s.address.taxOffice=null)},this.onCompanyChange=function(t){s.address.company=t},this.onTaxNumberChange=function(t){s.address.taxNumber=t},this.onTaxOfficeChange=function(t){s.address.taxOffice=t},this.address=e.address,this.isCorporate=e.isCorporate||!1,this.isErrorsVisible=e.isErrorsVisible||!1,this.isCustomerAddress=e.isCustomerAddress||!1,this.allowedCountryIds=e.allowedCountryIds,this.allowCorporateInfo=e.allowCorporateInfo||!1,this.allowTitleChange=e.allowTitleChange||!1,this.firstNameChangeCallback=e.firstNameChangeCallback||null,this.lastNameChangeCallback=e.lastNameChangeCallback||null,o(this,{firstNameChangeCallback:!1,lastNameChangeCallback:!1}),this.fillDropdownOptions()}return Object.defineProperty(f.prototype,"firstName",{get:function(){return this.address.firstName},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"lastName",{get:function(){return this.address.lastName},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"phone",{get:function(){return this.address.phone},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"identityNumber",{get:function(){return this.address.identityNumber},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"shippingZone",{get:function(){var t,i=this;return null===(t=this.address.shippingZones)||void 0===t?void 0:t.find((function(t){var e;return t.countryId===(null===(e=i.address.country)||void 0===e?void 0:e.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"shippingZoneState",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.state)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"shippingZoneCity",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneState)||void 0===t?void 0:t.cities)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.city)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"shippingZoneDistrict",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneCity)||void 0===t?void 0:t.districts)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.district)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"shippingZoneRegions",{get:function(){var t,i,e=this;return null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.find((function(t){var i;return t.id===(null===(i=e.address.region)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"country",{get:function(){return this.address.country},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"state",{get:function(){return this.address.state},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"city",{get:function(){return this.address.city},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"district",{get:function(){return this.address.district},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"region",{get:function(){return this.address.region},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"countryOptions",{get:function(){var t=this.countries.map(this.modelToOption);return t.sort((function(t,i){return l(t.label,i.label)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"stateOptions",{get:function(){var t,i,e=this,o=this.states.map(this.modelToOption);return this.shippingZone&&!this.shippingZone.showAllStates&&(null===(i=null===(t=this.shippingZone)||void 0===t?void 0:t.states)||void 0===i?void 0:i.length)&&(o=o.filter((function(t){var i,o;return null===(o=null===(i=e.shippingZone)||void 0===i?void 0:i.states)||void 0===o?void 0:o.some((function(i){return i.id===t.value}))}))),o.sort((function(t,i){return l(t.label,i.label)})),o},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"cityOptions",{get:function(){var t,i,e,o=this,r=s(this.cities,"order").map(this.modelToOption);return this.shippingZone&&!(null===(t=this.shippingZoneState)||void 0===t?void 0:t.showAllCities)&&(null===(e=null===(i=this.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.length)&&(r=r.filter((function(t){var i,e;return null===(e=null===(i=o.shippingZoneState)||void 0===i?void 0:i.cities)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"districtOptions",{get:function(){var t,i,o,s=this,r=this.districts.map((function(t){return e(e({},t),{name:u(t.name)})})).map(this.modelToOption);return this.shippingZone&&!(null===(t=this.shippingZoneCity)||void 0===t?void 0:t.showAllDistricts)&&(null===(o=null===(i=this.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===o?void 0:o.length)&&(r=r.filter((function(t){var i,e;return null===(e=null===(i=s.shippingZoneCity)||void 0===i?void 0:i.districts)||void 0===e?void 0:e.some((function(i){return i.id===t.value}))}))),r.sort((function(t,i){return l(t.label,i.label)})),r},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"regionOptions",{get:function(){var t,i,e=(null===(i=null===(t=this.shippingZoneDistrict)||void 0===t?void 0:t.regions)||void 0===i?void 0:i.map(this.modelToOption))||[];return e.sort((function(t,i){return l(t.label,i.label)})),e},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"isFreeTextCity",{get:function(){var t=this;return c.some((function(i){var e,o;return(null===(o=null===(e=t.address.country)||void 0===e?void 0:e.iso2)||void 0===o?void 0:o.toLowerCase())===i.toLowerCase()}))},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"isDistrictHidden",{get:function(){var t=this;return m.some((function(i){var e,o;return(null===(o=null===(e=t.address.country)||void 0===e?void 0:e.iso2)||void 0===o?void 0:o.toLowerCase())===i.toLowerCase()}))},enumerable:!1,configurable:!0}),f}();export{f as default};
|
package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { IkasOrderLineVariantBundleProduct } from "../../../../../../models/data/order/line-item/variant/bundle-product";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
bundleProduct: IkasOrderLineVariantBundleProduct;
|
|
5
|
+
};
|
|
6
|
+
export declare const BundleProductItem: React.FC<Props>;
|
|
7
|
+
export {};
|
package/build/components/checkout/components/cart-summary/cart-item/bundle-product-item/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{observer as a}from"mobx-react-lite";import t from"./style.module.scss.js";var m=a((function(a){var m,n,r=a.bundleProduct;return e.createElement("div",{className:t.BundleProductItem},e.createElement("div",{className:t.ImageContainer},e.createElement("img",{className:t.Image,src:null===(m=r.variant.mainImage)||void 0===m?void 0:m.thumbnailSrc})),e.createElement("div",{className:t.Center},e.createElement("div",{className:t.Name},e.createElement("span",{className:t.Quantity},r.quantity," x")," ",r.variant.name),e.createElement("div",{className:[t.LightText,t.Small].join(" ")},null===(n=r.variant.variantValues)||void 0===n?void 0:n.map((function(e){return e.variantValueName})).join(" / "))))}));export{m as BundleProductItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from'./../../../../../../ext/style-inject/dist/style-inject.es.js';var t={BundleProductItem:"style-module_BundleProductItem__5NcRT",ImageContainer:"style-module_ImageContainer__M8d05",Image:"style-module_Image__joJP8",Center:"style-module_Center__Lo3MR",Name:"style-module_Name__U38Va",Quantity:"style-module_Quantity__8vhv-",LightText:"style-module_LightText__Lmf-c",Small:"style-module_Small__y7iK7"};e(".style-module_BundleProductItem__5NcRT {\n display: flex;\n width: 100%;\n margin-bottom: 12px;\n}\n.style-module_BundleProductItem__5NcRT:last-child {\n margin-bottom: 0;\n}\n.style-module_BundleProductItem__5NcRT .style-module_ImageContainer__M8d05 {\n flex: 0 0 auto;\n width: 40px;\n height: 40px;\n position: relative;\n overflow: hidden;\n margin-right: 12px;\n}\n.style-module_BundleProductItem__5NcRT .style-module_ImageContainer__M8d05 .style-module_Image__joJP8 {\n object-fit: contain;\n border-radius: 8px;\n width: 40px;\n height: 40px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_BundleProductItem__5NcRT .style-module_ImageContainer__M8d05 .style-module_Image__joJP8 {\n width: 40px;\n height: 40px;\n }\n}\n.style-module_BundleProductItem__5NcRT .style-module_Center__Lo3MR {\n position: relative;\n flex: 1 1 auto;\n}\n.style-module_BundleProductItem__5NcRT .style-module_Center__Lo3MR .style-module_Name__U38Va {\n font-size: 14px;\n font-weight: 500;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n max-height: 40px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.style-module_BundleProductItem__5NcRT .style-module_Center__Lo3MR .style-module_Name__U38Va .style-module_Quantity__8vhv- {\n color: var(--checkout-button-disabled-text-color);\n font-size: 14px;\n}\n.style-module_BundleProductItem__5NcRT .style-module_LightText__Lmf-c {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n line-height: 20px;\n margin-top: 2px;\n}\n.style-module_BundleProductItem__5NcRT .style-module_LightText__Lmf-c.style-module_Small__y7iK7 {\n font-size: 12px;\n}");export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasProductOptionType as a}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import"../../../../../models/data/blog/category/index.js";import"../../../../../models/data/blog/content/index.js";import"../../../../../models/data/blog/meta-data/index.js";import"../../../../../models/data/blog/tag/index.js";import"../../../../../models/data/blog/index.js";import"../../../../../models/data/brand/index.js";import{IkasProductOptionType as a}from"@ikas/storefront-models";import"mobx";import"../../../../../models/data/campaign-offer/index.js";import"../../../../../models/data/cart/campaign-offer/index.js";import"../../../../../models/data/cart/index.js";import"../../../../../models/data/category/path-item/index.js";import"../../../../../models/data/category/index.js";import"../../../../../models/data/checkout/index.js";import"../../../../../models/data/checkout-settings/index.js";import"../../../../../models/data/city/index.js";import"../../../../../models/data/country/index.js";import"../../../../../models/data/customer/address/region/index.js";import"../../../../../models/data/customer/address/index.js";import"../../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../../models/data/customer/attribute/index.js";import"../../../../../models/data/customer/review/summary/index.js";import"../../../../../models/data/customer/review/index.js";import"../../../../../models/data/customer/index.js";import"../../../../../models/data/district/index.js";import"../../../../../models/data/favorite-product/index.js";import"../../../../../models/data/filter-category/index.js";import"../../../../../models/data/html-meta-data/index.js";import"../../../../../models/data/image/index.js";import"../../../../../models/data/order/address/region/index.js";import"../../../../../models/data/order/address/index.js";import"../../../../../models/data/order/line-item/option/value/index.js";import"../../../../../models/data/order/line-item/variant/value/index.js";import"../../../../../models/data/order/line-item/variant/index.js";import"../../../../../models/data/order/line-item/index.js";import"../../../../../models/data/order/package/index.js";import"../../../../../models/data/order/transaction/index.js";import"../../../../../models/data/order/index.js";import"../../../../../models/data/payment-gateway/index.js";import"../../../../../models/data/product/attribute-value/index.js";import"../../../../../models/data/product/filter/index.js";import"../../../../../models/data/product/campaign-offer/index.js";import"../../../../../models/data/product/option-set/option/index.js";import"../../../../../models/data/product/option-set/index.js";import"../../../../../models/data/product/stock-location/index.js";import"../../../../../models/data/product/variant/price/index.js";import"../../../../../models/data/product/variant/index.js";import"../../../../../models/data/variant-type/index.js";import"../../../../../models/data/product/index.js";import"../../../../../models/data/raffle/index.js";import"../../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../../models/data/state/index.js";import"../../../../../models/data/theme-json/index.js";import"../../../../../models/data/theme-json/component/index.js";import"../../../../../models/data/theme-json/custom-data/index.js";import"../../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../../models/ui/blog-list/index.js";import"../../../../../models/ui/blog-category-list/index.js";import"../../../../../models/ui/brand-list/index.js";import"../../../../../models/ui/category-list/index.js";import"../../../../../models/ui/product-list/index.js";import"../../../../../models/ui/product-attribute-detail/index.js";import"../../../../../models/ui/product-attribute-list/index.js";import"../../../../../models/ui/customer-review-list/index.js";import"../../../../../models/ui/customer-review-summary-list/index.js";import"../../../../../models/ui/validator/index.js";import"../../../../../models/ui/validator/rules/index.js";import"../../../../../models/ui/validator/form/login.js";import"../../../../../models/ui/validator/form/address.js";import"../../../../../models/ui/validator/form/ikas-address.js";import"../../../../../models/ui/validator/form/register.js";import"../../../../../models/ui/validator/form/contact-form.js";import"../../../../../models/ui/validator/form/forgot-password.js";import"../../../../../models/ui/validator/form/recover-password.js";import"../../../../../models/ui/validator/form/account-info.js";import"../../../../../models/ui/validator/form/raffle-form.js";import"../../../../../models/ui/validator/form/customer-review.js";import"../../../../../models/ui/raffle-list/index.js";import{formatDate as o}from"../../../../../utils/helper.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../../utils/i18n.js";import{Modal as r}from"../../modal/index.js";import{BundleProductItem as s}from"./bundle-product-item/index.js";import m from"./svg/arrow-right.js";import d from"./svg/arrow-down.js";import n from"./style.module.scss.js";var l=t((function(t){var l,c,u,p;t.vm,t.currencyCode;var v=t.cartItem,j=t.stockErrorItem,x=t.onChange,f=i().t,g=!j,E=e.useRef(null),N=e.useState(0),h=N[0],y=N[1],b=e.useState(!1),k=b[0],C=b[1],O=e.useState(!1),P=O[0],w=O[1];e.useEffect((function(){if(E.current){var e=24;Array.from(E.current.children).map((function(t){return e=e+t.clientHeight+12})),y(e)}}),[]),e.useEffect((function(){E.current&&(E.current.style.maxHeight=P?"".concat(h,"px"):"0")}),[P]);var I=e.useMemo((function(){var t;return e.createElement("div",null,null===(t=v.options)||void 0===t?void 0:t.map((function(t){switch(t.type){case a.TEXT:case a.TEXT_AREA:case a.CHOICE:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.map((function(e){return e.name||e.value})).join(", ")));case a.DATE_PICKER:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.map((function(e){return t=e.value,(a=o(new Date(t)).split(" ")).splice(-1),a.join(" ");var t,a})).join(", ")));case a.FILE:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.map((function(e){return t=e.value,decodeURIComponent(t.split("/")[t.split("/").length-1]);var t})).join(", ")));case a.CHECKBOX:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionValue},t.values.length&&"true"===t.values[0].value?f("checkout-page:yes"):f("checkout-page:no")));case a.COLOR_PICKER:return e.createElement("div",{className:n.OptionRow},e.createElement("div",{className:n.OptionName},t.name),e.createElement("div",{className:n.OptionsHorContainer},t.values.map((function(t,a){return e.createElement("div",{key:a,className:n.OptionColorValue,style:{backgroundColor:t.value}})}))))}})))}),[]),R=[n.BundleProductsContainer,P?n.VisibleBundleProducts:""].join(" ");return e.createElement(e.Fragment,null,e.createElement("div",{className:n.CheckoutItem},e.createElement("div",{className:n.ImageContainer},e.createElement("img",{className:n.Image,src:null===(l=v.variant.mainImage)||void 0===l?void 0:l.thumbnailSrc}),e.createElement("div",{className:n.QuantityCircle},v.quantity)),e.createElement("div",{className:n.Center},!!j&&e.createElement("div",{className:n.StockErrorItemMain},e.createElement("span",null,v.quantity," ",f("checkout-page:quantity")),e.createElement("span",null,e.createElement(m,null)),e.createElement("span",null,j.stockCount<0?0:j.stockCount," ",f("checkout-page:quantity"))),e.createElement("div",{className:n.Name},v.variant.name),e.createElement("div",{className:[n.LightText,n.Small].join(" ")},null===(c=v.variant.variantValues)||void 0===c?void 0:c.map((function(e){return e.variantValueName})).join(" / ")),!!(null===(u=v.options)||void 0===u?void 0:u.length)&&e.createElement("div",{className:n.OptionsText,onClick:function(){return C(!0)}},f("checkout-page:customizedProduct")),v.variant.bundleProducts&&0!==v.variant.bundleProducts.length&&e.createElement("div",{className:n.BundleProducts,onClick:function(){w(!P),x&&setTimeout((function(){x(!P)}),200)}},f("checkout-page:bundleProductsQuantity",{value:v.variant.bundleProducts.length}),e.createElement("span",{style:{paddingTop:2,transform:P?void 0:"rotate(180deg)"}},e.createElement(d,null))),!!k&&e.createElement(r,{title:v.variant.name,modalContent:I,onClose:function(){return C(!1)}})),g&&e.createElement("div",{className:n.Right},e.createElement("div",{className:n.Price},!!v.overridenPriceWithQuantity&&e.createElement("span",{className:n.GrayPrice},v.formattedOverridenPriceWithQuantity),v.formattedFinalPriceWithQuantity),v.unitPriceText&&e.createElement("div",{className:[n.LightText,n.Small].join(" ")},v.unitPriceText))),e.createElement("div",{ref:E,className:R},null===(p=v.variant.bundleProducts)||void 0===p?void 0:p.map((function(t){return e.createElement(s,{bundleProduct:t})}))))}));export{l as CartItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutItem:"style-module_CheckoutItem__DaU-Y",ImageContainer:"style-module_ImageContainer__Nr1VF",Image:"style-module_Image__EskwT",QuantityCircle:"style-module_QuantityCircle__sv1mk",Center:"style-module_Center__ZOloc",StockErrorItemMain:"style-module_StockErrorItemMain__RprLM",Name:"style-module_Name__z-5-n",OptionsText:"style-module_OptionsText__7Gcy6",Right:"style-module_Right__WoFoc",Price:"style-module_Price__4WmJv",GrayPrice:"style-module_GrayPrice__Gtch1",LightText:"style-module_LightText__uO43H",Small:"style-module_Small__peZjv",OptionRow:"style-module_OptionRow__lt6CJ",OptionName:"style-module_OptionName__09oij",OptionValue:"style-module_OptionValue__4fCYP",OptionsHorContainer:"style-module_OptionsHorContainer__eTmOO",OptionColorValue:"style-module_OptionColorValue__oNEyN"};e(".style-module_CheckoutItem__DaU-Y {\n display: flex;\n width: 100%;\n margin-bottom: 24px;\n}\n.style-module_CheckoutItem__DaU-Y:last-child {\n margin-bottom: 0;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n flex: 0 0 auto;\n width: 80px;\n height: 74px;\n position: relative;\n padding-right: 16px;\n overflow: hidden;\n padding-top: 10px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n width: 72px;\n height: 66px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n object-fit: contain;\n border-radius: 8px;\n width: 64px;\n height: 64px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n width: 56px;\n height: 56px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_QuantityCircle__sv1mk {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--checkout-button-bg-color);\n color: var(--checkout-button-text-color);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px;\n font-weight: 500;\n position: absolute;\n top: 0px;\n right: 8px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc {\n position: relative;\n flex: 1 1 auto;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM {\n display: flex;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span {\n margin-right: 6px;\n font-size: 14px;\n font-weight: 500;\n text-transform: lowercase;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span:first-child {\n color: var(--checkout-button-disabled-text-color);\n text-decoration-line: line-through;\n font-weight: 400;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_Name__z-5-n {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n max-height: 40px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6 {\n font-size: 12px;\n color: var(--checkout-primary-text-color);\n line-height: 16px;\n margin-top: 2px;\n user-select: none;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6:hover {\n cursor: pointer;\n text-decoration: underline;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 12px;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_Price__4WmJv {\n font-size: 14px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_GrayPrice__Gtch1 {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n text-decoration: line-through;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n line-height: 20px;\n margin-top: 2px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H.style-module_Small__peZjv {\n font-size: 12px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ {\n display: flex;\n flex-direction: column;\n margin-bottom: 24px;\n max-width: 400px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionName__09oij {\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n margin-right: 8px;\n font-weight: 500;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionValue__4fCYP {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionsHorContainer__eTmOO {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionColorValue__oNEyN {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n margin-right: 4px;\n}");export{t as default};
|
|
1
|
+
import e from'./../../../../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutItem:"style-module_CheckoutItem__DaU-Y",ImageContainer:"style-module_ImageContainer__Nr1VF",Image:"style-module_Image__EskwT",QuantityCircle:"style-module_QuantityCircle__sv1mk",Center:"style-module_Center__ZOloc",StockErrorItemMain:"style-module_StockErrorItemMain__RprLM",Name:"style-module_Name__z-5-n",OptionsText:"style-module_OptionsText__7Gcy6",BundleProducts:"style-module_BundleProducts__fbCWu",Right:"style-module_Right__WoFoc",Price:"style-module_Price__4WmJv",GrayPrice:"style-module_GrayPrice__Gtch1",LightText:"style-module_LightText__uO43H",Small:"style-module_Small__peZjv",OptionRow:"style-module_OptionRow__lt6CJ",OptionName:"style-module_OptionName__09oij",OptionValue:"style-module_OptionValue__4fCYP",OptionsHorContainer:"style-module_OptionsHorContainer__eTmOO",OptionColorValue:"style-module_OptionColorValue__oNEyN",BundleProductsContainer:"style-module_BundleProductsContainer__em-6w",VisibleBundleProducts:"style-module_VisibleBundleProducts__YwXXL"};e(".style-module_CheckoutItem__DaU-Y {\n display: flex;\n width: 100%;\n margin-bottom: 24px;\n}\n.style-module_CheckoutItem__DaU-Y:last-child {\n margin-bottom: 0;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n flex: 0 0 auto;\n width: 80px;\n height: 74px;\n position: relative;\n padding-right: 16px;\n overflow: hidden;\n padding-top: 10px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF {\n width: 72px;\n height: 66px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n object-fit: contain;\n border-radius: 8px;\n width: 64px;\n height: 64px;\n}\n@media only screen and (max-width: 375px) {\n .style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_Image__EskwT {\n width: 56px;\n height: 56px;\n }\n}\n.style-module_CheckoutItem__DaU-Y .style-module_ImageContainer__Nr1VF .style-module_QuantityCircle__sv1mk {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--checkout-button-bg-color);\n color: var(--checkout-button-text-color);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px;\n font-weight: 500;\n position: absolute;\n top: 0px;\n right: 8px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc {\n position: relative;\n flex: 1 1 auto;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM {\n display: flex;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span {\n margin-right: 6px;\n font-size: 14px;\n font-weight: 500;\n text-transform: lowercase;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_StockErrorItemMain__RprLM span:first-child {\n color: var(--checkout-button-disabled-text-color);\n text-decoration-line: line-through;\n font-weight: 400;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_Name__z-5-n {\n font-size: 14px;\n font-weight: 600;\n color: var(--checkout-primary-text-color);\n line-height: 20px;\n max-height: 40px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6 {\n font-size: 12px;\n color: var(--checkout-primary-text-color);\n line-height: 16px;\n margin-top: 2px;\n user-select: none;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_OptionsText__7Gcy6:hover {\n cursor: pointer;\n text-decoration: underline;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Center__ZOloc .style-module_BundleProducts__fbCWu {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 12px;\n color: #6f55ff;\n line-height: 16px;\n cursor: pointer;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc {\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 12px;\n padding-top: 10px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_Price__4WmJv {\n font-size: 14px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_Right__WoFoc .style-module_GrayPrice__Gtch1 {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n text-decoration: line-through;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n line-height: 20px;\n margin-top: 2px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_LightText__uO43H.style-module_Small__peZjv {\n font-size: 12px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ {\n display: flex;\n flex-direction: column;\n margin-bottom: 24px;\n max-width: 400px;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionName__09oij {\n font-size: 14px;\n color: var(--checkout-primary-text-color);\n margin-right: 8px;\n font-weight: 500;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionValue__4fCYP {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionsHorContainer__eTmOO {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n}\n.style-module_CheckoutItem__DaU-Y .style-module_OptionRow__lt6CJ .style-module_OptionColorValue__oNEyN {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n margin-right: 4px;\n}\n\n.style-module_BundleProductsContainer__em-6w {\n margin-left: 32px;\n padding-left: 24px;\n border-left: 1px solid var(--checkout-border-color);\n margin-top: -8px;\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.2s ease;\n}\n.style-module_BundleProductsContainer__em-6w.style-module_VisibleBundleProducts__YwXXL {\n max-height: 1000px;\n margin-bottom: 24px;\n}");export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";var t=function(){return e.createElement("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("g",{"clip-path":"url(#clip0_2788_17064)"},e.createElement("path",{d:"M8.75 8.75L4.8125 4.8125L0.875 8.75",stroke:"#6F55FF","stroke-width":"1.225","stroke-linecap":"round","stroke-linejoin":"round"})),e.createElement("defs",null,e.createElement("clipPath",{id:"clip0_2788_17064"},e.createElement("rect",{width:"10",height:"14",fill:"white",transform:"translate(10 14) rotate(-180)"}))))};export{t as default};
|
|
@@ -9,4 +9,15 @@ export declare enum CouponErrorCode {
|
|
|
9
9
|
COUPON_CODE_NOT_EXIST_FOR_GUESS = "COUPON_CODE_NOT_EXIST_FOR_GUESS"
|
|
10
10
|
}
|
|
11
11
|
export declare const CartSummary: React.FC<Props>;
|
|
12
|
+
declare type CommonProps = {
|
|
13
|
+
vm: CheckoutViewModel;
|
|
14
|
+
};
|
|
15
|
+
declare type CouponProps = {
|
|
16
|
+
isAddingCoupon: boolean;
|
|
17
|
+
setAddingCoupon: (value: boolean) => void;
|
|
18
|
+
setCouponError: (value: boolean) => void;
|
|
19
|
+
setCouponErrorCode: (value: CouponErrorCode | null) => void;
|
|
20
|
+
isOpenCouponCode?: boolean;
|
|
21
|
+
} & CommonProps;
|
|
22
|
+
export declare const Coupon: React.FC<CouponProps>;
|
|
12
23
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as s}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as d}from"../form-item/index.js";import{FormItemType as p}from"../form-item/model.js";import E from"../tooltip/index.js";import C from"../svg/arrow-down.js";import v from"../svg/cross.js";import h from"../svg/gift.js";import f from"./style.module.scss.js";import k from"../svg/ikas.js";var N;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS"}(N||(N={}));var g=n((function(e){var t,n,a=e.vm,c=e.allowExpand,d=a.checkout,p=s().t,E=o.useState(!c),v=E[0],h=E[1],g=o.useState(!1),x=g[0],_=g[1],P=o.useState(null),j=P[0],w=P[1],I=o.useState(0),A=I[0],R=I[1],D=o.useState(null),U=D[0],L=D[1],B=o.useState(!1),F=B[0],X=B[1],G=o.useState(!1),V=G[0],M=G[1];o.useEffect((function(){c&&(v?U&&R(U.getBoundingClientRect().height):R(0))}),[v,U,c,F,V,x]);var z=o.useMemo((function(){switch(j){case N.COUPON_CODE_NOT_EXIST:return p("checkout-page:giftCodeErrorDescription");case N.COUPON_CODE_NOT_EXIST_FOR_GUESS:return p("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[j]),H=[f.CartSummary,c?f.HideOnDesktop:""].join(" "),$=c?{height:A+"px"}:void 0,Q=[f.ArrowDown,v?f.Rotated:""].join(" ");return d?o.createElement(o.Fragment,null,!!c&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:f.ExpandHeader,onClick:function(){if(!v){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}h(!v)}},o.createElement("div",{className:f.Left},p("checkout-page:summary")),o.createElement("div",{className:f.Price},o.createElement("span",{className:f.PriceText},"".concat(u(a.finalPrice||0,d.currencyCode,d.currencySymbol)," (").concat(d.itemQuantity," ").concat(p("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:Q},o.createElement(C,null))))),o.createElement("div",{className:H},o.createElement("div",{className:f.DetailsContainer,style:$},o.createElement("div",{className:f.Details,ref:L},o.createElement("div",{className:f.ItemsContainer},d.items.map((function(e,t){return o.createElement(m,{key:t,vm:a,cartItem:e,currencyCode:d.currencyCode})}))),o.createElement("div",{className:f.Divider}),o.createElement("div",{className:f.SubTotalInfo},x&&o.createElement("div",{className:f.NotificationContainer},o.createElement(l,{type:"warning",title:p("checkout-page:giftCodeErrorTitle"),content:z,onClose:function(){_(!1),w(null)}})),o.createElement(y,{label:p("checkout-page:subtotal"),value:d.formattedTotalPrice,tooltipText:p("checkout-page:subtotalTooltip")}),!!(null===(t=d.shippingLines)||void 0===t?void 0:t.length)&&o.createElement(y,{label:p("checkout-page:cartShippingTitle"),value:d.shippingTotal?d.formattedShippingTotal:p("checkout-page:free")}),!!a.installmentExtraPrice&&o.createElement(y,{label:p("checkout-page:cartInterest"),value:u(a.installmentExtraPrice,d.currencyCode,d.currencySymbol)}),o.createElement(S,{vm:a}),o.createElement(T,{vm:a}),(a.step===r.SUCCESS&&(!!a.checkout.note||!!a.checkout.appliedCouponCode)||a.step!==r.SUCCESS)&&o.createElement("div",{className:f.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(b,{vm:a,isAddingCoupon:V,setAddingCoupon:M,setCouponError:_,setCouponErrorCode:w}),o.createElement(O,{vm:a,isAddingNote:F,setAddingNote:X})),o.createElement("div",{className:f.TotalContainer},o.createElement("div",{className:f.TitleContainer},o.createElement("div",{className:f.Title},p("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:f.TotalPricesContainer},o.createElement("div",{className:f.TotalPrice},u(a.finalPrice||0,d.currencyCode,d.currencySymbol)),!!d.$totalTax&&!!(null===(n=a.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement("div",{className:[f.TotalTax].join(" ")},p("checkout-page:cartTaxTitle")+" "+d.$formattedTotalTax)))),o.createElement("div",{className:f.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(k,null))))))):null})),y=n((function(e){var t=e.label,n=e.value,a=e.tooltipText;return o.createElement("div",{className:f.InfoRow},o.createElement("div",{className:f.Label},o.createElement("span",null,t),!!a&&o.createElement(E,{text:a,style:{marginLeft:"8px"}})),o.createElement("div",{className:f.Value},n))})),S=n((function(e){var t=e.vm,n=s().t;return t.checkout?o.createElement(o.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").map((function(e,a){return o.createElement("div",{className:f.InfoRow,key:a},o.createElement("div",{className:f.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,u(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),T=n((function(e){var t,n,a=e.vm,c=s().t;return a.checkout?o.createElement(o.Fragment,null,a.step!==r.SUCCESS&&((null===(t=a.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(a.checkout.totalFinalPrice||0,a.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},e.name),o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,u(e.amount,a.checkout.currencyCode,a.checkout.currencySymbol))))})),null===(n=a.checkout.giftPackageLines)||void 0===n?void 0:n.map((function(e,t){return o.createElement("div",{className:f.InfoRow,key:t},o.createElement("div",{className:f.Label},o.createElement("div",{className:f.GiftLabel},o.createElement(h,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,c("checkout-page:giftPackage")))),o.createElement("div",{className:f.Value},o.createElement("span",null,u(e.price,a.checkout.currencyCode,a.checkout.currencySymbol))))}))):null})),b=n((function(n){var a=n.vm,l=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,d=n.setCouponErrorCode,p=s().t,E=o.useState(""),C=E[0],h=E[1],k=o.useState(!1),N=k[0],g=k[1],y=o.useRef(null);o.useEffect((function(){l&&y.current&&y.current.focus()}),[l]);if(a.step===r.SUCCESS&&!a.checkout.appliedCouponCode)return null;var S=a.checkout.couponAdjustment;return o.createElement("div",{className:f.InfoRow},!a.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.ActionTextBtn,onClick:function(){return i(!0)}},p("checkout-page:addCouponCode")),l&&o.createElement(c,{value:C,placeholder:p("checkout-page:couponCode"),buttonLabel:p("checkout-page:actions.apply"),inputRef:y,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=C,g(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),g(!1),h(""),a.checkout.appliedCouponCode&&!a.couponError?(i(!1),m(!1),d(null)):(a.checkout.couponCode=null,m(!0),d(a.couponError)),[2]}}))}))},isLoading:N,onChange:h}),!!a.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:[f.ActionTextBtn,f.NoUnderline,f.Light].join(" ")},p("checkout-page:couponCode"),o.createElement("span",{className:f.AppliedCoupon},o.createElement("span",{className:f.CouponCode},a.checkout.appliedCouponCode),a.step!==r.SUCCESS&&o.createElement("span",{className:f.ClearCoupon,onClick:function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,g(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),g(!1),[2]}}))}))}},o.createElement(v,null)))),!!a.checkout.appliedCouponCode&&!l&&o.createElement("div",{className:f.Value},o.createElement("span",null,"DECREMENT"===(null==S?void 0:S.type)?"- ":"")," ",o.createElement("span",null,u((null==S?void 0:S.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol))))})),O=n((function(e){var t=e.vm,n=e.isAddingNote,a=e.setAddingNote,c=s().t,l=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){a(!0)}),[]),u=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:f.InfoRow},!n&&!m&&o.createElement("div",{className:f.ActionTextBtn,onClick:i},l),(n||m)&&o.createElement("div",{className:[f.CheckoutNoteContainer,m?f.Success:""].join(" ")},o.createElement("div",{className:f.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:f.CheckoutNoteDisplay},t.checkout.note):o.createElement(d,{style:{width:"100%"},type:p.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:u})))}));export{g as CartSummary,N as CouponErrorCode};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as n}from"mobx-react-lite";import a from"lodash/sortBy";import c from"../input-with-button/index.js";import l from"../notification-box/index.js";import{CheckoutStep as r}from"../../model.js";import{IkasStorefrontConfig as i}from"@ikas/storefront-config";import{formatCurrency as u}from"../../../../utils/currency.js";import{useTranslation as s}from"../../../../utils/i18n.js";import{CartItem as m}from"./cart-item/index.js";import{FormItem as p}from"../form-item/index.js";import{FormItemType as d}from"../form-item/model.js";import E from"../tooltip/index.js";import C from"../svg/arrow-down.js";import h from"../svg/cross.js";import v from"../svg/gift.js";import f from"../../styles/common.module.scss.js";import g from"./style.module.scss.js";import k from"../svg/ikas.js";import{Button as N}from"../button/index.js";var y;!function(e){e.COUPON_CODE_NOT_EXIST="COUPON_CODE_NOT_EXIST",e.COUPON_CODE_NOT_EXIST_FOR_GUESS="COUPON_CODE_NOT_EXIST_FOR_GUESS"}(y||(y={}));var S=n((function(e){var t,n,a=e.vm,c=e.allowExpand,p=a.checkout,d=s().t,E=o.useState(!c),h=E[0],v=E[1],f=o.useState(!1),N=f[0],S=f[1],P=o.useState(null),_=P[0],I=P[1],A=o.useState(0),w=A[0],R=A[1],D=o.useState(null),U=D[0],B=D[1],L=o.useState(!1),F=L[0],M=L[1],V=o.useState(!1),X=V[0],G=V[1],q=o.useState(!1),H=q[0],z=q[1];o.useEffect((function(){c&&(h?U&&R(U.getBoundingClientRect().height):R(0))}),[h,U,c,F,X,N,H]);var $=o.useMemo((function(){switch(_){case y.COUPON_CODE_NOT_EXIST:return d("checkout-page:giftCodeErrorDescription");case y.COUPON_CODE_NOT_EXIST_FOR_GUESS:return d("checkout-page:mustBeSignInToApplyCampaign");default:return""}}),[_]),Q=[g.CartSummary,c?g.HideOnDesktop:""].join(" "),J=c?{height:w+"px"}:void 0,K=[g.ArrowDown,h?g.Rotated:""].join(" ");return p?o.createElement(o.Fragment,null,!!c&&o.createElement(o.Fragment,null,o.createElement("div",{id:"checkout-mobile-summary-header"}),o.createElement("div",{className:g.ExpandHeader,onClick:function(){if(!h){var e=document.getElementById("Checkout"),t=document.getElementById("checkout-mobile-summary-header");e&&t&&e.scrollTo({top:t.offsetTop,behavior:"smooth"})}v(!h)}},o.createElement("div",{className:g.Left},d("checkout-page:summary")),o.createElement("div",{className:g.Price},o.createElement("span",{className:g.PriceText},"".concat(u(a.finalPrice||0,p.currencyCode,p.currencySymbol)," (").concat(p.itemQuantity," ").concat(d("checkout-page:cartItemProduct"),")")),o.createElement("span",{className:K},o.createElement(C,null))))),o.createElement("div",{className:Q},o.createElement("div",{className:g.DetailsContainer,style:J},o.createElement("div",{className:g.Details,ref:B},o.createElement("div",{className:g.ItemsContainer},p.items.map((function(e,t){return o.createElement(m,{key:t,vm:a,cartItem:e,currencyCode:p.currencyCode,onChange:z})}))),o.createElement("div",{className:g.Divider}),o.createElement("div",{className:g.SubTotalInfo},N&&o.createElement("div",{className:g.NotificationContainer},o.createElement(l,{type:"warning",title:d("checkout-page:giftCodeErrorTitle"),content:$,onClose:function(){S(!1),I(null)}})),o.createElement(T,{label:d("checkout-page:subtotal"),value:p.formattedTotalPrice,tooltipText:d("checkout-page:subtotalTooltip"),hideMarginBottom:!a.isCouponCodeVisible}),!!(null===(t=p.shippingLines)||void 0===t?void 0:t.length)&&o.createElement(T,{label:d("checkout-page:cartShippingTitle"),value:p.shippingTotal?p.formattedShippingTotal:d("checkout-page:free")}),!!a.installmentExtraPrice&&o.createElement(T,{label:d("checkout-page:cartInterest"),value:u(a.installmentExtraPrice,p.currencyCode,p.currencySymbol)}),o.createElement(b,{vm:a}),o.createElement(x,{vm:a}),(a.step===r.SUCCESS&&(!!a.checkout.note||!!a.checkout.appliedCouponCode)||a.step!==r.SUCCESS)&&a.isCouponCodeVisible&&o.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement(O,{vm:a,isAddingCoupon:X,setAddingCoupon:G,setCouponError:S,setCouponErrorCode:I}),o.createElement(j,{vm:a,isAddingNote:F,setAddingNote:M})),o.createElement("div",{className:g.TotalContainer},o.createElement("div",{className:g.TitleContainer},o.createElement("div",{className:g.Title},d("checkout-page:total"))),o.createElement("div",null,o.createElement("div",{className:g.TotalPricesContainer},o.createElement("div",{className:g.TotalPrice},u(a.finalPrice||0,p.currencyCode,p.currencySymbol)),!!p.$totalTax&&!!(null===(n=a.customizationProps)||void 0===n?void 0:n.showTax)&&o.createElement("div",{className:[g.TotalTax].join(" ")},d("checkout-page:cartTaxTitle")+" "+p.$formattedTotalTax)))),o.createElement("div",{className:g.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===i.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(k,null))))))):null})),T=n((function(e){var t=e.label,n=e.value,a=e.tooltipText,c=e.hideMarginBottom;return o.createElement("div",{className:[g.InfoRow,c?g.hideMb:""].join(" ")},o.createElement("div",{className:g.Label},o.createElement("span",null,t),!!a&&o.createElement(E,{text:a,style:{marginLeft:"8px"}})),o.createElement("div",{className:g.Value},n))})),b=n((function(e){var t=e.vm,n=s().t;return t.checkout?o.createElement(o.Fragment,null,a(t.checkout.nonCouponAdjustments||[],"order").map((function(e,a){return o.createElement("div",{className:g.InfoRow,key:a},o.createElement("div",{className:g.Label},"INTEREST"===e.name?n("checkout-page:cartInterest"):e.name),o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,u(e.amount,t.checkout.currencyCode,t.checkout.currencySymbol))))}))):null})),x=n((function(e){var t,n,a=e.vm,c=s().t;return a.checkout?o.createElement(o.Fragment,null,a.step!==r.SUCCESS&&((null===(t=a.checkout.selectedPaymentGateway)||void 0===t?void 0:t.getCalculatedAdditionalPrices(a.checkout.totalFinalPrice||0,a.checkout.shippingLines||null))||[]).filter((function(e){return 0!==e.amount})).map((function(e,t){return o.createElement("div",{className:g.InfoRow,key:t},o.createElement("div",{className:g.Label},e.name),o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===e.type?"- ":"")," ",o.createElement("span",null,u(e.amount,a.checkout.currencyCode,a.checkout.currencySymbol))))})),null===(n=a.checkout.giftPackageLines)||void 0===n?void 0:n.map((function(e,t){return o.createElement("div",{className:g.InfoRow,key:t},o.createElement("div",{className:g.Label},o.createElement("div",{className:g.GiftLabel},o.createElement(v,{style:{position:"relative",top:"-1px"}}),o.createElement("span",null,c("checkout-page:giftPackage")))),o.createElement("div",{className:g.Value},o.createElement("span",null,u(e.price,a.checkout.currencyCode,a.checkout.currencySymbol))))}))):null})),O=n((function(n){var a=n.vm,l=n.isAddingCoupon,i=n.setAddingCoupon,m=n.setCouponError,E=n.setCouponErrorCode,C=n.isOpenCouponCode,v=s().t,k=o.useState(""),y=k[0],S=k[1],T=o.useState(!1),b=T[0],x=T[1],O=o.useRef(null);o.useEffect((function(){l&&O.current&&O.current.focus()}),[l]);var j=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=y,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),x(!1),S(""),!a.checkout.appliedCouponCode||a.couponError?[3,3]:(i(!1),m(!1),E(null),[4,a.reInitPaymentMethod()]);case 2:return e.sent(),[3,4];case 3:a.checkout.couponCode=null,m(!0),E(a.couponError),e.label=4;case 4:return[2]}}))}))},P=function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return a.checkout.couponCode=null,x(!0),[4,a.onCouponCodeApply()];case 1:return e.sent(),[4,a.reInitPaymentMethod()];case 2:return e.sent(),x(!1),[2]}}))}))},_=a.step===r.SUCCESS,I=a.step===r.SHIPPING;if(_&&!a.checkout.appliedCouponCode)return null;var A=a.checkout.couponAdjustment,w=!(!a.checkout.appliedCouponCode||l),R=!!a.checkout.appliedCouponCode&&C;return o.createElement(o.Fragment,null,!!C&&o.createElement(o.Fragment,null,o.createElement("div",{className:[g.CartSummary,g.OpenCouponCodeSummary].join(" ")},o.createElement("div",{className:f.FormSectionTitle},o.createElement("div",{style:{paddingBottom:R?0:6},className:f.Title},v("checkout-page:couponCode")),R&&o.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},o.createElement("span",{className:[g.AppliedCoupon,g.AppliedCouponBgGray].join(" ")},o.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),!_&&o.createElement("span",{className:g.ClearCoupon,onClick:P},o.createElement(h,null))))))),w&&!I&&!a.isCouponCodeRequirementDefult&&o.createElement("div",{className:g.Divider,style:{marginTop:"24px",marginBottom:"24px"}}),o.createElement("div",{className:g.InfoRow},!a.checkout.appliedCouponCode&&!l&&a.isCouponCodeVisible&&o.createElement("div",{className:g.ActionTextBtn,onClick:function(){return i(!0)}},v("checkout-page:addCouponCode")),l&&!C&&o.createElement(c,{value:y,placeholder:v("checkout-page:couponCode"),buttonLabel:v("checkout-page:actions.apply"),inputRef:O,onClick:j,isLoading:b,onChange:S}),C&&!R&&o.createElement("div",{className:g.OpenCouponCodeMain},o.createElement(p,{label:v("checkout-page:couponCode"),type:d.TEXT,value:y,onChange:S}),o.createElement(N,{style:{width:"33%"},text:v("checkout-page:actions.apply"),isLoading:b,onClick:j})),w&&o.createElement("div",{className:[g.ActionTextBtn,g.NoUnderline,g.Light].join(" ")},v("checkout-page:couponCode"),o.createElement("span",{className:[g.AppliedCoupon,a.isCouponCodeRequirementDefult?"":g.NotClosed].join(" ")},o.createElement("span",{className:g.CouponCode},a.checkout.appliedCouponCode),a.step!==r.SUCCESS&&a.isCouponCodeRequirementDefult&&o.createElement("span",{className:g.ClearCoupon,onClick:P},o.createElement(h,null)))),w&&o.createElement("div",{className:g.Value},o.createElement("span",null,"DECREMENT"===(null==A?void 0:A.type)?"- ":"")," ",o.createElement("span",null,u((null==A?void 0:A.amount)||0,a.checkout.currencyCode,a.checkout.currencySymbol)))))})),j=n((function(e){var t=e.vm,n=e.isAddingNote,a=e.setAddingNote,c=s().t,l=o.useState(t.checkout.note?c("checkout-page:editOrderNote"):c("checkout-page:addOrderNote"))[0],i=o.useCallback((function(){a(!0)}),[]),u=o.useCallback((function(e){t.checkout.note=e}),[t,t.checkout]);if(!t.checkoutSettings.showCheckoutNote)return null;var m=t.step===r.SUCCESS;return m&&!t.checkout.note?null:o.createElement("div",{className:g.InfoRow},!n&&!m&&o.createElement("div",{className:g.ActionTextBtn,onClick:i},l),(n||m)&&o.createElement("div",{className:[g.CheckoutNoteContainer,m?g.Success:""].join(" ")},o.createElement("div",{className:g.Title},c("checkout-page:orderNote")),m?o.createElement("div",{className:g.CheckoutNoteDisplay},t.checkout.note):o.createElement(p,{style:{width:"100%"},type:d.TEXT_AREA,disableResize:!0,label:"",value:t.checkout.note||"",onChange:u})))}));export{S as CartSummary,O as Coupon,y as CouponErrorCode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 320px;\n overflow-y: auto;\n padding-top: 10px;\n margin-bottom: 24px;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 10px 10px #E3E7EF;\n border: solid 3px transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 10px 10px #000000;\n border: solid 3px transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}");export{t as default};
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={ExpandHeader:"style-module_ExpandHeader__LQwWm",Left:"style-module_Left__-N12h",Price:"style-module_Price__OT1Wh",PriceText:"style-module_PriceText__bq1pk",ArrowDown:"style-module_ArrowDown__YhRny",Rotated:"style-module_Rotated__ZPfId",CartSummary:"style-module_CartSummary__m77tn",OpenCouponCodeSummary:"style-module_OpenCouponCodeSummary__ua9wx",HideOnDesktop:"style-module_HideOnDesktop__Vs5AV",ItemsContainer:"style-module_ItemsContainer__QFKQV",DetailsContainer:"style-module_DetailsContainer__PK33m",Details:"style-module_Details__hWJ9o",Divider:"style-module_Divider__MNDti",ActionTextBtn:"style-module_ActionTextBtn__7yua4",NoUnderline:"style-module_NoUnderline__FphKn",Light:"style-module_Light__dIcW-",SubTotalInfo:"style-module_SubTotalInfo__JMqK9",InfoRow:"style-module_InfoRow__oAvZS",hideMb:"style-module_hideMb__j7VBr",Label:"style-module_Label__28Bij",Value:"style-module_Value__7rELF",TotalContainer:"style-module_TotalContainer__sGR7d",TitleContainer:"style-module_TitleContainer__LgmJI",Title:"style-module_Title__oMVSD",TotalPricesContainer:"style-module_TotalPricesContainer__-PsOD",TotalPrice:"style-module_TotalPrice__QBdM1",TotalTax:"style-module_TotalTax__9pA4Y",AppliedCoupon:"style-module_AppliedCoupon__UNo1h",AppliedCouponBgGray:"style-module_AppliedCouponBgGray__MYoYu",NotClosed:"style-module_NotClosed__E-N9z",CouponCode:"style-module_CouponCode__UKPmf",ClearCoupon:"style-module_ClearCoupon__CBAzl",NotificationContainer:"style-module_NotificationContainer__AXfJT",CheckoutNoteContainer:"style-module_CheckoutNoteContainer__d-z4m",CheckoutNoteDisplay:"style-module_CheckoutNoteDisplay__DtnXo",Success:"style-module_Success__VI2Bw",GiftLabel:"style-module_GiftLabel__cazrS",PoweredBy:"style-module_PoweredBy__DKBJF",OpenCouponCodeMain:"style-module_OpenCouponCodeMain__lZtb3"};e(".style-module_ExpandHeader__LQwWm {\n position: sticky;\n top: 0;\n z-index: 10;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n padding: 0 24px;\n width: 100%;\n border-top: 1px solid var(--checkout-border-color);\n border-bottom: 1px solid var(--checkout-border-color);\n transition: border-bottom 0.3s;\n user-select: none;\n background-color: var(--checkout-primary-bg-color);\n}\n@media only screen and (min-width: 1000px) {\n .style-module_ExpandHeader__LQwWm {\n display: none;\n }\n}\n.style-module_ExpandHeader__LQwWm .style-module_Left__-N12h {\n display: flex;\n align-items: center;\n font-size: 16px;\n font-weight: 600;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh {\n font-weight: 600;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_PriceText__bq1pk {\n font-weight: 600;\n margin-right: 8px;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny {\n transition: all 0.3s;\n display: flex;\n align-items: center;\n}\n.style-module_ExpandHeader__LQwWm .style-module_Price__OT1Wh .style-module_ArrowDown__YhRny.style-module_Rotated__ZPfId {\n transform: rotate(-180deg);\n}\n\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn {\n width: 100%;\n background-color: var(--checkout-card-bg-color);\n }\n .style-module_CartSummary__m77tn.style-module_OpenCouponCodeSummary__ua9wx {\n background-color: #fff;\n }\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CartSummary__m77tn.style-module_HideOnDesktop__Vs5AV {\n display: none;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: 320px;\n overflow-y: auto;\n padding-top: 10px;\n margin-bottom: 24px;\n scrollbar-gutter: stable;\n /* Track */\n /* Handle */\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV {\n max-height: unset;\n }\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar {\n width: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-track {\n box-shadow: inset 0 0 10px 10px #E3E7EF;\n border: solid 3px transparent;\n}\n.style-module_CartSummary__m77tn .style-module_ItemsContainer__QFKQV::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 10px 10px #000000;\n border: solid 3px transparent;\n}\n.style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n overflow: hidden;\n width: 100%;\n transition: height 0.3s ease-in-out;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_DetailsContainer__PK33m {\n padding: 0 24px;\n box-shadow: 1px 2px 5px 0px rgba(0, 0, 0, 0.2);\n }\n}\n.style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n overflow: hidden;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_Details__hWJ9o {\n padding-top: 24px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_Divider__MNDti {\n width: 100%;\n height: 1px;\n margin: auto;\n background-color: var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4 {\n color: var(--checkout-primary-text-color);\n user-select: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4:hover {\n text-decoration: underline;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_NoUnderline__FphKn:hover {\n text-decoration: none;\n}\n.style-module_CartSummary__m77tn .style-module_ActionTextBtn__7yua4.style-module_Light__dIcW- {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 {\n padding: 24px 0;\n border-bottom: 1px solid var(--checkout-border-color);\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS.style-module_hideMb__j7VBr {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Label__28Bij {\n color: var(--checkout-secondary-text-color);\n display: flex;\n align-items: center;\n flex: 1 1 auto;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS .style-module_Value__7rELF {\n flex: 0 0 auto;\n padding-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_SubTotalInfo__JMqK9 .style-module_InfoRow__oAvZS:last-of-type {\n margin-bottom: 0;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n display: flex;\n justify-content: space-between;\n margin-top: 12px;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TitleContainer__LgmJI .style-module_Title__oMVSD {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPricesContainer__-PsOD {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalPrice__QBdM1 {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d .style-module_TotalTax__9pA4Y {\n font-size: 14px;\n line-height: 24px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_TotalContainer__sGR7d {\n height: 64px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h {\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 8px;\n background-color: white;\n border-radius: 6px;\n margin-left: 12px;\n font-size: 14px;\n line-height: 20px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_AppliedCouponBgGray__MYoYu {\n background-color: var(--checkout-secondary-bg-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h.style-module_NotClosed__E-N9z {\n padding: 4px 4px 4px 4px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_CouponCode__UKPmf {\n font-size: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl {\n cursor: pointer;\n display: flex;\n align-items: center;\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_AppliedCoupon__UNo1h .style-module_ClearCoupon__CBAzl svg {\n transform: scale(0.8);\n}\n.style-module_CartSummary__m77tn .style-module_NotificationContainer__AXfJT {\n margin-bottom: 14px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 24px;\n width: calc(100% - 2px);\n margin-left: 1px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_Title__oMVSD {\n font-size: 16px;\n color: var(--checkout-primary-text-color);\n margin-bottom: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m .style-module_CheckoutNoteDisplay__DtnXo {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m.style-module_Success__VI2Bw {\n margin-top: 0;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_CheckoutNoteContainer__d-z4m {\n margin-top: 0px;\n }\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS {\n display: flex;\n align-items: center;\n}\n.style-module_CartSummary__m77tn .style-module_GiftLabel__cazrS span {\n margin-left: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n width: 100%;\n height: 50px;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF {\n display: flex;\n }\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CartSummary__m77tn .style-module_PoweredBy__DKBJF a {\n display: flex;\n align-items: center;\n}\n\n.style-module_OpenCouponCodeMain__lZtb3 {\n display: flex;\n}\n.style-module_OpenCouponCodeMain__lZtb3 input {\n width: calc(100% - 12px);\n}");export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";var t=function(){function t(t){void 0===t&&(t={});var r=this;this.installmentCount=1,this.toInput=function(){var e=r.expirationDate.split(" / "),t=parseInt(e[0]),i=parseInt(e[1]);return{cardNumber:r.cardNumber.split(" ").join(""),cardHolderName:r.cardHolderName,cvv:r.cvv,expiredMonth:t,expiredYear:i,installmentCount:r.installmentCount,threeDSecure:r.threeDSecure}},this.cardNumber=t.cardNumber||"",this.cardHolderName=t.cardHolderName||"",this.expirationDate=t.expirationDate||"",this.cvv=t.cvv||"",this.installmentCount=t.installmentCount||1,this.threeDSecure=t.threeDSecure||!1,e(this)}return Object.defineProperty(t.prototype,"validationResult",{get:function(){return{cardNumber:!!this.cardNumber&&19===this.cardNumber.length,cardHolderName:!!this.cardHolderName,expirationDate:!!this.expirationDate&&7===this.expirationDate.length,cvv:!!this.cvv}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return Object.values(this.validationResult).every((function(e){return e}))},enumerable:!1,configurable:!0}),t}();export{t as default};
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";var t=function(){function t(t){void 0===t&&(t={});var r=this;this.installmentCount=1,this.toInput=function(){var e=r.expirationDate.split(" / "),t=parseInt(e[0]),i=parseInt(e[1]);return{cardNumber:r.cardNumber.split(" ").join(""),cardHolderName:r.cardHolderName,cvv:r.cvv,expiredMonth:t,expiredYear:i,installmentCount:r.installmentCount,threeDSecure:r.threeDSecure}},this.cardNumber=t.cardNumber||"",this.cardHolderName=t.cardHolderName||"",this.expirationDate=t.expirationDate||"",this.cvv=t.cvv||"",this.installmentCount=t.installmentCount||1,this.threeDSecure=t.threeDSecure||!1,e(this)}return Object.defineProperty(t.prototype,"validationResult",{get:function(){return{cardNumber:!!this.cardNumber&&(19===this.cardNumber.length||17===this.cardNumber.length),cardHolderName:!!this.cardHolderName,expirationDate:!!this.expirationDate&&7===this.expirationDate.length,cvv:!!this.cvv}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return Object.values(this.validationResult).every((function(e){return e}))},enumerable:!1,configurable:!0}),t}();export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{observer as t}from"mobx-react-lite";import s from"../../style.module.scss.js";import r from"../select-box/index.js";import{AddressForm as d}from"../address-form/index.js";import{Checkbox as
|
|
1
|
+
import*as e from"react";import{observer as t}from"mobx-react-lite";import s from"../../style.module.scss.js";import r from"../select-box/index.js";import{AddressForm as d}from"../address-form/index.js";import{Checkbox as a}from"../checkbox/index.js";import{FormItem as i}from"../form-item/index.js";import{FormItemType as o}from"../form-item/model.js";import n from"./style.module.scss.js";import l from"../../styles/common.module.scss.js";import{Button as c}from"../button/index.js";import{IkasStorefrontConfig as m}from"@ikas/storefront-config";import{useTranslation as u}from"../../../../utils/i18n.js";import v from"../delivery-methods/index.js";import{CheckoutStep as p}from"../../model.js";var E=t((function(t){var d,a=t.vm,i=u().t,o=e.useMemo((function(){return e.createElement("div",null,e.createElement(g,{vm:a}),e.createElement(k,{vm:a}))}),[a]),E=e.useMemo((function(){return e.createElement("div",null,e.createElement(h,{vm:a}))}),[a]),C=e.useState("-1"),f=C[0],A=C[1];e.useEffect((function(){a.vm.checkout.stockLocationId&&A(a.vm.checkout.stockLocationId)}),[]);var y=function(e){if(!e.address)return"";var t=[];return e.address.address&&t.push(e.address.address),e.address.postalCode&&t.push(e.address.postalCode),e.address.district&&e.address.district.name&&t.push(e.address.district.name),e.address.city&&e.address.city.name&&t.push(e.address.city.name),e.address.state&&e.address.state.name&&"Default"!==e.address.state.name&&t.push(e.address.state.name),e.address.country&&e.address.country.name&&t.push(e.address.country.name),t.join(", ")};return e.createElement(e.Fragment,null,!!m.getPickupStockLocationIds()&&!a.vm.isDigitalOnly&&a.vm.availableStockLocations.length>0&&a.vm.step!==p.PAYMENT&&e.createElement(e.Fragment,null,e.createElement("div",{className:l.FormSectionTitle},e.createElement("div",{className:l.Title},i("checkout-page:deliveryMethod"))),e.createElement(v,{deliveryMethod:a.vm.deliveryMethod,onClick:function(e){"address"===e&&A("-1"),a.vm.onDeliveryMethodChange(e)}})),e.createElement("div",{className:l.FormSectionTitle},"address"===a.vm.deliveryMethod?e.createElement("div",{className:l.Title},a.editingCustomerAddress?i("checkout-page:editAddress"):"billing"===a.addressType?i("checkout-page:billingAddress"):i("checkout-page:shippingAddress")):a.vm.step===p.PAYMENT?e.createElement("div",{className:l.Title},i("checkout-page:billingAddress")):e.createElement("div",{className:l.Title},i("checkout-page:pickUpLocation"),e.createElement("span",{className:n.ErrorMessage},a.vm.isErrorsVisible&&!a.vm.checkout.stockLocationId&&i("checkout-page:errorPickupLocationRequired"))),!!a.editingCustomerAddress&&e.createElement("div",{className:n.CancelEdit,onClick:a.onCancelEditAddressClick},i("checkout-page:actions.cancel"))),!!a.vm.store.customerStore.customer&&!a.editingCustomerAddress&&("address"===a.vm.deliveryMethod||a.vm.step===p.PAYMENT&&"in-store"===a.vm.deliveryMethod)&&e.createElement("div",{className:s.RowPB},null===(d=a.vm.customerAddresses)||void 0===d?void 0:d.map((function(t){return e.createElement(r,{key:t.id,label:t.title||"",isSelected:t.id===a.selectedAddressId,rightContent:e.createElement("div",{onClick:function(){return a.onEditAddressClick(t)}},i("checkout-page:actions.edit")),bottomContent:e.createElement("div",{className:n.AddressContent},e.createElement("div",{className:n.AddressText},t.firstName," ",t.lastName),e.createElement("div",{className:n.AddressText},t.addressText)),bottomContentVisible:!0,hasError:!t.isValidAddress,errorText:i("checkout-page:missingAddressFields"),onClick:function(){return t.id!==a.selectedAddressId&&a.onAddressSelect(t)}})})),e.createElement(r,{label:i("checkout-page:newAddress"),isSelected:"-1"===a.selectedAddressId,bottomContent:o,onClick:function(){return"-1"!==a.selectedAddressId&&a.onAddressSelect()}})),a.vm.store.customerStore.customer||a.vm.step!==p.INFO||"address"!==a.vm.deliveryMethod?a.vm.step===p.PAYMENT&&!a.vm.store.customerStore.customer&&o:o,"in-store"===a.vm.deliveryMethod&&e.createElement("div",{className:s.RowPB},a.vm.stockLocations.map((function(t){return function(e){return e.address&&e.address.address&&e.address.city&&e.address.country&&a.vm.availableStockLocations.find((function(t){return t.id===e.id}))}(t)&&e.createElement(r,{key:t.id,label:t.name||"",isSelected:f===t.id,bottomContent:e.createElement("div",null,e.createElement("div",{className:n.AddressText},y(t)),t.deliveryTime&&e.createElement("div",{className:n.DeliveryTime},i("checkout-page:stockLocation.deliveryTime.".concat(t.deliveryTime)))),bottomContentVisible:!0,onClick:function(){a.vm.onStockLocationChange(t),A(t.id)}})}))),"in-store"===a.vm.deliveryMethod&&a.vm.step!==p.PAYMENT&&e.createElement(e.Fragment,null,e.createElement("div",{className:l.FormSectionTitle},e.createElement("div",{className:l.Title},i("checkout-page:recipientsInfo"))),E),!!a.editingCustomerAddress&&e.createElement(g,{vm:a}),!!a.editingCustomerAddress&&e.createElement("div",{className:n.EditAddressActions},e.createElement(c,{style:{width:"100%"},text:i("checkout-page:deleteAddress"),isLine:!0,isLoading:a.isDeleteAddressLoading,isDisabled:a.isEditAddressLoading,onClick:a.onDeleteAddressClick}),e.createElement(c,{style:{width:"100%",marginTop:a.vm.store.customerStore.customer?"0px":"32px"},text:i("checkout-page:actions.save"),isLoading:a.isEditAddressLoading,isDisabled:a.isDeleteAddressLoading,onClick:a.onSaveAddressClick})))})),g=t((function(t){var s=t.vm;return e.createElement(d,{address:s.editingCustomerAddress||s.address,isErrorsVisible:s.isEditAddressErrorsVisible||s.vm.isErrorsVisible,allowedCountryIds:s.vm.shippingCountryIds||void 0,allowCorporateInfo:"billing"===s.addressType,firstNameChangeCallback:s.firstNameChangeCallback,lastNameChangeCallback:s.lastNameChangeCallback,allowTitleChange:!!s.editingCustomerAddress,deliveryMethod:"address"})})),h=t((function(t){var s=t.vm;return e.createElement(d,{address:s.editingCustomerAddress||s.address,isErrorsVisible:s.isEditAddressErrorsVisible||s.vm.isErrorsVisible,firstNameChangeCallback:s.firstNameChangeCallback,lastNameChangeCallback:s.lastNameChangeCallback,deliveryMethod:"in-store"})})),k=t((function(t){var s=t.vm,r=u().t;return s.vm.store.customerStore.customer&&"-1"===s.selectedAddressId?e.createElement("div",{style:{marginTop:"12px"}},e.createElement(a,{value:s.vm.shouldSaveAddress,label:r("checkout-page:saveAddressCta"),onChange:s.vm.setShouldSaveAddress}),s.vm.shouldSaveAddress&&e.createElement("div",{style:{marginTop:"8px"}},e.createElement(i,{type:o.TEXT,label:r("checkout-page:addressTitle"),value:s.vm.addressTitle,onChange:s.vm.setAddressTitle}))):null}));export{g as CustomerAddressForm,h as RecipientForm,k as SaveAddressCheckboxAndTitle,E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import i from"lodash/cloneDeep";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import i from"lodash/cloneDeep";import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import"../../../../models/data/customer/address/region/index.js";import{IkasCustomerAddress as d}from"../../../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as o}from"../../../../models/data/customer/address/ikas-localized-customer-address.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/region/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/transaction/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/campaign-offer/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/stock-location/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/shipping-zone/state/city/district/region/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/component/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/ikas-address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";var r=function(){function r(r,a){var m=this;this.editingCustomerAddress=null,this.isDeleteAddressLoading=!1,this.isEditAddressLoading=!1,this.isEditAddressErrorsVisible=!1,this.onAddressSelect=function(e){("shipping"===m.addressType?m.vm.onSelectedShippingAddressIdChange:m.vm.onSelectedBillingAddressIdChange)((null==e?void 0:e.id)||"-1")},this.onEditAddressClick=function(e){var t=new o(i(e));t.countrySettings=m.vm.countrySettings,t.checkoutSettings=m.vm.checkoutSettings,m.editingCustomerAddress=t},this.onCancelEditAddressClick=function(){m.isDeleteAddressLoading||m.isEditAddressLoading||(m.editingCustomerAddress=null)},this.onDeleteAddressClick=function(){return e(m,void 0,void 0,(function(){var e,s,d,o,r,a=this;return t(this,(function(t){switch(t.label){case 0:if(-1===(e=null===(o=null===(d=this.vm.store.customerStore.customer)||void 0===d?void 0:d.addresses)||void 0===o?void 0:o.findIndex((function(e){var t;return e.id===(null===(t=a.editingCustomerAddress)||void 0===t?void 0:t.id)})))||void 0===e)return[3,5];s=i(this.vm.store.customerStore.customer),null===(r=s.addresses)||void 0===r||r.splice(e,1),t.label=1;case 1:return t.trys.push([1,3,4,5]),this.isDeleteAddressLoading=!0,[4,this.vm.store.customerStore.saveCustomer(s)];case 2:return t.sent()&&(this.editingCustomerAddress=null),[3,5];case 3:return t.sent(),[3,5];case 4:return this.isDeleteAddressLoading=!1,[7];case 5:return[2]}}))}))},this.onSaveAddressClick=function(){return e(m,void 0,void 0,(function(){var e,s,o,r,a,m,n,l=this;return t(this,(function(t){switch(t.label){case 0:if(this.isDeleteAddressLoading||this.isEditAddressLoading)return[2];if(!(null===(o=this.editingCustomerAddress)||void 0===o?void 0:o.isValidAddress))return this.isEditAddressErrorsVisible=!0,[2];if(-1===(e=null===(a=null===(r=this.vm.store.customerStore.customer)||void 0===r?void 0:r.addresses)||void 0===a?void 0:a.findIndex((function(e){var t;return e.id===(null===(t=l.editingCustomerAddress)||void 0===t?void 0:t.id)})))||void 0===e)return[3,5];(s=i(this.vm.store.customerStore.customer)).addresses[e]=new d(i(this.editingCustomerAddress)),t.label=1;case 1:return t.trys.push([1,3,4,5]),this.isEditAddressLoading=!0,[4,this.vm.store.customerStore.saveCustomer(s)];case 2:return t.sent()&&(null===(n=null===(m=this.vm.store.customerStore.customer)||void 0===m?void 0:m.addresses)||void 0===n||n.forEach((function(e){return e.checkoutSettings=l.vm.checkoutSettings})),this.onAddressSelect(this.editingCustomerAddress),this.editingCustomerAddress=null,this.isEditAddressErrorsVisible=!1),[3,5];case 3:return t.sent(),[3,5];case 4:return this.isEditAddressLoading=!1,[7];case 5:return[2]}}))}))},this.firstNameChangeCallback=function(e){(!m.vm.checkout.hasCustomer&&"shipping"===m.addressType||m.vm.isDigitalOnly)&&(m.vm.checkout.customer.firstName=e)},this.lastNameChangeCallback=function(e){(!m.vm.checkout.hasCustomer&&"shipping"===m.addressType||m.vm.isDigitalOnly)&&(m.vm.checkout.customer.lastName=e)},this.vm=r,this.addressType=a,s(this)}return Object.defineProperty(r.prototype,"address",{get:function(){return"shipping"===this.addressType?this.vm.checkout.shippingAddress:this.vm.checkout.billingAddress},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selectedAddressId",{get:function(){return"shipping"===this.addressType?this.vm.selectedShippingAddressId:this.vm.selectedBillingAddressId},enumerable:!1,configurable:!0}),r}();export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={AddressText:"style-module_AddressText__Mx1zl",CancelEdit:"style-module_CancelEdit__E-Bcn",EditAddressActions:"style-module_EditAddressActions__S8--X",DeliveryTime:"style-module_DeliveryTime__ylmaT",ErrorMessage:"style-module_ErrorMessage__zjLxh",fadeInFromRight:"style-module_fadeInFromRight__G-1Fk"};e(".style-module_AddressText__Mx1zl {\n padding-left: 32px;\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_CancelEdit__E-Bcn {\n font-size: 16px;\n padding-bottom: 16px;\n cursor: pointer;\n user-select: none;\n}\n\n.style-module_EditAddressActions__S8--X {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 16px;\n margin-top: 16px;\n}\n\n.style-module_DeliveryTime__ylmaT {\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n margin-top: 8px;\n padding-left: 32px;\n}\n\n.style-module_ErrorMessage__zjLxh {\n display: flex;\n color: var(--checkout-error-color);\n font-size: 12px;\n animation-name: style-module_fadeInFromRight__G-1Fk;\n margin-top: -5px;\n animation-duration: 0.3s;\n}");export{n as default};
|
|
1
|
+
import e from'./../../../../ext/style-inject/dist/style-inject.es.js';var n={AddressContent:"style-module_AddressContent__dnfSP",AddressText:"style-module_AddressText__Mx1zl",CancelEdit:"style-module_CancelEdit__E-Bcn",EditAddressActions:"style-module_EditAddressActions__S8--X",DeliveryTime:"style-module_DeliveryTime__ylmaT",ErrorMessage:"style-module_ErrorMessage__zjLxh",fadeInFromRight:"style-module_fadeInFromRight__G-1Fk"};e(".style-module_AddressContent__dnfSP {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.style-module_AddressText__Mx1zl {\n padding-left: 32px;\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_CancelEdit__E-Bcn {\n font-size: 16px;\n padding-bottom: 16px;\n cursor: pointer;\n user-select: none;\n}\n\n.style-module_EditAddressActions__S8--X {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 16px;\n margin-top: 16px;\n}\n\n.style-module_DeliveryTime__ylmaT {\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-primary-text-color);\n margin-top: 8px;\n padding-left: 32px;\n}\n\n.style-module_ErrorMessage__zjLxh {\n display: flex;\n color: var(--checkout-error-color);\n font-size: 12px;\n animation-name: style-module_fadeInFromRight__G-1Fk;\n margin-top: -5px;\n animation-duration: 0.3s;\n}");export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import a from"./style.module.scss.js";import t from"../svg/epaykolay.js";var l=function(l){return e.createElement("div",{className:a.Container},e.createElement("div",{className:a.LeftContent},e.createElement("strong",null,"Bi' tıkla gerisi e-Pay Kolay!"),e.createElement("div",{className:a.Description},"Kart ve adres bilgilerini her defasında girmeden, birden fazla ödeme seçeneğiyle alışveriş kolaylığını e-Pay Kolay ile yaşayın.")),e.createElement("div",{className:a.RightContent},e.createElement("div",{className:a.EPayKolayButton,onClick:l.onClick},e.createElement("div",{className:a.Icon},e.createElement(t,null)),e.createElement("div",{className:a.ButtonText}," ile Al")),e.createElement("div",{className:a.EPayKolayDescription},"e-Pay Kolay bir Türkiye İş Bankası markasıdır.")))};export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var t={Container:"style-module_Container__oDKWq",LeftContent:"style-module_LeftContent__97sbP",Description:"style-module_Description__XDDJ8",RightContent:"style-module_RightContent__-jdoh",EPayKolayButton:"style-module_EPayKolayButton__c8OjL",Icon:"style-module_Icon__0t3CD",ButtonText:"style-module_ButtonText__G12-2",EPayKolayDescription:"style-module_EPayKolayDescription__xxQ58"};n(".style-module_Container__oDKWq {\n width: calc(100% - 50px);\n margin-left: 50px;\n padding: 20px 24px;\n background-color: rgb(237, 238, 240);\n border-radius: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_Container__oDKWq .style-module_LeftContent__97sbP {\n flex: 1 1 auto;\n}\n.style-module_Container__oDKWq .style-module_LeftContent__97sbP strong {\n font-size: 14px;\n color: #4c556c;\n font-weight: 700;\n margin-bottom: 2px;\n line-height: 20px;\n}\n.style-module_Container__oDKWq .style-module_LeftContent__97sbP .style-module_Description__XDDJ8 {\n font-size: 14px;\n color: #4c556c;\n line-height: 20px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh {\n width: 192px;\n flex: 0 0 auto;\n margin-left: 31px;\n position: relative;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL {\n height: 50px;\n width: 190px;\n display: flex;\n background-color: #013682;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.3s;\n padding: 13px 22px 13px 22px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL .style-module_Icon__0t3CD {\n margin-top: 2px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL .style-module_ButtonText__G12-2 {\n color: white;\n margin-left: 4.36px;\n font-weight: 600;\n font-size: 16px;\n line-height: 22.79px;\n}\n.style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayDescription__xxQ58 {\n color: #013682;\n font-size: 9.1px;\n margin-top: 4px;\n font-style: italic;\n letter-spacing: -0.02em;\n position: absolute;\n bottom: -19px;\n}\n@media only screen and (max-width: 1440px) {\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh {\n margin-left: 16px;\n }\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayButton__c8OjL .style-module_ButtonText__G12-2 {\n margin-top: 0px;\n }\n}\n@media only screen and (max-width: 1280px) {\n .style-module_Container__oDKWq {\n flex-direction: column;\n }\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh {\n margin-left: 0;\n margin-top: 12px;\n }\n .style-module_Container__oDKWq .style-module_RightContent__-jdoh .style-module_EPayKolayDescription__xxQ58 {\n position: static;\n }\n}\n@media only screen and (max-width: 1024px) {\n .style-module_Container__oDKWq {\n margin: 0 12px;\n margin-top: 20px;\n width: calc(100% - 24px);\n margin-bottom: 24px;\n }\n}");export{t as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import CheckoutViewModel from "../../../../../components/checkout/model";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
vm: CheckoutViewModel;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const CustomerAccountDisabledError: React.FC<Props>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as o from"react";import{observer as t}from"mobx-react-lite";import r from"../../notification-box/index.js";import"@ikas/storefront-config";import{useTranslation as e}from"../../../../../utils/i18n.js";var n=t((function(t){t.vm;var n=t.onClose,i=e().t;return o.createElement(r,{type:"warning",content:o.createElement("div",null,i("checkout-page:errorCustomerAccountDisabled")),onClose:n})}));export{n as CustomerAccountDisabledError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"react";import{observer as r}from"mobx-react-lite";import t from"../../notification-box/index.js";import"@ikas/storefront-config";import{useTranslation as e}from"../../../../../utils/i18n.js";var i=r((function(r){r.vm;var i=r.onClose,n=e().t;return o.createElement(t,{type:"warning",content:o.createElement("div",null,n("checkout-page:errorCustomerRequired")),onClose:i})}));export{i as CustomerLoginRequiredError};
|
|
1
|
+
import*as o from"react";import{observer as r}from"mobx-react-lite";import t from"../../notification-box/index.js";import"@ikas/storefront-config";import{useTranslation as e}from"../../../../../utils/i18n.js";var i=r((function(r){r.vm;var i=r.onClose,n=e().t;return o.createElement(t,{type:"warning",content:o.createElement("div",null,n("checkout-page:errorCustomerRequired")),onClose:i,scrollTop:!0})}));export{i as CustomerLoginRequiredError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"react";import{observer as r}from"mobx-react-lite";import{ErrorType as o}from"../../model.js";import{UnknownError as t}from"./unknown-error/index.js";import{PaymentError as n}from"./payment-error/index.js";import{NoShippingError as l}from"./no-shipping-error/index.js";import{CustomerLoginRequiredError as m}from"./customer-login-required-error/index.js";import{CustomerAccountDisabledError as a}from"./customer-account-disabled-error/index.js";var i=r((function(r){var i,s=r.vm,c=e.useRef(null),u=e.useCallback((function(){s.error=void 0}),[s]),R=null;switch(null===(i=s.error)||void 0===i?void 0:i.type){case o.PAYMENT_ERROR:R=e.createElement(n,{error:s.error,onClose:u});break;case o.NO_SHIPPING_ERROR:R=e.createElement(l,null);break;case o.CUSTOMER_LOGIN_REQUIRED_ERROR:R=e.createElement(m,{vm:s,onClose:u});break;case o.CUSTOMER_ACCOUNT_DISABLED_ERROR:R=e.createElement(a,{vm:s,onClose:u});break;case o.API_ERROR:case o.UNKNOWN:R=e.createElement(t,{error:s.error,onClose:u});break;default:R=null}return R?(c.current&&c.current.scrollIntoView(),e.createElement("div",{ref:c,style:{marginBottom:"24px"}},R)):null}));export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import o,{FormItemType as r}from"./model.js";import a from"./caret-down.js";import
|
|
1
|
+
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import o,{FormItemType as r}from"./model.js";import a from"./caret-down.js";import u from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as l}from"../../../../utils/i18n.js";import i from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var a=l().t,s=e.useState((function(){return new o(n)})),d=s[0],E=s[1];return e.useEffect((function(){i.rebuild()}),[]),e.useEffect((function(){t((function(){d.type=n.type}))}),[n.type]),e.useEffect((function(){t((function(){d.inputType=n.inputType}))}),[n.inputType]),e.useEffect((function(){t((function(){d.inputMode=n.inputMode}))}),[n.inputMode]),e.useEffect((function(){t((function(){d.value=n.value}))}),[n.value]),e.useEffect((function(){t((function(){d.options=n.options}))}),[n.options]),e.useEffect((function(){t((function(){d.label=n.label}))}),[n.label]),e.useEffect((function(){t((function(){d.hasError=n.hasError}))}),[n.hasError]),e.useEffect((function(){t((function(){d.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){d.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){d.textAreaPlaceholder=n.textAreaPlaceholder}))}),[n.textAreaPlaceholder]),e.useEffect((function(){t((function(){d.rightContent=n.rightContent}))}),[n.rightContent]),e.useEffect((function(){t((function(){d.disableResize=n.disableResize}))}),[n.disableResize]),e.useEffect((function(){t((function(){E(new o(n))}))}),[n.onChange]),e.useEffect((function(){!d.country&&n.currentCountryCode&&d.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]),e.createElement("div",{className:d.formItemStyle,style:n.style},e.createElement("div",{className:u.FormItemWrapper},e.createElement("div",{className:u.FormItemInputWrapper},e.createElement("label",{className:d.labelStyle},d.label),d.type===r.TEXT&&e.createElement(m,{vm:d,type:d.inputType,disabled:d.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name}),d.type===r.TEL&&e.createElement(c,{key:n.currentCountryCode||"1",disabled:d.disabled,defaultCountry:n.currentCountryCode,placeholder:a("checkout-page:enterPhoneNumber"),value:d.value?d.value:"",onChange:d.onPhoneChange}),d.type===r.TEXT_AREA&&e.createElement(f,{vm:d}),d.type===r.SELECT&&e.createElement(p,{vm:d,autocomplete:n.autocomplete})),!!d.hasError&&e.createElement("div",{className:u.ErrorMsg},d.errorText||""),!!n.tooltipText&&e.createElement("div",{className:u.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!d.rightContent&&e.createElement("div",{className:u.RightContent},d.rightContent)))})),m=n((function(t){var n=t.vm,o=t.name,r=t.autocomplete,a=t.type,u=t.pattern,l=t.required,i=t.disabled;return e.createElement("input",{required:l,type:a||"text",name:o,pattern:u,disabled:i,autoComplete:r,inputMode:n.inputMode||"text",className:n.inputStyle,value:n.value,onChange:n.onValueChange})})),f=n((function(t){var n=t.vm;return e.createElement("textarea",{style:{resize:n.disableResize?"none":"initial"},value:n.value,disabled:n.disabled,onChange:n.onTextAreaValueChange,placeholder:n.textAreaPlaceholder||""})})),p=n((function(t){var n,o=t.vm,r=t.autocomplete;return e.createElement(e.Fragment,null,e.createElement("select",{className:o.inputStyle,disabled:o.disabled,autoComplete:r,onChange:o.onSelectChange},!o.value&&e.createElement("option",{selected:!0,disabled:!0,key:-1}),null===(n=o.options)||void 0===n?void 0:n.map((function(t,n){return e.createElement("option",{key:n+t.value,value:t.label,selected:o.value===t.value},t.label)}))),e.createElement("div",{className:u.ArrowContainer},e.createElement(a,null)))}));export{s as FormItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";import t from"./style.module.scss.js";var i,n,o,r=function(){function n(t){var i=this;this.country=null,this.textAreaPlaceholder=null,this.onValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onTextAreaValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onSelectChange=function(e){var t;if(!i.disabled){var n=null===(t=i.options)||void 0===t?void 0:t.find((function(t){return t.label===e.target.value}));n&&i.onChange(n.value)}},this.onPhoneChange=function(e){i.disabled||i.onChange(e)},this.onCountryChange=function(e){i.disabled||(i.country=e)},this.type=t.type,this.inputType=t.inputType,this.options=t.options,this.label=t.label,this.value=t.value,this.hasError=t.hasError,this.errorText=t.errorText,this.tooltipText=t.tooltipText,this.country=t.country||null,this.textAreaPlaceholder=t.textAreaPlaceholder||null,this.rightContent=t.rightContent||null,this.disableResize=t.disableResize||!1,this.disabled=t.disabled||!1,this.onChange=t.onChange,e(this)}return Object.defineProperty(n.prototype,"formItemStyle",{get:function(){var e=[t.FormItem];return this.type===i.TEL&&this.hasError&&e.push(t.PhoneError),e.join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"labelStyle",{get:function(){return this.value||this.type===i.TEL?[t.FieldLabel,t.FieldLabelTop].join(" "):[t.FieldLabel].join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputStyle",{get:function(){var e=[];return this.value&&e.push(t.Bottom),this.hasError&&e.push(t.Error),this.tooltipText&&e.push(t.WithTooltip),this.type===i.TEL&&e.push(t.Tel),this.disabled&&e.push(t.Disabled),e.join(" ")},enumerable:!1,configurable:!0}),n}();!function(e){e[e.TEXT=0]="TEXT",e[e.TEXT_AREA=1]="TEXT_AREA",e[e.SELECT=2]="SELECT",e[e.TEL=3]="TEL"}(i||(i={})),function(e){e.TEXT="text",e.PASSWORD="password"}(n||(n={})),function(e){e.NUMERIC="numeric",e.TEL="tel",e.EMAIL="email"}(o||(o={}));export{o as FormItemInputMode,n as FormItemInputType,i as FormItemType,r as default};
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";import t from"./style.module.scss.js";var i,n,o,r=function(){function n(t){var i=this;this.country=null,this.textAreaPlaceholder=null,this.onValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onTextAreaValueChange=function(e){i.disabled||i.onChange(e.target.value)},this.onSelectChange=function(e){var t;if(!i.disabled){var n=null===(t=i.options)||void 0===t?void 0:t.find((function(t){return t.label===e.target.value}));n&&i.onChange(n.value)}},this.onPhoneChange=function(e){i.disabled||i.onChange(e)},this.onCountryChange=function(e){i.disabled||(i.country=e)},this.type=t.type,this.inputType=t.inputType,this.inputMode=t.inputMode,this.options=t.options,this.label=t.label,this.value=t.value,this.hasError=t.hasError,this.errorText=t.errorText,this.tooltipText=t.tooltipText,this.country=t.country||null,this.textAreaPlaceholder=t.textAreaPlaceholder||null,this.rightContent=t.rightContent||null,this.disableResize=t.disableResize||!1,this.disabled=t.disabled||!1,this.onChange=t.onChange,e(this)}return Object.defineProperty(n.prototype,"formItemStyle",{get:function(){var e=[t.FormItem];return this.type===i.TEL&&this.hasError&&e.push(t.PhoneError),e.join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"labelStyle",{get:function(){return this.value||this.type===i.TEL?[t.FieldLabel,t.FieldLabelTop].join(" "):[t.FieldLabel].join(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inputStyle",{get:function(){var e=[];return this.value&&e.push(t.Bottom),this.hasError&&e.push(t.Error),this.tooltipText&&e.push(t.WithTooltip),this.type===i.TEL&&e.push(t.Tel),this.disabled&&e.push(t.Disabled),e.join(" ")},enumerable:!1,configurable:!0}),n}();!function(e){e[e.TEXT=0]="TEXT",e[e.TEXT_AREA=1]="TEXT_AREA",e[e.SELECT=2]="SELECT",e[e.TEL=3]="TEL"}(i||(i={})),function(e){e.TEXT="text",e.PASSWORD="password"}(n||(n={})),function(e){e.NUMERIC="numeric",e.TEL="tel",e.EMAIL="email"}(o||(o={}));export{o as FormItemInputMode,n as FormItemInputType,i as FormItemType,r as default};
|