UNPKG

vue-ganttastic-custom

Version:

A simple and customizable Gantt chart component for Vue.js

271 lines (270 loc) 41.6 kB
(function(T,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("dayjs"),require("vue")):typeof define=="function"&&define.amd?define(["exports","dayjs","vue"],V):(T=typeof globalThis<"u"?globalThis:T||self,V(T.VueGanttastic={},T.dayjs,T.Vue))})(this,function(T,V,t){"use strict";const L=(e=>e&&typeof e=="object"&&"default"in e?e:{default:e})(V);var H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},at={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){var o="day";return function(r,b,d){var u=function(n){return n.add(4-n.isoWeekday(),o)},a=b.prototype;a.isoWeekYear=function(){return u(this).year()},a.isoWeek=function(n){if(!this.$utils().u(n))return this.add(7*(n-this.isoWeek()),o);var s,l,g,p,k=u(this),h=(s=this.isoWeekYear(),l=this.$u,g=(l?d.utc:d)().year(s).startOf("year"),p=4-g.isoWeekday(),g.isoWeekday()>4&&(p+=7),g.add(p,o));return k.diff(h,"week")+1},a.isoWeekday=function(n){return this.$utils().u(n)?this.day()||7:this.day(this.day()%7?n:n-7)};var i=a.startOf;a.startOf=function(n,s){var l=this.$utils(),g=!!l.u(s)||s;return l.p(n)==="isoweek"?g?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):i.bind(this)(n,s)}}})})(at);const $t=at.exports;var it={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){return function(o,r){r.prototype.isSameOrBefore=function(b,d){return this.isSame(b,d)||this.isBefore(b,d)}}})})(it);const Lt=it.exports;var st={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){return function(o,r){r.prototype.isSameOrAfter=function(b,d){return this.isSame(b,d)||this.isAfter(b,d)}}})})(st);const Yt=st.exports;var lt={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){return function(o,r,b){r.prototype.isBetween=function(d,u,a,i){var n=b(d),s=b(u),l=(i=i||"()")[0]==="(",g=i[1]===")";return(l?this.isAfter(n,a):!this.isBefore(n,a))&&(g?this.isBefore(s,a):!this.isAfter(s,a))||(l?this.isBefore(n,a):!this.isAfter(n,a))&&(g?this.isAfter(s,a):!this.isBefore(s,a))}}})})(lt);const Gt=lt.exports;var ct={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){var o="week",r="year";return function(b,d,u){var a=d.prototype;a.week=function(i){if(i===void 0&&(i=null),i!==null)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var s=u(this).startOf(r).add(1,r).date(n),l=u(this).endOf(o);if(s.isBefore(l))return 1}var g=u(this).startOf(r).date(n).startOf(o).subtract(1,"millisecond"),p=this.diff(g,o,!0);return p<0?u(this).startOf("week").week():Math.ceil(p)},a.weeks=function(i){return i===void 0&&(i=null),this.week(i)}}})})(ct);const Nt=ct.exports;var dt={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){return function(o,r,b){var d=r.prototype,u=d.format;b.en.ordinal=function(a){var i=["th","st","nd","rd"],n=a%100;return"["+a+(i[(n-20)%10]||i[n]||i[0])+"]"},d.format=function(a){var i=this,n=this.$locale();if(!this.isValid())return u.bind(this)(a);var s=this.$utils(),l=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(g){switch(g){case"Q":return Math.ceil((i.$M+1)/3);case"Do":return n.ordinal(i.$D);case"gggg":return i.weekYear();case"GGGG":return i.isoWeekYear();case"wo":return n.ordinal(i.week(),"W");case"w":case"ww":return s.s(i.week(),g==="w"?1:2,"0");case"W":case"WW":return s.s(i.isoWeek(),g==="W"?1:2,"0");case"k":case"kk":return s.s(String(i.$H===0?24:i.$H),g==="k"?1:2,"0");case"X":return Math.floor(i.$d.getTime()/1e3);case"x":return i.$d.getTime();case"z":return"["+i.offsetName()+"]";case"zzz":return"["+i.offsetName("long")+"]";default:return g}});return u.bind(this)(l)}}})})(dt);const zt=dt.exports;var ft={exports:{}};(function(e,f){(function(o,r){e.exports=r()})(H,function(){var o={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,b=/\d\d/,d=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,a={},i=function(h){return(h=+h)+(h>68?1900:2e3)},n=function(h){return function(y){this[h]=+y}},s=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var _=y.match(/([+-]|\d\d)/g),C=60*_[1]+(+_[2]||0);return C===0?0:_[0]==="+"?-C:C}(h)}],l=function(h){var y=a[h];return y&&(y.indexOf?y:y.s.concat(y.f))},g=function(h,y){var _,C=a.meridiem;if(C){for(var m=1;m<=24;m+=1)if(h.indexOf(C(m,0,y))>-1){_=m>12;break}}else _=h===(y?"pm":"PM");return _},p={A:[u,function(h){this.afternoon=g(h,!1)}],a:[u,function(h){this.afternoon=g(h,!0)}],S:[/\d/,function(h){this.milliseconds=100*+h}],SS:[b,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[d,n("seconds")],ss:[d,n("seconds")],m:[d,n("minutes")],mm:[d,n("minutes")],H:[d,n("hours")],h:[d,n("hours")],HH:[d,n("hours")],hh:[d,n("hours")],D:[d,n("day")],DD:[b,n("day")],Do:[u,function(h){var y=a.ordinal,_=h.match(/\d+/);if(this.day=_[0],y)for(var C=1;C<=31;C+=1)y(C).replace(/\[|\]/g,"")===h&&(this.day=C)}],M:[d,n("month")],MM:[b,n("month")],MMM:[u,function(h){var y=l("months"),_=(l("monthsShort")||y.map(function(C){return C.slice(0,3)})).indexOf(h)+1;if(_<1)throw new Error;this.month=_%12||_}],MMMM:[u,function(h){var y=l("months").indexOf(h)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,n("year")],YY:[b,function(h){this.year=i(h)}],YYYY:[/\d{4}/,n("year")],Z:s,ZZ:s};function k(h){var y,_;y=h,_=a&&a.formats;for(var C=(h=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,v,D){var O=D&&D.toUpperCase();return v||_[D]||o[D]||_[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,Y,z){return Y||z.slice(1)})})).match(r),m=C.length,x=0;x<m;x+=1){var c=C[x],B=p[c],w=B&&B[0],E=B&&B[1];C[x]=E?{regex:w,parser:E}:c.replace(/^\[|\]$/g,"")}return function(S){for(var v={},D=0,O=0;D<m;D+=1){var M=C[D];if(typeof M=="string")O+=M.length;else{var Y=M.regex,z=M.parser,R=S.slice(O),I=Y.exec(R)[0];z.call(v,I),S=S.replace(I,"")}}return function(G){var N=G.afternoon;if(N!==void 0){var A=G.hours;N?A<12&&(G.hours+=12):A===12&&(G.hours=0),delete G.afternoon}}(v),v}}return function(h,y,_){_.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(i=h.parseTwoDigitYear);var C=y.prototype,m=C.parse;C.parse=function(x){var c=x.date,B=x.utc,w=x.args;this.$u=B;var E=w[1];if(typeof E=="string"){var S=w[2]===!0,v=w[3]===!0,D=S||v,O=w[2];v&&(O=w[2]),a=this.$locale(),!S&&O&&(a=_.Ls[O]),this.$d=function(R,I,G){try{if(["x","X"].indexOf(I)>-1)return new Date((I==="X"?1e3:1)*R);var N=k(I)(R),A=N.year,U=N.month,_e=N.day,Ee=N.hours,Ce=N.minutes,Se=N.seconds,ve=N.milliseconds,Mt=N.zone,Z=new Date,J=_e||(A||U?1:Z.getDate()),tt=A||Z.getFullYear(),q=0;A&&!U||(q=U>0?U-1:Z.getMonth());var et=Ee||0,nt=Ce||0,rt=Se||0,ot=ve||0;return Mt?new Date(Date.UTC(tt,q,J,et,nt,rt,ot+60*Mt.offset*1e3)):G?new Date(Date.UTC(tt,q,J,et,nt,rt,ot)):new Date(tt,q,J,et,nt,rt,ot)}catch{return new Date("")}}(c,E,B),this.init(),O&&O!==!0&&(this.$L=this.locale(O).$L),D&&c!=this.format(E)&&(this.$d=new Date("")),a={}}else if(E instanceof Array)for(var M=E.length,Y=1;Y<=M;Y+=1){w[1]=E[Y-1];var z=_.apply(this,w);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}Y===M&&(this.$d=new Date(""))}else m.call(this,x)}}})})(ft);const Rt=ft.exports,ut=Symbol("CHART_ROWS_KEY"),mt=Symbol("CONFIG_KEY"),gt=Symbol("EMIT_BAR_EVENT_KEY"),pt=Symbol("BAR_CONTAINER_KEY");function $(){const e=t.inject(mt);if(!e)throw Error("Failed to inject config!");return e}const ht="YYYY-MM-DD HH:mm:ss";function j(e=$()){const{chartStart:f,chartEnd:o,barStart:r,barEnd:b,dateFormat:d}=e,u=t.computed(()=>i(f.value)),a=t.computed(()=>i(o.value)),i=(s,l)=>{let g;if(l!==void 0&&typeof s!="string"&&!(s instanceof Date)&&(g=l==="start"?s[r.value]:s[b.value]),typeof s=="string")g=s;else if(s instanceof Date)return L.default(s);const p=d.value||ht;return L.default(g,p,!0)};return{chartStartDayjs:u,chartEndDayjs:a,toDayjs:i,format:(s,l)=>l===!1?s instanceof Date?s:L.default(s).toDate():(typeof s=="string"||s instanceof Date?i(s):s).format(l)}}function yt(){const{precision:e}=$(),{chartStartDayjs:f,chartEndDayjs:o}=j(),r=t.computed(()=>{switch(e==null?void 0:e.value){case"hour":return"day";case"day":return"month";case"date":case"week":return"month";case"month":return"year";default:throw new Error("Precision prop incorrect. Must be one of the following: 'hour', 'day', 'date', 'week', 'month'")}}),b=t.computed(()=>{switch(e.value){case"date":return"day";case"week":return"isoWeek";default:return e.value}}),d={hour:"HH",date:"DD.MMM",day:"DD.MMM",week:"WW",month:"MMMM YYYY",year:"YYYY"};return{timeaxisUnits:t.computed(()=>{const a=[],i=[],n=o.value.diff(f.value,"minutes",!0),s=r.value,l=b.value;let g=f.value,p=f.value;for(;p.isSameOrBefore(o.value);){const k=p.endOf(l),y=k.isAfter(o.value)?o.value.diff(p,"minutes",!0)/n*100:k.diff(p,"minutes",!0)/n*100;i.push({label:p.format(d[e==null?void 0:e.value]),value:String(p),date:p.toDate(),width:String(y)+"%"}),p=k.add(1,l==="isoWeek"?"week":l).startOf(l)}for(;g.isSameOrBefore(o.value);){const k=g.endOf(s),y=k.isAfter(o.value)?o.value.diff(g,"minutes",!0)/n*100:k.diff(g,"minutes",!0)/n*100;a.push({label:g.format(d[s]),value:String(g),date:g.toDate(),width:String(y)+"%"}),g=k.add(1,s).startOf(s)}return{upperUnits:a,lowerUnits:i}})}}const It={class:"g-grid-container"},Vt=t.defineComponent({__name:"GGanttGrid",props:{highlightedUnits:{}},setup(e){const{colors:f}=$(),{timeaxisUnits:o}=yt();return(r,b)=>(t.openBlock(),t.createElementBlock("div",It,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).lowerUnits,({label:d,value:u,width:a})=>{var i;return t.openBlock(),t.createElementBlock("div",{key:d,class:"g-grid-line",style:t.normalizeStyle({width:a,background:(i=r.highlightedUnits)!=null&&i.includes(Number(u))?t.unref(f).hoverHighlight:void 0})},null,4)}),128))]))}}),De="";function Q(){const e=t.inject(ut);if(!e)throw Error("Failed to inject getChartRows!");return e}const Ht={class:"g-label-column-rows"},At=t.defineComponent({__name:"GGanttLabelColumn",setup(e){const{font:f,colors:o,labelColumnTitle:r,rowHeight:b}=$(),d=Q();return(u,a)=>(t.openBlock(),t.createElementBlock("div",{class:"g-label-column",style:t.normalizeStyle({fontFamily:t.unref(f),color:t.unref(o).text})},[t.renderSlot(u.$slots,"label-column-title",{},()=>[t.createElementVNode("div",{class:"g-label-column-header",style:t.normalizeStyle({background:t.unref(o).primary})},t.toDisplayString(t.unref(r)),5)]),t.createElementVNode("div",Ht,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(d)(),({label:i},n)=>(t.openBlock(),t.createElementBlock("div",{key:`${i}_${n}`,class:"g-label-column-row",style:t.normalizeStyle({background:n%2===0?t.unref(o).ternary:t.unref(o).quartenary,height:`${t.unref(b)}px`})},[t.renderSlot(u.$slots,"label-column-row",{label:i},()=>[t.createElementVNode("span",null,t.toDisplayString(i),1)])],4))),128))])],4))}}),Oe="",jt={class:"g-timeaxis"},Ft={class:"g-timeunits-container"},Wt={class:"g-timeunits-container"},Pt={key:0},Ut={key:1},qt={key:2,style:{width:"100%",position:"relative",display:"flex"}},Qt=t.defineComponent({__name:"GGanttTimeaxis",props:{isActiveInSeconds:{type:Boolean}},setup(e){const{precision:f,colors:o}=$(),{timeaxisUnits:r}=yt();return(b,d)=>(t.openBlock(),t.createElementBlock("div",jt,[t.createElementVNode("div",Ft,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(r).upperUnits,({label:u,value:a,date:i,width:n},s)=>(t.openBlock(),t.createElementBlock("div",{key:u,class:"g-upper-timeunit",style:t.normalizeStyle({background:s%2===0?t.unref(o).primary:t.unref(o).secondary,color:t.unref(o).text,width:n})},[t.renderSlot(b.$slots,"upper-timeunit",{label:u,value:a,date:i},()=>[t.createTextVNode(t.toDisplayString(u),1)])],4))),128))]),t.createElementVNode("div",Wt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(r).lowerUnits,({label:u,value:a,date:i,width:n},s)=>(t.openBlock(),t.createElementBlock("div",{key:u,class:"g-timeunit",style:t.normalizeStyle({background:s%2===0?t.unref(o).ternary:t.unref(o).quartenary,color:t.unref(o).text,flexDirection:t.unref(f)==="hour"?"column":"row",alignItems:t.unref(f)==="hour"?"":"center",width:n})},[t.renderSlot(b.$slots,"timeunit",{label:u,value:a,date:i},()=>[b.isActiveInSeconds?(t.openBlock(),t.createElementBlock("strong",Pt,t.toDisplayString(u),1)):(t.openBlock(),t.createElementBlock("span",Ut,t.toDisplayString(u),1)),b.isActiveInSeconds?(t.openBlock(),t.createElementBlock("div",qt,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(60,l=>t.createElementVNode("div",{key:l,class:"g-timeaxis-hour-pin",style:t.normalizeStyle({background:t.unref(o).text,position:"absolute",top:0,left:`${(l-1)*(100/60)}%`})},null,4)),64)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(60,l=>t.createElementVNode("span",{key:`label-${l}`,style:t.normalizeStyle({position:"absolute",top:"-20px",left:`${(l-1)*(100/60)}%`,textAlign:"center",color:t.unref(o).text,fontSize:"7px"})},t.toDisplayString(l===1?"":(l-1)*1),5)),64)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(3600,l=>t.createElementVNode("div",{key:l,class:"g-timeaxis-second-pin",style:t.normalizeStyle({left:`${(l-1)*(100/3600)}%`})},[(l-1)%15===0?(t.openBlock(),t.createElementBlock("span",{key:0,style:t.normalizeStyle({left:`${(l-1)*(100/3600)}%`})},t.toDisplayString((l-1)%60===0?"":(l-1)%60),5)):t.createCommentVNode("",!0)],4)),64))])):t.createCommentVNode("",!0)]),t.unref(f)==="hour"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"g-timeaxis-hour-pin",style:t.normalizeStyle({background:t.unref(o).text})},null,4)):t.createCommentVNode("",!0)],4))),128))])]))}}),Te="",Xt="cadetblue",Kt=t.defineComponent({__name:"GGanttBarTooltip",props:{bar:{},modelValue:{type:Boolean}},setup(e){const f=e,o={hour:"HH:mm:ss.SSS",day:"DD. MMM HH:mm:ss.SSS",date:"DD. MMMM YYYY",month:"DD. MMMM YYYY",week:"DD. MMMM YYYY (WW)"},{bar:r}=t.toRefs(f),{precision:b,font:d,barStart:u,barEnd:a,rowHeight:i}=$(),n=t.ref("0px"),s=t.ref("0px");t.watch(()=>f.bar,async()=>{var c;await t.nextTick();const y=((c=r==null?void 0:r.value)==null?void 0:c.ganttBarConfig.id)||"";if(!y)return;const _=document.getElementById(y),{top:C,left:m}=(_==null?void 0:_.getBoundingClientRect())||{top:0,left:0},x=Math.max(m,10);n.value=`${C+i.value-10}px`,s.value=`${x}px`},{deep:!0,immediate:!0});const l=t.computed(()=>{var y,_;return((_=(y=r==null?void 0:r.value)==null?void 0:y.ganttBarConfig.style)==null?void 0:_.background)||Xt}),{toDayjs:g}=j(),p=t.computed(()=>{var y;return(y=r.value)==null?void 0:y[u.value]}),k=t.computed(()=>{var y;return(y=r.value)==null?void 0:y[a.value]}),h=t.computed(()=>{if(!(r!=null&&r.value))return"";const y=o[b.value],_=g(p.value).format(y),C=g(k.value).format(y);return`${_} \u2013 ${C}`});return(y,_)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"g-fade",mode:"out-in"},{default:t.withCtx(()=>[y.modelValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"g-gantt-tooltip",style:t.normalizeStyle({top:n.value,left:s.value,fontFamily:t.unref(d)})},[t.createElementVNode("div",{class:"g-gantt-tooltip-color-dot",style:t.normalizeStyle({background:l.value})},null,4),t.renderSlot(y.$slots,"default",{bar:t.unref(r),barStart:p.value,barEnd:k.value},()=>[t.createTextVNode(t.toDisplayString(h.value),1)])],4)):t.createCommentVNode("",!0)]),_:3})]))}}),Me="";function P(e=$()){const{dateFormat:f,chartSize:o}=e,{chartStartDayjs:r,chartEndDayjs:b,toDayjs:d,format:u}=j(e),a=t.computed(()=>b.value.diff(r.value,"minutes"));return{mapTimeToPosition:s=>{const l=o.width.value||0,g=d(s).diff(r.value,"minutes",!0);return Math.ceil(g/a.value*l)},mapPositionToTime:s=>{const l=o.width.value||0,g=s/l*a.value;return u(r.value.add(g,"minutes"),f.value)}}}const Zt=t.defineComponent({__name:"GGanttCurrentTime",setup(e){const{mapTimeToPosition:f}=P(),o=t.ref(L.default()),{colors:r,dateFormat:b,currentTimeLabel:d}=$(),u=t.computed(()=>{const a=b.value||"YYYY-MM-DD HH:mm";return f(L.default(o.value,a).format(a))});return(a,i)=>(t.openBlock(),t.createElementBlock("div",{class:"g-grid-current-time",style:t.normalizeStyle({left:`${u.value}px`})},[t.createElementVNode("div",{class:"g-grid-current-time-marker",style:t.normalizeStyle({border:`1px dashed ${t.unref(r).markerCurrentTime}`})},null,4),t.createElementVNode("span",{class:"g-grid-current-time-text",style:t.normalizeStyle({color:t.unref(r).markerCurrentTime})},[t.renderSlot(a.$slots,"current-time-label",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(d)),1)])],4)],4))}}),$e="";var bt;const F=typeof window<"u";F&&((bt=window==null?void 0:window.navigator)==null?void 0:bt.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Jt(e){return typeof e=="function"?e():t.unref(e)}function te(e){return e}function ee(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function ne(e,f=!0){t.getCurrentInstance()?t.onMounted(e):f?e():t.nextTick(e)}function wt(e){var f;const o=Jt(e);return(f=o==null?void 0:o.$el)!=null?f:o}const re=F?window:void 0;F&&window.document,F&&window.navigator,F&&window.location;function oe(e,f=!1){const o=t.ref(),r=()=>o.value=Boolean(e());return r(),ne(r,f),o}const X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},K="__vueuse_ssr_handlers__";X[K]=X[K]||{},X[K];var Bt=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,se=(e,f)=>{var o={};for(var r in e)ae.call(e,r)&&f.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&Bt)for(var r of Bt(e))f.indexOf(r)<0&&ie.call(e,r)&&(o[r]=e[r]);return o};function le(e,f,o={}){const r=o,{window:b=re}=r,d=se(r,["window"]);let u;const a=oe(()=>b&&"ResizeObserver"in b),i=()=>{u&&(u.disconnect(),u=void 0)},n=t.watch(()=>wt(e),l=>{i(),a.value&&b&&l&&(u=new ResizeObserver(f),u.observe(l,d))},{immediate:!0,flush:"post"}),s=()=>{i(),n()};return ee(s),{isSupported:a,stop:s}}function ce(e,f={width:0,height:0},o={}){const r=t.ref(f.width),b=t.ref(f.height);return le(e,([d])=>{r.value=d.contentRect.width,b.value=d.contentRect.height},o),t.watch(()=>wt(e),d=>{r.value=d?f.width:0,b.value=d?f.height:0}),{width:r,height:b}}var kt;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(kt||(kt={}));var de=Object.defineProperty,xt=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,_t=(e,f,o)=>f in e?de(e,f,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[f]=o,me=(e,f)=>{for(var o in f||(f={}))fe.call(f,o)&&_t(e,o,f[o]);if(xt)for(var o of xt(f))ue.call(f,o)&&_t(e,o,f[o]);return e};me({linear:te},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Et={default:{primary:"#eeeeee",secondary:"#E0E0E0",ternary:"#F5F5F5",quartenary:"#ededed",hoverHighlight:"rgba(204, 216, 219, 0.5)",markerCurrentTime:"#000",text:"#404040",background:"white"},creamy:{primary:"#ffe8d9",secondary:"#fcdcc5",ternary:"#fff6f0",quartenary:"#f7ece6",hoverHighlight:"rgba(230, 221, 202, 0.5)",markerCurrentTime:"#000",text:"#542d05",background:"white"},crimson:{primary:"#a82039",secondary:"#c41238",ternary:"#db4f56",quartenary:"#ce5f64",hoverHighlight:"rgba(196, 141, 141, 0.5)",markerCurrentTime:"#000",text:"white",background:"white"},dark:{primary:"#404040",secondary:"#303030",ternary:"#353535",quartenary:"#383838",hoverHighlight:"rgba(159, 160, 161, 0.5)",markerCurrentTime:"#fff",text:"white",background:"#525252",toast:"#1f1f1f"},flare:{primary:"#e08a38",secondary:"#e67912",ternary:"#5e5145",quartenary:"#665648",hoverHighlight:"rgba(196, 141, 141, 0.5)",markerCurrentTime:"#000",text:"white",background:"white"},fuchsia:{primary:"#de1d5a",secondary:"#b50b41",ternary:"#ff7da6",quartenary:"#f2799f",hoverHighlight:"rgba(196, 141, 141, 0.5)",markerCurrentTime:"#000",text:"white",background:"white"},grove:{primary:"#3d9960",secondary:"#288542",ternary:"#72b585",quartenary:"#65a577",hoverHighlight:"rgba(160, 219, 171, 0.5)",markerCurrentTime:"#000",text:"white",background:"white"},"material-blue":{primary:"#0D47A1",secondary:"#1565C0",ternary:"#42a5f5",quartenary:"#409fed",hoverHighlight:"rgba(110, 165, 196, 0.5)",markerCurrentTime:"#000",text:"white",background:"white"},sky:{primary:"#b5e3ff",secondary:"#a1d6f7",ternary:"#d6f7ff",quartenary:"#d0edf4",hoverHighlight:"rgba(193, 202, 214, 0.5)",markerCurrentTime:"#000",text:"#022c47",background:"white"},slumber:{primary:"#2a2f42",secondary:"#2f3447",ternary:"#35394d",quartenary:"#2c3044",hoverHighlight:"rgba(179, 162, 127, 0.5)",markerCurrentTime:"#fff",text:"#ffe0b3",background:"#38383b",toast:"#1f1f1f"},vue:{primary:"#258a5d",secondary:"#41B883",ternary:"#35495E",quartenary:"#2a3d51",hoverHighlight:"rgba(160, 219, 171, 0.5)",markerCurrentTime:"#000",text:"white",background:"white"}},ge={class:"g-gantt-rows-container"},Ct=t.defineComponent({__name:"GGanttChart",props:{chartStart:{},chartEnd:{},precision:{default:"day"},barStart:{},barEnd:{},currentTime:{type:Boolean},currentTimeLabel:{default:""},dateFormat:{type:[String,Boolean],default:ht},width:{default:"100%"},hideTimeaxis:{type:Boolean,default:!1},colorScheme:{default:"default"},grid:{type:Boolean,default:!1},pushOnOverlap:{type:Boolean,default:!1},noOverlap:{type:Boolean,default:!1},rowHeight:{default:40},highlightedUnits:{default:()=>[]},font:{default:"inherit"},labelColumnTitle:{default:""},labelColumnWidth:{default:"150px"}},emits:["click-bar","mousedown-bar","mouseup-bar","dblclick-bar","mouseenter-bar","mouseleave-bar","dragstart-bar","drag-bar","dragend-bar","contextmenu-bar"],setup(e,{emit:f}){const o=e,{width:r,font:b,colorScheme:d}=t.toRefs(o),u=t.computed(()=>parseFloat(r.value)>500),a=t.useSlots(),i=t.computed(()=>typeof d.value!="string"?d.value:Et[d.value]||Et.default),n=()=>{var c;const m=(c=a.default)==null?void 0:c.call(a),x=[];return m&&m.forEach(B=>{var w;if((w=B.props)!=null&&w.bars){const{label:E,bars:S}=B.props;x.push({label:E,bars:S})}else Array.isArray(B.children)&&B.children.forEach(E=>{var v;const S=E;if((v=S==null?void 0:S.props)!=null&&v.bars){const{label:D,bars:O}=S.props;x.push({label:D,bars:O})}})}),x},s=t.ref(!1),l=t.ref(!1),g=t.ref(void 0);let p;const k=m=>{p&&clearTimeout(p),p=setTimeout(()=>{s.value=!0},800),g.value=m},h=()=>{clearTimeout(p),s.value=!1},y=(m,x,c,B)=>{switch(m.type){case"click":f("click-bar",{bar:x,e:m,datetime:c});break;case"mousedown":f("mousedown-bar",{bar:x,e:m,datetime:c});break;case"mouseup":f("mouseup-bar",{bar:x,e:m,datetime:c});break;case"dblclick":f("dblclick-bar",{bar:x,e:m,datetime:c});break;case"mouseenter":k(x),f("mouseenter-bar",{bar:x,e:m});break;case"mouseleave":h(),f("mouseleave-bar",{bar:x,e:m});break;case"dragstart":l.value=!0,f("dragstart-bar",{bar:x,e:m});break;case"drag":f("drag-bar",{bar:x,e:m});break;case"dragend":l.value=!1,f("dragend-bar",{bar:x,e:m,movedBars:B});break;case"contextmenu":f("contextmenu-bar",{bar:x,e:m,datetime:c});break}},_=t.ref(null),C=ce(_);return t.provide(ut,n),t.provide(mt,{...t.toRefs(o),colors:i,chartSize:C}),t.provide(gt,y),(m,x)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{class:t.normalizeClass([{"labels-in-column":!!m.labelColumnTitle}])},[m.labelColumnTitle?(t.openBlock(),t.createBlock(At,{key:0,style:t.normalizeStyle({width:m.labelColumnWidth})},{"label-column-title":t.withCtx(()=>[t.renderSlot(m.$slots,"label-column-title")]),"label-column-row":t.withCtx(({label:c})=>[t.renderSlot(m.$slots,"label-column-row",{label:c})]),_:3},8,["style"])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"ganttChart",ref:_,class:t.normalizeClass(["g-gantt-chart",{"with-column":m.labelColumnTitle}]),style:t.normalizeStyle({width:t.unref(r),background:i.value.background,fontFamily:t.unref(b)})},[m.hideTimeaxis?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Qt,{key:0,"is-active-in-seconds":u.value},{"upper-timeunit":t.withCtx(({label:c,value:B,date:w})=>[t.renderSlot(m.$slots,"upper-timeunit",{label:c,value:B,date:w})]),timeunit:t.withCtx(({label:c,value:B,date:w})=>[t.renderSlot(m.$slots,"timeunit",{label:c,value:B,date:w})]),_:3},8,["is-active-in-seconds"])),m.grid?(t.openBlock(),t.createBlock(Vt,{key:1,"highlighted-units":m.highlightedUnits},null,8,["highlighted-units"])):t.createCommentVNode("",!0),m.currentTime?(t.openBlock(),t.createBlock(Zt,{key:2},{"current-time-label":t.withCtx(()=>[t.renderSlot(m.$slots,"current-time-label")]),_:3})):t.createCommentVNode("",!0),t.createElementVNode("div",ge,[t.renderSlot(m.$slots,"default")])],6)],2),t.createVNode(Kt,{"model-value":s.value||l.value,bar:g.value},{default:t.withCtx(()=>[t.renderSlot(m.$slots,"bar-tooltip",{bar:g.value})]),_:3},8,["model-value","bar"])]))}}),Ye="";function St(e,f=()=>null,o=()=>null,r=$()){const{barStart:b,barEnd:d,pushOnOverlap:u}=r,a=t.ref(!1);let i=0,n;const{mapPositionToTime:s}=P(r),{toDayjs:l}=j(r),g=m=>{const x=document.getElementById(e.ganttBarConfig.id);if(!x)return;switch(i=m.clientX-(x.getBoundingClientRect().left||0),m.target.className){case"g-gantt-bar-handle-left":document.body.style.cursor="ew-resize",n=h;break;case"g-gantt-bar-handle-right":document.body.style.cursor="ew-resize",n=y;break;default:n=k}a.value=!0,window.addEventListener("mousemove",n),window.addEventListener("mouseup",C)},p=()=>{var c;const m=document.getElementById(e.ganttBarConfig.id),x=(c=m==null?void 0:m.closest(".g-gantt-row-bars-container"))==null?void 0:c.getBoundingClientRect();return{barElement:m,barContainer:x}},k=m=>{const{barElement:x,barContainer:c}=p();if(!x||!c)return;const B=x.getBoundingClientRect().width,w=m.clientX-c.left-i,E=w+B;_(w,E)||(e[b.value]=s(w),e[d.value]=s(E),f(m,e))},h=m=>{const{barElement:x,barContainer:c}=p();if(!x||!c)return;const B=m.clientX-c.left,w=s(B);l(w).isSameOrAfter(l(e,"end"))||(e[b.value]=w,f(m,e))},y=m=>{const{barElement:x,barContainer:c}=p();if(!x||!c)return;const B=m.clientX-c.left,w=s(B);l(w).isSameOrBefore(l(e,"start"))||(e[d.value]=w,f(m,e))},_=(m,x)=>{if(!u.value)return!1;const c=e.ganttBarConfig.dragLimitLeft,B=e.ganttBarConfig.dragLimitRight;return m&&c!=null&&m<c||x&&B!=null&&x>B},C=m=>{a.value=!1,document.body.style.cursor="",window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",C),o(m,e)};return{isDragging:a,initDrag:g}}function vt(){const e=t.inject(gt);if(!e)throw Error("Failed to inject emitBarEvent!");return e}function pe(){const e=$(),f=Q(),o=vt(),{pushOnOverlap:r,barStart:b,barEnd:d,noOverlap:u,dateFormat:a}=e,i=new Map,{toDayjs:n,format:s}=j(),l=(c,B)=>{const{initDrag:w}=St(c,p,C,e);o({...B,type:"dragstart"},c),w(B),m(c)},g=(c,B)=>{const w=c.ganttBarConfig.bundle;w!=null&&(f().forEach(E=>{E.bars.forEach(S=>{if(S.ganttBarConfig.bundle===w){const v=S===c?C:()=>null,{initDrag:D}=St(S,p,v,e);D(B),m(S)}})}),o({...B,type:"dragstart"},c))},p=(c,B)=>{o({...c,type:"drag"},B),k(B)},k=c=>{if(!(r!=null&&r.value))return;let B=c,{overlapBar:w,overlapType:E}=y(B);for(;w;){m(w);const S=n(B[b.value]),v=n(B[d.value]),D=n(w[b.value]),O=n(w[d.value]);let M;switch(E){case"left":M=O.diff(S,"seconds",!0),w[d.value]=s(B[b.value],a.value),w[b.value]=s(D.subtract(M,"seconds"),a.value);break;case"right":M=v.diff(D,"seconds",!0),w[b.value]=s(v,a.value),w[d.value]=s(O.add(M,"seconds"),a.value);break;default:console.warn("Vue-Ganttastic: One bar is inside of the other one! This should never occur while push-on-overlap is active!");return}w&&(E==="left"||E==="right")&&h(w,M,E),B=w,{overlapBar:w,overlapType:E}=y(w)}},h=(c,B,w)=>{m(c),c.ganttBarConfig.bundle&&f().forEach(E=>{E.bars.forEach(S=>{S.ganttBarConfig.bundle===c.ganttBarConfig.bundle&&S!==c&&(m(S),_(S,B,w))})})},y=c=>{var Y,z;let B,w,E;const S=(z=(Y=f().find(R=>R.bars.includes(c)))==null?void 0:Y.bars)!=null?z:[],v=n(c[b.value]),D=n(c[d.value]);return{overlapBar:S.find(R=>{if(R===c)return!1;const I=n(R[b.value]),G=n(R[d.value]);return B=v.isBetween(I,G),w=D.isBetween(I,G),E=I.isBetween(v,D)||G.isBetween(v,D),B||w||E}),overlapType:B?"left":w?"right":E?"between":null}},_=(c,B,w)=>{switch(w){case"left":c[b.value]=s(n(c,"start").subtract(B,"seconds"),a.value),c[d.value]=s(n(c,"end").subtract(B,"seconds"),a.value);break;case"right":c[b.value]=s(n(c,"start").add(B,"seconds"),a.value),c[d.value]=s(n(c,"end").add(B,"seconds"),a.value)}k(c)},C=(c,B)=>{x();const w={...c,type:"dragend"};o(w,B,void 0,new Map(i)),i.clear()},m=c=>{if(!i.has(c)){const B=c[b.value],w=c[d.value];i.set(c,{oldStart:B,oldEnd:w})}},x=()=>{if(r.value||!u.value)return;let c=!1;i.forEach((B,w)=>{const{overlapBar:E}=y(w);E!=null&&(c=!0)}),c&&i.forEach(({oldStart:B,oldEnd:w},E)=>{E[b.value]=B,E[d.value]=w})};return{initDragOfBar:l,initDragOfBundle:g}}function he(){const{pushOnOverlap:e}=$(),f=Q(),o=u=>{const a=[];return u!=null&&f().forEach(i=>{i.bars.forEach(n=>{n.ganttBarConfig.bundle===u&&a.push(n)})}),a},r=u=>{if(!e.value||u.ganttBarConfig.pushOnOverlap===!1)return;for(const i of["left","right"]){const n=i,{gapDistanceSoFar:s,bundleBarsAndGapDist:l}=b(u,0,n);let g=s;const p=l;if(!p)continue;for(let h=0;h<p.length;h++){const y=p[h].bar,_=p[h].gapDistance;o(y.ganttBarConfig.bundle).filter(m=>m!==y).forEach(m=>{const x=b(m,_,n),c=x.gapDistanceSoFar,B=x.bundleBarsAndGapDist;c!=null&&(!g||c<g)&&(g=c),B.forEach(w=>{p.find(E=>E.bar===w.bar)||p.push(w)})})}const k=document.getElementById(u.ganttBarConfig.id);g!=null&&n==="left"?u.ganttBarConfig.dragLimitLeft=k.offsetLeft-g:g!=null&&n==="right"&&(u.ganttBarConfig.dragLimitRight=k.offsetLeft+k.offsetWidth+g)}o(u.ganttBarConfig.bundle).forEach(i=>{i.ganttBarConfig.dragLimitLeft=u.ganttBarConfig.dragLimitLeft,i.ganttBarConfig.dragLimitRight=u.ganttBarConfig.dragLimitRight})},b=(u,a=0,i)=>{const n=u.ganttBarConfig.bundle?[{bar:u,gapDistance:a}]:[];let s=u,l=d(s,i);if(i==="left")for(;l;){const g=document.getElementById(s.ganttBarConfig.id),p=document.getElementById(l.ganttBarConfig.id),k=p.offsetLeft+p.offsetWidth;if(a+=g.offsetLeft-k,l.ganttBarConfig.immobile)return{gapDistanceSoFar:a,bundleBarsAndGapDist:n};l.ganttBarConfig.bundle&&n.push({bar:l,gapDistance:a}),s=l,l=d(l,"left")}if(i==="right")for(;l;){const g=document.getElementById(s.ganttBarConfig.id),p=document.getElementById(l.ganttBarConfig.id),k=g.offsetLeft+g.offsetWidth;if(a+=p.offsetLeft-k,l.ganttBarConfig.immobile)return{gapDistanceSoFar:a,bundleBarsAndGapDist:n};l.ganttBarConfig.bundle&&n.push({bar:l,gapDistance:a}),s=l,l=d(l,"right")}return{gapDistanceSoFar:null,bundleBarsAndGapDist:n}},d=(u,a)=>{var l,g;const i=document.getElementById(u.ganttBarConfig.id),n=(g=(l=f().find(p=>p.bars.includes(u)))==null?void 0:l.bars)!=null?g:[];let s=[];return a==="left"?s=n.filter(p=>{const k=document.getElementById(p.ganttBarConfig.id);return k&&k.offsetLeft<i.offsetLeft&&p.ganttBarConfig.pushOnOverlap!==!1}):s=n.filter(p=>{const k=document.getElementById(p.ganttBarConfig.id);return k&&k.offsetLeft>i.offsetLeft&&p.ganttBarConfig.pushOnOverlap!==!1}),s.length>0?s.reduce((p,k)=>{const h=document.getElementById(p.ganttBarConfig.id),y=document.getElementById(k.ganttBarConfig.id),_=Math.abs(h.offsetLeft-i.offsetLeft),C=Math.abs(y.offsetLeft-i.offsetLeft);return _<C?p:k},s[0]):null};return{setDragLimitsOfGanttBar:r}}const ye=["id"],be={class:"g-gantt-bar-label"},we=["innerHTML"],Be=t.createElementVNode("div",{class:"g-gantt-bar-handle-left"},null,-1),ke=t.createElementVNode("div",{class:"g-gantt-bar-handle-right"},null,-1),xe=t.defineComponent({__name:"GGanttBar",props:{bar:{}},setup(e){const f=e,o=vt(),r=$(),{rowHeight:b}=r,{bar:d}=t.toRefs(f),{mapTimeToPosition:u,mapPositionToTime:a}=P(),{initDragOfBar:i,initDragOfBundle:n}=pe(),{setDragLimitsOfGanttBar:s}=he(),l=t.ref(!1),g=t.computed(()=>d.value.ganttBarConfig);function p(S){g.value.bundle!=null?n(d.value,S):i(d.value,S),l.value=!0}const k=()=>{s(d.value),!g.value.immobile&&(window.addEventListener("mousemove",p,{once:!0}),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",p),l.value=!1},{once:!0}))},h=t.inject(pt),y=S=>{var O;S.preventDefault(),S.type==="mousedown"&&k();const v=(O=h==null?void 0:h.value)==null?void 0:O.getBoundingClientRect();if(!v)return;const D=a(S.clientX-v.left);o(S,d.value,D)},{barStart:_,barEnd:C,width:m,chartStart:x,chartEnd:c,chartSize:B}=r,w=t.ref(0),E=t.ref(0);return t.onMounted(()=>{t.watch([d,m,x,c,B.width],()=>{w.value=u(d.value[_.value]),E.value=u(d.value[C.value])},{deep:!0,immediate:!0})}),(S,v)=>(t.openBlock(),t.createElementBlock("div",{id:g.value.id,class:t.normalizeClass(["g-gantt-bar",g.value.class||""]),style:t.normalizeStyle({...g.value.style,position:"absolute",top:`${t.unref(b)*.1}px`,left:`${w.value}px`,width:`${E.value-w.value}px`,height:`${t.unref(b)*.8}px`,zIndex:l.value?3:2}),onMousedown:y,onClick:y,onDblclick:y,onMouseenter:y,onMouseleave:y,onContextmenu:y},[t.createElementVNode("div",be,[t.renderSlot(S.$slots,"default",{bar:t.unref(d)},()=>[t.createElementVNode("div",null,t.toDisplayString(g.value.label||""),1),g.value.html?(t.openBlock(),t.createElementBlock("div",{key:0,innerHTML:g.value.html},null,8,we)):t.createCommentVNode("",!0)])]),g.value.hasHandles?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[Be,ke],64)):t.createCommentVNode("",!0)],46,ye))}}),Ge="",Dt=t.defineComponent({__name:"GGanttRow",props:{label:{},bars:{},highlightOnHover:{type:Boolean}},emits:["drop"],setup(e,{emit:f}){const o=e,{rowHeight:r,colors:b,labelColumnTitle:d}=$(),{highlightOnHover:u}=t.toRefs(o),a=t.ref(!1),i=t.computed(()=>({height:`${r.value}px`,background:(u==null?void 0:u.value)&&a.value?b.value.hoverHighlight:null})),{mapPositionToTime:n}=P(),s=t.ref(null);t.provide(pt,s);const l=p=>{var _;const k=(_=s.value)==null?void 0:_.getBoundingClientRect();if(!k){console.error("Vue-Ganttastic: failed to find bar container element for row.");return}const h=p.clientX-k.left,y=n(h);f("drop",{e:p,datetime:y})},g=p=>!p||/^\s*$/.test(p);return(p,k)=>(t.openBlock(),t.createElementBlock("div",{class:"g-gantt-row",style:t.normalizeStyle(i.value),onDragover:k[0]||(k[0]=t.withModifiers(h=>a.value=!0,["prevent"])),onDragleave:k[1]||(k[1]=h=>a.value=!1),onDrop:k[2]||(k[2]=h=>l(h)),onMouseover:k[3]||(k[3]=h=>a.value=!0),onMouseleave:k[4]||(k[4]=h=>a.value=!1)},[!g(p.label)&&!t.unref(d)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"g-gantt-row-label",style:t.normalizeStyle({background:t.unref(b).primary,color:t.unref(b).text})},[t.renderSlot(p.$slots,"label",{},()=>[t.createTextVNode(t.toDisplayString(p.label),1)])],4)):t.createCommentVNode("",!0),t.createElementVNode("div",t.mergeProps({ref_key:"barContainer",ref:s,class:"g-gantt-row-bars-container"},p.$attrs),[t.createVNode(t.TransitionGroup,{name:"bar-transition",tag:"div"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.bars,h=>(t.openBlock(),t.createBlock(xe,{key:h.ganttBarConfig.id,bar:h},{default:t.withCtx(()=>[t.renderSlot(p.$slots,"bar-label",{bar:h})]),_:2},1032,["bar"]))),128))]),_:3})],16)],36))}}),Ne="";function Ot(){L.default.extend(Lt),L.default.extend(Yt),L.default.extend(Gt),L.default.extend(Rt),L.default.extend(Nt),L.default.extend($t),L.default.extend(zt)}const Tt={install(e,f){Ot(),e.component("GGanttChart",Ct),e.component("GGanttRow",Dt)}};T.GGanttChart=Ct,T.GGanttRow=Dt,T.default=Tt,T.extendDayjs=Ot,T.ganttastic=Tt,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});function injectStyle(T,V="top"){if(!T||typeof document>"u")return;const t=document.head,W=document.createElement("style");V==="top"&&t.firstChild?t.insertBefore(W,t.firstChild):t.appendChild(W),W.appendChild(document.createTextNode(T))}injectStyle(` .g-gantt-chart { position: relative; display: flex; flex-direction: column; overflow-x: hidden; -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; border-radius: 5px; } .with-column { border-top-left-radius: 0px; border-bottom-left-radius: 0px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; } .g-gantt-rows-container { position: relative; } .labels-in-column { display: flex; flex-direction: row; } `,"top");injectStyle(` .g-gantt-row { width: 100%; transition: background 0.4s; position: relative; } .g-gantt-row > .g-gantt-row-bars-container { position: relative; border-top: 1px solid #eaeaea; width: 100%; border-bottom: 1px solid #eaeaea; } .g-gantt-row-label { position: absolute; top: 0; left: 0px; padding: 0px 8px; display: flex; align-items: center; height: 60%; min-height: 20px; font-size: 0.8em; font-weight: bold; border-bottom-right-radius: 6px; background: #f2f2f2; z-index: 3; box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.6); } .bar-transition-leave-active, .bar-transition-enter-active { transition: all 0.2s; } .bar-transition-enter-from, .bar-transition-leave-to { transform: scale(0.8); opacity: 0; } `,"top");injectStyle(` .g-gantt-tooltip { position: fixed; background: black; color: white; z-index: 4; font-size: 0.85em; padding: 5px; border-radius: 3px; transition: opacity 0.2s; display: flex; align-items: center; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; } .g-gantt-tooltip:before { content: ""; position: absolute; top: 0; left: 10%; width: 0; height: 0; border: 10px solid transparent; border-bottom-color: black; border-top: 0; margin-left: -5px; margin-top: -5px; } .g-gantt-tooltip-color-dot { width: 8px; height: 8px; border-radius: 100%; margin-right: 4px; } .g-fade-enter-active, .g-fade-leave-active { transition: opacity 0.3s ease; } .g-fade-enter-from, .g-fade-leave-to { opacity: 0; } `,"top");injectStyle(` .g-label-column { display: flex; align-items: center; flex-direction: column; color: rgb(64, 64, 64); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; font-size: 0.9em; } .g-label-column-header { width: 100%; height: 80px; min-height: 80px; overflow: hidden; display: flex; align-items: center; justify-content: center; border-top-left-radius: 5px; } .g-label-column-rows { width: 100%; height: 100%; display: flex; flex-direction: column; border-bottom-left-radius: 5px; } .g-label-column-row { width: 100%; height: 100%; display: flex; padding: 0.1rem 0.3rem; overflow: hidden; white-space: normal; box-sizing: border-box; text-align: center; align-items: center; justify-content: center; } .g-label-column-row:last-child { border-bottom-left-radius: 5px; } `,"top");injectStyle(` .g-grid-container { position: absolute; top: 0; left: 0%; width: 100%; height: 100%; display: flex; justify-content: space-between; } .g-grid-line { width: 1px; height: 100%; border-left: 1px solid #eaeaea; } `,"top");injectStyle(` .g-timeaxis-second-pin { background-color: #888; justify-content: space-between; height: 5px; width: 1px; position: absolute; font-size: 7px; } .g-timeaxis-second-pin span { position: absolute; top: -10px; text-align: center; color: "#fffff"; font-size: 7px; } .g-timeaxis { position: sticky; top: 0; width: 100%; height: 80px; background: white; z-index: 4; display: flex; flex-direction: column; } .g-timeunits-container { display: flex; width: 100%; height: 50%; } .g-timeunit { height: 100%; font-size: 65%; display: flex; flex-direction: column; justify-content: center; } .g-upper-timeunit { display: flex; height: 100%; justify-content: center; align-items: center; } .g-timeaxis-hour-pin { width: 1px; height: 10px; } `,"top");injectStyle(` .g-grid-current-time { position: absolute; height: 100%; display: flex; z-index: 5; pointer-events: none; } .g-grid-current-time-marker { width: 0px; height: calc(100% - 2px); display: flex; } .g-grid-current-time-text { font-size: x-small; } `,"top");injectStyle(` .g-gantt-bar { display: flex; justify-content: center; align-items: center; background: cadetblue; overflow: hidden; } .g-gantt-bar-label { width: 100%; height: 100%; box-sizing: border-box; padding: 0 14px 0 14px; /* 14px is the width of the handle */ display: flex; justify-content: center; align-items: center; } .g-gantt-bar-label > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .g-gantt-bar-handle-left, .g-gantt-bar-handle-right { position: absolute; width: 10px; height: 100%; background: white; opacity: 0.7; border-radius: 0px; cursor: ew-resize; top: 0; } .g-gantt-bar-handle-left { left: 0; } .g-gantt-bar-handle-right { right: 0; } .g-gantt-bar-label img { pointer-events: none; } `,"top");