gantt-task-react-powern 0.4.4 → 0.4.7

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.
@@ -117,11 +117,15 @@ var ganttDateRange = function ganttDateRange(tasks, viewMode, preStepsCount) {
117
117
  if (task.end > newEndDate) {
118
118
  newEndDate = task.end;
119
119
  }
120
- }
121
120
 
122
- newStartDate = addToDate(newStartDate, -1, "year");
123
- newEndDate = addToDate(newEndDate, 1, "year");
124
- console.log(newStartDate, newEndDate);
121
+ if (task.actualStart < newStartDate) {
122
+ newStartDate = task.actualStart;
123
+ }
124
+
125
+ if (task.actualEnd > newEndDate) {
126
+ newEndDate = task.actualEnd;
127
+ }
128
+ }
125
129
 
126
130
  switch (viewMode) {
127
131
  case ViewMode.Year:
@@ -1063,7 +1067,8 @@ var Arrow = function Arrow(_ref) {
1063
1067
  rowHeight = _ref.rowHeight,
1064
1068
  taskHeight = _ref.taskHeight,
1065
1069
  arrowIndent = _ref.arrowIndent,
1066
- rtl = _ref.rtl;
1070
+ rtl = _ref.rtl,
1071
+ arrowColor = _ref.arrowColor;
1067
1072
  var path;
1068
1073
  var trianglePoints;
1069
1074
 
@@ -1084,9 +1089,11 @@ var Arrow = function Arrow(_ref) {
1084
1089
  }, React.createElement("path", {
1085
1090
  strokeWidth: "1.5",
1086
1091
  d: path,
1087
- fill: "none"
1092
+ fill: "none",
1093
+ stroke: arrowColor
1088
1094
  }), React.createElement("polygon", {
1089
- points: trianglePoints
1095
+ points: trianglePoints,
1096
+ fill: arrowColor
1090
1097
  }));
1091
1098
  };
1092
1099
 
@@ -1257,9 +1264,11 @@ var convertToMilestone = function convertToMilestone(task, index, dates, columnW
1257
1264
  };
1258
1265
 
1259
1266
  var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
1267
+ console.log(dates);
1260
1268
  var index = dates.findIndex(function (d) {
1261
1269
  return d.getTime() >= xDate.getTime();
1262
1270
  }) - 1;
1271
+ console.log(index);
1263
1272
  var remainderMillis = xDate.getTime() - dates[index].getTime();
1264
1273
  var percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
1265
1274
  var x = index * columnWidth + percentOfInterval * columnWidth;
@@ -1559,8 +1568,6 @@ var sortTasks = function sortTasks(taskA, taskB) {
1559
1568
  }
1560
1569
  };
1561
1570
 
1562
- var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1563
-
1564
1571
  var BarDisplay = function BarDisplay(_ref) {
1565
1572
  var x = _ref.x,
1566
1573
  y = _ref.y,
@@ -1593,7 +1600,8 @@ var BarDisplay = function BarDisplay(_ref) {
1593
1600
  ry: barCornerRadius,
1594
1601
  rx: barCornerRadius,
1595
1602
  fill: getBarColor(),
1596
- className: styles$6.barBackground
1603
+ strokeWidth: 2,
1604
+ stroke: styles.criticalPathColor
1597
1605
  }), React.createElement("rect", {
1598
1606
  x: actualX1,
1599
1607
  width: actualX2 - actualX1,
@@ -1613,6 +1621,8 @@ var BarDisplay = function BarDisplay(_ref) {
1613
1621
  }));
1614
1622
  };
1615
1623
 
1624
+ var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1625
+
1616
1626
  var BarDateHandle = function BarDateHandle(_ref) {
1617
1627
  var x = _ref.x,
1618
1628
  y = _ref.y,
@@ -1886,7 +1896,6 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
1886
1896
  timeStep = _ref.timeStep,
1887
1897
  svg = _ref.svg,
1888
1898
  taskHeight = _ref.taskHeight,
1889
- arrowColor = _ref.arrowColor,
1890
1899
  arrowIndent = _ref.arrowIndent,
1891
1900
  fontFamily = _ref.fontFamily,
1892
1901
  fontSize = _ref.fontSize,
@@ -2104,9 +2113,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2104
2113
  return React.createElement("g", {
2105
2114
  className: "content"
2106
2115
  }, React.createElement("g", {
2107
- className: "arrows",
2108
- fill: arrowColor,
2109
- stroke: arrowColor
2116
+ className: "arrows"
2110
2117
  }, tasks.map(function (task) {
2111
2118
  return task.barChildren.map(function (child) {
2112
2119
  return React.createElement(Arrow, {
@@ -2116,7 +2123,8 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2116
2123
  rowHeight: rowHeight,
2117
2124
  taskHeight: taskHeight,
2118
2125
  arrowIndent: arrowIndent,
2119
- rtl: rtl
2126
+ rtl: rtl,
2127
+ arrowColor: task.styles.criticalPathColor || "#808080"
2120
2128
  });
2121
2129
  });
2122
2130
  })), React.createElement("g", {