@ikas/storefront 6.1.0-beta.383 → 6.1.0-beta.384

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.
@@ -1 +1 @@
1
- import*as e from"react";import{observer as t}from"mobx-react-lite";import{suggestEmailCorrection as o}from"@ikas/storefront-model-functions";import{FormItem as i}from"../../components/form-item/index.js";import{FormItemType as n,FormItemInputMode as r}from"../../components/form-item/model.js";import{Button as s}from"../../components/button/index.js";import{Checkbox as l}from"../../components/checkbox/index.js";import a from"../../components/error/index.js";import m from"../../styles/common.module.scss.js";import c from"./style.module.scss.js";import u from"../../components/customer-addresses/index.js";import p from"../../components/customer-addresses/model.js";import"@ikas/storefront-config";import{useTranslation as d}from"../../../../utils/i18n.js";var f=t((function(t){var f,g,h=t.vm,E=d().t,k=e.useRef(null),v=e.useState(0),S=v[0],C=v[1],b=e.useState(null),y=b[0],x=b[1],T=(null===(f=h.checkout.customer)||void 0===f?void 0:f.email)||"";e.useEffect((function(){h.hasEmailError&&k.current&&k.current.scrollIntoView({behavior:"smooth",block:"center"})}),[h.hasEmailError,S]),e.useEffect((function(){var e=window.setTimeout((function(){x(o(T))}),500);return function(){window.clearTimeout(e)}}),[T]);var w=e.useCallback((function(e){h.checkout.customer&&(h.checkout.customer.email=e?e.trim():e)}),[h]),A=e.useCallback((function(e){e.preventDefault(),y&&(w(y),x(null))}),[w,y]),j=e.useMemo((function(){if(!y)return null;var t=E("checkout-page:emailSuggestion",{email:"\0"}).split("\0"),o=t[0],i=t[1],n=void 0===i?"":i;return e.createElement(e.Fragment,null,o,e.createElement("button",{type:"button",className:c.EmailSuggestionLink,onClick:A},y),n)}),[y,A,E]),D=e.useMemo((function(){return h.isDigitalOnly?new p(h,"billing"):new p(h,"shipping")}),[h]),O=e.useCallback((function(e){e.preventDefault(),C((function(e){return e+1})),h.isStepLoading||D.editingCustomerAddress||(h.isDigitalOnly?h.onProceedToDigitalOnlyPaymentClick():h.onProceedToShippingClick())}),[h,D.editingCustomerAddress]);return e.createElement("form",{onSubmit:O,autoComplete:"on"},e.createElement(a,{vm:h}),!h.checkout.hasCustomer&&e.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},e.createElement("div",{className:m.FormSectionTitle},e.createElement("div",{className:m.Title},E("checkout-page:contactInfo"))),e.createElement("div",{ref:k},e.createElement(i,{name:"email",type:n.TEXT,inputMode:r.EMAIL,label:E("checkout-page:email"),autocomplete:"shipping email",value:T,onChange:w,hasError:h.hasEmailError,errorText:y||h.hasCorrectableEmailTypo?void 0:E("checkout-page:emailError"),tooltipText:E("checkout-page:guestEmailTooltip"),autocapitalize:"off",autocorrect:"off",spellcheck:"false"}),!!j&&e.createElement("div",{className:c.EmailSuggestion},j)),e.createElement(l,{value:(null===(g=h.checkout.customer)||void 0===g?void 0:g.notificationsAccepted)||!1,label:E("checkout-page:customerConsentCta"),onChange:h.setCustomerConsentGranted,id:"marketingCheckbox"})),e.createElement(u,{vm:D}),h.isShowBillingAddressOnShippingStep&&"address"===h.deliveryMethod&&!h.isDigitalOnly&&e.createElement(l,{value:!h.useDifferentAddress,hasError:h.isErrorsVisible&&!h.isTermsAndConditionsChecked,label:E("checkout-page:useShippingForBilling"),onChange:function(e){return h.setUseDifferentAddress(!e,!0)}}),h.isShowBillingAddressOnShippingStep&&(h.useDifferentAddress||"in-store"===h.deliveryMethod)&&e.createElement(u,{vm:new p(h,"billing"),showBillingAddressOnShippingStep:!0}),!D.editingCustomerAddress&&e.createElement(s,{type:"submit",style:{width:"100%",marginTop:h.store.customerStore.customer&&!h.isShowBillingAddressOnShippingStep?"0px":"32px"},text:"address"!==h.deliveryMethod||h.isDigitalOnly?E("checkout-page:actions.continueWithPayment"):E("checkout-page:actions.continueWithShipping"),isLoading:h.isStepLoading}))}));export{f as default};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{suggestEmailCorrection as o}from"@ikas/storefront-model-functions";import{FormItem as i}from"../../components/form-item/index.js";import{FormItemType as n,FormItemInputMode as r}from"../../components/form-item/model.js";import{Button as s}from"../../components/button/index.js";import{Checkbox as l}from"../../components/checkbox/index.js";import c from"../../components/error/index.js";import a from"../../styles/common.module.scss.js";import m from"./style.module.scss.js";import u from"../../components/customer-addresses/index.js";import p from"../../components/customer-addresses/model.js";import"@ikas/storefront-config";import{useTranslation as d}from"../../../../utils/i18n.js";var f=t((function(t){var f,g,h=t.vm,E=d().t,k=e.useRef(null),v=e.useState(0),S=v[0],C=v[1],b=e.useState(null),y=b[0],x=b[1],T=(null===(f=h.checkout.customer)||void 0===f?void 0:f.email)||"";e.useEffect((function(){h.hasEmailError&&k.current&&k.current.scrollIntoView({behavior:"smooth",block:"center"})}),[h.hasEmailError,S]),e.useEffect((function(){var e=window.setTimeout((function(){x(o(T))}),500);return function(){window.clearTimeout(e)}}),[T]);var w=e.useCallback((function(e){h.checkout.customer&&(h.checkout.customer.email=e?e.trim():e)}),[h]),A=e.useCallback((function(e){e.preventDefault(),y&&(w(y),x(null))}),[w,y]),j=e.useMemo((function(){if(!y)return null;var t=E("checkout-page:emailSuggestion",{email:"\0"}).split("\0"),o=t[0],i=t[1],n=void 0===i?"":i,r=y.indexOf("@"),s=-1===r?"".concat(y).concat(n):e.createElement(e.Fragment,null,y.slice(0,r+1),e.createElement("wbr",null),"".concat(y.slice(r+1)).concat(n));return e.createElement(e.Fragment,null,o,e.createElement("button",{type:"button",className:m.EmailSuggestionLink,onClick:A},s))}),[y,A,E]),D=e.useMemo((function(){return h.isDigitalOnly?new p(h,"billing"):new p(h,"shipping")}),[h]),O=e.useCallback((function(e){e.preventDefault(),C((function(e){return e+1})),h.isStepLoading||D.editingCustomerAddress||(h.isDigitalOnly?h.onProceedToDigitalOnlyPaymentClick():h.onProceedToShippingClick())}),[h,D.editingCustomerAddress]);return e.createElement("form",{onSubmit:O,autoComplete:"on"},e.createElement(c,{vm:h}),!h.checkout.hasCustomer&&e.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},e.createElement("div",{className:a.FormSectionTitle},e.createElement("div",{className:a.Title},E("checkout-page:contactInfo"))),e.createElement("div",{ref:k},e.createElement(i,{name:"email",type:n.TEXT,inputMode:r.EMAIL,label:E("checkout-page:email"),autocomplete:"shipping email",value:T,onChange:w,hasError:h.hasEmailError,errorText:y||h.hasCorrectableEmailTypo?void 0:E("checkout-page:emailError"),tooltipText:E("checkout-page:guestEmailTooltip"),autocapitalize:"off",autocorrect:"off",spellcheck:"false"}),!!j&&e.createElement("div",{className:m.EmailSuggestion},j)),e.createElement(l,{value:(null===(g=h.checkout.customer)||void 0===g?void 0:g.notificationsAccepted)||!1,label:E("checkout-page:customerConsentCta"),onChange:h.setCustomerConsentGranted,id:"marketingCheckbox"})),e.createElement(u,{vm:D}),h.isShowBillingAddressOnShippingStep&&"address"===h.deliveryMethod&&!h.isDigitalOnly&&e.createElement(l,{value:!h.useDifferentAddress,hasError:h.isErrorsVisible&&!h.isTermsAndConditionsChecked,label:E("checkout-page:useShippingForBilling"),onChange:function(e){return h.setUseDifferentAddress(!e,!0)}}),h.isShowBillingAddressOnShippingStep&&(h.useDifferentAddress||"in-store"===h.deliveryMethod)&&e.createElement(u,{vm:new p(h,"billing"),showBillingAddressOnShippingStep:!0}),!D.editingCustomerAddress&&e.createElement(s,{type:"submit",style:{width:"100%",marginTop:h.store.customerStore.customer&&!h.isShowBillingAddressOnShippingStep?"0px":"32px"},text:"address"!==h.deliveryMethod||h.isDigitalOnly?E("checkout-page:actions.continueWithPayment"):E("checkout-page:actions.continueWithShipping"),isLoading:h.isStepLoading}))}));export{f as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.383",
3
+ "version": "6.1.0-beta.384",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -23,11 +23,11 @@
23
23
  "swiper": "11.0.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@ikas/storefront-api": "^6.1.0-beta.383",
27
- "@ikas/storefront-config": "^6.1.0-beta.383",
28
- "@ikas/storefront-model-functions": "^6.1.0-beta.383",
29
- "@ikas/storefront-models": "^6.1.0-beta.383",
30
- "@ikas/storefront-providers": "^6.1.0-beta.383",
26
+ "@ikas/storefront-api": "^6.1.0-beta.384",
27
+ "@ikas/storefront-config": "^6.1.0-beta.384",
28
+ "@ikas/storefront-model-functions": "^6.1.0-beta.384",
29
+ "@ikas/storefront-models": "^6.1.0-beta.384",
30
+ "@ikas/storefront-providers": "^6.1.0-beta.384",
31
31
  "@ikas/localized-address": "1.0.0-beta.6",
32
32
  "@adyen/adyen-web": "^5.57.0",
33
33
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -62,11 +62,11 @@
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@ikas/localized-address": "1.0.0-beta.6",
65
- "@ikas/storefront-api": "^6.1.0-beta.383",
66
- "@ikas/storefront-config": "^6.1.0-beta.383",
67
- "@ikas/storefront-model-functions": "^6.1.0-beta.383",
68
- "@ikas/storefront-models": "^6.1.0-beta.383",
69
- "@ikas/storefront-providers": "^6.1.0-beta.383",
65
+ "@ikas/storefront-api": "^6.1.0-beta.384",
66
+ "@ikas/storefront-config": "^6.1.0-beta.384",
67
+ "@ikas/storefront-model-functions": "^6.1.0-beta.384",
68
+ "@ikas/storefront-models": "^6.1.0-beta.384",
69
+ "@ikas/storefront-providers": "^6.1.0-beta.384",
70
70
  "mobx": "^6.1.3",
71
71
  "mobx-react-lite": "^3.1.5",
72
72
  "next": "12.2.0",