gantt-task-react-powern 0.4.79 → 0.4.80
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/components/gantt/gantt.d.ts +1 -1
- package/dist/index.js +52 -39
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +52 -39
- package/dist/index.modern.js.map +1 -1
- package/dist/types/bar-task.d.ts +1 -0
- package/dist/types/public-types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2518,44 +2518,51 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
};
|
|
2520
2520
|
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2521
|
+
var getArrows = function getArrows(isCritical, criticalPathType) {
|
|
2522
|
+
return tasks.flatMap(function (_task) {
|
|
2523
|
+
var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
|
|
2524
|
+
|
|
2525
|
+
if (!task) {
|
|
2526
|
+
return [React.createElement("g", {
|
|
2527
|
+
key: _task.id + (isCritical ? "-critical" : "-normal"),
|
|
2528
|
+
style: {
|
|
2529
|
+
height: taskHeight
|
|
2530
|
+
}
|
|
2531
|
+
})];
|
|
2532
|
+
}
|
|
2527
2533
|
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
style: {
|
|
2532
|
-
height: taskHeight
|
|
2533
|
-
}
|
|
2534
|
-
});
|
|
2535
|
-
}
|
|
2534
|
+
return task.barChildren.map(function (child) {
|
|
2535
|
+
if (task.x2 > task.x1 || task.actualx2 > task.actualx1) {
|
|
2536
|
+
var _task$criticalPathArr;
|
|
2536
2537
|
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
style: {
|
|
2554
|
-
height: taskHeight
|
|
2538
|
+
var criticalTask = (_task$criticalPathArr = task.criticalPathArrows) === null || _task$criticalPathArr === void 0 ? void 0 : _task$criticalPathArr.find(function (arrow) {
|
|
2539
|
+
return arrow.taskId === tasks[child.index].id && (!!arrow.criticalPathType ? arrow.criticalPathType === criticalPathType : !criticalPathType);
|
|
2540
|
+
});
|
|
2541
|
+
|
|
2542
|
+
if (!!criticalTask === isCritical) {
|
|
2543
|
+
return React.createElement(Arrow, {
|
|
2544
|
+
key: "Arrow from " + task.id + " to " + tasks[child.index].id + (isCritical ? "-critical" : ""),
|
|
2545
|
+
taskFrom: task,
|
|
2546
|
+
taskTo: tasks[child.index],
|
|
2547
|
+
rowHeight: rowHeight,
|
|
2548
|
+
taskHeight: taskHeight,
|
|
2549
|
+
arrowIndent: arrowIndent,
|
|
2550
|
+
rtl: rtl,
|
|
2551
|
+
arrowColor: (criticalTask === null || criticalTask === void 0 ? void 0 : criticalTask.arrowColor) || "#808080"
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2555
2554
|
}
|
|
2556
|
-
|
|
2555
|
+
|
|
2556
|
+
return null;
|
|
2557
|
+
}).filter(Boolean);
|
|
2557
2558
|
});
|
|
2558
|
-
}
|
|
2559
|
+
};
|
|
2560
|
+
|
|
2561
|
+
return React.createElement("g", {
|
|
2562
|
+
className: "content"
|
|
2563
|
+
}, React.createElement("g", {
|
|
2564
|
+
className: "arrows"
|
|
2565
|
+
}, getArrows(false), getArrows(true, "secondary"), getArrows(true, "primary")), React.createElement("g", {
|
|
2559
2566
|
className: "bar",
|
|
2560
2567
|
fontFamily: fontFamily,
|
|
2561
2568
|
fontSize: fontSize
|
|
@@ -2881,8 +2888,8 @@ var Gantt = function Gantt(_ref) {
|
|
|
2881
2888
|
uncolorAll(tasks);
|
|
2882
2889
|
|
|
2883
2890
|
if (scheduleType !== "lookAhead") {
|
|
2884
|
-
colorPath(secondaryPath, "#00ff00", tasks);
|
|
2885
|
-
colorPath(primaryPath, "#ff0000", tasks);
|
|
2891
|
+
colorPath(secondaryPath, "#00ff00", tasks, "secondary");
|
|
2892
|
+
colorPath(primaryPath, "#ff0000", tasks, "primary");
|
|
2886
2893
|
}
|
|
2887
2894
|
|
|
2888
2895
|
setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor));
|
|
@@ -3325,7 +3332,7 @@ function uncolorAll(tasks) {
|
|
|
3325
3332
|
delete task.criticalPathArrows;
|
|
3326
3333
|
});
|
|
3327
3334
|
}
|
|
3328
|
-
function colorPath(path, color, tasks) {
|
|
3335
|
+
function colorPath(path, color, tasks, criticalPathType) {
|
|
3329
3336
|
for (var i = 0; i < path.length; i++) {
|
|
3330
3337
|
var longestIDLength = 0;
|
|
3331
3338
|
var longestTask = void 0;
|
|
@@ -3368,10 +3375,16 @@ function colorPath(path, color, tasks) {
|
|
|
3368
3375
|
var arrow = arrows.find(function (arrow) {
|
|
3369
3376
|
return arrow.taskId === path[_i7 + 1].id;
|
|
3370
3377
|
});
|
|
3371
|
-
|
|
3378
|
+
|
|
3379
|
+
if (arrow) {
|
|
3380
|
+
arrow.arrowColor = color;
|
|
3381
|
+
arrow.criticalPathType = criticalPathType;
|
|
3382
|
+
} else arrows.push({
|
|
3372
3383
|
taskId: path[_i7 + 1].id,
|
|
3373
|
-
arrowColor: color
|
|
3384
|
+
arrowColor: color,
|
|
3385
|
+
criticalPathType: criticalPathType
|
|
3374
3386
|
});
|
|
3387
|
+
|
|
3375
3388
|
taskFromTasks.criticalPathArrows = arrows;
|
|
3376
3389
|
}
|
|
3377
3390
|
};
|