@ikas/storefront 6.1.0-beta.168 → 6.1.0-beta.169
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{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import a,{FormItemType as o}from"./model.js";import r from"./caret-down.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import u from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var r=i().t,s=e.useState((function(){return new a(n)})),p=s[0],E=s[1];return e.useEffect((function(){u.rebuild()}),[]),e.useEffect((function(){t((function(){p.type=n.type}))}),[n.type]),e.useEffect((function(){t((function(){p.inputType=n.inputType}))}),[n.inputType]),e.useEffect((function(){t((function(){p.inputMode=n.inputMode}))}),[n.inputMode]),e.useEffect((function(){t((function(){p.value=n.value}))}),[n.value]),e.useEffect((function(){t((function(){p.options=n.options}))}),[n.options]),e.useEffect((function(){t((function(){p.label=n.label}))}),[n.label]),e.useEffect((function(){t((function(){p.hasError=n.hasError}))}),[n.hasError]),e.useEffect((function(){t((function(){p.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){p.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){p.textAreaPlaceholder=n.textAreaPlaceholder}))}),[n.textAreaPlaceholder]),e.useEffect((function(){t((function(){p.rightContent=n.rightContent}))}),[n.rightContent]),e.useEffect((function(){t((function(){p.disabled=n.disabled||!1}))}),[n.disabled]),e.useEffect((function(){t((function(){p.isLoading=n.isLoading||!1}))}),[n.isLoading]),e.useEffect((function(){t((function(){p.disableResize=n.disableResize}))}),[n.disableResize]),e.useEffect((function(){t((function(){E(new a(n))}))}),[n.onChange]),e.useEffect((function(){!p.country&&n.currentCountryCode&&p.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]),e.createElement("div",{className:p.formItemStyle,style:n.style},e.createElement("div",{className:l.FormItemWrapper},e.createElement("div",{className:l.FormItemInputWrapper},e.createElement("label",{className:p.labelStyle,id:n.name+"-label"},p.label),p.type===o.TEXT&&e.createElement(m,{vm:p,type:p.inputType,disabled:p.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name,placeholder:n.placeholder,autocapitalize:n.autocapitalize,autocorrect:n.autocorrect,spellcheck:n.spellcheck,ariaLabelledBy:n.name+"-label"}),p.type===o.TEL&&e.createElement(c,{key:n.currentCountryCode||"1",disabled:p.disabled,defaultCountry:n.currentCountryCode,placeholder:r("checkout-page:enterPhoneNumber"),value:p.value?p.value:"",onChange:p.onPhoneChange}),p.type===o.TEXT_AREA&&e.createElement(d,{vm:p,name:n.name}),p.type===o.SELECT&&e.createElement(f,{vm:p,autocomplete:n.autocomplete,name:n.name})),!!p.hasError&&e.createElement("div",{className:l.ErrorMsg},p.errorText||""),!!n.tooltipText&&e.createElement("div",{className:l.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!p.rightContent&&e.createElement("div",{className:l.RightContent},p.rightContent)))})),m=n((function(t){var n=t.vm,a=t.name,o=t.autocomplete,r=t.type,l=t.pattern,i=t.required,u=t.disabled
|
|
1
|
+
import*as e from"react";import{runInAction as t}from"mobx";import{observer as n}from"mobx-react-lite";import a,{FormItemType as o}from"./model.js";import r from"./caret-down.js";import l from"./style.module.scss.js";import"@ikas/storefront-config";import{useTranslation as i}from"../../../../utils/i18n.js";import u from"react-tooltip";import{PhoneNumberInput as c}from"../phone-number-input/index.js";var s=n((function(n){var r=i().t,s=e.useState((function(){return new a(n)})),p=s[0],E=s[1];return e.useEffect((function(){u.rebuild()}),[]),e.useEffect((function(){t((function(){p.type=n.type}))}),[n.type]),e.useEffect((function(){t((function(){p.inputType=n.inputType}))}),[n.inputType]),e.useEffect((function(){t((function(){p.inputMode=n.inputMode}))}),[n.inputMode]),e.useEffect((function(){t((function(){p.value=n.value}))}),[n.value]),e.useEffect((function(){t((function(){p.options=n.options}))}),[n.options]),e.useEffect((function(){t((function(){p.label=n.label}))}),[n.label]),e.useEffect((function(){t((function(){p.hasError=n.hasError}))}),[n.hasError]),e.useEffect((function(){t((function(){p.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){p.errorText=n.errorText}))}),[n.errorText]),e.useEffect((function(){t((function(){p.textAreaPlaceholder=n.textAreaPlaceholder}))}),[n.textAreaPlaceholder]),e.useEffect((function(){t((function(){p.rightContent=n.rightContent}))}),[n.rightContent]),e.useEffect((function(){t((function(){p.disabled=n.disabled||!1}))}),[n.disabled]),e.useEffect((function(){t((function(){p.isLoading=n.isLoading||!1}))}),[n.isLoading]),e.useEffect((function(){t((function(){p.disableResize=n.disableResize}))}),[n.disableResize]),e.useEffect((function(){t((function(){E(new a(n))}))}),[n.onChange]),e.useEffect((function(){!p.country&&n.currentCountryCode&&p.onCountryChange(n.currentCountryCode)}),[n.currentCountryCode]),e.createElement("div",{className:p.formItemStyle,style:n.style},e.createElement("div",{className:l.FormItemWrapper},e.createElement("div",{className:l.FormItemInputWrapper},e.createElement("label",{className:p.labelStyle,id:n.name+"-label",htmlFor:n.name},p.label),p.type===o.TEXT&&e.createElement(m,{vm:p,type:p.inputType,disabled:p.disabled,required:n.required,pattern:n.pattern,autocomplete:n.autocomplete,name:n.name,placeholder:n.placeholder,autocapitalize:n.autocapitalize,autocorrect:n.autocorrect,spellcheck:n.spellcheck,ariaLabelledBy:n.name+"-label"}),p.type===o.TEL&&e.createElement(c,{key:n.currentCountryCode||"1",disabled:p.disabled,defaultCountry:n.currentCountryCode,placeholder:r("checkout-page:enterPhoneNumber"),value:p.value?p.value:"",onChange:p.onPhoneChange}),p.type===o.TEXT_AREA&&e.createElement(d,{vm:p,name:n.name}),p.type===o.SELECT&&e.createElement(f,{vm:p,autocomplete:n.autocomplete,name:n.name})),!!p.hasError&&e.createElement("div",{className:l.ErrorMsg},p.errorText||""),!!n.tooltipText&&e.createElement("div",{className:l.FormItemTooltipContainer,"data-tip":n.tooltipText,"data-event":"touchstart focus mouseover","data-event-off":"mouseout"},"?"),!!p.rightContent&&e.createElement("div",{className:l.RightContent},p.rightContent)))})),m=n((function(t){var n=t.vm,a=t.name,o=t.autocomplete,r=t.type,l=t.pattern,i=t.required,u=t.disabled;t.placeholder;var c=t.autocapitalize,s=t.autocorrect,m=t.spellcheck,d=t.ariaLabelledBy;return e.createElement("input",{id:a,required:i,type:r||"text",name:a,pattern:l,disabled:u,autoComplete:o,inputMode:n.inputMode||"text",className:n.inputStyle,value:n.value,onChange:n.onValueChange,onFocus:n.handleOnFocus,onBlur:n.handleOnBlur,autoCapitalize:c,autoCorrect:s,spellCheck:m,"aria-labelledby":d})})),d=n((function(t){var n,a=t.vm,o=t.name;return e.createElement(e.Fragment,null,e.createElement("textarea",{style:{resize:a.disableResize?"none":"initial"},name:o,value:a.value,disabled:a.disabled,onChange:a.onTextAreaValueChange,placeholder:a.textAreaPlaceholder||"",maxLength:a.maxLength}),a.maxLength&&e.createElement("div",{className:l.TextareaInfo},(null===(n=a.value)||void 0===n?void 0:n.length)||0," / ",a.maxLength))})),f=n((function(t){var n,a=t.vm,o=t.autocomplete,i=t.name;return e.createElement(e.Fragment,null,e.createElement("select",{name:i,className:a.inputStyle,disabled:a.isLoading||a.disabled,autoComplete:o,onChange:a.onSelectChange},!a.value&&e.createElement("option",{selected:!0,disabled:!0,key:-1}),null===(n=a.options)||void 0===n?void 0:n.map((function(t,n){return e.createElement("option",{key:n+t.value,value:t.label,selected:a.value===t.value},t.label)}))),e.createElement("div",{className:l.ArrowContainer},!a.isLoading&&e.createElement(r,null),a.isLoading&&e.createElement("div",{className:l.Loader})))}));export{s as FormItem};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "6.1.0-beta.
|
|
3
|
+
"version": "6.1.0-beta.169",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"swiper": "11.0.6"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
26
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
27
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
28
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
29
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
25
|
+
"@ikas/storefront-api": "^6.1.0-beta.169",
|
|
26
|
+
"@ikas/storefront-config": "^6.1.0-beta.169",
|
|
27
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.169",
|
|
28
|
+
"@ikas/storefront-models": "^6.1.0-beta.169",
|
|
29
|
+
"@ikas/storefront-providers": "^6.1.0-beta.169",
|
|
30
30
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
31
31
|
"@adyen/adyen-web": "^5.57.0",
|
|
32
32
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@ikas/localized-address": "1.0.0-beta.6",
|
|
64
|
-
"@ikas/storefront-api": "^6.1.0-beta.
|
|
65
|
-
"@ikas/storefront-config": "^6.1.0-beta.
|
|
66
|
-
"@ikas/storefront-model-functions": "^6.1.0-beta.
|
|
67
|
-
"@ikas/storefront-models": "^6.1.0-beta.
|
|
68
|
-
"@ikas/storefront-providers": "^6.1.0-beta.
|
|
64
|
+
"@ikas/storefront-api": "^6.1.0-beta.169",
|
|
65
|
+
"@ikas/storefront-config": "^6.1.0-beta.169",
|
|
66
|
+
"@ikas/storefront-model-functions": "^6.1.0-beta.169",
|
|
67
|
+
"@ikas/storefront-models": "^6.1.0-beta.169",
|
|
68
|
+
"@ikas/storefront-providers": "^6.1.0-beta.169",
|
|
69
69
|
"mobx": "^6.1.3",
|
|
70
70
|
"mobx-react-lite": "^3.1.5",
|
|
71
71
|
"next": "12.2.0",
|