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