gantt-task-react-v 1.3.5 → 1.3.6

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.
@@ -13115,8 +13115,41 @@ const TaskGanttContentInner = (props) => {
13115
13115
  const safeProgressWidth = isNaN(progressWidth) || !isFinite(progressWidth) ? 0 : Math.max(progressWidth, 0);
13116
13116
  const safeInnerX1 = isNaN(innerX1) || !isFinite(innerX1) ? 0 : innerX1;
13117
13117
  const safeInnerX2 = isNaN(innerX2) || !isFinite(innerX2) ? safeInnerX1 + safeWidth : innerX2;
13118
+ let comparisonBarElement = null;
13119
+ if (task.comparisonDates && comparisonDates) {
13120
+ const safeComparisonX = isNaN(comparisonDates.x) || !isFinite(comparisonDates.x) ? 0 : comparisonDates.x;
13121
+ const safeComparisonWidth = isNaN(comparisonDates.width) || !isFinite(comparisonDates.width) ? 10 : Math.max(comparisonDates.width, 3);
13122
+ const safeComparisonHeight = isNaN(comparisonDates.height) || !isFinite(comparisonDates.height) ? 6 : Math.max(comparisonDates.height, 3);
13123
+ const comparisonRight = safeComparisonX + safeComparisonWidth;
13124
+ const isVisible = comparisonRight >= 0 && safeComparisonX <= 1e4;
13125
+ if (isVisible) {
13126
+ const relativeComparisonX = safeComparisonX - safeContainerX;
13127
+ comparisonBarElement = /* @__PURE__ */ jsx(
13128
+ "g",
13129
+ {
13130
+ transform: `translate(${relativeComparisonX}, ${taskHeight + 2})`,
13131
+ children: /* @__PURE__ */ jsx(
13132
+ BarComparison,
13133
+ {
13134
+ inProgress: !task.comparisonDates.end,
13135
+ 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(),
13136
+ isWarning: !!task.comparisonDates.end && task.comparisonDates.end.getTime() >= task.end.getTime(),
13137
+ isCritical: task.comparisonDates.start.getTime() > task.start.getTime(),
13138
+ barCornerRadius: distances.barCornerRadius,
13139
+ height: safeComparisonHeight,
13140
+ width: safeComparisonWidth,
13141
+ borderHeight: distances.barComparisonTaskBorderHeight,
13142
+ yOffset: 0,
13143
+ task,
13144
+ onTooltipTask
13145
+ }
13146
+ )
13147
+ }
13148
+ );
13149
+ }
13150
+ }
13118
13151
  tasksRes.push(
13119
- /* @__PURE__ */ jsx(
13152
+ /* @__PURE__ */ jsxs(
13120
13153
  "svg",
13121
13154
  {
13122
13155
  id: task.id,
@@ -13125,91 +13158,51 @@ const TaskGanttContentInner = (props) => {
13125
13158
  y: safeLevelY,
13126
13159
  width: Math.max(safeContainerWidth, 0),
13127
13160
  height: fullRowHeight,
13128
- children: /* @__PURE__ */ jsx(
13129
- TaskItem,
13130
- {
13131
- movingAction: taskBarMovingAction(task),
13132
- allowMoveTaskBar,
13133
- hasChildren: checkHasChildren(task, childTasksMap),
13134
- progressWidth: safeProgressWidth,
13135
- progressX: rtl ? safeInnerX2 : safeInnerX1,
13136
- onSelectTaskOnMouseDown: selectTaskOnMouseDown,
13137
- task,
13138
- taskYOffset,
13139
- width: safeWidth,
13140
- x1: safeInnerX1,
13141
- x2: safeInnerX2,
13142
- distances,
13143
- taskHeight,
13144
- taskHalfHeight,
13145
- isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks,
13146
- isDateChangeable: (t) => isDateChangeable(t) && !waitCommitTasks,
13147
- isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks,
13148
- authorizedRelations,
13149
- ganttRelationEvent,
13150
- canDelete: !task.isDisabled && !waitCommitTasks,
13151
- onDoubleClick,
13152
- onClick,
13153
- onEventStart: onTaskBarDragStart,
13154
- onTooltipTask,
13155
- onRelationStart: onTaskBarRelationStart,
13156
- isSelected: Boolean(selectedIdsMirror[taskId]),
13157
- isCritical,
13158
- rtl,
13159
- onDeleteTask,
13160
- renderCustomLabel,
13161
- viewMode,
13162
- showProgress,
13163
- progressColor
13164
- }
13165
- )
13161
+ children: [
13162
+ /* @__PURE__ */ jsx(
13163
+ TaskItem,
13164
+ {
13165
+ movingAction: taskBarMovingAction(task),
13166
+ allowMoveTaskBar,
13167
+ hasChildren: checkHasChildren(task, childTasksMap),
13168
+ progressWidth: safeProgressWidth,
13169
+ progressX: rtl ? safeInnerX2 : safeInnerX1,
13170
+ onSelectTaskOnMouseDown: selectTaskOnMouseDown,
13171
+ task,
13172
+ taskYOffset,
13173
+ width: safeWidth,
13174
+ x1: safeInnerX1,
13175
+ x2: safeInnerX2,
13176
+ distances,
13177
+ taskHeight,
13178
+ taskHalfHeight,
13179
+ isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks,
13180
+ isDateChangeable: (t) => isDateChangeable(t) && !waitCommitTasks,
13181
+ isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks,
13182
+ authorizedRelations,
13183
+ ganttRelationEvent,
13184
+ canDelete: !task.isDisabled && !waitCommitTasks,
13185
+ onDoubleClick,
13186
+ onClick,
13187
+ onEventStart: onTaskBarDragStart,
13188
+ onTooltipTask,
13189
+ onRelationStart: onTaskBarRelationStart,
13190
+ isSelected: Boolean(selectedIdsMirror[taskId]),
13191
+ isCritical,
13192
+ rtl,
13193
+ onDeleteTask,
13194
+ renderCustomLabel,
13195
+ viewMode,
13196
+ showProgress,
13197
+ progressColor
13198
+ }
13199
+ ),
13200
+ comparisonBarElement
13201
+ ]
13166
13202
  },
13167
13203
  key2
13168
13204
  )
13169
13205
  );
13170
- if (task.comparisonDates && comparisonDates) {
13171
- console.log(`Comparison bar for task ${task.id}:`, {
13172
- originalCoords: comparisonDates,
13173
- taskComparisonDates: task.comparisonDates
13174
- });
13175
- const safeComparisonX = isNaN(comparisonDates.x) || !isFinite(comparisonDates.x) ? 0 : comparisonDates.x;
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
- }
13212
- }
13213
13206
  const addedDependenciesAtLevel = addedDependencies[comparisonLevel] || {};
13214
13207
  if (!addedDependencies[comparisonLevel]) {
13215
13208
  addedDependencies[comparisonLevel] = addedDependenciesAtLevel;
@@ -13132,8 +13132,41 @@
13132
13132
  const safeProgressWidth = isNaN(progressWidth) || !isFinite(progressWidth) ? 0 : Math.max(progressWidth, 0);
13133
13133
  const safeInnerX1 = isNaN(innerX1) || !isFinite(innerX1) ? 0 : innerX1;
13134
13134
  const safeInnerX2 = isNaN(innerX2) || !isFinite(innerX2) ? safeInnerX1 + safeWidth : innerX2;
13135
+ let comparisonBarElement = null;
13136
+ if (task.comparisonDates && comparisonDates) {
13137
+ const safeComparisonX = isNaN(comparisonDates.x) || !isFinite(comparisonDates.x) ? 0 : comparisonDates.x;
13138
+ const safeComparisonWidth = isNaN(comparisonDates.width) || !isFinite(comparisonDates.width) ? 10 : Math.max(comparisonDates.width, 3);
13139
+ const safeComparisonHeight = isNaN(comparisonDates.height) || !isFinite(comparisonDates.height) ? 6 : Math.max(comparisonDates.height, 3);
13140
+ const comparisonRight = safeComparisonX + safeComparisonWidth;
13141
+ const isVisible = comparisonRight >= 0 && safeComparisonX <= 1e4;
13142
+ if (isVisible) {
13143
+ const relativeComparisonX = safeComparisonX - safeContainerX;
13144
+ comparisonBarElement = /* @__PURE__ */ jsxRuntime.jsx(
13145
+ "g",
13146
+ {
13147
+ transform: `translate(${relativeComparisonX}, ${taskHeight + 2})`,
13148
+ children: /* @__PURE__ */ jsxRuntime.jsx(
13149
+ BarComparison,
13150
+ {
13151
+ inProgress: !task.comparisonDates.end,
13152
+ 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(),
13153
+ isWarning: !!task.comparisonDates.end && task.comparisonDates.end.getTime() >= task.end.getTime(),
13154
+ isCritical: task.comparisonDates.start.getTime() > task.start.getTime(),
13155
+ barCornerRadius: distances.barCornerRadius,
13156
+ height: safeComparisonHeight,
13157
+ width: safeComparisonWidth,
13158
+ borderHeight: distances.barComparisonTaskBorderHeight,
13159
+ yOffset: 0,
13160
+ task,
13161
+ onTooltipTask
13162
+ }
13163
+ )
13164
+ }
13165
+ );
13166
+ }
13167
+ }
13135
13168
  tasksRes.push(
13136
- /* @__PURE__ */ jsxRuntime.jsx(
13169
+ /* @__PURE__ */ jsxRuntime.jsxs(
13137
13170
  "svg",
13138
13171
  {
13139
13172
  id: task.id,
@@ -13142,91 +13175,51 @@
13142
13175
  y: safeLevelY,
13143
13176
  width: Math.max(safeContainerWidth, 0),
13144
13177
  height: fullRowHeight,
13145
- children: /* @__PURE__ */ jsxRuntime.jsx(
13146
- TaskItem,
13147
- {
13148
- movingAction: taskBarMovingAction(task),
13149
- allowMoveTaskBar,
13150
- hasChildren: checkHasChildren(task, childTasksMap),
13151
- progressWidth: safeProgressWidth,
13152
- progressX: rtl ? safeInnerX2 : safeInnerX1,
13153
- onSelectTaskOnMouseDown: selectTaskOnMouseDown,
13154
- task,
13155
- taskYOffset,
13156
- width: safeWidth,
13157
- x1: safeInnerX1,
13158
- x2: safeInnerX2,
13159
- distances,
13160
- taskHeight,
13161
- taskHalfHeight,
13162
- isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks,
13163
- isDateChangeable: (t) => isDateChangeable(t) && !waitCommitTasks,
13164
- isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks,
13165
- authorizedRelations,
13166
- ganttRelationEvent,
13167
- canDelete: !task.isDisabled && !waitCommitTasks,
13168
- onDoubleClick,
13169
- onClick,
13170
- onEventStart: onTaskBarDragStart,
13171
- onTooltipTask,
13172
- onRelationStart: onTaskBarRelationStart,
13173
- isSelected: Boolean(selectedIdsMirror[taskId]),
13174
- isCritical,
13175
- rtl,
13176
- onDeleteTask,
13177
- renderCustomLabel,
13178
- viewMode,
13179
- showProgress,
13180
- progressColor
13181
- }
13182
- )
13178
+ children: [
13179
+ /* @__PURE__ */ jsxRuntime.jsx(
13180
+ TaskItem,
13181
+ {
13182
+ movingAction: taskBarMovingAction(task),
13183
+ allowMoveTaskBar,
13184
+ hasChildren: checkHasChildren(task, childTasksMap),
13185
+ progressWidth: safeProgressWidth,
13186
+ progressX: rtl ? safeInnerX2 : safeInnerX1,
13187
+ onSelectTaskOnMouseDown: selectTaskOnMouseDown,
13188
+ task,
13189
+ taskYOffset,
13190
+ width: safeWidth,
13191
+ x1: safeInnerX1,
13192
+ x2: safeInnerX2,
13193
+ distances,
13194
+ taskHeight,
13195
+ taskHalfHeight,
13196
+ isProgressChangeable: (t) => isProgressChangeable(t) && !waitCommitTasks,
13197
+ isDateChangeable: (t) => isDateChangeable(t) && !waitCommitTasks,
13198
+ isRelationChangeable: (t) => isRelationChangeable(t) && !waitCommitTasks,
13199
+ authorizedRelations,
13200
+ ganttRelationEvent,
13201
+ canDelete: !task.isDisabled && !waitCommitTasks,
13202
+ onDoubleClick,
13203
+ onClick,
13204
+ onEventStart: onTaskBarDragStart,
13205
+ onTooltipTask,
13206
+ onRelationStart: onTaskBarRelationStart,
13207
+ isSelected: Boolean(selectedIdsMirror[taskId]),
13208
+ isCritical,
13209
+ rtl,
13210
+ onDeleteTask,
13211
+ renderCustomLabel,
13212
+ viewMode,
13213
+ showProgress,
13214
+ progressColor
13215
+ }
13216
+ ),
13217
+ comparisonBarElement
13218
+ ]
13183
13219
  },
13184
13220
  key2
13185
13221
  )
13186
13222
  );
13187
- if (task.comparisonDates && comparisonDates) {
13188
- console.log(`Comparison bar for task ${task.id}:`, {
13189
- originalCoords: comparisonDates,
13190
- taskComparisonDates: task.comparisonDates
13191
- });
13192
- const safeComparisonX = isNaN(comparisonDates.x) || !isFinite(comparisonDates.x) ? 0 : comparisonDates.x;
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
- }
13229
- }
13230
13223
  const addedDependenciesAtLevel = addedDependencies[comparisonLevel] || {};
13231
13224
  if (!addedDependencies[comparisonLevel]) {
13232
13225
  addedDependencies[comparisonLevel] = addedDependenciesAtLevel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Interactive Gantt Chart for React with TypeScript.",
5
5
  "author": "aguilanbon",
6
6
  "homepage": "https://github.com/aguilanbon/gantt-task-react-v",