vue3-gantt-elastic
Version:
gantt-elastic Project was wrapped with vue3 based on gantt-elastic-wrapvue3
34 lines • 164 kB
JavaScript
(function(gt,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(gt=typeof globalThis!="undefined"?globalThis:gt||self,i(gt.GanttElastic={},gt.Vue))})(this,function(gt,i){"use strict";var bs=Object.defineProperty,ws=Object.defineProperties;var xs=Object.getOwnPropertyDescriptors;var rr=Object.getOwnPropertySymbols;var vs=Object.prototype.hasOwnProperty,ks=Object.prototype.propertyIsEnumerable;var ir=(gt,i,zt)=>i in gt?bs(gt,i,{enumerable:!0,configurable:!0,writable:!0,value:zt}):gt[i]=zt,u=(gt,i)=>{for(var zt in i||(i={}))vs.call(i,zt)&&ir(gt,zt,i[zt]);if(rr)for(var zt of rr(i))ks.call(i,zt)&&ir(gt,zt,i[zt]);return gt},wt=(gt,i)=>ws(gt,xs(i));var zt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},_e={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(zt,function(){var r=1e3,n=6e4,a=36e5,o="millisecond",l="second",g="minute",m="hour",p="day",T="week",k="month",L="quarter",Y="year",_="date",x="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,U=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},yt=function(V,S,b){var D=String(V);return!D||D.length>=S?V:""+Array(S+1-D.length).join(b)+V},xt={s:yt,z:function(V){var S=-V.utcOffset(),b=Math.abs(S),D=Math.floor(b/60),v=b%60;return(S<=0?"+":"-")+yt(D,2,"0")+":"+yt(v,2,"0")},m:function V(S,b){if(S.date()<b.date())return-V(b,S);var D=12*(b.year()-S.year())+(b.month()-S.month()),v=S.clone().add(D,k),W=b-v<0,j=S.clone().add(D+(W?-1:1),k);return+(-(D+(b-v)/(W?v-j:j-v))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:k,y:Y,w:T,d:p,D:_,h:m,m:g,s:l,ms:o,Q:L}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},ut="en",it={};it[ut]=I;var et=function(V){return V instanceof Z},ft=function V(S,b,D){var v;if(!S)return ut;if(typeof S=="string"){var W=S.toLowerCase();it[W]&&(v=W),b&&(it[W]=b,v=W);var j=S.split("-");if(!v&&j.length>1)return V(j[0])}else{var F=S.name;it[F]=S,v=F}return!D&&v&&(ut=v),v||!D&&ut},C=function(V,S){if(et(V))return V.clone();var b=typeof S=="object"?S:{};return b.date=V,b.args=arguments,new Z(b)},A=xt;A.l=ft,A.i=et,A.w=function(V,S){return C(V,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var Z=function(){function V(b){this.$L=ft(b.locale,null,!0),this.parse(b)}var S=V.prototype;return S.parse=function(b){this.$d=function(D){var v=D.date,W=D.utc;if(v===null)return new Date(NaN);if(A.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var j=v.match(O);if(j){var F=j[2]-1||0,rt=(j[7]||"0").substring(0,3);return W?new Date(Date.UTC(j[1],F,j[3]||1,j[4]||0,j[5]||0,j[6]||0,rt)):new Date(j[1],F,j[3]||1,j[4]||0,j[5]||0,j[6]||0,rt)}}return new Date(v)}(b),this.$x=b.x||{},this.init()},S.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},S.$utils=function(){return A},S.isValid=function(){return this.$d.toString()!==x},S.isSame=function(b,D){var v=C(b);return this.startOf(D)<=v&&v<=this.endOf(D)},S.isAfter=function(b,D){return C(b)<this.startOf(D)},S.isBefore=function(b,D){return this.endOf(D)<C(b)},S.$g=function(b,D,v){return A.u(b)?this[D]:this.set(v,b)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(b,D){var v=this,W=!!A.u(D)||D,j=A.p(b),F=function(Lt,vt){var Mt=A.w(v.$u?Date.UTC(v.$y,vt,Lt):new Date(v.$y,vt,Lt),v);return W?Mt:Mt.endOf(p)},rt=function(Lt,vt){return A.w(v.toDate()[Lt].apply(v.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(vt)),v)},J=this.$W,G=this.$M,R=this.$D,q="set"+(this.$u?"UTC":"");switch(j){case Y:return W?F(1,0):F(31,11);case k:return W?F(1,G):F(0,G+1);case T:var Vt=this.$locale().weekStart||0,Dt=(J<Vt?J+7:J)-Vt;return F(W?R-Dt:R+(6-Dt),G);case p:case _:return rt(q+"Hours",0);case m:return rt(q+"Minutes",1);case g:return rt(q+"Seconds",2);case l:return rt(q+"Milliseconds",3);default:return this.clone()}},S.endOf=function(b){return this.startOf(b,!1)},S.$set=function(b,D){var v,W=A.p(b),j="set"+(this.$u?"UTC":""),F=(v={},v[p]=j+"Date",v[_]=j+"Date",v[k]=j+"Month",v[Y]=j+"FullYear",v[m]=j+"Hours",v[g]=j+"Minutes",v[l]=j+"Seconds",v[o]=j+"Milliseconds",v)[W],rt=W===p?this.$D+(D-this.$W):D;if(W===k||W===Y){var J=this.clone().set(_,1);J.$d[F](rt),J.init(),this.$d=J.set(_,Math.min(this.$D,J.daysInMonth())).$d}else F&&this.$d[F](rt);return this.init(),this},S.set=function(b,D){return this.clone().$set(b,D)},S.get=function(b){return this[A.p(b)]()},S.add=function(b,D){var v,W=this;b=Number(b);var j=A.p(D),F=function(G){var R=C(W);return A.w(R.date(R.date()+Math.round(G*b)),W)};if(j===k)return this.set(k,this.$M+b);if(j===Y)return this.set(Y,this.$y+b);if(j===p)return F(1);if(j===T)return F(7);var rt=(v={},v[g]=n,v[m]=a,v[l]=r,v)[j]||1,J=this.$d.getTime()+b*rt;return A.w(J,this)},S.subtract=function(b,D){return this.add(-1*b,D)},S.format=function(b){var D=this,v=this.$locale();if(!this.isValid())return v.invalidDate||x;var W=b||"YYYY-MM-DDTHH:mm:ssZ",j=A.z(this),F=this.$H,rt=this.$m,J=this.$M,G=v.weekdays,R=v.months,q=function(vt,Mt,$t,Nt){return vt&&(vt[Mt]||vt(D,W))||$t[Mt].slice(0,Nt)},Vt=function(vt){return A.s(F%12||12,vt,"0")},Dt=v.meridiem||function(vt,Mt,$t){var Nt=vt<12?"AM":"PM";return $t?Nt.toLowerCase():Nt},Lt={YY:String(this.$y).slice(-2),YYYY:this.$y,M:J+1,MM:A.s(J+1,2,"0"),MMM:q(v.monthsShort,J,R,3),MMMM:q(R,J),D:this.$D,DD:A.s(this.$D,2,"0"),d:String(this.$W),dd:q(v.weekdaysMin,this.$W,G,2),ddd:q(v.weekdaysShort,this.$W,G,3),dddd:G[this.$W],H:String(F),HH:A.s(F,2,"0"),h:Vt(1),hh:Vt(2),a:Dt(F,rt,!0),A:Dt(F,rt,!1),m:String(rt),mm:A.s(rt,2,"0"),s:String(this.$s),ss:A.s(this.$s,2,"0"),SSS:A.s(this.$ms,3,"0"),Z:j};return W.replace(U,function(vt,Mt){return Mt||Lt[vt]||j.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(b,D,v){var W,j=A.p(D),F=C(b),rt=(F.utcOffset()-this.utcOffset())*n,J=this-F,G=A.m(this,F);return G=(W={},W[Y]=G/12,W[k]=G,W[L]=G/3,W[T]=(J-rt)/6048e5,W[p]=(J-rt)/864e5,W[m]=J/a,W[g]=J/n,W[l]=J/r,W)[j]||J,v?G:A.a(G)},S.daysInMonth=function(){return this.endOf(k).$D},S.$locale=function(){return it[this.$L]},S.locale=function(b,D){if(!b)return this.$L;var v=this.clone(),W=ft(b,D,!0);return W&&(v.$L=W),v},S.clone=function(){return A.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},V}(),ot=Z.prototype;return C.prototype=ot,[["$ms",o],["$s",l],["$m",g],["$H",m],["$W",p],["$M",k],["$y",Y],["$D",_]].forEach(function(V){ot[V[1]]=function(S){return this.$g(S,V[0],V[1])}}),C.extend=function(V,S){return V.$i||(V(S,Z,C),V.$i=!0),C},C.locale=ft,C.isDayjs=et,C.unix=function(V){return C(1e3*V)},C.en=it[ut],C.Ls=it,C.p={},C})})(_e);var tt=_e.exports,pt=(e,t)=>{const r=e.__vccOpts||e;for(const[n,a]of t)r[n]=a;return r};const or={name:"Expander",inject:["root"],props:["tasks","options","type"],data(){return{border:.5,borderStyle:{"stroke-width":.5},lineOffset:5}},computed:{style(){if(this.type!=="taskList")return{};const e=this.root.state.options.taskList.expander.margin;return{"padding-left":this.tasks[0].parents.length*this.root.state.options.taskList.expander.padding+e+"px",margin:"auto 0"}},allChildren(){const e=[];return this.tasks.forEach(t=>{t.allChildren.forEach(r=>{e.push(r)})}),e},collapsed(){if(this.tasks.length===0)return!1;let e=0;for(let t=0,r=this.tasks.length;t<r;t++)this.tasks[t].collapsed&&e++;return e===this.tasks.length}},methods:{getClassPrefix(e=!0){return`${e?"gantt-elastic__":""}${this.options.type}-expander`},toggle(){if(this.tasks.length===0)return;const e=!this.collapsed;this.tasks.forEach(t=>{t.collapsed=e})}}},sr=["width","height"],nr=["x","y","width","height"],ar=["x1","y1","x2","y2"],lr=["x1","y1","x2","y2"];function cr(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(o.getClassPrefix()+"-wrapper"),style:i.normalizeStyle(u(u({},o.root.style[o.getClassPrefix(!1)+"-wrapper"]),o.style))},[o.allChildren.length?(i.openBlock(),i.createElementBlock("svg",{key:0,class:i.normalizeClass(o.getClassPrefix()+"-content"),style:i.normalizeStyle(u({},o.root.style[o.getClassPrefix(!1)+"-content"])),width:r.options.size,height:r.options.size,onClick:t[0]||(t[0]=(...l)=>o.toggle&&o.toggle(...l))},[i.createElementVNode("rect",{class:i.normalizeClass(o.getClassPrefix()+"-border"),style:i.normalizeStyle(u(u({},o.root.style[o.getClassPrefix(!1)+"-border"]),a.borderStyle)),x:a.border,y:a.border,width:r.options.size-a.border*2,height:r.options.size-a.border*2,rx:"2",ry:"2"},null,14,nr),o.allChildren.length?(i.openBlock(),i.createElementBlock("line",{key:0,class:i.normalizeClass(o.getClassPrefix()+"-line"),style:i.normalizeStyle(u({},o.root.style[o.getClassPrefix(!1)+"-line"])),x1:a.lineOffset,y1:r.options.size/2,x2:r.options.size-a.lineOffset,y2:r.options.size/2},null,14,ar)):i.createCommentVNode("",!0),o.collapsed?(i.openBlock(),i.createElementBlock("line",{key:1,class:i.normalizeClass(o.getClassPrefix()+"-line"),style:i.normalizeStyle(u({},o.root.style[o.getClassPrefix(!1)+"-line"])),x1:r.options.size/2,y1:a.lineOffset,x2:r.options.size/2,y2:r.options.size-a.lineOffset},null,14,lr)):i.createCommentVNode("",!0)],14,sr)):i.createCommentVNode("",!0)],6)}var Yt=pt(or,[["render",cr]]);const dr={name:"TaskListHeader",components:{TaskListExpander:Yt},inject:["root"],data(){return{resizer:{moving:!1,x:0}}},computed:{collapsible(){return this.root.state.tasks.filter(e=>e.allChildren.length>0)}},methods:{getStyle(e){return{width:e.finalWidth+"px"}},resizerMouseDown(e,t){this.resizer.moving||(this.resizer.moving=t,this.resizer.x=e.clientX,this.resizer.initialWidth=t.width,this.$root.emitter.emit("taskList-column-width-change-start",this.resizer.moving))},resizerMouseMove(e){if(this.resizer.moving){const t=this.resizer.moving.width;this.resizer.moving.width=this.resizer.initialWidth+e.clientX-this.resizer.x,this.resizer.moving.width<this.root.state.options.taskList.minWidth&&(this.resizer.moving.width=this.root.state.options.taskList.minWidth),t!==this.resizer.moving.width&&this.$root.emitter.emit("taskList-column-width-change",this.resizer.moving)}},resizerMouseUp(e){this.resizer.moving&&(this.$root.emitter.emit("taskList-column-width-change-stop",this.resizer.moving),this.resizer.moving=!1)}},created(){this.mouseUpListener=document.addEventListener("mouseup",this.resizerMouseUp.bind(this)),this.mouseMoveListener=document.addEventListener("mousemove",this.resizerMouseMove.bind(this)),this.$root.emitter.on("main-view-mousemove",this.resizerMouseMove),this.$root.emitter.on("main-view-mouseup",this.resizerMouseUp)},beforeDestroy(){document.removeEventListener("mouseup",this.resizerMouseUp),document.removeEventListener("mousemove",this.resizerMouseMove)}},hr=["column"],pr=["column","onMousedown"];function ur(e,t,r,n,a,o){const l=i.resolveComponent("task-list-expander");return i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__task-list-header",style:i.normalizeStyle(wt(u({},o.root.style["task-list-header"]),{height:`${o.root.state.options.calendar.height}px`,"margin-bottom":`${o.root.state.options.calendar.gap}px`}))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.root.getTaskListColumns,g=>(i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__task-list-header-column",style:i.normalizeStyle(u(u(u({},o.root.style["task-list-header-column"]),g.style["task-list-header-column"]),o.getStyle(g))),key:g._id},[g.expander?(i.openBlock(),i.createBlock(l,{key:0,tasks:o.collapsible,options:o.root.state.options.taskList.expander},null,8,["tasks","options"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"gantt-elastic__task-list-header-label",style:i.normalizeStyle(u(u({},o.root.style["task-list-header-label"]),g.style["task-list-header-label"])),column:g,onMouseup:t[0]||(t[0]=(...m)=>o.resizerMouseUp&&o.resizerMouseUp(...m))},i.toDisplayString(g.label),45,hr),i.createElementVNode("div",{class:"gantt-elastic__task-list-header-resizer-wrapper",style:i.normalizeStyle(u(u({},o.root.style["task-list-header-resizer-wrapper"]),g.style["task-list-header-resizer-wrapper"])),column:g,onMousedown:m=>o.resizerMouseDown(m,g)},[i.createElementVNode("div",{class:"gantt-elastic__task-list-header-resizer",style:i.normalizeStyle(u(u({},o.root.style["task-list-header-resizer"]),g.style["task-list-header-resizer"]))},[i.createElementVNode("div",{class:"gantt-elastic__task-list-header-resizer-dot",style:i.normalizeStyle(u(u({},o.root.style["task-list-header-resizer-dot"]),g.style["task-list-header-resizer-dot"]))},null,4),i.createElementVNode("div",{class:"gantt-elastic__task-list-header-resizer-dot",style:i.normalizeStyle(u(u({},o.root.style["task-list-header-resizer-dot"]),g.style["task-list-header-resizer-dot"]))},null,4),i.createElementVNode("div",{class:"gantt-elastic__task-list-header-resizer-dot",style:i.normalizeStyle(u(u({},o.root.style["task-list-header-resizer-dot"]),g.style["task-list-header-resizer-dot"]))},null,4)],4)],44,pr)],4))),128))],4)}var fr=pt(dr,[["render",ur]]);const mr={name:"ItemColumn",inject:["root"],props:["column","task"],data(){return{}},methods:{emitEvent(e,t){typeof this.column.events!="undefined"&&typeof this.column.events[e]=="function"&&this.column.events[e]({event:t,data:this.task,column:this.column}),this.$root.emitter.emit(`taskList-${this.task.type}-${e}`,{event:t,data:this.task,column:this.column})}},computed:{html(){return typeof this.column.html!="undefined"&&this.column.html===!0},value(){return typeof this.column.value=="function"?this.column.value(this.task):this.task[this.column.value]},itemColumnStyle(){return wt(u(u({},this.root.style["task-list-item-column"]),this.column.style["task-list-item-column"]),{width:this.column.finalWidth+"px",height:this.column.height+"px"})},wrapperStyle(){return u(u({},this.root.style["task-list-item-value-wrapper"]),this.column.style["task-list-item-value-wrapper"])},containerStyle(){return u(u({},this.root.style["task-list-item-value-container"]),this.column.style["task-list-item-value-container"])},valueStyle(){return u(u({},this.root.style["task-list-item-value"]),this.column.style["task-list-item-value"])}}},gr=["innerHTML"];function yr(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__task-list-item-column",style:i.normalizeStyle(o.itemColumnStyle)},[i.createElementVNode("div",{class:"gantt-elastic__task-list-item-value-wrapper",style:i.normalizeStyle(o.wrapperStyle)},[i.renderSlot(e.$slots,"default"),i.createElementVNode("div",{class:"gantt-elastic__task-list-item-value-container",style:i.normalizeStyle(o.containerStyle)},[o.html?(i.openBlock(),i.createElementBlock("div",{key:1,class:"gantt-elastic__task-list-item-value",style:i.normalizeStyle(o.valueStyle),onClick:t[12]||(t[12]=l=>o.emitEvent("click",l)),onDblclick:t[13]||(t[13]=l=>o.emitEvent("dblclick",l)),onMouseenter:t[14]||(t[14]=l=>o.emitEvent("mouseenter",l)),onMouseover:t[15]||(t[15]=l=>o.emitEvent("mouseover",l)),onMouseout:t[16]||(t[16]=l=>o.emitEvent("mouseout",l)),onMousemove:t[17]||(t[17]=l=>o.emitEvent("mousemove",l)),onMousedown:t[18]||(t[18]=l=>o.emitEvent("mousedown",l)),onMouseup:t[19]||(t[19]=l=>o.emitEvent("mouseup",l)),onMousewheel:t[20]||(t[20]=l=>o.emitEvent("mousewheel",l)),onTouchstart:t[21]||(t[21]=l=>o.emitEvent("touchstart",l)),onTouchmove:t[22]||(t[22]=l=>o.emitEvent("touchmove",l)),onTouchend:t[23]||(t[23]=l=>o.emitEvent("touchend",l)),innerHTML:o.value},null,44,gr)):(i.openBlock(),i.createElementBlock("div",{key:0,class:"gantt-elastic__task-list-item-value",style:i.normalizeStyle(o.valueStyle),onClick:t[0]||(t[0]=l=>o.emitEvent("click",l)),onDblclick:t[1]||(t[1]=l=>o.emitEvent("dblclick",l)),onMouseenter:t[2]||(t[2]=l=>o.emitEvent("mouseenter",l)),onMouseover:t[3]||(t[3]=l=>o.emitEvent("mouseover",l)),onMouseout:t[4]||(t[4]=l=>o.emitEvent("mouseout",l)),onMousemove:t[5]||(t[5]=l=>o.emitEvent("mousemove",l)),onMousedown:t[6]||(t[6]=l=>o.emitEvent("mousedown",l)),onMouseup:t[7]||(t[7]=l=>o.emitEvent("mouseup",l)),onMousewheel:t[8]||(t[8]=l=>o.emitEvent("mousewheel",l)),onTouchstart:t[9]||(t[9]=l=>o.emitEvent("touchstart",l)),onTouchmove:t[10]||(t[10]=l=>o.emitEvent("touchmove",l)),onTouchend:t[11]||(t[11]=l=>o.emitEvent("touchend",l))},i.toDisplayString(o.value),37))],4)],4)],4)}var br=pt(mr,[["render",yr]]);const wr={name:"TaskListItem",components:{TaskListExpander:Yt,ItemColumn:br},inject:["root"],props:["task"],data(){return{}},computed:{columns(){return this.root.state.options.taskList.columns}}};function xr(e,t,r,n,a,o){const l=i.resolveComponent("task-list-expander"),g=i.resolveComponent("item-column");return i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__task-list-item",style:i.normalizeStyle(u({},o.root.style["task-list-item"]))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.columns,m=>(i.openBlock(),i.createBlock(g,{key:m._id,column:m,task:r.task},{default:i.withCtx(()=>[m.expander?(i.openBlock(),i.createBlock(l,{key:0,tasks:[r.task],options:o.root.state.options.taskList.expander,type:"taskList"},null,8,["tasks","options"])):i.createCommentVNode("",!0)]),_:2},1032,["column","task"]))),128))],4)}var vr=pt(wr,[["render",xr]]);const kr={name:"TaskList",components:{TaskListHeader:fr,TaskListItem:vr},inject:["root"],data(){return{}},mounted(){this.root.state.refs.taskListWrapper=this.$refs.taskListWrapper,this.root.state.refs.taskList=this.$refs.taskList,this.root.state.refs.taskListItems=this.$refs.taskListItems}};function _r(e,t,r,n,a,o){const l=i.resolveComponent("task-list-header"),g=i.resolveComponent("task-list-item");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__task-list-wrapper",ref:"taskListWrapper",style:i.normalizeStyle(wt(u({},o.root.style["task-list-wrapper"]),{width:"100%",height:"100%"}))},[i.createElementVNode("div",{class:"gantt-elastic__task-list",style:i.normalizeStyle(u({},o.root.style["task-list"])),ref:"taskList"},[i.createVNode(l),i.createElementVNode("div",{class:"gantt-elastic__task-list-items",ref:"taskListItems",style:i.normalizeStyle(wt(u({},o.root.style["task-list-items"]),{height:o.root.state.options.rowsHeight+"px"}))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.root.visibleTasks,m=>(i.openBlock(),i.createBlock(g,{key:m.id,task:m},null,8,["task"]))),128))],4)],4)],4)),[[i.vShow,o.root.state.options.taskList.display]])}var Sr=pt(kr,[["render",_r]]);const Er={name:"Grid",inject:["root"],data(){return{}},created(){this.$root.emitter.on("recenterPosition",this.recenterPosition)},mounted(){this.$nextTick(()=>{this.$nextTick(()=>{this.root.scrollToTime(this.timeLinePosition.time)})})},methods:{recenterPosition(){this.root.scrollToTime(this.timeLinePosition.time)}},computed:{verticalLines(){let e=[];const t=this.root.state;return t.options.times.steps.forEach(r=>{this.root.isInsideViewPort(r.offset.px,1)&&e.push({key:r.time,x1:r.offset.px,y1:0,x2:r.offset.px,y2:t.tasks.length*(t.options.row.height+t.options.chart.grid.horizontal.gap*2)+this.root.style["grid-line-vertical"]["stroke-width"]})}),e},horizontalLines(){let e=[];const t=this.root.state.options;let r=this.root.visibleTasks;for(let n=0,a=r.length;n<=a;n++){const o=n*(t.row.height+t.chart.grid.horizontal.gap*2)+this.root.style["grid-line-vertical"]["stroke-width"]/2;e.push({key:"hl"+n,x1:0,y1:o,x2:"100%",y2:o})}return e},inViewPort(){return e=>{const t=this.root.state.options;return e.x1>=t.scroll.chart.left&&e.x1<=t.scroll.chart.right}},timeLinePosition(){const e=new Date,t=e.getTime(),r=this.root.timeToPixelOffsetX(t),n={x:0,y1:0,y2:"100%",dateTime:"",time:t};return n.x=r,n.dateTime=e.toLocaleDateString(),n}}},zr=["width","height"],Mr=["x1","y1","x2","y2"],Tr=["x1","y1","x2","y2"],Cr=["x1","y1","x2","y2"];function Or(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("svg",{class:"gantt-elastic__grid-lines-wrapper",style:i.normalizeStyle(u({},o.root.style["grid-lines-wrapper"])),ref:"chart",x:"0",y:"0",width:o.root.state.options.width,height:o.root.state.options.allVisibleTasksHeight,xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("g",{class:"gantt-elastic__grid-lines",style:i.normalizeStyle(u({},o.root.style["grid-lines"]))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.horizontalLines,l=>(i.openBlock(),i.createElementBlock("line",{class:"gantt-elastic__grid-line-horizontal",style:i.normalizeStyle(u({},o.root.style["grid-line-horizontal"])),key:l.key,x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2},null,12,Mr))),128)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.verticalLines,l=>(i.openBlock(),i.createElementBlock("line",{class:"gantt-elastic__grid-line-vertical",style:i.normalizeStyle(u({},o.root.style["grid-line-vertical"])),key:l.key,x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2},null,12,Tr))),128)),i.createElementVNode("line",{class:"gantt-elastic__grid-line-time",style:i.normalizeStyle(u({},o.root.style["grid-line-time"])),x1:o.timeLinePosition.x,y1:o.timeLinePosition.y1,x2:o.timeLinePosition.x,y2:o.timeLinePosition.y2},null,12,Cr)],4)],12,zr)}var Pr=pt(Er,[["render",Or]]);const Lr={name:"DaysHighlight",inject:["root"],data(){return{}},methods:{getKey(e){return tt(e.time).format("YYYY-MM-DD")}},computed:{workingDays(){return this.root.state.options.times.steps.filter(e=>this.root.state.options.calendar.workingDays.indexOf(tt(e.time).day())===-1)},showWorkingDays(){const e=this.root.state.options.calendar;return!!(typeof e.workingDays!="undefined"&&Array.isArray(e.workingDays)&&e.workingDays.length)}}},Vr=["x","width"];function Dr(e,t,r,n,a,o){return o.showWorkingDays?(i.openBlock(),i.createElementBlock("g",{key:0,class:"gantt-elastic__chart-days-highlight-container",style:i.normalizeStyle(u({},o.root.style["chart-days-highlight-container"]))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.workingDays,l=>(i.openBlock(),i.createElementBlock("rect",{class:"gantt-elastic__chart-days-highlight-rect",key:o.getKey(l),x:l.offset.px,y:"0",width:l.width.px,height:"100%",style:i.normalizeStyle(u({},o.root.style["chart-days-highlight-rect"]))},null,12,Vr))),128))],4)):i.createCommentVNode("",!0)}var Nr=pt(Lr,[["render",Dr]]);const Br={name:"CalendarRow",inject:["root"],props:["items","which"],data(){return{}},methods:{getTextX(e){let t=e.x+e.width/2-e.textWidth/2;if(this.which==="month"&&this.root.isInsideViewPort(e.x,e.width,0)){let r=this.root.state.options.scroll.chart.right-this.root.state.options.scroll.chart.left;t=this.root.state.options.scroll.chart.left+r/2-e.textWidth/2+2,t+e.textWidth+2>e.x+e.width?t=e.x+e.width-e.textWidth-2:t<e.x&&(t=e.x+2)}return t-e.x}},computed:{rowStyle(){return u(u({},this.root.style["calendar-row"]),this.root.style["calendar-row--"+this.which])},rectStyle(){return u(u({},this.root.style["calendar-row-rect"]),this.root.style["calendar-row-rect--"+this.which])},rectChildStyle(){const e=u(u({},this.root.style["calendar-row-rect-child"]),this.root.style["calendar-row-rect-child--"+this.which]),t=[];for(let r of this.items){const n=[];for(let a of r.children)n.push(wt(u({},e),{width:a.width+"px",height:a.height+"px"}));t.push(n)}return t},textStyle(){const e=u(u({},this.root.style["calendar-row-text"]),this.root.style["calendar-row-text--"+this.which]);return t=>{const r=u({},e);return this.which==="month"&&(r.left=this.getTextX(t)+"px"),r}}}};function jr(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass("gantt-elastic__calendar-row gantt-elastic__calendar-row--"+r.which),style:i.normalizeStyle(o.rowStyle)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.items,(l,g)=>(i.openBlock(),i.createElementBlock("div",{key:l.key,class:i.normalizeClass("gantt-elastic__calendar-row-rect gantt-elastic__calendar-row-rect--"+r.which),style:i.normalizeStyle(o.rectStyle)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.children,(m,p)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass("gantt-elastic__calendar-row-rect-child gantt-elastic__calendar-row-rect-child--"+r.which),key:m.key,style:i.normalizeStyle(o.rectChildStyle[g][p])},[i.createElementVNode("div",{class:i.normalizeClass("gantt-elastic__calendar-row-text gantt-elastic__calendar-row-text--"+r.which),style:i.normalizeStyle(o.textStyle(m))},i.toDisplayString(m.label),7)],6))),128))],6))),128))],6)}var Hr=pt(Br,[["render",jr]]);const Ar={name:"Calendar",components:{CalendarRow:Hr},inject:["root"],data(){return{}},methods:{howManyHoursFit(e){let n=this.root.state.options.times.steps[e].width.px,a=Object.keys(this.root.state.options.calendar.hour.format);for(let o=24;o>1;o=Math.ceil(o/2))for(let l of a)if((this.root.state.options.calendar.hour.maxWidths[l]+3)*o<=n&&o>1)return{count:o,type:l};return{count:0,type:""}},howManyDaysFit(){let r=this.root.state.options.width,n=Object.keys(this.root.state.options.calendar.day.format);for(let a=this.root.state.options.times.steps.length;a>1;a=Math.ceil(a/2))for(let o of n)if((this.root.state.options.calendar.day.maxWidths[o]+3)*a<=r&&a>1)return{count:a,type:o};return{count:0,type:""}},howManyMonthsFit(){let r=this.root.state.options.width,n=Object.keys(this.root.state.options.calendar.month.format);tt(this.root.state.options.times.firstTime).clone(),this.root.state.options.times.lastTime;let o=this.root.monthsCount(this.root.state.options.times.firstTime,this.root.state.options.times.lastTime);if(o===1){for(let l of n)if(this.root.state.options.calendar.month.maxWidths[l]+3<=r)return{count:1,type:l}}for(let l=o;l>1;l=Math.ceil(l/2))for(let g of n)if((this.root.state.options.calendar.month.maxWidths[g]+3)*l<=r&&l>1)return{count:l,type:g};return{count:0,type:n[0]}},generateHours(){let e=[];if(!this.root.state.options.calendar.hour.display)return e;const t=this.root.state.options.times.steps;this.root.state.options.locale.name;for(let r=0,n=t.length;r<n;r++){const a=this.howManyHoursFit(r);if(a.count===0)continue;const o={key:r+"step",children:[]},l=24/a.count,g=t[r].width.px/a.count;for(let m=0,p=a.count;m<p;m++){const T=m*l;let k=r;r>0&&(k=r-Math.floor(r/24)*24);let L=0;typeof this.root.state.options.calendar.hour.widths[k]!="undefined"&&(L=this.root.state.options.calendar.hour.widths[k][a.type]);let Y=t[r].offset.px+g*m;o.children.push({index:r,key:"h"+m,x:Y,y:this.root.state.options.calendar.day.height+this.root.state.options.calendar.month.height,width:g,textWidth:L,height:this.root.state.options.calendar.hour.height,label:this.root.state.options.calendar.hour.formatted[a.type][T]})}e.push(o)}return e},generateDays(){let e=[];if(!this.root.state.options.calendar.day.display)return e;const t=this.howManyDaysFit();if(t.count===0)return e;const r=this.root.state.options.times.steps,n=this.root.state.options.locale.name,a=Math.ceil(r.length/t.count);for(let o=0,l=r.length;o<l;o+=a){let g=0;for(let k=0;k<a;k++)typeof r[o+k]!="undefined"&&(g+=r[o+k].width.px);const m=tt(r[o].time);let p=0;typeof this.root.state.options.calendar.day.widths[o]!="undefined"&&(p=this.root.state.options.calendar.day.widths[o][t.type]);let T=r[o].offset.px;e.push({index:o,key:r[o].time+"d",x:T,y:this.root.state.options.calendar.month.height,width:g,textWidth:p,height:this.root.state.options.calendar.day.height,label:this.root.state.options.calendar.day.format[t.type](m.locale(n))})}return e.map(o=>({key:o.key,children:[o]}))},generateMonths(){let e=[];if(!this.root.state.options.calendar.month.display)return e;const t=this.howManyMonthsFit();if(t.count===0)return e;this.root.state.options.times.steps;const r=this.root.state.options.locale.name;let n=Object.keys(this.root.state.options.calendar.month.format),a=tt(this.root.state.options.times.firstTime);for(let o=0;o<t.count;o++){let l=0,g=Number.MAX_SAFE_INTEGER,m=tt(a).add(1,"month").startOf("month");m.valueOf()>this.root.state.options.times.lastTime&&(m=tt(this.root.state.options.times.lastTime));for(let Y=0,_=this.root.state.options.times.steps.length;Y<_;Y++){let x=this.root.state.options.times.steps[Y];x.time>=a.valueOf()&&x.time<m.valueOf()&&(l+=x.width.px,x.offset.px<g&&(g=x.offset.px))}let p="",T;for(let Y of n)this.root.state.options.calendar.month.maxWidths[Y]+2<=l&&(p=this.root.state.options.calendar.month.format[Y](a.locale(r)),T=Y);let k=0;typeof this.root.state.options.calendar.month.widths[o]!="undefined"&&(k=this.root.state.options.calendar.month.widths[o][T]);let L=g;e.push({index:o,key:o+"m",x:L,y:0,width:l,textWidth:k,choosenFormatName:T,height:this.root.state.options.calendar.month.height,label:p}),a=a.add(1,"month").startOf("month"),a.valueOf()>this.root.state.options.times.lastTime&&(a=tt(this.root.state.options.times.lastTime))}return e.map(o=>({key:o.key,children:[o]}))},calculateCalendarDimensions({hours:e,days:t,months:r}){let n=0;this.root.state.options.calendar.hour.display&&e.length>0&&(n+=this.root.state.options.calendar.hour.height),this.root.state.options.calendar.day.display&&t.length>0&&(n+=this.root.state.options.calendar.day.height),this.root.state.options.calendar.month.display&&r.length>0&&(n+=this.root.state.options.calendar.month.height),this.root.state.options.calendar.height=n}},computed:{dates(){const e=this.generateHours(),t=this.generateDays(),r=this.generateMonths(),n={hours:e,days:t,months:r};return this.calculateCalendarDimensions(n),n}}};function Wr(e,t,r,n,a,o){const l=i.resolveComponent("calendar-row");return i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__calendar-wrapper",style:i.normalizeStyle(wt(u({},o.root.style["calendar-wrapper"]),{width:o.root.state.options.width+"px"}))},[i.createElementVNode("div",{class:"gantt-elastic__calendar",style:i.normalizeStyle(wt(u({},o.root.style.calendar),{width:o.root.state.options.width+"px"}))},[o.root.state.options.calendar.month.display?(i.openBlock(),i.createBlock(l,{key:0,items:o.dates.months,which:"month"},null,8,["items"])):i.createCommentVNode("",!0),o.root.state.options.calendar.day.display?(i.openBlock(),i.createBlock(l,{key:1,items:o.dates.days,which:"day"},null,8,["items"])):i.createCommentVNode("",!0),o.root.state.options.calendar.hour.display?(i.openBlock(),i.createBlock(l,{key:2,items:o.dates.hours,which:"hour"},null,8,["items"])):i.createCommentVNode("",!0)],4)],4)}var Fr=pt(Ar,[["render",Wr]]);const Ur={name:"DependencyLines",inject:["root"],props:["tasks"],data(){return{}},methods:{getPoints(e,t){const r=this.root.getTask(e),n=this.root.getTask(t);if(r===null||n===null||!this.root.isTaskVisible(n)||!this.root.isTaskVisible(r))return null;const a=r.x+r.width,o=r.y+r.height/2,l=n.x,g=n.y+n.height/2,m=l-a;let p,T=1;g>=o?p=g-o:(p=o-g,T=-1);const k=10,L=4,Y=m<=k+L;let _=`M ${a} ${o}
L ${a+k},${o} `;return Y?_+=`Q ${a+k+L},${o} ${a+k+L},${o+L*T}
L ${a+k+L},${o+p*T/2-L*T}
Q ${a+k+L},${o+p*T/2} ${a+k},${o+p*T/2}
L ${a-k+m},${o+p*T/2}
Q ${a-k+m-L},${o+p*T/2} ${a-k+m-L},${o+p*T/2+L*T}
L ${a-k+m-L},${g-L*T}
Q ${a-k+m-L},${g} ${a-k+m},${g}
L ${l},${g}`:_+=`L ${a+m/2-L},${o}
Q ${a+m/2},${o} ${a+m/2},${o+L*T}
L ${a+m/2},${g-L*T}
Q ${a+m/2},${g} ${a+m/2+L},${g}
L ${l},${g}`,_}},computed:{dependencyTasks(){return this.tasks.filter(e=>typeof e.dependentOn!="undefined").map(e=>(e.dependencyLines=e.dependentOn.map(t=>({points:this.getPoints(t,e.id),task_id:t})),e)).filter(e=>e.dependencyLines.points!==null)}}},Yr=["task"],Rr=["task","d"];function $r(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("svg",{x:"0",y:"0",width:"100%",height:"100%",class:"gantt-elastic__chart-dependency-lines-container",style:i.normalizeStyle(u({},o.root.style["chart-dependency-lines-container"]))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.dependencyTasks,l=>(i.openBlock(),i.createElementBlock("g",{key:l.id,task:l},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.dependencyLines,g=>(i.openBlock(),i.createElementBlock("path",{class:"gantt-elastic__chart-dependency-lines-path",style:i.normalizeStyle(u(u(u({},o.root.style["chart-dependency-lines-path"]),l.style["chart-dependency-lines-path"]),l.style["chart-dependency-lines-path-"+g.task_id])),key:g.id,task:l,d:g.points},null,12,Rr))),128))],8,Yr))),128))],4)}var qr=pt(Ur,[["render",$r]]);const Ir={name:"ChartText",inject:["root"],props:["task"],data(){return{}},computed:{getWidth(){const e=this.root.style["chart-row-text"];return this.root.state.ctx.font=`${e["font-weight"]} ${e["font-size"]} ${e["font-family"]}`,this.root.state.ctx.measureText(this.task.label).width+this.root.state.options.chart.text.xPadding*2},getHeight(){return this.task.height+this.root.state.options.chart.grid.horizontal.gap*2},contentStyle(){return{height:"100%","line-height":this.getHeight+"px"}},html(){const e=this.root.state.options.taskList.columns;for(let t=0,r=e.length;t<r;t++){const n=e[t];if(n.value==="label"&&typeof n.html!="undefined"&&n.html)return!0}return!1}}},Xr=["x","y","width","height"],Gr=["height"],Zr=["innerHTML"];function Jr(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("svg",{class:"gantt-elastic__chart-row-text-wrapper",style:i.normalizeStyle(u({},o.root.style["chart-row-text-wrapper"])),x:r.task.x+r.task.width+o.root.state.options.chart.text.offset,y:r.task.y-o.root.state.options.chart.grid.horizontal.gap,width:o.getWidth,height:o.getHeight},[(i.openBlock(),i.createElementBlock("foreignObject",{x:"0",y:"0",width:"100%",height:o.getHeight},[i.createElementVNode("div",{xmlns:"http://www.w3.org/1999/xhtml",class:"gantt-elastic__chart-row-text",style:i.normalizeStyle(u({},o.root.style["chart-row-text"]))},[o.html?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:"gantt-elastic__chart-row-text-content gantt-elastic__chart-row-text-content--text",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-text-content"]),o.root.style["chart-row-text-content--text"]),o.contentStyle))},[i.createElementVNode("div",null,i.toDisplayString(r.task.label),1)],4)),o.html?(i.openBlock(),i.createElementBlock("div",{key:1,class:"gantt-elastic__chart-row-text-content gantt-elastic__chart-row-text-content--html",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-text-content"]),o.root.style["chart-row-text-content--html"]),o.contentStyle)),innerHTML:r.task.label},null,12,Zr)):i.createCommentVNode("",!0)],4)],8,Gr))],12,Xr)}var re=pt(Ir,[["render",Jr]]);const Kr={name:"ProgressBar",inject:["root"],props:["task"],data(){return{}},computed:{getProgressWidth(){return this.task.progress+"%"},getLinePoints(){const e=this.task.width/100*this.task.progress;return`M ${e} 0 L ${e} ${this.task.height}`},getSolidStyle(){return Object.assign({},this.root.state.options.chart.progress.styles.bar.solid,this.task.progressBarStyle.bar)},getLineStyle(){return Object.assign({},{stroke:this.root.state.options.row.styles.bar.stroke+"a0","stroke-width":this.root.state.options.row.styles.bar["stroke-width"]/2},this.task.style)}}},Qr=["width","height"],ti=["y2"],ei=["width"],ri={key:1},ii=["x","width"],oi=["d"];function si(e,t,r,n,a,o){return i.openBlock(),i.createElementBlock("g",{class:"gantt-elastic__chart-row-progress-bar-wrapper",style:i.normalizeStyle(u(u({},o.root.style["chart-row-progress-bar-wrapper"]),r.task.style["chart-row-progress-bar-wrapper"]))},[i.createElementVNode("defs",null,[i.createElementVNode("pattern",{id:"diagonalHatch",width:o.root.state.options.chart.progress.width,height:o.root.state.options.chart.progress.width,patternTransform:"rotate(45 0 0)",patternUnits:"userSpaceOnUse"},[i.createElementVNode("line",{class:"chart-row-progress-bar-line",style:i.normalizeStyle(u(u({},o.root.style["chart-row-progress-bar-line"]),r.task.style["chart-row-progress-bar-line"])),x1:"0",y1:"0",x2:"0",y2:o.root.state.options.chart.progress.width},null,12,ti)],8,Qr)]),o.root.state.options.chart.progress.bar?(i.openBlock(),i.createElementBlock("rect",{key:0,class:"gantt-elastic__chart-row-progress-bar-solid",style:i.normalizeStyle(u(u({},o.root.style["chart-row-progress-bar-solid"]),r.task.style["chart-row-progress-bar-solid"])),x:"0",y:"0",width:o.getProgressWidth},null,12,ei)):i.createCommentVNode("",!0),o.root.state.options.chart.progress.pattern?(i.openBlock(),i.createElementBlock("g",ri,[i.createElementVNode("rect",{class:"gantt-elastic__chart-row-progress-bar-pattern",style:i.normalizeStyle(u(u({},o.root.style["chart-row-progress-bar-pattern"]),r.task.style["chart-row-progress-bar-pattern"])),x:o.getProgressWidth,y:"0",width:100-r.task.progress+"%",height:"100%"},null,12,ii),i.createElementVNode("path",{class:"gantt-elastic__chart-row-progress-bar-outline",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-progress-bar-outline"]),r.task.style.base),r.task.style["chart-row-progress-bar-outline"])),d:o.getLinePoints},null,12,oi)])):i.createCommentVNode("",!0)],4)}var ie=pt(Kr,[["render",si]]);/**
* @fileoverview Task mixin
* @license MIT
* @author Rafal Pospiech <neuronet.io@gmail.com>
* @package GanttElastic
*/var oe={computed:{getViewBox(){const e=this.task;return`0 0 ${e.width} ${e.height}`},getGroupTransform(){return`translate(${this.task.x} ${this.task.y})`},displayExpander(){const e=this.root.state.options.chart.expander;return e.display||e.displayIfTaskListHidden&&!this.root.state.options.taskList.display}},methods:{emitEvent(e,t){this.root.state.options.scroll.scrolling||this.$root.emitter.emit(`chart-${this.task.type}-${e}`,{event:t,data:this.task})}}};const ni={name:"Task",components:{ChartText:re,ProgressBar:ie,Expander:Yt},inject:["root"],props:["task"],mixins:[oe],data(){return{}},computed:{clipPathId(){return"gantt-elastic__task-clip-path-"+this.task.id},getPoints(){const e=this.task;return`0,0 ${e.width},0 ${e.width},${e.height} 0,${e.height}`}}},ai=["x","y","width","height"],li=["x","y","width","height","viewBox"],ci=["id"],di=["points"],hi=["points"];function pi(e,t,r,n,a,o){const l=i.resolveComponent("expander"),g=i.resolveComponent("progress-bar"),m=i.resolveComponent("chart-text");return i.openBlock(),i.createElementBlock("g",{class:"gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-task-wrapper",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-bar-wrapper"]),o.root.style["chart-row-task-wrapper"]),r.task.style["chart-row-bar-wrapper"]))},[e.displayExpander?(i.openBlock(),i.createElementBlock("foreignObject",{key:0,class:"gantt-elastic__chart-expander gantt-elastic__chart-expander--task",style:i.normalizeStyle(u(u(u({},o.root.style["chart-expander"]),o.root.style["chart-expander--task"]),r.task.style["chart-expander"])),x:r.task.x-o.root.state.options.chart.expander.offset-o.root.state.options.chart.expander.size,y:r.task.y+(o.root.state.options.row.height-o.root.state.options.chart.expander.size)/2,width:o.root.state.options.chart.expander.size,height:o.root.state.options.chart.expander.size},[i.createVNode(l,{tasks:[r.task],options:o.root.state.options.chart.expander,type:"chart"},null,8,["tasks","options"])],12,ai)):i.createCommentVNode("",!0),(i.openBlock(),i.createElementBlock("svg",{class:"gantt-elastic__chart-row-bar gantt-elastic__chart-row-task",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-bar"]),o.root.style["chart-row-task"]),r.task.style["chart-row-bar"])),x:r.task.x,y:r.task.y,width:r.task.width,height:r.task.height,viewBox:`0 0 ${r.task.width} ${r.task.height}`,onClick:t[0]||(t[0]=p=>e.emitEvent("click",p)),onMouseenter:t[1]||(t[1]=p=>e.emitEvent("mouseenter",p)),onMouseover:t[2]||(t[2]=p=>e.emitEvent("mouseover",p)),onMouseout:t[3]||(t[3]=p=>e.emitEvent("mouseout",p)),onMousemove:t[4]||(t[4]=p=>e.emitEvent("mousemove",p)),onMousedown:t[5]||(t[5]=p=>e.emitEvent("mousedown",p)),onMouseup:t[6]||(t[6]=p=>e.emitEvent("mouseup",p)),onMousewheel:t[7]||(t[7]=p=>e.emitEvent("mousewheel",p)),onTouchstart:t[8]||(t[8]=p=>e.emitEvent("touchstart",p)),onTouchmove:t[9]||(t[9]=p=>e.emitEvent("touchmove",p)),onTouchend:t[10]||(t[10]=p=>e.emitEvent("touchend",p)),xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("defs",null,[i.createElementVNode("clipPath",{id:o.clipPathId},[i.createElementVNode("polygon",{points:o.getPoints},null,8,di)],8,ci)]),i.createElementVNode("polygon",{class:"gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-task-polygon",style:i.normalizeStyle(u(u(u(u({},o.root.style["chart-row-bar-polygon"]),o.root.style["chart-row-task-polygon"]),r.task.style.base),r.task.style["chart-row-bar-polygon"])),points:o.getPoints},null,12,hi),i.createVNode(g,{task:r.task,"clip-path":"url(#"+o.clipPathId+")"},null,8,["task","clip-path"])],44,li)),o.root.state.options.chart.text.display?(i.openBlock(),i.createBlock(m,{key:1,task:r.task},null,8,["task"])):i.createCommentVNode("",!0)],4)}var ui=pt(ni,[["render",pi]]);const fi={name:"Milestone",components:{ChartText:re,ProgressBar:ie,Expander:Yt},inject:["root"],props:["task"],mixins:[oe],data(){return{}},computed:{clipPathId(){return"gantt-elastic__milestone-clip-path-"+this.task.id},getPoints(){const e=this.task,t=e.height/2;let r=t;return e.width/2-r<0&&(r=e.width/2),`0,${t}
${r},0
${e.width-r},0
${e.width},${t}
${e.width-r},${e.height}
${r},${e.height}`}}},mi=["x","y","width","height"],gi=["x","y","width","height","viewBox"],yi=["id"],bi=["points"],wi=["points"];function xi(e,t,r,n,a,o){const l=i.resolveComponent("expander"),g=i.resolveComponent("progress-bar"),m=i.resolveComponent("chart-text");return i.openBlock(),i.createElementBlock("g",{class:"gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-milestone-wrapper",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-bar-wrapper"]),o.root.style["chart-row-milestone-wrapper"]),r.task.style["chart-row-bar-wrapper"]))},[e.displayExpander?(i.openBlock(),i.createElementBlock("foreignObject",{key:0,class:"gantt-elastic__chart-expander gantt-elastic__chart-expander--milestone",style:i.normalizeStyle(u(u(u({},o.root.style["chart-expander"]),o.root.style["chart-expander--milestone"]),r.task.style["chart-expander"])),x:r.task.x-o.root.state.options.chart.expander.offset-o.root.state.options.chart.expander.size,y:r.task.y+(o.root.state.options.row.height-o.root.state.options.chart.expander.size)/2,width:o.root.state.options.chart.expander.size,height:o.root.state.options.chart.expander.size},[i.createVNode(l,{tasks:[r.task],options:o.root.state.options.chart.expander,type:"chart"},null,8,["tasks","options"])],12,mi)):i.createCommentVNode("",!0),(i.openBlock(),i.createElementBlock("svg",{class:"gantt-elastic__chart-row-bar gantt-elastic__chart-row-milestone",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-bar"]),o.root.style["chart-row-milestone"]),r.task.style["chart-row-bar"])),x:r.task.x,y:r.task.y,width:r.task.width,height:r.task.height,viewBox:`0 0 ${r.task.width} ${r.task.height}`,onClick:t[0]||(t[0]=p=>e.emitEvent("click",p)),onMouseenter:t[1]||(t[1]=p=>e.emitEvent("mouseenter",p)),onMouseover:t[2]||(t[2]=p=>e.emitEvent("mouseover",p)),onMouseout:t[3]||(t[3]=p=>e.emitEvent("mouseout",p)),onMousemove:t[4]||(t[4]=p=>e.emitEvent("mousemove",p)),onMousedown:t[5]||(t[5]=p=>e.emitEvent("mousedown",p)),onMouseup:t[6]||(t[6]=p=>e.emitEvent("mouseup",p)),onMousewheel:t[7]||(t[7]=p=>e.emitEvent("mousewheel",p)),onTouchstart:t[8]||(t[8]=p=>e.emitEvent("touchstart",p)),onTouchmove:t[9]||(t[9]=p=>e.emitEvent("touchmove",p)),onTouchend:t[10]||(t[10]=p=>e.emitEvent("touchend",p)),xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("defs",null,[i.createElementVNode("clipPath",{id:o.clipPathId},[i.createElementVNode("polygon",{points:o.getPoints},null,8,bi)],8,yi)]),i.createElementVNode("polygon",{class:"gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-milestone-polygon",style:i.normalizeStyle(u(u(u(u({},o.root.style["chart-row-bar-polygon"]),o.root.style["chart-row-milestone-polygon"]),r.task.style.base),r.task.style["chart-row-bar-polygon"])),points:o.getPoints},null,12,wi),i.createVNode(g,{task:r.task,"clip-path":"url(#"+o.clipPathId+")"},null,8,["task","clip-path"])],44,gi)),o.root.state.options.chart.text.display?(i.openBlock(),i.createBlock(m,{key:1,task:r.task},null,8,["task"])):i.createCommentVNode("",!0)],4)}var vi=pt(fi,[["render",xi]]);const ki={name:"Project",components:{ChartText:re,ProgressBar:ie,Expander:Yt},inject:["root"],props:["task"],mixins:[oe],data(){return{}},computed:{clipPathId(){return"gantt-elastic__project-clip-path-"+this.task.id},getPoints(){const e=this.task,t=e.height-e.height/4,r=e.height/6,n=e.height/8;return`M ${n},0
L ${e.width-n} 0
L ${e.width} ${n}
L ${e.width} ${t}
L ${e.width-r} ${e.height}
L ${e.width-r*2} ${t}
L ${r*2} ${t}
L ${r} ${e.height}
L 0 ${t}
L 0 ${n}
Z
`},displayExpander(){const e=this.root.state.options.chart.expander;return e.display||e.displayIfTaskListHidden&&!this.root.state.options.taskList.display}}},_i=["x","y","width","height"],Si=["x","y","width","height","viewBox"],Ei=["id"],zi=["d"],Mi=["d"];function Ti(e,t,r,n,a,o){const l=i.resolveComponent("expander"),g=i.resolveComponent("progress-bar"),m=i.resolveComponent("chart-text");return i.openBlock(),i.createElementBlock("g",{class:"gantt-elastic__chart-row-bar-wrapper gantt-elastic__chart-row-project-wrapper",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-bar-wrapper"]),o.root.style["chart-row-project-wrapper"]),r.task.style["chart-row-bar-wrapper"]))},[o.displayExpander?(i.openBlock(),i.createElementBlock("foreignObject",{key:0,class:"gantt-elastic__chart-expander gantt-elastic__chart-expander--project",style:i.normalizeStyle(u(u(u({},o.root.style["chart-expander"]),o.root.style["chart-expander--project"]),r.task.style["chart-expander"])),x:r.task.x-o.root.state.options.chart.expander.offset-o.root.state.options.chart.expander.size,y:r.task.y+(o.root.state.options.row.height-o.root.state.options.chart.expander.size)/2,width:o.root.state.options.chart.expander.size,height:o.root.state.options.chart.expander.size},[i.createVNode(l,{tasks:[r.task],options:o.root.state.options.chart.expander,type:"chart"},null,8,["tasks","options"])],12,_i)):i.createCommentVNode("",!0),(i.openBlock(),i.createElementBlock("svg",{class:"gantt-elastic__chart-row-bar gantt-elastic__chart-row-project",style:i.normalizeStyle(u(u(u({},o.root.style["chart-row-bar"]),o.root.style["chart-row-project"]),r.task.style["chart-row-bar"])),x:r.task.x,y:r.task.y,width:r.task.width,height:r.task.height,viewBox:`0 0 ${r.task.width} ${r.task.height}`,onClick:t[0]||(t[0]=p=>e.emitEvent("click",p)),onMouseenter:t[1]||(t[1]=p=>e.emitEvent("mouseenter",p)),onMouseover:t[2]||(t[2]=p=>e.emitEvent("mouseover",p)),onMouseout:t[3]||(t[3]=p=>e.emitEvent("mouseout",p)),onMousemove:t[4]||(t[4]=p=>e.emitEvent("mousemove",p)),onMousedown:t[5]||(t[5]=p=>e.emitEvent("mousedown",p)),onMouseup:t[6]||(t[6]=p=>e.emitEvent("mouseup",p)),onMousewheel:t[7]||(t[7]=p=>e.emitEvent("mousewheel",p)),onTouchstart:t[8]||(t[8]=p=>e.emitEvent("touchstart",p)),onTouchmove:t[9]||(t[9]=p=>e.emitEvent("touchmove",p)),onTouchend:t[10]||(t[10]=p=>e.emitEvent("touchend",p)),xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("defs",null,[i.createElementVNode("clipPath",{id:o.clipPathId},[i.createElementVNode("path",{d:o.getPoints},null,8,zi)],8,Ei)]),i.createElementVNode("path",{class:"gantt-elastic__chart-row-bar-polygon gantt-elastic__chart-row-project-polygon",style:i.normalizeStyle(u(u(u(u({},o.root.style["chart-row-bar-polygon"]),o.root.style["chart-row-project-polygon"]),r.task.style.base),r.task.style["chart-row-bar-polygon"])),d:o.getPoints},null,12,Mi),i.createVNode(g,{task:r.task,"clip-path":"url(#"+o.clipPathId+")"},null,8,["task","clip-path"])],44,Si)),o.root.state.options.chart.text.display?(i.openBlock(),i.createBlock(m,{key:1,task:r.task},null,8,["task"])):i.createCommentVNode("",!0)],4)}var Ci=pt(ki,[["render",Ti]]);const Oi={name:"Chart",components:{Grid:Pr,DependencyLines:qr,Calendar:Fr,Task:ui,Milestone:vi,Project:Ci,DaysHighlight:Nr},inject:["root"],data(){return{moving:!1}},mounted(){this.root.state.refs.chart=this.$refs.chart,this.root.state.refs.chartCalendarContainer=this.$refs.chartCalendarContainer,this.root.state.refs.chartGraphContainer=this.$refs.chartGraphContainer,this.root.state.refs.chartGraph=this.$refs.chartGraph,this.root.state.refs.chartGraphSvg=this.$refs.chartGraphSvg},computed:{getViewBox(){return`0 0 ${this.root.state.options.width} ${this.root.state.options.allVisibleTasksHeight}`}}},Pi=["width","height"],Li=["task"],Vi=["task"];function Di(e,t,r,n,a,o){const l=i.resolveComponent("calendar"),g=i.resolveComponent("days-highlight"),m=i.resolveComponent("grid"),p=i.resolveComponent("dependency-lines");return i.openBlock(),i.createElementBlock("div",{class:"gantt-elastic__chart",style:i.normalizeStyle(u({},o.root.style.chart)),ref:"chart"},[i.createElementVNode("div",{class:"gantt-elastic__chart-calendar-container",ref:"chartCalendarContainer",style:i.normalizeStyle(wt(u({},o.root.style["chart-calendar-container"]),{height:o.root.state.options.calendar.height+"px","margin-bottom":o.root.state.options.calendar.gap+"px"}))},[i.createVNode(l)],4),i.