gantt-task-react-powern 0.4.81 → 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.
@@ -2593,7 +2593,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2593
2593
  })));
2594
2594
  };
2595
2595
 
2596
- var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf"};
2596
+ var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf","alertContainer":"_2AxB2","success":"_1a-EU","warning":"_1TP0x","error":"_2TeAI","alertDismissCheckbox":"_3cBUj","alertCloseButton":"_5jQM6"};
2597
2597
 
2598
2598
  var TaskGantt = function TaskGantt(_ref) {
2599
2599
  var gridProps = _ref.gridProps,
@@ -2837,6 +2837,10 @@ var Gantt = function Gantt(_ref) {
2837
2837
  ignoreScrollEvent = _useState12[0],
2838
2838
  setIgnoreScrollEvent = _useState12[1];
2839
2839
 
2840
+ var _useState13 = useState(false),
2841
+ hasCircularDeps = _useState13[0],
2842
+ setHasCircularDeps = _useState13[1];
2843
+
2840
2844
  useEffect(function () {
2841
2845
  if (scheduleType === "lookAhead" && startDate && endDate) {
2842
2846
  setDateSetup({
@@ -2885,6 +2889,10 @@ var Gantt = function Gantt(_ref) {
2885
2889
  primaryPath = _getCriticalPaths[0],
2886
2890
  secondaryPath = _getCriticalPaths[1];
2887
2891
 
2892
+ if (leafTasks.length > 0 && primaryPath.length === 0 && secondaryPath.length === 0) {
2893
+ setHasCircularDeps(true);
2894
+ }
2895
+
2888
2896
  uncolorAll(tasks);
2889
2897
 
2890
2898
  if (scheduleType !== "lookAhead") {
@@ -3026,6 +3034,15 @@ var Gantt = function Gantt(_ref) {
3026
3034
  }
3027
3035
  };
3028
3036
 
3037
+ var hideAlert = function hideAlert() {
3038
+ var checkbox = document.getElementById("alert-dismiss");
3039
+ var alert = document.getElementById("alert-container");
3040
+
3041
+ if (checkbox.checked) {
3042
+ alert.style.display = "None";
3043
+ }
3044
+ };
3045
+
3029
3046
  var handleKeyDown = function handleKeyDown(event) {
3030
3047
  event.preventDefault();
3031
3048
  var newScrollY = scrollY;
@@ -3174,7 +3191,20 @@ var Gantt = function Gantt(_ref) {
3174
3191
  taskLabelRenderer: taskLabelRenderer,
3175
3192
  onMultiSelect: onMultiSelect
3176
3193
  };
3177
- return React.createElement("div", null, React.createElement("div", {
3194
+ return React.createElement("div", null, hasCircularDeps && React.createElement("div", {
3195
+ id: "alert-container",
3196
+ className: styles$9.alertContainer + " " + styles$9.warning
3197
+ }, React.createElement("input", {
3198
+ type: "checkbox",
3199
+ id: "alert-dismiss",
3200
+ className: styles$9.alertDismissCheckbox,
3201
+ onChange: hideAlert
3202
+ }), React.createElement("label", {
3203
+ htmlFor: "alert-dismiss",
3204
+ className: styles$9.alertCloseButton
3205
+ }, "\xD7"), React.createElement("div", {
3206
+ className: styles$9.alertContent
3207
+ }, React.createElement("p", null, "Critical path could not be displayed due to circular dependencies"))), React.createElement("div", {
3178
3208
  className: styles$9.wrapper,
3179
3209
  onKeyDown: handleKeyDown,
3180
3210
  tabIndex: 0,