gantt-lib 0.137.0 → 0.139.0
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/README.md +19 -0
- package/dist/core/scheduling/index.d.mts +1 -1
- package/dist/core/scheduling/index.d.ts +1 -1
- package/dist/core/scheduling/index.js +40 -3
- package/dist/core/scheduling/index.js.map +1 -1
- package/dist/core/scheduling/index.mjs +40 -3
- package/dist/core/scheduling/index.mjs.map +1 -1
- package/dist/{index-DheG4h0O.d.mts → index-BfFHn43h.d.mts} +16 -1
- package/dist/{index-DheG4h0O.d.ts → index-BfFHn43h.d.ts} +16 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.js +1066 -939
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +659 -533
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -562,3 +562,22 @@ MIT
|
|
|
562
562
|
## GitHub
|
|
563
563
|
|
|
564
564
|
[https://github.com/simon100500/gantt-lib](https://github.com/simon100500/gantt-lib)
|
|
565
|
+
|
|
566
|
+
### Explicit activity dependencies
|
|
567
|
+
|
|
568
|
+
`activityDependencies` defines the visual activity graph using host task IDs and activity IDs (activity IDs may repeat in different hosts). It uses the same native dependency renderer as ordinary Gantt tasks. Supplying a graph, including an empty array, replaces inferred links between consecutive activities. It does not change the scheduling policy; the host owns the activity dates.
|
|
569
|
+
|
|
570
|
+
```tsx
|
|
571
|
+
<GanttChart
|
|
572
|
+
tasks={floorRows}
|
|
573
|
+
activityDependencies={[{
|
|
574
|
+
predecessorTaskId: 'floor-1', predecessorActivityId: 'walls',
|
|
575
|
+
successorTaskId: 'floor-2', successorActivityId: 'walls',
|
|
576
|
+
type: 'FS', lag: 0,
|
|
577
|
+
}]}
|
|
578
|
+
showActivityLinks
|
|
579
|
+
showActivityLag
|
|
580
|
+
/>
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
All four dependency types (`FS`, `SS`, `FF`, `SF`), signed lags, cross-row links, packed lanes and filtered/virtualized rows are supported. `showActivityLinks={false}` hides the graph; `showActivityLag={false}` hides its lag labels.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { am as CascadeContext, C as CriticalPathOptions, D as DAY_MS, h as DependencyError, L as LinkType, p as ScaleTaskSubtreeAnchor, q as ScaleTaskSubtreeErrorCode, r as ScaleTaskSubtreeExternalPolicy, s as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, t as ScaleTaskSubtreeWarning, an as ScheduleCommandOptions, ao as ScheduleCommandResult, ap as ScheduleDependency, aq as ScheduleTask, ar as ScheduleTaskUpdate, T as Task, as as TaskDependency, V as ValidationResult, at as addBusinessDays, w as alignToWorkingDay, x as areTasksHierarchicallyRelated, y as buildAdjacencyList, z as buildTaskRangeFromEnd, E as buildTaskRangeFromStart, F as calculateSuccessorDate, H as cascadeByLinks, au as cascadeTaskProgress, I as clampTaskRangeForIncomingFS, J as computeCriticalPath, K as computeLagFromDates, N as computeParentDates, O as computeParentProgress, av as createCascadeContext, P as detectCycles, Q as extendCriticalIdsToParents, U as findParentId, X as getAllDependencyEdges, Y as getAllDescendants, Z as getBusinessDayOffset, aw as getBusinessDaysCount, _ as getChildren, $ as getDependencyLag, a0 as getSuccessorChain, a1 as getTaskDuration, a2 as getTransitiveCascadeChain, a3 as isAncestorTask, a4 as isTaskParent, a5 as moveTaskRange, a6 as moveTaskWithCascade, a7 as normalizeDependencyLag, a8 as normalizePredecessorDates, a9 as normalizeTaskDependencyLags, aa as normalizeUTCDate, ab as parseDateOnly, ac as recalculateIncomingLags, ad as recalculateProjectSchedule, ae as recalculateTaskFromDependencies, af as reflowTasksOnModeSwitch, ag as removeDependenciesBetweenTasks, ah as resizeTaskWithCascade, ai as scaleTaskSubtreeDuration, aj as shiftBusinessDayOffset, ax as subtractBusinessDays, ak as universalCascade, al as validateDependencies } from '../../index-BfFHn43h.mjs';
|
|
2
2
|
import 'react';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { am as CascadeContext, C as CriticalPathOptions, D as DAY_MS, h as DependencyError, L as LinkType, p as ScaleTaskSubtreeAnchor, q as ScaleTaskSubtreeErrorCode, r as ScaleTaskSubtreeExternalPolicy, s as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, t as ScaleTaskSubtreeWarning, an as ScheduleCommandOptions, ao as ScheduleCommandResult, ap as ScheduleDependency, aq as ScheduleTask, ar as ScheduleTaskUpdate, T as Task, as as TaskDependency, V as ValidationResult, at as addBusinessDays, w as alignToWorkingDay, x as areTasksHierarchicallyRelated, y as buildAdjacencyList, z as buildTaskRangeFromEnd, E as buildTaskRangeFromStart, F as calculateSuccessorDate, H as cascadeByLinks, au as cascadeTaskProgress, I as clampTaskRangeForIncomingFS, J as computeCriticalPath, K as computeLagFromDates, N as computeParentDates, O as computeParentProgress, av as createCascadeContext, P as detectCycles, Q as extendCriticalIdsToParents, U as findParentId, X as getAllDependencyEdges, Y as getAllDescendants, Z as getBusinessDayOffset, aw as getBusinessDaysCount, _ as getChildren, $ as getDependencyLag, a0 as getSuccessorChain, a1 as getTaskDuration, a2 as getTransitiveCascadeChain, a3 as isAncestorTask, a4 as isTaskParent, a5 as moveTaskRange, a6 as moveTaskWithCascade, a7 as normalizeDependencyLag, a8 as normalizePredecessorDates, a9 as normalizeTaskDependencyLags, aa as normalizeUTCDate, ab as parseDateOnly, ac as recalculateIncomingLags, ad as recalculateProjectSchedule, ae as recalculateTaskFromDependencies, af as reflowTasksOnModeSwitch, ag as removeDependenciesBetweenTasks, ah as resizeTaskWithCascade, ai as scaleTaskSubtreeDuration, aj as shiftBusinessDayOffset, ax as subtractBusinessDays, ak as universalCascade, al as validateDependencies } from '../../index-BfFHn43h.js';
|
|
2
2
|
import 'react';
|
|
@@ -550,6 +550,29 @@ function parseCascadeDateInput(date) {
|
|
|
550
550
|
}
|
|
551
551
|
return normalizeUTCDate(/* @__PURE__ */ new Date(`${date.split("T")[0]}T00:00:00.000Z`));
|
|
552
552
|
}
|
|
553
|
+
function projectDayDelta(from, to, businessDays, weekendPredicate) {
|
|
554
|
+
if (businessDays && weekendPredicate) {
|
|
555
|
+
return getBusinessDayOffset(from, to, weekendPredicate);
|
|
556
|
+
}
|
|
557
|
+
return Math.round((to.getTime() - from.getTime()) / DAY_MS);
|
|
558
|
+
}
|
|
559
|
+
function shiftTaskActivities(activities, dayDelta, businessDays, weekendPredicate) {
|
|
560
|
+
if (!activities || activities.length === 0 || dayDelta === 0) return void 0;
|
|
561
|
+
const shiftDate = (value) => {
|
|
562
|
+
const base = parseDateOnly(value);
|
|
563
|
+
const shifted = businessDays && weekendPredicate ? shiftBusinessDayOffset(base, dayDelta, weekendPredicate) : new Date(base.getTime() + dayDelta * DAY_MS);
|
|
564
|
+
return typeof value === "string" ? shifted.toISOString().slice(0, 10) : shifted;
|
|
565
|
+
};
|
|
566
|
+
return activities.map((activity) => ({
|
|
567
|
+
...activity,
|
|
568
|
+
startDate: shiftDate(activity.startDate),
|
|
569
|
+
endDate: shiftDate(activity.endDate)
|
|
570
|
+
}));
|
|
571
|
+
}
|
|
572
|
+
function shiftedActivitiesPatch(activities, dayDelta, businessDays, weekendPredicate) {
|
|
573
|
+
const shifted = shiftTaskActivities(activities, dayDelta, businessDays, weekendPredicate);
|
|
574
|
+
return shifted ? { activities: shifted } : {};
|
|
575
|
+
}
|
|
553
576
|
function createCascadeContext(allTasks) {
|
|
554
577
|
const childrenByParentId = /* @__PURE__ */ new Map();
|
|
555
578
|
const dependentsByPredecessorId = /* @__PURE__ */ new Map();
|
|
@@ -625,7 +648,8 @@ function cascadeByLinks(movedTaskId, newStart, newEnd, allTasks, skipChildCascad
|
|
|
625
648
|
result.push(normalizeTaskDependencyLags({
|
|
626
649
|
...child,
|
|
627
650
|
startDate: newChildStart.toISOString().split("T")[0],
|
|
628
|
-
endDate: newChildEnd.toISOString().split("T")[0]
|
|
651
|
+
endDate: newChildEnd.toISOString().split("T")[0],
|
|
652
|
+
...shiftedActivitiesPatch(child.activities, Math.round(parentStartDelta / DAY_MS), false)
|
|
629
653
|
}));
|
|
630
654
|
queue.push(child.id);
|
|
631
655
|
}
|
|
@@ -769,7 +793,14 @@ function universalCascade(movedTask, newStart, newEnd, allTasks, businessDays =
|
|
|
769
793
|
resultMap.set(child.id, normalizeTaskDependencyLags({
|
|
770
794
|
...child,
|
|
771
795
|
startDate: childNewStart.toISOString().split("T")[0],
|
|
772
|
-
endDate: childNewEnd.toISOString().split("T")[0]
|
|
796
|
+
endDate: childNewEnd.toISOString().split("T")[0],
|
|
797
|
+
// Дети едут параллельно: вместе с датами строки сдвигаются и её работы.
|
|
798
|
+
...shiftedActivitiesPatch(
|
|
799
|
+
child.activities,
|
|
800
|
+
projectDayDelta(childOrigStart, childNewStart, businessDays, weekendPredicate),
|
|
801
|
+
businessDays,
|
|
802
|
+
weekendPredicate
|
|
803
|
+
)
|
|
773
804
|
}));
|
|
774
805
|
}
|
|
775
806
|
}
|
|
@@ -848,7 +879,13 @@ function universalCascade(movedTask, newStart, newEnd, allTasks, businessDays =
|
|
|
848
879
|
resultMap.set(task.id, normalizeTaskDependencyLags({
|
|
849
880
|
...task,
|
|
850
881
|
startDate: succNewStart.toISOString().split("T")[0],
|
|
851
|
-
endDate: succNewEnd.toISOString().split("T")[0]
|
|
882
|
+
endDate: succNewEnd.toISOString().split("T")[0],
|
|
883
|
+
...shiftedActivitiesPatch(
|
|
884
|
+
task.activities,
|
|
885
|
+
projectDayDelta(origStart, succNewStart, businessDays, weekendPredicate),
|
|
886
|
+
businessDays,
|
|
887
|
+
weekendPredicate
|
|
888
|
+
)
|
|
852
889
|
}));
|
|
853
890
|
}
|
|
854
891
|
}
|