vlite3 1.5.4 → 1.5.5
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 +71 -0
- package/components/Calendar/Calendar.vue.js +1 -1
- package/components/Calendar/Calendar.vue2.js +29 -29
- package/components/CategoryManager/CategoryManager.vue2.js +2 -2
- package/components/Chart/GanttChart.vue.d.ts +2 -0
- package/components/Chart/GanttChart.vue.js +2 -2
- package/components/Chart/GanttChart.vue2.js +591 -656
- package/components/QRCode/QRCode.vue.d.ts +1 -1
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +1 -1
- package/components/Screen/ScreenFilter.vue.js +2 -2
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +18 -18
- package/core/CoreScale.d.ts +18 -0
- package/core/CoreScale.js +44 -0
- package/core/config.d.ts +38 -32
- package/core/config.js +23 -13
- package/core/index.d.ts +3 -2
- package/core/index.js +43 -32
- package/index.d.ts +1 -1
- package/index.js +270 -260
- package/package.json +1 -1
- package/style.css +45 -15
- package/types/config.type.d.ts +16 -0
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
|
@@ -1,50 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { CHART_COLORS as
|
|
5
|
-
import { resolveGanttScheduleDependencyEdges as
|
|
6
|
-
import { routeGanttDependencyConnectors as
|
|
7
|
-
import { parseGanttDate as oe, formatGanttLocalDate as
|
|
8
|
-
import { ganttPreviewBarGeometry as Wo, computeGanttInteractionPreview as
|
|
9
|
-
import { placeGanttTaskTooltip as
|
|
10
|
-
const Ro = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "vlite-gantt-toolbar"
|
|
13
|
-
}, Bo = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "vlite-gantt-legend-blocked",
|
|
16
|
-
role: "note",
|
|
17
|
-
"aria-label": "Legend: blocked task"
|
|
18
|
-
}, Ho = { class: "vlite-gantt-wrapper" }, _o = {
|
|
1
|
+
import { defineComponent as oo, ref as h, computed as b, watch as fe, onMounted as ao, nextTick as Me, onUnmounted as lo, openBlock as v, createElementBlock as g, createElementVNode as c, normalizeStyle as A, normalizeClass as ge, createCommentVNode as x, Fragment as W, renderList as O, toDisplayString as S, unref as X, withDirectives as ro, vShow as so, withKeys as st, withModifiers as an, createBlock as it, Teleport as io } from "vue";
|
|
2
|
+
import uo from "../Persona.vue.js";
|
|
3
|
+
import co from "../AvatarGroup/AvatarGroup.vue.js";
|
|
4
|
+
import { CHART_COLORS as vo, getColor as fo, animateProgress as go } from "./utils.js";
|
|
5
|
+
import { resolveGanttScheduleDependencyEdges as ln, ganttDependencyEdgeKey as po, ganttDependencyTypeLabel as rn, getGanttDependencyEdgeScrollDelta as sn, getGanttDependencyConnectorPosition as yo, validateGanttDependencyLink as ut, describeGanttDependencyLinkValidation as ct, findGanttDependencyBarAtPoint as ho } from "./GanttChartDependencyUtils.js";
|
|
6
|
+
import { routeGanttDependencyConnectors as mo, ganttConnectorPreviewPath as ko, ganttConnectorArrowPath as xo } from "./GanttChartConnectorRouting.js";
|
|
7
|
+
import { parseGanttDate as oe, formatGanttLocalDate as bo, ganttAddDays as wo, ganttStartOfWeek as Do, ganttStartOfMonth as Io, ganttDateToX as So, ganttColumnBoundaryX as Mo, ganttCalendarDaysBetween as $o, ganttDaysToPx as Co, ganttPxToDays as Lo } from "./GanttChartDateUtils.js";
|
|
8
|
+
import { ganttPreviewBarGeometry as Wo, computeGanttInteractionPreview as To } from "./GanttChartResizePreviewUtils.js";
|
|
9
|
+
import { placeGanttTaskTooltip as Ao, isGanttPointerNearConnector as Eo } from "./GanttChartTooltipUtils.js";
|
|
10
|
+
const Po = { class: "vlite-gantt-wrapper" }, Ro = {
|
|
19
11
|
key: 0,
|
|
20
12
|
class: "text-xs font-semibold text-muted-foreground uppercase tracking-wider"
|
|
21
|
-
},
|
|
13
|
+
}, Bo = ["aria-label", "aria-expanded"], _o = ["onClick"], Ho = { class: "text-xs font-bold text-foreground uppercase tracking-wide" }, zo = { class: "vlite-gantt-group-count" }, Xo = ["title", "onClick"], Go = { class: "truncate text-xs font-medium text-foreground" }, Fo = {
|
|
22
14
|
key: 0,
|
|
23
15
|
class: "vlite-gantt-progress-badge"
|
|
24
|
-
},
|
|
16
|
+
}, Oo = ["width", "height"], qo = ["x1", "x2", "y2", "stroke-opacity"], Vo = ["x", "y"], Zo = ["x", "y"], Yo = ["width", "height"], Ko = ["id"], No = ["stop-color"], Uo = ["stop-color"], jo = ["id"], Jo = ["stop-color"], Qo = ["stop-color"], ea = ["id"], ta = ["x1", "x2", "y2", "stroke-opacity"], na = ["y1", "x2", "y2", "stroke-opacity"], oa = ["y", "width", "height"], aa = ["aria-label"], la = ["d", "tabindex", "onClick", "onKeydown", "onMouseenter", "onFocus"], ra = ["d", "stroke", "stroke-width", "stroke-opacity"], sa = ["d", "fill", "fill-opacity"], ia = ["transform", "aria-label", "onKeydown"], ua = ["onMouseenter"], ca = ["d", "fill", "stroke", "opacity", "onMouseenter", "onMousemove", "onClick"], da = ["d", "fill"], va = ["d", "fill"], fa = ["d", "fill"], ga = ["d", "fill"], pa = ["d"], ya = ["transform"], ha = ["x", "y", "width", "height", "onMouseenter", "onMousemove", "onMousedown", "onClick"], ma = ["x", "y", "width", "height", "rx", "ry"], ka = ["x", "y", "height"], xa = ["x", "y", "height"], ba = ["data-name", "x", "y", "fill", "opacity"], wa = ["transform", "aria-label", "onPointerdown", "onKeydown", "onFocus", "onMouseenter"], Da = {
|
|
25
17
|
key: 3,
|
|
26
18
|
class: "pointer-events-none"
|
|
27
|
-
},
|
|
19
|
+
}, Ia = ["x", "y", "width", "height", "rx", "stroke", "stroke-dasharray"], Sa = ["x", "y", "fill"], Ma = {
|
|
28
20
|
key: 2,
|
|
29
21
|
class: "vlite-gantt-link-preview pointer-events-none"
|
|
30
|
-
},
|
|
22
|
+
}, $a = ["x1", "y1", "x2", "y2", "stroke", "stroke-dasharray", "stroke-opacity"], Ca = ["cx", "cy", "fill", "fill-opacity"], La = { key: 3 }, Wa = ["x1", "x2", "y2", "stroke"], Ta = ["cx", "fill"], Aa = ["x", "fill"], Ea = {
|
|
31
23
|
class: "sr-only",
|
|
32
24
|
role: "status",
|
|
33
25
|
"aria-live": "polite",
|
|
34
26
|
"aria-atomic": "true"
|
|
35
|
-
},
|
|
27
|
+
}, Pa = { class: "font-semibold text-xs mb-1.5" }, Ra = { class: "flex items-center gap-1.5 text-[11px] text-muted-foreground mb-1" }, Ba = { class: "text-[10px] text-muted-foreground" }, _a = {
|
|
36
28
|
key: 0,
|
|
37
29
|
class: "mt-1.5 flex items-center gap-2"
|
|
38
|
-
},
|
|
30
|
+
}, Ha = { class: "vlite-gantt-tooltip-progress-track" }, za = { class: "text-[10px] font-semibold" }, Xa = {
|
|
39
31
|
key: 1,
|
|
40
32
|
class: "vlite-gantt-tooltip-blocked mt-1.5"
|
|
41
|
-
},
|
|
33
|
+
}, Ga = {
|
|
42
34
|
key: 2,
|
|
43
35
|
class: "text-[10px] text-muted-foreground mt-1 opacity-60"
|
|
44
|
-
},
|
|
36
|
+
}, Fa = {
|
|
45
37
|
key: 3,
|
|
46
38
|
class: "mt-2 pt-2 border-t border-border/60"
|
|
47
|
-
},
|
|
39
|
+
}, Oa = 40, un = 6, dt = "#eab308", cn = 8, qa = 7, dn = 6.5, Va = 10, tl = /* @__PURE__ */ oo({
|
|
48
40
|
__name: "GanttChart",
|
|
49
41
|
props: {
|
|
50
42
|
tasks: {},
|
|
@@ -63,7 +55,7 @@ const Ro = {
|
|
|
63
55
|
showTodayLine: { type: Boolean, default: !0 },
|
|
64
56
|
showHeader: { type: Boolean, default: !0 },
|
|
65
57
|
animate: { type: Boolean, default: !0 },
|
|
66
|
-
colors: { default: () =>
|
|
58
|
+
colors: { default: () => vo },
|
|
67
59
|
todayColor: { default: "var(--color-danger)" },
|
|
68
60
|
locale: { default: "en-US" },
|
|
69
61
|
draggable: { type: Boolean, default: !0 },
|
|
@@ -83,8 +75,8 @@ const Ro = {
|
|
|
83
75
|
defaultSidebarCollapsed: { type: Boolean, default: !1 }
|
|
84
76
|
},
|
|
85
77
|
emits: ["task-click", "task-hover", "task-update", "dependency-create", "dependency-delete", "zoom-change", "sidebar-toggle"],
|
|
86
|
-
setup(d, { expose:
|
|
87
|
-
const r = d, q =
|
|
78
|
+
setup(d, { expose: vn, emit: fn }) {
|
|
79
|
+
const r = d, q = fn;
|
|
88
80
|
function vt(e) {
|
|
89
81
|
return oe(e);
|
|
90
82
|
}
|
|
@@ -92,53 +84,53 @@ const Ro = {
|
|
|
92
84
|
return $o(e, n);
|
|
93
85
|
}
|
|
94
86
|
function ae(e, n) {
|
|
95
|
-
return
|
|
87
|
+
return wo(e, n);
|
|
88
|
+
}
|
|
89
|
+
function Fe(e) {
|
|
90
|
+
return Do(e);
|
|
96
91
|
}
|
|
97
92
|
function Oe(e) {
|
|
98
93
|
return Io(e);
|
|
99
94
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
let Ve = null;
|
|
105
|
-
function pn() {
|
|
106
|
-
Ce.value && (Ve = new ResizeObserver((e) => {
|
|
95
|
+
const $e = h(), I = h(), N = h(800);
|
|
96
|
+
let qe = null;
|
|
97
|
+
function gn() {
|
|
98
|
+
$e.value && (qe = new ResizeObserver((e) => {
|
|
107
99
|
const n = Math.round(e[0].contentRect.width || 800);
|
|
108
100
|
Math.abs(N.value - n) > 0.5 && (N.value = n);
|
|
109
|
-
}),
|
|
101
|
+
}), qe.observe($e.value), N.value = Math.round($e.value.clientWidth || 800));
|
|
110
102
|
}
|
|
111
103
|
const M = h(r.defaultSidebarCollapsed), le = b(
|
|
112
|
-
() => r.collapsibleSidebar && M.value ?
|
|
104
|
+
() => r.collapsibleSidebar && M.value ? Oa : r.sidebarWidth
|
|
113
105
|
);
|
|
114
106
|
function gt() {
|
|
115
107
|
if (!r.collapsibleSidebar) return;
|
|
116
|
-
const e =
|
|
117
|
-
M.value = !M.value, q("sidebar-toggle", M.value), e && Me(() =>
|
|
108
|
+
const e = Ze.value;
|
|
109
|
+
M.value = !M.value, q("sidebar-toggle", M.value), e && Me(() => Ye(e, "center"));
|
|
118
110
|
}
|
|
119
|
-
const
|
|
111
|
+
const m = b(
|
|
120
112
|
() => r.tasks.map((e, n) => ({
|
|
121
113
|
...e,
|
|
122
114
|
_start: vt(e.start),
|
|
123
115
|
_end: vt(e.end),
|
|
124
|
-
_color: e.color ??
|
|
116
|
+
_color: e.color ?? fo(r.colors, n),
|
|
125
117
|
_index: n
|
|
126
118
|
}))
|
|
127
|
-
),
|
|
128
|
-
function
|
|
129
|
-
const n = new Set(
|
|
130
|
-
n.has(e) ? n.delete(e) : n.add(e),
|
|
119
|
+
), Ce = h(/* @__PURE__ */ new Set());
|
|
120
|
+
function pn(e) {
|
|
121
|
+
const n = new Set(Ce.value);
|
|
122
|
+
n.has(e) ? n.delete(e) : n.add(e), Ce.value = n;
|
|
131
123
|
}
|
|
132
|
-
const
|
|
124
|
+
const Ve = b(() => {
|
|
133
125
|
const e = /* @__PURE__ */ new Map(), n = [];
|
|
134
|
-
for (const t of
|
|
126
|
+
for (const t of m.value)
|
|
135
127
|
t.group ? (e.has(t.group) || e.set(t.group, []), e.get(t.group).push(t)) : n.push(t);
|
|
136
128
|
return { grouped: e, ungrouped: n };
|
|
137
|
-
}),
|
|
129
|
+
}), pe = b(() => {
|
|
138
130
|
const e = [];
|
|
139
|
-
for (const [n, t] of
|
|
140
|
-
if (e.push({ type: "group-header", group: n }),
|
|
141
|
-
for (const n of
|
|
131
|
+
for (const [n, t] of Ve.value.grouped)
|
|
132
|
+
if (e.push({ type: "group-header", group: n }), !Ce.value.has(n)) for (const o of t) e.push({ type: "task", group: n, task: o });
|
|
133
|
+
for (const n of Ve.value.ungrouped) e.push({ type: "task", task: n });
|
|
142
134
|
return e;
|
|
143
135
|
});
|
|
144
136
|
function pt(e, n) {
|
|
@@ -147,78 +139,78 @@ const Ro = {
|
|
|
147
139
|
const U = b(() => {
|
|
148
140
|
const e = r.timelineStart ? oe(r.timelineStart) : null, n = r.timelineEnd ? oe(r.timelineEnd) : null;
|
|
149
141
|
let t, o;
|
|
150
|
-
if (
|
|
151
|
-
t =
|
|
152
|
-
for (const
|
|
153
|
-
|
|
142
|
+
if (m.value.length) {
|
|
143
|
+
t = m.value[0]._start, o = m.value[0]._end;
|
|
144
|
+
for (const f of m.value)
|
|
145
|
+
f._start < t && (t = f._start), f._end > o && (o = f._end);
|
|
154
146
|
} else {
|
|
155
|
-
const
|
|
156
|
-
t =
|
|
147
|
+
const f = oe(/* @__PURE__ */ new Date());
|
|
148
|
+
t = f, o = f;
|
|
157
149
|
}
|
|
158
150
|
e && (t = e), n && (o = n);
|
|
159
151
|
const a = Math.max(0, Math.floor(r.rangePadding));
|
|
160
152
|
if (r.viewMode === "month") {
|
|
161
|
-
const
|
|
162
|
-
return { start:
|
|
153
|
+
const f = Oe(e || t), y = n ? Oe(n) : pt(o, a);
|
|
154
|
+
return { start: f, end: y < f ? f : y };
|
|
163
155
|
}
|
|
164
|
-
const l =
|
|
165
|
-
return { start: l, end:
|
|
166
|
-
}),
|
|
156
|
+
const l = Fe(e || t), u = n || ae(Fe(o), 6 + 7 * a);
|
|
157
|
+
return { start: l, end: u < l ? l : u };
|
|
158
|
+
}), $ = h(1);
|
|
167
159
|
let re = null;
|
|
168
|
-
function
|
|
160
|
+
function yt(e) {
|
|
169
161
|
return Math.max(r.minZoom, Math.min(e, r.maxZoom));
|
|
170
162
|
}
|
|
171
|
-
function
|
|
163
|
+
function yn() {
|
|
172
164
|
return {
|
|
173
|
-
zoom:
|
|
174
|
-
canZoomIn:
|
|
175
|
-
canZoomOut:
|
|
165
|
+
zoom: $.value,
|
|
166
|
+
canZoomIn: $.value < r.maxZoom,
|
|
167
|
+
canZoomOut: $.value > r.minZoom,
|
|
176
168
|
min: r.minZoom,
|
|
177
169
|
max: r.maxZoom
|
|
178
170
|
};
|
|
179
171
|
}
|
|
180
|
-
fe(
|
|
172
|
+
fe($, () => q("zoom-change", yn()));
|
|
181
173
|
function Le(e, n) {
|
|
182
|
-
const t = I.value, o =
|
|
174
|
+
const t = I.value, o = $.value, a = yt(e);
|
|
183
175
|
if (a === o) return;
|
|
184
176
|
if (!t) {
|
|
185
|
-
|
|
177
|
+
$.value = a;
|
|
186
178
|
return;
|
|
187
179
|
}
|
|
188
|
-
const l = t.clientWidth / 2,
|
|
189
|
-
|
|
190
|
-
const
|
|
180
|
+
const l = t.clientWidth / 2, u = t.scrollLeft + l;
|
|
181
|
+
$.value = a;
|
|
182
|
+
const f = a / o;
|
|
191
183
|
Me(() => {
|
|
192
|
-
I.value && (I.value.scrollLeft =
|
|
184
|
+
I.value && (I.value.scrollLeft = u * f - l);
|
|
193
185
|
});
|
|
194
186
|
}
|
|
195
|
-
function
|
|
187
|
+
function hn(e) {
|
|
196
188
|
if (r.zoom && (e.ctrlKey || e.metaKey)) {
|
|
197
189
|
e.preventDefault();
|
|
198
190
|
const n = I.value;
|
|
199
191
|
if (!n) return;
|
|
200
|
-
const t = n.getBoundingClientRect(), o = e.clientX - t.left, l = (re !== null ? re : n.scrollLeft) + o,
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
re = l *
|
|
192
|
+
const t = n.getBoundingClientRect(), o = e.clientX - t.left, l = (re !== null ? re : n.scrollLeft) + o, u = $.value, f = yt(u * Math.exp(-e.deltaY * 5e-3));
|
|
193
|
+
if (f === u) return;
|
|
194
|
+
$.value = f;
|
|
195
|
+
const y = f / u;
|
|
196
|
+
re = l * y - o, Me(() => {
|
|
205
197
|
I.value && re !== null && (I.value.scrollLeft = re, re = null);
|
|
206
198
|
});
|
|
207
199
|
}
|
|
208
200
|
}
|
|
209
|
-
function
|
|
210
|
-
Le(
|
|
201
|
+
function mn() {
|
|
202
|
+
Le($.value + r.zoomStep);
|
|
211
203
|
}
|
|
212
|
-
function
|
|
213
|
-
Le(
|
|
204
|
+
function kn() {
|
|
205
|
+
Le($.value - r.zoomStep);
|
|
214
206
|
}
|
|
215
|
-
function
|
|
207
|
+
function xn(e) {
|
|
216
208
|
Le(e);
|
|
217
209
|
}
|
|
218
|
-
function
|
|
210
|
+
function bn() {
|
|
219
211
|
Le(1);
|
|
220
212
|
}
|
|
221
|
-
const
|
|
213
|
+
const We = b(() => {
|
|
222
214
|
const e = [], { start: n, end: t } = U.value;
|
|
223
215
|
let o = new Date(n);
|
|
224
216
|
if (r.viewMode === "day")
|
|
@@ -231,113 +223,113 @@ const Ro = {
|
|
|
231
223
|
for (; o <= t; )
|
|
232
224
|
e.push(o), o = new Date(o.getFullYear(), o.getMonth() + 1, 1);
|
|
233
225
|
return e;
|
|
234
|
-
}),
|
|
226
|
+
}), ht = {
|
|
235
227
|
day: { min: 44, defaultVisible: 7 },
|
|
236
228
|
week: { min: 96, defaultVisible: 4 },
|
|
237
229
|
// 1.7 → one full month plus a peek at the next, hinting more to scroll.
|
|
238
230
|
month: { min: 130, defaultVisible: 1.7 }
|
|
239
|
-
},
|
|
240
|
-
const e =
|
|
231
|
+
}, wn = b(() => {
|
|
232
|
+
const e = ht[r.viewMode], n = We.value.length || 1, t = r.visiblePeriodCount && r.visiblePeriodCount > 0 ? r.visiblePeriodCount : e.defaultVisible;
|
|
241
233
|
return Math.max(1, Math.min(t, n));
|
|
242
234
|
}), G = b(() => {
|
|
243
|
-
const e =
|
|
244
|
-
if (t <= 0) return n *
|
|
245
|
-
const o = t /
|
|
246
|
-
return Math.max(n, o) *
|
|
247
|
-
}),
|
|
248
|
-
const e = G.value, n =
|
|
235
|
+
const e = ht[r.viewMode], n = r.minColumnWidth != null ? r.minColumnWidth : e.min, t = Math.max(0, N.value - le.value);
|
|
236
|
+
if (t <= 0) return n * $.value;
|
|
237
|
+
const o = t / wn.value;
|
|
238
|
+
return Math.max(n, o) * $.value;
|
|
239
|
+
}), Te = h(0), Dn = b(() => {
|
|
240
|
+
const e = G.value, n = We.value.length;
|
|
249
241
|
if (e <= 0 || n === 0) return { start: 0, end: n };
|
|
250
|
-
const t = Math.max(0, N.value - le.value) || e, o = Math.floor(
|
|
242
|
+
const t = Math.max(0, N.value - le.value) || e, o = Math.floor(Te.value / e) - un, a = Math.ceil((Te.value + t) / e) + un;
|
|
251
243
|
return {
|
|
252
244
|
start: Math.max(0, o),
|
|
253
245
|
end: Math.min(n, Math.max(0, a))
|
|
254
246
|
};
|
|
255
247
|
});
|
|
256
|
-
function
|
|
248
|
+
function In(e) {
|
|
257
249
|
return r.viewMode === "day" ? {
|
|
258
250
|
label: e.toLocaleDateString(r.locale, { day: "numeric" }),
|
|
259
251
|
sublabel: e.toLocaleDateString(r.locale, { weekday: "short" })
|
|
260
252
|
} : r.viewMode === "week" ? {
|
|
261
253
|
label: e.toLocaleDateString(r.locale, { month: "short", day: "numeric" }),
|
|
262
|
-
sublabel: `W${
|
|
254
|
+
sublabel: `W${Sn(e)}`
|
|
263
255
|
} : {
|
|
264
256
|
label: e.toLocaleDateString(r.locale, { month: "long" }),
|
|
265
257
|
sublabel: String(e.getFullYear())
|
|
266
258
|
};
|
|
267
259
|
}
|
|
268
|
-
const
|
|
269
|
-
const e = G.value, { start: n, end: t } =
|
|
260
|
+
const mt = b(() => {
|
|
261
|
+
const e = G.value, { start: n, end: t } = Dn.value, o = We.value, a = [];
|
|
270
262
|
for (let l = n; l < t; l++) {
|
|
271
|
-
const
|
|
272
|
-
a.push({ key:
|
|
263
|
+
const u = o[l], { label: f, sublabel: y } = In(u);
|
|
264
|
+
a.push({ key: bo(u), label: f, sublabel: y, x: l * e, width: e });
|
|
273
265
|
}
|
|
274
266
|
return a;
|
|
275
267
|
});
|
|
276
|
-
function
|
|
268
|
+
function Sn(e) {
|
|
277
269
|
const n = new Date(e.getTime());
|
|
278
270
|
n.setHours(0, 0, 0, 0), n.setDate(n.getDate() + 3 - (n.getDay() + 6) % 7);
|
|
279
271
|
const t = new Date(n.getFullYear(), 0, 4);
|
|
280
272
|
return 1 + Math.round(((n.getTime() - t.getTime()) / 864e5 - 3 + (t.getDay() + 6) % 7) / 7);
|
|
281
273
|
}
|
|
282
|
-
const se = b(() =>
|
|
283
|
-
const e =
|
|
274
|
+
const se = b(() => We.value.length * G.value), ie = b(() => r.showHeader ? 56 : 0), ue = b(() => {
|
|
275
|
+
const e = pe.value.length * r.rowHeight;
|
|
284
276
|
return Math.max(r.height || e, e);
|
|
285
277
|
});
|
|
286
278
|
function Ae(e) {
|
|
287
|
-
return
|
|
279
|
+
return So(e, U.value.start, r.viewMode, G.value);
|
|
288
280
|
}
|
|
289
|
-
function
|
|
290
|
-
return To(e, r.viewMode, G.value);
|
|
291
|
-
}
|
|
292
|
-
function Ln(e) {
|
|
281
|
+
function Mn(e) {
|
|
293
282
|
return Lo(e, r.viewMode, G.value);
|
|
294
283
|
}
|
|
295
|
-
function
|
|
284
|
+
function $n(e) {
|
|
285
|
+
return Co(e, r.viewMode, G.value);
|
|
286
|
+
}
|
|
287
|
+
function Cn(e) {
|
|
296
288
|
const n = U.value.start, t = G.value || 1;
|
|
297
289
|
if (r.viewMode === "month") {
|
|
298
|
-
const a = e / t, l = Math.floor(a),
|
|
299
|
-
return ae(
|
|
290
|
+
const a = e / t, l = Math.floor(a), u = pt(n, l), f = new Date(u.getFullYear(), u.getMonth() + 1, 0).getDate();
|
|
291
|
+
return ae(u, Math.round((a - l) * f));
|
|
300
292
|
}
|
|
301
293
|
const o = r.viewMode === "week" ? e / t * 7 : e / t;
|
|
302
294
|
return ae(n, Math.round(o));
|
|
303
295
|
}
|
|
304
|
-
const
|
|
305
|
-
function
|
|
296
|
+
const Ze = h(null);
|
|
297
|
+
function kt() {
|
|
306
298
|
return Math.max(0, N.value - le.value) || (I.value?.clientWidth ?? 0);
|
|
307
299
|
}
|
|
308
|
-
function
|
|
309
|
-
I.value && (
|
|
300
|
+
function xt() {
|
|
301
|
+
I.value && (Ze.value = Cn(I.value.scrollLeft + kt() / 2));
|
|
310
302
|
}
|
|
311
|
-
function
|
|
303
|
+
function Ye(e, n = "start") {
|
|
312
304
|
const t = I.value;
|
|
313
305
|
if (!t) return;
|
|
314
|
-
const o =
|
|
306
|
+
const o = Mo(e, U.value.start, r.viewMode, G.value), a = kt();
|
|
315
307
|
let l = o;
|
|
316
308
|
n === "center" && (l = o - a / 2 + G.value / 2);
|
|
317
|
-
const
|
|
318
|
-
t.scrollLeft = Math.max(0, Math.min(l,
|
|
309
|
+
const u = Math.max(0, t.scrollWidth - a);
|
|
310
|
+
t.scrollLeft = Math.max(0, Math.min(l, u)), Te.value = t.scrollLeft, xt();
|
|
319
311
|
}
|
|
320
|
-
function
|
|
312
|
+
function bt() {
|
|
321
313
|
const e = oe(/* @__PURE__ */ new Date()), { start: n, end: t } = U.value;
|
|
322
314
|
if (e >= n && e <= t) return e;
|
|
323
|
-
if (
|
|
324
|
-
let o =
|
|
325
|
-
for (const a of
|
|
315
|
+
if (m.value.length) {
|
|
316
|
+
let o = m.value[0]._start;
|
|
317
|
+
for (const a of m.value) a._start < o && (o = a._start);
|
|
326
318
|
return o;
|
|
327
319
|
}
|
|
328
320
|
return n;
|
|
329
321
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
322
|
+
function wt() {
|
|
323
|
+
Ye(bt(), "start");
|
|
332
324
|
}
|
|
333
325
|
const w = b(() => {
|
|
334
|
-
const e =
|
|
335
|
-
return
|
|
326
|
+
const e = Xe.value;
|
|
327
|
+
return pe.value.reduce((n, t, o) => {
|
|
336
328
|
if (t.type !== "task" || !t.task) return n;
|
|
337
|
-
const a = t.task, l = Ae(a._start),
|
|
338
|
-
return n.push({ task: a, x: l, y: D, fullW:
|
|
329
|
+
const a = t.task, l = Ae(a._start), u = Ae(a._end), f = Math.max(8, u - l), y = f * e, D = o * r.rowHeight + (r.rowHeight - r.barHeight) / 2, R = a.progress != null ? f * Math.min(100, a.progress) / 100 * e : 0;
|
|
330
|
+
return n.push({ task: a, x: l, y: D, fullW: f, w: y, progressW: R, rowIndex: o }), n;
|
|
339
331
|
}, []);
|
|
340
|
-
}),
|
|
332
|
+
}), Dt = b(() => {
|
|
341
333
|
const e = /* @__PURE__ */ new Map();
|
|
342
334
|
for (const n of w.value) e.set(n.task.id, n);
|
|
343
335
|
return e;
|
|
@@ -354,12 +346,12 @@ const Ro = {
|
|
|
354
346
|
row: t.rowIndex,
|
|
355
347
|
milestone: t.task.milestone
|
|
356
348
|
});
|
|
357
|
-
const n =
|
|
349
|
+
const n = ln(m.value).map((t) => ({
|
|
358
350
|
predecessorId: t.predecessorId,
|
|
359
351
|
successorId: t.successorId,
|
|
360
352
|
key: po(t.predecessorId, t.successorId)
|
|
361
353
|
}));
|
|
362
|
-
return
|
|
354
|
+
return mo(n, e, {
|
|
363
355
|
rowHeight: r.rowHeight,
|
|
364
356
|
barHeight: r.barHeight,
|
|
365
357
|
chartWidth: se.value,
|
|
@@ -367,81 +359,81 @@ const Ro = {
|
|
|
367
359
|
cornerRadius: 5
|
|
368
360
|
});
|
|
369
361
|
}), V = h(null);
|
|
370
|
-
function
|
|
371
|
-
i.active || s.active ||
|
|
362
|
+
function It(e) {
|
|
363
|
+
i.active || s.active || k.value || (V.value = e);
|
|
372
364
|
}
|
|
373
|
-
function
|
|
365
|
+
function St() {
|
|
374
366
|
V.value = null;
|
|
375
367
|
}
|
|
376
|
-
const
|
|
377
|
-
function
|
|
378
|
-
|
|
368
|
+
const Mt = /* @__PURE__ */ new Map();
|
|
369
|
+
function Ln(e, n) {
|
|
370
|
+
Mt.set(n, e ?? null);
|
|
379
371
|
}
|
|
380
372
|
function $t(e, n, t) {
|
|
381
|
-
const o =
|
|
373
|
+
const o = Mt.get(e);
|
|
382
374
|
if (!o) return;
|
|
383
375
|
const a = o.querySelector('[data-dep-part="hit"]');
|
|
384
376
|
a && a.setAttribute("d", n);
|
|
385
377
|
const l = o.querySelector('[data-dep-part="line"]');
|
|
386
378
|
l && l.setAttribute("d", n);
|
|
387
|
-
const
|
|
388
|
-
|
|
379
|
+
const u = o.querySelector('[data-dep-part="arrow"]');
|
|
380
|
+
u && u.setAttribute("d", t);
|
|
389
381
|
}
|
|
390
|
-
function
|
|
382
|
+
function Ct(e) {
|
|
391
383
|
if (!r.showDependencies || !j.value.length) return;
|
|
392
384
|
const n = r.barHeight * 0.4;
|
|
393
385
|
for (const t of j.value) {
|
|
394
386
|
const o = e.get(t.predecessorId), a = e.get(t.successorId);
|
|
395
387
|
if (!o && !a) continue;
|
|
396
|
-
const l =
|
|
397
|
-
if (!l || !
|
|
398
|
-
const
|
|
388
|
+
const l = Dt.value.get(t.predecessorId), u = Dt.value.get(t.successorId);
|
|
389
|
+
if (!l || !u) continue;
|
|
390
|
+
const f = (o?.geo?.x ?? l.x) + (o?.dx ?? 0), y = o?.geo?.fullW ?? l.fullW, D = (a?.geo?.x ?? u.x) + (a?.dx ?? 0), R = a?.geo?.fullW ?? u.fullW, De = l.task.milestone ? f + y / 2 + n : f + y, Ie = l.y + r.barHeight / 2, de = u.task.milestone ? D + R / 2 - n : D, ve = u.y + r.barHeight / 2;
|
|
399
391
|
$t(
|
|
400
392
|
t.key,
|
|
401
|
-
|
|
402
|
-
|
|
393
|
+
ko(De, Ie, de, ve, r.rowHeight, r.barHeight),
|
|
394
|
+
xo(de, ve)
|
|
403
395
|
);
|
|
404
396
|
}
|
|
405
397
|
}
|
|
406
|
-
function
|
|
398
|
+
function Ke() {
|
|
407
399
|
for (const e of j.value)
|
|
408
400
|
$t(e.key, e.d, e.ad);
|
|
409
401
|
}
|
|
410
|
-
const
|
|
411
|
-
const e =
|
|
402
|
+
const T = h(null), ye = b(() => T.value ? j.value.find((e) => e.key === T.value) ?? null : null), Wn = b(() => {
|
|
403
|
+
const e = ye.value;
|
|
412
404
|
if (!e) return "Delete dependency";
|
|
413
|
-
const n =
|
|
405
|
+
const n = m.value.find((o) => o.id === e.predecessorId)?.name ?? e.predecessorId, t = m.value.find((o) => o.id === e.successorId)?.name ?? e.successorId;
|
|
414
406
|
return `Delete dependency from ${n} to ${t}`;
|
|
415
|
-
}),
|
|
407
|
+
}), Lt = b(() => {
|
|
416
408
|
const e = /* @__PURE__ */ new Map();
|
|
417
|
-
for (const n of
|
|
409
|
+
for (const n of m.value) e.set(n.id, n.name);
|
|
418
410
|
return e;
|
|
419
411
|
});
|
|
420
412
|
function Wt(e) {
|
|
421
|
-
const n =
|
|
413
|
+
const n = Lt.value.get(e.predecessorId) ?? e.predecessorId, t = Lt.value.get(e.successorId) ?? e.successorId;
|
|
422
414
|
return `${t} is waiting on ${n} · ${n} is blocking ${t}`;
|
|
423
415
|
}
|
|
424
416
|
function J(e) {
|
|
425
|
-
return
|
|
417
|
+
return T.value === e;
|
|
426
418
|
}
|
|
427
419
|
function he(e = !1) {
|
|
428
|
-
|
|
420
|
+
T.value && (T.value = null, e && P("Dependency deselected"));
|
|
429
421
|
}
|
|
430
|
-
function
|
|
422
|
+
function Tt(e, n) {
|
|
431
423
|
if (!r.editableDependencies || s.active || i.active) return;
|
|
432
|
-
e.preventDefault(), e.stopPropagation(),
|
|
433
|
-
const t =
|
|
424
|
+
e.preventDefault(), e.stopPropagation(), T.value = n.key;
|
|
425
|
+
const t = m.value.find((a) => a.id === n.predecessorId), o = m.value.find((a) => a.id === n.successorId);
|
|
434
426
|
P(
|
|
435
427
|
`Dependency selected from ${t?.name ?? n.predecessorId} to ${o?.name ?? n.successorId}. Press Delete to remove, or Escape to deselect.`
|
|
436
428
|
);
|
|
437
429
|
}
|
|
438
|
-
function
|
|
430
|
+
function Tn(e) {
|
|
439
431
|
e.preventDefault(), e.stopPropagation(), Ee();
|
|
440
432
|
}
|
|
441
433
|
function Ee() {
|
|
442
|
-
const e =
|
|
434
|
+
const e = ye.value;
|
|
443
435
|
if (!e || !r.editableDependencies) return;
|
|
444
|
-
const n =
|
|
436
|
+
const n = m.value.find((a) => a.id === e.predecessorId), t = m.value.find((a) => a.id === e.successorId);
|
|
445
437
|
if (!n || !t) {
|
|
446
438
|
he();
|
|
447
439
|
return;
|
|
@@ -449,18 +441,18 @@ const Ro = {
|
|
|
449
441
|
const o = {
|
|
450
442
|
predecessorId: e.predecessorId,
|
|
451
443
|
successorId: e.successorId,
|
|
452
|
-
predecessor:
|
|
453
|
-
successor:
|
|
444
|
+
predecessor: He(n),
|
|
445
|
+
successor: He(t),
|
|
454
446
|
type: "waiting-on",
|
|
455
|
-
typeLabel:
|
|
447
|
+
typeLabel: rn("waiting-on")
|
|
456
448
|
};
|
|
457
|
-
|
|
449
|
+
T.value = null, P(`Dependency removed from ${n.name} to ${t.name}`), q("dependency-delete", o);
|
|
458
450
|
}
|
|
459
|
-
function
|
|
460
|
-
!
|
|
451
|
+
function An(e) {
|
|
452
|
+
!T.value || e.target?.closest?.(".vlite-gantt-dep-group, .vlite-gantt-dep-delete, .vlite-gantt-dep-connector") || he();
|
|
461
453
|
}
|
|
462
|
-
function
|
|
463
|
-
if (!(!
|
|
454
|
+
function Ne(e) {
|
|
455
|
+
if (!(!T.value || s.active || k.value)) {
|
|
464
456
|
if (e.key === "Escape") {
|
|
465
457
|
e.preventDefault(), he(!0);
|
|
466
458
|
return;
|
|
@@ -472,18 +464,18 @@ const Ro = {
|
|
|
472
464
|
}
|
|
473
465
|
}
|
|
474
466
|
}
|
|
475
|
-
fe(
|
|
476
|
-
e && !n && document.addEventListener("keydown",
|
|
467
|
+
fe(T, (e, n) => {
|
|
468
|
+
e && !n && document.addEventListener("keydown", Ne), !e && n && document.removeEventListener("keydown", Ne);
|
|
477
469
|
});
|
|
478
470
|
const me = b(() => {
|
|
479
471
|
const e = oe(/* @__PURE__ */ new Date());
|
|
480
472
|
return Ae(e);
|
|
481
|
-
}),
|
|
473
|
+
}), Ue = b(() => {
|
|
482
474
|
const e = oe(/* @__PURE__ */ new Date());
|
|
483
475
|
return e >= U.value.start && e <= U.value.end;
|
|
484
476
|
});
|
|
485
|
-
function
|
|
486
|
-
!I.value || !
|
|
477
|
+
function En() {
|
|
478
|
+
!I.value || !Ue.value || I.value.scrollTo({ left: Math.max(0, me.value - (N.value - le.value) / 2), behavior: "smooth" });
|
|
487
479
|
}
|
|
488
480
|
let i = {
|
|
489
481
|
active: !1,
|
|
@@ -510,14 +502,14 @@ const Ro = {
|
|
|
510
502
|
keyboard: !1,
|
|
511
503
|
keyboardTargetIndex: -1
|
|
512
504
|
};
|
|
513
|
-
const B = h(!1), Q = h(""), Z = h(null),
|
|
514
|
-
function
|
|
505
|
+
const B = h(!1), Q = h(""), Z = h(null), Pe = h(null), ke = h("default"), k = h(!1), ce = h(""), xe = h(null), L = h("none"), E = h(null), je = h(""), Re = h(null), C = h(!1), ee = h([]), F = h(null);
|
|
506
|
+
function Pn(e, n) {
|
|
515
507
|
ee.value[n] = e;
|
|
516
508
|
}
|
|
517
|
-
function
|
|
509
|
+
function Rn(e) {
|
|
518
510
|
const n = /* @__PURE__ */ new Set();
|
|
519
511
|
if (!r.cascadeDependencies) return n;
|
|
520
|
-
const t =
|
|
512
|
+
const t = ln(m.value), o = [e];
|
|
521
513
|
for (; o.length; ) {
|
|
522
514
|
const a = o.shift();
|
|
523
515
|
for (const l of t)
|
|
@@ -525,43 +517,43 @@ const Ro = {
|
|
|
525
517
|
}
|
|
526
518
|
return n;
|
|
527
519
|
}
|
|
528
|
-
function
|
|
520
|
+
function At(e, n) {
|
|
529
521
|
if (!r.draggable || n.task.milestone) return "move";
|
|
530
522
|
const t = e.currentTarget.closest("svg");
|
|
531
523
|
if (!t) return "move";
|
|
532
524
|
const o = e.clientX - t.getBoundingClientRect().left;
|
|
533
|
-
return o < n.x +
|
|
525
|
+
return o < n.x + cn ? "resize-left" : o > n.x + n.fullW - cn ? "resize-right" : "move";
|
|
534
526
|
}
|
|
535
|
-
function
|
|
536
|
-
if (!r.draggable || s.active ||
|
|
527
|
+
function Bn(e, n) {
|
|
528
|
+
if (!r.draggable || s.active || k.value) return;
|
|
537
529
|
const t = w.value[n];
|
|
538
530
|
if (!t || t.task.milestone) return;
|
|
539
531
|
e.preventDefault(), e.stopPropagation();
|
|
540
|
-
const o =
|
|
541
|
-
i.active = !0, i.barIndex = n, i.taskId = t.task.id, i.mode = o, i.startMouseX = e.clientX, i.pxDelta = 0, i.origStart = new Date(t.task._start), i.origEnd = new Date(t.task._end), i.affectedIds = o === "move" ?
|
|
532
|
+
const o = At(e, t);
|
|
533
|
+
i.active = !0, i.barIndex = n, i.taskId = t.task.id, i.mode = o, i.startMouseX = e.clientX, i.pxDelta = 0, i.origStart = new Date(t.task._start), i.origEnd = new Date(t.task._end), i.affectedIds = o === "move" ? Rn(t.task.id) : /* @__PURE__ */ new Set(), B.value = !0, Q.value = t.task.id, p.value = null, C.value = !1, V.value = null, H.value = n, be = "", document.addEventListener("mousemove", Pt), document.addEventListener("mouseup", Ot), document.addEventListener("pointercancel", Bt), document.addEventListener("keydown", Rt), document.body.style.cursor = o === "move" ? "grabbing" : "ew-resize", document.body.style.userSelect = "none", P(
|
|
542
534
|
o === "move" ? `Moving ${t.task.name}` : `Resizing ${t.task.name}. Preview dates update as you drag.`
|
|
543
535
|
);
|
|
544
536
|
}
|
|
545
|
-
function
|
|
537
|
+
function Et() {
|
|
546
538
|
if (!i.origStart || !i.origEnd) return null;
|
|
547
539
|
const e = ft(i.origStart, i.origEnd);
|
|
548
|
-
return
|
|
540
|
+
return To({
|
|
549
541
|
mode: i.mode,
|
|
550
542
|
pxDelta: i.pxDelta,
|
|
551
543
|
origStart: i.origStart,
|
|
552
544
|
origEnd: i.origEnd,
|
|
553
545
|
origDurationDays: e,
|
|
554
|
-
pxToDays:
|
|
555
|
-
daysToPx:
|
|
546
|
+
pxToDays: Mn,
|
|
547
|
+
daysToPx: $n,
|
|
556
548
|
addDays: ae
|
|
557
549
|
});
|
|
558
550
|
}
|
|
559
|
-
function
|
|
551
|
+
function Pt(e) {
|
|
560
552
|
if (!i.active) return;
|
|
561
553
|
i.pxDelta = e.clientX - i.startMouseX;
|
|
562
554
|
const n = I.value;
|
|
563
555
|
if (n) {
|
|
564
|
-
const t = n.getBoundingClientRect(), { dx: o, dy: a } =
|
|
556
|
+
const t = n.getBoundingClientRect(), { dx: o, dy: a } = sn(e.clientX, e.clientY, {
|
|
565
557
|
left: t.left,
|
|
566
558
|
top: t.top,
|
|
567
559
|
right: t.right,
|
|
@@ -571,19 +563,19 @@ const Ro = {
|
|
|
571
563
|
}
|
|
572
564
|
cancelAnimationFrame(i.rafId), i.rafId = requestAnimationFrame(_n);
|
|
573
565
|
}
|
|
574
|
-
function
|
|
566
|
+
function Rt(e) {
|
|
575
567
|
i.active && e.key === "Escape" && (e.preventDefault(), _e(i.mode === "move" ? "Move cancelled" : "Resize cancelled"));
|
|
576
568
|
}
|
|
577
|
-
function
|
|
569
|
+
function Bt() {
|
|
578
570
|
_e(i.mode === "move" ? "Move cancelled" : "Resize cancelled");
|
|
579
571
|
}
|
|
580
|
-
function
|
|
581
|
-
const { x: t, y: o, fullW: a, progressW: l } = n,
|
|
582
|
-
|
|
572
|
+
function _t(e, n) {
|
|
573
|
+
const { x: t, y: o, fullW: a, progressW: l } = n, u = r.barHeight, f = r.barRadius, y = e.querySelector('[data-gantt-part="bg"]');
|
|
574
|
+
y && y.setAttribute("d", _(t, o, a, u, f));
|
|
583
575
|
const D = e.querySelector('[data-gantt-part="progress"]');
|
|
584
|
-
D && (l > 0 ? (D.setAttribute("d",
|
|
576
|
+
D && (l > 0 ? (D.setAttribute("d", _(t, o, Math.min(l, a), u, f)), D.style.display = "") : D.style.display = "none");
|
|
585
577
|
const R = e.querySelector('[data-gantt-part="fill"]');
|
|
586
|
-
R && R.setAttribute("d",
|
|
578
|
+
R && R.setAttribute("d", _(t, o, a, u, f));
|
|
587
579
|
const De = e.querySelector('[data-gantt-part="hitbox"]');
|
|
588
580
|
De && (De.setAttribute("x", String(t)), De.setAttribute("width", String(a)));
|
|
589
581
|
const Ie = e.querySelector('[data-gantt-part="highlight"]');
|
|
@@ -592,69 +584,69 @@ const Ro = {
|
|
|
592
584
|
de && (de.setAttribute("x", String(t)), de.style.display = "");
|
|
593
585
|
const ve = e.querySelector('[data-gantt-part="handle-right"]');
|
|
594
586
|
ve && (ve.setAttribute("x", String(t + a - 4)), ve.style.display = "");
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
587
|
+
const tn = e.querySelector('[data-gantt-part="blocked-hatch"]');
|
|
588
|
+
tn && tn.setAttribute("d", _(t, o, a, u, f));
|
|
589
|
+
const nn = e.querySelector('[data-gantt-part="blocked-outline"]');
|
|
590
|
+
nn && nn.setAttribute("d", _(t, o, a, u, f));
|
|
591
|
+
const Ge = e.querySelector('[data-gantt-part="blocked-lock"]');
|
|
592
|
+
Ge && Ge.setAttribute("transform", `translate(${t + 10}, ${o + u / 2})`);
|
|
601
593
|
const Se = e.querySelector('[data-gantt-part="label"]');
|
|
602
594
|
if (Se) {
|
|
603
|
-
Se.setAttribute("x", String(t + (
|
|
604
|
-
const
|
|
605
|
-
|
|
595
|
+
Se.setAttribute("x", String(t + (Ge ? 24 : 12))), Se.style.display = a > 60 ? "" : "none";
|
|
596
|
+
const on = Se.getAttribute("data-name");
|
|
597
|
+
on && (Se.textContent = jt(on, a, !!Ge));
|
|
606
598
|
}
|
|
607
599
|
}
|
|
608
|
-
function
|
|
600
|
+
function Ht(e) {
|
|
609
601
|
const n = w.value[e], t = ee.value[e];
|
|
610
602
|
if (!n || !t || n.task.milestone) return;
|
|
611
603
|
t.style.transform = "", t.removeAttribute("data-resize-px");
|
|
612
604
|
const o = n.task.progress != null ? n.fullW * Math.min(100, n.task.progress) / 100 : 0;
|
|
613
|
-
|
|
605
|
+
_t(t, {
|
|
614
606
|
x: n.x,
|
|
615
607
|
y: n.y,
|
|
616
608
|
fullW: n.fullW,
|
|
617
609
|
progressW: o
|
|
618
610
|
});
|
|
619
611
|
}
|
|
620
|
-
const
|
|
621
|
-
function
|
|
622
|
-
return `${e.toLocaleDateString(r.locale,
|
|
612
|
+
const zt = { month: "short", day: "numeric", year: "numeric" };
|
|
613
|
+
function Be(e, n) {
|
|
614
|
+
return `${e.toLocaleDateString(r.locale, zt)} — ${n.toLocaleDateString(r.locale, zt)}`;
|
|
623
615
|
}
|
|
624
|
-
function
|
|
616
|
+
function Xt(e, n, t, o, a) {
|
|
625
617
|
if (!F.value) return;
|
|
626
|
-
const l =
|
|
618
|
+
const l = Be(e, n), u = t + a / 2, f = o - 22, y = Math.max(148, l.length * 6.2);
|
|
627
619
|
F.value.style.display = "";
|
|
628
620
|
const D = F.value.querySelector("rect"), R = F.value.querySelector("text");
|
|
629
|
-
D && (D.setAttribute("x", String(
|
|
621
|
+
D && (D.setAttribute("x", String(u - y / 2)), D.setAttribute("y", String(f - 8)), D.setAttribute("width", String(y))), R && (R.setAttribute("x", String(u)), R.setAttribute("y", String(f + 2)), R.textContent = l);
|
|
630
622
|
}
|
|
631
623
|
let be = "";
|
|
632
|
-
function
|
|
624
|
+
function Gt(e) {
|
|
633
625
|
e !== be && (be = e, P(e));
|
|
634
626
|
}
|
|
635
627
|
function _n() {
|
|
636
628
|
const e = w.value[i.barIndex], n = ee.value[i.barIndex];
|
|
637
629
|
if (!e || !n || !i.origStart || !i.origEnd) return;
|
|
638
|
-
const t =
|
|
630
|
+
const t = Et();
|
|
639
631
|
if (!t) return;
|
|
640
632
|
if (i.mode === "move") {
|
|
641
633
|
const l = t.clampedPxDelta;
|
|
642
634
|
if (n.style.transform = `translateX(${l}px)`, i.affectedIds.size > 0) {
|
|
643
|
-
for (let
|
|
644
|
-
if (i.affectedIds.has(w.value[
|
|
645
|
-
const
|
|
646
|
-
|
|
635
|
+
for (let f = 0; f < w.value.length; f++)
|
|
636
|
+
if (i.affectedIds.has(w.value[f].task.id)) {
|
|
637
|
+
const y = ee.value[f];
|
|
638
|
+
y && (y.style.transform = `translateX(${l}px)`);
|
|
647
639
|
}
|
|
648
640
|
}
|
|
649
|
-
const
|
|
650
|
-
for (const
|
|
651
|
-
|
|
641
|
+
const u = /* @__PURE__ */ new Map([[e.task.id, { dx: l }]]);
|
|
642
|
+
for (const f of i.affectedIds) u.set(f, { dx: l });
|
|
643
|
+
Ct(u), Xt(
|
|
652
644
|
t.start,
|
|
653
645
|
t.end,
|
|
654
646
|
e.x + l,
|
|
655
647
|
e.y,
|
|
656
648
|
e.fullW
|
|
657
|
-
),
|
|
649
|
+
), Gt(`${e.task.name}: ${Be(t.start, t.end)}`);
|
|
658
650
|
return;
|
|
659
651
|
}
|
|
660
652
|
n.style.transform = "";
|
|
@@ -663,47 +655,47 @@ const Ro = {
|
|
|
663
655
|
end: t.end,
|
|
664
656
|
dateToX: Ae
|
|
665
657
|
}), a = e.fullW > 0 ? e.progressW / e.fullW : 0;
|
|
666
|
-
|
|
658
|
+
_t(n, {
|
|
667
659
|
x: o.x,
|
|
668
660
|
y: e.y,
|
|
669
661
|
fullW: o.fullW,
|
|
670
662
|
progressW: o.fullW * a
|
|
671
|
-
}),
|
|
663
|
+
}), Ct(/* @__PURE__ */ new Map([[e.task.id, { geo: { x: o.x, fullW: o.fullW } }]])), Xt(t.start, t.end, o.x, e.y, o.fullW), Gt(`${e.task.name}: ${Be(t.start, t.end)}`);
|
|
672
664
|
}
|
|
673
|
-
function
|
|
674
|
-
document.removeEventListener("mousemove",
|
|
665
|
+
function Ft() {
|
|
666
|
+
document.removeEventListener("mousemove", Pt), document.removeEventListener("mouseup", Ot), document.removeEventListener("pointercancel", Bt), document.removeEventListener("keydown", Rt), document.body.style.cursor = "", document.body.style.userSelect = "", cancelAnimationFrame(i.rafId);
|
|
675
667
|
}
|
|
676
668
|
function _e(e) {
|
|
677
669
|
if (!i.active) return;
|
|
678
|
-
|
|
670
|
+
Ft();
|
|
679
671
|
const n = i.barIndex;
|
|
680
672
|
if (i.mode === "move")
|
|
681
673
|
for (const t of ee.value)
|
|
682
674
|
t && (t.style.transform = "", t.removeAttribute("data-resize-px"));
|
|
683
|
-
else n >= 0 &&
|
|
684
|
-
|
|
675
|
+
else n >= 0 && Ht(n);
|
|
676
|
+
Ke(), F.value && (F.value.style.display = "none"), i.active = !1, i.barIndex = -1, i.taskId = "", i.pxDelta = 0, i.origStart = null, i.origEnd = null, i.affectedIds.clear(), B.value = !1, Q.value = "", H.value = null, be = "", e && P(e);
|
|
685
677
|
}
|
|
686
|
-
function
|
|
678
|
+
function Ot() {
|
|
687
679
|
if (!i.active) return;
|
|
688
|
-
const e =
|
|
689
|
-
if (
|
|
690
|
-
const l =
|
|
691
|
-
if (l && (q("task-update", l, { start: e.start, end: e.end }), P(`Updated ${l.name} to ${
|
|
692
|
-
for (const
|
|
693
|
-
|
|
694
|
-
|
|
680
|
+
const e = Et(), n = i.mode, t = i.taskId, o = i.barIndex;
|
|
681
|
+
if (Ft(), !!e && Math.abs(e.snappedDays) > 0.1 && e) {
|
|
682
|
+
const l = m.value.find((u) => u.id === t);
|
|
683
|
+
if (l && (q("task-update", l, { start: e.start, end: e.end }), P(`Updated ${l.name} to ${Be(e.start, e.end)}`)), n === "move") {
|
|
684
|
+
for (const u of ee.value)
|
|
685
|
+
u && (u.style.transform = "", u.removeAttribute("data-resize-px"));
|
|
686
|
+
Ke();
|
|
695
687
|
}
|
|
696
688
|
} else {
|
|
697
689
|
if (n === "move")
|
|
698
690
|
for (const l of ee.value)
|
|
699
691
|
l && (l.style.transform = "", l.removeAttribute("data-resize-px"));
|
|
700
|
-
else o >= 0 &&
|
|
701
|
-
|
|
692
|
+
else o >= 0 && Ht(o);
|
|
693
|
+
Ke();
|
|
702
694
|
}
|
|
703
|
-
F.value && (F.value.style.display = "none"), i.active = !1, i.barIndex = -1, i.taskId = "", i.pxDelta = 0, i.origStart = null, i.origEnd = null, i.affectedIds.clear(), B.value = !1, Q.value = "",
|
|
695
|
+
F.value && (F.value.style.display = "none"), i.active = !1, i.barIndex = -1, i.taskId = "", i.pxDelta = 0, i.origStart = null, i.origEnd = null, i.affectedIds.clear(), B.value = !1, Q.value = "", H.value = null, be = "";
|
|
704
696
|
}
|
|
705
697
|
function Je(e, n) {
|
|
706
|
-
if (s.active ||
|
|
698
|
+
if (s.active || k.value) {
|
|
707
699
|
ke.value = "crosshair";
|
|
708
700
|
return;
|
|
709
701
|
}
|
|
@@ -711,28 +703,28 @@ const Ro = {
|
|
|
711
703
|
ke.value = i.active ? "grabbing" : "pointer";
|
|
712
704
|
return;
|
|
713
705
|
}
|
|
714
|
-
ke.value =
|
|
706
|
+
ke.value = At(e, n) === "move" ? "grab" : "ew-resize";
|
|
715
707
|
}
|
|
716
|
-
function
|
|
708
|
+
function He(e) {
|
|
717
709
|
const { _start: n, _end: t, _color: o, _index: a, ...l } = e;
|
|
718
710
|
return l;
|
|
719
711
|
}
|
|
720
712
|
function Qe(e, n) {
|
|
721
|
-
const t =
|
|
713
|
+
const t = Re.value;
|
|
722
714
|
if (!t) return { x: 0, y: 0 };
|
|
723
715
|
const o = t.getBoundingClientRect();
|
|
724
716
|
return { x: e - o.left, y: n - o.top };
|
|
725
717
|
}
|
|
726
718
|
function Y(e) {
|
|
727
|
-
return
|
|
719
|
+
return yo(
|
|
728
720
|
{ id: e.task.id, x: e.x, y: e.y, fullW: e.fullW, milestone: e.task.milestone },
|
|
729
721
|
r.barHeight
|
|
730
722
|
);
|
|
731
723
|
}
|
|
732
|
-
function
|
|
733
|
-
return !r.editableDependencies || i.active || B.value ? !1 :
|
|
724
|
+
function Hn(e) {
|
|
725
|
+
return !r.editableDependencies || i.active || B.value ? !1 : k.value && ce.value === w.value[e]?.task.id ? !0 : Z.value === e || Pe.value === e;
|
|
734
726
|
}
|
|
735
|
-
function
|
|
727
|
+
function zn() {
|
|
736
728
|
return w.value.map((e) => ({
|
|
737
729
|
id: e.task.id,
|
|
738
730
|
x: e.x,
|
|
@@ -760,54 +752,54 @@ const Ro = {
|
|
|
760
752
|
y2: s.pointerY
|
|
761
753
|
};
|
|
762
754
|
}
|
|
763
|
-
function
|
|
755
|
+
function ze(e) {
|
|
764
756
|
if (s.targetId = e, xe.value = e, !e || e === s.sourceId) {
|
|
765
757
|
s.targetValid = !1, L.value = e ? "invalid" : "none";
|
|
766
758
|
return;
|
|
767
759
|
}
|
|
768
|
-
const n = ut(
|
|
760
|
+
const n = ut(m.value, s.sourceId, e);
|
|
769
761
|
s.targetValid = n.valid, L.value = n.valid ? "valid" : "invalid";
|
|
770
762
|
}
|
|
771
763
|
function et(e, n) {
|
|
772
764
|
const t = Qe(e, n);
|
|
773
765
|
s.pointerX = t.x, s.pointerY = t.y;
|
|
774
|
-
const o =
|
|
775
|
-
|
|
766
|
+
const o = ho(zn(), t.x, t.y, r.barHeight), a = o && o.id !== s.sourceId ? o.id : o?.id === s.sourceId ? s.sourceId : null;
|
|
767
|
+
ze(a), we();
|
|
776
768
|
const l = I.value;
|
|
777
769
|
if (l) {
|
|
778
|
-
const
|
|
779
|
-
left:
|
|
780
|
-
top:
|
|
781
|
-
right:
|
|
782
|
-
bottom:
|
|
770
|
+
const u = l.getBoundingClientRect(), { dx: f, dy: y } = sn(e, n, {
|
|
771
|
+
left: u.left,
|
|
772
|
+
top: u.top,
|
|
773
|
+
right: u.right,
|
|
774
|
+
bottom: u.bottom
|
|
783
775
|
});
|
|
784
|
-
(
|
|
785
|
-
l.scrollLeft +=
|
|
776
|
+
(f || y) && (cancelAnimationFrame(s.scrollRafId), s.scrollRafId = requestAnimationFrame(() => {
|
|
777
|
+
l.scrollLeft += f, l.scrollTop += y, ne.value && (ne.value.scrollTop = l.scrollTop);
|
|
786
778
|
const D = Qe(e, n);
|
|
787
779
|
s.pointerX = D.x, s.pointerY = D.y, we();
|
|
788
780
|
}));
|
|
789
781
|
}
|
|
790
782
|
}
|
|
791
|
-
function
|
|
792
|
-
document.removeEventListener("pointermove",
|
|
783
|
+
function qt() {
|
|
784
|
+
document.removeEventListener("pointermove", Yt), document.removeEventListener("pointerup", Kt), document.removeEventListener("pointercancel", Nt), document.removeEventListener("keydown", Ut);
|
|
793
785
|
}
|
|
794
786
|
function te(e) {
|
|
795
|
-
!s.active && !
|
|
787
|
+
!s.active && !k.value || (qt(), cancelAnimationFrame(s.rafId), cancelAnimationFrame(s.scrollRafId), document.body.style.cursor = "", document.body.style.userSelect = "", s.active = !1, s.sourceId = "", s.sourceIndex = -1, s.targetId = null, s.targetValid = !1, s.keyboard = !1, s.keyboardTargetIndex = -1, k.value = !1, ce.value = "", xe.value = null, L.value = "none", E.value = null, C.value = !1, e && P(e));
|
|
796
788
|
}
|
|
797
|
-
function
|
|
789
|
+
function Vt() {
|
|
798
790
|
if (!s.active) return;
|
|
799
791
|
const e = s.sourceId, n = s.targetId;
|
|
800
792
|
if (!(s.targetValid && !!n) || !n) {
|
|
801
793
|
te(
|
|
802
794
|
n ? ct(
|
|
803
|
-
ut(
|
|
804
|
-
|
|
805
|
-
|
|
795
|
+
ut(m.value, e, n),
|
|
796
|
+
m.value.find((u) => u.id === e)?.name ?? e,
|
|
797
|
+
m.value.find((u) => u.id === n)?.name ?? n
|
|
806
798
|
) : "Dependency linking cancelled"
|
|
807
799
|
);
|
|
808
800
|
return;
|
|
809
801
|
}
|
|
810
|
-
const o =
|
|
802
|
+
const o = m.value.find((u) => u.id === e), a = m.value.find((u) => u.id === n);
|
|
811
803
|
if (!o || !a) {
|
|
812
804
|
te("Dependency linking cancelled");
|
|
813
805
|
return;
|
|
@@ -815,10 +807,10 @@ const Ro = {
|
|
|
815
807
|
const l = {
|
|
816
808
|
predecessorId: e,
|
|
817
809
|
successorId: n,
|
|
818
|
-
predecessor:
|
|
819
|
-
successor:
|
|
810
|
+
predecessor: He(o),
|
|
811
|
+
successor: He(a),
|
|
820
812
|
type: "waiting-on",
|
|
821
|
-
typeLabel:
|
|
813
|
+
typeLabel: rn("waiting-on")
|
|
822
814
|
};
|
|
823
815
|
P(
|
|
824
816
|
ct(
|
|
@@ -826,129 +818,131 @@ const Ro = {
|
|
|
826
818
|
o.name,
|
|
827
819
|
a.name
|
|
828
820
|
)
|
|
829
|
-
),
|
|
821
|
+
), qt(), cancelAnimationFrame(s.rafId), cancelAnimationFrame(s.scrollRafId), document.body.style.cursor = "", document.body.style.userSelect = "", s.active = !1, s.sourceId = "", s.sourceIndex = -1, s.targetId = null, s.targetValid = !1, s.keyboard = !1, s.keyboardTargetIndex = -1, k.value = !1, ce.value = "", xe.value = null, L.value = "none", E.value = null, C.value = !1, q("dependency-create", l);
|
|
830
822
|
}
|
|
831
|
-
function
|
|
823
|
+
function Zt(e, n, t, o = !1) {
|
|
832
824
|
if (!r.editableDependencies || i.active || B.value) return;
|
|
833
825
|
const a = w.value[e];
|
|
834
826
|
if (!a) return;
|
|
835
|
-
he(), s.active = !0, s.sourceId = a.task.id, s.sourceIndex = e, s.keyboard = o, s.keyboardTargetIndex = -1,
|
|
827
|
+
he(), s.active = !0, s.sourceId = a.task.id, s.sourceIndex = e, s.keyboard = o, s.keyboardTargetIndex = -1, k.value = !0, ce.value = a.task.id, p.value = null, C.value = !0, V.value = null, H.value = e;
|
|
836
828
|
const l = Y(a);
|
|
837
|
-
o ? (s.pointerX = l.cx + 40, s.pointerY = l.cy,
|
|
829
|
+
o ? (s.pointerX = l.cx + 40, s.pointerY = l.cy, ze(null)) : et(n, t), we(), P(`Linking from ${a.task.name}. Drop on a target task, or press Escape to cancel.`), document.addEventListener("pointermove", Yt), document.addEventListener("pointerup", Kt), document.addEventListener("pointercancel", Nt), document.addEventListener("keydown", Ut), document.body.style.cursor = "crosshair", document.body.style.userSelect = "none";
|
|
838
830
|
}
|
|
839
|
-
function
|
|
831
|
+
function Yt(e) {
|
|
840
832
|
!s.active || s.keyboard || (cancelAnimationFrame(s.rafId), s.rafId = requestAnimationFrame(() => et(e.clientX, e.clientY)));
|
|
841
833
|
}
|
|
842
|
-
function
|
|
843
|
-
!s.active || s.keyboard || (et(e.clientX, e.clientY),
|
|
834
|
+
function Kt(e) {
|
|
835
|
+
!s.active || s.keyboard || (et(e.clientX, e.clientY), Vt());
|
|
844
836
|
}
|
|
845
|
-
function
|
|
837
|
+
function Nt() {
|
|
846
838
|
te("Dependency linking cancelled");
|
|
847
839
|
}
|
|
848
840
|
function tt(e) {
|
|
849
841
|
const n = w.value;
|
|
850
842
|
if (!n.length) return;
|
|
851
|
-
const t = n.map((
|
|
843
|
+
const t = n.map((y, D) => ({ b: y, i: D })).filter(({ b: y }) => y.task.id !== s.sourceId);
|
|
852
844
|
if (!t.length) {
|
|
853
|
-
|
|
845
|
+
ze(null), we();
|
|
854
846
|
return;
|
|
855
847
|
}
|
|
856
|
-
let o = t.findIndex(({ b:
|
|
848
|
+
let o = t.findIndex(({ b: y }) => y.task.id === s.targetId);
|
|
857
849
|
o < 0 && (o = e === 1 ? -1 : 0), o = (o + e + t.length) % t.length;
|
|
858
850
|
const a = t[o];
|
|
859
851
|
s.keyboardTargetIndex = a.i;
|
|
860
852
|
const l = Y(a.b);
|
|
861
|
-
s.pointerX = a.b.task.milestone ? a.b.x + a.b.fullW / 2 : a.b.x, s.pointerY = l.cy,
|
|
862
|
-
const
|
|
853
|
+
s.pointerX = a.b.task.milestone ? a.b.x + a.b.fullW / 2 : a.b.x, s.pointerY = l.cy, ze(a.b.task.id), we();
|
|
854
|
+
const u = ut(m.value, s.sourceId, a.b.task.id), f = m.value.find((y) => y.id === s.sourceId)?.name ?? s.sourceId;
|
|
863
855
|
P(
|
|
864
|
-
|
|
856
|
+
u.valid ? `Target ${a.b.task.name}. Press Enter to create dependency.` : ct(u, f, a.b.task.name)
|
|
865
857
|
);
|
|
866
858
|
}
|
|
867
|
-
function
|
|
859
|
+
function Ut(e) {
|
|
868
860
|
if (s.active) {
|
|
869
861
|
if (e.key === "Escape") {
|
|
870
862
|
e.preventDefault(), te("Dependency linking cancelled");
|
|
871
863
|
return;
|
|
872
864
|
}
|
|
873
|
-
s.keyboard && (e.key === "ArrowDown" || e.key === "ArrowRight" ? (e.preventDefault(), tt(1)) : e.key === "ArrowUp" || e.key === "ArrowLeft" ? (e.preventDefault(), tt(-1)) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
865
|
+
s.keyboard && (e.key === "ArrowDown" || e.key === "ArrowRight" ? (e.preventDefault(), tt(1)) : e.key === "ArrowUp" || e.key === "ArrowLeft" ? (e.preventDefault(), tt(-1)) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Vt()));
|
|
874
866
|
}
|
|
875
867
|
}
|
|
876
|
-
function
|
|
877
|
-
!r.editableDependencies || i.active || (e.preventDefault(), e.stopPropagation(),
|
|
868
|
+
function Xn(e, n) {
|
|
869
|
+
!r.editableDependencies || i.active || (e.preventDefault(), e.stopPropagation(), p.value = null, C.value = !0, Zt(n, e.clientX, e.clientY, !1));
|
|
878
870
|
}
|
|
879
|
-
function
|
|
880
|
-
if (!(!r.editableDependencies || i.active ||
|
|
871
|
+
function Gn(e, n) {
|
|
872
|
+
if (!(!r.editableDependencies || i.active || k.value) && (e.key === "Enter" || e.key === " ")) {
|
|
881
873
|
e.preventDefault(), e.stopPropagation();
|
|
882
874
|
const t = w.value[n];
|
|
883
875
|
if (!t) return;
|
|
884
|
-
|
|
885
|
-
const o = Y(t), l =
|
|
886
|
-
|
|
876
|
+
p.value = null;
|
|
877
|
+
const o = Y(t), l = Re.value?.getBoundingClientRect(), u = (l?.left ?? 0) + o.cx, f = (l?.top ?? 0) + o.cy;
|
|
878
|
+
Zt(n, u, f, !0), tt(1);
|
|
887
879
|
}
|
|
888
880
|
}
|
|
889
|
-
function
|
|
890
|
-
|
|
881
|
+
function Fn(e) {
|
|
882
|
+
Pe.value = e, Z.value = e, p.value = null;
|
|
891
883
|
}
|
|
892
|
-
function
|
|
893
|
-
|
|
884
|
+
function On() {
|
|
885
|
+
Pe.value = null, C.value = !1, k.value || (Z.value = null);
|
|
894
886
|
}
|
|
895
|
-
function
|
|
896
|
-
return !
|
|
887
|
+
function qn(e) {
|
|
888
|
+
return !k.value || ce.value === e ? "" : xe.value !== e ? "vlite-gantt-link-candidate" : L.value === "valid" ? "vlite-gantt-link-target-valid" : "vlite-gantt-link-target-invalid";
|
|
897
889
|
}
|
|
898
|
-
const
|
|
890
|
+
const Xe = h(r.animate ? 0 : 1);
|
|
899
891
|
let nt = null;
|
|
900
892
|
function ot() {
|
|
901
|
-
nt?.(),
|
|
893
|
+
nt?.(), Xe.value = 0, nt = go(900, (e) => Xe.value = e);
|
|
902
894
|
}
|
|
903
|
-
|
|
904
|
-
|
|
895
|
+
ao(() => {
|
|
896
|
+
gn(), r.animate && ot(), Me(wt);
|
|
905
897
|
}), fe(() => r.viewMode, () => {
|
|
906
|
-
const e = r.preserveCenterDate ?
|
|
907
|
-
|
|
908
|
-
e ?
|
|
898
|
+
const e = r.preserveCenterDate ? Ze.value ?? bt() : null;
|
|
899
|
+
$.value = 1, r.animate && ot(), Me(() => {
|
|
900
|
+
e ? Ye(e, "center") : wt();
|
|
909
901
|
});
|
|
910
902
|
}), fe(() => r.tasks.length, () => {
|
|
911
903
|
r.animate && ot();
|
|
912
904
|
}), fe(() => r.tasks, () => {
|
|
913
|
-
i.active && (r.tasks.some((n) => n.id === i.taskId) || _e(i.mode === "move" ? "Move cancelled because task was removed" : "Resize cancelled because task was removed")), (s.active ||
|
|
905
|
+
i.active && (r.tasks.some((n) => n.id === i.taskId) || _e(i.mode === "move" ? "Move cancelled because task was removed" : "Resize cancelled because task was removed")), (s.active || k.value) && te("Dependency linking cancelled because tasks changed"), T.value && !j.value.some((e) => e.key === T.value) && (T.value = null), V.value && !j.value.some((e) => e.key === V.value) && (V.value = null);
|
|
914
906
|
}), fe(() => r.editableDependencies, (e) => {
|
|
915
|
-
e || ((s.active ||
|
|
916
|
-
}),
|
|
917
|
-
nt?.(),
|
|
918
|
-
}),
|
|
919
|
-
zoomIn:
|
|
920
|
-
zoomOut:
|
|
921
|
-
setZoom:
|
|
922
|
-
resetZoom:
|
|
923
|
-
scrollToToday:
|
|
907
|
+
e || ((s.active || k.value) && te("Dependency linking cancelled"), he());
|
|
908
|
+
}), lo(() => {
|
|
909
|
+
nt?.(), qe?.disconnect(), _e(), document.removeEventListener("keydown", Ne), te();
|
|
910
|
+
}), vn({
|
|
911
|
+
zoomIn: mn,
|
|
912
|
+
zoomOut: kn,
|
|
913
|
+
setZoom: xn,
|
|
914
|
+
resetZoom: bn,
|
|
915
|
+
scrollToToday: En,
|
|
916
|
+
/** Whether "today" falls inside the rendered date range (read-only). */
|
|
917
|
+
isTodayVisible: () => Ue.value,
|
|
924
918
|
/** Current zoom level (read-only). */
|
|
925
|
-
getZoom: () =>
|
|
919
|
+
getZoom: () => $.value,
|
|
926
920
|
/** Collapse / expand the task sidebar. */
|
|
927
921
|
toggleSidebar: gt,
|
|
928
922
|
/** Whether the sidebar is currently collapsed (read-only). */
|
|
929
923
|
isSidebarCollapsed: () => M.value
|
|
930
924
|
});
|
|
931
|
-
function
|
|
932
|
-
const o = n - (t ? 24 : 12) -
|
|
933
|
-
if (o <
|
|
934
|
-
const a = Math.floor(o /
|
|
925
|
+
function jt(e, n, t) {
|
|
926
|
+
const o = n - (t ? 24 : 12) - Va;
|
|
927
|
+
if (o < dn * 3) return "";
|
|
928
|
+
const a = Math.floor(o / dn);
|
|
935
929
|
return e.length <= a ? e : `${e.slice(0, Math.max(1, a - 1)).trimEnd()}…`;
|
|
936
930
|
}
|
|
937
|
-
function
|
|
931
|
+
function _(e, n, t, o, a) {
|
|
938
932
|
const l = Math.min(a, t / 2, o / 2);
|
|
939
933
|
return l <= 0 || t <= 0 ? `M${e},${n}h${t}v${o}h${-t}Z` : `M${e + l},${n}h${t - 2 * l}q${l},0 ${l},${l}v${o - 2 * l}q0,${l} ${-l},${l}h${-(t - 2 * l)}q${-l},0 ${-l},${-l}v${-(o - 2 * l)}q0,${-l} ${l},${-l}Z`;
|
|
940
934
|
}
|
|
941
|
-
function
|
|
935
|
+
function Vn(e, n, t) {
|
|
942
936
|
return `M${e},${n - t}L${e + t},${n}L${e},${n + t}L${e - t},${n}Z`;
|
|
943
937
|
}
|
|
944
|
-
const
|
|
945
|
-
function
|
|
938
|
+
const p = h(null), H = h(null);
|
|
939
|
+
function Zn(e) {
|
|
946
940
|
const n = e;
|
|
947
941
|
return !n || typeof n.closest != "function" ? !1 : !!n.closest(".vlite-gantt-bar-group");
|
|
948
942
|
}
|
|
949
|
-
function
|
|
943
|
+
function Yn(e) {
|
|
950
944
|
if (!r.editableDependencies) return null;
|
|
951
|
-
const n =
|
|
945
|
+
const n = Re.value;
|
|
952
946
|
if (!n) return null;
|
|
953
947
|
const t = n.getBoundingClientRect(), o = Y(e), a = 14;
|
|
954
948
|
return {
|
|
@@ -958,31 +952,31 @@ const Ro = {
|
|
|
958
952
|
bottom: t.top + o.cy + a
|
|
959
953
|
};
|
|
960
954
|
}
|
|
961
|
-
function
|
|
955
|
+
function Kn(e, n, t) {
|
|
962
956
|
if (!r.editableDependencies) return !1;
|
|
963
|
-
if (
|
|
957
|
+
if (C.value) return !0;
|
|
964
958
|
const o = Qe(e, n), a = Y(t);
|
|
965
|
-
return
|
|
959
|
+
return Eo(o.x, o.y, a.cx, a.cy);
|
|
966
960
|
}
|
|
967
961
|
function at(e, n) {
|
|
968
|
-
if (!r.showTooltip || i.active || s.active ||
|
|
969
|
-
|
|
962
|
+
if (!r.showTooltip || i.active || s.active || k.value) {
|
|
963
|
+
p.value = null;
|
|
970
964
|
return;
|
|
971
965
|
}
|
|
972
966
|
const t = w.value[n];
|
|
973
967
|
if (!t) return;
|
|
974
|
-
if (
|
|
975
|
-
|
|
968
|
+
if (Kn(e.clientX, e.clientY, t)) {
|
|
969
|
+
p.value = null;
|
|
976
970
|
return;
|
|
977
971
|
}
|
|
978
|
-
const o = t.task, a =
|
|
972
|
+
const o = t.task, a = Ao({
|
|
979
973
|
pointerX: e.clientX,
|
|
980
974
|
pointerY: e.clientY,
|
|
981
975
|
viewportWidth: window.innerWidth,
|
|
982
976
|
viewportHeight: window.innerHeight,
|
|
983
|
-
avoid:
|
|
977
|
+
avoid: Yn(t)
|
|
984
978
|
});
|
|
985
|
-
|
|
979
|
+
p.value = {
|
|
986
980
|
left: a.left,
|
|
987
981
|
top: a.top,
|
|
988
982
|
task: o,
|
|
@@ -990,43 +984,43 @@ const Ro = {
|
|
|
990
984
|
endStr: o._end.toLocaleDateString(r.locale, { month: "short", day: "numeric", year: "numeric" })
|
|
991
985
|
};
|
|
992
986
|
}
|
|
993
|
-
function
|
|
994
|
-
|
|
987
|
+
function Nn(e = !0) {
|
|
988
|
+
p.value = null, H.value = null, C.value = !1, Pe.value == null && (Z.value = null), ke.value = "default", e && q("task-hover", null);
|
|
995
989
|
}
|
|
996
|
-
function
|
|
997
|
-
if (i.active || s.active ||
|
|
998
|
-
Z.value = n,
|
|
990
|
+
function Un(e, n) {
|
|
991
|
+
if (i.active || s.active || k.value) return;
|
|
992
|
+
Z.value = n, H.value = n;
|
|
999
993
|
const t = w.value[n];
|
|
1000
994
|
if (!t) return;
|
|
1001
995
|
q("task-hover", t.task), Je(e, t);
|
|
1002
996
|
const o = !!e.target?.closest?.(".vlite-gantt-dep-connector");
|
|
1003
|
-
|
|
997
|
+
C.value = o, o ? p.value = null : at(e, n);
|
|
1004
998
|
}
|
|
1005
|
-
function
|
|
1006
|
-
i.active || s.active ||
|
|
999
|
+
function jn() {
|
|
1000
|
+
i.active || s.active || k.value || Nn(!0);
|
|
1007
1001
|
}
|
|
1008
|
-
function
|
|
1009
|
-
if (i.active || s.active ||
|
|
1010
|
-
|
|
1002
|
+
function Jt(e, n) {
|
|
1003
|
+
if (i.active || s.active || k.value) return;
|
|
1004
|
+
C.value = !1, Z.value = n, H.value = n;
|
|
1011
1005
|
const t = w.value[n];
|
|
1012
1006
|
t && (Je(e, t), at(e, n));
|
|
1013
1007
|
}
|
|
1014
|
-
function
|
|
1015
|
-
if (i.active || s.active ||
|
|
1016
|
-
|
|
1008
|
+
function Qt(e, n) {
|
|
1009
|
+
if (i.active || s.active || k.value) return;
|
|
1010
|
+
C.value = !1;
|
|
1017
1011
|
const t = w.value[n];
|
|
1018
1012
|
t && Je(e, t), at(e, n);
|
|
1019
1013
|
}
|
|
1020
|
-
function
|
|
1021
|
-
i.active || s.active ||
|
|
1014
|
+
function Jn(e) {
|
|
1015
|
+
i.active || s.active || k.value || (C.value = !0, Z.value = e, H.value = e, p.value = null);
|
|
1022
1016
|
}
|
|
1023
|
-
function
|
|
1024
|
-
if (!(i.active || s.active ||
|
|
1025
|
-
if (
|
|
1026
|
-
|
|
1017
|
+
function Qn(e) {
|
|
1018
|
+
if (!(i.active || s.active || k.value)) {
|
|
1019
|
+
if (Zn(e.relatedTarget) && !e.relatedTarget?.closest?.(".vlite-gantt-dep-connector")) {
|
|
1020
|
+
C.value = !1;
|
|
1027
1021
|
return;
|
|
1028
1022
|
}
|
|
1029
|
-
|
|
1023
|
+
C.value = !1, p.value = null;
|
|
1030
1024
|
}
|
|
1031
1025
|
}
|
|
1032
1026
|
function lt(e) {
|
|
@@ -1034,14 +1028,14 @@ const Ro = {
|
|
|
1034
1028
|
}
|
|
1035
1029
|
const ne = h();
|
|
1036
1030
|
let rt = !1;
|
|
1037
|
-
function
|
|
1031
|
+
function eo(e) {
|
|
1038
1032
|
const n = e.target;
|
|
1039
1033
|
ne.value && (ne.value.scrollTop = n.scrollTop), rt || (rt = !0, requestAnimationFrame(() => {
|
|
1040
|
-
rt = !1, I.value && (
|
|
1034
|
+
rt = !1, I.value && (Te.value = I.value.scrollLeft, xt());
|
|
1041
1035
|
}));
|
|
1042
1036
|
}
|
|
1043
1037
|
const K = Math.random().toString(36).slice(2, 7);
|
|
1044
|
-
function
|
|
1038
|
+
function to(e, n) {
|
|
1045
1039
|
const t = Math.ceil(ft(e, n));
|
|
1046
1040
|
if (t <= 1) return "1 day";
|
|
1047
1041
|
if (t < 7) return `${t} days`;
|
|
@@ -1051,97 +1045,38 @@ const Ro = {
|
|
|
1051
1045
|
function z(e) {
|
|
1052
1046
|
return (e.assignees ?? []).filter((n) => n && (n.name || n.src || n.fallback));
|
|
1053
1047
|
}
|
|
1054
|
-
function
|
|
1048
|
+
function en(e) {
|
|
1055
1049
|
if (e.fallback) return e.fallback;
|
|
1056
1050
|
if (!e.name) return;
|
|
1057
1051
|
const n = e.name.trim().split(/\s+/);
|
|
1058
1052
|
return (n[0][0] + (n.length > 1 ? n[n.length - 1][0] : "")).toUpperCase();
|
|
1059
1053
|
}
|
|
1060
|
-
function
|
|
1054
|
+
function no(e) {
|
|
1061
1055
|
return z(e).map((n) => ({
|
|
1062
1056
|
src: n.src,
|
|
1063
1057
|
alt: n.alt ?? n.name,
|
|
1064
|
-
fallback:
|
|
1058
|
+
fallback: en(n),
|
|
1065
1059
|
heading: n.name,
|
|
1066
1060
|
text: n.role
|
|
1067
1061
|
}));
|
|
1068
1062
|
}
|
|
1069
|
-
return (e, n) => (v(),
|
|
1063
|
+
return (e, n) => (v(), g("div", {
|
|
1070
1064
|
ref_key: "containerRef",
|
|
1071
|
-
ref:
|
|
1065
|
+
ref: $e,
|
|
1072
1066
|
class: "vlite-gantt-chart w-full select-none"
|
|
1073
1067
|
}, [
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
u("svg", {
|
|
1077
|
-
width: "12",
|
|
1078
|
-
height: "12",
|
|
1079
|
-
viewBox: "0 0 24 24",
|
|
1080
|
-
fill: "none",
|
|
1081
|
-
stroke: "currentColor",
|
|
1082
|
-
"stroke-width": "2",
|
|
1083
|
-
"stroke-linecap": "round",
|
|
1084
|
-
"stroke-linejoin": "round"
|
|
1085
|
-
}, [
|
|
1086
|
-
u("rect", {
|
|
1087
|
-
x: "5",
|
|
1088
|
-
y: "11",
|
|
1089
|
-
width: "14",
|
|
1090
|
-
height: "9",
|
|
1091
|
-
rx: "2"
|
|
1092
|
-
}),
|
|
1093
|
-
u("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
|
|
1094
|
-
], -1),
|
|
1095
|
-
u("span", null, "Blocked", -1)
|
|
1096
|
-
])])) : m("", !0),
|
|
1097
|
-
d.showTodayLine && Pe.value ? (v(), f("button", {
|
|
1098
|
-
key: 1,
|
|
1099
|
-
class: "vlite-gantt-btn",
|
|
1100
|
-
onClick: Et
|
|
1101
|
-
}, [...n[2] || (n[2] = [
|
|
1102
|
-
u("svg", {
|
|
1103
|
-
width: "12",
|
|
1104
|
-
height: "12",
|
|
1105
|
-
viewBox: "0 0 24 24",
|
|
1106
|
-
fill: "none",
|
|
1107
|
-
stroke: "currentColor",
|
|
1108
|
-
"stroke-width": "2.5",
|
|
1109
|
-
"stroke-linecap": "round",
|
|
1110
|
-
"stroke-linejoin": "round"
|
|
1111
|
-
}, [
|
|
1112
|
-
u("circle", {
|
|
1113
|
-
cx: "12",
|
|
1114
|
-
cy: "12",
|
|
1115
|
-
r: "10"
|
|
1116
|
-
}),
|
|
1117
|
-
u("line", {
|
|
1118
|
-
x1: "12",
|
|
1119
|
-
y1: "8",
|
|
1120
|
-
x2: "12",
|
|
1121
|
-
y2: "12"
|
|
1122
|
-
}),
|
|
1123
|
-
u("line", {
|
|
1124
|
-
x1: "12",
|
|
1125
|
-
y1: "16",
|
|
1126
|
-
x2: "12.01",
|
|
1127
|
-
y2: "16"
|
|
1128
|
-
})
|
|
1129
|
-
], -1),
|
|
1130
|
-
u("span", null, "Today", -1)
|
|
1131
|
-
])])) : m("", !0)
|
|
1132
|
-
])) : m("", !0),
|
|
1133
|
-
u("div", Ho, [
|
|
1134
|
-
u("div", {
|
|
1068
|
+
c("div", Po, [
|
|
1069
|
+
c("div", {
|
|
1135
1070
|
class: ge(["vlite-gantt-sidebar", { "vlite-gantt-sidebar-collapsed": d.collapsibleSidebar && M.value }]),
|
|
1136
1071
|
style: A({ width: `${le.value}px`, minWidth: `${le.value}px` })
|
|
1137
1072
|
}, [
|
|
1138
|
-
d.showHeader ? (v(),
|
|
1073
|
+
d.showHeader ? (v(), g("div", {
|
|
1139
1074
|
key: 0,
|
|
1140
1075
|
class: "vlite-gantt-sidebar-header",
|
|
1141
1076
|
style: A({ height: `${ie.value}px` })
|
|
1142
1077
|
}, [
|
|
1143
|
-
d.collapsibleSidebar && M.value ?
|
|
1144
|
-
d.collapsibleSidebar ? (v(),
|
|
1078
|
+
d.collapsibleSidebar && M.value ? x("", !0) : (v(), g("span", Ro, "Tasks")),
|
|
1079
|
+
d.collapsibleSidebar ? (v(), g("button", {
|
|
1145
1080
|
key: 1,
|
|
1146
1081
|
type: "button",
|
|
1147
1082
|
class: "vlite-gantt-sidebar-toggle",
|
|
@@ -1149,7 +1084,7 @@ const Ro = {
|
|
|
1149
1084
|
"aria-expanded": !M.value,
|
|
1150
1085
|
onClick: gt
|
|
1151
1086
|
}, [
|
|
1152
|
-
(v(),
|
|
1087
|
+
(v(), g("svg", {
|
|
1153
1088
|
width: "16",
|
|
1154
1089
|
height: "16",
|
|
1155
1090
|
viewBox: "0 0 24 24",
|
|
@@ -1159,30 +1094,30 @@ const Ro = {
|
|
|
1159
1094
|
"stroke-linecap": "round",
|
|
1160
1095
|
"stroke-linejoin": "round",
|
|
1161
1096
|
style: A({ transform: M.value ? "rotate(180deg)" : "none" })
|
|
1162
|
-
}, [...n[
|
|
1163
|
-
|
|
1097
|
+
}, [...n[1] || (n[1] = [
|
|
1098
|
+
c("polyline", { points: "15 18 9 12 15 6" }, null, -1)
|
|
1164
1099
|
])], 4))
|
|
1165
|
-
], 8,
|
|
1166
|
-
], 4)) :
|
|
1167
|
-
|
|
1100
|
+
], 8, Bo)) : x("", !0)
|
|
1101
|
+
], 4)) : x("", !0),
|
|
1102
|
+
c("div", {
|
|
1168
1103
|
ref_key: "sidebarRef",
|
|
1169
1104
|
ref: ne,
|
|
1170
1105
|
class: "vlite-gantt-sidebar-body",
|
|
1171
1106
|
style: A({ height: `${ue.value}px` })
|
|
1172
1107
|
}, [
|
|
1173
|
-
(v(!0),
|
|
1108
|
+
(v(!0), g(W, null, O(pe.value, (t, o) => (v(), g("div", {
|
|
1174
1109
|
key: `s-${o}`,
|
|
1175
1110
|
class: "vlite-gantt-sidebar-row",
|
|
1176
1111
|
style: A({ height: `${d.rowHeight}px` })
|
|
1177
1112
|
}, [
|
|
1178
|
-
t.type === "group-header" ? (v(),
|
|
1179
|
-
d.collapsibleSidebar && M.value ?
|
|
1113
|
+
t.type === "group-header" ? (v(), g(W, { key: 0 }, [
|
|
1114
|
+
d.collapsibleSidebar && M.value ? x("", !0) : (v(), g("button", {
|
|
1180
1115
|
key: 0,
|
|
1181
1116
|
class: "vlite-gantt-group-toggle",
|
|
1182
|
-
onClick: (a) =>
|
|
1117
|
+
onClick: (a) => pn(t.group)
|
|
1183
1118
|
}, [
|
|
1184
|
-
(v(),
|
|
1185
|
-
class: ge(["vlite-gantt-chevron", { "vlite-gantt-chevron-collapsed":
|
|
1119
|
+
(v(), g("svg", {
|
|
1120
|
+
class: ge(["vlite-gantt-chevron", { "vlite-gantt-chevron-collapsed": Ce.value.has(t.group) }]),
|
|
1186
1121
|
width: "14",
|
|
1187
1122
|
height: "14",
|
|
1188
1123
|
viewBox: "0 0 24 24",
|
|
@@ -1191,13 +1126,13 @@ const Ro = {
|
|
|
1191
1126
|
"stroke-width": "2.5",
|
|
1192
1127
|
"stroke-linecap": "round",
|
|
1193
1128
|
"stroke-linejoin": "round"
|
|
1194
|
-
}, [...n[
|
|
1195
|
-
|
|
1129
|
+
}, [...n[2] || (n[2] = [
|
|
1130
|
+
c("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
1196
1131
|
])], 2)),
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
], 8,
|
|
1200
|
-
], 64)) : (v(),
|
|
1132
|
+
c("span", Ho, S(t.group), 1),
|
|
1133
|
+
c("span", zo, S(Ve.value.grouped.get(t.group)?.length ?? 0), 1)
|
|
1134
|
+
], 8, _o))
|
|
1135
|
+
], 64)) : (v(), g("div", {
|
|
1201
1136
|
key: 1,
|
|
1202
1137
|
class: ge(["vlite-gantt-task-name", {
|
|
1203
1138
|
"vlite-gantt-task-name-grouped": !!t.group && !(d.collapsibleSidebar && M.value),
|
|
@@ -1207,47 +1142,47 @@ const Ro = {
|
|
|
1207
1142
|
title: d.collapsibleSidebar && M.value ? t.task?.name : void 0,
|
|
1208
1143
|
onClick: (a) => t.task && lt(t.task)
|
|
1209
1144
|
}, [
|
|
1210
|
-
|
|
1145
|
+
c("span", {
|
|
1211
1146
|
class: "vlite-gantt-task-dot",
|
|
1212
1147
|
style: A({ backgroundColor: t.task?._color })
|
|
1213
1148
|
}, null, 4),
|
|
1214
|
-
d.collapsibleSidebar && M.value ?
|
|
1215
|
-
|
|
1216
|
-
d.showProgress && t.task?.progress != null ? (v(),
|
|
1149
|
+
d.collapsibleSidebar && M.value ? x("", !0) : (v(), g(W, { key: 0 }, [
|
|
1150
|
+
c("span", Go, S(t.task?.name), 1),
|
|
1151
|
+
d.showProgress && t.task?.progress != null ? (v(), g("span", Fo, S(t.task.progress) + "%", 1)) : x("", !0)
|
|
1217
1152
|
], 64))
|
|
1218
|
-
], 10,
|
|
1153
|
+
], 10, Xo))
|
|
1219
1154
|
], 4))), 128))
|
|
1220
1155
|
], 4)
|
|
1221
1156
|
], 6),
|
|
1222
|
-
|
|
1157
|
+
c("div", {
|
|
1223
1158
|
ref_key: "timelineRef",
|
|
1224
1159
|
ref: I,
|
|
1225
1160
|
class: "vlite-gantt-timeline",
|
|
1226
|
-
onScroll:
|
|
1227
|
-
onWheel:
|
|
1161
|
+
onScroll: eo,
|
|
1162
|
+
onWheel: hn
|
|
1228
1163
|
}, [
|
|
1229
|
-
d.showHeader ? (v(),
|
|
1164
|
+
d.showHeader ? (v(), g("div", {
|
|
1230
1165
|
key: 0,
|
|
1231
1166
|
class: "vlite-gantt-timeline-header",
|
|
1232
1167
|
style: A({ height: `${ie.value}px`, width: `${se.value}px` })
|
|
1233
1168
|
}, [
|
|
1234
|
-
(v(),
|
|
1169
|
+
(v(), g("svg", {
|
|
1235
1170
|
width: se.value,
|
|
1236
1171
|
height: ie.value,
|
|
1237
1172
|
class: "overflow-visible"
|
|
1238
1173
|
}, [
|
|
1239
|
-
(v(!0),
|
|
1174
|
+
(v(!0), g(W, null, O(mt.value, (t) => (v(), g("g", {
|
|
1240
1175
|
key: t.key
|
|
1241
1176
|
}, [
|
|
1242
|
-
|
|
1177
|
+
c("line", {
|
|
1243
1178
|
x1: t.x,
|
|
1244
1179
|
y1: 0,
|
|
1245
1180
|
x2: t.x,
|
|
1246
1181
|
y2: ie.value,
|
|
1247
1182
|
stroke: "currentColor",
|
|
1248
1183
|
"stroke-opacity": d.gridOpacity
|
|
1249
|
-
}, null, 8,
|
|
1250
|
-
|
|
1184
|
+
}, null, 8, qo),
|
|
1185
|
+
c("text", {
|
|
1251
1186
|
x: t.x + t.width / 2,
|
|
1252
1187
|
y: ie.value / 2 - 5,
|
|
1253
1188
|
"text-anchor": "middle",
|
|
@@ -1255,8 +1190,8 @@ const Ro = {
|
|
|
1255
1190
|
"font-size": "11",
|
|
1256
1191
|
"font-weight": "600",
|
|
1257
1192
|
class: "fill-foreground"
|
|
1258
|
-
}, S(t.label), 9,
|
|
1259
|
-
t.sublabel ? (v(),
|
|
1193
|
+
}, S(t.label), 9, Vo),
|
|
1194
|
+
t.sublabel ? (v(), g("text", {
|
|
1260
1195
|
key: 0,
|
|
1261
1196
|
x: t.x + t.width / 2,
|
|
1262
1197
|
y: ie.value / 2 + 11,
|
|
@@ -1264,26 +1199,26 @@ const Ro = {
|
|
|
1264
1199
|
"dominant-baseline": "middle",
|
|
1265
1200
|
"font-size": "10",
|
|
1266
1201
|
class: "fill-muted-foreground"
|
|
1267
|
-
}, S(t.sublabel), 9,
|
|
1202
|
+
}, S(t.sublabel), 9, Zo)) : x("", !0)
|
|
1268
1203
|
]))), 128))
|
|
1269
|
-
], 8,
|
|
1270
|
-
], 4)) :
|
|
1271
|
-
|
|
1204
|
+
], 8, Oo))
|
|
1205
|
+
], 4)) : x("", !0),
|
|
1206
|
+
c("div", {
|
|
1272
1207
|
class: "vlite-gantt-timeline-body",
|
|
1273
1208
|
style: A({ height: `${ue.value}px` })
|
|
1274
1209
|
}, [
|
|
1275
|
-
(v(),
|
|
1210
|
+
(v(), g("svg", {
|
|
1276
1211
|
ref_key: "timelineSvgRef",
|
|
1277
|
-
ref:
|
|
1212
|
+
ref: Re,
|
|
1278
1213
|
width: se.value,
|
|
1279
1214
|
height: ue.value,
|
|
1280
1215
|
role: "img",
|
|
1281
1216
|
"aria-label": "Gantt chart",
|
|
1282
|
-
class: ge(["overflow-visible", { "vlite-gantt-linking":
|
|
1283
|
-
onPointerdown:
|
|
1217
|
+
class: ge(["overflow-visible", { "vlite-gantt-linking": k.value }]),
|
|
1218
|
+
onPointerdown: An
|
|
1284
1219
|
}, [
|
|
1285
|
-
|
|
1286
|
-
(v(!0),
|
|
1220
|
+
c("defs", null, [
|
|
1221
|
+
(v(!0), g(W, null, O(w.value, (t, o) => (v(), g("linearGradient", {
|
|
1287
1222
|
key: `g${o}`,
|
|
1288
1223
|
id: `gg-${X(K)}-${o}`,
|
|
1289
1224
|
x1: "0",
|
|
@@ -1291,18 +1226,18 @@ const Ro = {
|
|
|
1291
1226
|
x2: "1",
|
|
1292
1227
|
y2: "0"
|
|
1293
1228
|
}, [
|
|
1294
|
-
|
|
1229
|
+
c("stop", {
|
|
1295
1230
|
offset: "0%",
|
|
1296
1231
|
"stop-color": t.task._color,
|
|
1297
1232
|
"stop-opacity": "1"
|
|
1298
|
-
}, null, 8,
|
|
1299
|
-
|
|
1233
|
+
}, null, 8, No),
|
|
1234
|
+
c("stop", {
|
|
1300
1235
|
offset: "100%",
|
|
1301
1236
|
"stop-color": t.task._color,
|
|
1302
1237
|
"stop-opacity": "0.75"
|
|
1303
|
-
}, null, 8,
|
|
1304
|
-
], 8,
|
|
1305
|
-
(v(!0),
|
|
1238
|
+
}, null, 8, Uo)
|
|
1239
|
+
], 8, Ko))), 128)),
|
|
1240
|
+
(v(!0), g(W, null, O(w.value, (t, o) => (v(), g("linearGradient", {
|
|
1306
1241
|
key: `p${o}`,
|
|
1307
1242
|
id: `gp-${X(K)}-${o}`,
|
|
1308
1243
|
x1: "0",
|
|
@@ -1310,25 +1245,25 @@ const Ro = {
|
|
|
1310
1245
|
x2: "1",
|
|
1311
1246
|
y2: "0"
|
|
1312
1247
|
}, [
|
|
1313
|
-
|
|
1248
|
+
c("stop", {
|
|
1314
1249
|
offset: "0%",
|
|
1315
1250
|
"stop-color": t.task._color,
|
|
1316
1251
|
"stop-opacity": "0.35"
|
|
1317
|
-
}, null, 8,
|
|
1318
|
-
|
|
1252
|
+
}, null, 8, Jo),
|
|
1253
|
+
c("stop", {
|
|
1319
1254
|
offset: "100%",
|
|
1320
1255
|
"stop-color": t.task._color,
|
|
1321
1256
|
"stop-opacity": "0.15"
|
|
1322
|
-
}, null, 8,
|
|
1323
|
-
], 8,
|
|
1324
|
-
|
|
1257
|
+
}, null, 8, Qo)
|
|
1258
|
+
], 8, jo))), 128)),
|
|
1259
|
+
c("pattern", {
|
|
1325
1260
|
id: `gb-${X(K)}`,
|
|
1326
1261
|
width: "6",
|
|
1327
1262
|
height: "6",
|
|
1328
1263
|
patternUnits: "userSpaceOnUse",
|
|
1329
1264
|
patternTransform: "rotate(45)"
|
|
1330
|
-
}, [...n[
|
|
1331
|
-
|
|
1265
|
+
}, [...n[3] || (n[3] = [
|
|
1266
|
+
c("line", {
|
|
1332
1267
|
x1: "0",
|
|
1333
1268
|
y1: "0",
|
|
1334
1269
|
x2: "0",
|
|
@@ -1337,9 +1272,9 @@ const Ro = {
|
|
|
1337
1272
|
"stroke-width": "2",
|
|
1338
1273
|
"stroke-opacity": "0.3"
|
|
1339
1274
|
}, null, -1)
|
|
1340
|
-
])], 8,
|
|
1275
|
+
])], 8, ea)
|
|
1341
1276
|
]),
|
|
1342
|
-
d.showGrid ? (v(!0),
|
|
1277
|
+
d.showGrid ? (v(!0), g(W, { key: 0 }, O(mt.value, (t) => (v(), g("line", {
|
|
1343
1278
|
key: t.key,
|
|
1344
1279
|
x1: t.x,
|
|
1345
1280
|
y1: 0,
|
|
@@ -1348,8 +1283,8 @@ const Ro = {
|
|
|
1348
1283
|
stroke: "currentColor",
|
|
1349
1284
|
"stroke-opacity": d.gridOpacity,
|
|
1350
1285
|
"stroke-dasharray": "4 4"
|
|
1351
|
-
}, null, 8,
|
|
1352
|
-
(v(!0),
|
|
1286
|
+
}, null, 8, ta))), 128)) : x("", !0),
|
|
1287
|
+
(v(!0), g(W, null, O(pe.value, (t, o) => (v(), g("line", {
|
|
1353
1288
|
key: o,
|
|
1354
1289
|
x1: 0,
|
|
1355
1290
|
y1: (o + 1) * d.rowHeight,
|
|
@@ -1357,8 +1292,8 @@ const Ro = {
|
|
|
1357
1292
|
y2: (o + 1) * d.rowHeight,
|
|
1358
1293
|
stroke: "currentColor",
|
|
1359
1294
|
"stroke-opacity": d.gridOpacity
|
|
1360
|
-
}, null, 8,
|
|
1361
|
-
(v(!0),
|
|
1295
|
+
}, null, 8, na))), 128)),
|
|
1296
|
+
(v(!0), g(W, null, O(pe.value, (t, o) => ro((v(), g("rect", {
|
|
1362
1297
|
key: `bg${o}`,
|
|
1363
1298
|
x: 0,
|
|
1364
1299
|
y: o * d.rowHeight,
|
|
@@ -1366,13 +1301,13 @@ const Ro = {
|
|
|
1366
1301
|
height: d.rowHeight,
|
|
1367
1302
|
fill: "currentColor",
|
|
1368
1303
|
"fill-opacity": "0.02"
|
|
1369
|
-
}, null, 8,
|
|
1370
|
-
[
|
|
1304
|
+
}, null, 8, oa)), [
|
|
1305
|
+
[so, t.type === "group-header"]
|
|
1371
1306
|
])), 128)),
|
|
1372
|
-
(v(!0),
|
|
1307
|
+
(v(!0), g(W, null, O(j.value, (t) => (v(), g("g", {
|
|
1373
1308
|
key: t.key,
|
|
1374
1309
|
ref_for: !0,
|
|
1375
|
-
ref: (o) =>
|
|
1310
|
+
ref: (o) => Ln(o, t.key),
|
|
1376
1311
|
class: ge(["vlite-gantt-dep-group", {
|
|
1377
1312
|
"vlite-gantt-dep-selectable": d.editableDependencies,
|
|
1378
1313
|
"vlite-gantt-dep-active": J(t.key),
|
|
@@ -1381,8 +1316,8 @@ const Ro = {
|
|
|
1381
1316
|
role: "img",
|
|
1382
1317
|
"aria-label": Wt(t)
|
|
1383
1318
|
}, [
|
|
1384
|
-
|
|
1385
|
-
|
|
1319
|
+
c("title", null, S(Wt(t)), 1),
|
|
1320
|
+
c("path", {
|
|
1386
1321
|
d: t.d,
|
|
1387
1322
|
"data-dep-part": "hit",
|
|
1388
1323
|
stroke: "transparent",
|
|
@@ -1392,14 +1327,14 @@ const Ro = {
|
|
|
1392
1327
|
"stroke-linecap": "round",
|
|
1393
1328
|
class: "vlite-gantt-dep-hit",
|
|
1394
1329
|
tabindex: d.editableDependencies ? 0 : void 0,
|
|
1395
|
-
onClick: (o) =>
|
|
1396
|
-
onKeydown: st((o) =>
|
|
1397
|
-
onMouseenter: (o) =>
|
|
1398
|
-
onMouseleave:
|
|
1399
|
-
onFocus: (o) =>
|
|
1400
|
-
onBlur:
|
|
1401
|
-
}, null, 40,
|
|
1402
|
-
|
|
1330
|
+
onClick: (o) => Tt(o, t),
|
|
1331
|
+
onKeydown: st((o) => Tt(o, t), ["enter"]),
|
|
1332
|
+
onMouseenter: (o) => It(t.key),
|
|
1333
|
+
onMouseleave: St,
|
|
1334
|
+
onFocus: (o) => It(t.key),
|
|
1335
|
+
onBlur: St
|
|
1336
|
+
}, null, 40, la),
|
|
1337
|
+
c("path", {
|
|
1403
1338
|
d: t.d,
|
|
1404
1339
|
"data-dep-part": "line",
|
|
1405
1340
|
stroke: J(t.key) ? dt : "var(--color-muted-foreground)",
|
|
@@ -1408,128 +1343,128 @@ const Ro = {
|
|
|
1408
1343
|
fill: "none",
|
|
1409
1344
|
"stroke-linejoin": "round",
|
|
1410
1345
|
class: "vlite-gantt-dep-line pointer-events-none"
|
|
1411
|
-
}, null, 8,
|
|
1412
|
-
|
|
1346
|
+
}, null, 8, ra),
|
|
1347
|
+
c("path", {
|
|
1413
1348
|
d: t.ad,
|
|
1414
1349
|
"data-dep-part": "arrow",
|
|
1415
1350
|
fill: J(t.key) ? dt : "var(--color-muted-foreground)",
|
|
1416
1351
|
"fill-opacity": J(t.key) ? 1 : 0.6,
|
|
1417
1352
|
class: "vlite-gantt-dep-arrowhead pointer-events-none"
|
|
1418
|
-
}, null, 8,
|
|
1419
|
-
], 10,
|
|
1420
|
-
d.editableDependencies &&
|
|
1353
|
+
}, null, 8, sa)
|
|
1354
|
+
], 10, aa))), 128)),
|
|
1355
|
+
d.editableDependencies && ye.value ? (v(), g("g", {
|
|
1421
1356
|
key: 1,
|
|
1422
1357
|
class: "vlite-gantt-dep-delete",
|
|
1423
|
-
transform: `translate(${
|
|
1358
|
+
transform: `translate(${ye.value.midX}, ${ye.value.midY})`,
|
|
1424
1359
|
role: "button",
|
|
1425
1360
|
tabindex: "0",
|
|
1426
1361
|
focusable: "true",
|
|
1427
|
-
"aria-label":
|
|
1428
|
-
onClick:
|
|
1362
|
+
"aria-label": Wn.value,
|
|
1363
|
+
onClick: Tn,
|
|
1429
1364
|
onKeydown: [
|
|
1430
|
-
st(
|
|
1431
|
-
st(
|
|
1365
|
+
st(an(Ee, ["prevent"]), ["enter"]),
|
|
1366
|
+
st(an(Ee, ["prevent"]), ["space"])
|
|
1432
1367
|
]
|
|
1433
1368
|
}, [
|
|
1434
|
-
n[
|
|
1369
|
+
n[4] || (n[4] = c("circle", {
|
|
1435
1370
|
r: "11",
|
|
1436
1371
|
fill: "transparent"
|
|
1437
1372
|
}, null, -1)),
|
|
1438
|
-
|
|
1373
|
+
c("circle", {
|
|
1439
1374
|
r: "8",
|
|
1440
1375
|
fill: dt,
|
|
1441
1376
|
stroke: "var(--color-background)",
|
|
1442
1377
|
"stroke-width": "1.5"
|
|
1443
1378
|
}),
|
|
1444
|
-
n[
|
|
1379
|
+
n[5] || (n[5] = c("path", {
|
|
1445
1380
|
d: "M -3 -3 L 3 3 M 3 -3 L -3 3",
|
|
1446
1381
|
stroke: "var(--color-background)",
|
|
1447
1382
|
"stroke-width": "1.75",
|
|
1448
1383
|
"stroke-linecap": "round",
|
|
1449
1384
|
class: "pointer-events-none"
|
|
1450
1385
|
}, null, -1))
|
|
1451
|
-
], 40,
|
|
1452
|
-
(v(!0),
|
|
1386
|
+
], 40, ia)) : x("", !0),
|
|
1387
|
+
(v(!0), g(W, null, O(w.value, (t, o) => (v(), g("g", {
|
|
1453
1388
|
key: t.task.id,
|
|
1454
1389
|
ref_for: !0,
|
|
1455
|
-
ref: (a) =>
|
|
1390
|
+
ref: (a) => Pn(a, o),
|
|
1456
1391
|
class: ge(["vlite-gantt-bar-group", [
|
|
1457
1392
|
{ "vlite-gantt-bar-dragging": B.value && (Q.value === t.task.id || X(i).affectedIds.has(t.task.id)) },
|
|
1458
|
-
|
|
1459
|
-
{ "vlite-gantt-link-source":
|
|
1393
|
+
qn(t.task.id),
|
|
1394
|
+
{ "vlite-gantt-link-source": k.value && ce.value === t.task.id }
|
|
1460
1395
|
]]),
|
|
1461
|
-
onMouseenter: (a) =>
|
|
1462
|
-
onMouseleave:
|
|
1396
|
+
onMouseenter: (a) => Un(a, o),
|
|
1397
|
+
onMouseleave: jn
|
|
1463
1398
|
}, [
|
|
1464
|
-
t.task.milestone ? (v(),
|
|
1399
|
+
t.task.milestone ? (v(), g("path", {
|
|
1465
1400
|
key: 0,
|
|
1466
|
-
d:
|
|
1401
|
+
d: Vn(t.x + t.fullW / 2, t.y + d.barHeight / 2, d.barHeight * 0.4),
|
|
1467
1402
|
fill: `url(#gg-${X(K)}-${o})`,
|
|
1468
1403
|
stroke: t.task._color,
|
|
1469
1404
|
"stroke-width": "1.5",
|
|
1470
1405
|
"stroke-opacity": "0.6",
|
|
1471
1406
|
class: "cursor-pointer",
|
|
1472
|
-
opacity:
|
|
1473
|
-
onMouseenter: (a) =>
|
|
1474
|
-
onMousemove: (a) =>
|
|
1407
|
+
opacity: H.value === o ? 0.9 : 1,
|
|
1408
|
+
onMouseenter: (a) => Jt(a, o),
|
|
1409
|
+
onMousemove: (a) => Qt(a, o),
|
|
1475
1410
|
onClick: (a) => lt(t.task)
|
|
1476
|
-
}, null, 40,
|
|
1477
|
-
|
|
1411
|
+
}, null, 40, ca)) : (v(), g(W, { key: 1 }, [
|
|
1412
|
+
c("path", {
|
|
1478
1413
|
"data-gantt-part": "bg",
|
|
1479
|
-
d:
|
|
1414
|
+
d: _(t.x, t.y, t.fullW, d.barHeight, d.barRadius),
|
|
1480
1415
|
fill: `url(#gp-${X(K)}-${o})`,
|
|
1481
1416
|
class: "pointer-events-none"
|
|
1482
|
-
}, null, 8,
|
|
1483
|
-
d.showProgress && t.progressW > 0 ? (v(),
|
|
1417
|
+
}, null, 8, da),
|
|
1418
|
+
d.showProgress && t.progressW > 0 ? (v(), g("path", {
|
|
1484
1419
|
key: 0,
|
|
1485
1420
|
"data-gantt-part": "progress",
|
|
1486
|
-
d:
|
|
1421
|
+
d: _(t.x, t.y, Math.min(t.progressW, t.fullW), d.barHeight, d.barRadius),
|
|
1487
1422
|
fill: `url(#gg-${X(K)}-${o})`,
|
|
1488
1423
|
class: "pointer-events-none"
|
|
1489
|
-
}, null, 8,
|
|
1490
|
-
d.showProgress ?
|
|
1424
|
+
}, null, 8, va)) : x("", !0),
|
|
1425
|
+
d.showProgress ? x("", !0) : (v(), g("path", {
|
|
1491
1426
|
key: 1,
|
|
1492
1427
|
"data-gantt-part": "fill",
|
|
1493
|
-
d:
|
|
1428
|
+
d: _(t.x, t.y, t.w, d.barHeight, d.barRadius),
|
|
1494
1429
|
fill: `url(#gg-${X(K)}-${o})`,
|
|
1495
1430
|
class: "pointer-events-none"
|
|
1496
|
-
}, null, 8,
|
|
1497
|
-
t.task.blocked ? (v(),
|
|
1498
|
-
|
|
1431
|
+
}, null, 8, fa)),
|
|
1432
|
+
t.task.blocked ? (v(), g(W, { key: 2 }, [
|
|
1433
|
+
c("path", {
|
|
1499
1434
|
"data-gantt-part": "blocked-hatch",
|
|
1500
|
-
d:
|
|
1435
|
+
d: _(t.x, t.y, t.fullW, d.barHeight, d.barRadius),
|
|
1501
1436
|
fill: `url(#gb-${X(K)})`,
|
|
1502
1437
|
class: "pointer-events-none"
|
|
1503
|
-
}, null, 8,
|
|
1504
|
-
|
|
1438
|
+
}, null, 8, ga),
|
|
1439
|
+
c("path", {
|
|
1505
1440
|
"data-gantt-part": "blocked-outline",
|
|
1506
|
-
d:
|
|
1441
|
+
d: _(t.x, t.y, t.fullW, d.barHeight, d.barRadius),
|
|
1507
1442
|
fill: "none",
|
|
1508
1443
|
stroke: "var(--color-danger)",
|
|
1509
1444
|
"stroke-width": "1.5",
|
|
1510
1445
|
"stroke-opacity": "0.9",
|
|
1511
1446
|
"stroke-dasharray": "4 3",
|
|
1512
1447
|
class: "pointer-events-none"
|
|
1513
|
-
}, null, 8,
|
|
1514
|
-
|
|
1448
|
+
}, null, 8, pa),
|
|
1449
|
+
c("g", {
|
|
1515
1450
|
"data-gantt-part": "blocked-lock",
|
|
1516
1451
|
transform: `translate(${t.x + 10}, ${t.y + d.barHeight / 2})`,
|
|
1517
1452
|
class: "pointer-events-none"
|
|
1518
|
-
}, [...n[
|
|
1519
|
-
|
|
1453
|
+
}, [...n[6] || (n[6] = [
|
|
1454
|
+
c("circle", {
|
|
1520
1455
|
r: "7",
|
|
1521
1456
|
fill: "var(--color-danger)"
|
|
1522
1457
|
}, null, -1),
|
|
1523
|
-
|
|
1458
|
+
c("path", {
|
|
1524
1459
|
d: "M -2 -0.5 v -1.3 a 2 2 0 0 1 4 0 v 1.3 M -3 -0.5 h 6 v 3.8 h -6 Z",
|
|
1525
1460
|
fill: "none",
|
|
1526
1461
|
stroke: "var(--color-background)",
|
|
1527
1462
|
"stroke-width": "1.2",
|
|
1528
1463
|
"stroke-linejoin": "round"
|
|
1529
1464
|
}, null, -1)
|
|
1530
|
-
])], 8,
|
|
1531
|
-
], 64)) :
|
|
1532
|
-
|
|
1465
|
+
])], 8, ya)
|
|
1466
|
+
], 64)) : x("", !0),
|
|
1467
|
+
c("rect", {
|
|
1533
1468
|
"data-gantt-part": "hitbox",
|
|
1534
1469
|
x: t.x,
|
|
1535
1470
|
y: t.y,
|
|
@@ -1537,12 +1472,12 @@ const Ro = {
|
|
|
1537
1472
|
height: d.barHeight,
|
|
1538
1473
|
fill: "transparent",
|
|
1539
1474
|
style: A({ cursor: ke.value }),
|
|
1540
|
-
onMouseenter: (a) =>
|
|
1541
|
-
onMousemove: (a) =>
|
|
1542
|
-
onMousedown: (a) =>
|
|
1475
|
+
onMouseenter: (a) => Jt(a, o),
|
|
1476
|
+
onMousemove: (a) => Qt(a, o),
|
|
1477
|
+
onMousedown: (a) => Bn(a, o),
|
|
1543
1478
|
onClick: (a) => lt(t.task)
|
|
1544
|
-
}, null, 44,
|
|
1545
|
-
|
|
1479
|
+
}, null, 44, ha),
|
|
1480
|
+
H.value === o || B.value && Q.value === t.task.id ? (v(), g("rect", {
|
|
1546
1481
|
key: 3,
|
|
1547
1482
|
"data-gantt-part": "highlight",
|
|
1548
1483
|
x: t.x,
|
|
@@ -1554,9 +1489,9 @@ const Ro = {
|
|
|
1554
1489
|
fill: "currentColor",
|
|
1555
1490
|
"fill-opacity": "0.06",
|
|
1556
1491
|
class: "pointer-events-none"
|
|
1557
|
-
}, null, 8,
|
|
1558
|
-
d.draggable && !t.task.milestone && (Z.value === o || B.value && Q.value === t.task.id) ? (v(),
|
|
1559
|
-
|
|
1492
|
+
}, null, 8, ma)) : x("", !0),
|
|
1493
|
+
d.draggable && !t.task.milestone && (Z.value === o || B.value && Q.value === t.task.id) ? (v(), g(W, { key: 4 }, [
|
|
1494
|
+
c("rect", {
|
|
1560
1495
|
"data-gantt-part": "handle-left",
|
|
1561
1496
|
x: t.x,
|
|
1562
1497
|
y: t.y + 4,
|
|
@@ -1566,8 +1501,8 @@ const Ro = {
|
|
|
1566
1501
|
fill: "currentColor",
|
|
1567
1502
|
"fill-opacity": "0.4",
|
|
1568
1503
|
class: "pointer-events-none"
|
|
1569
|
-
}, null, 8,
|
|
1570
|
-
|
|
1504
|
+
}, null, 8, ka),
|
|
1505
|
+
c("rect", {
|
|
1571
1506
|
"data-gantt-part": "handle-right",
|
|
1572
1507
|
x: t.x + t.fullW - 4,
|
|
1573
1508
|
y: t.y + 4,
|
|
@@ -1577,9 +1512,9 @@ const Ro = {
|
|
|
1577
1512
|
fill: "currentColor",
|
|
1578
1513
|
"fill-opacity": "0.4",
|
|
1579
1514
|
class: "pointer-events-none"
|
|
1580
|
-
}, null, 8,
|
|
1581
|
-
], 64)) :
|
|
1582
|
-
d.showLabels && t.fullW > 60 ? (v(),
|
|
1515
|
+
}, null, 8, xa)
|
|
1516
|
+
], 64)) : x("", !0),
|
|
1517
|
+
d.showLabels && t.fullW > 60 ? (v(), g("text", {
|
|
1583
1518
|
key: 5,
|
|
1584
1519
|
"data-gantt-part": "label",
|
|
1585
1520
|
"data-name": t.task.name,
|
|
@@ -1589,11 +1524,11 @@ const Ro = {
|
|
|
1589
1524
|
"font-size": "11",
|
|
1590
1525
|
"font-weight": "600",
|
|
1591
1526
|
fill: d.showProgress ? "currentColor" : "white",
|
|
1592
|
-
opacity:
|
|
1527
|
+
opacity: Xe.value > 0.3 ? 0.85 : 0,
|
|
1593
1528
|
class: "pointer-events-none"
|
|
1594
|
-
}, S(
|
|
1529
|
+
}, S(jt(t.task.name, t.fullW, t.task.blocked)), 9, ba)) : x("", !0)
|
|
1595
1530
|
], 64)),
|
|
1596
|
-
d.editableDependencies &&
|
|
1531
|
+
d.editableDependencies && Hn(o) ? (v(), g("g", {
|
|
1597
1532
|
key: 2,
|
|
1598
1533
|
class: "vlite-gantt-dep-connector",
|
|
1599
1534
|
transform: `translate(${Y(t).cx}, ${Y(t).cy})`,
|
|
@@ -1601,35 +1536,35 @@ const Ro = {
|
|
|
1601
1536
|
tabindex: "0",
|
|
1602
1537
|
focusable: "true",
|
|
1603
1538
|
"aria-label": `Create dependency from ${t.task.name}`,
|
|
1604
|
-
onPointerdown: (a) =>
|
|
1605
|
-
onKeydown: (a) =>
|
|
1606
|
-
onFocus: (a) =>
|
|
1607
|
-
onBlur:
|
|
1608
|
-
onMouseenter: (a) =>
|
|
1609
|
-
onMouseleave: n[0] || (n[0] = (a) =>
|
|
1539
|
+
onPointerdown: (a) => Xn(a, o),
|
|
1540
|
+
onKeydown: (a) => Gn(a, o),
|
|
1541
|
+
onFocus: (a) => Fn(o),
|
|
1542
|
+
onBlur: On,
|
|
1543
|
+
onMouseenter: (a) => Jn(o),
|
|
1544
|
+
onMouseleave: n[0] || (n[0] = (a) => Qn(a))
|
|
1610
1545
|
}, [
|
|
1611
|
-
n[
|
|
1546
|
+
n[7] || (n[7] = c("circle", {
|
|
1612
1547
|
r: "11",
|
|
1613
1548
|
fill: "transparent",
|
|
1614
1549
|
class: "vlite-gantt-dep-connector-hit"
|
|
1615
1550
|
}, null, -1)),
|
|
1616
|
-
|
|
1617
|
-
r:
|
|
1551
|
+
c("circle", {
|
|
1552
|
+
r: qa,
|
|
1618
1553
|
class: "vlite-gantt-dep-connector-disc",
|
|
1619
1554
|
fill: "var(--color-background)",
|
|
1620
1555
|
stroke: "var(--color-foreground)",
|
|
1621
1556
|
"stroke-width": "1.5"
|
|
1622
1557
|
}),
|
|
1623
|
-
n[
|
|
1558
|
+
n[8] || (n[8] = c("path", {
|
|
1624
1559
|
d: "M -3.5 0 H 3.5 M 0 -3.5 V 3.5",
|
|
1625
1560
|
stroke: "var(--color-foreground)",
|
|
1626
1561
|
"stroke-width": "1.5",
|
|
1627
1562
|
"stroke-linecap": "round",
|
|
1628
1563
|
class: "pointer-events-none"
|
|
1629
1564
|
}, null, -1))
|
|
1630
|
-
], 40,
|
|
1631
|
-
|
|
1632
|
-
|
|
1565
|
+
], 40, wa)) : x("", !0),
|
|
1566
|
+
k.value && xe.value === t.task.id ? (v(), g("g", Da, [
|
|
1567
|
+
c("rect", {
|
|
1633
1568
|
x: t.x - 3,
|
|
1634
1569
|
y: t.y - 3,
|
|
1635
1570
|
width: t.fullW + 6,
|
|
@@ -1639,19 +1574,19 @@ const Ro = {
|
|
|
1639
1574
|
stroke: L.value === "valid" ? "var(--color-success)" : "var(--color-danger)",
|
|
1640
1575
|
"stroke-width": "2",
|
|
1641
1576
|
"stroke-dasharray": L.value === "valid" ? "0" : "5 3"
|
|
1642
|
-
}, null, 8,
|
|
1643
|
-
|
|
1577
|
+
}, null, 8, Ia),
|
|
1578
|
+
c("text", {
|
|
1644
1579
|
x: t.x + t.fullW + 10,
|
|
1645
1580
|
y: t.y + d.barHeight / 2,
|
|
1646
1581
|
"dominant-baseline": "middle",
|
|
1647
1582
|
"font-size": "11",
|
|
1648
1583
|
"font-weight": "700",
|
|
1649
1584
|
fill: L.value === "valid" ? "var(--color-success)" : "var(--color-danger)"
|
|
1650
|
-
}, S(L.value === "valid" ? "✓" : "✕"), 9,
|
|
1651
|
-
])) :
|
|
1652
|
-
], 42,
|
|
1653
|
-
|
|
1654
|
-
|
|
1585
|
+
}, S(L.value === "valid" ? "✓" : "✕"), 9, Sa)
|
|
1586
|
+
])) : x("", !0)
|
|
1587
|
+
], 42, ua))), 128)),
|
|
1588
|
+
k.value && E.value ? (v(), g("g", Ma, [
|
|
1589
|
+
c("line", {
|
|
1655
1590
|
x1: E.value.x1,
|
|
1656
1591
|
y1: E.value.y1,
|
|
1657
1592
|
x2: E.value.x2,
|
|
@@ -1661,23 +1596,23 @@ const Ro = {
|
|
|
1661
1596
|
"stroke-dasharray": L.value === "invalid" ? "2 4" : "6 4",
|
|
1662
1597
|
"stroke-linecap": "round",
|
|
1663
1598
|
"stroke-opacity": L.value === "none" ? 0.55 : 0.9
|
|
1664
|
-
}, null, 8,
|
|
1665
|
-
|
|
1599
|
+
}, null, 8, $a),
|
|
1600
|
+
c("circle", {
|
|
1666
1601
|
cx: E.value.x2,
|
|
1667
1602
|
cy: E.value.y2,
|
|
1668
1603
|
r: "4",
|
|
1669
1604
|
fill: L.value === "invalid" ? "var(--color-danger)" : "var(--color-primary)",
|
|
1670
1605
|
"fill-opacity": L.value === "none" ? 0.55 : 0.9
|
|
1671
|
-
}, null, 8,
|
|
1672
|
-
])) :
|
|
1673
|
-
|
|
1606
|
+
}, null, 8, Ca)
|
|
1607
|
+
])) : x("", !0),
|
|
1608
|
+
c("g", {
|
|
1674
1609
|
ref_key: "dragLabelRef",
|
|
1675
1610
|
ref: F,
|
|
1676
1611
|
style: { display: "none" },
|
|
1677
1612
|
"pointer-events": "none",
|
|
1678
1613
|
"aria-hidden": "true"
|
|
1679
|
-
}, [...n[
|
|
1680
|
-
|
|
1614
|
+
}, [...n[9] || (n[9] = [
|
|
1615
|
+
c("rect", {
|
|
1681
1616
|
x: "0",
|
|
1682
1617
|
y: "0",
|
|
1683
1618
|
width: "148",
|
|
@@ -1686,7 +1621,7 @@ const Ro = {
|
|
|
1686
1621
|
fill: "var(--color-foreground)",
|
|
1687
1622
|
"fill-opacity": "0.85"
|
|
1688
1623
|
}, null, -1),
|
|
1689
|
-
|
|
1624
|
+
c("text", {
|
|
1690
1625
|
x: "0",
|
|
1691
1626
|
y: "0",
|
|
1692
1627
|
"text-anchor": "middle",
|
|
@@ -1696,8 +1631,8 @@ const Ro = {
|
|
|
1696
1631
|
fill: "var(--color-background)"
|
|
1697
1632
|
}, null, -1)
|
|
1698
1633
|
])], 512),
|
|
1699
|
-
d.showTodayLine &&
|
|
1700
|
-
|
|
1634
|
+
d.showTodayLine && Ue.value ? (v(), g("g", La, [
|
|
1635
|
+
c("line", {
|
|
1701
1636
|
x1: me.value,
|
|
1702
1637
|
y1: 0,
|
|
1703
1638
|
x2: me.value,
|
|
@@ -1706,15 +1641,15 @@ const Ro = {
|
|
|
1706
1641
|
"stroke-width": "2",
|
|
1707
1642
|
"stroke-opacity": "0.7",
|
|
1708
1643
|
"stroke-dasharray": "6 3"
|
|
1709
|
-
}, null, 8,
|
|
1710
|
-
|
|
1644
|
+
}, null, 8, Wa),
|
|
1645
|
+
c("circle", {
|
|
1711
1646
|
cx: me.value,
|
|
1712
1647
|
cy: 0,
|
|
1713
1648
|
r: "4",
|
|
1714
1649
|
fill: d.todayColor,
|
|
1715
1650
|
"fill-opacity": "0.9"
|
|
1716
|
-
}, null, 8,
|
|
1717
|
-
|
|
1651
|
+
}, null, 8, Ta),
|
|
1652
|
+
c("text", {
|
|
1718
1653
|
x: me.value,
|
|
1719
1654
|
y: -8,
|
|
1720
1655
|
"text-anchor": "middle",
|
|
@@ -1722,42 +1657,42 @@ const Ro = {
|
|
|
1722
1657
|
"font-weight": "700",
|
|
1723
1658
|
fill: d.todayColor,
|
|
1724
1659
|
"fill-opacity": "0.9"
|
|
1725
|
-
}, "TODAY", 8,
|
|
1726
|
-
])) :
|
|
1727
|
-
], 42,
|
|
1660
|
+
}, "TODAY", 8, Aa)
|
|
1661
|
+
])) : x("", !0)
|
|
1662
|
+
], 42, Yo))
|
|
1728
1663
|
], 4)
|
|
1729
1664
|
], 544)
|
|
1730
1665
|
]),
|
|
1731
|
-
|
|
1732
|
-
(v(), it(
|
|
1733
|
-
|
|
1666
|
+
c("div", Ea, S(je.value), 1),
|
|
1667
|
+
(v(), it(io, { to: "body" }, [
|
|
1668
|
+
p.value && !B.value && !k.value && !C.value ? (v(), g("div", {
|
|
1734
1669
|
key: 0,
|
|
1735
1670
|
class: "vlite-chart-tooltip",
|
|
1736
|
-
style: A({ left: `${
|
|
1671
|
+
style: A({ left: `${p.value.left}px`, top: `${p.value.top}px` })
|
|
1737
1672
|
}, [
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1673
|
+
c("div", Pa, S(p.value.task.name), 1),
|
|
1674
|
+
c("div", Ra, [
|
|
1675
|
+
c("span", {
|
|
1741
1676
|
class: "w-2 h-2 rounded-sm shrink-0",
|
|
1742
|
-
style: A({ backgroundColor:
|
|
1677
|
+
style: A({ backgroundColor: p.value.task._color ?? p.value.task.color })
|
|
1743
1678
|
}, null, 4),
|
|
1744
|
-
|
|
1679
|
+
c("span", null, S(p.value.startStr) + " — " + S(p.value.endStr), 1)
|
|
1745
1680
|
]),
|
|
1746
|
-
|
|
1747
|
-
d.showProgress &&
|
|
1748
|
-
|
|
1749
|
-
|
|
1681
|
+
c("div", Ba, S(to(p.value.task._start, p.value.task._end)), 1),
|
|
1682
|
+
d.showProgress && p.value.task.progress != null ? (v(), g("div", _a, [
|
|
1683
|
+
c("div", Ha, [
|
|
1684
|
+
c("div", {
|
|
1750
1685
|
class: "vlite-gantt-tooltip-progress-fill",
|
|
1751
1686
|
style: A({
|
|
1752
|
-
width: `${
|
|
1753
|
-
backgroundColor:
|
|
1687
|
+
width: `${p.value.task.progress}%`,
|
|
1688
|
+
backgroundColor: p.value.task._color ?? p.value.task.color
|
|
1754
1689
|
})
|
|
1755
1690
|
}, null, 4)
|
|
1756
1691
|
]),
|
|
1757
|
-
|
|
1758
|
-
])) :
|
|
1759
|
-
|
|
1760
|
-
n[
|
|
1692
|
+
c("span", za, S(p.value.task.progress) + "%", 1)
|
|
1693
|
+
])) : x("", !0),
|
|
1694
|
+
p.value.task.blocked ? (v(), g("div", Xa, [
|
|
1695
|
+
n[10] || (n[10] = c("svg", {
|
|
1761
1696
|
width: "10",
|
|
1762
1697
|
height: "10",
|
|
1763
1698
|
viewBox: "0 0 24 24",
|
|
@@ -1767,41 +1702,41 @@ const Ro = {
|
|
|
1767
1702
|
"stroke-linecap": "round",
|
|
1768
1703
|
"stroke-linejoin": "round"
|
|
1769
1704
|
}, [
|
|
1770
|
-
|
|
1705
|
+
c("rect", {
|
|
1771
1706
|
x: "5",
|
|
1772
1707
|
y: "11",
|
|
1773
1708
|
width: "14",
|
|
1774
1709
|
height: "9",
|
|
1775
1710
|
rx: "2"
|
|
1776
1711
|
}),
|
|
1777
|
-
|
|
1712
|
+
c("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
|
|
1778
1713
|
], -1)),
|
|
1779
|
-
|
|
1780
|
-
])) :
|
|
1781
|
-
|
|
1782
|
-
z(
|
|
1783
|
-
z(
|
|
1714
|
+
c("span", null, S(p.value.task.blockedReason || "Blocked"), 1)
|
|
1715
|
+
])) : x("", !0),
|
|
1716
|
+
p.value.task.group ? (v(), g("div", Ga, S(p.value.task.group), 1)) : x("", !0),
|
|
1717
|
+
z(p.value.task).length ? (v(), g("div", Fa, [
|
|
1718
|
+
z(p.value.task).length === 1 ? (v(), it(uo, {
|
|
1784
1719
|
key: 0,
|
|
1785
|
-
src: z(
|
|
1786
|
-
alt: z(
|
|
1787
|
-
fallback:
|
|
1788
|
-
label: z(
|
|
1789
|
-
"secondary-label": z(
|
|
1790
|
-
presence: z(
|
|
1720
|
+
src: z(p.value.task)[0].src,
|
|
1721
|
+
alt: z(p.value.task)[0].alt || z(p.value.task)[0].name,
|
|
1722
|
+
fallback: en(z(p.value.task)[0]),
|
|
1723
|
+
label: z(p.value.task)[0].name,
|
|
1724
|
+
"secondary-label": z(p.value.task)[0].role,
|
|
1725
|
+
presence: z(p.value.task)[0].presence,
|
|
1791
1726
|
size: "xs"
|
|
1792
|
-
}, null, 8, ["src", "alt", "fallback", "label", "secondary-label", "presence"])) : (v(), it(X(
|
|
1727
|
+
}, null, 8, ["src", "alt", "fallback", "label", "secondary-label", "presence"])) : (v(), it(X(co), {
|
|
1793
1728
|
key: 1,
|
|
1794
|
-
items:
|
|
1729
|
+
items: no(p.value.task),
|
|
1795
1730
|
max: 5,
|
|
1796
1731
|
size: "xs",
|
|
1797
1732
|
overlap: "sm"
|
|
1798
1733
|
}, null, 8, ["items"]))
|
|
1799
|
-
])) :
|
|
1800
|
-
], 4)) :
|
|
1734
|
+
])) : x("", !0)
|
|
1735
|
+
], 4)) : x("", !0)
|
|
1801
1736
|
]))
|
|
1802
1737
|
], 512));
|
|
1803
1738
|
}
|
|
1804
1739
|
});
|
|
1805
1740
|
export {
|
|
1806
|
-
|
|
1741
|
+
tl as default
|
|
1807
1742
|
};
|