gantt-task-react-v 1.3.4 → 1.3.5
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/gantt-task-react.es.js +44 -36
- package/dist/gantt-task-react.umd.js +44 -36
- package/package.json +1 -1
|
@@ -13168,40 +13168,47 @@ const TaskGanttContentInner = (props) => {
|
|
|
13168
13168
|
)
|
|
13169
13169
|
);
|
|
13170
13170
|
if (task.comparisonDates && comparisonDates) {
|
|
13171
|
+
console.log(`Comparison bar for task ${task.id}:`, {
|
|
13172
|
+
originalCoords: comparisonDates,
|
|
13173
|
+
taskComparisonDates: task.comparisonDates
|
|
13174
|
+
});
|
|
13171
13175
|
const safeComparisonX = isNaN(comparisonDates.x) || !isFinite(comparisonDates.x) ? 0 : comparisonDates.x;
|
|
13172
|
-
const
|
|
13173
|
-
const
|
|
13174
|
-
const
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13176
|
+
const safeComparisonWidth = isNaN(comparisonDates.width) || !isFinite(comparisonDates.width) ? 10 : Math.max(comparisonDates.width, 3);
|
|
13177
|
+
const safeComparisonHeight = isNaN(comparisonDates.height) || !isFinite(comparisonDates.height) ? 6 : Math.max(comparisonDates.height, 3);
|
|
13178
|
+
const comparisonRight = safeComparisonX + safeComparisonWidth;
|
|
13179
|
+
const isVisible = comparisonRight >= 0 && safeComparisonX <= 1e4;
|
|
13180
|
+
if (isVisible) {
|
|
13181
|
+
tasksRes.push(
|
|
13182
|
+
/* @__PURE__ */ jsx(
|
|
13183
|
+
"svg",
|
|
13184
|
+
{
|
|
13185
|
+
id: task.id + "_comparison",
|
|
13186
|
+
className: "TaskItemWrapperComparison",
|
|
13187
|
+
x: Math.max(safeComparisonX + (additionalLeftSpace || 0), 0),
|
|
13188
|
+
y: safeLevelY + taskHeight + 2,
|
|
13189
|
+
width: safeComparisonWidth,
|
|
13190
|
+
height: safeComparisonHeight,
|
|
13191
|
+
children: /* @__PURE__ */ jsx(
|
|
13192
|
+
BarComparison,
|
|
13193
|
+
{
|
|
13194
|
+
inProgress: !task.comparisonDates.end,
|
|
13195
|
+
isPlan: task.comparisonDates.start.getTime() >= task.start.getTime() && !!task.comparisonDates.end && task.comparisonDates.end.getTime() <= task.end.getTime() || task.comparisonDates.start.getTime() <= task.start.getTime() && !!task.comparisonDates.end && task.comparisonDates.end.getTime() <= task.start.getTime(),
|
|
13196
|
+
isWarning: !!task.comparisonDates.end && task.comparisonDates.end.getTime() >= task.end.getTime(),
|
|
13197
|
+
isCritical: task.comparisonDates.start.getTime() > task.start.getTime(),
|
|
13198
|
+
barCornerRadius: distances.barCornerRadius,
|
|
13199
|
+
height: safeComparisonHeight,
|
|
13200
|
+
width: safeComparisonWidth,
|
|
13201
|
+
borderHeight: distances.barComparisonTaskBorderHeight,
|
|
13202
|
+
yOffset: distances.barComparisonTaskYOffset,
|
|
13203
|
+
task,
|
|
13204
|
+
onTooltipTask
|
|
13205
|
+
}
|
|
13206
|
+
)
|
|
13207
|
+
},
|
|
13208
|
+
key2 + "_comparison"
|
|
13209
|
+
)
|
|
13210
|
+
);
|
|
13211
|
+
}
|
|
13205
13212
|
}
|
|
13206
13213
|
const addedDependenciesAtLevel = addedDependencies[comparisonLevel] || {};
|
|
13207
13214
|
if (!addedDependencies[comparisonLevel]) {
|
|
@@ -13860,11 +13867,12 @@ const countTaskCoordinates = (task, taskToRowIndexMap, startDate, viewMode, rtl,
|
|
|
13860
13867
|
);
|
|
13861
13868
|
cx1 = isNaN(cx1) || !isFinite(cx1) ? x1 : cx1;
|
|
13862
13869
|
cx2 = isNaN(cx2) || !isFinite(cx2) ? x2 : cx2;
|
|
13870
|
+
const comparisonWidth = Math.max(Math.abs(cx2 - cx1), 3);
|
|
13871
|
+
const comparisonX = Math.min(cx1, cx2);
|
|
13863
13872
|
comparisonDates = {
|
|
13864
|
-
x:
|
|
13873
|
+
x: comparisonX,
|
|
13865
13874
|
y: y + taskHeight,
|
|
13866
|
-
width:
|
|
13867
|
-
// Ensure minimum width of 1px for visibility
|
|
13875
|
+
width: comparisonWidth,
|
|
13868
13876
|
height: barComparisonTaskHeight
|
|
13869
13877
|
};
|
|
13870
13878
|
}
|
|
@@ -13185,40 +13185,47 @@
|
|
|
13185
13185
|
)
|
|
13186
13186
|
);
|
|
13187
13187
|
if (task.comparisonDates && comparisonDates) {
|
|
13188
|
+
console.log(`Comparison bar for task ${task.id}:`, {
|
|
13189
|
+
originalCoords: comparisonDates,
|
|
13190
|
+
taskComparisonDates: task.comparisonDates
|
|
13191
|
+
});
|
|
13188
13192
|
const safeComparisonX = isNaN(comparisonDates.x) || !isFinite(comparisonDates.x) ? 0 : comparisonDates.x;
|
|
13189
|
-
const
|
|
13190
|
-
const
|
|
13191
|
-
const
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13193
|
+
const safeComparisonWidth = isNaN(comparisonDates.width) || !isFinite(comparisonDates.width) ? 10 : Math.max(comparisonDates.width, 3);
|
|
13194
|
+
const safeComparisonHeight = isNaN(comparisonDates.height) || !isFinite(comparisonDates.height) ? 6 : Math.max(comparisonDates.height, 3);
|
|
13195
|
+
const comparisonRight = safeComparisonX + safeComparisonWidth;
|
|
13196
|
+
const isVisible = comparisonRight >= 0 && safeComparisonX <= 1e4;
|
|
13197
|
+
if (isVisible) {
|
|
13198
|
+
tasksRes.push(
|
|
13199
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13200
|
+
"svg",
|
|
13201
|
+
{
|
|
13202
|
+
id: task.id + "_comparison",
|
|
13203
|
+
className: "TaskItemWrapperComparison",
|
|
13204
|
+
x: Math.max(safeComparisonX + (additionalLeftSpace || 0), 0),
|
|
13205
|
+
y: safeLevelY + taskHeight + 2,
|
|
13206
|
+
width: safeComparisonWidth,
|
|
13207
|
+
height: safeComparisonHeight,
|
|
13208
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13209
|
+
BarComparison,
|
|
13210
|
+
{
|
|
13211
|
+
inProgress: !task.comparisonDates.end,
|
|
13212
|
+
isPlan: task.comparisonDates.start.getTime() >= task.start.getTime() && !!task.comparisonDates.end && task.comparisonDates.end.getTime() <= task.end.getTime() || task.comparisonDates.start.getTime() <= task.start.getTime() && !!task.comparisonDates.end && task.comparisonDates.end.getTime() <= task.start.getTime(),
|
|
13213
|
+
isWarning: !!task.comparisonDates.end && task.comparisonDates.end.getTime() >= task.end.getTime(),
|
|
13214
|
+
isCritical: task.comparisonDates.start.getTime() > task.start.getTime(),
|
|
13215
|
+
barCornerRadius: distances.barCornerRadius,
|
|
13216
|
+
height: safeComparisonHeight,
|
|
13217
|
+
width: safeComparisonWidth,
|
|
13218
|
+
borderHeight: distances.barComparisonTaskBorderHeight,
|
|
13219
|
+
yOffset: distances.barComparisonTaskYOffset,
|
|
13220
|
+
task,
|
|
13221
|
+
onTooltipTask
|
|
13222
|
+
}
|
|
13223
|
+
)
|
|
13224
|
+
},
|
|
13225
|
+
key2 + "_comparison"
|
|
13226
|
+
)
|
|
13227
|
+
);
|
|
13228
|
+
}
|
|
13222
13229
|
}
|
|
13223
13230
|
const addedDependenciesAtLevel = addedDependencies[comparisonLevel] || {};
|
|
13224
13231
|
if (!addedDependencies[comparisonLevel]) {
|
|
@@ -13877,11 +13884,12 @@
|
|
|
13877
13884
|
);
|
|
13878
13885
|
cx1 = isNaN(cx1) || !isFinite(cx1) ? x1 : cx1;
|
|
13879
13886
|
cx2 = isNaN(cx2) || !isFinite(cx2) ? x2 : cx2;
|
|
13887
|
+
const comparisonWidth = Math.max(Math.abs(cx2 - cx1), 3);
|
|
13888
|
+
const comparisonX = Math.min(cx1, cx2);
|
|
13880
13889
|
comparisonDates = {
|
|
13881
|
-
x:
|
|
13890
|
+
x: comparisonX,
|
|
13882
13891
|
y: y + taskHeight,
|
|
13883
|
-
width:
|
|
13884
|
-
// Ensure minimum width of 1px for visibility
|
|
13892
|
+
width: comparisonWidth,
|
|
13885
13893
|
height: barComparisonTaskHeight
|
|
13886
13894
|
};
|
|
13887
13895
|
}
|
package/package.json
CHANGED