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 A=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},at={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){var a="day";return function(o,b,c){var g=function(r){return r.add(4-r.isoWeekday(),a)},n=b.prototype;n.isoWeekYear=function(){return g(this).year()},n.isoWeek=function(r){if(!this.$utils().u(r))return this.add(7*(r-this.isoWeek()),a);var s,u,l,p,k=g(this),h=(s=this.isoWeekYear(),u=this.$u,l=(u?c.utc:c)().year(s).startOf("year"),p=4-l.isoWeekday(),l.isoWeekday()>4&&(p+=7),l.add(p,a));return k.diff(h,"week")+1},n.isoWeekday=function(r){return this.$utils().u(r)?this.day()||7:this.day(this.day()%7?r:r-7)};var i=n.startOf;n.startOf=function(r,s){var u=this.$utils(),l=!!u.u(s)||s;return u.p(r)==="isoweek"?l?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):i.bind(this)(r,s)}}})})(at);const $t=at.exports;var it={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){return function(a,o){o.prototype.isSameOrBefore=function(b,c){return this.isSame(b,c)||this.isBefore(b,c)}}})})(it);const Lt=it.exports;var st={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){return function(a,o){o.prototype.isSameOrAfter=function(b,c){return this.isSame(b,c)||this.isAfter(b,c)}}})})(st);const Yt=st.exports;var lt={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){return function(a,o,b){o.prototype.isBetween=function(c,g,n,i){var r=b(c),s=b(g),u=(i=i||"()")[0]==="(",l=i[1]===")";return(u?this.isAfter(r,n):!this.isBefore(r,n))&&(l?this.isBefore(s,n):!this.isAfter(s,n))||(u?this.isBefore(r,n):!this.isAfter(r,n))&&(l?this.isAfter(s,n):!this.isBefore(s,n))}}})})(lt);const Gt=lt.exports;var ct={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){var a="week",o="year";return function(b,c,g){var n=c.prototype;n.week=function(i){if(i===void 0&&(i=null),i!==null)return this.add(7*(i-this.week()),"day");var r=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var s=g(this).startOf(o).add(1,o).date(r),u=g(this).endOf(a);if(s.isBefore(u))return 1}var l=g(this).startOf(o).date(r).startOf(a).subtract(1,"millisecond"),p=this.diff(l,a,!0);return p<0?g(this).startOf("week").week():Math.ceil(p)},n.weeks=function(i){return i===void 0&&(i=null),this.week(i)}}})})(ct);const zt=ct.exports;var dt={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){return function(a,o,b){var c=o.prototype,g=c.format;b.en.ordinal=function(n){var i=["th","st","nd","rd"],r=n%100;return"["+n+(i[(r-20)%10]||i[r]||i[0])+"]"},c.format=function(n){var i=this,r=this.$locale();if(!this.isValid())return g.bind(this)(n);var s=this.$utils(),u=(n||"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(l){switch(l){case"Q":return Math.ceil((i.$M+1)/3);case"Do":return r.ordinal(i.$D);case"gggg":return i.weekYear();case"GGGG":return i.isoWeekYear();case"wo":return r.ordinal(i.week(),"W");case"w":case"ww":return s.s(i.week(),l==="w"?1:2,"0");case"W":case"WW":return s.s(i.isoWeek(),l==="W"?1:2,"0");case"k":case"kk":return s.s(String(i.$H===0?24:i.$H),l==="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 l}});return g.bind(this)(u)}}})})(dt);const Nt=dt.exports;var ft={exports:{}};(function(e,f){(function(a,o){e.exports=o()})(A,function(){var a={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"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,b=/\d\d/,c=/\d\d?/,g=/\d*[^-_:/,()\s\d]+/,n={},i=function(h){return(h=+h)+(h>68?1900:2e3)},r=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)}],u=function(h){var y=n[h];return y&&(y.indexOf?y:y.s.concat(y.f))},l=function(h,y){var _,C=n.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:[g,function(h){this.afternoon=l(h,!1)}],a:[g,function(h){this.afternoon=l(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:[c,r("seconds")],ss:[c,r("seconds")],m:[c,r("minutes")],mm:[c,r("minutes")],H:[c,r("hours")],h:[c,r("hours")],HH:[c,r("hours")],hh:[c,r("hours")],D:[c,r("day")],DD:[b,r("day")],Do:[g,function(h){var y=n.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:[c,r("month")],MM:[b,r("month")],MMM:[g,function(h){var y=u("months"),_=(u("monthsShort")||y.map(function(C){return C.slice(0,3)})).indexOf(h)+1;if(_<1)throw new Error;this.month=_%12||_}],MMMM:[g,function(h){var y=u("months").indexOf(h)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,r("year")],YY:[b,function(h){this.year=i(h)}],YYYY:[/\d{4}/,r("year")],Z:s,ZZ:s};function k(h){var y,_;y=h,_=n&&n.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]||a[D]||_[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,Y,N){return Y||N.slice(1)})})).match(o),m=C.length,x=0;x<m;x+=1){var d=C[x],B=p[d],w=B&&B[0],E=B&&B[1];C[x]=E?{regex:w,parser:E}:d.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,N=M.parser,R=S.slice(O),I=Y.exec(R)[0];N.call(v,I),S=S.replace(I,"")}}return function(G){var z=G.afternoon;if(z!==void 0){var H=G.hours;z?H<12&&(G.hours+=12):H===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 d=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]),n=this.$locale(),!S&&O&&(n=_.Ls[O]),this.$d=function(R,I,G){try{if(["x","X"].indexOf(I)>-1)return new Date((I==="X"?1e3:1)*R);var z=k(I)(R),H=z.year,U=z.month,_e=z.day,Ee=z.hours,Ce=z.minutes,Se=z.seconds,ve=z.milliseconds,Mt=z.zone,Z=new Date,J=_e||(H||U?1:Z.getDate()),tt=H||Z.getFullYear(),q=0;H&&!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("")}}(d,E,B),this.init(),O&&O!==!0&&(this.$L=this.locale(O).$L),D&&d!=this.format(E)&&(this.$d=new Date("")),n={}}else if(E instanceof Array)for(var M=E.length,Y=1;Y<=M;Y+=1){w[1]=E[Y-1];var N=_.apply(this,w);if(N.isValid()){this.$d=N.$d,this.$L=N.$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:a,barStart:o,barEnd:b,dateFormat:c}=e,g=t.computed(()=>i(f.value)),n=t.computed(()=>i(a.value)),i=(s,u)=>{let l;if(u!==void 0&&typeof s!="string"&&!(s instanceof Date)&&(l=u==="start"?s[o.value]:s[b.value]),typeof s=="string")l=s;else if(s instanceof Date)return L.default(s);const p=c.value||ht;return L.default(l,p,!0)};return{chartStartDayjs:g,chartEndDayjs:n,toDayjs:i,format:(s,u)=>u===!1?s instanceof Date?s:L.default(s).toDate():(typeof s=="string"||s instanceof Date?i(s):s).format(u)}}function yt(){const{precision:e}=$(),{chartStartDayjs:f,chartEndDayjs:a}=j(),o=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}}),c={hour:"HH",date:"DD.MMM",day:"DD.MMM",week:"WW",month:"MMMM YYYY",year:"YYYY"};return{timeaxisUnits:t.computed(()=>{const n=[],i=[],r=a.value.diff(f.value,"minutes",!0),s=o.value,u=b.value;let l=f.value,p=f.value;for(;p.isSameOrBefore(a.value);){const k=p.endOf(u),y=k.isAfter(a.value)?a.value.diff(p,"minutes",!0)/r*100:k.diff(p,"minutes",!0)/r*100;i.push({label:p.format(c[e==null?void 0:e.value]),value:String(p),date:p.toDate(),width:String(y)+"%"}),p=k.add(1,u==="isoWeek"?"week":u).startOf(u)}for(;l.isSameOrBefore(a.value);){const k=l.endOf(s),y=k.isAfter(a.value)?a.value.diff(l,"minutes",!0)/r*100:k.diff(l,"minutes",!0)/r*100;n.push({label:l.format(c[s]),value:String(l),date:l.toDate(),width:String(y)+"%"}),l=k.add(1,s).startOf(s)}return{upperUnits:n,lowerUnits:i}})}}const It={class:"g-grid-container"},Vt=t.defineComponent({__name:"GGanttGrid",props:{highlightedUnits:{}},setup(e){const{colors:f}=$(),{timeaxisUnits:a}=yt();return(o,b)=>(t.openBlock(),t.createElementBlock("div",It,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).lowerUnits,({label:c,value:g,width:n})=>{var i;return t.openBlock(),t.createElementBlock("div",{key:c,class:"g-grid-line",style:t.normalizeStyle({width:n,background:(i=o.highlightedUnits)!=null&&i.includes(Number(g))?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 At={class:"g-label-column-rows"},Ht=t.defineComponent({__name:"GGanttLabelColumn",setup(e){const{font:f,colors:a,labelColumnTitle:o,rowHeight:b}=$(),c=Q();return(g,n)=>(t.openBlock(),t.createElementBlock("div",{class:"g-label-column",style:t.normalizeStyle({fontFamily:t.unref(f),color:t.unref(a).text})},[t.renderSlot(g.$slots,"label-column-title",{},()=>[t.createElementVNode("div",{class:"g-label-column-header",style:t.normalizeStyle({background:t.unref(a).primary})},t.toDisplayString(t.unref(o)),5)]),t.createElementVNode("div",At,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(c)(),({label:i},r)=>(t.openBlock(),t.createElementBlock("div",{key:`${i}_${r}`,class:"g-label-column-row",style:t.normalizeStyle({background:r%2===0?t.unref(a).ternary:t.unref(a).quartenary,height:`${t.unref(b)}px`})},[t.renderSlot(g.$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:a}=$(),{timeaxisUnits:o}=yt(),b=t.computed(()=>Array.from({length:3600},(g,n)=>n+1).filter(g=>(g-1)%15===0));return(c,g)=>(t.openBlock(),t.createElementBlock("div",jt,[t.createElementVNode("div",Ft,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).upperUnits,({label:n,value:i,date:r,width:s},u)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:"g-upper-timeunit",style:t.normalizeStyle({background:u%2===0?t.unref(a).primary:t.unref(a).secondary,color:t.unref(a).text,width:s})},[t.renderSlot(c.$slots,"upper-timeunit",{label:n,value:i,date:r},()=>[t.createTextVNode(t.toDisplayString(n),1)])],4))),128))]),t.createElementVNode("div",Wt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o).lowerUnits,({label:n,value:i,date:r,width:s},u)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:"g-timeunit",style:t.normalizeStyle({background:u%2===0?t.unref(a).ternary:t.unref(a).quartenary,color:t.unref(a).text,flexDirection:t.unref(f)==="hour"?"column":"row",alignItems:t.unref(f)==="hour"?"":"center",width:s})},[t.renderSlot(c.$slots,"timeunit",{label:n,value:i,date:r},()=>[c.isActiveInSeconds?(t.openBlock(),t.createElementBlock("strong",Pt,t.toDisplayString(n),1)):(t.openBlock(),t.createElementBlock("span",Ut,t.toDisplayString(n),1)),c.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(a).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(a).text,fontSize:"7px"})},t.toDisplayString(l===1?"":(l-1)*1),5)),64)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,l=>(t.openBlock(),t.createElementBlock("div",{key:l,class:"g-timeaxis-second-pin",style:t.normalizeStyle({left:`${(l-1)*(100/3600)}%`})},[t.createElementVNode("span",{style:t.normalizeStyle({left:`${(l-1)*(100/3600)}%`})},t.toDisplayString((l-1)%60===0?"":(l-1)%60),5)],4))),128))])):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(a).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,a={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:o}=t.toRefs(f),{precision:b,font:c,barStart:g,barEnd:n,rowHeight:i}=$(),r=t.ref("0px"),s=t.ref("0px");t.watch(()=>f.bar,async()=>{var d;await t.nextTick();const y=((d=o==null?void 0:o.value)==null?void 0:d.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);r.value=`${C+i.value-10}px`,s.value=`${x}px`},{deep:!0,immediate:!0});const u=t.computed(()=>{var y,_;return((_=(y=o==null?void 0:o.value)==null?void 0:y.ganttBarConfig.style)==null?void 0:_.background)||Xt}),{toDayjs:l}=j(),p=t.computed(()=>{var y;return(y=o.value)==null?void 0:y[g.value]}),k=t.computed(()=>{var y;return(y=o.value)==null?void 0:y[n.value]}),h=t.computed(()=>{if(!(o!=null&&o.value))return"";const y=a[b.value],_=l(p.value).format(y),C=l(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:r.value,left:s.value,fontFamily:t.unref(c)})},[t.createElementVNode("div",{class:"g-gantt-tooltip-color-dot",style:t.normalizeStyle({background:u.value})},null,4),t.renderSlot(y.$slots,"default",{bar:t.unref(o),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:a}=e,{chartStartDayjs:o,chartEndDayjs:b,toDayjs:c,format:g}=j(e),n=t.computed(()=>b.value.diff(o.value,"minutes"));return{mapTimeToPosition:s=>{const u=a.width.value||0,l=c(s).diff(o.value,"minutes",!0);return Math.ceil(l/n.value*u)},mapPositionToTime:s=>{const u=a.width.value||0,l=s/u*n.value;return g(o.value.add(l,"minutes"),f.value)}}}const Zt=t.defineComponent({__name:"GGanttCurrentTime",setup(e){const{mapTimeToPosition:f}=P(),a=t.ref(L.default()),{colors:o,dateFormat:b,currentTimeLabel:c}=$(),g=t.computed(()=>{const n=b.value||"YYYY-MM-DD HH:mm";return f(L.default(a.value,n).format(n))});return(n,i)=>(t.openBlock(),t.createElementBlock("div",{class:"g-grid-current-time",style:t.normalizeStyle({left:`${g.value}px`})},[t.createElementVNode("div",{class:"g-grid-current-time-marker",style:t.normalizeStyle({border:`1px dashed ${t.unref(o).markerCurrentTime}`})},null,4),t.createElementVNode("span",{class:"g-grid-current-time-text",style:t.normalizeStyle({color:t.unref(o).markerCurrentTime})},[t.renderSlot(n.$slots,"current-time-label",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(c)),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 a=Jt(e);return(f=a==null?void 0:a.$el)!=null?f:a}const re=F?window:void 0;F&&window.document,F&&window.navigator,F&&window.location;function oe(e,f=!1){const a=t.ref(),o=()=>a.value=Boolean(e());return o(),ne(o,f),a}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 a={};for(var o in e)ae.call(e,o)&&f.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&Bt)for(var o of Bt(e))f.indexOf(o)<0&&ie.call(e,o)&&(a[o]=e[o]);return a};function le(e,f,a={}){const o=a,{window:b=re}=o,c=se(o,["window"]);let g;const n=oe(()=>b&&"ResizeObserver"in b),i=()=>{g&&(g.disconnect(),g=void 0)},r=t.watch(()=>wt(e),u=>{i(),n.value&&b&&u&&(g=new ResizeObserver(f),g.observe(u,c))},{immediate:!0,flush:"post"}),s=()=>{i(),r()};return ee(s),{isSupported:n,stop:s}}function ce(e,f={width:0,height:0},a={}){const o=t.ref(f.width),b=t.ref(f.height);return le(e,([c])=>{o.value=c.contentRect.width,b.value=c.contentRect.height},a),t.watch(()=>wt(e),c=>{o.value=c?f.width:0,b.value=c?f.height:0}),{width:o,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,a)=>f in e?de(e,f,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[f]=a,me=(e,f)=>{for(var a in f||(f={}))fe.call(f,a)&&_t(e,a,f[a]);if(xt)for(var a of xt(f))ue.call(f,a)&&_t(e,a,f[a]);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 a=e,{width:o,font:b,colorScheme:c}=t.toRefs(a),g=t.computed(()=>parseFloat(o.value)>500),n=t.useSlots(),i=t.computed(()=>typeof c.value!="string"?c.value:Et[c.value]||Et.default),r=()=>{var d;const m=(d=n.default)==null?void 0:d.call(n),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),u=t.ref(!1),l=t.ref(void 0);let p;const k=m=>{p&&clearTimeout(p),p=setTimeout(()=>{s.value=!0},800),l.value=m},h=()=>{clearTimeout(p),s.value=!1},y=(m,x,d,B)=>{switch(m.type){case"click":f("click-bar",{bar:x,e:m,datetime:d});break;case"mousedown":f("mousedown-bar",{bar:x,e:m,datetime:d});break;case"mouseup":f("mouseup-bar",{bar:x,e:m,datetime:d});break;case"dblclick":f("dblclick-bar",{bar:x,e:m,datetime:d});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":u.value=!0,f("dragstart-bar",{bar:x,e:m});break;case"drag":f("drag-bar",{bar:x,e:m});break;case"dragend":u.value=!1,f("dragend-bar",{bar:x,e:m,movedBars:B});break;case"contextmenu":f("contextmenu-bar",{bar:x,e:m,datetime:d});break}},_=t.ref(null),C=ce(_);return t.provide(ut,r),t.provide(mt,{...t.toRefs(a),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(Ht,{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:d})=>[t.renderSlot(m.$slots,"label-column-row",{label:d})]),_: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(o),background:i.value.background,fontFamily:t.unref(b)})},[m.hideTimeaxis?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Qt,{key:0,"is-active-in-seconds":g.value},{"upper-timeunit":t.withCtx(({label:d,value:B,date:w})=>[t.renderSlot(m.$slots,"upper-timeunit",{label:d,value:B,date:w})]),timeunit:t.withCtx(({label:d,value:B,date:w})=>[t.renderSlot(m.$slots,"timeunit",{label:d,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||u.value,bar:l.value},{default:t.withCtx(()=>[t.renderSlot(m.$slots,"bar-tooltip",{bar:l.value})]),_:3},8,["model-value","bar"])]))}}),Ye="";function St(e,f=()=>null,a=()=>null,o=$()){const{barStart:b,barEnd:c,pushOnOverlap:g}=o,n=t.ref(!1);let i=0,r;const{mapPositionToTime:s}=P(o),{toDayjs:u}=j(o),l=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",r=h;break;case"g-gantt-bar-handle-right":document.body.style.cursor="ew-resize",r=y;break;default:r=k}n.value=!0,window.addEventListener("mousemove",r),window.addEventListener("mouseup",C)},p=()=>{var d;const m=document.getElementById(e.ganttBarConfig.id),x=(d=m==null?void 0:m.closest(".g-gantt-row-bars-container"))==null?void 0:d.getBoundingClientRect();return{barElement:m,barContainer:x}},k=m=>{const{barElement:x,barContainer:d}=p();if(!x||!d)return;const B=x.getBoundingClientRect().width,w=m.clientX-d.left-i,E=w+B;_(w,E)||(e[b.value]=s(w),e[c.value]=s(E),f(m,e))},h=m=>{const{barElement:x,barContainer:d}=p();if(!x||!d)return;const B=m.clientX-d.left,w=s(B);u(w).isSameOrAfter(u(e,"end"))||(e[b.value]=w,f(m,e))},y=m=>{const{barElement:x,barContainer:d}=p();if(!x||!d)return;const B=m.clientX-d.left,w=s(B);u(w).isSameOrBefore(u(e,"start"))||(e[c.value]=w,f(m,e))},_=(m,x)=>{if(!g.value)return!1;const d=e.ganttBarConfig.dragLimitLeft,B=e.ganttBarConfig.dragLimitRight;return m&&d!=null&&m<d||x&&B!=null&&x>B},C=m=>{n.value=!1,document.body.style.cursor="",window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",C),a(m,e)};return{isDragging:n,initDrag:l}}function vt(){const e=t.inject(gt);if(!e)throw Error("Failed to inject emitBarEvent!");return e}function pe(){const e=$(),f=Q(),a=vt(),{pushOnOverlap:o,barStart:b,barEnd:c,noOverlap:g,dateFormat:n}=e,i=new Map,{toDayjs:r,format:s}=j(),u=(d,B)=>{const{initDrag:w}=St(d,p,C,e);a({...B,type:"dragstart"},d),w(B),m(d)},l=(d,B)=>{const w=d.ganttBarConfig.bundle;w!=null&&(f().forEach(E=>{E.bars.forEach(S=>{if(S.ganttBarConfig.bundle===w){const v=S===d?C:()=>null,{initDrag:D}=St(S,p,v,e);D(B),m(S)}})}),a({...B,type:"dragstart"},d))},p=(d,B)=>{a({...d,type:"drag"},B),k(B)},k=d=>{if(!(o!=null&&o.value))return;let B=d,{overlapBar:w,overlapType:E}=y(B);for(;w;){m(w);const S=r(B[b.value]),v=r(B[c.value]),D=r(w[b.value]),O=r(w[c.value]);let M;switch(E){case"left":M=O.diff(S,"seconds",!0),w[c.value]=s(B[b.value],n.value),w[b.value]=s(D.subtract(M,"seconds"),n.value);break;case"right":M=v.diff(D,"seconds",!0),w[b.value]=s(v,n.value),w[c.value]=s(O.add(M,"seconds"),n.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=(d,B,w)=>{m(d),d.ganttBarConfig.bundle&&f().forEach(E=>{E.bars.forEach(S=>{S.ganttBarConfig.bundle===d.ganttBarConfig.bundle&&S!==d&&(m(S),_(S,B,w))})})},y=d=>{var Y,N;let B,w,E;const S=(N=(Y=f().find(R=>R.bars.includes(d)))==null?void 0:Y.bars)!=null?N:[],v=r(d[b.value]),D=r(d[c.value]);return{overlapBar:S.find(R=>{if(R===d)return!1;const I=r(R[b.value]),G=r(R[c.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}},_=(d,B,w)=>{switch(w){case"left":d[b.value]=s(r(d,"start").subtract(B,"seconds"),n.value),d[c.value]=s(r(d,"end").subtract(B,"seconds"),n.value);break;case"right":d[b.value]=s(r(d,"start").add(B,"seconds"),n.value),d[c.value]=s(r(d,"end").add(B,"seconds"),n.value)}k(d)},C=(d,B)=>{x();const w={...d,type:"dragend"};a(w,B,void 0,new Map(i)),i.clear()},m=d=>{if(!i.has(d)){const B=d[b.value],w=d[c.value];i.set(d,{oldStart:B,oldEnd:w})}},x=()=>{if(o.value||!g.value)return;let d=!1;i.forEach((B,w)=>{const{overlapBar:E}=y(w);E!=null&&(d=!0)}),d&&i.forEach(({oldStart:B,oldEnd:w},E)=>{E[b.value]=B,E[c.value]=w})};return{initDragOfBar:u,initDragOfBundle:l}}function he(){const{pushOnOverlap:e}=$(),f=Q(),a=g=>{const n=[];return g!=null&&f().forEach(i=>{i.bars.forEach(r=>{r.ganttBarConfig.bundle===g&&n.push(r)})}),n},o=g=>{if(!e.value||g.ganttBarConfig.pushOnOverlap===!1)return;for(const i of["left","right"]){const r=i,{gapDistanceSoFar:s,bundleBarsAndGapDist:u}=b(g,0,r);let l=s;const p=u;if(!p)continue;for(let h=0;h<p.length;h++){const y=p[h].bar,_=p[h].gapDistance;a(y.ganttBarConfig.bundle).filter(m=>m!==y).forEach(m=>{const x=b(m,_,r),d=x.gapDistanceSoFar,B=x.bundleBarsAndGapDist;d!=null&&(!l||d<l)&&(l=d),B.forEach(w=>{p.find(E=>E.bar===w.bar)||p.push(w)})})}const k=document.getElementById(g.ganttBarConfig.id);l!=null&&r==="left"?g.ganttBarConfig.dragLimitLeft=k.offsetLeft-l:l!=null&&r==="right"&&(g.ganttBarConfig.dragLimitRight=k.offsetLeft+k.offsetWidth+l)}a(g.ganttBarConfig.bundle).forEach(i=>{i.ganttBarConfig.dragLimitLeft=g.ganttBarConfig.dragLimitLeft,i.ganttBarConfig.dragLimitRight=g.ganttBarConfig.dragLimitRight})},b=(g,n=0,i)=>{const r=g.ganttBarConfig.bundle?[{bar:g,gapDistance:n}]:[];let s=g,u=c(s,i);if(i==="left")for(;u;){const l=document.getElementById(s.ganttBarConfig.id),p=document.getElementById(u.ganttBarConfig.id),k=p.offsetLeft+p.offsetWidth;if(n+=l.offsetLeft-k,u.ganttBarConfig.immobile)return{gapDistanceSoFar:n,bundleBarsAndGapDist:r};u.ganttBarConfig.bundle&&r.push({bar:u,gapDistance:n}),s=u,u=c(u,"left")}if(i==="right")for(;u;){const l=document.getElementById(s.ganttBarConfig.id),p=document.getElementById(u.ganttBarConfig.id),k=l.offsetLeft+l.offsetWidth;if(n+=p.offsetLeft-k,u.ganttBarConfig.immobile)return{gapDistanceSoFar:n,bundleBarsAndGapDist:r};u.ganttBarConfig.bundle&&r.push({bar:u,gapDistance:n}),s=u,u=c(u,"right")}return{gapDistanceSoFar:null,bundleBarsAndGapDist:r}},c=(g,n)=>{var u,l;const i=document.getElementById(g.ganttBarConfig.id),r=(l=(u=f().find(p=>p.bars.includes(g)))==null?void 0:u.bars)!=null?l:[];let s=[];return n==="left"?s=r.filter(p=>{const k=document.getElementById(p.ganttBarConfig.id);return k&&k.offsetLeft<i.offsetLeft&&p.ganttBarConfig.pushOnOverlap!==!1}):s=r.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:o}}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,a=vt(),o=$(),{rowHeight:b}=o,{bar:c}=t.toRefs(f),{mapTimeToPosition:g,mapPositionToTime:n}=P(),{initDragOfBar:i,initDragOfBundle:r}=pe(),{setDragLimitsOfGanttBar:s}=he(),u=t.ref(!1),l=t.computed(()=>c.value.ganttBarConfig);function p(S){l.value.bundle!=null?r(c.value,S):i(c.value,S),u.value=!0}const k=()=>{s(c.value),!l.value.immobile&&(window.addEventListener("mousemove",p,{once:!0}),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",p),u.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=n(S.clientX-v.left);a(S,c.value,D)},{barStart:_,barEnd:C,width:m,chartStart:x,chartEnd:d,chartSize:B}=o,w=t.ref(0),E=t.ref(0);return t.onMounted(()=>{t.watch([c,m,x,d,B.width],()=>{w.value=g(c.value[_.value]),E.value=g(c.value[C.value])},{deep:!0,immediate:!0})}),(S,v)=>(t.openBlock(),t.createElementBlock("div",{id:l.value.id,class:t.normalizeClass(["g-gantt-bar",l.value.class||""]),style:t.normalizeStyle({...l.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:u.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(c)},()=>[t.createElementVNode("div",null,t.toDisplayString(l.value.label||""),1),l.value.html?(t.openBlock(),t.createElementBlock("div",{key:0,innerHTML:l.value.html},null,8,we)):t.createCommentVNode("",!0)])]),l.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 a=e,{rowHeight:o,colors:b,labelColumnTitle:c}=$(),{highlightOnHover:g}=t.toRefs(a),n=t.ref(!1),i=t.computed(()=>({height:`${o.value}px`,background:(g==null?void 0:g.value)&&n.value?b.value.hoverHighlight:null})),{mapPositionToTime:r}=P(),s=t.ref(null);t.provide(pt,s);const u=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=r(h);f("drop",{e:p,datetime:y})},l=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=>n.value=!0,["prevent"])),onDragleave:k[1]||(k[1]=h=>n.value=!1),onDrop:k[2]||(k[2]=h=>u(h)),onMouseover:k[3]||(k[3]=h=>n.value=!0),onMouseleave:k[4]||(k[4]=h=>n.value=!1)},[!l(p.label)&&!t.unref(c)?(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))}}),ze="";function Ot(){L.default.extend(Lt),L.default.extend(Yt),L.default.extend(Gt),L.default.extend(Rt),L.default.extend(zt),L.default.extend($t),L.default.extend(Nt)}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-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-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-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-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-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");