@ikas/storefront 4.3.0-beta.3 → 4.3.0-beta.5

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.
@@ -0,0 +1 @@
1
+ import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={AdyenContainer:"adyen-module_AdyenContainer__rZaiG"};n(".adyen-module_AdyenContainer__rZaiG .adyen-checkout__payment-method__radio--selected {\n background-color: #272727;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__button {\n display: none !important;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__input {\n border: 1px solid #e5e4e9;\n background-color: #fff;\n background-clip: padding-box;\n border-radius: 8px;\n display: block;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n outline: none !important;\n transition: padding 0.1s, border-color 0.5s, box-shadow 0.5s;\n box-shadow: 0 0 0 1px transparent;\n -moz-appearance: none;\n -webkit-appearance: none;\n margin: 5px 0;\n caret-color: black;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__input--focus.adyen-checkout__input--focus:hover {\n border: 1px solid black !important;\n box-shadow: 0 0 0 1px black !important;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__label--focused .adyen-checkout__label__text {\n color: #00112c;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__error-text {\n color: #fb4e4e;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__label__text--error {\n color: #fb4e4e;\n}\n.adyen-module_AdyenContainer__rZaiG .adyen-checkout__spinner {\n border: 3px solid rgb(0, 0, 0);\n border-radius: 50%;\n border-top-color: transparent;\n}");export{e as default};
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import CheckoutViewModel from "../../model";
3
3
  import "@adyen/adyen-web/dist/adyen.css";
4
- import "./Adyen.css";
5
4
  declare type Props = {
6
5
  vm: CheckoutViewModel;
7
6
  };
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as n}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import s from"@adyen/adyen-web";import"@adyen/adyen-web/dist/adyen.css";import"./Adyen.css.js";var r;!function(e){e.Authorised="Authorised",e.Cancelled="Cancelled"}(r||(r={}));var i=o((function(o){var i=o.vm,a=t.useRef(null);return t.useEffect((function(){e(void 0,void 0,void 0,(function(){var t,o,d;return n(this,(function(u){switch(u.label){case 0:return i.adyenResponse&&a.current?(t={environment:"test",clientKey:i.adyenResponse.clientKey,analytics:{enabled:!0},session:{id:i.adyenResponse.sessionId,sessionData:i.adyenResponse.sessionData},beforeSubmit:function(t,o,s){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return s.resolve(t),[2]}))}))},onPaymentCompleted:function(e,n){e.resultCode===r.Authorised&&i.adyenResponse?window.location.href=i.adyenResponse.returnUrl:(i.isStepLoading=!1,setTimeout((function(){d.setStatus("ready")}),3e3))},onError:function(e,n){console.log(e)},paymentMethodsConfiguration:{card:{showPayButton:!1}}},[4,s(t)]):[3,2];case 1:o=u.sent(),d=o.create("dropin").mount(a.current),i.setAdyenDropinElement(d),u.label=2;case 2:return[2]}}))}))}),[i.adyenResponse]),i.adyenResponse?t.createElement("div",{ref:a}):null}));export{i as Adyen};
1
+ import{__awaiter as e,__generator as n}from'./../../../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import s from"@adyen/adyen-web";import"@adyen/adyen-web/dist/adyen.css";import r from"./adyen.module.scss.js";var i;!function(e){e.Authorised="Authorised",e.Cancelled="Cancelled"}(i||(i={}));var a=o((function(o){var a=o.vm,d=t.useRef(null);return t.useEffect((function(){e(void 0,void 0,void 0,(function(){var t,o,r;return n(this,(function(u){switch(u.label){case 0:return a.adyenResponse&&d.current?(t={environment:"test",clientKey:a.adyenResponse.clientKey,analytics:{enabled:!0},session:{id:a.adyenResponse.sessionId,sessionData:a.adyenResponse.sessionData},beforeSubmit:function(t,o,s){return e(void 0,void 0,void 0,(function(){return n(this,(function(e){return s.resolve(t),[2]}))}))},onPaymentCompleted:function(e,n){e.resultCode===i.Authorised&&a.adyenResponse?window.location.href="".concat(a.adyenResponse.returnUrl,"&redirectResult=").concat(e.sessionData):(a.isStepLoading=!1,setTimeout((function(){r.setStatus("ready")}),3e3))},onError:function(e,n){a.isStepLoading=!1,setTimeout((function(){r.setStatus("ready")}),3e3)},paymentMethodsConfiguration:{card:{showPayButton:!1}}},[4,s(t)]):[3,2];case 1:o=u.sent(),r=o.create("dropin").mount(d.current),a.setAdyenDropinElement(r),u.label=2;case 2:return[2]}}))}))}),[a.adyenResponse]),a.adyenResponse?t.createElement("div",{className:r.AdyenContainer},t.createElement("div",{ref:d})):null}));export{a as Adyen};
@@ -1 +1 @@
1
- import{__awaiter as t,__generator as e}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as r,computed as i,observable as a,action as s}from"mobx";import{Validator as o}from"../index.js";import{IkasBaseStore as n}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{RequiredRule as u,EmailRule as d,MinRule as m}from"../rules/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import{IkasCustomerAttributeType as l,IkasCustomerAttributeRegisterPageRequirement as c}from"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout/country-settings-model.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/index.js";import"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/state/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";var p=function(){function p(t){var e=this;this.model={firstName:"",lastName:"",email:"",password:"",attributes:void 0,isMarketingAccepted:!1},this.isFormSubmit=!1,this._customerAttributes=void 0,this.onFirstNameChange=function(t){e.firstName=t},this.onLastNameChange=function(t){e.lastName=t},this.onEmailChange=function(t){e.email=t},this.onPasswordChange=function(t){e.password=t},this.setCustomerAttributes=function(t){e._customerAttributes=(null==t?void 0:t.filter((function(t){return t.registerPageRequirement!==c.INVISIBLE})).map((function(t){return{attribute:t,attributeValue:{isChecked:void 0,value:void 0,selectedIdList:void 0},validator:{isRequired:t.registerPageRequirement===c.MANDATORY,hasError:!1,message:""}}})))||[]},this.onAttributeChange=function(t,r){var i;if(e._customerAttributes){var a=e._customerAttributes.find((function(e){return e.attribute.id===t}));if(a){var s=null===(i=e._customerAttributes)||void 0===i?void 0:i.findIndex((function(e){return e.attribute.id===t}));void 0!==s&&-1!==s&&(e._customerAttributes[s].attributeValue=e.getAttributeValue(a.attribute,r),e.validateCustomerAttribute())}}},r(this,{emailErrorMessage:i,passwordErrorMessage:i,firstNameErrorMessage:i,lastNameErrorMessage:i,hasError:i,redirect:i,model:a,validateAll:s,register:s,customerAttributes:i,_customerAttributes:a}),this.message=t.message,this.validator=new o(this.model,[new u({fieldKey:"firstName",valuePath:"firstName",message:t.message.requiredRule}),new u({fieldKey:"lastName",valuePath:"lastName",message:t.message.requiredRule}),new u({fieldKey:"email",valuePath:"email",message:t.message.requiredRule}),new u({fieldKey:"password",valuePath:"password",message:t.message.requiredRule}),new d({fieldKey:"email",valuePath:"email",message:t.message.emailRule}),new m({fieldKey:"password",valuePath:"password",minValue:6,message:t.message.minRule})])}return Object.defineProperty(p.prototype,"firstName",{get:function(){return this.model.firstName},set:function(t){this.model.firstName=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastName",{get:function(){return this.model.lastName},set:function(t){this.model.lastName=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"email",{get:function(){return this.model.email},set:function(t){this.model.email=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"password",{get:function(){return this.model.password},set:function(t){this.model.password=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"isMarketingAccepted",{get:function(){return this.model.isMarketingAccepted},set:function(t){this.model.isMarketingAccepted=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"attributes",{get:function(){return this.model.attributes},set:function(t){this.model.attributes=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"customerAttributes",{get:function(){return this._customerAttributes},enumerable:!1,configurable:!0}),p.prototype.getAttributeValue=function(t,e){var r={isChecked:void 0,value:void 0,selectedIdList:void 0};if("string"!=typeof e||t.type!==l.TEXT&&t.type!==l.DATETIME&&t.type!==l.CHOICE||(r.value=e),"string"==typeof e&&t.type===l.NUMERIC){var i=parseInt(e);isNaN(i)?r.value=r.value||"":r.value=e}return"boolean"==typeof e&&t.type===l.BOOLEAN&&(r.isChecked=e),"object"==typeof e&&t.type===l.MULTIPLE_CHOICE&&(r.selectedIdList=e),r},Object.defineProperty(p.prototype,"formattedAttributesInput",{get:function(){if(!this._customerAttributes)return null;if(!this._customerAttributes.some((function(t){return void 0!==t.attributeValue.value||void 0!==t.attributeValue.isChecked||void 0!==t.attributeValue.selectedIdList})))return null;var t=[];return this._customerAttributes.map((function(e){var r=e.attributeValue,i=r.selectedIdList,a=r.isChecked,s=r.value;void 0!==i&&l.MULTIPLE_CHOICE&&i.map((function(r){t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:r,value:null})})),e.attribute.type===l.BOOLEAN&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:a?a.toString():"false"}),void 0!==s&&(e.attribute.type!==l.TEXT&&e.attribute.type!==l.NUMERIC||t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:s.toString()}),e.attribute.type===l.CHOICE&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:s,value:null}),e.attribute.type===l.DATETIME&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:new Date(s).getTime().toString()}))})),t},enumerable:!1,configurable:!0}),p.prototype.validateCustomerAttribute=function(){var t,e=this;this._customerAttributes=null===(t=this._customerAttributes)||void 0===t?void 0:t.map((function(t){var r;return t.validator.isRequired&&e.isFormSubmit&&(t.attributeValue.value||(null===(r=t.attributeValue.selectedIdList)||void 0===r?void 0:r.length)?(t.validator.hasError=!1,t.validator.message=""):(t.validator.hasError=!0,t.validator.message="string"==typeof e.message.requiredRule?e.message.requiredRule:e.message.requiredRule(e.model))),t}))},p.prototype.validateAll=function(){var r;return t(this,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this.validateCustomerAttribute(),[4,this.validator.validateAll()];case 1:return t=e.sent(),i=null===(r=this._customerAttributes)||void 0===r?void 0:r.some((function(t){return t.validator.hasError})),[2,t||i]}}))}))},p.prototype.register=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isFormSubmit=!0,t={isFormError:!1,isSuccess:!1},[4,this.validateAll()];case 1:if(e.sent())return t.isFormError=!0,[2,t];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,n.getInstance().customerStore.register(this.model.firstName,this.model.lastName,this.model.email,this.model.password,this.model.isMarketingAccepted,this.model.attributes||this.formattedAttributesInput||void 0)];case 3:return e.sent()&&(t.isSuccess=!0),[2,t];case 4:return e.sent(),[2,t];case 5:return[2]}}))}))},p}();export{p as RegisterForm};
1
+ import{__awaiter as t,__generator as e}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as r,computed as i,observable as a,action as s}from"mobx";import{Validator as o}from"../index.js";import{IkasBaseStore as n}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{RequiredRule as u,EmailRule as d,MinRule as m}from"../rules/index.js";import"../../../data/blog/category/index.js";import"../../../data/blog/content/index.js";import"../../../data/blog/meta-data/index.js";import"../../../data/blog/tag/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import{IkasCustomerAttributeType as l,IkasCustomerAttributeRegisterPageRequirement as c}from"@ikas/storefront-models";import"../../../data/campaign-offer/index.js";import"../../../data/cart/campaign-offer/index.js";import"../../../data/cart/index.js";import"../../../data/category/path-item/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/checkout/country-settings-model.js";import"../../../data/checkout-settings/index.js";import"../../../data/city/index.js";import"../../../data/country/index.js";import"../../../data/customer/address/index.js";import"../../../data/customer/address/ikas-localized-customer-address.js";import"../../../data/customer/attribute/index.js";import"../../../data/customer/review/summary/index.js";import"../../../data/customer/review/index.js";import"../../../data/customer/index.js";import"../../../data/district/index.js";import"../../../data/favorite-product/index.js";import"../../../data/filter-category/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/order/address/index.js";import"../../../data/order/line-item/option/value/index.js";import"../../../data/order/line-item/variant/value/index.js";import"../../../data/order/line-item/variant/index.js";import"../../../data/order/line-item/index.js";import"../../../data/order/package/index.js";import"../../../data/order/transaction/index.js";import"../../../data/order/index.js";import"../../../data/payment-gateway/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product/filter/index.js";import"../../../data/product/option-set/option/index.js";import"../../../data/product/option-set/index.js";import"../../../data/product/stock-location/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product/variant/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/index.js";import"../../../data/raffle/index.js";import"../../../data/state/index.js";import"../../../data/theme-json/index.js";import"../../../data/theme-json/custom-data/index.js";import"../../../data/variant-type/variant-value/index.js";var p=function(){function p(t){var e=this;this.model={firstName:"",lastName:"",email:"",password:"",attributes:void 0,isMarketingAccepted:!1},this.isFormSubmit=!1,this._customerAttributes=void 0,this.onFirstNameChange=function(t){e.firstName=t},this.onLastNameChange=function(t){e.lastName=t},this.onEmailChange=function(t){e.email=t},this.onPasswordChange=function(t){e.password=t},this.setCustomerAttributes=function(t){e._customerAttributes=(null==t?void 0:t.filter((function(t){return t.registerPageRequirement!==c.INVISIBLE})).map((function(t){return{attribute:t,attributeValue:{isChecked:void 0,value:void 0,selectedIdList:void 0},validator:{isRequired:t.registerPageRequirement===c.MANDATORY,hasError:!1,message:""}}})))||[]},this.onAttributeChange=function(t,r){var i;if(e._customerAttributes){var a=e._customerAttributes.find((function(e){return e.attribute.id===t}));if(a){var s=null===(i=e._customerAttributes)||void 0===i?void 0:i.findIndex((function(e){return e.attribute.id===t}));void 0!==s&&-1!==s&&(e._customerAttributes[s].attributeValue=e.getAttributeValue(a.attribute,r),e.validateCustomerAttribute())}}},r(this,{emailErrorMessage:i,passwordErrorMessage:i,firstNameErrorMessage:i,lastNameErrorMessage:i,hasError:i,redirect:i,model:a,validateAll:s,register:s,customerAttributes:i,_customerAttributes:a}),this.message=t.message,this.validator=new o(this.model,[new u({fieldKey:"firstName",valuePath:"firstName",message:t.message.requiredRule}),new u({fieldKey:"lastName",valuePath:"lastName",message:t.message.requiredRule}),new u({fieldKey:"email",valuePath:"email",message:t.message.requiredRule}),new u({fieldKey:"password",valuePath:"password",message:t.message.requiredRule}),new d({fieldKey:"email",valuePath:"email",message:t.message.emailRule}),new m({fieldKey:"password",valuePath:"password",minValue:6,message:t.message.minRule})])}return Object.defineProperty(p.prototype,"firstName",{get:function(){return this.model.firstName},set:function(t){this.model.firstName=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastName",{get:function(){return this.model.lastName},set:function(t){this.model.lastName=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"email",{get:function(){return this.model.email},set:function(t){this.model.email=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"password",{get:function(){return this.model.password},set:function(t){this.model.password=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"isMarketingAccepted",{get:function(){return this.model.isMarketingAccepted},set:function(t){this.model.isMarketingAccepted=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"attributes",{get:function(){return this.model.attributes},set:function(t){this.model.attributes=t},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"customerAttributes",{get:function(){return this._customerAttributes},enumerable:!1,configurable:!0}),p.prototype.getAttributeValue=function(t,e){var r={isChecked:void 0,value:void 0,selectedIdList:void 0};if("string"!=typeof e||t.type!==l.TEXT&&t.type!==l.DATETIME&&t.type!==l.CHOICE||(r.value=e),"string"==typeof e&&t.type===l.NUMERIC){var i=parseInt(e);isNaN(i)?r.value=r.value||"":r.value=e}return"boolean"==typeof e&&t.type===l.BOOLEAN&&(r.isChecked=e),"object"==typeof e&&t.type===l.MULTIPLE_CHOICE&&(r.selectedIdList=e),r},Object.defineProperty(p.prototype,"formattedAttributesInput",{get:function(){if(!this._customerAttributes)return null;if(!this._customerAttributes.some((function(t){return void 0!==t.attributeValue.value||void 0!==t.attributeValue.isChecked||void 0!==t.attributeValue.selectedIdList})))return null;var t=[];return this._customerAttributes.map((function(e){var r=e.attributeValue,i=r.selectedIdList,a=r.isChecked,s=r.value;void 0!==i&&l.MULTIPLE_CHOICE&&i.map((function(r){t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:r,value:null})})),e.attribute.type===l.BOOLEAN&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:a?a.toString():"false"}),void 0!==s&&(e.attribute.type!==l.TEXT&&e.attribute.type!==l.NUMERIC||t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:s.toString()}),e.attribute.type===l.CHOICE&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:s,value:null}),e.attribute.type===l.DATETIME&&t.push({customerAttributeId:e.attribute.id,customerAttributeOptionId:null,value:new Date(s).getTime().toString()}))})),t},enumerable:!1,configurable:!0}),p.prototype.validateCustomerAttribute=function(){var t,e=this;this._customerAttributes=null===(t=this._customerAttributes)||void 0===t?void 0:t.map((function(t){var r;return t.validator.isRequired&&e.isFormSubmit&&(t.attribute.type===l.BOOLEAN||t.attributeValue.value||(null===(r=t.attributeValue.selectedIdList)||void 0===r?void 0:r.length)?(t.validator.hasError=!1,t.validator.message=""):(t.validator.hasError=!0,t.validator.message="string"==typeof e.message.requiredRule?e.message.requiredRule:e.message.requiredRule(e.model))),t}))},p.prototype.validateAll=function(){var r;return t(this,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this.validateCustomerAttribute(),[4,this.validator.validateAll()];case 1:return t=e.sent(),i=null===(r=this._customerAttributes)||void 0===r?void 0:r.some((function(t){return t.validator.hasError})),[2,t||i]}}))}))},p.prototype.register=function(){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isFormSubmit=!0,t={isFormError:!1,isSuccess:!1},[4,this.validateAll()];case 1:if(e.sent())return t.isFormError=!0,[2,t];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,n.getInstance().customerStore.register(this.model.firstName,this.model.lastName,this.model.email,this.model.password,this.model.isMarketingAccepted,this.model.attributes||this.formattedAttributesInput||void 0)];case 3:return e.sent()&&(t.isSuccess=!0),[2,t];case 4:return e.sent(),[2,t];case 5:return[2]}}))}))},p}();export{p as RegisterForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.3.0-beta.3",
3
+ "version": "4.3.0-beta.5",
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
  "devDependencies": {
20
20
  "@adyen/adyen-web": "^5.28.2",
21
- "@ikas/storefront-api": "^4.3.0-beta.3",
22
- "@ikas/storefront-config": "^4.3.0-beta.3",
23
- "@ikas/storefront-model-functions": "^4.3.0-beta.3",
24
- "@ikas/storefront-models": "^4.3.0-beta.3",
25
- "@ikas/storefront-providers": "^4.3.0-beta.3",
21
+ "@ikas/storefront-api": "^4.3.0-beta.5",
22
+ "@ikas/storefront-config": "^4.3.0-beta.5",
23
+ "@ikas/storefront-model-functions": "^4.3.0-beta.5",
24
+ "@ikas/storefront-models": "^4.3.0-beta.5",
25
+ "@ikas/storefront-providers": "^4.3.0-beta.5",
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.3.0-beta.3",
56
- "@ikas/storefront-config": "^4.3.0-beta.3",
57
- "@ikas/storefront-model-functions": "^4.3.0-beta.3",
58
- "@ikas/storefront-models": "^4.3.0-beta.3",
59
- "@ikas/storefront-providers": "^4.3.0-beta.3",
55
+ "@ikas/storefront-api": "^4.3.0-beta.5",
56
+ "@ikas/storefront-config": "^4.3.0-beta.5",
57
+ "@ikas/storefront-model-functions": "^4.3.0-beta.5",
58
+ "@ikas/storefront-models": "^4.3.0-beta.5",
59
+ "@ikas/storefront-providers": "^4.3.0-beta.5",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.2.0",
@@ -1 +0,0 @@
1
- import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var o=".adyen-checkout__payment-method__radio--selected {\n background-color: #272727;\n}\n\n.adyen-checkout__button {\n display: none !important;\n}\n\n.adyen-checkout__button:hover {\n background-color: #272727;\n}\n\n.adyen-checkout__input {\n border: 1px solid #e5e4e9;\n background-color: #fff;\n background-clip: padding-box;\n border-radius: 8px;\n display: block;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n outline: none !important;\n transition: padding 0.1s, border-color 0.5s, box-shadow 0.5s;\n box-shadow: 0 0 0 1px transparent;\n -moz-appearance: none;\n -webkit-appearance: none;\n margin: 5px 0;\n caret-color: black;\n}\n\n.adyen-checkout__input--focus.adyen-checkout__input--focus:hover {\n border: 1px solid black !important;\n box-shadow: 0 0 0 1px black !important;\n}\n\n.adyen-checkout__label--focused .adyen-checkout__label__text {\n color: #00112c;\n}\n\n.adyen-checkout__error-text {\n color: #fb4e4e;\n}\n\n.adyen-checkout__label__text--error {\n color: #fb4e4e;\n}\n\n.adyen-checkout__spinner {\n border: 3px solid rgb(0, 0, 0);\n border-radius: 50%;\n border-top-color: transparent;\n}\n";n(o);export{o as default};