amotify 0.3.35 → 0.3.37

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.
@@ -8,7 +8,7 @@ const nextConfig: NextConfig = {
8
8
  webpackMemoryOptimizations: true,
9
9
  },
10
10
  allowedDevOrigins: [
11
- '192.168.100.40'
11
+ '192.168.100.21'
12
12
  ]
13
13
  }
14
14
 
@@ -12,7 +12,7 @@
12
12
  "cross-env": "^7.0.3",
13
13
  "dotenv": "^16.4.5",
14
14
  "express": "^4.19.2",
15
- "jmini": "^0.0.129",
15
+ "jmini": "^0.0.130",
16
16
  "next": "^16.2.1",
17
17
  "node-cron": "^4.1.1",
18
18
  "nodemon": "^3.1.4",
@@ -1 +1 @@
1
- import{b as n,c as p,d as G,e as be}from"../../chunk-C5N2D3ZX.js";import{Fragment as Be,jsx as o,jsxs as $}from"react/jsx-runtime";import u,{useStore as ne,UUID as ge}from"jmini";import me,{useState as Re,useEffect as se}from"react";import{ExtractStyles as X,GenerateHTMLProps as xe,dragEffect as ye,useRemote as ie}from"../../@utils";import{faArrowUp as Te}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faUpDown as De}from"@fortawesome/free-solid-svg-icons/faUpDown";import{Box as K,Flex as we,FAI as _,Span as ke}from"../../atoms";import{Literal as pe,Row as q,MarkerPen as he}from"../../mols";import{Button as ce}from"../Trigger";import E from"../Input";import{TableClasses as Ke}from"../../@styles/componentClasses";import{faGripVertical as Se}from"@fortawesome/free-solid-svg-icons/faGripVertical";import{Tips as Ce}from"../Tips";const b={reservedKeys:["row_id","onCheckerDisabled","onDraggerDisabled","columnIdx","isSelected","isFilterMatched","isVisible","draggerIndex","onRowClick"],toSafetyHeader:t=>{let e=!!t.some(l=>l.draggable);return(t==null?void 0:t.map((l,a)=>{var d;return u.isRecord(l)||(l={key:l}),u.isString(l.key)&&(l.key=l.key.replace(/[.\s]/g,"_")),e&&(l.sortable=0,l.filterable=!1),l.columnIdx=(d=l.columnIdx)!=null?d:a,l}).toASC("columnIdx"))||[]},toSafetyBody:t=>t==null?void 0:t.map((e,r)=>{var a;let l={};return Object.entries(e).forEach(([d,c])=>{var i,s;if(u.isOneOf(d,...b.reservedKeys))return;let g=c;u.isNullish(g)||(u.isRecord(g)||(g={data:g}),u.isString(d)&&(d=d.replace(/[.\s]/g,"_")),g.sortKey=(s=(i=g.sortKey)!=null?i:String(g.data))!=null?s:"",l[d]=g)}),l=p(n({},l),{row_id:(a=e.row_id)!=null?a:r,onRowClick:e.onRowClick,isSelected:!!e.isSelected,isFilterMatched:!0,isVisible:!0,onCheckerDisabled:e.onCheckerDisabled,onDraggerDisabled:e.onDraggerDisabled,draggerIndex:r}),l}),toSafetyData:t=>{var l,a;let{header:e=[]}=t,r={datagridID:t.datagridID||ge(),sessionID:ge(),body:b.toSafetyBody(t.body||[]),filter:{keyword:t.defaultSearchKey||"",current:[]},sort:{col:-1,dir:1},paging:{rows:t.maxRows||100,total:1,current:1},draggable:!!e.some(d=>d.draggable)};{let d=e==null?void 0:e.findIndex(c=>c.defSort);d!==-1&&(r.sort.col=d,r.sort.dir=(a=(l=e[d])==null?void 0:l.sortable)!=null?a:1)}return r.draggable&&(r.sort.col=-1,r.sort.dir=0),b.updateRowMeta(r,t)},updateRowMeta:(t,e)=>{var l;let r=n({},t);if(r.sort.col>=0&&r.sort.dir){let a=((l=e.header[r.sort.col])==null?void 0:l.key)||"";r.sort.dir==1?r.body.toASC(a+".sortKey"):r.body.toDESC(a+".sortKey")}{let a=String(r.filter.keyword)||"";r.body.forEach(d=>{if(d.isFilterMatched=!0,!a)return;let c=e.header.some(g=>{var f;let i=d[g.key];return!i||!i.sortKey?!1:!!((f=String(i.sortKey||i.data))!=null&&f.match(new RegExp(a.escapeRegExChar(),"i")))});d.isFilterMatched=c})}{let a=r.paging.rows;r.paging.total=Math.ceil(r.body.filter(i=>i.isFilterMatched).length/a);let d=a*(r.paging.current-1),c=d+a,g=0;r.body.forEach(i=>{i.isVisible=!1,i.isFilterMatched&&(i.isVisible=g>=d&&g<c,g++)})}return r.draggable&&r.body.toASC("draggerIndex"),r},index:t=>{var s,f,H,x;let[e,r]=Re(()=>b.toSafetyData(t));se(()=>{ne.set({["reset-"+e.datagridID]:()=>{r(b.toSafetyData(t))},["refresh-"+e.datagridID]:()=>{r(y=>b.updateRowMeta(p(n({},y),{body:b.toSafetyBody(t.body)}),t))}})},[t]),se(()=>{ne.set({["rows-"+e.datagridID]:e.body}),ie.bridge(e.datagridID,{val_config:e,remoteUpdate:{paging:y=>{r(m=>b.updateRowMeta(p(n({},m),{paging:p(n({},m.paging),{current:Math.max(1,Math.min(m.paging.total,y))})}),t))},maxRow:y=>{r(m=>b.updateRowMeta(p(n({},m),{paging:p(n({},m.paging),{rows:y,current:1})}),t))},searchKey:y=>{u.interval.once(()=>{r(m=>{let w=p(n({},m),{paging:p(n({},m.paging),{current:1}),filter:p(n({},m.filter),{keyword:String(y||"").trim()})});return b.updateRowMeta(w,t)})},300,"InputSearchTime")}}})},[e]);const l=me.useRef(!1);se(()=>{if(t.onSelected){if(!l.current){l.current=!0;return}t.onSelected(e.body.filter(y=>y.isSelected))}},[(s=e==null?void 0:e.body)==null?void 0:s.filter(y=>y.isSelected).length]);const a=me.useRef(!1);se(()=>{if(t.onSorted){if(!a.current){a.current=!0;return}t.onSorted(e.sort.col,e.sort.dir)}},[(f=e==null?void 0:e.sort)==null?void 0:f.col,(H=e==null?void 0:e.sort)==null?void 0:H.dir]);let d={input:t,val_config:e,set_config:r},{className:c,style:g}=xe(t),i=(x=t.colLength)!=null?x:t.header.length;return o(K,{className:c,style:g,children:o(D.Table,{className:Ke("DataGrid"),borderRadius:"inherit",children:$(D.Body,{children:[o(b.Header,n({},d)),o(b.Body,n({},d)),o(b.Footer,n({},d))]})},[i,...t.header.map(y=>y.key),e.sessionID].join("."))})},Checker:t=>o(K,{flexCenter:!0,onClick:e=>{e.stopPropagation()},children:o(E.Checker,p(n({wrapStyles:{display:"inlineBlock"},cellStyles:{gap:0}},t),{label:!1}))}),Header:t=>{var i,s,f,H;let{input:e,val_config:r,set_config:l}=t;if(e.headerless)return null;let a="datagrid-dragger-"+r.datagridID,d=["datagrid",r.datagridID,""].join("-"),c=1+r.body.filter(x=>x.isVisible).length+ +!!e.footer,g=(i=e.colLength)!=null?i:e.header.length;return o(ye.DropArea,p(n({jsxElement:D.Row,id:d},e.rowStyles),{dragInfo:{type:a,id:String(((H=(f=(s=r.body)==null?void 0:s.filter(x=>x.isFilterMatched))==null?void 0:f[0])==null?void 0:H.draggerIndex)||0),marker:"bottom"},children:e.header.toASC("columnIdx").map((x,y)=>{var re,oe,le,k,j,F;let[m,w]=X(x),te=w,{isTH:S,key:C,label:M,onLabelRender:B,columnIdx:Y,checkable:N,draggable:J,defSort:de,sortable:P,filterable:A,isHidden:v}=te,T=G(te,["isTH","key","label","onLabelRender","columnIdx","checkable","draggable","defSort","sortable","filterable","isHidden"]);if(v)return null;let I={rowIdx:0,colIdx:y,topIdx:0,leftIdx:y,rightIdx:g-y-1,bottomIdx:c-1,isHeader:!0,isBody:!1,isFooter:!1},Z=J,V=P!=0,O=y==r.sort.col,Q=u.deepMerge(u.deepCopy(e.cellStyles),fe(I,{}),(re=e.cellStyles)==null?void 0:re.onHeader,!I.leftIdx&&((oe=e.cellStyles)==null?void 0:oe.onLeft),!I.rightIdx&&((le=e.cellStyles)==null?void 0:le.onRight),!I.topIdx&&((k=e.cellStyles)==null?void 0:k.onTop),!I.bottomIdx&&((j=e.cellStyles)==null?void 0:j.onBottom),m);e.onCellStyles&&(Q=e.onCellStyles(I,Q||{}));let U=[],ee=[];if(Z&&U.push(o(ce.Clear.S,{ssSphere:2.5,fontColor:"theme",onMouseOver:h=>{Ce.open(h.currentTarget,$(pe.Mini,{children:[o(_,{icon:Se}),"\u30C9\u30E9\u30C3\u30B0\u3067\u5217\u306E\u9806\u756A\u3092\u5909\u66F4"]}),22)},onMouseLeave:h=>Ce.abort(),onClick:h=>{h.stopPropagation()},children:o(_.QuestionCircle,{})},"drag")),N){let h=o(b.Checker,{value:r.body.every(R=>R.isSelected),onUpdateValue:R=>{l(L=>{let z=n({},L);return z.body.forEach(ae=>{ae.isFilterMatched&&(ae.onCheckerDisabled||(ae.isSelected=!!R))}),z})}},"check");N=="left"?U.push(h):ee.push(h)}return V&&U.push(o(_,{fontSize:"1.mini",fontColor:"theme",opacity:O?"max":"low",transition:"middle",xcss:{transform:O&&r.sort.dir==-1?"rotate(180deg)":"none"},icon:O?Te:De},"sort")),o(D.Cell,p(n(n({isTH:!!S,ssPushable:!!P},X(Q||{})[0]),T),{className:[e.cellClassName,T.className].join(" "),onClick:h=>{T.onClick&&T.onClick(h),e.onCellClick&&e.onCellClick(I,h),V&&l(R=>{let L=n({},R);return L.sort={col:y,dir:O?R.sort.dir*-1:P},b.updateRowMeta(L,e)})},children:$(q.Left,{gap:"1/3",height:1,children:[U,(F=B==null?void 0:B(C))!=null?F:o(K,{flexSizing:0,children:M!=null?M:C}),ee]})}),[y,x.key].join("/"))})}))},Body:t=>{var g,i;let{input:e,val_config:r,set_config:l}=t,a=r.body.filter(s=>s.isVisible),d=+!e.headerless+a.length+ +!!e.footer,c=(g=e.colLength)!=null?g:e.header.length;return a.length?o(Be,{children:a.map((s,f)=>{let{onCheckerDisabled:H,onDraggerDisabled:x}=s,y=f;e.headerless||(y+=1);let m="datagrid-dragger-"+r.datagridID,w=["datagrid",r.datagridID,s.row_id].join("-");return o(ye.DropArea,p(n({jsxElement:D.Row,id:w,ssPushable:!!e.onRowClick||!!s.onRowClick},e.rowStyles),{onClick:S=>{s.onRowClick&&s.onRowClick(S),e.onRowClick&&e.onRowClick(s,S)},dragInfo:{type:m,id:String(s.row_id||""),disabled:!r.draggable,marker:"bottom"},children:e.header.toASC("columnIdx").map((S,C)=>{var U,ee,te,re,oe,le;let M=S.draggable,B=s[S.key];if(!B)return null;let[Y,N]=X(B),Q=N,{isTH:J,sortKey:de,data:P,label:A,onLabelRender:v}=Q,T=G(Q,["isTH","sortKey","data","label","onLabelRender"]),I={rowIdx:y,colIdx:C,topIdx:y,leftIdx:C,rightIdx:c-C-1,bottomIdx:d-y-1,isHeader:!1,isBody:!0,isFooter:!1},Z=u.deepMerge(u.deepCopy(e.cellStyles),fe(I,{}),(U=e.cellStyles)==null?void 0:U.onBody,!I.leftIdx&&((ee=e.cellStyles)==null?void 0:ee.onLeft),!I.rightIdx&&((te=e.cellStyles)==null?void 0:te.onRight),!I.topIdx&&((re=e.cellStyles)==null?void 0:re.onTop),!I.bottomIdx&&((oe=e.cellStyles)==null?void 0:oe.onBottom),Y);e.onCellStyles&&(Z=e.onCellStyles(I,Z||{}));let V=[],O=[];return u.scope(()=>{if(M){if(s.onDraggerDisabled){V.push(s.onDraggerDisabled());return}V.push(o(ce.Clear.S,{tabIndex:-1,isRounded:!0,ssSphere:2.5,fontColor:"6.clear",onPointerDown:k=>{let j=u("#"+w)[0],F=j.cloneNode(!0);F.style.width=j.offsetWidth+"px",ye.Start(m,{dragElement:F,startEvent:k,originId:w,horizontal:!1},h=>be(void 0,null,function*(){if(!h.end||!h.onDropArea)return;let R=[...r.body],L=R.findIndex(W=>W.row_id==s.row_id);if(L==-1)return;let z=R.findIndex(W=>W.row_id==h.id);if(z<L&&z++,L==z)return;let ae=R.splice(L,1)[0];R.splice(z,0,ae),R.forEach((W,Ie)=>{W.draggerIndex=Ie}),e.onDragged&&e.onDragged(R),l(W=>p(n({},W),{body:R}))}))},children:o(q.Center,{gap:"1/4",children:o(_,{icon:Se})})},"drag"))}}),u.scope(()=>{if(!S.checkable)return;let k=o(b.Checker,{override:"force",value:!!s.isSelected,onUpdateValue:j=>{l(F=>p(n({},F),{body:F.body.map(h=>(h.row_id==s.row_id&&(h.isSelected=!!j),h))}))}},"check");s.onCheckerDisabled&&(k=s.onCheckerDisabled()),S.checkable=="left"?V.push(k):O.push(k)}),o(D.Cell,p(n(n({isTH:!!J},X(Z||{})[0]),T),{className:[e.cellClassName,T.className].join(" "),onClick:k=>{T.onClick&&T.onClick(k),e.onCellClick&&e.onCellClick(I,k)},children:$(q.Left,{gap:"1/3",height:1,children:[V,(le=v==null?void 0:v(P))!=null?le:o(K,{flexSizing:0,children:he(A!=null?A:String(P),r.filter.keyword)}),O]})}),[C,S.key].join("/"))})}),[s.row_id,y].join("."))})}):o(D.Row,p(n({},e.rowStyles),{children:o(D.Cell,{colSpan:c,padding:1,children:(i=e.onNoRecordsRender)==null?void 0:i.call(e)})}))},Footer:t=>{var c;let{input:e,val_config:r,set_config:l}=t;if(!e.footer)return null;let a=+!e.headerless+r.body.filter(g=>g.isVisible).length+1,d=(c=e.colLength)!=null?c:e.header.length;return o(D.Row,p(n({},e.rowStyles),{children:e.header.toASC("columnIdx").map((g,i)=>{var Y,N,J,de,P,A,v;let s=e.footer[g.key];if(!s)return null;u.isRecord(s)||(s={data:s});let[f,H]=X(s),B=H,{isTH:x,data:y,label:m,onLabelRender:w}=B,S=G(B,["isTH","data","label","onLabelRender"]),C={rowIdx:a-1,colIdx:i,topIdx:a-1,leftIdx:i,rightIdx:d-i-1,bottomIdx:0,isHeader:!1,isBody:!1,isFooter:!0},M=u.deepMerge(u.deepCopy(e.cellStyles),fe(C,{}),(Y=e.cellStyles)==null?void 0:Y.onBody,(N=e.cellStyles)==null?void 0:N.onFooter,!C.leftIdx&&((J=e.cellStyles)==null?void 0:J.onLeft),!C.rightIdx&&((de=e.cellStyles)==null?void 0:de.onRight),!C.topIdx&&((P=e.cellStyles)==null?void 0:P.onTop),!C.bottomIdx&&((A=e.cellStyles)==null?void 0:A.onBottom),f);return e.onCellStyles&&(M=e.onCellStyles(C,M||{})),o(D.Cell,p(n(n({isTH:!!x},X(M||{})[0]),S),{className:[e.cellClassName,S.className].join(" "),onClick:T=>{S.onClick&&S.onClick(T),e.onCellClick&&e.onCellClick(C,T)},children:o(K,{flexSizing:0,children:(v=w==null?void 0:w(y))!=null?v:he(m!=null?m:String(y),r.filter.keyword)})}),[i,g.key].join("/"))})}))}},fe=(t,e)=>{let r=n({},e);return t.topIdx||(r.borderTop="unset"),t.bottomIdx||(r.borderBottom="unset"),t.rightIdx||(r.borderRight="unset"),t.leftIdx||(r.borderLeft="unset"),t.topIdx||(t.leftIdx||(r.borderTopLeftRadius="inherit"),t.rightIdx||(r.borderTopRightRadius="inherit")),t.bottomIdx||(t.leftIdx||(r.borderBottomLeftRadius="inherit"),t.rightIdx||(r.borderBottomRightRadius="inherit")),r},Me=t=>(t=n({datagridID:ge(),tone:"border",maxRows:100,onNoRecordsRender:()=>o(q.Center,{children:o(pe.Mini,{fontColor:"4.thin",children:"(\u30C7\u30FC\u30BF\u306A\u3057)"})})},t),t.rowStyles=n({backgroundColor:"layer.0"},t.rowStyles),t.cellStyles=n(p(n({},u.scope(()=>{if(!t.tone)return{};let e={};return u.isOneOf(t.tone,"border","border.horizontal")&&(e.borderBottom="2.normal"),u.isOneOf(t.tone,"border","border.vertical")&&(e.borderRight="2.normal"),e})),{position:"relative",padding:["1/3","2/3"],transition:"short"}),t.cellStyles),t.tone&&(t=n({border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"},t)),t.header=b.toSafetyHeader(t.header||[]),t.header.forEach((e,r)=>{var l;e.sortable=(l=e.sortable)!=null?l:1,e.checkable===!0&&(e.checkable="left")}),o(b.index,n({},t))),ue={getBodyRows:t=>ne.get("rows-"+t)||[],toSafetyBody:b.toSafetyBody,reset:t=>{var e;(e=ne.get("reset-"+t))==null||e()},refreshBody:t=>{var e;(e=ne.get("refresh-"+t))==null||e()},reservedKeys:b.reservedKeys,Table:t=>o(K,p(n({htmlTag:"table",borderRadius:"inherit"},t),{border:t.border})),Head:t=>o(K,n({htmlTag:"thead",borderRadius:"inherit"},t)),Body:t=>o(K,n({htmlTag:"tbody",borderRadius:"inherit"},t)),Row:t=>o(K,n({htmlTag:"tr",borderRadius:"inherit"},t)),TH:t=>o(K,n({htmlTag:"th"},t)),TD:t=>o(K,n({htmlTag:"td"},t)),Cell:t=>{let l=t,{isTH:e}=l,r=G(l,["isTH"]);return e?o(ue.TH,n({},r)):o(ue.TD,n({},r))},RightIndicator:{data:"",label:o(q.Right,{children:o(_.AngleRight,{fontColor:"theme",fontSize:"3.paragraph"})})},SearchInput:t=>{let d=t,{datagridID:e}=d,r=G(d,["datagridID"]),l=ie.catch(t.datagridID);if(!l)return console.warn("[DataGrid] SearchInput must be used inside DataGrid."),null;let{val_config:a}=l;return o(E.TextField,p(n({label:"\u691C\u7D22...",clearButton:!0,padding:["1/2","2/3"],rightIcon:o(E.RightIcon,{ssSphere:2,fontColor:"5.translucent",right:"2/3",children:o(_.Search,{})}),value:a.filter.keyword},r),{onUpdateValidValue:(...c)=>{r.onUpdateValidValue&&r.onUpdateValidValue(...c),l.remoteUpdate.searchKey(c[0])}}))},Info:t=>{let e=ie.catch(t.datagridID);if(!e)return null;let{val_config:r}=e,l=t.totalCount||r.body.length,a=r.body.filter(c=>c.isFilterMatched).length,d=a.toRate(l,1)||0;return $(we,{verticalAlign:"baseline",gap:"1/2",fontSize:"1.mini",fontColor:"3.blur",children:[o(ke,{fontSize:"4.thirdTitle",fontColor:"theme",children:a.toLocaleString()}),"/ ",l.toLocaleString(),"\u4EF6 (",d,"%)"]})},Paging:t=>{let g=t,{datagridID:e}=g,r=G(g,["datagridID"]),l=ie.catch(e);if(!l)return null;let{val_config:a}=l,d=[];for(let i=0;i<a.paging.total;i++)d.push({value:i+1,label:(i+1).toString()});const c=i=>{let s=Math.min(Math.max(1,i),a.paging.total),f=n({},a);f.paging.current=s,l.remoteUpdate.paging(s)};return o(E.Select,p(n({emptySelect:!1,padding:["1/3","2/3"],override:"force",gap:0},r),{leftIcon:o(E.LeftIcon,{xcss:{left:2,pointerEvents:"all"},children:o(ce.Sub.S,{color:"cloud",fontColor:"4.thin",ssSquare:2.5,unitWidth:2,onClick:()=>{if(a.paging.current==1){c(a.paging.total);return}c(a.paging.current-1)},children:o(_.ChevronLeft,{})})}),rightIcon:o(E.RightIcon,{xcss:{right:2,pointerEvents:"all"},children:o(ce.Sub.S,{color:"cloud",fontColor:"4.thin",ssSquare:2.5,unitWidth:2,onClick:()=>{if(a.paging.current==a.paging.total){c(1);return}c(a.paging.current+1)},children:o(_.ChevronRight,{})})}),options:d.map(i=>({value:i.value||0,label:$(q.Left,{gap:"1/3",verticalAlign:"baseline",children:[i.label,$(pe.Micro,{fontColor:"4.thin",children:["/ ",a.paging.total]})]})})),value:a.paging.current,onUpdateValidValue:i=>{c(i)}}))},RowCount:t=>{let s=t,{datagridID:e}=s,r=G(s,["datagridID"]),l=ie.catch(e);if(!l)return null;let{val_config:a}=l,d=a.body.filter(f=>f.isFilterMatched).length,c=a.paging.rows,g=0,i=t.options.map(f=>(g|=+(f==c),{value:f,label:f.toString()}));return g||i.push({value:c,label:c.toString()}),o(q.Center,{gap:"1/2",children:o(E.Select,p(n({emptySelect:!1,override:"force",padding:"1/3",paddingLeft:3,paddingRight:2,pickerStyles:{xcss:{minWidth:12*9}},pickerPosition:4,leftIcon:o(E.LeftIcon,{fontSize:"0.xs",fontColor:"4.thin",xcss:{left:6},children:"\u8868\u793A"}),rightIcon:o(E.RightIcon,{fontSize:"0.xs",fontColor:"4.thin",xcss:{right:6},children:"\u4EF6"})},r),{value:a.paging.rows,options:i.toASC("value"),onUpdateValidValue:f=>{l.remoteUpdate.maxRow(Number(f))}}))})}},D=Object.assign(Me,ue);export{D as DataGrid,D as default,fe as onDefaultCellStyles};
1
+ import{b as n,c as p,d as G,e as be}from"../../chunk-C5N2D3ZX.js";import{Fragment as Pe,jsx as o,jsxs as $}from"react/jsx-runtime";import u,{useStore as ne,UUID as ge}from"jmini";import me,{useState as Re,useEffect as se}from"react";import{Config as xe,ExtractStyles as X,GenerateHTMLProps as Te,dragEffect as ye,useRemote as ie}from"../../@utils";import{faArrowUp as De}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faUpDown as we}from"@fortawesome/free-solid-svg-icons/faUpDown";import{Box as K,Flex as ke,FAI as _,Span as Ke}from"../../atoms";import{Literal as pe,Row as q,MarkerPen as he}from"../../mols";import{Button as ce}from"../Trigger";import E from"../Input";import{TableClasses as Me}from"../../@styles/componentClasses";import{faGripVertical as Se}from"@fortawesome/free-solid-svg-icons/faGripVertical";import{Tips as Ce}from"../Tips";const b={reservedKeys:["row_id","onCheckerDisabled","onDraggerDisabled","columnIdx","isSelected","isFilterMatched","isVisible","draggerIndex","onRowClick"],toSafetyHeader:t=>{let e=!!t.some(l=>l.draggable);return(t==null?void 0:t.map((l,a)=>{var d;return u.isRecord(l)||(l={key:l}),u.isString(l.key)&&(l.key=l.key.replace(/[.\s]/g,"_")),e&&(l.sortable=0,l.filterable=!1),l.columnIdx=(d=l.columnIdx)!=null?d:a,l}).toASC("columnIdx"))||[]},toSafetyBody:t=>t==null?void 0:t.map((e,r)=>{var a;let l={};return Object.entries(e).forEach(([d,c])=>{var i,s;if(u.isOneOf(d,...b.reservedKeys))return;let g=c;u.isNullish(g)||(u.isRecord(g)||(g={data:g}),u.isString(d)&&(d=d.replace(/[.\s]/g,"_")),g.sortKey=(s=(i=g.sortKey)!=null?i:String(g.data))!=null?s:"",l[d]=g)}),l=p(n({},l),{row_id:(a=e.row_id)!=null?a:r,onRowClick:e.onRowClick,isSelected:!!e.isSelected,isFilterMatched:!0,isVisible:!0,onCheckerDisabled:e.onCheckerDisabled,onDraggerDisabled:e.onDraggerDisabled,draggerIndex:r}),l}),toSafetyData:t=>{var l,a;let{header:e=[]}=t,r={datagridID:t.datagridID||ge(),sessionID:ge(),body:b.toSafetyBody(t.body||[]),filter:{keyword:t.defaultSearchKey||"",current:[]},sort:{col:-1,dir:1},paging:{rows:t.maxRows||100,total:1,current:1},draggable:!!e.some(d=>d.draggable)};{let d=e==null?void 0:e.findIndex(c=>c.defSort);d!==-1&&(r.sort.col=d,r.sort.dir=(a=(l=e[d])==null?void 0:l.sortable)!=null?a:1)}return r.draggable&&(r.sort.col=-1,r.sort.dir=0),b.updateRowMeta(r,t)},updateRowMeta:(t,e)=>{var l;let r=n({},t);if(r.sort.col>=0&&r.sort.dir){let a=((l=e.header[r.sort.col])==null?void 0:l.key)||"";r.sort.dir==1?r.body.toASC(a+".sortKey"):r.body.toDESC(a+".sortKey")}{let a=String(r.filter.keyword)||"";r.body.forEach(d=>{if(d.isFilterMatched=!0,!a)return;let c=e.header.some(g=>{var f;let i=d[g.key];return!i||!i.sortKey?!1:!!((f=String(i.sortKey||i.data))!=null&&f.match(new RegExp(a.escapeRegExChar(),"i")))});d.isFilterMatched=c})}{let a=r.paging.rows;r.paging.total=Math.ceil(r.body.filter(i=>i.isFilterMatched).length/a);let d=a*(r.paging.current-1),c=d+a,g=0;r.body.forEach(i=>{i.isVisible=!1,i.isFilterMatched&&(i.isVisible=g>=d&&g<c,g++)})}return r.draggable&&r.body.toASC("draggerIndex"),r},index:t=>{var s,f,v,x;let[e,r]=Re(()=>b.toSafetyData(t));se(()=>{ne.set({["reset-"+e.datagridID]:()=>{r(b.toSafetyData(t))},["refresh-"+e.datagridID]:()=>{r(y=>b.updateRowMeta(p(n({},y),{body:b.toSafetyBody(t.body)}),t))}})},[t]),se(()=>{ne.set({["rows-"+e.datagridID]:e.body}),ie.bridge(e.datagridID,{val_config:e,remoteUpdate:{paging:y=>{r(m=>b.updateRowMeta(p(n({},m),{paging:p(n({},m.paging),{current:Math.max(1,Math.min(m.paging.total,y))})}),t))},maxRow:y=>{r(m=>b.updateRowMeta(p(n({},m),{paging:p(n({},m.paging),{rows:y,current:1})}),t))},searchKey:y=>{u.interval.once(()=>{r(m=>{let w=p(n({},m),{paging:p(n({},m.paging),{current:1}),filter:p(n({},m.filter),{keyword:String(y||"").trim()})});return b.updateRowMeta(w,t)})},300,"InputSearchTime")}}})},[e]);const l=me.useRef(!1);se(()=>{if(t.onSelected){if(!l.current){l.current=!0;return}t.onSelected(e.body.filter(y=>y.isSelected))}},[(s=e==null?void 0:e.body)==null?void 0:s.filter(y=>y.isSelected).length]);const a=me.useRef(!1);se(()=>{if(t.onSorted){if(!a.current){a.current=!0;return}t.onSorted(e.sort.col,e.sort.dir)}},[(f=e==null?void 0:e.sort)==null?void 0:f.col,(v=e==null?void 0:e.sort)==null?void 0:v.dir]);let d={input:t,val_config:e,set_config:r},{className:c,style:g}=Te(t),i=(x=t.colLength)!=null?x:t.header.length;return o(K,{className:c,style:g,children:o(D.Table,{className:Me("DataGrid"),borderRadius:"inherit",children:$(D.Body,{children:[o(b.Header,n({},d)),o(b.Body,n({},d)),o(b.Footer,n({},d))]})},[i,...t.header.map(y=>y.key),e.sessionID].join("."))})},Checker:t=>o(K,{flexCenter:!0,onClick:e=>{e.stopPropagation()},children:o(E.Checker,p(n({wrapStyles:{display:"inlineBlock"},cellStyles:{gap:0}},t),{label:!1}))}),Header:t=>{var i,s,f,v;let{input:e,val_config:r,set_config:l}=t;if(e.headerless)return null;let a="datagrid-dragger-"+r.datagridID,d=["datagrid",r.datagridID,""].join("-"),c=1+r.body.filter(x=>x.isVisible).length+ +!!e.footer,g=(i=e.colLength)!=null?i:e.header.length;return o(ye.DropArea,p(n({jsxElement:D.Row,id:d},e.rowStyles),{dragInfo:{type:a,id:String(((v=(f=(s=r.body)==null?void 0:s.filter(x=>x.isFilterMatched))==null?void 0:f[0])==null?void 0:v.draggerIndex)||0),marker:"bottom"},children:e.header.toASC("columnIdx").map((x,y)=>{var re,oe,le,k,j,F;let[m,w]=X(x),te=w,{isTH:S,key:C,label:M,onLabelRender:B,columnIdx:Y,checkable:N,draggable:J,defSort:de,sortable:P,filterable:A,isHidden:H}=te,T=G(te,["isTH","key","label","onLabelRender","columnIdx","checkable","draggable","defSort","sortable","filterable","isHidden"]);if(H)return null;let I={rowIdx:0,colIdx:y,topIdx:0,leftIdx:y,rightIdx:g-y-1,bottomIdx:c-1,isHeader:!0,isBody:!1,isFooter:!1},Z=J,V=P!=0,O=y==r.sort.col,Q=u.deepMerge(u.deepCopy(e.cellStyles),fe(I,{}),(re=e.cellStyles)==null?void 0:re.onHeader,!I.leftIdx&&((oe=e.cellStyles)==null?void 0:oe.onLeft),!I.rightIdx&&((le=e.cellStyles)==null?void 0:le.onRight),!I.topIdx&&((k=e.cellStyles)==null?void 0:k.onTop),!I.bottomIdx&&((j=e.cellStyles)==null?void 0:j.onBottom),m);e.onCellStyles&&(Q=e.onCellStyles(I,Q||{}));let U=[],ee=[];if(Z&&U.push(o(ce.Clear.S,{ssSphere:2.5,fontColor:"theme",onMouseOver:h=>{Ce.open(h.currentTarget,$(pe.Mini,{children:[o(_,{icon:Se}),"\u30C9\u30E9\u30C3\u30B0\u3067\u5217\u306E\u9806\u756A\u3092\u5909\u66F4"]}),22)},onMouseLeave:h=>Ce.abort(),onClick:h=>{h.stopPropagation()},children:o(_.QuestionCircle,{})},"drag")),N){let h=o(b.Checker,{value:r.body.every(R=>R.isSelected),onUpdateValue:R=>{l(L=>{let z=n({},L);return z.body.forEach(ae=>{ae.isFilterMatched&&(ae.onCheckerDisabled||(ae.isSelected=!!R))}),z})}},"check");N=="left"?U.push(h):ee.push(h)}return V&&U.push(o(_,{fontSize:"1.mini",fontColor:"theme",opacity:O?"max":"low",transition:"middle",xcss:{transform:O&&r.sort.dir==-1?"rotate(180deg)":"none"},icon:O?De:we},"sort")),o(D.Cell,p(n(n({isTH:!!S,ssPushable:!!P},X(Q||{})[0]),T),{className:[e.cellClassName,T.className].join(" "),onClick:h=>{T.onClick&&T.onClick(h),e.onCellClick&&e.onCellClick(I,h),V&&l(R=>{let L=n({},R);return L.sort={col:y,dir:O?R.sort.dir*-1:P},b.updateRowMeta(L,e)})},children:$(q.Left,{gap:"1/3",height:1,children:[U,(F=B==null?void 0:B(C))!=null?F:o(K,{flexSizing:0,children:M!=null?M:C}),ee]})}),[y,x.key].join("/"))})}))},Body:t=>{var g,i;let{input:e,val_config:r,set_config:l}=t,a=r.body.filter(s=>s.isVisible),d=+!e.headerless+a.length+ +!!e.footer,c=(g=e.colLength)!=null?g:e.header.length;return a.length?o(Pe,{children:a.map((s,f)=>{let{onCheckerDisabled:v,onDraggerDisabled:x}=s,y=f;e.headerless||(y+=1);let m="datagrid-dragger-"+r.datagridID,w=["datagrid",r.datagridID,s.row_id].join("-");return o(ye.DropArea,p(n(n({jsxElement:D.Row,position:"relative",id:w,ssPushable:!!e.onRowClick||!!s.onRowClick},xe.get().browserIs=="safari"&&{ssEffectsOnActive:"none"}),e.rowStyles),{onClick:S=>{s.onRowClick&&s.onRowClick(S),e.onRowClick&&e.onRowClick(s,S)},dragInfo:{type:m,id:String(s.row_id||""),disabled:!r.draggable,marker:"bottom"},children:e.header.toASC("columnIdx").map((S,C)=>{var U,ee,te,re,oe,le;let M=S.draggable,B=s[S.key];if(!B)return null;let[Y,N]=X(B),Q=N,{isTH:J,sortKey:de,data:P,label:A,onLabelRender:H}=Q,T=G(Q,["isTH","sortKey","data","label","onLabelRender"]),I={rowIdx:y,colIdx:C,topIdx:y,leftIdx:C,rightIdx:c-C-1,bottomIdx:d-y-1,isHeader:!1,isBody:!0,isFooter:!1},Z=u.deepMerge(u.deepCopy(e.cellStyles),fe(I,{}),(U=e.cellStyles)==null?void 0:U.onBody,!I.leftIdx&&((ee=e.cellStyles)==null?void 0:ee.onLeft),!I.rightIdx&&((te=e.cellStyles)==null?void 0:te.onRight),!I.topIdx&&((re=e.cellStyles)==null?void 0:re.onTop),!I.bottomIdx&&((oe=e.cellStyles)==null?void 0:oe.onBottom),Y);e.onCellStyles&&(Z=e.onCellStyles(I,Z||{}));let V=[],O=[];return u.scope(()=>{if(M){if(s.onDraggerDisabled){V.push(s.onDraggerDisabled());return}V.push(o(ce.Clear.S,{tabIndex:-1,isRounded:!0,ssSphere:2.5,fontColor:"6.clear",onPointerDown:k=>{let j=u("#"+w)[0],F=j.cloneNode(!0);F.style.width=j.offsetWidth+"px",ye.Start(m,{dragElement:F,startEvent:k,originId:w,horizontal:!1},h=>be(void 0,null,function*(){if(!h.end||!h.onDropArea)return;let R=[...r.body],L=R.findIndex(W=>W.row_id==s.row_id);if(L==-1)return;let z=R.findIndex(W=>W.row_id==h.id);if(z<L&&z++,L==z)return;let ae=R.splice(L,1)[0];R.splice(z,0,ae),R.forEach((W,Ie)=>{W.draggerIndex=Ie}),e.onDragged&&e.onDragged(R),l(W=>p(n({},W),{body:R}))}))},children:o(q.Center,{gap:"1/4",children:o(_,{icon:Se})})},"drag"))}}),u.scope(()=>{if(!S.checkable)return;let k=o(b.Checker,{override:"force",value:!!s.isSelected,onUpdateValue:j=>{l(F=>p(n({},F),{body:F.body.map(h=>(h.row_id==s.row_id&&(h.isSelected=!!j),h))}))}},"check");s.onCheckerDisabled&&(k=s.onCheckerDisabled()),S.checkable=="left"?V.push(k):O.push(k)}),o(D.Cell,p(n(n({isTH:!!J},X(Z||{})[0]),T),{className:[e.cellClassName,T.className].join(" "),onClick:k=>{T.onClick&&T.onClick(k),e.onCellClick&&e.onCellClick(I,k)},children:$(q.Left,{gap:"1/3",height:1,children:[V,(le=H==null?void 0:H(P))!=null?le:o(K,{flexSizing:0,children:he(A!=null?A:String(P),r.filter.keyword)}),O]})}),[C,S.key].join("/"))})}),[s.row_id,y].join("."))})}):o(D.Row,p(n({},e.rowStyles),{children:o(D.Cell,{colSpan:c,padding:1,children:(i=e.onNoRecordsRender)==null?void 0:i.call(e)})}))},Footer:t=>{var c;let{input:e,val_config:r,set_config:l}=t;if(!e.footer)return null;let a=+!e.headerless+r.body.filter(g=>g.isVisible).length+1,d=(c=e.colLength)!=null?c:e.header.length;return o(D.Row,p(n({},e.rowStyles),{children:e.header.toASC("columnIdx").map((g,i)=>{var Y,N,J,de,P,A,H;let s=e.footer[g.key];if(!s)return null;u.isRecord(s)||(s={data:s});let[f,v]=X(s),B=v,{isTH:x,data:y,label:m,onLabelRender:w}=B,S=G(B,["isTH","data","label","onLabelRender"]),C={rowIdx:a-1,colIdx:i,topIdx:a-1,leftIdx:i,rightIdx:d-i-1,bottomIdx:0,isHeader:!1,isBody:!1,isFooter:!0},M=u.deepMerge(u.deepCopy(e.cellStyles),fe(C,{}),(Y=e.cellStyles)==null?void 0:Y.onBody,(N=e.cellStyles)==null?void 0:N.onFooter,!C.leftIdx&&((J=e.cellStyles)==null?void 0:J.onLeft),!C.rightIdx&&((de=e.cellStyles)==null?void 0:de.onRight),!C.topIdx&&((P=e.cellStyles)==null?void 0:P.onTop),!C.bottomIdx&&((A=e.cellStyles)==null?void 0:A.onBottom),f);return e.onCellStyles&&(M=e.onCellStyles(C,M||{})),o(D.Cell,p(n(n({isTH:!!x},X(M||{})[0]),S),{className:[e.cellClassName,S.className].join(" "),onClick:T=>{S.onClick&&S.onClick(T),e.onCellClick&&e.onCellClick(C,T)},children:o(K,{flexSizing:0,children:(H=w==null?void 0:w(y))!=null?H:he(m!=null?m:String(y),r.filter.keyword)})}),[i,g.key].join("/"))})}))}},fe=(t,e)=>{let r=n({},e);return t.topIdx||(r.borderTop="unset"),t.bottomIdx||(r.borderBottom="unset"),t.rightIdx||(r.borderRight="unset"),t.leftIdx||(r.borderLeft="unset"),t.topIdx||(t.leftIdx||(r.borderTopLeftRadius="inherit"),t.rightIdx||(r.borderTopRightRadius="inherit")),t.bottomIdx||(t.leftIdx||(r.borderBottomLeftRadius="inherit"),t.rightIdx||(r.borderBottomRightRadius="inherit")),r},Be=t=>(t=n({datagridID:ge(),tone:"border",maxRows:100,onNoRecordsRender:()=>o(q.Center,{children:o(pe.Mini,{fontColor:"4.thin",children:"(\u30C7\u30FC\u30BF\u306A\u3057)"})})},t),t.rowStyles=n({backgroundColor:"layer.0"},t.rowStyles),t.cellStyles=n(p(n({},u.scope(()=>{if(!t.tone)return{};let e={};return u.isOneOf(t.tone,"border","border.horizontal")&&(e.borderBottom="2.normal"),u.isOneOf(t.tone,"border","border.vertical")&&(e.borderRight="2.normal"),e})),{position:"relative",padding:["1/3","2/3"],transition:"short"}),t.cellStyles),t.tone&&(t=n({border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"},t)),t.header=b.toSafetyHeader(t.header||[]),t.header.forEach((e,r)=>{var l;e.sortable=(l=e.sortable)!=null?l:1,e.checkable===!0&&(e.checkable="left")}),o(b.index,n({},t))),ue={getBodyRows:t=>ne.get("rows-"+t)||[],toSafetyBody:b.toSafetyBody,reset:t=>{var e;(e=ne.get("reset-"+t))==null||e()},refreshBody:t=>{var e;(e=ne.get("refresh-"+t))==null||e()},reservedKeys:b.reservedKeys,Table:t=>o(K,p(n({htmlTag:"table",borderRadius:"inherit"},t),{border:t.border})),Head:t=>o(K,n({htmlTag:"thead",borderRadius:"inherit"},t)),Body:t=>o(K,n({htmlTag:"tbody",borderRadius:"inherit"},t)),Row:t=>o(K,n({htmlTag:"tr",borderRadius:"inherit"},t)),TH:t=>o(K,n({htmlTag:"th"},t)),TD:t=>o(K,n({htmlTag:"td"},t)),Cell:t=>{let l=t,{isTH:e}=l,r=G(l,["isTH"]);return e?o(ue.TH,n({},r)):o(ue.TD,n({},r))},RightIndicator:{data:"",label:o(q.Right,{children:o(_.AngleRight,{fontColor:"theme",fontSize:"3.paragraph"})})},SearchInput:t=>{let d=t,{datagridID:e}=d,r=G(d,["datagridID"]),l=ie.catch(t.datagridID);if(!l)return console.warn("[DataGrid] SearchInput must be used inside DataGrid."),null;let{val_config:a}=l;return o(E.TextField,p(n({label:"\u691C\u7D22...",clearButton:!0,padding:["1/2","2/3"],rightIcon:o(E.RightIcon,{ssSphere:2,fontColor:"5.translucent",right:"2/3",children:o(_.Search,{})}),value:a.filter.keyword},r),{onUpdateValidValue:(...c)=>{r.onUpdateValidValue&&r.onUpdateValidValue(...c),l.remoteUpdate.searchKey(c[0])}}))},Info:t=>{let e=ie.catch(t.datagridID);if(!e)return null;let{val_config:r}=e,l=t.totalCount||r.body.length,a=r.body.filter(c=>c.isFilterMatched).length,d=a.toRate(l,1)||0;return $(ke,{verticalAlign:"baseline",gap:"1/2",fontSize:"1.mini",fontColor:"3.blur",children:[o(Ke,{fontSize:"4.thirdTitle",fontColor:"theme",children:a.toLocaleString()}),"/ ",l.toLocaleString(),"\u4EF6 (",d,"%)"]})},Paging:t=>{let g=t,{datagridID:e}=g,r=G(g,["datagridID"]),l=ie.catch(e);if(!l)return null;let{val_config:a}=l,d=[];for(let i=0;i<a.paging.total;i++)d.push({value:i+1,label:(i+1).toString()});const c=i=>{let s=Math.min(Math.max(1,i),a.paging.total),f=n({},a);f.paging.current=s,l.remoteUpdate.paging(s)};return o(E.Select,p(n({emptySelect:!1,padding:["1/3","2/3"],override:"force",gap:0},r),{leftIcon:o(E.LeftIcon,{xcss:{left:2,pointerEvents:"all"},children:o(ce.Sub.S,{color:"cloud",fontColor:"4.thin",ssSquare:2.5,unitWidth:2,onClick:()=>{if(a.paging.current==1){c(a.paging.total);return}c(a.paging.current-1)},children:o(_.ChevronLeft,{})})}),rightIcon:o(E.RightIcon,{xcss:{right:2,pointerEvents:"all"},children:o(ce.Sub.S,{color:"cloud",fontColor:"4.thin",ssSquare:2.5,unitWidth:2,onClick:()=>{if(a.paging.current==a.paging.total){c(1);return}c(a.paging.current+1)},children:o(_.ChevronRight,{})})}),options:d.map(i=>({value:i.value||0,label:$(q.Left,{gap:"1/3",verticalAlign:"baseline",children:[i.label,$(pe.Micro,{fontColor:"4.thin",children:["/ ",a.paging.total]})]})})),value:a.paging.current,onUpdateValidValue:i=>{c(i)}}))},RowCount:t=>{let s=t,{datagridID:e}=s,r=G(s,["datagridID"]),l=ie.catch(e);if(!l)return null;let{val_config:a}=l,d=a.body.filter(f=>f.isFilterMatched).length,c=a.paging.rows,g=0,i=t.options.map(f=>(g|=+(f==c),{value:f,label:f.toString()}));return g||i.push({value:c,label:c.toString()}),o(q.Center,{gap:"1/2",children:o(E.Select,p(n({emptySelect:!1,override:"force",padding:"1/3",paddingLeft:3,paddingRight:2,pickerStyles:{xcss:{minWidth:12*9}},pickerPosition:4,leftIcon:o(E.LeftIcon,{fontSize:"0.xs",fontColor:"4.thin",xcss:{left:6},children:"\u8868\u793A"}),rightIcon:o(E.RightIcon,{fontSize:"0.xs",fontColor:"4.thin",xcss:{right:6},children:"\u4EF6"})},r),{value:a.paging.rows,options:i.toASC("value"),onUpdateValidValue:f=>{l.remoteUpdate.maxRow(Number(f))}}))})}},D=Object.assign(Be,ue);export{D as DataGrid,D as default,fe as onDefaultCellStyles};
@@ -1 +1 @@
1
- import{b as p,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 R}from"react";import{Box as T,Grid as J,FAI as B,Column as L,FlexMargin as P}from"../../../atoms";import{Row as C,Literal as h}from"../../../mols";import{Button as x}from"../../Trigger";import _ from"../../Sheet";import Y from"../Select";import{LeftIcon as X,RightIcon as N}from"..";import{InputTimeClasses as V}from"../../../@styles/componentClasses";import F from"../Drum";const j=t=>{let{restrict:l}=t;return l=="year"?e(y.Year,p({},t)):l=="month"?e(y.Month,p({},t)):l=="week"?"[DEV]":l=="date"?e(y.Date,p({},t)):l=="locale.jp.warekiDate"?e(y.Locale.JP.WarekiDate,p({},t)):l=="clock"?e(y.Clock,p({},t)):l=="period.clock"?e(y.Period.Clock,p({},t)):l=="period.month"?e(y.Period.Month,p({},t)):l=="period.date"?e(y.Period.Date,p({},t)):null},y={YearOptions:t=>{var u,i,n;let l=[],v=(u=t==null?void 0:t.min)!=null?u:1900,o=(i=t==null?void 0:t.max)!=null?i:d().addYear(10).year;for(let a=v;a<=o;a++){let r=[a],[m,s]=S.transformer.wareki(a).value;((n=t.showJPWareki)==null||n)&&(m&&r.push(e(h.Micro,{fontColor:"4.thin",children:m},1)),s&&r.push(f(h.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 R(()=>{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 R(()=>{localStorage.setItem("@env/input/time/selector/clock/minutesUnit",String(t))},[t]),[t,l]},remoteControl:function(t){let{restrict:l,pickerId:v,val_value:o,set_value:u}=t;R(()=>{v&&W.set({[v]:{onClear:()=>{if(l.match(/period\./)){u(i=>g(p({},i),{eventType:"commit",forcus:0,display:d(),from:d(null),to:d(null)}));return}u(i=>g(p({},i),{eventType:"commit",from:d(null)}))},onConfirm:()=>{u(i=>g(p({},i),{eventType:"commit"}))}}})},[])},Year:t=>{let{min:l,max:v}=t,[o,u]=D(S.scope(()=>{let[i]=String(t.defaultValue).split(/\D/);return{eventType:"init",from:d().setYear(Number(i||d().year))}}));return y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{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(h.Paragraph,{children:[o.from.year||"----","\u5E74"]}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();u({eventType:"update",from:i})},children:"\u4ECA\u5E74"}),e(P,{})]}),e(T,{borderTop:!0}),e(F,{override:"force",value:o.from.year||null,options:y.YearOptions({min:Number(l)||void 0,max:Number(v)||void 0}),onUpdateValidValue:i=>{u(n=>({eventType:"update",from:n.from.clone().setYear(Number(i))}))}})]})},Month:t=>{let{min:l,max:v}=t,[o,u]=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 y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{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(h.Paragraph,{children:o.from.toFormatYM("JP")||"----/--"}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();u({eventType:"update",from:i,display:i})},children:"\u4ECA\u6708"}),e(P,{})]}),e(T,{borderTop:!0}),e(y.Parts.DrumSelector,{type:"month",min:l,max:v,value:o.from,onChange:i=>{u(g(p({},o),{eventType:"update",from:i}))}})]})},Date:t=>{let{min:l,max:v}=t,[o,u]=y.calendartypeState(),[i,n]=D(S.scope(()=>{var b;let[a,r,m]=(b=String(t.defaultValue))==null?void 0:b.split(/\D/);(S.isNullish(a)||S.isNullish(r)||S.isNullish(m))&&([a,r,m]=d().toFormat("%Y-%M-%D").split("-"));let s=d(),c=d([Number(a)||s.year,(Number(r)||s.month).zeroEmbed(2),(Number(m)||s.date).zeroEmbed(2)].join("/"));return{eventType:"init",era:"year",display:c,from:c}}));return y.remoteControl(g(p({},t),{val_value:i,set_value:n})),R(()=>{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(h.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:()=>{u(a=>a=="calendar"?"drum":"calendar")},children:[o=="calendar"&&"\u30C9\u30E9\u30E0",o=="drum"&&"\u30AB\u30EC\u30F3\u30C0\u30FC","\u8868\u793A"]})]}),e(T,{borderTop:!0}),o=="calendar"&&f($,{children:[f(C.Center,{gap:"1/2",children:[e(Y,{override:"force",emptySelect:!1,value:i.display.year,options:y.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(p({},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(p({},r),{eventType:"update",display:r.display.clone().setMonth(Number(a))}))}}),e(y.Parts.ShiftButtons,{callback:a=>{n(r=>g(p({},r),{eventType:"update",display:r.display.clone().addMonth(a)}))}})]}),f(L,{children:[e(T,{margin:"auto",xcss:{minWidth:"50%"},UnderBreakPointStyles:{margin:0},children:y.Parts.Calendar({min:l,max:v,onTitleRender:a=>"",targetMonth:i.display,from:i.from,onChange:a=>{n(r=>g(p({},r),{eventType:"update",from:a}))}})}),e(T,{unitHeight:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1,ssHiddenOnBreak:!0}),f(C.Center,{verticalAlign:"unset",ssHiddenOnBreak:!0,children:[e(T,{flexSizing:0,children:y.Parts.Calendar({min:l,max:v,onTitleRender:a=>e(h.Mini,{children:f(C.Center,{gap:"1/2",children:[e(h,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(h,{fontColor:"4.thin",children:"[\u524D\u6708]"})]})}),targetMonth:i.display.clone().addMonth(-1),from:i.from,onChange:a=>{n(r=>g(p({},r),{eventType:"update",from:a}))}})}),e(T,{unitWidth:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1}),e(T,{flexSizing:0,children:y.Parts.Calendar({min:l,max:v,onTitleRender:a=>e(h.Mini,{children:f(C.Center,{gap:"1/2",children:[e(h,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(h,{fontColor:"4.thin",children:"[\u7FCC\u6708]"})]})}),targetMonth:i.display.clone().addMonth(1),from:i.from,onChange:a=>{n(r=>g(p({},r),{eventType:"update",from:a}))}})})]})]})]}),o=="drum"&&e(y.Parts.DrumSelector,{type:"date",min:l,max:v,value:i.from,onChange:a=>{n(g(p({},i),{eventType:"update",from:a}))}})]})},Locale:{JP:{WarekiDate:t=>{var n;let{min:l,max:v}=t,[o,u]=D(S.scope(()=>{var M;let[a,r,m]=(M=String(t.defaultValue))==null?void 0:M.split(/\D/),s=t.era||"year";if(S.isNullish(a)||S.isNullish(r)||S.isNullish(m)){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,m]=k.toFormat("%Y-%M-%D").split("-")}let c=d();return{eventType:"init",from:d([Number(a)||c.year,(Number(r)||c.month).zeroEmbed(2),(Number(m)||c.date).zeroEmbed(2)].join("/"))}}));y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{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(h.Paragraph,{children:[o.from.warekiLabel,(n=o.from.warekiYear)==null?void 0:n.zeroEmbed(2),"\u5E74",o.from.toFormatMD("JP")]}),e(P,{})]}),e(T,{borderTop:!0}),e(C.Left,{gap:"1/2",flexWrap:!0,children:["reiwa","heisei","showa","taisho","meiji"].map((a,r)=>{let m=i[a];return m?e(x.Border.S,{onClick:()=>{let s=o.from;if(a=="reiwa"||a=="year")s=d();else{let c=d(m.min),b=d(m.max);c.value>o.from.value&&(s=c),o.from.value>b.value&&(s=b)}if(l){let c=d(l);s.value<c.value&&(s=c)}if(v){let c=d(v);c.value<s.value&&(s=c)}u(g(p({},o),{eventType:"update",from:s}))},children:m.label},r):null})}),e(y.Parts.DrumSelector,{type:"locale.jp.warekiDate",min:t.min,max:t.max,value:o.from,onChange:a=>{u(g(p({},o),{eventType:"update",from:a}))}})]})}}},Clock:t=>{let[l,v]=D(S.scope(()=>{let r=String(t.defaultValue).split(/[^\d]/);if(!r[0]){let c=d();r=[c.hours,c.minutes]}let m=Number(r[0]),s=Number(r[1]);return{eventType:"init",from:d().setHours(m).setMinutes(s)}}));y.remoteControl(g(p({},t),{val_value:l,set_value:v})),R(()=>{t.onValueUpdate({value:l.from.toFormatHM(),era:"clock",eventType:l.eventType})},[l]);let[o,u]=y.minutesUnitState(),i=d().setFromFormatHHMM(t.min||"00:00"),n=d().setFromFormatHHMM(t.max||"23:59");const a=(r,m)=>{v(s=>{let c=s.from.clone();return S.isExist(r)&&c.setHours(r),S.isExist(m)&&c.setMinutes(m),c.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(c=n.clone()),c.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(c=i.clone()),g(p({},s),{eventType:"update",from:c})})};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(T,{className:V("ClockBase"),children:e(T,{className:V("ClockUiBase"),flexCenter:!0,children:f(T,{className:V("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[e(T,{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(T,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[V("Needle"),V("minute")].join(" "),xcss:{transform:`rotate(${l.from.minutes*6}deg)`}})]})})}),f(T,{textAlign:"center",fontHeight:1.2,children:[f(h.Paragraph,{children:[l.from.hours.zeroEmbed(2)," : ",l.from.minutes.zeroEmbed(2)]}),f(h.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=>{u(r||1)}})]}),e(T,{borderTop:!0}),f(C.Center,{gap:"1/2",children:[e(F,{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 m=l.from.hours%12+r;a(m)}}),e(F,{override:"force",value:l.from.hours,options:Array.from({length:24}).map((r,m)=>{let s=m;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)}}),onUpdateValidValue:r=>{a(r)}}),e(h,{isSemiBoldFont:!0,children:"\u6642"}),e(F,{override:"force",value:l.from.minutes,options:Array.from({length:60}).map((r,m)=>{let s=m;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(h,{isSemiBoldFont:!0,children:"\u5206"})]})]})},Period:{Clock:t=>{let[l,v]=y.minutesUnitState(),[o,u]=D(S.scope(()=>{let[r,m]=S.Arrayify(t.defaultValue),s=d().setFromFormatHHMM(r||"09:00"),c=d().setFromFormatHHMM(m||"18:00");return{eventType:"init",forcus:0,display:s,from:s,to:c}}));y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){u(m=>g(p({},m),{eventType:"update",from:m.to,to:m.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,m,s)=>{u(c=>{let b=c[r].clone();return S.isExist(m)&&b.setHours(m),S.isExist(s)&&b.setMinutes(s),b.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(b=n.clone()),b.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(b=i.clone()),g(p({},c),{eventType:"update",[r]:b})})};return f(L,{width:1,xcss:{minWidth:12*24},children:[f(C.Left,{flexWrap:!0,children:[f(C.Left,{gap:"1/2",children:[e(h.Paragraph,{children:o.from.toFormatHM()||"--:--"}),e(h.Mini,{children:"-"}),e(h.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=>{v(r||1)}})]}),e(T,{borderBottom:"1.thin"}),e(y.Period.Preset,g(p({},t),{onPreset:(r,m)=>{u({eventType:"update",forcus:0,display:d(r),from:d(r),to:d(m)})}})),f(C.Center,{gap:"1/2",children:[e(F,{override:"force",value:o.from.hours,options:Array.from({length:24}).map((r,m)=>{let s=m;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:r=>{a("from",r)}}),e(F,{override:"force",value:o.from.minutes,options:Array.from({length:60}).map((r,m)=>{let s=m;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(h,{isSemiBoldFont:!0,children:"~"}),e(F,{override:"force",value:o.to.hours,options:Array.from({length:24}).map((r,m)=>{let s=m;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:r=>{a("to",r)}}),e(F,{override:"force",value:o.to.minutes,options:Array.from({length:60}).map((r,m)=>{let s=m;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:v}=t,[o,u]=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 y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){u(n=>g(p({},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(h.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:0}))},children:[o.from.toFormatYMD()||"----/--/--",o.forcus==0&&e(y.Parts.PeriodFocusSign,{})]}),e(h.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:1}))},children:[o.to.toFormatYMD()||"----/--/--",o.forcus==1&&e(y.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:y.YearOptions({reverse:!0}),value:o.display.year,onUpdateValidValue:i=>{u(n=>g(p({},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=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().setMonth(Number(i)).setDate(1)}))}}),e(y.Parts.ShiftButtons,{callback:i=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().addMonth(i)}))}})]})]}),e(T,{borderBottom:"1.thin"}),e(y.Period.Preset,g(p({},t),{onPreset:(i,n)=>{u({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=y.Parts.Calendar({min:l,max:v,targetMonth:o.display.clone().addMonth(n-1),from:o.from,to:o.to,onTitleRender:r=>{let m=r.diff(o.display).months;return e(h.Mini,{ssHiddenOnBreak:!0,children:f(C.Center,{gap:"1/2",children:[e(h,{isSemiBoldFont:!0,children:r.toFormatYM("JP")}),e(h,{fontColor:"4.thin",children:["[\u524D\u6708]","","[\u7FCC\u6708]","[\u7FCC\u3005\u6708]"][m+1]})]})})},onChange:r=>{if(o.forcus==0){u(m=>g(p({},m),{eventType:"update",forcus:1,from:r,to:d(null)}));return}u(m=>g(p({},m),{eventType:"update",to:r}))}});return e(T,{flexSizing:"auto",ssHiddenOnBreak:n!=1,children:a},n)})})]})},Month:t=>{let{min:l,max:v}=t,[o,u]=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 y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){u(n=>g(p({},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(h.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:0}))},children:[o.from.toFormatYM("JP")||"----/--",o.forcus==0&&e(y.Parts.PeriodFocusSign,{})]}),e(h.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:1}))},children:[o.to.toFormatYM("JP")||"----/--",o.forcus==1&&e(y.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:y.YearOptions({reverse:!0}),value:o.display.year,onUpdateValidValue:i=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().setYear(Number(i))}))}}),e(y.Parts.ShiftButtons,{callback:i=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().addYear(i)}))}})]})]}),e(T,{borderBottom:"1.thin"}),e(y.Period.Preset,g(p({},t),{onPreset:(i,n)=>{u({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=y.Parts.YearCalendar({min:l,max:v,targetYear:o.display.year+n-1,from:o.from.getFirstDayOfMonth(),to:o.to.getLastDayOfMonth(),onTitleRender:r=>{let m=r-o.display.year;return e(h.Mini,{children:f(C.Left,{gap:"1/2",children:[f(h,{isSemiBoldFont:!0,children:[r,"\u5E74"]}),e(h,{fontColor:"4.thin",children:["[\u524D\u5E74]","","[\u7FCC\u5E74]","[\u7FCC\u3005\u5E74]"][m+1]})]})})},onChange:r=>{if(o.forcus==0){u(m=>g(p({},m),{eventType:"update",forcus:1,from:r,to:d(null)}));return}u(m=>g(p({},m),{eventType:"update",to:r}))}});return e(T,{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,v)=>e(x.Border.S,{padding:["1/4",1],onClick:()=>{t.onPreset(l.from,l.to)},children:l.label},v))}):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:v,to:o,onTitleRender:u=k=>e(h.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,m=[],s=[],c=[],b=[];for(var M=0;M<7;M++){let k=M==6,w=M==0;m.push(e(h.Micro,{textAlign:"center",fontColor:k?"googleBlue":w?"googleRed":"inherit",children:S.transformer.weekday.shortJP(M)},M))}for(var M=0;M<n.weekday;M++)s.unshift(e(h.Mini,{fontColor:"4.thin",flexCenter:!0,children:r-M},M));for(var M=1;M<=a.date;M++){let w=l.clone().setDate(M),E=v.isSameDate(w),z=!1,H=!1;o&&o.validate&&(z=w.isInRange(v,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)}c.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:[M,G&&e(y.Parts.CurrentSign,{})]},w.toFormatYMD()))}for(var M=1;M<7-a.weekday;M++)b.push(e(h.Mini,{flexCenter:!0,fontColor:"4.thin",children:M},M));return f(L,{gap:"1/2",children:[u(l)||"",f(J,{gridCols:7,gap:"1/6",children:[m,s,c,b]})]},l.toFormatYM())},YearCalendar:t=>{let{targetYear:l,from:v,to:o,onTitleRender:u=a=>f(h.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),m=!1;if(t.min){let k=d(t.min).getLastDayOfMonth();k&&r.value<k.value&&(m=!0)}if(t.max){let k=d(t.max).getLastDayOfMonth();k&&k.value<r.value&&(m=!0)}let s=v.year==l&&v.month==r.month,c=!1,b=!1;o&&o.validate&&(c=r.isInRange(v,o),b=o.year==l&&o.month==r.month);let M=i.year==l&&i.month==r.month;n.push(f(x.Clear.S,{isLocked:m,color:"cloud",border:"1.thin",isActive:s||b||c,isActiveStyles:s||b?{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(h,{children:r.month}),e(h.Mini,{opacity:"middle",children:["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month]})]}),M&&e(y.Parts.CurrentSign,{})]},l+"-"+r.month))}return f(L,{gap:"1/2",children:[u(t.targetYear),e(J,{flexWrap:!0,gridCols:4,gap:"1/6",children:n})]},t.targetYear)},DrumSelector:t=>{let{type:l,min:v,max:o,value:u}=t;const i=(r,m,s)=>{let c=t.value.clone();if(S.isExist(r)&&(c=c.setYear(r)),S.isExist(m)&&(c=c.setMonth(m)),S.isExist(s)&&(c=c.setDate(s)),v){let b=d(v);c.value<b.value&&(c=b)}if(o){let b=d(o);b.value<c.value&&(c=b)}t.onChange(c)};let n=u.getFirstDayOfMonth(),a=u.getLastDayOfMonth().date;return f(C.Center,{gap:"1/2",children:[e(F,{override:"force",options:y.YearOptions({}),value:u.year,onUpdateValidValue:r=>{i(Number(r))}}),e(h,{isSemiBoldFont:!0,children:"\u5E74"}),e(F,{override:"force",options:Array.from({length:12}).map((r,m)=>{let s=m+1;return{value:s,label:s}}),value:u.month,onUpdateValidValue:r=>{i(void 0,Number(r))}}),e(h,{isSemiBoldFont:!0,children:"\u6708"}),l!="month"&&f($,{children:[e(F,{override:"force",options:Array.from({length:31}).map((r,m)=>{let s=m+1,c=(n.weekday+m)%7;return s>a?null:{value:s,label:f(C.Right,{gap:"1/4",children:[e(h,{children:s}),f(h.Micro,{fontColor:c==0?"googleRed":c==6?"googleBlue":"4.thin",children:["(",S.transformer.weekday.shortJP(c),")"]})]})}}),value:u.date,onUpdateValidValue:r=>{i(void 0,void 0,Number(r))}},[u.year,u.month].join("-")),e(h,{isSemiBoldFont:!0,children:"\u65E5"})]})]})},MinMax:t=>{let{restrict:l,min:v,max:o}=t;if(!v&&!o)return null;let u=d(v||null),i=d(o||null),n="",a="";return l=="year"?(n=u.toFormat("%Y\u5E74"),a=i.toFormat("%Y\u5E74")):l.match(/month/)?(n=u.toFormatYM(),a=i.toFormatYM()):l.match(/date/)?(n=u.toFormatYMD(),a=i.toFormatYMD()):l.match(/clock/)&&(u=d().setFromFormatHHMM(v||""),i=d().setFromFormatHHMM(o||""),n=u.toFormatHM(),a=i.toFormatHM()),f(h.Micro,{fontHeight:1.2,children:[n&&f(h,{children:["\u6700\u5C0F: ",n]}),a&&f(h,{children:["\u6700\u5927: ",a]})]})},CurrentSign:()=>e(T,{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(T,{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,v=null,o="init",u="L";t.restrict=="year"&&(u="S"),t.restrict=="month"&&(u="S"),t.restrict=="clock"?u="XS":(t.restrict=="locale.jp.warekiDate"||t.restrict=="period.clock")&&(u="S");let i=t.sheetID||O(),n=t.pickerId||O();_.open("middleCenter",{sheetID:i,size:u,padding:[2,0],closeAtAroundClick:!0,closeAtParentBlur:!1,onClose:()=>{o!="commit"&&t.onValueUpdate({value:l,era:v,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&&t.onValueUpdate(a),l=a.value,v=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(h.Micro,{children:"\u30EA\u30BB\u30C3\u30C8"})]})}),e(y.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};
1
+ import{b as p,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 R}from"react";import{Box as T,Grid as J,FAI as B,Column as L,FlexMargin as P}from"../../../atoms";import{Row as C,Literal as h}from"../../../mols";import{Button as x}from"../../Trigger";import _ from"../../Sheet";import Y from"../Select";import{LeftIcon as X,RightIcon as N}from"..";import{InputTimeClasses as V}from"../../../@styles/componentClasses";import F from"../Drum";const j=t=>{let{restrict:l}=t;return l=="year"?e(y.Year,p({},t)):l=="month"?e(y.Month,p({},t)):l=="week"?"[DEV]":l=="date"?e(y.Date,p({},t)):l=="locale.jp.warekiDate"?e(y.Locale.JP.WarekiDate,p({},t)):l=="clock"?e(y.Clock,p({},t)):l=="period.clock"?e(y.Period.Clock,p({},t)):l=="period.month"?e(y.Period.Month,p({},t)):l=="period.date"?e(y.Period.Date,p({},t)):null},y={YearOptions:t=>{var u,i,n;let l=[],v=(u=t==null?void 0:t.min)!=null?u:1900,o=(i=t==null?void 0:t.max)!=null?i:d().addYear(10).year;for(let a=v;a<=o;a++){let r=[a],[m,s]=S.transformer.wareki(a).value;((n=t.showJPWareki)==null||n)&&(m&&r.push(e(h.Micro,{fontColor:"4.thin",children:m},1)),s&&r.push(f(h.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 R(()=>{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 R(()=>{localStorage.setItem("@env/input/time/selector/clock/minutesUnit",String(t))},[t]),[t,l]},remoteControl:function(t){let{restrict:l,pickerId:v,val_value:o,set_value:u}=t;R(()=>{v&&W.set({[v]:{onClear:()=>{if(l.match(/period\./)){u(i=>g(p({},i),{eventType:"commit",forcus:0,display:d(),from:d(null),to:d(null)}));return}u(i=>g(p({},i),{eventType:"commit",from:d(null)}))},onConfirm:()=>{u(i=>g(p({},i),{eventType:"commit"}))}}})},[])},Year:t=>{let{min:l,max:v}=t,[o,u]=D(S.scope(()=>{let[i]=String(t.defaultValue).split(/\D/);return{eventType:"init",from:d().setYear(Number(i||d().year))}}));return y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{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(h.Paragraph,{children:[o.from.year||"----","\u5E74"]}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();u({eventType:"update",from:i})},children:"\u4ECA\u5E74"}),e(P,{})]}),e(T,{borderTop:!0}),e(F,{override:"force",value:o.from.year||null,options:y.YearOptions({min:Number(l)||void 0,max:Number(v)||void 0}),onUpdateValidValue:i=>{u(n=>({eventType:"update",from:n.from.clone().setYear(Number(i))}))}})]})},Month:t=>{let{min:l,max:v}=t,[o,u]=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 y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{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(h.Paragraph,{children:o.from.toFormatYM("JP")||"----/--"}),e(x.Border.XS,{fontColor:"theme",borderRadius:"2.tone.secondary",onClick:()=>{let i=d();u({eventType:"update",from:i,display:i})},children:"\u4ECA\u6708"}),e(P,{})]}),e(T,{borderTop:!0}),e(y.Parts.DrumSelector,{type:"month",min:l,max:v,value:o.from,onChange:i=>{u(g(p({},o),{eventType:"update",from:i}))}})]})},Date:t=>{let{min:l,max:v}=t,[o,u]=y.calendartypeState(),[i,n]=D(S.scope(()=>{var b;let[a,r,m]=(b=String(t.defaultValue))==null?void 0:b.split(/\D/);(S.isNullish(a)||S.isNullish(r)||S.isNullish(m))&&([a,r,m]=d().toFormat("%Y-%M-%D").split("-"));let s=d(),c=d([Number(a)||s.year,(Number(r)||s.month).zeroEmbed(2),(Number(m)||s.date).zeroEmbed(2)].join("/"));return{eventType:"init",era:"year",display:c,from:c}}));return y.remoteControl(g(p({},t),{val_value:i,set_value:n})),R(()=>{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(h.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:()=>{u(a=>a=="calendar"?"drum":"calendar")},children:[o=="calendar"&&"\u30C9\u30E9\u30E0",o=="drum"&&"\u30AB\u30EC\u30F3\u30C0\u30FC","\u8868\u793A"]})]}),e(T,{borderTop:!0}),o=="calendar"&&f($,{children:[f(C.Center,{gap:"1/2",children:[e(Y,{override:"force",emptySelect:!1,value:i.display.year,options:y.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(p({},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(p({},r),{eventType:"update",display:r.display.clone().setMonth(Number(a))}))}}),e(y.Parts.ShiftButtons,{callback:a=>{n(r=>g(p({},r),{eventType:"update",display:r.display.clone().addMonth(a)}))}})]}),f(L,{children:[e(T,{margin:"auto",xcss:{minWidth:"50%"},UnderBreakPointStyles:{margin:0},children:y.Parts.Calendar({min:l,max:v,onTitleRender:a=>"",targetMonth:i.display,from:i.from,onChange:a=>{n(r=>g(p({},r),{eventType:"update",from:a}))}})}),e(T,{unitHeight:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1,ssHiddenOnBreak:!0}),f(C.Center,{verticalAlign:"unset",ssHiddenOnBreak:!0,children:[e(T,{flexSizing:0,children:y.Parts.Calendar({min:l,max:v,onTitleRender:a=>e(h.Mini,{children:f(C.Center,{gap:"1/2",children:[e(h,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(h,{fontColor:"4.thin",children:"[\u524D\u6708]"})]})}),targetMonth:i.display.clone().addMonth(-1),from:i.from,onChange:a=>{n(r=>g(p({},r),{eventType:"update",from:a}))}})}),e(T,{unitWidth:"1/4",isRounded:!0,backgroundColor:"cloud",margin:1}),e(T,{flexSizing:0,children:y.Parts.Calendar({min:l,max:v,onTitleRender:a=>e(h.Mini,{children:f(C.Center,{gap:"1/2",children:[e(h,{isSemiBoldFont:!0,children:a.toFormatYM("JP")}),e(h,{fontColor:"4.thin",children:"[\u7FCC\u6708]"})]})}),targetMonth:i.display.clone().addMonth(1),from:i.from,onChange:a=>{n(r=>g(p({},r),{eventType:"update",from:a}))}})})]})]})]}),o=="drum"&&e(y.Parts.DrumSelector,{type:"date",min:l,max:v,value:i.from,onChange:a=>{n(g(p({},i),{eventType:"update",from:a}))}})]})},Locale:{JP:{WarekiDate:t=>{var n;let{min:l,max:v}=t,[o,u]=D(S.scope(()=>{var M;let[a,r,m]=(M=String(t.defaultValue))==null?void 0:M.split(/\D/),s=t.era||"year";if(S.isNullish(a)||S.isNullish(r)||S.isNullish(m)){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,m]=k.toFormat("%Y-%M-%D").split("-")}let c=d();return{eventType:"init",from:d([Number(a)||c.year,(Number(r)||c.month).zeroEmbed(2),(Number(m)||c.date).zeroEmbed(2)].join("/"))}}));y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{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(h.Paragraph,{children:[o.from.warekiLabel,(n=o.from.warekiYear)==null?void 0:n.zeroEmbed(2),"\u5E74",o.from.toFormatMD("JP")]}),e(P,{})]}),e(T,{borderTop:!0}),e(C.Left,{gap:"1/2",flexWrap:!0,children:["reiwa","heisei","showa","taisho","meiji"].map((a,r)=>{let m=i[a];return m?e(x.Border.S,{onClick:()=>{let s=o.from;if(a=="reiwa"||a=="year")s=d();else{let c=d(m.min),b=d(m.max);c.value>o.from.value&&(s=c),o.from.value>b.value&&(s=b)}if(l){let c=d(l);s.value<c.value&&(s=c)}if(v){let c=d(v);c.value<s.value&&(s=c)}u(g(p({},o),{eventType:"update",from:s}))},children:m.label},r):null})}),e(y.Parts.DrumSelector,{type:"locale.jp.warekiDate",min:t.min,max:t.max,value:o.from,onChange:a=>{u(g(p({},o),{eventType:"update",from:a}))}})]})}}},Clock:t=>{let[l,v]=D(S.scope(()=>{let r=String(t.defaultValue).split(/[^\d]/);if(!r[0]){let c=d();r=[c.hours,c.minutes]}let m=Number(r[0]),s=Number(r[1]);return{eventType:"init",from:d().setHours(m).setMinutes(s)}}));y.remoteControl(g(p({},t),{val_value:l,set_value:v})),R(()=>{t.onValueUpdate({value:l.from.toFormatHM(),era:"clock",eventType:l.eventType})},[l]);let[o,u]=y.minutesUnitState(),i=d().setFromFormatHHMM(t.min||"00:00"),n=d().setFromFormatHHMM(t.max||"23:59");const a=(r,m)=>{v(s=>{let c=s.from.clone();return S.isExist(r)&&c.setHours(r),S.isExist(m)&&c.setMinutes(m),c.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(c=n.clone()),c.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(c=i.clone()),g(p({},s),{eventType:"update",from:c})})};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(T,{className:V("ClockBase"),children:e(T,{className:V("ClockUiBase"),flexCenter:!0,children:f(T,{className:V("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[e(T,{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(T,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[V("Needle"),V("minute")].join(" "),xcss:{transform:`rotate(${l.from.minutes*6}deg)`}})]})})}),f(T,{textAlign:"center",fontHeight:1.2,children:[f(h.Paragraph,{children:[l.from.hours.zeroEmbed(2)," : ",l.from.minutes.zeroEmbed(2)]}),f(h.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=>{u(r||1)}})]}),e(T,{borderTop:!0}),f(C.Center,{gap:"1/2",children:[e(F,{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 m=l.from.hours%12+r;a(m)}}),e(F,{override:"force",value:l.from.hours,options:Array.from({length:24}).map((r,m)=>{let s=m;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)}}),onUpdateValidValue:r=>{a(r)}}),e(h,{isSemiBoldFont:!0,children:"\u6642"}),e(F,{override:"force",value:l.from.minutes,options:Array.from({length:60}).map((r,m)=>{let s=m;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(h,{isSemiBoldFont:!0,children:"\u5206"})]})]})},Period:{Clock:t=>{let[l,v]=y.minutesUnitState(),[o,u]=D(S.scope(()=>{let[r,m]=S.Arrayify(t.defaultValue),s=d().setFromFormatHHMM(r||"09:00"),c=d().setFromFormatHHMM(m||"18:00");return{eventType:"init",forcus:0,display:s,from:s,to:c}}));y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){u(m=>g(p({},m),{eventType:"update",from:m.to,to:m.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,m,s)=>{u(c=>{let b=c[r].clone();return S.isExist(m)&&b.setHours(m),S.isExist(s)&&b.setMinutes(s),b.toFormatHM().toNumber()>n.toFormatHM().toNumber()&&(b=n.clone()),b.toFormatHM().toNumber()<i.toFormatHM().toNumber()&&(b=i.clone()),g(p({},c),{eventType:"update",[r]:b})})};return f(L,{width:1,xcss:{minWidth:12*24},children:[f(C.Left,{flexWrap:!0,children:[f(C.Left,{gap:"1/2",children:[e(h.Paragraph,{children:o.from.toFormatHM()||"--:--"}),e(h.Mini,{children:"-"}),e(h.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=>{v(r||1)}})]}),e(T,{borderBottom:"1.thin"}),e(y.Period.Preset,g(p({},t),{onPreset:(r,m)=>{u({eventType:"update",forcus:0,display:d(r),from:d(r),to:d(m)})}})),f(C.Center,{gap:"1/2",children:[e(F,{override:"force",value:o.from.hours,options:Array.from({length:24}).map((r,m)=>{let s=m;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:r=>{a("from",r)}}),e(F,{override:"force",value:o.from.minutes,options:Array.from({length:60}).map((r,m)=>{let s=m;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(h,{isSemiBoldFont:!0,children:"~"}),e(F,{override:"force",value:o.to.hours,options:Array.from({length:24}).map((r,m)=>{let s=m;return i.hours>s||n.hours<s?null:{value:s,label:s.zeroEmbed(2)+"\u6642"}}),onUpdateValidValue:r=>{a("to",r)}}),e(F,{override:"force",value:o.to.minutes,options:Array.from({length:60}).map((r,m)=>{let s=m;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:v}=t,[o,u]=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 y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){u(n=>g(p({},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(h.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:0}))},children:[o.from.toFormatYMD()||"----/--/--",o.forcus==0&&e(y.Parts.PeriodFocusSign,{})]}),e(h.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:1}))},children:[o.to.toFormatYMD()||"----/--/--",o.forcus==1&&e(y.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:y.YearOptions({reverse:!0}),value:o.display.year,onUpdateValidValue:i=>{u(n=>g(p({},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=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().setMonth(Number(i)).setDate(1)}))}}),e(y.Parts.ShiftButtons,{callback:i=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().addMonth(i)}))}})]})]}),e(T,{borderBottom:"1.thin"}),e(y.Period.Preset,g(p({},t),{onPreset:(i,n)=>{u({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=y.Parts.Calendar({min:l,max:v,targetMonth:o.display.clone().addMonth(n-1),from:o.from,to:o.to,onTitleRender:r=>{let m=r.diff(o.display).months;return e(h.Mini,{ssHiddenOnBreak:!0,children:f(C.Center,{gap:"1/2",children:[e(h,{isSemiBoldFont:!0,children:r.toFormatYM("JP")}),e(h,{fontColor:"4.thin",children:["[\u524D\u6708]","","[\u7FCC\u6708]","[\u7FCC\u3005\u6708]"][m+1]})]})})},onChange:r=>{if(o.forcus==0){u(m=>g(p({},m),{eventType:"update",forcus:1,from:r,to:d(null)}));return}u(m=>g(p({},m),{eventType:"update",to:r}))}});return e(T,{flexSizing:"auto",ssHiddenOnBreak:n!=1,children:a},n)})})]})},Month:t=>{let{min:l,max:v}=t,[o,u]=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 y.remoteControl(g(p({},t),{val_value:o,set_value:u})),R(()=>{if(!o.to.value)return;if(o.from.value>o.to.value){u(n=>g(p({},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(h.Mini,{fontColor:"4.thin",children:"from"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:0}))},children:[o.from.toFormatYM("JP")||"----/--",o.forcus==0&&e(y.Parts.PeriodFocusSign,{})]}),e(h.Mini,{fontColor:"4.thin",children:"to"}),f(x.Sub,{color:"cloud",isSemiBoldFont:!0,fontColor:"inherit",onClick:()=>{u(i=>g(p({},i),{forcus:1}))},children:[o.to.toFormatYM("JP")||"----/--",o.forcus==1&&e(y.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:y.YearOptions({reverse:!0}),value:o.display.year,onUpdateValidValue:i=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().setYear(Number(i))}))}}),e(y.Parts.ShiftButtons,{callback:i=>{u(n=>g(p({},n),{eventType:"update",display:n.display.clone().addYear(i)}))}})]})]}),e(T,{borderBottom:"1.thin"}),e(y.Period.Preset,g(p({},t),{onPreset:(i,n)=>{u({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=y.Parts.YearCalendar({min:l,max:v,targetYear:o.display.year+n-1,from:o.from.getFirstDayOfMonth(),to:o.to.getLastDayOfMonth(),onTitleRender:r=>{let m=r-o.display.year;return e(h.Mini,{children:f(C.Left,{gap:"1/2",children:[f(h,{isSemiBoldFont:!0,children:[r,"\u5E74"]}),e(h,{fontColor:"4.thin",children:["[\u524D\u5E74]","","[\u7FCC\u5E74]","[\u7FCC\u3005\u5E74]"][m+1]})]})})},onChange:r=>{if(o.forcus==0){u(m=>g(p({},m),{eventType:"update",forcus:1,from:r,to:d(null)}));return}u(m=>g(p({},m),{eventType:"update",to:r}))}});return e(T,{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,v)=>e(x.Border.S,{padding:["1/4",1],onClick:()=>{t.onPreset(l.from,l.to)},children:l.label},v))}):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:v,to:o,onTitleRender:u=k=>e(h.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,m=[],s=[],c=[],b=[];for(var M=0;M<7;M++){let k=M==6,w=M==0;m.push(e(h.Micro,{textAlign:"center",fontColor:k?"googleBlue":w?"googleRed":"inherit",children:S.transformer.weekday.shortJP(M)},M))}for(var M=0;M<n.weekday;M++)s.unshift(e(h.Mini,{fontColor:"4.thin",flexCenter:!0,children:r-M},M));for(var M=1;M<=a.date;M++){let w=l.clone().setDate(M),E=v.isSameDate(w),z=!1,H=!1;o&&o.validate&&(z=w.isInRange(v,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)}c.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:[M,G&&e(y.Parts.CurrentSign,{})]},w.toFormatYMD()))}for(var M=1;M<7-a.weekday;M++)b.push(e(h.Mini,{flexCenter:!0,fontColor:"4.thin",children:M},M));return f(L,{gap:"1/2",children:[u(l)||"",f(J,{gridCols:7,gap:"1/6",children:[m,s,c,b]})]},l.toFormatYM())},YearCalendar:t=>{let{targetYear:l,from:v,to:o,onTitleRender:u=a=>f(h.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),m=!1;if(t.min){let k=d(t.min).getLastDayOfMonth();k&&r.value<k.value&&(m=!0)}if(t.max){let k=d(t.max).getLastDayOfMonth();k&&k.value<r.value&&(m=!0)}let s=v.year==l&&v.month==r.month,c=!1,b=!1;o&&o.validate&&(c=r.isInRange(v,o),b=o.year==l&&o.month==r.month);let M=i.year==l&&i.month==r.month;n.push(f(x.Clear.S,{isLocked:m,color:"cloud",border:"1.thin",isActive:s||b||c,isActiveStyles:s||b?{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(h,{children:r.month}),e(h.Mini,{opacity:"middle",children:["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.month]})]}),M&&e(y.Parts.CurrentSign,{})]},l+"-"+r.month))}return f(L,{gap:"1/2",children:[u(t.targetYear),e(J,{flexWrap:!0,gridCols:4,gap:"1/6",children:n})]},t.targetYear)},DrumSelector:t=>{let{type:l,min:v,max:o,value:u}=t;const i=(r,m,s)=>{let c=t.value.clone();if(S.isExist(r)&&(c=c.setYear(r)),S.isExist(m)&&(c=c.setMonth(m)),S.isExist(s)&&(c=c.setDate(s)),v){let b=d(v);c.value<b.value&&(c=b)}if(o){let b=d(o);b.value<c.value&&(c=b)}t.onChange(c)};let n=u.getFirstDayOfMonth(),a=u.getLastDayOfMonth();return f(C.Center,{gap:"1/2",children:[e(F,{override:"force",options:y.YearOptions({}),value:u.year,onUpdateValidValue:r=>{i(Number(r))}}),e(h,{isSemiBoldFont:!0,children:"\u5E74"}),e(F,{override:"force",options:Array.from({length:12}).map((r,m)=>{let s=m+1;return{value:s,label:s}}),value:u.month,onUpdateValidValue:r=>{i(void 0,Number(r))}}),e(h,{isSemiBoldFont:!0,children:"\u6708"}),l!="month"&&f($,{children:[e(F,{override:"force",options:Array.from({length:31}).map((r,m)=>{let s=m+1,c=(n.weekday+m)%7;return s>a.date?null:{value:s,label:f(C.Right,{gap:"1/4",ssNowrapText:!0,children:[e(h,{children:s}),f(h.Micro,{fontColor:c==0?"googleRed":c==6?"googleBlue":"4.thin",children:["(",S.transformer.weekday.shortJP(c),")"]})]})}}),value:u.date,onUpdateValidValue:r=>{i(void 0,void 0,Number(r))}},[u.year,u.month].join("-")),e(h,{isSemiBoldFont:!0,children:"\u65E5"})]})]})},MinMax:t=>{let{restrict:l,min:v,max:o}=t;if(!v&&!o)return null;let u=d(v||null),i=d(o||null),n="",a="";return l=="year"?(n=u.toFormat("%Y\u5E74"),a=i.toFormat("%Y\u5E74")):l.match(/month/)?(n=u.toFormatYM(),a=i.toFormatYM()):l.match(/date/)?(n=u.toFormatYMD(),a=i.toFormatYMD()):l.match(/clock/)&&(u=d().setFromFormatHHMM(v||""),i=d().setFromFormatHHMM(o||""),n=u.toFormatHM(),a=i.toFormatHM()),f(h.Micro,{fontHeight:1.2,children:[n&&f(h,{children:["\u6700\u5C0F: ",n]}),a&&f(h,{children:["\u6700\u5927: ",a]})]})},CurrentSign:()=>e(T,{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(T,{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,v=null,o="init",u="L";t.restrict=="year"&&(u="S"),t.restrict=="month"&&(u="S"),t.restrict=="clock"?u="XS":(t.restrict=="locale.jp.warekiDate"||t.restrict=="period.clock")&&(u="S");let i=t.sheetID||O(),n=t.pickerId||O();_.open("middleCenter",{sheetID:i,size:u,padding:[2,0],closeAtAroundClick:!0,closeAtParentBlur:!1,onClose:()=>{o!="commit"&&t.onValueUpdate({value:l,era:v,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&&t.onValueUpdate(a),l=a.value,v=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(h.Micro,{children:"\u30EA\u30BB\u30C3\u30C8"})]})}),e(y.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};
@@ -49,8 +49,9 @@ declare namespace Trigger {
49
49
  body: T;
50
50
  isValid: boolean;
51
51
  /**
52
- * ⚠️ Warning: Be careful when using this function to avoid deadlocks.
53
- * after serialLock function is called, the form submission will be stopped receive new form submissions until release function is called.
52
+ * ⚠️ serialLockの注意
53
+ * serialLockは、同じformNameのsubmitイベントが連続で発生した場合に、前のsubmitイベントが完了するまで次のsubmitイベントを待機させるためのロック機能です。
54
+ * callback内の処理が全てパースされると、自動でロックが解除されます。
54
55
  * */
55
56
  serialLock(): {
56
57
  release(): void;
@@ -68,6 +69,9 @@ declare namespace Trigger {
68
69
  }
69
70
  type Input<C = Trigger.Colors> = Trigger.Input<C> & {
70
71
  onFormSubmit?: OnFormSubmit.Input;
72
+ /**
73
+ * @deprecated use onFormSubmit instead
74
+ */
71
75
  submitOption?: {
72
76
  formName: string;
73
77
  acceptInvalidForm?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amotify",
3
- "version": "0.3.35",
3
+ "version": "0.3.37",
4
4
  "description": "UI Component for React,NextJS,esbuild",
5
5
  "scripts": {
6
6
  "start": "run-p clean build:*",
@@ -90,7 +90,7 @@
90
90
  "@fortawesome/free-solid-svg-icons": "^7.2.0",
91
91
  "@fortawesome/react-fontawesome": "^3.3.0",
92
92
  "dotenv": "^17.0.1",
93
- "jmini": "^0.0.129",
93
+ "jmini": "^0.0.130",
94
94
  "react": "^19.2.3"
95
95
  },
96
96
  "devDependencies": {