frappe-gantt
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1239,3 +1239,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var bar = self.$bar, | ||
bar_progress = self.$bar_progress, | ||
handle_width = 8; | ||
@@ -1247,6 +1246,11 @@ | ||
if (self.task.progress && self.task.progress < 100) { | ||
gt.canvas.polygon(bar_progress.getEndX() - 5, bar_progress.getY() + bar_progress.getHeight(), bar_progress.getEndX() + 5, bar_progress.getY() + bar_progress.getHeight(), bar_progress.getEndX(), bar_progress.getY() + bar_progress.getHeight() - 8.66).addClass('handle progress').appendTo(self.handle_group); | ||
gt.canvas.polygon(get_progress_polygon_points()).addClass('handle progress').appendTo(self.handle_group); | ||
} | ||
} | ||
function get_progress_polygon_points() { | ||
var bar_progress = self.$bar_progress; | ||
return [bar_progress.getEndX() - 5, bar_progress.getY() + bar_progress.getHeight(), bar_progress.getEndX() + 5, bar_progress.getY() + bar_progress.getHeight(), bar_progress.getEndX(), bar_progress.getY() + bar_progress.getHeight() - 8.66]; | ||
} | ||
function bind() { | ||
@@ -1362,3 +1366,3 @@ if (self.invalid) return; | ||
bar_progress.attr('width', bar_progress.owidth + dx); | ||
handle.transform('t{dx},0'); | ||
handle.attr('points', get_progress_polygon_points()); | ||
bar_progress.finaldx = dx; | ||
@@ -1587,2 +1591,3 @@ } | ||
}); | ||
self.group.select('.handle.progress').attr('points', get_progress_polygon_points()); | ||
} | ||
@@ -1589,0 +1594,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Gantt",[],e):"object"==typeof exports?exports.Gantt=e():t.Gantt=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e,n){function r(){a(),O.change_view_mode=o,O.unselect_all=X,O.view_is=U,O.get_bar=j,O.trigger_event=G,o(O.config.view_mode)}function a(){var r={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"};O.element=t,O._tasks=e,O.config=Object.assign({},r,n),O._bars=[],O._arrows=[],O.element_groups={}}function o(t){y(t),d(),g(),G("view_change",[t])}function d(){c(),l(),f(),u()}function c(){O.tasks=O._tasks.map(function(t,e){if(t._start=moment(t.start,O.config.date_format),t._end=moment(t.end,O.config.date_format),t._index=e,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 n=[];t.dependencies&&(n=t.dependencies.split(",").map(function(t){return t.trim()}).filter(function(t){return t})),t.dependencies=n}return t})}function l(){O.dependency_map={};var t=!0,e=!1,n=void 0;try{for(var r,a=O.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;O.dependency_map[f]=O.dependency_map[f]||[],O.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){e=!0,n=u}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}}function f(){var t=!0,e=!1,n=void 0;try{for(var r,a=O.tasks[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;(!O.gantt_start||o._start<O.gantt_start)&&(O.gantt_start=o._start),(!O.gantt_end||o._end>O.gantt_end)&&(O.gantt_end=o._end)}}catch(i){e=!0,n=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}p(),_()}function u(){O.canvas=Snap(O.element).addClass("gantt")}function g(){h(),v(),A(),M(),T(),S(),W(),m(),w(),Y()}function h(){O.canvas.clear(),O._bars=[],O._arrows=[]}function p(){U(["Quarter Day","Half Day"])?(O.gantt_start=O.gantt_start.clone().subtract(7,"day"),O.gantt_end=O.gantt_end.clone().add(7,"day")):U("Month")?(O.gantt_start=O.gantt_start.clone().startOf("year"),O.gantt_end=O.gantt_end.clone().endOf("month").add(1,"year")):(O.gantt_start=O.gantt_start.clone().startOf("month").subtract(1,"month"),O.gantt_end=O.gantt_end.clone().endOf("month").add(1,"month"))}function _(){O.dates=[];for(var t=null;null===t||t<O.gantt_end;)t=t?U("Month")?t.clone().add(1,"month"):t.clone().add(O.config.step,"hours"):O.gantt_start.clone(),O.dates.push(t)}function v(){var t=["grid","date","arrow","progress","bar","details"],e=!0,n=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(e=(a=o.next()).done);e=!0){var i=a.value;O.element_groups[i]=O.canvas.group().attr({id:i})}}catch(d){n=!0,r=d}finally{try{!e&&o["return"]&&o["return"]()}finally{if(n)throw r}}}function y(t){O.config.view_mode=t,"Day"===t?(O.config.step=24,O.config.column_width=38):"Half Day"===t?(O.config.step=12,O.config.column_width=38):"Quarter Day"===t?(O.config.step=6,O.config.column_width=38):"Week"===t?(O.config.step=168,O.config.column_width=140):"Month"===t&&(O.config.step=720,O.config.column_width=120)}function m(){var t=O.canvas.node.getBoundingClientRect().width,e=O.canvas.getBBox().width;t<e&&O.canvas.attr("width",e)}function w(){var t=document.querySelector(O.element).parentElement;if(t){var e=b().diff(O.gantt_start,"hours")/O.config.step*O.config.column_width;t.scrollLeft=e}}function b(){var t=O.tasks.reduce(function(t,e){return e._start.isSameOrBefore(t._start)?e:t});return t._start}function A(){x(),C(),k(),B(),$()}function x(){var t=O.dates.length*O.config.column_width,e=O.config.header_height+O.config.padding+(O.config.bar.height+O.config.padding)*O.tasks.length;O.canvas.rect(0,0,t,e).addClass("grid-background").appendTo(O.element_groups.grid),O.canvas.attr({height:e+O.config.padding,width:"100%"})}function k(){var t=O.dates.length*O.config.column_width,e=O.config.header_height+10;O.canvas.rect(0,0,t,e).addClass("grid-header").appendTo(O.element_groups.grid)}function C(){var t=O.canvas.group().appendTo(O.element_groups.grid),e=O.canvas.group().appendTo(O.element_groups.grid),n=O.dates.length*O.config.column_width,r=O.config.bar.height+O.config.padding,a=O.config.header_height+O.config.padding/2,o=!0,i=!1,d=void 0;try{for(var s,c=O.tasks[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){s.value;O.canvas.rect(0,a,n,r).addClass("grid-row").appendTo(t),O.canvas.line(0,a+r,n,a+r).addClass("row-line").appendTo(e),a+=O.config.bar.height+O.config.padding}}catch(l){i=!0,d=l}finally{try{!o&&c["return"]&&c["return"]()}finally{if(i)throw d}}}function B(){var t=0,e=O.config.header_height+O.config.padding/2,n=(O.config.bar.height+O.config.padding)*O.tasks.length,r=!0,a=!1,o=void 0;try{for(var i,d=O.dates[Symbol.iterator]();!(r=(i=d.next()).done);r=!0){var s=i.value,c="tick";U("Day")&&1===s.day()&&(c+=" thick"),U("Week")&&s.date()>=1&&s.date()<8&&(c+=" thick"),U("Month")&&s.month()%3===0&&(c+=" thick"),O.canvas.path(Snap.format("M {x} {y} v {height}",{x:t,y:e,height:n})).addClass(c).appendTo(O.element_groups.grid),t+=U("Month")?s.daysInMonth()*O.config.column_width/30:O.config.column_width}}catch(l){a=!0,o=l}finally{try{!r&&d["return"]&&d["return"]()}finally{if(a)throw o}}}function $(){if(U("Day")){var t=moment().startOf("day").diff(O.gantt_start,"hours")/O.config.step*O.config.column_width,e=0,n=O.config.column_width,r=(O.config.bar.height+O.config.padding)*O.tasks.length+O.config.header_height+O.config.padding/2;O.canvas.rect(t,e,n,r).addClass("today-highlight").appendTo(O.element_groups.grid)}}function M(){var t=!0,e=!1,n=void 0;try{for(var r,a=E()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;if(O.canvas.text(o.lower_x,o.lower_y,o.lower_text).addClass("lower-text").appendTo(O.element_groups.date),o.upper_text){var i=O.canvas.text(o.upper_x,o.upper_y,o.upper_text).addClass("upper-text").appendTo(O.element_groups.date);i.getBBox().x2>O.element_groups.grid.getBBox().width&&i.remove()}}}catch(d){e=!0,n=d}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}}function E(){var t=null,e=O.dates.map(function(e,n){var r=D(e,t,n);return t=e,r});return e}function D(t,e,n){e||(e=t.clone().add(1,"year"));var r={"Quarter Day_lower":t.format("HH"),"Half Day_lower":t.format("HH"),Day_lower:t.date()!==e.date()?t.format("D"):"",Week_lower:"Week "+t.format("W"),Month_lower:t.format("MMMM"),"Quarter Day_upper":t.date()!==e.date()?t.format("D MMM"):"","Half Day_upper":t.date()!==e.date()?t.format("D MMM"):"",Day_upper:t.month()!==e.month()?t.format("MMMM"):"",Week_upper:t.month()!==e.month()?t.format("MMMM"):"",Month_upper:t.year()!==e.year()?t.format("YYYY"):""},a={x:n*O.config.column_width,lower_y:O.config.header_height,upper_y:O.config.header_height-25},o={"Quarter Day_lower":4*O.config.column_width/2,"Quarter Day_upper":0,"Half Day_lower":2*O.config.column_width/2,"Half Day_upper":0,Day_lower:O.config.column_width/2,Day_upper:30*O.config.column_width/2,Week_lower:O.config.column_width/2,Week_upper:4*O.config.column_width/2,Month_lower:t.daysInMonth()*O.config.column_width/30/2,Month_upper:12*O.config.column_width/2};return{upper_text:r[O.config.view_mode+"_upper"],lower_text:r[O.config.view_mode+"_lower"],upper_x:a.x+o[O.config.view_mode+"_upper"],upper_y:a.upper_y,lower_x:a.x+o[O.config.view_mode+"_lower"],lower_y:a.lower_y}}function S(){O._arrows=[];var t=!0,e=!1,n=void 0;try{for(var r,a=function(){var t=r.value,e=[];e=t.dependencies.map(function(e){var n=H(e);if(n){var r=(0,s["default"])(O,O._bars[n._index],O._bars[t._index]);return O.element_groups.arrow.add(r.element),r}}),O._arrows=O._arrows.concat(e)},o=O.tasks[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){e=!0,n=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(e)throw n}}}function T(){O._bars=O.tasks.map(function(t){var e=(0,i["default"])(O,t);return O.element_groups.bar.add(e.group),e})}function W(){var t=!0,e=!1,n=void 0;try{for(var r,a=function(){var t=r.value;t.arrows=O._arrows.filter(function(e){return e.from_task.task.id===t.task.id||e.to_task.task.id===t.task.id})},o=O._bars[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){e=!0,n=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(e)throw n}}}function Y(){O.element_groups.grid.click(function(){X(),O.element_groups.details.addClass("hide")})}function X(){O.canvas.selectAll(".bar-wrapper").forEach(function(t){t.removeClass("active")})}function U(t){if("string"==typeof t)return O.config.view_mode===t;if(Array.isArray(t)){var e=!0,n=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(e=(a=o.next()).done);e=!0){var i=a.value;if(O.config.view_mode===i)return!0}}catch(d){n=!0,r=d}finally{try{!e&&o["return"]&&o["return"]()}finally{if(n)throw r}}return!1}}function H(t){return O.tasks.find(function(e){return e.id===t})}function j(t){return O._bars.find(function(e){return e.task.id===t})}function G(t,e){O.config["on_"+t]&&O.config["on_"+t].apply(null,e)}var O={};return r(),O}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=a,n(1);var o=n(5),i=r(o),d=n(6),s=r(d);t.exports=e["default"]},function(t,e,n){var r=n(2);"string"==typeof r&&(r=[[t.id,r,""]]);n(4)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){e=t.exports=n(3)(),e.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(even){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 .primary-text,.gantt .secondary-text{font-size:12px;text-anchor:middle}.gantt .primary-text{fill:#555}.gantt .secondary-text{fill:#333}.gantt #details{font-size:14}.gantt #details .details-container{stroke:#e0e0e0;stroke-width:1.1;fill:#fff}.gantt #details .details-heading{fill:#333;font-weight:500}.gantt #details .details-body{fill:#555}.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,iCAcE,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,4CAoGE,eACA,kBAAmB,CArGrB,qBAwGE,SA7Ge,CAKjB,uBA2GE,SA/Ge,CAIjB,gBA+GE,YAAa,CA/Gf,mCAkHG,eACA,iBACA,SAAU,CApHb,iCAuHG,UACA,eAAgB,CAxHnB,8BA2HG,SAhIc,CAKjB,aAgIE,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.primary-text, .secondary-text {\n\t\tfont-size: 12px;\n\t\ttext-anchor: middle;\n\t}\n\t.primary-text {\n\t\tfill: $text-light;\n\t}\n\t.secondary-text {\n\t\tfill: $text-color;\n\t}\n\n\t#details {\n\t\tfont-size: 14;\n\n\t\t.details-container {\n\t\t\tstroke: $border-color;\n\t\t\tstroke-width: 1.1;\n\t\t\tfill: #fff;\n\t\t}\n\t\t.details-heading {\n\t\t\tfill: $text-color;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.details-body {\n\t\t\tfill: $text-light;\n\t\t}\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n}"],sourceRoot:"webpack://"}])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},a=0;a<this.length;a++){var o=this[a][0];"number"==typeof o&&(r[o]=!0)}for(a=0;a<e.length;a++){var i=e[a];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(t,e,n){function r(t,e){for(var n=0;n<t.length;n++){var r=t[n],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],e))}else{for(var i=[],o=0;o<r.parts.length;o++)i.push(c(r.parts[o],e));g[r.id]={id:r.id,refs:1,parts:i}}}}function a(t){for(var e=[],n={},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};n[o]?n[o].parts.push(c):e.push(n[o]={id:o,parts:[c]})}return e}function o(t,e){var n=_(),r=m[m.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),m.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function i(t){t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function d(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function s(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function c(t,e){var n,r,a;if(e.singleton){var o=y++;n=v||(v=d(e)),r=l.bind(null,n,o,!1),a=l.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(e),r=u.bind(null,n),a=function(){i(n),n.href&&URL.revokeObjectURL(n.href)}):(n=d(e),r=f.bind(null,n),a=function(){i(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else a()}}function l(t,e,n,r){var a=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(e,a);else{var o=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(o,i[e]):t.appendChild(o)}}function f(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function u(t,e){var n=e.css,r=e.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([n],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(a),o&&URL.revokeObjectURL(o)}var g={},h=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},p=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),_=h(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,y=0,m=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=p()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=a(t);return r(n,e),function(t){for(var o=[],i=0;i<n.length;i++){var d=n[i],s=g[d.id];s.refs--,o.push(s)}if(t){var c=a(t);r(c,e)}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(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){"use strict";function n(t,e){function n(){r(),a(),d(),u()}function r(){I.action_completed=!1,I.task=e}function a(){o(),i()}function o(){I.invalid=I.task.invalid,I.height=t.config.bar.height,I.x=X(),I.y=U(),I.corner_radius=3,I.duration=(I.task._end.diff(I.task._start,"hours")+24)/t.config.step,I.width=t.config.column_width*I.duration,I.progress_width=t.config.column_width*I.duration*(I.task.progress/100)||0,I.group=t.canvas.group().addClass("bar-wrapper"),I.bar_group=t.canvas.group().addClass("bar-group").appendTo(I.group),I.handle_group=t.canvas.group().addClass("handle-group").appendTo(I.group)}function i(){Snap.plugin(function(t,e,n,r,a){e.prototype.getX=function(){return+this.attr("x")},e.prototype.getY=function(){return+this.attr("y")},e.prototype.getWidth=function(){return+this.attr("width")},e.prototype.getHeight=function(){return+this.attr("height")},e.prototype.getEndX=function(){return this.getX()+this.getWidth()}})}function d(){s(),c(),l(),f()}function s(){I.$bar=t.canvas.rect(I.x,I.y,I.width,I.height,I.corner_radius,I.corner_radius).addClass("bar").appendTo(I.bar_group),I.invalid&&I.$bar.addClass("bar-invalid")}function c(){I.invalid||(I.$bar_progress=t.canvas.rect(I.x,I.y,I.progress_width,I.height,I.corner_radius,I.corner_radius).addClass("bar-progress").appendTo(I.bar_group))}function l(){t.canvas.text(I.x+I.width/2,I.y+I.height/2,I.task.name).addClass("bar-label").appendTo(I.bar_group),O()}function f(){if(!I.invalid){var e=I.$bar,n=I.$bar_progress,r=8;t.canvas.rect(e.getX()+e.getWidth()-9,e.getY()+1,r,I.height-2,I.corner_radius,I.corner_radius).addClass("handle right").appendTo(I.handle_group),t.canvas.rect(e.getX()+1,e.getY()+1,r,I.height-2,I.corner_radius,I.corner_radius).addClass("handle left").appendTo(I.handle_group),I.task.progress&&I.task.progress<100&&t.canvas.polygon(n.getEndX()-5,n.getY()+n.getHeight(),n.getEndX()+5,n.getY()+n.getHeight(),n.getEndX(),n.getY()+n.getHeight()-8.66).addClass("handle progress").appendTo(I.handle_group)}}function u(){I.invalid||(M(),g(),p(),v(),y())}function g(){var e=t.element_groups.details,n=e.select(".details-wrapper");if(!n){n=t.canvas.group().addClass("details-wrapper").appendTo(e),t.canvas.rect(0,0,0,110,2,2).addClass("details-container").appendTo(n),t.canvas.text(0,0,"").attr({dx:10,dy:30}).addClass("details-heading").appendTo(n),t.canvas.text(0,0,"").attr({dx:10,dy:65}).addClass("details-body").appendTo(n),t.canvas.text(0,0,"").attr({dx:10,dy:90}).addClass("details-body").appendTo(n);var r=t.canvas.filter(Snap.filter.shadow(0,1,1,"#666",.6));n.attr({filter:r})}I.group.click(function(t){if(!I.action_completed){e.removeClass("hide");var r=h();n.transform("t"+r.x+","+r.y);var a=I.task._start.format("MMM D"),o=I.task._end.format("MMM D"),i=I.task.name+": "+a+" - "+o,d=e.select(".details-heading").attr("text",i),s=d.getBBox();n.select(".details-container").attr({width:s.width+20});var c=I.task._end.diff(I.task._start,"days"),l="Duration: "+c+" days",f=I.task.progress?"Progress: "+I.task.progress:"",u=e.selectAll(".details-body");u[0].attr("text",l),u[1].attr("text",f)}})}function h(){return{x:I.$bar.getEndX()+2,y:I.$bar.getY()-10}}function p(){function t(t,e){C(t,e)}function e(){B()}function n(t,e){A(t,e)}function r(){x()}var a=_(),o=a.left,i=a.right;o.drag(n,m,r),i.drag(t,m,e)}function _(){return{left:I.handle_group.select(".handle.left"),right:I.handle_group.select(".handle.right")}}function v(){I.bar_group.drag(w,m,b)}function y(){function t(t,e){t>a.max_dx&&(t=a.max_dx),t<a.min_dx&&(t=a.min_dx),a.attr("width",a.owidth+t),o.transform("t{dx},0"),a.finaldx=t}function e(){a.finaldx&&(D(),S())}function n(){a.finaldx=0,a.owidth=a.getWidth(),a.min_dx=-a.getWidth(),a.max_dx=r.getWidth()-a.getWidth()}var r=I.$bar,a=I.$bar_progress,o=I.group.select(".handle.progress");o&&o.drag(t,n,e)}function m(){var t=I.$bar;t.ox=t.getX(),t.oy=t.getY(),t.owidth=t.getWidth(),t.finaldx=0,k("onstart")}function w(t,e){var n=I.$bar;n.finaldx=H(t),$(n.ox+n.finaldx),k("onmove",[t,e])}function b(){var t=I.$bar;t.finaldx&&(E(),S(),k("onstop"))}function A(t,e){var n=I.$bar;n.finaldx=H(t),$(n.ox+n.finaldx,n.owidth-n.finaldx),k("onmove",[t,e])}function x(){var t=I.$bar;t.finaldx&&E(),S(),k("onstop")}function k(e,n){var r=t.dependency_map;if(r[I.task.id]){var a=!0,o=!1,i=void 0;try{for(var d,s=r[I.task.id][Symbol.iterator]();!(a=(d=s.next()).done);a=!0){var c=d.value,l=t.get_bar(c);l[e].apply(l,n)}}catch(f){o=!0,i=f}finally{try{!a&&s["return"]&&s["return"]()}finally{if(o)throw i}}}}function C(t,e){var n=I.$bar;n.finaldx=H(t),$(null,n.owidth+n.finaldx)}function B(){var t=I.$bar;t.finaldx&&E(),S()}function $(t,e){var n=I.$bar;t&&j(n,"x",t),e&&j(n,"width",e),O(),L(),G(),R(),z()}function M(){I.group.click(function(){I.action_completed||(I.group.hasClass("active")&&t.trigger_event("click",[I.task]),t.unselect_all(),I.group.toggleClass("active"))})}function E(){t.trigger_event("date_change",[I.task,T(),W()])}function D(){t.trigger_event("progress_change",[I.task,Y()])}function S(){I.action_completed=!0,setTimeout(function(){return I.action_completed=!1},2e3)}function T(){var e=I.$bar,n=(e.getX()-X())/t.config.column_width,r=I.task._start.clone().add(t.config.step*n,"hours");return r}function W(){var e=I.$bar,n=X()+I.duration*t.config.column_width,r=e.getEndX(),a=(r-n)/t.config.column_width,o=I.task._end.clone().add(t.config.step*a,"hours");return o}function Y(){return I.$bar_progress.getWidth()/I.$bar.getWidth()*100}function X(){var e=I.task._start.diff(t.gantt_start,"hours")/t.config.step*t.config.column_width;return t.view_is("Month")&&(e=I.task._start.diff(t.gantt_start,"days")*t.config.column_width/30),e}function U(){return t.config.header_height+t.config.padding+I.task._index*(I.height+t.config.padding)}function H(e){var n=e,r=void 0,a=void 0;return t.view_is("Week")?(r=e%(t.config.column_width/7),a=n-r+(r<t.config.column_width/14?0:t.config.column_width/7)):t.view_is("Month")?(r=e%(t.config.column_width/30),a=n-r+(r<t.config.column_width/60?0:t.config.column_width/30)):(r=e%t.config.column_width,a=n-r+(r<t.config.column_width/2?0:t.config.column_width)),a}function j(t,e,n){return n=+n,isNaN(n)||t.attr(e,n),t}function G(){I.$bar_progress.attr("x",I.$bar.getX()),I.$bar_progress.attr("width",I.$bar.getWidth()*(I.task.progress/100))}function O(){var t=I.$bar,e=I.group.select(".bar-label");e.getBBox().width>t.getWidth()?e.addClass("big").attr("x",t.getX()+t.getWidth()+5):e.removeClass("big").attr("x",t.getX()+t.getWidth()/2)}function L(){var t=I.$bar;I.handle_group.select(".handle.left").attr({x:t.getX()+1}),I.handle_group.select(".handle.right").attr({x:t.getEndX()-9})}function R(){var t=!0,e=!1,n=void 0;try{for(var r,a=I.arrows[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;o.update()}}catch(i){e=!0,n=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}}function z(){var e=t.element_groups.details.select(".details-wrapper"),n=h();e&&e.transform("t"+n.x+","+n.y)}var I={};return I.onstart=m,I.onmove=w,I.onstop=b,I.onmove_handle_left=A,I.onstop_handle_left=x,n(),I}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e){"use strict";function n(t,e,n){function r(){d.from_task=e,d.to_task=n,a(),o()}function a(){d.start_x=e.$bar.getX()+e.$bar.getWidth()/2;for(var r=function(){return n.$bar.getX()<d.start_x+t.config.padding&&d.start_x>e.$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)*e.task._index+t.config.padding,d.end_x=n.$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)*n.task._index+t.config.padding;var a=e.task._index>n.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}),n.$bar.getX()<e.$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:n.$bar.getY()+n.$bar.getHeight()/2-d.curve_y,left:n.$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(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Gantt",[],e):"object"==typeof exports?exports.Gantt=e():t.Gantt=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e,n){function r(){a(),O.change_view_mode=o,O.unselect_all=X,O.view_is=U,O.get_bar=j,O.trigger_event=G,o(O.config.view_mode)}function a(){var r={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"};O.element=t,O._tasks=e,O.config=Object.assign({},r,n),O._bars=[],O._arrows=[],O.element_groups={}}function o(t){y(t),d(),g(),G("view_change",[t])}function d(){c(),l(),f(),u()}function c(){O.tasks=O._tasks.map(function(t,e){if(t._start=moment(t.start,O.config.date_format),t._end=moment(t.end,O.config.date_format),t._index=e,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 n=[];t.dependencies&&(n=t.dependencies.split(",").map(function(t){return t.trim()}).filter(function(t){return t})),t.dependencies=n}return t})}function l(){O.dependency_map={};var t=!0,e=!1,n=void 0;try{for(var r,a=O.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;O.dependency_map[f]=O.dependency_map[f]||[],O.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){e=!0,n=u}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}}function f(){var t=!0,e=!1,n=void 0;try{for(var r,a=O.tasks[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;(!O.gantt_start||o._start<O.gantt_start)&&(O.gantt_start=o._start),(!O.gantt_end||o._end>O.gantt_end)&&(O.gantt_end=o._end)}}catch(i){e=!0,n=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}h(),_()}function u(){O.canvas=Snap(O.element).addClass("gantt")}function g(){p(),v(),A(),M(),T(),S(),W(),m(),w(),Y()}function p(){O.canvas.clear(),O._bars=[],O._arrows=[]}function h(){U(["Quarter Day","Half Day"])?(O.gantt_start=O.gantt_start.clone().subtract(7,"day"),O.gantt_end=O.gantt_end.clone().add(7,"day")):U("Month")?(O.gantt_start=O.gantt_start.clone().startOf("year"),O.gantt_end=O.gantt_end.clone().endOf("month").add(1,"year")):(O.gantt_start=O.gantt_start.clone().startOf("month").subtract(1,"month"),O.gantt_end=O.gantt_end.clone().endOf("month").add(1,"month"))}function _(){O.dates=[];for(var t=null;null===t||t<O.gantt_end;)t=t?U("Month")?t.clone().add(1,"month"):t.clone().add(O.config.step,"hours"):O.gantt_start.clone(),O.dates.push(t)}function v(){var t=["grid","date","arrow","progress","bar","details"],e=!0,n=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(e=(a=o.next()).done);e=!0){var i=a.value;O.element_groups[i]=O.canvas.group().attr({id:i})}}catch(d){n=!0,r=d}finally{try{!e&&o["return"]&&o["return"]()}finally{if(n)throw r}}}function y(t){O.config.view_mode=t,"Day"===t?(O.config.step=24,O.config.column_width=38):"Half Day"===t?(O.config.step=12,O.config.column_width=38):"Quarter Day"===t?(O.config.step=6,O.config.column_width=38):"Week"===t?(O.config.step=168,O.config.column_width=140):"Month"===t&&(O.config.step=720,O.config.column_width=120)}function m(){var t=O.canvas.node.getBoundingClientRect().width,e=O.canvas.getBBox().width;t<e&&O.canvas.attr("width",e)}function w(){var t=document.querySelector(O.element).parentElement;if(t){var e=b().diff(O.gantt_start,"hours")/O.config.step*O.config.column_width;t.scrollLeft=e}}function b(){var t=O.tasks.reduce(function(t,e){return e._start.isSameOrBefore(t._start)?e:t});return t._start}function A(){x(),C(),k(),B(),$()}function x(){var t=O.dates.length*O.config.column_width,e=O.config.header_height+O.config.padding+(O.config.bar.height+O.config.padding)*O.tasks.length;O.canvas.rect(0,0,t,e).addClass("grid-background").appendTo(O.element_groups.grid),O.canvas.attr({height:e+O.config.padding,width:"100%"})}function k(){var t=O.dates.length*O.config.column_width,e=O.config.header_height+10;O.canvas.rect(0,0,t,e).addClass("grid-header").appendTo(O.element_groups.grid)}function C(){var t=O.canvas.group().appendTo(O.element_groups.grid),e=O.canvas.group().appendTo(O.element_groups.grid),n=O.dates.length*O.config.column_width,r=O.config.bar.height+O.config.padding,a=O.config.header_height+O.config.padding/2,o=!0,i=!1,d=void 0;try{for(var s,c=O.tasks[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){s.value;O.canvas.rect(0,a,n,r).addClass("grid-row").appendTo(t),O.canvas.line(0,a+r,n,a+r).addClass("row-line").appendTo(e),a+=O.config.bar.height+O.config.padding}}catch(l){i=!0,d=l}finally{try{!o&&c["return"]&&c["return"]()}finally{if(i)throw d}}}function B(){var t=0,e=O.config.header_height+O.config.padding/2,n=(O.config.bar.height+O.config.padding)*O.tasks.length,r=!0,a=!1,o=void 0;try{for(var i,d=O.dates[Symbol.iterator]();!(r=(i=d.next()).done);r=!0){var s=i.value,c="tick";U("Day")&&1===s.day()&&(c+=" thick"),U("Week")&&s.date()>=1&&s.date()<8&&(c+=" thick"),U("Month")&&s.month()%3===0&&(c+=" thick"),O.canvas.path(Snap.format("M {x} {y} v {height}",{x:t,y:e,height:n})).addClass(c).appendTo(O.element_groups.grid),t+=U("Month")?s.daysInMonth()*O.config.column_width/30:O.config.column_width}}catch(l){a=!0,o=l}finally{try{!r&&d["return"]&&d["return"]()}finally{if(a)throw o}}}function $(){if(U("Day")){var t=moment().startOf("day").diff(O.gantt_start,"hours")/O.config.step*O.config.column_width,e=0,n=O.config.column_width,r=(O.config.bar.height+O.config.padding)*O.tasks.length+O.config.header_height+O.config.padding/2;O.canvas.rect(t,e,n,r).addClass("today-highlight").appendTo(O.element_groups.grid)}}function M(){var t=!0,e=!1,n=void 0;try{for(var r,a=E()[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;if(O.canvas.text(o.lower_x,o.lower_y,o.lower_text).addClass("lower-text").appendTo(O.element_groups.date),o.upper_text){var i=O.canvas.text(o.upper_x,o.upper_y,o.upper_text).addClass("upper-text").appendTo(O.element_groups.date);i.getBBox().x2>O.element_groups.grid.getBBox().width&&i.remove()}}}catch(d){e=!0,n=d}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}}function E(){var t=null,e=O.dates.map(function(e,n){var r=D(e,t,n);return t=e,r});return e}function D(t,e,n){e||(e=t.clone().add(1,"year"));var r={"Quarter Day_lower":t.format("HH"),"Half Day_lower":t.format("HH"),Day_lower:t.date()!==e.date()?t.format("D"):"",Week_lower:"Week "+t.format("W"),Month_lower:t.format("MMMM"),"Quarter Day_upper":t.date()!==e.date()?t.format("D MMM"):"","Half Day_upper":t.date()!==e.date()?t.format("D MMM"):"",Day_upper:t.month()!==e.month()?t.format("MMMM"):"",Week_upper:t.month()!==e.month()?t.format("MMMM"):"",Month_upper:t.year()!==e.year()?t.format("YYYY"):""},a={x:n*O.config.column_width,lower_y:O.config.header_height,upper_y:O.config.header_height-25},o={"Quarter Day_lower":4*O.config.column_width/2,"Quarter Day_upper":0,"Half Day_lower":2*O.config.column_width/2,"Half Day_upper":0,Day_lower:O.config.column_width/2,Day_upper:30*O.config.column_width/2,Week_lower:O.config.column_width/2,Week_upper:4*O.config.column_width/2,Month_lower:t.daysInMonth()*O.config.column_width/30/2,Month_upper:12*O.config.column_width/2};return{upper_text:r[O.config.view_mode+"_upper"],lower_text:r[O.config.view_mode+"_lower"],upper_x:a.x+o[O.config.view_mode+"_upper"],upper_y:a.upper_y,lower_x:a.x+o[O.config.view_mode+"_lower"],lower_y:a.lower_y}}function S(){O._arrows=[];var t=!0,e=!1,n=void 0;try{for(var r,a=function(){var t=r.value,e=[];e=t.dependencies.map(function(e){var n=H(e);if(n){var r=(0,s["default"])(O,O._bars[n._index],O._bars[t._index]);return O.element_groups.arrow.add(r.element),r}}),O._arrows=O._arrows.concat(e)},o=O.tasks[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){e=!0,n=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(e)throw n}}}function T(){O._bars=O.tasks.map(function(t){var e=(0,i["default"])(O,t);return O.element_groups.bar.add(e.group),e})}function W(){var t=!0,e=!1,n=void 0;try{for(var r,a=function(){var t=r.value;t.arrows=O._arrows.filter(function(e){return e.from_task.task.id===t.task.id||e.to_task.task.id===t.task.id})},o=O._bars[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)a()}catch(i){e=!0,n=i}finally{try{!t&&o["return"]&&o["return"]()}finally{if(e)throw n}}}function Y(){O.element_groups.grid.click(function(){X(),O.element_groups.details.addClass("hide")})}function X(){O.canvas.selectAll(".bar-wrapper").forEach(function(t){t.removeClass("active")})}function U(t){if("string"==typeof t)return O.config.view_mode===t;if(Array.isArray(t)){var e=!0,n=!1,r=void 0;try{for(var a,o=t[Symbol.iterator]();!(e=(a=o.next()).done);e=!0){var i=a.value;if(O.config.view_mode===i)return!0}}catch(d){n=!0,r=d}finally{try{!e&&o["return"]&&o["return"]()}finally{if(n)throw r}}return!1}}function H(t){return O.tasks.find(function(e){return e.id===t})}function j(t){return O._bars.find(function(e){return e.task.id===t})}function G(t,e){O.config["on_"+t]&&O.config["on_"+t].apply(null,e)}var O={};return r(),O}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=a,n(1);var o=n(5),i=r(o),d=n(6),s=r(d);t.exports=e["default"]},function(t,e,n){var r=n(2);"string"==typeof r&&(r=[[t.id,r,""]]);n(4)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){e=t.exports=n(3)(),e.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(even){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 .primary-text,.gantt .secondary-text{font-size:12px;text-anchor:middle}.gantt .primary-text{fill:#555}.gantt .secondary-text{fill:#333}.gantt #details{font-size:14}.gantt #details .details-container{stroke:#e0e0e0;stroke-width:1.1;fill:#fff}.gantt #details .details-heading{fill:#333;font-weight:500}.gantt #details .details-body{fill:#555}.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,iCAcE,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,4CAoGE,eACA,kBAAmB,CArGrB,qBAwGE,SA7Ge,CAKjB,uBA2GE,SA/Ge,CAIjB,gBA+GE,YAAa,CA/Gf,mCAkHG,eACA,iBACA,SAAU,CApHb,iCAuHG,UACA,eAAgB,CAxHnB,8BA2HG,SAhIc,CAKjB,aAgIE,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.primary-text, .secondary-text {\n\t\tfont-size: 12px;\n\t\ttext-anchor: middle;\n\t}\n\t.primary-text {\n\t\tfill: $text-light;\n\t}\n\t.secondary-text {\n\t\tfill: $text-color;\n\t}\n\n\t#details {\n\t\tfont-size: 14;\n\n\t\t.details-container {\n\t\t\tstroke: $border-color;\n\t\t\tstroke-width: 1.1;\n\t\t\tfill: #fff;\n\t\t}\n\t\t.details-heading {\n\t\t\tfill: $text-color;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.details-body {\n\t\t\tfill: $text-light;\n\t\t}\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n}"],sourceRoot:"webpack://"}])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},a=0;a<this.length;a++){var o=this[a][0];"number"==typeof o&&(r[o]=!0)}for(a=0;a<e.length;a++){var i=e[a];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(t,e,n){function r(t,e){for(var n=0;n<t.length;n++){var r=t[n],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],e))}else{for(var i=[],o=0;o<r.parts.length;o++)i.push(c(r.parts[o],e));g[r.id]={id:r.id,refs:1,parts:i}}}}function a(t){for(var e=[],n={},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};n[o]?n[o].parts.push(c):e.push(n[o]={id:o,parts:[c]})}return e}function o(t,e){var n=_(),r=m[m.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),m.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function i(t){t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function d(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function s(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function c(t,e){var n,r,a;if(e.singleton){var o=y++;n=v||(v=d(e)),r=l.bind(null,n,o,!1),a=l.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(e),r=u.bind(null,n),a=function(){i(n),n.href&&URL.revokeObjectURL(n.href)}):(n=d(e),r=f.bind(null,n),a=function(){i(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else a()}}function l(t,e,n,r){var a=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=w(e,a);else{var o=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(o,i[e]):t.appendChild(o)}}function f(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function u(t,e){var n=e.css,r=e.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([n],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(a),o&&URL.revokeObjectURL(o)}var g={},p=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},h=p(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),_=p(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,y=0,m=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=h()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=a(t);return r(n,e),function(t){for(var o=[],i=0;i<n.length;i++){var d=n[i],s=g[d.id];s.refs--,o.push(s)}if(t){var c=a(t);r(c,e)}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(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){"use strict";function n(t,e){function n(){r(),a(),d(),g()}function r(){N.action_completed=!1,N.task=e}function a(){o(),i()}function o(){N.invalid=N.task.invalid,N.height=t.config.bar.height,N.x=U(),N.y=H(),N.corner_radius=3,N.duration=(N.task._end.diff(N.task._start,"hours")+24)/t.config.step,N.width=t.config.column_width*N.duration,N.progress_width=t.config.column_width*N.duration*(N.task.progress/100)||0,N.group=t.canvas.group().addClass("bar-wrapper"),N.bar_group=t.canvas.group().addClass("bar-group").appendTo(N.group),N.handle_group=t.canvas.group().addClass("handle-group").appendTo(N.group)}function i(){Snap.plugin(function(t,e,n,r,a){e.prototype.getX=function(){return+this.attr("x")},e.prototype.getY=function(){return+this.attr("y")},e.prototype.getWidth=function(){return+this.attr("width")},e.prototype.getHeight=function(){return+this.attr("height")},e.prototype.getEndX=function(){return this.getX()+this.getWidth()}})}function d(){s(),c(),l(),f()}function s(){N.$bar=t.canvas.rect(N.x,N.y,N.width,N.height,N.corner_radius,N.corner_radius).addClass("bar").appendTo(N.bar_group),N.invalid&&N.$bar.addClass("bar-invalid")}function c(){N.invalid||(N.$bar_progress=t.canvas.rect(N.x,N.y,N.progress_width,N.height,N.corner_radius,N.corner_radius).addClass("bar-progress").appendTo(N.bar_group))}function l(){t.canvas.text(N.x+N.width/2,N.y+N.height/2,N.task.name).addClass("bar-label").appendTo(N.bar_group),L()}function f(){if(!N.invalid){var e=N.$bar,n=8;t.canvas.rect(e.getX()+e.getWidth()-9,e.getY()+1,n,N.height-2,N.corner_radius,N.corner_radius).addClass("handle right").appendTo(N.handle_group),t.canvas.rect(e.getX()+1,e.getY()+1,n,N.height-2,N.corner_radius,N.corner_radius).addClass("handle left").appendTo(N.handle_group),N.task.progress&&N.task.progress<100&&t.canvas.polygon(u()).addClass("handle progress").appendTo(N.handle_group)}}function u(){var t=N.$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(){N.invalid||(E(),p(),_(),y(),m())}function p(){var e=t.element_groups.details,n=e.select(".details-wrapper");if(!n){n=t.canvas.group().addClass("details-wrapper").appendTo(e),t.canvas.rect(0,0,0,110,2,2).addClass("details-container").appendTo(n),t.canvas.text(0,0,"").attr({dx:10,dy:30}).addClass("details-heading").appendTo(n),t.canvas.text(0,0,"").attr({dx:10,dy:65}).addClass("details-body").appendTo(n),t.canvas.text(0,0,"").attr({dx:10,dy:90}).addClass("details-body").appendTo(n);var r=t.canvas.filter(Snap.filter.shadow(0,1,1,"#666",.6));n.attr({filter:r})}N.group.click(function(t){if(!N.action_completed){e.removeClass("hide");var r=h();n.transform("t"+r.x+","+r.y);var a=N.task._start.format("MMM D"),o=N.task._end.format("MMM D"),i=N.task.name+": "+a+" - "+o,d=e.select(".details-heading").attr("text",i),s=d.getBBox();n.select(".details-container").attr({width:s.width+20});var c=N.task._end.diff(N.task._start,"days"),l="Duration: "+c+" days",f=N.task.progress?"Progress: "+N.task.progress:"",u=e.selectAll(".details-body");u[0].attr("text",l),u[1].attr("text",f)}})}function h(){return{x:N.$bar.getEndX()+2,y:N.$bar.getY()-10}}function _(){function t(t,e){B(t,e)}function e(){$()}function n(t,e){x(t,e)}function r(){k()}var a=v(),o=a.left,i=a.right;o.drag(n,w,r),i.drag(t,w,e)}function v(){return{left:N.handle_group.select(".handle.left"),right:N.handle_group.select(".handle.right")}}function y(){N.bar_group.drag(b,w,A)}function m(){function t(t,e){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 e(){a.finaldx&&(S(),T())}function n(){a.finaldx=0,a.owidth=a.getWidth(),a.min_dx=-a.getWidth(),a.max_dx=r.getWidth()-a.getWidth()}var r=N.$bar,a=N.$bar_progress,o=N.group.select(".handle.progress");o&&o.drag(t,n,e)}function w(){var t=N.$bar;t.ox=t.getX(),t.oy=t.getY(),t.owidth=t.getWidth(),t.finaldx=0,C("onstart")}function b(t,e){var n=N.$bar;n.finaldx=j(t),M(n.ox+n.finaldx),C("onmove",[t,e])}function A(){var t=N.$bar;t.finaldx&&(D(),T(),C("onstop"))}function x(t,e){var n=N.$bar;n.finaldx=j(t),M(n.ox+n.finaldx,n.owidth-n.finaldx),C("onmove",[t,e])}function k(){var t=N.$bar;t.finaldx&&D(),T(),C("onstop")}function C(e,n){var r=t.dependency_map;if(r[N.task.id]){var a=!0,o=!1,i=void 0;try{for(var d,s=r[N.task.id][Symbol.iterator]();!(a=(d=s.next()).done);a=!0){var c=d.value,l=t.get_bar(c);l[e].apply(l,n)}}catch(f){o=!0,i=f}finally{try{!a&&s["return"]&&s["return"]()}finally{if(o)throw i}}}}function B(t,e){var n=N.$bar;n.finaldx=j(t),M(null,n.owidth+n.finaldx)}function $(){var t=N.$bar;t.finaldx&&D(),T()}function M(t,e){var n=N.$bar;t&&G(n,"x",t),e&&G(n,"width",e),L(),R(),O(),z(),I()}function E(){N.group.click(function(){N.action_completed||(N.group.hasClass("active")&&t.trigger_event("click",[N.task]),t.unselect_all(),N.group.toggleClass("active"))})}function D(){t.trigger_event("date_change",[N.task,W(),Y()])}function S(){t.trigger_event("progress_change",[N.task,X()])}function T(){N.action_completed=!0,setTimeout(function(){return N.action_completed=!1},2e3)}function W(){var e=N.$bar,n=(e.getX()-U())/t.config.column_width,r=N.task._start.clone().add(t.config.step*n,"hours");return r}function Y(){var e=N.$bar,n=U()+N.duration*t.config.column_width,r=e.getEndX(),a=(r-n)/t.config.column_width,o=N.task._end.clone().add(t.config.step*a,"hours");return o}function X(){return N.$bar_progress.getWidth()/N.$bar.getWidth()*100}function U(){var e=N.task._start.diff(t.gantt_start,"hours")/t.config.step*t.config.column_width;return t.view_is("Month")&&(e=N.task._start.diff(t.gantt_start,"days")*t.config.column_width/30),e}function H(){return t.config.header_height+t.config.padding+N.task._index*(N.height+t.config.padding)}function j(e){var n=e,r=void 0,a=void 0;return t.view_is("Week")?(r=e%(t.config.column_width/7),a=n-r+(r<t.config.column_width/14?0:t.config.column_width/7)):t.view_is("Month")?(r=e%(t.config.column_width/30),a=n-r+(r<t.config.column_width/60?0:t.config.column_width/30)):(r=e%t.config.column_width,a=n-r+(r<t.config.column_width/2?0:t.config.column_width)),a}function G(t,e,n){return n=+n,isNaN(n)||t.attr(e,n),t}function O(){N.$bar_progress.attr("x",N.$bar.getX()),N.$bar_progress.attr("width",N.$bar.getWidth()*(N.task.progress/100))}function L(){var t=N.$bar,e=N.group.select(".bar-label");e.getBBox().width>t.getWidth()?e.addClass("big").attr("x",t.getX()+t.getWidth()+5):e.removeClass("big").attr("x",t.getX()+t.getWidth()/2)}function R(){var t=N.$bar;N.handle_group.select(".handle.left").attr({x:t.getX()+1}),N.handle_group.select(".handle.right").attr({x:t.getEndX()-9}),N.group.select(".handle.progress").attr("points",u())}function z(){var t=!0,e=!1,n=void 0;try{for(var r,a=N.arrows[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var o=r.value;o.update()}}catch(i){e=!0,n=i}finally{try{!t&&a["return"]&&a["return"]()}finally{if(e)throw n}}}function I(){var e=t.element_groups.details.select(".details-wrapper"),n=h();e&&e.transform("t"+n.x+","+n.y)}var N={};return N.onstart=w,N.onmove=b,N.onstop=A,N.onmove_handle_left=x,N.onstop_handle_left=k,n(),N}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]},function(t,e){"use strict";function n(t,e,n){function r(){d.from_task=e,d.to_task=n,a(),o()}function a(){d.start_x=e.$bar.getX()+e.$bar.getWidth()/2;for(var r=function(){return n.$bar.getX()<d.start_x+t.config.padding&&d.start_x>e.$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)*e.task._index+t.config.padding,d.end_x=n.$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)*n.task._index+t.config.padding;var a=e.task._index>n.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}),n.$bar.getX()<e.$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:n.$bar.getY()+n.$bar.getHeight()/2-d.curve_y,left:n.$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(e,"__esModule",{value:!0}),e["default"]=n,t.exports=e["default"]}])}); | ||
//# sourceMappingURL=frappe-gantt.min.js.map |
{ | ||
"name": "frappe-gantt", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A simple, modern, interactive gantt library for the web", | ||
@@ -5,0 +5,0 @@ "main": "dist/frappe-gantt.js", |
@@ -108,3 +108,2 @@ /* global Snap */ | ||
const bar = self.$bar, | ||
bar_progress = self.$bar_progress, | ||
handle_width = 8; | ||
@@ -122,7 +121,3 @@ | ||
if (self.task.progress && self.task.progress < 100) { | ||
gt.canvas.polygon( | ||
bar_progress.getEndX() - 5, bar_progress.getY() + bar_progress.getHeight(), | ||
bar_progress.getEndX() + 5, bar_progress.getY() + bar_progress.getHeight(), | ||
bar_progress.getEndX(), bar_progress.getY() + bar_progress.getHeight() - 8.66 | ||
) | ||
gt.canvas.polygon(get_progress_polygon_points()) | ||
.addClass('handle progress') | ||
@@ -133,2 +128,11 @@ .appendTo(self.handle_group); | ||
function get_progress_polygon_points() { | ||
const bar_progress = self.$bar_progress; | ||
return [ | ||
bar_progress.getEndX() - 5, bar_progress.getY() + bar_progress.getHeight(), | ||
bar_progress.getEndX() + 5, bar_progress.getY() + bar_progress.getHeight(), | ||
bar_progress.getEndX(), bar_progress.getY() + bar_progress.getHeight() - 8.66 | ||
]; | ||
} | ||
function bind() { | ||
@@ -260,3 +264,3 @@ if (self.invalid) return; | ||
bar_progress.attr('width', bar_progress.owidth + dx); | ||
handle.transform(`t{dx},0`); | ||
handle.attr('points', get_progress_polygon_points()); | ||
bar_progress.finaldx = dx; | ||
@@ -468,2 +472,5 @@ } | ||
}); | ||
self.group.select('.handle.progress').attr( | ||
'points', get_progress_polygon_points() | ||
); | ||
} | ||
@@ -470,0 +477,0 @@ |
Sorry, the diff of this file is not supported yet
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
362406
16
2609
0
45