gantt-lib 0.142.1 → 0.142.2

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.mjs CHANGED
@@ -5958,10 +5958,11 @@ function areBothHiddenInSameParent(predecessorId, successorId, collapsedParentId
5958
5958
  if (!predVisibleAncestor || !succVisibleAncestor) return false;
5959
5959
  return predVisibleAncestor.id === succVisibleAncestor.id;
5960
5960
  }
5961
+ var EMPTY_COLLAPSED_PARENT_IDS = /* @__PURE__ */ new Set();
5961
5962
  var DependencyLines = React6.memo(({
5962
5963
  tasks,
5963
5964
  allTasks,
5964
- collapsedParentIds = /* @__PURE__ */ new Set(),
5965
+ collapsedParentIds = EMPTY_COLLAPSED_PARENT_IDS,
5965
5966
  monthStart,
5966
5967
  dayWidth,
5967
5968
  rowHeight,
@@ -6342,10 +6343,12 @@ function ActivityDependencyLines(props) {
6342
6343
  const layout = useMemo7(() => {
6343
6344
  const flattened = [], rendered = [], tops = [], heights = [];
6344
6345
  const indices = /* @__PURE__ */ new Map();
6346
+ const neededRows = /* @__PURE__ */ new Set();
6345
6347
  const incoming = /* @__PURE__ */ new Map();
6346
6348
  const selected = props.highlight ? new Set(props.highlight.activities.map((activity) => activityKey(activity.taskId, activity.activityId))) : void 0;
6347
6349
  const highlightMode = props.highlight?.mode ?? "chain";
6348
6350
  for (const edge of dependencies) {
6351
+ if (!props.renderedTaskIds.has(edge.predecessorTaskId) && !props.renderedTaskIds.has(edge.successorTaskId)) continue;
6349
6352
  if (selected) {
6350
6353
  const fromSelected = selected.has(activityKey(edge.predecessorTaskId, edge.predecessorActivityId));
6351
6354
  const toSelected = selected.has(activityKey(edge.successorTaskId, edge.successorActivityId));
@@ -6354,12 +6357,15 @@ function ActivityDependencyLines(props) {
6354
6357
  const outgoing = fromSelected && !toSelected && (highlightMode === "chain-outgoing" || highlightMode === "chain-all");
6355
6358
  if (!internal && !incoming2 && !outgoing) continue;
6356
6359
  }
6360
+ neededRows.add(edge.predecessorTaskId);
6361
+ neededRows.add(edge.successorTaskId);
6357
6362
  const id = activityKey(edge.successorTaskId, edge.successorActivityId);
6358
6363
  const values = incoming.get(id) ?? [];
6359
6364
  values.push({ taskId: activityKey(edge.predecessorTaskId, edge.predecessorActivityId), type: edge.type, lag: edge.lag });
6360
6365
  incoming.set(id, values);
6361
6366
  }
6362
6367
  for (const task of tasks) {
6368
+ if (!neededRows.has(task.id)) continue;
6363
6369
  const row = props.rowIndexByTaskId.get(task.id);
6364
6370
  if (row === void 0 || !task.activities?.length) continue;
6365
6371
  const height = props.rowHeights[row] ?? props.rowHeight;