gantt-task-react-powern 0.4.88 → 0.4.95

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.
@@ -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) >= 0) return React.createElement("g", {
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) >= 0) {
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
@@ -2959,8 +2959,8 @@ var Gantt = function Gantt(_ref) {
2959
2959
  if (leafTasks.length > 0 && primaryPath.length === 0 && secondaryPath.length === 0) {
2960
2960
  setHasCircularDeps(true);
2961
2961
  } else {
2962
- if (hasCircularDeps && localStorage.getItem('hideCircularDepsAlert') === 'true') {
2963
- localStorage.removeItem('hideCircularDepsAlert');
2962
+ if (hasCircularDeps && localStorage.getItem("hideCircularDepsAlert") === "true") {
2963
+ localStorage.removeItem("hideCircularDepsAlert");
2964
2964
  }
2965
2965
 
2966
2966
  setHasCircularDeps(false);
@@ -3112,7 +3112,7 @@ var Gantt = function Gantt(_ref) {
3112
3112
  var alert = document.getElementById("alert-container");
3113
3113
 
3114
3114
  if (checkbox.checked) {
3115
- localStorage.setItem('hideCircularDepsAlert', 'true');
3115
+ localStorage.setItem("hideCircularDepsAlert", "true");
3116
3116
  alert.style.display = "None";
3117
3117
  }
3118
3118
  };
@@ -3265,7 +3265,7 @@ var Gantt = function Gantt(_ref) {
3265
3265
  taskLabelRenderer: taskLabelRenderer,
3266
3266
  onMultiSelect: onMultiSelect
3267
3267
  };
3268
- return React.createElement("div", null, hasCircularDeps && localStorage.getItem('hideCircularDepsAlert') !== 'true' && React.createElement("div", {
3268
+ return React.createElement("div", null, hasCircularDeps && localStorage.getItem("hideCircularDepsAlert") !== "true" && React.createElement("div", {
3269
3269
  id: "alert-container",
3270
3270
  className: styles$9.alertContainer + " " + styles$9.warning
3271
3271
  }, React.createElement("input", {
@@ -3414,19 +3414,59 @@ function getCriticalPaths(leafTasks) {
3414
3414
  secondaryLeaf = taskMap[secondaryLeaf].next;
3415
3415
  }
3416
3416
 
3417
+ console.debug([primaryPath, secondaryPath]);
3417
3418
  return [primaryPath, secondaryPath];
3418
3419
  }
3419
3420
  function computeCriticalPath(taskID, taskMap) {
3420
3421
  var task = taskMap[taskID].task;
3421
3422
  var dependents = taskMap[taskID].dependents;
3423
+ taskMap[taskID].start = task.start.getTime();
3422
3424
  taskMap[taskID].end = task.end.getTime();
3425
+ var start = taskMap[taskID].start;
3423
3426
 
3424
- for (var j = 0; j < dependents.length; j++) {
3425
- var newDependentEnd = taskMap[dependents[j]].end;
3427
+ for (var _iterator = _createForOfIteratorHelperLoose(dependents), _step; !(_step = _iterator()).done;) {
3428
+ var _dependentTask$depend;
3426
3429
 
3427
- if (newDependentEnd > taskMap[taskID].end) {
3428
- taskMap[taskID].next = dependents[j];
3429
- taskMap[taskID].end = newDependentEnd;
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
+ }
3443
+
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;
3462
+
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;
3430
3470
  }
3431
3471
  }
3432
3472
  }