amotify 0.1.59 → 0.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@declaration/property.d.ts +9 -9
- package/dist/@utils/GenerateClassName.d.ts +2 -2
- package/dist/@utils/GenerateClassName.js +1 -1
- package/dist/@utils/LaunchReactApp.d.ts +1 -1
- package/dist/@utils/useRecycle.js +1 -1
- 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/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/Layout/PageRouter.js +1 -1
- package/dist/fn/Layout/RootViewController.d.ts +6 -6
- package/dist/fn/Layout/RootViewController.js +1 -1
- package/dist/fn/Layout/SwipeView.d.ts +1 -1
- package/dist/fn/Layout/SwipeView.js +1 -1
- package/dist/fn/Loader/corner.js +1 -1
- package/dist/fn/Loader/index.d.ts +1 -1
- package/dist/fn/Loader/mini.d.ts +1 -1
- package/dist/fn/Loader/mini.js +1 -1
- package/dist/fn/Loader/top.js +1 -1
- package/dist/fn/Sheet.d.ts +10 -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/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/index.d.ts +3 -3
- package/dist/mols/Accordion.js +1 -1
- package/dist/mols/Text.js +1 -1
- package/package.json +2 -2
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y,b as o,c as _,d as H}from"../../../chunk-VY3566IV.js";import{Fragment as ke,jsx as T,jsxs as Z}from"react/jsx-runtime";import{useState as W,useEffect as X,useRef as re}from"react";import b from"@mingoo/jsmin";import{$$fromRoot as ie,Config as z,useStore as O}from"../../../@utils";import ae from"../../../atoms/Box";import ne from"../../../atoms/FAI";import q from"../../Button";import G from"../../Tooltips";import{faClock as le}from"@fortawesome/free-solid-svg-icons/faClock";import{faCalendarAlt as oe}from"@fortawesome/free-solid-svg-icons/faCalendarAlt";import{Wrapper as se,BoxWrapper as me,SubmitForm as ue,CommonEffects as pe,DefaultStyles as ce}from"../core";import de from"../Hidden";import fe from"../Select";import he from"../Parts";import ge from"./Picker";const A=" ~ ",ye={clock:{defaultValue:"--:--",format:/^\d{2}\D\d{2}$/,ranges:[{type:"hour",from:0,length:2},{type:"minute",from:3,length:2}],sets:1},date:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2}],sets:1},week:{defaultValue:"----\u5E74\u7B2C--\u9031",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4,region:6},{type:"week",from:6,length:2,region:3}],sets:1},month:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:3}],sets:1},year:{defaultValue:"----\u5E74",format:/^\d{4}$/,ranges:[{type:"year",from:0,length:4,region:5}],sets:1},dates:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2,region:5},{type:"year",from:10+A.length,length:4},{type:"month",from:15+A.length,length:2},{type:"date",from:18+A.length,length:2}],sets:2},months:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:6},{type:"year",from:8+A.length,length:4},{type:"month",from:13+A.length,length:2,region:3}],sets:2},dateWareki:{defaultValue:"----\u5E74--\u6708--\u65E5",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"dateWareki",from:0,length:4,region:5},{type:"month",from:5,length:2,region:3},{type:"date",from:8,length:2,region:3}],sets:1}},P=e=>{let{restrict:l,value:v,era:t}=e,D=b.flatArray(v||""),{defaultValue:h,format:d,ranges:p,sets:i}=ye[l],m=[],n=l=="clock"?":":"/";for(let a=0;a<D.length;a++)D[a]=String(D[a]).replace(/\D/ig,n);for(let a=0;a<i;a++){let c=D[a]||"";if(!c.match(d))D[a]="",m.push(h);else{let x=h;c.split(/\D/).forEach((S,R)=>{if(R==0&&l=="dateWareki"){let y=Number(S);t!="year"&&(y>=2019?t=="reiwa"?y-=2018:t=="heisei"&&(y=31):y>=1989?t=="heisei"?y-=1988:t=="shouwa"&&(y=64):y>=1926?t=="shouwa"?y-=1925:t=="taisho"&&(y=15):y>=1912?t=="taisho"?y-=1911:t=="meiji"&&(y=45):y>=1868&&(y-=1867)),S=y.zeroEmbed(4)}x=x.replace(new RegExp("------------------".slice(0,S.length)),S)}),m.push(x)}}return{formatValue:m.join(A),dataValue:["dates","months"].includes(l)?D:D[0],ranges:p}};function ve(e){let{para:l}=e,{restrict:v,min:t,max:D,required:h}=l,d=[],p=b.flatArray(e.value),i={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let m=v=="clock"?":":"/";for(let n=0;n<p.length;n++)p[n]=String(p[n]).replace(/\D/ig,m);for(let n=0;n<p.length;n++){let a=p[n],c=p[n-1];a.removeLetters()||(i.empty=!0),n>0&&(i.escalated&=+(a>=c))}i.escalated&&(i.empty||(v.match(/clock/)?p.forEach(n=>{let[a,c]=n.split(/\D+/);!a||!c?i.filled=!1:(Number(a)>23||Number(c)>59)&&(i.correct=!1)}):v.match(/date/)?p.forEach(n=>{let[a,c,x]=n.split(/\D+/);if(!a||!c||!x)i.filled=!1;else{let S=b.Time(n);(!S.validate||n!=S.toFormatYMD())&&(i.correct=!1)}}):v.match(/week/)?p.forEach(n=>{let[a,c]=n.split(/\D+/);if(!a||!c)i.filled=!1;else{let x=b.Time(a+"/01/01").weekday,R=b.Time(a+"/01/0"+(7-x+1)).addWeek(Number(c)-1);a!=String(R.year)&&(i.correct=!1)}}):v.match(/month/)?p.forEach(n=>{let[a,c]=n.split(/\D+/);!a||!c?i.filled=!1:b.Time([a,c,"01"].join("/")).validate||(i.correct=!1)}):v.match(/year/),i.filled&&i.correct&&p.forEach(n=>{{let a=Number(String(n).replace(/\D/ig,""));if(t&&Number(String(t).replace(/\D/ig,""))>a&&(i.prohibited=!0),D){let c=Number(String(D).replace(/\D/ig,""));a>c&&(i.prohibited=!0)}}})))})();{let{empty:m,escalated:n,filled:a,correct:c,prohibited:x}=i;m&&h&&(d=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),n||d.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),c||d.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),a||d.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),x&&d.push({type:"invalid",label:Z(ke,{children:[T(ae,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",t||"\u4E0B\u9650\u7121\u3057","] ~ [",D||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!d.filter(({type:m})=>m=="invalid").length,notice:d}}const Q={picker:{launch:e=>{let l=e.tipsID||b.uuid.gen();G.open(_(o({gravityPoint:e.gravityPoint||24,padding:"1/2",tipsID:l},e),{close_option:o({aroundClick:!0,parentBlur:!1},e.close_option),content:T(ge,{restrict:e.restrict,min:e.min,max:e.max,era:e.era,defaultValue:e.defaultValue,tipsID:l,onValueUpdate:(v,t)=>{e.onValueUpdate(v,t)}})}))},remove:e=>{G.close(e)}}},De=e=>{let U=e,{tone:l,required:v,restrict:t="clock",componentID:D,era:h,form:d,name:p,min:i,max:m,className:n,enableFormSubmit:a,checkValidationAtFirst:c,onKeyDown:x,onValidate:S,onUpdateValue:R,onUpdateValidValue:y,value:$="",leftIndicator:J,rightIndicator:F}=U,f=H(U,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator"]),[r,C]=W(h),[s,V]=W(_(o({componentID:e.componentID||""},P({restrict:t,value:$,era:r})),{eventType:"init",eventID:b.uuid.gen()})),[g,M]=W({ok:!1,notice:[]}),[I,k]=W({active:!1,index:0,prevIndex:-1});pe({type:"time",para:e,val_status:s,set_status:V,val_validate:g,set_validate:M,DefaultValidation:ve,onUpdateValue:R,onUpdateValidValue:y,ExtraOverrideParams:o({},P({restrict:t,value:$,era:r}))});const E=re(!1);return X(()=>{if(E.current){V(o(o({},s),P({restrict:t,value:s.dataValue,era:r})));let u=O.get("refreshEra_"+s.componentID);u&&u.refreshEra(r)}else E.current=!0},[r]),O.update({key:s.componentID,value:{openPicker:()=>{e.disabled||Q.picker.launch({parent:"#Picker-"+s.componentID,tipsID:"PickerTips-"+s.componentID,restrict:t,min:i,max:m,defaultValue:s.dataValue,era:r,onValueUpdate:(u,w)=>{V(_(o(o({},s),P({restrict:t,value:u,era:w})),{eventType:"update",eventID:b.uuid.gen()})),C(w)}})},resetEra:u=>{C(u),V(_(o(o({},s),P({restrict:t,value:"",era:r})),{eventType:"update",eventID:b.uuid.gen()}))}}}),X(()=>{let{index:u,active:w}=I;if(w){u=Math.max(u,0),u=Math.min(u,s.ranges.length-1);let{from:B,length:L}=s.ranges[u],j=ie("#"+e.id)[0];j&&j.setSelectionRange(B,B+L)}},[I]),Z(me,{val_status:s,set_status:V,val_validate:g,para:e,children:[T(de,{name:p,"data-input-type":"time","data-form":d,"data-validation":g.ok,componentID:s.componentID,"data-value":JSON.stringify(["dates","months"].includes(t)?!s.dataValue[0]||!s.dataValue[1]?null:s.dataValue:s.dataValue||null)}),z.get().isTouchDevice?T(q.Button.Plain,{className:n,freeCSS:{textAlign:"left"},children:s.formatValue,onClick:u=>{let w=O.get(s.componentID);w&&w.openPicker(),u.stopPropagation()}}):T("input",o({type:"text",inputMode:"numeric","data-input-type":"time","data-form-name":d,value:s.formatValue,className:n,tabIndex:z.get().isTouchDevice?-1:0,onKeyDown:u=>{Ie({restrict:t,event:u,val_era:r,val_status:s,set_status:V,val_focus:I,set_focus:k}),x&&x(u),a&&ue(u)},onKeyUp:u=>{u.key=="Tab"&&k(_(o({},I),{active:!0}))},onClick:u=>{let w=u.target.selectionEnd,B=0;s.ranges.forEach((L,j)=>{let{from:K,length:ee,region:te}=L;K<=w&&w<=K+(te||ee)&&(B=j)}),k(_(o({},I),{active:!0,index:B})),u.preventDefault()},onChange:()=>{}},f))]})},Ie=e=>{let{val_era:l,restrict:v,event:t,val_status:D,set_status:h,val_focus:d,set_focus:p}=e,{key:i,shiftKey:m,ctrlKey:n,metaKey:a}=t,c=n||a,{selectionStart:x,selectionEnd:S}=t.target,{index:R,prevIndex:y}=d,{ranges:$,formatValue:J}=D,F=$.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(i)){let f=0;if(i=="Tab"){let r=+!m*2-1;if(f=d.index+r,f<0||f>F)return}else{let r=i=="ArrowLeft"?-1:i=="ArrowRight"?1:0;c||x==0&&S==String(D.formatValue).length?f=r==1?F:0:f=Math.max(0,Math.min(R+r,F))}p(_(o({},d),{index:f,prevIndex:R})),t.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(i)){t.preventDefault();let f=R;f=Math.max(f,0),f=Math.min(f,F);let{type:r,from:C,length:s}=$[f],V=J.slice(C,C+s),g;if(i=="Backspace")g="------".slice(0,s);else if(["ArrowUp","ArrowDown"].includes(i)){let M=i=="ArrowUp"?1:-1;V=V|0,g=V+M;let[I,k,E]=r=="dateWareki"?l=="year"?[0,2999,4]:l=="reiwa"?[1,2999,4]:l=="heisei"?[1,31,4]:l=="shouwa"?[1,64,4]:l=="taisho"?[1,15,4]:l=="meiji"?[1,45,4]:[0,0,0]:r=="minute"?[0,59,2]:r=="hour"?[0,23,2]:r=="date"?[1,31,2]:r=="week"?[1,53,2]:r=="month"?[1,12,2]:r=="year"?[0,2999,4]:[0,0,0];g>k?g=I:g<I&&(g=k),g=Number(g).zeroEmbed(E)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(i)){let M=V|0,I=i,k=`${M}${I}`;if(y!=R&&(M=0,k="0"+I),r=="year"||r=="dateWareki"&&l=="year")Number(k)>1e4?g=I:g=k,(g|0)>1e3&&f++;else if(["hour","minute","date","week","month"].includes(r)||r=="dateWareki"&&l!="year"){let E=r=="dateWareki"?l=="reiwa"?100:l=="heisei"?31:l=="shouwa"?64:l=="taisho"?15:l=="meiji"?45:0:r=="minute"?59:r=="hour"?23:r=="date"?31:r=="week"?53:r=="month"?12:0;g=(k|0)>E?I:k,(Number(I)>Number(String(E)[0])||V=="0000".slice(0,String(E).length)&&(k!="0000".slice(0,String(E).length)||["minute","hour"].includes(r)&&y==R)||(k|0)>=Y(10,String(E).length-1))&&f++}r=="year"||r=="dateWareki"?g=(g|0).zeroEmbed(4):g=(g|0).zeroEmbed(2)}{let M=String(J).partReplace(C,String(g)),I=M.split(A).map(k=>k.replace(/(^\D|\D$)/,"").split(/\D+/).join(v=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(v=="dateWareki"){let k=I[0].split(/\D/),[E,U,u]=k;k.length==3&&E&&(I=[[Number(E)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[l]),U,u].join("/")])}f=Math.max(f,0),f=Math.min(f,F),h(_(o({},D),{dataValue:["dates","months"].includes(v)?I:I[0],formatValue:M,eventType:"update",eventID:b.uuid.gen()})),p(_(o({},d),{index:f,prevIndex:d.index}))}}},N={Origin:e=>{e=o({},e);let[l]=W(e.componentID||b.uuid.gen());if(e.componentID=l,b.is.nullish(e.rightIndicator)){let v=(e.restrict||"").match(/clock/)?le:oe;e.rightIndicator=T(he.RightIndicator,{padding:0,children:T(q.Button.Sub.R,{color:"cloud",border:"unset",padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["ripple.cloud"],tabIndex:-1,id:"Picker-"+e.componentID,onClick:()=>{let t=O.get(e.componentID);t&&t.openPicker()},children:T(ne,{icon:v})})})}return T(se,{componentID:e.componentID,children:De,para:ce.Boxish(e)})},Clock:e=>T(N.Origin,o({restrict:"clock",era:"clock"},e)),Date:e=>T(N.Origin,o({restrict:"date"},e)),Week:e=>T(N.Origin,o({restrict:"week"},e)),Month:e=>T(N.Origin,o({restrict:"month"},e)),Year:e=>T(N.Origin,o({restrict:"year"},e)),DateWareki:e=>{e=o({},e);let[l]=W(e.componentID||b.uuid.gen());e.componentID=l;let{defaultEra:v="wareki"}=e,[t,D]=W((()=>{let h="year";if(v=="wareki"&&(h="reiwa",e.value)){let[d,p,i]=e.value.split(/\D/);if(d&&p&&i){let m=Number(d);m>=2019?(m-=2019,h="reiwa"):m>=1989?(m-=1989,h="heisei"):m>=1926?(m-=1926,h="shouwa"):m>=1912?(m-=1912,h="taisho"):m>=1868&&(m-=1868,h="meiji"),m+=1}}return h})());return X(()=>{O.set({key:"refreshEra_"+l,value:{refreshEra:h=>{D(h)}}})},[]),T(N.Origin,_(o({restrict:"dateWareki",leftIndicator:T(fe,{enableUnSelected:!1,value:t,tone:e.tone,override:"force",flexCenter:!0,borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",height:1,freeCSS:{whiteSpace:"nowrap"},options:[{value:"year",label:"\u897F\u66A6"},{value:"reiwa",label:"\u4EE4\u548C"},{value:"heisei",label:"\u5E73\u6210"},{value:"shouwa",label:"\u662D\u548C"},{value:"taisho",label:"\u5927\u6B63"},{value:"meiji",label:"\u660E\u6CBB"}],onUpdateValidValue:({value:h,eventType:d})=>{D(h);let p=O.get(e.componentID);p&&p.resetEra&&p.resetEra(h)}})},e),{era:t}))},Periods:{Date:e=>T(N.Origin,o({restrict:"dates"},e)),Month:e=>T(N.Origin,o({restrict:"months"},e))},fn:Q};export{N as Time,N as default};
|
|
1
|
+
import{a as Y,b as o,c as _,d as H}from"../../../chunk-VY3566IV.js";import{Fragment as ke,jsx as T,jsxs as Z}from"react/jsx-runtime";import{useState as W,useEffect as X,useRef as ae}from"react";import b from"@mingoo/jsmin";import{$$fromRoot as re,Config as z,useStore as C}from"../../../@utils";import ie from"../../../atoms/Box";import ne from"../../../atoms/FAI";import q from"../../Button";import G from"../../Tooltips";import{faClock as le}from"@fortawesome/free-solid-svg-icons/faClock";import{faCalendarAlt as oe}from"@fortawesome/free-solid-svg-icons/faCalendarAlt";import{Wrapper as se,BoxWrapper as me,SubmitForm as ue,CommonEffects as ce,DefaultStyles as pe}from"../core";import de from"../Hidden";import fe from"../Select";import he from"../Parts";import ge from"./Picker";const P=" ~ ",ye={clock:{defaultValue:"--:--",format:/^\d{2}\D\d{2}$/,ranges:[{type:"hour",from:0,length:2},{type:"minute",from:3,length:2}],sets:1},date:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2}],sets:1},week:{defaultValue:"----\u5E74\u7B2C--\u9031",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4,region:6},{type:"week",from:6,length:2,region:3}],sets:1},month:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:3}],sets:1},year:{defaultValue:"----\u5E74",format:/^\d{4}$/,ranges:[{type:"year",from:0,length:4,region:5}],sets:1},dates:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2,region:5},{type:"year",from:10+P.length,length:4},{type:"month",from:15+P.length,length:2},{type:"date",from:18+P.length,length:2}],sets:2},months:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:6},{type:"year",from:8+P.length,length:4},{type:"month",from:13+P.length,length:2,region:3}],sets:2},dateWareki:{defaultValue:"----\u5E74--\u6708--\u65E5",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"dateWareki",from:0,length:4,region:5},{type:"month",from:5,length:2,region:3},{type:"date",from:8,length:2,region:3}],sets:1}},B=e=>{let{restrict:l,value:v,era:t}=e,D=b.flatArray(v||""),{defaultValue:h,format:d,ranges:c,sets:r}=ye[l],m=[],n=l=="clock"?":":"/";for(let i=0;i<D.length;i++)D[i]=String(D[i]).replace(/\D/ig,n);for(let i=0;i<r;i++){let p=D[i]||"";if(!p.match(d))D[i]="",m.push(h);else{let x=h;p.split(/\D/).forEach((S,w)=>{if(w==0&&l=="dateWareki"){let y=Number(S);t!="year"&&(y>=2019?t=="reiwa"?y-=2018:t=="heisei"&&(y=31):y>=1989?t=="heisei"?y-=1988:t=="shouwa"&&(y=64):y>=1926?t=="shouwa"?y-=1925:t=="taisho"&&(y=15):y>=1912?t=="taisho"?y-=1911:t=="meiji"&&(y=45):y>=1868&&(y-=1867)),S=y.zeroEmbed(4)}x=x.replace(new RegExp("------------------".slice(0,S.length)),S)}),m.push(x)}}return{formatValue:m.join(P),dataValue:["dates","months"].includes(l)?D:D[0],ranges:c}};function ve(e){let{states:l}=e,{restrict:v,min:t,max:D,required:h}=l,d=[],c=b.flatArray(e.value),r={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let m=v=="clock"?":":"/";for(let n=0;n<c.length;n++)c[n]=String(c[n]).replace(/\D/ig,m);for(let n=0;n<c.length;n++){let i=c[n],p=c[n-1];i.removeLetters()||(r.empty=!0),n>0&&(r.escalated&=+(i>=p))}r.escalated&&(r.empty||(v.match(/clock/)?c.forEach(n=>{let[i,p]=n.split(/\D+/);!i||!p?r.filled=!1:(Number(i)>23||Number(p)>59)&&(r.correct=!1)}):v.match(/date/)?c.forEach(n=>{let[i,p,x]=n.split(/\D+/);if(!i||!p||!x)r.filled=!1;else{let S=b.Time(n);(!S.validate||n!=S.toFormatYMD())&&(r.correct=!1)}}):v.match(/week/)?c.forEach(n=>{let[i,p]=n.split(/\D+/);if(!i||!p)r.filled=!1;else{let x=b.Time(i+"/01/01").weekday,w=b.Time(i+"/01/0"+(7-x+1)).addWeek(Number(p)-1);i!=String(w.year)&&(r.correct=!1)}}):v.match(/month/)?c.forEach(n=>{let[i,p]=n.split(/\D+/);!i||!p?r.filled=!1:b.Time([i,p,"01"].join("/")).validate||(r.correct=!1)}):v.match(/year/),r.filled&&r.correct&&c.forEach(n=>{{let i=Number(String(n).replace(/\D/ig,""));if(t&&Number(String(t).replace(/\D/ig,""))>i&&(r.prohibited=!0),D){let p=Number(String(D).replace(/\D/ig,""));i>p&&(r.prohibited=!0)}}})))})();{let{empty:m,escalated:n,filled:i,correct:p,prohibited:x}=r;m&&h&&(d=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),n||d.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),p||d.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),i||d.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),x&&d.push({type:"invalid",label:Z(ke,{children:[T(ie,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",t||"\u4E0B\u9650\u7121\u3057","] ~ [",D||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!d.filter(({type:m})=>m=="invalid").length,notice:d}}const Q={picker:{launch:e=>{let l=e.tipsID||b.uuid.gen();G.open(_(o({gravityPoint:e.gravityPoint||24,padding:"1/2",tipsID:l},e),{close_option:o({aroundClick:!0,parentBlur:!1},e.close_option),content:T(ge,{restrict:e.restrict,min:e.min,max:e.max,era:e.era,defaultValue:e.defaultValue,tipsID:l,onValueUpdate:(v,t)=>{e.onValueUpdate(v,t)}})}))},remove:e=>{G.close(e)}}},De=e=>{let U=e,{tone:l,required:v,restrict:t="clock",componentID:D,era:h,form:d,name:c,min:r,max:m,className:n,enableFormSubmit:i,checkValidationAtFirst:p,onKeyDown:x,onValidate:S,onUpdateValue:w,onUpdateValidValue:y,value:O="",leftIndicator:J,rightIndicator:F}=U,f=H(U,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator"]),[a,A]=W(h),[s,V]=W(_(o({componentID:e.componentID||""},B({restrict:t,value:O,era:a})),{eventType:"init",eventID:b.uuid.gen()})),[g,M]=W({ok:!1,notice:[]}),[I,k]=W({active:!1,index:0,prevIndex:-1});ce({type:"time",states:e,val_status:s,set_status:V,val_validate:g,set_validate:M,DefaultValidation:ve,onUpdateValue:w,onUpdateValidValue:y,ExtraOverrideStates:o({},B({restrict:t,value:O,era:a}))});const E=ae(!1);return X(()=>{if(E.current){V(o(o({},s),B({restrict:t,value:s.dataValue,era:a})));let u=C.get("refreshEra_"+s.componentID);u&&u.refreshEra(a)}else E.current=!0},[a]),C.update({[s.componentID]:{openPicker:()=>{e.disabled||Q.picker.launch({parent:"#Picker-"+s.componentID,tipsID:"PickerTips-"+s.componentID,restrict:t,min:r,max:m,defaultValue:s.dataValue,era:a,onValueUpdate:(u,R)=>{V(_(o(o({},s),B({restrict:t,value:u,era:R})),{eventType:"update",eventID:b.uuid.gen()})),A(R)}})},resetEra:u=>{A(u),V(_(o(o({},s),B({restrict:t,value:"",era:a})),{eventType:"update",eventID:b.uuid.gen()}))}}}),X(()=>{let{index:u,active:R}=I;if(R){u=Math.max(u,0),u=Math.min(u,s.ranges.length-1);let{from:$,length:L}=s.ranges[u],j=re("#"+e.id)[0];j&&j.setSelectionRange($,$+L)}},[I]),Z(me,{val_status:s,set_status:V,val_validate:g,states:e,children:[T(de,{name:c,"data-input-type":"time","data-form":d,"data-validation":g.ok,componentID:s.componentID,"data-value":JSON.stringify(["dates","months"].includes(t)?!s.dataValue[0]||!s.dataValue[1]?null:s.dataValue:s.dataValue||null)}),z.get().isTouchDevice?T(q.Button.Plain,{className:n,freeCSS:{textAlign:"left"},children:s.formatValue,onClick:u=>{let R=C.get(s.componentID);R&&R.openPicker(),u.stopPropagation()}}):T("input",o({type:"text",inputMode:"numeric","data-input-type":"time","data-form-name":d,value:s.formatValue,className:n,tabIndex:z.get().isTouchDevice?-1:0,onKeyDown:u=>{Ie({restrict:t,event:u,val_era:a,val_status:s,set_status:V,val_focus:I,set_focus:k}),x&&x(u),i&&ue(u)},onKeyUp:u=>{u.key=="Tab"&&k(_(o({},I),{active:!0}))},onClick:u=>{let R=u.target.selectionEnd,$=0;s.ranges.forEach((L,j)=>{let{from:K,length:ee,region:te}=L;K<=R&&R<=K+(te||ee)&&($=j)}),k(_(o({},I),{active:!0,index:$})),u.preventDefault()},onChange:()=>{}},f))]})},Ie=e=>{let{val_era:l,restrict:v,event:t,val_status:D,set_status:h,val_focus:d,set_focus:c}=e,{key:r,shiftKey:m,ctrlKey:n,metaKey:i}=t,p=n||i,{selectionStart:x,selectionEnd:S}=t.target,{index:w,prevIndex:y}=d,{ranges:O,formatValue:J}=D,F=O.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(r)){let f=0;if(r=="Tab"){let a=+!m*2-1;if(f=d.index+a,f<0||f>F)return}else{let a=r=="ArrowLeft"?-1:r=="ArrowRight"?1:0;p||x==0&&S==String(D.formatValue).length?f=a==1?F:0:f=Math.max(0,Math.min(w+a,F))}c(_(o({},d),{index:f,prevIndex:w})),t.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(r)){t.preventDefault();let f=w;f=Math.max(f,0),f=Math.min(f,F);let{type:a,from:A,length:s}=O[f],V=J.slice(A,A+s),g;if(r=="Backspace")g="------".slice(0,s);else if(["ArrowUp","ArrowDown"].includes(r)){let M=r=="ArrowUp"?1:-1;V=V|0,g=V+M;let[I,k,E]=a=="dateWareki"?l=="year"?[0,2999,4]:l=="reiwa"?[1,2999,4]:l=="heisei"?[1,31,4]:l=="shouwa"?[1,64,4]:l=="taisho"?[1,15,4]:l=="meiji"?[1,45,4]:[0,0,0]:a=="minute"?[0,59,2]:a=="hour"?[0,23,2]:a=="date"?[1,31,2]:a=="week"?[1,53,2]:a=="month"?[1,12,2]:a=="year"?[0,2999,4]:[0,0,0];g>k?g=I:g<I&&(g=k),g=Number(g).zeroEmbed(E)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(r)){let M=V|0,I=r,k=`${M}${I}`;if(y!=w&&(M=0,k="0"+I),a=="year"||a=="dateWareki"&&l=="year")Number(k)>1e4?g=I:g=k,(g|0)>1e3&&f++;else if(["hour","minute","date","week","month"].includes(a)||a=="dateWareki"&&l!="year"){let E=a=="dateWareki"?l=="reiwa"?100:l=="heisei"?31:l=="shouwa"?64:l=="taisho"?15:l=="meiji"?45:0:a=="minute"?59:a=="hour"?23:a=="date"?31:a=="week"?53:a=="month"?12:0;g=(k|0)>E?I:k,(Number(I)>Number(String(E)[0])||V=="0000".slice(0,String(E).length)&&(k!="0000".slice(0,String(E).length)||["minute","hour"].includes(a)&&y==w)||(k|0)>=Y(10,String(E).length-1))&&f++}a=="year"||a=="dateWareki"?g=(g|0).zeroEmbed(4):g=(g|0).zeroEmbed(2)}{let M=String(J).partReplace(A,String(g)),I=M.split(P).map(k=>k.replace(/(^\D|\D$)/,"").split(/\D+/).join(v=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(v=="dateWareki"){let k=I[0].split(/\D/),[E,U,u]=k;k.length==3&&E&&(I=[[Number(E)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[l]),U,u].join("/")])}f=Math.max(f,0),f=Math.min(f,F),h(_(o({},D),{dataValue:["dates","months"].includes(v)?I:I[0],formatValue:M,eventType:"update",eventID:b.uuid.gen()})),c(_(o({},d),{index:f,prevIndex:d.index}))}}},N={Origin:e=>{e=o({},e);let[l]=W(e.componentID||b.uuid.gen());if(e.componentID=l,b.is.nullish(e.rightIndicator)){let v=(e.restrict||"").match(/clock/)?le:oe;e.rightIndicator=T(he.RightIndicator,{padding:0,children:T(q.Button.Sub.R,{color:"cloud",border:"unset",padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["ripple.cloud"],tabIndex:-1,id:"Picker-"+e.componentID,onClick:()=>{let t=C.get(e.componentID);t&&t.openPicker()},children:T(ne,{icon:v})})})}return T(se,{componentID:e.componentID,children:De,states:pe.Boxish(e)})},Clock:e=>T(N.Origin,o({restrict:"clock",era:"clock"},e)),Date:e=>T(N.Origin,o({restrict:"date"},e)),Week:e=>T(N.Origin,o({restrict:"week"},e)),Month:e=>T(N.Origin,o({restrict:"month"},e)),Year:e=>T(N.Origin,o({restrict:"year"},e)),DateWareki:e=>{e=o({},e);let[l]=W(e.componentID||b.uuid.gen());e.componentID=l;let{defaultEra:v="wareki"}=e,[t,D]=W((()=>{let h="year";if(v=="wareki"&&(h="reiwa",e.value)){let[d,c,r]=e.value.split(/\D/);if(d&&c&&r){let m=Number(d);m>=2019?(m-=2019,h="reiwa"):m>=1989?(m-=1989,h="heisei"):m>=1926?(m-=1926,h="shouwa"):m>=1912?(m-=1912,h="taisho"):m>=1868&&(m-=1868,h="meiji"),m+=1}}return h})());return X(()=>{C.set({["refreshEra_"+l]:{refreshEra:h=>{D(h)}}})},[]),T(N.Origin,_(o({restrict:"dateWareki",leftIndicator:T(fe,{enableUnSelected:!1,value:t,tone:e.tone,override:"force",flexCenter:!0,borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",height:1,freeCSS:{whiteSpace:"nowrap"},options:[{value:"year",label:"\u897F\u66A6"},{value:"reiwa",label:"\u4EE4\u548C"},{value:"heisei",label:"\u5E73\u6210"},{value:"shouwa",label:"\u662D\u548C"},{value:"taisho",label:"\u5927\u6B63"},{value:"meiji",label:"\u660E\u6CBB"}],onUpdateValidValue:({value:h,eventType:d})=>{D(h);let c=C.get(e.componentID);c&&c.resetEra&&c.resetEra(h)}})},e),{era:t}))},Periods:{Date:e=>T(N.Origin,o({restrict:"dates"},e)),Month:e=>T(N.Origin,o({restrict:"months"},e))},fn:Q};export{N as Time,N as default};
|
package/dist/fn/Input/core.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare namespace Wrapper {
|
|
|
6
6
|
type Input = {
|
|
7
7
|
componentID?: string;
|
|
8
8
|
children: React.FC<any>;
|
|
9
|
-
|
|
9
|
+
states: any;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export declare const Wrapper: React.FC<Wrapper.Input>;
|
|
@@ -15,7 +15,7 @@ declare namespace BoxWrapper {
|
|
|
15
15
|
val_status: any;
|
|
16
16
|
set_status: React.Dispatch<React.SetStateAction<any>>;
|
|
17
17
|
val_validate: InputTypes.Validation.Result;
|
|
18
|
-
|
|
18
|
+
states: any;
|
|
19
19
|
children: ReactElement;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ export declare const BoxWrapper: React.FC<BoxWrapper.Input>;
|
|
|
23
23
|
export declare const CommonEffects: {
|
|
24
24
|
(props: {
|
|
25
25
|
type?: string;
|
|
26
|
-
|
|
26
|
+
states: plainObject;
|
|
27
27
|
val_status: InputTypes.Status.Plain;
|
|
28
28
|
set_status: React.Dispatch<React.SetStateAction<any>>;
|
|
29
29
|
val_validate: InputTypes.Validation.Result;
|
|
@@ -31,24 +31,24 @@ export declare const CommonEffects: {
|
|
|
31
31
|
DefaultValidation: InputTypes.Validation.SystemCheck;
|
|
32
32
|
onUpdateValue?: InputTypes.OnUpdateValue;
|
|
33
33
|
onUpdateValidValue?: InputTypes.OnUpdateValue;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
ExtraOverrideStates?: plainObject;
|
|
35
|
+
ExtraStoreStates?: plainObject;
|
|
36
36
|
}): void;
|
|
37
37
|
};
|
|
38
38
|
export declare const ValidationCheck: {
|
|
39
39
|
(props: {
|
|
40
40
|
val_status: InputTypes.Status.Plain;
|
|
41
41
|
DefaultValidation: InputTypes.Validation.SystemCheck;
|
|
42
|
-
|
|
42
|
+
states: any;
|
|
43
43
|
set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
|
|
44
44
|
}): void;
|
|
45
45
|
};
|
|
46
46
|
export declare const SubmitForm: (event: React.KeyboardEvent) => boolean;
|
|
47
47
|
export declare const DefaultStyles: {
|
|
48
|
-
Input: (type: InputTypes.BoxTone) => TagProperty.
|
|
49
|
-
ListCell: (
|
|
50
|
-
Boxish: (
|
|
51
|
-
Indicator: (type: InputTypes.BoxTone) => TagProperty.
|
|
52
|
-
IndicatorIcon: TagProperty.
|
|
48
|
+
Input: (type: InputTypes.BoxTone) => TagProperty.States;
|
|
49
|
+
ListCell: (p: List.Plain) => List.Plain;
|
|
50
|
+
Boxish: (p: any) => any;
|
|
51
|
+
Indicator: (type: InputTypes.BoxTone) => TagProperty.States;
|
|
52
|
+
IndicatorIcon: TagProperty.States;
|
|
53
53
|
};
|
|
54
54
|
export {};
|
package/dist/fn/Input/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,c as
|
|
1
|
+
import{b as o,c as n,e as D}from"../../chunk-VY3566IV.js";import{jsx as v,jsxs as V}from"react/jsx-runtime";import{useState as _,useEffect as R,useRef as P}from"react";import i from"@mingoo/jsmin";import{$$fromRoot as z,Config as L,useStore as y,GenerateClassName as B}from"../../@utils";import{InputClasses as N}from"../../@styles/componentClasses";import E from"../../atoms/Box";import A from"../../atoms/Flex";import T from"../../atoms/FAI";import w from"../../mols/Row";import W from"../../mols/Column";import U from"../Button";import k from"../Tooltips";const ue=e=>{let[t]=_(e.componentID||i.uuid.gen());e=o({},e),e.states=n(o({enableFormSubmit:!0,status_id:i.uuid.gen(),override:"never",name:i.uuid.gen(),id:i.uuid.gen(),"aria-label":"Input-"+t},e.states),{componentID:t});let{children:a}=e;return v(a,o({},e.states))},de=e=>{let{children:t,val_status:a,set_status:r,val_validate:c,states:l}=e,{clearButton:s,rightIcon:u,leftIcon:p,wrapStyles:m}=l;return a.eventType=="init"&&!l.checkValidationAtFirst&&(c.notice=[]),V(w.Center,n(o({position:"relative",verticalAlign:"unset",gap:0},m),{className:N("Wrapper"),"data-notice-uid":a.componentID,children:[v($,{notice:c.notice,val_status:a}),l.leftIndicator,V(A,{position:"relative",flexSizing:"auto",children:[p,t,s&&a.dataValue?v(U.Button.Normal.R,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3,transform:"translateY(-50%)"},onClick:()=>{r(n(o({},a),{dataValue:"",formatValue:"",eventType:"update",eventID:i.uuid.gen()}))},children:v(T.Times,{})}):u]}),l.rightIndicator]}))},$=e=>{let{notice:t,val_status:a}=e,{componentID:r,eventType:c}=a,l="NoticeTimer-"+r,s="NoticeTimerClose-"+r,u="notice-tips-"+r;return i.interval.clear(l),i.interval.clear(s),t.length?(i.interval.standBy(l,350,()=>{k.open({tipsID:u,parent:`[data-notice-uid="${r}"]`,gravityPoint:22,padding:[1,0],close_option:{parentBlur:!1},content:V(k.Comps.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[v(E,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),v(W,{gap:"1/3",position:"relative",freeCSS:{zIndex:2},backgroundColor:"inherit",children:t.map(p=>{let{type:m,label:C}=p,b=m=="invalid"?T.Times:m=="warn"?T.Exclamation:T.Check;return V(w.Left,{gap:0,borderRadius:"2.tone.secondary",children:[v(b,{flexCenter:!0,fontSize:"3.paragraph",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[m]}),v(E,{fontColor:"white",children:C})]})})})]})})}),i.interval.standBy(s,6e3,()=>{k.close(u)}),null):(k.close(u),null)},ce=e=>{let{type:t,states:a,val_status:r,set_status:c,ExtraOverrideStates:l,ExtraStoreStates:s,val_validate:u,set_validate:p,DefaultValidation:m,onUpdateValue:C,onUpdateValidValue:b}=e;a=o({},a);let{componentID:I}=r,[F,O]=_(i.uuid.gen());R(()=>(y.update({[I]:o({ResolveRefresh:null,Refresh:()=>new Promise((d,f)=>{y.get(I).ResolveRefresh=d,O(i.uuid.gen())}),GenNotice:d=>{let{ok:f,notice:S}=d;p({ok:f,notice:S})}},s)}),()=>{y.delete(I)}),[]);const x=P(!1);R(()=>{x.current?c(n(o({},r),{eventType:"refresh",eventID:i.uuid.gen()})):x.current=!0},[F]),R(()=>{a.value=r.dataValue,i.interval.clear("ValidationTimer-"+I),j({val_status:r,set_validate:p,DefaultValidation:m,states:a})},[r.eventID]),(()=>{let{override:d}=a;if(d=="never"||d=="beforeModified"&&!["init","override"].includes(r.eventType))return;let f=y.get(r.componentID);f&&(a.value!=r.dataValue&&a.status_id!=f.status_id&&c(n(o(n(o({},r),{dataValue:a.value}),l),{eventType:"override",eventID:i.uuid.gen()})),f.status_id=a.status_id)})(),R(()=>{let{componentID:d,eventType:f,dataValue:S}=r,g=S;if(t=="list"?g=S.map(h=>JSON.parse(h)):t=="select"||t=="richSelect"?g=JSON.parse(S):t=="file"&&y.update({[d]:{Files:r.dataValue}}),f=="refresh"){let h=y.get(d);h&&h.ResolveRefresh&&h.ResolveRefresh(null)}f=="update"&&(C&&C({componentID:d,value:g,storeData:y.get(d),eventType:f}),i.scope(()=>{u.ok&&b&&b({componentID:d,value:g,storeData:y.get(d),eventType:f})}))},[u])},j=e=>{let{val_status:t,states:a,set_validate:r,DefaultValidation:c}=e,l=c({value:t.dataValue,states:a});if(!l.ok){r(l);return}let s=l.notice;const u=()=>D(void 0,null,function*(){if(!a.onValidate)return;let p=yield a.onValidate({value:t.dataValue,eventType:t.eventType,props:e});if(!p.ok){r({ok:!1,notice:[...s,...p.notice]});return}r({ok:!0,notice:[...s,...p.notice]})});a.onValidate?t.eventType=="refresh"?u():i.interval.standBy("ValidationTimer-"+t.componentID,450,u):r({ok:!0,notice:s})},pe=e=>{let t=e.target,{form:a,formName:r}=t.dataset;a=r||a;let c=!1,l=z(`[data-form-submit-button="${a}"]`)[0];if(!l)return c;let s=l.dataset.sdfike||"",u=e.key,p=e.ctrlKey||e.metaKey;return i.scope(()=>{s.includes("enter")&&(u!="Enter"||e.nativeEvent.isComposing||L.get().browserIs=="safari"&&e.keyCode==229)||((u=="Enter"&&(s.includes("enter")||s.includes("auxEnter")&&p)||u==" "&&s.includes("space"))&&(l.click(),e.preventDefault()),c=!0)}),c},K={Input:e=>{if(e=="plain")return{};let t={padding:"3/4",transition:"middle",flexSizing:"auto",boxShadow:"0.thin"};return e=="border"?t=n(o({},t),{border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"}):e=="cloud"?t=n(o({},t),{border:"1.thin",borderRadius:"2.tone.secondary",backgroundColor:"cloud"}):e=="bottomBorder"&&(t=n(o({},t),{borderRadius:0,border:"unset",borderBottom:!0,backgroundColor:"cloud"})),t},ListCell:e=>{e=o({},e),e.tone||(e.tone="border");let{tone:t}=e;return t=="plain"||(e=n(o({},e),{cellStyles:o({position:"relative",padding:["3/4",1],borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),t=="normal"?e=n(o({gap:"1/2"},e),{cellStyles:o({isSemiBoldFont:!0},e.cellStyles),cellCheckedStyles:{backgroundColor:"cloud"}}):(e=n(o({gap:"3/4"},e),{cellStyles:o({boxShadow:"0.thin"},e.cellStyles)}),(t=="cloud"||t=="vivid")&&(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.2"},e.cellStyles)),t=="border"?(e.cellStyles=o({border:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):t=="cloud"?e.cellCheckedStyles=o({backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"theme"},e.cellCheckedStyles):t=="vivid"&&(e.cellCheckedStyles=o({backgroundColor:"theme",fontColor:"white",borderColor:"theme"},e.cellCheckedStyles)))),B(e)},Boxish:e=>{e=o({},e),e.tone||(e.tone="border");let t=n(o(o(o(n(o({},K.Input(e.tone)),{fontColor:"2.normal"}),e),!!e.leftIndicator&&{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3",marginLeft:"1/4"}),!!e.rightIndicator&&{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}),{className:[N("Input"),e.className].join(" ")});return B(t)},Indicator:e=>{if(e||(e="border"),e=="plain")return{};let t={flexSizing:"none",flexCenter:!0,padding:[0,1],borderRadius:"2.tone.secondary",backgroundColor:"cloud"};return e=="border"?t=n(o({},t),{border:!0}):e=="cloud"?t=n(o({},t),{border:"1.thin"}):e=="bottomBorder"&&(t=n(o({},t),{borderRadius:0,borderBottom:!0})),t},IndicatorIcon:{position:"absolute",ssSquare:2,top:"50%",flexCenter:!0,fontColor:"theme",fontSize:"1.mini",backgroundColor:"inherit",freeCSS:{transform:"translateY(-50%)"}}};export{de as BoxWrapper,ce as CommonEffects,K as DefaultStyles,pe as SubmitForm,j as ValidationCheck,ue as Wrapper};
|
package/dist/fn/Input/index.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export declare namespace InputTypes {
|
|
|
25
25
|
};
|
|
26
26
|
type CoreInput = UniInput & {
|
|
27
27
|
className?: string;
|
|
28
|
-
wrapStyles?: TagProperty.
|
|
29
|
-
} & TagProperty.
|
|
28
|
+
wrapStyles?: TagProperty.States;
|
|
29
|
+
} & TagProperty.States;
|
|
30
30
|
namespace Validation {
|
|
31
31
|
type EventType = 'init' | 'update' | 'override' | 'refresh';
|
|
32
32
|
type Notice = {
|
|
@@ -40,7 +40,7 @@ export declare namespace InputTypes {
|
|
|
40
40
|
type SystemCheck = {
|
|
41
41
|
(props: {
|
|
42
42
|
value: any;
|
|
43
|
-
|
|
43
|
+
states: any;
|
|
44
44
|
}): Result;
|
|
45
45
|
};
|
|
46
46
|
type OnValidate = {
|
|
@@ -99,7 +99,7 @@ import _Segmented from './Segmented';
|
|
|
99
99
|
import _Parts from './Parts';
|
|
100
100
|
declare namespace Input {
|
|
101
101
|
type Methods = {
|
|
102
|
-
Plain: React.FC<TagProperty.
|
|
102
|
+
Plain: React.FC<TagProperty.States & React.InputHTMLAttributes<HTMLInputElement>>;
|
|
103
103
|
Hidden: React.FC<_Hidden.Input>;
|
|
104
104
|
Text: _Text.Methods;
|
|
105
105
|
TextArea: React.FC<_TextArea.Input>;
|
package/dist/fn/Input/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import o from"./Plain";import i from"./Hidden";import a from"./Text";import p from"./TextArea";import m from"./AutoHeightText";import n from"./Contenteditable";import l from"./DigitCharacters";import c from"./Time";import s from"./Select";import d from"./RichSelect";import*as r from"./List";import x from"./Chips";import h from"./Search";import _ from"./Filer";import y from"./Slider";import C from"./Switch";import T from"./Checker";import
|
|
1
|
+
import"../../chunk-VY3566IV.js";import o from"./Plain";import i from"./Hidden";import a from"./Text";import p from"./TextArea";import m from"./AutoHeightText";import n from"./Contenteditable";import l from"./DigitCharacters";import c from"./Time";import s from"./Select";import d from"./RichSelect";import*as r from"./List";import x from"./Chips";import h from"./Search";import _ from"./Filer";import y from"./Slider";import C from"./Switch";import T from"./Checker";import S from"./Segmented";import u from"./Parts";var t;(e=>(e.Plain=o,e.Hidden=i,e.Text=a,e.TextArea=p,e.AutoHeightText=m,e.Contenteditable=n,e.DigitCharacters=l,e.Time=c,e.Select=s,e.RichSelect=d,e.List=r.List,e.Radio=r.Radio,e.Checkbox=r.Checkbox,e.Checker=T,e.Chips=x,e.Search=h,e.Filer=_,e.Slider=y,e.Switch=C,e.Segmented=S,e.Comps=u))(t||(t={}));export{t as Input,t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import{jsx as n,jsxs as P}from"react/jsx-runtime";import{useEffect as c,useRef as m}from"react";import{useStore as R}from"../../@utils";import*as s from"react-router-dom";import C from"../Sheet";import{PageNotFound as g}from"./PageNotFound";import{RootViewController as
|
|
1
|
+
import"../../chunk-VY3566IV.js";import{jsx as n,jsxs as P}from"react/jsx-runtime";import{useEffect as c,useRef as m}from"react";import{useStore as R}from"../../@utils";import*as s from"react-router-dom";import C from"../Sheet";import{PageNotFound as g}from"./PageNotFound";import{RootViewController as h}from"./RootViewController";const k=(t,o,a)=>{const r=m(!1);let e=s.useLocation(),u=s.useNavigate();R.set({navigate:u}),c(()=>{r.current?(C.closeAll(!0),h.fn.updateCSSProperty.reset()):r.current=!0},[e.pathname]),t&&t(e),c(()=>{a&&a(e)},[]),c(()=>{setTimeout(()=>{window.dispatchEvent(new Event("resize"))},200),o&&o(e)},[e])},B=t=>{let{routes:o,beforeCallBack:a,afterCallBack:r,afterFirstCallBack:e}=t;k(a,r,e);let u=o.map(i=>{let{path:l,content:f}=i;return l="/"+l.replace(/^\//,""),n(s.Route,{path:l,element:f},l)});return P(s.Routes,{children:[u,n(s.Route,{path:"*",element:n(g,{})})]})},p=t=>{let{pages:o,beforeCallBack:a,afterCallBack:r,afterFirstCallBack:e}=t;return n(B,{routes:o,beforeCallBack:a,afterCallBack:r,afterFirstCallBack:e})};export{p as PageRouter,p as default};
|
|
@@ -5,27 +5,27 @@ import Flex from '../../atoms/Flex';
|
|
|
5
5
|
import Button from '../Button';
|
|
6
6
|
declare namespace RootViewController {
|
|
7
7
|
type Methods = {
|
|
8
|
-
Base: React.FC<RootViewController.
|
|
8
|
+
Base: React.FC<RootViewController.Base>;
|
|
9
9
|
TopNavigation: React.FC<Flex.Input>;
|
|
10
10
|
SideNavigation: React.FC<Flex.Input & {
|
|
11
|
-
baseStyles?: TagProperty.
|
|
11
|
+
baseStyles?: TagProperty.States;
|
|
12
12
|
}>;
|
|
13
13
|
FooterNavigation: React.FC<Flex.Input & {
|
|
14
|
-
baseStyles?: TagProperty.
|
|
14
|
+
baseStyles?: TagProperty.States;
|
|
15
15
|
}>;
|
|
16
16
|
Comps: {
|
|
17
|
-
Button: React.FC<
|
|
17
|
+
Button: React.FC<Button>;
|
|
18
18
|
Title: React.FC<Box.Input>;
|
|
19
19
|
Bar: React.FC<Box.Input>;
|
|
20
20
|
};
|
|
21
21
|
fn: FNs;
|
|
22
22
|
};
|
|
23
|
-
type
|
|
23
|
+
type Base = Box.Input & {
|
|
24
24
|
topNavigation?: ReactElement;
|
|
25
25
|
sideNavigation?: ReactElement;
|
|
26
26
|
footerNavigation?: ReactElement;
|
|
27
27
|
};
|
|
28
|
-
type
|
|
28
|
+
type Button = Button.ButtonInput & Button.Tones.Clear & {
|
|
29
29
|
uri?: string;
|
|
30
30
|
uriGroup?: (string | RegExp) | (string | RegExp)[];
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as p,c as
|
|
1
|
+
import{b as p,c as m,d as f}from"../../chunk-VY3566IV.js";import{jsx as s,jsxs as x}from"react/jsx-runtime";import{useState as S,useEffect as N}from"react";import r from"@mingoo/jsmin";import{$$fromRoot as v,Config as R,pageTransit as F}from"../../@utils";import h from"../../atoms/Box";import C from"../../atoms/Flex";import _ from"../../mols/Column";import P from"../Button";import{LayoutClasses as y}from"../../@styles/componentClasses";const c={Base:o=>{let l=o,{topNavigation:e,sideNavigation:t,footerNavigation:i,children:a,className:n}=l,g=f(l,["topNavigation","sideNavigation","footerNavigation","children","className"]);N(()=>{c.fn.updateCSSProperty.reset(),setTimeout(()=>{c.fn.updateCSSProperty.reset()},100);let u="ResizeCB",B="RemovePageEventCB";return r(window).addEvent({eventType:"resize",eventID:u,callback:()=>{R.get().screen.isPhonepoint()||(r.interval.clear("__RVC_calcHeights"),r.interval.standBy("__RVC_calcHeights",300,()=>{c.fn.updateCSSProperty.reset()}))}}),()=>{r(window).removeEvent(B),r(window).removeEvent(u)}},[]);let d=a;return x(_,m(p({className:[n,y("RootViewController")].join(" "),backgroundColor:"layer.1",gap:0,minHeight:"viewHeight"},g),{children:[e,x(C,{className:y("Body"),flexWrap:!1,position:"relative",flexSizing:0,children:[t,s(h,{className:y("Content"),position:"relative",flexSizing:0,width:0,UnderBreakPointStyles:{width:"auto"},children:d})]}),i]}))},TopNavigation:o=>{let n=o,{className:e,children:t}=n,i=f(n,["className","children"]),[a]=S(r.uuid.gen());return N(()=>{c.fn.updateCSSProperty.topNav()},[]),s(C,m(p({"data-id":a,flexSizing:"none",flexType:"col",position:"sticky",top:0,backgroundColor:"layer.1"},i),{id:"__RVC_TopNavigation",className:[e,y("TopNav")].join(" "),children:t}),a)},SideNavigation:o=>{let a=o,{className:e="",baseStyles:t}=a,i=f(a,["className","baseStyles"]);return s(h,p({flexSizing:"none",className:[e,y("SideNav")].join(" "),minHeight:"sideNavigationHeight"},i))},FooterNavigation:o=>{let n=o,{className:e="",baseStyles:t}=n,i=f(n,["className","baseStyles"]),[a]=S(r.uuid.gen());return N(()=>{c.fn.updateCSSProperty.footer()},[]),s(C,m(p({"data-id":a,borderTop:!0,position:"sticky",bottom:0,overflow:"auto",backgroundColor:"layer.1",paddingBottom:"safeAreaBottom"},t),{id:"__RVC_FooterNavigation",className:[y("FooterNav"),e].join(" "),children:s(C,p({gap:1,flexWrap:!1,padding:"2/3",margin:"auto"},i))}))},Comps:{Button:o=>{let d=o,{isActive:e,uri:t,uriGroup:i}=d,a=f(d,["isActive","uri","uriGroup"]),n=r.flatArray(i),g=location.pathname;{let l=!1;if(r.is.exist(t)&&r.is.string(t)){let u=[location.origin,t.replace(/\//,"")].join("/");l=g==new URL(u).pathname}if(!l&&n.length)for(let u of n)r.is.nullish(u)||g.match(new RegExp(u))&&(l=!0);e=e!=null?e:l}return s(P.Button.Clear.R,p({padding:["3/4",1],display:"flex",gap:"1/2",fontColor:"inherit",width:1,flexSizing:"none",flexWrap:!1,ssEffectsOnActive:"ripple.cloud",verticalAlign:"center",textAlign:"left",isSemiBoldFont:!0,isActive:e,isActiveStyles:{fontColor:"theme",backgroundColor:"cloud"},onClick:l=>{r.is.exist(t)&&r.is.string(t)&&F.push(t,l.ctrlKey||l.metaKey)},color:"cloud"},a))},Bar:o=>s(h,p({flexSizing:"none",backgroundColor:"layer.4.opa.middle",unitHeight:"1/3",margin:["2/3",1],borderRadius:"sphere"},o)),Title:o=>s(h,p({fontSize:"3.paragraph",isSemiBoldFont:!0,padding:[0,1]},o))},fn:{updateCSSProperty:{topNav:()=>{let o=r(document.body),e=v("#__RVC_TopNavigation"),t=e.position().height||0,i=t;e.getStyleProperty("position")!="sticky"&&(i=0),o.setStyleProperty("--topNavHeight",t+"px").setStyleProperty("--topBase",i+"px")},footer:()=>{let o=r(document.body),t=v("#__RVC_FooterNavigation").position().height||0;o.setStyleProperty("--footerNavHeight",t+"px")},reset:()=>{let o=r(document.body),e=v("#__RVC_TopNavigation"),t=v("#__RVC_FooterNavigation"),i=e.position().height||0,a=i,n=t.position().height||0;e.getStyleProperty("position")!="sticky"&&(a=0);let g=window.innerHeight,d=g-i-n;o.setStyleProperty("--topNavHeight",i+"px").setStyleProperty("--topBase",a+"px").setStyleProperty("--footerNavHeight",n+"px").setStyleProperty("--viewHeight",g+"px").setStyleProperty("--sideNavHeight",d+"px").setStyleProperty("--contentHeight",d+"px")}}}};export{c as RootViewController,c as default};
|
|
@@ -36,5 +36,5 @@ declare namespace SwipeView {
|
|
|
36
36
|
set_event: React.Dispatch<React.SetStateAction<SlideEvent>>;
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
declare const SwipeView: (
|
|
39
|
+
declare const SwipeView: (p: SwipeView.Input) => import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
export { SwipeView, SwipeView as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as f,c as T,d as k}from"../../chunk-VY3566IV.js";import{jsx as I}from"react/jsx-runtime";import{useState as L,useEffect as M,useRef as N}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as h,useStore as X}from"../../@utils";import R from"../../atoms/Box";import j from"../../atoms/Flex";import{LayoutClasses as a}from"../../@styles/componentClasses";const B=t=>{let D=t,{options:{onSlideCallback:e,visibilitySurroundSlide:u=!0,autoSwipems:d=0,loop:i=!1,disableMousedrag:r=!1,disableTouch:o=!1}={},wrapper:s=n=>n,slides:
|
|
1
|
+
import{b as f,c as T,d as k}from"../../chunk-VY3566IV.js";import{jsx as I}from"react/jsx-runtime";import{useState as L,useEffect as M,useRef as N}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as h,useStore as X}from"../../@utils";import R from"../../atoms/Box";import j from"../../atoms/Flex";import{LayoutClasses as a}from"../../@styles/componentClasses";const B=t=>{let D=t,{options:{onSlideCallback:e,visibilitySurroundSlide:u=!0,autoSwipems:d=0,loop:i=!1,disableMousedrag:r=!1,disableTouch:o=!1}={},wrapper:s=n=>n,slides:x=[]}=D,E=k(D,["options","wrapper","slides"]),[w]=L(c.uuid.gen()),[p,y]=L({eventType:"init",index:t.slideIndex});M(()=>{X.set({["SwipeTimer-"+w]:null})},[]);const g=N(!1);M(()=>{y({eventType:"usr",index:t.slideIndex}),g.current||(g.current=!0)},[t.slideIndex]),M(()=>{let n=p.index+(i?1:0),m=[-1,x.length].includes(p.index);m||e&&setTimeout(()=>{e(p.index)},300);let b=h("#Swiper-"+w);if(p.eventType=="adjustLoop")b.await(250).css({transition:"0s",transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass([a("Display"),a("LoopAdjusting")]).await(100).removeClass(a("LoopAdjusting"));else if(p.eventType=="sys")b.await(250).css({transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass(a("Display"));else if(b.children().removeClass(a("Display")).parent().children(n).addClass(a("Display")).parent().css({transition:"0.3s",transform:l.TrasformString(n)}).await(250).css({transition:"0s"}),m){let v=p.index==-1?x.length-1:0;y({eventType:"adjustLoop",index:v})}d&&!m&&(c.interval.clear("SwipeTimer-"+w),c.interval.standBy("SwipeTimer-"+w,d-(p.eventType=="sys"?310:0),()=>{let v=p.index+1;!i&&v>x.length-1&&(v=0),y({eventType:"usr",index:v})}))},[p]);let S=x.map((n,m)=>I(R,{flexSizing:"none",width:1,height:0,className:a("Child"),children:s(n)},m));i&&(S.push(S[0]),S.unshift(S[S.length-2]));let C={x:0,y:0,process:!1,effectStartAt:0,id:w,loop:i,index:p.index,minIndex:i?-1:0,maxIndex:x.length+(i?1:-1),width:0,set_event:y},A=p.index+(i?1:0);return I(R,T(f({overflow:"hidden",position:"relative"},E),{className:[E.className,a("SwipeView")].join(" "),freeCSS:f({zIndex:1},E.freeCSS),"data-swipe-id":w,onMouseDown:n=>{r||n.buttons==1&&l.EffectStart(n,C)},onTouchStart:n=>{var m;o||((m=n.touches)==null?void 0:m.length)==1&&l.EffectStart(n,C)},children:I(j,{flexWrap:!1,gap:1,transition:"long",className:[a("Rail"),a("ShowOther_"+u)].join(" "),id:"Swiper-"+w,freeCSS:f({},g.current?{}:{transform:l.TrasformString(A)}),children:S})}))},l={TrasformString:t=>`translateX( calc( ${-100*t}% - ${12*t}px ) )`,EffectStart:(t,e)=>{let{x:u,y:d}=c.getCursor(t),i=t.currentTarget,r=t.target;if(["SELECT","BUTTON","LABEL","INPUT"].includes(r.tagName))return;e=T(f({},e),{x:u-e.x+window.scrollX,y:d-e.y+window.scrollY,effectStartAt:new Date().getTime(),width:h("#Swiper-"+e.id).position().width});let{swipeId:o}=i.dataset;o==e.id&&c(document).addEvent({eventID:"SwipeMouseMove",eventType:"mousemove",callback:s=>{l.EffectCheck(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeTouchMove",eventType:"touchmove",callback:s=>{l.EffectCheck(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeMouseUp",eventType:"mouseup",callback:s=>{l.EffectEnd(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeTouchEnd",eventType:"touchend",callback:s=>{l.EffectEnd(s,e)},options:{passive:!1}})},EffectCheck:(t,e)=>{if(e.process)return;let{x:u,y:d}=c.getCursor(t),i=Math.abs(u-e.x+window.scrollX),r=Math.abs(d-e.y+window.scrollY);if(!(t.touches&&t.touches.length>1)&&!(r+i<15))if(r>i/2)c(document).removeEvent(["SwipeMouseMove","SwipeTouchMove"]);else{e.process=!0;let o=e.index+(e.loop?1:0);h("#Swiper-"+e.id).children(o-1).addClass(a("Display")),c(document).addEvent({eventID:"SwipeCheckMouseMove",eventType:"mousemove",callback:s=>{l.EffectMove(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeCheckTouchMove",eventType:"touchmove",callback:s=>{l.EffectMove(s,e)},options:{passive:!1}}),t.preventDefault();return}},EffectMove:(t,e)=>{if(t.touches&&t.touches.length>1)return;let{x:u}=c.getCursor(t),d=u-e.x+window.scrollX,r=e.index+(e.loop?1:0)-d/e.width;if(r<0)r/=2;else if(r>e.maxIndex){let o=r-e.maxIndex;r=e.maxIndex+o/2}h("#Swiper-"+e.id).css({transition:"0s",transform:l.TrasformString(r)}),t.preventDefault()},EffectEnd:(t,e)=>{if(e.process){let d=c.getCursor(t).x-e.x+window.scrollX,i=new Date().getTime(),r=i-e.effectStartAt,o=e.index+(e.loop?1:0),s=0;r<400?s=o-(+(d>0)*2-1):s=Math.round(o-d/e.width),s=Math.max(Math.min(s,e.maxIndex),e.minIndex),e.process=!1,o===s?(e.effectStartAt=i,h("#Swiper-"+e.id).css({transition:".2s",transform:l.TrasformString(s)}).await(310).css({transition:"0s"}).children().removeClass(a("Display")).parent().children(o).addClass(a("Display"))):e.set_event({eventType:"usr",index:s+e.minIndex})}c(document).removeEvent(["SwipeMouseMove","SwipeTouchMove","SwipeCheckMouseMove","SwipeCheckTouchMove","SwipeMouseUp","SwipeTouchEnd"])}},V=t=>I(B,T(f({},t),{slideIndex:Math.max(Math.min(t.slideIndex,t.slides.length-1),0)}));export{V as SwipeView,V as default};
|
package/dist/fn/Loader/corner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import{jsx as a,jsxs as t}from"react/jsx-runtime";import{Config as n,useStore as l}from"../../@utils";import{useState as d,useEffect as c}from"react";import o from"../../atoms/Box";import s from"../../atoms/Flex";import{LoaderClasses as e}from"../../@styles/componentClasses";const N=()=>{let[i,r]=d(!1);return c(()=>{l.set({
|
|
1
|
+
import"../../chunk-VY3566IV.js";import{jsx as a,jsxs as t}from"react/jsx-runtime";import{Config as n,useStore as l}from"../../@utils";import{useState as d,useEffect as c}from"react";import o from"../../atoms/Box";import s from"../../atoms/Flex";import{LoaderClasses as e}from"../../@styles/componentClasses";const N=()=>{let[i,r]=d(!1);return c(()=>{l.set({["Loader-corner-"+n.get().sessionUID+"-corner"]:{active:()=>{r(!0)},stop:()=>{r(!1)}}})},[]),t(s,{className:[e("CornerLoader"),e("Active_"+i)].join(" "),gap:"1/2",padding:["1/2","3/4"],borderRadius:"2/3",backgroundColor:"dark",position:"fixed",boxShadow:"1.remark",left:"50%",top:1,opacity:"trans",transition:"short",isRounded:!0,freeCSS:{pointerEvents:"none",transform:"translateX(-50%)"},children:[t(s,{className:e("Wrap"),flexWrap:!1,verticalAlign:"center",horizontalAlign:"center",children:[a(o,{className:e("Ld4")}),a(o,{className:e("Ld3")}),a(o,{className:e("Ld2")}),a(o,{className:e("Ld1")}),a(o,{className:e("Ld2")}),a(o,{className:e("Ld3")}),a(o,{className:e("Ld4")})]}),a(o,{fontColor:"white",fontSize:"0.xs",isSemiBoldFont:!0,children:"Loading"})]})};export{N as Corner};
|
|
@@ -19,7 +19,7 @@ declare namespace Loader {
|
|
|
19
19
|
};
|
|
20
20
|
type Sizes = 'S' | 'R' | 'L' | 'XL' | 'MAX';
|
|
21
21
|
type Colors = 'theme' | 'posi' | 'nega' | 'warn' | 'white' | 'cloud';
|
|
22
|
-
type CompInput = TagProperty.
|
|
22
|
+
type CompInput = TagProperty.States & {
|
|
23
23
|
showInitial?: boolean;
|
|
24
24
|
loaderID?: string;
|
|
25
25
|
};
|
package/dist/fn/Loader/mini.d.ts
CHANGED
package/dist/fn/Loader/mini.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d,c as f,d as h}from"../../chunk-VY3566IV.js";import{jsx as i,jsxs as
|
|
1
|
+
import{b as d,c as f,d as h}from"../../chunk-VY3566IV.js";import{jsx as i,jsxs as x}from"react/jsx-runtime";import y from"@mingoo/jsmin";import{$$fromRoot as L,useStore as z}from"../../@utils";import{useState as l,useEffect as g}from"react";import{LoaderClasses as e}from"../../@styles/componentClasses";import I from"../../mols/Row";const R=w=>{let v=w,{color:u="theme",size:t="R",showInitial:c=!1,loaderID:C=""}=v,S=h(v,["color","size","showInitial","loaderID"]),[m]=l(C),[s]=l(y.uuid.gen()),[n,a]=l(c),o=0;t=="S"?o=1:t=="R"?o=1.5:t=="L"?o=3:t=="XL"?o=4:t=="MAX"&&(o=6);let p={theme:"hsl( var( --color-theme-hsl ) )",posi:"var( --color-positive )",nega:"var( --color-negative )",warn:"var( --color-warning )",cloud:"hsl( var( --color-layer5-hsl ) )",white:"white"}[u];return g(()=>{let r=L('[data-component-id="'+s+'"]');n?r.removeClass(e("Hide")).await(10).addClass(e("Active")):r.removeClass(e("Active")).await(210).addClass(e("Hide"))},[n]),g(()=>{z.set({[s]:{active:r=>{m==r&&a(!0)},stop:r=>{m==r&&a(!1)},stopForce:()=>{a(!1)}}})},[]),x(I.Center,f(d({ssSphere:o,className:[e("MiniLoader"),c?"":e("Hide")].join(" "),componentID:s,position:"relative"},S),{children:[i("svg",{className:e("SVG1"),width:"100",height:"100",viewBox:"0 0 100 100",style:{stroke:p},children:i("circle",{cx:"50",cy:"50",r:"40"})}),i("svg",{className:e("SVG2"),width:"100",height:"100",viewBox:"0 0 100 100",style:{stroke:p},children:i("circle",{cx:"50",cy:"50",r:"40"})})]}))};export{R as Mini};
|
package/dist/fn/Loader/top.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{Config as t,useStore as n}from"../../@utils";import{useState as c,useEffect as C}from"react";import{LoaderClasses as e}from"../../@styles/componentClasses";import l from"../../atoms/Box";import a from"../../atoms/Flex";const m=()=>{let[s,i]=c(!1);return C(()=>{n.set({
|
|
1
|
+
import"../../chunk-VY3566IV.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{Config as t,useStore as n}from"../../@utils";import{useState as c,useEffect as C}from"react";import{LoaderClasses as e}from"../../@styles/componentClasses";import l from"../../atoms/Box";import a from"../../atoms/Flex";const m=()=>{let[s,i]=c(!1);return C(()=>{n.set({["Loader-top-"+t.get().sessionUID+"-corner"]:{active:()=>{i(!0)},stop:()=>{i(!1)}}})},[]),o(a,{className:[e("TopLoader"),e("Active_"+s)].join(" "),position:"fixed",top:0,left:0,right:0,bottom:0,horizontalAlign:"center",transition:"long",opacity:"trans",backgroundColor:"layer.4.opa.high",freeCSS:{paddingTop:12*8,pointerEvents:"none"},children:r(a,{flexType:"col",position:"relative",children:[o(a,{className:e("Center"),flexCenter:!0,children:r(l,{children:[o(l,{className:[e("Child"),e("Child1")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme.darken"})}),o(l,{className:[e("Child"),e("Child2")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme.darker"})}),o(l,{className:[e("Child"),e("Child3")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme.darkest"})}),o(l,{className:[e("Child"),e("Child4")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme.lighten"})}),o(l,{className:[e("Child"),e("Child5")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme.lighter"})}),o(l,{className:[e("Child"),e("Child6")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme.lightest"})}),o(l,{className:[e("Child"),e("Child7")].join(" "),children:o(l,{className:e("Circle"),backgroundColor:"theme"})})]})}),o(l,{flexCenter:!0,fontSize:"2.normal",children:"Loading..."})]})})};export{m as Top};
|
package/dist/fn/Sheet.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ import Box from '../atoms/Box';
|
|
|
5
5
|
declare namespace Sheet {
|
|
6
6
|
type Methods = {
|
|
7
7
|
Wrapper(): JSX.Element;
|
|
8
|
-
open(
|
|
9
|
-
refresh(
|
|
10
|
-
resize(
|
|
8
|
+
open(p: Input): void;
|
|
9
|
+
refresh(p: Input, open: boolean): void;
|
|
10
|
+
resize(p: {
|
|
11
11
|
sheetID: string;
|
|
12
12
|
size: Size;
|
|
13
13
|
}): void;
|
|
@@ -20,7 +20,7 @@ declare namespace Sheet {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
type Input = Normal | Edge | Custom | Image | Bottom.Input;
|
|
23
|
-
type
|
|
23
|
+
type States = {
|
|
24
24
|
sheetID?: string;
|
|
25
25
|
sheetGroups?: string | string[];
|
|
26
26
|
backgroundEffect?: boolean;
|
|
@@ -42,30 +42,30 @@ declare namespace Sheet {
|
|
|
42
42
|
parentBlur?: boolean;
|
|
43
43
|
};
|
|
44
44
|
type Sheet = 'normal.topLeft' | 'normal.topCenter' | 'normal.topRight' | 'normal.middleLeft' | 'normal.middleCenter' | 'normal.middleRight' | 'normal.bottomLeft' | 'normal.bottomCenter' | 'normal.bottomRight' | 'drawer.left' | 'drawer.right' | 'drawer.bottom' | 'custom' | 'image';
|
|
45
|
-
type Normal =
|
|
45
|
+
type Normal = States & {
|
|
46
46
|
type: Sheet;
|
|
47
47
|
size?: Size;
|
|
48
48
|
};
|
|
49
|
-
type Edge =
|
|
49
|
+
type Edge = States & {
|
|
50
50
|
type: Sheet;
|
|
51
51
|
size?: Size;
|
|
52
52
|
};
|
|
53
|
-
type Custom =
|
|
53
|
+
type Custom = States & {
|
|
54
54
|
type: 'custom';
|
|
55
55
|
parent: $$.Args;
|
|
56
56
|
gravityPoint?: number;
|
|
57
57
|
};
|
|
58
|
-
type Image = Omit<
|
|
58
|
+
type Image = Omit<States, 'content'> & {
|
|
59
59
|
type: 'image';
|
|
60
60
|
src: string | string[];
|
|
61
61
|
};
|
|
62
62
|
namespace Bottom {
|
|
63
63
|
type Sizes = 'S' | 'R' | 'L';
|
|
64
|
-
type Input =
|
|
64
|
+
type Input = States & {
|
|
65
65
|
type: 'drawer.bottom';
|
|
66
66
|
size: Sizes;
|
|
67
67
|
sizeChanged?(size: Sizes): void;
|
|
68
|
-
baseStyles?: TagProperty.
|
|
68
|
+
baseStyles?: TagProperty.States;
|
|
69
69
|
close_option?: CloseOptions & {
|
|
70
70
|
swipeDown?: boolean;
|
|
71
71
|
};
|