gantt-task-react-powern 0.4.23 → 0.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +39 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +39 -11
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1877,7 +1877,8 @@ var Project = function Project(_ref) {
|
|
|
1877
1877
|
height: task.height,
|
|
1878
1878
|
rx: task.barCornerRadius,
|
|
1879
1879
|
ry: task.barCornerRadius,
|
|
1880
|
-
className: styles$8.projectBackground
|
|
1880
|
+
className: styles$8.projectBackground,
|
|
1881
|
+
stroke: task.styles.criticalPathColor
|
|
1881
1882
|
}), React.createElement("rect", {
|
|
1882
1883
|
x: task.progressX,
|
|
1883
1884
|
width: task.progressWidth,
|
|
@@ -1885,7 +1886,8 @@ var Project = function Project(_ref) {
|
|
|
1885
1886
|
height: task.height,
|
|
1886
1887
|
ry: task.barCornerRadius,
|
|
1887
1888
|
rx: task.barCornerRadius,
|
|
1888
|
-
fill: processColor
|
|
1889
|
+
fill: processColor,
|
|
1890
|
+
stroke: task.styles.criticalPathColor
|
|
1889
1891
|
}), React.createElement("rect", {
|
|
1890
1892
|
fill: barColor,
|
|
1891
1893
|
x: task.x1,
|
|
@@ -1894,15 +1896,18 @@ var Project = function Project(_ref) {
|
|
|
1894
1896
|
height: task.height / 2,
|
|
1895
1897
|
rx: task.barCornerRadius,
|
|
1896
1898
|
ry: task.barCornerRadius,
|
|
1897
|
-
className: styles$8.projectTop
|
|
1899
|
+
className: styles$8.projectTop,
|
|
1900
|
+
stroke: task.styles.criticalPathColor
|
|
1898
1901
|
}), React.createElement("polygon", {
|
|
1899
1902
|
className: styles$8.projectTop,
|
|
1900
1903
|
points: projectLeftTriangle,
|
|
1901
|
-
fill: barColor
|
|
1904
|
+
fill: barColor,
|
|
1905
|
+
stroke: task.styles.criticalPathColor
|
|
1902
1906
|
}), React.createElement("polygon", {
|
|
1903
1907
|
className: styles$8.projectTop,
|
|
1904
1908
|
points: projectRightTriangle,
|
|
1905
|
-
fill: barColor
|
|
1909
|
+
fill: barColor,
|
|
1910
|
+
stroke: task.styles.criticalPathColor
|
|
1906
1911
|
}));
|
|
1907
1912
|
};
|
|
1908
1913
|
|
|
@@ -2524,6 +2529,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
2524
2529
|
primaryPath = _getCriticalPaths[0],
|
|
2525
2530
|
secondaryPath = _getCriticalPaths[1];
|
|
2526
2531
|
|
|
2532
|
+
uncolorAll(tasks);
|
|
2527
2533
|
colorPath(secondaryPath, "#00ff00", tasks);
|
|
2528
2534
|
colorPath(primaryPath, "#ff0000", tasks);
|
|
2529
2535
|
setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
|
|
@@ -2794,18 +2800,40 @@ var Gantt = function Gantt(_ref) {
|
|
|
2794
2800
|
return [].concat(longestPath, [task]);
|
|
2795
2801
|
}
|
|
2796
2802
|
|
|
2803
|
+
function uncolorAll(tasks) {
|
|
2804
|
+
tasks.forEach(function (task) {
|
|
2805
|
+
if (task.styles) delete task.styles.criticalPathColor;
|
|
2806
|
+
delete task.criticalPathArrows;
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2797
2810
|
function colorPath(path, color, tasks) {
|
|
2798
2811
|
for (var i = 0; i < path.length; i++) {
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
var _tasks$j$styles;
|
|
2812
|
+
var longestIDLength = 0;
|
|
2813
|
+
var longestTask = void 0;
|
|
2802
2814
|
|
|
2803
|
-
|
|
2815
|
+
for (var j = 0; j < tasks.length; j++) {
|
|
2816
|
+
if (path[i].id === tasks[j].id) {
|
|
2817
|
+
longestTask = tasks[j];
|
|
2818
|
+
break;
|
|
2819
|
+
}
|
|
2804
2820
|
|
|
2805
|
-
|
|
2806
|
-
tasks[j].
|
|
2821
|
+
if (path[i].id.startsWith(tasks[j].id + ".") && tasks[j].id.length > longestIDLength) {
|
|
2822
|
+
longestIDLength = tasks[j].id.length;
|
|
2823
|
+
longestTask = tasks[j];
|
|
2807
2824
|
}
|
|
2808
2825
|
}
|
|
2826
|
+
|
|
2827
|
+
if (longestTask) {
|
|
2828
|
+
var _longestTask$styles;
|
|
2829
|
+
|
|
2830
|
+
console.log("Colored " + longestTask.id + " " + color);
|
|
2831
|
+
|
|
2832
|
+
var _styles = (_longestTask$styles = longestTask.styles) != null ? _longestTask$styles : {};
|
|
2833
|
+
|
|
2834
|
+
_styles.criticalPathColor = color;
|
|
2835
|
+
longestTask.styles = _styles;
|
|
2836
|
+
}
|
|
2809
2837
|
}
|
|
2810
2838
|
|
|
2811
2839
|
var _loop = function _loop(_i) {
|