@ikas/storefront 4.0.13 → 4.0.14

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 e,{useRef as t,useState as o,useEffect as a}from"react";import{observer as n}from"mobx-react-lite";import r from"../modal/index.js";import s from"./svg/master-pass.js";import c from"./style.module.scss.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import{Button as l}from"../../button/index.js";import{FormItem as i}from"../../form-item/index.js";import{FormItemType as p}from"../../form-item/model.js";var u=n((function(n){var u=n.visible,f=n.type,d=n.vm,v=n.onClose,b=m().t,h=t(),k=o(180),x=k[0],g=k[1],M=o(""),E=M[0],P=M[1],T=o(!1),y=T[0],C=T[1],j=o(!1),O=j[0],N=j[1],V=function(){if(!O&&E&&d.checkout.masterPassPaymentGateway){N(!0),d.mpVM.onOtpFormSubmit({validationCode:E,store:d.store,checkout:d.checkout,callback:function(){N(!1),P(""),R()}})}},R=function(){g(0)},w=function(){g(180)},I=function(){g(180)};a((function(){if(!(x<1&&h.current))return h.current&&clearInterval(h.current),h.current=setInterval((function(){g(x-1)}),1e3),function(){h.current&&clearInterval(h.current)};clearInterval(h.current)}),[x]);var L,S,B,D,F,A,G=x<=120,W=e.createElement("div",null,e.createElement("div",{className:c.Wrapper},"masterPassOtp"===f&&e.createElement("span",{"data-mr":!0,className:c.Logo},e.createElement(s,null)),e.createElement("p",{className:c.Text},b("masterPassOtp"===f?"checkout-page:masterPass.otpModal.otpTextMasterPass":"checkout-page:masterPass.otpModal.otpTextBank"))),e.createElement("div",{className:c.Countdown},b("checkout-page:masterPass.otpModal.countdownText"),e.createElement("strong",null,(L=x%3600,S=Math.floor(L/60),B=L%60,D=Math.ceil(B),F=S<10?"0".concat(S):S,A=D<10?"0".concat(D):D,"".concat(F,":").concat(A)))),d.mpVM.otpResponse.text&&e.createElement("div",{role:"error"===d.mpVM.otpResponse.status?"alert":"",className:c.OtpResponseText},d.mpVM.otpResponse.text),e.createElement("form",{onSubmit:function(e){e.preventDefault(),V()}},e.createElement(i,{type:p.TEXT,label:b("checkout-page:masterPass.otpModal.inputLabel"),name:"one-time-code",autocomplete:"off",rightContent:d.mpVM.isOtpFormSubmitAtLeastOnce&&G?e.createElement("button",{type:"button",className:c.ResendButton,disabled:y,onClick:function(e){e.stopPropagation(),y||(C(!0),d.mpVM.resendOtp({store:d.store,checkout:d.checkout,callback:function(){C(!1),I(),P("")}}))}},b("checkout-page:masterPass.otpModal.resendText")):void 0,value:E,onChange:function(e){P(e)}}),e.createElement(l,{type:"submit",style:{width:"100%",marginTop:"16px"},text:b("checkout-page:masterPass.otpModal.buttonText"),isLoading:O,isDisabled:!E,onClick:V})));return a((function(){u?w():R()}),[u]),a((function(){w()}),[f]),console.log("calisti modal",u),e.createElement(r,{visible:u,onClose:v},W)}));export{u as default};
1
+ import e,{useRef as t,useState as o,useEffect as a}from"react";import{observer as n}from"mobx-react-lite";import r from"../modal/index.js";import s from"./svg/master-pass.js";import c from"./style.module.scss.js";import{useTranslation as m}from"../../../../../utils/i18n.js";import{Button as l}from"../../button/index.js";import{FormItem as i}from"../../form-item/index.js";import{FormItemType as p}from"../../form-item/model.js";var u=n((function(n){var u=n.visible,d=n.type,f=n.vm,v=n.onClose,b=m().t,h=t(),k=o(180),x=k[0],g=k[1],M=o(""),E=M[0],P=M[1],T=o(!1),y=T[0],C=T[1],j=o(!1),O=j[0],N=j[1],V=function(){if(!O&&E&&f.checkout.masterPassPaymentGateway){N(!0),f.mpVM.onOtpFormSubmit({validationCode:E,store:f.store,checkout:f.checkout,callback:function(){N(!1),P(""),R()}})}},R=function(){g(0)},w=function(){g(180)},I=function(){g(180)};a((function(){if(!(x<1&&h.current))return h.current&&clearInterval(h.current),h.current=setInterval((function(){g(x-1)}),1e3),function(){h.current&&clearInterval(h.current)};clearInterval(h.current)}),[x]);var L,S,B,D,F,A,G=x<=120,W=e.createElement("div",null,e.createElement("div",{className:c.Wrapper},"masterPassOtp"===d&&e.createElement("span",{"data-mr":!0,className:c.Logo},e.createElement(s,null)),e.createElement("p",{className:c.Text},b("masterPassOtp"===d?"checkout-page:masterPass.otpModal.otpTextMasterPass":"checkout-page:masterPass.otpModal.otpTextBank"))),e.createElement("div",{className:c.Countdown},b("checkout-page:masterPass.otpModal.countdownText"),e.createElement("strong",null,(L=x%3600,S=Math.floor(L/60),B=L%60,D=Math.ceil(B),F=S<10?"0".concat(S):S,A=D<10?"0".concat(D):D,"".concat(F,":").concat(A)))),f.mpVM.otpResponse.text&&e.createElement("div",{role:"error"===f.mpVM.otpResponse.status?"alert":"",className:c.OtpResponseText},f.mpVM.otpResponse.text),e.createElement("form",{onSubmit:function(e){e.preventDefault(),V()}},e.createElement(i,{type:p.TEXT,label:b("checkout-page:masterPass.otpModal.inputLabel"),name:"one-time-code",autocomplete:"one-time-code",rightContent:f.mpVM.isOtpFormSubmitAtLeastOnce&&G?e.createElement("button",{type:"button",className:c.ResendButton,disabled:y,onClick:function(e){e.stopPropagation(),y||(C(!0),f.mpVM.resendOtp({store:f.store,checkout:f.checkout,callback:function(){C(!1),I(),P("")}}))}},b("checkout-page:masterPass.otpModal.resendText")):void 0,value:E,onChange:function(e){P(e)}}),e.createElement(l,{type:"submit",style:{width:"100%",marginTop:"16px"},text:b("checkout-page:masterPass.otpModal.buttonText"),isLoading:O,isDisabled:!E,onClick:V})));return a((function(){u?w():R()}),[u]),a((function(){w()}),[d]),console.log("calisti modal",u),e.createElement(r,{visible:u,onClose:v},W)}));export{u as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.0.13",
3
+ "version": "4.0.14",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -23,11 +23,11 @@
23
23
  "libphonenumber-js": "^1.10.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@ikas/storefront-api": "^4.0.13",
27
- "@ikas/storefront-config": "^4.0.13",
28
- "@ikas/storefront-model-functions": "^4.0.13",
29
- "@ikas/storefront-models": "^4.0.13",
30
- "@ikas/storefront-providers": "^4.0.13",
26
+ "@ikas/storefront-api": "^4.0.14",
27
+ "@ikas/storefront-config": "^4.0.14",
28
+ "@ikas/storefront-model-functions": "^4.0.14",
29
+ "@ikas/storefront-models": "^4.0.14",
30
+ "@ikas/storefront-providers": "^4.0.14",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
32
32
  "@rollup/plugin-json": "^4.1.0",
33
33
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -53,11 +53,11 @@
53
53
  "query-string": "^6.13.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@ikas/storefront-api": "^4.0.13",
57
- "@ikas/storefront-config": "^4.0.13",
58
- "@ikas/storefront-model-functions": "^4.0.13",
59
- "@ikas/storefront-models": "^4.0.13",
60
- "@ikas/storefront-providers": "^4.0.13",
56
+ "@ikas/storefront-api": "^4.0.14",
57
+ "@ikas/storefront-config": "^4.0.14",
58
+ "@ikas/storefront-model-functions": "^4.0.14",
59
+ "@ikas/storefront-models": "^4.0.14",
60
+ "@ikas/storefront-providers": "^4.0.14",
61
61
  "mobx": "^6.1.3",
62
62
  "mobx-react-lite": "^3.1.5",
63
63
  "next": "12.2.0",