amotify 0.1.60 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@declaration/index.d.ts +2 -2
- package/dist/@declaration/property.d.ts +9 -9
- package/dist/@styles/componentClasses/index.css +46 -149
- package/dist/@styles/componentClasses/index.js +35 -49
- package/dist/@styles/index.css +46 -149
- package/dist/@styles/index.js +35 -49
- package/dist/@styles/style.css +46 -149
- package/dist/@styles/style.js +35 -49
- package/dist/@utils/GenerateClassName.d.ts +2 -2
- package/dist/@utils/GenerateClassName.js +1 -1
- package/dist/@utils/LaunchReactApp.d.ts +11 -11
- package/dist/@utils/LaunchReactApp.js +1 -1
- package/dist/@utils/config.d.ts +6 -1
- package/dist/@utils/config.js +1 -1
- package/dist/@utils/index.d.ts +2 -2
- package/dist/@utils/index.js +1 -1
- package/dist/@utils/pageRouter.d.ts +15 -0
- package/dist/@utils/pageRouter.js +1 -0
- package/dist/@utils/useRecycle.js +1 -1
- package/dist/@utils/useRouterEffect.d.ts +16 -0
- package/dist/@utils/useRouterEffect.js +1 -0
- package/dist/@utils/useStore.d.ts +2 -10
- package/dist/@utils/useStore.js +1 -1
- package/dist/atoms/FAI.d.ts +1 -1
- package/dist/atoms/FAI.js +1 -1
- package/dist/atoms/Flex.js +1 -1
- package/dist/atoms/Logo.d.ts +14 -14
- package/dist/atoms/Logo.js +3 -3
- package/dist/fn/Button.d.ts +4 -4
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Cropper.d.ts +1 -1
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Effect/Pudding.js +1 -1
- package/dist/fn/Effect/Ripple.js +3 -3
- package/dist/fn/Input/AutoHeightText.d.ts +1 -1
- package/dist/fn/Input/AutoHeightText.js +1 -1
- package/dist/fn/Input/Checker.d.ts +3 -3
- package/dist/fn/Input/Checker.js +1 -1
- package/dist/fn/Input/Chips/Selector.d.ts +3 -3
- package/dist/fn/Input/Chips/Selector.js +1 -1
- package/dist/fn/Input/Chips/index.js +1 -1
- package/dist/fn/Input/Contenteditable.js +1 -1
- package/dist/fn/Input/DigitCharacters.d.ts +1 -1
- package/dist/fn/Input/DigitCharacters.js +1 -1
- package/dist/fn/Input/Filer.d.ts +3 -3
- package/dist/fn/Input/Filer.js +1 -1
- package/dist/fn/Input/Hidden.d.ts +1 -1
- package/dist/fn/Input/Hidden.js +1 -1
- package/dist/fn/Input/List.d.ts +5 -5
- package/dist/fn/Input/List.js +1 -1
- package/dist/fn/Input/Parts.d.ts +1 -1
- package/dist/fn/Input/Parts.js +1 -1
- package/dist/fn/Input/Plain.d.ts +2 -2
- package/dist/fn/Input/Plain.js +1 -1
- package/dist/fn/Input/RichSelect.d.ts +3 -3
- package/dist/fn/Input/RichSelect.js +1 -1
- package/dist/fn/Input/Search.d.ts +1 -1
- package/dist/fn/Input/Segmented.d.ts +8 -8
- package/dist/fn/Input/Segmented.js +1 -1
- package/dist/fn/Input/Select.d.ts +1 -1
- package/dist/fn/Input/Select.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Input/Switch.js +1 -1
- package/dist/fn/Input/Text.js +1 -1
- package/dist/fn/Input/TextArea.js +1 -1
- package/dist/fn/Input/Time/Picker.js +1 -1
- package/dist/fn/Input/Time/index.d.ts +1 -1
- package/dist/fn/Input/Time/index.js +1 -1
- package/dist/fn/Input/core.d.ts +11 -11
- package/dist/fn/Input/core.js +1 -1
- package/dist/fn/Input/index.d.ts +4 -4
- package/dist/fn/Input/index.js +1 -1
- package/dist/fn/Loader/corner.js +1 -1
- package/dist/fn/Loader/index.d.ts +1 -5
- package/dist/fn/Loader/index.js +1 -1
- package/dist/fn/Loader/mini.d.ts +1 -1
- package/dist/fn/Loader/mini.js +1 -1
- package/dist/fn/PageNotFound.js +1 -0
- package/dist/fn/{Layout/PageViewController.d.ts → PageViewController.d.ts} +1 -1
- package/dist/fn/PageViewController.js +1 -0
- package/dist/fn/{Layout/Plate.d.ts → Plate.d.ts} +1 -1
- package/dist/fn/Plate.js +1 -0
- package/dist/fn/{Layout/RootViewController.d.ts → RootViewController.d.ts} +10 -10
- package/dist/fn/RootViewController.js +1 -0
- package/dist/fn/Sheet.d.ts +11 -10
- package/dist/fn/Sheet.js +1 -1
- package/dist/fn/Snackbar.d.ts +1 -1
- package/dist/fn/Snackbar.js +1 -1
- package/dist/fn/{Layout/SwipeView.d.ts → SwipeView.d.ts} +2 -2
- package/dist/fn/SwipeView.js +1 -0
- package/dist/fn/{Layout/TabBar.d.ts → TabBar.d.ts} +1 -1
- package/dist/fn/TabBar.js +1 -0
- package/dist/fn/Table/Data.d.ts +2 -2
- package/dist/fn/Table/Data.js +1 -1
- package/dist/fn/Table/Drag.d.ts +1 -1
- package/dist/fn/Table/Drag.js +1 -1
- package/dist/fn/Table/Normal.d.ts +1 -1
- package/dist/fn/Table/Normal.js +1 -1
- package/dist/fn/Table/Wrapper.d.ts +1 -1
- package/dist/fn/Table/Wrapper.js +1 -1
- package/dist/fn/Table/cellStyling.d.ts +2 -2
- package/dist/fn/Table/cellStyling.js +1 -1
- package/dist/fn/Table/index.d.ts +3 -3
- package/dist/fn/Table/index.js +1 -1
- package/dist/fn/Tooltips.d.ts +1 -1
- package/dist/fn/index.d.ts +6 -1
- package/dist/fn/index.js +1 -1
- package/dist/index.d.ts +17 -6
- package/dist/mols/Accordion.js +1 -1
- package/dist/mols/List.js +1 -1
- package/dist/mols/Text.js +1 -1
- package/dist/temps/designBook.d.ts +0 -2
- package/dist/temps/designBook.js +10 -10
- package/package.json +3 -8
- package/dist/@utils/fin.d.ts +0 -1
- package/dist/@utils/fin.js +0 -1
- package/dist/@utils/pageTransit.d.ts +0 -11
- package/dist/@utils/pageTransit.js +0 -1
- package/dist/fn/Layout/PageNotFound.js +0 -1
- package/dist/fn/Layout/PageRouter.d.ts +0 -27
- package/dist/fn/Layout/PageRouter.js +0 -1
- package/dist/fn/Layout/PageViewController.js +0 -1
- package/dist/fn/Layout/Plate.js +0 -1
- package/dist/fn/Layout/RootViewController.js +0 -1
- package/dist/fn/Layout/SwipeView.js +0 -1
- package/dist/fn/Layout/TabBar.js +0 -1
- package/dist/fn/Layout/index.d.ts +0 -27
- package/dist/fn/Layout/index.js +0 -1
- package/dist/fn/Loader/top.d.ts +0 -2
- package/dist/fn/Loader/top.js +0 -1
- /package/dist/fn/{Layout/PageNotFound.d.ts → PageNotFound.d.ts} +0 -0
package/dist/fn/Input/Filer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as g,c as
|
|
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 c}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,d=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&&d.push(n("label",{className:[a.cellClassName,c("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:c("AddIcon"),children:n(L,{icon:pe,className:c("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:d})},Cell:e=>{let{index:t,file:a,className:s,val_status:l,set_status:p,fileNameEdit:d=!0}=e,{name:u,size:x,type:i}=a,[w,b]=q(!1),N=h.uuid.gen(),V=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(()=>{w&&setTimeout(()=>{E("#"+N).focus()},100)},[w]),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:c("FileName"),children:w?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:_}=f;_=="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:_}=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],_+"."+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,!!d&&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,{})})]})})}),!w&&n(y,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:o+"\u30D5\u30A1\u30A4\u30EB / "+V+"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,{})})]})}},de=e=>{let J=e,{tone:t,required:a,form:s,fileNameEdit:l=!0,systemOnly:p=!1,accept:d="*",limit:u=1,checkValidationAtFirst:x,onChange:i,onValidate:w,onUpdateValue:b,onUpdateValidValue:N,value:V=[],className:G,cellStyles:O,cellClassName:o,componentID:f,status_id:_,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:V,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:V,formatValue:V},ExtraStoreStates:{AddFiles:A=>$(void 0,null,function*(){let k=Q.get(r.componentID).Files,v=[];for(var F=0;F<(A==null?void 0:A.length);F++){let I=A[F],{type:R,name:S}=I;if(F+1+k.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(d&&d=="image"&&!R.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:[...k,...v],eventType:"update",eventID:h.uuid.gen()}))})}});let j="";return d&&(d=="image"?j="image/png,image/jpeg":j=d),m(ie,{val_status:r,set_status:B,val_validate:D,states:e,children:[n("input",C(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 k=A.target,v=k.files,F=[];for(var I=0;I<(v==null?void 0:v.length);I++){let R=v[I],S=R.name;if(R.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(R)}B(C(g({},r),{dataValue:[...r.dataValue,...F],eventType:"update",eventID:h.uuid.gen()})),k.value=""})},T),{tabIndex:-1,value:""})),!p&&n(Y.List,{files:r.dataValue,states:e,val_status:r,set_status:B})]})};typeof window!="undefined"&&window.document&&h(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),E("."+c("AddButton")).addClass(c("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),E("."+c("AddButton")).removeClass(c("Draggable"));let t=e.dataTransfer.files;if(t.length){let a=e.target;if(E(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(C(g({},t.cellStyles),{tone:t.tone})).className].join(" "),n(ne,{componentID:e.componentID,children:de,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: (
|
|
12
|
+
declare const Hidden: (p: Hidden.Input) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export { Hidden, Hidden as default };
|
package/dist/fn/Input/Hidden.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,c as
|
|
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};
|
package/dist/fn/Input/List.d.ts
CHANGED
|
@@ -16,9 +16,9 @@ declare namespace List {
|
|
|
16
16
|
hideInput?: boolean;
|
|
17
17
|
leftIndicator?: ReactElement | false;
|
|
18
18
|
rightIndicator?: ReactElement | false;
|
|
19
|
-
cellStyles?: TagProperty.
|
|
19
|
+
cellStyles?: TagProperty.States;
|
|
20
20
|
cellClassName?: string;
|
|
21
|
-
cellCheckedStyles?: TagProperty.
|
|
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.
|
|
34
|
+
checkedStyles?: TagProperty.States;
|
|
35
35
|
checkedClassName?: string;
|
|
36
|
-
} & TagProperty.
|
|
36
|
+
} & TagProperty.States;
|
|
37
37
|
type ListInput = {
|
|
38
|
-
|
|
38
|
+
states: List.Plain;
|
|
39
39
|
val_status: InputTypes.Status.Plain;
|
|
40
40
|
set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
|
|
41
41
|
};
|
package/dist/fn/Input/List.js
CHANGED
|
@@ -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
|
|
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};
|
package/dist/fn/Input/Parts.d.ts
CHANGED
package/dist/fn/Input/Parts.js
CHANGED
|
@@ -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
|
|
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};
|
package/dist/fn/Input/Plain.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagProperty } from '../../@declaration';
|
|
3
3
|
declare namespace _Plain {
|
|
4
|
-
type Input = TagProperty.
|
|
4
|
+
type Input = TagProperty.States & React.InputHTMLAttributes<HTMLInputElement>;
|
|
5
5
|
}
|
|
6
|
-
declare const _Plain: (
|
|
6
|
+
declare const _Plain: (p: _Plain.Input) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { _Plain, _Plain as default };
|
package/dist/fn/Input/Plain.js
CHANGED
|
@@ -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
|
|
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.
|
|
19
|
-
cellStyles?: TagProperty.
|
|
20
|
-
sheetStyles?: TagProperty.
|
|
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
|
|
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: (
|
|
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: (
|
|
12
|
-
Normal: (
|
|
13
|
-
Cloud: (
|
|
14
|
-
Cloud2: (
|
|
15
|
-
Cloud3: (
|
|
16
|
-
Border: (
|
|
17
|
-
Border2: (
|
|
18
|
-
BottomLine: (
|
|
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
|
|
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.
|
|
18
|
+
rightIconStyles?: TagProperty.States;
|
|
19
19
|
};
|
|
20
20
|
type Value = string | number | boolean | plainObject | void | null;
|
|
21
21
|
type Options = {
|
package/dist/fn/Input/Select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c,c as d,d as T}from"../../chunk-VY3566IV.js";import{Fragment as
|
|
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};
|
package/dist/fn/Input/Slider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as I,c as
|
|
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};
|
package/dist/fn/Input/Switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l,c as f,d as
|
|
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};
|
package/dist/fn/Input/Text.js
CHANGED
|
@@ -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
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as f,c as T}from"../../../chunk-VY3566IV.js";import{Fragment as $,jsx as i,jsxs as y}from"react/jsx-runtime";import{createElement as P}from"react";import{useState as w,useEffect as z,useRef as Y}from"react";import c from"@mingoo/jsmin";import C from"../../../atoms/Box";import N from"../../../atoms/FAI";import B from"../../../atoms/Flex";import _ from"../../../atoms/Grid";import M from"../../../mols/Row";import x from"../../../mols/Column";import O from"../../../mols/Text";import v from"../../Button";import H from"../../Tooltips";import R from"../Select";import{List as F}from"../List";import{InputTimeClasses as g}from"../../../@styles/componentClasses";let A=r=>{var t,a;let e=[],d=Number((t=r==null?void 0:r.min)!=null?t:1900),o=Number((a=r==null?void 0:r.max)!=null?a:c.Time().addYear(10).year);for(let m=d;m<=o;m++)e.unshift({value:m,label:[m,...c.transformer.wareki(m).value].join(" - ")});return e};const L=r=>{let{restrict:e,era:d="year",defaultValue:o=""}=r;r=f({},r),r.tipsID=r.tipsID||c.uuid.gen();const t=Y(!1);let[a,m]=w((()=>{var s,p;if(e=="clock"){let l=String(o).split(/[^\d]/);l[0]||(l=[0,0]);let u=Number(l[0]),h=Number(l[1]);return{modifiedType:"init",hour:u,minutes:h}}else if(e=="date"){let[l,u,h]=(s=String(o))==null?void 0:s.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",year:Number(l),month:Number(u),date:Number(h)}}else if(e!="week"){if(e=="month"){let[l,u]=String(o).split(/\D/);return(c.is.nullish(l)||c.is.nullish(u))&&([l,u]=c.Time().toFormat("%Y-%M").split("-")),{modifiedType:"init",year:Number(l),month:Number(u)}}else if(e=="year"){let[l]=String(o).split(/\D/);return c.is.nullish(l)&&([l]=c.Time().toFormat("%Y").split("-")),{modifiedType:"init",year:Number(l)}}else if(e=="dateWareki"){let[l,u,h]=(p=String(o))==null?void 0:p.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",era:d||"year",year:Number(l),month:Number(u),date:Number(h)}}}return{}})());z(()=>{if(t.current){if(a.modifiedType=="update"){let s="",p=d||"year";if(e=="clock"){let{hour:l,minutes:u}=a;s=[l.zeroEmbed(2),u.zeroEmbed(2)].join("/")}else if(e=="date"){let{year:l,month:u,date:h}=a;s=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}else if(e!="week"){if(e=="month"){let{year:l,month:u}=a;s=[l,u.zeroEmbed(2)].join("/")}else if(e=="year"){let{year:l}=a;s=String(l)}else if(e=="dateWareki"){let{year:l,month:u,date:h,era:S}=a;p=S,s=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}}r.onValueUpdate(s,p)}}else t.current=!0},[a]);let n=T(f({},r),{val_value:a,set_value:m});return i(C,{backgroundColor:"layer.1",borderRadius:"2.tone.secondary",boxShadow:"1.remark",border:!0,overflow:"hidden",children:i(C,{overflow:"auto",className:g(e.toCapital()+"Base"),children:e=="clock"?i(k.Clock._,f({},n)):e=="date"?i(k.Date._,f({},n)):e=="week"?"":e=="month"?i(k.Month._,f({},n)):e=="year"?i(k.Year._,f({},n)):e=="dates"||e=="months"?"":e=="dateWareki"?i(k.DateWareki._,f({},n)):i($,{})})})},k={Clock:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,[n,s]=w(a.hour>12?2:1),[p,l]=w(Number(localStorage.getItem("timePickerUnit")||5));z(()=>{localStorage.setItem("timePickerUnit",String(p))},[p]);let{hour:u,minutes:h}=a;return y(x,{padding:1,children:[y(B,{flexType:"row",flexWrap:!1,gap:1,className:g("Body"),children:[y(x,{className:g("DesignSide"),flexSizing:0,children:[i(C,{className:g("ClockUiBase"),padding:[1,"2/3"],flexCenter:!0,children:y(C,{className:g("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[i(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[g("Needle"),g("hour")].join(" "),freeCSS:{transform:`rotate(${u*30+h/2}deg)`}}),i(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[g("Needle"),g("minute")].join(" "),freeCSS:{transform:`rotate(${h*6}deg)`}})]})}),i(F.Radio,{tone:"plain",icon:!0,value:[n],options:[{value:1,label:"AM"},{value:2,label:"PM"}],flexType:"col",gap:0,cellStyles:{padding:"1/2",horizontalAlign:"between",gap:"1/3"},tabIndex:-1,onUpdateValidValue:({value:S})=>{let D=a.hour%12+(S==2?12:0);s(S),m({modifiedType:"update",hour:D,minutes:a.minutes})}}),i(C,{borderTop:!0,margin:[0,1]}),i(F.Radio,{tone:"plain",icon:!0,value:[p],options:[{value:1,label:"/ 1\u5206"},{value:2,label:"/ 2\u5206"},{value:5,label:"/ 5\u5206"}],flexType:"col",gap:0,cellStyles:{padding:"1/2",horizontalAlign:"between",gap:"1/3"},tabIndex:-1,onUpdateValidValue:({value:S})=>{l(S)}})]}),y(x,{children:[y(C,{flexCenter:!0,fontSize:"3.paragraph",isSemiBoldFont:!0,children:[a.hour.zeroEmbed(2)," : ",a.minutes.zeroEmbed(2)]}),y(B,{flexWrap:!1,borderRadius:"1.tone.primary",boxShadow:"0.remark.inset",flexChilds:"even",freeCSS:{minWidth:12*12},padding:["1/3",0],children:[i(x,{gap:0,overflow:"auto",padding:"2/3",borderRight:!0,freeCSS:{maxHeight:12*22},children:k.Clock.Hours({onClick:S=>{let V=S+(n==2?12:0);m({modifiedType:"update",hour:V,minutes:a.minutes})},min:e,max:d,ampm:n})}),i(x,{gap:0,overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*22},children:k.Clock.Minutes({onClick:S=>{m({modifiedType:"update",hour:a.hour,minutes:S})},min:e,max:d,unit:p})})]})]})]}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Hours:r=>{let e=[];for(let d=0;d<12;d++){let o=r.ampm==2?d+12:d,t=!1;{let a=Number(String(o*100).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>a&&(t=!0),r.max){let m=Number(String(r.max).replace(/\D/ig,""));a>m&&(t=!0)}}e.push(i(v.Button.Normal.R,{isLocked:t,borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(d)},children:o.zeroEmbed(2)},d))}return e},Minutes:r=>{let e=[];for(let d=0;d<60/r.unit;d++){let o=d*r.unit;e.push(i(v.Button.Normal.R,{borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(o)},children:o.zeroEmbed(2)},o))}return e}},Date:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n,month:s,date:p}=a;return y(x,{padding:1,children:[y(B,{horizontalAlign:"between",verticalAlign:"center",flexWrap:!1,children:[y(B,{verticalAlign:"bottom",horizontalAlign:"left",gap:"2/3",flexWrap:!1,children:[i(R,{override:"force",enableUnSelected:!1,value:n,options:A(),border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:Number(l),month:s,date:p})}}),i(R,{override:"force",enableUnSelected:!1,value:s,options:(()=>{let l=[];for(let u=1;u<=12;u++)l.push({value:u,label:String(u),displayLabel:String(u)+"\u6708"});return l})(),placeholder:"",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:n,month:Number(l),date:p})}})]}),i(k.Variables.ShiftButtons,{callback:l=>{let u=s+l,h=n;l==-1?(u<=0&&h--,u=u||12):s==12&&h++,m({modifiedType:"update",year:h,month:u,date:a.date})}})]}),i(C,{borderTop:!0}),i(C,{children:k.Date.MonthCalendar({min:e,max:d,year:a.year,month:a.month,current:[a.year,a.month,a.date],callback:l=>{let[u,h,S]=l;m({modifiedType:"update",year:u,month:h,date:S})}})}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},MonthCalendar:r=>{let{min:e,max:d,year:o,month:t,current:a,callback:m}=r,n=c.Time(),s=c.Time([o,t.zeroEmbed(2),"01"].join("/")),p=s.getLastDayOfTheMonth(),l=c.Time(s).addMonth(-1).getLastDayOfTheMonth().date,u=[],h=[],S=[],V=[],D={padding:0,unitWidth:3,unitHeight:3,flexCenter:!0,borderRadius:"3.tone.tertiary"};for(var b=0;b<7;b++)u.push(P(C,T(f({className:[g("CalendarDay"),g("Legend")].join(" ")},D),{key:b}),["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][b]));for(var b=0;b<s.weekday;b++)h.unshift(P(C,T(f({className:[g("CalendarDay"),g("Dummy")].join(" "),fontColor:"4.thin"},D),{key:b}),l-b));for(var b=1;b<=p.date;b++){let U=b,j=o==n.year&&t==n.month&&b==n.date,I=!1;{let E=Number(String([o,t.zeroEmbed(2),b.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>E&&(I=!0),r.max){let W=Number(String(r.max).replace(/\D/ig,""));E>W&&(I=!0)}}S.push(P(v.Button.Clear.R,T(f({className:[g("CalendarDay"),g("isToday_"+j)].join(" ")},D),{onClick:()=>{m([o,t,U])},tabIndex:-1,key:U,isLocked:I,fontColor:"1.clear",ssEffectsOnActive:"shrink",padding:0,flexCenter:!0,borderRadius:"sphere",children:b})))}for(var b=1;b<7-p.weekday;b++)V.push(P(C,T(f({className:[g("CalendarDay"),g("Dummy")].join(" "),fontColor:"4.thin"},D),{key:b}),b));return y(_,{gridCols:7,gap:"1/3",children:[u,h,S,V]})}},Month:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n,month:s}=a;return y(x,{padding:1,children:[y(M.Separate,{gap:0,children:[i(M.Center,{verticalAlign:"bottom",gap:"2/3",children:i(R,{enableUnSelected:!1,value:n,options:A(),override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:p})=>{m({modifiedType:"update",year:Number(p),month:s})}})}),i(k.Variables.ShiftButtons,{callback:p=>{let l=Math.min(Math.max(n+p,1900),2100);m({modifiedType:"update",year:l,month:s})}})]}),i(C,{borderTop:!0}),k.Month.Months({min:e,max:d,year:a.year,callback:p=>{let[l,u]=p;m({modifiedType:"update",year:l,month:u})}}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Months:r=>{let{year:e,callback:d}=r,o=c.Time(),t=[];for(let a=1;a<=12;a++){let m=e==o.year&&a==o.month,n=!1;{let p=Number(String([e,a.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>p&&(n=!0),r.max){let l=Number(String(r.max).replace(/\D/ig,""));p>l&&(n=!0)}}let s=[g("Cell"),m?g("isThisMonth"):""].join(" ");t.push(y(v.Button.Clear.R,{className:s,isLocked:n,fontColor:"2.normal",padding:["2/3",1],ssEffectsOnActive:"shrink",onClick:()=>{d([e,a])},children:[a," \u6708"]},e+"-"+a))}return i(_,{gridCols:4,gap:"2/3",children:t})}},Year:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n}=a;return y(x,{padding:1,children:[i(R,{enableUnSelected:!1,value:n||c.Time().year,override:"force",options:A({min:e,max:d}),onUpdateValidValue:({value:s})=>{m({modifiedType:"update",year:Number(s)})}}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o,onSubmit:()=>{m({modifiedType:"update",year:Number(n||c.Time().year)})}})]})}},DateWareki:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{era:n,year:s,month:p,date:l}=a,u={val_value:a,set_value:m};return y(C,{children:[y(M.Left,{verticalAlign:"unset",borderBottom:!0,gap:0,children:[i(k.DateWareki.EraSelect,f({},u)),i(C,{borderRight:!0}),i(k.DateWareki.Calendar,f({},u))]}),i(C,{padding:1,children:i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})})]})},EraSelect:r=>{let{val_value:e,set_value:d}=r,o={padding:["1/2",1.5],fontColor:"3.blur"},t={backgroundColor:"cloud",fontColor:"2.normal",isSemiBoldFont:!0};return y(x,{gap:0,padding:1,children:[i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="year",onClick:()=>{let a=c.Time();d({modifiedType:"update",era:"year",year:a.year,month:a.month,date:a.date})},children:"\u897F\u66A6"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="reiwa",onClick:()=>{let a=c.Time();d({modifiedType:"update",era:"reiwa",year:a.year,month:a.month,date:a.date})},children:"\u4EE4\u548C"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="heisei",onClick:()=>{d({modifiedType:"update",era:"heisei",year:2019,month:1,date:1})},children:"\u5E73\u6210"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="shouwa",onClick:()=>{d({modifiedType:"update",era:"shouwa",year:1989,month:1,date:1})},children:"\u662D\u548C"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="taisho",onClick:()=>{d({modifiedType:"update",era:"taisho",year:1926,month:1,date:1})},children:"\u5927\u6B63"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="meiji",onClick:()=>{d({modifiedType:"update",era:"meiji",year:1912,month:1,date:1})},children:"\u660E\u6CBB"}))]})},Calendar:r=>{let{val_value:e,set_value:d}=r,o=[];if(e.era=="year")for(let t=1900;t<2100;t++)o.unshift({value:t,label:t+"\u5E74"});else if(e.era=="reiwa"){let t=c.Time().year-2018;for(let a=1;a<=t+10;a++)o.unshift({value:2019+a-1,label:"\u4EE4\u548C"+(a==1?"\u5143":a)+"\u5E74"})}else if(e.era=="heisei")for(let t=1;t<=31;t++)o.unshift({value:1989+t-1,label:"\u5E73\u6210"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="shouwa")for(let t=1;t<=64;t++)o.unshift({value:1926+t-1,label:"\u662D\u548C"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="taisho")for(let t=1;t<=15;t++)o.unshift({value:1912+t-1,label:"\u5927\u6B63"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="meiji")for(let t=1;t<=45;t++)o.unshift({value:1868+t-1,label:"\u660E\u6CBB"+(t==1?"\u5143":t)+"\u5E74"});return y(x,{padding:1,children:[y(M.Separate,{children:[i(R,{tone:"cloud",enableUnSelected:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},options:o,value:e.year,onUpdateValidValue:({value:t})=>{d(T(f({},e),{modifiedType:"update",year:Number(t)}))}}),y(M.Center,{gap:"1/3",children:[i(v.Button.Clear.S,{ssSphere:2,onClick:()=>{let t=e.month-1;d({modifiedType:"update",era:e.era,year:t==0?e.year-1:e.year,month:t==0?12:t,date:1})},children:i(N.ChevronLeft,{})}),i(R,{tone:"cloud",enableUnSelected:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:e.month,onUpdateValidValue:({value:t})=>{d({modifiedType:"update",era:e.era,year:e.year,month:Number(t),date:1})}}),i(v.Button.Clear.S,{ssSphere:2,onClick:()=>{let t=e.month+1;d({modifiedType:"update",era:e.era,year:t==13?e.year+1:e.year,month:t==13?1:t,date:1})},children:i(N.ChevronRight,{})})]})]}),i(k.DateWareki.MonthCell,f({},r))]},e.era)},MonthCell:r=>{let{val_value:e,set_value:d}=r,o=c.Time([e.year.zeroEmbed(4),e.month.zeroEmbed(2),e.date.zeroEmbed(2)].join("/"));if(!o.validate)return;let t=o.getFirstDayOfTheMonth().weekday,a=o.getLastDayOfTheMonth(),m=[];for(let n=0;n<7;n++)m.push(i(O.Supplement,{flexCenter:!0,fontColor:n==0?"googleRed":n==6?"googleBlue":"3.blur",children:c.transformer.weekday.shortJP(n)}));for(let n=0;n<t;n++){let s=c.Time(o).getFirstDayOfTheMonth().addDate(n-t);m.push(i(v.Button.Sub.R,{color:"cloud",border:"1.thin",ssSquare:3,opacity:"middle",onClick:p=>{p.preventDefault(),p.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}for(let n=1;n<=a.date;n++){let s=c.Time(o).setDate(n);m.push(i(v.Button.Border.R,{ssSquare:3,onClick:()=>{d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}for(let n=0;n<7-a.weekday-1;n++){let s=c.Time(o).addMonth(1).setDate(1).addDate(n);m.push(i(v.Button.Sub.R,{color:"cloud",border:"1.thin",ssSquare:3,opacity:"middle",onClick:p=>{p.preventDefault(),p.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}return i(_,{gridCols:7,gap:"1/4",children:m})}},Variables:{Footer:r=>y(B,{flexWrap:!1,gap:1,flexChilds:"even",freeCSS:{whiteSpace:"nowrap"},children:[y(v.Button.Border.R,{onClick:()=>{r.onValueUpdate("")},tabIndex:-1,flexSizing:"none",padding:["2/3",1],children:[i(N.Times,{})," \u524A\u9664"]}),i(v.Button.Prime.R,{flexSizing:"auto",onClick:()=>{r.onSubmit&&r.onSubmit(),H.close(r.tipsID)},tabIndex:-1,children:"\u6C7A\u5B9A",padding:["2/3",1]})]}),ShiftButtons:r=>y(B,{flexWrap:!1,gap:"1/3",children:[i(v.Button.Clear.R,T(f({className:g("LeftButton"),tabIndex:-1,right:0},k.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(-1)},children:i(N.ChevronLeft,{})})),i(v.Button.Clear.R,T(f({className:g("RightButton"),tabIndex:-1,left:0},k.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(1)},children:i(N.ChevronRight,{})}))]}),ShiftButtonStyles:{flexCenter:!0,padding:0,unitWidth:3,unitHeight:3,borderRadius:"sphere",position:"relative"}}};export{L as Picker,L as default};
|
|
1
|
+
import{b as f,c as T}from"../../../chunk-VY3566IV.js";import{Fragment as $,jsx as i,jsxs as y}from"react/jsx-runtime";import{createElement as I}from"react";import{useState as P,useEffect as z,useRef as Y}from"react";import c from"@mingoo/jsmin";import C from"../../../atoms/Box";import N from"../../../atoms/FAI";import B from"../../../atoms/Flex";import _ from"../../../atoms/Grid";import M from"../../../mols/Row";import x from"../../../mols/Column";import O from"../../../mols/Text";import v from"../../Button";import H from"../../Tooltips";import R from"../Select";import{List as F}from"../List";import{InputTimeClasses as g}from"../../../@styles/componentClasses";let A=r=>{var t,a;let e=[],d=Number((t=r==null?void 0:r.min)!=null?t:1900),o=Number((a=r==null?void 0:r.max)!=null?a:c.Time().addYear(10).year);for(let m=d;m<=o;m++)e.unshift({value:m,label:[m,...c.transformer.wareki(m).value].join(" - ")});return e};const L=r=>{let{restrict:e,era:d="year",defaultValue:o=""}=r;r=f({},r),r.tipsID=r.tipsID||c.uuid.gen();const t=Y(!1);let[a,m]=P((()=>{var s,p;if(e=="clock"){let l=String(o).split(/[^\d]/);l[0]||(l=[0,0]);let u=Number(l[0]),h=Number(l[1]);return{modifiedType:"init",hour:u,minutes:h}}else if(e=="date"){let[l,u,h]=(s=String(o))==null?void 0:s.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",year:Number(l),month:Number(u),date:Number(h)}}else if(e!="week"){if(e=="month"){let[l,u]=String(o).split(/\D/);return(c.is.nullish(l)||c.is.nullish(u))&&([l,u]=c.Time().toFormat("%Y-%M").split("-")),{modifiedType:"init",year:Number(l),month:Number(u)}}else if(e=="year"){let[l]=String(o).split(/\D/);return c.is.nullish(l)&&([l]=c.Time().toFormat("%Y").split("-")),{modifiedType:"init",year:Number(l)}}else if(e=="dateWareki"){let[l,u,h]=(p=String(o))==null?void 0:p.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",era:d||"year",year:Number(l),month:Number(u),date:Number(h)}}}return{}})());z(()=>{if(t.current){if(a.modifiedType=="update"){let s="",p=d||"year";if(e=="clock"){let{hour:l,minutes:u}=a;s=[l.zeroEmbed(2),u.zeroEmbed(2)].join("/")}else if(e=="date"){let{year:l,month:u,date:h}=a;s=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}else if(e!="week"){if(e=="month"){let{year:l,month:u}=a;s=[l,u.zeroEmbed(2)].join("/")}else if(e=="year"){let{year:l}=a;s=String(l)}else if(e=="dateWareki"){let{year:l,month:u,date:h,era:S}=a;p=S,s=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}}r.onValueUpdate(s,p)}}else t.current=!0},[a]);let n=T(f({},r),{val_value:a,set_value:m});return i(C,{backgroundColor:"layer.1",borderRadius:"2.tone.secondary",boxShadow:"1.remark",border:!0,overflow:"hidden",children:i(C,{overflow:"auto",className:g(e.toCapital()+"Base"),children:e=="clock"?i(k.Clock._,f({},n)):e=="date"?i(k.Date._,f({},n)):e=="week"?"":e=="month"?i(k.Month._,f({},n)):e=="year"?i(k.Year._,f({},n)):e=="dates"||e=="months"?"":e=="dateWareki"?i(k.DateWareki._,f({},n)):i($,{})})})},k={Clock:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,[n,s]=P(a.hour>12?2:1),[p,l]=P(Number(localStorage.getItem("timePickerUnit")||5));z(()=>{localStorage.setItem("timePickerUnit",String(p))},[p]);let{hour:u,minutes:h}=a;return y(x,{padding:1,children:[y(B,{flexType:"row",flexWrap:!1,gap:1,className:g("Body"),children:[y(x,{className:g("DesignSide"),flexSizing:0,children:[i(C,{className:g("ClockUiBase"),padding:[1,"2/3"],flexCenter:!0,children:y(C,{className:g("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[i(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[g("Needle"),g("hour")].join(" "),freeCSS:{transform:`rotate(${u*30+h/2}deg)`}}),i(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[g("Needle"),g("minute")].join(" "),freeCSS:{transform:`rotate(${h*6}deg)`}})]})}),i(F.Radio,{tone:"plain",icon:!0,value:[n],options:[{value:1,label:"AM"},{value:2,label:"PM"}],flexType:"col",gap:0,cellStyles:{padding:"1/2",horizontalAlign:"between",gap:"1/3"},tabIndex:-1,onUpdateValidValue:({value:S})=>{let D=a.hour%12+(S==2?12:0);s(S),m({modifiedType:"update",hour:D,minutes:a.minutes})}}),i(C,{borderTop:!0,margin:[0,1]}),i(F.Radio,{tone:"plain",icon:!0,value:[p],options:[{value:1,label:"/ 1\u5206"},{value:2,label:"/ 2\u5206"},{value:5,label:"/ 5\u5206"}],flexType:"col",gap:0,cellStyles:{padding:"1/2",horizontalAlign:"between",gap:"1/3"},tabIndex:-1,onUpdateValidValue:({value:S})=>{l(S)}})]}),y(x,{children:[y(C,{flexCenter:!0,fontSize:"3.paragraph",isSemiBoldFont:!0,children:[a.hour.zeroEmbed(2)," : ",a.minutes.zeroEmbed(2)]}),y(B,{flexWrap:!1,borderRadius:"1.tone.primary",boxShadow:"0.remark.inset",flexChilds:"even",freeCSS:{minWidth:12*12},padding:["1/3",0],children:[i(x,{gap:0,overflow:"auto",padding:"2/3",borderRight:!0,freeCSS:{maxHeight:12*22},children:k.Clock.Hours({onClick:S=>{let V=S+(n==2?12:0);m({modifiedType:"update",hour:V,minutes:a.minutes})},min:e,max:d,ampm:n})}),i(x,{gap:0,overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*22},children:k.Clock.Minutes({onClick:S=>{m({modifiedType:"update",hour:a.hour,minutes:S})},min:e,max:d,unit:p})})]})]})]}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Hours:r=>{let e=[];for(let d=0;d<12;d++){let o=r.ampm==2?d+12:d,t=!1;{let a=Number(String(o*100).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>a&&(t=!0),r.max){let m=Number(String(r.max).replace(/\D/ig,""));a>m&&(t=!0)}}e.push(i(v.Button.Normal.R,{isLocked:t,borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(d)},children:o.zeroEmbed(2)},d))}return e},Minutes:r=>{let e=[];for(let d=0;d<60/r.unit;d++){let o=d*r.unit;e.push(i(v.Button.Normal.R,{borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(o)},children:o.zeroEmbed(2)},o))}return e}},Date:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n,month:s,date:p}=a;return y(x,{padding:1,children:[y(B,{horizontalAlign:"between",verticalAlign:"center",flexWrap:!1,children:[y(B,{verticalAlign:"bottom",horizontalAlign:"left",gap:"2/3",flexWrap:!1,children:[i(R,{override:"force",enableUnSelected:!1,value:n,options:A(),border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:Number(l),month:s,date:p})}}),i(R,{override:"force",enableUnSelected:!1,value:s,options:(()=>{let l=[];for(let u=1;u<=12;u++)l.push({value:u,label:String(u),displayLabel:String(u)+"\u6708"});return l})(),placeholder:"",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:n,month:Number(l),date:p})}})]}),i(k.Variables.ShiftButtons,{callback:l=>{let u=s+l,h=n;l==-1?(u<=0&&h--,u=u||12):s==12&&h++,m({modifiedType:"update",year:h,month:u,date:a.date})}})]}),i(C,{borderTop:!0}),i(C,{children:k.Date.MonthCalendar({min:e,max:d,year:a.year,month:a.month,current:[a.year,a.month,a.date],callback:l=>{let[u,h,S]=l;m({modifiedType:"update",year:u,month:h,date:S})}})}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},MonthCalendar:r=>{let{min:e,max:d,year:o,month:t,current:a,callback:m}=r,n=c.Time(),s=c.Time([o,t.zeroEmbed(2),"01"].join("/")),p=s.getLastDayOfTheMonth(),l=c.Time(s).addMonth(-1).getLastDayOfTheMonth().date,u=[],h=[],S=[],V=[],D={padding:0,unitWidth:3,unitHeight:3,flexCenter:!0,borderRadius:"3.tone.tertiary"};for(var b=0;b<7;b++)u.push(I(C,T(f({className:[g("CalendarDay"),g("Legend")].join(" ")},D),{key:b}),["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][b]));for(var b=0;b<s.weekday;b++)h.unshift(I(C,T(f({className:[g("CalendarDay"),g("Dummy")].join(" "),fontColor:"4.thin"},D),{key:b}),l-b));for(var b=1;b<=p.date;b++){let U=b,j=o==n.year&&t==n.month&&b==n.date,w=!1;{let E=Number(String([o,t.zeroEmbed(2),b.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>E&&(w=!0),r.max){let W=Number(String(r.max).replace(/\D/ig,""));E>W&&(w=!0)}}S.push(I(v.Button.Clear.R,T(f({className:[g("CalendarDay"),g("isToday_"+j)].join(" ")},D),{onClick:()=>{m([o,t,U])},tabIndex:-1,key:U,isLocked:w,fontColor:"1.clear",ssEffectsOnActive:"shrink",padding:0,flexCenter:!0,borderRadius:"sphere",children:b})))}for(var b=1;b<7-p.weekday;b++)V.push(I(C,T(f({className:[g("CalendarDay"),g("Dummy")].join(" "),fontColor:"4.thin"},D),{key:b}),b));return y(_,{gridCols:7,gap:"1/3",children:[u,h,S,V]})}},Month:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n,month:s}=a;return y(x,{padding:1,children:[y(M.Separate,{gap:0,children:[i(M.Center,{verticalAlign:"bottom",gap:"2/3",children:i(R,{enableUnSelected:!1,value:n,options:A(),override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:p})=>{m({modifiedType:"update",year:Number(p),month:s})}})}),i(k.Variables.ShiftButtons,{callback:p=>{let l=Math.min(Math.max(n+p,1900),2100);m({modifiedType:"update",year:l,month:s})}})]}),i(C,{borderTop:!0}),k.Month.Months({min:e,max:d,year:a.year,callback:p=>{let[l,u]=p;m({modifiedType:"update",year:l,month:u})}}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Months:r=>{let{year:e,callback:d}=r,o=c.Time(),t=[];for(let a=1;a<=12;a++){let m=e==o.year&&a==o.month,n=!1;{let p=Number(String([e,a.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>p&&(n=!0),r.max){let l=Number(String(r.max).replace(/\D/ig,""));p>l&&(n=!0)}}let s=[g("Cell"),m?g("isThisMonth"):""].join(" ");t.push(y(v.Button.Clear.R,{className:s,isLocked:n,fontColor:"2.normal",padding:["2/3",1],ssEffectsOnActive:"shrink",onClick:()=>{d([e,a])},children:[a," \u6708"]},e+"-"+a))}return i(_,{gridCols:4,gap:"2/3",children:t})}},Year:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n}=a;return y(x,{padding:1,children:[i(R,{enableUnSelected:!1,value:n||c.Time().year,override:"force",options:A({min:e,max:d}),onUpdateValidValue:({value:s})=>{m({modifiedType:"update",year:Number(s)})}}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o,onSubmit:()=>{m({modifiedType:"update",year:Number(n||c.Time().year)})}})]})}},DateWareki:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{era:n,year:s,month:p,date:l}=a,u={val_value:a,set_value:m};return y(C,{children:[y(M.Left,{verticalAlign:"unset",borderBottom:!0,gap:0,children:[i(k.DateWareki.EraSelect,f({},u)),i(C,{borderRight:!0}),i(k.DateWareki.Calendar,f({},u))]}),i(C,{padding:1,children:i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})})]})},EraSelect:r=>{let{val_value:e,set_value:d}=r,o={padding:["1/2",1.5],fontColor:"3.blur"},t={backgroundColor:"cloud",fontColor:"2.normal",isSemiBoldFont:!0};return y(x,{gap:0,padding:1,children:[i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="year",onClick:()=>{let a=c.Time();d({modifiedType:"update",era:"year",year:a.year,month:a.month,date:a.date})},children:"\u897F\u66A6"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="reiwa",onClick:()=>{let a=c.Time();d({modifiedType:"update",era:"reiwa",year:a.year,month:a.month,date:a.date})},children:"\u4EE4\u548C"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="heisei",onClick:()=>{d({modifiedType:"update",era:"heisei",year:2019,month:1,date:1})},children:"\u5E73\u6210"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="shouwa",onClick:()=>{d({modifiedType:"update",era:"shouwa",year:1989,month:1,date:1})},children:"\u662D\u548C"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="taisho",onClick:()=>{d({modifiedType:"update",era:"taisho",year:1926,month:1,date:1})},children:"\u5927\u6B63"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="meiji",onClick:()=>{d({modifiedType:"update",era:"meiji",year:1912,month:1,date:1})},children:"\u660E\u6CBB"}))]})},Calendar:r=>{let{val_value:e,set_value:d}=r,o=[];if(e.era=="year")for(let t=1900;t<2100;t++)o.unshift({value:t,label:t+"\u5E74"});else if(e.era=="reiwa"){let t=c.Time().year-2018;for(let a=1;a<=t+10;a++)o.unshift({value:2019+a-1,label:"\u4EE4\u548C"+(a==1?"\u5143":a)+"\u5E74"})}else if(e.era=="heisei")for(let t=1;t<=31;t++)o.unshift({value:1989+t-1,label:"\u5E73\u6210"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="shouwa")for(let t=1;t<=64;t++)o.unshift({value:1926+t-1,label:"\u662D\u548C"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="taisho")for(let t=1;t<=15;t++)o.unshift({value:1912+t-1,label:"\u5927\u6B63"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="meiji")for(let t=1;t<=45;t++)o.unshift({value:1868+t-1,label:"\u660E\u6CBB"+(t==1?"\u5143":t)+"\u5E74"});return y(x,{padding:1,children:[y(M.Separate,{children:[i(R,{tone:"cloud",enableUnSelected:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},options:o,value:e.year,onUpdateValidValue:({value:t})=>{d(T(f({},e),{modifiedType:"update",year:Number(t)}))}}),y(M.Center,{gap:"1/3",children:[i(v.Button.Clear.S,{ssSphere:2,onClick:()=>{let t=e.month-1;d({modifiedType:"update",era:e.era,year:t==0?e.year-1:e.year,month:t==0?12:t,date:1})},children:i(N.ChevronLeft,{})}),i(R,{tone:"cloud",enableUnSelected:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:e.month,onUpdateValidValue:({value:t})=>{d({modifiedType:"update",era:e.era,year:e.year,month:Number(t),date:1})}}),i(v.Button.Clear.S,{ssSphere:2,onClick:()=>{let t=e.month+1;d({modifiedType:"update",era:e.era,year:t==13?e.year+1:e.year,month:t==13?1:t,date:1})},children:i(N.ChevronRight,{})})]})]}),i(k.DateWareki.MonthCell,f({},r))]},e.era)},MonthCell:r=>{let{val_value:e,set_value:d}=r,o=c.Time([e.year.zeroEmbed(4),e.month.zeroEmbed(2),e.date.zeroEmbed(2)].join("/"));if(!o.validate)return;let t=o.getFirstDayOfTheMonth().weekday,a=o.getLastDayOfTheMonth(),m=[];for(let n=0;n<7;n++)m.push(i(O.Supplement,{flexCenter:!0,fontColor:n==0?"googleRed":n==6?"googleBlue":"3.blur",children:c.transformer.weekday.shortJP(n)}));for(let n=0;n<t;n++){let s=c.Time(o).getFirstDayOfTheMonth().addDate(n-t);m.push(i(v.Button.Sub.R,{color:"cloud",border:"1.thin",ssSquare:3,opacity:"middle",onClick:p=>{p.preventDefault(),p.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}for(let n=1;n<=a.date;n++){let s=c.Time(o).setDate(n);m.push(i(v.Button.Border.R,{ssSquare:3,onClick:()=>{d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}for(let n=0;n<7-a.weekday-1;n++){let s=c.Time(o).addMonth(1).setDate(1).addDate(n);m.push(i(v.Button.Sub.R,{color:"cloud",border:"1.thin",ssSquare:3,opacity:"middle",onClick:p=>{p.preventDefault(),p.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}return i(_,{gridCols:7,gap:"1/4",children:m})}},Variables:{Footer:r=>y(B,{flexWrap:!1,gap:1,flexChilds:"even",freeCSS:{whiteSpace:"nowrap"},children:[y(v.Button.Border.R,{onClick:()=>{r.onValueUpdate("")},tabIndex:-1,flexSizing:"none",padding:["2/3",1],children:[i(N.Times,{})," \u524A\u9664"]}),i(v.Button.Prime.R,{flexSizing:"auto",onClick:()=>{r.onSubmit&&r.onSubmit(),H.close(r.tipsID)},tabIndex:-1,children:"\u6C7A\u5B9A",padding:["2/3",1]})]}),ShiftButtons:r=>y(B,{flexWrap:!1,gap:"1/3",children:[i(v.Button.Clear.R,T(f({className:g("LeftButton"),tabIndex:-1,right:0},k.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(-1)},children:i(N.ChevronLeft,{})})),i(v.Button.Clear.R,T(f({className:g("RightButton"),tabIndex:-1,left:0},k.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(1)},children:i(N.ChevronRight,{})}))]}),ShiftButtonStyles:{flexCenter:!0,padding:0,unitWidth:3,unitHeight:3,borderRadius:"sphere",position:"relative"}}};export{L as Picker,L as default};
|