amotify 0.1.59 → 0.1.61

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 (85) hide show
  1. package/dist/@declaration/property.d.ts +9 -9
  2. package/dist/@utils/GenerateClassName.d.ts +2 -2
  3. package/dist/@utils/GenerateClassName.js +1 -1
  4. package/dist/@utils/LaunchReactApp.d.ts +1 -1
  5. package/dist/@utils/useRecycle.js +1 -1
  6. package/dist/@utils/useStore.d.ts +2 -10
  7. package/dist/@utils/useStore.js +1 -1
  8. package/dist/atoms/FAI.d.ts +1 -1
  9. package/dist/atoms/FAI.js +1 -1
  10. package/dist/atoms/Flex.js +1 -1
  11. package/dist/atoms/Logo.d.ts +14 -14
  12. package/dist/atoms/Logo.js +3 -3
  13. package/dist/fn/Button.d.ts +4 -4
  14. package/dist/fn/Button.js +1 -1
  15. package/dist/fn/Cropper.d.ts +1 -1
  16. package/dist/fn/Cropper.js +1 -1
  17. package/dist/fn/Input/AutoHeightText.d.ts +1 -1
  18. package/dist/fn/Input/AutoHeightText.js +1 -1
  19. package/dist/fn/Input/Checker.d.ts +3 -3
  20. package/dist/fn/Input/Checker.js +1 -1
  21. package/dist/fn/Input/Chips/Selector.d.ts +3 -3
  22. package/dist/fn/Input/Chips/Selector.js +1 -1
  23. package/dist/fn/Input/Chips/index.js +1 -1
  24. package/dist/fn/Input/Contenteditable.js +1 -1
  25. package/dist/fn/Input/DigitCharacters.d.ts +1 -1
  26. package/dist/fn/Input/DigitCharacters.js +1 -1
  27. package/dist/fn/Input/Filer.d.ts +3 -3
  28. package/dist/fn/Input/Filer.js +1 -1
  29. package/dist/fn/Input/Hidden.d.ts +1 -1
  30. package/dist/fn/Input/Hidden.js +1 -1
  31. package/dist/fn/Input/List.d.ts +5 -5
  32. package/dist/fn/Input/List.js +1 -1
  33. package/dist/fn/Input/Parts.d.ts +1 -1
  34. package/dist/fn/Input/Parts.js +1 -1
  35. package/dist/fn/Input/Plain.d.ts +2 -2
  36. package/dist/fn/Input/Plain.js +1 -1
  37. package/dist/fn/Input/RichSelect.d.ts +3 -3
  38. package/dist/fn/Input/RichSelect.js +1 -1
  39. package/dist/fn/Input/Search.d.ts +1 -1
  40. package/dist/fn/Input/Segmented.d.ts +8 -8
  41. package/dist/fn/Input/Segmented.js +1 -1
  42. package/dist/fn/Input/Select.d.ts +1 -1
  43. package/dist/fn/Input/Select.js +1 -1
  44. package/dist/fn/Input/Slider.js +1 -1
  45. package/dist/fn/Input/Switch.js +1 -1
  46. package/dist/fn/Input/Text.js +1 -1
  47. package/dist/fn/Input/TextArea.js +1 -1
  48. package/dist/fn/Input/Time/Picker.js +1 -1
  49. package/dist/fn/Input/Time/index.d.ts +1 -1
  50. package/dist/fn/Input/Time/index.js +1 -1
  51. package/dist/fn/Input/core.d.ts +11 -11
  52. package/dist/fn/Input/core.js +1 -1
  53. package/dist/fn/Input/index.d.ts +4 -4
  54. package/dist/fn/Input/index.js +1 -1
  55. package/dist/fn/Layout/PageRouter.js +1 -1
  56. package/dist/fn/Layout/RootViewController.d.ts +6 -6
  57. package/dist/fn/Layout/RootViewController.js +1 -1
  58. package/dist/fn/Layout/SwipeView.d.ts +1 -1
  59. package/dist/fn/Layout/SwipeView.js +1 -1
  60. package/dist/fn/Loader/corner.js +1 -1
  61. package/dist/fn/Loader/index.d.ts +1 -1
  62. package/dist/fn/Loader/mini.d.ts +1 -1
  63. package/dist/fn/Loader/mini.js +1 -1
  64. package/dist/fn/Loader/top.js +1 -1
  65. package/dist/fn/Sheet.d.ts +10 -10
  66. package/dist/fn/Sheet.js +1 -1
  67. package/dist/fn/Snackbar.d.ts +1 -1
  68. package/dist/fn/Snackbar.js +1 -1
  69. package/dist/fn/Table/Data.d.ts +2 -2
  70. package/dist/fn/Table/Data.js +1 -1
  71. package/dist/fn/Table/Drag.d.ts +1 -1
  72. package/dist/fn/Table/Drag.js +1 -1
  73. package/dist/fn/Table/Normal.d.ts +1 -1
  74. package/dist/fn/Table/Normal.js +1 -1
  75. package/dist/fn/Table/Wrapper.d.ts +1 -1
  76. package/dist/fn/Table/Wrapper.js +1 -1
  77. package/dist/fn/Table/cellStyling.d.ts +2 -2
  78. package/dist/fn/Table/cellStyling.js +1 -1
  79. package/dist/fn/Table/index.d.ts +3 -3
  80. package/dist/fn/Table/index.js +1 -1
  81. package/dist/fn/Tooltips.d.ts +1 -1
  82. package/dist/index.d.ts +3 -3
  83. package/dist/mols/Accordion.js +1 -1
  84. package/dist/mols/Text.js +1 -1
  85. package/package.json +2 -2
@@ -1 +1 @@
1
- import{b as r,c as h,d as N}from"../../../chunk-VY3566IV.js";import{jsx as a,jsxs as b}from"react/jsx-runtime";import{useState as v,useEffect as L,useRef as H}from"react";import B from"@mingoo/jsmin";import{$$fromRoot as T}from"../../../@utils";import Q from"../../../atoms/Box";import P from"../../../atoms/FAI";import X from"../../../mols/Row";import U from"../../Button";import Y from"../../Sheet";import{Wrapper as Z,BoxWrapper as j,CommonEffects as ee,DefaultStyles as te}from"../core";import ne from"../Hidden";import W from"./Selector";function oe(e){let{value:u,para:s}=e,{required:o}=s,c=[];return o&&!u.length&&c.push({type:"invalid",label:"\u4E00\u3064\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),{ok:!c.filter(({type:f})=>f=="invalid").length,notice:c}}const le=e=>{let $=e,{required:u,form:s,name:o,checkValidationAtFirst:c,onValidate:f,onUpdateValue:O,onUpdateValidValue:M,value:F=[],limit:A,leftIndicator:ie,rightIndicator:pe,leftIcon:re,rightIcon:ue,SelectedCellComponent:g,AddButtonComponent:x,componentID:se,defaultOptions:ce,enableFormSubmit:de,onDynamicSearch:me}=$,q=N($,["required","form","name","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","limit","leftIndicator","rightIndicator","leftIcon","rightIcon","SelectedCellComponent","AddButtonComponent","componentID","defaultOptions","enableFormSubmit","onDynamicSearch"]);x=x;let[p]=v(B.uuid.gen()),[d,R]=v({componentID:e.componentID||"",dataValue:F.map(t=>t),eventID:B.uuid.gen(),eventType:"init"}),[D,z]=v({ok:!1,notice:[]}),[n,G]=v([...F]);ee({para:e,val_status:d,set_status:R,val_validate:D,set_validate:z,DefaultValidation:oe,onUpdateValue:O,onUpdateValidValue:M,ExtraOverrideParams:{formatValue:n,dataValue:n.map(t=>t)},ExtraStoreParams:{searchTimer:null}});const C=t=>{G(t),R(h(r({},d),{dataValue:t.map(i=>i),eventID:B.uuid.gen(),eventType:"update"}))};let E=`[data-chips-input-wrapper="${p}"]`;const y=()=>{W.openSelector({parent:E,gravityPoint:e.selectorGravityPoint,SelectorCellComponent:e.SelectorCellComponent,selectorID:p,options:e.defaultOptions||[],selected:n,limit:e.limit,onDynamicSearch:e.onDynamicSearch,onUpdated:t=>{C(t.values)},onClosed:()=>{T(E).focus()}})};let S=A&&A<=n.length;const _=H(!1);L(()=>{_.current?S&&(Y.close(p),T(`[data-chips-input-wrapper="${p}"]`).focus()):_.current=!0},[n]);let J=n.map(t=>{let{value:i,label:k}=t;g=g;const I=()=>{let l=n.findIndex(w=>w.value==i);if(l==-1)return;let m=[...n];m.splice(l,1),C(m),m.length||setTimeout(()=>{T(`[data-chips-input-wrapper="${p}"]`).focus()},200)};return a(g,{value:i,label:k,removeCallback:I,defaultRemoveButton:a(U.Button.Sub.S,{flexSizing:"none",color:"cloud",backgroundColor:"cloud",flexCenter:!0,isRounded:!0,freeCSS:{aspectRatio:"1/1"},onClick:()=>{I()},children:a(P.Times,{})}),openCallback:()=>{y()}},JSON.stringify(i))});return b(j,{val_status:d,set_status:R,val_validate:D,para:e,children:[a(ne,{"data-value":JSON.stringify(d.dataValue.map(t=>t.value)),name:o,form:s,"data-input-type":"chips-"+["single","multi"][+(e.limit!=1)],"data-validation":D.ok,componentID:d.componentID,"data-focusor":p}),b("button",h(r({"data-chips-input-wrapper":p,onKeyDown:t=>{let{key:i,ctrlKey:k,metaKey:I,keyCode:l}=t,m=k||I;if(l>=48&&l<=57||l>=65&&l<=90||l>=96&&l<=105){if(S)return;y()}else if(i!="Tab"){if(i=="Backspace"){if(!n.length)return;if(m)C([]);else{let K=[...n];K.pop(),C(K)}}}},onClick:()=>{S||y()}},q),{children:[!S&&a(x,{selected:n,openCallback:y}),J]}))]})},ae=e=>{let s=[...e.value||[]].splice(0,e.limit||65535);return a(le,h(r({SelectedCellComponent:o=>{let{value:c,label:f,removeCallback:O}=o;return b(X.Left,{ssCardBox:!0,padding:"1/3",gap:0,isRounded:!0,textAlign:"left",children:[a(Q,{padding:[0,"1/2"],children:f}),o.defaultRemoveButton]})},AddButtonComponent:o=>e.limit&&e.limit<=o.selected.length?null:b(U.Button.Sub.R,{color:"cloud",padding:"1/2",onClick:()=>{o.openCallback()},children:[a(P.Plus,{}),"\u8FFD\u52A0\u3059\u308B"]})},e),{value:s}))},V=e=>{e=r({},e),e=r({gap:1,display:"flex",horizontalAlign:"left",verticalAlign:"center",flexWrap:!0},e);let u=te.Boxish(e);return a(Z,{componentID:e.componentID,children:ae,para:u})};V.fn=W;export{V as Chips,V as default};
1
+ import{b as r,c as h,d as K}from"../../../chunk-VY3566IV.js";import{jsx as a,jsxs as b}from"react/jsx-runtime";import{useState as v,useEffect as L,useRef as H}from"react";import B from"@mingoo/jsmin";import{$$fromRoot as T}from"../../../@utils";import Q from"../../../atoms/Box";import N from"../../../atoms/FAI";import X from"../../../mols/Row";import U from"../../Button";import Y from"../../Sheet";import{Wrapper as Z,BoxWrapper as j,CommonEffects as ee,DefaultStyles as te}from"../core";import ne from"../Hidden";import W from"./Selector";function oe(e){let{value:s,states:u}=e,{required:o}=u,c=[];return o&&!s.length&&c.push({type:"invalid",label:"\u4E00\u3064\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),{ok:!c.filter(({type:f})=>f=="invalid").length,notice:c}}const le=e=>{let w=e,{required:s,form:u,name:o,checkValidationAtFirst:c,onValidate:f,onUpdateValue:O,onUpdateValidValue:M,value:F=[],limit:A,leftIndicator:ie,rightIndicator:pe,leftIcon:re,rightIcon:se,SelectedCellComponent:g,AddButtonComponent:x,componentID:ue,defaultOptions:ce,enableFormSubmit:de,onDynamicSearch:me}=w,q=K(w,["required","form","name","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","limit","leftIndicator","rightIndicator","leftIcon","rightIcon","SelectedCellComponent","AddButtonComponent","componentID","defaultOptions","enableFormSubmit","onDynamicSearch"]);x=x;let[p]=v(B.uuid.gen()),[d,R]=v({componentID:e.componentID||"",dataValue:F.map(t=>t),eventID:B.uuid.gen(),eventType:"init"}),[D,z]=v({ok:!1,notice:[]}),[n,G]=v([...F]);ee({states:e,val_status:d,set_status:R,val_validate:D,set_validate:z,DefaultValidation:oe,onUpdateValue:O,onUpdateValidValue:M,ExtraOverrideStates:{formatValue:n,dataValue:n.map(t=>t)},ExtraStoreStates:{searchTimer:null}});const C=t=>{G(t),R(h(r({},d),{dataValue:t.map(i=>i),eventID:B.uuid.gen(),eventType:"update"}))};let E=`[data-chips-input-wrapper="${p}"]`;const y=()=>{W.openSelector({parent:E,gravityPoint:e.selectorGravityPoint,SelectorCellComponent:e.SelectorCellComponent,selectorID:p,options:e.defaultOptions||[],selected:n,limit:e.limit,onDynamicSearch:e.onDynamicSearch,onUpdated:t=>{C(t.values)},onClosed:()=>{T(E).focus()}})};let S=A&&A<=n.length;const _=H(!1);L(()=>{_.current?S&&(Y.close(p),T(`[data-chips-input-wrapper="${p}"]`).focus()):_.current=!0},[n]);let J=n.map(t=>{let{value:i,label:k}=t;g=g;const I=()=>{let l=n.findIndex(P=>P.value==i);if(l==-1)return;let m=[...n];m.splice(l,1),C(m),m.length||setTimeout(()=>{T(`[data-chips-input-wrapper="${p}"]`).focus()},200)};return a(g,{value:i,label:k,removeCallback:I,defaultRemoveButton:a(U.Button.Sub.S,{flexSizing:"none",color:"cloud",backgroundColor:"cloud",flexCenter:!0,isRounded:!0,freeCSS:{aspectRatio:"1/1"},onClick:()=>{I()},children:a(N.Times,{})}),openCallback:()=>{y()}},JSON.stringify(i))});return b(j,{val_status:d,set_status:R,val_validate:D,states:e,children:[a(ne,{"data-value":JSON.stringify(d.dataValue.map(t=>t.value)),name:o,form:u,"data-input-type":"chips-"+["single","multi"][+(e.limit!=1)],"data-validation":D.ok,componentID:d.componentID,"data-focusor":p}),b("button",h(r({"data-chips-input-wrapper":p,onKeyDown:t=>{let{key:i,ctrlKey:k,metaKey:I,keyCode:l}=t,m=k||I;if(l>=48&&l<=57||l>=65&&l<=90||l>=96&&l<=105){if(S)return;y()}else if(i!="Tab"){if(i=="Backspace"){if(!n.length)return;if(m)C([]);else{let $=[...n];$.pop(),C($)}}}},onClick:()=>{S||y()}},q),{children:[!S&&a(x,{selected:n,openCallback:y}),J]}))]})},ae=e=>{let u=[...e.value||[]].splice(0,e.limit||65535);return a(le,h(r({SelectedCellComponent:o=>{let{value:c,label:f,removeCallback:O}=o;return b(X.Left,{ssCardBox:!0,padding:"1/3",gap:0,isRounded:!0,textAlign:"left",children:[a(Q,{padding:[0,"1/2"],children:f}),o.defaultRemoveButton]})},AddButtonComponent:o=>e.limit&&e.limit<=o.selected.length?null:b(U.Button.Sub.R,{color:"cloud",padding:"1/2",onClick:()=>{o.openCallback()},children:[a(N.Plus,{}),"\u8FFD\u52A0\u3059\u308B"]})},e),{value:u}))},V=e=>{e=r({},e),e=r({gap:1,display:"flex",horizontalAlign:"left",verticalAlign:"center",flexWrap:!0},e);let s=te.Boxish(e);return a(Z,{componentID:e.componentID,children:ae,states:s})};V.fn=W;export{V as Chips,V as default};
@@ -1 +1 @@
1
- import{b as n,c as u,d as y}from"../../chunk-VY3566IV.js";import{jsx as r}from"react/jsx-runtime";import{useState as T}from"react";import g from"@mingoo/jsmin";import{Wrapper as _,BoxWrapper as k,SubmitForm as L,CommonEffects as F,DefaultStyles as B}from"./core";function H(t){let{value:e,para:o}=t,{required:a}=o,i=[];return a&&!e&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:s})=>s=="invalid").length,notice:i}}const M=t=>{let v=t,{componentID:e,tone:o,required:a,form:i,value:s,enableFormSubmit:b,checkValidationAtFirst:W,onInput:m,onKeyDown:f,onValidate:q,onUpdateValue:D,onUpdateValidValue:R,children:C="",leftIndicator:A,rightIndicator:K,leftIcon:U,rightIcon:$}=v,V=y(v,["componentID","tone","required","form","value","enableFormSubmit","checkValidationAtFirst","onInput","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","children","leftIndicator","rightIndicator","leftIcon","rightIcon"]),E={componentID:e,dataValue:s,eventType:"init",eventID:g.uuid.gen()},[l,c]=T(E),[d,I]=T({ok:!1,notice:[]});return F({para:t,val_status:l,set_status:c,val_validate:d,set_validate:I,onUpdateValue:D,onUpdateValidValue:R,DefaultValidation:H}),r(k,{val_status:l,set_status:c,val_validate:d,para:t,children:r("div",u(n({contentEditable:!0,"data-form":i,"data-name":t.name,"data-input-type":"contenteditable","data-validation":d.ok,"data-value":l.dataValue,"data-component-id":l.componentID,onKeyDown:p=>{f&&f(p),b&&L(p)},onInput:p=>{let S=p.currentTarget,{innerHTML:N,innerText:x}=S;d.ok&&I({ok:!1,notice:[]}),c(u(n({},l),{dataValue:x,eventType:"update",eventID:g.uuid.gen()})),m&&m(p)}},V),{children:C}))})},h=t=>{var o,a;t=n({},t),t.rightIcon&&(t.paddingRight=(o=t.paddingRight)!=null?o:3),t.leftIcon&&(t.paddingLeft=(a=t.paddingLeft)!=null?a:3),t=u(n({},t),{freeCSS:n({whiteSpace:"pre-wrap"},t.freeCSS)});let e=B.Boxish(t);return e.rows=e.rows||5,r(_,{componentID:t.componentID,children:M,para:e})};export{h as Contenteditable,h as default};
1
+ import{b as a,c as s,d as y}from"../../chunk-VY3566IV.js";import{jsx as p}from"react/jsx-runtime";import{useState as T}from"react";import g from"@mingoo/jsmin";import{Wrapper as _,BoxWrapper as k,SubmitForm as w,CommonEffects as L,DefaultStyles as F}from"./core";function B(t){let{value:e,states:n}=t,{required:o}=n,i=[];return o&&!e&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:u})=>u=="invalid").length,notice:i}}const H=t=>{let v=t,{componentID:e,tone:n,required:o,form:i,value:u,enableFormSubmit:b,checkValidationAtFirst:M,onInput:m,onKeyDown:f,onValidate:W,onUpdateValue:D,onUpdateValidValue:R,children:C="",leftIndicator:q,rightIndicator:A,leftIcon:K,rightIcon:U}=v,V=y(v,["componentID","tone","required","form","value","enableFormSubmit","checkValidationAtFirst","onInput","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","children","leftIndicator","rightIndicator","leftIcon","rightIcon"]),E={componentID:e,dataValue:u,eventType:"init",eventID:g.uuid.gen()},[l,c]=T(E),[d,I]=T({ok:!1,notice:[]});return L({states:t,val_status:l,set_status:c,val_validate:d,set_validate:I,onUpdateValue:D,onUpdateValidValue:R,DefaultValidation:B}),p(k,{val_status:l,set_status:c,val_validate:d,states:t,children:p("div",s(a({contentEditable:!0,"data-form":i,"data-name":t.name,"data-input-type":"contenteditable","data-validation":d.ok,"data-value":l.dataValue,"data-component-id":l.componentID,onKeyDown:r=>{f&&f(r),b&&w(r)},onInput:r=>{let S=r.currentTarget,{innerHTML:$,innerText:x}=S;d.ok&&I({ok:!1,notice:[]}),c(s(a({},l),{dataValue:x,eventType:"update",eventID:g.uuid.gen()})),m&&m(r)}},V),{children:C}))})},h=t=>{var n,o;t=a({},t),t.rightIcon&&(t.paddingRight=(n=t.paddingRight)!=null?n:3),t.leftIcon&&(t.paddingLeft=(o=t.paddingLeft)!=null?o:3),t=s(a({},t),{freeCSS:a({whiteSpace:"pre-wrap"},t.freeCSS)});let e=F.Boxish(t);return e.rows=e.rows||5,p(_,{componentID:t.componentID,children:H,states:e})};export{h as Contenteditable,h as default};
@@ -10,7 +10,7 @@ declare namespace DigitCharacters {
10
10
  tabIndex?: number;
11
11
  id?: string;
12
12
  value?: string | number;
13
- listStyles?: TagProperty.Para;
13
+ listStyles?: TagProperty.States;
14
14
  };
15
15
  }
16
16
  declare const DigitCharacters: React.FC<DigitCharacters.Input>;
@@ -1 +1 @@
1
- import{b as t,c as p,d as S}from"../../chunk-VY3566IV.js";import{jsx as I,jsxs as Z}from"react/jsx-runtime";import{useState as V}from"react";import y from"@mingoo/jsmin";import{$$fromRoot as O}from"../../@utils";import{Wrapper as q,BoxWrapper as w,SubmitForm as U,CommonEffects as j,DefaultStyles as z}from"./core";import G from"../../atoms/Flex";import J from"./Hidden";import{InputClasses as R}from"../../@styles/componentClasses";function Q(e){let{value:n,para:u}=e,{required:s,numericOnly:l=!1,digits:c}=u,r=[];return s&&!n&&r.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),n&&(l&&n.match(/\D/)&&r.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n.length!=c&&r.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!r.filter(({type:m})=>m=="invalid"||m=="warn").length,notice:r}}const X=(e,n="")=>{let u=String(n),s=[];for(let l=0;l<e;l++)s[l]=u[l]||"";return{formatValue:s,dataValue:u}},F=(e="")=>{let n=e,u=n.join("");return{formatValue:n,dataValue:u}},Y=e=>{let b=e,{tone:n,required:u,form:s,name:l,className:c="",digits:r,numericOnly:m=!1,enableFormSubmit:_,checkValidationAtFirst:P,onChange:ee,onKeyDown:te,onValidate:ne,onUpdateValue:k,onUpdateValidValue:A,value:N="",override:ie,componentID:ae,listStyles:B}=b,E=S(b,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","override","componentID","listStyles"]);m&&(e.inputMode=e.inputMode||"numeric");let H=p(t({componentID:e.componentID||""},X(r,N)),{eventType:"init",eventID:y.uuid.gen()}),[i,f]=V(H),[h,L]=V({ok:!1,notice:[]});j({para:e,val_status:i,set_status:f,val_validate:h,set_validate:L,onUpdateValue:k,onUpdateValidValue:A,DefaultValidation:Q});let v=[];for(let a=0;a<r;a++){let W=i.formatValue[a],$={},x=c;e.combineInput&&(x=[c,R("DigitCharacterCell"),R("Combined")].join(" ")),v.push(I("input",{type:"text",inputMode:e.inputMode||"text",value:W,"data-form-name":s,id:"Digit-"+a+"-"+i.componentID,className:x,style:t(t({},e.style),$),onKeyDown:D=>{let{key:g,code:K}=D;if(g=="Tab")return;D.preventDefault();let d=null;if(g=="Backspace"){let o=i.formatValue;o[a]="",f(p(t(t({},i),F(o)),{eventType:"update",eventID:y.uuid.gen()})),d=a-1}else if(["ArrowLeft","ArrowRight"].includes(g)){let o=+(g=="ArrowRight")*2-1;d=a+o}else _&&U(D),(()=>{let o=K.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!o)return;let C=o[2]||o[3]||o[4];if(m&&!C.match(/\d/)||!C)return;let T=i.formatValue;T[a]=C,f(p(t(t({},i),F(T)),{eventType:"update",eventID:y.uuid.gen()})),d=a+1})();y.is.exist(d)&&O("#Digit-"+d+"-"+i.componentID).focus()},onChange:()=>{}},a))}return Z(w,{val_status:i,set_status:f,val_validate:h,para:e,children:[I(J,t({name:l,"data-input-type":"digitCharacters","data-form":s,"data-validation":h.ok,componentID:i.componentID,"data-value":i.dataValue},E)),I(G,p(t({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},B),{children:v}))]})},M=e=>{e=t({},e),e=t({textAlign:"center",width:0},e),e.combineInput&&(e=p(t({textAlign:"center",width:0},e),{freeCSS:t({minWidth:12*2,marginRight:-1},e.freeCSS),listStyles:t({borderRadius:"2.tone.secondary",border:"unset",gap:0},e.listStyles)}));let n=z.Boxish(e);return I(q,{componentID:e.componentID,children:Y,para:n})};export{M as DigitCharacters,M as default};
1
+ import{b as e,c as m,d as T}from"../../chunk-VY3566IV.js";import{jsx as I,jsxs as Y}from"react/jsx-runtime";import{useState as V}from"react";import y from"@mingoo/jsmin";import{$$fromRoot as $}from"../../@utils";import{Wrapper as K,BoxWrapper as O,SubmitForm as q,CommonEffects as U,DefaultStyles as j}from"./core";import z from"../../atoms/Flex";import G from"./Hidden";import{InputClasses as w}from"../../@styles/componentClasses";function J(t){let{value:a,states:s}=t,{required:u,numericOnly:o=!1,digits:c}=s,l=[];return u&&!a&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),a&&(o&&a.match(/\D/)&&l.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a.length!=c&&l.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!l.filter(({type:p})=>p=="invalid"||p=="warn").length,notice:l}}const Q=(t,a="")=>{let s=String(a),u=[];for(let o=0;o<t;o++)u[o]=s[o]||"";return{formatValue:u,dataValue:s}},R=(t="")=>{let a=t,s=a.join("");return{formatValue:a,dataValue:s}},X=t=>{let b=t,{tone:a,required:s,form:u,name:o,className:c="",digits:l,numericOnly:p=!1,enableFormSubmit:M,checkValidationAtFirst:Z,onChange:tt,onKeyDown:et,onValidate:at,onUpdateValue:_,onUpdateValidValue:k,value:A="",override:nt,componentID:it,listStyles:N}=b,B=T(b,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","override","componentID","listStyles"]);p&&(t.inputMode=t.inputMode||"numeric");let E=m(e({componentID:t.componentID||""},Q(l,A)),{eventType:"init",eventID:y.uuid.gen()}),[n,f]=V(E),[h,H]=V({ok:!1,notice:[]});U({states:t,val_status:n,set_status:f,val_validate:h,set_validate:H,onUpdateValue:_,onUpdateValidValue:k,DefaultValidation:J});let v=[];for(let i=0;i<l;i++){let L=n.formatValue[i],W={},x=c;t.combineInput&&(x=[c,w("DigitCharacterCell"),w("Combined")].join(" ")),v.push(I("input",{type:"text",inputMode:t.inputMode||"text",value:L,"data-form-name":u,id:"Digit-"+i+"-"+n.componentID,className:x,style:e(e({},t.style),W),onKeyDown:D=>{let{key:g,code:P}=D;if(g=="Tab")return;D.preventDefault();let d=null;if(g=="Backspace"){let r=n.formatValue;r[i]="",f(m(e(e({},n),R(r)),{eventType:"update",eventID:y.uuid.gen()})),d=i-1}else if(["ArrowLeft","ArrowRight"].includes(g)){let r=+(g=="ArrowRight")*2-1;d=i+r}else M&&q(D),(()=>{let r=P.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!r)return;let C=r[2]||r[3]||r[4];if(p&&!C.match(/\d/)||!C)return;let S=n.formatValue;S[i]=C,f(m(e(e({},n),R(S)),{eventType:"update",eventID:y.uuid.gen()})),d=i+1})();y.is.exist(d)&&$("#Digit-"+d+"-"+n.componentID).focus()},onChange:()=>{}},i))}return Y(O,{val_status:n,set_status:f,val_validate:h,states:t,children:[I(G,e({name:o,"data-input-type":"digitCharacters","data-form":u,"data-validation":h.ok,componentID:n.componentID,"data-value":n.dataValue},B)),I(z,m(e({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},N),{children:v}))]})},F=t=>{t=e({},t),t=e({textAlign:"center",width:0},t),t.combineInput&&(t=m(e({textAlign:"center",width:0},t),{freeCSS:e({minWidth:12*2,marginRight:-1},t.freeCSS),listStyles:e({borderRadius:"2.tone.secondary",border:"unset",gap:0},t.listStyles)}));let a=j.Boxish(t);return I(K,{componentID:t.componentID,children:X,states:a})};export{F as DigitCharacters,F as default};
@@ -13,7 +13,7 @@ declare namespace Filer {
13
13
  fileNameEdit?: boolean;
14
14
  systemOnly?: boolean;
15
15
  accept?: Accept;
16
- cellStyles?: TagProperty.Para;
16
+ cellStyles?: TagProperty.States;
17
17
  cellClassName?: string;
18
18
  };
19
19
  type CustomFile = File & {
@@ -22,7 +22,7 @@ declare namespace Filer {
22
22
  type Accept = 'image' | string;
23
23
  type ListInput = {
24
24
  files: File[];
25
- para: Filer.Input;
25
+ states: Filer.Input;
26
26
  val_status: InputTypes.Status.Plain;
27
27
  set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
28
28
  };
@@ -36,7 +36,7 @@ declare namespace Filer {
36
36
  };
37
37
  type FNs = {
38
38
  fn: {
39
- openDialog(para: {
39
+ openDialog(p: {
40
40
  accept?: Accept;
41
41
  multiple?: boolean;
42
42
  }): Promise<File[]>;
@@ -1 +1 @@
1
- import{b as g,c as x,d as Z,e as $}from"../../chunk-VY3566IV.js";import{Fragment as ee,jsx as n,jsxs as d}from"react/jsx-runtime";import{useState as q,useEffect as te}from"react";import h from"@mingoo/jsmin";import{$$fromRoot as P,useStore as Q,GenerateClassName as ae}from"../../@utils";import y from"../../atoms/Box";import L from"../../atoms/FAI";import W from"../../atoms/Flex";import X from"../../mols/Column";import le from"../../mols/Row";import M from"../Button";import H from"../Snackbar";import{Wrapper as ne,BoxWrapper as ie,CommonEffects as oe,DefaultStyles as se}from"./core";import re from"./Text";import{InputFilerClasses as c}from"../../@styles/componentClasses";import{faCloudArrowUp as pe}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function ue(e){let{value:t,para:a}=e,{required:s}=a,l=[];return s&&!t.length&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!l.filter(({type:p})=>p=="invalid").length,notice:l}}const Y={List:e=>{let{files:t,para:a,val_status:s,set_status:l}=e,p=(a.limit||1)-s.dataValue.length,m=t.map((u,S)=>n(Y.Cell,{index:S,file:u,className:a.cellClassName,val_status:s,set_status:l,fileNameEdit:a.fileNameEdit},u.name));return p>0&&m.push(n("label",{className:[a.cellClassName,c("AddButton")].join(" "),"data-component-id":s.componentID,htmlFor:a.id,tabIndex:a.tabIndex,onKeyDown:u=>{let{key:S}=u;a.tabIndex!=-1&&[" ","Enter"].includes(S)&&P("#"+a.id).click()},children:d(le.Center,{padding:["1/3",0],children:[n(y,{isRounded:!0,className:c("AddIcon"),children:n(L,{icon:pe,className:c("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"theme.opa.low",ssSphere:3,padding:"1/2"})}),d(y,{children:[n(y,{children:`\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\uFF08${p}\uFF09`,fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0}),n(y,{isSemiBoldFont:!0,fontColor:"4.thin",fontSize:"0.xs",children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})},"AddButton")),n(X,{flexSizing:"auto",className:a.className,children:m})},Cell:e=>{let{index:t,file:a,className:s,val_status:l,set_status:p,fileNameEdit:m=!0}=e,{name:u,size:S,type:i}=a,[V,b]=q(!1),N=h.uuid.gen(),_=S.rank(),[G,O]=u.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" "),o="\u30D5\u30A1\u30A4\u30EB";return i.match(/image/)?o=i.replace(/image\//,""):i.match(/pdf/)?o="PDF":i.match(/csv/)?o="CSV":i.match(/spreadsheet/)?o="SpreadSheet":i.match(/presentation/)?o="PowerPoint":i.match(/word/)?o="Word":i.match(/zip/)?o="Zip":i.match(/powerpoint/)?o="PowerPoint":i.match(/html/)?o="HTML":i.match(/js/)?o="JavaScript":i.match(/css/)?o="CSS":i.match(/text\/plain/)&&(o="\u30C6\u30AD\u30B9\u30C8"),te(()=>{V&&setTimeout(()=>{P("#"+N).focus()},100)},[V]),d(W,{verticalAlign:"center",flexWrap:!1,gap:1,className:s,children:[n(L.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),d(y,{flexSizing:0,children:[n(y,{children:n(W,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:c("FileName"),children:V?n(ee,{children:d(X,{gap:"1/2",flexSizing:0,children:[d(W,{gap:"2/3",verticalAlign:"center",children:[n(re.Normal,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:N,form:"form-"+N,enableFormSubmit:!0,value:G,onKeyDown:f=>{let{key:k}=f;k=="Escape"&&b(!1)}}),d(y,{children:[". ",O]})]}),d(W,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[n(M.Button.Sub.R,{padding:["2/3",1],children:"\u9589\u3058\u308B",onClick:()=>{b(!1)}}),n(M.Button.Prime.R,{padding:["2/3",1],submitOption:{formName:"form-"+N,callback:f=>$(void 0,null,function*(){let{name:k}=f,w=[...l.dataValue],T=w[t],U=T.id;if(!T)return;let{target:r}=yield T.read();if(!r)return;let D=yield String(r.result).toBlob(a.type);if(!D)return;let z=new File([D],k+"."+O,{type:T.type});z.id=U,w[t]=z,p(x(g({},l),{dataValue:w,eventType:"update",eventID:h.uuid.gen()})),b(!1)})},children:"\u6C7A\u5B9A"})]})]})}):d(ee,{children:[u,!!m&&n(M.Button.Clear.R,{ssSphere:2.5,flexSizing:"none",color:"cloud",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",onClick:()=>{b(!0)},children:n(L.Pen,{})})]})})}),!V&&n(y,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:o+"\u30D5\u30A1\u30A4\u30EB / "+_+"B"})]}),n(M.Button.Sub.R,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let f=[...l.dataValue];f[t]&&(f.splice(t,1),p(x(g({},l),{dataValue:f,eventType:"update",eventID:h.uuid.gen()})))},children:n(L.Times,{})})]})}},me=e=>{let J=e,{tone:t,required:a,form:s,fileNameEdit:l=!0,systemOnly:p=!1,accept:m="*",limit:u=1,checkValidationAtFirst:S,onChange:i,onValidate:V,onUpdateValue:b,onUpdateValidValue:N,value:_=[],className:G,cellStyles:O,cellClassName:o,componentID:f,status_id:k,enableFormSubmit:w}=J,T=Z(J,["tone","required","form","fileNameEdit","systemOnly","accept","limit","checkValidationAtFirst","onChange","onValidate","onUpdateValue","onUpdateValidValue","value","className","cellStyles","cellClassName","componentID","status_id","enableFormSubmit"]),U={componentID:e.componentID||"",dataValue:_,eventType:"init",eventID:h.uuid.gen()},[r,B]=q(U),[D,z]=q({ok:!1,notice:[]});oe({type:"file",para:e,val_status:r,set_status:B,val_validate:D,set_validate:z,DefaultValidation:ue,onUpdateValue:b,onUpdateValidValue:N,ExtraOverrideParams:{dataValue:_,formatValue:_},ExtraStoreParams:{AddFiles:A=>$(void 0,null,function*(){let R=Q.get(r.componentID).Files,v=[];for(var F=0;F<(A==null?void 0:A.length);F++){let I=A[F],{type:E,name:C}=I;if(F+1+R.length>u){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u9078\u629E\u4E0A\u9650\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${C}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}if(m&&m=="image"&&!E.match(/image/)){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u7570\u306A\u308B\u305F\u3081\u3001${C} \u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}v.push(I)}B(x(g({},r),{dataValue:[...R,...v],eventType:"update",eventID:h.uuid.gen()}))})}});let j="";return m&&(m=="image"?j="image/png,image/jpeg":j=m),d(ie,{val_status:r,set_status:B,val_validate:D,para:e,children:[n("input",x(g({type:"file",className:c("Input"),"data-form":s,"data-input-type":"file","data-component-id":r.componentID,"data-validation":D.ok,accept:j,multiple:u!=1,onChange:A=>$(void 0,null,function*(){let R=A.target,v=R.files,F=[];for(var I=0;I<(v==null?void 0:v.length);I++){let E=v[I],C=E.name;if(E.id=h.uuid.gen(),I+1+r.dataValue.length>u){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u767B\u9332\u6570\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${C}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,backgroundColor:"nega"});continue}F.push(E)}B(x(g({},r),{dataValue:[...r.dataValue,...F],eventType:"update",eventID:h.uuid.gen()})),R.value=""})},T),{tabIndex:-1,value:""})),!p&&n(Y.List,{files:r.dataValue,para:e,val_status:r,set_status:B})]})};h(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),P("."+c("AddButton")).addClass(c("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),P("."+c("AddButton")).removeClass(c("Draggable"));let t=e.dataTransfer.files;if(t.length){let a=e.target;if(P(a).hasClass(c("AddButton"))){let{componentId:s}=a.dataset,l=Q.get(s);l&&l.AddFiles&&l.AddFiles(t)}}},options:{passive:!1}});const K=e=>{e=g({},e),e.override="force";let t=ae(e);return t.cellClassName=[t.cellClassName,se.Boxish(x(g({},t.cellStyles),{tone:t.tone})).className].join(" "),n(ne,{componentID:e.componentID,children:me,para:t})};K.fn={openDialog:e=>{let{multiple:t,accept:a}=e;return new Promise(s=>{const l=document.createElement("input");l.type="file",l.multiple=t!=null?t:!0,a&&(a=="image"?l.accept="image/png,image/jpeg":l.accept=a),l.onchange=p=>{s(p.target.files)},l.click()})}};export{K as Filer,K as default};
1
+ import{b as g,c as C,d as Z,e as $}from"../../chunk-VY3566IV.js";import{Fragment as ee,jsx as n,jsxs as m}from"react/jsx-runtime";import{useState as q,useEffect as te}from"react";import h from"@mingoo/jsmin";import{$$fromRoot as E,useStore as Q,GenerateClassName as ae}from"../../@utils";import y from"../../atoms/Box";import L from"../../atoms/FAI";import W from"../../atoms/Flex";import X from"../../mols/Column";import le from"../../mols/Row";import M from"../Button";import H from"../Snackbar";import{Wrapper as ne,BoxWrapper as ie,CommonEffects as oe,DefaultStyles as se}from"./core";import re from"./Text";import{InputFilerClasses as d}from"../../@styles/componentClasses";import{faCloudArrowUp as pe}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function ue(e){let{value:t,states:a}=e,{required:s}=a,l=[];return s&&!t.length&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!l.filter(({type:p})=>p=="invalid").length,notice:l}}const Y={List:e=>{let{files:t,states:a,val_status:s,set_status:l}=e,p=(a.limit||1)-s.dataValue.length,c=t.map((u,x)=>n(Y.Cell,{index:x,file:u,className:a.cellClassName,val_status:s,set_status:l,fileNameEdit:a.fileNameEdit},u.name));return p>0&&c.push(n("label",{className:[a.cellClassName,d("AddButton")].join(" "),"data-component-id":s.componentID,htmlFor:a.id,tabIndex:a.tabIndex,onKeyDown:u=>{let{key:x}=u;a.tabIndex!=-1&&[" ","Enter"].includes(x)&&E("#"+a.id).click()},children:m(le.Center,{padding:["1/3",0],children:[n(y,{isRounded:!0,className:d("AddIcon"),children:n(L,{icon:pe,className:d("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"theme.opa.low",ssSphere:3,padding:"1/2"})}),m(y,{children:[n(y,{children:`\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\uFF08${p}\uFF09`,fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0}),n(y,{isSemiBoldFont:!0,fontColor:"4.thin",fontSize:"0.xs",children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})},"AddButton")),n(X,{flexSizing:"auto",className:a.className,children:c})},Cell:e=>{let{index:t,file:a,className:s,val_status:l,set_status:p,fileNameEdit:c=!0}=e,{name:u,size:x,type:i}=a,[V,b]=q(!1),N=h.uuid.gen(),_=x.rank(),[G,O]=u.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" "),o="\u30D5\u30A1\u30A4\u30EB";return i.match(/image/)?o=i.replace(/image\//,""):i.match(/pdf/)?o="PDF":i.match(/csv/)?o="CSV":i.match(/spreadsheet/)?o="SpreadSheet":i.match(/presentation/)?o="PowerPoint":i.match(/word/)?o="Word":i.match(/zip/)?o="Zip":i.match(/powerpoint/)?o="PowerPoint":i.match(/html/)?o="HTML":i.match(/js/)?o="JavaScript":i.match(/css/)?o="CSS":i.match(/text\/plain/)&&(o="\u30C6\u30AD\u30B9\u30C8"),te(()=>{V&&setTimeout(()=>{E("#"+N).focus()},100)},[V]),m(W,{verticalAlign:"center",flexWrap:!1,gap:1,className:s,children:[n(L.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),m(y,{flexSizing:0,children:[n(y,{children:n(W,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:d("FileName"),children:V?n(ee,{children:m(X,{gap:"1/2",flexSizing:0,children:[m(W,{gap:"2/3",verticalAlign:"center",children:[n(re.Normal,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:N,form:"form-"+N,enableFormSubmit:!0,value:G,onKeyDown:f=>{let{key:k}=f;k=="Escape"&&b(!1)}}),m(y,{children:[". ",O]})]}),m(W,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[n(M.Button.Sub.R,{padding:["2/3",1],children:"\u9589\u3058\u308B",onClick:()=>{b(!1)}}),n(M.Button.Prime.R,{padding:["2/3",1],submitOption:{formName:"form-"+N,callback:f=>$(void 0,null,function*(){let{name:k}=f,P=[...l.dataValue],T=P[t],U=T.id;if(!T)return;let{target:r}=yield T.read();if(!r)return;let D=yield String(r.result).toBlob(a.type);if(!D)return;let z=new File([D],k+"."+O,{type:T.type});z.id=U,P[t]=z,p(C(g({},l),{dataValue:P,eventType:"update",eventID:h.uuid.gen()})),b(!1)})},children:"\u6C7A\u5B9A"})]})]})}):m(ee,{children:[u,!!c&&n(M.Button.Clear.R,{ssSphere:2.5,flexSizing:"none",color:"cloud",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",onClick:()=>{b(!0)},children:n(L.Pen,{})})]})})}),!V&&n(y,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:o+"\u30D5\u30A1\u30A4\u30EB / "+_+"B"})]}),n(M.Button.Sub.R,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let f=[...l.dataValue];f[t]&&(f.splice(t,1),p(C(g({},l),{dataValue:f,eventType:"update",eventID:h.uuid.gen()})))},children:n(L.Times,{})})]})}},ce=e=>{let J=e,{tone:t,required:a,form:s,fileNameEdit:l=!0,systemOnly:p=!1,accept:c="*",limit:u=1,checkValidationAtFirst:x,onChange:i,onValidate:V,onUpdateValue:b,onUpdateValidValue:N,value:_=[],className:G,cellStyles:O,cellClassName:o,componentID:f,status_id:k,enableFormSubmit:P}=J,T=Z(J,["tone","required","form","fileNameEdit","systemOnly","accept","limit","checkValidationAtFirst","onChange","onValidate","onUpdateValue","onUpdateValidValue","value","className","cellStyles","cellClassName","componentID","status_id","enableFormSubmit"]),U={componentID:e.componentID||"",dataValue:_,eventType:"init",eventID:h.uuid.gen()},[r,B]=q(U),[D,z]=q({ok:!1,notice:[]});oe({type:"file",states:e,val_status:r,set_status:B,val_validate:D,set_validate:z,DefaultValidation:ue,onUpdateValue:b,onUpdateValidValue:N,ExtraOverrideStates:{dataValue:_,formatValue:_},ExtraStoreStates:{AddFiles:A=>$(void 0,null,function*(){let R=Q.get(r.componentID).Files,v=[];for(var F=0;F<(A==null?void 0:A.length);F++){let I=A[F],{type:w,name:S}=I;if(F+1+R.length>u){H.add({componentID:S,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u9078\u629E\u4E0A\u9650\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${S}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}if(c&&c=="image"&&!w.match(/image/)){H.add({componentID:S,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u7570\u306A\u308B\u305F\u3081\u3001${S} \u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}v.push(I)}B(C(g({},r),{dataValue:[...R,...v],eventType:"update",eventID:h.uuid.gen()}))})}});let j="";return c&&(c=="image"?j="image/png,image/jpeg":j=c),m(ie,{val_status:r,set_status:B,val_validate:D,states:e,children:[n("input",C(g({type:"file",className:d("Input"),"data-form":s,"data-input-type":"file","data-component-id":r.componentID,"data-validation":D.ok,accept:j,multiple:u!=1,onChange:A=>$(void 0,null,function*(){let R=A.target,v=R.files,F=[];for(var I=0;I<(v==null?void 0:v.length);I++){let w=v[I],S=w.name;if(w.id=h.uuid.gen(),I+1+r.dataValue.length>u){H.add({componentID:S,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u767B\u9332\u6570\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${S}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,backgroundColor:"nega"});continue}F.push(w)}B(C(g({},r),{dataValue:[...r.dataValue,...F],eventType:"update",eventID:h.uuid.gen()})),R.value=""})},T),{tabIndex:-1,value:""})),!p&&n(Y.List,{files:r.dataValue,states:e,val_status:r,set_status:B})]})};h(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),E("."+d("AddButton")).addClass(d("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),E("."+d("AddButton")).removeClass(d("Draggable"));let t=e.dataTransfer.files;if(t.length){let a=e.target;if(E(a).hasClass(d("AddButton"))){let{componentId:s}=a.dataset,l=Q.get(s);l&&l.AddFiles&&l.AddFiles(t)}}},options:{passive:!1}});const K=e=>{e=g({},e),e.override="force";let t=ae(e);return t.cellClassName=[t.cellClassName,se.Boxish(C(g({},t.cellStyles),{tone:t.tone})).className].join(" "),n(ne,{componentID:e.componentID,children:ce,states:t})};K.fn={openDialog:e=>{let{multiple:t,accept:a}=e;return new Promise(s=>{const l=document.createElement("input");l.type="file",l.multiple=t!=null?t:!0,a&&(a=="image"?l.accept="image/png,image/jpeg":l.accept=a),l.onchange=p=>{s(p.target.files)},l.click()})}};export{K as Filer,K as default};
@@ -9,5 +9,5 @@ declare namespace Hidden {
9
9
  value?: string | number | plainObject;
10
10
  };
11
11
  }
12
- declare const Hidden: (para: Hidden.Input) => import("react/jsx-runtime").JSX.Element;
12
+ declare const Hidden: (p: Hidden.Input) => import("react/jsx-runtime").JSX.Element;
13
13
  export { Hidden, Hidden as default };
@@ -1 +1 @@
1
- import{b as i,c as o,d as r}from"../../chunk-VY3566IV.js";import{jsx as d}from"react/jsx-runtime";import{Wrapper as l}from"./core";const s=n=>{let e=n,{componentID:p="",enableFormSubmit:c,form:m,value:t=""}=e,u=r(e,["componentID","enableFormSubmit","form","value"]);return d("input",o(i({value:JSON.stringify(t),"data-input-type":"hidden","data-form":m,"data-component-id":p,"data-value":JSON.stringify(t)},u),{type:"hidden"}))},a=n=>d(l,{componentID:n.componentID,children:s,para:n});export{a as Hidden,a as default};
1
+ import{b as i,c as a,d as o}from"../../chunk-VY3566IV.js";import{jsx as d}from"react/jsx-runtime";import{Wrapper as s}from"./core";const l=t=>{let e=t,{componentID:p="",enableFormSubmit:c,form:m,value:n=""}=e,u=o(e,["componentID","enableFormSubmit","form","value"]);return d("input",a(i({value:JSON.stringify(n),"data-input-type":"hidden","data-form":m,"data-component-id":p,"data-value":JSON.stringify(n)},u),{type:"hidden"}))},r=t=>d(s,{componentID:t.componentID,children:l,states:t});export{r as Hidden,r as default};
@@ -16,9 +16,9 @@ declare namespace List {
16
16
  hideInput?: boolean;
17
17
  leftIndicator?: ReactElement | false;
18
18
  rightIndicator?: ReactElement | false;
19
- cellStyles?: TagProperty.Para;
19
+ cellStyles?: TagProperty.States;
20
20
  cellClassName?: string;
21
- cellCheckedStyles?: TagProperty.Para;
21
+ cellCheckedStyles?: TagProperty.States;
22
22
  cellCheckedClassName?: string;
23
23
  defaultActiveStyling?: boolean;
24
24
  };
@@ -31,11 +31,11 @@ declare namespace List {
31
31
  label: ReactElement;
32
32
  disabled?: boolean;
33
33
  className?: string;
34
- checkedStyles?: TagProperty.Para;
34
+ checkedStyles?: TagProperty.States;
35
35
  checkedClassName?: string;
36
- } & TagProperty.Para;
36
+ } & TagProperty.States;
37
37
  type ListInput = {
38
- para: List.Plain;
38
+ states: List.Plain;
39
39
  val_status: InputTypes.Status.Plain;
40
40
  set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
41
41
  };
@@ -1 +1 @@
1
- import{b as t,c,d as B}from"../../chunk-VY3566IV.js";import{jsx as l,jsxs as te}from"react/jsx-runtime";import{useState as X}from"react";import b from"@mingoo/jsmin";import{$$fromRoot as ne}from"../../@utils";import D from"../../atoms/Box";import ie from"../../atoms/Flex";import oe from"../../atoms/FAI";import se from"../Button";import{BoxWrapper as re,SubmitForm as ce,CommonEffects as ue,DefaultStyles as de,Wrapper as pe}from"./core";import fe from"./Hidden";import{InputListClasses as s}from"../../@styles/componentClasses";function me(e){let{value:n,para:i}=e,{type:I,required:u,minSelect:a=0}=i,o=[];return u&&(n.length||I=="radio"&&o.push({type:"invalid",label:"\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"})),a&&n.length<a&&o.push({type:"invalid",label:`${a}\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044`}),{ok:!o.filter(({type:r})=>r=="invalid").length,notice:o}}const ye=e=>{let{value:n,options:i=[]}=e,I=b.is.exist(n)?b.flatArray(n):[],u=i.map(o=>{let{value:r,label:h}=o;return c(t({},o),{value:JSON.stringify(r),label:h})}),a=[];return I.forEach(o=>{let r=JSON.stringify(o);u.findIndex(k=>k.value==r)!=-1&&a.push(r)}),l(P.Core,c(t({},e),{value:a,options:u}))},P={Core:e=>{let N=e,{type:n,tone:i,required:I,componentID:u="",form:a,override:o,freeCSS:r,icon:h,iconType:k,enableFormSubmit:$,defaultActiveStyling:J,checkValidationAtFirst:W,onValidate:j,onUpdateValue:R,onUpdateValidValue:_,value:A,options:v,leftIndicator:z,rightIndicator:U,className:F,cellStyles:q,cellClassName:w,cellCheckedStyles:H,cellCheckedClassName:K}=N,T=B(N,["type","tone","required","componentID","form","override","freeCSS","icon","iconType","enableFormSubmit","defaultActiveStyling","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName"]),S={componentID:u,dataValue:A,eventType:"init",eventID:b.uuid.gen()},[d,C]=X(S),[x,g]=X({ok:!1,notice:[]});return ue({type:"list",para:e,val_status:d,set_status:C,val_validate:x,set_validate:g,onUpdateValue:R,onUpdateValidValue:_,DefaultValidation:me}),te(re,{val_status:d,set_status:C,val_validate:x,para:e,children:[l(fe,c(t({"data-value":JSON.stringify(d.dataValue),form:a,"data-input-type":n,"data-validation":x.ok},T),{componentID:d.componentID})),l(P.List,{para:e,val_status:d,set_status:C})]})},List:e=>{let{para:n,val_status:i,set_status:I}=e,{componentID:u,type:a,tone:o,icon:r=!0,options:h,name:k,form:$,tabIndex:J,hideInput:W,disabled:j,className:R,cellStyles:_,cellClassName:A="",cellCheckedStyles:v,cellCheckedClassName:z="",enableFormSubmit:U,defaultActiveStyling:F=!0}=n,{dataValue:q}=i,w=r?l(D,{flexSizing:"none",children:n.iconType=="radio"?l(P.RadioIcon,{}):n.iconType=="checkbox"?l(P.CheckboxIcon,{}):null}):null,H=h.map((K,T)=>{let Q=K,{value:S,label:d,disabled:C=j,className:x="",checkedStyles:g,checkedClassName:N=""}=Q,ae=B(Q,["value","label","disabled","className","checkedStyles","checkedClassName"]),G=b.uuid.gen(),M=q.findIndex(p=>p===S)!=-1,L=t(t({},_),ae),O=[s("Label"),s("defaultActiveStyling_"+!!F),A,x];return M&&(L=c(t(t(t({},L),v),g),{freeCSS:t(t(t({},L.freeCSS),v==null?void 0:v.freeCSS),g==null?void 0:g.freeCSS)}),O=[...O,z,N]),[l("input",{type:a=="radio"?"radio":"checkbox",className:[s("Input"),s("defaultActiveStyling_"+!!F)].join(" "),name:"RadioCheckbox-"+k,"data-list-index":u+"-"+T,id:G,value:String(S),"data-form-name":$,disabled:C,checked:M,onFocus:p=>{if(C||a!="radio"||i.dataValue.length)return;let{value:f,checked:V}=p.target,m=[f];I(c(t({},i),{dataValue:m,eventType:"update",eventID:b.uuid.gen()}))},onChange:p=>{if(C)return;let{value:f,checked:V}=p.target,m=[];if(a=="radio")m=[f];else if(a=="checkbox"||a=="checker")if(V)m=[...i.dataValue,f];else{let y=[...i.dataValue];y.splice(i.dataValue.findIndex(le=>le==f),1),m=y}I(c(t({},i),{dataValue:m,eventType:"update",eventID:b.uuid.gen()}))},onKeyDown:p=>{let{key:f,shiftKey:V}=p;if((a=="checkbox"||a=="checker")&&f!="Tab"){if(f.match(/Arrow/)){p.preventDefault();let m=["ArrowLeft","ArrowUp"].includes(f)?-1:1,y=T+m;y<0?y=h.length-1:y>=h.length&&(y=0),ne(`input[data-list-index="${u}-${y}"]`).focus()}}U&&ce(p)},tabIndex:J},"List-"+JSON.stringify(S)),te(se.Label.Plain,c(t({htmlFor:G,className:O.join(" "),tabIndex:-1,display:"flex",ssEffectsOnActive:!1,verticalAlign:"center",gap:"1/3",flexWrap:!1},L),{children:[w,b.is.string(d)?l(D,{children:d}):d]}),"ListTrigger-"+JSON.stringify(S))]});return l(ie,{flexSizing:"auto",freeCSS:t({},n.freeCSS),className:[R,s("CellBase"),s("HideInput_"+W),s("IconIndicator_"+!!r),s("Tone_"+o)].join(" "),children:H})},RadioIcon:()=>l(D,{className:s("Icon"),backgroundColor:"layer.1",border:!0,transition:"middle",position:"relative",borderRadius:"sphere",flexCenter:!0}),CheckboxIcon:()=>l(D,{className:[s("Icon"),s("CheckboxIcon")].join(" "),borderRadius:"3.tone.tertiary",backgroundColor:"layer.1",border:!0,transition:"middle",fontColor:"white",position:"relative",flexCenter:!0,children:l(oe.Check,{className:s("I"),transition:"middle",opacity:"trans",freeCSS:{zIndex:8}})})},E=e=>{e=t({},e);let n=de.ListCell(e);return l(pe,{componentID:e.componentID,children:ye,para:n})},Y=e=>l(E,c(t({iconType:"radio",tone:e.tone},e),{type:"radio"})),Z=e=>l(E,c(t({iconType:"checkbox",tone:e.tone},e),{type:"checkbox"})),ee={Plain:E,Radio:Y,Checkbox:Z};export{Z as Checkbox,ee as List,Y as Radio,ee as default};
1
+ import{b as t,c,d as B}from"../../chunk-VY3566IV.js";import{jsx as l,jsxs as te}from"react/jsx-runtime";import{useState as X}from"react";import S from"@mingoo/jsmin";import{$$fromRoot as ne}from"../../@utils";import D from"../../atoms/Box";import ie from"../../atoms/Flex";import se from"../../atoms/FAI";import oe from"../Button";import{BoxWrapper as re,SubmitForm as ce,CommonEffects as ue,DefaultStyles as de,Wrapper as pe}from"./core";import fe from"./Hidden";import{InputListClasses as o}from"../../@styles/componentClasses";function me(e){let{value:n,states:i}=e,{type:I,required:u,minSelect:a=0}=i,s=[];return u&&(n.length||I=="radio"&&s.push({type:"invalid",label:"\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"})),a&&n.length<a&&s.push({type:"invalid",label:`${a}\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044`}),{ok:!s.filter(({type:r})=>r=="invalid").length,notice:s}}const ye=e=>{let{value:n,options:i=[]}=e,I=S.is.exist(n)?S.flatArray(n):[],u=i.map(s=>{let{value:r,label:h}=s;return c(t({},s),{value:JSON.stringify(r),label:h})}),a=[];return I.forEach(s=>{let r=JSON.stringify(s);u.findIndex(k=>k.value==r)!=-1&&a.push(r)}),l(R.Core,c(t({},e),{value:a,options:u}))},R={Core:e=>{let N=e,{type:n,tone:i,required:I,componentID:u="",form:a,override:s,freeCSS:r,icon:h,iconType:k,enableFormSubmit:$,defaultActiveStyling:w,checkValidationAtFirst:J,onValidate:W,onUpdateValue:_,onUpdateValidValue:P,value:A,options:v,leftIndicator:j,rightIndicator:z,className:F,cellStyles:U,cellClassName:q,cellCheckedStyles:H,cellCheckedClassName:K}=N,T=B(N,["type","tone","required","componentID","form","override","freeCSS","icon","iconType","enableFormSubmit","defaultActiveStyling","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName"]),b={componentID:u,dataValue:A,eventType:"init",eventID:S.uuid.gen()},[d,C]=X(b),[x,g]=X({ok:!1,notice:[]});return ue({type:"list",states:e,val_status:d,set_status:C,val_validate:x,set_validate:g,onUpdateValue:_,onUpdateValidValue:P,DefaultValidation:me}),te(re,{val_status:d,set_status:C,val_validate:x,states:e,children:[l(fe,c(t({"data-value":JSON.stringify(d.dataValue),form:a,"data-input-type":n,"data-validation":x.ok},T),{componentID:d.componentID})),l(R.List,{states:e,val_status:d,set_status:C})]})},List:e=>{let{states:n,val_status:i,set_status:I}=e,{componentID:u,type:a,tone:s,icon:r=!0,options:h,name:k,form:$,tabIndex:w,hideInput:J,disabled:W,className:_,cellStyles:P,cellClassName:A="",cellCheckedStyles:v,cellCheckedClassName:j="",enableFormSubmit:z,defaultActiveStyling:F=!0}=n,{dataValue:U}=i,q=r?l(D,{flexSizing:"none",children:n.iconType=="radio"?l(R.RadioIcon,{}):n.iconType=="checkbox"?l(R.CheckboxIcon,{}):null}):null,H=h.map((K,T)=>{let Q=K,{value:b,label:d,disabled:C=W,className:x="",checkedStyles:g,checkedClassName:N=""}=Q,ae=B(Q,["value","label","disabled","className","checkedStyles","checkedClassName"]),G=S.uuid.gen(),M=U.findIndex(p=>p===b)!=-1,L=t(t({},P),ae),O=[o("Label"),o("defaultActiveStyling_"+!!F),A,x];return M&&(L=c(t(t(t({},L),v),g),{freeCSS:t(t(t({},L.freeCSS),v==null?void 0:v.freeCSS),g==null?void 0:g.freeCSS)}),O=[...O,j,N]),[l("input",{type:a=="radio"?"radio":"checkbox",className:[o("Input"),o("defaultActiveStyling_"+!!F)].join(" "),name:"RadioCheckbox-"+k,"data-list-index":u+"-"+T,id:G,value:String(b),"data-form-name":$,disabled:C,checked:M,onFocus:p=>{if(C||a!="radio"||i.dataValue.length)return;let{value:f,checked:V}=p.target,m=[f];I(c(t({},i),{dataValue:m,eventType:"update",eventID:S.uuid.gen()}))},onChange:p=>{if(C)return;let{value:f,checked:V}=p.target,m=[];if(a=="radio")m=[f];else if(a=="checkbox"||a=="checker")if(V)m=[...i.dataValue,f];else{let y=[...i.dataValue];y.splice(i.dataValue.findIndex(le=>le==f),1),m=y}I(c(t({},i),{dataValue:m,eventType:"update",eventID:S.uuid.gen()}))},onKeyDown:p=>{let{key:f,shiftKey:V}=p;if((a=="checkbox"||a=="checker")&&f!="Tab"){if(f.match(/Arrow/)){p.preventDefault();let m=["ArrowLeft","ArrowUp"].includes(f)?-1:1,y=T+m;y<0?y=h.length-1:y>=h.length&&(y=0),ne(`input[data-list-index="${u}-${y}"]`).focus()}}z&&ce(p)},tabIndex:w},"List-"+JSON.stringify(b)),te(oe.Label.Plain,c(t({htmlFor:G,className:O.join(" "),tabIndex:-1,display:"flex",ssEffectsOnActive:!1,verticalAlign:"center",gap:"1/3",flexWrap:!1},L),{children:[q,S.is.string(d)?l(D,{children:d}):d]}),"ListTrigger-"+JSON.stringify(b))]});return l(ie,{flexSizing:"auto",freeCSS:t({},n.freeCSS),className:[_,o("CellBase"),o("HideInput_"+J),o("IconIndicator_"+!!r),o("Tone_"+s)].join(" "),children:H})},RadioIcon:()=>l(D,{className:o("Icon"),backgroundColor:"layer.1",border:!0,transition:"middle",position:"relative",borderRadius:"sphere",flexCenter:!0}),CheckboxIcon:()=>l(D,{className:[o("Icon"),o("CheckboxIcon")].join(" "),borderRadius:"3.tone.tertiary",backgroundColor:"layer.1",border:!0,transition:"middle",fontColor:"white",position:"relative",flexCenter:!0,children:l(se.Check,{className:o("I"),transition:"middle",opacity:"trans",freeCSS:{zIndex:8}})})},E=e=>{e=t({},e);let n=de.ListCell(e);return l(pe,{componentID:e.componentID,children:ye,states:n})},Y=e=>l(E,c(t({iconType:"radio",tone:e.tone},e),{type:"radio"})),Z=e=>l(E,c(t({iconType:"checkbox",tone:e.tone},e),{type:"checkbox"})),ee={Plain:E,Radio:Y,Checkbox:Z};export{Z as Checkbox,ee as List,Y as Radio,ee as default};
@@ -12,7 +12,7 @@ declare namespace Parts {
12
12
  LeftIcon: React.FC<Input>;
13
13
  RightIcon: React.FC<Input>;
14
14
  };
15
- type Input = TagProperty.Para & {
15
+ type Input = TagProperty.States & {
16
16
  tone?: InputTypes.BoxTone;
17
17
  className?: string;
18
18
  children: ReactElement;
@@ -1 +1 @@
1
- import{b as t,c as n,d as p}from"../../chunk-VY3566IV.js";import{jsx as i}from"react/jsx-runtime";import c from"../../atoms/Box";import u from"../../atoms/Span";import{DefaultStyles as a}from"./core";const s={RequiredSign:e=>i(u,t({fontColor:"white",fontSize:"0.xs",padding:["1/4","1/3"],backgroundColor:"nega",borderRadius:"3.tone.tertiary",children:"\u5FC5\u9808"},e)),RequiredShortSign:e=>i(u,t({fontColor:"nega",padding:["1/4","1/3"],borderRadius:"3.tone.tertiary",children:"*"},e)),OmitSign:e=>i(u,t({fontColor:"white",fontSize:"0.xs",padding:["1/4","1/3"],borderRadius:"3.tone.tertiary",backgroundColor:"layer.6",children:"\u7701\u7565\u53EF"},e)),LeftIndicator:e=>{let r=e,{tone:d}=r,o=p(r,["tone"]);return i(c,t(n(t({},a.Indicator(d)),{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3"}),o))},RightIndicator:e=>{let r=e,{tone:d}=r,o=p(r,["tone"]);return i(c,t(n(t({},a.Indicator(d)),{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3"}),o))},RightIcon:e=>{let r=e,{tone:d="border"}=r,o=p(r,["tone"]);return i(c,n(t(n(t({},a.IndicatorIcon),{right:"3/4"}),o),{freeCSS:t(t({zIndex:6,pointerEvents:"none"},a.IndicatorIcon.freeCSS),o.freeCSS)}))},LeftIcon:e=>{let r=e,{tone:d="border"}=r,o=p(r,["tone"]);return i(c,n(t(n(t({},a.IndicatorIcon),{left:"3/4"}),o),{freeCSS:t(t({zIndex:6,pointerEvents:"none"},a.IndicatorIcon.freeCSS),o.freeCSS)}))}};export{s as Parts,s as default};
1
+ import{b as t,c as n,d as p}from"../../chunk-VY3566IV.js";import{jsx as i}from"react/jsx-runtime";import c from"../../atoms/Box";import s from"../../atoms/Span";import{DefaultStyles as a}from"./core";const u={RequiredSign:e=>i(s,t({fontColor:"white",fontSize:"0.xs",padding:["1/4","1/3"],backgroundColor:"nega",borderRadius:"3.tone.tertiary",children:"\u5FC5\u9808"},e)),RequiredShortSign:e=>i(s,t({fontColor:"nega",padding:["1/4","1/3"],borderRadius:"3.tone.tertiary",children:"*"},e)),OmitSign:e=>i(s,t({fontColor:"white",fontSize:"0.xs",padding:["1/4","1/3"],borderRadius:"3.tone.tertiary",backgroundColor:"layer.6",children:"\u7701\u7565\u53EF"},e)),LeftIndicator:e=>{let r=e,{tone:d}=r,o=p(r,["tone"]);return i(c,t(n(t({},a.Indicator(d)),{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3"}),o))},RightIndicator:e=>{let r=e,{tone:d}=r,o=p(r,["tone"]);return i(c,t(n(t({},a.Indicator(d)),{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3"}),o))},RightIcon:e=>{let r=e,{tone:d="border"}=r,o=p(r,["tone"]);return i(c,n(t(n(t({},a.IndicatorIcon),{right:"3/4"}),o),{freeCSS:t(t({zIndex:6,pointerEvents:"none"},a.IndicatorIcon.freeCSS),o.freeCSS)}))},LeftIcon:e=>{let r=e,{tone:d="border"}=r,o=p(r,["tone"]);return i(c,n(t(n(t({},a.IndicatorIcon),{left:"3/4"}),o),{freeCSS:t(t({zIndex:6,pointerEvents:"none"},a.IndicatorIcon.freeCSS),o.freeCSS)}))}};export{u as Parts,u as default};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { TagProperty } from '../../@declaration';
3
3
  declare namespace _Plain {
4
- type Input = TagProperty.Para & React.InputHTMLAttributes<HTMLInputElement>;
4
+ type Input = TagProperty.States & React.InputHTMLAttributes<HTMLInputElement>;
5
5
  }
6
- declare const _Plain: (para: _Plain.Input) => import("react/jsx-runtime").JSX.Element;
6
+ declare const _Plain: (p: _Plain.Input) => import("react/jsx-runtime").JSX.Element;
7
7
  export { _Plain, _Plain as default };
@@ -1 +1 @@
1
- import{b as t}from"../../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import{GenerateClassName as p}from"../../@utils";const a=e=>n("input",t({},p(e)));export{a as _Plain,a as default};
1
+ import{b as t}from"../../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import{GenerateClassName as p}from"../../@utils";const e=a=>n("input",t({},p(a)));export{e as _Plain,e as default};
@@ -15,9 +15,9 @@ declare namespace RichSelect {
15
15
  leftIcon?: ReactElement | false;
16
16
  rightIcon?: ReactElement | false;
17
17
  enableUnSelected?: boolean;
18
- rightIconStyles?: TagProperty.Para;
19
- cellStyles?: TagProperty.Para;
20
- sheetStyles?: TagProperty.Para;
18
+ rightIconStyles?: TagProperty.States;
19
+ cellStyles?: TagProperty.States;
20
+ sheetStyles?: TagProperty.States;
21
21
  gravityPoint?: number;
22
22
  };
23
23
  type Value = string | number | boolean | plainObject | void | null;
@@ -1 +1 @@
1
- import{b as t,c as a,d as O}from"../../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import{useState as R}from"react";import s from"@mingoo/jsmin";import M from"../../atoms/Box";import P from"../../atoms/FAI";import $ from"../../mols/Column";import j from"../Button";import _ from"../Tooltips";import{Wrapper as K,BoxWrapper as z,CommonEffects as G,DefaultStyles as Q}from"./core";import X from"./Parts";import{InputRichSelectClasses as Y,InputClasses as Z}from"../../@styles/componentClasses";function w(e){let{value:l,para:r}=e,{required:o,options:i}=r,p=[];return o&&(!i.length||i.length&&s.is.nullish(JSON.parse(l)))&&p.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!p.filter(({type:d})=>d=="invalid").length,notice:p}}const ee=e=>{let E=e,{tone:l,required:r,form:o,className:i,enableFormSubmit:p,enableUnSelected:d,checkValidationAtFirst:b,onChange:I,onKeyDown:V,onValidate:C,onUpdateValue:m,onUpdateValidValue:h,value:y="",options:x,placeholder:k,leftIndicator:le,rightIndicator:ne,leftIcon:oe,rightIcon:ae,componentID:ie,status_id:ue,cellStyles:A,sheetStyles:f,gravityPoint:F}=E,L=O(E,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","cellStyles","sheetStyles","gravityPoint"]),H={componentID:e.componentID||"",dataValue:y,eventType:"init",eventID:s.uuid.gen()},[D]=R(s.uuid.gen()),[u,S]=R(H),[v,J]=R({ok:!1,notice:[]});G({type:"richSelect",para:e,val_status:u,set_status:S,ExtraOverrideParams:{dataValue:y,formatValue:y},val_validate:v,set_validate:J,DefaultValidation:w,onUpdateValue:m,onUpdateValidValue:h});let T=n(M,{fontColor:"4.thin",textAlign:"left",children:k||"\u9078\u629E"});if(u.dataValue){let c=x.find(g=>g.type=="button"&&g.value==u.dataValue);c&&(T=c.selectedLabel||c.label)}return n(z,{val_status:u,set_status:S,val_validate:v,para:e,children:n("button",a(t({},L),{"data-form":o,"data-validation":v.ok,"data-component-id":u.componentID,"data-value":u.dataValue,"data-input-type":"richSelect",className:[i,Y("SelectLegend"),Z("InputCover")].join(" "),onClick:c=>{_.open({tipsID:D,parent:c.currentTarget,gravityPoint:F||13,close_option:{parentBlur:!1},content:()=>{let g=x.map(U=>{let{type:W,value:q,label:B}=U;return W=="button"?n(j.Button.Clear.R,a(t({color:"cloud",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:0,onClick:()=>{S(a(t({},u),{dataValue:q,eventType:"update",eventID:s.uuid.gen()})),_.close(D)}},A),{children:B})):B});return n($,a(t({ssCardBox:!0,padding:[1,0],gap:0,overflow:"auto"},f),{freeCSS:t({minWidth:12*20,maxHeight:"90vh"},f==null?void 0:f.freeCSS),children:g}))}})},children:T}))})},te=e=>{let{value:l=null,placeholder:r,options:o=[]}=e,i=0,p=JSON.stringify(l),d=o.map(I=>{let{type:V,value:C}=I,m=JSON.stringify(C),h=m==p;return i|=Number(h),a(t({},I),{type:V||"button",value:m})});i||(l=null);let b=JSON.stringify(l);return n(ee,a(t({},e),{value:b,options:d}))},N=e=>{var r,o;e=t({},e),s.is.nullish(e.rightIcon)&&(e.rightIcon=n(X.RightIcon,a(t({flexType:"col"},e.rightIconStyles),{children:n(P.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(o=e.paddingLeft)!=null?o:3);let l=Q.Boxish(e);return delete l.rightIconStyles,n(K,{componentID:e.componentID,children:te,para:l})};export{N as RichSelect,N as default};
1
+ import{b as t,c as o,d as O}from"../../chunk-VY3566IV.js";import{jsx as l}from"react/jsx-runtime";import{useState as R}from"react";import p from"@mingoo/jsmin";import W from"../../atoms/Box";import q from"../../atoms/FAI";import M from"../../mols/Column";import $ from"../Button";import _ from"../Tooltips";import{Wrapper as j,BoxWrapper as K,CommonEffects as z,DefaultStyles as G}from"./core";import Q from"./Parts";import{InputRichSelectClasses as X,InputClasses as Y}from"../../@styles/componentClasses";function Z(e){let{value:a,states:s}=e,{required:n,options:i}=s,u=[];return n&&(!i.length||i.length&&p.is.nullish(JSON.parse(a)))&&u.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!u.filter(({type:d})=>d=="invalid").length,notice:u}}const ee=e=>{let E=e,{tone:a,required:s,form:n,className:i,enableFormSubmit:u,enableUnSelected:d,checkValidationAtFirst:b,onChange:I,onKeyDown:V,onValidate:C,onUpdateValue:m,onUpdateValidValue:h,value:y="",options:x,placeholder:N,leftIndicator:ae,rightIndicator:le,leftIcon:ne,rightIcon:oe,componentID:ie,status_id:re,cellStyles:k,sheetStyles:f,gravityPoint:A}=E,F=O(E,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","cellStyles","sheetStyles","gravityPoint"]),L={componentID:e.componentID||"",dataValue:y,eventType:"init",eventID:p.uuid.gen()},[D]=R(p.uuid.gen()),[r,S]=R(L),[v,w]=R({ok:!1,notice:[]});z({type:"richSelect",states:e,val_status:r,set_status:S,ExtraOverrideStates:{dataValue:y,formatValue:y},val_validate:v,set_validate:w,DefaultValidation:Z,onUpdateValue:m,onUpdateValidValue:h});let T=l(W,{fontColor:"4.thin",textAlign:"left",children:N||"\u9078\u629E"});if(r.dataValue){let c=x.find(g=>g.type=="button"&&g.value==r.dataValue);c&&(T=c.selectedLabel||c.label)}return l(K,{val_status:r,set_status:S,val_validate:v,states:e,children:l("button",o(t({},F),{"data-form":n,"data-validation":v.ok,"data-component-id":r.componentID,"data-value":r.dataValue,"data-input-type":"richSelect",className:[i,X("SelectLegend"),Y("InputCover")].join(" "),onClick:c=>{_.open({tipsID:D,parent:c.currentTarget,gravityPoint:A||13,close_option:{parentBlur:!1},content:()=>{let g=x.map(H=>{let{type:J,value:U,label:B}=H;return J=="button"?l($.Button.Clear.R,o(t({color:"cloud",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:0,onClick:()=>{S(o(t({},r),{dataValue:U,eventType:"update",eventID:p.uuid.gen()})),_.close(D)}},k),{children:B})):B});return l(M,o(t({ssCardBox:!0,padding:[1,0],gap:0,overflow:"auto"},f),{freeCSS:t({minWidth:12*20,maxHeight:"90vh"},f==null?void 0:f.freeCSS),children:g}))}})},children:T}))})},te=e=>{let{value:a=null,placeholder:s,options:n=[]}=e,i=0,u=JSON.stringify(a),d=n.map(I=>{let{type:V,value:C}=I,m=JSON.stringify(C),h=m==u;return i|=Number(h),o(t({},I),{type:V||"button",value:m})});i||(a=null);let b=JSON.stringify(a);return l(ee,o(t({},e),{value:b,options:d}))},P=e=>{var s,n;e=t({},e),p.is.nullish(e.rightIcon)&&(e.rightIcon=l(Q.RightIcon,o(t({flexType:"col"},e.rightIconStyles),{children:l(q.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(s=e.paddingRight)!=null?s:3),e.leftIcon&&(e.paddingLeft=(n=e.paddingLeft)!=null?n:3);let a=G.Boxish(e);return delete a.rightIconStyles,l(j,{componentID:e.componentID,children:te,states:a})};export{P as RichSelect,P as default};
@@ -2,5 +2,5 @@ import Chips from './Chips';
2
2
  declare namespace Search {
3
3
  type Input = Chips.Input;
4
4
  }
5
- declare const Search: (para: Search.Input) => import("react/jsx-runtime").JSX.Element;
5
+ declare const Search: (p: Search.Input) => import("react/jsx-runtime").JSX.Element;
6
6
  export { Search, Search as default };
@@ -8,14 +8,14 @@ declare namespace Segmented {
8
8
  type ListInput = List.Options[];
9
9
  type Input = List.Input;
10
10
  type Methods = {
11
- Auto: (para: Input) => JSX.Element;
12
- Normal: (para: Input) => JSX.Element;
13
- Cloud: (para: Input) => JSX.Element;
14
- Cloud2: (para: Input) => JSX.Element;
15
- Cloud3: (para: Input) => JSX.Element;
16
- Border: (para: Input) => JSX.Element;
17
- Border2: (para: Input) => JSX.Element;
18
- BottomLine: (para: Input) => JSX.Element;
11
+ Auto: (p: Input) => JSX.Element;
12
+ Normal: (p: Input) => JSX.Element;
13
+ Cloud: (p: Input) => JSX.Element;
14
+ Cloud2: (p: Input) => JSX.Element;
15
+ Cloud3: (p: Input) => JSX.Element;
16
+ Border: (p: Input) => JSX.Element;
17
+ Border2: (p: Input) => JSX.Element;
18
+ BottomLine: (p: Input) => JSX.Element;
19
19
  };
20
20
  }
21
21
  declare const Segmented: Segmented.Methods;
@@ -1 +1 @@
1
- import{b as o,c as l,d as y}from"../../chunk-VY3566IV.js";import{jsx as t}from"react/jsx-runtime";import R from"@mingoo/jsmin";import{useState as s}from"react";import x from"./List";import{InputSegmentedClasses as u}from"../../@styles/componentClasses";const n=e=>{let m=e,{tone:E,appearance:c,value:r,options:a,onUpdateValue:f,onUpdateValidValue:i,freeCSS:p,cellStyles:b,cellClassName:g,cellCheckedClassName:k,cellCheckedStyles:B}=m,I=y(m,["tone","appearance","value","options","onUpdateValue","onUpdateValidValue","freeCSS","cellStyles","cellClassName","cellCheckedClassName","cellCheckedStyles"]),[v]=s(R.uuid.gen()),[C,L]=s(r),[w,h]=s(C);return C!=r&&(L(r),h(r)),t(x.Radio,l(o({defaultActiveStyling:!1,flexWrap:!1,borderRadius:"2.tone.secondary",position:"relative",options:a,value:w,componentID:v,icon:!1},I),{freeCSS:o({whiteSpace:"nowrap"},p),cellStyles:o({flexCenter:!0,ssPushable:!0,boxShadow:"none"},b),cellClassName:[g,u("Label"),u("Tone_"+c)].join(" "),cellCheckedStyles:o({isSemiBoldFont:!0},B),cellCheckedClassName:[k,u("Checked")].join(" "),tone:"custom",onUpdateValue:f,onUpdateValidValue:S=>{i&&i(S),c=="BottomLine"&&h(S.value[0])}}))},d={Auto:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",ssCardBox:!0},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Auto"},e))),Normal:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(n,o({appearance:"Border"},e))),Cloud:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",backgroundColor:"cloud"},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Cloud"},e))),Cloud2:e=>(e=o({},e),e.tone="WhiteCloud",t(d.Cloud,l(o({fontColor:"3.blur"},e),{cellCheckedStyles:o({fontColor:"1.clear"},e.cellCheckedStyles)}))),Cloud3:e=>(e=o({},e),e.tone="ThemeCloud",t(d.Cloud,l(o({backgroundColor:"theme.opa.few",fontColor:"theme"},e),{cellStyles:o({},e.cellStyles)}))),Border:e=>(e=o({},e),e=l(o({backgroundColor:"layer.1",border:"2.normal",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin"},e),{cellStyles:o({borderRadius:0,borderRight:"2.normal"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme.opa.few",fontColor:"theme"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Border"},e))),Border2:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(n,o({appearance:"Border"},e))),BottomLine:e=>(e=o({},e),e=l(o({gap:0,fontColor:"3.blur"},e),{cellStyles:o({ssEffectsOnActive:"ripple.theme",borderRadius:0,padding:1},e.cellStyles),cellCheckedStyles:o({fontColor:"theme"},e.cellCheckedStyles)}),t(n,o({appearance:"BottomLine"},e)))};export{d as Segmented,d as default};
1
+ import{b as o,c as l,d as S}from"../../chunk-VY3566IV.js";import{jsx as t}from"react/jsx-runtime";import R from"@mingoo/jsmin";import{useState as d}from"react";import x from"./List";import{InputSegmentedClasses as s}from"../../@styles/componentClasses";const r=e=>{let h=e,{tone:E,appearance:u,value:n,options:y,onUpdateValue:f,onUpdateValidValue:c,freeCSS:p,cellStyles:b,cellClassName:g,cellCheckedClassName:k,cellCheckedStyles:B}=h,I=S(h,["tone","appearance","value","options","onUpdateValue","onUpdateValidValue","freeCSS","cellStyles","cellClassName","cellCheckedClassName","cellCheckedStyles"]),[v]=d(R.uuid.gen()),[i,L]=d(n),[w,C]=d(i);return i!=n&&(L(n),C(n)),t(x.Radio,l(o({defaultActiveStyling:!1,flexWrap:!1,borderRadius:"2.tone.secondary",position:"relative",options:y,value:w,componentID:v,icon:!1},I),{freeCSS:o({whiteSpace:"nowrap"},p),cellStyles:o({flexCenter:!0,ssPushable:!0,boxShadow:"none"},b),cellClassName:[g,s("Label"),s("Tone_"+u)].join(" "),cellCheckedStyles:o({isSemiBoldFont:!0},B),cellCheckedClassName:[k,s("Checked")].join(" "),tone:"custom",onUpdateValue:f,onUpdateValidValue:m=>{c&&c(m),u=="BottomLine"&&C(m.value[0])}}))},a={Auto:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",ssCardBox:!0},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(r,o({appearance:e.tone||"Auto"},e))),Normal:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(r,o({appearance:"Border"},e))),Cloud:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",backgroundColor:"cloud"},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(r,o({appearance:e.tone||"Cloud"},e))),Cloud2:e=>(e=o({},e),e.tone="WhiteCloud",t(a.Cloud,l(o({fontColor:"3.blur"},e),{cellCheckedStyles:o({fontColor:"1.clear"},e.cellCheckedStyles)}))),Cloud3:e=>(e=o({},e),e.tone="ThemeCloud",t(a.Cloud,l(o({backgroundColor:"theme.opa.few",fontColor:"theme"},e),{cellStyles:o({},e.cellStyles)}))),Border:e=>(e=o({},e),e=l(o({backgroundColor:"layer.1",border:"2.normal",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin"},e),{cellStyles:o({borderRadius:0,borderRight:"2.normal"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme.opa.few",fontColor:"theme"},e.cellCheckedStyles)}),t(r,o({appearance:e.tone||"Border"},e))),Border2:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(r,o({appearance:"Border"},e))),BottomLine:e=>(e=o({},e),e=l(o({gap:0,fontColor:"3.blur"},e),{cellStyles:o({ssEffectsOnActive:"ripple.theme",borderRadius:0,padding:1},e.cellStyles),cellCheckedStyles:o({fontColor:"theme"},e.cellCheckedStyles)}),t(r,o({appearance:"BottomLine"},e)))};export{a as Segmented,a as default};
@@ -15,7 +15,7 @@ declare namespace Select {
15
15
  leftIcon?: ReactElement | false;
16
16
  rightIcon?: ReactElement | false;
17
17
  enableUnSelected?: boolean;
18
- rightIconStyles?: TagProperty.Para;
18
+ rightIconStyles?: TagProperty.States;
19
19
  };
20
20
  type Value = string | number | boolean | plainObject | void | null;
21
21
  type Options = {
@@ -1 +1 @@
1
- import{b as c,c as d,d as T}from"../../chunk-VY3566IV.js";import{Fragment as Q,jsx as l,jsxs as G}from"react/jsx-runtime";import{useState as C}from"react";import S from"@mingoo/jsmin";import E from"../../atoms/Box";import J from"../../atoms/FAI";import{Wrapper as U,BoxWrapper as W,SubmitForm as q,CommonEffects as K,DefaultStyles as M}from"./core";import $ from"./Parts";import{InputClasses as j,InputSelectClasses as N}from"../../@styles/componentClasses";function H(e){let{value:t,para:s}=e,{required:n,options:a}=s,o=[];return n&&(!a.length||a.length&&S.is.nullish(JSON.parse(t)))&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!o.filter(({type:r})=>r=="invalid").length,notice:o}}const _={Core:e=>{var O;let x=e,{tone:t,required:s,form:n,className:a,enableFormSubmit:o,enableUnSelected:r,checkValidationAtFirst:f,onChange:u,onKeyDown:m,onValidate:b,onUpdateValue:I,onUpdateValidValue:y,value:h="",options:B,placeholder:F,leftIndicator:X,rightIndicator:Y,leftIcon:Z,rightIcon:P,componentID:w,status_id:ee}=x,L=T(x,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id"]),A={componentID:e.componentID||"",dataValue:h,eventType:"init",eventID:S.uuid.gen()},[p,v]=C(A),[g,D]=C({ok:!1,notice:[]});K({type:"select",para:e,val_status:p,set_status:v,ExtraOverrideParams:{dataValue:h,formatValue:h},val_validate:g,set_validate:D,DefaultValidation:H,onUpdateValue:I,onUpdateValidValue:y});let R=l(E,{fontColor:"4.thin",textAlign:"left",children:F||"\u9078\u629E"});if(p.dataValue){let i=B.find(V=>V.value==p.dataValue);i&&(R=(O=i.displayLabel)!=null?O:i.label)}return l(W,{val_status:p,set_status:v,val_validate:g,para:e,children:G(E,{className:[a,N("SelectLegend"),j("InputCover")].join(" "),children:[R,l("select",d(c({"data-form":n,"data-input-type":"select","data-validation":g.ok,"data-component-id":p.componentID,"data-value":p.dataValue,value:p.dataValue,onKeyDown:i=>{m&&m(i),o&&q(i)},onChange:i=>{let{value:V}=i.target;g.ok&&D({ok:!1,notice:[]}),v(d(c({},p),{dataValue:V,eventType:"update",eventID:S.uuid.gen()})),u&&u(i)}},L),{className:N("Select"),children:l(_.Options,c({},e))}))]})})},Options:e=>{let{options:t=[],placeholder:s="\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",enableUnSelected:n=!0}=e,a=t.map(o=>{let{value:r,label:f}=o,u=String(r);return l("option",{value:u,children:f},u)});return n&&a.unshift(l("option",{value:JSON.stringify(null),children:s},0)),l(Q,{children:a})}},z=e=>{let{value:t=null,placeholder:s,options:n=[]}=e,a=0,o=JSON.stringify(t),r=n.map(u=>{let{value:m,label:b}=u,I=JSON.stringify(m),y=I==o;return a|=Number(y),d(c({},u),{value:I,label:b})});a||(t=null);let f=JSON.stringify(t);return l(_.Core,d(c({},e),{value:f,options:r}))},k=e=>{var s,n;e=c({},e),S.is.nullish(e.rightIcon)&&(e.rightIcon=l($.RightIcon,d(c({flexType:"col"},e.rightIconStyles),{children:l(J.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(s=e.paddingRight)!=null?s:3),e.leftIcon&&(e.paddingLeft=(n=e.paddingLeft)!=null?n:3);let t=M.Boxish(e);return delete t.rightIconStyles,l(U,{componentID:e.componentID,children:z,para:t})};export{k as Select,k as default};
1
+ import{b as c,c as d,d as T}from"../../chunk-VY3566IV.js";import{Fragment as z,jsx as t,jsxs as H}from"react/jsx-runtime";import{useState as C}from"react";import S from"@mingoo/jsmin";import E from"../../atoms/Box";import J from"../../atoms/FAI";import{Wrapper as P,BoxWrapper as U,SubmitForm as w,CommonEffects as W,DefaultStyles as q}from"./core";import K from"./Parts";import{InputClasses as M,InputSelectClasses as N}from"../../@styles/componentClasses";function $(e){let{value:l,states:s}=e,{required:a,options:n}=s,o=[];return a&&(!n.length||n.length&&S.is.nullish(JSON.parse(l)))&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!o.filter(({type:p})=>p=="invalid").length,notice:o}}const _={Core:e=>{var O;let x=e,{tone:l,required:s,form:a,className:n,enableFormSubmit:o,enableUnSelected:p,checkValidationAtFirst:f,onChange:r,onKeyDown:m,onValidate:b,onUpdateValue:I,onUpdateValidValue:y,value:h="",options:B,placeholder:F,leftIndicator:G,rightIndicator:Q,leftIcon:X,rightIcon:Y,componentID:Z,status_id:ee}=x,L=T(x,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id"]),A={componentID:e.componentID||"",dataValue:h,eventType:"init",eventID:S.uuid.gen()},[u,v]=C(A),[g,D]=C({ok:!1,notice:[]});W({type:"select",states:e,val_status:u,set_status:v,ExtraOverrideStates:{dataValue:h,formatValue:h},val_validate:g,set_validate:D,DefaultValidation:$,onUpdateValue:I,onUpdateValidValue:y});let R=t(E,{fontColor:"4.thin",textAlign:"left",children:F||"\u9078\u629E"});if(u.dataValue){let i=B.find(V=>V.value==u.dataValue);i&&(R=(O=i.displayLabel)!=null?O:i.label)}return t(U,{val_status:u,set_status:v,val_validate:g,states:e,children:H(E,{className:[n,N("SelectLegend"),M("InputCover")].join(" "),children:[R,t("select",d(c({"data-form":a,"data-input-type":"select","data-validation":g.ok,"data-component-id":u.componentID,"data-value":u.dataValue,value:u.dataValue,onKeyDown:i=>{m&&m(i),o&&w(i)},onChange:i=>{let{value:V}=i.target;g.ok&&D({ok:!1,notice:[]}),v(d(c({},u),{dataValue:V,eventType:"update",eventID:S.uuid.gen()})),r&&r(i)}},L),{className:N("Select"),children:t(_.Options,c({},e))}))]})})},Options:e=>{let{options:l=[],placeholder:s="\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",enableUnSelected:a=!0}=e,n=l.map(o=>{let{value:p,label:f}=o,r=String(p);return t("option",{value:r,children:f},r)});return a&&n.unshift(t("option",{value:JSON.stringify(null),children:s},0)),t(z,{children:n})}},j=e=>{let{value:l=null,placeholder:s,options:a=[]}=e,n=0,o=JSON.stringify(l),p=a.map(r=>{let{value:m,label:b}=r,I=JSON.stringify(m),y=I==o;return n|=Number(y),d(c({},r),{value:I,label:b})});n||(l=null);let f=JSON.stringify(l);return t(_.Core,d(c({},e),{value:f,options:p}))},k=e=>{var s,a;e=c({},e),S.is.nullish(e.rightIcon)&&(e.rightIcon=t(K.RightIcon,d(c({flexType:"col"},e.rightIconStyles),{children:t(J.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(s=e.paddingRight)!=null?s:3),e.leftIcon&&(e.paddingLeft=(a=e.paddingLeft)!=null?a:3);let l=q.Boxish(e);return delete e.rightIconStyles,t(P,{componentID:e.componentID,children:j,states:l})};export{k as Select,k as default};
@@ -1 +1 @@
1
- import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as P}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses";function Z(a){let{value:e,para:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("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",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"layer.4",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{b.Effects.Move(o,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 o=c.getCursor(a).x,{val_status:n,set_status:s}=e,{componentID:i,min:r,max:t}=n,p=L("#"+i+"_Ball"),f=L("#"+i+"_Bar"),u=L("#"+i+"_BarColor"),{width:l,left:g}=f.position(),S=(o-g)/l;S=Math.max(S,0),S=Math.min(S,1);let C=S*t,y=N({value:C,val_status:n}),m=y.positionLeft,D=y.stepValue;p.css({left:m}),u.css({width:m});let{prevValue:_}=E.get(i);return D!=_&&(E.update({key:i,value:{prevValue:D}}),s(T(I({},n),{dataValue:D,eventType:"update",eventID:c.uuid.gen()}))),a.preventDefault(),a.stopPropagation(),!1},End:()=>{c(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:o,set_status:n}=a,{min:s,max:i,step:r}=o,{key:t,metaKey:p,ctrlKey:f}=e,u=f||p,l=o.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=s:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),s),E.update({key:o.componentID,value:{prevValue:l}}),n(T(I({},o),{dataValue:l,eventType:"update",eventID:c.uuid.gen()})))}},ee=a=>{let k=a,{color:e="theme",required:o,form:n="",legends:{enable:s=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:f,enableFormSubmit:u,checkValidationAtFirst:l,onChange:g,onKeyDown:S,onValidate:C,onUpdateValue:y,onUpdateValidValue:m,value:D="",className:_}=k,K=B(k,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","className"]),W={componentID:a.componentID||"",dataValue:D,min:t,max:p,step:f,eventType:"init",eventID:c.uuid.gen()},[h,V]=A(W),[w,U]=A({ok:!1,notice:[]});Q({para:a,val_status:h,set_status:V,val_validate:w,set_validate:U,onUpdateValue:y,onUpdateValidValue:m,DefaultValidation:Z,ExtraOverrideParams:{dataValue:D},ExtraStoreParams:{prevValue:h.dataValue,setValueByForeign:$=>{V(T(I({},h),{dataValue:$,eventType:"update",eventID:c.uuid.gen()}))}}});let R=N({value:h.dataValue,val_status:h});return M(j,{val_status:h,set_status:V,val_validate:w,para:a,children:[d(Y,I({value:R.stepValue,form:n,"data-value":R.stepValue,"data-validation":w.ok,"data-input-type":"slider"},K)),M(O,{gap:"1/2",flexSizing:"auto",className:[v("Wrap"),_,v("ShowLegendsAlways_"+r)].join(" "),children:[d(z.Rail,{color:e,val_status:h,set_status:V,DotData:R,form:n,enableFormSubmit:u}),!!s&&d(z.IndicatorLabels,{componentID:h.componentID,min:t,max:p,step:f,customLegends:i})]})]})},H=a=>(a=I({},a),d(X,{componentID:a.componentID,children:ee,para:q(a)}));export{H as Slider,H as default};
1
+ import{b as I,c as V,d as k}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as $}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses";function Z(a){let{value:e,states:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("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",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return $(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"layer.4",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{b.Effects.Move(o,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 o=c.getCursor(a).x,{val_status:n,set_status:s}=e,{componentID:i,min:r,max:t}=n,p=L("#"+i+"_Ball"),f=L("#"+i+"_Bar"),u=L("#"+i+"_BarColor"),{width:l,left:g}=f.position(),S=(o-g)/l;S=Math.max(S,0),S=Math.min(S,1);let C=S*t,y=N({value:C,val_status:n}),m=y.positionLeft,D=y.stepValue;p.css({left:m}),u.css({width:m});let{prevValue:T}=E.get(i);return D!=T&&(E.update({[i]:{prevValue:D}}),s(V(I({},n),{dataValue:D,eventType:"update",eventID:c.uuid.gen()}))),a.preventDefault(),a.stopPropagation(),!1},End:()=>{c(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:o,set_status:n}=a,{min:s,max:i,step:r}=o,{key:t,metaKey:p,ctrlKey:f}=e,u=f||p,l=o.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=s:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),s),E.update({[o.componentID]:{prevValue:l}}),n(V(I({},o),{dataValue:l,eventType:"update",eventID:c.uuid.gen()})))}},ee=a=>{let B=a,{color:e="theme",required:o,form:n="",legends:{enable:s=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:f,enableFormSubmit:u,checkValidationAtFirst:l,onChange:g,onKeyDown:S,onValidate:C,onUpdateValue:y,onUpdateValidValue:m,value:D="",className:T}=B,K=k(B,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","className"]),W={componentID:a.componentID||"",dataValue:D,min:t,max:p,step:f,eventType:"init",eventID:c.uuid.gen()},[h,w]=A(W),[_,U]=A({ok:!1,notice:[]});Q({states:a,val_status:h,set_status:w,val_validate:_,set_validate:U,onUpdateValue:y,onUpdateValidValue:m,DefaultValidation:Z,ExtraOverrideStates:{dataValue:D},ExtraStoreStates:{prevValue:h.dataValue,setValueByForeign:P=>{w(V(I({},h),{dataValue:P,eventType:"update",eventID:c.uuid.gen()}))}}});let R=N({value:h.dataValue,val_status:h});return M(j,{val_status:h,set_status:w,val_validate:_,states:a,children:[d(Y,I({value:R.stepValue,form:n,"data-value":R.stepValue,"data-validation":_.ok,"data-input-type":"slider"},K)),M(O,{gap:"1/2",flexSizing:"auto",className:[v("Wrap"),T,v("ShowLegendsAlways_"+r)].join(" "),children:[d(z.Rail,{color:e,val_status:h,set_status:w,DotData:R,form:n,enableFormSubmit:u}),!!s&&d(z.IndicatorLabels,{componentID:h.componentID,min:t,max:p,step:f,customLegends:i})]})]})},H=a=>(a=I({},a),d(X,{componentID:a.componentID,children:ee,states:q(a)}));export{H as Slider,H as default};
@@ -1 +1 @@
1
- import{b as l,c as f,d as g}from"../../chunk-VY3566IV.js";import{jsx as a,jsxs as w}from"react/jsx-runtime";import{useState as k}from"react";import x from"@mingoo/jsmin";import s from"../../atoms/Box";import F from"../../mols/Row";import N from"../Button";import{Wrapper as L,BoxWrapper as q,SubmitForm as H,CommonEffects as O}from"./core";import{InputSwitchClasses as c}from"../../@styles/componentClasses";function U(e){let{value:I,para:o}=e,{required:y}=o,i=[];return y&&!I&&i.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!i.filter(({type:r})=>r=="invalid").length,notice:i}}const W=e=>{let V=e,{componentID:I,color:o="posi",required:y,form:i,id:r,enableFormSubmit:R,checkValidationAtFirst:A,onChange:b,onKeyDown:v,onValidate:K,onUpdateValue:T,onUpdateValidValue:B,value:m="",icon:C="",appearance:p="material"}=V,_=g(V,["componentID","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","icon","appearance"]),E={componentID:e.componentID||"",dataValue:m,eventType:"init",eventID:x.uuid.gen()},[t,h]=k(E),[u,S]=k({ok:!1,notice:[]}),d=!!t.dataValue;return O({para:e,val_status:t,set_status:h,val_validate:u,set_validate:S,DefaultValidation:U,onUpdateValue:T,onUpdateValidValue:B,ExtraOverrideParams:{dataValue:m,formatValue:m}}),w(q,{val_status:t,set_status:h,val_validate:u,para:e,children:[a("input",l({type:"checkbox","data-form":i,"data-input-type":"switch","data-validation":u.ok,"data-component-id":t.componentID,"data-value":t.dataValue,checked:t.dataValue,className:c("Input"),id:r,onKeyDown:n=>{v&&v(n),R&&H(n)},onChange:n=>{u.ok&&S({ok:!1,notice:[]}),h(f(l({},t),{dataValue:n.target.checked,eventType:"update",eventID:x.uuid.gen()})),b&&b(n)}},_)),a(N.Label.Plain,{tabIndex:-1,htmlFor:r,padding:"1/3",transition:"middle",borderRadius:"1.tone.primary",className:c("Label"),children:a(s,f(l({},p=="applely"?{padding:"1/4",isRounded:!0,backgroundColor:d?o:"layer.5"}:{}),{children:w(F.Center,{unitHeight:2.5,position:"relative",freeCSS:{width:12*4.5},children:[p=="material"&&a(s,{position:"absolute",backgroundColor:d?o:"layer.5",borderRadius:"sphere",unitHeight:1,transition:"middle",width:1,className:c("Bar"),opacity:"middle"}),a(s,{position:"absolute",top:0,left:0,backgroundColor:p=="material"&&d?o:"white",transition:"middle",ssSphere:2.5,boxShadow:"1.remark",className:c("Dot"),children:C&&a(s,{transition:"middle",ssSquare:2,flexCenter:!0,fontColor:p=="applely"&&d?o:"white",children:C})})]})}))})]})},D=e=>(e=l({},e),e.color=e.color||"theme",a(L,{componentID:e.componentID,children:W,para:e}));export{D as Switch,D as default};
1
+ import{b as l,c as f,d as V}from"../../chunk-VY3566IV.js";import{jsx as a,jsxs as D}from"react/jsx-runtime";import{useState as g}from"react";import k from"@mingoo/jsmin";import d from"../../atoms/Box";import F from"../../mols/Row";import N from"../Button";import{Wrapper as L,BoxWrapper as q,SubmitForm as H,CommonEffects as O}from"./core";import{InputSwitchClasses as m}from"../../@styles/componentClasses";function P(e){let{value:I,states:o}=e,{required:y}=o,i=[];return y&&!I&&i.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!i.filter(({type:r})=>r=="invalid").length,notice:i}}const U=e=>{let S=e,{componentID:I,color:o="posi",required:y,form:i,id:r,enableFormSubmit:R,checkValidationAtFirst:W,onChange:b,onKeyDown:v,onValidate:A,onUpdateValue:T,onUpdateValidValue:B,value:c="",icon:C="",appearance:s="material"}=S,_=V(S,["componentID","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","icon","appearance"]),E={componentID:e.componentID||"",dataValue:c,eventType:"init",eventID:k.uuid.gen()},[t,h]=g(E),[p,w]=g({ok:!1,notice:[]}),u=!!t.dataValue;return O({states:e,val_status:t,set_status:h,val_validate:p,set_validate:w,DefaultValidation:P,onUpdateValue:T,onUpdateValidValue:B,ExtraOverrideStates:{dataValue:c,formatValue:c}}),D(q,{val_status:t,set_status:h,val_validate:p,states:e,children:[a("input",l({type:"checkbox","data-form":i,"data-input-type":"switch","data-validation":p.ok,"data-component-id":t.componentID,"data-value":t.dataValue,checked:t.dataValue,className:m("Input"),id:r,onKeyDown:n=>{v&&v(n),R&&H(n)},onChange:n=>{p.ok&&w({ok:!1,notice:[]}),h(f(l({},t),{dataValue:n.target.checked,eventType:"update",eventID:k.uuid.gen()})),b&&b(n)}},_)),a(N.Label.Plain,{tabIndex:-1,htmlFor:r,padding:"1/3",transition:"middle",borderRadius:"1.tone.primary",className:m("Label"),children:a(d,f(l({},s=="applely"?{padding:"1/4",isRounded:!0,backgroundColor:u?o:"layer.5"}:{}),{children:D(F.Center,{unitHeight:2.5,position:"relative",freeCSS:{width:12*4.5},children:[s=="material"&&a(d,{position:"absolute",backgroundColor:u?o:"layer.5",borderRadius:"sphere",unitHeight:1,transition:"middle",width:1,className:m("Bar"),opacity:"middle"}),a(d,{position:"absolute",top:0,left:0,backgroundColor:s=="material"&&u?o:"white",transition:"middle",ssSphere:2.5,boxShadow:"1.remark",className:m("Dot"),children:C&&a(d,{transition:"middle",ssSquare:2,flexCenter:!0,fontColor:s=="applely"&&u?o:"white",children:C})})]})}))})]})},x=e=>(e=l({},e),e.color=e.color||"theme",a(L,{componentID:e.componentID,children:U,states:e}));export{x as Switch,x as default};
@@ -1 +1 @@
1
- import{b as o,c as I,d as F}from"../../chunk-VY3566IV.js";import{Fragment as P,jsx as n,jsxs as W}from"react/jsx-runtime";import{useState as E,useEffect as w}from"react";import x from"@mingoo/jsmin";import{$$fromRoot as ae,useStore as re}from"../../@utils";import C from"../../atoms/Box";import U from"../../atoms/FAI";import K from"../Button";import R from"../Tooltips";import{faEye as Z}from"@fortawesome/free-solid-svg-icons/faEye";import{Wrapper as ne,BoxWrapper as ie,SubmitForm as oe,CommonEffects as le,DefaultStyles as ue}from"./core";import S from"./Parts";const se={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:W(P,{children:[n(C,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(C,{children:"\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"})]})},password:{reg:/^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,exist:!0,reason:"8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},tel:{reg:/.*$/g,exist:!0,reason:W(P,{children:[n(C,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),n(C,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(C,{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"}},T=e=>{let{restrict:r,value:s=""}=e,t=String(s),a=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(r)&&(t=t.zen2hanNumber()),r=="katakana"&&(t=t.replace(/[^ァ-ヶー  ヲ-゚  ]/ig,"")),r=="hankaku.katakana"&&(t=t.replace(/[^ヲ-゚  ]/ig,"")),["postal","creditCard"].includes(r)&&(t=t.removeLetters()),["number","digitNumber"].includes(r)&&t&&t!="-")if(t=="0-")t="-";else{t[0]=="-"&&(a=!0),t=t.replace(/[^0-9\.]/ig,"");let i=Number(t);i===0&&(a=!1),a&&(i=-1*i),x.is.exist(e.min)&&(i=Math.max(i,Number(e.min))),x.is.exist(e.max)&&(i=Math.min(i,Number(e.max))),t=String(Math.abs(i))}let p=t;if(r=="digitNumber"){if(t&&t!="-"){let i=[];for(let l=t.length-1;l>=0;l--){i.unshift(t[l]);let g=t.length-1-l+1;l!=0&&g%3==0&&i.unshift(",")}p=i.join("")}}else r=="postal"?t.length>=4&&(p=t.clip(0,3)+"-"+t.clip(3)):r=="creditCard"&&(p=t.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(r)&&a&&(t="-"+t,p="-"+p),{formatValue:p,dataValue:t}},pe=e=>{let{id:r,restrict:s,val_status:t}=e,a=ae("#"+r)[0];if(a&&t.prevValue&&t.formatValue){let{formatValue:p,prevValue:i,caretFrom:l,caretTo:g}=t;if(s=="creditCard")p.length>=i.length&&l%5==0&&(l++,g++),a.setSelectionRange(l,g);else if(s=="postal")p.length==5&&i.length==3&&(l++,g++),a.setSelectionRange(l,g);else if(s=="digitNumber"){let D=p.length-i.length;D==2&&(l++,g++),D==-2&&(l--,g--),a.setSelectionRange(l,g)}}},H=(e,r)=>{let s={ok:!0,body:""};return(()=>{let t=se[r];if(!t)return;let a=t.reason;if(t){let p=!!(+!!e.match(t.reg)^+!t.exist);s={ok:p,body:p?"":a}}})(),s};function de(e){let{value:r,para:s}=e,{restrict:t="text",maxLength:a=255,required:p}=s,i=[];if(x.is.exist(a)&&r.length>=Number(a)&&i.push({type:"invalid",label:a+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),r){let l=H(r,t);l.ok||i.push({type:"invalid",label:l.body})}else p&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!i.filter(({type:l})=>l=="invalid").length,notice:i}}const me=e=>{let O=e,{componentID:r,tone:s,required:t,restrict:a="text",form:p,autoComplete:i="off",autoCapitalize:l="off",enableFormSubmit:g,clearButton:D=!1,checkValidationAtFirst:ce,onChange:M,onKeyDown:$,onValidate:fe,onUpdateValue:q,onUpdateValidValue:Y,value:X="",leftIndicator:ge,rightIndicator:xe,leftIcon:be,rightIcon:he,maxLength:Ie,min:y,max:N}=O,m=F(O,["componentID","tone","required","restrict","form","autoComplete","autoCapitalize","enableFormSubmit","clearButton","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max"]),j=a=="password"||a=="concealed"?"password":"text",G=["number","digitNumber","creditCard"].includes(a)?"numeric":a=="email"?"email":"text",Q=I(o({componentID:r},T({min:y,max:N,restrict:a,value:X})),{prevValue:"",eventType:"init",eventID:x.uuid.gen(),caretFrom:null,caretTo:null}),[ee,L]=E(!1),[u,v]=E(Q),[k,B]=E({ok:!1,notice:[]});return le({para:e,val_status:u,set_status:v,val_validate:k,set_validate:B,DefaultValidation:de,onUpdateValue:q,onUpdateValidValue:Y,ExtraOverrideParams:o({},T({min:y,max:N,restrict:a,value:X}))}),w(()=>{pe({id:e.id,restrict:a,val_status:u})},[u]),n(ie,{val_status:u,set_status:v,val_validate:k,para:e,children:n("input",I(o({type:j,inputMode:G,"data-form":p,"data-input-type":"text","data-validation":k.ok,"data-value":u.dataValue,"data-component-id":u.componentID,value:u.formatValue,autoComplete:i,autoCapitalize:l,onKeyDown:c=>{let{key:f,target:_}=c;{let b=_,{selectionStart:h,selectionEnd:te}=b,V=Number(h),z=Number(te),A=u.formatValue[Number(V)],J=u.formatValue[Number(V)-1];f=="Delete"&&(a=="creditCard"&&A==" "||a=="postal"&&A=="-"||a=="digitNumber"&&A==",")&&(b.setSelectionRange(V+1,z+1),c.preventDefault()),f=="Backspace"&&(a=="creditCard"&&J==" "||a=="postal"&&J=="-"||a=="digitNumber"&&J==",")&&(b.setSelectionRange(V-1,z-1),c.preventDefault()),f=="Enter"||f=="Tab"}if(["number","digitNumber","creditCard"].includes(a)&&f=="Clear"&&v(I(o({},u),{dataValue:"",formatValue:"",eventType:"update",eventID:x.uuid.gen()})),["number","digitNumber"].includes(a)&&["ArrowUp","ArrowDown"].includes(f)){let b=+(f=="ArrowUp")*2-1,h=String(Number(u.dataValue)+b);k.ok&&B({ok:!1,notice:[]}),v(I(o(o({},u),T({min:y,max:N,restrict:a,value:h})),{eventType:"update",eventID:x.uuid.gen()})),c.preventDefault()}$&&$(c),g&&oe(c)},onChange:c=>{let{value:f,selectionStart:_,selectionEnd:b}=c.target,h=T({min:y,max:N,restrict:a,value:f});ee&&(h.formatValue=f),h.formatValue!=u.formatValue&&(k.ok&&B({ok:!1,notice:[]}),v(I(o(o({},u),h),{prevValue:u.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(_),caretTo:Number(b)})),M&&M(c))}},m),{onCompositionStart:c=>{m!=null&&m.onCompositionStart&&(m==null||m.onCompositionStart(c)),L(!0)},onCompositionEnd:c=>{if(m!=null&&m.onCompositionEnd&&(m==null||m.onCompositionEnd(c)),a=="text")return;let f=T({min:y,max:N,restrict:a,value:u.formatValue});v(I(o(o({},u),f),{prevValue:u.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(u.formatValue.length+1),caretTo:Number(u.formatValue.length+1)})),L(!1)}}))})},d={Validate:H,Normal:e=>{var r,s;return e=o({},e),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(s=e.paddingLeft)!=null?s:3),n(ne,{componentID:e.componentID,children:me,para:ue.Boxish(e)})},Katakana:e=>n(d.Normal,o({restrict:"katakana"},e)),HankakuKatakana:e=>n(d.Normal,o({restrict:"hankaku.katakana"},e)),CreditCard:e=>n(d.Normal,o({restrict:"creditCard"},e)),Tel:e=>n(d.Normal,o({restrict:"tel",placeholder:"xxx-xxxx-xxxx"},e)),Number:e=>n(d.Normal,o({restrict:"number"},e)),DigitNumber:e=>n(d.Normal,o({restrict:"digitNumber"},e)),Email:e=>n(d.Normal,o({restrict:"email"},e)),Url:e=>n(d.Normal,o({restrict:"url"},e)),Postal:e=>{let[r]=E(x.uuid.gen());return w(()=>()=>{re.delete(r)},[]),n(d.Normal,o({restrict:"postal",placeholder:"\u90F5\u4FBF\u756A\u53F7",leftIndicator:n(S.LeftIndicator,{children:"\u3012"})},e))},Password:e=>n(d.Normal,o({restrict:"password",placeholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{padding:0,children:n(K.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{R.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:n(R.Comps.Body,{children:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().find("input").callback(s=>{let t=s[0];t.type=t.type==="password"?"text":"password"})},children:n(U,{icon:Z})})})},e)),Concealed:e=>n(d.Normal,o({restrict:"concealed",placeholder:"\u79D8\u5BC6\u9375\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{padding:0,children:n(K.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{R.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:n(R.Comps.Body,{children:"\u5024\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().parent().find("input").callback(s=>{let t=s[0];t.type=t.type==="password"?"text":"password"})},children:n(U,{icon:Z})})})},e)),Money:{JPY:e=>n(d.DigitNumber,o({placeholder:"\u91D1\u984D\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{children:"\u5186"})},e))}};export{d as Text,me as TextInput,d as default};
1
+ import{b as o,c as I,d as P}from"../../chunk-VY3566IV.js";import{Fragment as H,jsx as n,jsxs as W}from"react/jsx-runtime";import{useState as E,useEffect as z}from"react";import x from"@mingoo/jsmin";import{$$fromRoot as ae,useStore as re}from"../../@utils";import C from"../../atoms/Box";import F from"../../atoms/FAI";import U from"../Button";import R from"../Tooltips";import{faEye as K}from"@fortawesome/free-solid-svg-icons/faEye";import{Wrapper as ne,BoxWrapper as ie,SubmitForm as oe,CommonEffects as le,DefaultStyles as se}from"./core";import S from"./Parts";const ue={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:W(H,{children:[n(C,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(C,{children:"\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"})]})},password:{reg:/^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,exist:!0,reason:"8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},tel:{reg:/.*$/g,exist:!0,reason:W(H,{children:[n(C,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),n(C,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(C,{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"}},T=e=>{let{restrict:r,value:u=""}=e,t=String(u),a=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(r)&&(t=t.zen2hanNumber()),r=="katakana"&&(t=t.replace(/[^ァ-ヶー  ヲ-゚  ]/ig,"")),r=="hankaku.katakana"&&(t=t.replace(/[^ヲ-゚  ]/ig,"")),["postal","creditCard"].includes(r)&&(t=t.removeLetters()),["number","digitNumber"].includes(r)&&t&&t!="-")if(t=="0-")t="-";else{t[0]=="-"&&(a=!0),t=t.replace(/[^0-9\.]/ig,"");let i=Number(t);i===0&&(a=!1),a&&(i=-1*i),x.is.exist(e.min)&&(i=Math.max(i,Number(e.min))),x.is.exist(e.max)&&(i=Math.min(i,Number(e.max))),t=String(Math.abs(i))}let p=t;if(r=="digitNumber"){if(t&&t!="-"){let i=[];for(let l=t.length-1;l>=0;l--){i.unshift(t[l]);let g=t.length-1-l+1;l!=0&&g%3==0&&i.unshift(",")}p=i.join("")}}else r=="postal"?t.length>=4&&(p=t.clip(0,3)+"-"+t.clip(3)):r=="creditCard"&&(p=t.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(r)&&a&&(t="-"+t,p="-"+p),{formatValue:p,dataValue:t}},pe=e=>{let{id:r,restrict:u,val_status:t}=e,a=ae("#"+r)[0];if(a&&t.prevValue&&t.formatValue){let{formatValue:p,prevValue:i,caretFrom:l,caretTo:g}=t;if(u=="creditCard")p.length>=i.length&&l%5==0&&(l++,g++),a.setSelectionRange(l,g);else if(u=="postal")p.length==5&&i.length==3&&(l++,g++),a.setSelectionRange(l,g);else if(u=="digitNumber"){let D=p.length-i.length;D==2&&(l++,g++),D==-2&&(l--,g--),a.setSelectionRange(l,g)}}},Z=(e,r)=>{let u={ok:!0,body:""};return(()=>{let t=ue[r];if(!t)return;let a=t.reason;if(t){let p=!!(+!!e.match(t.reg)^+!t.exist);u={ok:p,body:p?"":a}}})(),u};function me(e){let{value:r,states:u}=e,{restrict:t="text",maxLength:a=255,required:p}=u,i=[];if(x.is.exist(a)&&r.length>=Number(a)&&i.push({type:"invalid",label:a+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),r){let l=Z(r,t);l.ok||i.push({type:"invalid",label:l.body})}else p&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!i.filter(({type:l})=>l=="invalid").length,notice:i}}const de=e=>{let L=e,{componentID:r,tone:u,required:t,restrict:a="text",form:p,autoComplete:i="off",autoCapitalize:l="off",enableFormSubmit:g,clearButton:D=!1,checkValidationAtFirst:ce,onChange:J,onKeyDown:M,onValidate:fe,onUpdateValue:q,onUpdateValidValue:Y,value:$="",leftIndicator:ge,rightIndicator:xe,leftIcon:be,rightIcon:he,maxLength:Ie,min:y,max:N}=L,d=P(L,["componentID","tone","required","restrict","form","autoComplete","autoCapitalize","enableFormSubmit","clearButton","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max"]),j=a=="password"||a=="concealed"?"password":"text",G=["number","digitNumber","creditCard"].includes(a)?"numeric":a=="email"?"email":"text",Q=I(o({componentID:r},T({min:y,max:N,restrict:a,value:$})),{prevValue:"",eventType:"init",eventID:x.uuid.gen(),caretFrom:null,caretTo:null}),[ee,X]=E(!1),[s,v]=E(Q),[k,B]=E({ok:!1,notice:[]});return le({states:e,val_status:s,set_status:v,val_validate:k,set_validate:B,DefaultValidation:me,onUpdateValue:q,onUpdateValidValue:Y,ExtraOverrideStates:o({},T({min:y,max:N,restrict:a,value:$}))}),z(()=>{pe({id:e.id,restrict:a,val_status:s})},[s]),n(ie,{val_status:s,set_status:v,val_validate:k,states:e,children:n("input",I(o({type:j,inputMode:G,"data-form":p,"data-input-type":"text","data-validation":k.ok,"data-value":s.dataValue,"data-component-id":s.componentID,value:s.formatValue,autoComplete:i,autoCapitalize:l,onKeyDown:c=>{let{key:f,target:w}=c;{let b=w,{selectionStart:h,selectionEnd:te}=b,V=Number(h),O=Number(te),_=s.formatValue[Number(V)],A=s.formatValue[Number(V)-1];f=="Delete"&&(a=="creditCard"&&_==" "||a=="postal"&&_=="-"||a=="digitNumber"&&_==",")&&(b.setSelectionRange(V+1,O+1),c.preventDefault()),f=="Backspace"&&(a=="creditCard"&&A==" "||a=="postal"&&A=="-"||a=="digitNumber"&&A==",")&&(b.setSelectionRange(V-1,O-1),c.preventDefault()),f=="Enter"||f=="Tab"}if(["number","digitNumber","creditCard"].includes(a)&&f=="Clear"&&v(I(o({},s),{dataValue:"",formatValue:"",eventType:"update",eventID:x.uuid.gen()})),["number","digitNumber"].includes(a)&&["ArrowUp","ArrowDown"].includes(f)){let b=+(f=="ArrowUp")*2-1,h=String(Number(s.dataValue)+b);k.ok&&B({ok:!1,notice:[]}),v(I(o(o({},s),T({min:y,max:N,restrict:a,value:h})),{eventType:"update",eventID:x.uuid.gen()})),c.preventDefault()}M&&M(c),g&&oe(c)},onChange:c=>{let{value:f,selectionStart:w,selectionEnd:b}=c.target,h=T({min:y,max:N,restrict:a,value:f});ee&&(h.formatValue=f),h.formatValue!=s.formatValue&&(k.ok&&B({ok:!1,notice:[]}),v(I(o(o({},s),h),{prevValue:s.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(w),caretTo:Number(b)})),J&&J(c))}},d),{onCompositionStart:c=>{d!=null&&d.onCompositionStart&&(d==null||d.onCompositionStart(c)),X(!0)},onCompositionEnd:c=>{if(d!=null&&d.onCompositionEnd&&(d==null||d.onCompositionEnd(c)),a=="text")return;let f=T({min:y,max:N,restrict:a,value:s.formatValue});v(I(o(o({},s),f),{prevValue:s.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(s.formatValue.length+1),caretTo:Number(s.formatValue.length+1)})),X(!1)}}))})},m={Validate:Z,Normal:e=>{var r,u;return e=o({},e),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(u=e.paddingLeft)!=null?u:3),n(ne,{componentID:e.componentID,children:de,states:se.Boxish(e)})},Katakana:e=>n(m.Normal,o({restrict:"katakana"},e)),HankakuKatakana:e=>n(m.Normal,o({restrict:"hankaku.katakana"},e)),CreditCard:e=>n(m.Normal,o({restrict:"creditCard"},e)),Tel:e=>n(m.Normal,o({restrict:"tel",placeholder:"xxx-xxxx-xxxx"},e)),Number:e=>n(m.Normal,o({restrict:"number"},e)),DigitNumber:e=>n(m.Normal,o({restrict:"digitNumber"},e)),Email:e=>n(m.Normal,o({restrict:"email"},e)),Url:e=>n(m.Normal,o({restrict:"url"},e)),Postal:e=>{let[r]=E(x.uuid.gen());return z(()=>()=>{re.delete(r)},[]),n(m.Normal,o({restrict:"postal",placeholder:"\u90F5\u4FBF\u756A\u53F7",leftIndicator:n(S.LeftIndicator,{children:"\u3012"})},e))},Password:e=>n(m.Normal,o({restrict:"password",placeholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{padding:0,children:n(U.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{R.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:n(R.Comps.Body,{children:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().find("input").callback(u=>{let t=u[0];t.type=t.type==="password"?"text":"password"})},children:n(F,{icon:K})})})},e)),Concealed:e=>n(m.Normal,o({restrict:"concealed",placeholder:"\u79D8\u5BC6\u9375\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{padding:0,children:n(U.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{R.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:n(R.Comps.Body,{children:"\u5024\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().parent().find("input").callback(u=>{let t=u[0];t.type=t.type==="password"?"text":"password"})},children:n(F,{icon:K})})})},e)),Money:{JPY:e=>n(m.DigitNumber,o({placeholder:"\u91D1\u984D\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{children:"\u5186"})},e))}};export{m as Text,de as TextInput,m as default};
@@ -1 +1 @@
1
- import{b as u,c as g,d as T}from"../../chunk-VY3566IV.js";import{jsx as s}from"react/jsx-runtime";import{useState as v}from"react";import y from"@mingoo/jsmin";import{Wrapper as E,BoxWrapper as _,SubmitForm as k,CommonEffects as C,DefaultStyles as S}from"./core";function F(e){let{value:t,para:n}=e,{required:o}=n,i=[];return o&&!t&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:d})=>d=="invalid").length,notice:i}}const B=e=>{let m=e,{componentID:t,tone:n,required:o,form:i,enableFormSubmit:d,checkValidationAtFirst:L,onChange:c,onKeyDown:f,onValidate:W,onUpdateValue:x,onUpdateValidValue:V,value:D="",leftIndicator:q,rightIndicator:H,leftIcon:K,rightIcon:M}=m,R=T(m,["componentID","tone","required","form","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon"]),b={componentID:t,dataValue:D,eventType:"init",eventID:y.uuid.gen()},[a,r]=v(b),[p,I]=v({ok:!1,notice:[]});return C({para:e,val_status:a,set_status:r,val_validate:p,set_validate:I,onUpdateValue:x,onUpdateValidValue:V,DefaultValidation:F}),s(_,{val_status:a,set_status:r,val_validate:p,para:e,children:s("textarea",u({"data-form":i,"data-input-type":"textarea","data-validation":p.ok,"data-value":a.dataValue,"data-component-id":a.componentID,value:a.dataValue,onKeyDown:l=>{f&&f(l),d&&k(l)},onChange:l=>{let{value:A}=l.target;p.ok&&I({ok:!1,notice:[]}),r(g(u({},a),{dataValue:A,eventType:"update",eventID:y.uuid.gen()})),c&&c(l)}},R))})},h=e=>{var n,o;e=u({},e),e.rightIcon&&(e.paddingRight=(n=e.paddingRight)!=null?n:3),e.leftIcon&&(e.paddingLeft=(o=e.paddingLeft)!=null?o:3);let t=S.Boxish(e);return t.rows=t.rows||5,s(E,{componentID:e.componentID,children:B,para:t})};export{h as TextArea,h as default};
1
+ import{b as s,c as g,d as T}from"../../chunk-VY3566IV.js";import{jsx as p}from"react/jsx-runtime";import{useState as v}from"react";import y from"@mingoo/jsmin";import{Wrapper as E,BoxWrapper as _,SubmitForm as k,CommonEffects as C,DefaultStyles as S}from"./core";function F(t){let{value:e,states:n}=t,{required:o}=n,i=[];return o&&!e&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:u})=>u=="invalid").length,notice:i}}const w=t=>{let I=t,{componentID:e,tone:n,required:o,form:i,enableFormSubmit:u,checkValidationAtFirst:B,onChange:c,onKeyDown:f,onValidate:L,onUpdateValue:x,onUpdateValidValue:V,value:D="",leftIndicator:W,rightIndicator:q,leftIcon:H,rightIcon:K}=I,R=T(I,["componentID","tone","required","form","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon"]),b={componentID:e,dataValue:D,eventType:"init",eventID:y.uuid.gen()},[a,d]=v(b),[r,m]=v({ok:!1,notice:[]});return C({states:t,val_status:a,set_status:d,val_validate:r,set_validate:m,onUpdateValue:x,onUpdateValidValue:V,DefaultValidation:F}),p(_,{val_status:a,set_status:d,val_validate:r,states:t,children:p("textarea",s({"data-form":i,"data-input-type":"textarea","data-validation":r.ok,"data-value":a.dataValue,"data-component-id":a.componentID,value:a.dataValue,onKeyDown:l=>{f&&f(l),u&&k(l)},onChange:l=>{let{value:A}=l.target;r.ok&&m({ok:!1,notice:[]}),d(g(s({},a),{dataValue:A,eventType:"update",eventID:y.uuid.gen()})),c&&c(l)}},R))})},h=t=>{var n,o;t=s({},t),t.rightIcon&&(t.paddingRight=(n=t.paddingRight)!=null?n:3),t.leftIcon&&(t.paddingLeft=(o=t.paddingLeft)!=null?o:3);let e=S.Boxish(t);return e.rows=e.rows||5,p(E,{componentID:t.componentID,children:w,states:e})};export{h as TextArea,h as default};