gantt-task-react-powern 0.4.80 → 0.4.82

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.css CHANGED
@@ -310,6 +310,36 @@
310
310
  position: relative;
311
311
  }
312
312
 
313
+ ._2AxB2 {
314
+ padding: 10px;
315
+ margin: 5px 0px 5px 0px;
316
+ border-radius: 15px;
317
+ max-width: 50vw;
318
+ z-index: 1000;
319
+ }
320
+
321
+ ._2AxB2._1a-EU {
322
+ background-color: rgba(0, 255, 0, 0.2);
323
+ }
324
+
325
+ ._2AxB2._1TP0x {
326
+ background-color: rgba(255, 255, 0, 0.2);
327
+ }
328
+
329
+ ._2AxB2._2TeAI {
330
+ background-color: rgba(255, 0, 0, 0.2);
331
+ }
332
+
333
+ ._3cBUj {
334
+ display: none; /* Hide the actual checkbox */
335
+ }
336
+
337
+ ._5jQM6 {
338
+ float: right;
339
+ font-size: 20px;
340
+ font-weight: bold;
341
+ cursor: pointer;
342
+ }
313
343
  ._2k9Ys {
314
344
  overflow: auto;
315
345
  max-width: 100%;
package/dist/index.js CHANGED
@@ -442,7 +442,7 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
442
442
  }, tasks.map(function (t) {
443
443
  var expanderSymbol = "";
444
444
 
445
- if (!leafTaskIds.has(t.id)) {
445
+ if (!(leafTaskIds.has(t.id) || t.type === "milestone")) {
446
446
  if (t.hideChildren === false) {
447
447
  expanderSymbol = "▼";
448
448
  } else if (t.hideChildren === true) {
@@ -491,7 +491,7 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
491
491
  style: {
492
492
  paddingLeft: t.depth * 4 + "px"
493
493
  }
494
- }, !leafTaskIds.has(t.id) ? React__default.createElement("div", {
494
+ }, !(leafTaskIds.has(t.id) || t.type === "milestone") ? React__default.createElement("div", {
495
495
  className: styles$1.taskListExpander,
496
496
  onClick: function onClick() {
497
497
  return onExpanderClick(t);
@@ -2594,7 +2594,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2594
2594
  })));
2595
2595
  };
2596
2596
 
2597
- var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf"};
2597
+ var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf","alertContainer":"_2AxB2","success":"_1a-EU","warning":"_1TP0x","error":"_2TeAI","alertDismissCheckbox":"_3cBUj","alertCloseButton":"_5jQM6"};
2598
2598
 
2599
2599
  var TaskGantt = function TaskGantt(_ref) {
2600
2600
  var gridProps = _ref.gridProps,
@@ -2838,6 +2838,10 @@ var Gantt = function Gantt(_ref) {
2838
2838
  ignoreScrollEvent = _useState12[0],
2839
2839
  setIgnoreScrollEvent = _useState12[1];
2840
2840
 
2841
+ var _useState13 = React.useState(false),
2842
+ hasCircularDeps = _useState13[0],
2843
+ setHasCircularDeps = _useState13[1];
2844
+
2841
2845
  React.useEffect(function () {
2842
2846
  if (scheduleType === "lookAhead" && startDate && endDate) {
2843
2847
  setDateSetup({
@@ -2886,6 +2890,10 @@ var Gantt = function Gantt(_ref) {
2886
2890
  primaryPath = _getCriticalPaths[0],
2887
2891
  secondaryPath = _getCriticalPaths[1];
2888
2892
 
2893
+ if (leafTasks.length > 0 && primaryPath.length === 0 && secondaryPath.length === 0) {
2894
+ setHasCircularDeps(true);
2895
+ }
2896
+
2889
2897
  uncolorAll(tasks);
2890
2898
 
2891
2899
  if (scheduleType !== "lookAhead") {
@@ -3027,6 +3035,15 @@ var Gantt = function Gantt(_ref) {
3027
3035
  }
3028
3036
  };
3029
3037
 
3038
+ var hideAlert = function hideAlert() {
3039
+ var checkbox = document.getElementById("alert-dismiss");
3040
+ var alert = document.getElementById("alert-container");
3041
+
3042
+ if (checkbox.checked) {
3043
+ alert.style.display = "None";
3044
+ }
3045
+ };
3046
+
3030
3047
  var handleKeyDown = function handleKeyDown(event) {
3031
3048
  event.preventDefault();
3032
3049
  var newScrollY = scrollY;
@@ -3175,7 +3192,20 @@ var Gantt = function Gantt(_ref) {
3175
3192
  taskLabelRenderer: taskLabelRenderer,
3176
3193
  onMultiSelect: onMultiSelect
3177
3194
  };
3178
- return React__default.createElement("div", null, React__default.createElement("div", {
3195
+ return React__default.createElement("div", null, hasCircularDeps && React__default.createElement("div", {
3196
+ id: "alert-container",
3197
+ className: styles$9.alertContainer + " " + styles$9.warning
3198
+ }, React__default.createElement("input", {
3199
+ type: "checkbox",
3200
+ id: "alert-dismiss",
3201
+ className: styles$9.alertDismissCheckbox,
3202
+ onChange: hideAlert
3203
+ }), React__default.createElement("label", {
3204
+ htmlFor: "alert-dismiss",
3205
+ className: styles$9.alertCloseButton
3206
+ }, "\xD7"), React__default.createElement("div", {
3207
+ className: styles$9.alertContent
3208
+ }, React__default.createElement("p", null, "Critical path could not be displayed due to circular dependencies"))), React__default.createElement("div", {
3179
3209
  className: styles$9.wrapper,
3180
3210
  onKeyDown: handleKeyDown,
3181
3211
  tabIndex: 0,