@ikas/storefront 4.2.0-alpha.1 → 4.2.0-alpha.2

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{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{FormItem as n}from"../../components/form-item/index.js";import{FormItemType as r,FormItemInputMode as c}from"../../components/form-item/model.js";import{Button as s}from"../../components/button/index.js";import{Checkbox as m}from"../../components/checkbox/index.js";import a from"../../components/error/index.js";import l from"../../styles/common.module.scss.js";import u from"../../components/customer-addresses/index.js";import p from"../../components/customer-addresses/model.js";import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import{useTranslation as h}from"../../../../utils/i18n.js";var f=i((function(i){var f,g,k=i.vm,v=h().t,y=function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":d.getApiKey()},body:JSON.stringify({cartId:k.checkout.id,customerNumber:o,sessionsState:Date.now()})})];case 1:return[2,t.sent().json()]}}))}))},E=o.useCallback((function(e){k.checkout.customer&&(k.checkout.customer.email=e?e.trim():e)}),[k,k.checkout,k.checkout.customer]),x=o.useMemo((function(){return k.isDigitalOnly?new p(k,"billing"):new p(k,"shipping")}),[k]);return o.createElement("div",null,o.createElement(a,{vm:k}),o.createElement(s,{text:"e-Pay-Kolay",style:{},onClick:function(){var e;window.setContainerService(null===(e=d.getMerchantSettings())||void 0===e?void 0:e.merchantId,y,"https://cdn.myikas.com/sf/static/e-pay-kolay/")}}),!k.checkout.hasCustomer&&o.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},o.createElement("div",{className:l.FormSectionTitle},o.createElement("div",{className:l.Title},v("checkout-page:contactInfo"))),o.createElement(n,{type:r.TEXT,inputMode:c.EMAIL,label:v("checkout-page:email"),autocomplete:"email",value:(null===(f=k.checkout.customer)||void 0===f?void 0:f.email)||"",onChange:E,hasError:k.isErrorsVisible&&!k.checkout.hasValidCustomerEmail,errorText:v("checkout-page:emailError"),tooltipText:v("checkout-page:guestEmailTooltip")}),o.createElement(m,{value:(null===(g=k.checkout.customer)||void 0===g?void 0:g.notificationsAccepted)||!1,label:v("checkout-page:customerConsentCta"),onChange:k.setCustomerConsentGranted})),o.createElement(u,{vm:x}),!x.editingCustomerAddress&&o.createElement(s,{style:{width:"100%",marginTop:k.store.customerStore.customer?"0px":"32px"},text:"address"!==k.deliveryMethod||k.isDigitalOnly?v("checkout-page:actions.continueWithPayment"):v("checkout-page:actions.continueWithShipping"),isLoading:k.isStepLoading,onClick:k.isDigitalOnly?k.onProceedToDigitalOnlyPaymentClick:k.onProceedToShippingClick}))}));export{f as default};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{FormItem as n}from"../../components/form-item/index.js";import{FormItemType as r,FormItemInputMode as c}from"../../components/form-item/model.js";import{Button as s}from"../../components/button/index.js";import{Checkbox as a}from"../../components/checkbox/index.js";import m from"../../components/error/index.js";import l from"../../styles/common.module.scss.js";import u from"../../components/customer-addresses/index.js";import p from"../../components/customer-addresses/model.js";import{IkasStorefrontConfig as d}from"@ikas/storefront-config";import{useTranslation as h}from"../../../../utils/i18n.js";var f=i((function(i){var f,g,v=i.vm,k=h().t;o.useEffect((function(){var e=setInterval((function(){var t;window.setContainerService&&(window.setContainerService(null===(t=d.getMerchantSettings())||void 0===t?void 0:t.merchantId,y,"https://cdn.myikas.com/sf/static/e-pay-kolay/"),clearInterval(e))}),100)}),[]);var y=function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":d.getApiKey()},body:JSON.stringify({cartId:v.checkout.id,customerNumber:o,sessionsState:Date.now()})})];case 1:return[2,t.sent().json()]}}))}))},E=o.useCallback((function(e){v.checkout.customer&&(v.checkout.customer.email=e?e.trim():e)}),[v,v.checkout,v.checkout.customer]),C=o.useMemo((function(){return v.isDigitalOnly?new p(v,"billing"):new p(v,"shipping")}),[v]);return o.createElement("div",null,o.createElement(m,{vm:v}),o.createElement(s,{text:"e-Pay-Kolay",style:{},onClick:function(){window.frictionless()}}),!v.checkout.hasCustomer&&o.createElement("div",{style:{marginTop:"8px",marginBottom:"40px"}},o.createElement("div",{className:l.FormSectionTitle},o.createElement("div",{className:l.Title},k("checkout-page:contactInfo"))),o.createElement(n,{type:r.TEXT,inputMode:c.EMAIL,label:k("checkout-page:email"),autocomplete:"email",value:(null===(f=v.checkout.customer)||void 0===f?void 0:f.email)||"",onChange:E,hasError:v.isErrorsVisible&&!v.checkout.hasValidCustomerEmail,errorText:k("checkout-page:emailError"),tooltipText:k("checkout-page:guestEmailTooltip")}),o.createElement(a,{value:(null===(g=v.checkout.customer)||void 0===g?void 0:g.notificationsAccepted)||!1,label:k("checkout-page:customerConsentCta"),onChange:v.setCustomerConsentGranted})),o.createElement(u,{vm:C}),!C.editingCustomerAddress&&o.createElement(s,{style:{width:"100%",marginTop:v.store.customerStore.customer?"0px":"32px"},text:"address"!==v.deliveryMethod||v.isDigitalOnly?k("checkout-page:actions.continueWithPayment"):k("checkout-page:actions.continueWithShipping"),isLoading:v.isStepLoading,onClick:v.isDigitalOnly?v.onProceedToDigitalOnlyPaymentClick:v.onProceedToShippingClick}))}));export{f as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.2.0-alpha.1",
3
+ "version": "4.2.0-alpha.2",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {},
20
20
  "devDependencies": {
21
- "@ikas/storefront-api": "^4.2.0-alpha.1",
22
- "@ikas/storefront-config": "^4.2.0-alpha.1",
23
- "@ikas/storefront-model-functions": "^4.2.0-alpha.1",
24
- "@ikas/storefront-models": "^4.2.0-alpha.1",
25
- "@ikas/storefront-providers": "^4.2.0-alpha.1",
21
+ "@ikas/storefront-api": "^4.2.0-alpha.2",
22
+ "@ikas/storefront-config": "^4.2.0-alpha.2",
23
+ "@ikas/storefront-model-functions": "^4.2.0-alpha.2",
24
+ "@ikas/storefront-models": "^4.2.0-alpha.2",
25
+ "@ikas/storefront-providers": "^4.2.0-alpha.2",
26
26
  "@rollup/plugin-commonjs": "^22.0.0",
27
27
  "@rollup/plugin-json": "^4.1.0",
28
28
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -52,11 +52,11 @@
52
52
  "libphonenumber-js": "^1.10.6"
53
53
  },
54
54
  "peerDependencies": {
55
- "@ikas/storefront-api": "^4.2.0-alpha.1",
56
- "@ikas/storefront-config": "^4.2.0-alpha.1",
57
- "@ikas/storefront-model-functions": "^4.2.0-alpha.1",
58
- "@ikas/storefront-models": "^4.2.0-alpha.1",
59
- "@ikas/storefront-providers": "^4.2.0-alpha.1",
55
+ "@ikas/storefront-api": "^4.2.0-alpha.2",
56
+ "@ikas/storefront-config": "^4.2.0-alpha.2",
57
+ "@ikas/storefront-model-functions": "^4.2.0-alpha.2",
58
+ "@ikas/storefront-models": "^4.2.0-alpha.2",
59
+ "@ikas/storefront-providers": "^4.2.0-alpha.2",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.2.0",