gantt-lib 0.136.0 → 0.137.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 +80 -0
- package/dist/core/scheduling/index.d.mts +1 -1
- package/dist/core/scheduling/index.d.ts +1 -1
- package/dist/{index-D99kbU4p.d.mts → index-DheG4h0O.d.mts} +60 -1
- package/dist/{index-D99kbU4p.d.ts → index-DheG4h0O.d.ts} +60 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +243 -3
- package/dist/index.d.ts +243 -3
- package/dist/index.js +2049 -1038
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2037 -1038
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +175 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, b as TimelineMarker, c as TaskDateChangeMode, S as ScaleTaskSubtreeResult, d as ResourcePlannerChartProps, e as ResourceTimelineResource } from './index-
|
|
3
|
-
export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS,
|
|
2
|
+
import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, A as ActivityTooltipContext, b as TimelineMarker, c as TaskDateChangeMode, S as ScaleTaskSubtreeResult, d as ResourcePlannerChartProps, e as TaskActivity$1, f as ResourceTimelineResource } from './index-DheG4h0O.mjs';
|
|
3
|
+
export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, g as DependencyError, h as GanttChartMode, i as GridConfig, j as GridLine, L as LinkType, M as MonthSpan, k as ResourceTableColumnId, l as ResourceTableColumnWidthMap, m as ResourceTimelineMove, n as ResourceTimelineResourceMenuCommand, o as ScaleTaskSubtreeAnchor, p as ScaleTaskSubtreeErrorCode, q as ScaleTaskSubtreeExternalPolicy, r as ScaleTaskSubtreeOptions, s as ScaleTaskSubtreeWarning, t as TaskActivityTooltipField, u as TaskBarGeometry, W as WeekendBlock, v as alignToWorkingDay, w as areTasksHierarchicallyRelated, x as buildAdjacencyList, y as buildTaskRangeFromEnd, z as buildTaskRangeFromStart, E as calculateSuccessorDate, F as cascadeByLinks, H as clampTaskRangeForIncomingFS, I as computeCriticalPath, J as computeLagFromDates, K as computeParentDates, N as computeParentProgress, O as detectCycles, P as extendCriticalIdsToParents, Q as findParentId, U as getAllDependencyEdges, X as getAllDescendants, Y as getBusinessDayOffset, Z as getChildren, _ as getDependencyLag, $ as getSuccessorChain, a0 as getTaskDuration, a1 as getTransitiveCascadeChain, a2 as isAncestorTask, a3 as isTaskParent, a4 as moveTaskRange, a5 as moveTaskWithCascade, a6 as normalizeDependencyLag, a7 as normalizePredecessorDates, a8 as normalizeTaskDependencyLags, a9 as normalizeUTCDate, aa as parseDateOnly, ab as recalculateIncomingLags, ac as recalculateProjectSchedule, ad as recalculateTaskFromDependencies, ae as reflowTasksOnModeSwitch, af as removeDependenciesBetweenTasks, ag as resizeTaskWithCascade, ah as scaleTaskSubtreeDuration, ai as shiftBusinessDayOffset, aj as universalCascade, ak as validateDependencies } from './index-DheG4h0O.mjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as RadixPopover from '@radix-ui/react-popover';
|
|
6
6
|
|
|
@@ -500,6 +500,53 @@ interface Task {
|
|
|
500
500
|
divider?: 'top' | 'bottom';
|
|
501
501
|
/** Whether task dates match the linked work template (visual indicator only) */
|
|
502
502
|
synced?: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* Optional list of works rendered as bars packed into sub-lanes of this row
|
|
505
|
+
* (e.g. finishing works on one floor). Replaces the main bar for the row and
|
|
506
|
+
* grows the row height to fit concurrent activities. Works in gantt mode only.
|
|
507
|
+
*/
|
|
508
|
+
activities?: TaskActivity[];
|
|
509
|
+
/**
|
|
510
|
+
* ОН-конвейер (finish-to-start chain) for row activities. Inside the row every
|
|
511
|
+
* work follows the previous one; identical works of consecutive chained rows
|
|
512
|
+
* (floors) are linked too. `true` — жёсткий конвейер: перетаскивание сдвигает
|
|
513
|
+
* всю цепочку ниже на ту же дельту. `'push'` — режим «выталкивания» (ASAP):
|
|
514
|
+
* промежутки заполняются при движении вверх по потоку, вниз последователь
|
|
515
|
+
* сдвигается только после коллизии; лаг работы держит зазор постоянным.
|
|
516
|
+
*/
|
|
517
|
+
activityChain?: boolean | 'push';
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* A single work bar rendered inside a multi-activity task row.
|
|
521
|
+
* Activities are visual bars packed into sub-lanes of one row — no hierarchy,
|
|
522
|
+
* no dependencies, no progress of their own.
|
|
523
|
+
*/
|
|
524
|
+
interface TaskActivityTooltipField {
|
|
525
|
+
/** Field caption, e.g. "Подрядчик" */
|
|
526
|
+
label: string;
|
|
527
|
+
/** Field value — any renderable content (string, badge, icon, JSX) */
|
|
528
|
+
value: React$1.ReactNode;
|
|
529
|
+
}
|
|
530
|
+
interface TaskActivity {
|
|
531
|
+
/** Unique identifier within the host task */
|
|
532
|
+
id: string;
|
|
533
|
+
/** Display name rendered inside the activity bar */
|
|
534
|
+
name: string;
|
|
535
|
+
/** Activity start date (ISO string or Date object) */
|
|
536
|
+
startDate: string | Date;
|
|
537
|
+
/** Activity end date (ISO string or Date object) */
|
|
538
|
+
endDate: string | Date;
|
|
539
|
+
/** Optional color; falls back to the default task bar color */
|
|
540
|
+
color?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Обязательный зазор в днях между концом предыдущей работы цепочки и началом
|
|
543
|
+
* этой (например технологическая выдержка). Задан — зазор постоянный;
|
|
544
|
+
* не задан — последователь подтягивается вплотную («как можно раньше»),
|
|
545
|
+
* а зазор тянется, пока его держит другая связь.
|
|
546
|
+
*/
|
|
547
|
+
lag?: number;
|
|
548
|
+
/** Extra fields rendered in the hover tooltip under name/dates (e.g. contractor). */
|
|
549
|
+
tooltipFields?: TaskActivityTooltipField[];
|
|
503
550
|
}
|
|
504
551
|
/**
|
|
505
552
|
* Task dependency definition
|
|
@@ -635,6 +682,18 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
635
682
|
showTaskDateLabels?: boolean;
|
|
636
683
|
/** Render task names to the right of task bars in Gantt mode (default: true). */
|
|
637
684
|
showTaskNames?: boolean;
|
|
685
|
+
/** Render composite child mini-bars inside the parent bar (default: true). */
|
|
686
|
+
showCompositeSegments?: boolean;
|
|
687
|
+
/** Click a work to arm it before dragging; a plain drag then pans the canvas (default: false). */
|
|
688
|
+
activityClickToDrag?: boolean;
|
|
689
|
+
/** Visual of the activated work: 'none' | 'dim' others | 'highlight' its chain (default: 'none'). */
|
|
690
|
+
activityActivationMode?: 'none' | 'dim' | 'highlight';
|
|
691
|
+
/** Draw links between consecutive works of a row (default: true). */
|
|
692
|
+
showActivityLinks?: boolean;
|
|
693
|
+
/** Label the lag («+N») on work links (default: true). */
|
|
694
|
+
showActivityLag?: boolean;
|
|
695
|
+
/** Render extra tooltip content for a work (dates, crew — anything). */
|
|
696
|
+
activityTooltip?: (context: ActivityTooltipContext) => React$1.ReactNode;
|
|
638
697
|
/** Optional vertical timeline markers such as deadlines and checkpoints. */
|
|
639
698
|
timelineMarkers?: TimelineMarker[];
|
|
640
699
|
/** Additional custom columns to render in the TaskList after built-in columns */
|
|
@@ -769,6 +828,45 @@ interface TaskPreviewPositionStore {
|
|
|
769
828
|
setPositions: (positions: Map<string, TaskPreviewPosition>) => void;
|
|
770
829
|
clear: () => void;
|
|
771
830
|
}
|
|
831
|
+
/** Live day-shifts of chained row activities during a conveyor drag: taskId → activityId → dayDelta. */
|
|
832
|
+
interface ActivityPreviewStore {
|
|
833
|
+
subscribeTask: (taskId: string, listener: () => void) => () => void;
|
|
834
|
+
getTaskOverrides: (taskId: string) => Map<string, number> | undefined;
|
|
835
|
+
setOverrides: (overrides: Map<string, Map<string, number>>) => void;
|
|
836
|
+
clear: () => void;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Works that currently stop the dragged work (its binding chain predecessors).
|
|
840
|
+
* The dragged row publishes the blockers; every row renders the matching work
|
|
841
|
+
* with a "blocked" affordance so the reason a bar refuses to move is visible.
|
|
842
|
+
*/
|
|
843
|
+
interface ActivityBlockStore {
|
|
844
|
+
subscribeTask: (taskId: string, listener: () => void) => () => void;
|
|
845
|
+
/** Ids of works in the task that currently block the dragged work. */
|
|
846
|
+
getTaskBlockers: (taskId: string) => Set<string> | undefined;
|
|
847
|
+
setBlockers: (blockers: Map<string, Set<string>>) => void;
|
|
848
|
+
clear: () => void;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Which row activity is being dragged right now — `taskId \0 activityId`.
|
|
852
|
+
* Hover handlers read it synchronously so a drag in one row never lets another
|
|
853
|
+
* row mount a competing tooltip. It deliberately has no subscription: nothing
|
|
854
|
+
* needs to re-render when the owner changes, only the next hover is gated.
|
|
855
|
+
*/
|
|
856
|
+
interface ActivityDragOwner {
|
|
857
|
+
get: () => string | null;
|
|
858
|
+
set: (ownerKey: string | null) => void;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Which activity bar is currently activated by a click. A bar can only be
|
|
862
|
+
* dragged after activation, so a stray drag pans the canvas instead of
|
|
863
|
+
* nudging a work. `null` means nothing is activated.
|
|
864
|
+
*/
|
|
865
|
+
interface ActivityActivationStore {
|
|
866
|
+
subscribe: (listener: () => void) => () => void;
|
|
867
|
+
getActiveKey: () => string | null;
|
|
868
|
+
setActiveKey: (ownerKey: string | null) => void;
|
|
869
|
+
}
|
|
772
870
|
|
|
773
871
|
interface TaskRowProps {
|
|
774
872
|
/** Task data to render */
|
|
@@ -807,6 +905,29 @@ interface TaskRowProps {
|
|
|
807
905
|
};
|
|
808
906
|
/** External per-task preview store used to avoid chart-wide renders during cascade drag */
|
|
809
907
|
previewPositionStore?: TaskPreviewPositionStore;
|
|
908
|
+
/** Live day-shifts of chained row activities in other rows during a conveyor drag. */
|
|
909
|
+
activityPreviewStore?: ActivityPreviewStore;
|
|
910
|
+
/** Works that currently stop the dragged work — highlighted while a drag is blocked. */
|
|
911
|
+
activityBlockStore?: ActivityBlockStore;
|
|
912
|
+
/** Owner of the in-flight activity drag, so other rows mute their hover tooltips. */
|
|
913
|
+
activityDragOwner?: ActivityDragOwner;
|
|
914
|
+
/** Tracks which activity bar is click-activated; only an active bar can be dragged. */
|
|
915
|
+
activityActivationStore?: ActivityActivationStore;
|
|
916
|
+
/** Click a work to arm it before dragging (default: false). */
|
|
917
|
+
activityClickToDrag?: boolean;
|
|
918
|
+
/** Visual of the activated work: 'none' | 'dim' | 'highlight' (default: 'none'). */
|
|
919
|
+
activityActivationMode?: 'none' | 'dim' | 'highlight';
|
|
920
|
+
/** Draw links between consecutive works of a row (default: true). */
|
|
921
|
+
showActivityLinks?: boolean;
|
|
922
|
+
/** Label the lag on work links (default: true). */
|
|
923
|
+
showActivityLag?: boolean;
|
|
924
|
+
/** Render extra tooltip content for a work (dates, crew — anything). */
|
|
925
|
+
activityTooltip?: (context: ActivityTooltipContext) => React$1.ReactNode;
|
|
926
|
+
/** Visible horizontal pixel window; activity bars outside it are not rendered (pan optimization). */
|
|
927
|
+
horizontalWindow?: {
|
|
928
|
+
startPx: number;
|
|
929
|
+
endPx: number;
|
|
930
|
+
};
|
|
810
931
|
/** Called each RAF during cascade drag with override positions for non-dragged chain tasks */
|
|
811
932
|
onCascadeProgress?: (overrides: Map<string, {
|
|
812
933
|
left: number;
|
|
@@ -847,6 +968,8 @@ interface TaskRowProps {
|
|
|
847
968
|
showTaskDateLabels?: boolean;
|
|
848
969
|
/** Render the task name to the right of the task bar (default: true). */
|
|
849
970
|
showTaskNames?: boolean;
|
|
971
|
+
/** Render composite child mini-bars inside the parent bar (default: true). */
|
|
972
|
+
showCompositeSegments?: boolean;
|
|
850
973
|
/** Open or close the composite detail rows. */
|
|
851
974
|
onCompositeToggle?: (source: 'release' | 'click' | 'keyboard') => void;
|
|
852
975
|
compactDetail?: boolean;
|
|
@@ -932,6 +1055,11 @@ interface GridBackgroundProps {
|
|
|
932
1055
|
showWeekendBlocks?: boolean;
|
|
933
1056
|
/** Whether to render vertical grid lines. */
|
|
934
1057
|
showGridLines?: boolean;
|
|
1058
|
+
/** Visible horizontal pixel window in timeline coordinates; offscreen grid DOM is skipped. */
|
|
1059
|
+
horizontalWindow?: {
|
|
1060
|
+
startPx: number;
|
|
1061
|
+
endPx: number;
|
|
1062
|
+
};
|
|
935
1063
|
}
|
|
936
1064
|
/**
|
|
937
1065
|
* GridBackground component - renders vertical grid lines and weekend background highlighting
|
|
@@ -1334,6 +1462,118 @@ interface UseTaskDragReturn {
|
|
|
1334
1462
|
*/
|
|
1335
1463
|
declare const useTaskDrag: (options: UseTaskDragOptions) => UseTaskDragReturn;
|
|
1336
1464
|
|
|
1465
|
+
declare const ACTIVITY_LANE_STEP = 28;
|
|
1466
|
+
declare const ACTIVITY_LANE_BAR_HEIGHT = 24;
|
|
1467
|
+
declare const ACTIVITY_LANES_PADDING = 2;
|
|
1468
|
+
interface ActivitySegment {
|
|
1469
|
+
id: string;
|
|
1470
|
+
name: string;
|
|
1471
|
+
color?: string;
|
|
1472
|
+
/** Lane index counted from the top */
|
|
1473
|
+
lane: number;
|
|
1474
|
+
/** Left offset in px from the timeline start */
|
|
1475
|
+
left: number;
|
|
1476
|
+
/** Width in px, end date inclusive */
|
|
1477
|
+
width: number;
|
|
1478
|
+
/** Обязательный технологический зазор перед стартом работы (в днях). */
|
|
1479
|
+
lag?: number;
|
|
1480
|
+
}
|
|
1481
|
+
interface ActivityLanesLayout {
|
|
1482
|
+
segments: ActivitySegment[];
|
|
1483
|
+
laneCount: number;
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Pack intervals into the smallest number of lanes greedily (first fit):
|
|
1487
|
+
* a sequential work lands in the first lane free at its start, a concurrent
|
|
1488
|
+
* one opens a new lane below. Lane count therefore equals the maximum number
|
|
1489
|
+
* of simultaneous activities.
|
|
1490
|
+
*/
|
|
1491
|
+
declare function packIntervals<T extends {
|
|
1492
|
+
start: number;
|
|
1493
|
+
end: number;
|
|
1494
|
+
}>(intervals: T[]): Array<T & {
|
|
1495
|
+
lane: number;
|
|
1496
|
+
}>;
|
|
1497
|
+
/**
|
|
1498
|
+
* Resolve the lane layout of one task's activities in px geometry.
|
|
1499
|
+
* Used both for rendering (segments) and for the row height (laneCount).
|
|
1500
|
+
*/
|
|
1501
|
+
declare function computeActivityLanes(activities: TaskActivity$1[], monthStart: Date, dayWidth: number): ActivityLanesLayout;
|
|
1502
|
+
/**
|
|
1503
|
+
* Row height needed to show the given number of activity lanes,
|
|
1504
|
+
* or 0 when the row fits its normal height (single lane or none).
|
|
1505
|
+
*/
|
|
1506
|
+
declare function activityLanesExtraHeight(laneCount: number): number;
|
|
1507
|
+
/** Inclusive day-length helper for date-based lane counting. */
|
|
1508
|
+
declare function activitySpanMs(activity: Pick<TaskActivity$1, 'startDate' | 'endDate'>): {
|
|
1509
|
+
start: number;
|
|
1510
|
+
end: number;
|
|
1511
|
+
};
|
|
1512
|
+
/** Сдвиг даты на N дней с сохранением типа (ISO-строка остаётся ISO-строкой). */
|
|
1513
|
+
declare function shiftActivityDate(value: string | Date, days: number): string | Date;
|
|
1514
|
+
interface ActivityChainTask {
|
|
1515
|
+
id: string;
|
|
1516
|
+
activityChain?: boolean | 'push';
|
|
1517
|
+
activities?: TaskActivity$1[];
|
|
1518
|
+
}
|
|
1519
|
+
interface ActivityChainShift {
|
|
1520
|
+
taskId: string;
|
|
1521
|
+
activities: TaskActivity$1[];
|
|
1522
|
+
/** Ids of the activities that were actually shifted (chain successors). */
|
|
1523
|
+
shiftedIds: Set<string>;
|
|
1524
|
+
/** Per-activity day delta applied (successor id → days). */
|
|
1525
|
+
deltas: Map<string, number>;
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* ОН-конвейер (жёсткий режим): работы едут вслед за изменённой.
|
|
1529
|
+
* Рёбра цепочки: внутри строки работы идут друг за другом (окончание–начало),
|
|
1530
|
+
* одинаковые (тот же id или имя) работы соседних строк-этажей связаны между собой.
|
|
1531
|
+
* Весь конвейер ниже изменённой работы сдвигается на ту же дельту (жёстко, без пересчёта).
|
|
1532
|
+
* Возвращает только реально изменившиеся задачи; сама изменённая работа не сдвигается.
|
|
1533
|
+
*/
|
|
1534
|
+
declare function shiftActivityChain(orderedTasks: ActivityChainTask[], draggedTaskId: string, draggedActivityId: string, deltaDays: number): ActivityChainShift[];
|
|
1535
|
+
/**
|
|
1536
|
+
* Ограничение старта работы входящими связями конвейера: минимальный день начала
|
|
1537
|
+
* и работы-предшественники, которые этот минимум задают. Используется и для
|
|
1538
|
+
* жёсткого ограничения перетаскивания, и для визуальной подсказки «почему не едет».
|
|
1539
|
+
*/
|
|
1540
|
+
interface ActivityStartConstraint {
|
|
1541
|
+
/** Минимально допустимый день старта (включительно). */
|
|
1542
|
+
minStartDay: number;
|
|
1543
|
+
/** Дельта в днях от текущего старта до минимума (может быть отрицательной). */
|
|
1544
|
+
minStartDelta: number;
|
|
1545
|
+
/** Предшественники, задающие минимум (несколько при равном ограничении). */
|
|
1546
|
+
blockers: Array<{
|
|
1547
|
+
taskId: string;
|
|
1548
|
+
activityId: string;
|
|
1549
|
+
}>;
|
|
1550
|
+
/** Зазор ограничивающей связи (в днях). */
|
|
1551
|
+
lag: number;
|
|
1552
|
+
}
|
|
1553
|
+
declare function activityStartConstraint(orderedTasks: ActivityChainTask[], taskId: string, activityId: string): ActivityStartConstraint | null;
|
|
1554
|
+
/**
|
|
1555
|
+
* Минимальная дельта перетаскивания (в днях), при которой начало работы не
|
|
1556
|
+
* нарушает входящие связи конвейера (конец предыдущей + лаг). null — входящих нет.
|
|
1557
|
+
*/
|
|
1558
|
+
declare function activityChainMinStartDelta(orderedTasks: ActivityChainTask[], taskId: string, activityId: string): number | null;
|
|
1559
|
+
interface ActivityChainPushResult {
|
|
1560
|
+
shifts: ActivityChainShift[];
|
|
1561
|
+
draggedDeltaDays: number;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Режим «выталкивания» (принцип «как можно раньше»), асимметрично:
|
|
1565
|
+
* — предок ушёл влево → последователь подтягивается за ним (промежуток заполняется),
|
|
1566
|
+
* но не левее своих других связей;
|
|
1567
|
+
* — предок ушёл вправо → последователь стоит (зазор тянется), пока конец предка
|
|
1568
|
+
* не пересёк его старт — тогда выталкивается;
|
|
1569
|
+
* — лаг преемника — минимальный зазор: при заполнении и выталкивании держится
|
|
1570
|
+
* ровно «конец предка + лаг» (постоянный, например технология).
|
|
1571
|
+
* Пересчёт каскадом вниз по цепочке от изменённой работы; работы вне достижимого
|
|
1572
|
+
* подмножества не трогаются. Ограничение старта самой изменённой работы —
|
|
1573
|
+
* на вызывающем (activityChainMinStartDelta).
|
|
1574
|
+
*/
|
|
1575
|
+
declare function pushActivityChain(orderedTasks: ActivityChainTask[], draggedTaskId: string, draggedActivityId: string, requestedDeltaDays: number): ActivityChainPushResult;
|
|
1576
|
+
|
|
1337
1577
|
/**
|
|
1338
1578
|
* UI adapter: converts pixel coordinates to date ranges for drag interactions.
|
|
1339
1579
|
* @module adapters/scheduling
|
|
@@ -1629,4 +1869,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
|
|
|
1629
1869
|
}
|
|
1630
1870
|
declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
|
|
1631
1871
|
|
|
1632
|
-
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
|
|
1872
|
+
export { ACTIVITY_LANES_PADDING, ACTIVITY_LANE_BAR_HEIGHT, ACTIVITY_LANE_STEP, type ActivityChainPushResult, type ActivityChainShift, type ActivityChainTask, type ActivityLanesLayout, type ActivitySegment, type ActivityStartConstraint, ActivityTooltipContext, type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskActivity$1 as TaskActivity, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, activityChainMinStartDelta, activityLanesExtraHeight, activitySpanMs, activityStartConstraint, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, computeActivityLanes, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, packIntervals, parseUTCDate, pixelsToDate, progressInRange, pushActivityChain, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, shiftActivityChain, shiftActivityDate, subtractBusinessDays, useTaskDrag, withoutDeps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, b as TimelineMarker, c as TaskDateChangeMode, S as ScaleTaskSubtreeResult, d as ResourcePlannerChartProps, e as ResourceTimelineResource } from './index-
|
|
3
|
-
export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS,
|
|
2
|
+
import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, A as ActivityTooltipContext, b as TimelineMarker, c as TaskDateChangeMode, S as ScaleTaskSubtreeResult, d as ResourcePlannerChartProps, e as TaskActivity$1, f as ResourceTimelineResource } from './index-DheG4h0O.js';
|
|
3
|
+
export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, g as DependencyError, h as GanttChartMode, i as GridConfig, j as GridLine, L as LinkType, M as MonthSpan, k as ResourceTableColumnId, l as ResourceTableColumnWidthMap, m as ResourceTimelineMove, n as ResourceTimelineResourceMenuCommand, o as ScaleTaskSubtreeAnchor, p as ScaleTaskSubtreeErrorCode, q as ScaleTaskSubtreeExternalPolicy, r as ScaleTaskSubtreeOptions, s as ScaleTaskSubtreeWarning, t as TaskActivityTooltipField, u as TaskBarGeometry, W as WeekendBlock, v as alignToWorkingDay, w as areTasksHierarchicallyRelated, x as buildAdjacencyList, y as buildTaskRangeFromEnd, z as buildTaskRangeFromStart, E as calculateSuccessorDate, F as cascadeByLinks, H as clampTaskRangeForIncomingFS, I as computeCriticalPath, J as computeLagFromDates, K as computeParentDates, N as computeParentProgress, O as detectCycles, P as extendCriticalIdsToParents, Q as findParentId, U as getAllDependencyEdges, X as getAllDescendants, Y as getBusinessDayOffset, Z as getChildren, _ as getDependencyLag, $ as getSuccessorChain, a0 as getTaskDuration, a1 as getTransitiveCascadeChain, a2 as isAncestorTask, a3 as isTaskParent, a4 as moveTaskRange, a5 as moveTaskWithCascade, a6 as normalizeDependencyLag, a7 as normalizePredecessorDates, a8 as normalizeTaskDependencyLags, a9 as normalizeUTCDate, aa as parseDateOnly, ab as recalculateIncomingLags, ac as recalculateProjectSchedule, ad as recalculateTaskFromDependencies, ae as reflowTasksOnModeSwitch, af as removeDependenciesBetweenTasks, ag as resizeTaskWithCascade, ah as scaleTaskSubtreeDuration, ai as shiftBusinessDayOffset, aj as universalCascade, ak as validateDependencies } from './index-DheG4h0O.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as RadixPopover from '@radix-ui/react-popover';
|
|
6
6
|
|
|
@@ -500,6 +500,53 @@ interface Task {
|
|
|
500
500
|
divider?: 'top' | 'bottom';
|
|
501
501
|
/** Whether task dates match the linked work template (visual indicator only) */
|
|
502
502
|
synced?: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* Optional list of works rendered as bars packed into sub-lanes of this row
|
|
505
|
+
* (e.g. finishing works on one floor). Replaces the main bar for the row and
|
|
506
|
+
* grows the row height to fit concurrent activities. Works in gantt mode only.
|
|
507
|
+
*/
|
|
508
|
+
activities?: TaskActivity[];
|
|
509
|
+
/**
|
|
510
|
+
* ОН-конвейер (finish-to-start chain) for row activities. Inside the row every
|
|
511
|
+
* work follows the previous one; identical works of consecutive chained rows
|
|
512
|
+
* (floors) are linked too. `true` — жёсткий конвейер: перетаскивание сдвигает
|
|
513
|
+
* всю цепочку ниже на ту же дельту. `'push'` — режим «выталкивания» (ASAP):
|
|
514
|
+
* промежутки заполняются при движении вверх по потоку, вниз последователь
|
|
515
|
+
* сдвигается только после коллизии; лаг работы держит зазор постоянным.
|
|
516
|
+
*/
|
|
517
|
+
activityChain?: boolean | 'push';
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* A single work bar rendered inside a multi-activity task row.
|
|
521
|
+
* Activities are visual bars packed into sub-lanes of one row — no hierarchy,
|
|
522
|
+
* no dependencies, no progress of their own.
|
|
523
|
+
*/
|
|
524
|
+
interface TaskActivityTooltipField {
|
|
525
|
+
/** Field caption, e.g. "Подрядчик" */
|
|
526
|
+
label: string;
|
|
527
|
+
/** Field value — any renderable content (string, badge, icon, JSX) */
|
|
528
|
+
value: React$1.ReactNode;
|
|
529
|
+
}
|
|
530
|
+
interface TaskActivity {
|
|
531
|
+
/** Unique identifier within the host task */
|
|
532
|
+
id: string;
|
|
533
|
+
/** Display name rendered inside the activity bar */
|
|
534
|
+
name: string;
|
|
535
|
+
/** Activity start date (ISO string or Date object) */
|
|
536
|
+
startDate: string | Date;
|
|
537
|
+
/** Activity end date (ISO string or Date object) */
|
|
538
|
+
endDate: string | Date;
|
|
539
|
+
/** Optional color; falls back to the default task bar color */
|
|
540
|
+
color?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Обязательный зазор в днях между концом предыдущей работы цепочки и началом
|
|
543
|
+
* этой (например технологическая выдержка). Задан — зазор постоянный;
|
|
544
|
+
* не задан — последователь подтягивается вплотную («как можно раньше»),
|
|
545
|
+
* а зазор тянется, пока его держит другая связь.
|
|
546
|
+
*/
|
|
547
|
+
lag?: number;
|
|
548
|
+
/** Extra fields rendered in the hover tooltip under name/dates (e.g. contractor). */
|
|
549
|
+
tooltipFields?: TaskActivityTooltipField[];
|
|
503
550
|
}
|
|
504
551
|
/**
|
|
505
552
|
* Task dependency definition
|
|
@@ -635,6 +682,18 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
635
682
|
showTaskDateLabels?: boolean;
|
|
636
683
|
/** Render task names to the right of task bars in Gantt mode (default: true). */
|
|
637
684
|
showTaskNames?: boolean;
|
|
685
|
+
/** Render composite child mini-bars inside the parent bar (default: true). */
|
|
686
|
+
showCompositeSegments?: boolean;
|
|
687
|
+
/** Click a work to arm it before dragging; a plain drag then pans the canvas (default: false). */
|
|
688
|
+
activityClickToDrag?: boolean;
|
|
689
|
+
/** Visual of the activated work: 'none' | 'dim' others | 'highlight' its chain (default: 'none'). */
|
|
690
|
+
activityActivationMode?: 'none' | 'dim' | 'highlight';
|
|
691
|
+
/** Draw links between consecutive works of a row (default: true). */
|
|
692
|
+
showActivityLinks?: boolean;
|
|
693
|
+
/** Label the lag («+N») on work links (default: true). */
|
|
694
|
+
showActivityLag?: boolean;
|
|
695
|
+
/** Render extra tooltip content for a work (dates, crew — anything). */
|
|
696
|
+
activityTooltip?: (context: ActivityTooltipContext) => React$1.ReactNode;
|
|
638
697
|
/** Optional vertical timeline markers such as deadlines and checkpoints. */
|
|
639
698
|
timelineMarkers?: TimelineMarker[];
|
|
640
699
|
/** Additional custom columns to render in the TaskList after built-in columns */
|
|
@@ -769,6 +828,45 @@ interface TaskPreviewPositionStore {
|
|
|
769
828
|
setPositions: (positions: Map<string, TaskPreviewPosition>) => void;
|
|
770
829
|
clear: () => void;
|
|
771
830
|
}
|
|
831
|
+
/** Live day-shifts of chained row activities during a conveyor drag: taskId → activityId → dayDelta. */
|
|
832
|
+
interface ActivityPreviewStore {
|
|
833
|
+
subscribeTask: (taskId: string, listener: () => void) => () => void;
|
|
834
|
+
getTaskOverrides: (taskId: string) => Map<string, number> | undefined;
|
|
835
|
+
setOverrides: (overrides: Map<string, Map<string, number>>) => void;
|
|
836
|
+
clear: () => void;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Works that currently stop the dragged work (its binding chain predecessors).
|
|
840
|
+
* The dragged row publishes the blockers; every row renders the matching work
|
|
841
|
+
* with a "blocked" affordance so the reason a bar refuses to move is visible.
|
|
842
|
+
*/
|
|
843
|
+
interface ActivityBlockStore {
|
|
844
|
+
subscribeTask: (taskId: string, listener: () => void) => () => void;
|
|
845
|
+
/** Ids of works in the task that currently block the dragged work. */
|
|
846
|
+
getTaskBlockers: (taskId: string) => Set<string> | undefined;
|
|
847
|
+
setBlockers: (blockers: Map<string, Set<string>>) => void;
|
|
848
|
+
clear: () => void;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Which row activity is being dragged right now — `taskId \0 activityId`.
|
|
852
|
+
* Hover handlers read it synchronously so a drag in one row never lets another
|
|
853
|
+
* row mount a competing tooltip. It deliberately has no subscription: nothing
|
|
854
|
+
* needs to re-render when the owner changes, only the next hover is gated.
|
|
855
|
+
*/
|
|
856
|
+
interface ActivityDragOwner {
|
|
857
|
+
get: () => string | null;
|
|
858
|
+
set: (ownerKey: string | null) => void;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Which activity bar is currently activated by a click. A bar can only be
|
|
862
|
+
* dragged after activation, so a stray drag pans the canvas instead of
|
|
863
|
+
* nudging a work. `null` means nothing is activated.
|
|
864
|
+
*/
|
|
865
|
+
interface ActivityActivationStore {
|
|
866
|
+
subscribe: (listener: () => void) => () => void;
|
|
867
|
+
getActiveKey: () => string | null;
|
|
868
|
+
setActiveKey: (ownerKey: string | null) => void;
|
|
869
|
+
}
|
|
772
870
|
|
|
773
871
|
interface TaskRowProps {
|
|
774
872
|
/** Task data to render */
|
|
@@ -807,6 +905,29 @@ interface TaskRowProps {
|
|
|
807
905
|
};
|
|
808
906
|
/** External per-task preview store used to avoid chart-wide renders during cascade drag */
|
|
809
907
|
previewPositionStore?: TaskPreviewPositionStore;
|
|
908
|
+
/** Live day-shifts of chained row activities in other rows during a conveyor drag. */
|
|
909
|
+
activityPreviewStore?: ActivityPreviewStore;
|
|
910
|
+
/** Works that currently stop the dragged work — highlighted while a drag is blocked. */
|
|
911
|
+
activityBlockStore?: ActivityBlockStore;
|
|
912
|
+
/** Owner of the in-flight activity drag, so other rows mute their hover tooltips. */
|
|
913
|
+
activityDragOwner?: ActivityDragOwner;
|
|
914
|
+
/** Tracks which activity bar is click-activated; only an active bar can be dragged. */
|
|
915
|
+
activityActivationStore?: ActivityActivationStore;
|
|
916
|
+
/** Click a work to arm it before dragging (default: false). */
|
|
917
|
+
activityClickToDrag?: boolean;
|
|
918
|
+
/** Visual of the activated work: 'none' | 'dim' | 'highlight' (default: 'none'). */
|
|
919
|
+
activityActivationMode?: 'none' | 'dim' | 'highlight';
|
|
920
|
+
/** Draw links between consecutive works of a row (default: true). */
|
|
921
|
+
showActivityLinks?: boolean;
|
|
922
|
+
/** Label the lag on work links (default: true). */
|
|
923
|
+
showActivityLag?: boolean;
|
|
924
|
+
/** Render extra tooltip content for a work (dates, crew — anything). */
|
|
925
|
+
activityTooltip?: (context: ActivityTooltipContext) => React$1.ReactNode;
|
|
926
|
+
/** Visible horizontal pixel window; activity bars outside it are not rendered (pan optimization). */
|
|
927
|
+
horizontalWindow?: {
|
|
928
|
+
startPx: number;
|
|
929
|
+
endPx: number;
|
|
930
|
+
};
|
|
810
931
|
/** Called each RAF during cascade drag with override positions for non-dragged chain tasks */
|
|
811
932
|
onCascadeProgress?: (overrides: Map<string, {
|
|
812
933
|
left: number;
|
|
@@ -847,6 +968,8 @@ interface TaskRowProps {
|
|
|
847
968
|
showTaskDateLabels?: boolean;
|
|
848
969
|
/** Render the task name to the right of the task bar (default: true). */
|
|
849
970
|
showTaskNames?: boolean;
|
|
971
|
+
/** Render composite child mini-bars inside the parent bar (default: true). */
|
|
972
|
+
showCompositeSegments?: boolean;
|
|
850
973
|
/** Open or close the composite detail rows. */
|
|
851
974
|
onCompositeToggle?: (source: 'release' | 'click' | 'keyboard') => void;
|
|
852
975
|
compactDetail?: boolean;
|
|
@@ -932,6 +1055,11 @@ interface GridBackgroundProps {
|
|
|
932
1055
|
showWeekendBlocks?: boolean;
|
|
933
1056
|
/** Whether to render vertical grid lines. */
|
|
934
1057
|
showGridLines?: boolean;
|
|
1058
|
+
/** Visible horizontal pixel window in timeline coordinates; offscreen grid DOM is skipped. */
|
|
1059
|
+
horizontalWindow?: {
|
|
1060
|
+
startPx: number;
|
|
1061
|
+
endPx: number;
|
|
1062
|
+
};
|
|
935
1063
|
}
|
|
936
1064
|
/**
|
|
937
1065
|
* GridBackground component - renders vertical grid lines and weekend background highlighting
|
|
@@ -1334,6 +1462,118 @@ interface UseTaskDragReturn {
|
|
|
1334
1462
|
*/
|
|
1335
1463
|
declare const useTaskDrag: (options: UseTaskDragOptions) => UseTaskDragReturn;
|
|
1336
1464
|
|
|
1465
|
+
declare const ACTIVITY_LANE_STEP = 28;
|
|
1466
|
+
declare const ACTIVITY_LANE_BAR_HEIGHT = 24;
|
|
1467
|
+
declare const ACTIVITY_LANES_PADDING = 2;
|
|
1468
|
+
interface ActivitySegment {
|
|
1469
|
+
id: string;
|
|
1470
|
+
name: string;
|
|
1471
|
+
color?: string;
|
|
1472
|
+
/** Lane index counted from the top */
|
|
1473
|
+
lane: number;
|
|
1474
|
+
/** Left offset in px from the timeline start */
|
|
1475
|
+
left: number;
|
|
1476
|
+
/** Width in px, end date inclusive */
|
|
1477
|
+
width: number;
|
|
1478
|
+
/** Обязательный технологический зазор перед стартом работы (в днях). */
|
|
1479
|
+
lag?: number;
|
|
1480
|
+
}
|
|
1481
|
+
interface ActivityLanesLayout {
|
|
1482
|
+
segments: ActivitySegment[];
|
|
1483
|
+
laneCount: number;
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Pack intervals into the smallest number of lanes greedily (first fit):
|
|
1487
|
+
* a sequential work lands in the first lane free at its start, a concurrent
|
|
1488
|
+
* one opens a new lane below. Lane count therefore equals the maximum number
|
|
1489
|
+
* of simultaneous activities.
|
|
1490
|
+
*/
|
|
1491
|
+
declare function packIntervals<T extends {
|
|
1492
|
+
start: number;
|
|
1493
|
+
end: number;
|
|
1494
|
+
}>(intervals: T[]): Array<T & {
|
|
1495
|
+
lane: number;
|
|
1496
|
+
}>;
|
|
1497
|
+
/**
|
|
1498
|
+
* Resolve the lane layout of one task's activities in px geometry.
|
|
1499
|
+
* Used both for rendering (segments) and for the row height (laneCount).
|
|
1500
|
+
*/
|
|
1501
|
+
declare function computeActivityLanes(activities: TaskActivity$1[], monthStart: Date, dayWidth: number): ActivityLanesLayout;
|
|
1502
|
+
/**
|
|
1503
|
+
* Row height needed to show the given number of activity lanes,
|
|
1504
|
+
* or 0 when the row fits its normal height (single lane or none).
|
|
1505
|
+
*/
|
|
1506
|
+
declare function activityLanesExtraHeight(laneCount: number): number;
|
|
1507
|
+
/** Inclusive day-length helper for date-based lane counting. */
|
|
1508
|
+
declare function activitySpanMs(activity: Pick<TaskActivity$1, 'startDate' | 'endDate'>): {
|
|
1509
|
+
start: number;
|
|
1510
|
+
end: number;
|
|
1511
|
+
};
|
|
1512
|
+
/** Сдвиг даты на N дней с сохранением типа (ISO-строка остаётся ISO-строкой). */
|
|
1513
|
+
declare function shiftActivityDate(value: string | Date, days: number): string | Date;
|
|
1514
|
+
interface ActivityChainTask {
|
|
1515
|
+
id: string;
|
|
1516
|
+
activityChain?: boolean | 'push';
|
|
1517
|
+
activities?: TaskActivity$1[];
|
|
1518
|
+
}
|
|
1519
|
+
interface ActivityChainShift {
|
|
1520
|
+
taskId: string;
|
|
1521
|
+
activities: TaskActivity$1[];
|
|
1522
|
+
/** Ids of the activities that were actually shifted (chain successors). */
|
|
1523
|
+
shiftedIds: Set<string>;
|
|
1524
|
+
/** Per-activity day delta applied (successor id → days). */
|
|
1525
|
+
deltas: Map<string, number>;
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* ОН-конвейер (жёсткий режим): работы едут вслед за изменённой.
|
|
1529
|
+
* Рёбра цепочки: внутри строки работы идут друг за другом (окончание–начало),
|
|
1530
|
+
* одинаковые (тот же id или имя) работы соседних строк-этажей связаны между собой.
|
|
1531
|
+
* Весь конвейер ниже изменённой работы сдвигается на ту же дельту (жёстко, без пересчёта).
|
|
1532
|
+
* Возвращает только реально изменившиеся задачи; сама изменённая работа не сдвигается.
|
|
1533
|
+
*/
|
|
1534
|
+
declare function shiftActivityChain(orderedTasks: ActivityChainTask[], draggedTaskId: string, draggedActivityId: string, deltaDays: number): ActivityChainShift[];
|
|
1535
|
+
/**
|
|
1536
|
+
* Ограничение старта работы входящими связями конвейера: минимальный день начала
|
|
1537
|
+
* и работы-предшественники, которые этот минимум задают. Используется и для
|
|
1538
|
+
* жёсткого ограничения перетаскивания, и для визуальной подсказки «почему не едет».
|
|
1539
|
+
*/
|
|
1540
|
+
interface ActivityStartConstraint {
|
|
1541
|
+
/** Минимально допустимый день старта (включительно). */
|
|
1542
|
+
minStartDay: number;
|
|
1543
|
+
/** Дельта в днях от текущего старта до минимума (может быть отрицательной). */
|
|
1544
|
+
minStartDelta: number;
|
|
1545
|
+
/** Предшественники, задающие минимум (несколько при равном ограничении). */
|
|
1546
|
+
blockers: Array<{
|
|
1547
|
+
taskId: string;
|
|
1548
|
+
activityId: string;
|
|
1549
|
+
}>;
|
|
1550
|
+
/** Зазор ограничивающей связи (в днях). */
|
|
1551
|
+
lag: number;
|
|
1552
|
+
}
|
|
1553
|
+
declare function activityStartConstraint(orderedTasks: ActivityChainTask[], taskId: string, activityId: string): ActivityStartConstraint | null;
|
|
1554
|
+
/**
|
|
1555
|
+
* Минимальная дельта перетаскивания (в днях), при которой начало работы не
|
|
1556
|
+
* нарушает входящие связи конвейера (конец предыдущей + лаг). null — входящих нет.
|
|
1557
|
+
*/
|
|
1558
|
+
declare function activityChainMinStartDelta(orderedTasks: ActivityChainTask[], taskId: string, activityId: string): number | null;
|
|
1559
|
+
interface ActivityChainPushResult {
|
|
1560
|
+
shifts: ActivityChainShift[];
|
|
1561
|
+
draggedDeltaDays: number;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Режим «выталкивания» (принцип «как можно раньше»), асимметрично:
|
|
1565
|
+
* — предок ушёл влево → последователь подтягивается за ним (промежуток заполняется),
|
|
1566
|
+
* но не левее своих других связей;
|
|
1567
|
+
* — предок ушёл вправо → последователь стоит (зазор тянется), пока конец предка
|
|
1568
|
+
* не пересёк его старт — тогда выталкивается;
|
|
1569
|
+
* — лаг преемника — минимальный зазор: при заполнении и выталкивании держится
|
|
1570
|
+
* ровно «конец предка + лаг» (постоянный, например технология).
|
|
1571
|
+
* Пересчёт каскадом вниз по цепочке от изменённой работы; работы вне достижимого
|
|
1572
|
+
* подмножества не трогаются. Ограничение старта самой изменённой работы —
|
|
1573
|
+
* на вызывающем (activityChainMinStartDelta).
|
|
1574
|
+
*/
|
|
1575
|
+
declare function pushActivityChain(orderedTasks: ActivityChainTask[], draggedTaskId: string, draggedActivityId: string, requestedDeltaDays: number): ActivityChainPushResult;
|
|
1576
|
+
|
|
1337
1577
|
/**
|
|
1338
1578
|
* UI adapter: converts pixel coordinates to date ranges for drag interactions.
|
|
1339
1579
|
* @module adapters/scheduling
|
|
@@ -1629,4 +1869,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
|
|
|
1629
1869
|
}
|
|
1630
1870
|
declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
|
|
1631
1871
|
|
|
1632
|
-
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
|
|
1872
|
+
export { ACTIVITY_LANES_PADDING, ACTIVITY_LANE_BAR_HEIGHT, ACTIVITY_LANE_STEP, type ActivityChainPushResult, type ActivityChainShift, type ActivityChainTask, type ActivityLanesLayout, type ActivitySegment, type ActivityStartConstraint, ActivityTooltipContext, type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskActivity$1 as TaskActivity, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, activityChainMinStartDelta, activityLanesExtraHeight, activitySpanMs, activityStartConstraint, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, computeActivityLanes, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, packIntervals, parseUTCDate, pixelsToDate, progressInRange, pushActivityChain, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, shiftActivityChain, shiftActivityDate, subtractBusinessDays, useTaskDrag, withoutDeps };
|