gantt-task-react-powern 0.4.22 → 0.4.24

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 CHANGED
@@ -2796,27 +2796,20 @@ var Gantt = function Gantt(_ref) {
2796
2796
  }
2797
2797
 
2798
2798
  function colorPath(path, color, tasks) {
2799
- var _loop = function _loop(i) {
2800
- var task = tasks.find(function (otherTask) {
2801
- return path[i].id === otherTask.id;
2802
- });
2799
+ for (var i = 0; i < path.length; i++) {
2800
+ for (var j = 0; j < tasks.length; j++) {
2801
+ if (path[i].id.startsWith(tasks[j].id + ".") || path[i].id === tasks[j].id) {
2802
+ var _tasks$j$styles;
2803
2803
 
2804
- while (task) {
2805
- if (!task.styles) task.styles = {};
2806
- task.styles.criticalPathColor = color;
2807
- task = tasks.find(function (otherTask) {
2808
- var _task;
2804
+ var _styles = (_tasks$j$styles = tasks[j].styles) != null ? _tasks$j$styles : {};
2809
2805
 
2810
- return (_task = task) === null || _task === void 0 ? void 0 : _task.id.startsWith(otherTask.id + ".");
2811
- });
2806
+ _styles.criticalPathColor = color;
2807
+ tasks[j].styles = _styles;
2808
+ }
2812
2809
  }
2813
- };
2814
-
2815
- for (var i = 0; i < path.length; i++) {
2816
- _loop(i);
2817
2810
  }
2818
2811
 
2819
- var _loop2 = function _loop2(_i) {
2812
+ var _loop = function _loop(_i) {
2820
2813
  var arrows = path[_i].criticalPathArrows;
2821
2814
  if (!arrows) arrows = [];
2822
2815
  var arrow = arrows.find(function (arrow) {
@@ -2830,7 +2823,7 @@ var Gantt = function Gantt(_ref) {
2830
2823
  };
2831
2824
 
2832
2825
  for (var _i = 0; _i + 1 < path.length; _i++) {
2833
- _loop2(_i);
2826
+ _loop(_i);
2834
2827
  }
2835
2828
  }
2836
2829