@ikas/storefront 6.1.0-beta.100 → 6.1.0-beta.101

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 e from"react";import{observer as t}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";import{generateRandomId as o}from"../../../helpers/index.js";import{PhoneNumberInput as r}from"../phone-input-item-view/index.js";var n=t((function(t){var n=e.useState(!1),a=n[0],l=n[1];e.useRef(null);var i=e.useMemo((function(){return o()}),[]),c=t.placeholder,s=t.isRequired,u=t.inputLabel;t.updateCurrentInfo;var p=t.validationErrorMessage,d=t.formInputSettings,m=t.value,f=t.onValueChange,x=t.isPhoneInput,h=t.sfProps,v={width:"100%",backgroundColor:d.bgColor?"".concat(d.bgColor):"transparent",border:"".concat(d.borderWidth,"px solid ").concat(a?d.focusBorderColor:d.borderColor),borderRadius:"".concat(d.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(d.height,"px"),outline:"none"},g=function(e){f(e),s&&s.hasError&&e.length>0&&(s.hasError=!1)},E=s?((null==c?void 0:c.text)||"")+" *":(null==c?void 0:c.text)||"";return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(u||s)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},u&&e.createElement("label",{style:{color:d.titleColor,fontSize:"14px"}},u.text)),s&&s.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},s.validationErrorMessage),!!p&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},p)),x?e.createElement(r,{onChange:function(e){return g(e)},placeholder:E,value:m||"",inputStyle:v,sfProps:h,className:"ikas-form-input-item-view-".concat(i),setIsFocused:l}):e.createElement("input",{type:"text",placeholder:E,value:m||"",onChange:function(e){return g(e.target.value)},style:v,onFocus:function(){return l(!0)},onBlur:function(){return l(!1)},className:"ikas-form-input-item-view-".concat(i)}),e.createElement("style",null,"\n .ikas-form-input-item-view-".concat(i,"::placeholder {\n color: ").concat(d.placeholderColor," !important;\n }\n ")))}));export{n as default};
1
+ import e from"react";import{observer as t}from"../../../../../../../mobx-react/dist/mobxreact.esm.js";import{generateRandomId as o}from"../../../helpers/index.js";import{PhoneNumberInput as r}from"../phone-input-item-view/index.js";var n=t((function(t){var n=e.useState(!1),a=n[0],l=n[1];e.useRef(null);var i=e.useMemo((function(){return o()}),[]),c=t.placeholder,s=t.isRequired,u=t.inputLabel;t.updateCurrentInfo;var p=t.validationErrorMessage,d=t.formInputSettings,m=t.value,f=t.onValueChange,x=t.isPhoneInput,h=t.sfProps,v={width:"100%",backgroundColor:d.bgColor?"".concat(d.bgColor):"transparent",border:"".concat(d.borderWidth,"px solid ").concat(a?d.focusBorderColor:d.borderColor),color:"".concat(d.textColor),borderRadius:"".concat(d.borderRadius,"px"),fontSize:"14px",padding:"10px 12px",height:"".concat(d.height,"px"),outline:"none"},g=function(e){f(e),s&&s.hasError&&e.length>0&&(s.hasError=!1)},E=s?((null==c?void 0:c.text)||"")+" *":(null==c?void 0:c.text)||"";return e.createElement("div",{style:{width:"100%",display:"flex",gap:2,flexDirection:"column"}},(u||s)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:"6px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"}},u&&e.createElement("label",{style:{color:d.titleColor,fontSize:"14px"}},u.text)),s&&s.hasError&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},s.validationErrorMessage),!!p&&e.createElement("div",{style:{color:"red",fontSize:"12px"}},p)),x?e.createElement(r,{onChange:function(e){return g(e)},placeholder:E,value:m||"",inputStyle:v,sfProps:h,className:"ikas-form-input-item-view-".concat(i),setIsFocused:l}):e.createElement("input",{type:"text",placeholder:E,value:m||"",onChange:function(e){return g(e.target.value)},style:v,onFocus:function(){return l(!0)},onBlur:function(){return l(!1)},className:"ikas-form-input-item-view-".concat(i)}),e.createElement("style",null,"\n // change written input text color\n .ikas-form-input-item-view-".concat(i," {\n color: ").concat(d.textColor," !important;\n }\n\n .ikas-form-input-item-view-").concat(i,"::placeholder {\n color: ").concat(d.placeholderColor," !important;\n }\n ")))}));export{n as default};
@@ -1 +1 @@
1
- import{makeObservable as o,observable as r}from"mobx";import{IkasPopupRendererFontFamily as t}from"../../base/index.js";var e=function(e){var l,s;void 0===e&&(e={}),this.formInputSettings=e.formInputSettings?new i(e.formInputSettings):new i({borderColor:"#E3E8EF",focusBorderColor:"#000000"}),this.gapBetweenItems=null!==(l=e.gapBetweenItems)&&void 0!==l?l:12,this.fontFamily=new t(e.fontFamily),this.fontSize=null!==(s=e.fontSize)&&void 0!==s?s:14,o(this,{formInputSettings:r,gapBetweenItems:r,fontFamily:r,fontSize:r})},i=function(t){var e,i,l;void 0===t&&(t={}),this.bgColor=t.bgColor||"",this.borderWidth=null!==(e=t.borderWidth)&&void 0!==e?e:1,this.borderRadius=null!==(i=t.borderRadius)&&void 0!==i?i:4,this.borderColor=t.borderColor||"",this.focusBorderColor=t.focusBorderColor||"",this.height=null!==(l=t.height)&&void 0!==l?l:40,this.placeholderColor=t.placeholderColor?t.placeholderColor:"#697586",this.titleColor=t.titleColor?t.titleColor:"#121926",this.checkboxTextColor=t.checkboxTextColor?t.checkboxTextColor:"#121926",o(this,{bgColor:r,borderWidth:r,borderRadius:r,borderColor:r,focusBorderColor:r,height:r,placeholderColor:r,titleColor:r,checkboxTextColor:r})};export{i as FormInputSettings,e as FormSettings};
1
+ import{makeObservable as o,observable as t}from"mobx";import{IkasPopupRendererFontFamily as r}from"../../base/index.js";var e=function(e){var l,s;void 0===e&&(e={}),this.formInputSettings=e.formInputSettings?new i(e.formInputSettings):new i({borderColor:"#E3E8EF",focusBorderColor:"#000000"}),this.gapBetweenItems=null!==(l=e.gapBetweenItems)&&void 0!==l?l:12,this.fontFamily=new r(e.fontFamily),this.fontSize=null!==(s=e.fontSize)&&void 0!==s?s:14,o(this,{formInputSettings:t,gapBetweenItems:t,fontFamily:t,fontSize:t})},i=function(r){var e,i,l;void 0===r&&(r={}),this.bgColor=r.bgColor||"",this.borderWidth=null!==(e=r.borderWidth)&&void 0!==e?e:1,this.borderRadius=null!==(i=r.borderRadius)&&void 0!==i?i:4,this.borderColor=r.borderColor||"",this.focusBorderColor=r.focusBorderColor||"",this.height=null!==(l=r.height)&&void 0!==l?l:40,this.textColor=r.textColor||"#121926",this.placeholderColor=r.placeholderColor?r.placeholderColor:"#697586",this.titleColor=r.titleColor?r.titleColor:"#121926",this.checkboxTextColor=r.checkboxTextColor?r.checkboxTextColor:"#121926",o(this,{bgColor:t,borderWidth:t,borderRadius:t,borderColor:t,focusBorderColor:t,height:t,placeholderColor:t,titleColor:t,checkboxTextColor:t,textColor:t})};export{i as FormInputSettings,e as FormSettings};
@@ -1 +1 @@
1
- import{__extends as t,__assign as e}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as r,action as n}from"mobx";import{PopupElementTypeEnum as i,BaseElement as s}from"../base/index.js";import{ButtonElement as a}from"../button/index.js";import{FormSettings as m}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as l}from"./customer-surname/index.js";import{CustomerEmailFormItem as d}from"./customer-email/index.js";import{CustomerPhoneFormItem as p}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as E}from"./customer-birthday/index.js";import{CustomerGenderFormItem as c}from"./customer-gender/index.js";import{CheckboxFormItem as C}from"./checkbox/index.js";import{CustomerAttributeFormItem as h}from"./customer-attribute/index.js";import{Popup as T}from"../../../../index.js";var M;!function(t){t.CUSTOMER_NAME="CUSTOMER_NAME",t.CUSTOMER_SURNAME="CUSTOMER_SURNAME",t.CUSTOMER_EMAIL="CUSTOMER_EMAIL",t.CUSTOMER_PHONE="CUSTOMER_PHONE",t.CUSTOMER_BIRTHDAY="CUSTOMER_BIRTHDAY",t.CUSTOMER_GENDER="CUSTOMER_GENDER",t.CHECKBOX_FORM_ITEM="CHECKBOX_FORM_ITEM",t.CUSTOMER_ATTRIBUTE="CUSTOMER_ATTRIBUTE"}(M||(M={}));var f=function(e){function s(t,s){void 0===t&&(t={});var u,l,d,p,E=this;return(E=e.call(this,t)||this).type=i.FORM,E.rows=t.rows?t.rows.map((function(t){return new R(t)})):[],E.formSettings=t.formSettings||new m,E.buttonSettings=t.buttonSettings||new a({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),E.bgColor=t.bgColor||"",E.outerVerticalPadding=null!==(u=t.outerVerticalPadding)&&void 0!==u?u:10,E.outerHorizontalPadding=null!==(l=t.outerHorizontalPadding)&&void 0!==l?l:0,E.verticalPadding=null!==(d=t.verticalPadding)&&void 0!==d?d:0,E.horizontalPadding=null!==(p=t.horizontalPadding)&&void 0!==p?p:0,o(E,{rows:r,formSettings:r,buttonSettings:r,bgColor:r,addNewElement:n.bound}),0===E.rows.length&&1===s&&E.addNewElement(M.CUSTOMER_EMAIL),E}return t(s,e),s.prototype.addNewElement=function(t){var e=new R({order:this.rows.length,columns:[new S({type:t,order:0})]});this.rows.push(e)},s}(s),R=function(){function t(t){var e;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(e=t.order)&&void 0!==e?e:0,this.columns=t.columns?t.columns.map((function(t){return new S(t)})):[],o(this,{id:r,order:r,columns:r,addNewElement:n.bound,changeColumnSort:n.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new S({type:t,order:this.columns.length}))},t.prototype.changeColumnSort=function(){this.columns.forEach((function(t,e){0===e?t.order=t.order+1:1===e&&(t.order=t.order-1)})),this.columns=this.columns.sort((function(t,e){return t.order-e.order}))},t}(),S=function(){function t(t){var e;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(e=t.order)&&void 0!==e?e:0,this.type=t.type||M.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),o(this,{id:r,order:r,type:r,formItem:r,setFormItems:n.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case M.CUSTOMER_NAME:return new u(t?e({},t):{inputLabel:new w({text:T.t("popup:initialClassTranslations.firstName")})});case M.CUSTOMER_SURNAME:return new l(t?e({},t):{inputLabel:new w({text:T.t("popup:initialClassTranslations.lastName")})});case M.CUSTOMER_EMAIL:return new d(t?e({},t):{inputLabel:new w({text:T.t("popup:initialClassTranslations.email")})});case M.CUSTOMER_PHONE:return new p(t?e({},t):{inputLabel:new w({text:T.t("popup:initialClassTranslations.phone")})});case M.CUSTOMER_BIRTHDAY:return new E(t?e({},t):{inputLabel:new w({text:T.t("popup:initialClassTranslations.birthday")})});case M.CUSTOMER_GENDER:return new c(t?e({},t):{inputLabel:new w({text:T.t("popup:initialClassTranslations.gender")})});case M.CHECKBOX_FORM_ITEM:return new C(e({},t));case M.CUSTOMER_ATTRIBUTE:return new h(e({},t))}},t}(),w=function(t){void 0===t&&(t={}),this.text=t.text||T.t("popup:initialClassTranslations.inputLabel"),o(this,{text:r})},g=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||T.t("popup:initialClassTranslations.requiredFieldErrorMessage"),this.hasError=t.hasError||!1,o(this,{validationErrorMessage:r,hasError:r})},O=function(t){void 0===t&&(t={}),this.text=t.text||T.t("popup:initialClassTranslations.placeholder"),o(this,{text:r})};export{S as FormColumn,f as FormElement,M as FormItemTypeEnum,R as FormRow,w as InputLabel,O as InputPlaceholder,g as RequiredInput};
1
+ import{__extends as t,__assign as e}from"../../../../../../ext/tslib/tslib.es6.mjs.js";import{makeObservable as o,observable as r,action as n}from"mobx";import{PopupElementTypeEnum as i,BaseElement as s}from"../base/index.js";import{ButtonElement as a}from"../button/index.js";import{FormSettings as m}from"./form-settings/index.js";import{CustomerNameFormItem as u}from"./customer-name/index.js";import{CustomerSurnameFormItem as l}from"./customer-surname/index.js";import{CustomerEmailFormItem as d}from"./customer-email/index.js";import{CustomerPhoneFormItem as p}from"./customer-phone/index.js";import{CustomerBirthdayFormItem as E}from"./customer-birthday/index.js";import{CustomerGenderFormItem as c}from"./customer-gender/index.js";import{CheckboxFormItem as C}from"./checkbox/index.js";import{CustomerAttributeFormItem as h}from"./customer-attribute/index.js";import{Popup as T}from"../../../../index.js";var M,R;(R=M||(M={})).CUSTOMER_NAME="CUSTOMER_NAME",R.CUSTOMER_SURNAME="CUSTOMER_SURNAME",R.CUSTOMER_EMAIL="CUSTOMER_EMAIL",R.CUSTOMER_PHONE="CUSTOMER_PHONE",R.CUSTOMER_BIRTHDAY="CUSTOMER_BIRTHDAY",R.CUSTOMER_GENDER="CUSTOMER_GENDER",R.CHECKBOX_FORM_ITEM="CHECKBOX_FORM_ITEM",R.CUSTOMER_ATTRIBUTE="CUSTOMER_ATTRIBUTE";var f=function(e){function s(t,s){void 0===t&&(t={});var u,l,d,p,E=this;return(E=e.call(this,t)||this).type=i.FORM,E.rows=t.rows?t.rows.map((function(t){return new S(t)})):[],E.formSettings=t.formSettings||new m,E.buttonSettings=t.buttonSettings||new a({outerHorizontalPadding:0,outerVerticalPadding:0,buttonBgColor:"#000000",borderColor:"#000000"}),E.bgColor=t.bgColor||"",E.outerVerticalPadding=null!==(u=t.outerVerticalPadding)&&void 0!==u?u:10,E.outerHorizontalPadding=null!==(l=t.outerHorizontalPadding)&&void 0!==l?l:0,E.verticalPadding=null!==(d=t.verticalPadding)&&void 0!==d?d:0,E.horizontalPadding=null!==(p=t.horizontalPadding)&&void 0!==p?p:0,o(E,{rows:r,formSettings:r,buttonSettings:r,bgColor:r,addNewElement:n.bound}),0===E.rows.length&&1===s&&E.addNewElement(M.CUSTOMER_EMAIL),E}return t(s,e),s.prototype.addNewElement=function(t){var e=new S({order:this.rows.length,columns:[new w({type:t,order:0})]});this.rows.push(e)},s}(s),S=function(){function t(t){var e;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(e=t.order)&&void 0!==e?e:0,this.columns=t.columns?t.columns.map((function(t){return new w(t)})):[],o(this,{id:r,order:r,columns:r,addNewElement:n.bound,changeColumnSort:n.bound})}return t.prototype.addNewElement=function(t){this.columns.push(new w({type:t,order:this.columns.length}))},t.prototype.changeColumnSort=function(){this.columns.forEach((function(t,e){0===e?t.order=t.order+1:1===e&&(t.order=t.order-1)})),this.columns=this.columns.sort((function(t,e){return t.order-e.order}))},t}(),w=function(){function t(t){var e;void 0===t&&(t={}),this.id=t.id||Date.now().toString(),this.order=null!==(e=t.order)&&void 0!==e?e:0,this.type=t.type||M.CUSTOMER_NAME,this.formItem=this.setFormItems(t.formItem),o(this,{id:r,order:r,type:r,formItem:r,setFormItems:n.bound})}return t.prototype.setFormItems=function(t){switch(this.type){case M.CUSTOMER_NAME:return new u(t?e({},t):{inputLabel:new g({text:T.t("popup:initialClassTranslations.firstName")})});case M.CUSTOMER_SURNAME:return new l(t?e({},t):{inputLabel:new g({text:T.t("popup:initialClassTranslations.lastName")})});case M.CUSTOMER_EMAIL:return new d(t?e({},t):{inputLabel:new g({text:T.t("popup:initialClassTranslations.email")})});case M.CUSTOMER_PHONE:return new p(t?e({},t):{inputLabel:new g({text:T.t("popup:initialClassTranslations.phone")})});case M.CUSTOMER_BIRTHDAY:return new E(t?e({},t):{inputLabel:new g({text:T.t("popup:initialClassTranslations.birthday")})});case M.CUSTOMER_GENDER:return new c(t?e({},t):{inputLabel:new g({text:T.t("popup:initialClassTranslations.gender")})});case M.CHECKBOX_FORM_ITEM:return new C(e({},t));case M.CUSTOMER_ATTRIBUTE:return new h(e({},t))}},t}(),g=function(t){void 0===t&&(t={}),this.text=t.text||T.t("popup:initialClassTranslations.inputLabel"),o(this,{text:r})},O=function(t){void 0===t&&(t={}),this.validationErrorMessage=t.validationErrorMessage||T.t("popup:initialClassTranslations.requiredFieldErrorMessage"),this.hasError=t.hasError||!1,o(this,{validationErrorMessage:r,hasError:r})},_=function(t){void 0===t&&(t={}),this.text=t.text||T.t("popup:initialClassTranslations.placeholder"),o(this,{text:r})};export{w as FormColumn,f as FormElement,M as FormItemTypeEnum,S as FormRow,g as InputLabel,_ as InputPlaceholder,O as RequiredInput};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "6.1.0-beta.100",
3
+ "version": "6.1.0-beta.101",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -17,15 +17,15 @@
17
17
  "build": "rm -rf build && rollup -c"
18
18
  },
19
19
  "dependencies": {
20
- "@ikas/popup-renderer": "1.0.206",
20
+ "@ikas/popup-renderer": "1.0.207",
21
21
  "swiper": "11.0.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@ikas/storefront-api": "^6.1.0-beta.100",
25
- "@ikas/storefront-config": "^6.1.0-beta.100",
26
- "@ikas/storefront-model-functions": "^6.1.0-beta.100",
27
- "@ikas/storefront-models": "^6.1.0-beta.100",
28
- "@ikas/storefront-providers": "^6.1.0-beta.100",
24
+ "@ikas/storefront-api": "^6.1.0-beta.101",
25
+ "@ikas/storefront-config": "^6.1.0-beta.101",
26
+ "@ikas/storefront-model-functions": "^6.1.0-beta.101",
27
+ "@ikas/storefront-models": "^6.1.0-beta.101",
28
+ "@ikas/storefront-providers": "^6.1.0-beta.101",
29
29
  "@ikas/localized-address": "1.0.0-beta.6",
30
30
  "@adyen/adyen-web": "^5.57.0",
31
31
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -60,11 +60,11 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@ikas/localized-address": "1.0.0-beta.6",
63
- "@ikas/storefront-api": "^6.1.0-beta.100",
64
- "@ikas/storefront-config": "^6.1.0-beta.100",
65
- "@ikas/storefront-model-functions": "^6.1.0-beta.100",
66
- "@ikas/storefront-models": "^6.1.0-beta.100",
67
- "@ikas/storefront-providers": "^6.1.0-beta.100",
63
+ "@ikas/storefront-api": "^6.1.0-beta.101",
64
+ "@ikas/storefront-config": "^6.1.0-beta.101",
65
+ "@ikas/storefront-model-functions": "^6.1.0-beta.101",
66
+ "@ikas/storefront-models": "^6.1.0-beta.101",
67
+ "@ikas/storefront-providers": "^6.1.0-beta.101",
68
68
  "mobx": "^6.1.3",
69
69
  "mobx-react-lite": "^3.1.5",
70
70
  "next": "12.2.0",