gantt-lib 0.53.0 → 0.60.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/index.d.mts +149 -154
- package/dist/index.d.ts +149 -154
- package/dist/index.js +648 -601
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +643 -601
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -213,38 +213,23 @@ declare const normalizeTaskDates: (startDate: string | Date, endDate: string | D
|
|
|
213
213
|
};
|
|
214
214
|
/**
|
|
215
215
|
* Count business days between two dates (inclusive), excluding weekends
|
|
216
|
+
* Delegates to core/scheduling/dateMath for implementation.
|
|
216
217
|
* @param startDate - Start date (string or Date)
|
|
217
218
|
* @param endDate - End date (string or Date)
|
|
218
219
|
* @param weekendPredicate - Function that returns true for weekends
|
|
219
220
|
* @returns Number of business days (minimum 1)
|
|
220
|
-
*
|
|
221
|
-
* Example:
|
|
222
|
-
* getBusinessDaysCount('2026-03-14', '2026-03-17', (d) => d.getUTCDay() === 0 || d.getUTCDay() === 6)
|
|
223
|
-
* // Returns 2 (Fri + Mon, Sat/Sun excluded)
|
|
224
221
|
*/
|
|
225
222
|
declare function getBusinessDaysCount(startDate: string | Date, endDate: string | Date, weekendPredicate: (date: Date) => boolean): number;
|
|
226
223
|
/**
|
|
227
|
-
* Calculate end date by adding business days to start date
|
|
228
|
-
*
|
|
229
|
-
* @param businessDays - Number of business days to add (minimum 1)
|
|
230
|
-
* @param weekendPredicate - Function that returns true for weekends
|
|
224
|
+
* Calculate end date by adding business days to start date.
|
|
225
|
+
* Delegates to core/scheduling/dateMath, converts Date result to string.
|
|
231
226
|
* @returns End date as YYYY-MM-DD string
|
|
232
|
-
*
|
|
233
|
-
* Example:
|
|
234
|
-
* addBusinessDays('2026-03-14', 4, (d) => d.getUTCDay() === 0 || d.getUTCDay() === 6)
|
|
235
|
-
* // Returns '2026-03-19' (Fri + Mon + Tue + Wed, Sat/Sun skipped)
|
|
236
227
|
*/
|
|
237
228
|
declare function addBusinessDays(startDate: string | Date, businessDays: number, weekendPredicate: (date: Date) => boolean): string;
|
|
238
229
|
/**
|
|
239
|
-
* Subtract business days from a date (inverse of addBusinessDays)
|
|
240
|
-
*
|
|
241
|
-
* @param businessDays - Number of business days to subtract (minimum 1)
|
|
242
|
-
* @param weekendPredicate - Function that returns true for weekends
|
|
230
|
+
* Subtract business days from a date (inverse of addBusinessDays).
|
|
231
|
+
* Delegates to core/scheduling/dateMath, converts Date result to string.
|
|
243
232
|
* @returns Start date as YYYY-MM-DD string
|
|
244
|
-
*
|
|
245
|
-
* Example:
|
|
246
|
-
* subtractBusinessDays('2026-03-19', 4, (d) => d.getUTCDay() === 0 || d.getUTCDay() === 6)
|
|
247
|
-
* // Returns '2026-03-14' (going backwards: Fri[Thu][Wed][Tue]Mon, Sat/Sun skipped)
|
|
248
233
|
*/
|
|
249
234
|
declare function subtractBusinessDays(endDate: string | Date, businessDays: number, weekendPredicate: (date: Date) => boolean): string;
|
|
250
235
|
|
|
@@ -1018,40 +1003,62 @@ interface UseTaskDragReturn {
|
|
|
1018
1003
|
*/
|
|
1019
1004
|
declare const useTaskDrag: (options: UseTaskDragOptions) => UseTaskDragReturn;
|
|
1020
1005
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1006
|
+
/**
|
|
1007
|
+
* Pure date math utilities for the core scheduling module.
|
|
1008
|
+
* Zero React/DOM/date-fns dependencies.
|
|
1009
|
+
*
|
|
1010
|
+
* Functions moved from:
|
|
1011
|
+
* - dependencyUtils.ts: normalizeUTCDate, parseDateOnly, getBusinessDayOffset, shiftBusinessDayOffset, DAY_MS
|
|
1012
|
+
* - dateUtils.ts: getBusinessDaysCount, addBusinessDays, subtractBusinessDays
|
|
1013
|
+
*/
|
|
1014
|
+
declare const DAY_MS: number;
|
|
1015
|
+
/**
|
|
1016
|
+
* Normalize a Date to UTC midnight (hours/minutes/seconds zeroed).
|
|
1017
|
+
*/
|
|
1018
|
+
declare function normalizeUTCDate(date: Date): Date;
|
|
1019
|
+
/**
|
|
1020
|
+
* Parse a date string or Date object to a UTC midnight Date.
|
|
1021
|
+
* Handles ISO strings like "2025-01-15" by appending T00:00:00.000Z.
|
|
1022
|
+
*/
|
|
1023
|
+
declare function parseDateOnly(date: string | Date): Date;
|
|
1024
|
+
/**
|
|
1025
|
+
* Compute the business-day offset between two dates.
|
|
1026
|
+
* Steps through each calendar day, counting only non-weekend days.
|
|
1027
|
+
* Returns a positive number if toDate > fromDate, negative if toDate < fromDate.
|
|
1028
|
+
*/
|
|
1029
|
+
declare function getBusinessDayOffset(fromDate: Date, toDate: Date, weekendPredicate: (date: Date) => boolean): number;
|
|
1030
|
+
/**
|
|
1031
|
+
* Shift a date by a business-day offset, skipping weekends.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function shiftBusinessDayOffset(date: Date, offset: number, weekendPredicate: (date: Date) => boolean): Date;
|
|
1034
|
+
/**
|
|
1035
|
+
* Snap a date to the nearest working day in the given direction.
|
|
1036
|
+
*/
|
|
1023
1037
|
declare function alignToWorkingDay(date: Date, direction: 1 | -1, weekendPredicate: (date: Date) => boolean): Date;
|
|
1038
|
+
/**
|
|
1039
|
+
* Get task duration in days (inclusive).
|
|
1040
|
+
* If businessDays mode, counts business days using weekendPredicate.
|
|
1041
|
+
* Otherwise, counts calendar days.
|
|
1042
|
+
*/
|
|
1024
1043
|
declare function getTaskDuration(startDate: string | Date, endDate: string | Date, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): number;
|
|
1025
|
-
|
|
1026
|
-
start: Date;
|
|
1027
|
-
end: Date;
|
|
1028
|
-
};
|
|
1029
|
-
declare function buildTaskRangeFromEnd(endDate: Date, duration: number, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, snapDirection?: 1 | -1): {
|
|
1030
|
-
start: Date;
|
|
1031
|
-
end: Date;
|
|
1032
|
-
};
|
|
1033
|
-
declare function moveTaskRange(originalStart: string | Date, originalEnd: string | Date, proposedStart: Date, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, snapDirection?: 1 | -1): {
|
|
1034
|
-
start: Date;
|
|
1035
|
-
end: Date;
|
|
1036
|
-
};
|
|
1037
|
-
declare function clampTaskRangeForIncomingFS(task: Pick<Task$1, 'dependencies'>, proposedStart: Date, proposedEnd: Date, allTasks: Task$1[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): {
|
|
1038
|
-
start: Date;
|
|
1039
|
-
end: Date;
|
|
1040
|
-
};
|
|
1044
|
+
|
|
1041
1045
|
/**
|
|
1042
|
-
*
|
|
1046
|
+
* Dependency calculation functions.
|
|
1047
|
+
* Moved from dependencyUtils.ts — verbatim implementations.
|
|
1048
|
+
* Zero React/DOM/date-fns imports.
|
|
1043
1049
|
*/
|
|
1044
|
-
|
|
1050
|
+
|
|
1045
1051
|
/**
|
|
1046
|
-
*
|
|
1052
|
+
* Get lag value from dependency, defaulting to 0.
|
|
1047
1053
|
*/
|
|
1048
|
-
declare function
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1054
|
+
declare function getDependencyLag(dep: Pick<TaskDependency$1, 'lag'>): number;
|
|
1055
|
+
/**
|
|
1056
|
+
* Normalize lag for FS links — clamp to >= -predecessorDuration.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function normalizeDependencyLag(linkType: LinkType, lag: number, predecessorStart: Date, predecessorEnd: Date, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): number;
|
|
1052
1059
|
/**
|
|
1053
1060
|
* Compute lag (in days) from actual predecessor/successor dates.
|
|
1054
|
-
* This is the single source of truth for lag semantics
|
|
1061
|
+
* This is the single source of truth for lag semantics.
|
|
1055
1062
|
*
|
|
1056
1063
|
* Semantics (lag=0 = natural, gap-free connection):
|
|
1057
1064
|
* - FS: lag = succStart - predEnd - 1 (adjacent days = 0)
|
|
@@ -1061,73 +1068,111 @@ declare function detectCycles(tasks: Task$1[]): {
|
|
|
1061
1068
|
*/
|
|
1062
1069
|
declare function computeLagFromDates(linkType: LinkType, predStart: Date, predEnd: Date, succStart: Date, succEnd: Date, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): number;
|
|
1063
1070
|
/**
|
|
1064
|
-
* Calculate successor date based on predecessor dates, link type, and lag
|
|
1071
|
+
* Calculate successor date based on predecessor dates, link type, and lag.
|
|
1065
1072
|
*
|
|
1066
1073
|
* Link type semantics:
|
|
1067
|
-
* - FS: Successor start = Predecessor end + lag + 1 day (lag=0
|
|
1074
|
+
* - FS: Successor start = Predecessor end + lag + 1 day (lag=0 -> next day)
|
|
1068
1075
|
* - SS: Successor start = Predecessor start + lag
|
|
1069
1076
|
* - FF: Successor end = Predecessor end + lag
|
|
1070
|
-
* - SF: Successor end = Predecessor start + lag - 1 day (lag=0
|
|
1077
|
+
* - SF: Successor end = Predecessor start + lag - 1 day (lag=0 -> day before)
|
|
1071
1078
|
*/
|
|
1072
1079
|
declare function calculateSuccessorDate(predecessorStart: Date, predecessorEnd: Date, linkType: LinkType, lag?: number, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): Date;
|
|
1080
|
+
|
|
1073
1081
|
/**
|
|
1074
|
-
*
|
|
1082
|
+
* Cascade engine functions.
|
|
1083
|
+
* Moved from dependencyUtils.ts — verbatim implementations.
|
|
1084
|
+
* Zero React/DOM/date-fns imports.
|
|
1075
1085
|
*/
|
|
1076
|
-
|
|
1086
|
+
|
|
1077
1087
|
/**
|
|
1078
1088
|
* Get successor tasks of a dragged task using BFS, filtered by link type(s).
|
|
1079
|
-
*
|
|
1080
|
-
* Returns tasks in breadth-first order (direct successors first, then their successors).
|
|
1081
|
-
* The dragged task itself is NOT included in the returned array.
|
|
1082
|
-
*
|
|
1083
|
-
* The visited set prevents infinite loops in case of cycles (cycle detection already
|
|
1084
|
-
* prevents cycles in valid data, but the guard adds safety during cascade computation).
|
|
1085
|
-
*
|
|
1086
|
-
* @param draggedTaskId - ID of the task being dragged
|
|
1087
|
-
* @param allTasks - All tasks in the chart
|
|
1088
|
-
* @param linkTypes - Dependency types to follow (default: ['FS'] preserves Phase 7 behavior)
|
|
1089
1089
|
*/
|
|
1090
1090
|
declare function getSuccessorChain(draggedTaskId: string, allTasks: Task$1[], linkTypes?: LinkType[]): Task$1[];
|
|
1091
1091
|
/**
|
|
1092
1092
|
* Cascade successors by actual link constraints (BFS, constraint-based).
|
|
1093
|
-
*
|
|
1094
|
-
* Each successor in the chain is positioned using calculateSuccessorDate
|
|
1095
|
-
* with the predecessor's NEW dates and the actual lag — not a flat delta.
|
|
1096
|
-
*
|
|
1097
|
-
* - FS/SS: constraintDate = new start of successor (duration preserved)
|
|
1098
|
-
* - FF/SF: constraintDate = new end of successor (duration preserved)
|
|
1099
|
-
*
|
|
1100
|
-
* Locked tasks break the chain.
|
|
1101
|
-
* Also cascades hierarchy children when a parent moves (when parent moves by
|
|
1102
|
-
* dependency link, children must move with it to maintain parent-child relationship).
|
|
1103
|
-
* Returns only the cascaded successors (not the moved task itself).
|
|
1104
1093
|
*/
|
|
1105
1094
|
declare function cascadeByLinks(movedTaskId: string, newStart: Date, newEnd: Date, allTasks: Task$1[], skipChildCascade?: boolean): Task$1[];
|
|
1106
1095
|
/**
|
|
1107
1096
|
* Get transitive closure of successors for cascading.
|
|
1108
|
-
*
|
|
1109
|
-
* Direct successors of the changed task are filtered by firstLevelLinkTypes.
|
|
1110
|
-
* Their successors (and so on) are included regardless of link type.
|
|
1111
|
-
*
|
|
1112
|
-
* Also includes hierarchy children of any parent task in the chain - when a parent
|
|
1113
|
-
* moves via dependency cascade, its children must move with it.
|
|
1114
1097
|
*/
|
|
1115
1098
|
declare function getTransitiveCascadeChain(changedTaskId: string, allTasks: Task$1[], firstLevelLinkTypes: LinkType[]): Task$1[];
|
|
1099
|
+
/**
|
|
1100
|
+
* Universal cascade engine that propagates a moved task's new position through
|
|
1101
|
+
* the entire dependency+hierarchy graph using BFS with change detection.
|
|
1102
|
+
*/
|
|
1103
|
+
declare function universalCascade(movedTask: Task$1, newStart: Date, newEnd: Date, allTasks: Task$1[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): Task$1[];
|
|
1104
|
+
/**
|
|
1105
|
+
* Recalculate all task dates when switching between business/calendar day modes.
|
|
1106
|
+
*/
|
|
1107
|
+
declare function reflowTasksOnModeSwitch(sourceTasks: Task$1[], toBusinessDays: boolean, weekendPredicate: (date: Date) => boolean): Task$1[];
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* High-level schedule command functions.
|
|
1111
|
+
* Moved from dependencyUtils.ts — verbatim implementations.
|
|
1112
|
+
* Zero React/DOM/date-fns imports.
|
|
1113
|
+
*/
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Build a task range (start/end dates) from a start date and duration.
|
|
1117
|
+
*/
|
|
1118
|
+
declare function buildTaskRangeFromStart(startDate: Date, duration: number, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, snapDirection?: 1 | -1): {
|
|
1119
|
+
start: Date;
|
|
1120
|
+
end: Date;
|
|
1121
|
+
};
|
|
1122
|
+
/**
|
|
1123
|
+
* Build a task range (start/end dates) from an end date and duration.
|
|
1124
|
+
*/
|
|
1125
|
+
declare function buildTaskRangeFromEnd(endDate: Date, duration: number, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, snapDirection?: 1 | -1): {
|
|
1126
|
+
start: Date;
|
|
1127
|
+
end: Date;
|
|
1128
|
+
};
|
|
1129
|
+
/**
|
|
1130
|
+
* Move a task range to a new start date, preserving duration.
|
|
1131
|
+
*/
|
|
1132
|
+
declare function moveTaskRange(originalStart: string | Date, originalEnd: string | Date, proposedStart: Date, businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, snapDirection?: 1 | -1): {
|
|
1133
|
+
start: Date;
|
|
1134
|
+
end: Date;
|
|
1135
|
+
};
|
|
1136
|
+
/**
|
|
1137
|
+
* Clamp task range start date based on incoming FS dependencies.
|
|
1138
|
+
*/
|
|
1139
|
+
declare function clampTaskRangeForIncomingFS(task: Pick<Task$1, 'dependencies'>, proposedStart: Date, proposedEnd: Date, allTasks: Task$1[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): {
|
|
1140
|
+
start: Date;
|
|
1141
|
+
end: Date;
|
|
1142
|
+
};
|
|
1116
1143
|
/**
|
|
1117
1144
|
* Recalculate incoming dependency lags after a task's dates change.
|
|
1118
|
-
* Used when completing a drag or applying a manual date change.
|
|
1119
1145
|
*/
|
|
1120
1146
|
declare function recalculateIncomingLags(task: Task$1, newStartDate: Date, newEndDate: Date, allTasks: Task$1[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): NonNullable<Task$1['dependencies']>;
|
|
1147
|
+
|
|
1121
1148
|
/**
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1149
|
+
* Dependency validation and cycle detection.
|
|
1150
|
+
* Moved from dependencyUtils.ts — verbatim implementations.
|
|
1151
|
+
* Zero React/DOM/date-fns imports.
|
|
1124
1152
|
*/
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Build adjacency list for dependency graph (task -> successors)
|
|
1156
|
+
*/
|
|
1157
|
+
declare function buildAdjacencyList(tasks: Task$1[]): Map<string, string[]>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Detect circular dependencies using depth-first search
|
|
1160
|
+
*/
|
|
1161
|
+
declare function detectCycles(tasks: Task$1[]): {
|
|
1162
|
+
hasCycle: boolean;
|
|
1163
|
+
cyclePath?: string[];
|
|
1164
|
+
};
|
|
1165
|
+
/**
|
|
1166
|
+
* Validate all dependencies in the task list
|
|
1167
|
+
*/
|
|
1168
|
+
declare function validateDependencies(tasks: Task$1[]): ValidationResult;
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Hierarchy scheduling functions.
|
|
1172
|
+
* Moved from dependencyUtils.ts — verbatim implementations.
|
|
1173
|
+
* Zero React/DOM/date-fns imports.
|
|
1174
|
+
*/
|
|
1175
|
+
|
|
1131
1176
|
/**
|
|
1132
1177
|
* Get all child tasks of a parent task.
|
|
1133
1178
|
* Returns tasks where task.parentId === parentId.
|
|
@@ -1154,23 +1199,27 @@ declare function computeParentDates(parentId: string, tasks: Task$1[]): {
|
|
|
1154
1199
|
* Progress is rounded to 1 decimal place.
|
|
1155
1200
|
*/
|
|
1156
1201
|
declare function computeParentProgress(parentId: string, tasks: Task$1[]): number;
|
|
1202
|
+
/**
|
|
1203
|
+
* Get all descendant tasks of a parent task (transitive closure of children).
|
|
1204
|
+
* Returns all tasks where task.parentId is in the hierarchy of the parent.
|
|
1205
|
+
*/
|
|
1206
|
+
declare function getAllDescendants(parentId: string, tasks: Task$1[]): Task$1[];
|
|
1207
|
+
/**
|
|
1208
|
+
* Get all dependency edges for rendering.
|
|
1209
|
+
* Returns array of { predecessorId, successorId, type, lag }
|
|
1210
|
+
*/
|
|
1211
|
+
declare function getAllDependencyEdges(tasks: Task$1[]): Array<{
|
|
1212
|
+
predecessorId: string;
|
|
1213
|
+
successorId: string;
|
|
1214
|
+
type: 'FS' | 'SS' | 'FF' | 'SF';
|
|
1215
|
+
lag: number;
|
|
1216
|
+
}>;
|
|
1157
1217
|
/**
|
|
1158
1218
|
* Remove dependencies between two tasks in both directions.
|
|
1159
|
-
* When tasks become parent-child, their dependency link becomes meaningless.
|
|
1160
|
-
*
|
|
1161
|
-
* @param taskId1 - First task ID
|
|
1162
|
-
* @param taskId2 - Second task ID
|
|
1163
|
-
* @param tasks - All tasks array
|
|
1164
|
-
* @returns New tasks array with dependencies between the two tasks removed
|
|
1165
1219
|
*/
|
|
1166
1220
|
declare function removeDependenciesBetweenTasks(taskId1: string, taskId2: string, tasks: Task$1[]): Task$1[];
|
|
1167
1221
|
/**
|
|
1168
1222
|
* Find the parent ID of a task.
|
|
1169
|
-
* Returns the parentId of the task if found, undefined otherwise.
|
|
1170
|
-
*
|
|
1171
|
-
* @param taskId - ID of the task to find parent for
|
|
1172
|
-
* @param tasks - All tasks array
|
|
1173
|
-
* @returns Parent task ID or undefined if task is root or not found
|
|
1174
1223
|
*/
|
|
1175
1224
|
declare function findParentId(taskId: string, tasks: Task$1[]): string | undefined;
|
|
1176
1225
|
/**
|
|
@@ -1178,63 +1227,9 @@ declare function findParentId(taskId: string, tasks: Task$1[]): string | undefin
|
|
|
1178
1227
|
*/
|
|
1179
1228
|
declare function isAncestorTask(ancestorId: string, taskId: string, tasks: Task$1[]): boolean;
|
|
1180
1229
|
/**
|
|
1181
|
-
* Returns true when tasks are in the same ancestry chain
|
|
1230
|
+
* Returns true when tasks are in the same ancestry chain.
|
|
1182
1231
|
*/
|
|
1183
1232
|
declare function areTasksHierarchicallyRelated(taskId1: string, taskId2: string, tasks: Task$1[]): boolean;
|
|
1184
|
-
/**
|
|
1185
|
-
* Get all descendant tasks of a parent task (transitive closure of children).
|
|
1186
|
-
* Returns all tasks where task.parentId is in the hierarchy of the parent.
|
|
1187
|
-
*
|
|
1188
|
-
* @param parentId - ID of the parent task
|
|
1189
|
-
* @param tasks - All tasks array
|
|
1190
|
-
* @returns Array of descendant tasks (not including the parent itself)
|
|
1191
|
-
*/
|
|
1192
|
-
declare function getAllDescendants(parentId: string, tasks: Task$1[]): Task$1[];
|
|
1193
|
-
/**
|
|
1194
|
-
* Universal cascade engine that propagates a moved task's new position through
|
|
1195
|
-
* the entire dependency+hierarchy graph using BFS with change detection.
|
|
1196
|
-
*
|
|
1197
|
-
* Three rules applied in BFS order:
|
|
1198
|
-
*
|
|
1199
|
-
* RULE 1 — Hierarchy children of a parent task shift by the parent's delta.
|
|
1200
|
-
* Applied only when the parent arrived as 'direct', 'child-delta', or 'dependency'.
|
|
1201
|
-
* Skipped for 'parent-recalc' (parent was computed FROM children).
|
|
1202
|
-
*
|
|
1203
|
-
* RULE 2 — Parent task is recomputed as min(children.start)..max(children.end).
|
|
1204
|
-
* Re-queued every time a child changes (no visited guard — uses change detection).
|
|
1205
|
-
* This ensures the parent reflects ALL cascaded children, not just the first one.
|
|
1206
|
-
*
|
|
1207
|
-
* RULE 3 — Dependency successors are repositioned via calculateSuccessorDate.
|
|
1208
|
-
* Effective lag is computed from original dates (not stored dep.lag).
|
|
1209
|
-
* Re-queued if predecessor's dates changed (change detection).
|
|
1210
|
-
*
|
|
1211
|
-
* Change detection prevents infinite loops: a task is only re-queued if its
|
|
1212
|
-
* computed dates differ from what's already in updatedDates.
|
|
1213
|
-
*
|
|
1214
|
-
* @param movedTask - The task that was directly moved/resized (already has new dates).
|
|
1215
|
-
* @param newStart - New start date of the moved task.
|
|
1216
|
-
* @param newEnd - New end date of the moved task.
|
|
1217
|
-
* @param allTasks - All tasks in the chart (original, unmodified dates).
|
|
1218
|
-
* @param businessDays - If true, dependency calculations skip weekends.
|
|
1219
|
-
* @param weekendPredicate - Function that returns true for weekends.
|
|
1220
|
-
*/
|
|
1221
|
-
declare function universalCascade(movedTask: Task$1, newStart: Date, newEnd: Date, allTasks: Task$1[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): Task$1[];
|
|
1222
|
-
/**
|
|
1223
|
-
* Пересчитывает даты всех задач при переключении режима рабочих/календарных дней.
|
|
1224
|
-
*
|
|
1225
|
-
* Calendar → Working (toBusinessDays=true):
|
|
1226
|
-
* - duration число сохраняется (10 кал → 10 раб)
|
|
1227
|
-
* - start на выходном → сдвигается на ближайший рабочий
|
|
1228
|
-
* - end пересчитывается через buildTaskRangeFromStart
|
|
1229
|
-
* - каскад зависимостей (расширение может нарушить constraints)
|
|
1230
|
-
*
|
|
1231
|
-
* Working → Calendar (toBusinessDays=false):
|
|
1232
|
-
* - start остаётся как есть
|
|
1233
|
-
* - duration число сохраняется, но теперь считается как календарные дни
|
|
1234
|
-
* - end сдвигается ближе
|
|
1235
|
-
* - каскад НЕ нужен (сжатие не нарушает зависимости)
|
|
1236
|
-
*/
|
|
1237
|
-
declare function reflowTasksOnModeSwitch(sourceTasks: Task$1[], toBusinessDays: boolean, weekendPredicate: (date: Date) => boolean): Task$1[];
|
|
1238
1233
|
|
|
1239
1234
|
/**
|
|
1240
1235
|
* Checks whether a task is behind the expected progress for the current date.
|
|
@@ -1424,4 +1419,4 @@ interface VisibleReorderPosition {
|
|
|
1424
1419
|
*/
|
|
1425
1420
|
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
1426
1421
|
|
|
1427
|
-
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttDateRange, GridBackground, type GridConfig, type GridLine, Input, type InputProps, type MonthBlock, type MonthSpan, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type Task, type TaskBarGeometry, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TodayIndicator, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WeekendBlock, type YearSpan, addBusinessDays, alignToWorkingDay, and, areTasksHierarchicallyRelated, buildAdjacencyList, buildTaskRangeFromEnd, buildTaskRangeFromStart, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMonthGridLines, calculateOrthogonalPath, calculateSuccessorDate, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, cascadeByLinks, clampTaskRangeForIncomingFS, computeLagFromDates, computeParentDates, computeParentProgress, createCustomDayPredicate, createDateKey, detectCycles, detectEdgeZone, expired, findParentId, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getAllDependencyEdges, getAllDescendants, getBusinessDaysCount, getChildren, getCursorForPosition, getDayOffset, getDependencyLag, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getSuccessorChain, getTaskDuration, getTransitiveCascadeChain, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isAncestorTask, isTaskExpired, isTaskParent, isToday, isWeekend, moveTaskRange, nameContains, normalizeDependencyLag, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, recalculateIncomingLags, reflowTasksOnModeSwitch, removeDependenciesBetweenTasks, subtractBusinessDays, universalCascade, useTaskDrag, validateDependencies, withoutDeps };
|
|
1422
|
+
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DAY_MS, DatePicker, type DatePickerProps, type DependencyError, DragGuideLines, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttDateRange, GridBackground, type GridConfig, type GridLine, Input, type InputProps, type LinkType, type MonthBlock, type MonthSpan, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type Task, type TaskBarGeometry, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TodayIndicator, type ValidationResult, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WeekendBlock, type YearSpan, addBusinessDays, alignToWorkingDay, and, areTasksHierarchicallyRelated, buildAdjacencyList, buildTaskRangeFromEnd, buildTaskRangeFromStart, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMonthGridLines, calculateOrthogonalPath, calculateSuccessorDate, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, cascadeByLinks, clampTaskRangeForIncomingFS, computeLagFromDates, computeParentDates, computeParentProgress, createCustomDayPredicate, createDateKey, detectCycles, detectEdgeZone, expired, findParentId, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getAllDependencyEdges, getAllDescendants, getBusinessDayOffset, getBusinessDaysCount, getChildren, getCursorForPosition, getDayOffset, getDependencyLag, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getSuccessorChain, getTaskDuration, getTransitiveCascadeChain, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isAncestorTask, isTaskExpired, isTaskParent, isToday, isWeekend, moveTaskRange, nameContains, normalizeDependencyLag, normalizeHierarchyTasks, normalizeTaskDates, normalizeUTCDate, not, or, parseDateOnly, parseUTCDate, pixelsToDate, progressInRange, recalculateIncomingLags, reflowTasksOnModeSwitch, removeDependenciesBetweenTasks, shiftBusinessDayOffset, subtractBusinessDays, universalCascade, useTaskDrag, validateDependencies, withoutDeps };
|