amotify 0.3.11 → 0.3.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c,c as g}from"../../../chunk-C5N2D3ZX.js";import{Fragment as $,jsx as e,jsxs as f}from"react/jsx-runtime";import S,{UUID as O,Time as d,useStore as W}from"jmini";import{useState as D,useEffect as F}from"react";import{Box as M,Grid as J,FAI as B,Column as L,FlexMargin as P}from"../../../atoms";import{Row as C,Literal as y}from"../../../mols";import{Button as x}from"../../Button";import _ from"../../Sheet";import Y from"../Select";import{LeftIcon as X,RightIcon as N}from"..";import{InputTimeClasses as V}from"../../../@styles/componentClasses";import R from"../Drum";const j=t=>{let{restrict:l}=t;return l=="year"?e(p.Year,c({},t)):l=="month"?e(p.Month,c({},t)):l=="week"?"[DEV]":l=="date"?e(p.Date,c({},t)):l=="locale.jp.warekiDate"?e(p.Locale.JP.WarekiDate,c({},t)):l=="clock"?e(p.Clock,c({},t)):l=="period.clock"?e(p.Period.Clock,c({},t)):l=="period.month"?e(p.Period.Month,c({},t)):l=="period.date"?e(p.Period.Date,c({},t)):null},p={YearOptions:t=>{var m,i,n;let l=[],h=(m=t==null?void 0:t.min)!=null?m:1900,r=(i=t==null?void 0:t.max)!=null?i:d().addYear(10).year;for(let a=h;a<=r;a++){let o=[a],[u,s]=S.transformer.wareki(a).value;((n=t.showJPWareki)==null||n)&&(u&&o.push(e(y.Micro,{fontColor:"4.thin",children:u},1)),s&&o.push(f(y.Micro,{fontColor:"4.thin",children:["[",s,"]"]},2))),l[t.reverse?"unshift":"push"]({value:a,label:e(C.Center,{gap:["1/12","1/4"],verticalAlign:"baseline",flexWrap:!0,children:o})})}return l},calendartypeState:()=>{let[t,l]=D(localStorage.getItem("@env/input/time/selector/calendartype")||"calendar");return F(()=>{localStorage.setItem("@env/input/time/selector/calendartype",String(t))},[t]),[t,l]},minutesUnitState:()=>{let[t,l]=D(Number(localStorage.getItem("@env/input/time/selector/clock/minutesUnit")||10));return F(()=>{localStorage.setItem("@env/input/time/selector/clock/minutesUnit",String(t))},[t]),[t,l]},remoteControl:function(t){let{restrict:l,pickerId:h,val_value:r,set_value:m}=t;F(()=>{h&&W.set({[h]:{onClear:()=>{if(l.match(/period\./)){m(i=>g(c({},i),{eventType:"commit",forcus:0,display:d(),from:d(null),to:d(null)}));return}m(i=>g(c({},i),{eventType:"commit",from:d(null)}))},onConfirm:()=>{m(i=>g(c({},i),{eventType:"commit"}))}}})},[])},Year:t=>{let{min:l,max:h}=t,[r,m]=D(S.scope(()=>{let[i]=String(t.defaultValue).split(/\D/);return{eventType:"init",from:d().setYear(Number(i||d().year))}}));return p.remoteControl(g(c({},t),{val_value:r,set_value:m})),F(()=>{t.onValueUpdate({value:String(r.from.year||null),era:"year",eventType:r.eventType})},[r]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{flexWrap:!0,children:[f(y.Paragraph,{children:[r.from.year||"----","\u5E74"]}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();m({eventType:"update",from:i})},children:"\u4ECA\u5E74"}),e(P,{})]}),e(M,{borderTop:!0}),e(R,{override:"force",value:r.from.year||null,options:p.YearOptions({min:Number(l)||void 0,max:Number(h)||void 0}),onUpdateValidValue:i=>{m(n=>({eventType:"update",from:n.from.clone().setYear(Number(i))}))}})]})},Month:t=>{let{min:l,max:h}=t,[r,m]=D(S.scope(()=>{let[i,n]=String(t.defaultValue).split(/\D/);(S.isNullish(i)||S.isNullish(n))&&([i,n]=d().toFormat("%Y-%M").split("-"));let a=d(),o=d().setYear(Number(i)||a.year).setMonth(Number(n)||a.month).setDate(1);return{eventType:"init",from:o,display:o}}));return p.remoteControl(g(c({},t),{val_value:r,set_value:m})),F(()=>{t.onValueUpdate({value:r.from.toFormatYM(),era:"year",eventType:r.eventType})},[r]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",children:[e(y.Paragraph,{children:r.from.toFormatYM("JP")||"----/--"}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();m({eventType:"update",from:i,display:i})},children:"\u4ECA\u6708"}),e(P,{})]}),e(M,{borderTop:!0}),e(p.Parts.DrumSelector,{type:"month",min:l,max:h,value:r.from,onChange:i=>{m(g(c({},r),{eventType:"update",from:i}))}})]})},Date:t=>{let{min:l,max:h}=t,[r,m]=p.calendartypeState(),[i,n]=D(S.scope(()=>{var T;let[a,o,u]=(T=String(t.defaultValue))==null?void 0:T.split(/\D/);(S.isNullish(a)||S.isNullish(o)||S.isNullish(u))&&([a,o,u]=d().toFormat("%Y-%M-%D").split("-"));let s=d(),v=d([Number(a)||s.year,(Number(o)||s.month).zeroEmbed(2),(Number(u)||s.date).zeroEmbed(2)].join("/"));return{eventType:"init",era:"year",display:v,from:v}}));return p.remoteControl(g(c({},t),{val_value:i,set_value:n})),F(()=>{t.onValueUpdate({value:i.from.toFormatYMD(),era:"year",eventType:i.eventType})},[i]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{flexWrap:!0,gap:"1/2",children:[e(y.Paragraph,{children:i.from.toFormatYMD("JP")||"----/--/--"}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let a=d();n({eventType:"update",era:"year",from:a,display:a})},children:"\u4ECA\u65E5"}),e(P,{}),f(x.Border.S,{padding:["1/6","1/2"],fontColor:"3.blur",fontSize:"0.xs",onClick:()=>{m(a=>a=="calendar"?"drum":"calendar")},children:[r=="calendar"&&"\u30C9\u30E9\u30E0",r=="drum"&&"\u30AB\u30EC\u30F3\u30C0\u30FC","\u8868\u793A"]})]}),e(M,{borderTop:!0}),r=="calendar"&&f($,{children:[f(C.Center,{gap:"1/2",children:[e(Y,{override:"force",emptySelect:!1,value:i.display.year,options:p.YearOptions({reverse:!0}),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,pickerStyles:{xcss:{minWidth:12*12}},onUpdateValidValue:a=>{n(o=>g(c({},o),{eventType:"update",display:o.display.clone().setYear(Number(a))}))},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})})}),e(Y,{override:"force",emptySelect:!1,value:i.display.month,options:(()=>{let a=[];for(let o=1;o<=12;o++)a.push({value:o,label:String(o)+"\u6708"});return a})(),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,pickerStyles:{xcss:{minWidth:12*8}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),onUpdateValidValue:a=>{n(o=>g(c({},o),{eventType:"update",display:o.display.clone().setMonth(Number(a))}))}}),e(p.Parts.ShiftButtons,{callback:a=>{n(o=>g(c({},o),{eventType:"update",display:o.display.clone().addMonth(a)}))}})]}),f(L,{children:[e(M,{margin:"auto",xcss:{minWidth:"50%"},UnderBreakPointStyles:{margin:0},children:p.Parts.Calendar({min:l,max:h,onTitleRender:a=>"",targetMonth:i.display,from:i.from,onChange:a=>{n(o=>g(c({},o),{eventType:"update",from:a}))}})}),e(M,{unitHeight:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1,ssHiddenOnBreak:!0}),f(C.Center,{verticalAlign:"unset",ssHiddenOnBreak:!0,children:[e(M,{flexSizing:0,children:p.Parts.Calendar({min:l,max:h,onTitleRender:a=>e(y.Mini,{children:f(C.Center,{gap:"1/2",children:[e(y,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(y,{fontColor:"4.thin",children:"[\u524D\u6708]"})]})}),targetMonth:i.display.clone().addMonth(-1),from:i.from,onChange:a=>{n(o=>g(c({},o),{eventType:"update",from:a}))}})}),e(M,{unitWidth:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1}),e(M,{flexSizing:0,children:p.Parts.Calendar({min:l,max:h,onTitleRender:a=>e(y.Mini,{children:f(C.Center,{gap:"1/2",children:[e(y,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(y,{fontColor:"4.thin",children:"[\u7FCC\u6708]"})]})}),targetMonth:i.display.clone().addMonth(1),from:i.from,onChange:a=>{n(o=>g(c({},o),{eventType:"update",from:a}))}})})]})]})]}),r=="drum"&&e(p.Parts.DrumSelector,{type:"date",min:l,max:h,value:i.from,onChange:a=>{n(g(c({},i),{eventType:"update",from:a}))}})]})},Locale:{JP:{WarekiDate:t=>{var n;let{min:l,max:h}=t,[r,m]=D(S.scope(()=>{var b;let[a,o,u]=(b=String(t.defaultValue))==null?void 0:b.split(/\D/),s=t.era||"year";if(S.isNullish(a)||S.isNullish(o)||S.isNullish(u)){let k=d();s=="heisei"?k.setYear(1989):s=="shouwa"?k.setYear(1926):s=="taisho"?k.setYear(1912):s=="meiji"&&k.setYear(1868),[a,o,u]=k.toFormat("%Y-%M-%D").split("-")}let v=d();return{eventType:"init",from:d([Number(a)||v.year,(Number(o)||v.month).zeroEmbed(2),(Number(u)||v.date).zeroEmbed(2)].join("/"))}}));p.remoteControl(g(c({},t),{val_value:r,set_value:m})),F(()=>{t.onValueUpdate({value:r.from.toFormatYMD(),era:r.from.wareki.toLower(),eventType:r.eventType})},[r]);let i={year:{label:"\u897F\u66A6",min:"1900/01/01",max:"2100/12/31"},reiwa:{label:"\u4EE4\u548C",min:"2019/05/01",max:d().addYear(10).setMonth(12).setDate(31).toFormatYMD()},heisei:{label:"\u5E73\u6210",min:"1989/01/08",max:"2019/04/30"},showa:{label:"\u662D\u548C",min:"1926/12/25",max:"1989/01/07"},taisho:{label:"\u5927\u6B63",min:"1912/07/30",max:"1926/12/24"},meiji:{label:"\u660E\u6CBB",min:"1868/09/08",max:"1912/07/29"}};return f(L,{children:[f(C.Left,{gap:"1/4",flexWrap:!0,children:[f(y.Paragraph,{children:[r.from.warekiLabel,(n=r.from.warekiYear)==null?void 0:n.zeroEmbed(2),"\u5E74",r.from.toFormatMD("JP")]}),e(P,{})]}),e(M,{borderTop:!0}),e(C.Left,{gap:"1/2",flexWrap:!0,children:["reiwa","heisei","showa","taisho","meiji"].map((a,o)=>{let u=i[a];return u?e(x.Border.S,{onClick:()=>{let s=r.from;if(a=="reiwa"||a=="year")s=d();else{let v=d(u.min),T=d(u.max);v.value>r.from.value&&(s=v),r.from.value>T.value&&(s=T)}if(l){let v=d(l);s.value<v.value&&(s=v)}if(h){let v=d(h);v.value<s.value&&(s=v)}m(g(c({},r),{eventType:"update",from:s}))},children:u.label},o):null})}),e(p.Parts.DrumSelector,{type:"locale.jp.warekiDate",min:t.min,max:t.max,value:r.from,onChange:a=>{m(g(c({},r),{eventType:"update",from:a}))}})]})}}},Clock:t=>{let[l,h]=D(S.scope(()=>{let o=String(t.defaultValue).split(/[^\d]/);if(!o[0]){let v=d();o=[v.hours,v.minutes]}let u=Number(o[0]),s=Number(o[1]);return{eventType:"init",from:d().setHours(u).setMinutes(s)}}));p.remoteControl(g(c({},t),{val_value:l,set_value:h})),F(()=>{t.onValueUpdate({value:l.from.toFormatHM(),era:"clock",eventType:l.eventType})},[l]);let[r,m]=p.minutesUnitState(),i=d().setFromFormatHHMM(t.min||"00:00"),n=d().setFromFormatHHMM(t.max||"23:59");const a=(o,u)=>{h(s=>{let v=s.from.clone();return S.isExist(o)&&v.setHours(o),S.isExist(u)&&v.setMinutes(u),v.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(v=n.clone()),v.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(v=i.clone()),g(c({},s),{eventType:"update",from:v})})};return f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",flexWrap:!0,children:[f(C.Center,{gap:"1/2",children:[e(M,{className:V("ClockBase"),children:e(M,{className:V("ClockUiBase"),flexCenter:!0,children:f(M,{className:V("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[e(M,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[V("Needle"),V("hour")].join(" "),xcss:{transform:`rotate(${l.from.hours*30+l.from.minutes/2}deg)`}}),e(M,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[V("Needle"),V("minute")].join(" "),xcss:{transform:`rotate(${l.from.minutes*6}deg)`}})]})})}),f(M,{textAlign:"center",fontHeight:1.2,children:[f(y.Paragraph,{children:[l.from.hours.zeroEmbed(2)," : ",l.from.minutes.zeroEmbed(2)]}),f(y.Mini,{fontColor:"4.thin",children:[l.from.hours>=12&&"PM"||"AM",l.from.hours%12,":",l.from.minutes.zeroEmbed(2)]})]})]}),e(x.Border.XS,{borderRadius:"2.tone.secondary",fontColor:"theme",onClick:()=>{let o=d().setSeconds(0);o.minutes=Math.round(o.minutes/r)*r,a(o.hours,o.minutes)},children:"\u73FE\u6642\u523B"}),e(P,{}),e(Y,{emptySelect:!1,value:r,paddingLeft:3.5,leftIcon:e(X,{left:"2/3",children:"\u5358\u4F4D"}),pickerPosition:4,pickerStyles:{xcss:{minWidth:12*8}},padding:"1/2",options:[{value:10,label:"10\u5206"},{value:5,label:"5\u5206"},{value:1,label:"1\u5206"}],tabIndex:-1,onUpdateValidValue:o=>{m(o||1)}})]}),e(M,{borderTop:!0}),f(C.Center,{gap:"1/2",children:[e(R,{xcss:{maxHeight:12*12},override:"force",options:[{value:0,label:"\u5348\u524D"},{value:12,label:"\u5348\u5F8C"}],value:l.from.hours>=12?12:0,onUpdateValidValue:o=>{let u=l.from.hours%12+o;a(u)}}),e(R,{override:"force",value:l.from.hours,options:Array.from({length:24}).map((o,u)=>{let s=u;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)}}),onUpdateValidValue:o=>{a(o)}}),e(y,{isSemiBoldFont:!0,children:"\u6642"}),e(R,{override:"force",value:l.from.minutes,options:Array.from({length:60}).map((o,u)=>{let s=u;return s!=59&&(r==5&&s%5!=0||r==10&&s%10!=0)?null:{value:s,label:s.zeroEmbed(2)}}),onUpdateValidValue:o=>{a(void 0,o)}},r),e(y,{isSemiBoldFont:!0,children:"\u5206"})]})]})},Period:{Clock:t=>{let[l,h]=p.minutesUnitState(),[r,m]=D(S.scope(()=>{let[o,u]=S.Arrayify(t.defaultValue),s=d().setFromFormatHHMM(o||"09:00"),v=d().setFromFormatHHMM(u||"18:00");return{eventType:"init",forcus:0,display:s,from:s,to:v}}));p.remoteControl(g(c({},t),{val_value:r,set_value:m})),F(()=>{if(!r.to.value)return;if(r.from.value>r.to.value){m(u=>g(c({},u),{eventType:"update",from:u.to,to:u.from}));return}t.onValueUpdate({value:[r.from.toFormatHM(),r.to.toFormatHM()],era:"clock",eventType:r.eventType})},[r]);let i=d().setFromFormatHHMM(t.min||"00:00"),n=d().setFromFormatHHMM(t.max||"23:59");const a=(o,u,s)=>{m(v=>{let T=v[o].clone();return S.isExist(u)&&T.setHours(u),S.isExist(s)&&T.setMinutes(s),T.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(T=n.clone()),T.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(T=i.clone()),g(c({},v),{eventType:"update",[o]:T})})};return f(L,{width:1,xcss:{minWidth:12*24},children:[f(C.Left,{flexWrap:!0,children:[f(C.Left,{gap:"1/2",children:[e(y.Paragraph,{children:r.from.toFormatHM()||"--:--"}),e(y.Mini,{children:"-"}),e(y.Paragraph,{children:r.to.toFormatHM()||"--:--"})]}),e(P,{}),e(Y,{emptySelect:!1,value:l,paddingLeft:3.5,leftIcon:e(X,{left:"2/3",children:"\u5358\u4F4D"}),pickerPosition:4,pickerStyles:{xcss:{minWidth:12*8}},padding:"1/2",options:[{value:10,label:"10\u5206"},{value:5,label:"5\u5206"},{value:1,label:"1\u5206"}],tabIndex:-1,onUpdateValidValue:o=>{h(o||1)}})]}),e(M,{borderBottom:"1.thin"}),e(p.Period.Preset,g(c({},t),{onPreset:(o,u)=>{m({eventType:"update",forcus:0,display:d(o),from:d(o),to:d(u)})}})),f(C.Center,{gap:"1/2",children:[e(R,{override:"force",value:r.from.hours,options:Array.from({length:24}).map((o,u)=>{let s=u;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:o=>{a("from",o)}}),e(R,{override:"force",value:r.from.minutes,options:Array.from({length:60}).map((o,u)=>{let s=u;return s!=59&&(l==5&&s%5!=0||l==10&&s%10!=0)?null:{value:s,label:s.zeroEmbed(2)+"\u5206"}}),onUpdateValidValue:o=>{a("from",void 0,o)}},l+"-from"),e(y,{isSemiBoldFont:!0,children:"~"}),e(R,{override:"force",value:r.to.hours,options:Array.from({length:24}).map((o,u)=>{let s=u;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:o=>{a("to",o)}}),e(R,{override:"force",value:r.to.minutes,options:Array.from({length:60}).map((o,u)=>{let s=u;return s!=59&&(l==5&&s%5!=0||l==10&&s%10!=0)?null:{value:s,label:s.zeroEmbed(2)+"\u5206"}}),onUpdateValidValue:o=>{a("to",void 0,o)}},l+"-to")]})]})},Date:t=>{let{min:l,max:h}=t,[r,m]=D(S.scope(()=>{let[i,n]=S.Arrayify(t.defaultValue),a=d(i||void 0).setFirstOfDay(),o=d(n||null).setFirstOfDay();return{eventType:"init",forcus:0,display:a,from:a,to:o}}));return p.remoteControl(g(c({},t),{val_value:r,set_value:m})),F(()=>{if(!r.to.value)return;if(r.from.value>r.to.value){m(n=>g(c({},n),{eventType:"update",from:n.to,to:n.from}));return}t.onValueUpdate({value:[r.from.toFormatYMD(),r.to.toFormatYMD()],era:"year",eventType:r.eventType})},[r]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",flexWrap:!0,children:[e(y.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:0}))},children:[r.from.toFormatYMD()||"----/--/--",r.forcus==0&&e(p.Parts.PeriodFocusSign,{})]}),e(y.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:1}))},children:[r.to.toFormatYMD()||"----/--/--",r.forcus==1&&e(p.Parts.PeriodFocusSign,{})]}),e(P,{}),f(C.Right,{gap:"1/2",marginLeft:"auto",children:[e(Y,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,fontSize:"1.mini",pickerStyles:{xcss:{minWidth:12*12}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),options:p.YearOptions({reverse:!0}),value:r.display.year,onUpdateValidValue:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().setYear(Number(i))}))}}),e(Y,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,fontSize:"1.mini",pickerStyles:{xcss:{minWidth:12*9}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:r.display.month,onUpdateValidValue:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().setMonth(Number(i)).setDate(1)}))}}),e(p.Parts.ShiftButtons,{callback:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().addMonth(i)}))}})]})]}),e(M,{borderBottom:"1.thin"}),e(p.Period.Preset,g(c({},t),{onPreset:(i,n)=>{m({eventType:"update",forcus:0,display:d(i),from:d(i),to:d(n)})}})),e(C.Left,{verticalAlign:"top",flexWrap:!0,gap:2,children:Array.from({length:4}).map((i,n)=>{let a=p.Parts.Calendar({min:l,max:h,targetMonth:r.display.clone().addMonth(n-1),from:r.from,to:r.to,onTitleRender:o=>{let u=o.diff(r.display).months;return e(y.Mini,{ssHiddenOnBreak:!0,children:f(C.Center,{gap:"1/2",children:[e(y,{isSemiBoldFont:!0,children:o.toFormatYM("JP")}),e(y,{fontColor:"4.thin",children:["[\u524D\u6708]","","[\u7FCC\u6708]","[\u7FCC\u3005\u6708]"][u+1]})]})})},onChange:o=>{if(r.forcus==0){m(u=>g(c({},u),{eventType:"update",forcus:1,from:o,to:d(null)}));return}m(u=>g(c({},u),{eventType:"update",to:o}))}});return e(M,{flexSizing:"auto",ssHiddenOnBreak:n!=1,children:a},n)})})]})},Month:t=>{let{min:l,max:h}=t,[r,m]=D(S.scope(()=>{let[i,n]=S.Arrayify(t.defaultValue),a=d(i||void 0).setDate(1).setFirstOfDay(),o=d(n||null).setDate(1).setFirstOfDay();return{eventType:"init",forcus:0,display:a,from:a,to:o}}));return p.remoteControl(g(c({},t),{val_value:r,set_value:m})),F(()=>{if(!r.to.value)return;if(r.from.value>r.to.value){m(n=>g(c({},n),{eventType:"update",from:n.to,to:n.from}));return}t.onValueUpdate({value:[r.from.toFormatYM(),r.to.toFormatYM()],era:"year",eventType:r.eventType})},[r]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",flexWrap:!0,children:[e(y.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:0}))},children:[r.from.toFormatYM("JP")||"----/--",r.forcus==0&&e(p.Parts.PeriodFocusSign,{})]}),e(y.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:1}))},children:[r.to.toFormatYM("JP")||"----/--",r.forcus==1&&e(p.Parts.PeriodFocusSign,{})]}),e(P,{}),f(C.Left,{flexWrap:!0,gap:"1/2",marginLeft:"auto",children:[e(Y,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,fontSize:"1.mini",pickerStyles:{xcss:{minWidth:12*12}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),options:p.YearOptions({reverse:!0}),value:r.display.year,onUpdateValidValue:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().setYear(Number(i))}))}}),e(p.Parts.ShiftButtons,{callback:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().addYear(i)}))}})]})]}),e(M,{borderBottom:"1.thin"}),e(p.Period.Preset,g(c({},t),{onPreset:(i,n)=>{m({eventType:"update",forcus:0,display:d(i),from:d(i),to:d(n)})}})),e(C.Left,{verticalAlign:"top",flexWrap:!0,gap:2,UnderBreakPointStyles:{gap:1},children:Array.from({length:4}).map((i,n)=>{let a=p.Parts.YearCalendar({min:l,max:h,targetYear:r.display.year+n-1,from:r.from.getFirstDayOfMonth(),to:r.to.getLastDayOfMonth(),onTitleRender:o=>{let u=o-r.display.year;return e(y.Mini,{children:f(C.Left,{gap:"1/2",children:[f(y,{isSemiBoldFont:!0,children:[o,"\u5E74"]}),e(y,{fontColor:"4.thin",children:["[\u524D\u5E74]","","[\u7FCC\u5E74]","[\u7FCC\u3005\u5E74]"][u+1]})]})})},onChange:o=>{if(r.forcus==0){m(u=>g(c({},u),{eventType:"update",forcus:1,from:o,to:d(null)}));return}m(u=>g(c({},u),{eventType:"update",to:o}))}});return e(M,{flexSizing:"auto",ssHiddenOnBreak:n<1||n>2,xcss:{minWidth:"35%"},children:a},n)})})]})},Preset:t=>t.periodPresets?e(C.Right,{gap:"1/2",flexWrap:!0,children:t.periodPresets.map((l,h)=>e(x.Border.S,{padding:["1/4",1],onClick:()=>{t.onPreset(l.from,l.to)},children:l.label},h))}):null},Parts:{ShiftButtons:t=>f(C.Center,{gap:"1/3",fontSize:"1.mini",children:[e(x.Sub,{className:V("LeftButton"),tabIndex:-1,right:0,position:"relative",ssSquare:2.5,onClick:()=>{t.callback(-1)},children:e(B.ChevronLeft,{})}),e(x.Sub,{className:V("RightButton"),tabIndex:-1,left:0,position:"relative",ssSquare:2.5,onClick:()=>{t.callback(1)},children:e(B.ChevronRight,{})})]}),Calendar:t=>{let{targetMonth:l,from:h,to:r,onTitleRender:m=k=>e(y.Mini,{isSemiBoldFont:!0,children:k.toFormatYM("JP")})}=t,i=d();if(!t.targetMonth.validate)return null;let n=l.clone().setDate(1),a=n.getLastDayOfMonth(),o=d(n).addMonth(-1).getLastDayOfMonth().date,u=[],s=[],v=[],T=[];for(var b=0;b<7;b++){let k=b==6,w=b==0;u.push(e(y.Micro,{textAlign:"center",fontColor:k?"googleBlue":w?"googleRed":"inherit",children:S.transformer.weekday.shortJP(b)},b))}for(var b=0;b<n.weekday;b++)s.unshift(e(y.Mini,{fontColor:"4.thin",flexCenter:!0,children:o-b},b));for(var b=1;b<=a.date;b++){let w=l.clone().setDate(b),E=h.isSameDate(w),z=!1,H=!1;r&&r.validate&&(z=w.isInRange(h,r),H=r.isSameDate(w));let G=i.isSameDate(w),U=!1;if(t.min){let I=d(t.min);I&&w.value<I.value&&(U=!0)}if(t.max){let I=d(t.max);I&&I.value<w.value&&(U=!0)}v.push(f(x.Clear.S,{isLocked:U,color:"cloud",border:"1.thin",isActive:E||H||z,isActiveStyles:E||H?{fontColor:"white",backgroundColor:"theme",borderColor:"theme",boxShadow:"0.remark"}:{backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"0.trans"},xcss:{whiteSpace:"nowrap",minWidth:12*3,minHeight:12*3},flexCenter:!0,ssEffectsOnActive:"shrink",tabIndex:-1,onClick:()=>{t.onChange(w)},children:[b,G&&e(p.Parts.CurrentSign,{})]},w.toFormatYMD()))}for(var b=1;b<7-a.weekday;b++)T.push(e(y.Mini,{flexCenter:!0,fontColor:"4.thin",children:b},b));return f(L,{gap:"1/2",children:[m(l)||"",f(J,{gridCols:7,gap:"1/6",children:[u,s,v,T]})]},l.toFormatYM())},YearCalendar:t=>{let{targetYear:l,from:h,to:r,onTitleRender:m=a=>f(y.Mini,{isSemiBoldFont:!0,children:[a,"\u5E74"]})}=t,i=d(),n=[];for(let a=1;a<=12;a++){let o=d().setYear(t.targetYear).setMonth(a).setDate(1),u=!1;if(t.min){let k=d(t.min).getLastDayOfMonth();k&&o.value<k.value&&(u=!0)}if(t.max){let k=d(t.max).getLastDayOfMonth();k&&k.value<o.value&&(u=!0)}let s=h.year==l&&h.month==o.month,v=!1,T=!1;r&&r.validate&&(v=o.isInRange(h,r),T=r.year==l&&r.month==o.month);let b=i.year==l&&i.month==o.month;n.push(f(x.Clear.S,{isLocked:u,color:"cloud",border:"1.thin",isActive:s||T||v,isActiveStyles:s||T?{fontColor:"white",backgroundColor:"theme",borderColor:"theme",boxShadow:"0.remark"}:{backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"0.trans"},fontSize:"inherit",ssEffectsOnActive:"shrink",tabIndex:-1,xcss:{whiteSpace:"nowrap",minWidth:12*3,minHeight:12*3},flexCenter:!0,onClick:()=>{t.onChange(o)},children:[f(C.Center,{gap:"1/2",children:[e(y,{children:o.month}),e(y.Mini,{opacity:"middle",children:["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.month]})]}),b&&e(p.Parts.CurrentSign,{})]},l+"-"+o.month))}return f(L,{gap:"1/2",children:[m(t.targetYear),e(J,{flexWrap:!0,gridCols:4,gap:"1/6",children:n})]},t.targetYear)},DrumSelector:t=>{let{type:l,min:h,max:r,value:m}=t;const i=(a,o,u)=>{let s=t.value.clone();if(S.isExist(a)&&(s=s.setYear(a)),S.isExist(o)&&(s=s.setMonth(o)),S.isExist(u)&&(s=s.setDate(u)),h){let v=d(h);s.value<v.value&&(s=v)}if(r){let v=d(r);v.value<s.value&&(s=v)}t.onChange(s)};let n=m.getLastDayOfMonth().date;return f(C.Center,{gap:"1/2",children:[e(R,{override:"force",options:p.YearOptions({}),value:m.year,onUpdateValidValue:a=>{i(Number(a))}}),e(y,{isSemiBoldFont:!0,children:"\u5E74"}),e(R,{override:"force",options:Array.from({length:12}).map((a,o)=>{let u=o+1;return{value:u,label:u}}),value:m.month,onUpdateValidValue:a=>{i(void 0,Number(a))}}),e(y,{isSemiBoldFont:!0,children:"\u6708"}),l!="month"&&f($,{children:[e(R,{override:"force",options:Array.from({length:31}).map((a,o)=>{let u=o+1;return u>n?null:{value:u,label:u}}),value:m.date,onUpdateValidValue:a=>{i(void 0,void 0,Number(a))}}),e(y,{isSemiBoldFont:!0,children:"\u65E5"})]})]})},MinMax:t=>{let{restrict:l,min:h,max:r}=t;if(!h&&!r)return null;let m=d(h||null),i=d(r||null),n="",a="";return l=="year"?(n=m.toFormat("%Y\u5E74"),a=i.toFormat("%Y\u5E74")):l.match(/month/)?(n=m.toFormatYM(),a=i.toFormatYM()):l.match(/date/)?(n=m.toFormatYMD(),a=i.toFormatYMD()):l.match(/clock/)&&(m=d().setFromFormatHHMM(h||""),i=d().setFromFormatHHMM(r||""),n=m.toFormatHM(),a=i.toFormatHM()),f(y.Micro,{fontHeight:1.2,children:[n&&f(y,{children:["\u6700\u5C0F: ",n]}),a&&f(y,{children:["\u6700\u5927: ",a]})]})},CurrentSign:()=>e(M,{position:"absolute",bottom:"1/6",left:"50%",width:1,unitHeight:"1/6",backgroundColor:"warn",xcss:{maxWidth:12*2.5,transform:"translateX(-50%)"},isRounded:!0}),PeriodFocusSign:()=>e(M,{position:"absolute",bottom:"1/4",left:"1/2",right:"1/2",backgroundColor:"theme",unitHeight:"1/4",boxShadow:"0.remark",isRounded:!0})}},A=j;A.picker={open:t=>{let l=null,h=null,r="L";t.restrict=="year"&&(r="S"),t.restrict=="month"&&(r="S"),t.restrict=="clock"?r="XS":(t.restrict=="locale.jp.warekiDate"||t.restrict=="period.clock")&&(r="S");let m=t.sheetID||O(),i=t.pickerId||O();_.open("middleCenter",{sheetID:m,size:r,padding:[2,0],closeAtAroundClick:!0,closeAtParentBlur:!1,onClose:()=>{t.onValueUpdate({value:l,era:h,eventType:"commit"})},content:f(L,{gap:"1/2",children:[f(C.Left,{children:[e(P,{}),e(x.Sub.S,{color:"cloud",ssSphere:3,onClick:()=>{_.close(m)},children:e(B.X,{})})]}),e(_.Body,{children:f(L,{borderRadius:"inherit",children:[e(L,{padding:1,children:e(j,{sheetID:m,pickerId:i,restrict:t.restrict,min:t.min,max:t.max,era:t.era,defaultValue:t.defaultValue,onValueUpdate:n=>{t.onValueUpdate(n),l=n.value,h=n.era,n.eventType=="commit"&&_.close(m)}})}),f(C.Left,{padding:1,position:"sticky",ssZIndex:10,bottom:0,gap:"1/2",borderTop:"1.thin",backgroundColor:"layer.0.opa.low",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit",xcss:{backdropFilter:"blur(3px)"},children:[e(x.Clear.S,{color:"cloud",tabIndex:-1,fontColor:"4.thin",borderRadius:"2.tone.secondary",flexSizing:"none",onClick:()=>{var n,a;(a=(n=W.get(i||""))==null?void 0:n.onClear)==null||a.call(n)},children:f(C.Center,{gap:"1/2",children:[e(B.X,{}),e(y.Micro,{children:"\u30EA\u30BB\u30C3\u30C8"})]})}),e(p.Parts.MinMax,{restrict:t.restrict,min:t.min,max:t.max}),e(P,{}),e(x.Prime.S,{tabIndex:-1,xcss:{minWidth:12*6},onClick:()=>{var n,a;(a=(n=W.get(i||""))==null?void 0:n.onConfirm)==null||a.call(n)},children:"\u78BA\u5B9A"})]})]})})]})})},close:t=>{_.close(t)}};export{A as TimeSelector,A as default};
|
|
1
|
+
import{b as c,c as g}from"../../../chunk-C5N2D3ZX.js";import{Fragment as $,jsx as e,jsxs as f}from"react/jsx-runtime";import S,{UUID as O,Time as d,useStore as W}from"jmini";import{useState as D,useEffect as F}from"react";import{Box as M,Grid as J,FAI as B,Column as L,FlexMargin as P}from"../../../atoms";import{Row as C,Literal as y}from"../../../mols";import{Button as x}from"../../Button";import _ from"../../Sheet";import Y from"../Select";import{LeftIcon as X,RightIcon as N}from"..";import{InputTimeClasses as V}from"../../../@styles/componentClasses";import R from"../Drum";const j=t=>{let{restrict:l}=t;return l=="year"?e(p.Year,c({},t)):l=="month"?e(p.Month,c({},t)):l=="week"?"[DEV]":l=="date"?e(p.Date,c({},t)):l=="locale.jp.warekiDate"?e(p.Locale.JP.WarekiDate,c({},t)):l=="clock"?e(p.Clock,c({},t)):l=="period.clock"?e(p.Period.Clock,c({},t)):l=="period.month"?e(p.Period.Month,c({},t)):l=="period.date"?e(p.Period.Date,c({},t)):null},p={YearOptions:t=>{var m,i,n;let l=[],h=(m=t==null?void 0:t.min)!=null?m:1900,o=(i=t==null?void 0:t.max)!=null?i:d().addYear(10).year;for(let a=h;a<=o;a++){let r=[a],[u,s]=S.transformer.wareki(a).value;((n=t.showJPWareki)==null||n)&&(u&&r.push(e(y.Micro,{fontColor:"4.thin",children:u},1)),s&&r.push(f(y.Micro,{fontColor:"4.thin",children:["[",s,"]"]},2))),l[t.reverse?"unshift":"push"]({value:a,label:e(C.Center,{gap:["1/12","1/4"],verticalAlign:"baseline",flexWrap:!0,children:r})})}return l},calendartypeState:()=>{let[t,l]=D(localStorage.getItem("@env/input/time/selector/calendartype")||"calendar");return F(()=>{localStorage.setItem("@env/input/time/selector/calendartype",String(t))},[t]),[t,l]},minutesUnitState:()=>{let[t,l]=D(Number(localStorage.getItem("@env/input/time/selector/clock/minutesUnit")||10));return F(()=>{localStorage.setItem("@env/input/time/selector/clock/minutesUnit",String(t))},[t]),[t,l]},remoteControl:function(t){let{restrict:l,pickerId:h,val_value:o,set_value:m}=t;F(()=>{h&&W.set({[h]:{onClear:()=>{if(l.match(/period\./)){m(i=>g(c({},i),{eventType:"commit",forcus:0,display:d(),from:d(null),to:d(null)}));return}m(i=>g(c({},i),{eventType:"commit",from:d(null)}))},onConfirm:()=>{m(i=>g(c({},i),{eventType:"commit"}))}}})},[])},Year:t=>{let{min:l,max:h}=t,[o,m]=D(S.scope(()=>{let[i]=String(t.defaultValue).split(/\D/);return{eventType:"init",from:d().setYear(Number(i||d().year))}}));return p.remoteControl(g(c({},t),{val_value:o,set_value:m})),F(()=>{t.onValueUpdate({value:String(o.from.year||null),era:"year",eventType:o.eventType})},[o]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{flexWrap:!0,children:[f(y.Paragraph,{children:[o.from.year||"----","\u5E74"]}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();m({eventType:"update",from:i})},children:"\u4ECA\u5E74"}),e(P,{})]}),e(M,{borderTop:!0}),e(R,{override:"force",value:o.from.year||null,options:p.YearOptions({min:Number(l)||void 0,max:Number(h)||void 0}),onUpdateValidValue:i=>{m(n=>({eventType:"update",from:n.from.clone().setYear(Number(i))}))}})]})},Month:t=>{let{min:l,max:h}=t,[o,m]=D(S.scope(()=>{let[i,n]=String(t.defaultValue).split(/\D/);(S.isNullish(i)||S.isNullish(n))&&([i,n]=d().toFormat("%Y-%M").split("-"));let a=d(),r=d().setYear(Number(i)||a.year).setMonth(Number(n)||a.month).setDate(1);return{eventType:"init",from:r,display:r}}));return p.remoteControl(g(c({},t),{val_value:o,set_value:m})),F(()=>{t.onValueUpdate({value:o.from.toFormatYM(),era:"year",eventType:o.eventType})},[o]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",children:[e(y.Paragraph,{children:o.from.toFormatYM("JP")||"----/--"}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();m({eventType:"update",from:i,display:i})},children:"\u4ECA\u6708"}),e(P,{})]}),e(M,{borderTop:!0}),e(p.Parts.DrumSelector,{type:"month",min:l,max:h,value:o.from,onChange:i=>{m(g(c({},o),{eventType:"update",from:i}))}})]})},Date:t=>{let{min:l,max:h}=t,[o,m]=p.calendartypeState(),[i,n]=D(S.scope(()=>{var T;let[a,r,u]=(T=String(t.defaultValue))==null?void 0:T.split(/\D/);(S.isNullish(a)||S.isNullish(r)||S.isNullish(u))&&([a,r,u]=d().toFormat("%Y-%M-%D").split("-"));let s=d(),v=d([Number(a)||s.year,(Number(r)||s.month).zeroEmbed(2),(Number(u)||s.date).zeroEmbed(2)].join("/"));return{eventType:"init",era:"year",display:v,from:v}}));return p.remoteControl(g(c({},t),{val_value:i,set_value:n})),F(()=>{t.onValueUpdate({value:i.from.toFormatYMD(),era:"year",eventType:i.eventType})},[i]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{flexWrap:!0,gap:"1/2",children:[e(y.Paragraph,{children:i.from.toFormatYMD("JP")||"----/--/--"}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let a=d();n({eventType:"update",era:"year",from:a,display:a})},children:"\u4ECA\u65E5"}),e(P,{}),f(x.Border.S,{padding:["1/6","1/2"],fontColor:"3.blur",fontSize:"0.xs",onClick:()=>{m(a=>a=="calendar"?"drum":"calendar")},children:[o=="calendar"&&"\u30C9\u30E9\u30E0",o=="drum"&&"\u30AB\u30EC\u30F3\u30C0\u30FC","\u8868\u793A"]})]}),e(M,{borderTop:!0}),o=="calendar"&&f($,{children:[f(C.Center,{gap:"1/2",children:[e(Y,{override:"force",emptySelect:!1,value:i.display.year,options:p.YearOptions({reverse:!0}),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,pickerStyles:{xcss:{minWidth:12*12}},onUpdateValidValue:a=>{n(r=>g(c({},r),{eventType:"update",display:r.display.clone().setYear(Number(a))}))},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})})}),e(Y,{override:"force",emptySelect:!1,value:i.display.month,options:(()=>{let a=[];for(let r=1;r<=12;r++)a.push({value:r,label:String(r)+"\u6708"});return a})(),fontSize:"1.mini",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,pickerStyles:{xcss:{minWidth:12*8}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),onUpdateValidValue:a=>{n(r=>g(c({},r),{eventType:"update",display:r.display.clone().setMonth(Number(a))}))}}),e(p.Parts.ShiftButtons,{callback:a=>{n(r=>g(c({},r),{eventType:"update",display:r.display.clone().addMonth(a)}))}})]}),f(L,{children:[e(M,{margin:"auto",xcss:{minWidth:"50%"},UnderBreakPointStyles:{margin:0},children:p.Parts.Calendar({min:l,max:h,onTitleRender:a=>"",targetMonth:i.display,from:i.from,onChange:a=>{n(r=>g(c({},r),{eventType:"update",from:a}))}})}),e(M,{unitHeight:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1,ssHiddenOnBreak:!0}),f(C.Center,{verticalAlign:"unset",ssHiddenOnBreak:!0,children:[e(M,{flexSizing:0,children:p.Parts.Calendar({min:l,max:h,onTitleRender:a=>e(y.Mini,{children:f(C.Center,{gap:"1/2",children:[e(y,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(y,{fontColor:"4.thin",children:"[\u524D\u6708]"})]})}),targetMonth:i.display.clone().addMonth(-1),from:i.from,onChange:a=>{n(r=>g(c({},r),{eventType:"update",from:a}))}})}),e(M,{unitWidth:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1}),e(M,{flexSizing:0,children:p.Parts.Calendar({min:l,max:h,onTitleRender:a=>e(y.Mini,{children:f(C.Center,{gap:"1/2",children:[e(y,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(y,{fontColor:"4.thin",children:"[\u7FCC\u6708]"})]})}),targetMonth:i.display.clone().addMonth(1),from:i.from,onChange:a=>{n(r=>g(c({},r),{eventType:"update",from:a}))}})})]})]})]}),o=="drum"&&e(p.Parts.DrumSelector,{type:"date",min:l,max:h,value:i.from,onChange:a=>{n(g(c({},i),{eventType:"update",from:a}))}})]})},Locale:{JP:{WarekiDate:t=>{var n;let{min:l,max:h}=t,[o,m]=D(S.scope(()=>{var b;let[a,r,u]=(b=String(t.defaultValue))==null?void 0:b.split(/\D/),s=t.era||"year";if(S.isNullish(a)||S.isNullish(r)||S.isNullish(u)){let k=d();s=="heisei"?k.setYear(1989):s=="shouwa"?k.setYear(1926):s=="taisho"?k.setYear(1912):s=="meiji"&&k.setYear(1868),[a,r,u]=k.toFormat("%Y-%M-%D").split("-")}let v=d();return{eventType:"init",from:d([Number(a)||v.year,(Number(r)||v.month).zeroEmbed(2),(Number(u)||v.date).zeroEmbed(2)].join("/"))}}));p.remoteControl(g(c({},t),{val_value:o,set_value:m})),F(()=>{t.onValueUpdate({value:o.from.toFormatYMD(),era:o.from.wareki.toLower(),eventType:o.eventType})},[o]);let i={year:{label:"\u897F\u66A6",min:"1900/01/01",max:"2100/12/31"},reiwa:{label:"\u4EE4\u548C",min:"2019/05/01",max:d().addYear(10).setMonth(12).setDate(31).toFormatYMD()},heisei:{label:"\u5E73\u6210",min:"1989/01/08",max:"2019/04/30"},showa:{label:"\u662D\u548C",min:"1926/12/25",max:"1989/01/07"},taisho:{label:"\u5927\u6B63",min:"1912/07/30",max:"1926/12/24"},meiji:{label:"\u660E\u6CBB",min:"1868/09/08",max:"1912/07/29"}};return f(L,{children:[f(C.Left,{gap:"1/4",flexWrap:!0,children:[f(y.Paragraph,{children:[o.from.warekiLabel,(n=o.from.warekiYear)==null?void 0:n.zeroEmbed(2),"\u5E74",o.from.toFormatMD("JP")]}),e(P,{})]}),e(M,{borderTop:!0}),e(C.Left,{gap:"1/2",flexWrap:!0,children:["reiwa","heisei","showa","taisho","meiji"].map((a,r)=>{let u=i[a];return u?e(x.Border.S,{onClick:()=>{let s=o.from;if(a=="reiwa"||a=="year")s=d();else{let v=d(u.min),T=d(u.max);v.value>o.from.value&&(s=v),o.from.value>T.value&&(s=T)}if(l){let v=d(l);s.value<v.value&&(s=v)}if(h){let v=d(h);v.value<s.value&&(s=v)}m(g(c({},o),{eventType:"update",from:s}))},children:u.label},r):null})}),e(p.Parts.DrumSelector,{type:"locale.jp.warekiDate",min:t.min,max:t.max,value:o.from,onChange:a=>{m(g(c({},o),{eventType:"update",from:a}))}})]})}}},Clock:t=>{let[l,h]=D(S.scope(()=>{let r=String(t.defaultValue).split(/[^\d]/);if(!r[0]){let v=d();r=[v.hours,v.minutes]}let u=Number(r[0]),s=Number(r[1]);return{eventType:"init",from:d().setHours(u).setMinutes(s)}}));p.remoteControl(g(c({},t),{val_value:l,set_value:h})),F(()=>{t.onValueUpdate({value:l.from.toFormatHM(),era:"clock",eventType:l.eventType})},[l]);let[o,m]=p.minutesUnitState(),i=d().setFromFormatHHMM(t.min||"00:00"),n=d().setFromFormatHHMM(t.max||"23:59");const a=(r,u)=>{h(s=>{let v=s.from.clone();return S.isExist(r)&&v.setHours(r),S.isExist(u)&&v.setMinutes(u),v.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(v=n.clone()),v.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(v=i.clone()),g(c({},s),{eventType:"update",from:v})})};return f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",flexWrap:!0,children:[f(C.Center,{gap:"1/2",children:[e(M,{className:V("ClockBase"),children:e(M,{className:V("ClockUiBase"),flexCenter:!0,children:f(M,{className:V("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[e(M,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[V("Needle"),V("hour")].join(" "),xcss:{transform:`rotate(${l.from.hours*30+l.from.minutes/2}deg)`}}),e(M,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[V("Needle"),V("minute")].join(" "),xcss:{transform:`rotate(${l.from.minutes*6}deg)`}})]})})}),f(M,{textAlign:"center",fontHeight:1.2,children:[f(y.Paragraph,{children:[l.from.hours.zeroEmbed(2)," : ",l.from.minutes.zeroEmbed(2)]}),f(y.Mini,{fontColor:"4.thin",children:[l.from.hours>=12&&"PM"||"AM",l.from.hours%12,":",l.from.minutes.zeroEmbed(2)]})]})]}),e(x.Border.XS,{borderRadius:"2.tone.secondary",fontColor:"theme",onClick:()=>{let r=d().setSeconds(0);r.minutes=Math.round(r.minutes/o)*o,a(r.hours,r.minutes)},children:"\u73FE\u6642\u523B"}),e(P,{}),e(Y,{emptySelect:!1,value:o,paddingLeft:3.5,leftIcon:e(X,{left:"2/3",children:"\u5358\u4F4D"}),pickerPosition:4,pickerStyles:{xcss:{minWidth:12*8}},padding:"1/2",options:[{value:10,label:"10\u5206"},{value:5,label:"5\u5206"},{value:1,label:"1\u5206"}],tabIndex:-1,onUpdateValidValue:r=>{m(r||1)}})]}),e(M,{borderTop:!0}),f(C.Center,{gap:"1/2",children:[e(R,{xcss:{maxHeight:12*12},override:"force",options:[{value:0,label:"\u5348\u524D"},{value:12,label:"\u5348\u5F8C"}],value:l.from.hours>=12?12:0,onUpdateValidValue:r=>{let u=l.from.hours%12+r;a(u)}}),e(R,{override:"force",value:l.from.hours,options:Array.from({length:24}).map((r,u)=>{let s=u;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)}}),onUpdateValidValue:r=>{a(r)}}),e(y,{isSemiBoldFont:!0,children:"\u6642"}),e(R,{override:"force",value:l.from.minutes,options:Array.from({length:60}).map((r,u)=>{let s=u;return s!=59&&(o==5&&s%5!=0||o==10&&s%10!=0)?null:{value:s,label:s.zeroEmbed(2)}}),onUpdateValidValue:r=>{a(void 0,r)}},o),e(y,{isSemiBoldFont:!0,children:"\u5206"})]})]})},Period:{Clock:t=>{let[l,h]=p.minutesUnitState(),[o,m]=D(S.scope(()=>{let[r,u]=S.Arrayify(t.defaultValue),s=d().setFromFormatHHMM(r||"09:00"),v=d().setFromFormatHHMM(u||"18:00");return{eventType:"init",forcus:0,display:s,from:s,to:v}}));p.remoteControl(g(c({},t),{val_value:o,set_value:m})),F(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){m(u=>g(c({},u),{eventType:"update",from:u.to,to:u.from}));return}t.onValueUpdate({value:[o.from.toFormatHM(),o.to.toFormatHM()],era:"clock",eventType:o.eventType})},[o]);let i=d().setFromFormatHHMM(t.min||"00:00"),n=d().setFromFormatHHMM(t.max||"23:59");const a=(r,u,s)=>{m(v=>{let T=v[r].clone();return S.isExist(u)&&T.setHours(u),S.isExist(s)&&T.setMinutes(s),T.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(T=n.clone()),T.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(T=i.clone()),g(c({},v),{eventType:"update",[r]:T})})};return f(L,{width:1,xcss:{minWidth:12*24},children:[f(C.Left,{flexWrap:!0,children:[f(C.Left,{gap:"1/2",children:[e(y.Paragraph,{children:o.from.toFormatHM()||"--:--"}),e(y.Mini,{children:"-"}),e(y.Paragraph,{children:o.to.toFormatHM()||"--:--"})]}),e(P,{}),e(Y,{emptySelect:!1,value:l,paddingLeft:3.5,leftIcon:e(X,{left:"2/3",children:"\u5358\u4F4D"}),pickerPosition:4,pickerStyles:{xcss:{minWidth:12*8}},padding:"1/2",options:[{value:10,label:"10\u5206"},{value:5,label:"5\u5206"},{value:1,label:"1\u5206"}],tabIndex:-1,onUpdateValidValue:r=>{h(r||1)}})]}),e(M,{borderBottom:"1.thin"}),e(p.Period.Preset,g(c({},t),{onPreset:(r,u)=>{m({eventType:"update",forcus:0,display:d(r),from:d(r),to:d(u)})}})),f(C.Center,{gap:"1/2",children:[e(R,{override:"force",value:o.from.hours,options:Array.from({length:24}).map((r,u)=>{let s=u;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:r=>{a("from",r)}}),e(R,{override:"force",value:o.from.minutes,options:Array.from({length:60}).map((r,u)=>{let s=u;return s!=59&&(l==5&&s%5!=0||l==10&&s%10!=0)?null:{value:s,label:s.zeroEmbed(2)+"\u5206"}}),onUpdateValidValue:r=>{a("from",void 0,r)}},l+"-from"),e(y,{isSemiBoldFont:!0,children:"~"}),e(R,{override:"force",value:o.to.hours,options:Array.from({length:24}).map((r,u)=>{let s=u;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:r=>{a("to",r)}}),e(R,{override:"force",value:o.to.minutes,options:Array.from({length:60}).map((r,u)=>{let s=u;return s!=59&&(l==5&&s%5!=0||l==10&&s%10!=0)?null:{value:s,label:s.zeroEmbed(2)+"\u5206"}}),onUpdateValidValue:r=>{a("to",void 0,r)}},l+"-to")]})]})},Date:t=>{let{min:l,max:h}=t,[o,m]=D(S.scope(()=>{let[i,n]=S.Arrayify(t.defaultValue),a=d(i||void 0).setFirstOfDay(),r=d(n||null).setFirstOfDay();return{eventType:"init",forcus:0,display:a,from:a,to:r}}));return p.remoteControl(g(c({},t),{val_value:o,set_value:m})),F(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){m(n=>g(c({},n),{eventType:"update",from:n.to,to:n.from}));return}t.onValueUpdate({value:[o.from.toFormatYMD(),o.to.toFormatYMD()],era:"year",eventType:o.eventType})},[o]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",flexWrap:!0,children:[e(y.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:0}))},children:[o.from.toFormatYMD()||"----/--/--",o.forcus==0&&e(p.Parts.PeriodFocusSign,{})]}),e(y.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:1}))},children:[o.to.toFormatYMD()||"----/--/--",o.forcus==1&&e(p.Parts.PeriodFocusSign,{})]}),e(P,{}),f(C.Right,{gap:"1/2",marginLeft:"auto",children:[e(Y,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,fontSize:"1.mini",pickerStyles:{xcss:{minWidth:12*12}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),options:p.YearOptions({reverse:!0}),value:o.display.year,onUpdateValidValue:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().setYear(Number(i))}))}}),e(Y,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,fontSize:"1.mini",pickerStyles:{xcss:{minWidth:12*9}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:o.display.month,onUpdateValidValue:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().setMonth(Number(i)).setDate(1)}))}}),e(p.Parts.ShiftButtons,{callback:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().addMonth(i)}))}})]})]}),e(M,{borderBottom:"1.thin"}),e(p.Period.Preset,g(c({},t),{onPreset:(i,n)=>{m({eventType:"update",forcus:0,display:d(i),from:d(i),to:d(n)})}})),e(C.Left,{verticalAlign:"top",flexWrap:!0,gap:2,children:Array.from({length:4}).map((i,n)=>{let a=p.Parts.Calendar({min:l,max:h,targetMonth:o.display.clone().addMonth(n-1),from:o.from,to:o.to,onTitleRender:r=>{let u=r.diff(o.display).months;return e(y.Mini,{ssHiddenOnBreak:!0,children:f(C.Center,{gap:"1/2",children:[e(y,{isSemiBoldFont:!0,children:r.toFormatYM("JP")}),e(y,{fontColor:"4.thin",children:["[\u524D\u6708]","","[\u7FCC\u6708]","[\u7FCC\u3005\u6708]"][u+1]})]})})},onChange:r=>{if(o.forcus==0){m(u=>g(c({},u),{eventType:"update",forcus:1,from:r,to:d(null)}));return}m(u=>g(c({},u),{eventType:"update",to:r}))}});return e(M,{flexSizing:"auto",ssHiddenOnBreak:n!=1,children:a},n)})})]})},Month:t=>{let{min:l,max:h}=t,[o,m]=D(S.scope(()=>{let[i,n]=S.Arrayify(t.defaultValue),a=d(i||void 0).setDate(1).setFirstOfDay(),r=d(n||null).setDate(1).setFirstOfDay();return{eventType:"init",forcus:0,display:a,from:a,to:r}}));return p.remoteControl(g(c({},t),{val_value:o,set_value:m})),F(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){m(n=>g(c({},n),{eventType:"update",from:n.to,to:n.from}));return}t.onValueUpdate({value:[o.from.toFormatYM(),o.to.toFormatYM()],era:"year",eventType:o.eventType})},[o]),f(L,{xcss:{minWidth:12*16},children:[f(C.Left,{gap:"1/2",flexWrap:!0,children:[e(y.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:0}))},children:[o.from.toFormatYM("JP")||"----/--",o.forcus==0&&e(p.Parts.PeriodFocusSign,{})]}),e(y.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{m(i=>g(c({},i),{forcus:1}))},children:[o.to.toFormatYM("JP")||"----/--",o.forcus==1&&e(p.Parts.PeriodFocusSign,{})]}),e(P,{}),f(C.Left,{flexWrap:!0,gap:"1/2",marginLeft:"auto",children:[e(Y,{emptySelect:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,fontSize:"1.mini",pickerStyles:{xcss:{minWidth:12*12}},rightIcon:e(N,{right:"2/3",children:e(B.AngleDown,{})}),options:p.YearOptions({reverse:!0}),value:o.display.year,onUpdateValidValue:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().setYear(Number(i))}))}}),e(p.Parts.ShiftButtons,{callback:i=>{m(n=>g(c({},n),{eventType:"update",display:n.display.clone().addYear(i)}))}})]})]}),e(M,{borderBottom:"1.thin"}),e(p.Period.Preset,g(c({},t),{onPreset:(i,n)=>{m({eventType:"update",forcus:0,display:d(i),from:d(i),to:d(n)})}})),e(C.Left,{verticalAlign:"top",flexWrap:!0,gap:2,UnderBreakPointStyles:{gap:1},children:Array.from({length:4}).map((i,n)=>{let a=p.Parts.YearCalendar({min:l,max:h,targetYear:o.display.year+n-1,from:o.from.getFirstDayOfMonth(),to:o.to.getLastDayOfMonth(),onTitleRender:r=>{let u=r-o.display.year;return e(y.Mini,{children:f(C.Left,{gap:"1/2",children:[f(y,{isSemiBoldFont:!0,children:[r,"\u5E74"]}),e(y,{fontColor:"4.thin",children:["[\u524D\u5E74]","","[\u7FCC\u5E74]","[\u7FCC\u3005\u5E74]"][u+1]})]})})},onChange:r=>{if(o.forcus==0){m(u=>g(c({},u),{eventType:"update",forcus:1,from:r,to:d(null)}));return}m(u=>g(c({},u),{eventType:"update",to:r}))}});return e(M,{flexSizing:"auto",ssHiddenOnBreak:n<1||n>2,xcss:{minWidth:"35%"},children:a},n)})})]})},Preset:t=>t.periodPresets?e(C.Right,{gap:"1/2",flexWrap:!0,children:t.periodPresets.map((l,h)=>e(x.Border.S,{padding:["1/4",1],onClick:()=>{t.onPreset(l.from,l.to)},children:l.label},h))}):null},Parts:{ShiftButtons:t=>f(C.Center,{gap:"1/3",fontSize:"1.mini",children:[e(x.Sub,{className:V("LeftButton"),tabIndex:-1,right:0,position:"relative",ssSquare:2.5,onClick:()=>{t.callback(-1)},children:e(B.ChevronLeft,{})}),e(x.Sub,{className:V("RightButton"),tabIndex:-1,left:0,position:"relative",ssSquare:2.5,onClick:()=>{t.callback(1)},children:e(B.ChevronRight,{})})]}),Calendar:t=>{let{targetMonth:l,from:h,to:o,onTitleRender:m=k=>e(y.Mini,{isSemiBoldFont:!0,children:k.toFormatYM("JP")})}=t,i=d();if(!t.targetMonth.validate)return null;let n=l.clone().setDate(1),a=n.getLastDayOfMonth(),r=d(n).addMonth(-1).getLastDayOfMonth().date,u=[],s=[],v=[],T=[];for(var b=0;b<7;b++){let k=b==6,w=b==0;u.push(e(y.Micro,{textAlign:"center",fontColor:k?"googleBlue":w?"googleRed":"inherit",children:S.transformer.weekday.shortJP(b)},b))}for(var b=0;b<n.weekday;b++)s.unshift(e(y.Mini,{fontColor:"4.thin",flexCenter:!0,children:r-b},b));for(var b=1;b<=a.date;b++){let w=l.clone().setDate(b),E=h.isSameDate(w),z=!1,H=!1;o&&o.validate&&(z=w.isInRange(h,o),H=o.isSameDate(w));let G=i.isSameDate(w),U=!1;if(t.min){let I=d(t.min);I&&w.value<I.value&&(U=!0)}if(t.max){let I=d(t.max);I&&I.value<w.value&&(U=!0)}v.push(f(x.Clear.S,{isLocked:U,color:"cloud",border:"1.thin",isActive:E||H||z,isActiveStyles:E||H?{fontColor:"white",backgroundColor:"theme",borderColor:"theme",boxShadow:"0.remark"}:{backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"0.trans"},xcss:{whiteSpace:"nowrap",minWidth:12*3,minHeight:12*3},flexCenter:!0,ssEffectsOnActive:"shrink",tabIndex:-1,onClick:()=>{t.onChange(w)},children:[b,G&&e(p.Parts.CurrentSign,{})]},w.toFormatYMD()))}for(var b=1;b<7-a.weekday;b++)T.push(e(y.Mini,{flexCenter:!0,fontColor:"4.thin",children:b},b));return f(L,{gap:"1/2",children:[m(l)||"",f(J,{gridCols:7,gap:"1/6",children:[u,s,v,T]})]},l.toFormatYM())},YearCalendar:t=>{let{targetYear:l,from:h,to:o,onTitleRender:m=a=>f(y.Mini,{isSemiBoldFont:!0,children:[a,"\u5E74"]})}=t,i=d(),n=[];for(let a=1;a<=12;a++){let r=d().setYear(t.targetYear).setMonth(a).setDate(1),u=!1;if(t.min){let k=d(t.min).getLastDayOfMonth();k&&r.value<k.value&&(u=!0)}if(t.max){let k=d(t.max).getLastDayOfMonth();k&&k.value<r.value&&(u=!0)}let s=h.year==l&&h.month==r.month,v=!1,T=!1;o&&o.validate&&(v=r.isInRange(h,o),T=o.year==l&&o.month==r.month);let b=i.year==l&&i.month==r.month;n.push(f(x.Clear.S,{isLocked:u,color:"cloud",border:"1.thin",isActive:s||T||v,isActiveStyles:s||T?{fontColor:"white",backgroundColor:"theme",borderColor:"theme",boxShadow:"0.remark"}:{backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"0.trans"},fontSize:"inherit",ssEffectsOnActive:"shrink",tabIndex:-1,xcss:{whiteSpace:"nowrap",minWidth:12*3,minHeight:12*3},flexCenter:!0,onClick:()=>{t.onChange(r)},children:[f(C.Center,{gap:"1/2",children:[e(y,{children:r.month}),e(y.Mini,{opacity:"middle",children:["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month]})]}),b&&e(p.Parts.CurrentSign,{})]},l+"-"+r.month))}return f(L,{gap:"1/2",children:[m(t.targetYear),e(J,{flexWrap:!0,gridCols:4,gap:"1/6",children:n})]},t.targetYear)},DrumSelector:t=>{let{type:l,min:h,max:o,value:m}=t;const i=(a,r,u)=>{let s=t.value.clone();if(S.isExist(a)&&(s=s.setYear(a)),S.isExist(r)&&(s=s.setMonth(r)),S.isExist(u)&&(s=s.setDate(u)),h){let v=d(h);s.value<v.value&&(s=v)}if(o){let v=d(o);v.value<s.value&&(s=v)}t.onChange(s)};let n=m.getLastDayOfMonth().date;return f(C.Center,{gap:"1/2",children:[e(R,{override:"force",options:p.YearOptions({}),value:m.year,onUpdateValidValue:a=>{i(Number(a))}}),e(y,{isSemiBoldFont:!0,children:"\u5E74"}),e(R,{override:"force",options:Array.from({length:12}).map((a,r)=>{let u=r+1;return{value:u,label:u}}),value:m.month,onUpdateValidValue:a=>{i(void 0,Number(a))}}),e(y,{isSemiBoldFont:!0,children:"\u6708"}),l!="month"&&f($,{children:[e(R,{override:"force",options:Array.from({length:31}).map((a,r)=>{let u=r+1;return u>n?null:{value:u,label:u}}),value:m.date,onUpdateValidValue:a=>{i(void 0,void 0,Number(a))}}),e(y,{isSemiBoldFont:!0,children:"\u65E5"})]})]})},MinMax:t=>{let{restrict:l,min:h,max:o}=t;if(!h&&!o)return null;let m=d(h||null),i=d(o||null),n="",a="";return l=="year"?(n=m.toFormat("%Y\u5E74"),a=i.toFormat("%Y\u5E74")):l.match(/month/)?(n=m.toFormatYM(),a=i.toFormatYM()):l.match(/date/)?(n=m.toFormatYMD(),a=i.toFormatYMD()):l.match(/clock/)&&(m=d().setFromFormatHHMM(h||""),i=d().setFromFormatHHMM(o||""),n=m.toFormatHM(),a=i.toFormatHM()),f(y.Micro,{fontHeight:1.2,children:[n&&f(y,{children:["\u6700\u5C0F: ",n]}),a&&f(y,{children:["\u6700\u5927: ",a]})]})},CurrentSign:()=>e(M,{position:"absolute",bottom:"1/6",left:"50%",width:1,unitHeight:"1/6",backgroundColor:"warn",xcss:{maxWidth:12*2.5,transform:"translateX(-50%)"},isRounded:!0}),PeriodFocusSign:()=>e(M,{position:"absolute",bottom:"1/4",left:"1/2",right:"1/2",backgroundColor:"theme",unitHeight:"1/4",boxShadow:"0.remark",isRounded:!0})}},A=j;A.picker={open:t=>{let l=null,h=null,o="init",m="L";t.restrict=="year"&&(m="S"),t.restrict=="month"&&(m="S"),t.restrict=="clock"?m="XS":(t.restrict=="locale.jp.warekiDate"||t.restrict=="period.clock")&&(m="S");let i=t.sheetID||O(),n=t.pickerId||O();_.open("middleCenter",{sheetID:i,size:m,padding:[2,0],closeAtAroundClick:!0,closeAtParentBlur:!1,onClose:()=>{o!="commit"&&t.onValueUpdate({value:l,era:h,eventType:"commit"})},content:f(L,{gap:"1/2",children:[f(C.Left,{children:[e(P,{}),e(x.Sub.S,{color:"cloud",ssSphere:3,onClick:()=>{_.close(i)},children:e(B.X,{})})]}),e(_.Body,{children:f(L,{borderRadius:"inherit",children:[e(L,{padding:1,children:e(j,{sheetID:i,pickerId:n,restrict:t.restrict,min:t.min,max:t.max,era:t.era,defaultValue:t.defaultValue,onValueUpdate:a=>{t.onValueUpdate(a),l=a.value,h=a.era,o=a.eventType,a.eventType=="commit"&&_.close(i)}})}),f(C.Left,{padding:1,position:"sticky",ssZIndex:10,bottom:0,gap:"1/2",borderTop:"1.thin",backgroundColor:"layer.0.opa.low",borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit",xcss:{backdropFilter:"blur(3px)"},children:[e(x.Clear.S,{color:"cloud",tabIndex:-1,fontColor:"4.thin",borderRadius:"2.tone.secondary",flexSizing:"none",onClick:()=>{var a,r;(r=(a=W.get(n||""))==null?void 0:a.onClear)==null||r.call(a)},children:f(C.Center,{gap:"1/2",children:[e(B.X,{}),e(y.Micro,{children:"\u30EA\u30BB\u30C3\u30C8"})]})}),e(p.Parts.MinMax,{restrict:t.restrict,min:t.min,max:t.max}),e(P,{}),e(x.Prime.S,{tabIndex:-1,xcss:{minWidth:12*6},onClick:()=>{var a,r;(r=(a=W.get(n||""))==null?void 0:a.onConfirm)==null||r.call(a)},children:"\u78BA\u5B9A"})]})]})})]})})},close:t=>{_.close(t)}};export{A as TimeSelector,A as default};
|