@tachybase/plugin-block-gantt 1.3.25 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +32 -32
- package/dist/externalVersion.js +2 -2
- package/package.json +4 -4
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(L,c){typeof exports=="object"&&typeof module!="undefined"?c(exports,require("react/jsx-runtime"),require("react"),require("@tachybase/client"),require("@tachybase/schema"),require("antd"),require("lodash"),require("react-i18next"),require("@tego/client"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@tachybase/client","@tachybase/schema","antd","lodash","react-i18next","@tego/client","@ant-design/icons"],c):(L=typeof globalThis!="undefined"?globalThis:L||self,c(L["@tachybase/plugin-block-gantt"]={},L.jsxRuntime,L.react,L["@tachybase/client"],L["@tachybase/schema"],L.antd,L.lodash,L["react-i18next"],L["@tego/client"],L["@ant-design/icons"]))})(this,function(L,c,f,d,I,Ie,ke,ge,Q,Be){"use strict";var $o=Object.defineProperty,Vo=Object.defineProperties;var Lo=Object.getOwnPropertyDescriptors;var Qt=Object.getOwnPropertySymbols;var Ho=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var Kt=(L,c,f)=>c in L?$o(L,c,{enumerable:!0,configurable:!0,writable:!0,value:f}):L[c]=f,O=(L,c)=>{for(var f in c||(c={}))Ho.call(c,f)&&Kt(L,f,c[f]);if(Qt)for(var f of Qt(c))Eo.call(c,f)&&Kt(L,f,c[f]);return L},ce=(L,c)=>Vo(L,Lo(c));var re=(L,c,f)=>new Promise((d,I)=>{var Ie=Q=>{try{ge(f.next(Q))}catch(Be){I(Be)}},ke=Q=>{try{ge(f.throw(Q))}catch(Be){I(Be)}},ge=Q=>Q.done?d(Q.value):Promise.resolve(Q.value).then(Ie,ke);ge((f=f.apply(L,c)).next())});const Jt=I.observer(e=>c.jsx(c.Fragment,{children:e.children}),{displayName:"Event"}),Qe=f.createContext({});Qe.displayName="GanttBlockContext";const Ke=(e=[],t,r=[],o=void 0,n=!1,a,i)=>(e.forEach(s=>{var p,x;const l=a(s),u=parseFloat((s[t.progress]*100).toFixed(2));s.children&&s.children.length?(r.push({start:new Date((p=s[t.start])!=null?p:void 0),end:new Date((x=s[t.end])!=null?x:void 0),name:s[t.title],id:s[i]+"",type:"project",progress:u>100?100:u||0,hideChildren:n,project:o,color:s.color,isDisabled:l}),Ke(s.children,t,r,s.id+"",n,a)):r.push({start:s[t.start]?new Date(s[t.start]):void 0,end:new Date(s[t.end]||s[t.start]),name:s[t.title],id:s[i]+"",type:t.end?"task":"milestone",progress:u>100?100:u||0,project:o,color:s.color,isDisabled:l})}),r),Zt=e=>{const{fieldNames:t,timeRange:r,resource:o}=e,n=I.useField(),{service:a}=d.useBlockRequestContext();return c.jsx(Qe.Provider,{value:{field:n,service:a,resource:o,fieldNames:t,timeRange:r},children:e.children})},Rt=e=>{const t={filter:e.params.filter,paginate:!1,sort:e.fieldNames.start},r=d.useCollection_deprecated();return r!=null&&r.tree&&(t.tree=!0),c.jsx("div",{"aria-label":"block-item-gantt",role:"button",children:c.jsx(d.BlockProvider,ce(O({name:"gantt"},e),{params:t,children:c.jsx(d.TableBlockProvider,ce(O({},e),{params:t,children:c.jsx(Zt,O({},e))}))}))})},de=()=>f.useContext(Qe),dt=()=>{var F;const e=de(),[t,r]=f.useState([]),{getPrimaryKey:o,name:n,template:a,writableView:i}=d.useCollection_deprecated(),{parseAction:s}=d.useACLRoleContext(),l=o(),u=S=>{const y=`${n}:update`,B={},g=S==null?void 0:S[l],v=s(y,{schema:B,recordPkValue:g});return a==="view"&&!i||!v},p=S=>{const B=e.field.data.map(g=>g.id===S.id?S:g);r(B),e.field.data=B},x=S=>{var B;const y=Ke((B=e.service.data)==null?void 0:B.data,e.fieldNames,[],void 0,S,u,l);r(y),e.field.data=y};return f.useEffect(()=>{var S,y;if(!((S=e==null?void 0:e.service)!=null&&S.loading)){const B=Ke((y=e.service.data)==null?void 0:y.data,e.fieldNames,[],void 0,!1,u,l);r(B),e.field.data=B}},[(F=e==null?void 0:e.service)==null?void 0:F.loading]),{fieldNames:e.fieldNames,timeRange:e.timeRange,onExpanderClick:p,expandAndCollapseAll:x,tasks:t}},er=(e,t,r,o,n,a,i,s,l,u,p,x,F,S,y,B,g,v)=>{let C=e.map((T,M)=>tr(T,M,t,r,o,n,a,i,s,l,u,p,x,F,S,y,B,g,v));return C=C.map(T=>{const M=T.dependencies||[];for(let b=0;b<M.length;b++){const h=C.findIndex(m=>m.id===M[b]);h!==-1&&C[h].barChildren.push(T)}return T}),C},tr=(e,t,r,o,n,a,i,s,l,u,p,x,F,S,y,B,g,v,C)=>{let T;switch(e.type){case"milestone":T=rr(e,t,r,o,n,a,i,s,v,C);break;case"project":T=ut(e,t,r,o,n,a*.5,i,s,l,S,y,B,g);break;default:T=ut(e,t,r,o,n,a,i,s,l,u,p,x,F);break}return T},ut=(e,t,r,o,n,a,i,s,l,u,p,x,F)=>{let S,y;l?(y=ft(e.start,r,o),S=ft(e.end,r,o)):(S=Oe(e.start,r,o),y=Oe(e.end,r,o));let B=e.type;B==="task"&&y-S<s*2&&(B="smalltask",y=S>0?S+s*2:S);const[g,v]=Ne(S,y,e.progress,l),C=e.type==="project"?Je(t,n,a)+8:Je(t,n,a),T=e.type==="project"?e.hideChildren:void 0,M=O({backgroundColor:x,backgroundSelectedColor:F,progressColor:u,progressSelectedColor:p},e.styles);return ce(O({},e),{typeInternal:B,x1:S,x2:y,y:C,index:t,progressX:v,progressWidth:g,barCornerRadius:i,handleWidth:s,hideChildren:T,height:a,barChildren:[],styles:M})},rr=(e,t,r,o,n,a,i,s,l,u)=>{const p=Oe(e.start,r,o),x=Je(t,n,a),F=p-a*.5,S=p+a*.5,y=a/1.414,B=O({backgroundColor:l,backgroundSelectedColor:u,progressColor:"",progressSelectedColor:""},e.styles);return ce(O({},e),{end:e.start,x1:F,x2:S,y:x,index:t,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:s,typeInternal:e.type,progress:0,height:y,hideChildren:void 0,barChildren:[],styles:B})},Oe=(e,t,r)=>{var s,l,u;const o=t.findIndex(p=>(p==null?void 0:p.getTime())>=(e==null?void 0:e.getTime()))-1,a=((e==null?void 0:e.getTime())-((s=t[o])==null?void 0:s.getTime()))/(((l=t[o+1])==null?void 0:l.getTime())-((u=t[o])==null?void 0:u.getTime())),i=o*r+a*r;return isNaN(i)?0:i},ft=(e,t,r)=>{let o=Oe(e,t,r);return o+=r,isNaN(o)?0:o},Je=(e,t,r)=>{const o=e*t+(t-r)/2;return isNaN(o)?0:o},Ne=(e,t,r,o)=>{const n=(t-e)*r*.01;let a;return o?a=t-n:a=e,[n,a]},or=(e,t)=>{if(e>=t.x2)return 100;if(e<=t.x1)return 0;{const r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)}},nr=(e,t)=>{if(e>=t.x2)return 0;if(e<=t.x1)return 100;{const r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)}},ht=(e,t,r)=>[e-5,t+r,e+5,t+r,e,t+r-8.66].join(","),ar=(e,t,r)=>{e>=r.x2-r.handleWidth*2&&(e=r.x2-r.handleWidth*2);const n=Math.round((e-r.x1)/t)*t;return r.x1+n},sr=(e,t,r)=>{e<=r.x1+r.handleWidth*2&&(e=r.x1+r.handleWidth*2);const n=Math.round((e-r.x2)/t)*t;return r.x2+n},pt=(e,t,r)=>{const n=Math.round((e-r.x1)/t)*t,a=r.x1+n,i=a+r.x2-r.x1;return[a,i]},be=(e,t,r,o,n)=>{var i,s;let a=new Date((e-t)/o*n+((i=r==null?void 0:r.getTime)==null?void 0:i.call(r)));return a=new Date(((s=a==null?void 0:a.getTime)==null?void 0:s.call(a))+((a==null?void 0:a.getTimezoneOffset())-(r==null?void 0:r.getTimezoneOffset()))*6e4),a},gt=(e,t,r,o,n,a,i)=>{let s;switch(r.type){case"milestone":s=lr(e,t,r,o,n,a);break;default:s=ir(e,t,r,o,n,a,i);break}return s},ir=(e,t,r,o,n,a,i)=>{const s=O({},r);let l=!1;switch(t){case"progress":if(i?s.progress=nr(e,r):s.progress=or(e,r),l=s.progress!==r.progress,l){const[u,p]=Ne(s.x1,s.x2,s.progress,i);s.progressWidth=u,s.progressX=p}break;case"start":{const u=ar(e,o,r);if(s.x1=u,l=s.x1!==r.x1,l){i?s.end=be(u,r.x1,r.end,o,n):s.start=be(u,r.x1,r.start,o,n);const[p,x]=Ne(s.x1,s.x2,s.progress,i);s.progressWidth=p,s.progressX=x}break}case"end":{const u=sr(e,o,r);if(s.x2=u,l=s.x2!==r.x2,l){i?s.start=be(u,r.x2,r.start,o,n):s.end=be(u,r.x2,r.end,o,n);const[p,x]=Ne(s.x1,s.x2,s.progress,i);s.progressWidth=p,s.progressX=x}break}case"move":{const[u,p]=pt(e-a,o,r);if(l=u!==r.x1,l){s.start=be(u,r.x1,r.start,o,n),s.end=be(p,r.x2,r.end,o,n),s.x1=u,s.x2=p;const[x,F]=Ne(s.x1,s.x2,s.progress,i);s.progressWidth=x,s.progressX=F}break}}return{isChanged:l,changedTask:s}},lr=(e,t,r,o,n,a)=>{const i=O({},r);let s=!1;switch(t){case"move":{const[l,u]=pt(e-a,o,r);s=l!==r.x1,s&&(i.start=be(l,r.x1,r.start,o,n),i.end=i.start,i.x1=l,i.x2=u);break}}return{isChanged:s,changedTask:i}};var E=(e=>(e.Hour="hour",e.QuarterDay="quarterDay",e.HalfDay="halfDay",e.Day="day",e.Week="week",e.Month="month",e.QuarterYear="quarterYear",e.Year="year",e))(E||{});const bt={},Xe=(e,t={})=>{const r=JSON.stringify([e,t]);let o=bt[r];return o||(o=new Intl.DateTimeFormat(e,t),bt[r]=o),o},k=(e,t,r)=>new Date(e.getFullYear()+(r==="year"?t:0),e.getMonth()+(r==="month"?t:0),e.getDate()+(r==="day"?t:0),e.getHours()+(r==="hour"?t:0),e.getMinutes()+(r==="minute"?t:0),e.getSeconds()+(r==="second"?t:0),e.getMilliseconds()+(r==="millisecond"?t:0)),Y=(e,t)=>{const r=["millisecond","second","minute","hour","day","month","year"],o=a=>{const i=r.indexOf(t);return r.indexOf(a)<=i};return new Date(e==null?void 0:e.getFullYear(),o("year")?0:e.getMonth(),o("month")?1:e.getDate(),o("day")?0:e.getHours(),o("hour")?0:e.getMinutes(),o("minute")?0:e.getSeconds(),o("second")?0:e.getMilliseconds())},mt=(e,t,r)=>{var a,i;let o=((a=e[0])==null?void 0:a.start)||new Date,n=((i=e[0])==null?void 0:i.start)||new Date;for(const s of e)s.start<o&&(o=s.start),s.end>n&&(n=s.end);switch(t){case E.Year:o=k(o,-1,"year"),o=Y(o,"year"),n=k(n,1,"year"),n=Y(n,"year");break;case E.QuarterYear:o=k(o,-3,"month"),o=Y(o,"month"),n=k(n,3,"year"),n=Y(n,"year");break;case E.Month:o=k(o,-1*r,"month"),o=Y(o,"month"),n=k(n,1,"year"),n=Y(n,"year");break;case E.Week:o=Y(o,"day"),o=k(cr(o),-7*r,"day"),n=Y(n,"day"),n=k(n,1.5,"month");break;case E.Day:o=Y(o,"day"),o=k(o,-1*r,"day"),n=Y(n,"day"),n=k(n,19,"day");break;case E.QuarterDay:o=Y(o,"day"),o=k(o,-1*r,"day"),n=Y(n,"day"),n=k(n,66,"hour");break;case E.HalfDay:o=Y(o,"day"),o=k(o,-1*r,"day"),n=Y(n,"day"),n=k(n,108,"hour");break;case E.Hour:o=Y(o,"hour"),o=k(o,-1*r,"hour"),n=Y(n,"day"),n=k(n,1,"day");break}return[o,n]},xt=(e,t,r)=>{let o=new Date(e);const n=[o];for(;o<t;){switch(r){case E.Year:o=k(o,1,"year");break;case E.QuarterYear:o=k(o,3,"month");break;case E.Month:o=k(o,1,"month");break;case E.Week:o=k(o,7,"day");break;case E.Day:o=k(o,1,"day");break;case E.HalfDay:o=k(o,12,"hour");break;case E.QuarterDay:o=k(o,6,"hour");break;case E.Hour:o=k(o,1,"hour");break}n.push(o)}return n},Pe=(e,t)=>{let r=Xe(t,{month:"long"}).format(e);return r=r.replace(r[0],r[0].toLocaleUpperCase()),r},yt=(e,t,r)=>{let o=Xe(t,{weekday:r}).format(e);return o=o.replace(o[0],o[0].toLocaleUpperCase()),o},cr=e=>{const t=e.getDay(),r=e.getDate()-t+(t===0?-6:1);return new Date(e.setDate(r))},dr=e=>{const t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);const o=t.valueOf();t.setMonth(0,1),t.getDay()!==4&&t.setMonth(0,1+(4-t.getDay()+7)%7);const n=(1+Math.ceil((o-t.valueOf())/6048e5)).toString();return n.length===1?`0${n}`:n},ur=(e,t)=>new Date(t,e+1,0).getDate();function fr(e){return e.key!==void 0}function hr(e){const t=e.filter(r=>r.hideChildren&&r.type==="project");if(t.length>0)for(let r=0;t.length>r;r++){const o=t[r],n=vt(e,o);e=e.filter(a=>n.indexOf(a)===-1)}return e}function vt(e,t){let r=[];t.type!=="project"?r=e.filter(n=>n.dependencies&&n.dependencies.indexOf(t.id)!==-1):r=e.filter(n=>n.project&&n.project===t.id);const o=[];return r.forEach(n=>{o.push(...vt(e,n))}),r=r.concat(r,o),r}const pr=(e,t)=>{const r=e.displayOrder||Number.MAX_VALUE,o=t.displayOrder||Number.MAX_VALUE;return r>o?1:r<o?-1:0},Se=e=>{var t;return isNaN((t=e==null?void 0:e.getTime)==null?void 0:t.call(e))?0:e.getFullYear()+`/${e.getMonth()+1}/`+e.getDate()},Ge=d.createStyles(({token:e,css:t})=>({scrollWrapper:t`
|
|
1
|
+
(function(V,c){typeof exports=="object"&&typeof module!="undefined"?c(exports,require("react/jsx-runtime"),require("react"),require("@tachybase/client"),require("@tachybase/schema"),require("antd"),require("lodash"),require("react-i18next"),require("@tego/client"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","@tachybase/client","@tachybase/schema","antd","lodash","react-i18next","@tego/client","@ant-design/icons"],c):(V=typeof globalThis!="undefined"?globalThis:V||self,c(V["@tachybase/plugin-block-gantt"]={},V.jsxRuntime,V.react,V["@tachybase/client"],V["@tachybase/schema"],V.antd,V.lodash,V["react-i18next"],V["@tego/client"],V["@ant-design/icons"]))})(this,function(V,c,h,d,I,Ie,Oe,be,J,Ne){"use strict";var Ao=Object.defineProperty,ko=Object.defineProperties;var Vo=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Lo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var Zt=(V,c,h)=>c in V?Ao(V,c,{enumerable:!0,configurable:!0,writable:!0,value:h}):V[c]=h,H=(V,c)=>{for(var h in c||(c={}))Lo.call(c,h)&&Zt(V,h,c[h]);if(Jt)for(var h of Jt(c))Eo.call(c,h)&&Zt(V,h,c[h]);return V},de=(V,c)=>ko(V,Vo(c));var ne=(V,c,h)=>new Promise((d,I)=>{var Ie=J=>{try{be(h.next(J))}catch(Ne){I(Ne)}},Oe=J=>{try{be(h.throw(J))}catch(Ne){I(Ne)}},be=J=>J.done?d(J.value):Promise.resolve(J.value).then(Ie,Oe);be((h=h.apply(V,c)).next())});const Rt=I.observer(e=>c.jsx(c.Fragment,{children:e.children}),{displayName:"Event"}),Je=h.createContext({});Je.displayName="GanttBlockContext";const Ze=(e=[],r,t=[],o=void 0,n=!1,s,i)=>(e.forEach(a=>{var f,x;const l=s(a),u=parseFloat((a[r.progress]*100).toFixed(2));a.children&&a.children.length?(t.push({start:new Date((f=a[r.start])!=null?f:void 0),end:new Date((x=a[r.end])!=null?x:void 0),name:a[r.title],id:a[i]+"",type:"project",progress:u>100?100:u||0,hideChildren:n,project:o,color:a.color,isDisabled:l}),Ze(a.children,r,t,a.id+"",n,s)):t.push({start:a[r.start]?new Date(a[r.start]):void 0,end:new Date(a[r.end]||a[r.start]),name:a[r.title],id:a[i]+"",type:r.end?"task":"milestone",progress:u>100?100:u||0,project:o,color:a.color,isDisabled:l})}),t),er=e=>{const{fieldNames:r,timeRange:t,resource:o}=e,n=I.useField(),{service:s}=d.useBlockRequestContext();return c.jsx(Je.Provider,{value:{field:n,service:s,resource:o,fieldNames:r,timeRange:t},children:e.children})},tr=e=>{const r={filter:e.params.filter,paginate:!1,sort:e.fieldNames.start},t=d.useCollection_deprecated();return t!=null&&t.tree&&(r.tree=!0),c.jsx("div",{"aria-label":"block-item-gantt",role:"button",children:c.jsx(d.BlockProvider,de(H({name:"gantt"},e),{params:r,children:c.jsx(d.TableBlockProvider,de(H({},e),{params:r,children:c.jsx(er,H({},e))}))}))})},ue=()=>h.useContext(Je),ut=()=>{var P;const e=ue(),[r,t]=h.useState([]),{getPrimaryKey:o,name:n,template:s,writableView:i}=d.useCollection_deprecated(),{parseAction:a}=d.useACLRoleContext(),l=o(),u=w=>{const y=`${n}:update`,B={},p=w==null?void 0:w[l],S=a(y,{schema:B,recordPkValue:p});return s==="view"&&!i||!S},f=w=>{const B=e.field.data.map(p=>p.id===w.id?w:p);t(B),e.field.data=B},x=w=>{var B;const y=Ze((B=e.service.data)==null?void 0:B.data,e.fieldNames,[],void 0,w,u,l);t(y),e.field.data=y};return h.useEffect(()=>{var w,y;if(!((w=e==null?void 0:e.service)!=null&&w.loading)){const B=Ze((y=e.service.data)==null?void 0:y.data,e.fieldNames,[],void 0,!1,u,l);t(B),e.field.data=B}},[(P=e==null?void 0:e.service)==null?void 0:P.loading]),{fieldNames:e.fieldNames,timeRange:e.timeRange,onExpanderClick:f,expandAndCollapseAll:x,tasks:r}},rr=(e,r,t,o,n,s,i,a,l,u,f,x,P,w,y,B,p,S)=>{let C=e.map((T,M)=>or(T,M,r,t,o,n,s,i,a,l,u,f,x,P,w,y,B,p,S));return C=C.map(T=>{const M=T.dependencies||[];for(let b=0;b<M.length;b++){const g=C.findIndex(m=>m.id===M[b]);g!==-1&&C[g].barChildren.push(T)}return T}),C},or=(e,r,t,o,n,s,i,a,l,u,f,x,P,w,y,B,p,S,C)=>{let T;switch(e.type){case"milestone":T=nr(e,r,t,o,n,s,i,a,S,C);break;case"project":T=ht(e,r,t,o,n,s*.5,i,a,l,w,y,B,p);break;default:T=ht(e,r,t,o,n,s,i,a,l,u,f,x,P);break}return T},ht=(e,r,t,o,n,s,i,a,l,u,f,x,P)=>{let w,y;l?(y=ft(e.start,t,o),w=ft(e.end,t,o)):(w=Xe(e.start,t,o),y=Xe(e.end,t,o));let B=e.type;B==="task"&&y-w<a*2&&(B="smalltask",y=w>0?w+a*2:w);const[p,S]=$e(w,y,e.progress,l),C=e.type==="project"?Re(r,n,s)+8:Re(r,n,s),T=e.type==="project"?e.hideChildren:void 0,M=H({backgroundColor:x,backgroundSelectedColor:P,progressColor:u,progressSelectedColor:f},e.styles);return de(H({},e),{typeInternal:B,x1:w,x2:y,y:C,index:r,progressX:S,progressWidth:p,barCornerRadius:i,handleWidth:a,hideChildren:T,height:s,barChildren:[],styles:M})},nr=(e,r,t,o,n,s,i,a,l,u)=>{const f=Xe(e.start,t,o),x=Re(r,n,s),P=f-s*.5,w=f+s*.5,y=s/1.414,B=H({backgroundColor:l,backgroundSelectedColor:u,progressColor:"",progressSelectedColor:""},e.styles);return de(H({},e),{end:e.start,x1:P,x2:w,y:x,index:r,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:a,typeInternal:e.type,progress:0,height:y,hideChildren:void 0,barChildren:[],styles:B})},Xe=(e,r,t)=>{var a,l,u;const o=r.findIndex(f=>(f==null?void 0:f.getTime())>=(e==null?void 0:e.getTime()))-1,s=((e==null?void 0:e.getTime())-((a=r[o])==null?void 0:a.getTime()))/(((l=r[o+1])==null?void 0:l.getTime())-((u=r[o])==null?void 0:u.getTime())),i=o*t+s*t;return isNaN(i)?0:i},ft=(e,r,t)=>{let o=Xe(e,r,t);return o+=t,isNaN(o)?0:o},Re=(e,r,t)=>{const o=e*r+(r-t)/2;return isNaN(o)?0:o},$e=(e,r,t,o)=>{const n=(r-e)*t*.01;let s;return o?s=r-n:s=e,[n,s]},sr=(e,r)=>{if(e>=r.x2)return 100;if(e<=r.x1)return 0;{const t=r.x2-r.x1;return Math.round((e-r.x1)*100/t)}},ar=(e,r)=>{if(e>=r.x2)return 0;if(e<=r.x1)return 100;{const t=r.x2-r.x1;return Math.round((r.x2-e)*100/t)}},gt=(e,r,t)=>[e-5,r+t,e+5,r+t,e,r+t-8.66].join(","),ir=(e,r,t)=>{e>=t.x2-t.handleWidth*2&&(e=t.x2-t.handleWidth*2);const n=Math.round((e-t.x1)/r)*r;return t.x1+n},lr=(e,r,t)=>{e<=t.x1+t.handleWidth*2&&(e=t.x1+t.handleWidth*2);const n=Math.round((e-t.x2)/r)*r;return t.x2+n},pt=(e,r,t)=>{const n=Math.round((e-t.x1)/r)*r,s=t.x1+n,i=s+t.x2-t.x1;return[s,i]},me=(e,r,t,o,n)=>{var i,a;let s=new Date((e-r)/o*n+((i=t==null?void 0:t.getTime)==null?void 0:i.call(t)));return s=new Date(((a=s==null?void 0:s.getTime)==null?void 0:a.call(s))+((s==null?void 0:s.getTimezoneOffset())-(t==null?void 0:t.getTimezoneOffset()))*6e4),s},bt=(e,r,t,o,n,s,i)=>{let a;switch(t.type){case"milestone":a=dr(e,r,t,o,n,s);break;default:a=cr(e,r,t,o,n,s,i);break}return a},cr=(e,r,t,o,n,s,i)=>{const a=H({},t);let l=!1;switch(r){case"progress":if(i?a.progress=ar(e,t):a.progress=sr(e,t),l=a.progress!==t.progress,l){const[u,f]=$e(a.x1,a.x2,a.progress,i);a.progressWidth=u,a.progressX=f}break;case"start":{const u=ir(e,o,t);if(a.x1=u,l=a.x1!==t.x1,l){i?a.end=me(u,t.x1,t.end,o,n):a.start=me(u,t.x1,t.start,o,n);const[f,x]=$e(a.x1,a.x2,a.progress,i);a.progressWidth=f,a.progressX=x}break}case"end":{const u=lr(e,o,t);if(a.x2=u,l=a.x2!==t.x2,l){i?a.start=me(u,t.x2,t.start,o,n):a.end=me(u,t.x2,t.end,o,n);const[f,x]=$e(a.x1,a.x2,a.progress,i);a.progressWidth=f,a.progressX=x}break}case"move":{const[u,f]=pt(e-s,o,t);if(l=u!==t.x1,l){a.start=me(u,t.x1,t.start,o,n),a.end=me(f,t.x2,t.end,o,n),a.x1=u,a.x2=f;const[x,P]=$e(a.x1,a.x2,a.progress,i);a.progressWidth=x,a.progressX=P}break}}return{isChanged:l,changedTask:a}},dr=(e,r,t,o,n,s)=>{const i=H({},t);let a=!1;switch(r){case"move":{const[l,u]=pt(e-s,o,t);a=l!==t.x1,a&&(i.start=me(l,t.x1,t.start,o,n),i.end=i.start,i.x1=l,i.x2=u);break}}return{isChanged:a,changedTask:i}};var E=(e=>(e.Hour="hour",e.QuarterDay="quarterDay",e.HalfDay="halfDay",e.Day="day",e.Week="week",e.Month="month",e.QuarterYear="quarterYear",e.Year="year",e))(E||{});const mt={},Ge=(e,r={})=>{const t=JSON.stringify([e,r]);let o=mt[t];return o||(o=new Intl.DateTimeFormat(e,r),mt[t]=o),o},O=(e,r,t)=>new Date(e.getFullYear()+(t==="year"?r:0),e.getMonth()+(t==="month"?r:0),e.getDate()+(t==="day"?r:0),e.getHours()+(t==="hour"?r:0),e.getMinutes()+(t==="minute"?r:0),e.getSeconds()+(t==="second"?r:0),e.getMilliseconds()+(t==="millisecond"?r:0)),j=(e,r)=>{const t=["millisecond","second","minute","hour","day","month","year"],o=s=>{const i=t.indexOf(r);return t.indexOf(s)<=i};return new Date(e==null?void 0:e.getFullYear(),o("year")?0:e.getMonth(),o("month")?1:e.getDate(),o("day")?0:e.getHours(),o("hour")?0:e.getMinutes(),o("minute")?0:e.getSeconds(),o("second")?0:e.getMilliseconds())},xt=(e,r,t)=>{var s,i;let o=((s=e[0])==null?void 0:s.start)||new Date,n=((i=e[0])==null?void 0:i.start)||new Date;for(const a of e)a.start<o&&(o=a.start),a.end>n&&(n=a.end);switch(r){case E.Year:o=O(o,-1,"year"),o=j(o,"year"),n=O(n,1,"year"),n=j(n,"year");break;case E.QuarterYear:o=O(o,-3,"month"),o=j(o,"month"),n=O(n,3,"year"),n=j(n,"year");break;case E.Month:o=O(o,-1*t,"month"),o=j(o,"month"),n=O(n,1,"year"),n=j(n,"year");break;case E.Week:o=j(o,"day"),o=O(ur(o),-7*t,"day"),n=j(n,"day"),n=O(n,1.5,"month");break;case E.Day:o=j(o,"day"),o=O(o,-1*t,"day"),n=j(n,"day"),n=O(n,19,"day");break;case E.QuarterDay:o=j(o,"day"),o=O(o,-1*t,"day"),n=j(n,"day"),n=O(n,66,"hour");break;case E.HalfDay:o=j(o,"day"),o=O(o,-1*t,"day"),n=j(n,"day"),n=O(n,108,"hour");break;case E.Hour:o=j(o,"hour"),o=O(o,-1*t,"hour"),n=j(n,"day"),n=O(n,1,"day");break}return[o,n]},yt=(e,r,t)=>{let o=new Date(e);const n=[o];for(;o<r;){switch(t){case E.Year:o=O(o,1,"year");break;case E.QuarterYear:o=O(o,3,"month");break;case E.Month:o=O(o,1,"month");break;case E.Week:o=O(o,7,"day");break;case E.Day:o=O(o,1,"day");break;case E.HalfDay:o=O(o,12,"hour");break;case E.QuarterDay:o=O(o,6,"hour");break;case E.Hour:o=O(o,1,"hour");break}n.push(o)}return n},Pe=(e,r)=>{let t=Ge(r,{month:"long"}).format(e);return t=t.replace(t[0],t[0].toLocaleUpperCase()),t},St=(e,r,t)=>{let o=Ge(r,{weekday:t}).format(e);return o=o.replace(o[0],o[0].toLocaleUpperCase()),o},ur=e=>{const r=e.getDay(),t=e.getDate()-r+(r===0?-6:1);return new Date(e.setDate(t))},hr=e=>{const r=new Date(e.valueOf()),t=(r.getDay()+6)%7;r.setDate(r.getDate()-t+3);const o=r.valueOf();r.setMonth(0,1),r.getDay()!==4&&r.setMonth(0,1+(4-r.getDay()+7)%7);const n=(1+Math.ceil((o-r.valueOf())/6048e5)).toString();return n.length===1?`0${n}`:n},fr=(e,r)=>new Date(r,e+1,0).getDate();function gr(e){return e.key!==void 0}function pr(e){const r=e.filter(t=>t.hideChildren&&t.type==="project");if(r.length>0)for(let t=0;r.length>t;t++){const o=r[t],n=wt(e,o);e=e.filter(s=>n.indexOf(s)===-1)}return e}function wt(e,r){let t=[];r.type!=="project"?t=e.filter(n=>n.dependencies&&n.dependencies.indexOf(r.id)!==-1):t=e.filter(n=>n.project&&n.project===r.id);const o=[];return t.forEach(n=>{o.push(...wt(e,n))}),t=t.concat(t,o),t}const br=(e,r)=>{const t=e.displayOrder||Number.MAX_VALUE,o=r.displayOrder||Number.MAX_VALUE;return t>o?1:t<o?-1:0},ve=e=>{var r;return isNaN((r=e==null?void 0:e.getTime)==null?void 0:r.call(e))?0:e.getFullYear()+`/${e.getMonth()+1}/`+e.getDate()},ze=d.createStyles(({token:e,css:r})=>({scrollWrapper:r`
|
|
2
2
|
overflow: auto;
|
|
3
3
|
position: absolute;
|
|
4
4
|
bottom: -4px;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
&::-webkit-scrollbar-thumb:active: {
|
|
19
19
|
background: var(--colorBgScrollBarActive)
|
|
20
20
|
}
|
|
21
|
-
`,tooltipDefaultContainer:
|
|
21
|
+
`,tooltipDefaultContainer:r`
|
|
22
22
|
padding: 12px;
|
|
23
23
|
background-color: ${e.colorBgElevated};
|
|
24
24
|
background-clip: padding-box;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
margin-bottom: ${e.marginXXS} + ${e.marginXS-e.marginXXS};
|
|
34
34
|
color: ${e.colorText};
|
|
35
35
|
}
|
|
36
|
-
`,tooltipDetailsContainer:
|
|
36
|
+
`,tooltipDetailsContainer:r`
|
|
37
37
|
position: absolute;
|
|
38
38
|
display: flex;
|
|
39
39
|
flexshrink: 0;
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
mozuserselect: none;
|
|
44
44
|
msuserselect: none;
|
|
45
45
|
userselect: none;
|
|
46
|
-
`,tooltipDetailsContainerHidden:
|
|
46
|
+
`,tooltipDetailsContainerHidden:r`
|
|
47
47
|
visibility: hidden;
|
|
48
48
|
position: absolute;
|
|
49
49
|
display: flex;
|
|
50
50
|
pointerevents: none;
|
|
51
|
-
`,nbGridOther:
|
|
51
|
+
`,nbGridOther:r`
|
|
52
52
|
.horizontalScroll: {
|
|
53
53
|
height: 1
|
|
54
54
|
}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
`})),
|
|
76
|
+
`})),mr=({scroll:e,svgWidth:r,taskListWidth:t,rtl:o,onScroll:n})=>{const{styles:s}=ze(),i=h.useRef(null);return h.useEffect(()=>{i.current&&(i.current.scrollLeft=e)},[e]),c.jsx("div",{dir:"ltr",style:{margin:o?`0px ${t}px 0px 0px`:`0px 0px 0px ${t}px`},className:d.cx(s.nbGridOther,s.scrollWrapper,"gantt-horizontal-scoll"),onScroll:n,ref:i,children:c.jsx("div",{style:{width:r,height:1},className:"horizontalScroll"})})},xr=({task:e,rowHeight:r,rtl:t,svgContainerHeight:o,svgContainerWidth:n,scrollX:s,scrollY:i,arrowIndent:a,fontSize:l,fontFamily:u,headerHeight:f,taskListWidth:x,TooltipContent:P})=>{const{styles:w}=ze(),y=h.useRef(null),[B,p]=h.useState(0),[S,C]=h.useState(0);return h.useEffect(()=>{if(y.current){const T=y.current.offsetHeight*1.1,M=y.current.offsetWidth*1.1;let b=e.index*r-i+f,g;if(t)g=e.x1-a*1.5-M-s,g<0&&(g=e.x2+a*1.5-s),M+g>n&&(g=n-M,b+=r);else{g=e.x2+a*1.5+x-s;const N=M+g,k=x+n;N>k&&(g=e.x1+x-a*1.5-s-M),g<x&&(g=n+x-M,b+=r)}T+b-i>o-i&&(b=o-T),p(b),C(g)}},[y,e,a,s,i,f,x,r,o,n,t]),c.jsx("div",{ref:y,className:d.cx(S?w.tooltipDetailsContainer:w.tooltipDetailsContainerHidden,w.nbGridOther),style:{left:S,top:B},children:c.jsx(P,{task:e,fontSize:l,fontFamily:u})})},yr=({task:e,fontSize:r,fontFamily:t})=>{var s,i,a,l,u,f,x,P;const{styles:o}=ze(),n={fontSize:r,fontFamily:t};return c.jsxs("div",{className:d.cx(o.nbGridOther,o.tooltipDefaultContainer),"aria-label":"tb-gantt-tooltip",style:n,children:[c.jsxs("b",{style:{fontSize:r},children:[e.name,": ",ve(e.start)," ~ ",ve(e.end)]}),((i=(s=e.end)==null?void 0:s.getTime)==null?void 0:i.call(s))-((l=(a=e.start)==null?void 0:a.getTime)==null?void 0:l.call(a))!==0&&c.jsx("p",{className:"tooltipDefaultContainerParagraph",children:`Duration: ${Math.round((((f=(u=e.end)==null?void 0:u.getTime)==null?void 0:f.call(u))-((P=(x=e.start)==null?void 0:x.getTime)==null?void 0:P.call(x)))/(1e3*60*60*24)*10)/10||""} day(s)`}),c.jsx("p",{className:"tooltipDefaultContainerParagraph",children:!!e.progress&&`Progress: ${e.progress}%`})]})},Sr=({scroll:e,ganttHeight:r,ganttFullHeight:t,headerHeight:o,rtl:n,onScroll:s})=>{const{styles:i}=ze(),a=h.useRef(null);return h.useEffect(()=>{a.current&&(a.current.scrollTop=e)},[e]),c.jsx("div",{style:{maxHeight:r,marginTop:o,marginLeft:n?"":"-1rem"},className:d.cx(i.nbGridOther,"verticalScroll"),onScroll:s,ref:a,children:c.jsx("div",{style:{height:t,width:1}})})},vt=d.createStyles(({token:e,css:r})=>({ganttverticalcontainer:r`
|
|
77
77
|
overflow: hidden;
|
|
78
78
|
font-size: 0;
|
|
79
79
|
margin: 0;
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
.ganttbody: {
|
|
88
88
|
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
89
89
|
}
|
|
90
|
-
`,horizontalcontainer:
|
|
90
|
+
`,horizontalcontainer:r`
|
|
91
91
|
margin: 0;
|
|
92
92
|
padding: 0;
|
|
93
93
|
overflow: hidden;
|
|
94
|
-
`,wrapper:
|
|
94
|
+
`,wrapper:r`
|
|
95
95
|
display: flex;
|
|
96
96
|
padding: 0;
|
|
97
97
|
margin: 0;
|
|
@@ -106,13 +106,13 @@
|
|
|
106
106
|
display: block;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
`}));function z(e,t){yr(e)&&(e="100%");var r=vr(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function ze(e){return Math.min(1,Math.max(0,e))}function yr(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function vr(e){return typeof e=="string"&&e.indexOf("%")!==-1}function wt(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ye(e){return e<=1?"".concat(Number(e)*100,"%"):e}function me(e){return e.length===1?"0"+e:String(e)}function Sr(e,t,r){return{r:z(e,255)*255,g:z(t,255)*255,b:z(r,255)*255}}function Ct(e,t,r){e=z(e,255),t=z(t,255),r=z(r,255);var o=Math.max(e,t,r),n=Math.min(e,t,r),a=0,i=0,s=(o+n)/2;if(o===n)i=0,a=0;else{var l=o-n;switch(i=s>.5?l/(2-o-n):l/(o+n),o){case e:a=(t-r)/l+(t<r?6:0);break;case t:a=(r-e)/l+2;break;case r:a=(e-t)/l+4;break}a/=6}return{h:a,s:i,l:s}}function Ze(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function wr(e,t,r){var o,n,a;if(e=z(e,360),t=z(t,100),r=z(r,100),t===0)n=r,a=r,o=r;else{var i=r<.5?r*(1+t):r+t-r*t,s=2*r-i;o=Ze(s,i,e+1/3),n=Ze(s,i,e),a=Ze(s,i,e-1/3)}return{r:o*255,g:n*255,b:a*255}}function Tt(e,t,r){e=z(e,255),t=z(t,255),r=z(r,255);var o=Math.max(e,t,r),n=Math.min(e,t,r),a=0,i=o,s=o-n,l=o===0?0:s/o;if(o===n)a=0;else{switch(o){case e:a=(t-r)/s+(t<r?6:0);break;case t:a=(r-e)/s+2;break;case r:a=(e-t)/s+4;break}a/=6}return{h:a,s:l,v:i}}function Cr(e,t,r){e=z(e,360)*6,t=z(t,100),r=z(r,100);var o=Math.floor(e),n=e-o,a=r*(1-t),i=r*(1-n*t),s=r*(1-(1-n)*t),l=o%6,u=[r,i,a,a,s,r][l],p=[s,r,r,i,a,a][l],x=[a,a,s,r,r,i][l];return{r:u*255,g:p*255,b:x*255}}function Mt(e,t,r,o){var n=[me(Math.round(e).toString(16)),me(Math.round(t).toString(16)),me(Math.round(r).toString(16))];return o&&n[0].startsWith(n[0].charAt(1))&&n[1].startsWith(n[1].charAt(1))&&n[2].startsWith(n[2].charAt(1))?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function Tr(e,t,r,o,n){var a=[me(Math.round(e).toString(16)),me(Math.round(t).toString(16)),me(Math.round(r).toString(16)),me(Mr(o))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function Mr(e){return Math.round(parseFloat(e)*255).toString(16)}function Dt(e){return U(e)/255}function U(e){return parseInt(e,16)}function Dr(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Re={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Br(e){var t={r:0,g:0,b:0},r=1,o=null,n=null,a=null,i=!1,s=!1;return typeof e=="string"&&(e=Fr(e)),typeof e=="object"&&(oe(e.r)&&oe(e.g)&&oe(e.b)?(t=Sr(e.r,e.g,e.b),i=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):oe(e.h)&&oe(e.s)&&oe(e.v)?(o=Ye(e.s),n=Ye(e.v),t=Cr(e.h,o,n),i=!0,s="hsv"):oe(e.h)&&oe(e.s)&&oe(e.l)&&(o=Ye(e.s),a=Ye(e.l),t=wr(e.h,o,a),i=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=wt(r),{ok:i,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var Nr="[-\\+]?\\d+%?",Pr="[-\\+]?\\d*\\.\\d+%?",ue="(?:".concat(Pr,")|(?:").concat(Nr,")"),et="[\\s|\\(]+(".concat(ue,")[,|\\s]+(").concat(ue,")[,|\\s]+(").concat(ue,")\\s*\\)?"),tt="[\\s|\\(]+(".concat(ue,")[,|\\s]+(").concat(ue,")[,|\\s]+(").concat(ue,")[,|\\s]+(").concat(ue,")\\s*\\)?"),J={CSS_UNIT:new RegExp(ue),rgb:new RegExp("rgb"+et),rgba:new RegExp("rgba"+tt),hsl:new RegExp("hsl"+et),hsla:new RegExp("hsla"+tt),hsv:new RegExp("hsv"+et),hsva:new RegExp("hsva"+tt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Fr(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Re[e])e=Re[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=J.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=J.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=J.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=J.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=J.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=J.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=J.hex8.exec(e),r?{r:U(r[1]),g:U(r[2]),b:U(r[3]),a:Dt(r[4]),format:t?"name":"hex8"}:(r=J.hex6.exec(e),r?{r:U(r[1]),g:U(r[2]),b:U(r[3]),format:t?"name":"hex"}:(r=J.hex4.exec(e),r?{r:U(r[1]+r[1]),g:U(r[2]+r[2]),b:U(r[3]+r[3]),a:Dt(r[4]+r[4]),format:t?"name":"hex8"}:(r=J.hex3.exec(e),r?{r:U(r[1]+r[1]),g:U(r[2]+r[2]),b:U(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function oe(e){return!!J.CSS_UNIT.exec(String(e))}var Ar=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var o;if(t instanceof e)return t;typeof t=="number"&&(t=Dr(t)),this.originalInput=t;var n=Br(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=r.format)!==null&&o!==void 0?o:n.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,o,n,a=t.r/255,i=t.g/255,s=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*o+.0722*n},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=wt(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Tt(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Tt(this.r,this.g,this.b),r=Math.round(t.h*360),o=Math.round(t.s*100),n=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(o,"%, ").concat(n,"%)"):"hsva(".concat(r,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Ct(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Ct(this.r,this.g,this.b),r=Math.round(t.h*360),o=Math.round(t.s*100),n=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(o,"%, ").concat(n,"%)"):"hsla(".concat(r,", ").concat(o,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Mt(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Tr(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(o,")"):"rgba(".concat(t,", ").concat(r,", ").concat(o,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(z(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(z(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Mt(this.r,this.g,this.b,!1),r=0,o=Object.entries(Re);r<o.length;r++){var n=o[r],a=n[0],i=n[1];if(t===i)return a}return!1},e.prototype.toString=function(t){var r=!!t;t=t!=null?t:this.format;var o=!1,n=this.a<1&&this.a>=0,a=!r&&n&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(!0)),t==="hex4"&&(o=this.toHex8String(!0)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=ze(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=ze(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=ze(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=ze(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),o=(r.h+t)%360;return r.h=o<0?360+o:o,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var o=this.toRgb(),n=new e(t).toRgb(),a=r/100,i={r:(n.r-o.r)*a+o.r,g:(n.g-o.g)*a+o.g,b:(n.b-o.b)*a+o.b,a:(n.a-o.a)*a+o.a};return new e(i)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var o=this.toHsl(),n=360/r,a=[this];for(o.h=(o.h-(n*t>>1)+720)%360;--t;)o.h=(o.h+n)%360,a.push(new e(o));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),o=r.h,n=r.s,a=r.v,i=[],s=1/t;t--;)i.push(new e({h:o,s:n,v:a})),a=(a+s)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),o=new e(t).toRgb(),n=r.a+o.a*(1-r.a);return new e({r:(r.r*r.a+o.r*o.a*(1-r.a))/n,g:(r.g*r.a+o.g*o.a*(1-r.a))/n,b:(r.b*r.a+o.b*o.a*(1-r.a))/n,a:n})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),o=r.h,n=[this],a=360/t,i=1;i<t;i++)n.push(new e({h:(o+i*a)%360,s:r.s,l:r.l}));return n},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const $r=d.createStyles(({token:e,css:t})=>{const r=new Ar(e.colorFillAlter).onBackground(e.colorBgContainer).toHexShortString();return{calendarheader:t`
|
|
109
|
+
`}));function Y(e,r){wr(e)&&(e="100%");const t=vr(e);return e=r===360?e:Math.min(r,Math.max(0,parseFloat(e))),t&&(e=parseInt(String(e*r),10)/100),Math.abs(e-r)<1e-6?1:(r===360?e=(e<0?e%r+r:e%r)/parseFloat(String(r)):e=e%r/parseFloat(String(r)),e)}function Ye(e){return Math.min(1,Math.max(0,e))}function wr(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function vr(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Ct(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function je(e){return Number(e)<=1?`${Number(e)*100}%`:e}function xe(e){return e.length===1?"0"+e:String(e)}function Cr(e,r,t){return{r:Y(e,255)*255,g:Y(r,255)*255,b:Y(t,255)*255}}function Tt(e,r,t){e=Y(e,255),r=Y(r,255),t=Y(t,255);const o=Math.max(e,r,t),n=Math.min(e,r,t);let s=0,i=0;const a=(o+n)/2;if(o===n)i=0,s=0;else{const l=o-n;switch(i=a>.5?l/(2-o-n):l/(o+n),o){case e:s=(r-t)/l+(r<t?6:0);break;case r:s=(t-e)/l+2;break;case t:s=(e-r)/l+4;break}s/=6}return{h:s,s:i,l:a}}function et(e,r,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(r-e)*(6*t):t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}function Tr(e,r,t){let o,n,s;if(e=Y(e,360),r=Y(r,100),t=Y(t,100),r===0)n=t,s=t,o=t;else{const i=t<.5?t*(1+r):t+r-t*r,a=2*t-i;o=et(a,i,e+1/3),n=et(a,i,e),s=et(a,i,e-1/3)}return{r:o*255,g:n*255,b:s*255}}function Mt(e,r,t){e=Y(e,255),r=Y(r,255),t=Y(t,255);const o=Math.max(e,r,t),n=Math.min(e,r,t);let s=0;const i=o,a=o-n,l=o===0?0:a/o;if(o===n)s=0;else{switch(o){case e:s=(r-t)/a+(r<t?6:0);break;case r:s=(t-e)/a+2;break;case t:s=(e-r)/a+4;break}s/=6}return{h:s,s:l,v:i}}function Mr(e,r,t){e=Y(e,360)*6,r=Y(r,100),t=Y(t,100);const o=Math.floor(e),n=e-o,s=t*(1-r),i=t*(1-n*r),a=t*(1-(1-n)*r),l=o%6,u=[t,i,s,s,a,t][l],f=[a,t,t,i,s,s][l],x=[s,s,a,t,t,i][l];return{r:u*255,g:f*255,b:x*255}}function Dt(e,r,t,o){const n=[xe(Math.round(e).toString(16)),xe(Math.round(r).toString(16)),xe(Math.round(t).toString(16))];return o&&n[0].startsWith(n[0].charAt(1))&&n[1].startsWith(n[1].charAt(1))&&n[2].startsWith(n[2].charAt(1))?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function Dr(e,r,t,o,n){const s=[xe(Math.round(e).toString(16)),xe(Math.round(r).toString(16)),xe(Math.round(t).toString(16)),xe(Nr(o))];return n&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function Br(e,r,t,o){const n=e/100,s=r/100,i=t/100,a=o/100,l=255*(1-n)*(1-a),u=255*(1-s)*(1-a),f=255*(1-i)*(1-a);return{r:l,g:u,b:f}}function Bt(e,r,t){let o=1-e/255,n=1-r/255,s=1-t/255,i=Math.min(o,n,s);return i===1?(o=0,n=0,s=0):(o=(o-i)/(1-i)*100,n=(n-i)/(1-i)*100,s=(s-i)/(1-i)*100),i*=100,{c:Math.round(o),m:Math.round(n),y:Math.round(s),k:Math.round(i)}}function Nr(e){return Math.round(parseFloat(e)*255).toString(16)}function Nt(e){return W(e)/255}function W(e){return parseInt(e,16)}function $r(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const tt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Pr(e){let r={r:0,g:0,b:0},t=1,o=null,n=null,s=null,i=!1,a=!1;return typeof e=="string"&&(e=Fr(e)),typeof e=="object"&&(Q(e.r)&&Q(e.g)&&Q(e.b)?(r=Cr(e.r,e.g,e.b),i=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Q(e.h)&&Q(e.s)&&Q(e.v)?(o=je(e.s),n=je(e.v),r=Mr(e.h,o,n),i=!0,a="hsv"):Q(e.h)&&Q(e.s)&&Q(e.l)?(o=je(e.s),s=je(e.l),r=Tr(e.h,o,s),i=!0,a="hsl"):Q(e.c)&&Q(e.m)&&Q(e.y)&&Q(e.k)&&(r=Br(e.c,e.m,e.y,e.k),i=!0,a="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(t=e.a)),t=Ct(t),{ok:i,format:e.format||a,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:t}}const he="(?:"+"[-\\+]?\\d*\\.\\d+%?"+")|(?:"+"[-\\+]?\\d+%?"+")",rt="[\\s|\\(]+("+he+")[,|\\s]+("+he+")[,|\\s]+("+he+")\\s*\\)?",qe="[\\s|\\(]+("+he+")[,|\\s]+("+he+")[,|\\s]+("+he+")[,|\\s]+("+he+")\\s*\\)?",Z={CSS_UNIT:new RegExp(he),rgb:new RegExp("rgb"+rt),rgba:new RegExp("rgba"+qe),hsl:new RegExp("hsl"+rt),hsla:new RegExp("hsla"+qe),hsv:new RegExp("hsv"+rt),hsva:new RegExp("hsva"+qe),cmyk:new RegExp("cmyk"+qe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Fr(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let r=!1;if(tt[e])e=tt[e],r=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let t=Z.rgb.exec(e);return t?{r:t[1],g:t[2],b:t[3]}:(t=Z.rgba.exec(e),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Z.hsl.exec(e),t?{h:t[1],s:t[2],l:t[3]}:(t=Z.hsla.exec(e),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Z.hsv.exec(e),t?{h:t[1],s:t[2],v:t[3]}:(t=Z.hsva.exec(e),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Z.cmyk.exec(e),t?{c:t[1],m:t[2],y:t[3],k:t[4]}:(t=Z.hex8.exec(e),t?{r:W(t[1]),g:W(t[2]),b:W(t[3]),a:Nt(t[4]),format:r?"name":"hex8"}:(t=Z.hex6.exec(e),t?{r:W(t[1]),g:W(t[2]),b:W(t[3]),format:r?"name":"hex"}:(t=Z.hex4.exec(e),t?{r:W(t[1]+t[1]),g:W(t[2]+t[2]),b:W(t[3]+t[3]),a:Nt(t[4]+t[4]),format:r?"name":"hex8"}:(t=Z.hex3.exec(e),t?{r:W(t[1]+t[1]),g:W(t[2]+t[2]),b:W(t[3]+t[3]),format:r?"name":"hex"}:!1))))))))))}function Q(e){return typeof e=="number"?!Number.isNaN(e):Z.CSS_UNIT.test(e)}class X{constructor(r="",t={}){var n;if(r instanceof X)return r;typeof r=="number"&&(r=$r(r)),this.originalInput=r;const o=Pr(r);this.originalInput=r,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!=null?n:o.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const r=this.toRgb();return(r.r*299+r.g*587+r.b*114)/1e3}getLuminance(){const r=this.toRgb();let t,o,n;const s=r.r/255,i=r.g/255,a=r.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),a<=.03928?n=a/12.92:n=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*o+.0722*n}getAlpha(){return this.a}setAlpha(r){return this.a=Ct(r),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:r}=this.toHsl();return r===0}toHsv(){const r=Mt(this.r,this.g,this.b);return{h:r.h*360,s:r.s,v:r.v,a:this.a}}toHsvString(){const r=Mt(this.r,this.g,this.b),t=Math.round(r.h*360),o=Math.round(r.s*100),n=Math.round(r.v*100);return this.a===1?`hsv(${t}, ${o}%, ${n}%)`:`hsva(${t}, ${o}%, ${n}%, ${this.roundA})`}toHsl(){const r=Tt(this.r,this.g,this.b);return{h:r.h*360,s:r.s,l:r.l,a:this.a}}toHslString(){const r=Tt(this.r,this.g,this.b),t=Math.round(r.h*360),o=Math.round(r.s*100),n=Math.round(r.l*100);return this.a===1?`hsl(${t}, ${o}%, ${n}%)`:`hsla(${t}, ${o}%, ${n}%, ${this.roundA})`}toHex(r=!1){return Dt(this.r,this.g,this.b,r)}toHexString(r=!1){return"#"+this.toHex(r)}toHex8(r=!1){return Dr(this.r,this.g,this.b,this.a,r)}toHex8String(r=!1){return"#"+this.toHex8(r)}toHexShortString(r=!1){return this.a===1?this.toHexString(r):this.toHex8String(r)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const r=Math.round(this.r),t=Math.round(this.g),o=Math.round(this.b);return this.a===1?`rgb(${r}, ${t}, ${o})`:`rgba(${r}, ${t}, ${o}, ${this.roundA})`}toPercentageRgb(){const r=t=>`${Math.round(Y(t,255)*100)}%`;return{r:r(this.r),g:r(this.g),b:r(this.b),a:this.a}}toPercentageRgbString(){const r=t=>Math.round(Y(t,255)*100);return this.a===1?`rgb(${r(this.r)}%, ${r(this.g)}%, ${r(this.b)}%)`:`rgba(${r(this.r)}%, ${r(this.g)}%, ${r(this.b)}%, ${this.roundA})`}toCmyk(){return H({},Bt(this.r,this.g,this.b))}toCmykString(){const{c:r,m:t,y:o,k:n}=Bt(this.r,this.g,this.b);return`cmyk(${r}, ${t}, ${o}, ${n})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const r="#"+Dt(this.r,this.g,this.b,!1);for(const[t,o]of Object.entries(tt))if(r===o)return t;return!1}toString(r){const t=!!r;r=r!=null?r:this.format;let o=!1;const n=this.a<1&&this.a>=0;return!t&&n&&(r.startsWith("hex")||r==="name")?r==="name"&&this.a===0?this.toName():this.toRgbString():(r==="rgb"&&(o=this.toRgbString()),r==="prgb"&&(o=this.toPercentageRgbString()),(r==="hex"||r==="hex6")&&(o=this.toHexString()),r==="hex3"&&(o=this.toHexString(!0)),r==="hex4"&&(o=this.toHex8String(!0)),r==="hex8"&&(o=this.toHex8String()),r==="name"&&(o=this.toName()),r==="hsl"&&(o=this.toHslString()),r==="hsv"&&(o=this.toHsvString()),r==="cmyk"&&(o=this.toCmykString()),o||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new X(this.toString())}lighten(r=10){const t=this.toHsl();return t.l+=r/100,t.l=Ye(t.l),new X(t)}brighten(r=10){const t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(r/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(r/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(r/100)))),new X(t)}darken(r=10){const t=this.toHsl();return t.l-=r/100,t.l=Ye(t.l),new X(t)}tint(r=10){return this.mix("white",r)}shade(r=10){return this.mix("black",r)}desaturate(r=10){const t=this.toHsl();return t.s-=r/100,t.s=Ye(t.s),new X(t)}saturate(r=10){const t=this.toHsl();return t.s+=r/100,t.s=Ye(t.s),new X(t)}greyscale(){return this.desaturate(100)}spin(r){const t=this.toHsl(),o=(t.h+r)%360;return t.h=o<0?360+o:o,new X(t)}mix(r,t=50){const o=this.toRgb(),n=new X(r).toRgb(),s=t/100,i={r:(n.r-o.r)*s+o.r,g:(n.g-o.g)*s+o.g,b:(n.b-o.b)*s+o.b,a:(n.a-o.a)*s+o.a};return new X(i)}analogous(r=6,t=30){const o=this.toHsl(),n=360/t,s=[this];for(o.h=(o.h-(n*r>>1)+720)%360;--r;)o.h=(o.h+n)%360,s.push(new X(o));return s}complement(){const r=this.toHsl();return r.h=(r.h+180)%360,new X(r)}monochromatic(r=6){const t=this.toHsv(),{h:o}=t,{s:n}=t;let{v:s}=t;const i=[],a=1/r;for(;r--;)i.push(new X({h:o,s:n,v:s})),s=(s+a)%1;return i}splitcomplement(){const r=this.toHsl(),{h:t}=r;return[this,new X({h:(t+72)%360,s:r.s,l:r.l}),new X({h:(t+216)%360,s:r.s,l:r.l})]}onBackground(r){const t=this.toRgb(),o=new X(r).toRgb(),n=t.a+o.a*(1-t.a);return new X({r:(t.r*t.a+o.r*o.a*(1-t.a))/n,g:(t.g*t.a+o.g*o.a*(1-t.a))/n,b:(t.b*t.a+o.b*o.a*(1-t.a))/n,a:n})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(r){const t=this.toHsl(),{h:o}=t,n=[this],s=360/r;for(let i=1;i<r;i++)n.push(new X({h:(o+i*s)%360,s:t.s,l:t.l}));return n}equals(r){const t=new X(r);return this.format==="cmyk"||t.format==="cmyk"?this.toCmykString()===t.toCmykString():this.toRgbString()===t.toRgbString()}}const Ar=d.createStyles(({token:e,css:r})=>{const t=new X(e.colorFillAlter).onBackground(e.colorBgContainer).toHexShortString();return{calendarheader:r`
|
|
110
110
|
color: ${e.colorText};
|
|
111
|
-
fill: ${
|
|
111
|
+
fill: ${t};
|
|
112
112
|
stroke-width: 1.4;
|
|
113
|
-
background: ${
|
|
113
|
+
background: ${t};
|
|
114
114
|
border-bottom: 1px solid ${e.colorBorderSecondary};
|
|
115
|
-
`,nbGanttCalendar:
|
|
115
|
+
`,nbGanttCalendar:r`
|
|
116
116
|
.calendarbottomtext: {
|
|
117
117
|
textanchor: middle;
|
|
118
118
|
fill: ${e.colorText};
|
|
@@ -139,12 +139,12 @@
|
|
|
139
139
|
font-weight: 500;
|
|
140
140
|
fill: ${e.colorText};
|
|
141
141
|
}
|
|
142
|
-
`}}),
|
|
142
|
+
`}}),ye=({value:e,x1Line:r,y1Line:t,y2Line:o,xText:n,yText:s})=>c.jsxs("g",{className:"calendarTop",children:[c.jsx("line",{x1:r,y1:t,x2:r,y2:o,className:d.cx("calendarTopTick")},e+"line"),c.jsx("text",{y:s,x:n,className:d.cx("calendarTopText"),children:e},e+"text")]}),kr=({dateSetup:e,locale:r,viewMode:t,rtl:o,headerHeight:n,columnWidth:s,fontFamily:i,fontSize:a})=>{const{styles:l}=Ar(),u=()=>{const C=[],T=[],M=n*.5;for(let b=0;b<e.dates.length;b++){const g=e.dates[b],m=g.getFullYear();if(T.push(c.jsx("text",{y:n*.8,x:s*b+s*.5,className:d.cx("calendarBottomText"),children:m},g.getTime())),b===0||g.getFullYear()!==e.dates[b-1].getFullYear()){const N=g.getFullYear().toString();let k;o?k=(6+b+g.getFullYear()+1)*s:k=(6+b-g.getFullYear())*s,C.push(c.jsx(ye,{value:N,x1Line:s*b,y1Line:0,y2Line:n,xText:k,yText:M*.9},N))}}return[C,T]},f=()=>{const C=[],T=[],M=n*.5;for(let b=0;b<e.dates.length;b++){const g=e.dates[b],m="Q"+Math.floor((g.getMonth()+3)/3);if(T.push(c.jsx("text",{y:n*.8,x:s*b+s*.5,className:d.cx("calendarBottomText"),children:m},g.getTime())),b===0||g.getFullYear()!==e.dates[b-1].getFullYear()){const N=g.getFullYear().toString();let k;o?k=(6+b+g.getMonth()+1)*s:k=(6+b-g.getMonth())*s,C.push(c.jsx(ye,{value:N,x1Line:s*b,y1Line:0,y2Line:M,xText:Math.abs(k),yText:M*.9},N))}}return[C,T]},x=()=>{const C=[],T=[],M=n*.5;for(let b=0;b<e.dates.length;b++){const g=e.dates[b],m=Pe(g,r);if(T.push(c.jsx("text",{y:n*.8,x:s*b+s*.5,className:d.cx("calendarBottomText"),children:m},m+g.getFullYear())),b===0||g.getFullYear()!==e.dates[b-1].getFullYear()){const N=g.getFullYear().toString();let k;o?k=(6+b+g.getMonth()+1)*s:k=(6+b-g.getMonth())*s,C.push(c.jsx(ye,{value:N,x1Line:s*b,y1Line:0,y2Line:M,xText:k,yText:M*.9},N))}}return[C,T]},P=()=>{const C=[],T=[];let M=1;const b=n*.5,g=e.dates;for(let m=g.length-1;m>=0;m--){const N=g[m];let k="";(m===0||N.getMonth()!==g[m-1].getMonth())&&(k=`${Pe(N,r)}, ${N.getFullYear()}`);const K=`W${hr(N)}`;T.push(c.jsx("text",{y:n*.8,x:s*(m+ +o),className:d.cx("calendarBottomText"),children:K},N.getTime())),k&&(m!==g.length-1&&C.push(c.jsx(ye,{value:k,x1Line:s*m+M*s,y1Line:0,y2Line:b,xText:s*m+s*M*.5,yText:b*.9},k)),M=0),M++}return[C,T]},w=()=>{const C=[],T=[],M=n*.5,b=e.dates;for(let g=0;g<b.length;g++){const m=b[g],N=`${m.getDate().toString()}`;if(T.push(c.jsx("text",{y:n*.8,x:s*g+s*.5,className:d.cx("calendarBottomText"),children:N},m.getTime())),g+1!==b.length&&m.getMonth()!==b[g+1].getMonth()){const k=Pe(m,r);C.push(c.jsx(ye,{value:k,x1Line:s*(g+1),y1Line:0,y2Line:M,xText:s*(g+1)-fr(m.getMonth(),m.getFullYear())*s*.5,yText:M*.9},k+m.getFullYear()))}}return[C,T]},y=()=>{const C=[],T=[],M=t===E.HalfDay?2:4,b=n*.5,g=e.dates;for(let m=0;m<g.length;m++){const N=g[m],k=Ge(r,{hour:"numeric"}).format(N).replace("时","");if(T.push(c.jsx("text",{y:n*.8,x:s*(m+ +o),className:d.cx("calendarBottomText"),fontFamily:i,children:k},N.getTime())),m===0||N.getDate()!==g[m-1].getDate()){const K=`${St(N,r,"short")}, ${N.getDate()} ${Pe(N,r)}`;C.push(c.jsx(ye,{value:K,x1Line:s*m+M*s,y1Line:0,y2Line:b,xText:s*m+M*s*.5,yText:b*.9},K+N.getFullYear()))}}return[C,T]},B=()=>{var g;const C=[],T=[],M=n*.5,b=e.dates;for(let m=0;m<b.length;m++){const N=b[m],k=(g=Ge(r,{hour:"numeric"}).format(N))==null?void 0:g.replace("时","");if(T.push(c.jsx("text",{y:n*.8,x:s*(m+ +o),className:d.cx("calendarBottomText"),fontFamily:i,children:k},N.getTime())),m!==0&&N.getDate()!==b[m-1].getDate()){const K=b[m-1],se=`${St(K,r,"long")}, ${K.getDate()} ${Pe(K,r)}`,fe=(N.getHours()-24)/2;C.push(c.jsx(ye,{value:se,x1Line:s*m,y1Line:0,y2Line:M,xText:s*(m+fe),yText:M*.9},se+K.getFullYear()))}}return[C,T]};let p=[],S=[];switch(e.viewMode){case E.Year:[p,S]=u();break;case E.QuarterYear:[p,S]=f();break;case E.Month:[p,S]=x();break;case E.Week:[p,S]=P();break;case E.Day:[p,S]=w();break;case E.QuarterDay:case E.HalfDay:[p,S]=y();break;case E.Hour:[p,S]=B()}return c.jsxs("g",{className:l.nbGanttCalendar,fontSize:a,fontFamily:i,children:[c.jsx("rect",{x:0,y:0,width:s*e.dates.length,height:n,className:l.calendarheader}),S," ",p]})},Vr=d.createStyles(({token:e,css:r})=>({gridRow:r`
|
|
143
143
|
fill: ${e.colorBgContainer};
|
|
144
|
-
`,gridHeightRow:
|
|
144
|
+
`,gridHeightRow:r`
|
|
145
145
|
fill: #e6f7ff;
|
|
146
146
|
border-color: ${e.colorBorder};
|
|
147
|
-
`,nbGridbody:
|
|
147
|
+
`,nbGridbody:r`
|
|
148
148
|
.gridrowline: {
|
|
149
149
|
stroke: ${e.colorBorderSecondary};
|
|
150
150
|
stroke-width: 0;
|
|
@@ -153,21 +153,21 @@
|
|
|
153
153
|
.gridtick: {
|
|
154
154
|
stroke: ${e.colorBorderSecondary};
|
|
155
155
|
}
|
|
156
|
-
`})),
|
|
156
|
+
`})),Lr=[{id:J.uid()},{id:J.uid()},{id:J.uid()}],Er=({tasks:e,dates:r,rowHeight:t,svgWidth:o,columnWidth:n,todayColor:s,rtl:i,selectedRowKeys:a})=>{const{styles:l}=Vr(),u=e.length?e:Lr;let f=0;const x=[],P=[c.jsx("line",{x:"0",y1:0,x2:o,y2:0,className:d.cx("gridRowLine")},"RowLineFirst")];for(const S of u)x.push(c.jsx("rect",{x:"0",y:f,width:o,height:t,className:a!=null&&a.includes(+S.id)?l.gridHeightRow:l.gridRow},"Row"+S.id)),P.push(c.jsx("line",{x:"0",y1:f+t,x2:o,y2:f+t,className:d.cx("gridRowLine")},"RowLine"+S.id)),f+=t;const w=new Date;let y=0;const B=[];let p=c.jsx("rect",{});for(let S=0;S<r.length;S++){const C=r[S];B.push(c.jsx("line",{x1:y,y1:0,x2:y,y2:f,className:d.cx("gridTick")},C.getTime())),(S+1!==r.length&&C.getTime()<w.getTime()&&r[S+1].getTime()>=w.getTime()||S!==0&&S+1===r.length&&C.getTime()<w.getTime()&&O(C,C.getTime()-r[S-1].getTime(),"millisecond").getTime()>=w.getTime())&&(p=c.jsx("rect",{x:y,y:0,width:n,height:f,fill:s})),i&&S+1!==r.length&&C.getTime()>=w.getTime()&&r[S+1].getTime()<w.getTime()&&(p=c.jsx("rect",{x:y+n,y:0,width:n,height:f,fill:s})),y+=n}return c.jsxs("g",{className:d.cx("gridBody",l.nbGridbody),children:[c.jsx("g",{className:"rows",children:x}),c.jsx("g",{className:"rowLines",children:P}),c.jsx("g",{className:"ticks",children:B}),c.jsx("g",{className:"today",children:p})]})},Hr=e=>c.jsx("g",{className:"grid",children:c.jsx(Er,H({},e))}),Ir=({taskFrom:e,taskTo:r,rowHeight:t,taskHeight:o,arrowIndent:n,rtl:s})=>{let i,a;return s?[i,a]=Xr(e,r,t,o,n):[i,a]=Or(e,r,t,o,n),c.jsxs("g",{className:"arrow",children:[c.jsx("path",{strokeWidth:"1.5",d:i,fill:"none"}),c.jsx("polygon",{points:a})]})},Or=(e,r,t,o,n)=>{const s=e.index>r.index?-1:1,i=r.y+o/2,a=e.x2+n*2,l=a<r.x1?"":`H ${r.x1-n}`,u=a>r.x1?n:r.x1-e.x2-n,f=`M ${e.x2} ${e.y+o/2}
|
|
157
157
|
h ${n}
|
|
158
|
-
v ${
|
|
158
|
+
v ${s*t/2}
|
|
159
159
|
${l}
|
|
160
160
|
V ${i}
|
|
161
|
-
h ${u}`,x=`${
|
|
162
|
-
${
|
|
163
|
-
${
|
|
161
|
+
h ${u}`,x=`${r.x1},${i}
|
|
162
|
+
${r.x1-5},${i-5}
|
|
163
|
+
${r.x1-5},${i+5}`;return[f,x]},Xr=(e,r,t,o,n)=>{const s=e.index>r.index?-1:1,i=r.y+o/2,a=e.x1-n*2,l=a>r.x2?"":`H ${r.x2+n}`,u=a<r.x2?-n:r.x2-e.x1+n,f=`M ${e.x1} ${e.y+o/2}
|
|
164
164
|
h ${-n}
|
|
165
|
-
v ${
|
|
165
|
+
v ${s*t/2}
|
|
166
166
|
${l}
|
|
167
167
|
V ${i}
|
|
168
|
-
h ${u}`,x=`${
|
|
169
|
-
${
|
|
170
|
-
${
|
|
168
|
+
h ${u}`,x=`${r.x2},${i}
|
|
169
|
+
${r.x2+5},${i+5}
|
|
170
|
+
${r.x2+5},${i-5}`;return[f,x]},$t=({x:e,y:r,width:t,height:o,barCornerRadius:n,onMouseDown:s})=>c.jsx("rect",{x:e,y:r,width:t,height:o,className:"barHandle",role:"button",ry:n,rx:n,onMouseDown:s}),Pt=d.css`
|
|
171
171
|
cursor: pointer;
|
|
172
172
|
outline: none;
|
|
173
173
|
.barHandle {
|
|
@@ -184,21 +184,21 @@
|
|
|
184
184
|
user-select: none;
|
|
185
185
|
stroke-width: 0;
|
|
186
186
|
opacity: 0.6;
|
|
187
|
-
`,
|
|
187
|
+
`,Ft=({x:e,y:r,color:t,width:o,height:n,isSelected:s,progressX:i,progressWidth:a,barCornerRadius:l,styles:u,onMouseDown:f})=>{const x=()=>t||(s?u.progressSelectedColor:u.progressColor),P=()=>t||(s?u.backgroundSelectedColor:u.backgroundColor);return c.jsxs("g",{onMouseDown:f,children:[c.jsx("rect",{x:e,width:o,y:r,height:n,ry:l,rx:l,fill:P(),className:d.cx(Gr)}),c.jsx("rect",{x:i,width:a,y:r,height:n,ry:l,rx:l,fill:x()})]})},At=({progressPoint:e,onMouseDown:r})=>c.jsx("polygon",{className:"barHandle",points:e,onMouseDown:r}),zr=({task:e,isProgressChangeable:r,isDateChangeable:t,rtl:o,onEventStart:n,isSelected:s})=>{const i=gt(+!o*e.progressWidth+e.progressX,e.y,e.height),a=e.height-2;return c.jsxs("g",{className:d.cx(Pt),"aria-label":"task-bar",tabIndex:0,children:[c.jsx(Ft,{x:e.x1,y:e.y,color:e.color,width:e.x2-e.x1,height:e.height,progressX:e.progressX,progressWidth:e.progressWidth,barCornerRadius:e.barCornerRadius,styles:e.styles,isSelected:s,onMouseDown:l=>{t&&n("move",e,l)}}),c.jsxs("g",{className:"handleGroup",children:[t&&c.jsxs("g",{children:[c.jsx($t,{x:e.x1+1,y:e.y+1,width:e.handleWidth,height:a,barCornerRadius:e.barCornerRadius,onMouseDown:l=>{n("start",e,l)}}),c.jsx($t,{x:e.x2-e.handleWidth-1,y:e.y+1,width:e.handleWidth,height:a,barCornerRadius:e.barCornerRadius,onMouseDown:l=>{n("end",e,l)}})]}),r&&c.jsx(At,{progressPoint:i,onMouseDown:l=>{n("progress",e,l)}})]})]})},Yr=({task:e,isProgressChangeable:r,isDateChangeable:t,onEventStart:o,isSelected:n})=>{const s=gt(e.progressWidth+e.x1+10,e.y,e.height);return c.jsxs("g",{className:d.cx(Pt),tabIndex:0,children:[c.jsx(Ft,{x:e.x1,y:e.y,width:e.x2-e.x1,height:e.height,progressX:e.progressX,progressWidth:e.progressWidth,barCornerRadius:e.barCornerRadius,styles:e.styles,isSelected:n,onMouseDown:i=>{t&&o("move",e,i)}}),c.jsx("g",{className:"handleGroup",children:r&&c.jsx(At,{progressPoint:s,onMouseDown:i=>{o("progress",e,i)}})})]})},jr=d.css`
|
|
188
188
|
cursor: pointer;
|
|
189
189
|
outline: none;
|
|
190
190
|
`,qr=d.css`
|
|
191
191
|
user-select: none;
|
|
192
|
-
`,Ur=({task:e,isDateChangeable:
|
|
193
|
-
${e.y+e.height*.85})`,
|
|
192
|
+
`,Ur=({task:e,isDateChangeable:r,onEventStart:t,isSelected:o})=>{const n=`rotate(45 ${e.x1+e.height*.356}
|
|
193
|
+
${e.y+e.height*.85})`,s=()=>o?e.styles.backgroundSelectedColor:e.styles.backgroundColor;return c.jsx("g",{tabIndex:0,className:d.cx(jr),children:c.jsx("rect",{fill:s(),x:e.x1,width:e.height,y:e.y,height:e.height,rx:e.barCornerRadius,ry:e.barCornerRadius,transform:n,className:d.cx(qr),onMouseDown:i=>{r&&t("move",e,i)}})})},Wr=d.css`
|
|
194
194
|
cursor: pointer;
|
|
195
195
|
outline: none;
|
|
196
|
-
`,
|
|
196
|
+
`,Qr=d.css`
|
|
197
197
|
user-select: none;
|
|
198
198
|
opacity: 0.6;
|
|
199
199
|
`;d.css`
|
|
200
200
|
user-select: none;
|
|
201
|
-
`;const
|
|
201
|
+
`;const Kr=({task:e,isSelected:r})=>{const t=r?e.styles.backgroundSelectedColor:e.styles.backgroundColor,o=r?e.styles.progressSelectedColor:e.styles.progressColor,n=e.x2-e.x1;return c.jsxs("g",{tabIndex:0,className:d.cx(Wr),children:[c.jsx("rect",{fill:e.color||t,x:e.x1,width:n,y:e.y,height:e.height,rx:e.barCornerRadius,ry:e.barCornerRadius,className:d.cx(Qr)}),c.jsx("rect",{x:e.progressX,width:e.progressWidth,y:e.y,height:e.height,ry:e.barCornerRadius,rx:e.barCornerRadius,fill:e.color||o})]})},_r=d.createStyles(({token:e,css:r})=>({nbganttTaskitem:r`
|
|
202
202
|
.barLabel: {
|
|
203
203
|
fill: ${e.colorTextLightSolid},
|
|
204
204
|
textAnchor: middle,
|
|
@@ -234,11 +234,11 @@
|
|
|
234
234
|
pointerEvents: none,
|
|
235
235
|
},
|
|
236
236
|
}
|
|
237
|
-
}`})),Jr=e=>{const{styles:t}=Kr(),{task:r,arrowIndent:o,isDelete:n,taskHeight:a,isSelected:i,rtl:s,onEventStart:l}=O({},e),u=f.useRef(null),[p,x]=f.useState(c.jsx("div",{})),[F,S]=f.useState(!0),y=r.typeInternal==="project";f.useEffect(()=>{switch(r.typeInternal){case"milestone":x(c.jsx(Ur,O({},e)));break;case"project":x(c.jsx(Qr,O({},e)));break;case"smalltask":x(c.jsx(Yr,O({},e)));break;default:x(c.jsx(zr,O({},e)));break}},[r,i]),f.useEffect(()=>{u.current&&S(u.current.getBBox().width<r.x2-r.x1)},[u,r]);const B=()=>{const g=r.x2-r.x1,v=r.barChildren.length>0;return F?r.x1+g*.5:s&&u.current?r.x1-u.current.getBBox().width-o*+v-o*.2:r.x1+g+o*+v+o*.2};return c.jsxs("g",{className:d.cx(t.nbganttTaskitem),onKeyDown:g=>{switch(g.key){case"Delete":{n&&l("delete",r,g);break}}g.stopPropagation()},onMouseEnter:g=>{l("mouseenter",r,g)},onMouseLeave:g=>{l("mouseleave",r,g)},onDoubleClick:g=>{l("dblclick",r,g)},onClick:g=>{l("click",r,g)},onFocus:()=>{l("select",r)},children:[p,c.jsx("text",{x:y?r.x1:B(),y:y?r.y-8:F?r.y+a*.5:r.y+a*.65,className:y?d.cx("projectLabel"):F?d.cx("barLabel"):d.cx("barLabelOutside"),ref:u,children:y&&Se(r.start)&&Se(r.end)?`${r.name}: ${Se(r.start)} ~ ${Se(r.end)}`:r.name})]})};let rt=null,Fe=null;const Zr=({tasks:e,dates:t,ganttEvent:r,selectedTask:o,rowHeight:n,columnWidth:a,timeStep:i,svg:s,taskHeight:l,arrowColor:u,arrowIndent:p,fontFamily:x,fontSize:F,rtl:S,setGanttEvent:y,setFailedTask:B,setSelectedTask:g,onDateChange:v,onProgressChange:C,onDoubleClick:T,onClick:M,onDelete:b})=>{var R;const h=(R=s==null?void 0:s.current)==null?void 0:R.createSVGPoint(),[m,N]=f.useState(0),[V,W]=f.useState(0),[ne,fe]=f.useState(!1);f.useEffect(()=>{var G,j,X,q;const P=((G=t[1])==null?void 0:G.getTime())-((j=t[0])==null?void 0:j.getTime())-((X=t[1])==null?void 0:X.getTimezoneOffset())*60*1e3+((q=t[0])==null?void 0:q.getTimezoneOffset())*60*1e3,H=i*a/P;N(H)},[a,t,i]),f.useEffect(()=>{const P=G=>re(null,null,function*(){var he;if(!r.changedTask||!h||!(s!=null&&s.current))return;G.preventDefault(),h.x=G.clientX;const j=h.matrixTransform((he=s==null?void 0:s.current.getScreenCTM())==null?void 0:he.inverse()),{isChanged:X,changedTask:q}=gt(j.x,r.action,r.changedTask,m,i,V,S);X&&y({action:r.action,changedTask:q})}),H=G=>re(null,null,function*(){var $e;const{action:j,originalSelectedTask:X,changedTask:q}=r;if(!q||!h||!(s!=null&&s.current)||!X)return;G.preventDefault(),h.x=G.clientX;const he=h.matrixTransform(($e=s==null?void 0:s.current.getScreenCTM())==null?void 0:$e.inverse()),{changedTask:K}=gt(he.x,j,q,m,i,V,S),Te=X.start!==K.start||X.end!==K.end||X.progress!==K.progress;s.current.removeEventListener("mousemove",P),s.current.removeEventListener("mouseup",H),y({action:""}),fe(!1);let ye=!0;if((j==="move"||j==="end"||j==="start")&&v&&Te)try{const ae=yield v(K,K.barChildren);ae!==void 0&&(ye=ae)}catch(ae){ye=!1}else if(C&&Te)try{const ae=yield C(K,K.barChildren);ae!==void 0&&(ye=ae)}catch(ae){ye=!1}ye||B(X)});!ne&&(r.action==="move"||r.action==="end"||r.action==="start"||r.action==="progress")&&(s!=null&&s.current)&&(s.current.addEventListener("mousemove",P),s.current.addEventListener("mouseup",H),fe(!0))},[r,m,V,C,i,v,s,ne,h,S,B,y]);const Ce=(P,H,G)=>re(null,null,function*(){var j;if(!G)P==="select"&&g(H.id);else if(fr(G)){if(P==="delete"&&b)try{const X=yield b(H);X!==void 0&&X&&y({action:P,changedTask:H})}catch(X){console.error("Error on Delete. "+X)}}else if(P==="mouseenter")r.action||y({action:P,changedTask:H,originalSelectedTask:H});else if(P==="mouseleave")r.action==="mouseenter"&&setTimeout(()=>{y({action:""})},300);else if(P==="dblclick")T&&T(H);else if(P==="click")M&&M(H);else if(P==="move"){if(!(s!=null&&s.current)||!h)return;h.x=G.clientX;const X=h.matrixTransform((j=s.current.getScreenCTM())==null?void 0:j.inverse());W(X.x-H.x1),y({action:P,changedTask:H,originalSelectedTask:H})}else y({action:P,changedTask:H,originalSelectedTask:H})}),ot=(P,H,G)=>{["click"].includes(P)?(!["start","end","progress"].includes(rt)&&(!Fe||Fe===H.start)&&Ce(P,H,G),rt=null,Fe=null):["move","select"].includes(P)?(Fe=H.start,Ce(P,H,G)):(Fe=H.start,rt=P,Ce(P,H,G))};return c.jsxs("g",{className:"content",children:[c.jsx("g",{className:"arrows",fill:u,stroke:u,children:e.map(P=>P.barChildren.map(H=>c.jsx(kr,{taskFrom:P,taskTo:e[H.index],rowHeight:n,taskHeight:l,arrowIndent:p,rtl:S},`Arrow from ${P.id} to ${e[H.index].id}`)))}),c.jsx("g",{className:"bar",fontFamily:x,fontSize:F,children:e.map(P=>c.jsx(Jr,{task:P,arrowIndent:p,taskHeight:l,isProgressChangeable:!!C&&!P.isDisabled,isDateChangeable:!!v&&!P.isDisabled,isDelete:!P.isDisabled,onEventStart:ot,isSelected:!!o&&P.id===o.id,rtl:S},P.id))})]})},At=f.forwardRef(({gridProps:e,calendarProps:t,barProps:r,ganttHeight:o,scrollY:n,scrollX:a},i)=>{const s=f.useRef(null),l=f.useRef(null),u=ce(O({},r),{svg:s}),{styles:p}=St();return f.useEffect(()=>{l.current&&(l.current.scrollTop=n)},[n]),f.useEffect(()=>{i.current&&(i.current.scrollLeft=a)},[a]),c.jsxs("div",{className:p.ganttverticalcontainer,ref:i,dir:"ltr",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:t.headerHeight,fontFamily:r.fontFamily,className:"ganttHeader",children:c.jsx(Vr,O({},t))}),c.jsx("div",{ref:l,className:p.horizontalcontainer,style:o?{maxHeight:o,width:e.svgWidth}:{width:e.svgWidth},children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:r.rowHeight*(r.tasks.length||3),fontFamily:r.fontFamily,ref:s,className:"ganttBody",children:[c.jsx(Ir,O({},e)),c.jsx(Zr,O({},u))]})})]})});At.displayName="TaskGantt";const Rr=(e,t)=>t/e>50?Math.floor(t/e)+20:50,eo=f.createContext({close:()=>{}}),to=e=>{const{visible:t,setVisible:r,record:o}=e,n=d.useCollectionParentRecordData(),i=I.useFieldSchema().properties.detail,s=f.useCallback(()=>{r(!1)},[]);return i&&c.jsx(eo.Provider,{value:{close:s},children:c.jsx(d.ActionContextProvider,{value:{visible:t,setVisible:r},children:c.jsx(d.RecordProvider,{record:o,parent:n,children:c.jsx(I.RecursionField,{schema:i,name:i.name})})})})},ro=ke.debounce((e,t,r,o,n)=>re(null,null,function*(){yield t.update({filterByTk:e.id,values:{[r.start]:e.start,[r.end]:e.end}}),Ie.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),oo=ke.debounce((e,t,r,o,n)=>re(null,null,function*(){yield t.update({filterByTk:e.id,values:{[r.progress]:e.progress/100}}),Ie.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),we=d.withDynamicSchemaProps(e=>{var qt,Ut,Wt;const{styles:t}=St(),{token:r}=d.useToken(),a=d.useAPIClient().auth.getOption("theme")==="compact"?45:55.56,{headerHeight:i=((qt=document.querySelector(".ant-table-thead"))==null?void 0:qt.clientHeight)||0,listCellWidth:s="155px",rowHeight:l=a,ganttHeight:u=0,preStepsCount:p=1,barFill:x=60,barCornerRadius:F=r.borderRadiusXS,barProgressColor:S=r.colorPrimary,barProgressSelectedColor:y=r.colorPrimary,barBackgroundColor:B=r.colorPrimary,barBackgroundSelectedColor:g=r.colorPrimary,projectProgressColor:v=r.colorPrimary,projectProgressSelectedColor:C=r.colorPrimary,projectBackgroundColor:T=r.colorPrimary,projectBackgroundSelectedColor:M=r.colorPrimary,milestoneBackgroundColor:b="#f1c453",milestoneBackgroundSelectedColor:h="#f29e4c",rtl:m=!1,handleWidth:N=8,timeStep:V=3e5,arrowColor:W="grey",fontFamily:ne="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",fontSize:fe=r.fontSize,arrowIndent:Ce=20,todayColor:ot="rgba(252, 248, 227, 0.5)",viewDate:R,TooltipContent:P=mr,onDoubleClick:H,onDelete:G,onSelect:j,onExpanderClick:X,tasks:q,expandAndCollapseAll:he,fieldNames:K}=d.useProps(e),Te=de(),ye=d.useCurrentAppInfo(),{t:$e}=ge.useTranslation(),ae=(Ut=ye.data)==null?void 0:Ut.lang,nt=d.useTableBlockContext(),{resource:Lt,service:Ve}=d.useBlockRequestContext(),Ht=I.useFieldSchema(),ee=K.range||"day",ve=f.useRef(null),at=f.useRef(null),Et=f.useRef(null),[se,co]=f.useState(()=>{const[w,$]=mt(q,ee,p);return{viewMode:ee,dates:xt(w,$,ee)}}),[uo,It]=f.useState(!1),[fo,ho]=f.useState({}),[Le,kt]=f.useState(void 0),[qe,Ot]=f.useState(0),[po,go]=f.useState(0),[bo,Xt]=f.useState(u),[te,Ue]=f.useState([]),[He,Gt]=f.useState({action:""}),st=f.useMemo(()=>l*x/100,[l,x]),[it,mo]=f.useState(),[We,zt]=f.useState(null),[pe,lt]=f.useState(0),[ie,Ee]=f.useState(-1),[Yt,Me]=f.useState(!1),Z=Rr(se.dates.length,(Wt=Et.current)==null?void 0:Wt.clientWidth),le=se.dates.length*Z,De=te.length*l,{expandFlag:jt}=nt,[xo,yo]=f.useState([]);f.useEffect(()=>{nt.field.onExpandClick=To,nt.field.onRowSelect=Mo},[]),f.useEffect(()=>{he==null||he(!jt)},[jt]),f.useEffect(()=>{let w;X?w=hr(q):w=q,w=w.sort(pr);const[$,D]=mt(w,ee,p);let A=xt($,D,ee);m&&(A=A.reverse(),ie===-1&&Ee(A.length*Z)),co({dates:A,viewMode:ee}),Ue(er(w,A,Z,l,st,F,N,m,S,y,B,g,v,C,T,M,b,h))},[q,ee,p,l,F,Z,st,N,S,y,B,g,v,C,T,M,b,h,m,ie]),f.useEffect(()=>{if(ee===se.viewMode&&(R&&!Le||R&&(Le==null?void 0:Le.valueOf())!==R.valueOf())){const w=se.dates,$=w.findIndex((D,A)=>R.valueOf()>=D.valueOf()&&A+1!==w.length&&R.valueOf()<w[A+1].valueOf());if($===-1)return;kt(R),Ee(Z*$)}},[R,Z,se.dates,se.viewMode,ee,Le,kt]),f.useEffect(()=>{const{changedTask:w,action:$}=He;if(w){if($==="delete")Gt({action:""}),Ue(te.filter(D=>D.id!==w.id));else if($==="move"||$==="end"||$==="start"||$==="progress"){const D=te.find(A=>A.id===w.id);if(D&&D.start&&D.end&&(D.start.getTime()!==w.start.getTime()||D.end.getTime()!==w.end.getTime()||D.progress!==w.progress)){const A=te.map(_=>_.id===w.id?w:_);Ue(A)}}}},[He,te]),f.useEffect(()=>{We&&(Ue(te.map(w=>w.id!==We.id?w:We)),zt(null))},[We,te]),f.useEffect(()=>{s||Ot(0),at.current&&Ot(at.current.offsetWidth)},[at,s]),f.useEffect(()=>{ve.current&&go(ve.current.offsetWidth-qe)},[ve,qe]),f.useEffect(()=>{Xt(u?u+i:q.length*l+i)},[u,q,i,l]),f.useEffect(()=>{var $;const w=D=>{if(D.shiftKey||D.deltaX){const A=D.deltaX?D.deltaX:D.deltaY;let _=ie+A;_<0?_=0:_>le&&(_=le),Ee(_),D.preventDefault()}else if(u){let A=pe+D.deltaY;A<0?A=0:A>De-u&&(A=De-u),A!==pe&&(lt(A),D.preventDefault())}Me(!0)};return($=ve.current)==null||$.addEventListener("wheel",w,{passive:!1}),()=>{var D;(D=ve.current)==null||D.removeEventListener("wheel",w)}},[ve,pe,ie,u,le,m,De]);const vo=w=>{pe!==w.currentTarget.scrollTop&&!Yt?(lt(w.currentTarget.scrollTop),Me(!0)):Me(!1)},So=w=>{ie!==w.currentTarget.scrollLeft&&!Yt?(Ee(w.currentTarget.scrollLeft),Me(!0)):Me(!1)},wo=w=>{w.preventDefault();let $=pe,D=ie,A=!0;switch(w.key){case"Down":case"ArrowDown":$+=l,A=!1;break;case"Up":case"ArrowUp":$-=l,A=!1;break;case"Left":case"ArrowLeft":D-=Z;break;case"Right":case"ArrowRight":D+=Z;break}A?(D<0?D=0:D>le&&(D=le),Ee(D)):($<0?$=0:$>De-u&&($=De-u),lt($)),Me(!0)},Co=w=>{const $=te.find(A=>A.id===w),D=te.find(A=>!!it&&A.id===it.id);j&&(D&&j(D,!1),$&&j($,!0)),mo($)},To=(w,$)=>{var A;const D=(A=Te==null?void 0:Te.field)==null?void 0:A.data.find(_=>_.id===$.id+"");X&&$.children.length&&X(ce(O({},D),{hideChildren:!w}))},Mo=w=>{yo(w)},Do=w=>re(null,null,function*(){oo(w,Lt,K,Ve,$e)}),Bo=w=>re(null,null,function*(){ro(w,Lt,K,Ve,$e)}),No=w=>{var _;const $=ct=>ct.reduce((_t,_e)=>_e.children?_t.concat([_e,...$(_e.children)]):_t.concat(_e),[]),D=$((_=Ve==null?void 0:Ve.data)==null?void 0:_.data),A=D==null?void 0:D.find(ct=>ct.id===+w.id);A&&(ho(A),It(!0))},Po={columnWidth:Z,svgWidth:le,tasks:q,rowHeight:l,dates:se.dates,todayColor:ot,rtl:m,selectedRowKeys:xo},Fo={dateSetup:se,locale:ae,viewMode:ee,headerHeight:i,columnWidth:Z,fontFamily:ne,fontSize:fe,rtl:m},Ao={tasks:te,dates:se.dates,ganttEvent:He,selectedTask:it,rowHeight:l,taskHeight:st,columnWidth:Z,arrowColor:W,timeStep:V,fontFamily:ne,fontSize:fe,arrowIndent:Ce,svgWidth:le,rtl:m,setGanttEvent:Gt,setFailedTask:zt,setSelectedTask:Co,onDateChange:Bo,onProgressChange:K.progress&&Do,onDoubleClick:H,onClick:No,onDelete:G};return c.jsxs("div",{className:d.cx(d.css`
|
|
237
|
+
}`})),Jr=e=>{const{styles:r}=_r(),{task:t,arrowIndent:o,isDelete:n,taskHeight:s,isSelected:i,rtl:a,onEventStart:l}=H({},e),u=h.useRef(null),[f,x]=h.useState(c.jsx("div",{})),[P,w]=h.useState(!0),y=t.typeInternal==="project";h.useEffect(()=>{switch(t.typeInternal){case"milestone":x(c.jsx(Ur,H({},e)));break;case"project":x(c.jsx(Kr,H({},e)));break;case"smalltask":x(c.jsx(Yr,H({},e)));break;default:x(c.jsx(zr,H({},e)));break}},[t,i]),h.useEffect(()=>{u.current&&w(u.current.getBBox().width<t.x2-t.x1)},[u,t]);const B=()=>{const p=t.x2-t.x1,S=t.barChildren.length>0;return P?t.x1+p*.5:a&&u.current?t.x1-u.current.getBBox().width-o*+S-o*.2:t.x1+p+o*+S+o*.2};return c.jsxs("g",{className:d.cx(r.nbganttTaskitem),onKeyDown:p=>{switch(p.key){case"Delete":{n&&l("delete",t,p);break}}p.stopPropagation()},onMouseEnter:p=>{l("mouseenter",t,p)},onMouseLeave:p=>{l("mouseleave",t,p)},onDoubleClick:p=>{l("dblclick",t,p)},onClick:p=>{l("click",t,p)},onFocus:()=>{l("select",t)},children:[f,c.jsx("text",{x:y?t.x1:B(),y:y?t.y-8:P?t.y+s*.5:t.y+s*.65,className:y?d.cx("projectLabel"):P?d.cx("barLabel"):d.cx("barLabelOutside"),ref:u,children:y&&ve(t.start)&&ve(t.end)?`${t.name}: ${ve(t.start)} ~ ${ve(t.end)}`:t.name})]})};let ot=null,Fe=null;const Zr=({tasks:e,dates:r,ganttEvent:t,selectedTask:o,rowHeight:n,columnWidth:s,timeStep:i,svg:a,taskHeight:l,arrowColor:u,arrowIndent:f,fontFamily:x,fontSize:P,rtl:w,setGanttEvent:y,setFailedTask:B,setSelectedTask:p,onDateChange:S,onProgressChange:C,onDoubleClick:T,onClick:M,onDelete:b})=>{var te;const g=(te=a==null?void 0:a.current)==null?void 0:te.createSVGPoint(),[m,N]=h.useState(0),[k,K]=h.useState(0),[se,fe]=h.useState(!1);h.useEffect(()=>{var z,q,G,U;const $=((z=r[1])==null?void 0:z.getTime())-((q=r[0])==null?void 0:q.getTime())-((G=r[1])==null?void 0:G.getTimezoneOffset())*60*1e3+((U=r[0])==null?void 0:U.getTimezoneOffset())*60*1e3,L=i*s/$;N(L)},[s,r,i]),h.useEffect(()=>{const $=z=>ne(null,null,function*(){var ge;if(!t.changedTask||!g||!(a!=null&&a.current))return;z.preventDefault(),g.x=z.clientX;const q=g.matrixTransform((ge=a==null?void 0:a.current.getScreenCTM())==null?void 0:ge.inverse()),{isChanged:G,changedTask:U}=bt(q.x,t.action,t.changedTask,m,i,k,w);G&&y({action:t.action,changedTask:U})}),L=z=>ne(null,null,function*(){var ke;const{action:q,originalSelectedTask:G,changedTask:U}=t;if(!U||!g||!(a!=null&&a.current)||!G)return;z.preventDefault(),g.x=z.clientX;const ge=g.matrixTransform((ke=a==null?void 0:a.current.getScreenCTM())==null?void 0:ke.inverse()),{changedTask:R}=bt(ge.x,q,U,m,i,k,w),Me=G.start!==R.start||G.end!==R.end||G.progress!==R.progress;a.current.removeEventListener("mousemove",$),a.current.removeEventListener("mouseup",L),y({action:""}),fe(!1);let Se=!0;if((q==="move"||q==="end"||q==="start")&&S&&Me)try{const ae=yield S(R,R.barChildren);ae!==void 0&&(Se=ae)}catch(ae){Se=!1}else if(C&&Me)try{const ae=yield C(R,R.barChildren);ae!==void 0&&(Se=ae)}catch(ae){Se=!1}Se||B(G)});!se&&(t.action==="move"||t.action==="end"||t.action==="start"||t.action==="progress")&&(a!=null&&a.current)&&(a.current.addEventListener("mousemove",$),a.current.addEventListener("mouseup",L),fe(!0))},[t,m,k,C,i,S,a,se,g,w,B,y]);const Te=($,L,z)=>ne(null,null,function*(){var q;if(!z)$==="select"&&p(L.id);else if(gr(z)){if($==="delete"&&b)try{const G=yield b(L);G!==void 0&&G&&y({action:$,changedTask:L})}catch(G){console.error("Error on Delete. "+G)}}else if($==="mouseenter")t.action||y({action:$,changedTask:L,originalSelectedTask:L});else if($==="mouseleave")t.action==="mouseenter"&&setTimeout(()=>{y({action:""})},300);else if($==="dblclick")T&&T(L);else if($==="click")M&&M(L);else if($==="move"){if(!(a!=null&&a.current)||!g)return;g.x=z.clientX;const G=g.matrixTransform((q=a.current.getScreenCTM())==null?void 0:q.inverse());K(G.x-L.x1),y({action:$,changedTask:L,originalSelectedTask:L})}else y({action:$,changedTask:L,originalSelectedTask:L})}),nt=($,L,z)=>{["click"].includes($)?(!["start","end","progress"].includes(ot)&&(!Fe||Fe===L.start)&&Te($,L,z),ot=null,Fe=null):["move","select"].includes($)?(Fe=L.start,Te($,L,z)):(Fe=L.start,ot=$,Te($,L,z))};return c.jsxs("g",{className:"content",children:[c.jsx("g",{className:"arrows",fill:u,stroke:u,children:e.map($=>$.barChildren.map(L=>c.jsx(Ir,{taskFrom:$,taskTo:e[L.index],rowHeight:n,taskHeight:l,arrowIndent:f,rtl:w},`Arrow from ${$.id} to ${e[L.index].id}`)))}),c.jsx("g",{className:"bar",fontFamily:x,fontSize:P,children:e.map($=>c.jsx(Jr,{task:$,arrowIndent:f,taskHeight:l,isProgressChangeable:!!C&&!$.isDisabled,isDateChangeable:!!S&&!$.isDisabled,isDelete:!$.isDisabled,onEventStart:nt,isSelected:!!o&&$.id===o.id,rtl:w},$.id))})]})},kt=h.forwardRef(({gridProps:e,calendarProps:r,barProps:t,ganttHeight:o,scrollY:n,scrollX:s},i)=>{const a=h.useRef(null),l=h.useRef(null),u=de(H({},t),{svg:a}),{styles:f}=vt();return h.useEffect(()=>{l.current&&(l.current.scrollTop=n)},[n]),h.useEffect(()=>{i.current&&(i.current.scrollLeft=s)},[s]),c.jsxs("div",{className:f.ganttverticalcontainer,ref:i,dir:"ltr",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:r.headerHeight,fontFamily:t.fontFamily,className:"ganttHeader",children:c.jsx(kr,H({},r))}),c.jsx("div",{ref:l,className:f.horizontalcontainer,style:o?{maxHeight:o,width:e.svgWidth}:{width:e.svgWidth},children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.svgWidth,height:t.rowHeight*(t.tasks.length||3),fontFamily:t.fontFamily,ref:a,className:"ganttBody",children:[c.jsx(Hr,H({},e)),c.jsx(Zr,H({},u))]})})]})});kt.displayName="TaskGantt";const Rr=(e,r)=>r/e>50?Math.floor(r/e)+20:50,eo=h.createContext({close:()=>{}}),to=e=>{const{visible:r,setVisible:t,record:o}=e,n=d.useCollectionParentRecordData(),i=I.useFieldSchema().properties.detail,a=h.useCallback(()=>{t(!1)},[]);return i&&c.jsx(eo.Provider,{value:{close:a},children:c.jsx(d.ActionContextProvider,{value:{visible:r,setVisible:t},children:c.jsx(d.RecordProvider,{record:o,parent:n,children:c.jsx(I.RecursionField,{schema:i,name:i.name})})})})},ro=Oe.debounce((e,r,t,o,n)=>ne(null,null,function*(){yield r.update({filterByTk:e.id,values:{[t.start]:e.start,[t.end]:e.end}}),Ie.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),oo=Oe.debounce((e,r,t,o,n)=>ne(null,null,function*(){yield r.update({filterByTk:e.id,values:{[t.progress]:e.progress/100}}),Ie.message.success(n("Saved successfully")),yield o==null?void 0:o.refresh()}),300),Ce=d.withDynamicSchemaProps(e=>{var Wt,Qt,Kt;const{styles:r}=vt(),{token:t}=d.useToken(),s=d.useAPIClient().auth.getOption("theme")==="compact"?45:55.56,{headerHeight:i=((Wt=document.querySelector(".ant-table-thead"))==null?void 0:Wt.clientHeight)||0,listCellWidth:a="155px",rowHeight:l=s,ganttHeight:u=0,preStepsCount:f=1,barFill:x=60,barCornerRadius:P=t.borderRadiusXS,barProgressColor:w=t.colorPrimary,barProgressSelectedColor:y=t.colorPrimary,barBackgroundColor:B=t.colorPrimary,barBackgroundSelectedColor:p=t.colorPrimary,projectProgressColor:S=t.colorPrimary,projectProgressSelectedColor:C=t.colorPrimary,projectBackgroundColor:T=t.colorPrimary,projectBackgroundSelectedColor:M=t.colorPrimary,milestoneBackgroundColor:b="#f1c453",milestoneBackgroundSelectedColor:g="#f29e4c",rtl:m=!1,handleWidth:N=8,timeStep:k=3e5,arrowColor:K="grey",fontFamily:se="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",fontSize:fe=t.fontSize,arrowIndent:Te=20,todayColor:nt="rgba(252, 248, 227, 0.5)",viewDate:te,TooltipContent:$=yr,onDoubleClick:L,onDelete:z,onSelect:q,onExpanderClick:G,tasks:U,expandAndCollapseAll:ge,fieldNames:R}=d.useProps(e),Me=ue(),Se=d.useCurrentAppInfo(),{t:ke}=be.useTranslation(),ae=(Qt=Se.data)==null?void 0:Qt.lang,st=d.useTableBlockContext(),{resource:Et,service:Ve}=d.useBlockRequestContext(),Ht=I.useFieldSchema(),re=R.range||"day",we=h.useRef(null),at=h.useRef(null),It=h.useRef(null),[ie,co]=h.useState(()=>{const[v,A]=xt(U,re,f);return{viewMode:re,dates:yt(v,A,re)}}),[uo,Ot]=h.useState(!1),[ho,fo]=h.useState({}),[Le,Xt]=h.useState(void 0),[We,Gt]=h.useState(0),[go,po]=h.useState(0),[bo,zt]=h.useState(u),[oe,Qe]=h.useState([]),[Ee,Yt]=h.useState({action:""}),it=h.useMemo(()=>l*x/100,[l,x]),[lt,mo]=h.useState(),[Ke,jt]=h.useState(null),[pe,ct]=h.useState(0),[le,He]=h.useState(-1),[qt,De]=h.useState(!1),ee=Rr(ie.dates.length,(Kt=It.current)==null?void 0:Kt.clientWidth),ce=ie.dates.length*ee,Be=oe.length*l,{expandFlag:Ut}=st,[xo,yo]=h.useState([]);h.useEffect(()=>{st.field.onExpandClick=To,st.field.onRowSelect=Mo},[]),h.useEffect(()=>{ge==null||ge(!Ut)},[Ut]),h.useEffect(()=>{let v;G?v=pr(U):v=U,v=v.sort(br);const[A,D]=xt(v,re,f);let F=yt(A,D,re);m&&(F=F.reverse(),le===-1&&He(F.length*ee)),co({dates:F,viewMode:re}),Qe(rr(v,F,ee,l,it,P,N,m,w,y,B,p,S,C,T,M,b,g))},[U,re,f,l,P,ee,it,N,w,y,B,p,S,C,T,M,b,g,m,le]),h.useEffect(()=>{if(re===ie.viewMode&&(te&&!Le||te&&(Le==null?void 0:Le.valueOf())!==te.valueOf())){const v=ie.dates,A=v.findIndex((D,F)=>te.valueOf()>=D.valueOf()&&F+1!==v.length&&te.valueOf()<v[F+1].valueOf());if(A===-1)return;Xt(te),He(ee*A)}},[te,ee,ie.dates,ie.viewMode,re,Le,Xt]),h.useEffect(()=>{const{changedTask:v,action:A}=Ee;if(v){if(A==="delete")Yt({action:""}),Qe(oe.filter(D=>D.id!==v.id));else if(A==="move"||A==="end"||A==="start"||A==="progress"){const D=oe.find(F=>F.id===v.id);if(D&&D.start&&D.end&&(D.start.getTime()!==v.start.getTime()||D.end.getTime()!==v.end.getTime()||D.progress!==v.progress)){const F=oe.map(_=>_.id===v.id?v:_);Qe(F)}}}},[Ee,oe]),h.useEffect(()=>{Ke&&(Qe(oe.map(v=>v.id!==Ke.id?v:Ke)),jt(null))},[Ke,oe]),h.useEffect(()=>{a||Gt(0),at.current&&Gt(at.current.offsetWidth)},[at,a]),h.useEffect(()=>{we.current&&po(we.current.offsetWidth-We)},[we,We]),h.useEffect(()=>{zt(u?u+i:U.length*l+i)},[u,U,i,l]),h.useEffect(()=>{var A;const v=D=>{if(D.shiftKey||D.deltaX){const F=D.deltaX?D.deltaX:D.deltaY;let _=le+F;_<0?_=0:_>ce&&(_=ce),He(_),D.preventDefault()}else if(u){let F=pe+D.deltaY;F<0?F=0:F>Be-u&&(F=Be-u),F!==pe&&(ct(F),D.preventDefault())}De(!0)};return(A=we.current)==null||A.addEventListener("wheel",v,{passive:!1}),()=>{var D;(D=we.current)==null||D.removeEventListener("wheel",v)}},[we,pe,le,u,ce,m,Be]);const So=v=>{pe!==v.currentTarget.scrollTop&&!qt?(ct(v.currentTarget.scrollTop),De(!0)):De(!1)},wo=v=>{le!==v.currentTarget.scrollLeft&&!qt?(He(v.currentTarget.scrollLeft),De(!0)):De(!1)},vo=v=>{v.preventDefault();let A=pe,D=le,F=!0;switch(v.key){case"Down":case"ArrowDown":A+=l,F=!1;break;case"Up":case"ArrowUp":A-=l,F=!1;break;case"Left":case"ArrowLeft":D-=ee;break;case"Right":case"ArrowRight":D+=ee;break}F?(D<0?D=0:D>ce&&(D=ce),He(D)):(A<0?A=0:A>Be-u&&(A=Be-u),ct(A)),De(!0)},Co=v=>{const A=oe.find(F=>F.id===v),D=oe.find(F=>!!lt&&F.id===lt.id);q&&(D&&q(D,!1),A&&q(A,!0)),mo(A)},To=(v,A)=>{var F;const D=(F=Me==null?void 0:Me.field)==null?void 0:F.data.find(_=>_.id===A.id+"");G&&A.children.length&&G(de(H({},D),{hideChildren:!v}))},Mo=v=>{yo(v)},Do=v=>ne(null,null,function*(){oo(v,Et,R,Ve,ke)}),Bo=v=>ne(null,null,function*(){ro(v,Et,R,Ve,ke)}),No=v=>{var _;const A=dt=>dt.reduce((_t,_e)=>_e.children?_t.concat([_e,...A(_e.children)]):_t.concat(_e),[]),D=A((_=Ve==null?void 0:Ve.data)==null?void 0:_.data),F=D==null?void 0:D.find(dt=>dt.id===+v.id);F&&(fo(F),Ot(!0))},$o={columnWidth:ee,svgWidth:ce,tasks:U,rowHeight:l,dates:ie.dates,todayColor:nt,rtl:m,selectedRowKeys:xo},Po={dateSetup:ie,locale:ae,viewMode:re,headerHeight:i,columnWidth:ee,fontFamily:se,fontSize:fe,rtl:m},Fo={tasks:oe,dates:ie.dates,ganttEvent:Ee,selectedTask:lt,rowHeight:l,taskHeight:it,columnWidth:ee,arrowColor:K,timeStep:k,fontFamily:se,fontSize:fe,arrowIndent:Te,svgWidth:ce,rtl:m,setGanttEvent:Yt,setFailedTask:jt,setSelectedTask:Co,onDateChange:Bo,onProgressChange:R.progress&&Do,onDoubleClick:L,onClick:No,onDelete:z};return c.jsxs("div",{className:d.cx(d.css`
|
|
238
238
|
.ant-table-container::after {
|
|
239
239
|
box-shadow: none !important;
|
|
240
240
|
}
|
|
241
241
|
.ant-table-row {
|
|
242
|
-
height: ${
|
|
242
|
+
height: ${s}px;
|
|
243
243
|
}
|
|
244
|
-
`),children:[c.jsx(to,{visible:uo,setVisible:It,record:fo}),c.jsx(I.RecursionField,{name:"anctionBar",schema:Ht.properties.toolBar}),c.jsx(I.RecursionField,{name:"table",schema:Ht.properties.table}),c.jsxs("div",{className:t.wrapper,onKeyDown:wo,tabIndex:0,ref:ve,children:[c.jsx(At,{gridProps:Po,calendarProps:Fo,barProps:Ao,ganttHeight:u,scrollY:pe,scrollX:ie,ref:Et}),He.changedTask&&c.jsx(br,{arrowIndent:Ce,rowHeight:l,svgContainerHeight:bo,svgContainerWidth:po,fontFamily:ne,fontSize:fe,scrollX:ie,scrollY:pe,task:He.changedTask,headerHeight:i,taskListWidth:qe,TooltipContent:P,rtl:m,svgWidth:le}),c.jsx(xr,{ganttFullHeight:De,ganttHeight:u,headerHeight:i,scroll:pe,onScroll:vo,rtl:m}),c.jsx(gr,{svgWidth:le,taskListWidth:qe,scroll:ie,rtl:m,onScroll:So})]})]})}),no=()=>{const{name:e,title:t}=d.useCollection_deprecated(),r=d.useSchemaTemplate();return c.jsx(d.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:r,title:t||e})},Ae=()=>ge.useTranslation("gantt"),je=(e="string")=>{var n;const t=d.useCompile(),{fields:r}=d.useCollection_deprecated();return(n=r==null?void 0:r.filter(a=>a.type===e))==null?void 0:n.map(a=>{var i;return{value:a.name,label:t((i=a==null?void 0:a.uiSchema)==null?void 0:i.title)}})},ao=new d.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:d.SchemaSettingsBlockTitleItem},{name:"titleField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),t=I.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=de(),n=I.useField(),{dn:a}=d.useDesignable();return{title:e("Title field"),value:r.title,options:je("string"),onChange:s=>{const l=n.decoratorProps.fieldNames||{};l.title=s,n.decoratorProps.params=l,t["x-decorator-props"].params=l,t["x-decorator-props"].fieldNames=l,o.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":n.decoratorProps}}),a.refresh()}}}},{name:"timeScale",Component:d.SchemaSettingsSelectItem,useComponentProps(){var s;const{t:e}=Ae(),t=I.useFieldSchema(),r=((s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.fieldNames)||{},o=I.useField(),{service:n}=de(),{dn:a}=d.useDesignable(),i=d.useCompile();return{title:e("Time scale"),value:r.range||"day",options:[{label:i('{{t("Hour")}}'),value:"hour",color:"orange"},{label:i('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:i('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:i('{{t("Day")}}'),value:"day",color:"yellow"},{label:i('{{t("Week")}}'),value:"week",color:"pule"},{label:i('{{t("Month")}}'),value:"month",color:"green"},{label:i('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:i('{{t("Year")}}'),value:"year",color:"green"}],onChange:l=>{const u=o.decoratorProps.fieldNames||{};u.range=l,o.decoratorProps.params=u,t["x-decorator-props"].params=u,t["x-decorator-props"].fieldNames=u,n.refresh(),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),a.refresh()}}}},{name:"startDateField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),t=I.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},o=I.useField(),{dn:n}=d.useDesignable(),{service:a}=de();return{title:e("Start date field"),value:r.start,options:je("date"),onChange:s=>{const l=o.decoratorProps.fieldNames||{};l.start=s,o.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,a.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":o.decoratorProps}}),n.refresh()}}}},{name:"setDataLoadingMode",Component:d.SetDataLoadingMode},{name:"endDateField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),t=I.useFieldSchema(),r=I.useField(),{service:o}=de(),{dn:n}=d.useDesignable(),a=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{};return{title:e("End date field"),value:a.end,options:je("date"),onChange:s=>{const l=r.decoratorProps.fieldNames||{};l.end=s,r.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":r.decoratorProps}}),n.refresh()}}}},{name:"processField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),t=I.useFieldSchema(),r=((i=t==null?void 0:t["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=de(),{dn:n}=d.useDesignable(),a=I.useField();return{title:e("Progress field"),value:r.progress,options:je("float"),onChange:s=>{const l=a.decoratorProps.fieldNames||{};l.progress=s,a.decoratorProps.fieldNames=l,t["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":a.decoratorProps}}),n.refresh()}}}},{name:"dataScope",Component:d.SchemaSettingsDataScope,useComponentProps(){var s,l;const{name:e}=d.useCollection(),t=I.useFieldSchema(),{form:r}=d.useFormBlockContext(),o=I.useField(),{service:n}=de(),{dn:a}=d.useDesignable(),i=d.useDataLoadingMode();return{collectionName:e,defaultFilter:((l=(s=t==null?void 0:t["x-decorator-props"])==null?void 0:s.params)==null?void 0:l.filter)||{},form:r,onSubmit:({filter:u})=>{var x;u=d.removeNullCondition(u);const p=o.decoratorProps.params||{};p.filter=u,o.decoratorProps.params=p,t["x-decorator-props"].params=p,i==="auto"&&n.run(ce(O({},(x=n.params)==null?void 0:x[0]),{filter:u})),a.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":t["x-decorator-props"]}})}}}},{name:"divider",type:"divider"},{name:"template",Component:d.SchemaSettingsTemplate,useComponentProps(){const{name:e}=d.useCollection();return{componentName:"Gantt",collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),so=new d.SchemaInitializer({name:"gantt:configureActions",title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",name:"enableActions",title:"{{t('Enable actions')}}",children:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const e=d.useCollection_deprecated();return!["view","file","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible(){const e=d.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible(){var o;const e=I.useFieldSchema(),t=d.useCollection_deprecated(),{treeTable:r}=((o=e==null?void 0:e.parent)==null?void 0:o["x-decorator-props"])||{};return t.tree&&r!==!1}}]},{name:"divider",type:"divider",useVisible(){const e=d.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"subMenu",name:"customize",title:'{{t("Customize")}}',children:[{type:"item",title:'{{t("Add record")}}',name:"addRecord",Component:"CustomizeAddRecordActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"create","x-acl-action-props":{skipScopeCheck:!0}}}],useVisible(){const e=d.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}}]}),io=e=>{const{collectionName:t,fieldNames:r,dataSource:o}=e;return{type:"void","x-acl-action":`${t}:list`,"x-decorator":"GanttBlockProvider","x-decorator-props":{collection:t,dataSource:o,action:"list",fieldNames:r,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gantt","x-component":"CardItem",properties:{[I.uid()]:{type:"void","x-component":"Gantt","x-use-component-props":"useGanttBlockProps",properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"gantt:configureActions",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-designer":"TableV2.ActionColumnDesigner","x-initializer":"table:configureItemActions",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"tb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}}}}},lo=()=>{const{insert:e}=d.useSchemaInitializer(),{t}=ge.useTranslation(),{getCollectionFields:r}=d.useCollectionManager_deprecated(),o=f.useContext(I.SchemaOptionsContext),{theme:n}=d.useGlobalTheme(),a=d.useSchemaInitializerItem();return c.jsx(d.DataBlockInitializer,ce(O({},a),{componentType:"Gantt",icon:c.jsx(Be.FormOutlined,{}),onCreateBlockSchema:s=>re(null,[s],function*({item:i}){var S,y,B;const l=r(i.name,i.dataSource),u=(S=l==null?void 0:l.filter(g=>g.type==="string"))==null?void 0:S.map(g=>{var v;return{label:(v=g==null?void 0:g.uiSchema)==null?void 0:v.title,value:g.name}}),p=(y=l==null?void 0:l.filter(g=>g.type==="date"))==null?void 0:y.map(g=>{var v;return{label:(v=g==null?void 0:g.uiSchema)==null?void 0:v.title,value:g.name}}),x=(B=l==null?void 0:l.filter(g=>g.type==="float"))==null?void 0:B.map(g=>{var v;return{label:(v=g==null?void 0:g.uiSchema)==null?void 0:v.title,value:g.name}}),F=yield d.FormDialog(t("Create gantt block"),()=>c.jsx(d.SchemaComponentOptions,{scope:o.scope,components:O({},o.components),children:c.jsx(Q.FormLayout,{layout:"vertical",children:c.jsx(d.SchemaComponent,{schema:{properties:{title:{title:t("Title field"),enum:u,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:t("Start date field"),enum:p,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:t("End date field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:t("Progress field"),enum:x,"x-component":"Select","x-decorator":"FormItem"},range:{title:t("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})})}),n).open({initialValues:{}});e(io({collectionName:i.name,dataSource:i.dataSource,fieldNames:O({},F)}))})}))};we.ActionBar=d.ActionBar,we.ViewMode=E,we.Designer=no,we.Event=Jt;const $t=f.memo(e=>c.jsx(d.SchemaComponentOptions,{components:{Gantt:we,GanttBlockInitializer:lo,GanttBlockProvider:Rt},scope:{useGanttBlockProps:dt},children:e.children}));$t.displayName="GanttProvider";class Vt extends d.Plugin{load(){return re(this,null,function*(){this.app.use($t),this.app.schemaSettingsManager.add(ao),this.app.schemaInitializerManager.add(so);const t=this.app.schemaInitializerManager.get("page:addBlock");t==null||t.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"}),this.app.addScopes({useGanttBlockProps:dt})})}}L.Gantt=we,L.GanttPlugin=Vt,L.default=Vt,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
244
|
+
`),children:[c.jsx(to,{visible:uo,setVisible:Ot,record:ho}),c.jsx(I.RecursionField,{name:"anctionBar",schema:Ht.properties.toolBar}),c.jsx(I.RecursionField,{name:"table",schema:Ht.properties.table}),c.jsxs("div",{className:r.wrapper,onKeyDown:vo,tabIndex:0,ref:we,children:[c.jsx(kt,{gridProps:$o,calendarProps:Po,barProps:Fo,ganttHeight:u,scrollY:pe,scrollX:le,ref:It}),Ee.changedTask&&c.jsx(xr,{arrowIndent:Te,rowHeight:l,svgContainerHeight:bo,svgContainerWidth:go,fontFamily:se,fontSize:fe,scrollX:le,scrollY:pe,task:Ee.changedTask,headerHeight:i,taskListWidth:We,TooltipContent:$,rtl:m,svgWidth:ce}),c.jsx(Sr,{ganttFullHeight:Be,ganttHeight:u,headerHeight:i,scroll:pe,onScroll:So,rtl:m}),c.jsx(mr,{svgWidth:ce,taskListWidth:We,scroll:le,rtl:m,onScroll:wo})]})]})}),no=()=>{const{name:e,title:r}=d.useCollection_deprecated(),t=d.useSchemaTemplate();return c.jsx(d.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:t,title:r||e})},Ae=()=>be.useTranslation("gantt"),Ue=(e="string")=>{var n;const r=d.useCompile(),{fields:t}=d.useCollection_deprecated();return(n=t==null?void 0:t.filter(s=>s.type===e))==null?void 0:n.map(s=>{var i;return{value:s.name,label:r((i=s==null?void 0:s.uiSchema)==null?void 0:i.title)}})},so=new d.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:d.SchemaSettingsBlockTitleItem},{name:"titleField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),r=I.useFieldSchema(),t=((i=r==null?void 0:r["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=ue(),n=I.useField(),{dn:s}=d.useDesignable();return{title:e("Title field"),value:t.title,options:Ue("string"),onChange:a=>{const l=n.decoratorProps.fieldNames||{};l.title=a,n.decoratorProps.params=l,r["x-decorator-props"].params=l,r["x-decorator-props"].fieldNames=l,o.refresh(),s.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":n.decoratorProps}}),s.refresh()}}}},{name:"timeScale",Component:d.SchemaSettingsSelectItem,useComponentProps(){var a;const{t:e}=Ae(),r=I.useFieldSchema(),t=((a=r==null?void 0:r["x-decorator-props"])==null?void 0:a.fieldNames)||{},o=I.useField(),{service:n}=ue(),{dn:s}=d.useDesignable(),i=d.useCompile();return{title:e("Time scale"),value:t.range||"day",options:[{label:i('{{t("Hour")}}'),value:"hour",color:"orange"},{label:i('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:i('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:i('{{t("Day")}}'),value:"day",color:"yellow"},{label:i('{{t("Week")}}'),value:"week",color:"pule"},{label:i('{{t("Month")}}'),value:"month",color:"green"},{label:i('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:i('{{t("Year")}}'),value:"year",color:"green"}],onChange:l=>{const u=o.decoratorProps.fieldNames||{};u.range=l,o.decoratorProps.params=u,r["x-decorator-props"].params=u,r["x-decorator-props"].fieldNames=u,n.refresh(),s.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":o.decoratorProps}}),s.refresh()}}}},{name:"startDateField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),r=I.useFieldSchema(),t=((i=r==null?void 0:r["x-decorator-props"])==null?void 0:i.fieldNames)||{},o=I.useField(),{dn:n}=d.useDesignable(),{service:s}=ue();return{title:e("Start date field"),value:t.start,options:Ue("date"),onChange:a=>{const l=o.decoratorProps.fieldNames||{};l.start=a,o.decoratorProps.fieldNames=l,r["x-decorator-props"].fieldNames=l,s.refresh(),n.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":o.decoratorProps}}),n.refresh()}}}},{name:"setDataLoadingMode",Component:d.SetDataLoadingMode},{name:"endDateField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),r=I.useFieldSchema(),t=I.useField(),{service:o}=ue(),{dn:n}=d.useDesignable(),s=((i=r==null?void 0:r["x-decorator-props"])==null?void 0:i.fieldNames)||{};return{title:e("End date field"),value:s.end,options:Ue("date"),onChange:a=>{const l=t.decoratorProps.fieldNames||{};l.end=a,t.decoratorProps.fieldNames=l,r["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":t.decoratorProps}}),n.refresh()}}}},{name:"processField",Component:d.SchemaSettingsSelectItem,useComponentProps(){var i;const{t:e}=Ae(),r=I.useFieldSchema(),t=((i=r==null?void 0:r["x-decorator-props"])==null?void 0:i.fieldNames)||{},{service:o}=ue(),{dn:n}=d.useDesignable(),s=I.useField();return{title:e("Progress field"),value:t.progress,options:Ue("float"),onChange:a=>{const l=s.decoratorProps.fieldNames||{};l.progress=a,s.decoratorProps.fieldNames=l,r["x-decorator-props"].fieldNames=l,o.refresh(),n.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":s.decoratorProps}}),n.refresh()}}}},{name:"dataScope",Component:d.SchemaSettingsDataScope,useComponentProps(){var a,l;const{name:e}=d.useCollection(),r=I.useFieldSchema(),{form:t}=d.useFormBlockContext(),o=I.useField(),{service:n}=ue(),{dn:s}=d.useDesignable(),i=d.useDataLoadingMode();return{collectionName:e,defaultFilter:((l=(a=r==null?void 0:r["x-decorator-props"])==null?void 0:a.params)==null?void 0:l.filter)||{},form:t,onSubmit:({filter:u})=>{var x;u=d.removeNullCondition(u);const f=o.decoratorProps.params||{};f.filter=u,o.decoratorProps.params=f,r["x-decorator-props"].params=f,i==="auto"&&n.run(de(H({},(x=n.params)==null?void 0:x[0]),{filter:u})),s.emit("patch",{schema:{"x-uid":r["x-uid"],"x-decorator-props":r["x-decorator-props"]}})}}}},{name:"divider",type:"divider"},{name:"template",Component:d.SchemaSettingsTemplate,useComponentProps(){const{name:e}=d.useCollection();return{componentName:"Gantt",collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),ao=new d.SchemaInitializer({name:"gantt:configureActions",title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"itemGroup",name:"enableActions",title:"{{t('Enable actions')}}",children:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){const e=d.useCollection_deprecated();return!["view","file","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible(){const e=d.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible(){var o;const e=I.useFieldSchema(),r=d.useCollection_deprecated(),{treeTable:t}=((o=e==null?void 0:e.parent)==null?void 0:o["x-decorator-props"])||{};return r.tree&&t!==!1}}]},{name:"divider",type:"divider",useVisible(){const e=d.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}},{type:"subMenu",name:"customize",title:'{{t("Customize")}}',children:[{type:"item",title:'{{t("Add record")}}',name:"addRecord",Component:"CustomizeAddRecordActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action":"create","x-acl-action-props":{skipScopeCheck:!0}}}],useVisible(){const e=d.useCollection_deprecated();return!["view","sql"].includes(e.template)||(e==null?void 0:e.writableView)}}]}),io=e=>{const{collectionName:r,fieldNames:t,dataSource:o}=e;return{type:"void","x-acl-action":`${r}:list`,"x-decorator":"GanttBlockProvider","x-decorator-props":{collection:r,dataSource:o,action:"list",fieldNames:t,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gantt","x-component":"CardItem",properties:{[I.uid()]:{type:"void","x-component":"Gantt","x-use-component-props":"useGanttBlockProps",properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"gantt:configureActions",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-designer":"TableV2.ActionColumnDesigner","x-initializer":"table:configureItemActions",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"tb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}}}}},lo=()=>{const{insert:e}=d.useSchemaInitializer(),{t:r}=be.useTranslation(),{getCollectionFields:t}=d.useCollectionManager_deprecated(),o=h.useContext(I.SchemaOptionsContext),{theme:n}=d.useGlobalTheme(),s=d.useSchemaInitializerItem();return c.jsx(d.DataBlockInitializer,de(H({},s),{componentType:"Gantt",icon:c.jsx(Ne.FormOutlined,{}),onCreateBlockSchema:a=>ne(null,[a],function*({item:i}){var w,y,B;const l=t(i.name,i.dataSource),u=(w=l==null?void 0:l.filter(p=>p.type==="string"))==null?void 0:w.map(p=>{var S;return{label:(S=p==null?void 0:p.uiSchema)==null?void 0:S.title,value:p.name}}),f=(y=l==null?void 0:l.filter(p=>p.type==="date"))==null?void 0:y.map(p=>{var S;return{label:(S=p==null?void 0:p.uiSchema)==null?void 0:S.title,value:p.name}}),x=(B=l==null?void 0:l.filter(p=>p.type==="float"))==null?void 0:B.map(p=>{var S;return{label:(S=p==null?void 0:p.uiSchema)==null?void 0:S.title,value:p.name}}),P=yield d.FormDialog(r("Create gantt block"),()=>c.jsx(d.SchemaComponentOptions,{scope:o.scope,components:H({},o.components),children:c.jsx(J.FormLayout,{layout:"vertical",children:c.jsx(d.SchemaComponent,{schema:{properties:{title:{title:r("Title field"),enum:u,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:r("Start date field"),enum:f,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:r("End date field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:r("Progress field"),enum:x,"x-component":"Select","x-decorator":"FormItem"},range:{title:r("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})})}),n).open({initialValues:{}});e(io({collectionName:i.name,dataSource:i.dataSource,fieldNames:H({},P)}))})}))};Ce.ActionBar=d.ActionBar,Ce.ViewMode=E,Ce.Designer=no,Ce.Event=Rt;const Vt=h.memo(e=>c.jsx(d.SchemaComponentOptions,{components:{Gantt:Ce,GanttBlockInitializer:lo,GanttBlockProvider:tr},scope:{useGanttBlockProps:ut},children:e.children}));Vt.displayName="GanttProvider";class Lt extends d.Plugin{load(){return ne(this,null,function*(){this.app.use(Vt),this.app.schemaSettingsManager.add(so),this.app.schemaInitializerManager.add(ao);const r=this.app.schemaInitializerManager.get("page:addBlock");r==null||r.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"}),this.app.addScopes({useGanttBlockProps:ut})})}}V.Gantt=Ce,V.GanttPlugin=Lt,V.default=Lt,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.
|
|
3
|
+
"@tachybase/client": "1.5.0",
|
|
4
4
|
"@tachybase/schema": "1.3.52",
|
|
5
5
|
"@ant-design/icons": "5.6.1",
|
|
6
6
|
"@tego/client": "1.3.52",
|
|
7
|
-
"react-i18next": "
|
|
7
|
+
"react-i18next": "16.2.1",
|
|
8
8
|
"@tego/server": "1.3.52",
|
|
9
9
|
"@tachybase/test": "1.3.52",
|
|
10
10
|
"antd": "5.22.5",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-block-gantt",
|
|
3
3
|
"displayName": "Block: Gantt",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "Provides Gantt block.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Blocks"
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@ant-design/icons": "^5.6.1",
|
|
14
|
-
"@ctrl/tinycolor": "^
|
|
14
|
+
"@ctrl/tinycolor": "^4.2.0",
|
|
15
15
|
"@tachybase/schema": "*",
|
|
16
16
|
"@tachybase/test": "*",
|
|
17
17
|
"@tego/client": "*",
|
|
18
18
|
"@tego/server": "*",
|
|
19
19
|
"antd": "5.22.5",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
|
-
"react-i18next": "
|
|
22
|
-
"@tachybase/client": "1.
|
|
21
|
+
"react-i18next": "16.2.1",
|
|
22
|
+
"@tachybase/client": "1.5.0"
|
|
23
23
|
},
|
|
24
24
|
"description.zh-CN": "提供甘特图卡片。",
|
|
25
25
|
"displayName.zh-CN": "卡片:甘特图",
|