@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.
@@ -5,5 +5,6 @@ export declare class IkasContactForm implements IContactForm {
5
5
  lastName: string;
6
6
  message: string;
7
7
  referer: string;
8
+ phone?: string | null;
8
9
  constructor(data: IContactForm);
9
10
  }
@@ -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};
@@ -3,6 +3,7 @@ export declare class IkasImage implements IImage {
3
3
  id: string;
4
4
  isVideo: boolean;
5
5
  altText?: string | null;
6
+ fileName?: string | null;
6
7
  constructor(data: IImage);
7
8
  get src(): string;
8
9
  get thumbnailSrc(): string;
@@ -1 +1 @@
1
- import{IkasImageFunctions as t}from"@ikas/storefront-model-functions";import{makeObservable as e,observable as r,computed as i}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,e(this,{id:r,isVideo:r,altText:r,src:i,thumbnailSrc:i})}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
+ 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{IkasImage as i}from"../../image/index.js";var e=function(e){this.imageId=e.imageId||null,this.isMain=e.isMain||!1,this.isVideo=e.isVideo||!1,this.order=e.order,this.image=e.image?new i(e.image):null};export{e as IkasProductImage};
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 t,computed as s,observable as a,action as i}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 l,EmailRule as m}from"../rules/index.js";var u=function(){function u(e){var r=this;this.model={firstName:"",lastName:"",email:"",message:""},this.onFirstNameChange=function(e){r.firstName=e},this.onLastNameChange=function(e){r.lastName=e},this.onEmailChange=function(e){r.email=e},this.onMessageChange=function(e){r.message=e},t(this,{emailErrorMessage:s,messageErrorMessage:s,firstNameErrorMessage:s,lastNameErrorMessage:s,hasError:s,redirect:s,model:a,validateAll:i,saveContactForm:i}),this.validator=new o(this.model,[new l({fieldKey:"firstName",valuePath:"firstName",message:e.message.requiredRule}),new l({fieldKey:"lastName",valuePath:"lastName",message:e.message.requiredRule}),new l({fieldKey:"email",valuePath:"email",message:e.message.requiredRule}),new l({fieldKey:"message",valuePath:"message",message:e.message.requiredRule}),new m({fieldKey:"email",valuePath:"email",message:e.message.emailRule})])}return Object.defineProperty(u.prototype,"firstName",{get:function(){return this.model.firstName},set:function(e){this.model.firstName=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"lastName",{get:function(){return this.model.lastName},set:function(e){this.model.lastName=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"email",{get:function(){return this.model.email},set:function(e){this.model.email=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"message",{get:function(){return this.model.message},set:function(e){this.model.message=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"hasError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"firstNameErrorMessage",{get:function(){return this.validator.results.firstName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"lastNameErrorMessage",{get:function(){return this.validator.results.lastName.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"emailErrorMessage",{get:function(){return this.validator.results.email.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"messageErrorMessage",{get:function(){return this.validator.results.message.errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"redirect",{get:function(){if("undefined"!=typeof window)return new URLSearchParams(window.location.search).get("redirect")},enumerable:!1,configurable:!0}),u.prototype.validateAll=function(){return this.validator.validateAll()},u.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,n.getInstance().customerStore.saveContactForm({firstName:this.model.firstName,lastName:this.model.lastName,email:this.model.email,message:this.model.message,referer:window.location.href})];case 3:return r.sent()&&(e.isSuccess=!0),[2,e];case 4:return r.sent(),[2,e];case 5:return[2]}}))}))},u}();export{u as ContactForm};
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.11",
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.11",
21
- "@ikas/storefront-config": "^4.5.11",
22
- "@ikas/storefront-model-functions": "^4.5.11",
23
- "@ikas/storefront-models": "^4.5.11",
24
- "@ikas/storefront-providers": "^4.5.11",
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.11",
59
- "@ikas/storefront-config": "^4.5.11",
60
- "@ikas/storefront-model-functions": "^4.5.11",
61
- "@ikas/storefront-models": "^4.5.11",
62
- "@ikas/storefront-providers": "^4.5.11",
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",