gantt-task-react-powern 0.4.87 → 0.4.94
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 +66 -9
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +66 -9
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1569,7 +1569,7 @@ var convertToBar = function convertToBar(task, index, dates, columnWidth, rowHei
|
|
|
1569
1569
|
};
|
|
1570
1570
|
|
|
1571
1571
|
var convertToMilestone = function convertToMilestone(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
|
|
1572
|
-
var x = task.start && task.end ? taskXCoordinate(task.
|
|
1572
|
+
var x = task.start && task.end ? taskXCoordinate(task.end, dates, columnWidth) : 0;
|
|
1573
1573
|
var y = taskYCoordinate(index, rowHeight, taskHeight);
|
|
1574
1574
|
var x1 = task.start && task.end ? x - taskHeight * 0.5 : 0;
|
|
1575
1575
|
var x2 = task.start && task.end ? x + taskHeight * 0.5 : 0;
|
|
@@ -2020,7 +2020,7 @@ var Bar = function Bar(_ref) {
|
|
|
2020
2020
|
var handleHeight = task.height / 2 - 1;
|
|
2021
2021
|
|
|
2022
2022
|
if (type == "planned") {
|
|
2023
|
-
if ((task === null || task === void 0 ? void 0 : task.x1) >= 0 && (task === null || task === void 0 ? void 0 : task.x2)
|
|
2023
|
+
if ((task === null || task === void 0 ? void 0 : task.x1) >= 0 && (task === null || task === void 0 ? void 0 : task.x2) > 0) return React__default.createElement("g", {
|
|
2024
2024
|
className: styles$6.barWrapper,
|
|
2025
2025
|
tabIndex: 0
|
|
2026
2026
|
}, React__default.createElement(BarDisplay, {
|
|
@@ -2068,7 +2068,7 @@ var Bar = function Bar(_ref) {
|
|
|
2068
2068
|
className: styles$6.barWrapper,
|
|
2069
2069
|
tabIndex: 0
|
|
2070
2070
|
});
|
|
2071
|
-
} else if ((task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2)
|
|
2071
|
+
} else if ((task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2) > 0) {
|
|
2072
2072
|
return React__default.createElement("g", {
|
|
2073
2073
|
className: styles$6.barWrapper,
|
|
2074
2074
|
tabIndex: 0
|
|
@@ -2186,7 +2186,10 @@ var Milestone = function Milestone(_ref) {
|
|
|
2186
2186
|
transform: transform,
|
|
2187
2187
|
className: styles$7.milestoneBackground,
|
|
2188
2188
|
onMouseDown: function onMouseDown(e) {
|
|
2189
|
-
isDateChangeable && onEventStart("move", task, e);
|
|
2189
|
+
isDateChangeable && onEventStart("move", task, e, "planned");
|
|
2190
|
+
},
|
|
2191
|
+
onDoubleClick: function onDoubleClick(e) {
|
|
2192
|
+
onEventStart("dblclick", task, e);
|
|
2190
2193
|
}
|
|
2191
2194
|
}));
|
|
2192
2195
|
};
|
|
@@ -2619,6 +2622,21 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
|
|
|
2619
2622
|
}, tasks.map(function (_task) {
|
|
2620
2623
|
var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 || _task.actualStart.getTime() > 0 && _task.actualEnd.getTime() > 0 ? _task : undefined;
|
|
2621
2624
|
|
|
2625
|
+
if (!task && _task.typeInternal === "milestone") {
|
|
2626
|
+
return React__default.createElement(Milestone, {
|
|
2627
|
+
task: _task,
|
|
2628
|
+
arrowIndent: arrowIndent,
|
|
2629
|
+
taskHeight: taskHeight,
|
|
2630
|
+
isProgressChangeable: false,
|
|
2631
|
+
isDateChangeable: false,
|
|
2632
|
+
isDelete: !_task.isDisabled,
|
|
2633
|
+
onEventStart: handleBarEventStart,
|
|
2634
|
+
key: _task.id,
|
|
2635
|
+
isSelected: !!selectedTask && _task.id === selectedTask.id,
|
|
2636
|
+
rtl: rtl
|
|
2637
|
+
});
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2622
2640
|
if (!task) {
|
|
2623
2641
|
return React__default.createElement("g", {
|
|
2624
2642
|
key: _task.id,
|
|
@@ -3402,14 +3420,53 @@ function getCriticalPaths(leafTasks) {
|
|
|
3402
3420
|
function computeCriticalPath(taskID, taskMap) {
|
|
3403
3421
|
var task = taskMap[taskID].task;
|
|
3404
3422
|
var dependents = taskMap[taskID].dependents;
|
|
3423
|
+
taskMap[taskID].start = task.start.getTime();
|
|
3405
3424
|
taskMap[taskID].end = task.end.getTime();
|
|
3425
|
+
var start = taskMap[taskID].start;
|
|
3426
|
+
|
|
3427
|
+
for (var _iterator = _createForOfIteratorHelperLoose(dependents), _step; !(_step = _iterator()).done;) {
|
|
3428
|
+
var _dependentTask$depend;
|
|
3429
|
+
|
|
3430
|
+
var depID = _step.value;
|
|
3431
|
+
var dependentTask = taskMap[depID].task;
|
|
3432
|
+
var dependency = (_dependentTask$depend = dependentTask.dependencies) === null || _dependentTask$depend === void 0 ? void 0 : _dependentTask$depend.find(function (d) {
|
|
3433
|
+
return d.id === taskID;
|
|
3434
|
+
});
|
|
3435
|
+
if (!dependency) continue;
|
|
3436
|
+
|
|
3437
|
+
switch (dependency.type) {
|
|
3438
|
+
case "FS":
|
|
3439
|
+
if (taskMap[depID].end > taskMap[taskID].end) {
|
|
3440
|
+
taskMap[taskID].next = depID;
|
|
3441
|
+
taskMap[taskID].end = taskMap[depID].end;
|
|
3442
|
+
}
|
|
3406
3443
|
|
|
3407
|
-
|
|
3408
|
-
|
|
3444
|
+
break;
|
|
3445
|
+
|
|
3446
|
+
case "SS":
|
|
3447
|
+
if (taskMap[depID].start > start) {
|
|
3448
|
+
taskMap[taskID].next = depID;
|
|
3449
|
+
start = taskMap[depID].start;
|
|
3450
|
+
taskMap[taskID].end = taskMap[depID].end;
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
break;
|
|
3454
|
+
|
|
3455
|
+
case "FF":
|
|
3456
|
+
if (taskMap[depID].end > taskMap[taskID].end) {
|
|
3457
|
+
taskMap[taskID].next = depID;
|
|
3458
|
+
taskMap[taskID].end = taskMap[depID].end;
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
break;
|
|
3409
3462
|
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3463
|
+
case "SF":
|
|
3464
|
+
if (taskMap[depID].start > taskMap[taskID].end) {
|
|
3465
|
+
taskMap[taskID].next = depID;
|
|
3466
|
+
taskMap[taskID].end = taskMap[depID].start;
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
break;
|
|
3413
3470
|
}
|
|
3414
3471
|
}
|
|
3415
3472
|
}
|