amotify 0.2.174 → 0.2.175

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.
@@ -31,83 +31,6 @@ import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight
31
31
 
32
32
  const Dashboard = () => {
33
33
  useEffect( () => {
34
- // return
35
- let sheetID = 'passwordChangeSheet'
36
- let formName = 'passwordChangeForm'
37
-
38
- Sheet.open( 'topCenter',{
39
- sheetID,
40
- size: 'S',
41
- content: () => {
42
- // Hkvwtxky73n84
43
- return <Sheet.Body>
44
- <Column padding={ 2 } gap={ 2 }>
45
- <Column>
46
- <Row.Separate>
47
- <Literal isSemiBoldFont>パスワードを変更</Literal>
48
- <Button.Sub
49
- ssSphere={ 3 }
50
- color='cloud'
51
- onClick={ () => {
52
- Sheet.close( sheetID )
53
- } }
54
- >
55
- <FAI.X />
56
- </Button.Sub>
57
- </Row.Separate>
58
- <Box>
59
- <Literal.Supplement fontColor='nega'>
60
- ※送信後サインアウトされます。
61
- </Literal.Supplement>
62
- </Box>
63
- </Column>
64
-
65
- <Column gap={ 1.5 }>
66
- <Input.TextField.Password
67
- label='現在のパスワード'
68
- required
69
- form={ formName }
70
- name='currentPassword'
71
- />
72
- <Input.TextField.Password
73
- label='新しいパスワード'
74
- required
75
- form={ formName }
76
- name='newPassword'
77
- id='newPassword'
78
- />
79
- <Input.TextField.Password
80
- label='新しいパスワード(確認)'
81
- required
82
- form={ formName }
83
- name='newPasswordConfirm'
84
- onValidate={ async value => {
85
- let newPassword = $$( '#newPassword' ).getAttribute( 'value' )
86
- if ( value != newPassword ) {
87
- return {
88
- ok: false,notice: [ { type: 'invalid',label: 'パスワードが一致しません' } ]
89
- }
90
- }
91
- return { ok: true,notice: [] }
92
- } }
93
- />
94
- </Column>
95
- <Row.Right>
96
- <Button.Prime
97
- submitOption={ {
98
- formName,
99
- callback: ( form ) => {
100
- console.log( form )
101
- }
102
- } }
103
- >
104
- <Literal>変更する</Literal>
105
- </Button.Prime>
106
- </Row.Right>
107
- </Column>
108
- </Sheet.Body>
109
- }
110
- } )
111
34
  },[] )
112
35
 
113
36
 
@@ -117,16 +40,14 @@ const Dashboard = () => {
117
40
  >
118
41
 
119
42
  <Column gap={ 3 }>
120
- <Input.TextField.Password
121
- label='現在のパスワード'
122
- required
123
- name='currentPassword'
124
- />
125
- <Input.TextField.Postal
126
- label='現在のパスワード'
127
- required
128
- name='postalCode'
43
+ <Input.TextField.DigitNumber
44
+ allowDecimals={ 4 }
45
+ value={ 1.234 }
46
+ onUpdateValidValue={ value => {
47
+ console.log( value )
48
+ } }
129
49
  />
50
+
130
51
  <Button.Prime
131
52
  onClick={ () => {
132
53
  console.log( 'Hvfasd' )
@@ -1,3 +1,3 @@
1
- import{b as l,c as p,d as j,e as ne}from"../../chunk-C5N2D3ZX.js";import{Fragment as ue,jsx as n,jsxs as W}from"react/jsx-runtime";import x,{UUID as B,useStore as oe}from"jmini";import{useState as U,useEffect as Q}from"react";import{$$fromRoot as Ie,ExtractStyles as Te}from"../../@utils";import{Box as D,FAI as ve}from"../../atoms";import{Literal as ee}from"../../mols";import{Tips as re,Button as Re}from"..";import{faEye as ye}from"@fortawesome/free-solid-svg-icons/faEye";import{OptionalInputWrapper as Ce,BoxWrapper as we,CoreEffects as P,DefaultBoxishStyles as Ve}from"./core";import{InputLabel as ke}from"./Label";import{LeftIcon as Ne,RightIcon as se}from".";const Fe={katakana:{reg:/^[ァ-ヶー  ヲ-゚  ]*$/g,exist:!0,reason:"\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},"hankaku.katakana":{reg:/^[ヲ-゚  ]*$/g,exist:!0,reason:"\u534A\u89D2\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},number:{reg:/^-?[0-9\.]{0,}[0-9]{1,}$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},digitNumber:{reg:/^-?[0-9\,\.]{0,}[0-9]{1,}$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},fileName:{reg:/[¥\/:*\?\"\'\|\.\s\n\r\<\>]/g,exist:!1,reason:"\u7A7A\u767D\u307E\u305F\u306F\u4E00\u90E8\u306E\u7279\u6B8A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},creditCard:{reg:/^\d{14,16}$/g,exist:!0,reason:"14~16\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},email:{reg:/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+\.[A-Za-z0-9]+$/,exist:!0,reason:W(ue,{children:[n(D,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(D,{children:"\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"})]})},password:{reg:/^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,exist:!0,reason:"8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},tel:{reg:/.*$/g,exist:!0,reason:W(ue,{children:[n(D,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),n(D,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(D,{children:"\u6570\u5B57\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"})]})},url:{reg:/^https?:\/\/[^\n\s]+(\.|\:)[^\n\s\.\:]+$/,exist:!0,reason:"URL\u5F62\u5F0F : http(s)://\u25EF\u25EF\u25EF\u25EF"},postal:{reg:/^\d{7}$/g,exist:!0,reason:"7\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}},C={setSelection:t=>{let{id:a,restrict:o,val_status:s}=t,i=Ie("#"+a)[0];if(i&&s.prevValue&&s.formatValue){let{formatValue:e,prevValue:u,caretFrom:d,caretTo:r}=s;if(o=="creditCard")e.length>=u.length&&d%5==0&&(d++,r++),i.setSelectionRange(d,r);else if(o=="postal")e.length==5&&u.length==3&&(d++,r++),i.setSelectionRange(d,r);else if(o=="digitNumber"){let m=e.length-u.length;m==2&&(d++,r++),m==-2&&(d--,r--),i.setSelectionRange(d,r)}}},Validation:{System:t=>{let{value:a,states:o}=t,{restrict:s="text",defaultValidation:i,maxLength:e,multiline:u,required:d}=o,r=[];if(u||(e=e||255),x.is.exist(e)&&a.length>=Number(e)&&r.push({type:"invalid",label:e+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a){let m=C.Validation.Text(a,s,i);m.ok||r.push({type:"invalid",label:m.body})}else d&&r.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!r.filter(({type:m})=>m=="invalid").length,notice:r}},Text:(t,a,o)=>{let s={ok:!0,body:""};return(()=>{let i=o||Fe[a];if(!i)return;let e=i.reason;if(i){let u=!!(+!!t.match(i.reg)^+!i.exist);s={ok:u,body:u?"":e}}})(),s},DataLeveling:t=>{let{restrict:a,allowDecimals:o,allowZeroStart:s,value:i=""}=t,e=String(i);["tel","number","digitNumber","test","postal","creditCard"].includes(a)&&(e=e.zen2hanNumber()),a=="katakana",a=="hankaku.katakana",["postal","creditCard"].includes(a)&&(e=e.removeLetters()),x.scope(()=>{if(!["number","digitNumber"].includes(a))return;e=e.replace(/(\.\d+)\..*/g,"$1").replace(/\.+/g,".").replace(/[^0-9.-]/g,"");let d=Number(e)<0||e[0]=="-";e=e.replace(/[^0-9.]/g,""),d&&(e="-"+e),o||(e=e.replace(/\.\d?/g,"")),x.scope(()=>{a=="number"&&(s||(e=e.replace(/^0(\d+)/g,"$1").replace(/^-0(\d+)/g,"-$1")))}),x.scope(()=>{let r=e.slice(-1);e&&r!="."&&r!="-"&&(x.is.exist(t.min)&&(e=String(Math.max(Number(e),Number(t.min)))),x.is.exist(t.max)&&(e=String(Math.min(Number(e),Number(t.max)))))}),x.scope(()=>{if(!e||e=="-"||a!="digitNumber")return;let r=Number(e)<0,m=String(Math.abs(Math.round(Number(e)))),S=e.split("."),R=[];for(let g=m.length-1;g>=0;g--){R.unshift(m[g]);let F=m.length-1-g+1;g!=0&&F%3==0&&R.unshift(",")}e=R.join(""),r&&(e="-"+e),(S==null?void 0:S.length)==2&&(e+="."+S[1]||"")})});let u=e;return a=="digitNumber"||(a=="postal"?e.length>=4&&(u=e.clip(0,3)+"-"+e.clip(3)):a=="creditCard"&&(u=e.replace(/.{4}(?=.)/g,"$& "))),e=e.replace(/,/g,""),{formatValue:u,dataValue:e}}},Shallow:t=>{let{rootStates:a,val_status:o}=t,s=o.dataValue||"";Q(()=>{x.scope(()=>ne(void 0,null,function*(){if(!a.multiline)return;let m=x('[data-input-origin="'+o.componentId+'"]'),S=x('[data-input-shallow="'+o.componentId+'"]'),R=x('[data-input-min-height-value-shallow="'+o.componentId+'"]'),g=x('[data-input-max-height-value-shallow="'+o.componentId+'"]');if(!m[0]||!S[0]||!R[0]||!g[0])return;let F=S.position(),E=R.position(),f=g.position(),w=0;a.autoHeight&&(w=F.height),w=Math.max(w,E.height),w=Math.min(w,f.height),m[0].style.height=w+"px"}))},[s]);let i=s||"";(!!s.match(/\n$/)||!s)&&(i+="T");let u="",d="";if(a.multiline){let m=a.minRows||1,S=a.maxRows||100;u=`
1
+ import{b as l,c as p,d as j,e as ne}from"../../chunk-C5N2D3ZX.js";import{Fragment as ue,jsx as o,jsxs as W}from"react/jsx-runtime";import S,{UUID as B,useStore as oe}from"jmini";import{useState as U,useEffect as Q}from"react";import{$$fromRoot as Ie,ExtractStyles as Te}from"../../@utils";import{Box as D,FAI as ve}from"../../atoms";import{Literal as ee}from"../../mols";import{Tips as re,Button as Re}from"..";import{faEye as ye}from"@fortawesome/free-solid-svg-icons/faEye";import{OptionalInputWrapper as Ce,BoxWrapper as we,CoreEffects as P,DefaultBoxishStyles as Ve}from"./core";import{InputLabel as ke}from"./Label";import{LeftIcon as Ne,RightIcon as se}from".";const Fe={katakana:{reg:/^[ァ-ヶー  ヲ-゚  ]*$/g,exist:!0,reason:"\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},"hankaku.katakana":{reg:/^[ヲ-゚  ]*$/g,exist:!0,reason:"\u534A\u89D2\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},number:{reg:/^-?[0-9\.]{0,}[0-9]{1,}$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},digitNumber:{reg:/^-?[0-9\,\.]{0,}[0-9]{1,}$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},fileName:{reg:/[¥\/:*\?\"\'\|\.\s\n\r\<\>]/g,exist:!1,reason:"\u7A7A\u767D\u307E\u305F\u306F\u4E00\u90E8\u306E\u7279\u6B8A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},creditCard:{reg:/^\d{14,16}$/g,exist:!0,reason:"14~16\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},email:{reg:/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+\.[A-Za-z0-9]+$/,exist:!0,reason:W(ue,{children:[o(D,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),o(D,{children:"\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"})]})},password:{reg:/^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,exist:!0,reason:"8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},tel:{reg:/.*$/g,exist:!0,reason:W(ue,{children:[o(D,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),o(D,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),o(D,{children:"\u6570\u5B57\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"})]})},url:{reg:/^https?:\/\/[^\n\s]+(\.|\:)[^\n\s\.\:]+$/,exist:!0,reason:"URL\u5F62\u5F0F : http(s)://\u25EF\u25EF\u25EF\u25EF"},postal:{reg:/^\d{7}$/g,exist:!0,reason:"7\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}},C={setSelection:t=>{let{id:a,restrict:r,val_status:s}=t,i=Ie("#"+a)[0];if(i&&s.prevValue&&s.formatValue){let{formatValue:e,prevValue:u,caretFrom:d,caretTo:n}=s;if(r=="creditCard")e.length>=u.length&&d%5==0&&(d++,n++),i.setSelectionRange(d,n);else if(r=="postal")e.length==5&&u.length==3&&(d++,n++),i.setSelectionRange(d,n);else if(r=="digitNumber"){let m=e.length-u.length;m==2&&(d++,n++),m==-2&&(d--,n--),i.setSelectionRange(d,n)}}},Validation:{System:t=>{let{value:a,states:r}=t,{restrict:s="text",defaultValidation:i,maxLength:e,multiline:u,required:d}=r,n=[];if(u||(e=e||255),S.is.exist(e)&&a.length>=Number(e)&&n.push({type:"invalid",label:e+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a){let m=C.Validation.Text(a,s,i);m.ok||n.push({type:"invalid",label:m.body})}else d&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!n.filter(({type:m})=>m=="invalid").length,notice:n}},Text:(t,a,r)=>{let s={ok:!0,body:""};return(()=>{let i=r||Fe[a];if(!i)return;let e=i.reason;if(i){let u=!!(+!!t.match(i.reg)^+!i.exist);s={ok:u,body:u?"":e}}})(),s},DataLeveling:t=>{let{restrict:a,allowDecimals:r,allowZeroStart:s,value:i=""}=t,e=String(i);["tel","number","digitNumber","test","postal","creditCard"].includes(a)&&(e=e.zen2hanNumber()),a=="katakana",a=="hankaku.katakana",["postal","creditCard"].includes(a)&&(e=e.removeLetters()),S.scope(()=>{if(!["number","digitNumber"].includes(a))return;e=e.replace(/(\.\d+)\..*/g,"$1").replace(/\.+/g,".").replace(/[^0-9.-]/g,"");let d=Number(e)<0||e[0]=="-";if(e=e.replace(/[^0-9.]/g,""),d&&(e="-"+e),r){let n=Number(r);e=e.replace(/(\.\d{0,})\..*/g,"$1").replace(/\.(\d{0,})/g,(m,b)=>b.length>n?"."+b.slice(0,n):m)}else e=e.replace(/\.\d?/g,"");S.scope(()=>{a=="number"&&(s||(e=e.replace(/^0(\d+)/g,"$1").replace(/^-0(\d+)/g,"-$1")))}),S.scope(()=>{let n=e.slice(-1);e&&n!="."&&n!="-"&&(S.is.exist(t.min)&&(e=String(Math.max(Number(e),Number(t.min)))),S.is.exist(t.max)&&(e=String(Math.min(Number(e),Number(t.max)))))}),S.scope(()=>{if(!e||e=="-"||a!="digitNumber")return;let n=Number(e)<0,m=String(Math.abs(Math.round(Number(e)))),b=e.split("."),R=[];for(let g=m.length-1;g>=0;g--){R.unshift(m[g]);let F=m.length-1-g+1;g!=0&&F%3==0&&R.unshift(",")}e=R.join(""),n&&(e="-"+e),(b==null?void 0:b.length)==2&&(e+="."+b[1]||"")})});let u=e;return a=="digitNumber"||(a=="postal"?e.length>=4&&(u=e.clip(0,3)+"-"+e.clip(3)):a=="creditCard"&&(u=e.replace(/.{4}(?=.)/g,"$& "))),e=e.replace(/,/g,""),{formatValue:u,dataValue:e}}},Shallow:t=>{let{rootStates:a,val_status:r}=t,s=r.dataValue||"";Q(()=>{S.scope(()=>ne(void 0,null,function*(){if(!a.multiline)return;let m=S('[data-input-origin="'+r.componentId+'"]'),b=S('[data-input-shallow="'+r.componentId+'"]'),R=S('[data-input-min-height-value-shallow="'+r.componentId+'"]'),g=S('[data-input-max-height-value-shallow="'+r.componentId+'"]');if(!m[0]||!b[0]||!R[0]||!g[0])return;let F=b.position(),E=R.position(),f=g.position(),w=0;a.autoHeight&&(w=F.height),w=Math.max(w,E.height),w=Math.min(w,f.height),m[0].style.height=w+"px"}))},[s]);let i=s||"";(!!s.match(/\n$/)||!s)&&(i+="T");let u="",d="";if(a.multiline){let m=a.minRows||1,b=a.maxRows||100;u=`
2
2
  T`.repeat(m-1),d=`
3
- T`.repeat(S-1)}let r=Te(a);return W(D,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:[n(ee.Description,p(l({className:a.className},r),{position:"absolute",width:1,freeCSS:p(l({},r.freeCSS),{color:"orange"}),"data-input-shallow":o.componentId,children:n(D,{"data-input-value-shallow":o.componentId,children:i})})),n(ee.Description,p(l({className:a.className},r),{position:"absolute",left:0,freeCSS:p(l({},r.freeCSS),{backgroundColor:"transparent",color:"blue"}),"data-input-min-height-value-shallow":o.componentId,children:u})),n(ee.Description,p(l({className:a.className},r),{position:"absolute",right:0,freeCSS:p(l({},r.freeCSS),{backgroundColor:"transparent",color:"red"}),"data-input-max-height-value-shallow":o.componentId,children:d}))]})},InputBox:t=>{let{rootStates:a,val_validate:o,set_validate:s,val_status:i,set_status:e,val_inputType:u,set_inputType:d,val_focus:r,set_focus:m,val_isComposing:S,set_isComposing:R}=t;if(a.multiline)return null;let le=a,{componentId:g,tone:F,required:E,restrict:f="text",form:w,autoComplete:$="off",autoCapitalize:H="off",minRows:pe,maxRows:ce,multiline:te,autoHeight:me,enableFormSubmit:O,clearButton:q=!1,allowDecimals:M,allowZeroStart:K,checkValidationAtFirst:ae,onChange:J,onKeyDown:Y,onValidate:de,onUpdateValue:fe,onUpdateValidValue:ge,value:be="",leftIndicator:he,rightIndicator:xe,leftIcon:I,rightIcon:Se,maxLength:G,min:v,max:z,label:ie,isLabelActive:De,defaultValidation:Le,wrapStyles:Ee}=le,c=j(le,["componentId","tone","required","restrict","form","autoComplete","autoCapitalize","minRows","maxRows","multiline","autoHeight","enableFormSubmit","clearButton","allowDecimals","allowZeroStart","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max","label","isLabelActive","defaultValidation","wrapStyles"]);return n(D,p(l({htmlTag:"input",type:u,inputMode:["number","digitNumber","creditCard"].includes(f)?"numeric":f=="email"?"email":"text","data-disabled":a.disabled,"data-show-validation":P.isShowValidation(o,i,!!ae),"data-component-id":i.componentId,"data-input-origin":i.componentId,value:i.formatValue,autoComplete:$,autoCapitalize:H,onKeyDown:b=>{let{key:y,target:L}=b;{let k=L,{selectionStart:N,selectionEnd:T}=k,A=Number(N),Z=Number(T),_=i.formatValue[Number(A)],X=i.formatValue[Number(A)-1];y=="Delete"&&(f=="creditCard"&&_==" "||f=="postal"&&_=="-"||f=="digitNumber"&&_==",")&&(k.setSelectionRange(A+1,Z+1),b.preventDefault()),y=="Backspace"&&(f=="creditCard"&&X==" "||f=="postal"&&X=="-"||f=="digitNumber"&&X==",")&&(k.setSelectionRange(A-1,Z-1),b.preventDefault()),y=="Enter"||y=="Tab"}x.scope(()=>{["number","digitNumber","creditCard"].includes(f)&&y=="Clear"&&e(k=>p(l({},k),{dataValue:"",formatValue:"",eventType:"update",eventID:B()}))}),x.scope(()=>{var Z;if(!["number","digitNumber"].includes(f)||!["ArrowUp","ArrowDown"].includes(y))return;let k=+(y=="ArrowUp")*2-1,N=i.dataValue.slice(-1),T=i.dataValue,A=((Z=i.dataValue.split(".")[1])==null?void 0:Z.length)||0;if(!N)T+="0";else if(N=="-")T+="0";else if(N==".")T+="0";else if(A){let _=Number(N)+k;T=T.slice(0,-1),_<0?T+="9":_>9?T+="0":T+=String(_)}else T=String(Number(i.dataValue.replace(/,/g,""))+k);o.ok&&s({ok:!1,notice:[]}),e(_=>p(l(l({},_),C.Validation.DataLeveling({allowDecimals:M,allowZeroStart:K,min:v,max:z,restrict:f,value:T})),{eventType:"update",eventID:B()})),b.preventDefault()}),Y&&Y(b),O&&P.SubmitForm(b,w)},onChange:b=>{let{value:y,selectionStart:L,selectionEnd:k}=b.target,N=C.Validation.DataLeveling({allowDecimals:M,allowZeroStart:K,min:v,max:z,restrict:f,value:y});S&&(N.formatValue=y),N.formatValue!=i.formatValue&&(o.ok&&s({ok:!1,notice:[]}),e(T=>p(l(l({},T),N),{prevValue:i.formatValue,eventType:"update",eventID:B(),caretFrom:Number(L),caretTo:Number(k)})),J&&J(b))},width:1},c),{onFocus:b=>{c!=null&&c.onFocus&&(c==null||c.onFocus(b)),m(!0)},onBlur:b=>{c!=null&&c.onBlur&&(c==null||c.onBlur(b)),m(!1)},onCompositionStart:b=>{c!=null&&c.onCompositionStart&&(c==null||c.onCompositionStart(b)),R(!0)},onCompositionEnd:b=>{if(c!=null&&c.onCompositionEnd&&(c==null||c.onCompositionEnd(b)),f=="text")return;let y=C.Validation.DataLeveling({allowDecimals:M,allowZeroStart:K,min:v,max:z,restrict:f,value:i.formatValue});e(L=>p(l(l({},L),y),{prevValue:L.formatValue,eventType:"update",eventID:B(),caretFrom:Number(L.formatValue.length+1),caretTo:Number(L.formatValue.length+1)})),R(!1)}}))},TextAreaBox:t=>{let{rootStates:a,val_focus:o,set_focus:s,val_validate:i,set_validate:e,val_status:u,set_status:d,isShallow:r}=t,G=a,{componentId:m,tone:S,required:R,form:g,label:F,isLabelActive:E,minRows:f,maxRows:w,multiline:$,autoHeight:H,allowDecimals:pe,allowZeroStart:ce,enableFormSubmit:te,maxLength:me,checkValidationAtFirst:O,onChange:q,onKeyDown:M,onValidate:K,onUpdateValue:ae,onUpdateValidValue:J,value:Y="",leftIndicator:de,rightIndicator:fe,leftIcon:ge,rightIcon:be,defaultValidation:he,wrapStyles:xe}=G,I=j(G,["componentId","tone","required","form","label","isLabelActive","minRows","maxRows","multiline","autoHeight","allowDecimals","allowZeroStart","enableFormSubmit","maxLength","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","defaultValidation","wrapStyles"]);return!a.multiline?null:n(D,p(l({htmlTag:"textarea","data-show-validation":P.isShowValidation(i,u,!!O),"data-input-origin":u.componentId,"data-component-id":u.componentId,value:u.dataValue,width:1},I),{onFocus:v=>{I!=null&&I.onFocus&&(I==null||I.onFocus(v)),s(!0)},onBlur:v=>{I!=null&&I.onBlur&&(I==null||I.onBlur(v)),s(!1)},onKeyDown:v=>{M&&M(v),te&&P.SubmitForm(v,g)},onChange:v=>{let{value:z}=v.target;i.ok&&e({ok:!1,notice:[]}),d(ie=>p(l({},ie),{dataValue:z,eventType:"update",eventID:B()})),q&&q(v)}}))}},_e=t=>{let{componentId:a,restrict:o="text",value:s="",min:i,max:e,allowDecimals:u,allowZeroStart:d}=t,[r,m]=U(!1),[S,R]=U(!1),[g,F]=U(p(l({componentId:a},C.Validation.DataLeveling({allowDecimals:u,allowZeroStart:d,min:i,max:e,restrict:o,value:s})),{prevValue:"",eventType:"init",eventID:B(),caretFrom:null,caretTo:null})),[E,f]=U({ok:!1,notice:[]}),[w,$]=U(["password","concealed"].includes(o)&&"password"||"text");Q(()=>{oe.set({[a+":set_inputType"]:$})},[]);let H={rootStates:t,val_focus:r,set_focus:m,val_inputType:w,set_inputType:$,val_isComposing:S,set_isComposing:R,val_status:g,set_status:F,val_validate:E,set_validate:f};return P.CommonEffects({type:"textfield",states:t,val_status:g,set_status:F,val_validate:E,set_validate:f,SystemValidation:C.Validation.System,ExtraOverrideStates:l({},C.Validation.DataLeveling({allowDecimals:u,allowZeroStart:d,min:i,max:e,restrict:o,value:s}))}),Q(()=>{C.setSelection({id:t.id,restrict:o,val_status:g})},[g]),W(we,{val_status:g,set_status:F,val_validate:E,states:H.rootStates,children:[n(ke,{componentId:t.componentId,fontSize:t.fontSize,required:t.required,label:t.label,isActive:t.isLabelActive||r||!!g.dataValue}),n(C.Shallow,l({},H)),n(C.InputBox,l({},H)),n(C.TextAreaBox,l({},H))]})},V=t=>(t=l({autoHeight:!0,restrict:"text",fontSize:"inherit"},t),t.multiline?(t.minRows=t.minRows||5,t.maxRows=t.maxRows||20):(t.minRows=1,t.maxRows=1),n(Ce,{componentId:t.componentId,children:_e,states:Ve(t)})),h=V;h.Validate=C.Validation.Text,h.Katakana=t=>n(V,p(l({},t),{restrict:"katakana",multiline:!1,autoHeight:!1})),h.HankakuKatakana=t=>n(V,p(l({},t),{restrict:"hankaku.katakana",multiline:!1,autoHeight:!1})),h.CreditCard=t=>n(V,p(l({},t),{restrict:"creditCard",multiline:!1,autoHeight:!1})),h.Tel=t=>n(V,p(l({},t),{restrict:"tel",multiline:!1,autoHeight:!1})),h.Number=t=>n(V,p(l({},t),{restrict:"number",multiline:!1,autoHeight:!1})),h.DigitNumber=t=>n(V,p(l({},t),{restrict:"digitNumber",multiline:!1,autoHeight:!1})),h.Email=t=>n(V,p(l({},t),{restrict:"email",multiline:!1,autoHeight:!1})),h.Url=t=>n(V,p(l({},t),{restrict:"url",multiline:!1,autoHeight:!1})),h.Postal=t=>n(V,p(l({label:"\u90F5\u4FBF\u756A\u53F7"},t),{restrict:"postal",multiline:!1,autoHeight:!1,leftIcon:n(Ne,{ssSphere:2,fontColor:"4.thin",children:"\u3012"})})),h.Password=t=>n(V,p(l({label:"\u30D1\u30B9\u30EF\u30FC\u30C9",rightIcon:n(se,{ssSphere:2,padding:0,freeCSS:{pointerEvents:"all"},children:n(Re.Sub,{ssSphere:2,borderRadius:"3.tone.tertiary",fontColor:"theme",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:a=>{re.open(a.currentTarget,"\u30C6\u30AD\u30B9\u30C8\u3092\u8868\u793A",24)},onMouseLeave:re.abort,tabIndex:-1,onClick:a=>{x(a.target).parent().parent().find("input").callback(o=>{let s=o[0];if(!s)return;let i=s.dataset.componentId;if(!i)return;let e=oe.get(i+":set_inputType");e&&e(u=>u==="password"&&"text"||"password")})},children:n(ve,{icon:ye})})}),restrict:"password"},t),{multiline:!1,autoHeight:!1})),h.Concealed=t=>n(h.Password,p(l({label:"\u79D8\u5BC6\u9375"},t),{restrict:"concealed"})),h.Money={JPY:t=>n(h.DigitNumber,p(l({rightIcon:n(se,{ssSphere:2,fontColor:"4.thin",children:"\u5186"})},t),{multiline:!1,autoHeight:!1}))};export{h as TextField,_e as TextInput,h as default};
3
+ T`.repeat(b-1)}let n=Te(a);return W(D,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:[o(ee.Description,p(l({className:a.className},n),{position:"absolute",width:1,freeCSS:p(l({},n.freeCSS),{color:"orange"}),"data-input-shallow":r.componentId,children:o(D,{"data-input-value-shallow":r.componentId,children:i})})),o(ee.Description,p(l({className:a.className},n),{position:"absolute",left:0,freeCSS:p(l({},n.freeCSS),{backgroundColor:"transparent",color:"blue"}),"data-input-min-height-value-shallow":r.componentId,children:u})),o(ee.Description,p(l({className:a.className},n),{position:"absolute",right:0,freeCSS:p(l({},n.freeCSS),{backgroundColor:"transparent",color:"red"}),"data-input-max-height-value-shallow":r.componentId,children:d}))]})},InputBox:t=>{let{rootStates:a,val_validate:r,set_validate:s,val_status:i,set_status:e,val_inputType:u,set_inputType:d,val_focus:n,set_focus:m,val_isComposing:b,set_isComposing:R}=t;if(a.multiline)return null;let le=a,{componentId:g,tone:F,required:E,restrict:f="text",form:w,autoComplete:$="off",autoCapitalize:H="off",minRows:pe,maxRows:ce,multiline:te,autoHeight:me,enableFormSubmit:O,clearButton:q=!1,allowDecimals:M,allowZeroStart:K,checkValidationAtFirst:ae,onChange:J,onKeyDown:Y,onValidate:de,onUpdateValue:fe,onUpdateValidValue:ge,value:be="",leftIndicator:he,rightIndicator:xe,leftIcon:I,rightIcon:Se,maxLength:G,min:v,max:z,label:ie,isLabelActive:De,defaultValidation:Le,wrapStyles:Ee}=le,c=j(le,["componentId","tone","required","restrict","form","autoComplete","autoCapitalize","minRows","maxRows","multiline","autoHeight","enableFormSubmit","clearButton","allowDecimals","allowZeroStart","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max","label","isLabelActive","defaultValidation","wrapStyles"]);return o(D,p(l({htmlTag:"input",type:u,inputMode:["number","digitNumber","creditCard"].includes(f)?"numeric":f=="email"?"email":"text","data-disabled":a.disabled,"data-show-validation":P.isShowValidation(r,i,!!ae),"data-component-id":i.componentId,"data-input-origin":i.componentId,value:i.formatValue,autoComplete:$,autoCapitalize:H,onKeyDown:h=>{let{key:y,target:L}=h;{let k=L,{selectionStart:N,selectionEnd:T}=k,A=Number(N),Z=Number(T),_=i.formatValue[Number(A)],X=i.formatValue[Number(A)-1];y=="Delete"&&(f=="creditCard"&&_==" "||f=="postal"&&_=="-"||f=="digitNumber"&&_==",")&&(k.setSelectionRange(A+1,Z+1),h.preventDefault()),y=="Backspace"&&(f=="creditCard"&&X==" "||f=="postal"&&X=="-"||f=="digitNumber"&&X==",")&&(k.setSelectionRange(A-1,Z-1),h.preventDefault()),y=="Enter"||y=="Tab"}S.scope(()=>{["number","digitNumber","creditCard"].includes(f)&&y=="Clear"&&e(k=>p(l({},k),{dataValue:"",formatValue:"",eventType:"update",eventID:B()}))}),S.scope(()=>{var Z;if(!["number","digitNumber"].includes(f)||!["ArrowUp","ArrowDown"].includes(y))return;let k=+(y=="ArrowUp")*2-1,N=i.dataValue.slice(-1),T=i.dataValue,A=((Z=i.dataValue.split(".")[1])==null?void 0:Z.length)||0;if(!N)T+="0";else if(N=="-")T+="0";else if(N==".")T+="0";else if(A){let _=Number(N)+k;T=T.slice(0,-1),_<0?T+="9":_>9?T+="0":T+=String(_)}else T=String(Number(i.dataValue.replace(/,/g,""))+k);r.ok&&s({ok:!1,notice:[]}),e(_=>p(l(l({},_),C.Validation.DataLeveling({allowDecimals:M,allowZeroStart:K,min:v,max:z,restrict:f,value:T})),{eventType:"update",eventID:B()})),h.preventDefault()}),Y&&Y(h),O&&P.SubmitForm(h,w)},onChange:h=>{let{value:y,selectionStart:L,selectionEnd:k}=h.target,N=C.Validation.DataLeveling({allowDecimals:M,allowZeroStart:K,min:v,max:z,restrict:f,value:y});b&&(N.formatValue=y),N.formatValue!=i.formatValue&&(r.ok&&s({ok:!1,notice:[]}),e(T=>p(l(l({},T),N),{prevValue:i.formatValue,eventType:"update",eventID:B(),caretFrom:Number(L),caretTo:Number(k)})),J&&J(h))},width:1},c),{onFocus:h=>{c!=null&&c.onFocus&&(c==null||c.onFocus(h)),m(!0)},onBlur:h=>{c!=null&&c.onBlur&&(c==null||c.onBlur(h)),m(!1)},onCompositionStart:h=>{c!=null&&c.onCompositionStart&&(c==null||c.onCompositionStart(h)),R(!0)},onCompositionEnd:h=>{if(c!=null&&c.onCompositionEnd&&(c==null||c.onCompositionEnd(h)),f=="text")return;let y=C.Validation.DataLeveling({allowDecimals:M,allowZeroStart:K,min:v,max:z,restrict:f,value:i.formatValue});e(L=>p(l(l({},L),y),{prevValue:L.formatValue,eventType:"update",eventID:B(),caretFrom:Number(L.formatValue.length+1),caretTo:Number(L.formatValue.length+1)})),R(!1)}}))},TextAreaBox:t=>{let{rootStates:a,val_focus:r,set_focus:s,val_validate:i,set_validate:e,val_status:u,set_status:d,isShallow:n}=t,G=a,{componentId:m,tone:b,required:R,form:g,label:F,isLabelActive:E,minRows:f,maxRows:w,multiline:$,autoHeight:H,allowDecimals:pe,allowZeroStart:ce,enableFormSubmit:te,maxLength:me,checkValidationAtFirst:O,onChange:q,onKeyDown:M,onValidate:K,onUpdateValue:ae,onUpdateValidValue:J,value:Y="",leftIndicator:de,rightIndicator:fe,leftIcon:ge,rightIcon:be,defaultValidation:he,wrapStyles:xe}=G,I=j(G,["componentId","tone","required","form","label","isLabelActive","minRows","maxRows","multiline","autoHeight","allowDecimals","allowZeroStart","enableFormSubmit","maxLength","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","defaultValidation","wrapStyles"]);return!a.multiline?null:o(D,p(l({htmlTag:"textarea","data-show-validation":P.isShowValidation(i,u,!!O),"data-input-origin":u.componentId,"data-component-id":u.componentId,value:u.dataValue,width:1},I),{onFocus:v=>{I!=null&&I.onFocus&&(I==null||I.onFocus(v)),s(!0)},onBlur:v=>{I!=null&&I.onBlur&&(I==null||I.onBlur(v)),s(!1)},onKeyDown:v=>{M&&M(v),te&&P.SubmitForm(v,g)},onChange:v=>{let{value:z}=v.target;i.ok&&e({ok:!1,notice:[]}),d(ie=>p(l({},ie),{dataValue:z,eventType:"update",eventID:B()})),q&&q(v)}}))}},_e=t=>{let{componentId:a,restrict:r="text",value:s="",min:i,max:e,allowDecimals:u,allowZeroStart:d}=t,[n,m]=U(!1),[b,R]=U(!1),[g,F]=U(p(l({componentId:a},C.Validation.DataLeveling({allowDecimals:u,allowZeroStart:d,min:i,max:e,restrict:r,value:s})),{prevValue:"",eventType:"init",eventID:B(),caretFrom:null,caretTo:null})),[E,f]=U({ok:!1,notice:[]}),[w,$]=U(["password","concealed"].includes(r)&&"password"||"text");Q(()=>{oe.set({[a+":set_inputType"]:$})},[]);let H={rootStates:t,val_focus:n,set_focus:m,val_inputType:w,set_inputType:$,val_isComposing:b,set_isComposing:R,val_status:g,set_status:F,val_validate:E,set_validate:f};return P.CommonEffects({type:"textfield",states:t,val_status:g,set_status:F,val_validate:E,set_validate:f,SystemValidation:C.Validation.System,ExtraOverrideStates:l({},C.Validation.DataLeveling({allowDecimals:u,allowZeroStart:d,min:i,max:e,restrict:r,value:s}))}),Q(()=>{C.setSelection({id:t.id,restrict:r,val_status:g})},[g]),W(we,{val_status:g,set_status:F,val_validate:E,states:H.rootStates,children:[o(ke,{componentId:t.componentId,fontSize:t.fontSize,required:t.required,label:t.label,isActive:t.isLabelActive||n||!!g.dataValue}),o(C.Shallow,l({},H)),o(C.InputBox,l({},H)),o(C.TextAreaBox,l({},H))]})},V=t=>(t=l({autoHeight:!0,restrict:"text",fontSize:"inherit"},t),t.multiline?(t.minRows=t.minRows||5,t.maxRows=t.maxRows||20):(t.minRows=1,t.maxRows=1),o(Ce,{componentId:t.componentId,children:_e,states:Ve(t)})),x=V;x.Validate=C.Validation.Text,x.Katakana=t=>o(V,p(l({},t),{restrict:"katakana",multiline:!1,autoHeight:!1})),x.HankakuKatakana=t=>o(V,p(l({},t),{restrict:"hankaku.katakana",multiline:!1,autoHeight:!1})),x.CreditCard=t=>o(V,p(l({},t),{restrict:"creditCard",multiline:!1,autoHeight:!1})),x.Tel=t=>o(V,p(l({},t),{restrict:"tel",multiline:!1,autoHeight:!1})),x.Number=t=>o(V,p(l({},t),{restrict:"number",multiline:!1,autoHeight:!1})),x.DigitNumber=t=>o(V,p(l({},t),{restrict:"digitNumber",multiline:!1,autoHeight:!1})),x.Email=t=>o(V,p(l({},t),{restrict:"email",multiline:!1,autoHeight:!1})),x.Url=t=>o(V,p(l({},t),{restrict:"url",multiline:!1,autoHeight:!1})),x.Postal=t=>o(V,p(l({label:"\u90F5\u4FBF\u756A\u53F7"},t),{restrict:"postal",multiline:!1,autoHeight:!1,leftIcon:o(Ne,{ssSphere:2,fontColor:"4.thin",children:"\u3012"})})),x.Password=t=>o(V,p(l({label:"\u30D1\u30B9\u30EF\u30FC\u30C9",rightIcon:o(se,{ssSphere:2,padding:0,freeCSS:{pointerEvents:"all"},children:o(Re.Sub,{ssSphere:2,borderRadius:"3.tone.tertiary",fontColor:"theme",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:a=>{re.open(a.currentTarget,"\u30C6\u30AD\u30B9\u30C8\u3092\u8868\u793A",24)},onMouseLeave:re.abort,tabIndex:-1,onClick:a=>{S(a.target).parent().parent().find("input").callback(r=>{let s=r[0];if(!s)return;let i=s.dataset.componentId;if(!i)return;let e=oe.get(i+":set_inputType");e&&e(u=>u==="password"&&"text"||"password")})},children:o(ve,{icon:ye})})}),restrict:"password"},t),{multiline:!1,autoHeight:!1})),x.Concealed=t=>o(x.Password,p(l({label:"\u79D8\u5BC6\u9375"},t),{restrict:"concealed"})),x.Money={JPY:t=>o(x.DigitNumber,p(l({rightIcon:o(se,{ssSphere:2,fontColor:"4.thin",children:"\u5186"})},t),{multiline:!1,autoHeight:!1}))};export{x as TextField,_e as TextInput,x as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.2.174",
3
+ "version": "0.2.175",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",
@@ -90,7 +90,7 @@
90
90
  "@fortawesome/free-solid-svg-icons": "^6.7.2",
91
91
  "@fortawesome/react-fontawesome": "^0.2.2",
92
92
  "dotenv": "^17.0.1",
93
- "jmini": "^0.0.80",
93
+ "jmini": "^0.0.81",
94
94
  "react": "^18.3.1"
95
95
  },
96
96
  "devDependencies": {