amotify 0.2.76 → 0.2.78

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.
Files changed (67) hide show
  1. package/demo/esbuild/app.tsx +92 -41
  2. package/demo/esbuild/public/index.css +1 -1
  3. package/demo/esbuild/public/index.js +37 -37
  4. package/demo/esbuild/server.ts +1 -1
  5. package/dist/@styles/componentClasses/index.css +1 -1
  6. package/dist/@styles/componentClasses/index.js +1 -1
  7. package/dist/@styles/index.css +1 -1
  8. package/dist/@styles/index.js +1 -1
  9. package/dist/@styles/init.css +1 -1
  10. package/dist/@styles/style.css +1 -1
  11. package/dist/@styles/style.js +1 -1
  12. package/dist/@utils/GenerateClassName.js +1 -1
  13. package/dist/@utils/color.js +1 -1
  14. package/dist/@utils/config.js +1 -1
  15. package/dist/@utils/getElement.d.ts +1 -1
  16. package/dist/@utils/getElement.js +1 -1
  17. package/dist/@utils/useRefresh.js +1 -1
  18. package/dist/@utils/useStore.d.ts +1 -1
  19. package/dist/atoms/Logo.js +1 -1
  20. package/dist/fn/Button.d.ts +1 -1
  21. package/dist/fn/Button.js +1 -1
  22. package/dist/fn/Cropper.js +1 -1
  23. package/dist/fn/Effect/Fade.js +1 -1
  24. package/dist/fn/Effect/Pudding.js +1 -1
  25. package/dist/fn/Effect/Ripple.js +2 -2
  26. package/dist/fn/Input/Autocomplete.d.ts +1 -1
  27. package/dist/fn/Input/Autocomplete.js +1 -1
  28. package/dist/fn/Input/CollectForm.d.ts +1 -1
  29. package/dist/fn/Input/CollectForm.js +1 -1
  30. package/dist/fn/Input/Color.js +1 -1
  31. package/dist/fn/Input/Contenteditable.js +1 -1
  32. package/dist/fn/Input/DigitCharacters.js +1 -1
  33. package/dist/fn/Input/Filer.js +1 -1
  34. package/dist/fn/Input/Hidden.d.ts +1 -1
  35. package/dist/fn/Input/Hidden.js +1 -1
  36. package/dist/fn/Input/Label.js +1 -1
  37. package/dist/fn/Input/List.d.ts +1 -1
  38. package/dist/fn/Input/List.js +1 -1
  39. package/dist/fn/Input/Segmented.d.ts +1 -1
  40. package/dist/fn/Input/Segmented.js +1 -1
  41. package/dist/fn/Input/Select.d.ts +1 -1
  42. package/dist/fn/Input/Select.js +1 -1
  43. package/dist/fn/Input/Slider.js +1 -1
  44. package/dist/fn/Input/Switch.js +1 -1
  45. package/dist/fn/Input/TextField.js +1 -1
  46. package/dist/fn/Input/Time/Picker.js +1 -1
  47. package/dist/fn/Input/Time/index.d.ts +3 -3
  48. package/dist/fn/Input/Time/index.js +1 -1
  49. package/dist/fn/Input/core.d.ts +1 -1
  50. package/dist/fn/Input/core.js +1 -1
  51. package/dist/fn/Input/index.d.ts +1 -1
  52. package/dist/fn/Loader/mini.js +1 -1
  53. package/dist/fn/RootViewController.js +1 -1
  54. package/dist/fn/Sheet.d.ts +2 -3
  55. package/dist/fn/Sheet.js +1 -1
  56. package/dist/fn/Snackbar.js +1 -1
  57. package/dist/fn/SwipeView.js +1 -1
  58. package/dist/fn/Table/Data.js +1 -1
  59. package/dist/fn/Table/Drag.js +1 -1
  60. package/dist/fn/Table/Wrapper.js +1 -1
  61. package/dist/fn/Tips.js +1 -1
  62. package/dist/fn/Tooltips.d.ts +1 -1
  63. package/dist/fn/Tooltips.js +1 -1
  64. package/dist/index.d.ts +1 -1
  65. package/dist/mols/Accordion.js +1 -1
  66. package/dist/temps/designBook.js +1 -1
  67. package/package.json +2 -2
@@ -1 +1 @@
1
- import{b as a,c as u}from"../../chunk-C5N2D3ZX.js";import{jsx as m,jsxs as x}from"react/jsx-runtime";import{useState as c,useEffect as S}from"react";import n from"@mingoo/jsmin";import{Box as d,Span as g}from"../../atoms";import{Row as h}from"../../mols";const D=t=>{if(!t.label)return null;let[r,s]=c({});return S(()=>{let f=n('[data-input-origin="'+t.componentID+'"]'),e=n('[data-input-label="'+t.componentID+'"]'),p=n('[data-input-value-shallow="'+t.componentID+'"]');if(!f[0]||!e[0]||!p[0])return;let i=f.position(),l=p.position();if(t.isActive){let o=l.left-i.left;s({opacity:"max",freeCSS:{backgroundColor:"hsla(var(--color-layer1-hsl), .4)",backdropFilter:"blur(2px)",lineHeight:1,fontSize:"12px",transform:`translate(${o}px,-6px)`}})}else{let o=l.left-i.left,b=l.top-i.top;s({fontSize:t.fontSize||"inherit",opacity:"middle",freeCSS:{lineHeight:"inherit",transform:`translate(${o}px,${b}px)`,backgroundColor:"transparent"}})}e.getAttribute("data-label-init")=="true"&&e.setAttribute("data-label-init","false").await(10).css({transition:"var(--animation-time2)"})},[t.isActive]),m(d,u(a({htmlTag:"label","data-input-label":t.componentID,"data-label-init":"true",position:"absolute",left:0,top:0,fontColor:"3.blur",backgroundColor:"trans",borderRadius:"1/3",padding:[0,"1/4"],opacity:"min"},r),{freeCSS:a({zIndex:2,pointerEvents:"none",lineHeight:"inherit"},r.freeCSS),children:x(h.Left,{gap:"1/3",children:[t.label,t.required&&m(g,{fontColor:"nega",children:" * "})]})}))};export{D as InputLabel};
1
+ import{b as a,c as u}from"../../chunk-C5N2D3ZX.js";import{jsx as m,jsxs as x}from"react/jsx-runtime";import{useState as c,useEffect as S}from"react";import n from"jmini";import{Box as d,Span as g}from"../../atoms";import{Row as h}from"../../mols";const D=t=>{if(!t.label)return null;let[r,s]=c({});return S(()=>{let f=n('[data-input-origin="'+t.componentID+'"]'),e=n('[data-input-label="'+t.componentID+'"]'),p=n('[data-input-value-shallow="'+t.componentID+'"]');if(!f[0]||!e[0]||!p[0])return;let i=f.position(),l=p.position();if(t.isActive){let o=l.left-i.left;s({opacity:"max",freeCSS:{backgroundColor:"hsla(var(--color-layer1-hsl), .4)",backdropFilter:"blur(2px)",lineHeight:1,fontSize:"12px",transform:`translate(${o}px,-6px)`}})}else{let o=l.left-i.left,b=l.top-i.top;s({fontSize:t.fontSize||"inherit",opacity:"middle",freeCSS:{lineHeight:"inherit",transform:`translate(${o}px,${b}px)`,backgroundColor:"transparent"}})}e.getAttribute("data-label-init")=="true"&&e.setAttribute("data-label-init","false").await(10).css({transition:"var(--animation-time2)"})},[t.isActive]),m(d,u(a({htmlTag:"label","data-input-label":t.componentID,"data-label-init":"true",position:"absolute",left:0,top:0,fontColor:"3.blur",backgroundColor:"trans",borderRadius:"1/3",padding:[0,"1/4"],opacity:"min"},r),{freeCSS:a({zIndex:2,pointerEvents:"none",lineHeight:"inherit"},r.freeCSS),children:x(h.Left,{gap:"1/3",children:[t.label,t.required&&m(g,{fontColor:"nega",children:" * "})]})}))};export{D as InputLabel};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { StyleTags, ReactElement } from '../../@declares';
3
- import { KeyValueDict } from '@mingoo/jsmin';
3
+ import { KeyValueDict } from 'jmini';
4
4
  import { InputTypes } from '.';
5
5
  declare namespace List {
6
6
  type Type = 'radio' | 'checkbox';
@@ -1 +1 @@
1
- import{b as l,c as h,d as A}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as Ce}from"react/jsx-runtime";import g,{UUID as J}from"@mingoo/jsmin";import{useState as ee}from"react";import{$$fromRoot as ne,GenerateHTMLProps as se}from"../../@utils";import{Box as b,Flex as ie,FAI as re}from"../../atoms";import{Button as te}from"../Button";import{OptionalInputWrapper as de,BoxWrapper as ce,CoreEffects as M}from"./core";import{InputListClasses as I}from"../../@styles/componentClasses";function ue(t){let{value:o,states:n}=t,{type:e,required:c,min:s,max:m}=n;s=s||0,m=m||65535;let i=[],f=o.length;return c&&(f||e=="radio"&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),f<s&&i.push({type:"invalid",label:s+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),f>m&&i.push({type:"invalid",label:m+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!i.filter(({type:y})=>y=="invalid").length,notice:i}}const V={OptionalListWrapper:t=>{let{value:o,options:n=[]}=t,e=g.is.exist(o)?g.flatArray(o):[],c=[];return e.forEach(s=>{n.findIndex(i=>g.JsonTo(i.value)==g.JsonTo(s))!=-1&&c.push(s)}),a(V.Core,h(l({},t),{value:c,options:n}))},Core:t=>{let F=t,{type:o,tone:n,required:e,componentID:c="",form:s,override:m,icon:i,iconType:f,CustomIcon:y,enableFormSubmit:P,checkValidationAtFirst:w,onValidate:W,onUpdateValue:X,onUpdateValidValue:v,value:D,options:$,className:U,cellStyles:k,cellClassName:K,cellCheckedStyles:q,cellCheckedClassName:H,min:z,max:j,hideInput:G,freeCSS:R,wrapStyles:u}=F,N=A(F,["type","tone","required","componentID","form","override","icon","iconType","CustomIcon","enableFormSubmit","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName","min","max","hideInput","freeCSS","wrapStyles"]),[p,x]=ee(M.DefaultStatus(c,D)),[C,_]=ee({ok:!1,notice:[]});return M.CommonEffects({type:"list."+o,states:t,val_status:p,set_status:x,val_validate:C,set_validate:_,SystemValidation:ue}),a(ce,{val_status:p,set_status:x,val_validate:C,states:t,children:a(V.List,{rootStates:t,val_status:p,set_status:x})})},List:t=>{let{rootStates:o,val_status:n,set_status:e}=t,{componentID:c,type:s,tone:m,icon:i=!0,isChecker:f,options:y,name:P,form:w,tabIndex:W,hideInput:X,disabled:v,className:D,cellStyles:$,cellClassName:U="",cellCheckedStyles:k,cellCheckedClassName:K="",enableFormSubmit:q}=o,{dataValue:H}=n,z=o.CustomIcon,j=y.map((G,R)=>{let Z=G,{value:u,label:N,disabled:p,className:x="",checkedStyles:C,checkedClassName:_="",freeCSS:F}=Z,oe=A(Z,["value","label","disabled","className","checkedStyles","checkedClassName","freeCSS"]),Q=J(),L=H.findIndex(r=>r===u)!=-1,S=l(l({},$),oe),B=[I("Label"),U,x];L&&(S=h(l(l(l({},S),k),C),{freeCSS:l(l(l({},S==null?void 0:S.freeCSS),k==null?void 0:k.freeCSS),C==null?void 0:C.freeCSS)}),B=[...B,K,_]);const Y=()=>{if(v||p)return;let r=[];if(s=="radio")r=[u];else if(s=="checkbox"||f)if(!L)r=[...n.dataValue,u];else{let d=[...n.dataValue];d.splice(n.dataValue.findIndex(E=>E==u),1),r=d}e(d=>h(l({},d),{dataValue:r,eventType:"update",eventID:J()}))};return[a(b,{htmlTag:"input",type:s=="radio"?"radio":"checkbox",className:I("Input"),name:"RadioCheckbox-"+P,"data-list-index":c+"-"+R,id:Q,value:String(u),disabled:v||p,checked:L,onFocus:r=>{p||s=="radio"&&(n.dataValue.length||e(d=>h(l({},d),{dataValue:[u],eventType:"update",eventID:J()})))},onChange:()=>{Y()},onKeyDown:r=>{let{key:d,shiftKey:E}=r;if((s=="checkbox"||t.rootStates.isChecker)&&d!="Tab"){if(d.match(/Arrow/)){r.preventDefault();let ae=["ArrowLeft","ArrowUp"].includes(d)?-1:1,T=R+ae;T<0?T=y.length-1:T>=y.length&&(T=0),ne(`input[data-list-index="${c}-${T}"]`).focus()}}q&&M.SubmitForm(r,w)},tabIndex:W},"List-"+JSON.stringify(u)),Ce(b,h(l({htmlTag:"label","data-disabled":v||p,htmlFor:Q,className:B.join(" "),tabIndex:-1,display:"flex",verticalAlign:"center",gap:"1/6",flexWrap:!1},S),{children:[i&&a(z,{isChecked:L,toggle:()=>{Y()}}),g.is.string(N)?a(b,{children:N}):N]}),"ListTrigger-"+JSON.stringify(u))]});return a(ie,{flexSizing:"auto",style:o.style,freeCSS:l({},o.freeCSS),className:[D,I("CellBase"),I("HideInput_"+X),I("IconIndicator_"+!!i),I("Tone_"+m)].join(" "),children:j})},RadioIcon:t=>a(te.Normal,{ssPushable:!0,tabIndex:-1,ssEffectsOnActive:"ripple.cloud",ssSphere:3,onClick:o=>{o.preventDefault(),o.stopPropagation(),t.toggle()},children:a(b,{ssSphere:1.5,border:"3.thick",borderWidth:2,borderColor:t.isChecked?"theme":"3.thick",position:"relative",transition:"middle",children:a(b,{position:"absolute",transition:"middle",isRounded:!0,backgroundColor:t.isChecked?"theme":"trans",opacity:t.isChecked?"max":"trans",freeCSS:{width:"60%",height:"60%",transform:t.isChecked?"scale(1)":"scale(.6)"}})})}),CheckboxIcon:t=>a(te.Normal,{ssPushable:!0,color:"cloud",tabIndex:-1,ssEffectsOnActive:"ripple.cloud",ssSphere:3,onClick:o=>{o.preventDefault(),o.stopPropagation(),t.toggle()},children:a(b,{ssSquare:1.5,flexCenter:!0,border:"3.thick",borderWidth:2,borderColor:t.isChecked?"theme":"3.thick",borderRadius:"3.tone.tertiary",position:"relative",backgroundColor:t.isChecked?"theme":"trans",transition:"middle",fontColor:"white",children:a(re.Check,{transition:"middle",opacity:t.isChecked?"max":"trans",freeCSS:{zIndex:8}})})})},O=t=>{t=t||"checkbox";const o=e=>(e=h(l({gap:"1/2",iconType:t=="radio"?"radio":"checkbox"},e),{type:t,cellStyles:l({position:"relative",borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),e.CustomIcon||(e.iconType=="radio"?e.CustomIcon=V.RadioIcon:e.iconType=="checkbox"&&(e.CustomIcon=V.CheckboxIcon)),e.tone=="normal"?(e.cellStyles=l({padding:["1/4",1],border:"1.thin",isRounded:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=l({borderColor:"theme",fontColor:"theme",boxShadow:"1.normal"},e.cellCheckedStyles)):e.tone=="border"?(e.cellStyles=l({paddingRight:1,border:"1.thin",isRounded:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=l({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):e.tone=="cloud"&&(e.cellStyles=l({paddingRight:1,isRounded:!0,border:"1.thin",backgroundColor:"layer.2"},e.cellStyles),e.cellCheckedStyles=l({backgroundColor:"cloud",fontColor:"theme"},e.cellCheckedStyles)),e=se(e),a(de,{componentID:e.componentID,children:V.OptionalListWrapper,states:e})),n=o;return n.Normal=e=>a(o,l({type:t,tone:"normal",icon:!1},e)),n.Border=e=>a(o,l({type:t,tone:"border"},e)),n.Cloud=e=>a(o,l({type:t,tone:"cloud"},e)),n.Vivid=e=>a(o,l({type:t,tone:"normal",icon:!1,cellCheckedStyles:{backgroundColor:"theme",fontColor:"white"}},e)),n.Simple=e=>a(o,l({type:t,tone:"plain",icon:!1,cellCheckedStyles:{fontColor:"theme"}},e)),n},me=O("checkbox"),pe=O("radio"),le=O();export{me as Checkbox,le as List,pe as Radio,le as default};
1
+ import{b as l,c as h,d as A}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as Ce}from"react/jsx-runtime";import g,{UUID as J}from"jmini";import{useState as ee}from"react";import{$$fromRoot as ne,GenerateHTMLProps as se}from"../../@utils";import{Box as b,Flex as ie,FAI as re}from"../../atoms";import{Button as te}from"../Button";import{OptionalInputWrapper as de,BoxWrapper as ce,CoreEffects as M}from"./core";import{InputListClasses as I}from"../../@styles/componentClasses";function ue(t){let{value:o,states:n}=t,{type:e,required:c,min:s,max:m}=n;s=s||0,m=m||65535;let i=[],f=o.length;return c&&(f||e=="radio"&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),f<s&&i.push({type:"invalid",label:s+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),f>m&&i.push({type:"invalid",label:m+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!i.filter(({type:y})=>y=="invalid").length,notice:i}}const V={OptionalListWrapper:t=>{let{value:o,options:n=[]}=t,e=g.is.exist(o)?g.flatArray(o):[],c=[];return e.forEach(s=>{n.findIndex(i=>g.JsonTo(i.value)==g.JsonTo(s))!=-1&&c.push(s)}),a(V.Core,h(l({},t),{value:c,options:n}))},Core:t=>{let F=t,{type:o,tone:n,required:e,componentID:c="",form:s,override:m,icon:i,iconType:f,CustomIcon:y,enableFormSubmit:P,checkValidationAtFirst:w,onValidate:W,onUpdateValue:X,onUpdateValidValue:v,value:D,options:$,className:U,cellStyles:k,cellClassName:K,cellCheckedStyles:q,cellCheckedClassName:H,min:z,max:j,hideInput:G,freeCSS:R,wrapStyles:u}=F,N=A(F,["type","tone","required","componentID","form","override","icon","iconType","CustomIcon","enableFormSubmit","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName","min","max","hideInput","freeCSS","wrapStyles"]),[p,x]=ee(M.DefaultStatus(c,D)),[C,_]=ee({ok:!1,notice:[]});return M.CommonEffects({type:"list."+o,states:t,val_status:p,set_status:x,val_validate:C,set_validate:_,SystemValidation:ue}),a(ce,{val_status:p,set_status:x,val_validate:C,states:t,children:a(V.List,{rootStates:t,val_status:p,set_status:x})})},List:t=>{let{rootStates:o,val_status:n,set_status:e}=t,{componentID:c,type:s,tone:m,icon:i=!0,isChecker:f,options:y,name:P,form:w,tabIndex:W,hideInput:X,disabled:v,className:D,cellStyles:$,cellClassName:U="",cellCheckedStyles:k,cellCheckedClassName:K="",enableFormSubmit:q}=o,{dataValue:H}=n,z=o.CustomIcon,j=y.map((G,R)=>{let Z=G,{value:u,label:N,disabled:p,className:x="",checkedStyles:C,checkedClassName:_="",freeCSS:F}=Z,oe=A(Z,["value","label","disabled","className","checkedStyles","checkedClassName","freeCSS"]),Q=J(),L=H.findIndex(r=>r===u)!=-1,S=l(l({},$),oe),B=[I("Label"),U,x];L&&(S=h(l(l(l({},S),k),C),{freeCSS:l(l(l({},S==null?void 0:S.freeCSS),k==null?void 0:k.freeCSS),C==null?void 0:C.freeCSS)}),B=[...B,K,_]);const Y=()=>{if(v||p)return;let r=[];if(s=="radio")r=[u];else if(s=="checkbox"||f)if(!L)r=[...n.dataValue,u];else{let d=[...n.dataValue];d.splice(n.dataValue.findIndex(E=>E==u),1),r=d}e(d=>h(l({},d),{dataValue:r,eventType:"update",eventID:J()}))};return[a(b,{htmlTag:"input",type:s=="radio"?"radio":"checkbox",className:I("Input"),name:"RadioCheckbox-"+P,"data-list-index":c+"-"+R,id:Q,value:String(u),disabled:v||p,checked:L,onFocus:r=>{p||s=="radio"&&(n.dataValue.length||e(d=>h(l({},d),{dataValue:[u],eventType:"update",eventID:J()})))},onChange:()=>{Y()},onKeyDown:r=>{let{key:d,shiftKey:E}=r;if((s=="checkbox"||t.rootStates.isChecker)&&d!="Tab"){if(d.match(/Arrow/)){r.preventDefault();let ae=["ArrowLeft","ArrowUp"].includes(d)?-1:1,T=R+ae;T<0?T=y.length-1:T>=y.length&&(T=0),ne(`input[data-list-index="${c}-${T}"]`).focus()}}q&&M.SubmitForm(r,w)},tabIndex:W},"List-"+JSON.stringify(u)),Ce(b,h(l({htmlTag:"label","data-disabled":v||p,htmlFor:Q,className:B.join(" "),tabIndex:-1,display:"flex",verticalAlign:"center",gap:"1/6",flexWrap:!1},S),{children:[i&&a(z,{isChecked:L,toggle:()=>{Y()}}),g.is.string(N)?a(b,{children:N}):N]}),"ListTrigger-"+JSON.stringify(u))]});return a(ie,{flexSizing:"auto",style:o.style,freeCSS:l({},o.freeCSS),className:[D,I("CellBase"),I("HideInput_"+X),I("IconIndicator_"+!!i),I("Tone_"+m)].join(" "),children:j})},RadioIcon:t=>a(te.Normal,{ssPushable:!0,tabIndex:-1,ssEffectsOnActive:"ripple.cloud",ssSphere:3,onClick:o=>{o.preventDefault(),o.stopPropagation(),t.toggle()},children:a(b,{ssSphere:1.5,border:"3.thick",borderWidth:2,borderColor:t.isChecked?"theme":"3.thick",position:"relative",transition:"middle",children:a(b,{position:"absolute",transition:"middle",isRounded:!0,backgroundColor:t.isChecked?"theme":"trans",opacity:t.isChecked?"max":"trans",freeCSS:{width:"60%",height:"60%",transform:t.isChecked?"scale(1)":"scale(.6)"}})})}),CheckboxIcon:t=>a(te.Normal,{ssPushable:!0,color:"cloud",tabIndex:-1,ssEffectsOnActive:"ripple.cloud",ssSphere:3,onClick:o=>{o.preventDefault(),o.stopPropagation(),t.toggle()},children:a(b,{ssSquare:1.5,flexCenter:!0,border:"3.thick",borderWidth:2,borderColor:t.isChecked?"theme":"3.thick",borderRadius:"3.tone.tertiary",position:"relative",backgroundColor:t.isChecked?"theme":"trans",transition:"middle",fontColor:"white",children:a(re.Check,{transition:"middle",opacity:t.isChecked?"max":"trans",freeCSS:{zIndex:8}})})})},O=t=>{t=t||"checkbox";const o=e=>(e=h(l({gap:"1/2",iconType:t=="radio"?"radio":"checkbox"},e),{type:t,cellStyles:l({position:"relative",borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),e.CustomIcon||(e.iconType=="radio"?e.CustomIcon=V.RadioIcon:e.iconType=="checkbox"&&(e.CustomIcon=V.CheckboxIcon)),e.tone=="normal"?(e.cellStyles=l({padding:["1/4",1],border:"1.thin",isRounded:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=l({borderColor:"theme",fontColor:"theme",boxShadow:"1.normal"},e.cellCheckedStyles)):e.tone=="border"?(e.cellStyles=l({paddingRight:1,border:"1.thin",isRounded:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=l({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):e.tone=="cloud"&&(e.cellStyles=l({paddingRight:1,isRounded:!0,border:"1.thin",backgroundColor:"layer.2"},e.cellStyles),e.cellCheckedStyles=l({backgroundColor:"cloud",fontColor:"theme"},e.cellCheckedStyles)),e=se(e),a(de,{componentID:e.componentID,children:V.OptionalListWrapper,states:e})),n=o;return n.Normal=e=>a(o,l({type:t,tone:"normal",icon:!1},e)),n.Border=e=>a(o,l({type:t,tone:"border"},e)),n.Cloud=e=>a(o,l({type:t,tone:"cloud"},e)),n.Vivid=e=>a(o,l({type:t,tone:"normal",icon:!1,cellCheckedStyles:{backgroundColor:"theme",fontColor:"white"}},e)),n.Simple=e=>a(o,l({type:t,tone:"plain",icon:!1,cellCheckedStyles:{fontColor:"theme"}},e)),n},me=O("checkbox"),pe=O("radio"),le=O();export{me as Checkbox,le as List,pe as Radio,le as default};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { KeyValueDict } from '@mingoo/jsmin';
2
+ import { KeyValueDict } from 'jmini';
3
3
  import { List } from './List';
4
4
  declare namespace Segmented {
5
5
  type Tones = 'plain' | 'cloud' | 'cloud.theme' | 'cloud.mono' | 'border' | 'border.vivid' | 'bottomline';
@@ -1 +1 @@
1
- import{b as e,c as n,d as C}from"../../chunk-C5N2D3ZX.js";import{jsx as r}from"react/jsx-runtime";import{UUID as x}from"@mingoo/jsmin";import{useState as a}from"react";import{Radio as w}from"./List";import{InputSegmentedClasses as u}from"../../@styles/componentClasses";const E=t=>{let m=t,{__sys_segmented_type:o,tone:R,value:d,options:S,onUpdateValue:h,onUpdateValidValue:p,enableFormSubmit:B,checkValidationAtFirst:M,cellStyles:g,cellClassName:_,cellCheckedClassName:b,cellCheckedStyles:f,freeCSS:k,wrapStyles:J}=m,I=C(m,["__sys_segmented_type","tone","value","options","onUpdateValue","onUpdateValidValue","enableFormSubmit","checkValidationAtFirst","cellStyles","cellClassName","cellCheckedClassName","cellCheckedStyles","freeCSS","wrapStyles"]),[T]=a(x()),[i,V]=a(d),[v,c]=a(i);return i!=d&&(V(d),c(d)),r(w,n(e({options:S,value:v,componentID:T,icon:!1,flexWrap:!1,borderRadius:"2.tone.secondary",position:"relative"},I),{freeCSS:e({whiteSpace:"nowrap"},k),cellStyles:e({flexCenter:!0,ssEffectsOnActive:"push"},g),cellCheckedStyles:e({},f),cellClassName:[_,u("Label"),u("Tone_"+o.replace(/\./ig,""))].join(" "),cellCheckedClassName:[b,u("Checked")].join(" "),tone:"custom",onUpdateValue:h,onUpdateValidValue:y=>{p&&p(y),o=="bottomline"&&c(y.value)}}))},s=t=>{let{__sys_segmented_type:o}=t;return o=o||"plain",o=="plain"&&(t=n(e({padding:"1/3",gap:"1/3",ssCardBox:!0,isRounded:!0},t),{cellStyles:e({isRounded:!0,padding:["1/2","3/4"],borderRadius:"inherit",position:"relative"},t.cellStyles),cellCheckedStyles:e({backgroundColor:"theme",boxShadow:"1.normal",fontColor:"white"},t.cellCheckedStyles)})),r(E,e({__sys_segmented_type:"plain"},t))},l=s;l.Cloud=t=>{let o=n(e({__sys_segmented_type:"cloud",padding:"1/3",gap:"1/3",backgroundColor:"cloud"},t),{cellStyles:e({padding:"3/4",borderRadius:"inherit",position:"relative"},t.cellStyles),cellCheckedStyles:e({boxShadow:"1.normal",backgroundColor:"theme",fontColor:"white"},t.cellCheckedStyles)});return r(s,e({},o))},l.CloudTheme=t=>{let o=e({backgroundColor:"theme.opa.few",fontColor:"theme",__sys_segmented_type:"cloud.theme"},t);return r(l.Cloud,e({},o))},l.CloudMono=t=>{let o=n(e({fontColor:"3.blur",__sys_segmented_type:"cloud.mono"},t),{cellCheckedStyles:e({backgroundColor:"layer.1",fontColor:"1.clear"},t.cellCheckedStyles)});return r(l.Cloud,e({},o))},l.Border=t=>{let o=n(e({backgroundColor:"layer.1",border:"2.normal",overflow:"hidden",gap:0,fontColor:"3.blur",ssLastChildLossBorder:"right",boxShadow:"0.min",__sys_segmented_type:"border"},t),{cellStyles:e({padding:["3/4",1],borderRadius:0,borderRight:"2.normal"},t.cellStyles),cellCheckedStyles:e({backgroundColor:"theme.opa.few",fontColor:"theme"},t.cellCheckedStyles)});return r(s,e({},o))},l.BorderVivid=t=>{let o=n(e({border:!0,borderColor:"theme",__sys_segmented_type:"border.vivid"},t),{cellStyles:e({borderRight:!0,borderColor:"theme"},t.cellStyles),cellCheckedStyles:e({backgroundColor:"theme",fontColor:"white"},t.cellCheckedStyles)});return r(l.Border,e({},o))},l.Bottomline=t=>{let o=n(e({__sys_segmented_type:"bottomline",gap:0,fontColor:"3.blur"},t),{cellStyles:e({ssEffectsOnActive:"ripple.theme",borderRadius:0,padding:1},t.cellStyles),cellCheckedStyles:e({fontColor:"theme"},t.cellCheckedStyles)});return r(s,e({},o))};export{l as Segmented,l as default};
1
+ import{b as e,c as n,d as C}from"../../chunk-C5N2D3ZX.js";import{jsx as r}from"react/jsx-runtime";import{UUID as x}from"jmini";import{useState as a}from"react";import{Radio as w}from"./List";import{InputSegmentedClasses as u}from"../../@styles/componentClasses";const E=t=>{let m=t,{__sys_segmented_type:o,tone:R,value:d,options:S,onUpdateValue:h,onUpdateValidValue:p,enableFormSubmit:B,checkValidationAtFirst:M,cellStyles:g,cellClassName:_,cellCheckedClassName:b,cellCheckedStyles:f,freeCSS:k,wrapStyles:J}=m,I=C(m,["__sys_segmented_type","tone","value","options","onUpdateValue","onUpdateValidValue","enableFormSubmit","checkValidationAtFirst","cellStyles","cellClassName","cellCheckedClassName","cellCheckedStyles","freeCSS","wrapStyles"]),[T]=a(x()),[i,V]=a(d),[v,c]=a(i);return i!=d&&(V(d),c(d)),r(w,n(e({options:S,value:v,componentID:T,icon:!1,flexWrap:!1,borderRadius:"2.tone.secondary",position:"relative"},I),{freeCSS:e({whiteSpace:"nowrap"},k),cellStyles:e({flexCenter:!0,ssEffectsOnActive:"push"},g),cellCheckedStyles:e({},f),cellClassName:[_,u("Label"),u("Tone_"+o.replace(/\./ig,""))].join(" "),cellCheckedClassName:[b,u("Checked")].join(" "),tone:"custom",onUpdateValue:h,onUpdateValidValue:y=>{p&&p(y),o=="bottomline"&&c(y.value)}}))},s=t=>{let{__sys_segmented_type:o}=t;return o=o||"plain",o=="plain"&&(t=n(e({padding:"1/3",gap:"1/3",ssCardBox:!0,isRounded:!0},t),{cellStyles:e({isRounded:!0,padding:["1/2","3/4"],borderRadius:"inherit",position:"relative"},t.cellStyles),cellCheckedStyles:e({backgroundColor:"theme",boxShadow:"1.normal",fontColor:"white"},t.cellCheckedStyles)})),r(E,e({__sys_segmented_type:"plain"},t))},l=s;l.Cloud=t=>{let o=n(e({__sys_segmented_type:"cloud",padding:"1/3",gap:"1/3",backgroundColor:"cloud"},t),{cellStyles:e({padding:"3/4",borderRadius:"inherit",position:"relative"},t.cellStyles),cellCheckedStyles:e({boxShadow:"1.normal",backgroundColor:"theme",fontColor:"white"},t.cellCheckedStyles)});return r(s,e({},o))},l.CloudTheme=t=>{let o=e({backgroundColor:"theme.opa.few",fontColor:"theme",__sys_segmented_type:"cloud.theme"},t);return r(l.Cloud,e({},o))},l.CloudMono=t=>{let o=n(e({fontColor:"3.blur",__sys_segmented_type:"cloud.mono"},t),{cellCheckedStyles:e({backgroundColor:"layer.1",fontColor:"1.clear"},t.cellCheckedStyles)});return r(l.Cloud,e({},o))},l.Border=t=>{let o=n(e({backgroundColor:"layer.1",border:"2.normal",overflow:"hidden",gap:0,fontColor:"3.blur",ssLastChildLossBorder:"right",boxShadow:"0.min",__sys_segmented_type:"border"},t),{cellStyles:e({padding:["3/4",1],borderRadius:0,borderRight:"2.normal"},t.cellStyles),cellCheckedStyles:e({backgroundColor:"theme.opa.few",fontColor:"theme"},t.cellCheckedStyles)});return r(s,e({},o))},l.BorderVivid=t=>{let o=n(e({border:!0,borderColor:"theme",__sys_segmented_type:"border.vivid"},t),{cellStyles:e({borderRight:!0,borderColor:"theme"},t.cellStyles),cellCheckedStyles:e({backgroundColor:"theme",fontColor:"white"},t.cellCheckedStyles)});return r(l.Border,e({},o))},l.Bottomline=t=>{let o=n(e({__sys_segmented_type:"bottomline",gap:0,fontColor:"3.blur"},t),{cellStyles:e({ssEffectsOnActive:"ripple.theme",borderRadius:0,padding:1},t.cellStyles),cellCheckedStyles:e({fontColor:"theme"},t.cellCheckedStyles)});return r(s,e({},o))};export{l as Segmented,l as default};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { StyleTags, ReactElement } from '../../@declares';
3
- import { KeyValueDict } from '@mingoo/jsmin';
3
+ import { KeyValueDict } from 'jmini';
4
4
  import { InputTypes } from '.';
5
5
  declare namespace Select {
6
6
  type Input<T = Value> = InputTypes.CoreInput<T> & React.DOMAttributes<HTMLInputElement> & {
@@ -1 +1 @@
1
- import{b as s,c as m,d as J}from"../../chunk-C5N2D3ZX.js";import{Fragment as Q,jsx as l,jsxs as N}from"react/jsx-runtime";import p,{UUID as R}from"@mingoo/jsmin";import{useState as _,useEffect as F}from"react";import{ExtractStyles as ae,useStore as M}from"../../@utils";import{Box as T,Span as oe,FAI as $,Column as ne}from"../../atoms";import{Text as w,Row as X}from"../../mols";import{Button as re}from"../Button";import{Sheet as P}from"../Sheet";import{OptionalInputWrapper as se,BoxWrapper as ie,CoreEffects as A,DefaultBoxishStyles as ue}from"./core";import{InputAutocompleteClasses as E}from"../../@styles/componentClasses";import{InputLabel as ce}from"./Label";import{RightIcon as pe}from".";function Se(t){let{value:e,states:a}=t,{required:r,options:c}=a,d=[];return r&&e===null&&d.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!d.filter(({type:b})=>b=="invalid").length,notice:d}}const L={FilterSelectableOptions:(t,e)=>{let a=t.rootStates.options;return e||(a=a.filter(r=>r.type!="label")),a}},V={Shallow:t=>{let{rootStates:e,val_status:a}=t,r=ae(e);return l(T,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:l(w.Description,m(s({className:e.className},r),{position:"absolute",width:1,freeCSS:m(s({},r.freeCSS),{color:"orange"}),children:l(T,{"data-input-value-shallow":a.componentID,children:"A"})}))})},Button:t=>{let{rootStates:e,val_preventOpenSelectorOnFocus:a,set_preventOpenSelectorOnFocus:r,val_optionFocused:c,set_optionFocused:d,val_validate:b,set_validate:y,val_status:v,set_status:g,val_selectorOpen:i,set_selectorOpen:u}=t,U=e,{tone:C,required:Y,form:k,className:Z,label:de,isLabelActive:fe,placeholder:me,enableFormSubmit:ee,emptySelect:ve,checkValidationAtFirst:te,onValidate:ye,onUpdateValue:be,onUpdateValidValue:Ie,value:he="",options:ge,leftIndicator:Ce,rightIndicator:De,leftIcon:_e,rightIcon:Te,componentID:Ve,status_id:xe,wrapStyles:Oe,SelectedCellStyles:Re,SelectorCellStyles:Fe,SelectorStyles:we,SelectorGravityPoint:Ae}=U,o=J(U,["tone","required","form","className","label","isLabelActive","placeholder","enableFormSubmit","emptySelect","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","wrapStyles","SelectedCellStyles","SelectorCellStyles","SelectorStyles","SelectorGravityPoint"]),K="select-sheet-"+e.componentID;return F(()=>{if(e.disabled)return;let n="select-click-"+e.componentID;if(i){let f=p('[data-input-origin="'+e.componentID+'"]');if(!f)return;P.open({sheetID:K,type:"custom",parent:f[0],padding:["1/4",0],gravityPoint:e.SelectorGravityPoint||22,closeAtAroundClick:!1,content:l(V.Selector,s({},t))}),p(document).addEvent({eventID:n,eventType:"click",callback:B=>{let x=p(B.target),O=!!p(x).parent("."+E("Core")).length;p(x).parent("."+E("Selector")).length||O||u(!1)}})}else p(document).removeEvent([n]),P.close(K)},[i]),F(()=>{if(v.eventType=="init"||!i)return;let n=p('[data-input-origin="'+e.componentID+'"]');n&&n.focus()},[v.dataValue]),F(()=>{if(e.disabled||!i)return;let n=M.get("refresh-select-selector-"+e.componentID);n&&n(t)},[e.options,v.dataValue,c]),l(Q,{children:l(T,m(s({tabIndex:0},o),{"data-disabled":e.disabled,"data-show-validation":A.isShowValidation(b,v,!!te),"data-component-id":v.componentID,"data-input-origin":v.componentID,className:[Z,E("Core")].join(" "),onFocus:n=>{if(o!=null&&o.onFocus&&(o==null||o.onFocus(n)),!e.disabled){if(a)return r(!1);u(!0)}},onClick:n=>{o!=null&&o.onClick&&(o==null||o.onClick(n)),!e.disabled&&u(!0)},onKeyDown:n=>{let{key:f,metaKey:B,ctrlKey:x}=n,O=B||x;if(o!=null&&o.onKeyDown&&(o==null||o.onKeyDown(n)),ee&&A.SubmitForm(n,k),!e.disabled){if(p.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(f))return;if(n.preventDefault(),!i)return u(!0);let I=f=="ArrowDown"?1:-1,S=L.FilterSelectableOptions(t),W=S.length-1,h=null;p.scope(()=>{var q,G,z,H;let D=S.findIndex(le=>le.value==c);if(I==1){if(h=((q=S[0])==null?void 0:q.value)||null,O){h=S[W].value||null;return}if(D==-1||D==W)return;h=((G=S[D+1])==null?void 0:G.value)||null}else{if(h=S[W].value||null,O){h=((z=S[0])==null?void 0:z.value)||null;return}if(D==-1||D==0)return;h=((H=S[D-1])==null?void 0:H.value)||null}}),d(h)}),f=="Escape")u(!1);else if(f=="Tab")u(!1);else if(f=="Backspace")g(I=>m(s({},I),{dataValue:null,eventType:"update",eventID:R()}));else if(f==" ")n.preventDefault(),u(!0);else if(f=="Enter"){if(!i)return u(!0);n.preventDefault();let I=e.options.find(S=>S.value==c);if(!I)return;g(S=>m(s({},S),{dataValue:I.value,eventType:"update",eventID:R()})),u(!1)}}},children:N(X.Left,{flexWrap:!0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[l(V.Placeholder,s({},t)),l(V.Selected,s({},t)),l(oe,{width:0,overflow:"hidden",opacity:"trans",children:"A"})]})}))})},Placeholder:t=>!t.rootStates.placeholder||t.val_status.dataValue!==null?null:l(T,{position:"absolute",opacity:"middle",fontColor:"3.blur",children:t.rootStates.placeholder||""}),Selector:t=>{let[e,a]=_(t),{rootStates:r}=e;F(()=>{M.set({["refresh-select-selector-"+r.componentID]:y=>{a(y)}})},[]);let c=[],d=L.FilterSelectableOptions(e,!0),b=L.FilterSelectableOptions(e);return d.forEach((y,v)=>{let{type:g,value:i}=y,u=e.val_optionFocused==i,C=e.val_status.dataValue===i;if(g=="selector"){c.push(l(re.Sub.S,{color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1.5],isActive:C||u,isActiveStyles:u?{backgroundColor:"cloud"}:{backgroundColor:"theme.opa.few",fontColor:"theme"},onClick:Y=>{e.set_status(k=>m(s({},k),{dataValue:i,eventType:"update",eventID:R()})),e.set_selectorOpen(!1),e.set_preventOpenSelectorOnFocus(!0)},children:N(X.Left,{gap:"1/2",children:[C&&l($.Check,{fontColor:"theme"}),l(w.Supplement,{transition:"short",children:y.label})]})},String(i)));return}c.push(l(T,{children:y.label},R()))}),b.length||(c=[l(w.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},"no-selector-notice")]),l(P.Body,{className:E("Selector"),ssCardBox:!0,borderRadius:"3.tone.tertiary",boxShadow:"1.normal",freeCSS:{minWidth:12*14},children:l(ne,{gap:0,padding:[1,0],children:c})})},Selected:t=>{let e=[];return t.val_status.dataValue!==null&&p.scope(()=>{let a=t.rootStates.options.find(r=>p.JsonTo(r.value)==p.JsonTo(t.val_status.dataValue));a&&e.push(l(T,m(s({},t.rootStates.SelectedCellStyles),{children:a.label}),String(a.value)))}),l(Q,{children:e})},Core:t=>{let{value:e}=t,[a,r]=_(A.DefaultStatus(t.componentID,e)),[c,d]=_(!1),[b,y]=_(!1),[v,g]=_(t.value||null),[i,u]=_({ok:!1,notice:[]}),C={rootStates:t,val_preventOpenSelectorOnFocus:c,set_preventOpenSelectorOnFocus:d,val_optionFocused:v,set_optionFocused:g,val_selectorOpen:b,set_selectorOpen:y,val_status:a,set_status:r,val_validate:i,set_validate:u};return A.CommonEffects({type:"select",states:t,val_status:a,set_status:r,val_validate:i,set_validate:u,SystemValidation:Se}),N(ie,{val_status:a,set_status:r,val_validate:i,states:t,children:[l(ce,{componentID:t.componentID,fontSize:t.fontSize,required:t.required,label:t.label,isActive:t.isLabelActive||a.dataValue!==null}),l(V.Shallow,s({},C)),l(V.Button,s({},C))]})}},j=t=>{let e=s({},t);return e=m(s({emptySelect:!0},e),{freeCSS:s({cursor:"pointer"},e.freeCSS)}),e.emptySelect&&(e.options=[{value:null,label:l(w.Supplement,{fontColor:"4.thin",children:"\u9078\u629E\u3092\u89E3\u9664"})},...e.options]),e.value=e.value||null,e.options.forEach((a,r)=>{let{type:c,value:d}=a;e.options[r]=m(s({},a),{value:d,type:c||"selector"})}),p.is.nullish(e.rightIcon)&&(e.rightIcon=l(pe,{ssSphere:2,children:l($.AngleDown,{})})),l(se,{componentID:e.componentID,children:V.Core,states:ue(e)})};export{j as Select,j as default};
1
+ import{b as s,c as m,d as J}from"../../chunk-C5N2D3ZX.js";import{Fragment as Q,jsx as l,jsxs as N}from"react/jsx-runtime";import p,{UUID as R}from"jmini";import{useState as _,useEffect as F}from"react";import{ExtractStyles as ae,useStore as M}from"../../@utils";import{Box as T,Span as oe,FAI as $,Column as ne}from"../../atoms";import{Text as w,Row as X}from"../../mols";import{Button as re}from"../Button";import{Sheet as P}from"../Sheet";import{OptionalInputWrapper as se,BoxWrapper as ie,CoreEffects as A,DefaultBoxishStyles as ue}from"./core";import{InputAutocompleteClasses as E}from"../../@styles/componentClasses";import{InputLabel as ce}from"./Label";import{RightIcon as pe}from".";function Se(t){let{value:e,states:a}=t,{required:r,options:c}=a,d=[];return r&&e===null&&d.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!d.filter(({type:b})=>b=="invalid").length,notice:d}}const L={FilterSelectableOptions:(t,e)=>{let a=t.rootStates.options;return e||(a=a.filter(r=>r.type!="label")),a}},V={Shallow:t=>{let{rootStates:e,val_status:a}=t,r=ae(e);return l(T,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:l(w.Description,m(s({className:e.className},r),{position:"absolute",width:1,freeCSS:m(s({},r.freeCSS),{color:"orange"}),children:l(T,{"data-input-value-shallow":a.componentID,children:"A"})}))})},Button:t=>{let{rootStates:e,val_preventOpenSelectorOnFocus:a,set_preventOpenSelectorOnFocus:r,val_optionFocused:c,set_optionFocused:d,val_validate:b,set_validate:y,val_status:v,set_status:g,val_selectorOpen:i,set_selectorOpen:u}=t,U=e,{tone:C,required:Y,form:k,className:Z,label:de,isLabelActive:fe,placeholder:me,enableFormSubmit:ee,emptySelect:ve,checkValidationAtFirst:te,onValidate:ye,onUpdateValue:be,onUpdateValidValue:Ie,value:he="",options:ge,leftIndicator:Ce,rightIndicator:De,leftIcon:_e,rightIcon:Te,componentID:Ve,status_id:xe,wrapStyles:Oe,SelectedCellStyles:Re,SelectorCellStyles:Fe,SelectorStyles:we,SelectorGravityPoint:Ae}=U,o=J(U,["tone","required","form","className","label","isLabelActive","placeholder","enableFormSubmit","emptySelect","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","wrapStyles","SelectedCellStyles","SelectorCellStyles","SelectorStyles","SelectorGravityPoint"]),K="select-sheet-"+e.componentID;return F(()=>{if(e.disabled)return;let n="select-click-"+e.componentID;if(i){let f=p('[data-input-origin="'+e.componentID+'"]');if(!f)return;P.open({sheetID:K,type:"custom",parent:f[0],padding:["1/4",0],gravityPoint:e.SelectorGravityPoint||22,closeAtAroundClick:!1,content:l(V.Selector,s({},t))}),p(document).addEvent({eventID:n,eventType:"click",callback:B=>{let x=p(B.target),O=!!p(x).parent("."+E("Core")).length;p(x).parent("."+E("Selector")).length||O||u(!1)}})}else p(document).removeEvent([n]),P.close(K)},[i]),F(()=>{if(v.eventType=="init"||!i)return;let n=p('[data-input-origin="'+e.componentID+'"]');n&&n.focus()},[v.dataValue]),F(()=>{if(e.disabled||!i)return;let n=M.get("refresh-select-selector-"+e.componentID);n&&n(t)},[e.options,v.dataValue,c]),l(Q,{children:l(T,m(s({tabIndex:0},o),{"data-disabled":e.disabled,"data-show-validation":A.isShowValidation(b,v,!!te),"data-component-id":v.componentID,"data-input-origin":v.componentID,className:[Z,E("Core")].join(" "),onFocus:n=>{if(o!=null&&o.onFocus&&(o==null||o.onFocus(n)),!e.disabled){if(a)return r(!1);u(!0)}},onClick:n=>{o!=null&&o.onClick&&(o==null||o.onClick(n)),!e.disabled&&u(!0)},onKeyDown:n=>{let{key:f,metaKey:B,ctrlKey:x}=n,O=B||x;if(o!=null&&o.onKeyDown&&(o==null||o.onKeyDown(n)),ee&&A.SubmitForm(n,k),!e.disabled){if(p.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(f))return;if(n.preventDefault(),!i)return u(!0);let I=f=="ArrowDown"?1:-1,S=L.FilterSelectableOptions(t),W=S.length-1,h=null;p.scope(()=>{var q,G,z,H;let D=S.findIndex(le=>le.value==c);if(I==1){if(h=((q=S[0])==null?void 0:q.value)||null,O){h=S[W].value||null;return}if(D==-1||D==W)return;h=((G=S[D+1])==null?void 0:G.value)||null}else{if(h=S[W].value||null,O){h=((z=S[0])==null?void 0:z.value)||null;return}if(D==-1||D==0)return;h=((H=S[D-1])==null?void 0:H.value)||null}}),d(h)}),f=="Escape")u(!1);else if(f=="Tab")u(!1);else if(f=="Backspace")g(I=>m(s({},I),{dataValue:null,eventType:"update",eventID:R()}));else if(f==" ")n.preventDefault(),u(!0);else if(f=="Enter"){if(!i)return u(!0);n.preventDefault();let I=e.options.find(S=>S.value==c);if(!I)return;g(S=>m(s({},S),{dataValue:I.value,eventType:"update",eventID:R()})),u(!1)}}},children:N(X.Left,{flexWrap:!0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[l(V.Placeholder,s({},t)),l(V.Selected,s({},t)),l(oe,{width:0,overflow:"hidden",opacity:"trans",children:"A"})]})}))})},Placeholder:t=>!t.rootStates.placeholder||t.val_status.dataValue!==null?null:l(T,{position:"absolute",opacity:"middle",fontColor:"3.blur",children:t.rootStates.placeholder||""}),Selector:t=>{let[e,a]=_(t),{rootStates:r}=e;F(()=>{M.set({["refresh-select-selector-"+r.componentID]:y=>{a(y)}})},[]);let c=[],d=L.FilterSelectableOptions(e,!0),b=L.FilterSelectableOptions(e);return d.forEach((y,v)=>{let{type:g,value:i}=y,u=e.val_optionFocused==i,C=e.val_status.dataValue===i;if(g=="selector"){c.push(l(re.Sub.S,{color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1.5],isActive:C||u,isActiveStyles:u?{backgroundColor:"cloud"}:{backgroundColor:"theme.opa.few",fontColor:"theme"},onClick:Y=>{e.set_status(k=>m(s({},k),{dataValue:i,eventType:"update",eventID:R()})),e.set_selectorOpen(!1),e.set_preventOpenSelectorOnFocus(!0)},children:N(X.Left,{gap:"1/2",children:[C&&l($.Check,{fontColor:"theme"}),l(w.Supplement,{transition:"short",children:y.label})]})},String(i)));return}c.push(l(T,{children:y.label},R()))}),b.length||(c=[l(w.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},"no-selector-notice")]),l(P.Body,{className:E("Selector"),ssCardBox:!0,borderRadius:"3.tone.tertiary",boxShadow:"1.normal",freeCSS:{minWidth:12*14},children:l(ne,{gap:0,padding:[1,0],children:c})})},Selected:t=>{let e=[];return t.val_status.dataValue!==null&&p.scope(()=>{let a=t.rootStates.options.find(r=>p.JsonTo(r.value)==p.JsonTo(t.val_status.dataValue));a&&e.push(l(T,m(s({},t.rootStates.SelectedCellStyles),{children:a.label}),String(a.value)))}),l(Q,{children:e})},Core:t=>{let{value:e}=t,[a,r]=_(A.DefaultStatus(t.componentID,e)),[c,d]=_(!1),[b,y]=_(!1),[v,g]=_(t.value||null),[i,u]=_({ok:!1,notice:[]}),C={rootStates:t,val_preventOpenSelectorOnFocus:c,set_preventOpenSelectorOnFocus:d,val_optionFocused:v,set_optionFocused:g,val_selectorOpen:b,set_selectorOpen:y,val_status:a,set_status:r,val_validate:i,set_validate:u};return A.CommonEffects({type:"select",states:t,val_status:a,set_status:r,val_validate:i,set_validate:u,SystemValidation:Se}),N(ie,{val_status:a,set_status:r,val_validate:i,states:t,children:[l(ce,{componentID:t.componentID,fontSize:t.fontSize,required:t.required,label:t.label,isActive:t.isLabelActive||a.dataValue!==null}),l(V.Shallow,s({},C)),l(V.Button,s({},C))]})}},j=t=>{let e=s({},t);return e=m(s({emptySelect:!0},e),{freeCSS:s({cursor:"pointer"},e.freeCSS)}),e.emptySelect&&(e.options=[{value:null,label:l(w.Supplement,{fontColor:"4.thin",children:"\u9078\u629E\u3092\u89E3\u9664"})},...e.options]),e.value=e.value||null,e.options.forEach((a,r)=>{let{type:c,value:d}=a;e.options[r]=m(s({},a),{value:d,type:c||"selector"})}),p.is.nullish(e.rightIcon)&&(e.rightIcon=l(pe,{ssSphere:2,children:l($.AngleDown,{})})),l(se,{componentID:e.componentID,children:V.Core,states:ue(e)})};export{j as Select,j as default};
@@ -1 +1 @@
1
- import{b as C,c as _,d as B}from"../../chunk-C5N2D3ZX.js";import{jsx as d,jsxs as W}from"react/jsx-runtime";import y,{UUID as R}from"@mingoo/jsmin";import{useState as k,useEffect as P}from"react";import{$$fromRoot as I,GenerateHTMLProps as $}from"../../@utils";import{Box as D,Flex as A,Column as q}from"../../atoms";import{Button as O}from"../Button";import{OptionalInputWrapper as G,BoxWrapper as X,CoreEffects as F}from"./core";import{InputSliderClasses as c}from"../../@styles/componentClasses";function j(a){let{value:e,states:n}=a,{required:s}=n,o=[];return s&&!e&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!o.filter(({type:i})=>i=="invalid").length,notice:o}}const z=a=>{let{value:e,val_status:n}=a,{min:s,max:o,step:i}=n;e=Math.max(e,s),e=Math.min(e,o);let t=e/o*o;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/o*100+"%"}},N={IndicatorLabels:a=>{let{componentID:e,min:n,max:s,step:o,customLegends:i}=a,r=[],t=Math.round(n/o),p=Math.round(s/o),S=p-t+1;for(var u=t;u<=p;u++){let l=u*o;l=Math.max(l,n),l=Math.min(l,s);let f=l/s*100+"%";r.push(d(D,{className:c("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",verticalAlign:"center",horizontalAlign:"center",freeCSS:{left:f,whiteSpace:"nowrap",textAlign:"center"},children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let f=I("#Labels-"+e),{width:v}=f.position(),L=Math.round(v/50)-1,h=Math.round(S/L);for(let m=t+1;m<p;m++)I("#Legend-"+e+"-"+m).css({display:m%h==0?"flex":"none"})};return y(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{y(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(A,{className:c("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(D,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:n,DotData:s,form:o,enableFormSubmit:i}=a,{componentID:r}=e;return W(A,{className:c("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{a.rootStates.disabled||(t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:n,DotData:s}))},onTouchStart:t=>{a.rootStates.disabled||(t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:n,DotData:s}))},children:[d(D,{className:c("Bar"),backgroundColor:"layer.4",position:"relative",isRounded:!0,transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(D,{className:c("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:s.positionLeft},id:r+"_BarColor"})}),d(D,{className:c("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(O.Plain,{className:c("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:s.positionLeft},id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:n,DotData:s}),i&&F.SubmitForm(t,o)}})})]})}},b={Effects:{Start:(a,e)=>{y(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:n=>{b.Effects.Move(n,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:n=>{b.Effects.Move(n,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{b.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{b.Effects.End()}})},Move:(a,e)=>{let n=y.getCursor(a).x,{val_status:s,set_status:o}=e,{componentID:i,min:r,max:t}=s,p=I("#"+i+"_Ball"),S=I("#"+i+"_Bar"),u=I("#"+i+"_BarColor"),{width:l,left:f}=S.position(),v=(n-f)/l;v=Math.max(v,0),v=Math.min(v,1);let L=v*t,h=z({value:L,val_status:s}),m=h.positionLeft,w=h.stepValue;return p.css({left:m}),u.css({width:m}),o(x=>{let E=x.dataValue;return w==E?x:_(C({},x),{dataValue:w,eventType:"update",eventID:R()})}),a.preventDefault(),a.stopPropagation(),!1},End:()=>{y(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:n,set_status:s}=a,{min:o,max:i,step:r}=n,{key:t,metaKey:p,ctrlKey:S}=e,u=S||p,l=n.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=o:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),o),s(f=>_(C({},f),{dataValue:l,eventType:"update",eventID:R()})))}},J=a=>{let V=a,{color:e="theme",required:n,form:s="",legends:{enable:o=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:S,enableFormSubmit:u,checkValidationAtFirst:l,onValidate:f,onUpdateValue:v,onUpdateValidValue:L,value:h="",className:m,freeCSS:w,wrapStyles:x}=V,E=B(V,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","className","freeCSS","wrapStyles"]),[g,T]=k({componentID:a.componentID||"",dataValue:h,min:t,max:p,step:S,eventType:"init",eventID:R()}),[M,K]=k({ok:!1,notice:[]});F.CommonEffects({type:"slider",states:a,val_status:g,set_status:T,val_validate:M,set_validate:K,SystemValidation:j});let U=z({value:g.dataValue,val_status:g});return d(X,{val_status:g,set_status:T,val_validate:M,states:a,children:W(q,{gap:"1/2",flexSizing:"auto",className:[c("Wrap"),m,c("ShowLegendsAlways_"+r)].join(" "),children:[d(N.Rail,{rootStates:a,color:e,val_status:g,set_status:T,DotData:U,form:s,enableFormSubmit:u}),!!o&&d(N.IndicatorLabels,{componentID:g.componentID,min:t,max:p,step:S,customLegends:i})]})})},H=a=>{let e=C({},a);return d(G,{componentID:a.componentID,children:J,states:$(e)})};export{H as Slider,H as default};
1
+ import{b as C,c as _,d as B}from"../../chunk-C5N2D3ZX.js";import{jsx as d,jsxs as W}from"react/jsx-runtime";import y,{UUID as R}from"jmini";import{useState as k,useEffect as P}from"react";import{$$fromRoot as I,GenerateHTMLProps as $}from"../../@utils";import{Box as D,Flex as A,Column as q}from"../../atoms";import{Button as O}from"../Button";import{OptionalInputWrapper as G,BoxWrapper as X,CoreEffects as F}from"./core";import{InputSliderClasses as c}from"../../@styles/componentClasses";function j(a){let{value:e,states:n}=a,{required:s}=n,o=[];return s&&!e&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!o.filter(({type:i})=>i=="invalid").length,notice:o}}const z=a=>{let{value:e,val_status:n}=a,{min:s,max:o,step:i}=n;e=Math.max(e,s),e=Math.min(e,o);let t=e/o*o;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/o*100+"%"}},N={IndicatorLabels:a=>{let{componentID:e,min:n,max:s,step:o,customLegends:i}=a,r=[],t=Math.round(n/o),p=Math.round(s/o),S=p-t+1;for(var u=t;u<=p;u++){let l=u*o;l=Math.max(l,n),l=Math.min(l,s);let f=l/s*100+"%";r.push(d(D,{className:c("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",verticalAlign:"center",horizontalAlign:"center",freeCSS:{left:f,whiteSpace:"nowrap",textAlign:"center"},children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let f=I("#Labels-"+e),{width:v}=f.position(),L=Math.round(v/50)-1,h=Math.round(S/L);for(let m=t+1;m<p;m++)I("#Legend-"+e+"-"+m).css({display:m%h==0?"flex":"none"})};return y(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{y(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(A,{className:c("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(D,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:n,DotData:s,form:o,enableFormSubmit:i}=a,{componentID:r}=e;return W(A,{className:c("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{a.rootStates.disabled||(t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:n,DotData:s}))},onTouchStart:t=>{a.rootStates.disabled||(t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:n,DotData:s}))},children:[d(D,{className:c("Bar"),backgroundColor:"layer.4",position:"relative",isRounded:!0,transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(D,{className:c("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:s.positionLeft},id:r+"_BarColor"})}),d(D,{className:c("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(O.Plain,{className:c("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:s.positionLeft},id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:n,DotData:s}),i&&F.SubmitForm(t,o)}})})]})}},b={Effects:{Start:(a,e)=>{y(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:n=>{b.Effects.Move(n,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:n=>{b.Effects.Move(n,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{b.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{b.Effects.End()}})},Move:(a,e)=>{let n=y.getCursor(a).x,{val_status:s,set_status:o}=e,{componentID:i,min:r,max:t}=s,p=I("#"+i+"_Ball"),S=I("#"+i+"_Bar"),u=I("#"+i+"_BarColor"),{width:l,left:f}=S.position(),v=(n-f)/l;v=Math.max(v,0),v=Math.min(v,1);let L=v*t,h=z({value:L,val_status:s}),m=h.positionLeft,w=h.stepValue;return p.css({left:m}),u.css({width:m}),o(x=>{let E=x.dataValue;return w==E?x:_(C({},x),{dataValue:w,eventType:"update",eventID:R()})}),a.preventDefault(),a.stopPropagation(),!1},End:()=>{y(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:n,set_status:s}=a,{min:o,max:i,step:r}=n,{key:t,metaKey:p,ctrlKey:S}=e,u=S||p,l=n.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=o:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),o),s(f=>_(C({},f),{dataValue:l,eventType:"update",eventID:R()})))}},J=a=>{let V=a,{color:e="theme",required:n,form:s="",legends:{enable:o=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:S,enableFormSubmit:u,checkValidationAtFirst:l,onValidate:f,onUpdateValue:v,onUpdateValidValue:L,value:h="",className:m,freeCSS:w,wrapStyles:x}=V,E=B(V,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","className","freeCSS","wrapStyles"]),[g,T]=k({componentID:a.componentID||"",dataValue:h,min:t,max:p,step:S,eventType:"init",eventID:R()}),[M,K]=k({ok:!1,notice:[]});F.CommonEffects({type:"slider",states:a,val_status:g,set_status:T,val_validate:M,set_validate:K,SystemValidation:j});let U=z({value:g.dataValue,val_status:g});return d(X,{val_status:g,set_status:T,val_validate:M,states:a,children:W(q,{gap:"1/2",flexSizing:"auto",className:[c("Wrap"),m,c("ShowLegendsAlways_"+r)].join(" "),children:[d(N.Rail,{rootStates:a,color:e,val_status:g,set_status:T,DotData:U,form:s,enableFormSubmit:u}),!!o&&d(N.IndicatorLabels,{componentID:g.componentID,min:t,max:p,step:S,customLegends:i})]})})},H=a=>{let e=C({},a);return d(G,{componentID:a.componentID,children:J,states:$(e)})};export{H as Slider,H as default};
@@ -1 +1 @@
1
- import{b as r,c as f,d as S}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as T}from"react/jsx-runtime";import{UUID as g}from"@mingoo/jsmin";import{useState as k}from"react";import s from"../../atoms/Box";import{Row as F}from"../../mols";import{Label as N}from"../Button";import{OptionalInputWrapper as L,BoxWrapper as U,CoreEffects as x}from"./core";import{InputSwitchClasses as m}from"../../@styles/componentClasses";function H(t){let{value:e,states:o}=t,{required:I}=o,n=[];return I&&!e&&n.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!n.filter(({type:p})=>p=="invalid").length,notice:n}}const q=t=>{let w=t,{componentID:e,color:o="posi",required:I,form:n,id:p,enableFormSubmit:V,checkValidationAtFirst:M,onChange:y,onKeyDown:b,onValidate:O,onUpdateValue:P,onUpdateValidValue:W,value:R="",icon:C="",appearance:u="material"}=w,B=S(w,["componentID","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","icon","appearance"]),[i,c]=k({componentID:t.componentID||"",dataValue:R,eventType:"init",eventID:g()}),[h,v]=k({ok:!1,notice:[]}),d=!!i.dataValue;return x.CommonEffects({type:"switch",states:t,val_status:i,set_status:c,val_validate:h,set_validate:v,SystemValidation:H}),T(U,{val_status:i,set_status:c,val_validate:h,states:t,children:[a(s,r({htmlTag:"input",type:"checkbox","data-component-id":i.componentID,checked:i.dataValue,className:m("Input"),id:p,onKeyDown:l=>{b&&b(l),V&&x.SubmitForm(l,n)},onChange:l=>{let{checked:E}=l.target;h.ok&&v({ok:!1,notice:[]}),c(_=>f(r({},_),{dataValue:E,eventType:"update",eventID:g()})),y&&y(l)}},B)),a(N.Plain,{tabIndex:-1,htmlFor:p,padding:"1/3",transition:"middle",borderRadius:"1.tone.primary",className:m("Label"),children:a(s,f(r({},u=="applely"?{padding:"1/4",isRounded:!0,backgroundColor:d?o:"layer.5"}:{}),{children:T(F.Center,{unitHeight:2.5,position:"relative",freeCSS:{width:12*4.5},children:[u=="material"&&a(s,{position:"absolute",backgroundColor:d?o:"layer.5",isRounded:!0,unitHeight:1,transition:"middle",width:1,opacity:"middle",className:m("Bar")}),a(s,{position:"absolute",top:0,left:0,backgroundColor:u=="material"&&d?o:"white",transition:"middle",ssSphere:2.5,boxShadow:"1.remark",className:m("Dot"),children:C&&a(s,{transition:"middle",ssSquare:2,flexCenter:!0,fontColor:u=="applely"&&d?o:"white",children:C})})]})}))})]})},D=t=>{let e=r({},t);return e.value=!!e.value,e.color=e.color||"theme",a(L,{componentID:e.componentID,children:q,states:e})};export{D as Switch,D as default};
1
+ import{b as r,c as f,d as S}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as T}from"react/jsx-runtime";import{UUID as g}from"jmini";import{useState as k}from"react";import s from"../../atoms/Box";import{Row as F}from"../../mols";import{Label as N}from"../Button";import{OptionalInputWrapper as L,BoxWrapper as U,CoreEffects as x}from"./core";import{InputSwitchClasses as m}from"../../@styles/componentClasses";function H(t){let{value:e,states:o}=t,{required:I}=o,n=[];return I&&!e&&n.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!n.filter(({type:p})=>p=="invalid").length,notice:n}}const q=t=>{let w=t,{componentID:e,color:o="posi",required:I,form:n,id:p,enableFormSubmit:V,checkValidationAtFirst:M,onChange:y,onKeyDown:b,onValidate:O,onUpdateValue:P,onUpdateValidValue:W,value:R="",icon:C="",appearance:u="material"}=w,B=S(w,["componentID","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","icon","appearance"]),[i,c]=k({componentID:t.componentID||"",dataValue:R,eventType:"init",eventID:g()}),[h,v]=k({ok:!1,notice:[]}),d=!!i.dataValue;return x.CommonEffects({type:"switch",states:t,val_status:i,set_status:c,val_validate:h,set_validate:v,SystemValidation:H}),T(U,{val_status:i,set_status:c,val_validate:h,states:t,children:[a(s,r({htmlTag:"input",type:"checkbox","data-component-id":i.componentID,checked:i.dataValue,className:m("Input"),id:p,onKeyDown:l=>{b&&b(l),V&&x.SubmitForm(l,n)},onChange:l=>{let{checked:E}=l.target;h.ok&&v({ok:!1,notice:[]}),c(_=>f(r({},_),{dataValue:E,eventType:"update",eventID:g()})),y&&y(l)}},B)),a(N.Plain,{tabIndex:-1,htmlFor:p,padding:"1/3",transition:"middle",borderRadius:"1.tone.primary",className:m("Label"),children:a(s,f(r({},u=="applely"?{padding:"1/4",isRounded:!0,backgroundColor:d?o:"layer.5"}:{}),{children:T(F.Center,{unitHeight:2.5,position:"relative",freeCSS:{width:12*4.5},children:[u=="material"&&a(s,{position:"absolute",backgroundColor:d?o:"layer.5",isRounded:!0,unitHeight:1,transition:"middle",width:1,opacity:"middle",className:m("Bar")}),a(s,{position:"absolute",top:0,left:0,backgroundColor:u=="material"&&d?o:"white",transition:"middle",ssSphere:2.5,boxShadow:"1.remark",className:m("Dot"),children:C&&a(s,{transition:"middle",ssSquare:2,flexCenter:!0,fontColor:u=="applely"&&d?o:"white",children:C})})]})}))})]})},D=t=>{let e=r({},t);return e.value=!!e.value,e.color=e.color||"theme",a(L,{componentID:e.componentID,children:q,states:e})};export{D as Switch,D as default};
@@ -1,3 +1,3 @@
1
- import{b as l,c as s,d as q,e as ae}from"../../chunk-C5N2D3ZX.js";import{Fragment as le,jsx as o,jsxs as $}from"react/jsx-runtime";import w,{UUID as _}from"@mingoo/jsmin";import{useState as L,useEffect as J}from"react";import{$$fromRoot as Ie,useStore as ve,ExtractStyles as Se}from"../../@utils";import{Box as V,FAI as Te}from"../../atoms";import{Text as Y}from"../../mols";import{Tips as ie,Button as Ce}from"..";import{faEye as Re}from"@fortawesome/free-solid-svg-icons/faEye";import{OptionalInputWrapper as ye,BoxWrapper as we,CoreEffects as M,DefaultBoxishStyles as Ve}from"./core";import{InputLabel as De}from"./Label";import{LeftIcon as ke,RightIcon as ne}from".";const Fe={number:{reg:/^-?[0-9\.]+$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},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"},digitNumber:{reg:/^-?[0-9\.]+$/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:$(le,{children:[o(V,{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(V,{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:$(le,{children:[o(V,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),o(V,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),o(V,{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"}},D={setSelection:e=>{let{id:a,restrict:r,val_status:t}=e,n=Ie("#"+a)[0];if(n&&t.prevValue&&t.formatValue){let{formatValue:u,prevValue:c,caretFrom:i,caretTo:m}=t;if(r=="creditCard")u.length>=c.length&&i%5==0&&(i++,m++),n.setSelectionRange(i,m);else if(r=="postal")u.length==5&&c.length==3&&(i++,m++),n.setSelectionRange(i,m);else if(r=="digitNumber"){let h=u.length-c.length;h==2&&(i++,m++),h==-2&&(i--,m--),n.setSelectionRange(i,m)}}},Validation:{System:e=>{let{value:a,states:r}=e,{restrict:t="text",maxLength:n,multiline:u,required:c}=r,i=[];if(u||(n=n||255),w.is.exist(n)&&a.length>=Number(n)&&i.push({type:"invalid",label:n+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a){let m=D.Validation.Text(a,t);m.ok||i.push({type:"invalid",label:m.body})}else c&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!i.filter(({type:m})=>m=="invalid").length,notice:i}},Text:(e,a)=>{let r={ok:!0,body:""};return(()=>{let t=Fe[a];if(!t)return;let n=t.reason;if(t){let u=!!(+!!e.match(t.reg)^+!t.exist);r={ok:u,body:u?"":n}}})(),r},DataLeveling:e=>{let{restrict:a,value:r=""}=e,t=String(r),n=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(a)&&(t=t.zen2hanNumber()),a=="katakana"&&(t=t.replace(/[^ァ-ヶー  ヲ-゚  ]/ig,"")),a=="hankaku.katakana"&&(t=t.replace(/[^ヲ-゚  ]/ig,"")),["postal","creditCard"].includes(a)&&(t=t.removeLetters()),["number","number.zeroStart","digitNumber"].includes(a)){let c=t[0]=="0";if(t){if(t!="-")if(t=="0-")t="-";else{t[0]=="-"&&(n=!0),t=t.replace(/[^0-9\.]/ig,"");let i=Number(t);i===0&&(n=!1),n&&(i=-1*i),w.is.exist(e.min)&&(i=Math.max(i,Number(e.min))),w.is.exist(e.max)&&(i=Math.min(i,Number(e.max))),t=String(Math.abs(i))}c&&t!="0"&&a=="number.zeroStart"&&(t="0"+t)}}let u=t;if(a=="digitNumber"){if(t&&t!="-"){let c=[];for(let i=t.length-1;i>=0;i--){c.unshift(t[i]);let m=t.length-1-i+1;i!=0&&m%3==0&&c.unshift(",")}u=c.join("")}}else a=="postal"?t.length>=4&&(u=t.clip(0,3)+"-"+t.clip(3)):a=="creditCard"&&(u=t.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(a)&&n&&(t="-"+t,u="-"+u),{formatValue:u,dataValue:t}}}},G={Shallow:e=>{let{rootStates:a,val_status:r}=e,t=r.dataValue||"";J(()=>{w.scope(()=>ae(void 0,null,function*(){if(!a.multiline)return;let h=w('[data-input-origin="'+r.componentID+'"]'),b=w('[data-input-shallow="'+r.componentID+'"]'),k=w('[data-input-min-height-value-shallow="'+r.componentID+'"]'),T=w('[data-input-max-height-value-shallow="'+r.componentID+'"]');if(!h[0]||!b[0]||!k[0]||!T[0])return;let d=b.position(),C=k.position(),A=T.position(),R=0;a.autoHeight&&(R=d.height),R=Math.max(R,C.height),R=Math.min(R,A.height),h[0].style.height=R+"px"}))},[t]);let n=t||"";(!!t.match(/\n$/)||!t)&&(n+="T");let c="",i="";if(a.multiline){let h=a.minRows||1,b=a.maxRows||100;c=`
1
+ import{b as l,c as s,d as q,e as ae}from"../../chunk-C5N2D3ZX.js";import{Fragment as le,jsx as o,jsxs as $}from"react/jsx-runtime";import w,{UUID as _}from"jmini";import{useState as L,useEffect as J}from"react";import{$$fromRoot as Ie,useStore as ve,ExtractStyles as Se}from"../../@utils";import{Box as V,FAI as Te}from"../../atoms";import{Text as Y}from"../../mols";import{Tips as ie,Button as Ce}from"..";import{faEye as Re}from"@fortawesome/free-solid-svg-icons/faEye";import{OptionalInputWrapper as ye,BoxWrapper as we,CoreEffects as M,DefaultBoxishStyles as Ve}from"./core";import{InputLabel as De}from"./Label";import{LeftIcon as ke,RightIcon as ne}from".";const Fe={number:{reg:/^-?[0-9\.]+$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},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"},digitNumber:{reg:/^-?[0-9\.]+$/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:$(le,{children:[o(V,{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(V,{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:$(le,{children:[o(V,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),o(V,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),o(V,{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"}},D={setSelection:e=>{let{id:a,restrict:r,val_status:t}=e,n=Ie("#"+a)[0];if(n&&t.prevValue&&t.formatValue){let{formatValue:u,prevValue:c,caretFrom:i,caretTo:m}=t;if(r=="creditCard")u.length>=c.length&&i%5==0&&(i++,m++),n.setSelectionRange(i,m);else if(r=="postal")u.length==5&&c.length==3&&(i++,m++),n.setSelectionRange(i,m);else if(r=="digitNumber"){let h=u.length-c.length;h==2&&(i++,m++),h==-2&&(i--,m--),n.setSelectionRange(i,m)}}},Validation:{System:e=>{let{value:a,states:r}=e,{restrict:t="text",maxLength:n,multiline:u,required:c}=r,i=[];if(u||(n=n||255),w.is.exist(n)&&a.length>=Number(n)&&i.push({type:"invalid",label:n+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a){let m=D.Validation.Text(a,t);m.ok||i.push({type:"invalid",label:m.body})}else c&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!i.filter(({type:m})=>m=="invalid").length,notice:i}},Text:(e,a)=>{let r={ok:!0,body:""};return(()=>{let t=Fe[a];if(!t)return;let n=t.reason;if(t){let u=!!(+!!e.match(t.reg)^+!t.exist);r={ok:u,body:u?"":n}}})(),r},DataLeveling:e=>{let{restrict:a,value:r=""}=e,t=String(r),n=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(a)&&(t=t.zen2hanNumber()),a=="katakana"&&(t=t.replace(/[^ァ-ヶー  ヲ-゚  ]/ig,"")),a=="hankaku.katakana"&&(t=t.replace(/[^ヲ-゚  ]/ig,"")),["postal","creditCard"].includes(a)&&(t=t.removeLetters()),["number","number.zeroStart","digitNumber"].includes(a)){let c=t[0]=="0";if(t){if(t!="-")if(t=="0-")t="-";else{t[0]=="-"&&(n=!0),t=t.replace(/[^0-9\.]/ig,"");let i=Number(t);i===0&&(n=!1),n&&(i=-1*i),w.is.exist(e.min)&&(i=Math.max(i,Number(e.min))),w.is.exist(e.max)&&(i=Math.min(i,Number(e.max))),t=String(Math.abs(i))}c&&t!="0"&&a=="number.zeroStart"&&(t="0"+t)}}let u=t;if(a=="digitNumber"){if(t&&t!="-"){let c=[];for(let i=t.length-1;i>=0;i--){c.unshift(t[i]);let m=t.length-1-i+1;i!=0&&m%3==0&&c.unshift(",")}u=c.join("")}}else a=="postal"?t.length>=4&&(u=t.clip(0,3)+"-"+t.clip(3)):a=="creditCard"&&(u=t.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(a)&&n&&(t="-"+t,u="-"+u),{formatValue:u,dataValue:t}}}},G={Shallow:e=>{let{rootStates:a,val_status:r}=e,t=r.dataValue||"";J(()=>{w.scope(()=>ae(void 0,null,function*(){if(!a.multiline)return;let h=w('[data-input-origin="'+r.componentID+'"]'),b=w('[data-input-shallow="'+r.componentID+'"]'),k=w('[data-input-min-height-value-shallow="'+r.componentID+'"]'),T=w('[data-input-max-height-value-shallow="'+r.componentID+'"]');if(!h[0]||!b[0]||!k[0]||!T[0])return;let d=b.position(),C=k.position(),A=T.position(),R=0;a.autoHeight&&(R=d.height),R=Math.max(R,C.height),R=Math.min(R,A.height),h[0].style.height=R+"px"}))},[t]);let n=t||"";(!!t.match(/\n$/)||!t)&&(n+="T");let c="",i="";if(a.multiline){let h=a.minRows||1,b=a.maxRows||100;c=`
2
2
  T`.repeat(h-1),i=`
3
3
  T`.repeat(b-1)}let m=Se(a);return $(V,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:[o(Y.Description,s(l({className:a.className},m),{position:"absolute",width:1,freeCSS:s(l({},m.freeCSS),{color:"orange"}),"data-input-shallow":r.componentID,children:o(V,{"data-input-value-shallow":r.componentID,children:n})})),o(Y.Description,s(l({className:a.className},m),{position:"absolute",left:0,freeCSS:s(l({},m.freeCSS),{backgroundColor:"transparent",color:"blue"}),"data-input-min-height-value-shallow":r.componentID,children:c})),o(Y.Description,s(l({className:a.className},m),{position:"absolute",right:0,freeCSS:s(l({},m.freeCSS),{backgroundColor:"transparent",color:"red"}),"data-input-max-height-value-shallow":r.componentID,children:i}))]})},InputBox:e=>{let{rootStates:a,val_validate:r,set_validate:t,val_status:n,set_status:u,val_focus:c,set_focus:i,val_isComposing:m,set_isComposing:h}=e;if(a.multiline)return null;let ee=a,{componentID:b,tone:k,required:T,restrict:d="text",form:C,autoComplete:A="off",autoCapitalize:R="off",minRows:oe,maxRows:re,multiline:X,autoHeight:se,enableFormSubmit:U,clearButton:P=!1,checkValidationAtFirst:B,onChange:K,onKeyDown:W,onValidate:ue,onUpdateValue:me,onUpdateValidValue:pe,value:ce="",leftIndicator:de,rightIndicator:fe,leftIcon:ge,rightIcon:x,maxLength:xe,min:E,max:I,label:j,isLabelActive:Q,wrapStyles:_e}=ee,p=q(ee,["componentID","tone","required","restrict","form","autoComplete","autoCapitalize","minRows","maxRows","multiline","autoHeight","enableFormSubmit","clearButton","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max","label","isLabelActive","wrapStyles"]),he=d=="password"||d=="concealed"?"password":"text",be=["number","digitNumber","creditCard"].includes(d)?"numeric":d=="email"?"email":"text";return o(V,s(l({htmlTag:"input",type:he,inputMode:be,"data-disabled":a.disabled,"data-show-validation":M.isShowValidation(r,n,!!B),"data-component-id":n.componentID,"data-input-origin":n.componentID,value:n.formatValue,autoComplete:A,autoCapitalize:R,onKeyDown:f=>{let{key:v,target:F}=f;{let y=F,{selectionStart:N,selectionEnd:H}=y,z=Number(N),te=Number(H),Z=n.formatValue[Number(z)],O=n.formatValue[Number(z)-1];v=="Delete"&&(d=="creditCard"&&Z==" "||d=="postal"&&Z=="-"||d=="digitNumber"&&Z==",")&&(y.setSelectionRange(z+1,te+1),f.preventDefault()),v=="Backspace"&&(d=="creditCard"&&O==" "||d=="postal"&&O=="-"||d=="digitNumber"&&O==",")&&(y.setSelectionRange(z-1,te-1),f.preventDefault()),v=="Enter"||v=="Tab"}if(["number","digitNumber","creditCard"].includes(d)&&v=="Clear"&&u(y=>s(l({},y),{dataValue:"",formatValue:"",eventType:"update",eventID:_()})),["number","digitNumber"].includes(d)&&["ArrowUp","ArrowDown"].includes(v)){let y=+(v=="ArrowUp")*2-1,N=String(Number(n.dataValue)+y);r.ok&&t({ok:!1,notice:[]}),u(H=>s(l(l({},H),D.Validation.DataLeveling({min:E,max:I,restrict:d,value:N})),{eventType:"update",eventID:_()})),f.preventDefault()}W&&W(f),U&&M.SubmitForm(f,C)},onChange:f=>{let{value:v,selectionStart:F,selectionEnd:y}=f.target,N=D.Validation.DataLeveling({min:E,max:I,restrict:d,value:v});m&&(N.formatValue=v),N.formatValue!=n.formatValue&&(r.ok&&t({ok:!1,notice:[]}),u(H=>s(l(l({},H),N),{prevValue:n.formatValue,eventType:"update",eventID:_(),caretFrom:Number(F),caretTo:Number(y)})),K&&K(f))},width:1},p),{onFocus:f=>{p!=null&&p.onFocus&&(p==null||p.onFocus(f)),i(!0)},onBlur:f=>{p!=null&&p.onBlur&&(p==null||p.onBlur(f)),i(!1)},onCompositionStart:f=>{p!=null&&p.onCompositionStart&&(p==null||p.onCompositionStart(f)),h(!0)},onCompositionEnd:f=>{if(p!=null&&p.onCompositionEnd&&(p==null||p.onCompositionEnd(f)),d=="text")return;let v=D.Validation.DataLeveling({min:E,max:I,restrict:d,value:n.formatValue});u(F=>s(l(l({},F),v),{prevValue:F.formatValue,eventType:"update",eventID:_(),caretFrom:Number(F.formatValue.length+1),caretTo:Number(F.formatValue.length+1)})),h(!1)}}))},TextAreaBox:e=>{let{rootStates:a,val_focus:r,set_focus:t,val_validate:n,set_validate:u,val_status:c,set_status:i,isShallow:m}=e,E=a,{componentID:h,tone:b,required:k,form:T,label:d,isLabelActive:C,minRows:A,maxRows:R,multiline:oe,autoHeight:re,enableFormSubmit:X,maxLength:se,checkValidationAtFirst:U,onChange:P,onKeyDown:B,onValidate:K,onUpdateValue:W,onUpdateValidValue:ue,value:me="",leftIndicator:pe,rightIndicator:ce,leftIcon:de,rightIcon:fe,wrapStyles:ge}=E,x=q(E,["componentID","tone","required","form","label","isLabelActive","minRows","maxRows","multiline","autoHeight","enableFormSubmit","maxLength","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","wrapStyles"]);return!a.multiline?null:o(V,s(l({htmlTag:"textarea","data-show-validation":M.isShowValidation(n,c,!!U),"data-input-origin":c.componentID,"data-component-id":c.componentID,value:c.dataValue,width:1},x),{onFocus:I=>{x!=null&&x.onFocus&&(x==null||x.onFocus(I)),t(!0)},onBlur:I=>{x!=null&&x.onBlur&&(x==null||x.onBlur(I)),t(!1)},onKeyDown:I=>{B&&B(I),X&&M.SubmitForm(I,T)},onChange:I=>{let{value:j}=I.target;n.ok&&u({ok:!1,notice:[]}),i(Q=>s(l({},Q),{dataValue:j,eventType:"update",eventID:_()})),P&&P(I)}}))}},Ne=e=>{let{componentID:a,restrict:r="text",value:t="",min:n,max:u}=e,[c,i]=L(!1),[m,h]=L(!1),[b,k]=L(s(l({componentID:a},D.Validation.DataLeveling({min:n,max:u,restrict:r,value:t})),{prevValue:"",eventType:"init",eventID:_(),caretFrom:null,caretTo:null})),[T,d]=L({ok:!1,notice:[]}),C={rootStates:e,val_focus:c,set_focus:i,val_isComposing:m,set_isComposing:h,val_status:b,set_status:k,val_validate:T,set_validate:d};return M.CommonEffects({type:"textfield",states:e,val_status:b,set_status:k,val_validate:T,set_validate:d,SystemValidation:D.Validation.System,ExtraOverrideStates:l({},D.Validation.DataLeveling({min:n,max:u,restrict:r,value:t}))}),J(()=>{D.setSelection({id:e.id,restrict:r,val_status:b})},[b]),$(we,{val_status:b,set_status:k,val_validate:T,states:C.rootStates,children:[o(De,{componentID:e.componentID,fontSize:e.fontSize,required:e.required,label:e.label,isActive:e.isLabelActive||c||!!b.dataValue}),o(G.Shallow,l({},C)),o(G.InputBox,l({},C)),o(G.TextAreaBox,l({},C))]})},S=e=>(e=l({autoHeight:!0,restrict:"text",fontSize:"2.normal"},e),e.multiline?(e.minRows=e.minRows||5,e.maxRows=e.maxRows||20):(e.minRows=1,e.maxRows=1),o(ye,{componentID:e.componentID,children:Ne,states:Ve(e)})),g=S;g.Validate=D.Validation.Text,g.Katakana=e=>o(S,s(l({},e),{restrict:"katakana",multiline:!1,autoHeight:!1})),g.HankakuKatakana=e=>o(S,s(l({},e),{restrict:"hankaku.katakana",multiline:!1,autoHeight:!1})),g.CreditCard=e=>o(S,s(l({},e),{restrict:"creditCard",multiline:!1,autoHeight:!1})),g.Tel=e=>o(S,s(l({},e),{restrict:"tel",multiline:!1,autoHeight:!1})),g.Number=e=>o(S,s(l({},e),{restrict:"number",multiline:!1,autoHeight:!1})),g.DigitNumber=e=>o(S,s(l({},e),{restrict:"digitNumber",multiline:!1,autoHeight:!1})),g.Email=e=>o(S,s(l({},e),{restrict:"email",multiline:!1,autoHeight:!1})),g.Url=e=>o(S,s(l({},e),{restrict:"url",multiline:!1,autoHeight:!1})),g.Postal=e=>{let[a]=L(_());return J(()=>()=>{ve.delete(a)},[]),o(S,s(l({label:"\u90F5\u4FBF\u756A\u53F7"},e),{restrict:"postal",multiline:!1,autoHeight:!1,leftIcon:o(ke,{ssSphere:2,fontColor:"4.thin",children:"\u3012"})}))},g.Password=e=>o(S,s(l({label:"\u30D1\u30B9\u30EF\u30FC\u30C9",rightIcon:o(ne,{ssSphere:2,padding:0,freeCSS:{pointerEvents:"all"},children:o(Ce.Sub,{ssSphere:2,borderRadius:"3.tone.tertiary",fontColor:"theme",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:a=>{ie.open(a.currentTarget,"\u30C6\u30AD\u30B9\u30C8\u3092\u8868\u793A",24)},onMouseLeave:ie.abort,tabIndex:-1,onClick:a=>{w(a.target).parent().parent().find("input").callback(r=>{let t=r[0];t.type=t.type==="password"?"text":"password"})},children:o(Te,{icon:Re})})}),restrict:"password"},e),{multiline:!1,autoHeight:!1})),g.Concealed=e=>o(g.Password,s(l({label:"\u79D8\u5BC6\u9375"},e),{restrict:"concealed"})),g.Money={JPY:e=>o(g.DigitNumber,s(l({rightIcon:o(ne,{ssSphere:2,fontColor:"4.thin",children:"\u5186"})},e),{multiline:!1,autoHeight:!1}))};export{g as TextField,Ne as TextInput,g as default};
@@ -1 +1 @@
1
- import{b as f,c as x}from"../../../chunk-C5N2D3ZX.js";import{Fragment as $,jsx as a,jsxs as y}from"react/jsx-runtime";import{createElement as q}from"react";import c,{UUID as Y}from"@mingoo/jsmin";import{useState as P,useEffect as U,useRef as O}from"react";import{Box as C,Flex as R,Grid as A,FAI as T,Column as D}from"../../../atoms";import{Row as V,Text as H}from"../../../mols";import{Button as k}from"../../Button";import G from"../../Tooltips";import I from"../Select";import{Radio as F}from"../List";import{RightIcon as w}from"..";import{InputTimeClasses as b}from"../../../@styles/componentClasses";let _=r=>{var t,i;let e=[],d=Number((t=r==null?void 0:r.min)!=null?t:1900),o=Number((i=r==null?void 0:r.max)!=null?i:c.Time().addYear(10).year);for(let m=d;m<=o;m++)e.unshift({value:m,label:[m,...c.transformer.wareki(m).value].join(" -")});return e};const j=r=>{let{restrict:e,era:d="year",defaultValue:o=""}=r;r=f({},r),r.tipsID=r.tipsID||Y();const t=O(!1);let[i,m]=P((()=>{var n,s;if(e=="clock"){let l=String(o).split(/[^\d]/);l[0]||(l=[0,0]);let u=Number(l[0]),h=Number(l[1]);return{modifiedType:"init",hour:u,minutes:h}}else if(e=="date"){let[l,u,h]=(n=String(o))==null?void 0:n.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",year:Number(l),month:Number(u),date:Number(h)}}else if(e!="week"){if(e=="month"){let[l,u]=String(o).split(/\D/);return(c.is.nullish(l)||c.is.nullish(u))&&([l,u]=c.Time().toFormat("%Y-%M").split("-")),{modifiedType:"init",year:Number(l),month:Number(u)}}else if(e=="year"){let[l]=String(o).split(/\D/);return c.is.nullish(l)&&([l]=c.Time().toFormat("%Y").split("-")),{modifiedType:"init",year:Number(l)}}else if(e=="dateWareki"){let[l,u,h]=(s=String(o))==null?void 0:s.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",era:d||"year",year:Number(l),month:Number(u),date:Number(h)}}}return{}})());U(()=>{if(t.current){if(i.modifiedType=="update"){let n="",s=d||"year";if(e=="clock"){let{hour:l,minutes:u}=i;n=[l.zeroEmbed(2),u.zeroEmbed(2)].join("/")}else if(e=="date"){let{year:l,month:u,date:h}=i;n=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}else if(e!="week"){if(e=="month"){let{year:l,month:u}=i;n=[l,u.zeroEmbed(2)].join("/")}else if(e=="year"){let{year:l}=i;n=String(l)}else if(e=="dateWareki"){let{year:l,month:u,date:h,era:v}=i;s=v,n=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}}r.onValueUpdate(n,s)}}else t.current=!0},[i]);let p=x(f({},r),{val_value:i,set_value:m});return a(C,{backgroundColor:"layer.1",borderRadius:"2.tone.secondary",boxShadow:"1.remark",border:!0,overflow:"hidden",children:a(C,{overflow:"auto",className:b(e.toCapital()+"Base"),children:e=="clock"?a(S.Clock.index,f({},p)):e=="date"?a(S.Date.index,f({},p)):e=="week"?"":e=="month"?a(S.Month.index,f({},p)):e=="year"?a(S.Year.index,f({},p)):e=="dates"||e=="months"?"":e=="dateWareki"?a(S.DateWareki.index,f({},p)):a($,{})})})},S={Clock:{index:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:i,set_value:m}=r,[p,n]=P(i.hour>12?2:1),[s,l]=P(Number(localStorage.getItem("timePickerUnit")||5));U(()=>{localStorage.setItem("timePickerUnit",String(s))},[s]);let{hour:u,minutes:h}=i;return y(D,{padding:1,children:[y(R,{flexType:"row",flexWrap:!1,gap:1,className:b("Body"),children:[y(D,{className:b("DesignSide"),flexSizing:0,children:[a(C,{className:b("ClockUiBase"),padding:[1,"2/3"],flexCenter:!0,children:y(C,{className:b("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[a(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[b("Needle"),b("hour")].join(" "),freeCSS:{transform:`rotate(${u*30+h/2}deg)`}}),a(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[b("Needle"),b("minute")].join(" "),freeCSS:{transform:`rotate(${h*6}deg)`}})]})}),a(F,{icon:!0,value:[p],options:[{value:1,label:"AM"},{value:2,label:"PM"}],flexType:"col",gap:0,tabIndex:-1,onUpdateValidValue:({value:v})=>{let N=i.hour%12+(v==2?12:0);n(v),m({modifiedType:"update",hour:N,minutes:i.minutes})}}),a(C,{borderTop:!0,margin:[0,1]}),a(F,{icon:!0,value:[s],options:[{value:1,label:"/ 1\u5206"},{value:2,label:"/ 2\u5206"},{value:5,label:"/ 5\u5206"}],flexType:"col",gap:0,tabIndex:-1,onUpdateValidValue:({value:v})=>{l(v)}})]}),y(D,{children:[y(C,{flexCenter:!0,isSemiBoldFont:!0,fontSize:"3.paragraph",children:[i.hour.zeroEmbed(2)," : ",i.minutes.zeroEmbed(2)]}),y(R,{flexWrap:!1,ssCardBox:!0,flexChilds:"even",padding:["1/3",0],freeCSS:{minWidth:12*12},children:[a(D,{gap:0,overflow:"auto",padding:"2/3",borderRight:!0,freeCSS:{maxHeight:12*22},children:S.Clock.Hours({onClick:v=>{let M=v+(p==2?12:0);m({modifiedType:"update",hour:M,minutes:i.minutes})},min:e,max:d,ampm:p})}),a(D,{gap:0,overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*22},children:S.Clock.Minutes({onClick:v=>{m({modifiedType:"update",hour:i.hour,minutes:v})},min:e,max:d,unit:s})})]})]})]}),a(S.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Hours:r=>{let e=[];for(let d=0;d<12;d++){let o=r.ampm==2?d+12:d,t=!1;{let i=Number(String(o*100).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>i&&(t=!0),r.max){let m=Number(String(r.max).replace(/\D/ig,""));i>m&&(t=!0)}}e.push(a(k.Normal,{isLocked:t,borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(d)},children:o.zeroEmbed(2)},d))}return e},Minutes:r=>{let e=[];for(let d=0;d<60/r.unit;d++){let o=d*r.unit;e.push(a(k.Normal,{borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(o)},children:o.zeroEmbed(2)},o))}return e}},Date:{index:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:i,set_value:m}=r,{year:p,month:n,date:s}=i;return y(D,{padding:1,children:[y(V.Separate,{flexWrap:!0,children:[y(R,{verticalAlign:"bottom",horizontalAlign:"left",gap:"2/3",flexWrap:!1,children:[a(I,{override:"force",emptySelect:!1,value:p,options:_(),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:Number(l),month:n,date:s})},rightIcon:a(w,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})})}),a(I,{override:"force",emptySelect:!1,value:n,options:(()=>{let l=[];for(let u=1;u<=12;u++)l.push({value:u,label:String(u)+"\u6708"});return l})(),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,rightIcon:a(w,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:p,month:Number(l),date:s})}})]}),a(S.Variables.ShiftButtons,{callback:l=>{let u=n+l,h=p;u<=0&&(h--,u=12),u>12&&(h++,u=1),m({modifiedType:"update",year:h,month:u,date:i.date})}})]}),a(C,{borderTop:!0}),a(C,{children:S.Date.MonthCalendar({min:e,max:d,year:i.year,month:i.month,current:[i.year,i.month,i.date],callback:l=>{let[u,h,v]=l;m({modifiedType:"update",year:u,month:h,date:v})}})}),a(S.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},MonthCalendar:r=>{let{min:e,max:d,year:o,month:t,current:i,callback:m}=r,p=c.Time(),n=c.Time([o,t.zeroEmbed(2),"01"].join("/")),s=n.getLastDayOfTheMonth(),l=c.Time(n).addMonth(-1).getLastDayOfTheMonth().date,u=[],h=[],v=[],M=[],N={padding:0,unitWidth:3,unitHeight:3,flexCenter:!0,borderRadius:"3.tone.tertiary"};for(var g=0;g<7;g++)u.push(a(C,x(f({className:[b("CalendarDay"),b("Legend")].join(" ")},N),{children:["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][g]}),g));for(var g=0;g<n.weekday;g++)h.unshift(q(C,x(f({className:[b("CalendarDay"),b("Dummy")].join(" "),fontColor:"4.thin"},N),{key:g}),l-g));for(var g=1;g<=s.date;g++){let E=g,L=o==p.year&&t==p.month&&g==p.date,B=!1;{let W=Number(String([o,t.zeroEmbed(2),g.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>W&&(B=!0),r.max){let z=Number(String(r.max).replace(/\D/ig,""));W>z&&(B=!0)}}v.push(a(k.Clear,x(f({className:[b("CalendarDay"),b("isToday_"+L)].join(" ")},N),{fontColor:"1.clear",padding:0,flexCenter:!0,isRounded:!0,ssEffectsOnActive:"shrink",onClick:()=>{m([o,t,E])},tabIndex:-1,isLocked:B,children:g}),E))}for(var g=1;g<7-s.weekday;g++)M.push(a(C,x(f({className:[b("CalendarDay"),b("Dummy")].join(" "),fontColor:"4.thin"},N),{children:g}),g));return y(A,{gridCols:7,gap:"1/6",children:[u,h,v,M]})}},Month:{index:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:i,set_value:m}=r,{year:p,month:n}=i;return y(D,{padding:1,children:[y(V.Separate,{gap:0,children:[a(V.Center,{verticalAlign:"bottom",gap:"2/3",children:a(I,{emptySelect:!1,value:p,options:_(),override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIcon:a(w,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),onUpdateValidValue:({value:s})=>{m({modifiedType:"update",year:Number(s),month:n})}})}),a(S.Variables.ShiftButtons,{callback:s=>{let l=Math.min(Math.max(p+s,1900),2100);m({modifiedType:"update",year:l,month:n})}})]}),a(C,{borderTop:!0}),S.Month.Months({min:e,max:d,year:i.year,callback:s=>{let[l,u]=s;m({modifiedType:"update",year:l,month:u})}}),a(S.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Months:r=>{let{year:e,callback:d}=r,o=c.Time(),t=[];for(let i=1;i<=12;i++){let m=e==o.year&&i==o.month,p=!1;{let s=Number(String([e,i.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>s&&(p=!0),r.max){let l=Number(String(r.max).replace(/\D/ig,""));s>l&&(p=!0)}}let n=[b("Cell"),m?b("isThisMonth"):""].join(" ");t.push(y(k.Clear,{className:n,isLocked:p,fontColor:"2.normal",padding:["1/3",1],ssEffectsOnActive:"shrink",onClick:()=>{d([e,i])},children:[i," \u6708"]},e+"-"+i))}return a(A,{gridCols:4,gap:"2/3",children:t})}},Year:{index:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:i,set_value:m}=r,{year:p}=i;return y(D,{padding:1,children:[a(I,{emptySelect:!1,paddingRight:1,fontSize:"1.mini",value:p||c.Time().year,override:"force",options:_({min:e,max:d}),onUpdateValidValue:({value:n})=>{m({modifiedType:"update",year:Number(n)})}}),a(S.Variables.Footer,{tipsID:t,onValueUpdate:o,onSubmit:()=>{m({modifiedType:"update",year:Number(p||c.Time().year)})}})]})}},DateWareki:{index:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:i,set_value:m}=r,{era:p,year:n,month:s,date:l}=i,u={val_value:i,set_value:m};return y(C,{children:[y(V.Left,{borderBottom:!0,gap:0,verticalAlign:"unset",children:[a(S.DateWareki.EraSelect,f({},u)),a(C,{borderRight:!0}),a(S.DateWareki.Calendar,f({},u))]}),a(V.Right,{padding:1,children:a(S.Variables.Footer,{tipsID:t,onValueUpdate:o})})]})},EraSelect:r=>{let{val_value:e,set_value:d}=r,o={padding:["1/2",1.5],fontColor:"3.blur"},t={backgroundColor:"cloud",fontColor:"2.normal",isSemiBoldFont:!0};return y(D,{padding:1,gap:0,children:[a(k.Clear,x(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="year",onClick:()=>{let i=c.Time();d({modifiedType:"update",era:"year",year:i.year,month:i.month,date:i.date})},children:"\u897F\u66A6"})),a(k.Clear,x(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="reiwa",onClick:()=>{let i=c.Time();d({modifiedType:"update",era:"reiwa",year:i.year,month:i.month,date:i.date})},children:"\u4EE4\u548C"})),a(k.Clear,x(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="heisei",onClick:()=>{d({modifiedType:"update",era:"heisei",year:2019,month:1,date:1})},children:"\u5E73\u6210"})),a(k.Clear,x(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="shouwa",onClick:()=>{d({modifiedType:"update",era:"shouwa",year:1989,month:1,date:1})},children:"\u662D\u548C"})),a(k.Clear,x(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="taisho",onClick:()=>{d({modifiedType:"update",era:"taisho",year:1926,month:1,date:1})},children:"\u5927\u6B63"})),a(k.Clear,x(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="meiji",onClick:()=>{d({modifiedType:"update",era:"meiji",year:1912,month:1,date:1})},children:"\u660E\u6CBB"}))]})},Calendar:r=>{let{val_value:e,set_value:d}=r,o=[];if(e.era=="year")for(let t=1900;t<2100;t++)o.unshift({value:t,label:t+"\u5E74"});else if(e.era=="reiwa"){let t=c.Time().year-2018;for(let i=1;i<=t+10;i++)o.unshift({value:2019+i-1,label:"\u4EE4\u548C"+(i==1?"\u5143":i)+"\u5E74"})}else if(e.era=="heisei")for(let t=1;t<=31;t++)o.unshift({value:1989+t-1,label:"\u5E73\u6210"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="shouwa")for(let t=1;t<=64;t++)o.unshift({value:1926+t-1,label:"\u662D\u548C"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="taisho")for(let t=1;t<=15;t++)o.unshift({value:1912+t-1,label:"\u5927\u6B63"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="meiji")for(let t=1;t<=45;t++)o.unshift({value:1868+t-1,label:"\u660E\u6CBB"+(t==1?"\u5143":t)+"\u5E74"});return y(D,{padding:1,children:[y(V.Separate,{children:[a(I,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,fontSize:"1.mini",rightIcon:a(w,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),options:o,value:e.year,onUpdateValidValue:({value:t})=>{d(i=>x(f({},i),{modifiedType:"update",year:Number(t)}))}}),y(V.Center,{gap:"1/3",children:[a(I,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,fontSize:"1.mini",rightIcon:a(w,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:e.month,onUpdateValidValue:({value:t})=>{d({modifiedType:"update",era:e.era,year:e.year,month:Number(t),date:1})}}),a(k.Clear.S,{ssSphere:2.5,onClick:()=>{let t=e.month-1;d({modifiedType:"update",era:e.era,year:t==0?e.year-1:e.year,month:t==0?12:t,date:1})},children:a(T.ChevronLeft,{})}),a(k.Clear.S,{ssSphere:2.5,onClick:()=>{let t=e.month+1;d({modifiedType:"update",era:e.era,year:t==13?e.year+1:e.year,month:t==13?1:t,date:1})},children:a(T.ChevronRight,{})})]})]}),a(S.DateWareki.MonthCell,f({},r))]},e.era)},MonthCell:r=>{let{val_value:e,set_value:d}=r,o=c.Time([e.year.zeroEmbed(4),e.month.zeroEmbed(2),e.date.zeroEmbed(2)].join("/"));if(!o.validate)return;let t=o.getFirstDayOfTheMonth().weekday,i=o.getLastDayOfTheMonth(),m=[];for(let n=0;n<7;n++)m.push(a(H.Supplement,{flexCenter:!0,fontColor:n==0?"googleRed":n==6?"googleBlue":"3.blur",children:c.transformer.weekday.shortJP(n)},"legend-"+n));for(let n=0;n<t;n++){let s=c.Time(o).getFirstDayOfTheMonth().addDate(n-t);m.push(a(k.Sub,{color:"cloud",ssSquare:3,opacity:"middle",onClick:l=>{l.preventDefault(),l.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date},"lastMonth-"+n))}let p=c.Time();for(let n=1;n<=i.date;n++){let s=c.Time(o).setDate(n),l=p.diff(s).dates==0;m.push(a(k.Clear,{ssSquare:3,fontColor:"2.normal",className:[b("CalendarDay"),b("isToday_"+l)].join(" "),onClick:()=>{d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date},"currentMonth-"+n))}for(let n=0;n<7-i.weekday-1;n++){let s=c.Time(o).addMonth(1).setDate(1).addDate(n);m.push(a(k.Sub,{color:"cloud",ssSquare:3,opacity:"middle",onClick:l=>{l.preventDefault(),l.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date},"nextMonth-"+n))}return a(A,{gridCols:7,gap:"1/4",children:m})}},Variables:{Footer:r=>y(R,{flexWrap:!1,gap:1,flexChilds:"even",freeCSS:{whiteSpace:"nowrap"},children:[y(k.Sub.S,{tabIndex:-1,isRounded:!0,onClick:()=>{r.onValueUpdate("")},flexSizing:"none",children:[a(T.Times,{})," \u524A\u9664"]}),a(k.Prime.S,{tabIndex:-1,isRounded:!0,flexSizing:"auto",freeCSS:{minWidth:12*6},onClick:()=>{r.onSubmit&&r.onSubmit(),G.close(r.tipsID)},children:"\u6C7A\u5B9A"})]}),ShiftButtons:r=>y(R,{gap:"1/3",flexWrap:!1,children:[a(k.Clear,x(f({className:b("LeftButton"),tabIndex:-1,right:0},S.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(-1)},children:a(T.ChevronLeft,{})})),a(k.Clear,x(f({className:b("RightButton"),tabIndex:-1,left:0},S.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(1)},children:a(T.ChevronRight,{})}))]}),ShiftButtonStyles:{position:"relative",flexCenter:!0,ssSphere:2.5}}};export{j as Picker,j as default};
1
+ import{b as h,c as x}from"../../../chunk-C5N2D3ZX.js";import{Fragment as q,jsx as a,jsxs as f}from"react/jsx-runtime";import{createElement as X}from"react";import D,{UUID as O,Time as S}from"jmini";import{useState as A,useEffect as F,useRef as H}from"react";import{Box as C,Flex as w,Grid as _,FAI as T,Column as V}from"../../../atoms";import{Row as N,Text as G}from"../../../mols";import{Button as k}from"../../Button";import $ from"../../Tooltips";import M from"../Select";import{Radio as j}from"../List";import{RightIcon as B}from"..";import{InputTimeClasses as y}from"../../../@styles/componentClasses";let E=i=>{var t,r;let e=[],d=Number((t=i==null?void 0:i.min)!=null?t:1900),o=Number((r=i==null?void 0:i.max)!=null?r:S().addYear(10).year);for(let m=d;m<=o;m++)e.unshift({value:m,label:[m,...D.transformer.wareki(m).value].join(" -")});return e};const L=i=>{let{restrict:e,era:d="year",defaultValue:o=""}=i;i=h({},i),i.tipsID=i.tipsID||O();const t=H(!1);let[r,m]=A((()=>{var n,s;if(e=="clock"){let l=String(o).split(/[^\d]/);l[0]||(l=[0,0]);let u=Number(l[0]),c=Number(l[1]);return{modifiedType:"init",hour:u,minutes:c}}else if(e=="date"){let[l,u,c]=(n=String(o))==null?void 0:n.split(/\D/);return(D.is.nullish(l)||D.is.nullish(u)||D.is.nullish(c))&&([l,u,c]=S().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",year:Number(l),month:Number(u),date:Number(c)}}else if(e!="week"){if(e=="month"){let[l,u]=String(o).split(/\D/);return(D.is.nullish(l)||D.is.nullish(u))&&([l,u]=S().toFormat("%Y-%M").split("-")),{modifiedType:"init",year:Number(l),month:Number(u)}}else if(e=="year"){let[l]=String(o).split(/\D/);return D.is.nullish(l)&&([l]=S().toFormat("%Y").split("-")),{modifiedType:"init",year:Number(l)}}else if(e=="dateWareki"){let[l,u,c]=(s=String(o))==null?void 0:s.split(/\D/);return(D.is.nullish(l)||D.is.nullish(u)||D.is.nullish(c))&&([l,u,c]=S().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",era:d||"year",year:Number(l),month:Number(u),date:Number(c)}}}return{}})());F(()=>{if(t.current){if(r.modifiedType=="update"){let n="",s=d||"year";if(e=="clock"){let{hour:l,minutes:u}=r;n=[l.zeroEmbed(2),u.zeroEmbed(2)].join("/")}else if(e=="date"){let{year:l,month:u,date:c}=r;n=[l,u.zeroEmbed(2),c.zeroEmbed(2)].join("/")}else if(e!="week"){if(e=="month"){let{year:l,month:u}=r;n=[l,u.zeroEmbed(2)].join("/")}else if(e=="year"){let{year:l}=r;n=String(l)}else if(e=="dateWareki"){let{year:l,month:u,date:c,era:v}=r;s=v,n=[l,u.zeroEmbed(2),c.zeroEmbed(2)].join("/")}}i.onValueUpdate(n,s)}}else t.current=!0},[r]);let p=x(h({},i),{val_value:r,set_value:m});return a(C,{backgroundColor:"layer.1",borderRadius:"2.tone.secondary",boxShadow:"1.remark",border:!0,overflow:"hidden",children:a(C,{overflow:"auto",className:y(e.toCapital()+"Base"),children:e=="clock"?a(g.Clock.index,h({},p)):e=="date"?a(g.Date.index,h({},p)):e=="week"?"":e=="month"?a(g.Month.index,h({},p)):e=="year"?a(g.Year.index,h({},p)):e=="dates"||e=="months"?"":e=="dateWareki"?a(g.DateWareki.index,h({},p)):a(q,{})})})},g={Clock:{index:i=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:r,set_value:m}=i,[p,n]=A(r.hour>12?2:1),[s,l]=A(Number(localStorage.getItem("timePickerUnit")||5));F(()=>{localStorage.setItem("timePickerUnit",String(s))},[s]);let{hour:u,minutes:c}=r;return f(V,{padding:1,children:[f(w,{flexType:"row",flexWrap:!1,gap:1,className:y("Body"),children:[f(V,{className:y("DesignSide"),flexSizing:0,children:[a(C,{className:y("ClockUiBase"),padding:[1,"2/3"],flexCenter:!0,children:f(C,{className:y("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[a(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[y("Needle"),y("hour")].join(" "),freeCSS:{transform:`rotate(${u*30+c/2}deg)`}}),a(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[y("Needle"),y("minute")].join(" "),freeCSS:{transform:`rotate(${c*6}deg)`}})]})}),a(j,{icon:!0,value:[p],options:[{value:1,label:"AM"},{value:2,label:"PM"}],flexType:"col",gap:0,tabIndex:-1,onUpdateValidValue:({value:v})=>{let I=r.hour%12+(v==2?12:0);n(v),m({modifiedType:"update",hour:I,minutes:r.minutes})}}),a(C,{borderTop:!0,margin:[0,1]}),a(j,{icon:!0,value:[s],options:[{value:1,label:"/ 1\u5206"},{value:2,label:"/ 2\u5206"},{value:5,label:"/ 5\u5206"}],flexType:"col",gap:0,tabIndex:-1,onUpdateValidValue:({value:v})=>{l(v)}})]}),f(V,{children:[f(C,{flexCenter:!0,isSemiBoldFont:!0,fontSize:"3.paragraph",children:[r.hour.zeroEmbed(2)," : ",r.minutes.zeroEmbed(2)]}),f(w,{flexWrap:!1,ssCardBox:!0,flexChilds:"even",padding:["1/3",0],freeCSS:{minWidth:12*12},children:[a(V,{gap:0,overflow:"auto",padding:"2/3",borderRight:!0,freeCSS:{maxHeight:12*22},children:g.Clock.Hours({onClick:v=>{let R=v+(p==2?12:0);m({modifiedType:"update",hour:R,minutes:r.minutes})},min:e,max:d,ampm:p})}),a(V,{gap:0,overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*22},children:g.Clock.Minutes({onClick:v=>{m({modifiedType:"update",hour:r.hour,minutes:v})},min:e,max:d,unit:s})})]})]})]}),a(g.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Hours:i=>{let e=[];for(let d=0;d<12;d++){let o=i.ampm==2?d+12:d,t=!1;{let r=Number(String(o*100).replace(/\D/ig,""));if(i.min&&Number(String(i.min).replace(/\D/ig,""))>r&&(t=!0),i.max){let m=Number(String(i.max).replace(/\D/ig,""));r>m&&(t=!0)}}e.push(a(k.Normal,{isLocked:t,borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{i.onClick(d)},children:o.zeroEmbed(2)},d))}return e},Minutes:i=>{let e=[];for(let d=0;d<60/i.unit;d++){let o=d*i.unit;e.push(a(k.Normal,{borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{i.onClick(o)},children:o.zeroEmbed(2)},o))}return e}},Date:{index:i=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:r,set_value:m}=i,{year:p,month:n,date:s}=r;return f(V,{padding:1,children:[f(N.Separate,{flexWrap:!0,children:[f(w,{verticalAlign:"bottom",horizontalAlign:"left",gap:"2/3",flexWrap:!1,children:[a(M,{override:"force",emptySelect:!1,value:p,options:E(),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:Number(l),month:n,date:s})},rightIcon:a(B,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})})}),a(M,{override:"force",emptySelect:!1,value:n,options:(()=>{let l=[];for(let u=1;u<=12;u++)l.push({value:u,label:String(u)+"\u6708"});return l})(),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,rightIcon:a(B,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:p,month:Number(l),date:s})}})]}),a(g.Variables.ShiftButtons,{callback:l=>{let u=n+l,c=p;u<=0&&(c--,u=12),u>12&&(c++,u=1),m({modifiedType:"update",year:c,month:u,date:r.date})}})]}),a(C,{borderTop:!0}),a(C,{children:g.Date.MonthCalendar({min:e,max:d,year:r.year,month:r.month,current:[r.year,r.month,r.date],callback:l=>{let[u,c,v]=l;m({modifiedType:"update",year:u,month:c,date:v})}})}),a(g.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},MonthCalendar:i=>{let{min:e,max:d,year:o,month:t,current:r,callback:m}=i,p=S(),n=S([o,t.zeroEmbed(2),"01"].join("/")),s=n.getLastDayOfTheMonth(),l=S(n).addMonth(-1).getLastDayOfTheMonth().date,u=[],c=[],v=[],R=[],I={padding:0,unitWidth:3,unitHeight:3,flexCenter:!0,borderRadius:"3.tone.tertiary"};for(var b=0;b<7;b++)u.push(a(C,x(h({className:[y("CalendarDay"),y("Legend")].join(" ")},I),{children:["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][b]}),b));for(var b=0;b<n.weekday;b++)c.unshift(X(C,x(h({className:[y("CalendarDay"),y("Dummy")].join(" "),fontColor:"4.thin"},I),{key:b}),l-b));for(var b=1;b<=s.date;b++){let W=b,Y=o==p.year&&t==p.month&&b==p.date,P=!1;{let z=Number(String([o,t.zeroEmbed(2),b.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(i.min&&Number(String(i.min).replace(/\D/ig,""))>z&&(P=!0),i.max){let U=Number(String(i.max).replace(/\D/ig,""));z>U&&(P=!0)}}v.push(a(k.Clear,x(h({className:[y("CalendarDay"),y("isToday_"+Y)].join(" ")},I),{fontColor:"1.clear",padding:0,flexCenter:!0,isRounded:!0,ssEffectsOnActive:"shrink",onClick:()=>{m([o,t,W])},tabIndex:-1,isLocked:P,children:b}),W))}for(var b=1;b<7-s.weekday;b++)R.push(a(C,x(h({className:[y("CalendarDay"),y("Dummy")].join(" "),fontColor:"4.thin"},I),{children:b}),b));return f(_,{gridCols:7,gap:"1/6",children:[u,c,v,R]})}},Month:{index:i=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:r,set_value:m}=i,{year:p,month:n}=r;return f(V,{padding:1,children:[f(N.Separate,{gap:0,children:[a(N.Center,{verticalAlign:"bottom",gap:"2/3",children:a(M,{emptySelect:!1,value:p,options:E(),override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIcon:a(B,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),onUpdateValidValue:({value:s})=>{m({modifiedType:"update",year:Number(s),month:n})}})}),a(g.Variables.ShiftButtons,{callback:s=>{let l=Math.min(Math.max(p+s,1900),2100);m({modifiedType:"update",year:l,month:n})}})]}),a(C,{borderTop:!0}),g.Month.Months({min:e,max:d,year:r.year,callback:s=>{let[l,u]=s;m({modifiedType:"update",year:l,month:u})}}),a(g.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Months:i=>{let{year:e,callback:d}=i,o=S(),t=[];for(let r=1;r<=12;r++){let m=e==o.year&&r==o.month,p=!1;{let s=Number(String([e,r.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(i.min&&Number(String(i.min).replace(/\D/ig,""))>s&&(p=!0),i.max){let l=Number(String(i.max).replace(/\D/ig,""));s>l&&(p=!0)}}let n=[y("Cell"),m?y("isThisMonth"):""].join(" ");t.push(f(k.Clear,{className:n,isLocked:p,fontColor:"2.normal",padding:["1/3",1],ssEffectsOnActive:"shrink",onClick:()=>{d([e,r])},children:[r," \u6708"]},e+"-"+r))}return a(_,{gridCols:4,gap:"2/3",children:t})}},Year:{index:i=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:r,set_value:m}=i,{year:p}=r;return f(V,{padding:1,children:[a(M,{emptySelect:!1,paddingRight:1,fontSize:"1.mini",value:p||S().year,override:"force",options:E({min:e,max:d}),onUpdateValidValue:({value:n})=>{m({modifiedType:"update",year:Number(n)})}}),a(g.Variables.Footer,{tipsID:t,onValueUpdate:o,onSubmit:()=>{m({modifiedType:"update",year:Number(p||S().year)})}})]})}},DateWareki:{index:i=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:r,set_value:m}=i,{era:p,year:n,month:s,date:l}=r,u={val_value:r,set_value:m};return f(C,{children:[f(N.Left,{borderBottom:!0,gap:0,verticalAlign:"unset",children:[a(g.DateWareki.EraSelect,h({},u)),a(C,{borderRight:!0}),a(g.DateWareki.Calendar,h({},u))]}),a(N.Right,{padding:1,children:a(g.Variables.Footer,{tipsID:t,onValueUpdate:o})})]})},EraSelect:i=>{let{val_value:e,set_value:d}=i,o={padding:["1/2",1.5],fontColor:"3.blur"},t={backgroundColor:"cloud",fontColor:"2.normal",isSemiBoldFont:!0};return f(V,{padding:1,gap:0,children:[a(k.Clear,x(h({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="year",onClick:()=>{let r=S();d({modifiedType:"update",era:"year",year:r.year,month:r.month,date:r.date})},children:"\u897F\u66A6"})),a(k.Clear,x(h({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="reiwa",onClick:()=>{let r=S();d({modifiedType:"update",era:"reiwa",year:r.year,month:r.month,date:r.date})},children:"\u4EE4\u548C"})),a(k.Clear,x(h({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="heisei",onClick:()=>{d({modifiedType:"update",era:"heisei",year:2019,month:1,date:1})},children:"\u5E73\u6210"})),a(k.Clear,x(h({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="shouwa",onClick:()=>{d({modifiedType:"update",era:"shouwa",year:1989,month:1,date:1})},children:"\u662D\u548C"})),a(k.Clear,x(h({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="taisho",onClick:()=>{d({modifiedType:"update",era:"taisho",year:1926,month:1,date:1})},children:"\u5927\u6B63"})),a(k.Clear,x(h({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="meiji",onClick:()=>{d({modifiedType:"update",era:"meiji",year:1912,month:1,date:1})},children:"\u660E\u6CBB"}))]})},Calendar:i=>{let{val_value:e,set_value:d}=i,o=[];if(e.era=="year")for(let t=1900;t<2100;t++)o.unshift({value:t,label:t+"\u5E74"});else if(e.era=="reiwa"){let t=S().year-2018;for(let r=1;r<=t+10;r++)o.unshift({value:2019+r-1,label:"\u4EE4\u548C"+(r==1?"\u5143":r)+"\u5E74"})}else if(e.era=="heisei")for(let t=1;t<=31;t++)o.unshift({value:1989+t-1,label:"\u5E73\u6210"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="shouwa")for(let t=1;t<=64;t++)o.unshift({value:1926+t-1,label:"\u662D\u548C"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="taisho")for(let t=1;t<=15;t++)o.unshift({value:1912+t-1,label:"\u5927\u6B63"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="meiji")for(let t=1;t<=45;t++)o.unshift({value:1868+t-1,label:"\u660E\u6CBB"+(t==1?"\u5143":t)+"\u5E74"});return f(V,{padding:1,children:[f(N.Separate,{children:[a(M,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,fontSize:"1.mini",rightIcon:a(B,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),options:o,value:e.year,onUpdateValidValue:({value:t})=>{d(r=>x(h({},r),{modifiedType:"update",year:Number(t)}))}}),f(N.Center,{gap:"1/3",children:[a(M,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:1,fontSize:"1.mini",rightIcon:a(B,{ssSphere:2,right:"1/3",children:a(T.AngleDown,{})}),options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:e.month,onUpdateValidValue:({value:t})=>{d({modifiedType:"update",era:e.era,year:e.year,month:Number(t),date:1})}}),a(k.Clear.S,{ssSphere:2.5,onClick:()=>{let t=e.month-1;d({modifiedType:"update",era:e.era,year:t==0?e.year-1:e.year,month:t==0?12:t,date:1})},children:a(T.ChevronLeft,{})}),a(k.Clear.S,{ssSphere:2.5,onClick:()=>{let t=e.month+1;d({modifiedType:"update",era:e.era,year:t==13?e.year+1:e.year,month:t==13?1:t,date:1})},children:a(T.ChevronRight,{})})]})]}),a(g.DateWareki.MonthCell,h({},i))]},e.era)},MonthCell:i=>{let{val_value:e,set_value:d}=i,o=S([e.year.zeroEmbed(4),e.month.zeroEmbed(2),e.date.zeroEmbed(2)].join("/"));if(!o.validate)return;let t=o.getFirstDayOfTheMonth().weekday,r=o.getLastDayOfTheMonth(),m=[];for(let n=0;n<7;n++)m.push(a(G.Supplement,{flexCenter:!0,fontColor:n==0?"googleRed":n==6?"googleBlue":"3.blur",children:D.transformer.weekday.shortJP(n)},"legend-"+n));for(let n=0;n<t;n++){let s=S(o).getFirstDayOfTheMonth().addDate(n-t);m.push(a(k.Sub,{color:"cloud",ssSquare:3,opacity:"middle",onClick:l=>{l.preventDefault(),l.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date},"lastMonth-"+n))}let p=S();for(let n=1;n<=r.date;n++){let s=S(o).setDate(n),l=p.diff(s).dates==0;m.push(a(k.Clear,{ssSquare:3,fontColor:"2.normal",className:[y("CalendarDay"),y("isToday_"+l)].join(" "),onClick:()=>{d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date},"currentMonth-"+n))}for(let n=0;n<7-r.weekday-1;n++){let s=S(o).addMonth(1).setDate(1).addDate(n);m.push(a(k.Sub,{color:"cloud",ssSquare:3,opacity:"middle",onClick:l=>{l.preventDefault(),l.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date},"nextMonth-"+n))}return a(_,{gridCols:7,gap:"1/4",children:m})}},Variables:{Footer:i=>f(w,{flexWrap:!1,gap:1,flexChilds:"even",freeCSS:{whiteSpace:"nowrap"},children:[f(k.Sub.S,{tabIndex:-1,isRounded:!0,onClick:()=>{i.onValueUpdate("")},flexSizing:"none",children:[a(T.Times,{})," \u524A\u9664"]}),a(k.Prime.S,{tabIndex:-1,isRounded:!0,flexSizing:"auto",freeCSS:{minWidth:12*6},onClick:()=>{i.onSubmit&&i.onSubmit(),$.close(i.tipsID)},children:"\u6C7A\u5B9A"})]}),ShiftButtons:i=>f(w,{gap:"1/3",flexWrap:!1,children:[a(k.Clear,x(h({className:y("LeftButton"),tabIndex:-1,right:0},g.Variables.ShiftButtonStyles),{onClick:()=>{i.callback(-1)},children:a(T.ChevronLeft,{})})),a(k.Clear,x(h({className:y("RightButton"),tabIndex:-1,left:0},g.Variables.ShiftButtonStyles),{onClick:()=>{i.callback(1)},children:a(T.ChevronRight,{})}))]}),ShiftButtonStyles:{position:"relative",flexCenter:!0,ssSphere:2.5}}};export{L as Picker,L as default};
@@ -75,13 +75,13 @@ declare namespace Time {
75
75
  };
76
76
  type Range = TimeTypes.Range;
77
77
  type WrapperStates = {
78
- rootStates: Time.Origin;
78
+ rootStates: Origin;
79
79
  val_status: InputTypes.Status.Time;
80
80
  set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Time>>;
81
81
  val_validate: InputTypes.Validation.Result;
82
82
  set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
83
- val_era: Time.Era;
84
- set_era: React.Dispatch<React.SetStateAction<Time.Era>>;
83
+ val_era: Era;
84
+ set_era: React.Dispatch<React.SetStateAction<Era>>;
85
85
  val_focus: TimeTypes.Focus;
86
86
  set_focus: React.Dispatch<React.SetStateAction<TimeTypes.Focus>>;
87
87
  };
@@ -1 +1 @@
1
- import{a as te,b as s,c as k,d as q}from"../../../chunk-C5N2D3ZX.js";import{Fragment as we,jsx as y,jsxs as oe}from"react/jsx-runtime";import N,{UUID as W}from"@mingoo/jsmin";import{useState as C,useEffect as G,useRef as pe}from"react";import{$$fromRoot as ce,Config as ae,useStore as L,ExtractStyles as ue}from"../../../@utils";import{Box as J,FAI as fe}from"../../../atoms";import{Text as de}from"../../../mols";import{Button as re}from"../../Button";import ie 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 H,DefaultBoxishStyles as De}from"../core";import{RightIcon as Ie}from"..";import Te from"../Select";import{InputLabel as Se}from"../Label";import xe from"./Picker";const F=" ~ ",be={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}},P={PeriodMargin:" ~ ",DataLeveling:e=>{let{restrict:t,value:v,era:r}=e,d=N.flatArray(v||""),{defaultValue:h,format:I,ranges:u,sets:a}=be[t],m=[],n=t=="clock"?":":"/";for(let i=0;i<d.length;i++)d[i]=String(d[i]).replace(/\D/ig,n);for(let i=0;i<a;i++){let f=d[i]||"";if(!f.match(I))d[i]="",m.push(h);else{let b=h;f.split(/\D/).forEach((E,V)=>{if(V==0&&t=="dateWareki"){let T=Number(E);r!="year"&&(T>=2019?r=="reiwa"?T-=2018:r=="heisei"&&(T=31):T>=1989?r=="heisei"?T-=1988:r=="shouwa"&&(T=64):T>=1926?r=="shouwa"?T-=1925:r=="taisho"&&(T=15):T>=1912?r=="taisho"?T-=1911:r=="meiji"&&(T=45):T>=1868&&(T-=1867)),E=T.zeroEmbed(4)}b=b.replace(new RegExp("------------------".slice(0,E.length)),E)}),m.push(b)}}return{formatValue:m.join(F),dataValue:["dates","months"].includes(t)?d:d[0],ranges:u}},SystemValidation:e=>{let{states:t}=e,{restrict:v,min:r,max:d,required:h}=t,I=[],u=N.flatArray(e.value),a={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let m=v=="clock"?":":"/";for(let n=0;n<u.length;n++)u[n]=String(u[n]).replace(/\D/ig,m);for(let n=0;n<u.length;n++){let i=u[n],f=u[n-1];i.removeLetters()||(a.empty=!0),n>0&&(a.escalated&=+(i>=f))}a.escalated&&(a.empty||(v.match(/clock/)?u.forEach(n=>{let[i,f]=n.split(/\D+/);!i||!f?a.filled=!1:(Number(i)>23||Number(f)>59)&&(a.correct=!1)}):v.match(/date/)?u.forEach(n=>{let[i,f,b]=n.split(/\D+/);if(!i||!f||!b)a.filled=!1;else{let E=N.Time(n);(!E.validate||n!=E.toFormatYMD())&&(a.correct=!1)}}):v.match(/week/)?u.forEach(n=>{let[i,f]=n.split(/\D+/);if(!i||!f)a.filled=!1;else{let b=N.Time(i+"/01/01").weekday,V=N.Time(i+"/01/0"+(7-b+1)).addWeek(Number(f)-1);i!=String(V.year)&&(a.correct=!1)}}):v.match(/month/)?u.forEach(n=>{let[i,f]=n.split(/\D+/);!i||!f?a.filled=!1:N.Time([i,f,"01"].join("/")).validate||(a.correct=!1)}):v.match(/year/),a.filled&&a.correct&&u.forEach(n=>{{let i=Number(String(n).replace(/\D/ig,""));if(r&&Number(String(r).replace(/\D/ig,""))>i&&(a.prohibited=!0),d){let f=Number(String(d).replace(/\D/ig,""));i>f&&(a.prohibited=!0)}}})))})();{let{empty:m,escalated:n,filled:i,correct:f,prohibited:b}=a;m&&h&&(I=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),n||I.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),f||I.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),i||I.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),b&&I.push({type:"invalid",label:oe(we,{children:[y(J,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",r||"\u4E0B\u9650\u7121\u3057","] ~ [",d||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!I.filter(({type:m})=>m=="invalid").length,notice:I}},KeyDownEvent:e=>{let{val_era:t,restrict:v,event:r,val_status:d,set_status:h,val_focus:I,set_focus:u}=e,{key:a,shiftKey:m,ctrlKey:n,metaKey:i}=r,f=n||i,{selectionStart:b,selectionEnd:E}=r.target,{index:V,prevIndex:T}=I,{ranges:$,formatValue:z}=d,_=$.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(a)){let D=0;if(a=="Tab"){let l=+!m*2-1;if(D=I.index+l,D<0||D>_)return}else{let l=a=="ArrowLeft"?-1:a=="ArrowRight"?1:0;f||b==0&&E==String(d.formatValue).length?D=l==1?_:0:D=Math.max(0,Math.min(V+l,_))}u(l=>k(s({},l),{index:D,prevIndex:V})),r.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(a)){r.preventDefault();let D=V;D=Math.max(D,0),D=Math.min(D,_);let{type:l,from:j,length:Y}=$[D],A=z.slice(j,j+Y),c;if(a=="Backspace")c="------".slice(0,Y);else if(["ArrowUp","ArrowDown"].includes(a)){let w=a=="ArrowUp"?1:-1;A=A|0,c=A+w;let[o,p,x]=l=="dateWareki"?t=="year"?[0,2999,4]:t=="reiwa"?[1,2999,4]:t=="heisei"?[1,31,4]:t=="shouwa"?[1,64,4]:t=="taisho"?[1,15,4]:t=="meiji"?[1,45,4]:[0,0,0]:l=="minute"?[0,59,2]:l=="hour"?[0,23,2]:l=="date"?[1,31,2]:l=="week"?[1,53,2]:l=="month"?[1,12,2]:l=="year"?[0,2999,4]:[0,0,0];c>p?c=o:c<o&&(c=p),c=Number(c).zeroEmbed(x)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(a)){let w=A|0,o=a,p=`${w}${o}`;if(T!=V&&(w=0,p="0"+o),l=="year"||l=="dateWareki"&&t=="year")Number(p)>1e4?c=o:c=p,(c|0)>1e3&&D++;else if(["hour","minute","date","week","month"].includes(l)||l=="dateWareki"&&t!="year"){let x=l=="dateWareki"?t=="reiwa"?100:t=="heisei"?31:t=="shouwa"?64:t=="taisho"?15:t=="meiji"?45:0:l=="minute"?59:l=="hour"?23:l=="date"?31:l=="week"?53:l=="month"?12:0;c=(p|0)>x?o:p,(Number(o)>Number(String(x)[0])||A=="0000".slice(0,String(x).length)&&(p!="0000".slice(0,String(x).length)||["minute","hour"].includes(l)&&T==V)||(p|0)>=te(10,String(x).length-1))&&D++}l=="year"||l=="dateWareki"?c=(c|0).zeroEmbed(4):c=(c|0).zeroEmbed(2)}{let w=String(z).partReplace(j,String(c)),o=w.split(F).map(p=>p.replace(/(^\D|\D$)/,"").split(/\D+/).join(v=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(v=="dateWareki"){let p=o[0].split(/\D/),[x,K,O]=p;p.length==3&&x&&(o=[[Number(x)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[t]),K,O].join("/")])}D=Math.max(D,0),D=Math.min(D,_),h(p=>k(s({},p),{dataValue:["dates","months"].includes(v)?o:o[0],formatValue:w,eventType:"update",eventID:W()})),u(p=>k(s({},p),{index:D,prevIndex:p.index}))}}}},ne={picker:{launch:e=>{let t=e.tipsID||W(),m=e,{onValueUpdate:v,min:r,max:d,era:h,restrict:I,defaultValue:u}=m,a=q(m,["onValueUpdate","min","max","era","restrict","defaultValue"]);ie.open(k(s({gravityPoint:e.gravityPoint||24,tipsID:t,padding:0,closeAtAroundClick:!0,closeAtParentBlur:!1},a),{parent:a.parent,content:y(xe,{restrict:I,min:r,max:d,era:h,defaultValue:u,tipsID:t,onValueUpdate:(n,i)=>{v(n,i)}})}))},remove:e=>{ie.close(e)}}},ke={Shallow:e=>{let{rootStates:t,val_status:v}=e,r=ue(t);return y(J,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:y(de.Description,k(s({className:t.className},r),{position:"absolute",width:1,freeCSS:k(s({},r.freeCSS),{color:"orange"}),children:y(J,{"data-input-value-shallow":v.componentID,children:"A"})}))})}},Ee=e=>{let Z=e,{tone:t,required:v,restrict:r="clock",componentID:d,era:h,form:I,name:u,min:a,max:m,className:n,enableFormSubmit:i,checkValidationAtFirst:f,onKeyDown:b,onValidate:E,onUpdateValue:V,onUpdateValidValue:T,value:$="",leftIndicator:z,rightIndicator:_,leftIcon:D,rightIcon:l,freeCSS:j,wrapStyles:Y}=Z,A=q(Z,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","freeCSS","wrapStyles"]),[c,w]=C(h),[o,p]=C(k(s({componentID:e.componentID||""},P.DataLeveling({restrict:r,value:$,era:c})),{eventType:"init",eventID:W()})),[x,K]=C({ok:!1,notice:[]}),[O,U]=C({active:!1,index:0,prevIndex:-1}),le={rootStates:e,val_status:o,set_status:p,val_validate:x,set_validate:K,val_era:c,set_era:w,val_focus:O,set_focus:U};H.CommonEffects({type:"time",states:e,val_status:o,set_status:p,val_validate:x,set_validate:K,SystemValidation:P.SystemValidation,ExtraOverrideStates:s({},P.DataLeveling({restrict:r,value:$,era:c}))});const Q=pe(!1);return G(()=>{if(Q.current){p(S=>s(s({},S),P.DataLeveling({restrict:r,value:S.dataValue,era:c})));let g=L.get("refreshEra_"+o.componentID);g&&g.refreshEra(c)}else Q.current=!0},[c]),L.update({[o.componentID]:{openPicker:()=>{e.disabled||ne.picker.launch({parent:"#Picker-"+o.componentID,tipsID:"PickerTips-"+o.componentID,restrict:r,min:a,max:m,defaultValue:o.dataValue,era:c,onValueUpdate:(g,S)=>{p(M=>k(s(s({},M),P.DataLeveling({restrict:r,value:g,era:S})),{eventType:"update",eventID:W()})),w(S)}})},resetEra:g=>{w(g),p(S=>k(s(s({},S),P.DataLeveling({restrict:r,value:"",era:c})),{eventType:"update",eventID:W()}))}}}),G(()=>{let{index:g,active:S}=O;if(S){g=Math.max(g,0),g=Math.min(g,o.ranges.length-1);let{from:M,length:B}=o.ranges[g],X=ce("#"+e.id)[0];X&&X.setSelectionRange(M,M+B)}},[O]),oe(ve,{val_status:o,set_status:p,val_validate:x,states:e,children:[y(ke.Shallow,s({},le)),y(Se,{componentID:e.componentID,fontSize:e.fontSize,required:e.required,label:e.label,isActive:!0}),ae.get().isTouchDevice?y(re.Plain,{"data-show-validation":H.isShowValidation(x,o,!!f),"data-component-id":o.componentID,className:n,freeCSS:{textAlign:"left"},children:o.formatValue,onClick:g=>{let S=L.get(o.componentID);S&&S.openPicker(),g.stopPropagation()}}):y(J,s({htmlTag:"input",type:"text",inputMode:"numeric","data-show-validation":H.isShowValidation(x,o,!!f),"data-input-origin":o.componentID,"data-disabled":e.disabled,value:o.formatValue,className:n,tabIndex:ae.get().isTouchDevice?-1:0,onKeyDown:g=>{P.KeyDownEvent({restrict:r,event:g,val_era:c,val_status:o,set_status:p,val_focus:O,set_focus:U}),b&&b(g),i&&H.SubmitForm(g,I)},onKeyUp:g=>{g.key=="Tab"&&U(S=>k(s({},S),{active:!0}))},onClick:g=>{let S=g.target.selectionEnd,M=0;o.ranges.forEach((B,X)=>{let{from:ee,length:se,region:me}=B;ee<=S&&S<=ee+(me||se)&&(M=X)}),U(B=>k(s({},B),{active:!0,index:M})),g.preventDefault()},onChange:()=>{}},A))]})},R={Origin:e=>{let t=s({},e),[v]=C(e.componentID||W());if(t.componentID=v,N.is.nullish(t.rightIcon)){let r=(e.restrict||"").match(/clock/)?he:ge;t.rightIcon=y(Ie,{ssSphere:2,freeCSS:{pointerEvents:"all"},children:y(re.Sub,{color:"cloud",border:"unset",ssSphere:2,fontColor:"theme",boxShadow:"0.normal",borderRadius:"3.tone.tertiary",flexCenter:!0,ssEffectsOnActive:"push",tabIndex:-1,id:"Picker-"+t.componentID,onClick:()=>{let d=L.get(t.componentID);d&&d.openPicker()},children:y(fe,{icon:r})})})}return y(ye,{componentID:t.componentID,children:Ee,states:De(t)})},Clock:e=>y(R.Origin,s({restrict:"clock",era:"clock"},e)),Date:e=>y(R.Origin,s({restrict:"date"},e)),Week:e=>y(R.Origin,s({restrict:"week"},e)),Month:e=>y(R.Origin,s({restrict:"month"},e)),Year:e=>y(R.Origin,s({restrict:"year"},e)),DateWareki:e=>{e=s({},e);let[t]=C(e.componentID||W());e.componentID=t;let{defaultEra:v="wareki"}=e,[r,d]=C((()=>{let h="year";if(v=="wareki"&&(h="reiwa",e.value)){let[I,u,a]=e.value.split(/\D/);if(I&&u&&a){let m=Number(I);m>=2019?(m-=2019,h="reiwa"):m>=1989?(m-=1989,h="heisei"):m>=1926?(m-=1926,h="shouwa"):m>=1912?(m-=1912,h="taisho"):m>=1868&&(m-=1868,h="meiji"),m+=1}}return h})());return G(()=>{L.set({["refreshEra_"+t]:{refreshEra:h=>{d(h)}}})},[]),y(R.Origin,k(s({restrict:"dateWareki",leftIndicator:y(Te,{label:"\u5143\u53F7",emptySelect:!1,value:r,tone:e.tone||"border",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:h,eventType:I})=>{d(h);let u=L.get(e.componentID);u&&u.resetEra&&u.resetEra(h)}})},e),{era:r}))},Periods:{Date:e=>y(R.Origin,s({restrict:"dates"},e)),Month:e=>y(R.Origin,s({restrict:"months"},e))},fn:ne};export{R as Time,R as default};
1
+ import{a as ae,b as s,c as k,d as q}from"../../../chunk-C5N2D3ZX.js";import{Fragment as Ve,jsx as y,jsxs as le}from"react/jsx-runtime";import G,{UUID as N}from"jmini";import*as K from"jmini";import{useState as W,useEffect as Q,useRef as ce}from"react";import{$$fromRoot as ue,Config as re,useStore as O,ExtractStyles as fe}from"../../../@utils";import{Box as X,FAI as de}from"../../../atoms";import{Text as he}from"../../../mols";import{Button as ie}from"../../Button";import ne from"../../Tooltips";import{faClock as ge}from"@fortawesome/free-solid-svg-icons/faClock";import{faCalendarAlt as ye}from"@fortawesome/free-solid-svg-icons/faCalendarAlt";import{OptionalInputWrapper as ve,BoxWrapper as De,CoreEffects as H,DefaultBoxishStyles as Ie}from"../core";import{RightIcon as Se}from"..";import Te from"../Select";import{InputLabel as xe}from"../Label";import be from"./Picker";const C=" ~ ",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+C.length,length:4},{type:"month",from:15+C.length,length:2},{type:"date",from:18+C.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+C.length,length:4},{type:"month",from:13+C.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}},F={PeriodMargin:" ~ ",DataLeveling:e=>{let{restrict:t,value:v,era:r}=e,d=G.flatArray(v||""),{defaultValue:h,format:I,ranges:u,sets:a}=ke[t],m=[],n=t=="clock"?":":"/";for(let i=0;i<d.length;i++)d[i]=String(d[i]).replace(/\D/ig,n);for(let i=0;i<a;i++){let f=d[i]||"";if(!f.match(I))d[i]="",m.push(h);else{let b=h;f.split(/\D/).forEach((E,V)=>{if(V==0&&t=="dateWareki"){let S=Number(E);r!="year"&&(S>=2019?r=="reiwa"?S-=2018:r=="heisei"&&(S=31):S>=1989?r=="heisei"?S-=1988:r=="shouwa"&&(S=64):S>=1926?r=="shouwa"?S-=1925:r=="taisho"&&(S=15):S>=1912?r=="taisho"?S-=1911:r=="meiji"&&(S=45):S>=1868&&(S-=1867)),E=S.zeroEmbed(4)}b=b.replace(new RegExp("------------------".slice(0,E.length)),E)}),m.push(b)}}return{formatValue:m.join(C),dataValue:["dates","months"].includes(t)?d:d[0],ranges:u}},SystemValidation:e=>{let{states:t}=e,{restrict:v,min:r,max:d,required:h}=t,I=[],u=G.flatArray(e.value),a={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let m=v=="clock"?":":"/";for(let n=0;n<u.length;n++)u[n]=String(u[n]).replace(/\D/ig,m);for(let n=0;n<u.length;n++){let i=u[n],f=u[n-1];i.removeLetters()||(a.empty=!0),n>0&&(a.escalated&=+(i>=f))}a.escalated&&(a.empty||(v.match(/clock/)?u.forEach(n=>{let[i,f]=n.split(/\D+/);!i||!f?a.filled=!1:(Number(i)>23||Number(f)>59)&&(a.correct=!1)}):v.match(/date/)?u.forEach(n=>{let[i,f,b]=n.split(/\D+/);if(!i||!f||!b)a.filled=!1;else{let E=K.Time(n);(!E.validate||n!=E.toFormatYMD())&&(a.correct=!1)}}):v.match(/week/)?u.forEach(n=>{let[i,f]=n.split(/\D+/);if(!i||!f)a.filled=!1;else{let b=K.Time(i+"/01/01").weekday,V=K.Time(i+"/01/0"+(7-b+1)).addWeek(Number(f)-1);i!=String(V.year)&&(a.correct=!1)}}):v.match(/month/)?u.forEach(n=>{let[i,f]=n.split(/\D+/);!i||!f?a.filled=!1:K.Time([i,f,"01"].join("/")).validate||(a.correct=!1)}):v.match(/year/),a.filled&&a.correct&&u.forEach(n=>{{let i=Number(String(n).replace(/\D/ig,""));if(r&&Number(String(r).replace(/\D/ig,""))>i&&(a.prohibited=!0),d){let f=Number(String(d).replace(/\D/ig,""));i>f&&(a.prohibited=!0)}}})))})();{let{empty:m,escalated:n,filled:i,correct:f,prohibited:b}=a;m&&h&&(I=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),n||I.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),f||I.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),i||I.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),b&&I.push({type:"invalid",label:le(Ve,{children:[y(X,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",r||"\u4E0B\u9650\u7121\u3057","] ~ [",d||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!I.filter(({type:m})=>m=="invalid").length,notice:I}},KeyDownEvent:e=>{let{val_era:t,restrict:v,event:r,val_status:d,set_status:h,val_focus:I,set_focus:u}=e,{key:a,shiftKey:m,ctrlKey:n,metaKey:i}=r,f=n||i,{selectionStart:b,selectionEnd:E}=r.target,{index:V,prevIndex:S}=I,{ranges:L,formatValue:z}=d,_=L.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(a)){let D=0;if(a=="Tab"){let l=+!m*2-1;if(D=I.index+l,D<0||D>_)return}else{let l=a=="ArrowLeft"?-1:a=="ArrowRight"?1:0;f||b==0&&E==String(d.formatValue).length?D=l==1?_:0:D=Math.max(0,Math.min(V+l,_))}u(l=>k(s({},l),{index:D,prevIndex:V})),r.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(a)){r.preventDefault();let D=V;D=Math.max(D,0),D=Math.min(D,_);let{type:l,from:B,length:Y}=L[D],A=z.slice(B,B+Y),c;if(a=="Backspace")c="------".slice(0,Y);else if(["ArrowUp","ArrowDown"].includes(a)){let w=a=="ArrowUp"?1:-1;A=A|0,c=A+w;let[o,p,x]=l=="dateWareki"?t=="year"?[0,2999,4]:t=="reiwa"?[1,2999,4]:t=="heisei"?[1,31,4]:t=="shouwa"?[1,64,4]:t=="taisho"?[1,15,4]:t=="meiji"?[1,45,4]:[0,0,0]:l=="minute"?[0,59,2]:l=="hour"?[0,23,2]:l=="date"?[1,31,2]:l=="week"?[1,53,2]:l=="month"?[1,12,2]:l=="year"?[0,2999,4]:[0,0,0];c>p?c=o:c<o&&(c=p),c=Number(c).zeroEmbed(x)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(a)){let w=A|0,o=a,p=`${w}${o}`;if(S!=V&&(w=0,p="0"+o),l=="year"||l=="dateWareki"&&t=="year")Number(p)>1e4?c=o:c=p,(c|0)>1e3&&D++;else if(["hour","minute","date","week","month"].includes(l)||l=="dateWareki"&&t!="year"){let x=l=="dateWareki"?t=="reiwa"?100:t=="heisei"?31:t=="shouwa"?64:t=="taisho"?15:t=="meiji"?45:0:l=="minute"?59:l=="hour"?23:l=="date"?31:l=="week"?53:l=="month"?12:0;c=(p|0)>x?o:p,(Number(o)>Number(String(x)[0])||A=="0000".slice(0,String(x).length)&&(p!="0000".slice(0,String(x).length)||["minute","hour"].includes(l)&&S==V)||(p|0)>=ae(10,String(x).length-1))&&D++}l=="year"||l=="dateWareki"?c=(c|0).zeroEmbed(4):c=(c|0).zeroEmbed(2)}{let w=String(z).partReplace(B,String(c)),o=w.split(C).map(p=>p.replace(/(^\D|\D$)/,"").split(/\D+/).join(v=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(v=="dateWareki"){let p=o[0].split(/\D/),[x,j,P]=p;p.length==3&&x&&(o=[[Number(x)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[t]),j,P].join("/")])}D=Math.max(D,0),D=Math.min(D,_),h(p=>k(s({},p),{dataValue:["dates","months"].includes(v)?o:o[0],formatValue:w,eventType:"update",eventID:N()})),u(p=>k(s({},p),{index:D,prevIndex:p.index}))}}}},oe={picker:{launch:e=>{let t=e.tipsID||N(),m=e,{onValueUpdate:v,min:r,max:d,era:h,restrict:I,defaultValue:u}=m,a=q(m,["onValueUpdate","min","max","era","restrict","defaultValue"]);ne.open(k(s({gravityPoint:e.gravityPoint||24,tipsID:t,padding:0,closeAtAroundClick:!0,closeAtParentBlur:!1},a),{parent:a.parent,content:y(be,{restrict:I,min:r,max:d,era:h,defaultValue:u,tipsID:t,onValueUpdate:(n,i)=>{v(n,i)}})}))},remove:e=>{ne.close(e)}}},Ee={Shallow:e=>{let{rootStates:t,val_status:v}=e,r=fe(t);return y(X,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:y(he.Description,k(s({className:t.className},r),{position:"absolute",width:1,freeCSS:k(s({},r.freeCSS),{color:"orange"}),children:y(X,{"data-input-value-shallow":v.componentID,children:"A"})}))})}},we=e=>{let ee=e,{tone:t,required:v,restrict:r="clock",componentID:d,era:h,form:I,name:u,min:a,max:m,className:n,enableFormSubmit:i,checkValidationAtFirst:f,onKeyDown:b,onValidate:E,onUpdateValue:V,onUpdateValidValue:S,value:L="",leftIndicator:z,rightIndicator:_,leftIcon:D,rightIcon:l,freeCSS:B,wrapStyles:Y}=ee,A=q(ee,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","freeCSS","wrapStyles"]),[c,w]=W(h),[o,p]=W(k(s({componentID:e.componentID||""},F.DataLeveling({restrict:r,value:L,era:c})),{eventType:"init",eventID:N()})),[x,j]=W({ok:!1,notice:[]}),[P,$]=W({active:!1,index:0,prevIndex:-1}),se={rootStates:e,val_status:o,set_status:p,val_validate:x,set_validate:j,val_era:c,set_era:w,val_focus:P,set_focus:$};H.CommonEffects({type:"time",states:e,val_status:o,set_status:p,val_validate:x,set_validate:j,SystemValidation:F.SystemValidation,ExtraOverrideStates:s({},F.DataLeveling({restrict:r,value:L,era:c}))});const Z=ce(!1);return Q(()=>{if(Z.current){p(T=>s(s({},T),F.DataLeveling({restrict:r,value:T.dataValue,era:c})));let g=O.get("refreshEra_"+o.componentID);g&&g.refreshEra(c)}else Z.current=!0},[c]),O.update({[o.componentID]:{openPicker:()=>{e.disabled||oe.picker.launch({parent:"#Picker-"+o.componentID,tipsID:"PickerTips-"+o.componentID,restrict:r,min:a,max:m,defaultValue:o.dataValue,era:c,onValueUpdate:(g,T)=>{p(M=>k(s(s({},M),F.DataLeveling({restrict:r,value:g,era:T})),{eventType:"update",eventID:N()})),w(T)}})},resetEra:g=>{w(g),p(T=>k(s(s({},T),F.DataLeveling({restrict:r,value:"",era:c})),{eventType:"update",eventID:N()}))}}}),Q(()=>{let{index:g,active:T}=P;if(T){g=Math.max(g,0),g=Math.min(g,o.ranges.length-1);let{from:M,length:U}=o.ranges[g],J=ue("#"+e.id)[0];J&&J.setSelectionRange(M,M+U)}},[P]),le(De,{val_status:o,set_status:p,val_validate:x,states:e,children:[y(Ee.Shallow,s({},se)),y(xe,{componentID:e.componentID,fontSize:e.fontSize,required:e.required,label:e.label,isActive:!0}),re.get().isTouchDevice?y(ie.Plain,{"data-show-validation":H.isShowValidation(x,o,!!f),"data-component-id":o.componentID,className:n,freeCSS:{textAlign:"left"},children:o.formatValue,onClick:g=>{let T=O.get(o.componentID);T&&T.openPicker(),g.stopPropagation()}}):y(X,s({htmlTag:"input",type:"text",inputMode:"numeric","data-show-validation":H.isShowValidation(x,o,!!f),"data-input-origin":o.componentID,"data-disabled":e.disabled,value:o.formatValue,className:n,tabIndex:re.get().isTouchDevice?-1:0,onKeyDown:g=>{F.KeyDownEvent({restrict:r,event:g,val_era:c,val_status:o,set_status:p,val_focus:P,set_focus:$}),b&&b(g),i&&H.SubmitForm(g,I)},onKeyUp:g=>{g.key=="Tab"&&$(T=>k(s({},T),{active:!0}))},onClick:g=>{let T=g.target.selectionEnd,M=0;o.ranges.forEach((U,J)=>{let{from:te,length:me,region:pe}=U;te<=T&&T<=te+(pe||me)&&(M=J)}),$(U=>k(s({},U),{active:!0,index:M})),g.preventDefault()},onChange:()=>{}},A))]})},R={Origin:e=>{let t=s({},e),[v]=W(e.componentID||N());if(t.componentID=v,G.is.nullish(t.rightIcon)){let r=(e.restrict||"").match(/clock/)?ge:ye;t.rightIcon=y(Se,{ssSphere:2,freeCSS:{pointerEvents:"all"},children:y(ie.Sub,{color:"cloud",border:"unset",ssSphere:2,fontColor:"theme",boxShadow:"0.normal",borderRadius:"3.tone.tertiary",flexCenter:!0,ssEffectsOnActive:"push",tabIndex:-1,id:"Picker-"+t.componentID,onClick:()=>{let d=O.get(t.componentID);d&&d.openPicker()},children:y(de,{icon:r})})})}return y(ve,{componentID:t.componentID,children:we,states:Ie(t)})},Clock:e=>y(R.Origin,s({restrict:"clock",era:"clock"},e)),Date:e=>y(R.Origin,s({restrict:"date"},e)),Week:e=>y(R.Origin,s({restrict:"week"},e)),Month:e=>y(R.Origin,s({restrict:"month"},e)),Year:e=>y(R.Origin,s({restrict:"year"},e)),DateWareki:e=>{e=s({},e);let[t]=W(e.componentID||N());e.componentID=t;let{defaultEra:v="wareki"}=e,[r,d]=W((()=>{let h="year";if(v=="wareki"&&(h="reiwa",e.value)){let[I,u,a]=e.value.split(/\D/);if(I&&u&&a){let m=Number(I);m>=2019?(m-=2019,h="reiwa"):m>=1989?(m-=1989,h="heisei"):m>=1926?(m-=1926,h="shouwa"):m>=1912?(m-=1912,h="taisho"):m>=1868&&(m-=1868,h="meiji"),m+=1}}return h})());return Q(()=>{O.set({["refreshEra_"+t]:{refreshEra:h=>{d(h)}}})},[]),y(R.Origin,k(s({restrict:"dateWareki",leftIndicator:y(Te,{label:"\u5143\u53F7",emptySelect:!1,value:r,tone:e.tone||"border",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:h,eventType:I})=>{d(h);let u=O.get(e.componentID);u&&u.resetEra&&u.resetEra(h)}})},e),{era:r}))},Periods:{Date:e=>y(R.Origin,s({restrict:"dates"},e)),Month:e=>y(R.Origin,s({restrict:"months"},e))},fn:oe};export{R as Time,R as default};
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ReactElement } from '../../@declares';
3
- import { KeyValueDict } from '@mingoo/jsmin';
3
+ import { KeyValueDict } from 'jmini';
4
4
  import { InputTypes } from '.';
5
5
  declare namespace OptionalInputWrapper {
6
6
  type Input = {
@@ -1 +1 @@
1
- import{b as o,c as u,e as _}from"../../chunk-C5N2D3ZX.js";import{jsx as p,jsxs as h}from"react/jsx-runtime";import{useState as x,useEffect as g}from"react";import d,{UUID as y}from"@mingoo/jsmin";import{$$fromRoot as k,Config as B,useStore as v}from"../../@utils";import{InputClasses as b}from"../../@styles/componentClasses";import{Box as E,Flex as N,FAI as T,Column as w}from"../../atoms";import{Row as D,Text as F}from"../../mols";import{Button as A}from"../Button";import R from"../Tooltips";const it=t=>{let[n]=x(t.componentID||y());t=o({},t),t.states=u(o({enableFormSubmit:!0,status_id:y(),override:"never",form:"",id:y(),"aria-label":"Input-"+n},t.states),{componentID:n});let{children:e}=t;return p(e,o({},t.states))},rt=t=>{let{children:n,val_status:e,val_validate:a,states:i}=t,{leftIcon:r,wrapStyles:c}=i;return e.eventType=="init"&&!i.checkValidationAtFirst&&(a.notice=[]),h(D.Center,u(o({position:"relative",verticalAlign:"unset",gap:0},c),{className:b("Wrapper"),"data-notice-uid":e.componentID,children:[p(C.Notice,{notice:a.notice,val_status:e}),i.leftIndicator,h(N,{position:"relative",flexSizing:"auto",children:[n,r,p(C.RightIcon,o({},t)),p(C.ClearButton,o({},t))]}),i.rightIndicator]}))},C={ClearButton:t=>!t.states.clearButton||!t.val_status.dataValue?null:p(A.Normal,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3,transform:"translateY(-50%)"},onClick:()=>{t.set_status(n=>u(o({},n),{dataValue:"",formatValue:"",eventType:"update",eventID:y()}))},children:p(T.Times,{})}),RightIcon:t=>t.states.clearButton&&t.val_status.dataValue?null:t.states.rightIcon,Notice:t=>{let{notice:n,val_status:e}=t,{componentID:a}=e,i="NoticeTimer-"+a,r="NoticeTimerClose-"+a,c="notice-tips-"+a;return g(()=>{d.interval.clear(i),d.interval.clear(r),d.interval.standBy(i,350,()=>{if(!n.length){R.close(c);return}R.open({tipsID:c,parent:`[data-notice-uid="${a}"]`,gravityPoint:22,padding:[1,0],closeAtParentBlur:!1,content:h(R.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[p(E,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),p(w,{backgroundColor:"inherit",gap:"1/3",position:"relative",freeCSS:{zIndex:2},children:n.map((I,S)=>{let{type:l,label:s}=I,f=l=="invalid"?T.Times:l=="warn"?T.Exclamation:T.Check;return h(D.Left,{gap:0,borderRadius:"2.tone.secondary",children:[p(f,{flexCenter:!0,fontSize:"2.normal",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[l]}),p(F.Supplement,{fontSize:"0.xs",fontColor:"white",children:s})]},S+"-"+JSON.stringify(I))})})]})})}),d.interval.standBy(r,6e3,()=>{R.close(c)})},[n]),null}},W={DefaultStatus:(t,n)=>({componentID:t,dataValue:n,eventType:"init",eventID:y()}),CommonEffects:function(t){let{type:n,states:e,val_status:a,set_status:i,val_validate:r,set_validate:c,SystemValidation:I}=t;e=o({},e);let{componentID:S}=a;g(()=>(v.update({[S]:{ResolveRefresh:null,Refresh:()=>new Promise((l,s)=>{v.get(S).ResolveRefresh=l,i(f=>u(o({},f),{eventType:"refresh",eventID:y()}))}),GenNotice:l=>{let{ok:s,notice:f}=l;c({ok:s,notice:f})}}}),()=>{v.delete(S)}),[]),d.scope(()=>{let{override:l}=e;if(l=="never"||l=="beforeModified"&&!["init","override"].includes(a.eventType))return;let s=v.get(a.componentID);s&&(e.value!=a.dataValue&&e.status_id!=s.status_id&&i(f=>u(o(u(o({},f),{dataValue:e.value}),t.ExtraOverrideStates),{eventType:"override",eventID:y()})),s.status_id=e.status_id)}),g(()=>{W.ValidationCheck({val_status:a,set_validate:c,SystemValidation:I,states:e})},[a.eventID,a.dataValue]),g(()=>(d.scope(()=>{let{componentID:l,eventType:s,dataValue:f}=a,m=f;if(n=="autocomplete.single"||n=="list.radio"?m=m[0]:e.isChecker&&(m=!!m[0]),e.form=e.form||"testForm",e.name&&e.form&&v.update({[["form-data",e.form].join("-")]:{[e.name]:{componentID:l,type:n,value:m,validation:r.ok}}}),s=="refresh"){let V=v.get(l);V&&V.ResolveRefresh&&V.ResolveRefresh(null)}else s=="update"&&(e.onUpdateValue&&e.onUpdateValue({componentID:l,value:m,eventType:s}),d.scope(()=>{r.ok&&e.onUpdateValidValue&&e.onUpdateValidValue({componentID:l,value:m,eventType:s})}))}),()=>{v.update({[["form-data",e.form].join("-")]:{[e.name]:null}})}),[r])},ValidationCheck:t=>{let{states:n}=t;d.interval.clear("ValidationTimer-"+t.val_status.componentID);let e=t.SystemValidation({value:t.val_status.dataValue,states:n});if(!e.ok){t.set_validate(e);return}let a=e.notice;const i=()=>_(void 0,null,function*(){if(!n.onValidate)return;let r=yield n.onValidate({value:t.val_status.dataValue,eventType:t.val_status.eventType,props:t});t.set_validate({ok:r.ok,notice:[...a,...r.notice]})});if(n.onValidate){if(t.val_status.eventType=="refresh"){i();return}d.interval.standBy("ValidationTimer-"+t.val_status.componentID,450,i);return}t.set_validate({ok:!0,notice:a})},SubmitForm:(t,n)=>{let e=!1;if(!n)return e;let a=k(`[data-form-submit-button="${n}"]`)[0];if(!a)return e;let i=a.dataset.sdfike||"",r=t.key,c=t.ctrlKey||t.metaKey;return d.scope(()=>{i.includes("enter")&&(r!="Enter"||t.nativeEvent.isComposing||B.get().browserIs=="safari"&&t.keyCode==229)||((r=="Enter"&&(i.includes("enter")||i.includes("auxEnter")&&c)||r==" "&&i.includes("space"))&&(a.click(),t.preventDefault()),e=!0)}),e},isShowValidation:(t,n,e)=>{let a=t.ok;return!e&&n.eventType=="init"&&(a=!0),a}},lt=function(t){t=o({tone:"border"},t);let n=d.scope(()=>{if(t.tone=="plain")return{};let a={padding:"3/4",transition:"middle",flexSizing:"auto",boxShadow:"0.min"};return t.tone=="border"?a=u(o({},a),{border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"}):t.tone=="cloud"?a=u(o({},a),{border:"1.thin",borderRadius:"2.tone.secondary",backgroundColor:"cloud"}):t.tone=="bottomBorder"&&(a=u(o({},a),{borderRadius:0,border:"unset",borderBottom:!0,backgroundColor:"cloud"})),a});return u(o(o(o(o(o(o({fontColor:"2.normal"},n),!!t.rightIcon&&{paddingRight:3}),!!t.leftIcon&&{paddingLeft:3}),!!t.leftIndicator&&{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3",marginLeft:"1/4"}),!!t.rightIndicator&&{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}),t),{freeCSS:o({letterSpacing:"1px",resize:"none"},t.freeCSS),className:[b("Input"),t.className].join(" ")})};export{rt as BoxWrapper,W as CoreEffects,lt as DefaultBoxishStyles,it as OptionalInputWrapper};
1
+ import{b as o,c as u,e as _}from"../../chunk-C5N2D3ZX.js";import{jsx as p,jsxs as h}from"react/jsx-runtime";import{useState as x,useEffect as g}from"react";import d,{UUID as y}from"jmini";import{$$fromRoot as k,Config as B,useStore as v}from"../../@utils";import{InputClasses as b}from"../../@styles/componentClasses";import{Box as E,Flex as N,FAI as T,Column as w}from"../../atoms";import{Row as D,Text as F}from"../../mols";import{Button as A}from"../Button";import R from"../Tooltips";const it=t=>{let[n]=x(t.componentID||y());t=o({},t),t.states=u(o({enableFormSubmit:!0,status_id:y(),override:"never",form:"",id:y(),"aria-label":"Input-"+n},t.states),{componentID:n});let{children:e}=t;return p(e,o({},t.states))},rt=t=>{let{children:n,val_status:e,val_validate:a,states:i}=t,{leftIcon:r,wrapStyles:c}=i;return e.eventType=="init"&&!i.checkValidationAtFirst&&(a.notice=[]),h(D.Center,u(o({position:"relative",verticalAlign:"unset",gap:0},c),{className:b("Wrapper"),"data-notice-uid":e.componentID,children:[p(C.Notice,{notice:a.notice,val_status:e}),i.leftIndicator,h(N,{position:"relative",flexSizing:"auto",children:[n,r,p(C.RightIcon,o({},t)),p(C.ClearButton,o({},t))]}),i.rightIndicator]}))},C={ClearButton:t=>!t.states.clearButton||!t.val_status.dataValue?null:p(A.Normal,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3,transform:"translateY(-50%)"},onClick:()=>{t.set_status(n=>u(o({},n),{dataValue:"",formatValue:"",eventType:"update",eventID:y()}))},children:p(T.Times,{})}),RightIcon:t=>t.states.clearButton&&t.val_status.dataValue?null:t.states.rightIcon,Notice:t=>{let{notice:n,val_status:e}=t,{componentID:a}=e,i="NoticeTimer-"+a,r="NoticeTimerClose-"+a,c="notice-tips-"+a;return g(()=>{d.interval.clear(i),d.interval.clear(r),d.interval.standBy(i,350,()=>{if(!n.length){R.close(c);return}R.open({tipsID:c,parent:`[data-notice-uid="${a}"]`,gravityPoint:22,padding:[1,0],closeAtParentBlur:!1,content:h(R.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[p(E,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),p(w,{backgroundColor:"inherit",gap:"1/3",position:"relative",freeCSS:{zIndex:2},children:n.map((I,S)=>{let{type:l,label:s}=I,f=l=="invalid"?T.Times:l=="warn"?T.Exclamation:T.Check;return h(D.Left,{gap:0,borderRadius:"2.tone.secondary",children:[p(f,{flexCenter:!0,fontSize:"2.normal",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[l]}),p(F.Supplement,{fontSize:"0.xs",fontColor:"white",children:s})]},S+"-"+JSON.stringify(I))})})]})})}),d.interval.standBy(r,6e3,()=>{R.close(c)})},[n]),null}},W={DefaultStatus:(t,n)=>({componentID:t,dataValue:n,eventType:"init",eventID:y()}),CommonEffects:function(t){let{type:n,states:e,val_status:a,set_status:i,val_validate:r,set_validate:c,SystemValidation:I}=t;e=o({},e);let{componentID:S}=a;g(()=>(v.update({[S]:{ResolveRefresh:null,Refresh:()=>new Promise((l,s)=>{v.get(S).ResolveRefresh=l,i(f=>u(o({},f),{eventType:"refresh",eventID:y()}))}),GenNotice:l=>{let{ok:s,notice:f}=l;c({ok:s,notice:f})}}}),()=>{v.delete(S)}),[]),d.scope(()=>{let{override:l}=e;if(l=="never"||l=="beforeModified"&&!["init","override"].includes(a.eventType))return;let s=v.get(a.componentID);s&&(e.value!=a.dataValue&&e.status_id!=s.status_id&&i(f=>u(o(u(o({},f),{dataValue:e.value}),t.ExtraOverrideStates),{eventType:"override",eventID:y()})),s.status_id=e.status_id)}),g(()=>{W.ValidationCheck({val_status:a,set_validate:c,SystemValidation:I,states:e})},[a.eventID,a.dataValue]),g(()=>(d.scope(()=>{let{componentID:l,eventType:s,dataValue:f}=a,m=f;if(n=="autocomplete.single"||n=="list.radio"?m=m[0]:e.isChecker&&(m=!!m[0]),e.form=e.form||"testForm",e.name&&e.form&&v.update({[["form-data",e.form].join("-")]:{[e.name]:{componentID:l,type:n,value:m,validation:r.ok}}}),s=="refresh"){let V=v.get(l);V&&V.ResolveRefresh&&V.ResolveRefresh(null)}else s=="update"&&(e.onUpdateValue&&e.onUpdateValue({componentID:l,value:m,eventType:s}),d.scope(()=>{r.ok&&e.onUpdateValidValue&&e.onUpdateValidValue({componentID:l,value:m,eventType:s})}))}),()=>{v.update({[["form-data",e.form].join("-")]:{[e.name]:null}})}),[r])},ValidationCheck:t=>{let{states:n}=t;d.interval.clear("ValidationTimer-"+t.val_status.componentID);let e=t.SystemValidation({value:t.val_status.dataValue,states:n});if(!e.ok){t.set_validate(e);return}let a=e.notice;const i=()=>_(void 0,null,function*(){if(!n.onValidate)return;let r=yield n.onValidate({value:t.val_status.dataValue,eventType:t.val_status.eventType,props:t});t.set_validate({ok:r.ok,notice:[...a,...r.notice]})});if(n.onValidate){if(t.val_status.eventType=="refresh"){i();return}d.interval.standBy("ValidationTimer-"+t.val_status.componentID,450,i);return}t.set_validate({ok:!0,notice:a})},SubmitForm:(t,n)=>{let e=!1;if(!n)return e;let a=k(`[data-form-submit-button="${n}"]`)[0];if(!a)return e;let i=a.dataset.sdfike||"",r=t.key,c=t.ctrlKey||t.metaKey;return d.scope(()=>{i.includes("enter")&&(r!="Enter"||t.nativeEvent.isComposing||B.get().browserIs=="safari"&&t.keyCode==229)||((r=="Enter"&&(i.includes("enter")||i.includes("auxEnter")&&c)||r==" "&&i.includes("space"))&&(a.click(),t.preventDefault()),e=!0)}),e},isShowValidation:(t,n,e)=>{let a=t.ok;return!e&&n.eventType=="init"&&(a=!0),a}},lt=function(t){t=o({tone:"border"},t);let n=d.scope(()=>{if(t.tone=="plain")return{};let a={padding:"3/4",transition:"middle",flexSizing:"auto",boxShadow:"0.min"};return t.tone=="border"?a=u(o({},a),{border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"}):t.tone=="cloud"?a=u(o({},a),{border:"1.thin",borderRadius:"2.tone.secondary",backgroundColor:"cloud"}):t.tone=="bottomBorder"&&(a=u(o({},a),{borderRadius:0,border:"unset",borderBottom:!0,backgroundColor:"cloud"})),a});return u(o(o(o(o(o(o({fontColor:"2.normal"},n),!!t.rightIcon&&{paddingRight:3}),!!t.leftIcon&&{paddingLeft:3}),!!t.leftIndicator&&{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3",marginLeft:"1/4"}),!!t.rightIndicator&&{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}),t),{freeCSS:o({letterSpacing:"1px",resize:"none"},t.freeCSS),className:[b("Input"),t.className].join(" ")})};export{rt as BoxWrapper,W as CoreEffects,lt as DefaultBoxishStyles,it as OptionalInputWrapper};
@@ -1,4 +1,4 @@
1
- import { KeyValueDict } from '@mingoo/jsmin';
1
+ import { KeyValueDict } from 'jmini';
2
2
  import { ReactElement, StyleTags } from '../../@declares';
3
3
  export declare namespace InputTypes {
4
4
  type BoxTone = 'border' | 'cloud' | 'bottomBorder' | 'plain';
@@ -1 +1 @@
1
- import{b as f,c as d,d as h}from"../../chunk-C5N2D3ZX.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{UUID as 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 n=w,{color:S="theme",size:t="R",showInitial:c=!1,loaderID:C=""}=n,u=h(n,["color","size","showInitial","loaderID"]),[m]=l(C),[i]=l(y()),[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 p={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,d(f({className:[e("MiniLoader"),e(c?"Active":"Hide")].join(" "),componentID:i,ssSphere:o,position:"relative"},u),{children:[s("svg",{className:e("SVG1"),width:"100",height:"100",viewBox:"0 0 100 100",style:{stroke:p},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:p},children:s("circle",{cx:"50",cy:"50",r:"40"})})]}))};export{R as Mini};
1
+ import{b as f,c as d,d as h}from"../../chunk-C5N2D3ZX.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{UUID as y}from"jmini";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 n=w,{color:S="theme",size:t="R",showInitial:c=!1,loaderID:C=""}=n,u=h(n,["color","size","showInitial","loaderID"]),[m]=l(C),[i]=l(y()),[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 p={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,d(f({className:[e("MiniLoader"),e(c?"Active":"Hide")].join(" "),componentID:i,ssSphere:o,position:"relative"},u),{children:[s("svg",{className:e("SVG1"),width:"100",height:"100",viewBox:"0 0 100 100",style:{stroke:p},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:p},children:s("circle",{cx:"50",cy:"50",r:"40"})})]}))};export{R as Mini};
@@ -1 +1 @@
1
- import{b as s,c as h,d as y}from"../chunk-C5N2D3ZX.js";import{jsx as g,jsxs as B}from"react/jsx-runtime";import{useState as x,useEffect as N}from"react";import a,{UUID as R}from"@mingoo/jsmin";import{$$fromRoot as c,Config as w,pageRouter as F}from"../@utils";import{Box as S,Flex as C,Column as P}from"../atoms";import{Button as H}from"./Button";import{LayoutClasses as f}from"../@styles/componentClasses";const d={Base:t=>{let n=t,{topNavigation:o,sideNavigation:e,footerNavigation:i,children:l,className:r}=n,u=y(n,["topNavigation","sideNavigation","footerNavigation","children","className"]);N(()=>{d.fn.updateCSSProperty.reset(),setTimeout(()=>{d.fn.updateCSSProperty.reset()},100);let p="ResizeCB",m="RemovePageEventCB";return a(window).addEvent({eventType:"resize",eventID:p,callback:()=>{w.get().screen.isPhonepoint()||(a.interval.clear("__RVC_calcHeights"),a.interval.standBy("__RVC_calcHeights",300,()=>{d.fn.updateCSSProperty.reset()}))}}),()=>{a(window).removeEvent(m),a(window).removeEvent(p)}},[]);let v=l;return B(P,h(s({className:[r,f("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},u),{children:[o,B(C,{className:f("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[e,g(S,{className:f("Content"),position:"relative",flexSizing:0,width:0,UnderBreakPointStyles:{width:"auto"},children:v})]}),i]}))},TopNavigation:t=>{let r=t,{className:o,children:e}=r,i=y(r,["className","children"]),[l]=x(R());return N(()=>{d.fn.updateCSSProperty.topNav()},[]),g(C,h(s({"data-id":l,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},i),{id:"__RVC_TopNavigation",className:[o,f("TopNav")].join(" "),children:e}),l)},SideNavigation:t=>{let i=t,{className:o=""}=i,e=y(i,["className"]);return N(()=>{d.fn.updateCSSProperty.sideNav()},[]),g(S,h(s({className:[o,f("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:t=>{let r=t,{className:o="",baseStyles:e}=r,i=y(r,["className","baseStyles"]),[l]=x(R());return N(()=>{d.fn.updateCSSProperty.footer()},[]),g(C,h(s({"data-id":l,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[f("FooterNav"),o].join(" "),children:g(C,s({gap:1,flexWrap:!1,padding:"2/3",margin:"auto"},i))}))},Comps:{Button:t=>{let v=t,{isActive:o,uri:e,uriGroup:i}=v,l=y(v,["isActive","uri","uriGroup"]),r=a.flatArray(i),u=location.pathname;{let n=!1;if(a.is.exist(e)&&a.is.string(e)){let p=[location.origin,e.replace(/\//,"")].join("/");n=u==new URL(p).pathname}if(!n&&r.length)for(let p of r)a.is.nullish(p)||u.match(new RegExp(p))&&(n=!0);o=o!=null?o:n}return g(H.Clear,s({isActive:o,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:n=>{a.is.exist(e)&&a.is.string(e)&&F.push(e,n.ctrlKey||n.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},l))},Bar:t=>g(S,s({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},t)),Title:t=>g(S,s({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},t))},fn:{updateCSSProperty:{topNav:()=>{let t=a(document.body),o=c("#__RVC_TopNavigation"),e=o.position().height||0,i=e;o.getStyleProperty("position")!="sticky"&&(i=0),t.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",i+"px")},footer:()=>{let t=a(document.body),e=c("#__RVC_FooterNavigation").position().height||0;t.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let t=a(document.body),e=c("#__RVC_SideNavigation").position().width||0;t.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let t=a(document.body),o=c("#__RVC_TopNavigation"),e=c("#__RVC_FooterNavigation"),i=c("#__RVC_SideNavigation"),l=o.position().height||0,r=l,u=e.position().height||0,v=i.position().width||0;o.getStyleProperty("position")!="sticky"&&(r=0);let n=window.innerHeight,p=window.innerWidth,m=n-l-u,_=p-v;t.setStyleProperty("--topNavHeight",l+"px").setStyleProperty("--topBase",r+"px").setStyleProperty("--footerNavHeight",u+"px").setStyleProperty("--viewHeight",n+"px").setStyleProperty("--sideNavHeight",m+"px").setStyleProperty("--contentHeight",m+"px").setStyleProperty("--contentWidth",_+"px")}}}};export{d as RootViewController,d as default};
1
+ import{b as s,c as h,d as y}from"../chunk-C5N2D3ZX.js";import{jsx as g,jsxs as B}from"react/jsx-runtime";import{useState as x,useEffect as N}from"react";import a,{UUID as R}from"jmini";import{$$fromRoot as c,Config as w,pageRouter as F}from"../@utils";import{Box as S,Flex as C,Column as P}from"../atoms";import{Button as H}from"./Button";import{LayoutClasses as f}from"../@styles/componentClasses";const d={Base:t=>{let n=t,{topNavigation:o,sideNavigation:e,footerNavigation:i,children:l,className:r}=n,u=y(n,["topNavigation","sideNavigation","footerNavigation","children","className"]);N(()=>{d.fn.updateCSSProperty.reset(),setTimeout(()=>{d.fn.updateCSSProperty.reset()},100);let p="ResizeCB",m="RemovePageEventCB";return a(window).addEvent({eventType:"resize",eventID:p,callback:()=>{w.get().screen.isPhonepoint()||(a.interval.clear("__RVC_calcHeights"),a.interval.standBy("__RVC_calcHeights",300,()=>{d.fn.updateCSSProperty.reset()}))}}),()=>{a(window).removeEvent(m),a(window).removeEvent(p)}},[]);let v=l;return B(P,h(s({className:[r,f("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},u),{children:[o,B(C,{className:f("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[e,g(S,{className:f("Content"),position:"relative",flexSizing:0,width:0,UnderBreakPointStyles:{width:"auto"},children:v})]}),i]}))},TopNavigation:t=>{let r=t,{className:o,children:e}=r,i=y(r,["className","children"]),[l]=x(R());return N(()=>{d.fn.updateCSSProperty.topNav()},[]),g(C,h(s({"data-id":l,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},i),{id:"__RVC_TopNavigation",className:[o,f("TopNav")].join(" "),children:e}),l)},SideNavigation:t=>{let i=t,{className:o=""}=i,e=y(i,["className"]);return N(()=>{d.fn.updateCSSProperty.sideNav()},[]),g(S,h(s({className:[o,f("SideNav")].join(" "),flexSizing:"none",minHeight:"sideNavigationHeight"},e),{id:"__RVC_SideNavigation"}))},FooterNavigation:t=>{let r=t,{className:o="",baseStyles:e}=r,i=y(r,["className","baseStyles"]),[l]=x(R());return N(()=>{d.fn.updateCSSProperty.footer()},[]),g(C,h(s({"data-id":l,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},e),{id:"__RVC_FooterNavigation",className:[f("FooterNav"),o].join(" "),children:g(C,s({gap:1,flexWrap:!1,padding:"2/3",margin:"auto"},i))}))},Comps:{Button:t=>{let v=t,{isActive:o,uri:e,uriGroup:i}=v,l=y(v,["isActive","uri","uriGroup"]),r=a.flatArray(i),u=location.pathname;{let n=!1;if(a.is.exist(e)&&a.is.string(e)){let p=[location.origin,e.replace(/\//,"")].join("/");n=u==new URL(p).pathname}if(!n&&r.length)for(let p of r)a.is.nullish(p)||u.match(new RegExp(p))&&(n=!0);o=o!=null?o:n}return g(H.Clear,s({isActive:o,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:n=>{a.is.exist(e)&&a.is.string(e)&&F.push(e,n.ctrlKey||n.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},l))},Bar:t=>g(S,s({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],isRounded:!0},t)),Title:t=>g(S,s({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},t))},fn:{updateCSSProperty:{topNav:()=>{let t=a(document.body),o=c("#__RVC_TopNavigation"),e=o.position().height||0,i=e;o.getStyleProperty("position")!="sticky"&&(i=0),t.setStyleProperty("--topNavHeight",e+"px").setStyleProperty("--topBase",i+"px")},footer:()=>{let t=a(document.body),e=c("#__RVC_FooterNavigation").position().height||0;t.setStyleProperty("--footerNavHeight",e+"px")},sideNav:()=>{let t=a(document.body),e=c("#__RVC_SideNavigation").position().width||0;t.setStyleProperty("--sideNavWidth",e+"px")},reset:()=>{let t=a(document.body),o=c("#__RVC_TopNavigation"),e=c("#__RVC_FooterNavigation"),i=c("#__RVC_SideNavigation"),l=o.position().height||0,r=l,u=e.position().height||0,v=i.position().width||0;o.getStyleProperty("position")!="sticky"&&(r=0);let n=window.innerHeight,p=window.innerWidth,m=n-l-u,_=p-v;t.setStyleProperty("--topNavHeight",l+"px").setStyleProperty("--topBase",r+"px").setStyleProperty("--footerNavHeight",u+"px").setStyleProperty("--viewHeight",n+"px").setStyleProperty("--sideNavHeight",m+"px").setStyleProperty("--contentHeight",m+"px").setStyleProperty("--contentWidth",_+"px")}}}};export{d as RootViewController,d as default};
@@ -1,12 +1,11 @@
1
- import $$, { Time } from '@mingoo/jsmin';
1
+ import $$, { Time } from 'jmini';
2
2
  import { StyleTags, ReactElement } from '../@declares';
3
3
  import React from 'react';
4
4
  import { Box } from '../atoms';
5
5
  declare namespace Sheet {
6
6
  type Methods = {
7
7
  Wrapper(): JSX.Element;
8
- open<T extends Input>(p: T): void;
9
- refresh(p: Input, open: boolean): void;
8
+ open<T extends Input>(p: T, defaultOpen?: boolean): void;
10
9
  resize(p: {
11
10
  sheetID: string;
12
11
  size: Size;