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