gantt-task-react-powern 0.4.79 → 0.4.81
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 +54 -41
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +54 -41
- 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
|
@@ -441,7 +441,7 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
|
|
|
441
441
|
}, tasks.map(function (t) {
|
|
442
442
|
var expanderSymbol = "";
|
|
443
443
|
|
|
444
|
-
if (!leafTaskIds.has(t.id)) {
|
|
444
|
+
if (!(leafTaskIds.has(t.id) || t.type === "milestone")) {
|
|
445
445
|
if (t.hideChildren === false) {
|
|
446
446
|
expanderSymbol = "▼";
|
|
447
447
|
} else if (t.hideChildren === true) {
|
|
@@ -490,7 +490,7 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
|
|
|
490
490
|
style: {
|
|
491
491
|
paddingLeft: t.depth * 4 + "px"
|
|
492
492
|
}
|
|
493
|
-
}, !leafTaskIds.has(t.id) ? React.createElement("div", {
|
|
493
|
+
}, !(leafTaskIds.has(t.id) || t.type === "milestone") ? React.createElement("div", {
|
|
494
494
|
className: styles$1.taskListExpander,
|
|
495
495
|
onClick: function onClick() {
|
|
496
496
|
return onExpanderClick(t);
|
|
@@ -2518,44 +2518,51 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
};
|
|
2520
2520
|
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
className: "arrows"
|
|
2525
|
-
}, tasks.map(function (_task) {
|
|
2526
|
-
var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
|
|
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;
|
|
2527
2524
|
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2525
|
+
if (!task) {
|
|
2526
|
+
return [React.createElement("g", {
|
|
2527
|
+
key: _task.id + (isCritical ? "-critical" : "-normal"),
|
|
2528
|
+
style: {
|
|
2529
|
+
height: taskHeight
|
|
2530
|
+
}
|
|
2531
|
+
})];
|
|
2532
|
+
}
|
|
2536
2533
|
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2534
|
+
return task.barChildren.map(function (child) {
|
|
2535
|
+
if (task.x2 > task.x1 || task.actualx2 > task.actualx1) {
|
|
2536
|
+
var _task$criticalPathArr;
|
|
2537
|
+
|
|
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
|
};
|