vlite3 1.4.31 → 1.4.33
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/components/Accordion/Accordion.vue.js +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +4 -3
- package/components/CategoryManager/CategoryNode.vue.js +30 -30
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -11
- package/components/Chart/GanttChart.vue.d.ts +18 -2
- package/components/Chart/GanttChart.vue.js +1 -1
- package/components/Chart/GanttChart.vue2.js +1347 -604
- package/components/Chart/GanttChartConnectorRouting.d.ts +83 -0
- package/components/Chart/GanttChartConnectorRouting.js +405 -0
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +109 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +92 -2
- package/components/Chart/types.js +8 -0
- package/components/ColorPicker/ColorIro.vue2.js +155 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.d.ts +5 -0
- package/components/ColorPicker/ColorPicker.vue.js +111 -65
- package/components/ColorPicker/constants.d.ts +2 -0
- package/components/ColorPicker/constants.js +4 -0
- package/components/ColorPicker/index.d.ts +1 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Dropdown/Dropdown.vue.js +100 -97
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Form/AccordionView.vue.js +5 -220
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +309 -280
- package/components/Form/FormField.vue.js +177 -197
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +7 -7
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/Kanban/Kanban.vue.d.ts +16 -2
- package/components/Kanban/Kanban.vue.js +2 -2
- package/components/Kanban/Kanban.vue2.js +150 -86
- package/components/Kanban/types.d.ts +37 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +19 -18
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +215 -193
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/ToastNotification.vue.js +1 -1
- package/components/ToastNotification.vue2.js +3 -3
- package/components/index.d.ts +3 -2
- package/composables/useKeyStroke.d.ts +18 -0
- package/composables/useKeyStroke.js +103 -77
- package/composables/useTheme.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +380 -350
- package/package.json +12 -4
- package/style.css +1 -1
- package/utils/environment.d.ts +29 -0
- package/utils/environment.js +4 -0
- package/utils/functions.js +14 -13
- package/components/ColorPicker/ColorIro.vue.js +0 -141
- package/components/Form/AccordionView.vue2.js +0 -4
- /package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Obstacle-aware dependency connector routing for GanttChart.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the fixed elbow calculation with a deterministic router that:
|
|
5
|
+
* - anchors finish-to-start edges on the predecessor's right edge and the
|
|
6
|
+
* successor's left edge (milestones use the diamond tips)
|
|
7
|
+
* - distributes exit / entry points when several edges share a task so
|
|
8
|
+
* arrowheads and stubs never stack
|
|
9
|
+
* - generates orthogonal candidate paths per edge (direct, Z-shaped and
|
|
10
|
+
* row-corridor routes, plus variants that slide vertical runs past
|
|
11
|
+
* blocking bars) and picks the cheapest one by length + turns +
|
|
12
|
+
* task-bar collisions + connector crossings/overlaps + viewport cost
|
|
13
|
+
* - nudges coincident segments into separate lanes so parallel connectors
|
|
14
|
+
* stay individually traceable
|
|
15
|
+
* - renders unavoidable crossings with a small line bridge (hop) instead
|
|
16
|
+
* of visually merging two connectors
|
|
17
|
+
*
|
|
18
|
+
* The router is pure and layout-driven: the same bars and edges always
|
|
19
|
+
* produce the same paths (no randomness, input-order independent). It
|
|
20
|
+
* knows nothing about dependency semantics — callers must only pass
|
|
21
|
+
* schedule edges (related-to never reaches here).
|
|
22
|
+
*/
|
|
23
|
+
export interface GanttConnectorBar {
|
|
24
|
+
id: string;
|
|
25
|
+
/** Bar left edge in timeline SVG coordinates */
|
|
26
|
+
x: number;
|
|
27
|
+
/** Bar top edge in timeline SVG coordinates */
|
|
28
|
+
y: number;
|
|
29
|
+
/** Full bar width (not progress width) */
|
|
30
|
+
w: number;
|
|
31
|
+
/** Bar height */
|
|
32
|
+
h: number;
|
|
33
|
+
/** Visible row index the bar sits on */
|
|
34
|
+
row: number;
|
|
35
|
+
milestone?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface GanttConnectorEdge {
|
|
38
|
+
predecessorId: string;
|
|
39
|
+
successorId: string;
|
|
40
|
+
/** Stable edge key (see ganttDependencyEdgeKey) */
|
|
41
|
+
key: string;
|
|
42
|
+
}
|
|
43
|
+
export interface GanttRoutedConnector {
|
|
44
|
+
key: string;
|
|
45
|
+
predecessorId: string;
|
|
46
|
+
successorId: string;
|
|
47
|
+
/** Rounded orthogonal SVG path for the connector line */
|
|
48
|
+
d: string;
|
|
49
|
+
/** Arrowhead path entering the successor's left edge */
|
|
50
|
+
ad: string;
|
|
51
|
+
/** On-path midpoint (delete control / label placement) */
|
|
52
|
+
midX: number;
|
|
53
|
+
midY: number;
|
|
54
|
+
}
|
|
55
|
+
export interface GanttConnectorRoutingOptions {
|
|
56
|
+
rowHeight: number;
|
|
57
|
+
barHeight: number;
|
|
58
|
+
/** Timeline drawing width — routes are kept inside the viewport */
|
|
59
|
+
chartWidth: number;
|
|
60
|
+
/** Timeline drawing height */
|
|
61
|
+
chartHeight: number;
|
|
62
|
+
cornerRadius?: number;
|
|
63
|
+
arrowSize?: number;
|
|
64
|
+
}
|
|
65
|
+
type Pt = {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Build an SVG path with consistent rounded corners and crossing bridges.
|
|
71
|
+
* Exposed for reuse by the lightweight interaction preview.
|
|
72
|
+
*/
|
|
73
|
+
export declare function ganttRoundedConnectorPath(points: ReadonlyArray<Pt>, radius?: number, bridges?: Map<number, number[]>): string;
|
|
74
|
+
/** Arrowhead entering horizontally from the left, tip at (x, y) */
|
|
75
|
+
export declare function ganttConnectorArrowPath(x: number, y: number, size?: number): string;
|
|
76
|
+
/**
|
|
77
|
+
* Lightweight connector path used while dragging/resizing. No obstacle
|
|
78
|
+
* lookup — just the classic elbow with the same rounded-corner styling —
|
|
79
|
+
* so per-frame updates stay cheap. Final routing runs after the gesture.
|
|
80
|
+
*/
|
|
81
|
+
export declare function ganttConnectorPreviewPath(fX: number, fY: number, tX: number, tY: number, rowHeight: number, barHeight: number, radius?: number): string;
|
|
82
|
+
export declare function routeGanttDependencyConnectors(edges: GanttConnectorEdge[], barsById: ReadonlyMap<string, GanttConnectorBar>, options: GanttConnectorRoutingOptions): GanttRoutedConnector[];
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
const g = (t) => Math.round(t * 100) / 100, H = (t, n, e) => Math.min(e, Math.max(n, t));
|
|
2
|
+
function P(t) {
|
|
3
|
+
return t.h * 0.4;
|
|
4
|
+
}
|
|
5
|
+
function k(t) {
|
|
6
|
+
return t.milestone ? t.x + t.w / 2 + P(t) : t.x + t.w;
|
|
7
|
+
}
|
|
8
|
+
function U(t) {
|
|
9
|
+
return t.milestone ? t.x + t.w / 2 - P(t) : t.x;
|
|
10
|
+
}
|
|
11
|
+
function v(t) {
|
|
12
|
+
return t.y + t.h / 2;
|
|
13
|
+
}
|
|
14
|
+
function T(t) {
|
|
15
|
+
if (t.milestone) {
|
|
16
|
+
const n = P(t), e = t.x + t.w / 2, o = v(t);
|
|
17
|
+
return { id: t.id, x: e - n, y: o - n, w: n * 2, h: n * 2, row: t.row };
|
|
18
|
+
}
|
|
19
|
+
return { id: t.id, x: t.x, y: t.y, w: t.w, h: t.h, row: t.row };
|
|
20
|
+
}
|
|
21
|
+
function C(t) {
|
|
22
|
+
const n = [];
|
|
23
|
+
for (let e = 0; e < t.length - 1; e++) {
|
|
24
|
+
const o = t[e], c = t[e + 1];
|
|
25
|
+
Math.abs(o.x - c.x) < 0.01 && Math.abs(o.y - c.y) < 0.01 || n.push({ x1: o.x, y1: o.y, x2: c.x, y2: c.y, vertical: Math.abs(o.x - c.x) < 0.01 });
|
|
26
|
+
}
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
function N(t) {
|
|
30
|
+
return Math.abs(t.x2 - t.x1) + Math.abs(t.y2 - t.y1);
|
|
31
|
+
}
|
|
32
|
+
function A(t, n, e, o, c = 0) {
|
|
33
|
+
const s = Math.max(Math.min(t, n), Math.min(e, o));
|
|
34
|
+
return Math.min(Math.max(t, n), Math.max(e, o)) - s > c;
|
|
35
|
+
}
|
|
36
|
+
function B(t, n) {
|
|
37
|
+
return t.vertical ? t.x1 <= n.x + 0.5 || t.x1 >= n.x + n.w - 0.5 ? !1 : A(t.y1, t.y2, n.y + 0.5, n.y + n.h - 0.5) : t.y1 <= n.y + 0.5 || t.y1 >= n.y + n.h - 0.5 ? !1 : A(t.x1, t.x2, n.x + 0.5, n.x + n.w - 0.5);
|
|
38
|
+
}
|
|
39
|
+
function L(t, n, e = 0.75) {
|
|
40
|
+
if (t.vertical === n.vertical) return !1;
|
|
41
|
+
const o = t.vertical ? t : n, c = t.vertical ? n : t, s = o.x1 > Math.min(c.x1, c.x2) + e && o.x1 < Math.max(c.x1, c.x2) - e, i = c.y1 > Math.min(o.y1, o.y2) + e && c.y1 < Math.max(o.y1, o.y2) - e;
|
|
42
|
+
return s && i;
|
|
43
|
+
}
|
|
44
|
+
function G(t, n, e) {
|
|
45
|
+
return t.vertical !== n.vertical ? !1 : t.vertical ? Math.abs(t.x1 - n.x1) >= e ? !1 : A(t.y1, t.y2, n.y1, n.y2, 4) : Math.abs(t.y1 - n.y1) >= e ? !1 : A(t.x1, t.x2, n.x1, n.x2, 4);
|
|
46
|
+
}
|
|
47
|
+
function O(t) {
|
|
48
|
+
const n = [];
|
|
49
|
+
for (const e of t) {
|
|
50
|
+
const o = n[n.length - 1];
|
|
51
|
+
o && Math.abs(o.x - e.x) < 0.01 && Math.abs(o.y - e.y) < 0.01 || n.push({ x: e.x, y: e.y });
|
|
52
|
+
}
|
|
53
|
+
for (let e = n.length - 2; e >= 1; e--) {
|
|
54
|
+
const o = n[e - 1], c = n[e], s = n[e + 1], i = Math.abs(o.x - c.x) < 0.01, r = Math.abs(c.x - s.x) < 0.01, l = Math.abs(o.y - c.y) < 0.01, h = Math.abs(c.y - s.y) < 0.01;
|
|
55
|
+
(i && r || l && h) && n.splice(e, 1);
|
|
56
|
+
}
|
|
57
|
+
return n;
|
|
58
|
+
}
|
|
59
|
+
class V {
|
|
60
|
+
byRow = /* @__PURE__ */ new Map();
|
|
61
|
+
rowHeight;
|
|
62
|
+
constructor(n, e) {
|
|
63
|
+
this.rowHeight = e;
|
|
64
|
+
for (const o of n) {
|
|
65
|
+
const c = T(o), s = this.byRow.get(c.row);
|
|
66
|
+
s ? s.push(c) : this.byRow.set(c.row, [c]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** First obstacle strictly intersected by the segment, or null */
|
|
70
|
+
firstHit(n, e, o) {
|
|
71
|
+
const c = Math.min(n.y1, n.y2), s = Math.max(n.y1, n.y2), i = Math.floor(c / this.rowHeight) - 1, r = Math.floor(s / this.rowHeight) + 1;
|
|
72
|
+
for (let l = i; l <= r; l++) {
|
|
73
|
+
const h = this.byRow.get(l);
|
|
74
|
+
if (h) {
|
|
75
|
+
for (const f of h)
|
|
76
|
+
if (!(f.id === e || f.id === o) && B(n, f))
|
|
77
|
+
return f;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/** Number of obstacles strictly intersected by the segment */
|
|
83
|
+
hitCount(n, e, o) {
|
|
84
|
+
const c = Math.min(n.y1, n.y2), s = Math.max(n.y1, n.y2), i = Math.floor(c / this.rowHeight) - 1, r = Math.floor(s / this.rowHeight) + 1;
|
|
85
|
+
let l = 0;
|
|
86
|
+
for (let h = i; h <= r; h++) {
|
|
87
|
+
const f = this.byRow.get(h);
|
|
88
|
+
if (f)
|
|
89
|
+
for (const u of f)
|
|
90
|
+
u.id === e || u.id === o || B(n, u) && l++;
|
|
91
|
+
}
|
|
92
|
+
return l;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function $(t, n, e) {
|
|
96
|
+
const o = /* @__PURE__ */ new Map();
|
|
97
|
+
for (const s of t) {
|
|
98
|
+
const i = n === "source" ? s.pred.id : s.succ.id, r = o.get(i);
|
|
99
|
+
r ? r.push(s) : o.set(i, [s]);
|
|
100
|
+
}
|
|
101
|
+
const c = /* @__PURE__ */ new Map();
|
|
102
|
+
for (const s of o.values()) {
|
|
103
|
+
if (s.length === 1) {
|
|
104
|
+
c.set(s[0].key, 0);
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const i = [...s].sort((u, a) => {
|
|
108
|
+
const x = n === "source" ? u.succ : u.pred, d = n === "source" ? a.succ : a.pred;
|
|
109
|
+
return x.row !== d.row ? x.row - d.row : x.x !== d.x ? x.x - d.x : u.key < a.key ? -1 : 1;
|
|
110
|
+
}), r = i.length, h = (n === "source" ? i[0].pred : i[0].succ).milestone ? 4 : Math.max(3, e / 2 - 3), f = Math.min(6, 2 * h / (r - 1));
|
|
111
|
+
i.forEach((u, a) => {
|
|
112
|
+
c.set(u.key, H((a - (r - 1) / 2) * f, -h, h));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return c;
|
|
116
|
+
}
|
|
117
|
+
function W(t, n) {
|
|
118
|
+
if (t === n) return [t, t + 1];
|
|
119
|
+
const e = Math.min(t, n) + 1, o = Math.max(t, n);
|
|
120
|
+
if (o - e <= 3) {
|
|
121
|
+
const c = [];
|
|
122
|
+
for (let s = e; s <= o; s++) c.push(s);
|
|
123
|
+
return c;
|
|
124
|
+
}
|
|
125
|
+
return [.../* @__PURE__ */ new Set([e, Math.floor((e + o) / 2), o])];
|
|
126
|
+
}
|
|
127
|
+
function R(t, n, e, o, c, s, i, r, l) {
|
|
128
|
+
let h = t;
|
|
129
|
+
for (let f = 0; f < 6; f++) {
|
|
130
|
+
const u = l.obstacles.firstHit(
|
|
131
|
+
{ x1: h, y1: n, x2: h, y2: e, vertical: !0 },
|
|
132
|
+
c,
|
|
133
|
+
s
|
|
134
|
+
);
|
|
135
|
+
if (!u) return h >= i && h <= r ? h : null;
|
|
136
|
+
h = o > 0 ? u.x + u.w + 5 : u.x - 5;
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
function F(t, n, e, o, c, s, i) {
|
|
141
|
+
const r = [], l = n.x - t.x >= 24, h = 2, f = i.chartWidth - 2;
|
|
142
|
+
if (l)
|
|
143
|
+
if (Math.abs(t.y - n.y) < 0.75)
|
|
144
|
+
r.push([t, n]);
|
|
145
|
+
else {
|
|
146
|
+
const x = [.../* @__PURE__ */ new Set([t.x + 12, (t.x + n.x) / 2, n.x - 12])], d = [];
|
|
147
|
+
for (const y of x) {
|
|
148
|
+
r.push([t, { x: y, y: t.y }, { x: y, y: n.y }, n]);
|
|
149
|
+
for (const M of [1, -1]) {
|
|
150
|
+
const w = R(
|
|
151
|
+
y,
|
|
152
|
+
t.y,
|
|
153
|
+
n.y,
|
|
154
|
+
M,
|
|
155
|
+
c,
|
|
156
|
+
s,
|
|
157
|
+
t.x + 2,
|
|
158
|
+
n.x - 2,
|
|
159
|
+
i
|
|
160
|
+
);
|
|
161
|
+
w !== null && Math.abs(w - y) > 0.5 && d.push(w);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
for (const y of [...new Set(d)])
|
|
165
|
+
r.push([t, { x: y, y: t.y }, { x: y, y: n.y }, n]);
|
|
166
|
+
}
|
|
167
|
+
const u = H(t.x + 12, h, f), a = H(n.x - 12, h, f);
|
|
168
|
+
for (const x of W(e, o)) {
|
|
169
|
+
const d = H(x * i.rowHeight, 2, i.chartHeight - 2), y = [u], M = R(
|
|
170
|
+
u,
|
|
171
|
+
t.y,
|
|
172
|
+
d,
|
|
173
|
+
1,
|
|
174
|
+
c,
|
|
175
|
+
s,
|
|
176
|
+
t.x + 2,
|
|
177
|
+
f,
|
|
178
|
+
i
|
|
179
|
+
);
|
|
180
|
+
M !== null && Math.abs(M - u) > 0.5 && y.push(M);
|
|
181
|
+
const w = [a], I = R(
|
|
182
|
+
a,
|
|
183
|
+
d,
|
|
184
|
+
n.y,
|
|
185
|
+
-1,
|
|
186
|
+
c,
|
|
187
|
+
s,
|
|
188
|
+
h,
|
|
189
|
+
n.x - 2,
|
|
190
|
+
i
|
|
191
|
+
);
|
|
192
|
+
I !== null && Math.abs(I - a) > 0.5 && w.push(I);
|
|
193
|
+
for (const _ of y)
|
|
194
|
+
for (const E of w)
|
|
195
|
+
r.push([
|
|
196
|
+
t,
|
|
197
|
+
{ x: _, y: t.y },
|
|
198
|
+
{ x: _, y: d },
|
|
199
|
+
{ x: E, y: d },
|
|
200
|
+
{ x: E, y: n.y },
|
|
201
|
+
n
|
|
202
|
+
]);
|
|
203
|
+
}
|
|
204
|
+
return r.map(O).filter((x) => x.length >= 2);
|
|
205
|
+
}
|
|
206
|
+
function z(t, n, e, o) {
|
|
207
|
+
let c = 0, s = 0, i = 0;
|
|
208
|
+
for (const r of t)
|
|
209
|
+
c += N(r), s += o.obstacles.hitCount(r, n, e), (r.x1 < 0 || r.x1 > o.chartWidth || r.x2 < 0 || r.x2 > o.chartWidth || r.y1 < 0 || r.y1 > o.chartHeight || r.y2 < 0 || r.y2 > o.chartHeight) && i++;
|
|
210
|
+
return c + (t.length - 1) * 14 + s * 2e3 + i * 400;
|
|
211
|
+
}
|
|
212
|
+
function j(t, n, e) {
|
|
213
|
+
let o = 0, c = 0;
|
|
214
|
+
for (const s of t) {
|
|
215
|
+
const i = s.vertical ? e : n, r = s.vertical ? n : e;
|
|
216
|
+
for (const l of i)
|
|
217
|
+
L(s, l) && o++;
|
|
218
|
+
for (const l of r)
|
|
219
|
+
G(s, l, 4) && c++;
|
|
220
|
+
}
|
|
221
|
+
return o * 12 + c * 280;
|
|
222
|
+
}
|
|
223
|
+
const Q = 4;
|
|
224
|
+
function Z(t, n, e, o, c, s) {
|
|
225
|
+
const i = t.map((u) => ({ x: u.x, y: u.y })), r = i.length - 1;
|
|
226
|
+
if (r < 3) return i;
|
|
227
|
+
const l = Math.max(0, (s.rowHeight - s.barHeight) / 2), h = [
|
|
228
|
+
5,
|
|
229
|
+
-5,
|
|
230
|
+
10,
|
|
231
|
+
-10,
|
|
232
|
+
15,
|
|
233
|
+
-15
|
|
234
|
+
], f = (u) => {
|
|
235
|
+
if (s.obstacles.firstHit(u, n, e)) return !0;
|
|
236
|
+
const a = u.vertical ? o : c;
|
|
237
|
+
for (const x of a)
|
|
238
|
+
if (G(u, x, 5 - 0.5)) return !0;
|
|
239
|
+
return !1;
|
|
240
|
+
};
|
|
241
|
+
for (let u = 1; u <= r - 2; u++) {
|
|
242
|
+
const a = i[u], x = i[u + 1], d = Math.abs(a.x - x.x) < 0.01, y = { x1: a.x, y1: a.y, x2: x.x, y2: x.y, vertical: d };
|
|
243
|
+
if (f(y))
|
|
244
|
+
if (d) {
|
|
245
|
+
const M = i[u - 1], w = i[u + 2], I = Math.sign(a.x - M.x), _ = Math.sign(w.x - x.x);
|
|
246
|
+
for (const E of h) {
|
|
247
|
+
const S = a.x + E;
|
|
248
|
+
if (!(S < 2 || S > s.chartWidth - 2) && !(I !== 0 && (Math.sign(S - M.x) !== I || Math.abs(S - M.x) < 2)) && !(_ !== 0 && (Math.sign(w.x - S) !== _ || Math.abs(w.x - S) < 2)) && !f({ x1: S, y1: a.y, x2: S, y2: x.y, vertical: !0 })) {
|
|
249
|
+
a.x = S, x.x = S;
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
} else {
|
|
254
|
+
const M = t[u].y, w = i[u - 1], I = i[u + 2], _ = Math.sign(a.y - w.y), E = Math.sign(I.y - x.y), S = Math.max(0, l - 1.5);
|
|
255
|
+
for (const m of h) {
|
|
256
|
+
if (Math.abs(m) > S) continue;
|
|
257
|
+
const p = M + m;
|
|
258
|
+
if (!(p < 2 || p > s.chartHeight - 2) && !(_ !== 0 && (Math.sign(p - w.y) !== _ || Math.abs(p - w.y) < 2)) && !(E !== 0 && (Math.sign(I.y - p) !== E || Math.abs(I.y - p) < 2)) && !f({ x1: a.x, y1: p, x2: x.x, y2: p, vertical: !1 })) {
|
|
259
|
+
a.y = p, x.y = p;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return i;
|
|
266
|
+
}
|
|
267
|
+
function J(t, n, e, o) {
|
|
268
|
+
const c = /* @__PURE__ */ new Map(), s = C(t), i = o + 3.5 + 2;
|
|
269
|
+
return s.forEach((r, l) => {
|
|
270
|
+
const h = r.vertical ? e : n, f = [];
|
|
271
|
+
for (const y of h)
|
|
272
|
+
L(r, y) && f.push(r.vertical ? y.y1 : y.x1);
|
|
273
|
+
if (!f.length) return;
|
|
274
|
+
const u = (r.vertical ? Math.min(r.y1, r.y2) : Math.min(r.x1, r.x2)) + i, a = (r.vertical ? Math.max(r.y1, r.y2) : Math.max(r.x1, r.x2)) - i, x = [...new Set(f)].sort((y, M) => y - M).filter((y) => y > u && y < a), d = [];
|
|
275
|
+
for (const y of x)
|
|
276
|
+
d.length && y - d[d.length - 1] < 3.5 * 2 + 1 || d.push(y);
|
|
277
|
+
d.length && c.set(l, d);
|
|
278
|
+
}), c;
|
|
279
|
+
}
|
|
280
|
+
function K(t, n, e) {
|
|
281
|
+
const o = t[n - 1], c = t[n], s = t[n + 1], i = Math.abs(c.x - o.x) + Math.abs(c.y - o.y), r = Math.abs(s.x - c.x) + Math.abs(s.y - c.y);
|
|
282
|
+
return Math.max(0, Math.min(e, i / 2, r / 2));
|
|
283
|
+
}
|
|
284
|
+
function D(t, n = 5, e = /* @__PURE__ */ new Map()) {
|
|
285
|
+
const o = O(t);
|
|
286
|
+
if (o.length < 2) return "";
|
|
287
|
+
const c = [`M ${g(o[0].x)} ${g(o[0].y)}`];
|
|
288
|
+
for (let s = 0; s < o.length - 1; s++) {
|
|
289
|
+
const i = o[s], r = o[s + 1], l = Math.sign(r.x - i.x), h = Math.sign(r.y - i.y), f = s < o.length - 2 ? K(o, s + 1, n) : 0, u = e.get(s) ?? [];
|
|
290
|
+
if (u.length) {
|
|
291
|
+
const a = h === 0 ? l : h, x = a > 0 ? 1 : 0, d = [...u].sort((y, M) => a > 0 ? y - M : M - y);
|
|
292
|
+
for (const y of d)
|
|
293
|
+
h === 0 ? (c.push(`L ${g(y - l * 3.5)} ${g(i.y)}`), c.push(`A ${3.5} ${3.5} 0 0 ${x} ${g(y + l * 3.5)} ${g(i.y)}`)) : (c.push(`L ${g(i.x)} ${g(y - h * 3.5)}`), c.push(`A ${3.5} ${3.5} 0 0 ${x} ${g(i.x)} ${g(y + h * 3.5)}`));
|
|
294
|
+
}
|
|
295
|
+
if (c.push(`L ${g(r.x - l * f)} ${g(r.y - h * f)}`), s < o.length - 2 && f > 0) {
|
|
296
|
+
const a = o[s + 2], x = Math.sign(a.x - r.x), d = Math.sign(a.y - r.y);
|
|
297
|
+
c.push(`Q ${g(r.x)} ${g(r.y)} ${g(r.x + x * f)} ${g(r.y + d * f)}`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return c.join(" ");
|
|
301
|
+
}
|
|
302
|
+
function q(t, n, e = 5) {
|
|
303
|
+
return `M ${g(t)} ${g(n)} L ${g(t - e)} ${g(n - e * 0.6)} L ${g(t - e)} ${g(n + e * 0.6)} Z`;
|
|
304
|
+
}
|
|
305
|
+
function X(t) {
|
|
306
|
+
const n = C(t);
|
|
307
|
+
if (!n.length) return t[0] ?? { x: 0, y: 0 };
|
|
308
|
+
let o = n.reduce((s, i) => s + N(i), 0) / 2;
|
|
309
|
+
for (const s of n) {
|
|
310
|
+
const i = N(s);
|
|
311
|
+
if (o <= i) {
|
|
312
|
+
const r = i > 0 ? o / i : 0;
|
|
313
|
+
return { x: s.x1 + (s.x2 - s.x1) * r, y: s.y1 + (s.y2 - s.y1) * r };
|
|
314
|
+
}
|
|
315
|
+
o -= i;
|
|
316
|
+
}
|
|
317
|
+
const c = n[n.length - 1];
|
|
318
|
+
return { x: c.x2, y: c.y2 };
|
|
319
|
+
}
|
|
320
|
+
function Y(t, n, e, o, c, s, i = 5) {
|
|
321
|
+
let l;
|
|
322
|
+
if (e > t + 32)
|
|
323
|
+
if (Math.abs(n - o) < 2)
|
|
324
|
+
l = [{ x: t, y: n }, { x: e, y: o }];
|
|
325
|
+
else {
|
|
326
|
+
const h = t + (e - t) / 2;
|
|
327
|
+
l = [{ x: t, y: n }, { x: h, y: n }, { x: h, y: o }, { x: e, y: o }];
|
|
328
|
+
}
|
|
329
|
+
else if (Math.abs(n - o) < c * 0.5) {
|
|
330
|
+
const h = Math.max(n, o) + s / 2 + 16;
|
|
331
|
+
l = [
|
|
332
|
+
{ x: t, y: n },
|
|
333
|
+
{ x: t + 16, y: n },
|
|
334
|
+
{ x: t + 16, y: h },
|
|
335
|
+
{ x: e - 16, y: h },
|
|
336
|
+
{ x: e - 16, y: o },
|
|
337
|
+
{ x: e, y: o }
|
|
338
|
+
];
|
|
339
|
+
} else
|
|
340
|
+
l = [{ x: t, y: n }, { x: t + 16, y: n }, { x: t + 16, y: o }, { x: e, y: o }];
|
|
341
|
+
return D(l, i);
|
|
342
|
+
}
|
|
343
|
+
function tt(t, n, e) {
|
|
344
|
+
const o = {
|
|
345
|
+
rowHeight: e.rowHeight,
|
|
346
|
+
barHeight: e.barHeight,
|
|
347
|
+
chartWidth: Math.max(e.chartWidth, 40),
|
|
348
|
+
chartHeight: Math.max(e.chartHeight, e.rowHeight),
|
|
349
|
+
obstacles: new V(n.values(), e.rowHeight)
|
|
350
|
+
}, c = e.cornerRadius, s = e.arrowSize ?? 5, i = [];
|
|
351
|
+
for (const a of t) {
|
|
352
|
+
const x = n.get(a.predecessorId), d = n.get(a.successorId);
|
|
353
|
+
!x || !d || i.push({ key: a.key, predecessorId: a.predecessorId, successorId: a.successorId, pred: x, succ: d });
|
|
354
|
+
}
|
|
355
|
+
i.sort((a, x) => a.pred.row - x.pred.row || a.succ.row - x.succ.row || (a.key < x.key ? -1 : a.key > x.key ? 1 : 0));
|
|
356
|
+
const r = $(i, "source", o.barHeight), l = $(i, "target", o.barHeight), h = [], f = [], u = [];
|
|
357
|
+
for (const a of i) {
|
|
358
|
+
const x = {
|
|
359
|
+
x: k(a.pred),
|
|
360
|
+
y: v(a.pred) + (r.get(a.key) ?? 0)
|
|
361
|
+
}, d = {
|
|
362
|
+
x: U(a.succ),
|
|
363
|
+
y: v(a.succ) + (l.get(a.key) ?? 0)
|
|
364
|
+
}, y = F(
|
|
365
|
+
x,
|
|
366
|
+
d,
|
|
367
|
+
a.pred.row,
|
|
368
|
+
a.succ.row,
|
|
369
|
+
a.pred.id,
|
|
370
|
+
a.succ.id,
|
|
371
|
+
o
|
|
372
|
+
);
|
|
373
|
+
if (!y.length) continue;
|
|
374
|
+
const M = y.map((m, p) => {
|
|
375
|
+
const b = C(m);
|
|
376
|
+
return { pts: m, segs: b, index: p, base: z(b, a.pred.id, a.succ.id, o) };
|
|
377
|
+
}).sort((m, p) => m.base - p.base || m.index - p.index);
|
|
378
|
+
let w = M[0].pts, I = Number.POSITIVE_INFINITY;
|
|
379
|
+
for (const m of M.slice(0, Q)) {
|
|
380
|
+
const p = m.base + j(m.segs, h, f);
|
|
381
|
+
p < I - 1e-6 && (I = p, w = m.pts);
|
|
382
|
+
}
|
|
383
|
+
const _ = O(
|
|
384
|
+
Z(w, a.pred.id, a.succ.id, h, f, o)
|
|
385
|
+
), E = J(_, h, f, c), S = X(_);
|
|
386
|
+
u.push({
|
|
387
|
+
key: a.key,
|
|
388
|
+
predecessorId: a.predecessorId,
|
|
389
|
+
successorId: a.successorId,
|
|
390
|
+
d: D(_, c, E),
|
|
391
|
+
ad: q(d.x, d.y, s),
|
|
392
|
+
midX: g(S.x),
|
|
393
|
+
midY: g(S.y)
|
|
394
|
+
});
|
|
395
|
+
for (const m of C(_))
|
|
396
|
+
m.vertical ? h.push(m) : f.push(m);
|
|
397
|
+
}
|
|
398
|
+
return u;
|
|
399
|
+
}
|
|
400
|
+
export {
|
|
401
|
+
q as ganttConnectorArrowPath,
|
|
402
|
+
Y as ganttConnectorPreviewPath,
|
|
403
|
+
D as ganttRoundedConnectorPath,
|
|
404
|
+
tt as routeGanttDependencyConnectors
|
|
405
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure calendar-date helpers for GanttChart layout and interaction.
|
|
3
|
+
*
|
|
4
|
+
* Task dates are treated as local calendar days (not UTC instants).
|
|
5
|
+
* Date-only ISO strings (`YYYY-MM-DD`) are parsed as local midnight so
|
|
6
|
+
* bars align with timeline column boundaries in every timezone.
|
|
7
|
+
*/
|
|
8
|
+
export type GanttDateViewMode = 'day' | 'week' | 'month';
|
|
9
|
+
/** Local calendar midnight for a date */
|
|
10
|
+
export declare function ganttStartOfLocalDay(d: Date): Date;
|
|
11
|
+
/**
|
|
12
|
+
* Parse a Gantt task date as a local calendar day at 00:00:00.
|
|
13
|
+
* - `YYYY-MM-DD` → local midnight (never UTC)
|
|
14
|
+
* - Datetime strings / Date → normalized to local start of that calendar day
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseGanttDate(d: Date | string): Date;
|
|
17
|
+
/** Whole calendar days between local dates (time-of-day ignored). */
|
|
18
|
+
export declare function ganttCalendarDaysBetween(a: Date, b: Date): number;
|
|
19
|
+
export declare function ganttAddDays(d: Date, n: number): Date;
|
|
20
|
+
/** Monday-based week start at local midnight */
|
|
21
|
+
export declare function ganttStartOfWeek(d: Date): Date;
|
|
22
|
+
export declare function ganttStartOfMonth(d: Date): Date;
|
|
23
|
+
/** Format a local calendar date as `YYYY-MM-DD` (not UTC via toISOString). */
|
|
24
|
+
export declare function formatGanttLocalDate(d: Date): string;
|
|
25
|
+
/**
|
|
26
|
+
* Convert a calendar date to timeline X.
|
|
27
|
+
* A date that equals a column's start boundary maps to that column's left edge.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ganttDateToX(d: Date, rangeStart: Date, viewMode: GanttDateViewMode, columnWidth: number): number;
|
|
30
|
+
/** Pixel delta → calendar-day delta for the active view mode */
|
|
31
|
+
export declare function ganttPxToDays(px: number, viewMode: GanttDateViewMode, columnWidth: number): number;
|
|
32
|
+
/** Calendar-day delta → pixel delta for the active view mode */
|
|
33
|
+
export declare function ganttDaysToPx(days: number, viewMode: GanttDateViewMode, columnWidth: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* X of the left edge of the column that contains `d` (or starts at `d`
|
|
36
|
+
* when `d` is exactly on a column boundary).
|
|
37
|
+
*/
|
|
38
|
+
export declare function ganttColumnBoundaryX(d: Date, rangeStart: Date, viewMode: GanttDateViewMode, columnWidth: number): number;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const s = /^(\d{4})-(\d{2})-(\d{2})$/, f = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
2
|
+
function u(t) {
|
|
3
|
+
return new Date(t.getFullYear(), t.getMonth(), t.getDate(), 0, 0, 0, 0);
|
|
4
|
+
}
|
|
5
|
+
function i(t) {
|
|
6
|
+
if (t instanceof Date)
|
|
7
|
+
return Number.isNaN(t.getTime()) ? /* @__PURE__ */ new Date(NaN) : u(t);
|
|
8
|
+
const e = String(t).trim();
|
|
9
|
+
if (!e) return /* @__PURE__ */ new Date(NaN);
|
|
10
|
+
const n = s.exec(e);
|
|
11
|
+
if (n)
|
|
12
|
+
return new Date(
|
|
13
|
+
Number(n[1]),
|
|
14
|
+
Number(n[2]) - 1,
|
|
15
|
+
Number(n[3]),
|
|
16
|
+
0,
|
|
17
|
+
0,
|
|
18
|
+
0,
|
|
19
|
+
0
|
|
20
|
+
);
|
|
21
|
+
const r = f.exec(e);
|
|
22
|
+
if (r && (e.includes("T") || e.includes(" ")))
|
|
23
|
+
return new Date(
|
|
24
|
+
Number(r[1]),
|
|
25
|
+
Number(r[2]) - 1,
|
|
26
|
+
Number(r[3]),
|
|
27
|
+
0,
|
|
28
|
+
0,
|
|
29
|
+
0,
|
|
30
|
+
0
|
|
31
|
+
);
|
|
32
|
+
const a = new Date(e);
|
|
33
|
+
return Number.isNaN(a.getTime()) ? a : u(a);
|
|
34
|
+
}
|
|
35
|
+
function o(t, e) {
|
|
36
|
+
const n = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
37
|
+
return (Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()) - n) / 864e5;
|
|
38
|
+
}
|
|
39
|
+
function N(t, e) {
|
|
40
|
+
const n = u(t);
|
|
41
|
+
return n.setDate(n.getDate() + e), n;
|
|
42
|
+
}
|
|
43
|
+
function l(t) {
|
|
44
|
+
const e = u(t), n = e.getDay();
|
|
45
|
+
return e.setDate(e.getDate() - (n === 0 ? 6 : n - 1)), e;
|
|
46
|
+
}
|
|
47
|
+
function y(t) {
|
|
48
|
+
return new Date(t.getFullYear(), t.getMonth(), 1, 0, 0, 0, 0);
|
|
49
|
+
}
|
|
50
|
+
function w(t) {
|
|
51
|
+
const e = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
|
|
52
|
+
return `${e}-${n}-${r}`;
|
|
53
|
+
}
|
|
54
|
+
function T(t, e, n, r) {
|
|
55
|
+
if (n === "day")
|
|
56
|
+
return o(e, t) * r;
|
|
57
|
+
if (n === "week")
|
|
58
|
+
return o(e, t) / 7 * r;
|
|
59
|
+
const a = e, g = (t.getFullYear() - a.getFullYear()) * 12 + (t.getMonth() - a.getMonth()), c = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate(), D = (t.getDate() - 1) / c;
|
|
60
|
+
return (g + D) * r;
|
|
61
|
+
}
|
|
62
|
+
function F(t, e, n) {
|
|
63
|
+
return e === "day" ? t / n : e === "week" ? t / n * 7 : t / n * 30.44;
|
|
64
|
+
}
|
|
65
|
+
function Y(t, e, n) {
|
|
66
|
+
return e === "day" ? t * n : e === "week" ? t / 7 * n : t / 30.44 * n;
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
w as formatGanttLocalDate,
|
|
70
|
+
N as ganttAddDays,
|
|
71
|
+
o as ganttCalendarDaysBetween,
|
|
72
|
+
T as ganttDateToX,
|
|
73
|
+
Y as ganttDaysToPx,
|
|
74
|
+
F as ganttPxToDays,
|
|
75
|
+
u as ganttStartOfLocalDay,
|
|
76
|
+
y as ganttStartOfMonth,
|
|
77
|
+
l as ganttStartOfWeek,
|
|
78
|
+
i as parseGanttDate
|
|
79
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { GanttDependencyType, GanttTask, GanttTaskDependencyLink } from './types';
|
|
2
|
+
/** Why a proposed predecessor → successor link was rejected */
|
|
3
|
+
export type GanttDependencyLinkRejectReason = 'self' | 'duplicate' | 'circular' | 'missing-predecessor' | 'missing-successor';
|
|
4
|
+
export type GanttDependencyLinkValidation = {
|
|
5
|
+
valid: true;
|
|
6
|
+
} | {
|
|
7
|
+
valid: false;
|
|
8
|
+
reason: GanttDependencyLinkRejectReason;
|
|
9
|
+
};
|
|
10
|
+
export type GanttDependencyTaskRef = Pick<GanttTask, 'id' | 'dependencies' | 'dependencyLinks' | 'milestone'> & {
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Canonical schedule edge used for Gantt arrows (finish-to-start) */
|
|
14
|
+
export type GanttScheduleDependencyEdge = {
|
|
15
|
+
predecessorId: string;
|
|
16
|
+
successorId: string;
|
|
17
|
+
};
|
|
18
|
+
/** Minimal bar geometry needed for connector / hit-testing */
|
|
19
|
+
export interface GanttDependencyBarGeometry {
|
|
20
|
+
id: string;
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
fullW: number;
|
|
24
|
+
milestone?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** User-facing label for a dependency type (Type | Task selector) */
|
|
27
|
+
export declare function ganttDependencyTypeLabel(type: GanttDependencyType): string;
|
|
28
|
+
/**
|
|
29
|
+
* Normalize UI / API strings into a canonical `GanttDependencyType`.
|
|
30
|
+
* Accepts labels ("Waiting on"), kebab/snake/enum forms.
|
|
31
|
+
*/
|
|
32
|
+
export declare function normalizeGanttDependencyType(input: string): GanttDependencyType | null;
|
|
33
|
+
/**
|
|
34
|
+
* Reverse user-facing view of a schedule edge.
|
|
35
|
+
* Waiting on ↔ Blocking; Related to is symmetrical.
|
|
36
|
+
*/
|
|
37
|
+
export declare function invertGanttDependencyType(type: GanttDependencyType): GanttDependencyType;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve all schedule (arrow-drawing) edges from `dependencies[]` and
|
|
40
|
+
* typed `dependencyLinks`. `related-to` never produces an edge.
|
|
41
|
+
*
|
|
42
|
+
* Waiting-on / blocking from either endpoint collapse to one
|
|
43
|
+
* predecessor → successor direction.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveGanttScheduleDependencyEdges(tasks: GanttDependencyTaskRef[]): GanttScheduleDependencyEdge[];
|
|
46
|
+
/** Predecessor IDs this task is waiting on (for arrows / cascade) */
|
|
47
|
+
export declare function getGanttWaitingOnTaskIds(task: GanttDependencyTaskRef): string[];
|
|
48
|
+
/** Whether a schedule edge already exists between predecessor and successor */
|
|
49
|
+
export declare function hasGanttScheduleDependency(tasks: GanttDependencyTaskRef[], predecessorId: string, successorId: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Connector sits just past the dependency *output* edge so it does not
|
|
52
|
+
* cover resize handles or bar labels. Milestones use the diamond's right tip.
|
|
53
|
+
*/
|
|
54
|
+
export declare function getGanttDependencyConnectorPosition(bar: GanttDependencyBarGeometry, barHeight: number, offset?: number): {
|
|
55
|
+
cx: number;
|
|
56
|
+
cy: number;
|
|
57
|
+
};
|
|
58
|
+
/** Find the visible bar under an SVG-space pointer, if any. */
|
|
59
|
+
export declare function findGanttDependencyBarAtPoint(bars: GanttDependencyBarGeometry[], x: number, y: number, barHeight: number, hitPadding?: number): GanttDependencyBarGeometry | null;
|
|
60
|
+
/**
|
|
61
|
+
* Walk the schedule graph starting at `fromId`, following edges toward
|
|
62
|
+
* predecessors (from waiting-on / blocking-resolved edges).
|
|
63
|
+
*/
|
|
64
|
+
export declare function ganttDependencyReachable(tasks: GanttDependencyTaskRef[], fromId: string, targetId: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Validate adding a schedule edge: successor waiting on predecessor.
|
|
67
|
+
* Does not mutate any task data. Related-to is out of scope here.
|
|
68
|
+
*/
|
|
69
|
+
export declare function validateGanttDependencyLink(tasks: GanttDependencyTaskRef[], predecessorId: string, successorId: string): GanttDependencyLinkValidation;
|
|
70
|
+
/** Human-readable status for aria-live announcements */
|
|
71
|
+
export declare function describeGanttDependencyLinkValidation(validation: GanttDependencyLinkValidation, predecessorName: string, successorName: string): string;
|
|
72
|
+
/** Stable key for a predecessor → successor dependency edge */
|
|
73
|
+
export declare function ganttDependencyEdgeKey(predecessorId: string, successorId: string): string;
|
|
74
|
+
/** Midpoint used to place the delete control on a dependency edge */
|
|
75
|
+
export declare function getGanttDependencyEdgeMidpoint(fX: number, fY: number, tX: number, tY: number): {
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
};
|
|
79
|
+
/** Edge scroll: return scroll deltas when the pointer is near a viewport edge */
|
|
80
|
+
export declare function getGanttDependencyEdgeScrollDelta(clientX: number, clientY: number, viewport: {
|
|
81
|
+
left: number;
|
|
82
|
+
top: number;
|
|
83
|
+
right: number;
|
|
84
|
+
bottom: number;
|
|
85
|
+
}, edge?: number, speed?: number): {
|
|
86
|
+
dx: number;
|
|
87
|
+
dy: number;
|
|
88
|
+
};
|
|
89
|
+
/** Format "Type | Task" for selectors / announcements */
|
|
90
|
+
export declare function formatGanttDependencySelectorLabel(type: GanttDependencyType, taskName: string): string;
|
|
91
|
+
/** Build a typed waiting-on link for parent state updates */
|
|
92
|
+
export declare function createGanttWaitingOnLink(taskId: string): GanttTaskDependencyLink;
|