gantt-lib 0.136.1 → 0.138.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.
@@ -159,6 +159,57 @@ interface ValidationResult {
159
159
  /** Array of errors/warnings (empty if valid) */
160
160
  errors: DependencyError[];
161
161
  }
162
+ /**
163
+ * A single work bar rendered inside a multi-activity task row.
164
+ * Activities are visual bars packed into sub-lanes of one row — no hierarchy,
165
+ * no dependencies, no progress of their own.
166
+ */
167
+ interface TaskActivityTooltipField {
168
+ /** Field caption, e.g. "Подрядчик" */
169
+ label: string;
170
+ /** Field value — any renderable content (string, badge, icon, JSX) */
171
+ value: ReactNode;
172
+ }
173
+ interface TaskActivity {
174
+ /** Unique identifier within the host task */
175
+ id: string;
176
+ /** Display name rendered inside the activity bar */
177
+ name: string;
178
+ /** Activity start date (ISO string or Date object) */
179
+ startDate: string | Date;
180
+ /** Activity end date (ISO string or Date object) */
181
+ endDate: string | Date;
182
+ /** Optional color; falls back to the default task bar color */
183
+ color?: string;
184
+ /**
185
+ * Обязательный зазор в днях между концом предыдущей работы этой же строки
186
+ * (этажа) и началом этой (например технологическая выдержка). Задан — зазор
187
+ * постоянный; не задан — последователь подтягивается вплотную («как можно
188
+ * раньше»), а зазор тянется, пока его держит другая связь. На вертикальную
189
+ * связь «та же работа этажом выше» лаг не переносится.
190
+ */
191
+ lag?: number;
192
+ /** Extra rows rendered in the hover tooltip under the header (e.g. contractor). */
193
+ tooltipFields?: TaskActivityTooltipField[];
194
+ /**
195
+ * Прогресс работы 0–100 (визуальное заполнение полосы слева направо и строка
196
+ * «Готовность» в подсказке). Как и у Task.progress — только визуал.
197
+ */
198
+ progress?: number;
199
+ }
200
+ /**
201
+ * Context handed to the `activityTooltip` render prop: everything needed to
202
+ * compose a custom activity tooltip (dates, duration, host task, work).
203
+ */
204
+ interface ActivityTooltipContext {
205
+ task: Task;
206
+ activity: TaskActivity;
207
+ startDate: Date;
208
+ endDate: Date;
209
+ durationDays: number;
210
+ /** Прогресс работы 0–100, если задан. */
211
+ progress?: number;
212
+ }
162
213
  /**
163
214
  * Task data structure for Gantt chart
164
215
  */
@@ -221,6 +272,21 @@ interface Task {
221
272
  planByDate?: Record<string, number>;
222
273
  /** Optional actual quantities keyed by ISO date (YYYY-MM-DD), used by plan-fact mode. */
223
274
  factByDate?: Record<string, number>;
275
+ /**
276
+ * Optional list of works rendered as bars packed into sub-lanes of this row
277
+ * (e.g. finishing works on one floor). Replaces the main bar for the row and
278
+ * grows the row height to fit concurrent activities. Works in gantt mode only.
279
+ */
280
+ activities?: TaskActivity[];
281
+ /**
282
+ * ОН-конвейер (finish-to-start chain) for row activities. Inside the row every
283
+ * work follows the previous one; identical works of consecutive chained rows
284
+ * (floors) are linked too. `true` — жёсткий конвейер: перетаскивание сдвигает
285
+ * всю цепочку ниже на ту же дельту. `'push'` — режим «выталкивания» (ASAP):
286
+ * промежутки заполняются при движении вверх по потоку, вниз последователь
287
+ * сдвигается только после коллизии; лаг работы держит зазор постоянным.
288
+ */
289
+ activityChain?: boolean | 'push';
224
290
  }
225
291
  /**
226
292
  * Date range for Gantt chart display
@@ -772,4 +838,4 @@ type ScaleTaskSubtreeResult = {
772
838
  */
773
839
  declare function scaleTaskSubtreeDuration(parentId: string, targetDuration: number, snapshot: Task[], options?: ScaleTaskSubtreeOptions): ScaleTaskSubtreeResult;
774
840
 
775
- export { isAncestorTask as $, clampTaskRangeForIncomingFS as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, computeCriticalPath as E, computeLagFromDates as F, type GanttScheduleIntent as G, computeParentDates as H, computeParentProgress as I, detectCycles as J, extendCriticalIdsToParents as K, type LinkType as L, type MonthSpan as M, findParentId as N, getAllDependencyEdges as O, getAllDescendants as P, getBusinessDayOffset as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getChildren as U, type ValidationResult as V, type WeekendBlock as W, getDependencyLag as X, getSuccessorChain as Y, getTaskDuration as Z, getTransitiveCascadeChain as _, type GanttDateRange as a, isTaskParent as a0, moveTaskRange as a1, moveTaskWithCascade as a2, normalizeDependencyLag as a3, normalizePredecessorDates as a4, normalizeTaskDependencyLags as a5, normalizeUTCDate as a6, parseDateOnly as a7, recalculateIncomingLags as a8, recalculateProjectSchedule as a9, recalculateTaskFromDependencies as aa, reflowTasksOnModeSwitch as ab, removeDependenciesBetweenTasks as ac, resizeTaskWithCascade as ad, scaleTaskSubtreeDuration as ae, shiftBusinessDayOffset as af, universalCascade as ag, validateDependencies as ah, type CascadeContext as ai, type ScheduleCommandOptions as aj, type ScheduleCommandResult as ak, type ScheduleDependency as al, type ScheduleTask as am, type ScheduleTaskUpdate as an, type TaskDependency as ao, addBusinessDays as ap, cascadeTaskProgress as aq, createCascadeContext as ar, getBusinessDaysCount as as, subtractBusinessDays as at, type TimelineMarker as b, type TaskDateChangeMode as c, type ResourcePlannerChartProps as d, type ResourceTimelineResource as e, type DependencyError as f, type GanttChartMode as g, type GridConfig as h, type GridLine as i, type ResourceTableColumnId as j, type ResourceTableColumnWidthMap as k, type ResourceTimelineMove as l, type ResourceTimelineResourceMenuCommand as m, type ScaleTaskSubtreeAnchor as n, type ScaleTaskSubtreeErrorCode as o, type ScaleTaskSubtreeExternalPolicy as p, type ScaleTaskSubtreeOptions as q, type ScaleTaskSubtreeWarning as r, type TaskBarGeometry as s, alignToWorkingDay as t, areTasksHierarchicallyRelated as u, buildAdjacencyList as v, buildTaskRangeFromEnd as w, buildTaskRangeFromStart as x, calculateSuccessorDate as y, cascadeByLinks as z };
841
+ export { getSuccessorChain as $, type ActivityTooltipContext as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, calculateSuccessorDate as E, cascadeByLinks as F, type GanttScheduleIntent as G, clampTaskRangeForIncomingFS as H, computeCriticalPath as I, computeLagFromDates as J, computeParentDates as K, type LinkType as L, type MonthSpan as M, computeParentProgress as N, detectCycles as O, extendCriticalIdsToParents as P, findParentId as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getAllDependencyEdges as U, type ValidationResult as V, type WeekendBlock as W, getAllDescendants as X, getBusinessDayOffset as Y, getChildren as Z, getDependencyLag as _, type GanttDateRange as a, getTaskDuration as a0, getTransitiveCascadeChain as a1, isAncestorTask as a2, isTaskParent as a3, moveTaskRange as a4, moveTaskWithCascade as a5, normalizeDependencyLag as a6, normalizePredecessorDates as a7, normalizeTaskDependencyLags as a8, normalizeUTCDate as a9, parseDateOnly as aa, recalculateIncomingLags as ab, recalculateProjectSchedule as ac, recalculateTaskFromDependencies as ad, reflowTasksOnModeSwitch as ae, removeDependenciesBetweenTasks as af, resizeTaskWithCascade as ag, scaleTaskSubtreeDuration as ah, shiftBusinessDayOffset as ai, universalCascade as aj, validateDependencies as ak, type CascadeContext as al, type ScheduleCommandOptions as am, type ScheduleCommandResult as an, type ScheduleDependency as ao, type ScheduleTask as ap, type ScheduleTaskUpdate as aq, type TaskDependency as ar, addBusinessDays as as, cascadeTaskProgress as at, createCascadeContext as au, getBusinessDaysCount as av, subtractBusinessDays as aw, type TimelineMarker as b, type TaskDateChangeMode as c, type ResourcePlannerChartProps as d, type TaskActivity as e, type ResourceTimelineResource as f, type DependencyError as g, type GanttChartMode as h, type GridConfig as i, type GridLine as j, type ResourceTableColumnId as k, type ResourceTableColumnWidthMap as l, type ResourceTimelineMove as m, type ResourceTimelineResourceMenuCommand as n, type ScaleTaskSubtreeAnchor as o, type ScaleTaskSubtreeErrorCode as p, type ScaleTaskSubtreeExternalPolicy as q, type ScaleTaskSubtreeOptions as r, type ScaleTaskSubtreeWarning as s, type TaskActivityTooltipField as t, type TaskBarGeometry as u, alignToWorkingDay as v, areTasksHierarchicallyRelated as w, buildAdjacencyList as x, buildTaskRangeFromEnd as y, buildTaskRangeFromStart as z };
@@ -159,6 +159,57 @@ interface ValidationResult {
159
159
  /** Array of errors/warnings (empty if valid) */
160
160
  errors: DependencyError[];
161
161
  }
162
+ /**
163
+ * A single work bar rendered inside a multi-activity task row.
164
+ * Activities are visual bars packed into sub-lanes of one row — no hierarchy,
165
+ * no dependencies, no progress of their own.
166
+ */
167
+ interface TaskActivityTooltipField {
168
+ /** Field caption, e.g. "Подрядчик" */
169
+ label: string;
170
+ /** Field value — any renderable content (string, badge, icon, JSX) */
171
+ value: ReactNode;
172
+ }
173
+ interface TaskActivity {
174
+ /** Unique identifier within the host task */
175
+ id: string;
176
+ /** Display name rendered inside the activity bar */
177
+ name: string;
178
+ /** Activity start date (ISO string or Date object) */
179
+ startDate: string | Date;
180
+ /** Activity end date (ISO string or Date object) */
181
+ endDate: string | Date;
182
+ /** Optional color; falls back to the default task bar color */
183
+ color?: string;
184
+ /**
185
+ * Обязательный зазор в днях между концом предыдущей работы этой же строки
186
+ * (этажа) и началом этой (например технологическая выдержка). Задан — зазор
187
+ * постоянный; не задан — последователь подтягивается вплотную («как можно
188
+ * раньше»), а зазор тянется, пока его держит другая связь. На вертикальную
189
+ * связь «та же работа этажом выше» лаг не переносится.
190
+ */
191
+ lag?: number;
192
+ /** Extra rows rendered in the hover tooltip under the header (e.g. contractor). */
193
+ tooltipFields?: TaskActivityTooltipField[];
194
+ /**
195
+ * Прогресс работы 0–100 (визуальное заполнение полосы слева направо и строка
196
+ * «Готовность» в подсказке). Как и у Task.progress — только визуал.
197
+ */
198
+ progress?: number;
199
+ }
200
+ /**
201
+ * Context handed to the `activityTooltip` render prop: everything needed to
202
+ * compose a custom activity tooltip (dates, duration, host task, work).
203
+ */
204
+ interface ActivityTooltipContext {
205
+ task: Task;
206
+ activity: TaskActivity;
207
+ startDate: Date;
208
+ endDate: Date;
209
+ durationDays: number;
210
+ /** Прогресс работы 0–100, если задан. */
211
+ progress?: number;
212
+ }
162
213
  /**
163
214
  * Task data structure for Gantt chart
164
215
  */
@@ -221,6 +272,21 @@ interface Task {
221
272
  planByDate?: Record<string, number>;
222
273
  /** Optional actual quantities keyed by ISO date (YYYY-MM-DD), used by plan-fact mode. */
223
274
  factByDate?: Record<string, number>;
275
+ /**
276
+ * Optional list of works rendered as bars packed into sub-lanes of this row
277
+ * (e.g. finishing works on one floor). Replaces the main bar for the row and
278
+ * grows the row height to fit concurrent activities. Works in gantt mode only.
279
+ */
280
+ activities?: TaskActivity[];
281
+ /**
282
+ * ОН-конвейер (finish-to-start chain) for row activities. Inside the row every
283
+ * work follows the previous one; identical works of consecutive chained rows
284
+ * (floors) are linked too. `true` — жёсткий конвейер: перетаскивание сдвигает
285
+ * всю цепочку ниже на ту же дельту. `'push'` — режим «выталкивания» (ASAP):
286
+ * промежутки заполняются при движении вверх по потоку, вниз последователь
287
+ * сдвигается только после коллизии; лаг работы держит зазор постоянным.
288
+ */
289
+ activityChain?: boolean | 'push';
224
290
  }
225
291
  /**
226
292
  * Date range for Gantt chart display
@@ -772,4 +838,4 @@ type ScaleTaskSubtreeResult = {
772
838
  */
773
839
  declare function scaleTaskSubtreeDuration(parentId: string, targetDuration: number, snapshot: Task[], options?: ScaleTaskSubtreeOptions): ScaleTaskSubtreeResult;
774
840
 
775
- export { isAncestorTask as $, clampTaskRangeForIncomingFS as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, computeCriticalPath as E, computeLagFromDates as F, type GanttScheduleIntent as G, computeParentDates as H, computeParentProgress as I, detectCycles as J, extendCriticalIdsToParents as K, type LinkType as L, type MonthSpan as M, findParentId as N, getAllDependencyEdges as O, getAllDescendants as P, getBusinessDayOffset as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getChildren as U, type ValidationResult as V, type WeekendBlock as W, getDependencyLag as X, getSuccessorChain as Y, getTaskDuration as Z, getTransitiveCascadeChain as _, type GanttDateRange as a, isTaskParent as a0, moveTaskRange as a1, moveTaskWithCascade as a2, normalizeDependencyLag as a3, normalizePredecessorDates as a4, normalizeTaskDependencyLags as a5, normalizeUTCDate as a6, parseDateOnly as a7, recalculateIncomingLags as a8, recalculateProjectSchedule as a9, recalculateTaskFromDependencies as aa, reflowTasksOnModeSwitch as ab, removeDependenciesBetweenTasks as ac, resizeTaskWithCascade as ad, scaleTaskSubtreeDuration as ae, shiftBusinessDayOffset as af, universalCascade as ag, validateDependencies as ah, type CascadeContext as ai, type ScheduleCommandOptions as aj, type ScheduleCommandResult as ak, type ScheduleDependency as al, type ScheduleTask as am, type ScheduleTaskUpdate as an, type TaskDependency as ao, addBusinessDays as ap, cascadeTaskProgress as aq, createCascadeContext as ar, getBusinessDaysCount as as, subtractBusinessDays as at, type TimelineMarker as b, type TaskDateChangeMode as c, type ResourcePlannerChartProps as d, type ResourceTimelineResource as e, type DependencyError as f, type GanttChartMode as g, type GridConfig as h, type GridLine as i, type ResourceTableColumnId as j, type ResourceTableColumnWidthMap as k, type ResourceTimelineMove as l, type ResourceTimelineResourceMenuCommand as m, type ScaleTaskSubtreeAnchor as n, type ScaleTaskSubtreeErrorCode as o, type ScaleTaskSubtreeExternalPolicy as p, type ScaleTaskSubtreeOptions as q, type ScaleTaskSubtreeWarning as r, type TaskBarGeometry as s, alignToWorkingDay as t, areTasksHierarchicallyRelated as u, buildAdjacencyList as v, buildTaskRangeFromEnd as w, buildTaskRangeFromStart as x, calculateSuccessorDate as y, cascadeByLinks as z };
841
+ export { getSuccessorChain as $, type ActivityTooltipContext as A, type BuiltInResourceTableColumnId as B, type CriticalPathOptions as C, DAY_MS as D, calculateSuccessorDate as E, cascadeByLinks as F, type GanttScheduleIntent as G, clampTaskRangeForIncomingFS as H, computeCriticalPath as I, computeLagFromDates as J, computeParentDates as K, type LinkType as L, type MonthSpan as M, computeParentProgress as N, detectCycles as O, extendCriticalIdsToParents as P, findParentId as Q, type ResourceTimelineItem as R, type ScaleTaskSubtreeResult as S, type Task as T, getAllDependencyEdges as U, type ValidationResult as V, type WeekendBlock as W, getAllDescendants as X, getBusinessDayOffset as Y, getChildren as Z, getDependencyLag as _, type GanttDateRange as a, getTaskDuration as a0, getTransitiveCascadeChain as a1, isAncestorTask as a2, isTaskParent as a3, moveTaskRange as a4, moveTaskWithCascade as a5, normalizeDependencyLag as a6, normalizePredecessorDates as a7, normalizeTaskDependencyLags as a8, normalizeUTCDate as a9, parseDateOnly as aa, recalculateIncomingLags as ab, recalculateProjectSchedule as ac, recalculateTaskFromDependencies as ad, reflowTasksOnModeSwitch as ae, removeDependenciesBetweenTasks as af, resizeTaskWithCascade as ag, scaleTaskSubtreeDuration as ah, shiftBusinessDayOffset as ai, universalCascade as aj, validateDependencies as ak, type CascadeContext as al, type ScheduleCommandOptions as am, type ScheduleCommandResult as an, type ScheduleDependency as ao, type ScheduleTask as ap, type ScheduleTaskUpdate as aq, type TaskDependency as ar, addBusinessDays as as, cascadeTaskProgress as at, createCascadeContext as au, getBusinessDaysCount as av, subtractBusinessDays as aw, type TimelineMarker as b, type TaskDateChangeMode as c, type ResourcePlannerChartProps as d, type TaskActivity as e, type ResourceTimelineResource as f, type DependencyError as g, type GanttChartMode as h, type GridConfig as i, type GridLine as j, type ResourceTableColumnId as k, type ResourceTableColumnWidthMap as l, type ResourceTimelineMove as m, type ResourceTimelineResourceMenuCommand as n, type ScaleTaskSubtreeAnchor as o, type ScaleTaskSubtreeErrorCode as p, type ScaleTaskSubtreeExternalPolicy as q, type ScaleTaskSubtreeOptions as r, type ScaleTaskSubtreeWarning as s, type TaskActivityTooltipField as t, type TaskBarGeometry as u, alignToWorkingDay as v, areTasksHierarchicallyRelated as w, buildAdjacencyList as x, buildTaskRangeFromEnd as y, buildTaskRangeFromStart as z };