@ikas/storefront 4.5.11 → 4.5.13
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.
- package/build/models/data/contact-form/index.d.ts +1 -0
- package/build/models/data/contact-form/index.js +1 -1
- package/build/models/data/image/index.d.ts +1 -0
- package/build/models/data/image/index.js +1 -1
- package/build/models/data/product/image/index.d.ts +1 -0
- package/build/models/data/product/image/index.js +1 -1
- package/build/models/ui/validator/form/contact-form.d.ts +6 -0
- package/build/models/ui/validator/form/contact-form.js +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeAutoObservable as e}from"mobx";var s=function(s){this.email=s.email,this.firstName=s.firstName,this.lastName=s.lastName,this.message=s.message,this.referer=s.referer,e(this)};export{s as IkasContactForm};
|
|
1
|
+
import{makeAutoObservable as e}from"mobx";var s=function(s){this.email=s.email,this.firstName=s.firstName,this.lastName=s.lastName,this.message=s.message,this.referer=s.referer,this.phone=s.phone,e(this)};export{s as IkasContactForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IkasImageFunctions as t}from"@ikas/storefront-model-functions";import{makeObservable as e,observable as
|
|
1
|
+
import{IkasImageFunctions as t}from"@ikas/storefront-model-functions";import{makeObservable as e,observable as i,computed as r}from"mobx";var n=function(){function n(n){var o=this;this.getSrc=function(e){return t.getSrc(o,e)},this.id=n.id,this.isVideo=n.isVideo,this.altText=n.altText,this.fileName=n.fileName,e(this,{id:i,isVideo:i,altText:i,src:r,thumbnailSrc:r})}return Object.defineProperty(n.prototype,"src",{get:function(){return t.getDefaultSrc(this)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"thumbnailSrc",{get:function(){return t.getThumbnailSrc(this)},enumerable:!1,configurable:!0}),n}();export{n as IkasImage};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IkasImage } from "../../image";
|
|
2
2
|
import { IkasProductImage as IProductImage } from "@ikas/storefront-models";
|
|
3
3
|
export declare class IkasProductImage implements IProductImage {
|
|
4
|
+
fileName: string | null;
|
|
4
5
|
imageId: string | null;
|
|
5
6
|
isMain: boolean;
|
|
6
7
|
isVideo: boolean | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as i}from'./../../../../ext/tslib/tslib.es6.js';import{IkasImage as e}from"../../image/index.js";var s=function(s){this.fileName=s.fileName||null,this.imageId=s.imageId||null,this.isMain=s.isMain||!1,this.isVideo=s.isVideo||!1,this.order=s.order,this.image=s.image?new e(i(i({},s.image),{fileName:s.fileName})):null};export{s as IkasProductImage};
|
|
@@ -3,12 +3,14 @@ declare type ContactFormProps<T> = {
|
|
|
3
3
|
requiredRule: ((model: T) => string) | string;
|
|
4
4
|
emailRule: ((model: T) => string) | string;
|
|
5
5
|
minRule: ((model: T) => string) | string;
|
|
6
|
+
phoneRule?: ((model: T) => string) | string;
|
|
6
7
|
};
|
|
7
8
|
};
|
|
8
9
|
declare type ContactFormModel = {
|
|
9
10
|
firstName: string;
|
|
10
11
|
lastName: string;
|
|
11
12
|
email: string;
|
|
13
|
+
phone?: string | null;
|
|
12
14
|
message: string;
|
|
13
15
|
};
|
|
14
16
|
export declare class ContactForm {
|
|
@@ -21,17 +23,21 @@ export declare class ContactForm {
|
|
|
21
23
|
set lastName(value: string);
|
|
22
24
|
get email(): string;
|
|
23
25
|
set email(value: string);
|
|
26
|
+
get phone(): string | null | undefined;
|
|
27
|
+
set phone(value: string | null | undefined);
|
|
24
28
|
get message(): string;
|
|
25
29
|
set message(value: string);
|
|
26
30
|
get hasError(): boolean;
|
|
27
31
|
get firstNameErrorMessage(): string | undefined;
|
|
28
32
|
get lastNameErrorMessage(): string | undefined;
|
|
29
33
|
get emailErrorMessage(): string | undefined;
|
|
34
|
+
get phoneErrorMessage(): string | undefined;
|
|
30
35
|
get messageErrorMessage(): string | undefined;
|
|
31
36
|
get redirect(): string | null | undefined;
|
|
32
37
|
onFirstNameChange: (value: string) => void;
|
|
33
38
|
onLastNameChange: (value: string) => void;
|
|
34
39
|
onEmailChange: (value: string) => void;
|
|
40
|
+
onPhoneChange: (value: string) => void;
|
|
35
41
|
onMessageChange: (value: string) => void;
|
|
36
42
|
validateAll(): Promise<boolean>;
|
|
37
43
|
saveContactForm(): Promise<{
|
|
@@ -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,__assign as t}from'./../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as o,observable as a,action as i}from"mobx";import{Validator as n}from"../index.js";import{IkasBaseStore as l}from"../../../../store/base.js";import"../../../../store/customer/index.js";import"../../../../store/cart/index.js";import{RequiredRule as m,EmailRule as u,PhoneRule as f}from"../rules/index.js";var c=function(){function c(e){var r=this;this.model={firstName:"",lastName:"",email:"",phone:null,message:""},this.onFirstNameChange=function(e){r.firstName=e},this.onLastNameChange=function(e){r.lastName=e},this.onEmailChange=function(e){r.email=e},this.onPhoneChange=function(e){r.phone=e},this.onMessageChange=function(e){r.message=e},s(this,{emailErrorMessage:o,messageErrorMessage:o,firstNameErrorMessage:o,lastNameErrorMessage:o,phoneErrorMessage:o,hasError:o,redirect:o,model:a,validateAll:i,saveContactForm:i});var t=[new m({fieldKey:"firstName",valuePath:"firstName",message:e.message.requiredRule}),new m({fieldKey:"lastName",valuePath:"lastName",message:e.message.requiredRule}),new m({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new m({fieldKey:"message",valuePath:"message",message:e.message.requiredRule}),new u({fieldKey:"email",valuePath:"email",message:e.message.emailRule})];e.message.phoneRule&&t.push(new f({fieldKey:"phone",valuePath:"phone",message:e.message.phoneRule})),this.validator=new n(this.model,t)}return Object.defineProperty(c.prototype,"firstName",{get:function(){return this.model.firstName},set:function(e){this.model.firstName=e},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastName",{get:function(){return this.model.lastName},set:function(e){this.model.lastName=e},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"email",{get:function(){return this.model.email},set:function(e){this.model.email=e},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"phone",{get:function(){return this.model.phone},set:function(e){this.model.phone=e},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"message",{get:function(){return this.model.message},set:function(e){this.model.message=e},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"phoneErrorMessage",{get:function(){var e,r,t;if(null===(r=null===(e=this.validator.results)||void 0===e?void 0:e.phone)||void 0===r?void 0:r.errorMessage)return null===(t=this.validator.results)||void 0===t?void 0:t.phone.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"messageErrorMessage",{get:function(){return this.validator.results.message.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),c.prototype.validateAll=function(){return this.validator.validateAll()},c.prototype.saveContactForm=function(){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e={isFormError:!1,isSuccess:!1},[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,l.getInstance().customerStore.saveContactForm(t({firstName:this.model.firstName,lastName:this.model.lastName,email:this.model.email,message:this.model.message,referer:window.location.href},this.model.phone&&{phone:this.model.phone}))];case 3:return r.sent()&&(e.isSuccess=!0),[2,e];case 4:return r.sent(),[2,e];case 5:return[2]}}))}))},c}();export{c as ContactForm};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.13",
|
|
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.5.
|
|
21
|
-
"@ikas/storefront-config": "^4.5.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.5.
|
|
23
|
-
"@ikas/storefront-models": "^4.5.
|
|
24
|
-
"@ikas/storefront-providers": "^4.5.
|
|
20
|
+
"@ikas/storefront-api": "^4.5.13",
|
|
21
|
+
"@ikas/storefront-config": "^4.5.13",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.5.13",
|
|
23
|
+
"@ikas/storefront-models": "^4.5.13",
|
|
24
|
+
"@ikas/storefront-providers": "^4.5.13",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.2",
|
|
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.2",
|
|
58
|
-
"@ikas/storefront-api": "^4.5.
|
|
59
|
-
"@ikas/storefront-config": "^4.5.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.5.
|
|
61
|
-
"@ikas/storefront-models": "^4.5.
|
|
62
|
-
"@ikas/storefront-providers": "^4.5.
|
|
58
|
+
"@ikas/storefront-api": "^4.5.13",
|
|
59
|
+
"@ikas/storefront-config": "^4.5.13",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.5.13",
|
|
61
|
+
"@ikas/storefront-models": "^4.5.13",
|
|
62
|
+
"@ikas/storefront-providers": "^4.5.13",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|