gantt-task-react-powern 0.4.31 → 0.4.33
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 +55 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +55 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/types/public-types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -410,7 +410,8 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
|
|
|
410
410
|
style: {
|
|
411
411
|
minWidth: parseInt(rowWidth) * 2,
|
|
412
412
|
maxWidth: parseInt(rowWidth) * 2
|
|
413
|
-
}
|
|
413
|
+
},
|
|
414
|
+
title: t.name
|
|
414
415
|
}, React.createElement("div", {
|
|
415
416
|
className: styles$1.taskListText
|
|
416
417
|
}, taskLabelRenderer(t))), React.createElement("div", {
|
|
@@ -2392,6 +2393,8 @@ var Gantt = function Gantt(_ref) {
|
|
|
2392
2393
|
milestoneBackgroundSelectedColor = _ref$milestoneBackgro2 === void 0 ? "#f29e4c" : _ref$milestoneBackgro2,
|
|
2393
2394
|
_ref$rtl = _ref.rtl,
|
|
2394
2395
|
rtl = _ref$rtl === void 0 ? false : _ref$rtl,
|
|
2396
|
+
_ref$criticalPathExpa = _ref.criticalPathExpand,
|
|
2397
|
+
criticalPathExpand = _ref$criticalPathExpa === void 0 ? true : _ref$criticalPathExpa,
|
|
2395
2398
|
_ref$handleWidth = _ref.handleWidth,
|
|
2396
2399
|
handleWidth = _ref$handleWidth === void 0 ? 8 : _ref$handleWidth,
|
|
2397
2400
|
_ref$timeStep = _ref.timeStep,
|
|
@@ -2741,6 +2744,57 @@ var Gantt = function Gantt(_ref) {
|
|
|
2741
2744
|
}
|
|
2742
2745
|
};
|
|
2743
2746
|
|
|
2747
|
+
useEffect(function () {
|
|
2748
|
+
var _getCriticalPaths2 = getCriticalPaths(leafTasks),
|
|
2749
|
+
primaryPath = _getCriticalPaths2[0];
|
|
2750
|
+
|
|
2751
|
+
console.debug("Primary path", primaryPath);
|
|
2752
|
+
|
|
2753
|
+
var isCPhidden = function isCPhidden(p) {
|
|
2754
|
+
var _tasks$find;
|
|
2755
|
+
|
|
2756
|
+
return (_tasks$find = tasks.find(function (t) {
|
|
2757
|
+
return t.id === p.id.split(".").slice(0, p.id.split(".").length - 1).join(".");
|
|
2758
|
+
})) === null || _tasks$find === void 0 ? void 0 : _tasks$find.hideChildren;
|
|
2759
|
+
};
|
|
2760
|
+
|
|
2761
|
+
var toggleCP = function toggleCP(p) {
|
|
2762
|
+
if (onExpanderClick) {
|
|
2763
|
+
(function () {
|
|
2764
|
+
var _id = p.id;
|
|
2765
|
+
console.debug("toggleCP id ", _id);
|
|
2766
|
+
|
|
2767
|
+
for (var i = 0; i < p.id.split(".").length; i++) {
|
|
2768
|
+
console.debug("toggleCP id ", _id);
|
|
2769
|
+
var t = tasks.find(function (t) {
|
|
2770
|
+
return t.id === _id;
|
|
2771
|
+
});
|
|
2772
|
+
|
|
2773
|
+
if (t) {
|
|
2774
|
+
handleExpanderClick(t);
|
|
2775
|
+
_id = _id.split(".").slice(0, _id.split(".").length - 1).join(".");
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
})();
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
|
|
2782
|
+
if (criticalPathExpand) {
|
|
2783
|
+
primaryPath.forEach(function (p) {
|
|
2784
|
+
if (isCPhidden(p)) {
|
|
2785
|
+
console.debug("CP hidden ", p);
|
|
2786
|
+
toggleCP(p);
|
|
2787
|
+
}
|
|
2788
|
+
});
|
|
2789
|
+
} else {
|
|
2790
|
+
primaryPath.forEach(function (p) {
|
|
2791
|
+
if (isCPhidden(p) === false) {
|
|
2792
|
+
toggleCP(p);
|
|
2793
|
+
}
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
}, [criticalPathExpand, leafTasks, tasks]);
|
|
2797
|
+
|
|
2744
2798
|
function topologicalOrderingHelper(taskID, taskMap, sortedTaskList) {
|
|
2745
2799
|
if (!taskMap[taskID]) return true;
|
|
2746
2800
|
if (taskMap[taskID].finished) return true;
|