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