gantt-task-react-powern 0.4.21 → 0.4.23

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/README.md CHANGED
@@ -31,7 +31,7 @@ let tasks: Task[] = [
31
31
  },
32
32
  ...
33
33
  ];
34
- <Gantt tasks={tasks} />
34
+ <Gantt tasks={tasks}/>
35
35
  ```
36
36
 
37
37
  You may handle actions
package/dist/index.js CHANGED
@@ -2349,8 +2349,8 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
2349
2349
 
2350
2350
  var Gantt = function Gantt(_ref) {
2351
2351
  var tasks = _ref.tasks,
2352
- _ref$leafNodes = _ref.leafNodes,
2353
- leafNodes = _ref$leafNodes === void 0 ? [] : _ref$leafNodes,
2352
+ _ref$leafTasks = _ref.leafTasks,
2353
+ leafTasks = _ref$leafTasks === void 0 ? [] : _ref$leafTasks,
2354
2354
  _ref$headerHeight = _ref.headerHeight,
2355
2355
  headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
2356
2356
  _ref$columnWidth = _ref.columnWidth,
@@ -2521,7 +2521,7 @@ var Gantt = function Gantt(_ref) {
2521
2521
  viewMode: viewMode
2522
2522
  });
2523
2523
 
2524
- var _getCriticalPaths = getCriticalPaths(leafNodes),
2524
+ var _getCriticalPaths = getCriticalPaths(leafTasks),
2525
2525
  primaryPath = _getCriticalPaths[0],
2526
2526
  secondaryPath = _getCriticalPaths[1];
2527
2527
 
@@ -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 + ".")) {
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