@ikas/storefront 6.1.0-beta.396 → 6.1.0-beta.397

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{FormItem as r}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as a}from"../form-item/model.js";import{Button as i}from"../button/index.js";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../utils/i18n.js";import{QuickRegistrationCompleted as m}from"./completed.js";import{QuickRegistrationViewModel as c}from"./model.js";import n from"./style.module.scss.js";var l=t((function(t){var l=t.vm,u=s().t,p=e.useMemo((function(){return new c(l,u)}),[]);return l.checkout.customer?p.isRegisteredCustomer?e.createElement(m,{vm:l}):e.createElement("div",{className:n.Container},e.createElement("div",{className:n.Title},u("checkout-page:quickRegistration.title")),e.createElement("div",{className:n.SubTitle},u("checkout-page:quickRegistration.subtitle")),e.createElement("div",{className:n.EmailContainer},e.createElement("div",{className:n.Label},u("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:n.Email},l.checkout.customer.email)),e.createElement(r,{name:"password",type:o.TEXT,inputType:a.PASSWORD,label:u("checkout-page:password"),value:p.password,onChange:p.onPasswordChange,hasError:!!p.passwordErrorMessage,errorText:p.passwordErrorMessage}),e.createElement(i,{style:{width:"100%",marginTop:16},text:u("checkout-page:actions.signup"),isLoading:p.isLoading,onClick:p.onSubmit})):null}));export{l as QuickRegistration};
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import{FormItem as r}from"../form-item/index.js";import{FormItemType as o,FormItemInputType as i}from"../form-item/model.js";import{Button as a}from"../button/index.js";import"@ikas/storefront-config";import{useTranslation as s}from"../../../../utils/i18n.js";import m from"../notification-box/index.js";import{QuickRegistrationCompleted as n}from"./completed.js";import{QuickRegistrationVerificationSent as c}from"./verification-sent.js";import{QuickRegistrationViewModel as l}from"./model.js";import p from"./style.module.scss.js";var u=t((function(t){var u=t.vm,d=s().t,g=e.useMemo((function(){return new l(u,d)}),[]);return u.checkout.customer?g.isRegisteredCustomer?e.createElement(n,{vm:u}):g.isVerificationEmailSent?e.createElement(c,{vm:u}):e.createElement("div",{className:p.Container},e.createElement("div",{className:p.Title},d("checkout-page:quickRegistration.title")),e.createElement("div",{className:p.SubTitle},d("checkout-page:quickRegistration.subtitle")),e.createElement("div",{className:p.EmailContainer},e.createElement("div",{className:p.Label},d("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:p.Email},u.checkout.customer.email)),e.createElement(r,{name:"password",type:o.TEXT,inputType:i.PASSWORD,label:d("checkout-page:password"),value:g.password,onChange:g.onPasswordChange,hasError:!!g.passwordErrorMessage,errorText:g.passwordErrorMessage}),!!g.errorMessage&&e.createElement("div",{style:{marginTop:16}},e.createElement(m,{type:"error",content:g.errorMessage,onClose:g.clearErrorMessage,ignoreScroll:!0})),e.createElement(a,{style:{width:"100%",marginTop:16},text:d("checkout-page:actions.signup"),isLoading:g.isLoading,onClick:g.onSubmit})):null}));export{u as QuickRegistration};
@@ -6,14 +6,19 @@ export declare class QuickRegistrationViewModel {
6
6
  private validator;
7
7
  private _isLoading;
8
8
  private _isRegisteredCustomer;
9
+ private _isVerificationEmailSent;
10
+ private _errorMessage;
9
11
  t: TFunction;
10
12
  constructor(vm: CheckoutViewModel, t: TFunction);
11
13
  get password(): string;
12
14
  get isLoading(): boolean;
13
15
  get isRegisteredCustomer(): boolean;
16
+ get isVerificationEmailSent(): boolean;
17
+ get errorMessage(): string | null;
14
18
  get hasError(): boolean;
15
19
  get passwordErrorMessage(): string | undefined;
16
20
  onPasswordChange: (value: string) => void;
21
+ clearErrorMessage: () => void;
17
22
  validateAll: () => Promise<boolean>;
18
23
  onSubmit: () => Promise<void>;
19
24
  }
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o,observable as i}from"mobx";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/customer-form-data-input/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/order-transaction-with-prices/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/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/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{Validator as r}from"../../../../models/ui/validator/index.js";import{RequiredRule as s,MinRule as d}from"../../../../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 a=function(){function a(a,m){var n=this;this.model={password:""},this._isLoading=!1,this._isRegisteredCustomer=!1,this.onPasswordChange=function(e){n.model.password=e},this.validateAll=function(){return n.validator.validateAll()},this.onSubmit=function(){return e(n,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,this.validateAll()];case 1:return t.sent()?[3,3]:(this._isLoading=!0,[4,this.vm.registerCustomer(this.password)]);case 2:(null==(e=t.sent())?void 0:e.isSuccess)&&(this._isRegisteredCustomer=!0),this._isLoading=!1,t.label=3;case 3:return[2]}}))}))},o(this,{model:i}),this.vm=a,this.t=m,this.validator=new r(this.model,[new s({fieldKey:"password",valuePath:"password",message:m("checkout-page:passwordRequiredError")}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:m("checkout-page:passwordMinError",{value:6})})])}return Object.defineProperty(a.prototype,"password",{get:function(){return this.model.password},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isRegisteredCustomer",{get:function(){return this._isRegisteredCustomer},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),a}();export{a as QuickRegistrationViewModel};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeAutoObservable as o,observable as r}from"mobx";import{IkasRegisterError as i}from"@ikas/storefront-api";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/customer-form-data-input/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/order-transaction-with-prices/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/storefront-popup/storefront-popup-display-settings/index.js";import"../../../../models/data/storefront-popup/storefront-popup-page-filter/index.js";import"../../../../models/data/storefront-popup/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{Validator as s}from"../../../../models/ui/validator/index.js";import{RequiredRule as a,MinRule as d}from"../../../../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 m=function(){function m(m,n){var l=this;this.model={password:""},this._isLoading=!1,this._isRegisteredCustomer=!1,this._isVerificationEmailSent=!1,this._errorMessage=null,this.onPasswordChange=function(e){l.model.password=e,l._errorMessage=null},this.clearErrorMessage=function(){l._errorMessage=null},this.validateAll=function(){return l.validator.validateAll()},this.onSubmit=function(){return e(l,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return[4,this.validateAll()];case 1:if(t.sent()||this._isLoading)return[3,6];this._isLoading=!0,this._errorMessage=null,t.label=2;case 2:return t.trys.push([2,4,5,6]),[4,this.vm.registerCustomer(this.password)];case 3:return(null==(e=t.sent())?void 0:e.isSuccess)?(this._isRegisteredCustomer=!0,[2]):(o=(null==e?void 0:e.errorCodes)||[]).includes(i.EMAIL_IS_NOT_VERIFIED)?(this._isVerificationEmailSent=!0,[2]):o.includes(i.CUSTOMER_EMAIL_ALREADY_EXISTS)?(this._errorMessage=this.t("checkout-page:quickRegistration.errorEmailAlreadyExists"),[2]):(this._errorMessage=this.t("checkout-page:quickRegistration.errorGeneric"),[3,6]);case 4:return t.sent(),this._errorMessage=this.t("checkout-page:quickRegistration.errorGeneric"),[3,6];case 5:return this._isLoading=!1,[7];case 6:return[2]}}))}))},o(this,{model:r}),this.vm=m,this.t=n,this.validator=new s(this.model,[new a({fieldKey:"password",valuePath:"password",message:n("checkout-page:passwordRequiredError")}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:n("checkout-page:passwordMinError",{value:6})})])}return Object.defineProperty(m.prototype,"password",{get:function(){return this.model.password},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isRegisteredCustomer",{get:function(){return this._isRegisteredCustomer},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"isVerificationEmailSent",{get:function(){return this._isVerificationEmailSent},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),m}();export{m as QuickRegistrationViewModel};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const QuickRegistrationVerificationSent: React.FC<Props>;
7
+ export {};
@@ -0,0 +1 @@
1
+ import*as e from"react";import{observer as t}from"mobx-react-lite";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import a from"../svg/success-circle.js";import c from"./style.module.scss.js";var m=t((function(t){var m,o=t.vm,r=i().t;return e.createElement("div",{className:c.Container},e.createElement("div",{className:c.TitleContainer},e.createElement(a,{className:c.Icon}),e.createElement("div",{className:c.CompletedTitle},r("checkout-page:quickRegistration.verificationSentTitle"))),e.createElement("div",{className:c.SubTitle},r("checkout-page:quickRegistration.verificationSentSubtitle")),!!(null===(m=o.checkout.customer)||void 0===m?void 0:m.email)&&e.createElement("div",{className:c.EmailContainer,style:{marginBottom:0}},e.createElement("div",{className:c.Label},r("checkout-page:quickRegistration.accountEmail"),":"),e.createElement("div",{className:c.Email},o.checkout.customer.email)))}));export{m as QuickRegistrationVerificationSent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.396",
3
+ "version": "6.1.0-beta.397",
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.396",
27
- "@ikas/storefront-config": "^6.1.0-beta.396",
28
- "@ikas/storefront-model-functions": "^6.1.0-beta.396",
29
- "@ikas/storefront-models": "^6.1.0-beta.396",
30
- "@ikas/storefront-providers": "^6.1.0-beta.396",
26
+ "@ikas/storefront-api": "^6.1.0-beta.397",
27
+ "@ikas/storefront-config": "^6.1.0-beta.397",
28
+ "@ikas/storefront-model-functions": "^6.1.0-beta.397",
29
+ "@ikas/storefront-models": "^6.1.0-beta.397",
30
+ "@ikas/storefront-providers": "^6.1.0-beta.397",
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.396",
66
- "@ikas/storefront-config": "^6.1.0-beta.396",
67
- "@ikas/storefront-model-functions": "^6.1.0-beta.396",
68
- "@ikas/storefront-models": "^6.1.0-beta.396",
69
- "@ikas/storefront-providers": "^6.1.0-beta.396",
65
+ "@ikas/storefront-api": "^6.1.0-beta.397",
66
+ "@ikas/storefront-config": "^6.1.0-beta.397",
67
+ "@ikas/storefront-model-functions": "^6.1.0-beta.397",
68
+ "@ikas/storefront-models": "^6.1.0-beta.397",
69
+ "@ikas/storefront-providers": "^6.1.0-beta.397",
70
70
  "mobx": "^6.1.3",
71
71
  "mobx-react-lite": "^3.1.5",
72
72
  "next": "12.2.0",