gantt-lib 0.124.2 → 0.126.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/dist/core/scheduling/index.d.mts +1 -1
- package/dist/core/scheduling/index.d.ts +1 -1
- package/dist/core/scheduling/index.js +30 -19
- package/dist/core/scheduling/index.js.map +1 -1
- package/dist/core/scheduling/index.mjs +30 -19
- package/dist/core/scheduling/index.mjs.map +1 -1
- package/dist/{index-DD3YvhvA.d.mts → index-B1yy4LX0.d.mts} +15 -10
- package/dist/{index-DD3YvhvA.d.ts → index-B1yy4LX0.d.ts} +15 -10
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +64 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -32
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -27
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { aa as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, ab as ScheduleCommandOptions, ac as ScheduleCommandResult, ad as ScheduleDependency, ae as ScheduleTask, af as ScheduleTaskUpdate, T as Task, ag as TaskDependency, V as ValidationResult, ah as addBusinessDays, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, ai as createCascadeContext, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, aj as getBusinessDaysCount, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, ak as subtractBusinessDays, a8 as universalCascade, a9 as validateDependencies } from '../../index-
|
|
1
|
+
export { aa as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, ab as ScheduleCommandOptions, ac as ScheduleCommandResult, ad as ScheduleDependency, ae as ScheduleTask, af as ScheduleTaskUpdate, T as Task, ag as TaskDependency, V as ValidationResult, ah as addBusinessDays, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, ai as createCascadeContext, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, aj as getBusinessDaysCount, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, ak as subtractBusinessDays, a8 as universalCascade, a9 as validateDependencies } from '../../index-B1yy4LX0.mjs';
|
|
2
2
|
import 'react';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { aa as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, ab as ScheduleCommandOptions, ac as ScheduleCommandResult, ad as ScheduleDependency, ae as ScheduleTask, af as ScheduleTaskUpdate, T as Task, ag as TaskDependency, V as ValidationResult, ah as addBusinessDays, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, ai as createCascadeContext, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, aj as getBusinessDaysCount, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, ak as subtractBusinessDays, a8 as universalCascade, a9 as validateDependencies } from '../../index-
|
|
1
|
+
export { aa as CascadeContext, C as CriticalPathOptions, D as DAY_MS, e as DependencyError, L as LinkType, ab as ScheduleCommandOptions, ac as ScheduleCommandResult, ad as ScheduleDependency, ae as ScheduleTask, af as ScheduleTaskUpdate, T as Task, ag as TaskDependency, V as ValidationResult, ah as addBusinessDays, n as alignToWorkingDay, o as areTasksHierarchicallyRelated, p as buildAdjacencyList, q as buildTaskRangeFromEnd, r as buildTaskRangeFromStart, s as calculateSuccessorDate, t as cascadeByLinks, u as clampTaskRangeForIncomingFS, v as computeCriticalPath, w as computeLagFromDates, x as computeParentDates, y as computeParentProgress, ai as createCascadeContext, z as detectCycles, A as extendCriticalIdsToParents, E as findParentId, F as getAllDependencyEdges, H as getAllDescendants, I as getBusinessDayOffset, aj as getBusinessDaysCount, J as getChildren, K as getDependencyLag, N as getSuccessorChain, O as getTaskDuration, P as getTransitiveCascadeChain, Q as isAncestorTask, S as isTaskParent, U as moveTaskRange, X as moveTaskWithCascade, Y as normalizeDependencyLag, Z as normalizePredecessorDates, _ as normalizeTaskDependencyLags, $ as normalizeUTCDate, a0 as parseDateOnly, a1 as recalculateIncomingLags, a2 as recalculateProjectSchedule, a3 as recalculateTaskFromDependencies, a4 as reflowTasksOnModeSwitch, a5 as removeDependenciesBetweenTasks, a6 as resizeTaskWithCascade, a7 as shiftBusinessDayOffset, ak as subtractBusinessDays, a8 as universalCascade, a9 as validateDependencies } from '../../index-B1yy4LX0.js';
|
|
2
2
|
import 'react';
|
|
@@ -172,8 +172,7 @@ function getTaskDuration(startDate, endDate, businessDays = false, weekendPredic
|
|
|
172
172
|
// src/core/scheduling/dependencies.ts
|
|
173
173
|
function normalizePredecessorDates(predecessor, parseDateFn) {
|
|
174
174
|
const predStart = parseDateFn(predecessor.startDate);
|
|
175
|
-
const
|
|
176
|
-
const predEnd = isMilestone ? new Date(predStart.getTime() - DAY_MS) : parseDateFn(predecessor.endDate);
|
|
175
|
+
const predEnd = predecessor.type === "milestone" ? predStart : parseDateFn(predecessor.endDate);
|
|
177
176
|
return { predStart, predEnd };
|
|
178
177
|
}
|
|
179
178
|
function getDependencyLag(dep) {
|
|
@@ -182,7 +181,7 @@ function getDependencyLag(dep) {
|
|
|
182
181
|
function normalizeTaskDependencyLags(task) {
|
|
183
182
|
return task;
|
|
184
183
|
}
|
|
185
|
-
function normalizeDependencyLag(linkType, lag, predecessorStart, predecessorEnd, businessDays = false, weekendPredicate) {
|
|
184
|
+
function normalizeDependencyLag(linkType, lag, predecessorStart, predecessorEnd, businessDays = false, weekendPredicate, successorType) {
|
|
186
185
|
if (linkType !== "FS") {
|
|
187
186
|
return lag;
|
|
188
187
|
}
|
|
@@ -192,9 +191,10 @@ function normalizeDependencyLag(linkType, lag, predecessorStart, predecessorEnd,
|
|
|
192
191
|
businessDays,
|
|
193
192
|
weekendPredicate
|
|
194
193
|
);
|
|
195
|
-
|
|
194
|
+
const minimumLag = successorType === "milestone" ? -Math.max(0, predecessorDuration - 1) : -predecessorDuration;
|
|
195
|
+
return Math.max(minimumLag, lag);
|
|
196
196
|
}
|
|
197
|
-
function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, businessDays = false, weekendPredicate) {
|
|
197
|
+
function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, businessDays = false, weekendPredicate, successorType) {
|
|
198
198
|
const pS = Date.UTC(predStart.getUTCFullYear(), predStart.getUTCMonth(), predStart.getUTCDate());
|
|
199
199
|
const pE = Date.UTC(predEnd.getUTCFullYear(), predEnd.getUTCMonth(), predEnd.getUTCDate());
|
|
200
200
|
const sS = Date.UTC(succStart.getUTCFullYear(), succStart.getUTCMonth(), succStart.getUTCDate());
|
|
@@ -204,11 +204,12 @@ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, b
|
|
|
204
204
|
case "FS":
|
|
205
205
|
return normalizeDependencyLag(
|
|
206
206
|
linkType,
|
|
207
|
-
Math.round((sS - pE) / DAY_MS) - 1,
|
|
207
|
+
Math.round((sS - pE) / DAY_MS) - (successorType === "milestone" ? 0 : 1),
|
|
208
208
|
predStart,
|
|
209
209
|
predEnd,
|
|
210
210
|
businessDays,
|
|
211
|
-
weekendPredicate
|
|
211
|
+
weekendPredicate,
|
|
212
|
+
successorType
|
|
212
213
|
);
|
|
213
214
|
case "SS":
|
|
214
215
|
return Math.round((sS - pS) / DAY_MS);
|
|
@@ -225,11 +226,12 @@ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, b
|
|
|
225
226
|
case "FS":
|
|
226
227
|
return normalizeDependencyLag(
|
|
227
228
|
linkType,
|
|
228
|
-
businessOffset - 1,
|
|
229
|
+
businessOffset - (successorType === "milestone" ? 0 : 1),
|
|
229
230
|
predStart,
|
|
230
231
|
predEnd,
|
|
231
232
|
businessDays,
|
|
232
|
-
weekendPredicate
|
|
233
|
+
weekendPredicate,
|
|
234
|
+
successorType
|
|
233
235
|
);
|
|
234
236
|
case "SS":
|
|
235
237
|
return businessOffset;
|
|
@@ -239,19 +241,20 @@ function computeLagFromDates(linkType, predStart, predEnd, succStart, succEnd, b
|
|
|
239
241
|
return businessOffset + 1;
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
|
-
function calculateSuccessorDate(predecessorStart, predecessorEnd, linkType, lag = 0, businessDays = false, weekendPredicate) {
|
|
244
|
+
function calculateSuccessorDate(predecessorStart, predecessorEnd, linkType, lag = 0, businessDays = false, weekendPredicate, successorType) {
|
|
243
245
|
const normalizedLag = normalizeDependencyLag(
|
|
244
246
|
linkType,
|
|
245
247
|
lag,
|
|
246
248
|
predecessorStart,
|
|
247
249
|
predecessorEnd,
|
|
248
250
|
businessDays,
|
|
249
|
-
weekendPredicate
|
|
251
|
+
weekendPredicate,
|
|
252
|
+
successorType
|
|
250
253
|
);
|
|
251
254
|
if (!businessDays || !weekendPredicate) {
|
|
252
255
|
switch (linkType) {
|
|
253
256
|
case "FS":
|
|
254
|
-
return new Date(predecessorEnd.getTime() + (normalizedLag + 1) * DAY_MS);
|
|
257
|
+
return new Date(predecessorEnd.getTime() + (normalizedLag + (successorType === "milestone" ? 0 : 1)) * DAY_MS);
|
|
255
258
|
case "SS":
|
|
256
259
|
return new Date(predecessorStart.getTime() + normalizedLag * DAY_MS);
|
|
257
260
|
case "FF":
|
|
@@ -264,7 +267,7 @@ function calculateSuccessorDate(predecessorStart, predecessorEnd, linkType, lag
|
|
|
264
267
|
let offset;
|
|
265
268
|
switch (linkType) {
|
|
266
269
|
case "FS":
|
|
267
|
-
offset = normalizedLag + 1;
|
|
270
|
+
offset = normalizedLag + (successorType === "milestone" ? 0 : 1);
|
|
268
271
|
break;
|
|
269
272
|
case "SS":
|
|
270
273
|
offset = normalizedLag;
|
|
@@ -496,7 +499,8 @@ function clampTaskRangeForIncomingFS(task, proposedStart, proposedEnd, allTasks,
|
|
|
496
499
|
"FS",
|
|
497
500
|
-predecessorDuration,
|
|
498
501
|
businessDays,
|
|
499
|
-
weekendPredicate
|
|
502
|
+
weekendPredicate,
|
|
503
|
+
task.type
|
|
500
504
|
);
|
|
501
505
|
if (!minAllowedStart || candidateMinStart.getTime() > minAllowedStart.getTime()) {
|
|
502
506
|
minAllowedStart = candidateMinStart;
|
|
@@ -530,7 +534,8 @@ function recalculateIncomingLags(task, newStartDate, newEndDate, allTasks, busin
|
|
|
530
534
|
newStartDate,
|
|
531
535
|
newEndDate,
|
|
532
536
|
businessDays,
|
|
533
|
-
weekendPredicate
|
|
537
|
+
weekendPredicate,
|
|
538
|
+
task.type
|
|
534
539
|
);
|
|
535
540
|
return { ...dep, lag: nextLag };
|
|
536
541
|
});
|
|
@@ -645,7 +650,10 @@ function cascadeByLinks(movedTaskId, newStart, newEnd, allTasks, skipChildCascad
|
|
|
645
650
|
normalizedPredStart,
|
|
646
651
|
normalizedPredEnd,
|
|
647
652
|
dep.type,
|
|
648
|
-
getDependencyLag(dep)
|
|
653
|
+
getDependencyLag(dep),
|
|
654
|
+
false,
|
|
655
|
+
void 0,
|
|
656
|
+
task.type
|
|
649
657
|
);
|
|
650
658
|
let newSuccStart;
|
|
651
659
|
let newSuccEnd;
|
|
@@ -807,7 +815,8 @@ function universalCascade(movedTask, newStart, newEnd, allTasks, businessDays =
|
|
|
807
815
|
dep.type,
|
|
808
816
|
getDependencyLag(dep),
|
|
809
817
|
businessDays,
|
|
810
|
-
weekendPredicate
|
|
818
|
+
weekendPredicate,
|
|
819
|
+
task.type
|
|
811
820
|
);
|
|
812
821
|
let succNewStart;
|
|
813
822
|
let succNewEnd;
|
|
@@ -1107,7 +1116,8 @@ function recalculateTaskFromDependencies(taskId, snapshot, options) {
|
|
|
1107
1116
|
dep.type,
|
|
1108
1117
|
getDependencyLag(dep),
|
|
1109
1118
|
businessDays,
|
|
1110
|
-
weekendPredicate
|
|
1119
|
+
weekendPredicate,
|
|
1120
|
+
task.type
|
|
1111
1121
|
);
|
|
1112
1122
|
const duration = getTaskDuration(
|
|
1113
1123
|
parseDateOnly(task.startDate),
|
|
@@ -1223,7 +1233,8 @@ function recalculateProjectSchedule(snapshot, options) {
|
|
|
1223
1233
|
dep.type,
|
|
1224
1234
|
getDependencyLag(dep),
|
|
1225
1235
|
businessDays,
|
|
1226
|
-
weekendPredicate
|
|
1236
|
+
weekendPredicate,
|
|
1237
|
+
currentTask.type
|
|
1227
1238
|
);
|
|
1228
1239
|
const candidateRange = dep.type === "FS" || dep.type === "SS" ? buildTaskRangeFromStart(constraintDate, duration, businessDays, weekendPredicate) : buildTaskRangeFromEnd(constraintDate, duration, businessDays, weekendPredicate);
|
|
1229
1240
|
if (!constrainedRange || candidateRange.start.getTime() > constrainedRange.start.getTime() || candidateRange.start.getTime() === constrainedRange.start.getTime() && candidateRange.end.getTime() > constrainedRange.end.getTime()) {
|