@ikas/storefront 4.11.0 → 4.11.1
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,3 +1,4 @@
|
|
|
1
|
+
import { LoginResponseErrorCode } from "../../../../store/customer";
|
|
1
2
|
declare type LoginFormProps<T> = {
|
|
2
3
|
message: {
|
|
3
4
|
requiredRule: ((model: T) => string) | string;
|
|
@@ -24,9 +25,11 @@ export declare class LoginForm {
|
|
|
24
25
|
onEmailChange: (value: string) => void;
|
|
25
26
|
onPasswordChange: (value: string) => void;
|
|
26
27
|
validateAll(): Promise<boolean>;
|
|
27
|
-
login(): Promise<
|
|
28
|
-
isFormError: boolean;
|
|
29
|
-
isSuccess: boolean;
|
|
30
|
-
}>;
|
|
28
|
+
login(): Promise<LoginResponse>;
|
|
31
29
|
}
|
|
30
|
+
declare type LoginResponse = {
|
|
31
|
+
isFormError: boolean;
|
|
32
|
+
isSuccess: boolean;
|
|
33
|
+
errorCodes: LoginResponseErrorCode[];
|
|
34
|
+
};
|
|
32
35
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as
|
|
1
|
+
import{__awaiter as e,__generator as r}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as t,observable as o,action as i}from"mobx";import{Validator as a}from"../index.js";import{IkasBaseStore as n}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{RequiredRule as l,EmailRule as u,MinRule as d}from"../rules/index.js";var m=function(){function m(e){var r=this;this.model={email:"",password:""},this.onEmailChange=function(e){r.email=e},this.onPasswordChange=function(e){r.password=e},s(this,{emailErrorMessage:t,passwordErrorMessage:t,hasError:t,redirect:t,email:t,password:t,model:o,validateAll:i,login:i}),this.validator=new a(this.model,[new l({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new l({fieldKey:"password",valuePath:"password",message:e.message.requiredRule}),new u({fieldKey:"email",valuePath:"email",message:e.message.emailRule}),new d({fieldKey:"password",valuePath:"password",minValue:6,message:e.message.minRule})])}return Object.defineProperty(m.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"email",{get:function(){return this.model.email},set:function(e){this.model.email=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"password",{get:function(){return this.model.password},set:function(e){this.model.password=e},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"passwordErrorMessage",{get:function(){return this.validator.results.password.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),m.prototype.validateAll=function(){return this.validator.validateAll()},m.prototype.login=function(){return e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return e={isFormError:!1,isSuccess:!1,errorCodes:[]},[4,this.validateAll()];case 1:if(r.sent())return e.isFormError=!0,[2,e];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,n.getInstance().customerStore.customerLogin(this.model.email,this.model.password)];case 3:return s=r.sent(),e.isSuccess=s.isSuccess,e.errorCodes=s.errorCodes,[2,e];case 4:return r.sent(),[2,e];case 5:return[2]}}))}))},m}();export{m as LoginForm};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.1",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.11.
|
|
21
|
-
"@ikas/storefront-config": "^4.11.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.11.
|
|
23
|
-
"@ikas/storefront-models": "^4.11.
|
|
24
|
-
"@ikas/storefront-providers": "^4.11.
|
|
20
|
+
"@ikas/storefront-api": "^4.11.1",
|
|
21
|
+
"@ikas/storefront-config": "^4.11.1",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.11.1",
|
|
23
|
+
"@ikas/storefront-models": "^4.11.1",
|
|
24
|
+
"@ikas/storefront-providers": "^4.11.1",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.3",
|
|
58
|
-
"@ikas/storefront-api": "^4.11.
|
|
59
|
-
"@ikas/storefront-config": "^4.11.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.11.
|
|
61
|
-
"@ikas/storefront-models": "^4.11.
|
|
62
|
-
"@ikas/storefront-providers": "^4.11.
|
|
58
|
+
"@ikas/storefront-api": "^4.11.1",
|
|
59
|
+
"@ikas/storefront-config": "^4.11.1",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.11.1",
|
|
61
|
+
"@ikas/storefront-models": "^4.11.1",
|
|
62
|
+
"@ikas/storefront-providers": "^4.11.1",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|