frappe-gantt
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -664,3 +664,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
return arrow; // eslint-disable-line | ||
}); | ||
}).filter(function (arr) { | ||
return arr; | ||
}); // filter falsy values | ||
self._arrows = self._arrows.concat(arrows); | ||
@@ -1589,2 +1591,8 @@ }; | ||
var new_end_date = new_start_date.clone().add(width_in_units * gt.config.step, 'hours'); | ||
// lets say duration is 2 days | ||
// start_date = May 24 00:00:00 | ||
// end_date = May 24 + 2 days = May 26 (incorrect) | ||
// so subtract 1 second so that | ||
// end_date = May 25 23:59:59 | ||
new_end_date.add('-1', 'seconds'); | ||
return { new_start_date: new_start_date, new_end_date: new_end_date }; | ||
@@ -1591,0 +1599,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Gantt",[],n):"object"==typeof exports?exports.Gantt=n():t.Gantt=n()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var a=e[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,n,e){function r(){a(),I.change_view_mode=c,I.unselect_all=U,I.view_is=H,I.get_bar=G,I.trigger_event=R,I.refresh=d,c(I.config.view_mode)}function a(){var t={header_height:50,column_width:30,step:24,view_modes:["Quarter Day","Half Day","Day","Week","Month"],bar:{height:20},arrow:{curve:5},padding:18,view_mode:"Day",date_format:"YYYY-MM-DD",custom_popup_html:null};I.config=Object.assign({},t,e),o(n)}function o(n){I.element=t,I._tasks=n,I._bars=[],I._arrows=[],I.element_groups={}}function d(t){o(t),c(I.config.view_mode)}function c(t){w(t),l(),h(),R("view_change",[t])}function l(){f(),u(),g(),p()}function f(){I.tasks=I._tasks.map(function(t,n){if(t._start=moment(t.start,I.config.date_format),t._end=moment(t.end,I.config.date_format),t._index=n,t.start||t.end||(t._start=moment().startOf("day"),t._end=moment().startOf("day").add(2,"days")),!t.start&&t.end&&(t._start=t._end.clone().add(-2,"days")),t.start&&!t.end&&(t._end=t._start.clone().add(2,"days")),t.start&&t.end||(t.invalid=!0),"string"==typeof t.dependencies||!t.dependencies){var e=[];t.dependencies&&(e=t.dependencies.split(",").map(function(t){return t.trim()}).filter(function(t){return t})),t.dependencies=e}return t.id||(t.id=L(t)),t})}function u(){I.dependency_map={};var t=!0,n=!1,e=void 0;try{for(var r,a=I.tasks[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value,i=!0,d=!1,s=void 0;try{for(var c,l=o.dependencies[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value;I.dependency_map[f]=I.dependency_map[f]||[],I.dependency_map[f].push(o.id)}}catch(u){d=!0,s=u}finally{try{!i&&l["return"]&&l["return"]()}finally{if(d)throw s}}}}catch(u){n=!0,e=u}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}}function g(){I.gantt_start=I.gantt_end=null;var t=!0,n=!1,e=void 0;try{for(var r,a=I.tasks[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;(!I.gantt_start||o._start<I.gantt_start)&&(I.gantt_start=o._start),(!I.gantt_end||o._end>I.gantt_end)&&(I.gantt_end=o._end)}}catch(i){n=!0,e=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}v(),m()}function p(){I.canvas||(I.canvas=Snap(I.element).addClass("gantt"))}function h(){_(),y(),k(),E(),T(),j(),W(),b(),A(),X()}function _(){I.canvas.clear(),I._bars=[],I._arrows=[]}function v(){H(["Quarter Day","Half Day"])?(I.gantt_start=I.gantt_start.clone().subtract(7,"day"),I.gantt_end=I.gantt_end.clone().add(7,"day")):H("Month")?(I.gantt_start=I.gantt_start.clone().startOf("year"),I.gantt_end=I.gantt_end.clone().endOf("month").add(1,"year")):(I.gantt_start=I.gantt_start.clone().startOf("month").subtract(1,"month"),I.gantt_end=I.gantt_end.clone().endOf("month").add(1,"month"))}function m(){I.dates=[];for(var t=null;null===t||t<I.gantt_end;)t=t?H("Month")?t.clone().add(1,"month"):t.clone().add(I.config.step,"hours"):I.gantt_start.clone(),I.dates.push(t)}function y(){var t=["grid","date","arrow","progress","bar","details"],n=!0,e=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=a.value;I.element_groups[i]=I.canvas.group().attr({id:i})}}catch(d){e=!0,r=d}finally{try{!n&&o["return"]&&o["return"]()}finally{if(e)throw r}}}function w(t){I.config.view_mode=t,"Day"===t?(I.config.step=24,I.config.column_width=38):"Half Day"===t?(I.config.step=12,I.config.column_width=38):"Quarter Day"===t?(I.config.step=6,I.config.column_width=38):"Week"===t?(I.config.step=168,I.config.column_width=140):"Month"===t&&(I.config.step=720,I.config.column_width=120)}function b(){var t=I.canvas.node.getBoundingClientRect().width,n=I.canvas.select("#grid .grid-row").attr("width");t<n&&I.canvas.attr("width",n)}function A(){var t=document.querySelector(I.element).parentElement;if(t){var n=x().diff(I.gantt_start,"hours")/I.config.step*I.config.column_width-I.config.column_width;t.scrollLeft=n}}function x(){var t=I.tasks.reduce(function(t,n){return n._start.isSameOrBefore(t._start)?n:t});return t._start}function k(){C(),$(),B(),M(),D()}function C(){var t=I.dates.length*I.config.column_width,n=I.config.header_height+I.config.padding+(I.config.bar.height+I.config.padding)*I.tasks.length;I.canvas.rect(0,0,t,n).addClass("grid-background").appendTo(I.element_groups.grid),I.canvas.attr({height:n+I.config.padding,width:"100%"})}function B(){var t=I.dates.length*I.config.column_width,n=I.config.header_height+10;I.canvas.rect(0,0,t,n).addClass("grid-header").appendTo(I.element_groups.grid)}function $(){var t=I.canvas.group().appendTo(I.element_groups.grid),n=I.canvas.group().appendTo(I.element_groups.grid),e=I.dates.length*I.config.column_width,r=I.config.bar.height+I.config.padding,a=I.config.header_height+I.config.padding/2,o=!0,i=!1,d=void 0;try{for(var s,c=I.tasks[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){s.value;I.canvas.rect(0,a,e,r).addClass("grid-row").appendTo(t),I.canvas.line(0,a+r,e,a+r).addClass("row-line").appendTo(n),a+=I.config.bar.height+I.config.padding}}catch(l){i=!0,d=l}finally{try{!o&&c["return"]&&c["return"]()}finally{if(i)throw d}}}function M(){var t=0,n=I.config.header_height+I.config.padding/2,e=(I.config.bar.height+I.config.padding)*I.tasks.length,r=!0,a=!1,o=void 0;try{for(var i,d=I.dates[Symbol.iterator]();!(r=(i=d.next()).done);r=!0){var s=i.value,c="tick";H("Day")&&1===s.day()&&(c+=" thick"),H("Week")&&s.date()>=1&&s.date()<8&&(c+=" thick"),H("Month")&&s.month()%3===0&&(c+=" thick"),I.canvas.path(Snap.format("M {x} {y} v {height}",{x:t,y:n,height:e})).addClass(c).appendTo(I.element_groups.grid),t+=H("Month")?s.daysInMonth()*I.config.column_width/30:I.config.column_width}}catch(l){a=!0,o=l}finally{try{!r&&d["return"]&&d["return"]()}finally{if(a)throw o}}}function D(){if(H("Day")){var t=moment().startOf("day").diff(I.gantt_start,"hours")/I.config.step*I.config.column_width,n=0,e=I.config.column_width,r=(I.config.bar.height+I.config.padding)*I.tasks.length+I.config.header_height+I.config.padding/2;I.canvas.rect(t,n,e,r).addClass("today-highlight").appendTo(I.element_groups.grid)}}function E(){var t=!0,n=!1,e=void 0;try{for(var r,a=S()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;if(I.canvas.text(o.lower_x,o.lower_y,o.lower_text).addClass("lower-text").appendTo(I.element_groups.date),o.upper_text){var i=I.canvas.text(o.upper_x,o.upper_y,o.upper_text).addClass("upper-text").appendTo(I.element_groups.date);i.getBBox().x2>I.element_groups.grid.getBBox().width&&i.remove()}}}catch(d){n=!0,e=d}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}}function S(){var t=null,n=I.dates.map(function(n,e){var r=Y(n,t,e);return t=n,r});return n}function Y(t,n,e){n||(n=t.clone().add(1,"year"));var r={"Quarter Day_lower":t.format("HH"),"Half Day_lower":t.format("HH"),Day_lower:t.date()!==n.date()?t.format("D"):"",Week_lower:t.month()!==n.month()?t.format("D MMM"):t.format("D"),Month_lower:t.format("MMMM"),"Quarter Day_upper":t.date()!==n.date()?t.format("D MMM"):"","Half Day_upper":t.date()!==n.date()?t.month()!==n.month()?t.format("D MMM"):t.format("D"):"",Day_upper:t.month()!==n.month()?t.format("MMMM"):"",Week_upper:t.month()!==n.month()?t.format("MMMM"):"",Month_upper:t.year()!==n.year()?t.format("YYYY"):""},a={x:e*I.config.column_width,lower_y:I.config.header_height,upper_y:I.config.header_height-25},o={"Quarter Day_lower":4*I.config.column_width/2,"Quarter Day_upper":0,"Half Day_lower":2*I.config.column_width/2,"Half Day_upper":0,Day_lower:I.config.column_width/2,Day_upper:30*I.config.column_width/2,Week_lower:0,Week_upper:4*I.config.column_width/2,Month_lower:I.config.column_width/2,Month_upper:12*I.config.column_width/2};return{upper_text:r[I.config.view_mode+"_upper"],lower_text:r[I.config.view_mode+"_lower"],upper_x:a.x+o[I.config.view_mode+"_upper"],upper_y:a.upper_y,lower_x:a.x+o[I.config.view_mode+"_lower"],lower_y:a.lower_y}}function j(){I._arrows=[];var t=!0,n=!1,e=void 0;try{for(var r,a=function(){var t=r.value,n=[];n=t.dependencies.map(function(n){var e=O(n);if(e){var r=(0,s["default"])(I,I._bars[e._index],I._bars[t._index]);return I.element_groups.arrow.add(r.element),r}}),I._arrows=I._arrows.concat(n)},o=I.tasks[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){n=!0,e=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(n)throw e}}}function T(){I._bars=I.tasks.map(function(t){var n=(0,i["default"])(I,t);return I.element_groups.bar.add(n.group),n})}function W(){var t=!0,n=!1,e=void 0;try{for(var r,a=function(){var t=r.value;t.arrows=I._arrows.filter(function(n){return n.from_task.task.id===t.task.id||n.to_task.task.id===t.task.id})},o=I._bars[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){n=!0,e=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(n)throw e}}}function X(){I.element_groups.grid.click(function(){U(),I.element_groups.details.selectAll(".details-wrapper").forEach(function(t){return t.addClass("hide")})})}function U(){I.canvas.selectAll(".bar-wrapper").forEach(function(t){t.removeClass("active")})}function H(t){if("string"==typeof t)return I.config.view_mode===t;if(Array.isArray(t)){var n=!0,e=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=a.value;if(I.config.view_mode===i)return!0}}catch(d){e=!0,r=d}finally{try{!n&&o["return"]&&o["return"]()}finally{if(e)throw r}}return!1}}function O(t){return I.tasks.find(function(n){return n.id===t})}function G(t){return I._bars.find(function(n){return n.task.id===t})}function L(t){return t.name+"_"+Math.random().toString(36).slice(2,12)}function R(t,n){I.config["on_"+t]&&I.config["on_"+t].apply(null,n)}var I={};return r(),I}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=a,e(1);var o=e(5),i=r(o),d=e(6),s=r(d);t.exports=n["default"]},function(t,n,e){var r=e(2);"string"==typeof r&&(r=[[t.id,r,""]]);e(4)(r,{});r.locals&&(t.exports=r.locals)},function(t,n,e){n=t.exports=e(3)(),n.push([t.id,".gantt .grid-background{fill:none}.gantt .grid-header{fill:#fff;stroke:#e0e0e0;stroke-width:1.4}.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(2n){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.2}.gantt .tick.thick{stroke-width:.4}.gantt .today-highlight{fill:#fcf8e3;opacity:.5}.gantt #arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{fill:#b8c2cc;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease}.gantt .bar-progress{fill:#a3a3ff}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-width:1;stroke-dasharray:5}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;dominant-baseline:central;text-anchor:middle;font-size:12px;font-weight:lighter;letter-spacing:.8px}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .handle{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden;transition:opacity .3s ease}.gantt .bar-wrapper{cursor:pointer}.gantt .bar-wrapper:hover .bar{stroke-width:2}.gantt .bar-wrapper:hover .handle{visibility:visible;opacity:1}.gantt .bar-wrapper.active .bar{stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt #details .details-container{background:#fff;display:inline-block;padding:12px}.gantt #details .details-container h5,.gantt #details .details-container p{margin:0}.gantt #details .details-container h5{font-size:12px;font-weight:700;margin-bottom:10px;color:#555}.gantt #details .details-container p{font-size:12px;margin-bottom:6px;color:#666}.gantt #details .details-container p:last-child{margin-bottom:0}.gantt .hide{display:none}","",{version:3,sources:["/./src/src/gantt.scss"],names:[],mappings:"AAYA,wBAGE,SAAU,CAHZ,oBAME,UACA,eACA,gBAAiB,CARnB,iBAWE,SAAa,CAXf,+BAcE,YAvBgB,CASlB,iBAiBE,cAzB0B,CAQ5B,aAoBE,eACA,eAAiB,CArBnB,mBAuBG,eAAiB,CAvBpB,wBA2BE,aACA,UAAY,CA5Bd,cAgCE,UACA,YACA,gBAAiB,CAlCnB,YAsCE,aACA,eACA,eACA,gCAAiC,CAzCnC,qBA4CE,YA/CY,CAGd,oBA+CE,iBACA,eACA,eACA,kBAAmB,CAlDrB,+BAqDG,SA1Dc,CAKjB,kBAyDE,UACA,0BACA,mBACA,eACA,oBACA,mBAAqB,CA9DvB,sBAiEG,UACA,iBAAkB,CAlErB,eAuEE,UACA,iBACA,UACA,kBACA,2BAA4B,CA3E9B,oBA+EE,cAAe,CA/EjB,+BAmFI,cAAe,CAnFnB,kCAuFI,mBACA,SAAU,CAxFd,gCA8FI,cAAe,CA9FnB,sCAoGE,eACA,kBAAmB,CArGrB,mBAwGE,SA7Ge,CAKjB,mBA2GE,SA/Ge,CAIjB,mCA+GE,gBACA,qBACA,YAAa,CAjHf,2EAoHG,QAAS,CApHZ,sCAwHG,eACA,gBACA,mBACA,UAhIc,CAKjB,qCA+HG,eACA,kBACA,UAvIc,CAMjB,gDAqIG,eAAgB,CArInB,aA0IE,YAAa,CACb",file:"gantt.scss",sourcesContent:["$bar-color: #b8c2cc;\n$bar-stroke: #8D99A6;\n$border-color: #e0e0e0;\n$light-bg: #f5f5f5;\n$light-border-color: #ebeff2;\n$light-yellow: #fcf8e3;\n$text-muted: #666;\n$text-light: #555;\n$text-color: #333;\n$blue: #a3a3ff;\n$handle-color: #ddd;\n\n.gantt {\n\n\t.grid-background {\n\t\tfill: none;\n\t}\n\t.grid-header {\n\t\tfill: #ffffff;\n\t\tstroke: $border-color;\n\t\tstroke-width: 1.4;\n\t}\n\t.grid-row {\n\t\tfill: #ffffff;\n\t}\n\t.grid-row:nth-child(even) {\n\t\tfill: $light-bg;\n\t}\n\t.row-line {\n\t\tstroke: $light-border-color;\n\t}\n\t.tick {\n\t\tstroke: $border-color;\n\t\tstroke-width: 0.2;\n\t\t&.thick {\n\t\t\tstroke-width: 0.4;\n\t\t}\n\t}\n\t.today-highlight {\n\t\tfill: $light-yellow;\n\t\topacity: 0.5;\n\t}\n\n\t#arrow {\n\t\tfill: none;\n\t\tstroke: $text-muted;\n\t\tstroke-width: 1.4;\n\t}\n\n\t.bar {\n\t\tfill: $bar-color;\n\t\tstroke: $bar-stroke;\n\t\tstroke-width: 0;\n\t\ttransition: stroke-width .3s ease;\n\t}\n\t.bar-progress {\n\t\tfill: $blue;\n\t}\n\t.bar-invalid {\n\t\tfill: transparent;\n\t\tstroke: $bar-stroke;\n\t\tstroke-width: 1;\n\t\tstroke-dasharray: 5;\n\n\t\t&~.bar-label {\n\t\t\tfill: $text-light;\n\t\t}\n\t}\n\t.bar-label {\n\t\tfill: #fff;\n\t\tdominant-baseline: central;\n\t\ttext-anchor: middle;\n\t\tfont-size: 12px;\n\t\tfont-weight: lighter;\n\t\tletter-spacing: 0.8px;\n\n\t\t&.big {\n\t\t\tfill: $text-light;\n\t\t\ttext-anchor: start;\n\t\t}\n\t}\n\n\t.handle {\n\t\tfill: $handle-color;\n\t\tcursor: ew-resize;\n\t\topacity: 0;\n\t\tvisibility: hidden;\n\t\ttransition: opacity .3s ease;\n\t}\n\n\t.bar-wrapper {\n\t\tcursor: pointer;\n\n\t\t&:hover {\n\t\t\t.bar {\n\t\t\t\tstroke-width: 2;\n\t\t\t}\n\n\t\t\t.handle {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t&.active {\n\t\t\t.bar {\n\t\t\t\tstroke-width: 2;\n\t\t\t}\n\t\t}\n\t}\n\n\t.lower-text, .upper-text {\n\t\tfont-size: 12px;\n\t\ttext-anchor: middle;\n\t}\n\t.upper-text {\n\t\tfill: $text-light;\n\t}\n\t.lower-text {\n\t\tfill: $text-color;\n\t}\n\n\t#details .details-container {\n\t\tbackground: #fff;\n\t\tdisplay: inline-block;\n\t\tpadding: 12px;\n\n\t\th5, p {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\th5 {\n\t\t\tfont-size: 12px;\n\t\t\tfont-weight: bold;\n\t\t\tmargin-bottom: 10px;\n\t\t\tcolor: $text-light;\n\t\t}\n\n\t\tp {\n\t\t\tfont-size: 12px;\n\t\t\tmargin-bottom: 6px;\n\t\t\tcolor: $text-muted;\n\t\t}\n\n\t\tp:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n}"],sourceRoot:"webpack://"}])},function(t,n){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],n=0;n<this.length;n++){var e=this[n];e[2]?t.push("@media "+e[2]+"{"+e[1]+"}"):t.push(e[1])}return t.join("")},t.i=function(n,e){"string"==typeof n&&(n=[[null,n,""]]);for(var r={},a=0;a<this.length;a++){var o=this[a][0];"number"==typeof o&&(r[o]=!0)}for(a=0;a<n.length;a++){var i=n[a];"number"==typeof i[0]&&r[i[0]]||(e&&!i[2]?i[2]=e:e&&(i[2]="("+i[2]+") and ("+e+")"),t.push(i))}},t}},function(t,n,e){function r(t,n){for(var e=0;e<t.length;e++){var r=t[e],a=g[r.id];if(a){a.refs++;for(var o=0;o<a.parts.length;o++)a.parts[o](r.parts[o]);for(;o<r.parts.length;o++)a.parts.push(c(r.parts[o],n))}else{for(var i=[],o=0;o<r.parts.length;o++)i.push(c(r.parts[o],n));g[r.id]={id:r.id,refs:1,parts:i}}}}function a(t){for(var n=[],e={},r=0;r<t.length;r++){var a=t[r],o=a[0],i=a[1],d=a[2],s=a[3],c={css:i,media:d,sourceMap:s};e[o]?e[o].parts.push(c):n.push(e[o]={id:o,parts:[c]})}return n}function o(t,n){var e=_(),r=y[y.length-1];if("top"===t.insertAt)r?r.nextSibling?e.insertBefore(n,r.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),y.push(n);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");e.appendChild(n)}}function i(t){t.parentNode.removeChild(t);var n=y.indexOf(t);n>=0&&y.splice(n,1)}function d(t){var n=document.createElement("style");return n.type="text/css",o(t,n),n}function s(t){var n=document.createElement("link");return n.rel="stylesheet",o(t,n),n}function c(t,n){var e,r,a;if(n.singleton){var o=m++;e=v||(v=d(n)),r=l.bind(null,e,o,!1),a=l.bind(null,e,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=s(n),r=u.bind(null,e),a=function(){i(e),e.href&&URL.revokeObjectURL(e.href)}):(e=d(n),r=f.bind(null,e),a=function(){i(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else a()}}function l(t,n,e,r){var a=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(n,a);else{var o=document.createTextNode(a),i=t.childNodes;i[n]&&t.removeChild(i[n]),i.length?t.insertBefore(o,i[n]):t.appendChild(o)}}function f(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}function u(t,n){var e=n.css,r=n.sourceMap;r&&(e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([e],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(a),o&&URL.revokeObjectURL(o)}var g={},p=function(t){var n;return function(){return"undefined"==typeof n&&(n=t.apply(this,arguments)),n}},h=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),_=p(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,m=0,y=[];t.exports=function(t,n){n=n||{},"undefined"==typeof n.singleton&&(n.singleton=h()),"undefined"==typeof n.insertAt&&(n.insertAt="bottom");var e=a(t);return r(e,n),function(t){for(var o=[],i=0;i<e.length;i++){var d=e[i],s=g[d.id];s.refs--,o.push(s)}if(t){var c=a(t);r(c,n)}for(var i=0;i<o.length;i++){var s=o[i];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete g[s.id]}}}};var w=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},function(t,n){"use strict";function e(t,n){function e(){r(),a(),d(),g()}function r(){q.action_completed=!1,q.task=n}function a(){o(),i()}function o(){q.invalid=q.task.invalid,q.height=t.config.bar.height,q.x=U(),q.y=H(),q.corner_radius=3,q.duration=(q.task._end.diff(q.task._start,"hours")+24)/t.config.step,q.width=t.config.column_width*q.duration,q.progress_width=t.config.column_width*q.duration*(q.task.progress/100)||0,q.group=t.canvas.group().addClass("bar-wrapper").addClass(q.task.custom_class||""),q.bar_group=t.canvas.group().addClass("bar-group").appendTo(q.group),q.handle_group=t.canvas.group().addClass("handle-group").appendTo(q.group)}function i(){Snap.plugin(function(t,n,e,r,a){n.prototype.getX=function(){return+this.attr("x")},n.prototype.getY=function(){return+this.attr("y")},n.prototype.getWidth=function(){return+this.attr("width")},n.prototype.getHeight=function(){return+this.attr("height")},n.prototype.getEndX=function(){return this.getX()+this.getWidth()}})}function d(){s(),c(),l(),f()}function s(){q.$bar=t.canvas.rect(q.x,q.y,q.width,q.height,q.corner_radius,q.corner_radius).addClass("bar").appendTo(q.bar_group),q.invalid&&q.$bar.addClass("bar-invalid")}function c(){q.invalid||(q.$bar_progress=t.canvas.rect(q.x,q.y,q.progress_width,q.height,q.corner_radius,q.corner_radius).addClass("bar-progress").appendTo(q.bar_group))}function l(){t.canvas.text(q.x+q.width/2,q.y+q.height/2,q.task.name).addClass("bar-label").appendTo(q.bar_group),R()}function f(){if(!q.invalid){var n=q.$bar,e=8;t.canvas.rect(n.getX()+n.getWidth()-9,n.getY()+1,e,q.height-2,q.corner_radius,q.corner_radius).addClass("handle right").appendTo(q.handle_group),t.canvas.rect(n.getX()+1,n.getY()+1,e,q.height-2,q.corner_radius,q.corner_radius).addClass("handle left").appendTo(q.handle_group),q.task.progress&&q.task.progress<100&&t.canvas.polygon(u()).addClass("handle progress").appendTo(q.handle_group)}}function u(){var t=q.$bar_progress;return[t.getEndX()-5,t.getY()+t.getHeight(),t.getEndX()+5,t.getY()+t.getHeight(),t.getEndX(),t.getY()+t.getHeight()-8.66]}function g(){q.invalid||(S(),p(),m(),w(),b())}function p(){var n=t.element_groups.details;if(q.details_box=n.select(".details-wrapper[data-task='"+q.task.id+"']"),!q.details_box){q.details_box=t.canvas.group().addClass("details-wrapper hide").attr("data-task",q.task.id).appendTo(n),h();var e=t.canvas.filter(Snap.filter.shadow(0,1,1,"#666",.6));q.details_box.attr({filter:e})}q.group.click(function(t){q.action_completed||(n.selectAll(".details-wrapper").forEach(function(t){return t.addClass("hide")}),q.details_box.removeClass("hide"))})}function h(){var t=v(),n=t.x,e=t.y;q.details_box.transform("t"+n+","+e),q.details_box.clear();var r=_(),a=Snap.parse('<foreignObject width="5000" height="2000">\n\t\t\t\t<body xmlns="http://www.w3.org/1999/xhtml">\n\t\t\t\t\t'+r+"\n\t\t\t\t</body>\n\t\t\t\t</foreignObject>");q.details_box.append(a)}function _(){if(t.config.custom_popup_html){var e=t.config.custom_popup_html;if("string"==typeof e)return e;if(N(e))return e(n)}var r=q.task._start.format("MMM D"),a=q.task._end.format("MMM D"),o=q.task.name+": "+r+" - "+a,i="Duration: "+q.duration+" days",d=q.task.progress?"Progress: "+q.task.progress:null,s='\n\t\t\t<div class="details-container">\n\t\t\t\t<h5>'+o+"</h5>\n\t\t\t\t<p>"+i+"</p>\n\t\t\t\t"+(d?"<p>"+d+"</p>":"")+"\n\t\t\t</div>\n\t\t";return s}function v(){return{x:q.$bar.getEndX()+2,y:q.$bar.getY()-10}}function m(){function t(t,n){M(t,n)}function n(){D()}function e(t,n){C(t,n)}function r(){B()}var a=y(),o=a.left,i=a.right;o.drag(e,A,r),i.drag(t,A,n)}function y(){return{left:q.handle_group.select(".handle.left"),right:q.handle_group.select(".handle.right")}}function w(){q.bar_group.drag(x,A,k)}function b(){function t(t,n){t>a.max_dx&&(t=a.max_dx),t<a.min_dx&&(t=a.min_dx),a.attr("width",a.owidth+t),o.attr("points",u()),a.finaldx=t}function n(){a.finaldx&&(j(),T())}function e(){a.finaldx=0,a.owidth=a.getWidth(),a.min_dx=-a.getWidth(),a.max_dx=r.getWidth()-a.getWidth()}var r=q.$bar,a=q.$bar_progress,o=q.group.select(".handle.progress");o&&o.drag(t,e,n)}function A(){var t=q.$bar;t.ox=t.getX(),t.oy=t.getY(),t.owidth=t.getWidth(),t.finaldx=0,$("onstart")}function x(t,n){var e=q.$bar;e.finaldx=O(t),E({x:e.ox+e.finaldx}),$("onmove",[t,n])}function k(){var t=q.$bar;t.finaldx&&(Y(),T(),$("onstop"))}function C(t,n){var e=q.$bar;e.finaldx=O(t),E({x:e.ox+e.finaldx,width:e.owidth-e.finaldx}),$("onmove",[t,n])}function B(){var t=q.$bar;t.finaldx&&Y(),T(),$("onstop")}function $(n,e){var r=t.dependency_map;if(r[q.task.id]){var a=!0,o=!1,i=void 0;try{for(var d,s=r[q.task.id][Symbol.iterator]();!(a=(d=s.next()).done);a=!0){var c=d.value,l=t.get_bar(c);l[n].apply(l,e)}}catch(f){o=!0,i=f}finally{try{!a&&s["return"]&&s["return"]()}finally{if(o)throw i}}}}function M(t,n){var e=q.$bar;e.finaldx=O(t),E({width:e.owidth+e.finaldx})}function D(){var t=q.$bar;t.finaldx&&Y(),T()}function E(e){var r=e.x,a=void 0===r?null:r,o=e.width,i=void 0===o?null:o,d=q.$bar;if(a){var s=n.dependencies.map(function(n){return t.get_bar(n).$bar.getX()}),c=s.reduce(function(t,n){return a>=n},a);if(!c)return void(i=null);G(d,"x",a)}i&&i>=t.config.column_width&&G(d,"width",i),R(),I(),L(),z(),Q()}function S(){q.group.click(function(){q.action_completed||(q.group.hasClass("active")&&t.trigger_event("click",[q.task]),t.unselect_all(),q.group.toggleClass("active"))})}function Y(){var n=W(),e=n.new_start_date,r=n.new_end_date;q.task._start=e,q.task._end=r,h(),t.trigger_event("date_change",[q.task,e,r])}function j(){var n=X();q.task.progress=n,h(),t.trigger_event("progress_change",[q.task,n])}function T(){q.action_completed=!0,setTimeout(function(){return q.action_completed=!1},2e3)}function W(){var n=q.$bar,e=n.getX()/t.config.column_width,r=t.gantt_start.clone().add(e*t.config.step,"hours"),a=n.getWidth()/t.config.column_width,o=r.clone().add(a*t.config.step,"hours");return{new_start_date:r,new_end_date:o}}function X(){var t=q.$bar_progress.getWidth()/q.$bar.getWidth()*100;return parseInt(t,10)}function U(){var n=q.task._start.diff(t.gantt_start,"hours")/t.config.step*t.config.column_width;return t.view_is("Month")&&(n=q.task._start.diff(t.gantt_start,"days")*t.config.column_width/30),n}function H(){return t.config.header_height+t.config.padding+q.task._index*(q.height+t.config.padding)}function O(n){var e=n,r=void 0,a=void 0;return t.view_is("Week")?(r=n%(t.config.column_width/7),a=e-r+(r<t.config.column_width/14?0:t.config.column_width/7)):t.view_is("Month")?(r=n%(t.config.column_width/30),a=e-r+(r<t.config.column_width/60?0:t.config.column_width/30)):(r=n%t.config.column_width,a=e-r+(r<t.config.column_width/2?0:t.config.column_width)),a}function G(t,n,e){return e=+e,isNaN(e)||t.attr(n,e),t}function L(){q.$bar_progress.attr("x",q.$bar.getX()),q.$bar_progress.attr("width",q.$bar.getWidth()*(q.task.progress/100))}function R(){var t=q.$bar,n=q.group.select(".bar-label");n.getBBox().width>t.getWidth()?n.addClass("big").attr("x",t.getX()+t.getWidth()+5):n.removeClass("big").attr("x",t.getX()+t.getWidth()/2)}function I(){var t=q.$bar;q.handle_group.select(".handle.left").attr({x:t.getX()+1}),q.handle_group.select(".handle.right").attr({x:t.getEndX()-9});var n=q.group.select(".handle.progress");n&&n.attr("points",u())}function z(){var t=!0,n=!1,e=void 0;try{for(var r,a=q.arrows[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;o.update()}}catch(i){n=!0,e=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}}function Q(){var t=v(),n=t.x,e=t.y;q.details_box&&q.details_box.transform("t"+n+","+e)}function N(t){var n={};return t&&"[object Function]"===n.toString.call(t)}var q={};return q.onstart=A,q.onmove=x,q.onstop=k,q.onmove_handle_left=C,q.onstop_handle_left=B,e(),q}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=e,t.exports=n["default"]},function(t,n){"use strict";function e(t,n,e){function r(){d.from_task=n,d.to_task=e,a(),o()}function a(){d.start_x=n.$bar.getX()+n.$bar.getWidth()/2;for(var r=function(){return e.$bar.getX()<d.start_x+t.config.padding&&d.start_x>n.$bar.getX()+t.config.padding};r();)d.start_x-=10;d.start_y=t.config.header_height+t.config.bar.height+(t.config.padding+t.config.bar.height)*n.task._index+t.config.padding,d.end_x=e.$bar.getX()-t.config.padding/2,d.end_y=t.config.header_height+t.config.bar.height/2+(t.config.padding+t.config.bar.height)*e.task._index+t.config.padding;var a=n.task._index>e.task._index;d.curve=t.config.arrow.curve,d.clockwise=a?1:0,d.curve_y=a?-d.curve:d.curve,d.offset=a?d.end_y+t.config.arrow.curve:d.end_y-t.config.arrow.curve,d.path=Snap.format("M {start_x} {start_y} V {offset} a {curve} {curve} 0 0 {clockwise} {curve} {curve_y} L {end_x} {end_y} m -5 -5 l 5 5 l -5 5",{start_x:d.start_x,start_y:d.start_y,end_x:d.end_x,end_y:d.end_y,offset:d.offset,curve:d.curve,clockwise:d.clockwise,curve_y:d.curve_y}),e.$bar.getX()<n.$bar.getX()+t.config.padding&&(d.path=Snap.format("M {start_x} {start_y} v {down_1} a {curve} {curve} 0 0 1 -{curve} {curve} H {left} a {curve} {curve} 0 0 {clockwise} -{curve} {curve_y} V {down_2} a {curve} {curve} 0 0 {clockwise} {curve} {curve_y} L {end_x} {end_y} m -5 -5 l 5 5 l -5 5",{start_x:d.start_x,start_y:d.start_y,end_x:d.end_x,end_y:d.end_y,down_1:t.config.padding/2-d.curve,down_2:e.$bar.getY()+e.$bar.getHeight()/2-d.curve_y,left:e.$bar.getX()-t.config.padding,offset:d.offset,curve:d.curve,clockwise:d.clockwise,curve_y:d.curve_y}))}function o(){d.element=t.canvas.path(d.path).attr("data-from",d.from_task.task.id).attr("data-to",d.to_task.task.id)}function i(){a(),d.element.attr("d",d.path)}var d={};return d.update=i,r(),d}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=e,t.exports=n["default"]}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Gantt",[],n):"object"==typeof exports?exports.Gantt=n():t.Gantt=n()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var a=e[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,n,e){function r(){a(),I.change_view_mode=c,I.unselect_all=U,I.view_is=H,I.get_bar=G,I.trigger_event=R,I.refresh=d,c(I.config.view_mode)}function a(){var t={header_height:50,column_width:30,step:24,view_modes:["Quarter Day","Half Day","Day","Week","Month"],bar:{height:20},arrow:{curve:5},padding:18,view_mode:"Day",date_format:"YYYY-MM-DD",custom_popup_html:null};I.config=Object.assign({},t,e),o(n)}function o(n){I.element=t,I._tasks=n,I._bars=[],I._arrows=[],I.element_groups={}}function d(t){o(t),c(I.config.view_mode)}function c(t){w(t),l(),h(),R("view_change",[t])}function l(){f(),u(),g(),p()}function f(){I.tasks=I._tasks.map(function(t,n){if(t._start=moment(t.start,I.config.date_format),t._end=moment(t.end,I.config.date_format),t._index=n,t.start||t.end||(t._start=moment().startOf("day"),t._end=moment().startOf("day").add(2,"days")),!t.start&&t.end&&(t._start=t._end.clone().add(-2,"days")),t.start&&!t.end&&(t._end=t._start.clone().add(2,"days")),t.start&&t.end||(t.invalid=!0),"string"==typeof t.dependencies||!t.dependencies){var e=[];t.dependencies&&(e=t.dependencies.split(",").map(function(t){return t.trim()}).filter(function(t){return t})),t.dependencies=e}return t.id||(t.id=L(t)),t})}function u(){I.dependency_map={};var t=!0,n=!1,e=void 0;try{for(var r,a=I.tasks[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value,i=!0,d=!1,s=void 0;try{for(var c,l=o.dependencies[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value;I.dependency_map[f]=I.dependency_map[f]||[],I.dependency_map[f].push(o.id)}}catch(u){d=!0,s=u}finally{try{!i&&l["return"]&&l["return"]()}finally{if(d)throw s}}}}catch(u){n=!0,e=u}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}}function g(){I.gantt_start=I.gantt_end=null;var t=!0,n=!1,e=void 0;try{for(var r,a=I.tasks[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;(!I.gantt_start||o._start<I.gantt_start)&&(I.gantt_start=o._start),(!I.gantt_end||o._end>I.gantt_end)&&(I.gantt_end=o._end)}}catch(i){n=!0,e=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}v(),m()}function p(){I.canvas||(I.canvas=Snap(I.element).addClass("gantt"))}function h(){_(),y(),k(),E(),T(),j(),W(),b(),A(),X()}function _(){I.canvas.clear(),I._bars=[],I._arrows=[]}function v(){H(["Quarter Day","Half Day"])?(I.gantt_start=I.gantt_start.clone().subtract(7,"day"),I.gantt_end=I.gantt_end.clone().add(7,"day")):H("Month")?(I.gantt_start=I.gantt_start.clone().startOf("year"),I.gantt_end=I.gantt_end.clone().endOf("month").add(1,"year")):(I.gantt_start=I.gantt_start.clone().startOf("month").subtract(1,"month"),I.gantt_end=I.gantt_end.clone().endOf("month").add(1,"month"))}function m(){I.dates=[];for(var t=null;null===t||t<I.gantt_end;)t=t?H("Month")?t.clone().add(1,"month"):t.clone().add(I.config.step,"hours"):I.gantt_start.clone(),I.dates.push(t)}function y(){var t=["grid","date","arrow","progress","bar","details"],n=!0,e=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=a.value;I.element_groups[i]=I.canvas.group().attr({id:i})}}catch(d){e=!0,r=d}finally{try{!n&&o["return"]&&o["return"]()}finally{if(e)throw r}}}function w(t){I.config.view_mode=t,"Day"===t?(I.config.step=24,I.config.column_width=38):"Half Day"===t?(I.config.step=12,I.config.column_width=38):"Quarter Day"===t?(I.config.step=6,I.config.column_width=38):"Week"===t?(I.config.step=168,I.config.column_width=140):"Month"===t&&(I.config.step=720,I.config.column_width=120)}function b(){var t=I.canvas.node.getBoundingClientRect().width,n=I.canvas.select("#grid .grid-row").attr("width");t<n&&I.canvas.attr("width",n)}function A(){var t=document.querySelector(I.element).parentElement;if(t){var n=x().diff(I.gantt_start,"hours")/I.config.step*I.config.column_width-I.config.column_width;t.scrollLeft=n}}function x(){var t=I.tasks.reduce(function(t,n){return n._start.isSameOrBefore(t._start)?n:t});return t._start}function k(){C(),$(),B(),M(),D()}function C(){var t=I.dates.length*I.config.column_width,n=I.config.header_height+I.config.padding+(I.config.bar.height+I.config.padding)*I.tasks.length;I.canvas.rect(0,0,t,n).addClass("grid-background").appendTo(I.element_groups.grid),I.canvas.attr({height:n+I.config.padding,width:"100%"})}function B(){var t=I.dates.length*I.config.column_width,n=I.config.header_height+10;I.canvas.rect(0,0,t,n).addClass("grid-header").appendTo(I.element_groups.grid)}function $(){var t=I.canvas.group().appendTo(I.element_groups.grid),n=I.canvas.group().appendTo(I.element_groups.grid),e=I.dates.length*I.config.column_width,r=I.config.bar.height+I.config.padding,a=I.config.header_height+I.config.padding/2,o=!0,i=!1,d=void 0;try{for(var s,c=I.tasks[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){s.value;I.canvas.rect(0,a,e,r).addClass("grid-row").appendTo(t),I.canvas.line(0,a+r,e,a+r).addClass("row-line").appendTo(n),a+=I.config.bar.height+I.config.padding}}catch(l){i=!0,d=l}finally{try{!o&&c["return"]&&c["return"]()}finally{if(i)throw d}}}function M(){var t=0,n=I.config.header_height+I.config.padding/2,e=(I.config.bar.height+I.config.padding)*I.tasks.length,r=!0,a=!1,o=void 0;try{for(var i,d=I.dates[Symbol.iterator]();!(r=(i=d.next()).done);r=!0){var s=i.value,c="tick";H("Day")&&1===s.day()&&(c+=" thick"),H("Week")&&s.date()>=1&&s.date()<8&&(c+=" thick"),H("Month")&&s.month()%3===0&&(c+=" thick"),I.canvas.path(Snap.format("M {x} {y} v {height}",{x:t,y:n,height:e})).addClass(c).appendTo(I.element_groups.grid),t+=H("Month")?s.daysInMonth()*I.config.column_width/30:I.config.column_width}}catch(l){a=!0,o=l}finally{try{!r&&d["return"]&&d["return"]()}finally{if(a)throw o}}}function D(){if(H("Day")){var t=moment().startOf("day").diff(I.gantt_start,"hours")/I.config.step*I.config.column_width,n=0,e=I.config.column_width,r=(I.config.bar.height+I.config.padding)*I.tasks.length+I.config.header_height+I.config.padding/2;I.canvas.rect(t,n,e,r).addClass("today-highlight").appendTo(I.element_groups.grid)}}function E(){var t=!0,n=!1,e=void 0;try{for(var r,a=S()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;if(I.canvas.text(o.lower_x,o.lower_y,o.lower_text).addClass("lower-text").appendTo(I.element_groups.date),o.upper_text){var i=I.canvas.text(o.upper_x,o.upper_y,o.upper_text).addClass("upper-text").appendTo(I.element_groups.date);i.getBBox().x2>I.element_groups.grid.getBBox().width&&i.remove()}}}catch(d){n=!0,e=d}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}}function S(){var t=null,n=I.dates.map(function(n,e){var r=Y(n,t,e);return t=n,r});return n}function Y(t,n,e){n||(n=t.clone().add(1,"year"));var r={"Quarter Day_lower":t.format("HH"),"Half Day_lower":t.format("HH"),Day_lower:t.date()!==n.date()?t.format("D"):"",Week_lower:t.month()!==n.month()?t.format("D MMM"):t.format("D"),Month_lower:t.format("MMMM"),"Quarter Day_upper":t.date()!==n.date()?t.format("D MMM"):"","Half Day_upper":t.date()!==n.date()?t.month()!==n.month()?t.format("D MMM"):t.format("D"):"",Day_upper:t.month()!==n.month()?t.format("MMMM"):"",Week_upper:t.month()!==n.month()?t.format("MMMM"):"",Month_upper:t.year()!==n.year()?t.format("YYYY"):""},a={x:e*I.config.column_width,lower_y:I.config.header_height,upper_y:I.config.header_height-25},o={"Quarter Day_lower":4*I.config.column_width/2,"Quarter Day_upper":0,"Half Day_lower":2*I.config.column_width/2,"Half Day_upper":0,Day_lower:I.config.column_width/2,Day_upper:30*I.config.column_width/2,Week_lower:0,Week_upper:4*I.config.column_width/2,Month_lower:I.config.column_width/2,Month_upper:12*I.config.column_width/2};return{upper_text:r[I.config.view_mode+"_upper"],lower_text:r[I.config.view_mode+"_lower"],upper_x:a.x+o[I.config.view_mode+"_upper"],upper_y:a.upper_y,lower_x:a.x+o[I.config.view_mode+"_lower"],lower_y:a.lower_y}}function j(){I._arrows=[];var t=!0,n=!1,e=void 0;try{for(var r,a=function(){var t=r.value,n=[];n=t.dependencies.map(function(n){var e=O(n);if(e){var r=(0,s["default"])(I,I._bars[e._index],I._bars[t._index]);return I.element_groups.arrow.add(r.element),r}}).filter(function(t){return t}),I._arrows=I._arrows.concat(n)},o=I.tasks[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){n=!0,e=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(n)throw e}}}function T(){I._bars=I.tasks.map(function(t){var n=(0,i["default"])(I,t);return I.element_groups.bar.add(n.group),n})}function W(){var t=!0,n=!1,e=void 0;try{for(var r,a=function(){var t=r.value;t.arrows=I._arrows.filter(function(n){return n.from_task.task.id===t.task.id||n.to_task.task.id===t.task.id})},o=I._bars[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){n=!0,e=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(n)throw e}}}function X(){I.element_groups.grid.click(function(){U(),I.element_groups.details.selectAll(".details-wrapper").forEach(function(t){return t.addClass("hide")})})}function U(){I.canvas.selectAll(".bar-wrapper").forEach(function(t){t.removeClass("active")})}function H(t){if("string"==typeof t)return I.config.view_mode===t;if(Array.isArray(t)){var n=!0,e=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done);n=!0){var i=a.value;if(I.config.view_mode===i)return!0}}catch(d){e=!0,r=d}finally{try{!n&&o["return"]&&o["return"]()}finally{if(e)throw r}}return!1}}function O(t){return I.tasks.find(function(n){return n.id===t})}function G(t){return I._bars.find(function(n){return n.task.id===t})}function L(t){return t.name+"_"+Math.random().toString(36).slice(2,12)}function R(t,n){I.config["on_"+t]&&I.config["on_"+t].apply(null,n)}var I={};return r(),I}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=a,e(1);var o=e(5),i=r(o),d=e(6),s=r(d);t.exports=n["default"]},function(t,n,e){var r=e(2);"string"==typeof r&&(r=[[t.id,r,""]]);e(4)(r,{});r.locals&&(t.exports=r.locals)},function(t,n,e){n=t.exports=e(3)(),n.push([t.id,".gantt .grid-background{fill:none}.gantt .grid-header{fill:#fff;stroke:#e0e0e0;stroke-width:1.4}.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(2n){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.2}.gantt .tick.thick{stroke-width:.4}.gantt .today-highlight{fill:#fcf8e3;opacity:.5}.gantt #arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{fill:#b8c2cc;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease}.gantt .bar-progress{fill:#a3a3ff}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-width:1;stroke-dasharray:5}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;dominant-baseline:central;text-anchor:middle;font-size:12px;font-weight:lighter;letter-spacing:.8px}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .handle{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden;transition:opacity .3s ease}.gantt .bar-wrapper{cursor:pointer}.gantt .bar-wrapper:hover .bar{stroke-width:2}.gantt .bar-wrapper:hover .handle{visibility:visible;opacity:1}.gantt .bar-wrapper.active .bar{stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt #details .details-container{background:#fff;display:inline-block;padding:12px}.gantt #details .details-container h5,.gantt #details .details-container p{margin:0}.gantt #details .details-container h5{font-size:12px;font-weight:700;margin-bottom:10px;color:#555}.gantt #details .details-container p{font-size:12px;margin-bottom:6px;color:#666}.gantt #details .details-container p:last-child{margin-bottom:0}.gantt .hide{display:none}","",{version:3,sources:["/./src/src/gantt.scss"],names:[],mappings:"AAYA,wBAGE,SAAU,CAHZ,oBAME,UACA,eACA,gBAAiB,CARnB,iBAWE,SAAa,CAXf,+BAcE,YAvBgB,CASlB,iBAiBE,cAzB0B,CAQ5B,aAoBE,eACA,eAAiB,CArBnB,mBAuBG,eAAiB,CAvBpB,wBA2BE,aACA,UAAY,CA5Bd,cAgCE,UACA,YACA,gBAAiB,CAlCnB,YAsCE,aACA,eACA,eACA,gCAAiC,CAzCnC,qBA4CE,YA/CY,CAGd,oBA+CE,iBACA,eACA,eACA,kBAAmB,CAlDrB,+BAqDG,SA1Dc,CAKjB,kBAyDE,UACA,0BACA,mBACA,eACA,oBACA,mBAAqB,CA9DvB,sBAiEG,UACA,iBAAkB,CAlErB,eAuEE,UACA,iBACA,UACA,kBACA,2BAA4B,CA3E9B,oBA+EE,cAAe,CA/EjB,+BAmFI,cAAe,CAnFnB,kCAuFI,mBACA,SAAU,CAxFd,gCA8FI,cAAe,CA9FnB,sCAoGE,eACA,kBAAmB,CArGrB,mBAwGE,SA7Ge,CAKjB,mBA2GE,SA/Ge,CAIjB,mCA+GE,gBACA,qBACA,YAAa,CAjHf,2EAoHG,QAAS,CApHZ,sCAwHG,eACA,gBACA,mBACA,UAhIc,CAKjB,qCA+HG,eACA,kBACA,UAvIc,CAMjB,gDAqIG,eAAgB,CArInB,aA0IE,YAAa,CACb",file:"gantt.scss",sourcesContent:["$bar-color: #b8c2cc;\n$bar-stroke: #8D99A6;\n$border-color: #e0e0e0;\n$light-bg: #f5f5f5;\n$light-border-color: #ebeff2;\n$light-yellow: #fcf8e3;\n$text-muted: #666;\n$text-light: #555;\n$text-color: #333;\n$blue: #a3a3ff;\n$handle-color: #ddd;\n\n.gantt {\n\n\t.grid-background {\n\t\tfill: none;\n\t}\n\t.grid-header {\n\t\tfill: #ffffff;\n\t\tstroke: $border-color;\n\t\tstroke-width: 1.4;\n\t}\n\t.grid-row {\n\t\tfill: #ffffff;\n\t}\n\t.grid-row:nth-child(even) {\n\t\tfill: $light-bg;\n\t}\n\t.row-line {\n\t\tstroke: $light-border-color;\n\t}\n\t.tick {\n\t\tstroke: $border-color;\n\t\tstroke-width: 0.2;\n\t\t&.thick {\n\t\t\tstroke-width: 0.4;\n\t\t}\n\t}\n\t.today-highlight {\n\t\tfill: $light-yellow;\n\t\topacity: 0.5;\n\t}\n\n\t#arrow {\n\t\tfill: none;\n\t\tstroke: $text-muted;\n\t\tstroke-width: 1.4;\n\t}\n\n\t.bar {\n\t\tfill: $bar-color;\n\t\tstroke: $bar-stroke;\n\t\tstroke-width: 0;\n\t\ttransition: stroke-width .3s ease;\n\t}\n\t.bar-progress {\n\t\tfill: $blue;\n\t}\n\t.bar-invalid {\n\t\tfill: transparent;\n\t\tstroke: $bar-stroke;\n\t\tstroke-width: 1;\n\t\tstroke-dasharray: 5;\n\n\t\t&~.bar-label {\n\t\t\tfill: $text-light;\n\t\t}\n\t}\n\t.bar-label {\n\t\tfill: #fff;\n\t\tdominant-baseline: central;\n\t\ttext-anchor: middle;\n\t\tfont-size: 12px;\n\t\tfont-weight: lighter;\n\t\tletter-spacing: 0.8px;\n\n\t\t&.big {\n\t\t\tfill: $text-light;\n\t\t\ttext-anchor: start;\n\t\t}\n\t}\n\n\t.handle {\n\t\tfill: $handle-color;\n\t\tcursor: ew-resize;\n\t\topacity: 0;\n\t\tvisibility: hidden;\n\t\ttransition: opacity .3s ease;\n\t}\n\n\t.bar-wrapper {\n\t\tcursor: pointer;\n\n\t\t&:hover {\n\t\t\t.bar {\n\t\t\t\tstroke-width: 2;\n\t\t\t}\n\n\t\t\t.handle {\n\t\t\t\tvisibility: visible;\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\n\t\t&.active {\n\t\t\t.bar {\n\t\t\t\tstroke-width: 2;\n\t\t\t}\n\t\t}\n\t}\n\n\t.lower-text, .upper-text {\n\t\tfont-size: 12px;\n\t\ttext-anchor: middle;\n\t}\n\t.upper-text {\n\t\tfill: $text-light;\n\t}\n\t.lower-text {\n\t\tfill: $text-color;\n\t}\n\n\t#details .details-container {\n\t\tbackground: #fff;\n\t\tdisplay: inline-block;\n\t\tpadding: 12px;\n\n\t\th5, p {\n\t\t\tmargin: 0;\n\t\t}\n\n\t\th5 {\n\t\t\tfont-size: 12px;\n\t\t\tfont-weight: bold;\n\t\t\tmargin-bottom: 10px;\n\t\t\tcolor: $text-light;\n\t\t}\n\n\t\tp {\n\t\t\tfont-size: 12px;\n\t\t\tmargin-bottom: 6px;\n\t\t\tcolor: $text-muted;\n\t\t}\n\n\t\tp:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n}"],sourceRoot:"webpack://"}])},function(t,n){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],n=0;n<this.length;n++){var e=this[n];e[2]?t.push("@media "+e[2]+"{"+e[1]+"}"):t.push(e[1])}return t.join("")},t.i=function(n,e){"string"==typeof n&&(n=[[null,n,""]]);for(var r={},a=0;a<this.length;a++){var o=this[a][0];"number"==typeof o&&(r[o]=!0)}for(a=0;a<n.length;a++){var i=n[a];"number"==typeof i[0]&&r[i[0]]||(e&&!i[2]?i[2]=e:e&&(i[2]="("+i[2]+") and ("+e+")"),t.push(i))}},t}},function(t,n,e){function r(t,n){for(var e=0;e<t.length;e++){var r=t[e],a=g[r.id];if(a){a.refs++;for(var o=0;o<a.parts.length;o++)a.parts[o](r.parts[o]);for(;o<r.parts.length;o++)a.parts.push(c(r.parts[o],n))}else{for(var i=[],o=0;o<r.parts.length;o++)i.push(c(r.parts[o],n));g[r.id]={id:r.id,refs:1,parts:i}}}}function a(t){for(var n=[],e={},r=0;r<t.length;r++){var a=t[r],o=a[0],i=a[1],d=a[2],s=a[3],c={css:i,media:d,sourceMap:s};e[o]?e[o].parts.push(c):n.push(e[o]={id:o,parts:[c]})}return n}function o(t,n){var e=_(),r=y[y.length-1];if("top"===t.insertAt)r?r.nextSibling?e.insertBefore(n,r.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),y.push(n);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");e.appendChild(n)}}function i(t){t.parentNode.removeChild(t);var n=y.indexOf(t);n>=0&&y.splice(n,1)}function d(t){var n=document.createElement("style");return n.type="text/css",o(t,n),n}function s(t){var n=document.createElement("link");return n.rel="stylesheet",o(t,n),n}function c(t,n){var e,r,a;if(n.singleton){var o=m++;e=v||(v=d(n)),r=l.bind(null,e,o,!1),a=l.bind(null,e,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=s(n),r=u.bind(null,e),a=function(){i(e),e.href&&URL.revokeObjectURL(e.href)}):(e=d(n),r=f.bind(null,e),a=function(){i(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else a()}}function l(t,n,e,r){var a=e?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(n,a);else{var o=document.createTextNode(a),i=t.childNodes;i[n]&&t.removeChild(i[n]),i.length?t.insertBefore(o,i[n]):t.appendChild(o)}}function f(t,n){var e=n.css,r=n.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}function u(t,n){var e=n.css,r=n.sourceMap;r&&(e+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([e],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(a),o&&URL.revokeObjectURL(o)}var g={},p=function(t){var n;return function(){return"undefined"==typeof n&&(n=t.apply(this,arguments)),n}},h=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),_=p(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,m=0,y=[];t.exports=function(t,n){n=n||{},"undefined"==typeof n.singleton&&(n.singleton=h()),"undefined"==typeof n.insertAt&&(n.insertAt="bottom");var e=a(t);return r(e,n),function(t){for(var o=[],i=0;i<e.length;i++){var d=e[i],s=g[d.id];s.refs--,o.push(s)}if(t){var c=a(t);r(c,n)}for(var i=0;i<o.length;i++){var s=o[i];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete g[s.id]}}}};var w=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},function(t,n){"use strict";function e(t,n){function e(){r(),a(),d(),g()}function r(){q.action_completed=!1,q.task=n}function a(){o(),i()}function o(){q.invalid=q.task.invalid,q.height=t.config.bar.height,q.x=U(),q.y=H(),q.corner_radius=3,q.duration=(q.task._end.diff(q.task._start,"hours")+24)/t.config.step,q.width=t.config.column_width*q.duration,q.progress_width=t.config.column_width*q.duration*(q.task.progress/100)||0,q.group=t.canvas.group().addClass("bar-wrapper").addClass(q.task.custom_class||""),q.bar_group=t.canvas.group().addClass("bar-group").appendTo(q.group),q.handle_group=t.canvas.group().addClass("handle-group").appendTo(q.group)}function i(){Snap.plugin(function(t,n,e,r,a){n.prototype.getX=function(){return+this.attr("x")},n.prototype.getY=function(){return+this.attr("y")},n.prototype.getWidth=function(){return+this.attr("width")},n.prototype.getHeight=function(){return+this.attr("height")},n.prototype.getEndX=function(){return this.getX()+this.getWidth()}})}function d(){s(),c(),l(),f()}function s(){q.$bar=t.canvas.rect(q.x,q.y,q.width,q.height,q.corner_radius,q.corner_radius).addClass("bar").appendTo(q.bar_group),q.invalid&&q.$bar.addClass("bar-invalid")}function c(){q.invalid||(q.$bar_progress=t.canvas.rect(q.x,q.y,q.progress_width,q.height,q.corner_radius,q.corner_radius).addClass("bar-progress").appendTo(q.bar_group))}function l(){t.canvas.text(q.x+q.width/2,q.y+q.height/2,q.task.name).addClass("bar-label").appendTo(q.bar_group),R()}function f(){if(!q.invalid){var n=q.$bar,e=8;t.canvas.rect(n.getX()+n.getWidth()-9,n.getY()+1,e,q.height-2,q.corner_radius,q.corner_radius).addClass("handle right").appendTo(q.handle_group),t.canvas.rect(n.getX()+1,n.getY()+1,e,q.height-2,q.corner_radius,q.corner_radius).addClass("handle left").appendTo(q.handle_group),q.task.progress&&q.task.progress<100&&t.canvas.polygon(u()).addClass("handle progress").appendTo(q.handle_group)}}function u(){var t=q.$bar_progress;return[t.getEndX()-5,t.getY()+t.getHeight(),t.getEndX()+5,t.getY()+t.getHeight(),t.getEndX(),t.getY()+t.getHeight()-8.66]}function g(){q.invalid||(S(),p(),m(),w(),b())}function p(){var n=t.element_groups.details;if(q.details_box=n.select(".details-wrapper[data-task='"+q.task.id+"']"),!q.details_box){q.details_box=t.canvas.group().addClass("details-wrapper hide").attr("data-task",q.task.id).appendTo(n),h();var e=t.canvas.filter(Snap.filter.shadow(0,1,1,"#666",.6));q.details_box.attr({filter:e})}q.group.click(function(t){q.action_completed||(n.selectAll(".details-wrapper").forEach(function(t){return t.addClass("hide")}),q.details_box.removeClass("hide"))})}function h(){var t=v(),n=t.x,e=t.y;q.details_box.transform("t"+n+","+e),q.details_box.clear();var r=_(),a=Snap.parse('<foreignObject width="5000" height="2000">\n\t\t\t\t<body xmlns="http://www.w3.org/1999/xhtml">\n\t\t\t\t\t'+r+"\n\t\t\t\t</body>\n\t\t\t\t</foreignObject>");q.details_box.append(a)}function _(){if(t.config.custom_popup_html){var e=t.config.custom_popup_html;if("string"==typeof e)return e;if(N(e))return e(n)}var r=q.task._start.format("MMM D"),a=q.task._end.format("MMM D"),o=q.task.name+": "+r+" - "+a,i="Duration: "+q.duration+" days",d=q.task.progress?"Progress: "+q.task.progress:null,s='\n\t\t\t<div class="details-container">\n\t\t\t\t<h5>'+o+"</h5>\n\t\t\t\t<p>"+i+"</p>\n\t\t\t\t"+(d?"<p>"+d+"</p>":"")+"\n\t\t\t</div>\n\t\t";return s}function v(){return{x:q.$bar.getEndX()+2,y:q.$bar.getY()-10}}function m(){function t(t,n){M(t,n)}function n(){D()}function e(t,n){C(t,n)}function r(){B()}var a=y(),o=a.left,i=a.right;o.drag(e,A,r),i.drag(t,A,n)}function y(){return{left:q.handle_group.select(".handle.left"),right:q.handle_group.select(".handle.right")}}function w(){q.bar_group.drag(x,A,k)}function b(){function t(t,n){t>a.max_dx&&(t=a.max_dx),t<a.min_dx&&(t=a.min_dx),a.attr("width",a.owidth+t),o.attr("points",u()),a.finaldx=t}function n(){a.finaldx&&(j(),T())}function e(){a.finaldx=0,a.owidth=a.getWidth(),a.min_dx=-a.getWidth(),a.max_dx=r.getWidth()-a.getWidth()}var r=q.$bar,a=q.$bar_progress,o=q.group.select(".handle.progress");o&&o.drag(t,e,n)}function A(){var t=q.$bar;t.ox=t.getX(),t.oy=t.getY(),t.owidth=t.getWidth(),t.finaldx=0,$("onstart")}function x(t,n){var e=q.$bar;e.finaldx=O(t),E({x:e.ox+e.finaldx}),$("onmove",[t,n])}function k(){var t=q.$bar;t.finaldx&&(Y(),T(),$("onstop"))}function C(t,n){var e=q.$bar;e.finaldx=O(t),E({x:e.ox+e.finaldx,width:e.owidth-e.finaldx}),$("onmove",[t,n])}function B(){var t=q.$bar;t.finaldx&&Y(),T(),$("onstop")}function $(n,e){var r=t.dependency_map;if(r[q.task.id]){var a=!0,o=!1,i=void 0;try{for(var d,s=r[q.task.id][Symbol.iterator]();!(a=(d=s.next()).done);a=!0){var c=d.value,l=t.get_bar(c);l[n].apply(l,e)}}catch(f){o=!0,i=f}finally{try{!a&&s["return"]&&s["return"]()}finally{if(o)throw i}}}}function M(t,n){var e=q.$bar;e.finaldx=O(t),E({width:e.owidth+e.finaldx})}function D(){var t=q.$bar;t.finaldx&&Y(),T()}function E(e){var r=e.x,a=void 0===r?null:r,o=e.width,i=void 0===o?null:o,d=q.$bar;if(a){var s=n.dependencies.map(function(n){return t.get_bar(n).$bar.getX()}),c=s.reduce(function(t,n){return a>=n},a);if(!c)return void(i=null);G(d,"x",a)}i&&i>=t.config.column_width&&G(d,"width",i),R(),I(),L(),z(),Q()}function S(){q.group.click(function(){q.action_completed||(q.group.hasClass("active")&&t.trigger_event("click",[q.task]),t.unselect_all(),q.group.toggleClass("active"))})}function Y(){var n=W(),e=n.new_start_date,r=n.new_end_date;q.task._start=e,q.task._end=r,h(),t.trigger_event("date_change",[q.task,e,r])}function j(){var n=X();q.task.progress=n,h(),t.trigger_event("progress_change",[q.task,n])}function T(){q.action_completed=!0,setTimeout(function(){return q.action_completed=!1},2e3)}function W(){var n=q.$bar,e=n.getX()/t.config.column_width,r=t.gantt_start.clone().add(e*t.config.step,"hours"),a=n.getWidth()/t.config.column_width,o=r.clone().add(a*t.config.step,"hours");return o.add("-1","seconds"),{new_start_date:r,new_end_date:o}}function X(){var t=q.$bar_progress.getWidth()/q.$bar.getWidth()*100;return parseInt(t,10)}function U(){var n=q.task._start.diff(t.gantt_start,"hours")/t.config.step*t.config.column_width;return t.view_is("Month")&&(n=q.task._start.diff(t.gantt_start,"days")*t.config.column_width/30),n}function H(){return t.config.header_height+t.config.padding+q.task._index*(q.height+t.config.padding)}function O(n){var e=n,r=void 0,a=void 0;return t.view_is("Week")?(r=n%(t.config.column_width/7),a=e-r+(r<t.config.column_width/14?0:t.config.column_width/7)):t.view_is("Month")?(r=n%(t.config.column_width/30),a=e-r+(r<t.config.column_width/60?0:t.config.column_width/30)):(r=n%t.config.column_width,a=e-r+(r<t.config.column_width/2?0:t.config.column_width)),a}function G(t,n,e){return e=+e,isNaN(e)||t.attr(n,e),t}function L(){q.$bar_progress.attr("x",q.$bar.getX()),q.$bar_progress.attr("width",q.$bar.getWidth()*(q.task.progress/100))}function R(){var t=q.$bar,n=q.group.select(".bar-label");n.getBBox().width>t.getWidth()?n.addClass("big").attr("x",t.getX()+t.getWidth()+5):n.removeClass("big").attr("x",t.getX()+t.getWidth()/2)}function I(){var t=q.$bar;q.handle_group.select(".handle.left").attr({x:t.getX()+1}),q.handle_group.select(".handle.right").attr({x:t.getEndX()-9});var n=q.group.select(".handle.progress");n&&n.attr("points",u())}function z(){var t=!0,n=!1,e=void 0;try{for(var r,a=q.arrows[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;o.update()}}catch(i){n=!0,e=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(n)throw e}}}function Q(){var t=v(),n=t.x,e=t.y;q.details_box&&q.details_box.transform("t"+n+","+e)}function N(t){var n={};return t&&"[object Function]"===n.toString.call(t)}var q={};return q.onstart=A,q.onmove=x,q.onstop=k,q.onmove_handle_left=C,q.onstop_handle_left=B,e(),q}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=e,t.exports=n["default"]},function(t,n){"use strict";function e(t,n,e){function r(){d.from_task=n,d.to_task=e,a(),o()}function a(){d.start_x=n.$bar.getX()+n.$bar.getWidth()/2;for(var r=function(){return e.$bar.getX()<d.start_x+t.config.padding&&d.start_x>n.$bar.getX()+t.config.padding};r();)d.start_x-=10;d.start_y=t.config.header_height+t.config.bar.height+(t.config.padding+t.config.bar.height)*n.task._index+t.config.padding,d.end_x=e.$bar.getX()-t.config.padding/2,d.end_y=t.config.header_height+t.config.bar.height/2+(t.config.padding+t.config.bar.height)*e.task._index+t.config.padding;var a=n.task._index>e.task._index;d.curve=t.config.arrow.curve,d.clockwise=a?1:0,d.curve_y=a?-d.curve:d.curve,d.offset=a?d.end_y+t.config.arrow.curve:d.end_y-t.config.arrow.curve,d.path=Snap.format("M {start_x} {start_y} V {offset} a {curve} {curve} 0 0 {clockwise} {curve} {curve_y} L {end_x} {end_y} m -5 -5 l 5 5 l -5 5",{start_x:d.start_x,start_y:d.start_y,end_x:d.end_x,end_y:d.end_y,offset:d.offset,curve:d.curve,clockwise:d.clockwise,curve_y:d.curve_y}),e.$bar.getX()<n.$bar.getX()+t.config.padding&&(d.path=Snap.format("M {start_x} {start_y} v {down_1} a {curve} {curve} 0 0 1 -{curve} {curve} H {left} a {curve} {curve} 0 0 {clockwise} -{curve} {curve_y} V {down_2} a {curve} {curve} 0 0 {clockwise} {curve} {curve_y} L {end_x} {end_y} m -5 -5 l 5 5 l -5 5",{start_x:d.start_x,start_y:d.start_y,end_x:d.end_x,end_y:d.end_y,down_1:t.config.padding/2-d.curve,down_2:e.$bar.getY()+e.$bar.getHeight()/2-d.curve_y,left:e.$bar.getX()-t.config.padding,offset:d.offset,curve:d.curve,clockwise:d.clockwise,curve_y:d.curve_y}))}function o(){d.element=t.canvas.path(d.path).attr("data-from",d.from_task.task.id).attr("data-to",d.to_task.task.id)}function i(){a(),d.element.attr("d",d.path)}var d={};return d.update=i,r(),d}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=e,t.exports=n["default"]}])}); | ||
//# sourceMappingURL=frappe-gantt.min.js.map |
{ | ||
"name": "frappe-gantt", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A simple, modern, interactive gantt library for the web", | ||
@@ -5,0 +5,0 @@ "main": "dist/frappe-gantt.js", |
@@ -426,2 +426,8 @@ /* global Snap */ | ||
const new_end_date = new_start_date.clone().add(width_in_units * gt.config.step, 'hours'); | ||
// lets say duration is 2 days | ||
// start_date = May 24 00:00:00 | ||
// end_date = May 24 + 2 days = May 26 (incorrect) | ||
// so subtract 1 second so that | ||
// end_date = May 25 23:59:59 | ||
new_end_date.add('-1', 'seconds'); | ||
return { new_start_date, new_end_date }; | ||
@@ -428,0 +434,0 @@ } |
@@ -479,3 +479,3 @@ /* global moment, Snap */ | ||
return arrow; // eslint-disable-line | ||
}); | ||
}).filter(arr => arr); // filter falsy values | ||
self._arrows = self._arrows.concat(arrows); | ||
@@ -482,0 +482,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
379772
2751