amotify 0.2.26 → 0.2.28
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/demo/esbuild/app.tsx +23 -9
- package/demo/esbuild/public/index.css +1 -1
- package/demo/esbuild/public/index.js +96 -94
- package/dist/@declares/index.d.ts +2 -2
- package/dist/@declares/property.d.ts +4 -3
- package/dist/@styles/componentClasses/index.css +1 -1
- package/dist/@styles/componentClasses/index.d.ts +1 -2
- package/dist/@styles/componentClasses/index.js +1 -1
- package/dist/@styles/index.css +1 -1
- package/dist/@styles/index.js +1 -1
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +1 -1
- package/dist/@styles/style.js +1 -1
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.d.ts +4 -4
- package/dist/@utils/GenerateClassName.js +1 -1
- package/dist/@utils/LaunchReactApp.d.ts +1 -2
- package/dist/@utils/LaunchReactApp.js +1 -1
- package/dist/@utils/collectForm.js +1 -1
- package/dist/@utils/useRouterEffect.js +1 -1
- package/dist/atoms/Box.d.ts +8 -6
- package/dist/atoms/Box.js +1 -1
- package/dist/atoms/FAI.d.ts +3 -5
- package/dist/atoms/FAI.js +1 -1
- package/dist/atoms/Img.d.ts +3 -3
- package/dist/atoms/Img.js +1 -1
- package/dist/atoms/Logo.d.ts +3 -3
- package/dist/atoms/Logo.js +2 -2
- package/dist/atoms/Placeholder.d.ts +1 -1
- package/dist/atoms/Placeholder.js +1 -1
- package/dist/atoms/index.d.ts +40 -4
- package/dist/atoms/index.js +1 -1
- package/dist/fn/Button.d.ts +3 -3
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Cropper.d.ts +1 -1
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Effect/Fade.d.ts +3 -3
- package/dist/fn/Effect/Fade.js +1 -1
- package/dist/fn/Effect/Pudding.js +1 -1
- package/dist/fn/Effect/Ripple.js +2 -2
- package/dist/fn/Input/Autocomplete.d.ts +86 -0
- package/dist/fn/Input/Autocomplete.js +1 -0
- package/dist/fn/Input/Checker.d.ts +3 -3
- package/dist/fn/Input/Checker.js +1 -1
- package/dist/fn/Input/Contenteditable.js +1 -1
- package/dist/fn/Input/DigitCharacters.d.ts +2 -2
- package/dist/fn/Input/DigitCharacters.js +1 -1
- package/dist/fn/Input/Filer.d.ts +2 -2
- package/dist/fn/Input/Filer.js +1 -1
- package/dist/fn/Input/Hidden.js +1 -1
- package/dist/fn/Input/Label.d.ts +8 -0
- package/dist/fn/Input/Label.js +1 -0
- package/dist/fn/Input/List.d.ts +34 -22
- package/dist/fn/Input/List.js +1 -1
- package/dist/fn/Input/Parts.d.ts +18 -15
- package/dist/fn/Input/Parts.js +1 -1
- package/dist/fn/Input/Plain.d.ts +2 -2
- package/dist/fn/Input/Plain.js +1 -1
- package/dist/fn/Input/Search.d.ts +2 -2
- package/dist/fn/Input/Search.js +1 -1
- package/dist/fn/Input/Segmented.d.ts +17 -13
- package/dist/fn/Input/Segmented.js +1 -1
- package/dist/fn/Input/Select.d.ts +29 -9
- package/dist/fn/Input/Select.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Input/Switch.js +1 -1
- package/dist/fn/Input/TextField.d.ts +70 -0
- package/dist/fn/Input/TextField.js +3 -0
- package/dist/fn/Input/Time/Picker.js +1 -1
- package/dist/fn/Input/Time/index.d.ts +14 -0
- package/dist/fn/Input/Time/index.js +1 -1
- package/dist/fn/Input/core.d.ts +16 -18
- package/dist/fn/Input/core.js +1 -1
- package/dist/fn/Input/index.d.ts +36 -64
- package/dist/fn/Input/index.js +1 -1
- package/dist/fn/Loader/corner.js +1 -1
- package/dist/fn/Loader/index.d.ts +2 -2
- package/dist/fn/Loader/index.js +1 -1
- package/dist/fn/Loader/mini.js +1 -1
- package/dist/fn/PageNotFound.js +1 -1
- package/dist/fn/Plate.d.ts +2 -2
- package/dist/fn/Plate.js +1 -1
- package/dist/fn/RootViewController.d.ts +6 -7
- package/dist/fn/RootViewController.js +1 -1
- package/dist/fn/Sheet.d.ts +9 -9
- package/dist/fn/Sheet.js +1 -1
- package/dist/fn/Snackbar.d.ts +2 -2
- package/dist/fn/Snackbar.js +1 -1
- package/dist/fn/SwipeView.d.ts +2 -2
- package/dist/fn/SwipeView.js +1 -1
- package/dist/fn/TabBar.d.ts +2 -2
- package/dist/fn/TabBar.js +1 -1
- package/dist/fn/Table/Data.d.ts +3 -3
- package/dist/fn/Table/Data.js +1 -1
- package/dist/fn/Table/Drag.js +1 -1
- package/dist/fn/Table/Normal.js +1 -1
- package/dist/fn/Table/Parts.d.ts +7 -7
- package/dist/fn/Table/Parts.js +1 -1
- package/dist/fn/Table/cellStyling.d.ts +3 -3
- package/dist/fn/Table/cellStyling.js +1 -1
- package/dist/fn/Table/index.d.ts +5 -5
- package/dist/fn/Table/index.js +1 -1
- package/dist/fn/Tooltips.d.ts +4 -6
- package/dist/fn/Tooltips.js +1 -1
- package/dist/index.d.ts +28 -20
- package/dist/mols/Accordion.d.ts +2 -2
- package/dist/mols/Accordion.js +1 -1
- package/dist/mols/LinkifyText.d.ts +1 -1
- package/dist/mols/LinkifyText.js +1 -1
- package/dist/mols/List.d.ts +30 -7
- package/dist/mols/List.js +1 -1
- package/dist/mols/Row.d.ts +3 -3
- package/dist/mols/Row.js +1 -1
- package/dist/mols/Text.d.ts +18 -14
- package/dist/mols/Text.js +1 -1
- package/dist/mols/index.d.ts +0 -1
- package/dist/mols/index.js +1 -1
- package/dist/temps/designBook.js +20 -20
- package/package.json +2 -2
- package/dist/atoms/Flex.d.ts +0 -11
- package/dist/atoms/Flex.js +0 -1
- package/dist/atoms/Grid.d.ts +0 -4
- package/dist/atoms/Grid.js +0 -1
- package/dist/atoms/P.d.ts +0 -9
- package/dist/atoms/P.js +0 -1
- package/dist/atoms/Span.d.ts +0 -9
- package/dist/atoms/Span.js +0 -1
- package/dist/fn/Input/AutoHeightText.d.ts +0 -6
- package/dist/fn/Input/AutoHeightText.js +0 -1
- package/dist/fn/Input/Chips/Selector.d.ts +0 -44
- package/dist/fn/Input/Chips/Selector.js +0 -1
- package/dist/fn/Input/Chips/index.d.ts +0 -60
- package/dist/fn/Input/Chips/index.js +0 -1
- package/dist/fn/Input/RichSelect.d.ts +0 -33
- package/dist/fn/Input/RichSelect.js +0 -1
- package/dist/fn/Input/Text.d.ts +0 -51
- package/dist/fn/Input/Text.js +0 -1
- package/dist/fn/Input/TextArea.d.ts +0 -19
- package/dist/fn/Input/TextArea.js +0 -1
- package/dist/mols/Column.d.ts +0 -7
- package/dist/mols/Column.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q,b as m,c as _,d as Y}from"../../../chunk-C5N2D3ZX.js";import{Fragment as xe,jsx as I,jsxs as te}from"react/jsx-runtime";import{useState as C,useEffect as H,useRef as ie}from"react";import S from"@mingoo/jsmin";import{$$fromRoot as ne,Config as G,useStore as A}from"../../../@utils";import le from"../../../atoms/Box";import oe from"../../../atoms/FAI";import Q from"../../Button";import Z from"../../Tooltips";import{faClock as se}from"@fortawesome/free-solid-svg-icons/faClock";import{faCalendarAlt as me}from"@fortawesome/free-solid-svg-icons/faCalendarAlt";import{Wrapper as ue,BoxWrapper as pe,SubmitForm as ce,CommonEffects as de,DefaultStyles as fe}from"../core";import he from"../Hidden";import ge from"../Select";import ye from"../Parts";import ve from"./Picker";const P=" ~ ",De={clock:{defaultValue:"--:--",format:/^\d{2}\D\d{2}$/,ranges:[{type:"hour",from:0,length:2},{type:"minute",from:3,length:2}],sets:1},date:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2}],sets:1},week:{defaultValue:"----\u5E74\u7B2C--\u9031",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4,region:6},{type:"week",from:6,length:2,region:3}],sets:1},month:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:3}],sets:1},year:{defaultValue:"----\u5E74",format:/^\d{4}$/,ranges:[{type:"year",from:0,length:4,region:5}],sets:1},dates:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2,region:5},{type:"year",from:10+P.length,length:4},{type:"month",from:15+P.length,length:2},{type:"date",from:18+P.length,length:2}],sets:2},months:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:6},{type:"year",from:8+P.length,length:4},{type:"month",from:13+P.length,length:2,region:3}],sets:2},dateWareki:{defaultValue:"----\u5E74--\u6708--\u65E5",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"dateWareki",from:0,length:4,region:5},{type:"month",from:5,length:2,region:3},{type:"date",from:8,length:2,region:3}],sets:1}},j=e=>{let{restrict:l,value:D,era:i}=e,y=S.flatArray(D||""),{defaultValue:p,format:h,ranges:u,sets:t}=De[l],s=[],n=l=="clock"?":":"/";for(let r=0;r<y.length;r++)y[r]=String(y[r]).replace(/\D/ig,n);for(let r=0;r<t;r++){let c=y[r]||"";if(!c.match(h))y[r]="",s.push(p);else{let x=p;c.split(/\D/).forEach((V,w)=>{if(w==0&&l=="dateWareki"){let v=Number(V);i!="year"&&(v>=2019?i=="reiwa"?v-=2018:i=="heisei"&&(v=31):v>=1989?i=="heisei"?v-=1988:i=="shouwa"&&(v=64):v>=1926?i=="shouwa"?v-=1925:i=="taisho"&&(v=15):v>=1912?i=="taisho"?v-=1911:i=="meiji"&&(v=45):v>=1868&&(v-=1867)),V=v.zeroEmbed(4)}x=x.replace(new RegExp("------------------".slice(0,V.length)),V)}),s.push(x)}}return{formatValue:s.join(P),dataValue:["dates","months"].includes(l)?y:y[0],ranges:u}};function Ie(e){let{states:l}=e,{restrict:D,min:i,max:y,required:p}=l,h=[],u=S.flatArray(e.value),t={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let s=D=="clock"?":":"/";for(let n=0;n<u.length;n++)u[n]=String(u[n]).replace(/\D/ig,s);for(let n=0;n<u.length;n++){let r=u[n],c=u[n-1];r.removeLetters()||(t.empty=!0),n>0&&(t.escalated&=+(r>=c))}t.escalated&&(t.empty||(D.match(/clock/)?u.forEach(n=>{let[r,c]=n.split(/\D+/);!r||!c?t.filled=!1:(Number(r)>23||Number(c)>59)&&(t.correct=!1)}):D.match(/date/)?u.forEach(n=>{let[r,c,x]=n.split(/\D+/);if(!r||!c||!x)t.filled=!1;else{let V=S.Time(n);(!V.validate||n!=V.toFormatYMD())&&(t.correct=!1)}}):D.match(/week/)?u.forEach(n=>{let[r,c]=n.split(/\D+/);if(!r||!c)t.filled=!1;else{let x=S.Time(r+"/01/01").weekday,w=S.Time(r+"/01/0"+(7-x+1)).addWeek(Number(c)-1);r!=String(w.year)&&(t.correct=!1)}}):D.match(/month/)?u.forEach(n=>{let[r,c]=n.split(/\D+/);!r||!c?t.filled=!1:S.Time([r,c,"01"].join("/")).validate||(t.correct=!1)}):D.match(/year/),t.filled&&t.correct&&u.forEach(n=>{{let r=Number(String(n).replace(/\D/ig,""));if(i&&Number(String(i).replace(/\D/ig,""))>r&&(t.prohibited=!0),y){let c=Number(String(y).replace(/\D/ig,""));r>c&&(t.prohibited=!0)}}})))})();{let{empty:s,escalated:n,filled:r,correct:c,prohibited:x}=t;s&&p&&(h=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),n||h.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),c||h.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),r||h.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),x&&h.push({type:"invalid",label:te(xe,{children:[I(le,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",i||"\u4E0B\u9650\u7121\u3057","] ~ [",y||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!h.filter(({type:s})=>s=="invalid").length,notice:h}}const ee={picker:{launch:e=>{let l=e.tipsID||S.uuid.gen(),s=e,{onValueUpdate:D,min:i,max:y,era:p,restrict:h,defaultValue:u}=s,t=Y(s,["onValueUpdate","min","max","era","restrict","defaultValue"]);Z.open(_(m({gravityPoint:e.gravityPoint||24,tipsID:l,padding:"1/2"},t),{parent:t.parent,close_option:m({aroundClick:!0,parentBlur:!1},t.close_option),content:I(ve,{restrict:h,min:i,max:y,era:p,defaultValue:u,tipsID:l,onValueUpdate:(n,r)=>{D(n,r)}})}))},remove:e=>{Z.close(e)}}},ke=e=>{let K=e,{tone:l,required:D,restrict:i="clock",componentID:y,era:p,form:h,name:u,min:t,max:s,className:n,enableFormSubmit:r,checkValidationAtFirst:c,onKeyDown:x,onValidate:V,onUpdateValue:w,onUpdateValidValue:v,value:O="",leftIndicator:X,rightIndicator:F,freeCSS:g,wrapStyles:o}=K,$=Y(K,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","freeCSS","wrapStyles"]),[R,M]=C(p),[a,b]=C(_(m({componentID:e.componentID||""},j({restrict:i,value:O,era:R})),{eventType:"init",eventID:S.uuid.gen()})),[k,f]=C({ok:!1,notice:[]}),[E,B]=C({active:!1,index:0,prevIndex:-1});de({type:"time",states:e,val_status:a,set_status:b,val_validate:k,set_validate:f,DefaultValidation:Ie,onUpdateValue:w,onUpdateValidValue:v,ExtraOverrideStates:m({},j({restrict:i,value:O,era:R}))});const J=ie(!1);return H(()=>{if(J.current){b(T=>m(m({},T),j({restrict:i,value:T.dataValue,era:R})));let d=A.get("refreshEra_"+a.componentID);d&&d.refreshEra(R)}else J.current=!0},[R]),A.update({[a.componentID]:{openPicker:()=>{e.disabled||ee.picker.launch({parent:"#Picker-"+a.componentID,tipsID:"PickerTips-"+a.componentID,restrict:i,min:t,max:s,defaultValue:a.dataValue,era:R,onValueUpdate:(d,T)=>{b(W=>_(m(m({},W),j({restrict:i,value:d,era:T})),{eventType:"update",eventID:S.uuid.gen()})),M(T)}})},resetEra:d=>{M(d),b(T=>_(m(m({},T),j({restrict:i,value:"",era:R})),{eventType:"update",eventID:S.uuid.gen()}))}}}),H(()=>{let{index:d,active:T}=E;if(T){d=Math.max(d,0),d=Math.min(d,a.ranges.length-1);let{from:W,length:U}=a.ranges[d],L=ne("#"+e.id)[0];L&&L.setSelectionRange(W,W+U)}},[E]),te(pe,{val_status:a,set_status:b,val_validate:k,states:e,children:[I(he,{name:u,"data-input-type":"time","data-form":h,"data-validation":k.ok,componentID:a.componentID,"data-value":JSON.stringify(["dates","months"].includes(i)?!a.dataValue[0]||!a.dataValue[1]?null:a.dataValue:a.dataValue||null)}),G.get().isTouchDevice?I(Q.Button.Plain,{className:n,freeCSS:{textAlign:"left"},children:a.formatValue,onClick:d=>{let T=A.get(a.componentID);T&&T.openPicker(),d.stopPropagation()}}):I("input",m({type:"text",inputMode:"numeric","data-input-type":"time","data-form-name":h,value:a.formatValue,className:n,tabIndex:G.get().isTouchDevice?-1:0,onKeyDown:d=>{Te({restrict:i,event:d,val_era:R,val_status:a,set_status:b,val_focus:E,set_focus:B}),x&&x(d),r&&ce(d)},onKeyUp:d=>{d.key=="Tab"&&B(T=>_(m({},T),{active:!0}))},onClick:d=>{let T=d.target.selectionEnd,W=0;a.ranges.forEach((U,L)=>{let{from:z,length:ae,region:re}=U;z<=T&&T<=z+(re||ae)&&(W=L)}),B(U=>_(m({},U),{active:!0,index:W})),d.preventDefault()},onChange:()=>{}},$))]})},Te=e=>{let{val_era:l,restrict:D,event:i,val_status:y,set_status:p,val_focus:h,set_focus:u}=e,{key:t,shiftKey:s,ctrlKey:n,metaKey:r}=i,c=n||r,{selectionStart:x,selectionEnd:V}=i.target,{index:w,prevIndex:v}=h,{ranges:O,formatValue:X}=y,F=O.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(t)){let g=0;if(t=="Tab"){let o=+!s*2-1;if(g=h.index+o,g<0||g>F)return}else{let o=t=="ArrowLeft"?-1:t=="ArrowRight"?1:0;c||x==0&&V==String(y.formatValue).length?g=o==1?F:0:g=Math.max(0,Math.min(w+o,F))}u(o=>_(m({},o),{index:g,prevIndex:w})),i.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(t)){i.preventDefault();let g=w;g=Math.max(g,0),g=Math.min(g,F);let{type:o,from:$,length:R}=O[g],M=X.slice($,$+R),a;if(t=="Backspace")a="------".slice(0,R);else if(["ArrowUp","ArrowDown"].includes(t)){let b=t=="ArrowUp"?1:-1;M=M|0,a=M+b;let[k,f,E]=o=="dateWareki"?l=="year"?[0,2999,4]:l=="reiwa"?[1,2999,4]:l=="heisei"?[1,31,4]:l=="shouwa"?[1,64,4]:l=="taisho"?[1,15,4]:l=="meiji"?[1,45,4]:[0,0,0]:o=="minute"?[0,59,2]:o=="hour"?[0,23,2]:o=="date"?[1,31,2]:o=="week"?[1,53,2]:o=="month"?[1,12,2]:o=="year"?[0,2999,4]:[0,0,0];a>f?a=k:a<k&&(a=f),a=Number(a).zeroEmbed(E)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(t)){let b=M|0,k=t,f=`${b}${k}`;if(v!=w&&(b=0,f="0"+k),o=="year"||o=="dateWareki"&&l=="year")Number(f)>1e4?a=k:a=f,(a|0)>1e3&&g++;else if(["hour","minute","date","week","month"].includes(o)||o=="dateWareki"&&l!="year"){let E=o=="dateWareki"?l=="reiwa"?100:l=="heisei"?31:l=="shouwa"?64:l=="taisho"?15:l=="meiji"?45:0:o=="minute"?59:o=="hour"?23:o=="date"?31:o=="week"?53:o=="month"?12:0;a=(f|0)>E?k:f,(Number(k)>Number(String(E)[0])||M=="0000".slice(0,String(E).length)&&(f!="0000".slice(0,String(E).length)||["minute","hour"].includes(o)&&v==w)||(f|0)>=q(10,String(E).length-1))&&g++}o=="year"||o=="dateWareki"?a=(a|0).zeroEmbed(4):a=(a|0).zeroEmbed(2)}{let b=String(X).partReplace($,String(a)),k=b.split(P).map(f=>f.replace(/(^\D|\D$)/,"").split(/\D+/).join(D=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(D=="dateWareki"){let f=k[0].split(/\D/),[E,B,J]=f;f.length==3&&E&&(k=[[Number(E)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[l]),B,J].join("/")])}g=Math.max(g,0),g=Math.min(g,F),p(f=>_(m({},f),{dataValue:["dates","months"].includes(D)?k:k[0],formatValue:b,eventType:"update",eventID:S.uuid.gen()})),u(f=>_(m({},f),{index:g,prevIndex:f.index}))}}},N={Origin:e=>{e=m({},e);let[l]=C(e.componentID||S.uuid.gen());if(e.componentID=l,S.is.nullish(e.rightIndicator)){let D=(e.restrict||"").match(/clock/)?se:me;e.rightIndicator=I(ye.RightIndicator,{padding:0,children:I(Q.Button.Sub.R,{color:"cloud",border:"unset",padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["ripple.cloud"],tabIndex:-1,id:"Picker-"+e.componentID,onClick:()=>{let i=A.get(e.componentID);i&&i.openPicker()},children:I(oe,{icon:D})})})}return I(ue,{componentID:e.componentID,children:ke,states:fe.Boxish(e)})},Clock:e=>I(N.Origin,m({restrict:"clock",era:"clock"},e)),Date:e=>I(N.Origin,m({restrict:"date"},e)),Week:e=>I(N.Origin,m({restrict:"week"},e)),Month:e=>I(N.Origin,m({restrict:"month"},e)),Year:e=>I(N.Origin,m({restrict:"year"},e)),DateWareki:e=>{e=m({},e);let[l]=C(e.componentID||S.uuid.gen());e.componentID=l;let{defaultEra:D="wareki"}=e,[i,y]=C((()=>{let p="year";if(D=="wareki"&&(p="reiwa",e.value)){let[h,u,t]=e.value.split(/\D/);if(h&&u&&t){let s=Number(h);s>=2019?(s-=2019,p="reiwa"):s>=1989?(s-=1989,p="heisei"):s>=1926?(s-=1926,p="shouwa"):s>=1912?(s-=1912,p="taisho"):s>=1868&&(s-=1868,p="meiji"),s+=1}}return p})());return H(()=>{A.set({["refreshEra_"+l]:{refreshEra:p=>{y(p)}}})},[]),I(N.Origin,_(m({restrict:"dateWareki",leftIndicator:I(ge,{enableUnSelected:!1,value:i,tone:e.tone,override:"force",flexCenter:!0,borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",height:1,freeCSS:{whiteSpace:"nowrap"},options:[{value:"year",label:"\u897F\u66A6"},{value:"reiwa",label:"\u4EE4\u548C"},{value:"heisei",label:"\u5E73\u6210"},{value:"shouwa",label:"\u662D\u548C"},{value:"taisho",label:"\u5927\u6B63"},{value:"meiji",label:"\u660E\u6CBB"}],onUpdateValidValue:({value:p,eventType:h})=>{y(p);let u=A.get(e.componentID);u&&u.resetEra&&u.resetEra(p)}})},e),{era:i}))},Periods:{Date:e=>I(N.Origin,m({restrict:"dates"},e)),Month:e=>I(N.Origin,m({restrict:"months"},e))},fn:ee};export{N as Time,N as default};
|
|
1
|
+
import{a as ee,b as l,c as E,d as z}from"../../../chunk-C5N2D3ZX.js";import{Fragment as Ve,jsx as g,jsxs as ne}from"react/jsx-runtime";import{useState as A,useEffect as Y,useRef as me}from"react";import k from"@mingoo/jsmin";import{$$fromRoot as ue,Config as te,useStore as P,ExtractStyles as ce,GenerateHTMLProps as pe}from"../../../@utils";import{Box as q,FAI as de}from"../../../atoms";import{Text as fe}from"../../../mols";import ae from"../../Button";import re from"../../Tooltips";import{faClock as he}from"@fortawesome/free-solid-svg-icons/faClock";import{faCalendarAlt as ge}from"@fortawesome/free-solid-svg-icons/faCalendarAlt";import{OptionalInputWrapper as ye,BoxWrapper as ve,CoreEffects as K,DefaultStyles as De}from"../core";import{RightIcon as Ie}from"..";import Te from"../Hidden";import Se from"../Select";import{InputLabel as xe}from"../Label";import be from"./Picker";const F=" ~ ",ke={clock:{defaultValue:"--:--",format:/^\d{2}\D\d{2}$/,ranges:[{type:"hour",from:0,length:2},{type:"minute",from:3,length:2}],sets:1},date:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2}],sets:1},week:{defaultValue:"----\u5E74\u7B2C--\u9031",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4,region:6},{type:"week",from:6,length:2,region:3}],sets:1},month:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:3}],sets:1},year:{defaultValue:"----\u5E74",format:/^\d{4}$/,ranges:[{type:"year",from:0,length:4,region:5}],sets:1},dates:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2,region:5},{type:"year",from:10+F.length,length:4},{type:"month",from:15+F.length,length:2},{type:"date",from:18+F.length,length:2}],sets:2},months:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:6},{type:"year",from:8+F.length,length:4},{type:"month",from:13+F.length,length:2,region:3}],sets:2},dateWareki:{defaultValue:"----\u5E74--\u6708--\u65E5",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"dateWareki",from:0,length:4,region:5},{type:"month",from:5,length:2,region:3},{type:"date",from:8,length:2,region:3}],sets:1}},C={PeriodMargin:" ~ ",DataLeveling:e=>{let{restrict:n,value:y,era:t}=e,I=k.flatArray(y||""),{defaultValue:f,format:v,ranges:p,sets:a}=ke[n],m=[],o=n=="clock"?":":"/";for(let i=0;i<I.length;i++)I[i]=String(I[i]).replace(/\D/ig,o);for(let i=0;i<a;i++){let d=I[i]||"";if(!d.match(v))I[i]="",m.push(f);else{let b=f;d.split(/\D/).forEach((w,V)=>{if(V==0&&n=="dateWareki"){let T=Number(w);t!="year"&&(T>=2019?t=="reiwa"?T-=2018:t=="heisei"&&(T=31):T>=1989?t=="heisei"?T-=1988:t=="shouwa"&&(T=64):T>=1926?t=="shouwa"?T-=1925:t=="taisho"&&(T=15):T>=1912?t=="taisho"?T-=1911:t=="meiji"&&(T=45):T>=1868&&(T-=1867)),w=T.zeroEmbed(4)}b=b.replace(new RegExp("------------------".slice(0,w.length)),w)}),m.push(b)}}return{formatValue:m.join(F),dataValue:["dates","months"].includes(n)?I:I[0],ranges:p}},DefaultValidation:e=>{let{states:n}=e,{restrict:y,min:t,max:I,required:f}=n,v=[],p=k.flatArray(e.value),a={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let m=y=="clock"?":":"/";for(let o=0;o<p.length;o++)p[o]=String(p[o]).replace(/\D/ig,m);for(let o=0;o<p.length;o++){let i=p[o],d=p[o-1];i.removeLetters()||(a.empty=!0),o>0&&(a.escalated&=+(i>=d))}a.escalated&&(a.empty||(y.match(/clock/)?p.forEach(o=>{let[i,d]=o.split(/\D+/);!i||!d?a.filled=!1:(Number(i)>23||Number(d)>59)&&(a.correct=!1)}):y.match(/date/)?p.forEach(o=>{let[i,d,b]=o.split(/\D+/);if(!i||!d||!b)a.filled=!1;else{let w=k.Time(o);(!w.validate||o!=w.toFormatYMD())&&(a.correct=!1)}}):y.match(/week/)?p.forEach(o=>{let[i,d]=o.split(/\D+/);if(!i||!d)a.filled=!1;else{let b=k.Time(i+"/01/01").weekday,V=k.Time(i+"/01/0"+(7-b+1)).addWeek(Number(d)-1);i!=String(V.year)&&(a.correct=!1)}}):y.match(/month/)?p.forEach(o=>{let[i,d]=o.split(/\D+/);!i||!d?a.filled=!1:k.Time([i,d,"01"].join("/")).validate||(a.correct=!1)}):y.match(/year/),a.filled&&a.correct&&p.forEach(o=>{{let i=Number(String(o).replace(/\D/ig,""));if(t&&Number(String(t).replace(/\D/ig,""))>i&&(a.prohibited=!0),I){let d=Number(String(I).replace(/\D/ig,""));i>d&&(a.prohibited=!0)}}})))})();{let{empty:m,escalated:o,filled:i,correct:d,prohibited:b}=a;m&&f&&(v=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),o||v.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),d||v.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),i||v.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),b&&v.push({type:"invalid",label:ne(Ve,{children:[g(q,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",t||"\u4E0B\u9650\u7121\u3057","] ~ [",I||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!v.filter(({type:m})=>m=="invalid").length,notice:v}},KeyDownEvent:e=>{let{val_era:n,restrict:y,event:t,val_status:I,set_status:f,val_focus:v,set_focus:p}=e,{key:a,shiftKey:m,ctrlKey:o,metaKey:i}=t,d=o||i,{selectionStart:b,selectionEnd:w}=t.target,{index:V,prevIndex:T}=v,{ranges:L,formatValue:X}=I,N=L.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(a)){let D=0;if(a=="Tab"){let s=+!m*2-1;if(D=v.index+s,D<0||D>N)return}else{let s=a=="ArrowLeft"?-1:a=="ArrowRight"?1:0;d||b==0&&w==String(I.formatValue).length?D=s==1?N:0:D=Math.max(0,Math.min(V+s,N))}p(s=>E(l({},s),{index:D,prevIndex:V})),t.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(a)){t.preventDefault();let D=V;D=Math.max(D,0),D=Math.min(D,N);let{type:s,from:U,length:H}=L[D],M=X.slice(U,U+H),c;if(a=="Backspace")c="------".slice(0,H);else if(["ArrowUp","ArrowDown"].includes(a)){let R=a=="ArrowUp"?1:-1;M=M|0,c=M+R;let[r,u,S]=s=="dateWareki"?n=="year"?[0,2999,4]:n=="reiwa"?[1,2999,4]:n=="heisei"?[1,31,4]:n=="shouwa"?[1,64,4]:n=="taisho"?[1,15,4]:n=="meiji"?[1,45,4]:[0,0,0]:s=="minute"?[0,59,2]:s=="hour"?[0,23,2]:s=="date"?[1,31,2]:s=="week"?[1,53,2]:s=="month"?[1,12,2]:s=="year"?[0,2999,4]:[0,0,0];c>u?c=r:c<r&&(c=u),c=Number(c).zeroEmbed(S)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(a)){let R=M|0,r=a,u=`${R}${r}`;if(T!=V&&(R=0,u="0"+r),s=="year"||s=="dateWareki"&&n=="year")Number(u)>1e4?c=r:c=u,(c|0)>1e3&&D++;else if(["hour","minute","date","week","month"].includes(s)||s=="dateWareki"&&n!="year"){let S=s=="dateWareki"?n=="reiwa"?100:n=="heisei"?31:n=="shouwa"?64:n=="taisho"?15:n=="meiji"?45:0:s=="minute"?59:s=="hour"?23:s=="date"?31:s=="week"?53:s=="month"?12:0;c=(u|0)>S?r:u,(Number(r)>Number(String(S)[0])||M=="0000".slice(0,String(S).length)&&(u!="0000".slice(0,String(S).length)||["minute","hour"].includes(s)&&T==V)||(u|0)>=ee(10,String(S).length-1))&&D++}s=="year"||s=="dateWareki"?c=(c|0).zeroEmbed(4):c=(c|0).zeroEmbed(2)}{let R=String(X).partReplace(U,String(c)),r=R.split(F).map(u=>u.replace(/(^\D|\D$)/,"").split(/\D+/).join(y=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(y=="dateWareki"){let u=r[0].split(/\D/),[S,j,O]=u;u.length==3&&S&&(r=[[Number(S)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[n]),j,O].join("/")])}D=Math.max(D,0),D=Math.min(D,N),f(u=>E(l({},u),{dataValue:["dates","months"].includes(y)?r:r[0],formatValue:R,eventType:"update",eventID:k.uuid.gen()})),p(u=>E(l({},u),{index:D,prevIndex:u.index}))}}}},ie={picker:{launch:e=>{let n=e.tipsID||k.uuid.gen(),m=e,{onValueUpdate:y,min:t,max:I,era:f,restrict:v,defaultValue:p}=m,a=z(m,["onValueUpdate","min","max","era","restrict","defaultValue"]);re.open(E(l({gravityPoint:e.gravityPoint||24,tipsID:n,padding:0},a),{parent:a.parent,close_option:l({aroundClick:!0,parentBlur:!1},a.close_option),content:g(be,{restrict:v,min:t,max:I,era:f,defaultValue:p,tipsID:n,onValueUpdate:(o,i)=>{y(o,i)}})}))},remove:e=>{re.close(e)}}},Ee={Shallow:e=>{let{rootStates:n,val_status:y}=e,t=ce(n);return g(q,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:g(fe.Description,E(l({className:n.className},t),{position:"absolute",width:1,freeCSS:E(l({},t.freeCSS),{color:"orange"}),children:g(q,{"data-input-value-shallow":y.componentID,children:"A"})}))})}},we=e=>{let Q=e,{tone:n,required:y,restrict:t="clock",componentID:I,era:f,form:v,name:p,min:a,max:m,className:o,enableFormSubmit:i,checkValidationAtFirst:d,onKeyDown:b,onValidate:w,onUpdateValue:V,onUpdateValidValue:T,value:L="",leftIndicator:X,rightIndicator:N,leftIcon:D,rightIcon:s,freeCSS:U,wrapStyles:H}=Q,M=z(Q,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","freeCSS","wrapStyles"]),[c,R]=A(f),[r,u]=A(E(l({componentID:e.componentID||""},C.DataLeveling({restrict:t,value:L,era:c})),{eventType:"init",eventID:k.uuid.gen()})),[S,j]=A({ok:!1,notice:[]}),[O,B]=A({active:!1,index:0,prevIndex:-1}),oe={rootStates:e,val_status:r,set_status:u,val_validate:S,set_validate:j,val_era:c,set_era:R,val_focus:O,set_focus:B};K.CommonEffects({type:"time",states:e,val_status:r,set_status:u,val_validate:S,set_validate:j,onUpdateValue:V,onUpdateValidValue:T,DefaultValidation:C.DefaultValidation,ExtraOverrideStates:l({},C.DataLeveling({restrict:t,value:L,era:c}))});const G=me(!1);return Y(()=>{if(G.current){u(x=>l(l({},x),C.DataLeveling({restrict:t,value:x.dataValue,era:c})));let h=P.get("refreshEra_"+r.componentID);h&&h.refreshEra(c)}else G.current=!0},[c]),P.update({[r.componentID]:{openPicker:()=>{e.disabled||ie.picker.launch({parent:"#Picker-"+r.componentID,tipsID:"PickerTips-"+r.componentID,restrict:t,min:a,max:m,defaultValue:r.dataValue,era:c,onValueUpdate:(h,x)=>{u(W=>E(l(l({},W),C.DataLeveling({restrict:t,value:h,era:x})),{eventType:"update",eventID:k.uuid.gen()})),R(x)}})},resetEra:h=>{R(h),u(x=>E(l(l({},x),C.DataLeveling({restrict:t,value:"",era:c})),{eventType:"update",eventID:k.uuid.gen()}))}}}),Y(()=>{let{index:h,active:x}=O;if(x){h=Math.max(h,0),h=Math.min(h,r.ranges.length-1);let{from:W,length:$}=r.ranges[h],J=ue("#"+e.id)[0];J&&J.setSelectionRange(W,W+$)}},[O]),ne(ve,{val_status:r,set_status:u,val_validate:S,states:e,children:[g(Ee.Shallow,l({},oe)),g(xe,{componentID:e.componentID,fontSize:e.fontSize,required:e.required,label:e.label,isActive:!0}),g(Te,{name:p,"data-disabled":e.disabled,"data-input-type":"time","data-form":v,"data-validation":S.ok,componentID:r.componentID,"data-value":JSON.stringify(["dates","months"].includes(t)?!r.dataValue[0]||!r.dataValue[1]?null:r.dataValue:r.dataValue||null)}),te.get().isTouchDevice?g(ae.Button.Plain,{"data-show-validation":K.isShowValidation(S,r,!!d),"data-component-id":r.componentID,className:o,freeCSS:{textAlign:"left"},children:r.formatValue,onClick:h=>{let x=P.get(r.componentID);x&&x.openPicker(),h.stopPropagation()}}):g("input",l({type:"text",inputMode:"numeric","data-show-validation":K.isShowValidation(S,r,!!d),"data-input-origin":r.componentID,"data-disabled":e.disabled,"data-input-type":"time","data-form-name":v,value:r.formatValue,className:o,tabIndex:te.get().isTouchDevice?-1:0,onKeyDown:h=>{C.KeyDownEvent({restrict:t,event:h,val_era:c,val_status:r,set_status:u,val_focus:O,set_focus:B}),b&&b(h),i&&K.SubmitForm(h)},onKeyUp:h=>{h.key=="Tab"&&B(x=>E(l({},x),{active:!0}))},onClick:h=>{let x=h.target.selectionEnd,W=0;r.ranges.forEach(($,J)=>{let{from:Z,length:le,region:se}=$;Z<=x&&x<=Z+(se||le)&&(W=J)}),B($=>E(l({},$),{active:!0,index:W})),h.preventDefault()},onChange:()=>{}},M))]})},_={Origin:e=>{e=l({},e),e.rightIcon&&(e=l({paddingRight:3},e)),e.leftIcon&&(e=l({paddingLeft:3},e));let[n]=A(e.componentID||k.uuid.gen());if(e.componentID=n,k.is.nullish(e.rightIcon)){let y=(e.restrict||"").match(/clock/)?he:ge;e.rightIcon=g(Ie,{padding:0,children:g(ae.Button.Sub.R,{color:"cloud",border:"unset",ssSphere:2,fontColor:"theme",boxShadow:"0.normal",borderRadius:"3.tone.tertiary",flexCenter:!0,ssEffectsOnActive:"push",tabIndex:-1,id:"Picker-"+e.componentID,onClick:()=>{let t=P.get(e.componentID);t&&t.openPicker()},children:g(de,{icon:y})})})}return g(ye,{componentID:e.componentID,children:we,states:pe(De.Boxish(e))})},Clock:e=>g(_.Origin,l({restrict:"clock",era:"clock"},e)),Date:e=>g(_.Origin,l({restrict:"date"},e)),Week:e=>g(_.Origin,l({restrict:"week"},e)),Month:e=>g(_.Origin,l({restrict:"month"},e)),Year:e=>g(_.Origin,l({restrict:"year"},e)),DateWareki:e=>{e=l({},e);let[n]=A(e.componentID||k.uuid.gen());e.componentID=n;let{defaultEra:y="wareki"}=e,[t,I]=A((()=>{let f="year";if(y=="wareki"&&(f="reiwa",e.value)){let[v,p,a]=e.value.split(/\D/);if(v&&p&&a){let m=Number(v);m>=2019?(m-=2019,f="reiwa"):m>=1989?(m-=1989,f="heisei"):m>=1926?(m-=1926,f="shouwa"):m>=1912?(m-=1912,f="taisho"):m>=1868&&(m-=1868,f="meiji"),m+=1}}return f})());return Y(()=>{P.set({["refreshEra_"+n]:{refreshEra:f=>{I(f)}}})},[]),g(_.Origin,E(l({restrict:"dateWareki",leftIndicator:g(Se,{label:"\u5143\u53F7",emptySelect:!1,value:t,tone:e.tone,override:"force",flexCenter:!0,borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",height:1,freeCSS:{whiteSpace:"nowrap"},options:[{value:"year",label:"\u897F\u66A6"},{value:"reiwa",label:"\u4EE4\u548C"},{value:"heisei",label:"\u5E73\u6210"},{value:"shouwa",label:"\u662D\u548C"},{value:"taisho",label:"\u5927\u6B63"},{value:"meiji",label:"\u660E\u6CBB"}],onUpdateValidValue:({value:f,eventType:v})=>{I(f);let p=P.get(e.componentID);p&&p.resetEra&&p.resetEra(f)}})},e),{era:t}))},Periods:{Date:e=>g(_.Origin,l({restrict:"dates"},e)),Month:e=>g(_.Origin,l({restrict:"months"},e))},fn:ie};export{_ as Time,_ as default};
|
package/dist/fn/Input/core.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { StyleTags, ReactElement } from '../../@declares';
|
|
3
3
|
import { KeyValueDict } from '@mingoo/jsmin';
|
|
4
4
|
import { InputTypes } from '.';
|
|
5
|
-
|
|
6
|
-
declare namespace Wrapper {
|
|
5
|
+
declare namespace OptionalInputWrapper {
|
|
7
6
|
type Input = {
|
|
8
7
|
componentID?: string;
|
|
9
8
|
children: React.FC<any>;
|
|
10
9
|
states: any;
|
|
11
10
|
};
|
|
12
11
|
}
|
|
13
|
-
export declare const
|
|
12
|
+
export declare const OptionalInputWrapper: React.FC<OptionalInputWrapper.Input>;
|
|
14
13
|
declare namespace BoxWrapper {
|
|
15
14
|
type Input = {
|
|
16
15
|
val_status: any;
|
|
@@ -21,9 +20,10 @@ declare namespace BoxWrapper {
|
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
22
|
export declare const BoxWrapper: React.FC<BoxWrapper.Input>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
type CoreEffectTypes = 'textfield' | 'select' | 'list' | 'autocomplete' | 'time' | 'switch' | 'slider' | 'file' | 'contenteditable' | '';
|
|
24
|
+
export declare const CoreEffects: {
|
|
25
|
+
CommonEffects: (props: {
|
|
26
|
+
type: CoreEffectTypes;
|
|
27
27
|
states: KeyValueDict;
|
|
28
28
|
val_status: InputTypes.Status.Plain;
|
|
29
29
|
set_status: React.Dispatch<React.SetStateAction<any>>;
|
|
@@ -34,22 +34,20 @@ export declare const CommonEffects: {
|
|
|
34
34
|
onUpdateValidValue?: InputTypes.OnUpdateValue;
|
|
35
35
|
ExtraOverrideStates?: KeyValueDict;
|
|
36
36
|
ExtraStoreStates?: KeyValueDict;
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
export declare const ValidationCheck: {
|
|
40
|
-
(props: {
|
|
37
|
+
}) => void;
|
|
38
|
+
ValidationCheck: (props: {
|
|
41
39
|
val_status: InputTypes.Status.Plain;
|
|
42
40
|
DefaultValidation: InputTypes.Validation.SystemCheck;
|
|
43
41
|
states: any;
|
|
44
42
|
set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
|
|
45
|
-
})
|
|
43
|
+
}) => void;
|
|
44
|
+
SubmitForm: (event: React.KeyboardEvent) => boolean;
|
|
45
|
+
isShowValidation: (val_validate: InputTypes.Validation.Result, val_status: InputTypes.Status.Plain, checkValidationAtFirst: boolean) => boolean;
|
|
46
46
|
};
|
|
47
|
-
export declare const SubmitForm: (event: React.KeyboardEvent) => boolean;
|
|
48
47
|
export declare const DefaultStyles: {
|
|
49
|
-
Input: (type: InputTypes.BoxTone) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
IndicatorIcon: TagProperty.States;
|
|
48
|
+
Input: (type: InputTypes.BoxTone) => StyleTags.States;
|
|
49
|
+
Boxish: <T = any>(p: any) => T;
|
|
50
|
+
Indicator: (type: InputTypes.BoxTone) => StyleTags.Properties;
|
|
51
|
+
IndicatorIcon: StyleTags.States;
|
|
54
52
|
};
|
|
55
53
|
export {};
|
package/dist/fn/Input/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as n,c as d,e as B}from"../../chunk-C5N2D3ZX.js";import{jsx as y,jsxs as V}from"react/jsx-runtime";import{useState as E,useEffect as x}from"react";import i from"@mingoo/jsmin";import{$$fromRoot as N,Config as w,useStore as I}from"../../@utils";import{InputClasses as _}from"../../@styles/componentClasses";import{Box as z,Flex as F,FAI as R,Column as A}from"../../atoms";import{Row as k,Text as O}from"../../mols";import W from"../Button";import h from"../Tooltips";const ue=e=>{let[t]=E(e.componentID||i.uuid.gen());e=n({},e),e.states=d(n({enableFormSubmit:!0,status_id:i.uuid.gen(),override:"never",name:i.uuid.gen(),id:i.uuid.gen(),"aria-label":"Input-"+t},e.states),{componentID:t});let{children:a}=e;return y(a,n({},e.states))},de=e=>{let{children:t,val_status:a,set_status:o,val_validate:s,states:r}=e,{leftIcon:l,wrapStyles:u}=r;return a.eventType=="init"&&!r.checkValidationAtFirst&&(s.notice=[]),V(k.Center,d(n({position:"relative",verticalAlign:"unset",gap:0},u),{className:_("Wrapper"),"data-notice-uid":a.componentID,children:[y(D.Notice,{notice:s.notice,val_status:a}),r.leftIndicator,V(F,{position:"relative",flexSizing:"auto",children:[l,t,y(D.ClearButton,n({},e)),y(D.RightIcon,n({},e))]}),r.rightIndicator]}))},D={ClearButton:e=>!e.states.clearButton||!e.val_status.dataValue?null:y(W.Button.Normal.R,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3,transform:"translateY(-50%)"},onClick:()=>{e.set_status(t=>d(n({},t),{dataValue:"",formatValue:"",eventType:"update",eventID:i.uuid.gen()}))},children:y(R.Times,{})}),RightIcon:e=>e.states.clearButton&&e.val_status.dataValue?null:e.states.rightIcon,Notice:e=>{let{notice:t,val_status:a}=e,{componentID:o}=a,s="NoticeTimer-"+o,r="NoticeTimerClose-"+o,l="notice-tips-"+o;return i.interval.clear(s),i.interval.clear(r),i.interval.standBy(s,350,()=>{if(!t.length){h.close(l);return}h.open({tipsID:l,parent:`[data-notice-uid="${o}"]`,gravityPoint:22,padding:[1,0],close_option:{parentBlur:!1},content:V(h.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[y(z,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),y(A,{backgroundColor:"inherit",gap:"1/3",position:"relative",freeCSS:{zIndex:2},children:t.map((u,f)=>{let{type:g,label:T}=u,C=g=="invalid"?R.Times:g=="warn"?R.Exclamation:R.Check;return V(k.Left,{gap:0,borderRadius:"2.tone.secondary",children:[y(C,{flexCenter:!0,fontSize:"2.normal",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[g]}),y(O.Supplement,{fontSize:"0.xs",fontColor:"white",children:T})]},f+"-"+JSON.stringify(u))})})]})})}),i.interval.standBy(r,6e3,()=>{h.close(l)}),null}},K={CommonEffects:e=>{let{type:t,states:a,val_status:o,set_status:s,ExtraOverrideStates:r,ExtraStoreStates:l,val_validate:u,set_validate:f,DefaultValidation:g,onUpdateValue:T,onUpdateValidValue:C}=e;a=n({},a);let{componentID:b}=o;x(()=>(I.update({[b]:n({ResolveRefresh:null,Refresh:()=>new Promise((p,c)=>{I.get(b).ResolveRefresh=p,s(v=>d(n({},v),{eventType:"refresh",eventID:i.uuid.gen()}))}),GenNotice:p=>{let{ok:c,notice:v}=p;f({ok:c,notice:v})}},l)}),()=>{I.delete(b)}),[]),x(()=>{a.value=o.dataValue,i.interval.clear("ValidationTimer-"+b),K.ValidationCheck({val_status:o,set_validate:f,DefaultValidation:g,states:a})},[o.eventID]),(()=>{let{override:p}=a;if(p=="never"||p=="beforeModified"&&!["init","override"].includes(o.eventType))return;let c=I.get(o.componentID);c&&(a.value!=o.dataValue&&a.status_id!=c.status_id&&s(v=>d(n(d(n({},v),{dataValue:a.value}),r),{eventType:"override",eventID:i.uuid.gen()})),c.status_id=a.status_id)})(),x(()=>{let{componentID:p,eventType:c,dataValue:v}=o,m=v;if(t=="list"?(m=v.map(S=>i.toJson(S).body),a.type=="radio"&&(m=m[0])):t=="autocomplete"?(m=v.map(S=>i.toJson(S).body),a.multiSelect||(m=m[0])):t=="select"?m=i.toJson(m).body:t=="file"&&I.update({[p]:{Files:o.dataValue}}),c=="refresh"){let S=I.get(p);S&&S.ResolveRefresh&&S.ResolveRefresh(null)}c=="update"&&(T&&T({componentID:p,value:m,storeData:I.get(p),eventType:c}),i.scope(()=>{u.ok&&C&&C({componentID:p,value:m,storeData:I.get(p),eventType:c})}))},[u])},ValidationCheck:e=>{let{val_status:t,states:a,set_validate:o,DefaultValidation:s}=e,r=s({value:t.dataValue,states:a});if(!r.ok){o(r);return}let l=r.notice;const u=()=>B(void 0,null,function*(){if(!a.onValidate)return;let f=yield a.onValidate({value:t.dataValue,eventType:t.eventType,props:e});if(!f.ok){o({ok:!1,notice:[...l,...f.notice]});return}o({ok:!0,notice:[...l,...f.notice]})});a.onValidate?t.eventType=="refresh"?u():i.interval.standBy("ValidationTimer-"+t.componentID,450,u):o({ok:!0,notice:l})},SubmitForm:e=>{let t=e.target,{form:a,formName:o}=t.dataset;a=o||a;let s=!1,r=N(`[data-form-submit-button="${a}"]`)[0];if(!r)return s;let l=r.dataset.sdfike||"",u=e.key,f=e.ctrlKey||e.metaKey;return i.scope(()=>{l.includes("enter")&&(u!="Enter"||e.nativeEvent.isComposing||w.get().browserIs=="safari"&&e.keyCode==229)||((u=="Enter"&&(l.includes("enter")||l.includes("auxEnter")&&f)||u==" "&&l.includes("space"))&&(r.click(),e.preventDefault()),s=!0)}),s},isShowValidation:(e,t,a)=>{let o=e.ok;return!a&&t.eventType=="init"&&(o=!0),o}},L={Input:e=>{if(e=="plain")return{};let t={padding:"3/4",transition:"middle",flexSizing:"auto",boxShadow:"0.min"};return e=="border"?t=d(n({},t),{border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"}):e=="cloud"?t=d(n({},t),{border:"1.thin",borderRadius:"2.tone.secondary",backgroundColor:"cloud"}):e=="bottomBorder"&&(t=d(n({},t),{borderRadius:0,border:"unset",borderBottom:!0,backgroundColor:"cloud"})),t},Boxish:function(e){e=n({},e),e.tone||(e.tone="border");let t=L.Input(e.tone);return d(n(n(n(n({fontColor:"2.normal"},t),!!e.leftIndicator&&{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3",marginLeft:"1/4"}),!!e.rightIndicator&&{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}),e),{freeCSS:n({letterSpacing:"1px",resize:"none"},e.freeCSS),className:[_("Input"),e.className].join(" ")})},Indicator:e=>{if(e||(e="border"),e=="plain")return{};let t={flexSizing:"none",flexCenter:!0,padding:[0,1],borderRadius:"2.tone.secondary",backgroundColor:"cloud"};return e=="border"?t=d(n({},t),{border:!0}):e=="cloud"?t=d(n({},t),{border:"1.thin"}):e=="bottomBorder"&&(t=d(n({},t),{borderRadius:0,borderBottom:!0})),t},IndicatorIcon:{position:"absolute",ssSquare:2,flexCenter:!0,fontColor:"theme",fontSize:"1.mini",backgroundColor:"inherit",top:"50%",freeCSS:{transform:"translateY(-50%)"}}};export{de as BoxWrapper,K as CoreEffects,L as DefaultStyles,ue as OptionalInputWrapper};
|
package/dist/fn/Input/index.d.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { KeyValueDict } from '@mingoo/jsmin';
|
|
3
|
-
import { ReactElement,
|
|
2
|
+
import { ReactElement, StyleTags } from '../../@declares';
|
|
4
3
|
export declare namespace InputTypes {
|
|
5
4
|
type BoxTone = 'border' | 'cloud' | 'bottomBorder' | 'plain';
|
|
6
|
-
type OnUpdateValue = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
type UniInput = {
|
|
5
|
+
type OnUpdateValue<T = any> = (data: {
|
|
6
|
+
value: T;
|
|
7
|
+
componentID: string;
|
|
8
|
+
storeData?: KeyValueDict;
|
|
9
|
+
eventType: Validation.EventType;
|
|
10
|
+
}) => void;
|
|
11
|
+
type UniInput<T = any> = {
|
|
15
12
|
name?: string;
|
|
16
13
|
form?: string;
|
|
17
14
|
status_id?: string;
|
|
@@ -21,12 +18,12 @@ export declare namespace InputTypes {
|
|
|
21
18
|
enableFormSubmit?: boolean;
|
|
22
19
|
checkValidationAtFirst?: boolean;
|
|
23
20
|
onValidate?: Validation.OnValidate;
|
|
24
|
-
onUpdateValue?: OnUpdateValue
|
|
25
|
-
onUpdateValidValue?: OnUpdateValue
|
|
21
|
+
onUpdateValue?: OnUpdateValue<T>;
|
|
22
|
+
onUpdateValidValue?: OnUpdateValue<T>;
|
|
26
23
|
};
|
|
27
|
-
type CoreInput = UniInput &
|
|
24
|
+
type CoreInput<T = any> = UniInput<T> & StyleTags.States & {
|
|
28
25
|
className?: string;
|
|
29
|
-
wrapStyles?:
|
|
26
|
+
wrapStyles?: StyleTags.States;
|
|
30
27
|
};
|
|
31
28
|
namespace Validation {
|
|
32
29
|
type EventType = 'init' | 'update' | 'override' | 'refresh';
|
|
@@ -38,24 +35,20 @@ export declare namespace InputTypes {
|
|
|
38
35
|
ok: boolean;
|
|
39
36
|
notice: Notice[];
|
|
40
37
|
};
|
|
41
|
-
type SystemCheck = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
value: any;
|
|
51
|
-
props: KeyValueDict;
|
|
52
|
-
}): Promise<Result>;
|
|
53
|
-
};
|
|
38
|
+
type SystemCheck = (props: {
|
|
39
|
+
value: any;
|
|
40
|
+
states: any;
|
|
41
|
+
}) => Result;
|
|
42
|
+
type OnValidate = (state: {
|
|
43
|
+
eventType: EventType;
|
|
44
|
+
value: any;
|
|
45
|
+
props: KeyValueDict;
|
|
46
|
+
}) => Promise<Result>;
|
|
54
47
|
}
|
|
55
48
|
namespace Status {
|
|
56
|
-
type Plain = {
|
|
49
|
+
type Plain<T = any> = {
|
|
57
50
|
componentID: string;
|
|
58
|
-
dataValue:
|
|
51
|
+
dataValue: T;
|
|
59
52
|
eventType: Validation.EventType;
|
|
60
53
|
eventID: string;
|
|
61
54
|
};
|
|
@@ -79,68 +72,47 @@ export declare namespace InputTypes {
|
|
|
79
72
|
};
|
|
80
73
|
}
|
|
81
74
|
}
|
|
75
|
+
import * as _Parts from './Parts';
|
|
76
|
+
export * from './Parts';
|
|
82
77
|
import _Plain from './Plain';
|
|
83
78
|
import _Hidden from './Hidden';
|
|
84
|
-
import
|
|
85
|
-
import _TextArea from './TextArea';
|
|
86
|
-
import _AutoHeightText from './AutoHeightText';
|
|
79
|
+
import _TextField from './TextField';
|
|
87
80
|
import _Contenteditable from './Contenteditable';
|
|
88
81
|
import _DigitCharacters from './DigitCharacters';
|
|
89
82
|
import _Time from './Time';
|
|
90
83
|
import _Select from './Select';
|
|
91
|
-
import
|
|
84
|
+
import _Autocomplete from './Autocomplete';
|
|
92
85
|
import * as _List from './List';
|
|
93
|
-
import _Chips from './Chips';
|
|
94
86
|
import _Search from './Search';
|
|
95
87
|
import _Filer from './Filer';
|
|
96
88
|
import _Slider from './Slider';
|
|
97
89
|
import _Switch from './Switch';
|
|
98
90
|
import _Checker from './Checker';
|
|
99
91
|
import _Segmented from './Segmented';
|
|
100
|
-
import _Parts from './Parts';
|
|
101
92
|
declare namespace Input {
|
|
102
|
-
type Methods = {
|
|
103
|
-
Plain: React.FC<TagProperty.States & React.InputHTMLAttributes<HTMLInputElement>>;
|
|
104
|
-
Hidden: React.FC<_Hidden.Input>;
|
|
105
|
-
Text: _Text.Methods;
|
|
106
|
-
TextArea: React.FC<_TextArea.Input>;
|
|
107
|
-
AutoHeightText: React.FC<_AutoHeightText.Input>;
|
|
108
|
-
Contenteditable: React.FC<_Contenteditable.Input>;
|
|
109
|
-
DigitCharacters: React.FC<_DigitCharacters.Input>;
|
|
110
|
-
Time: _Time.Methods;
|
|
111
|
-
Select: React.FC<_Select.Input>;
|
|
112
|
-
RichSelect: React.FC<_RichSelect.Input>;
|
|
113
|
-
Radio: React.FC<_List.List.Input>;
|
|
114
|
-
Checkbox: React.FC<_List.List.Input>;
|
|
115
|
-
Checker: React.FC<_Checker.Input>;
|
|
116
|
-
Chips: _Chips.Methods;
|
|
117
|
-
Search: React.FC<_Search.Input>;
|
|
118
|
-
Filer: _Filer.Methods;
|
|
119
|
-
Slider: React.FC<_Slider.Input>;
|
|
120
|
-
Switch: React.FC<_Switch.Input>;
|
|
121
|
-
Segmented: _Segmented.Methods;
|
|
122
|
-
Comps: _Parts.Methods;
|
|
123
|
-
};
|
|
124
93
|
export import Plain = _Plain;
|
|
125
94
|
export import Hidden = _Hidden;
|
|
126
|
-
export import
|
|
127
|
-
export import TextArea = _TextArea;
|
|
128
|
-
export import AutoHeightText = _AutoHeightText;
|
|
95
|
+
export import TextField = _TextField;
|
|
129
96
|
export import Contenteditable = _Contenteditable;
|
|
130
97
|
export import DigitCharacters = _DigitCharacters;
|
|
131
98
|
export import Time = _Time;
|
|
132
99
|
export import Select = _Select;
|
|
133
|
-
export import
|
|
100
|
+
export import Autocomplete = _Autocomplete;
|
|
134
101
|
export import List = _List.List;
|
|
135
102
|
export import Radio = _List.Radio;
|
|
136
103
|
export import Checkbox = _List.Checkbox;
|
|
137
104
|
export import Checker = _Checker;
|
|
138
|
-
export import Chips = _Chips;
|
|
139
105
|
export import Search = _Search;
|
|
140
106
|
export import Filer = _Filer;
|
|
141
107
|
export import Slider = _Slider;
|
|
142
108
|
export import Switch = _Switch;
|
|
143
109
|
export import Segmented = _Segmented;
|
|
144
|
-
export import
|
|
110
|
+
export import LeftIcon = _Parts.LeftIcon;
|
|
111
|
+
export import RightIcon = _Parts.RightIcon;
|
|
112
|
+
export import LeftIndicator = _Parts.LeftIndicator;
|
|
113
|
+
export import RightIndicator = _Parts.RightIndicator;
|
|
114
|
+
export import RequiredSign = _Parts.RequiredSign;
|
|
115
|
+
export import RequiredShortSign = _Parts.RequiredShortSign;
|
|
116
|
+
export import OmitSign = _Parts.OmitSign;
|
|
145
117
|
}
|
|
146
118
|
export { Input, Input as default };
|
package/dist/fn/Input/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-C5N2D3ZX.js";import
|
|
1
|
+
import"../../chunk-C5N2D3ZX.js";import*as t from"./Parts";export*from"./Parts";import i from"./Plain";import a from"./Hidden";import p from"./TextField";import m from"./Contenteditable";import n from"./DigitCharacters";import l from"./Time";import d from"./Select";import x from"./Autocomplete";import*as o from"./List";import s from"./Search";import c from"./Filer";import y from"./Slider";import f from"./Switch";import T from"./Checker";import g from"./Segmented";var r;(e=>(e.Plain=i,e.Hidden=a,e.TextField=p,e.Contenteditable=m,e.DigitCharacters=n,e.Time=l,e.Select=d,e.Autocomplete=x,e.List=o.List,e.Radio=o.Radio,e.Checkbox=o.Checkbox,e.Checker=T,e.Search=s,e.Filer=c,e.Slider=y,e.Switch=f,e.Segmented=g,e.LeftIcon=t.LeftIcon,e.RightIcon=t.RightIcon,e.LeftIndicator=t.LeftIndicator,e.RightIndicator=t.RightIndicator,e.RequiredSign=t.RequiredSign,e.RequiredShortSign=t.RequiredShortSign,e.OmitSign=t.OmitSign))(r||(r={}));export{r as Input,r as default};
|
package/dist/fn/Loader/corner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-C5N2D3ZX.js";import{jsx as
|
|
1
|
+
import"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as t}from"react/jsx-runtime";import{Config as i,useStore as l}from"../../@utils";import{useState as d,useEffect as c}from"react";import{Box as o,Flex as r}from"../../atoms";import{LoaderClasses as e}from"../../@styles/componentClasses";const x=()=>{let[n,s]=d(!1);return c(()=>{l.set({["Loader-corner-"+i.get().sessionUID+"-corner"]:{active:()=>{s(!0)},stop:()=>{s(!1)}}})},[]),t(r,{className:[e("CornerLoader"),n?e("isActive"):""].join(" "),gap:"1/2",padding:["1/2","3/4"],borderRadius:"2/3",backgroundColor:"dark",position:"fixed",boxShadow:"1.remark",left:"50%",top:1,opacity:"trans",transition:"short",isRounded:!0,freeCSS:{zIndex:10,pointerEvents:"none",transform:"translateX(-50%)"},children:[t(r,{className:e("Wrap"),flexWrap:!1,verticalAlign:"center",horizontalAlign:"center",children:[a(o,{className:e("Ld4")}),a(o,{className:e("Ld3")}),a(o,{className:e("Ld2")}),a(o,{className:e("Ld1")}),a(o,{className:e("Ld2")}),a(o,{className:e("Ld3")}),a(o,{className:e("Ld4")})]}),a(o,{fontColor:"white",fontSize:"0.xs",isSemiBoldFont:!0,children:"Loading..."})]})};export{x as Corner};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { StyleTags } from '../../@declares';
|
|
3
3
|
declare namespace Loader {
|
|
4
4
|
type Methods = Color & FNs;
|
|
5
5
|
type Color = {
|
|
@@ -19,7 +19,7 @@ declare namespace Loader {
|
|
|
19
19
|
};
|
|
20
20
|
type Sizes = 'S' | 'R' | 'L' | 'XL' | 'MAX';
|
|
21
21
|
type Colors = 'theme' | 'posi' | 'nega' | 'warn' | 'white' | 'cloud';
|
|
22
|
-
type CompInput =
|
|
22
|
+
type CompInput = StyleTags.States & {
|
|
23
23
|
showInitial?: boolean;
|
|
24
24
|
loaderID?: string;
|
|
25
25
|
};
|
package/dist/fn/Loader/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p}from"../../chunk-C5N2D3ZX.js";import{jsx as n}from"react/jsx-runtime";import{Config as
|
|
1
|
+
import{b as p}from"../../chunk-C5N2D3ZX.js";import{jsx as n}from"react/jsx-runtime";import{Config as m,useStore as a,$$fromRoot as l}from"../../@utils";import{LoaderClasses as d}from"../../@styles/componentClasses";import{Mini as s}from"./mini";import{Corner as L}from"./corner";const i=e=>{let t=e.color;return{S:o=>n(s,p({size:"S",color:t},o)),R:o=>n(s,p({size:"R",color:t},o)),L:o=>n(s,p({size:"L",color:t},o)),XL:o=>n(s,p({size:"XL",color:t},o)),MAX:o=>n(s,p({size:"MAX",color:t},o))}},c={Wrapper:()=>n(L,{}),Theme:i({color:"theme"}),Posi:i({color:"posi"}),Nega:i({color:"nega"}),Warn:i({color:"warn"}),White:i({color:"white"}),Cloud:i({color:"cloud"}),fn:{corner:{active:()=>{let e=a.get("Loader-corner-"+m.get().sessionUID+"-corner");e&&e.active()},stop:()=>{let e=a.get("Loader-corner-"+m.get().sessionUID+"-corner");e&&e.stop()}},mini:{active:(e="")=>{l("."+d("MiniLoader")).for(t=>{let{dataset:{componentId:o}={}}=t;if(!o)return;let r=a.get(o);r&&r.active&&r.active(e)})},stop:(e="")=>{l("."+d("MiniLoader")).for(t=>{let{dataset:{componentId:o}={}}=t;if(!o)return;let r=a.get(o);r&&r.stop&&r.stop(e)})},stopALL:()=>{l("."+d("MiniLoader")).for(e=>{let{dataset:{componentId:t}={}}=e;if(!t)return;let o=a.get(t);o&&o.stopForce&&o.stopForce()})}},stopALL:()=>{c.fn.corner.stop(),c.fn.mini.stopALL()}}};export{c as Loader,c as default};
|
package/dist/fn/Loader/mini.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d,c as f,d as h}from"../../chunk-C5N2D3ZX.js";import{jsx as
|
|
1
|
+
import{b as d,c as f,d as h}from"../../chunk-C5N2D3ZX.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import y from"@mingoo/jsmin";import{$$fromRoot as L,useStore as z}from"../../@utils";import{useState as l,useEffect as g}from"react";import{LoaderClasses as e}from"../../@styles/componentClasses";import{Row as I}from"../../mols";const R=w=>{let p=w,{color:S="theme",size:t="R",showInitial:c=!1,loaderID:u=""}=p,C=h(p,["color","size","showInitial","loaderID"]),[m]=l(u),[i]=l(y.uuid.gen()),[v,a]=l(c),o=0;t=="S"?o=1:t=="R"?o=1.5:t=="L"?o=3:t=="XL"?o=4:t=="MAX"&&(o=6);let n={theme:"hsl( var( --color-theme-hsl ) )",posi:"var( --color-positive )",nega:"var( --color-negative )",warn:"var( --color-warning )",cloud:"hsl( var( --color-layer5-hsl ) )",white:"white"}[S];return g(()=>{let r=L('[data-component-id="'+i+'"]');v?r.removeClass(e("Hide")).await(10).addClass(e("Active")):r.removeClass(e("Active")).await(210).addClass(e("Hide"))},[v]),g(()=>{z.set({[i]:{active:r=>{m==r&&a(!0)},stop:r=>{m==r&&a(!1)},stopForce:()=>{a(!1)}}})},[]),x(I.Center,f(d({className:[e("MiniLoader"),e(c?"Active":"Hide")].join(" "),componentID:i,ssSphere:o,position:"relative"},C),{children:[s("svg",{className:e("SVG1"),width:"100",height:"100",viewBox:"0 0 100 100",style:{stroke:n},children:s("circle",{cx:"50",cy:"50",r:"40"})}),s("svg",{className:e("SVG2"),width:"100",height:"100",viewBox:"0 0 100 100",style:{stroke:n},children:s("circle",{cx:"50",cy:"50",r:"40"})})]}))};export{R as Mini};
|
package/dist/fn/PageNotFound.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-C5N2D3ZX.js";import{jsx as o,jsxs as t}from"react/jsx-runtime";import
|
|
1
|
+
import"../chunk-C5N2D3ZX.js";import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Box as e,FAI as l,Column as a}from"../atoms";import{Row as m,Text as r}from"../mols";import d from"./Button";const i=()=>{let{href:n}=location;return o(m.Center,{padding:[4,1],children:t(a,{ssCardBox:!0,gap:2,padding:[3,2],textAlign:"center",width:1,freeCSS:{maxWidth:12*30},children:[o(l.LinkSlash,{fontColor:"theme",freeCSS:{fontSize:"3rem"}}),t(e,{children:[o(r.Paragraph,{children:"\u3053\u306E\u30DA\u30FC\u30B8\u306F\u3054\u5229\u7528\u3044\u305F\u3060\u3051\u307E\u305B\u3093\u3002"}),o(r.Supplement,{fontColor:"3.blur",children:"\u5165\u529B\u3055\u308C\u305F\u30EA\u30F3\u30AF\u306E\u30DA\u30FC\u30B8\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3067\u3057\u305F\u3002"})]}),t(a,{children:[t(r,{textAlign:"left",ssCardBox:"cloud",isSemiBoldFont:!0,padding:1,children:["\u30FB\u30EA\u30F3\u30AF\u304C\u6B63\u3057\u3044\u304B",o(e,{margin:["1/2",0],borderBottom:!0}),"\u30FB\u30EA\u30F3\u30AF\u306E\u6709\u52B9\u671F\u9650",o(e,{margin:["1/2",0],borderBottom:!0}),"\u30FB\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u7B49\u304C\u6B63\u3057\u3044\u304B"]}),"\u306A\u3069\u3092\u3082\u3046\u4E00\u5EA6\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"]}),o(d.Anchor.Link,{newTab:!0,href:n,children:n}),o(d.Anchor.BorderToFill.R,{href:"/",width:1,children:"\u30DB\u30FC\u30E0\u306B\u623B\u308B"})]})})};export{i as PageNotFound,i as default};
|
package/dist/fn/Plate.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import Box from '../atoms
|
|
2
|
+
import { Box } from '../atoms';
|
|
3
3
|
declare namespace Plate {
|
|
4
4
|
type Input = {
|
|
5
5
|
size?: 'XS' | 'S' | 'R' | 'L' | 'XL' | 'MAX';
|
|
6
|
-
} & Box.
|
|
6
|
+
} & Box.DefaultInput;
|
|
7
7
|
}
|
|
8
8
|
declare const Plate: React.FC<Plate.Input>;
|
|
9
9
|
export { Plate, Plate as default };
|
package/dist/fn/Plate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as o,d as S}from"../chunk-C5N2D3ZX.js";import{jsx as
|
|
1
|
+
import{b as e,c as o,d as S}from"../chunk-C5N2D3ZX.js";import{jsx as u}from"react/jsx-runtime";import{Box as n}from"../atoms";const p=r=>{let a=r,{size:l="R"}=a,t=S(a,["size"]),i={XS:48,S:60,R:72,L:84,XL:100,MAX:120}[l];return u(n,o(e({margin:[0,"auto"],width:1},t),{freeCSS:e({maxWidth:12*i},t.freeCSS)}))};export{p as Plate,p as default};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import Box from '../atoms
|
|
4
|
-
import Flex from '../atoms/Flex';
|
|
2
|
+
import { StyleTags, ReactElement } from '../@declares';
|
|
3
|
+
import { Box, Flex } from '../atoms';
|
|
5
4
|
import Button from './Button';
|
|
6
5
|
declare namespace RootViewController {
|
|
7
6
|
type Methods = {
|
|
@@ -9,16 +8,16 @@ declare namespace RootViewController {
|
|
|
9
8
|
TopNavigation: React.FC<Flex.Input>;
|
|
10
9
|
SideNavigation: React.FC<Flex.Input>;
|
|
11
10
|
FooterNavigation: React.FC<Flex.Input & {
|
|
12
|
-
baseStyles?:
|
|
11
|
+
baseStyles?: StyleTags.Properties;
|
|
13
12
|
}>;
|
|
14
13
|
Comps: {
|
|
15
14
|
Button: React.FC<Button>;
|
|
16
|
-
Title: React.FC<Box.
|
|
17
|
-
Bar: React.FC<Box.
|
|
15
|
+
Title: React.FC<Box.DefaultInput>;
|
|
16
|
+
Bar: React.FC<Box.DefaultInput>;
|
|
18
17
|
};
|
|
19
18
|
fn: FNs;
|
|
20
19
|
};
|
|
21
|
-
type Base = Box.
|
|
20
|
+
type Base = Box.DefaultInput & {
|
|
22
21
|
topNavigation?: ReactElement;
|
|
23
22
|
sideNavigation?: ReactElement;
|
|
24
23
|
footerNavigation?: ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p,c as
|
|
1
|
+
import{b as p,c as v,d as f}from"../chunk-C5N2D3ZX.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{useState as S,useEffect as N}from"react";import a from"@mingoo/jsmin";import{$$fromRoot as m,Config as B,pageRouter as F}from"../@utils";import{Box as h,Flex as C,Column as _}from"../atoms";import w from"./Button";import{LayoutClasses as y}from"../@styles/componentClasses";const c={Base:o=>{let l=o,{topNavigation:t,sideNavigation:e,footerNavigation:i,children:n,className:r}=l,g=f(l,["topNavigation","sideNavigation","footerNavigation","children","className"]);N(()=>{c.fn.updateCSSProperty.reset(),setTimeout(()=>{c.fn.updateCSSProperty.reset()},100);let u="ResizeCB",R="RemovePageEventCB";return a(window).addEvent({eventType:"resize",eventID:u,callback:()=>{B.get().screen.isPhonepoint()||(a.interval.clear("__RVC_calcHeights"),a.interval.standBy("__RVC_calcHeights",300,()=>{c.fn.updateCSSProperty.reset()}))}}),()=>{a(window).removeEvent(R),a(window).removeEvent(u)}},[]);let d=n;return x(_,v(p({className:[r,y("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},g),{children:[t,x(C,{className:y("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[e,s(h,{className:y("Content"),position:"relative",flexSizing:0,width:0,UnderBreakPointStyles:{width:"auto"},children:d})]}),i]}))},TopNavigation:o=>{let r=o,{className:t,children:e}=r,i=f(r,["className","children"]),[n]=S(a.uuid.gen());return N(()=>{c.fn.updateCSSProperty.topNav()},[]),s(C,v(p({"data-id":n,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},i),{id:"__RVC_TopNavigation",className:[t,y("TopNav")].join(" "),children:e}),n)},SideNavigation:o=>{let i=o,{className:t=""}=i,e=f(i,["className"]);return s(h,p({className:[t,y("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e))},FooterNavigation:o=>{let r=o,{className:t="",baseStyles:e}=r,i=f(r,["className","baseStyles"]),[n]=S(a.uuid.gen());return N(()=>{c.fn.updateCSSProperty.footer()},[]),s(C,v(p({"data-id":n,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[y("FooterNav"),t].join(" "),children:s(C,p({gap:1,flexWrap:!1,padding:"2/3",margin:"auto"},i))}))},Comps:{Button:o=>{let d=o,{isActive:t,uri:e,uriGroup:i}=d,n=f(d,["isActive","uri","uriGroup"]),r=a.flatArray(i),g=location.pathname;{let l=!1;if(a.is.exist(e)&&a.is.string(e)){let u=[location.origin,e.replace(/\//,"")].join("/");l=g==new URL(u).pathname}if(!l&&r.length)for(let u of r)a.is.nullish(u)||g.match(new RegExp(u))&&(l=!0);t=t!=null?t:l}return s(w.Button.Clear.R,p({isActive:t,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:l=>{a.is.exist(e)&&a.is.string(e)&&F.push(e,l.ctrlKey||l.metaKey)},color:"cloud",padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",width:1,flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0},n))},Bar:o=>s(h,p({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},o)),Title:o=>s(h,p({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},o))},fn:{updateCSSProperty:{topNav:()=>{let o=a(document.body),t=m("#__RVC_TopNavigation"),e=t.position().height||0,i=e;t.getStyleProperty("position")!="sticky"&&(i=0),o.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",i+"px")},footer:()=>{let o=a(document.body),e=m("#__RVC_FooterNavigation").position().height||0;o.setStyleProperty("--footerNavHeight",e+"px")},reset:()=>{let o=a(document.body),t=m("#__RVC_TopNavigation"),e=m("#__RVC_FooterNavigation"),i=t.position().height||0,n=i,r=e.position().height||0;t.getStyleProperty("position")!="sticky"&&(n=0);let g=window.innerHeight,d=g-i-r;o.setStyleProperty("--topNavHeight",i+"px").setStyleProperty("--topBase",n+"px").setStyleProperty("--footerNavHeight",r+"px").setStyleProperty("--viewHeight",g+"px").setStyleProperty("--sideNavHeight",d+"px").setStyleProperty("--contentHeight",d+"px")}}}};export{c as RootViewController,c as default};
|
package/dist/fn/Sheet.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import $$ from '@mingoo/jsmin';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleTags, ReactElement } from '../@declares';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import Box from '../atoms
|
|
4
|
+
import { Box } from '../atoms';
|
|
5
5
|
declare namespace Sheet {
|
|
6
6
|
type Methods = {
|
|
7
7
|
Wrapper(): JSX.Element;
|
|
8
|
-
open(p:
|
|
8
|
+
open<T = Input>(p: T): void;
|
|
9
9
|
refresh(p: Input, open: boolean): void;
|
|
10
10
|
resize(p: {
|
|
11
11
|
sheetID: string;
|
|
12
12
|
size: Size;
|
|
13
13
|
}): void;
|
|
14
|
-
|
|
14
|
+
customSheet: {
|
|
15
|
+
reposition(sheetID: string): void;
|
|
16
|
+
};
|
|
15
17
|
close(key: string, eventType?: 'Escape' | 'pageTransit', force?: boolean): void;
|
|
16
18
|
closeGroup(keyGroup: string): void;
|
|
17
19
|
closeAll(pageTransit?: boolean): void;
|
|
18
|
-
|
|
19
|
-
Body: React.FC<Box.Input>;
|
|
20
|
-
};
|
|
20
|
+
Body: React.FC<Box.DefaultInput>;
|
|
21
21
|
};
|
|
22
22
|
type Input = Normal | Edge | Custom | Image | Bottom.Input;
|
|
23
23
|
type States = {
|
|
@@ -34,7 +34,7 @@ declare namespace Sheet {
|
|
|
34
34
|
bodyScrolls?: number;
|
|
35
35
|
openAfter?(): void;
|
|
36
36
|
closeAfter?(): void;
|
|
37
|
-
} &
|
|
37
|
+
} & StyleTags.BasicElement;
|
|
38
38
|
type Size = 'S' | 'R' | 'L' | '2L' | '3L' | 'MAX';
|
|
39
39
|
type CloseOptions = {
|
|
40
40
|
pageTransit?: boolean;
|
|
@@ -72,7 +72,7 @@ declare namespace Sheet {
|
|
|
72
72
|
type: 'drawer.bottom';
|
|
73
73
|
size: Sizes;
|
|
74
74
|
sizeChanged?(size: Sizes): void;
|
|
75
|
-
baseStyles?:
|
|
75
|
+
baseStyles?: StyleTags.States;
|
|
76
76
|
close_option?: CloseOptions & {
|
|
77
77
|
swipeDown?: boolean;
|
|
78
78
|
};
|