vlite3 1.4.24 → 1.4.25
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/AppShell/AppShell.vue.d.ts +2 -0
- package/components/AppShell/AppShell.vue.js +11 -9
- package/components/AppShell/AppShellLayoutClassic.vue.js +34 -32
- package/components/AppShell/AppShellLayoutDashboard.vue.js +51 -49
- package/components/AppShell/AppShellLayoutDock.vue.js +52 -50
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +56 -54
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +51 -49
- package/components/AppShell/AppShellLayoutStorefront.vue.js +40 -38
- package/components/AppShell/useAppShell.js +1 -1
- package/components/CategoryManager/CategoryManager.vue2.js +2 -2
- package/components/Chart/GanttChart.vue.js +1 -1
- package/components/Chart/GanttChart.vue2.js +367 -364
- package/components/Chart/types.d.ts +2 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +131 -127
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +2 -2
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/appshell.type.d.ts +2 -0
- /package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +0 -0
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { CHART_COLORS as
|
|
1
|
+
import { defineComponent as et, ref as x, computed as p, onMounted as tt, watch as ze, onUnmounted as ot, openBlock as u, createElementBlock as d, createElementVNode as r, createStaticVNode as nt, createCommentVNode as h, normalizeStyle as D, Fragment as $, renderList as C, normalizeClass as me, toDisplayString as b, unref as z, withDirectives as lt, vShow as at, createBlock as st, Teleport as rt, createTextVNode as We, nextTick as ke } from "vue";
|
|
2
|
+
import { CHART_COLORS as it, getColor as ut, animateProgress as dt } from "./utils.js";
|
|
3
3
|
const ct = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "vlite-gantt-toolbar"
|
|
6
|
-
},
|
|
6
|
+
}, vt = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "vlite-gantt-zoom-controls"
|
|
9
|
-
},
|
|
9
|
+
}, ft = ["disabled"], gt = ["disabled"], ht = { class: "vlite-gantt-wrapper" }, yt = ["onClick"], mt = { class: "text-xs font-bold text-foreground uppercase tracking-wide" }, kt = { class: "vlite-gantt-group-count" }, xt = ["onClick"], pt = { class: "truncate text-xs font-medium text-foreground" }, wt = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "vlite-gantt-progress-badge"
|
|
12
|
-
},
|
|
12
|
+
}, bt = ["width", "height"], $t = ["x1", "x2", "y2"], Mt = ["x", "y"], Dt = ["x", "y"], St = ["width", "height"], Ct = ["id"], Lt = ["stop-color"], _t = ["stop-color"], Ht = ["id"], zt = ["stop-color"], Wt = ["stop-color"], Tt = ["x1", "x2", "y2"], Et = ["y1", "x2", "y2"], It = ["y", "width", "height"], Bt = ["d"], Rt = ["d"], At = ["d", "fill", "stroke", "opacity", "onMouseenter", "onMousemove", "onClick"], Pt = ["d", "fill"], Ft = ["d", "fill"], Zt = ["d", "fill"], Ot = ["x", "y", "width", "height", "onMouseenter", "onMousemove", "onMousedown", "onClick"], Gt = ["x", "y", "width", "height", "rx", "ry"], qt = ["x", "y", "height"], Xt = ["x", "y", "height"], jt = ["x", "y", "fill", "opacity"], Nt = { key: 1 }, Vt = ["x1", "x2", "y2", "stroke"], Ut = ["cx", "fill"], Kt = ["x", "fill"], Qt = { class: "font-semibold text-xs mb-1.5" }, Jt = { class: "flex items-center gap-1.5 text-[11px] text-muted-foreground mb-1" }, Yt = { class: "text-[10px] text-muted-foreground" }, eo = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "mt-1.5 flex items-center gap-2"
|
|
15
|
-
},
|
|
15
|
+
}, to = { class: "vlite-gantt-tooltip-progress-track" }, oo = { class: "text-[10px] font-semibold" }, no = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "text-[10px] text-muted-foreground mt-1 opacity-60"
|
|
18
|
-
},
|
|
18
|
+
}, lo = {
|
|
19
19
|
key: 2,
|
|
20
20
|
class: "text-[9px] text-muted-foreground mt-1.5 opacity-40"
|
|
21
|
-
},
|
|
21
|
+
}, ao = 16, Y = 5, so = 4, Te = 8, uo = /* @__PURE__ */ et({
|
|
22
22
|
__name: "GanttChart",
|
|
23
23
|
props: {
|
|
24
24
|
tasks: {},
|
|
@@ -36,7 +36,7 @@ const ct = {
|
|
|
36
36
|
showTodayLine: { type: Boolean, default: !0 },
|
|
37
37
|
showHeader: { type: Boolean, default: !0 },
|
|
38
38
|
animate: { type: Boolean, default: !0 },
|
|
39
|
-
colors: { default: () =>
|
|
39
|
+
colors: { default: () => it },
|
|
40
40
|
todayColor: { default: "var(--color-danger)" },
|
|
41
41
|
locale: { default: "en-US" },
|
|
42
42
|
draggable: { type: Boolean, default: !0 },
|
|
@@ -44,85 +44,88 @@ const ct = {
|
|
|
44
44
|
zoom: { type: Boolean, default: !0 }
|
|
45
45
|
},
|
|
46
46
|
emits: ["task-click", "task-hover", "task-update"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
-
function
|
|
47
|
+
setup(c, { emit: Ee }) {
|
|
48
|
+
const s = c, A = Ee;
|
|
49
|
+
function xe(t) {
|
|
50
50
|
return t instanceof Date ? new Date(t.getTime()) : new Date(t);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
52
|
+
function X(t, o) {
|
|
53
|
+
const e = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds());
|
|
54
|
+
return (Date.UTC(o.getFullYear(), o.getMonth(), o.getDate(), o.getHours(), o.getMinutes(), o.getSeconds()) - e) / 864e5;
|
|
54
55
|
}
|
|
55
56
|
function y(t, o) {
|
|
56
57
|
const e = new Date(t);
|
|
57
58
|
return e.setDate(e.getDate() + o), e;
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function Ie(t) {
|
|
60
61
|
const o = new Date(t), e = o.getDay();
|
|
61
62
|
return o.setDate(o.getDate() - (e === 0 ? 6 : e - 1)), o.setHours(0, 0, 0, 0), o;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function Be(t) {
|
|
64
65
|
return new Date(t.getFullYear(), t.getMonth(), 1);
|
|
65
66
|
}
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
const j = x(), L = x(), P = x(800);
|
|
68
|
+
let ee = null;
|
|
69
|
+
function Re() {
|
|
70
|
+
j.value && (ee = new ResizeObserver((t) => {
|
|
71
|
+
const o = Math.round(t[0].contentRect.width || 800);
|
|
72
|
+
Math.abs(P.value - o) > 0.5 && (P.value = o);
|
|
73
|
+
}), ee.observe(j.value), P.value = Math.round(j.value.clientWidth || 800));
|
|
72
74
|
}
|
|
73
75
|
const _ = p(
|
|
74
|
-
() =>
|
|
76
|
+
() => s.tasks.map((t, o) => ({
|
|
75
77
|
...t,
|
|
76
|
-
_start:
|
|
77
|
-
_end:
|
|
78
|
-
_color: t.color ??
|
|
78
|
+
_start: xe(t.start),
|
|
79
|
+
_end: xe(t.end),
|
|
80
|
+
_color: t.color ?? ut(s.colors, o),
|
|
79
81
|
_index: o
|
|
80
82
|
}))
|
|
81
|
-
),
|
|
82
|
-
function
|
|
83
|
-
const o = new Set(
|
|
84
|
-
o.has(t) ? o.delete(t) : o.add(t),
|
|
83
|
+
), N = x(/* @__PURE__ */ new Set());
|
|
84
|
+
function Ae(t) {
|
|
85
|
+
const o = new Set(N.value);
|
|
86
|
+
o.has(t) ? o.delete(t) : o.add(t), N.value = o;
|
|
85
87
|
}
|
|
86
|
-
const
|
|
88
|
+
const te = p(() => {
|
|
87
89
|
const t = /* @__PURE__ */ new Map(), o = [];
|
|
88
90
|
for (const e of _.value)
|
|
89
91
|
e.group ? (t.has(e.group) || t.set(e.group, []), t.get(e.group).push(e)) : o.push(e);
|
|
90
92
|
return { grouped: t, ungrouped: o };
|
|
91
|
-
}),
|
|
93
|
+
}), F = p(() => {
|
|
92
94
|
const t = [];
|
|
93
|
-
for (const [o, e] of
|
|
94
|
-
if (t.push({ type: "group-header", group: o }), !
|
|
95
|
-
for (const o of
|
|
95
|
+
for (const [o, e] of te.value.grouped)
|
|
96
|
+
if (t.push({ type: "group-header", group: o }), !N.value.has(o)) for (const n of e) t.push({ type: "task", group: o, task: n });
|
|
97
|
+
for (const o of te.value.ungrouped) t.push({ type: "task", task: o });
|
|
96
98
|
return t;
|
|
97
|
-
}),
|
|
99
|
+
}), W = p(() => {
|
|
98
100
|
if (!_.value.length) {
|
|
99
|
-
const
|
|
100
|
-
return { start: y(
|
|
101
|
+
const i = /* @__PURE__ */ new Date();
|
|
102
|
+
return { start: y(i, -7), end: y(i, 30) };
|
|
101
103
|
}
|
|
102
104
|
let t = _.value[0]._start, o = _.value[0]._end;
|
|
103
|
-
for (const
|
|
104
|
-
|
|
105
|
-
const e =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
for (const i of _.value)
|
|
106
|
+
i._start < t && (t = i._start), i._end > o && (o = i._end);
|
|
107
|
+
const e = s.viewMode === "day" ? 2 : s.viewMode === "week" ? 5 : 15;
|
|
108
|
+
let n = y(t, -e), a = y(o, e);
|
|
109
|
+
return s.viewMode === "week" ? n = Ie(n) : s.viewMode === "month" ? n = Be(n) : n.setHours(0, 0, 0, 0), { start: n, end: a };
|
|
110
|
+
}), m = x(1);
|
|
111
|
+
let T = null;
|
|
112
|
+
function Pe(t) {
|
|
113
|
+
if (s.zoom && (t.ctrlKey || t.metaKey)) {
|
|
111
114
|
t.preventDefault();
|
|
112
|
-
const o =
|
|
115
|
+
const o = L.value;
|
|
113
116
|
if (!o) return;
|
|
114
|
-
const e = o.getBoundingClientRect(), n = t.clientX - e.left,
|
|
117
|
+
const e = o.getBoundingClientRect(), n = t.clientX - e.left, i = (T !== null ? T : o.scrollLeft) + n, f = m.value;
|
|
115
118
|
let v = f * Math.exp(-t.deltaY * 5e-3);
|
|
116
119
|
if (v = Math.max(0.2, Math.min(v, 5)), v === f) return;
|
|
117
120
|
m.value = v;
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
const k = v / f;
|
|
122
|
+
T = i * k - n, ke(() => {
|
|
123
|
+
L.value && T !== null && (L.value.scrollLeft = T, T = null);
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
|
-
function
|
|
125
|
-
const t =
|
|
127
|
+
function Fe() {
|
|
128
|
+
const t = L.value;
|
|
126
129
|
if (!t) {
|
|
127
130
|
m.value = Math.min(m.value + 0.2, 5);
|
|
128
131
|
return;
|
|
@@ -133,7 +136,7 @@ const ct = {
|
|
|
133
136
|
ke(() => t.scrollLeft = e * a - o);
|
|
134
137
|
}
|
|
135
138
|
function Ze() {
|
|
136
|
-
const t =
|
|
139
|
+
const t = L.value;
|
|
137
140
|
if (!t) {
|
|
138
141
|
m.value = Math.max(m.value - 0.2, 0.2);
|
|
139
142
|
return;
|
|
@@ -143,39 +146,29 @@ const ct = {
|
|
|
143
146
|
const a = m.value / n;
|
|
144
147
|
ke(() => t.scrollLeft = e * a - o);
|
|
145
148
|
}
|
|
146
|
-
const
|
|
147
|
-
const t = [], { start: o, end: e } =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
n.setHours(0, 0, 0, 0);
|
|
151
|
-
let a = 0;
|
|
149
|
+
const oe = p(() => {
|
|
150
|
+
const t = [], { start: o, end: e } = W.value;
|
|
151
|
+
let n = new Date(o);
|
|
152
|
+
if (s.viewMode === "day")
|
|
152
153
|
for (; n <= e; )
|
|
153
|
-
t.push(
|
|
154
|
-
|
|
155
|
-
sublabel: n.toLocaleDateString(c.locale, { weekday: "short" }),
|
|
156
|
-
x: a * H.value,
|
|
157
|
-
width: H.value
|
|
158
|
-
}), n = y(n, 1), a++;
|
|
159
|
-
} else if (c.viewMode === "week") {
|
|
160
|
-
let n = We(o), a = 0;
|
|
154
|
+
t.push(n), n = y(n, 1);
|
|
155
|
+
else if (s.viewMode === "week")
|
|
161
156
|
for (; n <= e; )
|
|
162
|
-
t.push(
|
|
163
|
-
|
|
164
|
-
sublabel: `W${Oe(n)}`,
|
|
165
|
-
x: a * H.value,
|
|
166
|
-
width: H.value
|
|
167
|
-
}), n = y(n, 7), a++;
|
|
168
|
-
} else {
|
|
169
|
-
let n = Ie(o), a = 0;
|
|
157
|
+
t.push(n), n = y(n, 7);
|
|
158
|
+
else
|
|
170
159
|
for (; n <= e; )
|
|
171
|
-
t.push(
|
|
172
|
-
label: n.toLocaleDateString(c.locale, { month: "long" }),
|
|
173
|
-
sublabel: String(n.getFullYear()),
|
|
174
|
-
x: a * H.value,
|
|
175
|
-
width: H.value
|
|
176
|
-
}), n = new Date(n.getFullYear(), n.getMonth() + 1, 1), a++;
|
|
177
|
-
}
|
|
160
|
+
t.push(n), n = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
178
161
|
return t;
|
|
162
|
+
}), M = p(() => {
|
|
163
|
+
let o = { day: 40, week: 120, month: 180 }[s.viewMode] * m.value;
|
|
164
|
+
const e = Math.max(0, P.value - s.sidebarWidth), n = oe.value.length;
|
|
165
|
+
return n > 0 && o * n < e && (o = e / n), o;
|
|
166
|
+
}), pe = p(() => {
|
|
167
|
+
const t = M.value;
|
|
168
|
+
return oe.value.map((o, e) => {
|
|
169
|
+
let n = "", a = "";
|
|
170
|
+
return s.viewMode === "day" ? (n = o.toLocaleDateString(s.locale, { day: "numeric" }), a = o.toLocaleDateString(s.locale, { weekday: "short" })) : s.viewMode === "week" ? (n = o.toLocaleDateString(s.locale, { month: "short", day: "numeric" }), a = `W${Oe(o)}`) : (n = o.toLocaleDateString(s.locale, { month: "long" }), a = String(o.getFullYear())), { label: n, sublabel: a, x: e * t, width: t };
|
|
171
|
+
});
|
|
179
172
|
});
|
|
180
173
|
function Oe(t) {
|
|
181
174
|
const o = new Date(t.getTime());
|
|
@@ -183,25 +176,35 @@ const ct = {
|
|
|
183
176
|
const e = new Date(o.getFullYear(), 0, 4);
|
|
184
177
|
return 1 + Math.round(((o.getTime() - e.getTime()) / 864e5 - 3 + (e.getDay() + 6) % 7) / 7);
|
|
185
178
|
}
|
|
186
|
-
const
|
|
187
|
-
const t =
|
|
188
|
-
return Math.max(
|
|
179
|
+
const Z = p(() => oe.value.length * M.value), E = p(() => s.showHeader ? 56 : 0), O = p(() => {
|
|
180
|
+
const t = F.value.length * s.rowHeight;
|
|
181
|
+
return Math.max(s.height || t, t);
|
|
189
182
|
});
|
|
183
|
+
function ne(t) {
|
|
184
|
+
if (s.viewMode === "day")
|
|
185
|
+
return X(W.value.start, t) * M.value;
|
|
186
|
+
if (s.viewMode === "week")
|
|
187
|
+
return X(W.value.start, t) / 7 * M.value;
|
|
188
|
+
{
|
|
189
|
+
const o = W.value.start, e = (t.getFullYear() - o.getFullYear()) * 12 + (t.getMonth() - o.getMonth()), n = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate(), a = (t.getDate() - 1 + t.getHours() / 24 + t.getMinutes() / 1440) / n;
|
|
190
|
+
return (e + a) * M.value;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
190
193
|
function le(t) {
|
|
191
|
-
return
|
|
194
|
+
return s.viewMode === "day" ? t / M.value : s.viewMode === "week" ? t / M.value * 7 : t / M.value * 30.44;
|
|
192
195
|
}
|
|
193
|
-
function
|
|
194
|
-
return t / M.value *
|
|
196
|
+
function we(t) {
|
|
197
|
+
return s.viewMode === "day" ? t * M.value : s.viewMode === "week" ? t / 7 * M.value : t / 30.44 * M.value;
|
|
195
198
|
}
|
|
196
199
|
const w = p(() => {
|
|
197
200
|
const t = Q.value;
|
|
198
|
-
return
|
|
201
|
+
return F.value.reduce((o, e, n) => {
|
|
199
202
|
if (e.type !== "task" || !e.task) return o;
|
|
200
|
-
const a = e.task,
|
|
201
|
-
return o.push({ task: a, x:
|
|
203
|
+
const a = e.task, i = ne(a._start), f = ne(a._end), v = Math.max(8, f - i), k = v * t, S = n * s.rowHeight + (s.rowHeight - s.barHeight) / 2, ge = a.progress != null ? v * Math.min(100, a.progress) / 100 * t : 0;
|
|
204
|
+
return o.push({ task: a, x: i, y: S, fullW: v, w: k, progressW: ge, rowIndex: n }), o;
|
|
202
205
|
}, []);
|
|
203
|
-
}),
|
|
204
|
-
if (!
|
|
206
|
+
}), Ge = p(() => {
|
|
207
|
+
if (!s.showDependencies) return [];
|
|
205
208
|
const t = /* @__PURE__ */ new Map();
|
|
206
209
|
for (const e of w.value) t.set(e.task.id, e);
|
|
207
210
|
const o = [];
|
|
@@ -210,48 +213,48 @@ const ct = {
|
|
|
210
213
|
for (const n of e.task.dependencies) {
|
|
211
214
|
const a = t.get(n);
|
|
212
215
|
if (!a) continue;
|
|
213
|
-
const
|
|
214
|
-
o.push({ d:
|
|
216
|
+
const i = a.x + a.fullW, f = a.y + s.barHeight / 2, v = e.x, k = e.y + s.barHeight / 2;
|
|
217
|
+
o.push({ d: qe(i, f, v, k), ad: Xe(v, k) });
|
|
215
218
|
}
|
|
216
219
|
return o;
|
|
217
220
|
});
|
|
218
|
-
function
|
|
219
|
-
const a =
|
|
221
|
+
function qe(t, o, e, n) {
|
|
222
|
+
const a = ao, i = so;
|
|
220
223
|
if (e > t + a * 2) {
|
|
221
224
|
if (Math.abs(o - n) < 2) return `M ${t} ${o} L ${e} ${n}`;
|
|
222
225
|
const v = t + (e - t) / 2;
|
|
223
|
-
return
|
|
226
|
+
return ae([[t, o], [v, o], [v, n], [e, n]], i);
|
|
224
227
|
}
|
|
225
228
|
const f = t + a;
|
|
226
|
-
if (Math.abs(o - n) <
|
|
227
|
-
const v = Math.max(o, n) +
|
|
228
|
-
return
|
|
229
|
+
if (Math.abs(o - n) < s.rowHeight * 0.5) {
|
|
230
|
+
const v = Math.max(o, n) + s.barHeight / 2 + a;
|
|
231
|
+
return ae([[t, o], [f, o], [f, v], [e - a, v], [e - a, n], [e, n]], i);
|
|
229
232
|
}
|
|
230
|
-
return
|
|
233
|
+
return ae([[t, o], [f, o], [f, n], [e, n]], i);
|
|
231
234
|
}
|
|
232
|
-
function
|
|
235
|
+
function ae(t, o) {
|
|
233
236
|
if (t.length < 2) return "";
|
|
234
237
|
if (t.length === 2) return `M ${t[0][0]} ${t[0][1]} L ${t[1][0]} ${t[1][1]}`;
|
|
235
238
|
const e = [`M ${t[0][0]} ${t[0][1]}`];
|
|
236
239
|
for (let a = 1; a < t.length - 1; a++) {
|
|
237
|
-
const [
|
|
238
|
-
e.push(`L ${v -
|
|
240
|
+
const [i, f] = t[a - 1], [v, k] = t[a], [S, ge] = t[a + 1], Ce = v - i, Le = k - f, _e = S - v, He = ge - k, he = Math.hypot(Ce, Le), ye = Math.hypot(_e, He), J = Math.min(o, he / 2, ye / 2);
|
|
241
|
+
e.push(`L ${v - Ce / he * J} ${k - Le / he * J}`), e.push(`Q ${v} ${k} ${v + _e / ye * J} ${k + He / ye * J}`);
|
|
239
242
|
}
|
|
240
243
|
const n = t[t.length - 1];
|
|
241
244
|
return e.push(`L ${n[0]} ${n[1]}`), e.join(" ");
|
|
242
245
|
}
|
|
243
|
-
function
|
|
246
|
+
function Xe(t, o) {
|
|
244
247
|
return `M ${t} ${o} L ${t - Y} ${o - Y * 0.6} L ${t - Y} ${o + Y * 0.6} Z`;
|
|
245
248
|
}
|
|
246
|
-
const
|
|
249
|
+
const G = p(() => {
|
|
247
250
|
const t = /* @__PURE__ */ new Date();
|
|
248
|
-
return t.setHours(12, 0, 0, 0),
|
|
251
|
+
return t.setHours(12, 0, 0, 0), ne(t);
|
|
249
252
|
}), V = p(() => {
|
|
250
253
|
const t = /* @__PURE__ */ new Date();
|
|
251
|
-
return t >=
|
|
254
|
+
return t >= W.value.start && t <= W.value.end;
|
|
252
255
|
});
|
|
253
|
-
function
|
|
254
|
-
!
|
|
256
|
+
function je() {
|
|
257
|
+
!L.value || !V.value || L.value.scrollTo({ left: Math.max(0, G.value - (P.value - s.sidebarWidth) / 2), behavior: "smooth" });
|
|
255
258
|
}
|
|
256
259
|
let l = {
|
|
257
260
|
active: !1,
|
|
@@ -266,13 +269,13 @@ const ct = {
|
|
|
266
269
|
// cascade set
|
|
267
270
|
rafId: 0
|
|
268
271
|
};
|
|
269
|
-
const
|
|
270
|
-
function
|
|
271
|
-
|
|
272
|
+
const I = x(!1), q = x(""), se = x(null), U = x("default"), K = x([]), H = x(null);
|
|
273
|
+
function Ne(t, o) {
|
|
274
|
+
K.value[o] = t;
|
|
272
275
|
}
|
|
273
|
-
function
|
|
276
|
+
function Ve(t) {
|
|
274
277
|
const o = /* @__PURE__ */ new Set();
|
|
275
|
-
if (!
|
|
278
|
+
if (!s.cascadeDependencies) return o;
|
|
276
279
|
const e = [t];
|
|
277
280
|
for (; e.length; ) {
|
|
278
281
|
const n = e.shift();
|
|
@@ -281,159 +284,159 @@ const ct = {
|
|
|
281
284
|
}
|
|
282
285
|
return o;
|
|
283
286
|
}
|
|
284
|
-
function
|
|
285
|
-
if (!
|
|
287
|
+
function be(t, o) {
|
|
288
|
+
if (!s.draggable || o.task.milestone) return "move";
|
|
286
289
|
const e = t.currentTarget.closest("svg");
|
|
287
290
|
if (!e) return "move";
|
|
288
291
|
const n = t.clientX - e.getBoundingClientRect().left;
|
|
289
|
-
return n < o.x +
|
|
292
|
+
return n < o.x + Te ? "resize-left" : n > o.x + o.fullW - Te ? "resize-right" : "move";
|
|
290
293
|
}
|
|
291
|
-
function
|
|
292
|
-
if (!
|
|
294
|
+
function Ue(t, o) {
|
|
295
|
+
if (!s.draggable) return;
|
|
293
296
|
const e = w.value[o];
|
|
294
297
|
if (!e || e.task.milestone) return;
|
|
295
298
|
t.preventDefault(), t.stopPropagation();
|
|
296
|
-
const n =
|
|
297
|
-
l.active = !0, l.barIndex = o, l.taskId = e.task.id, l.mode = n, l.startMouseX = t.clientX, l.pxDelta = 0, l.origStart = new Date(e.task._start), l.origEnd = new Date(e.task._end), l.affectedIds = n === "move" ?
|
|
299
|
+
const n = be(t, e);
|
|
300
|
+
l.active = !0, l.barIndex = o, l.taskId = e.task.id, l.mode = n, l.startMouseX = t.clientX, l.pxDelta = 0, l.origStart = new Date(e.task._start), l.origEnd = new Date(e.task._end), l.affectedIds = n === "move" ? Ve(e.task.id) : /* @__PURE__ */ new Set(), I.value = !0, q.value = e.task.id, g.value = null, B.value = o, document.addEventListener("mousemove", re), document.addEventListener("mouseup", ie), document.body.style.cursor = n === "move" ? "grabbing" : "ew-resize", document.body.style.userSelect = "none";
|
|
298
301
|
}
|
|
299
|
-
function
|
|
302
|
+
function re(t) {
|
|
300
303
|
if (l.active) {
|
|
301
304
|
if (l.pxDelta = t.clientX - l.startMouseX, l.mode !== "move" && l.origStart && l.origEnd) {
|
|
302
|
-
const o =
|
|
303
|
-
l.mode === "resize-left" && e >= o - 0.5 && (l.pxDelta = (o - 0.5)
|
|
305
|
+
const o = X(l.origStart, l.origEnd), e = le(l.pxDelta);
|
|
306
|
+
l.mode === "resize-left" && e >= o - 0.5 && (l.pxDelta = we(o - 0.5)), l.mode === "resize-right" && -e >= o - 0.5 && (l.pxDelta = -we(o - 0.5));
|
|
304
307
|
}
|
|
305
308
|
cancelAnimationFrame(l.rafId), l.rafId = requestAnimationFrame(Ke);
|
|
306
309
|
}
|
|
307
310
|
}
|
|
308
311
|
function Ke() {
|
|
309
|
-
const t = l.pxDelta, o =
|
|
312
|
+
const t = l.pxDelta, o = K.value[l.barIndex];
|
|
310
313
|
if (o) {
|
|
311
314
|
if (l.mode === "move") {
|
|
312
315
|
if (o.style.transform = `translateX(${t}px)`, l.affectedIds.size > 0) {
|
|
313
316
|
for (let e = 0; e < w.value.length; e++)
|
|
314
317
|
if (l.affectedIds.has(w.value[e].task.id)) {
|
|
315
|
-
const n =
|
|
318
|
+
const n = K.value[e];
|
|
316
319
|
n && (n.style.transform = `translateX(${t}px)`);
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
322
|
} else l.mode === "resize-right" ? (o.style.transform = "translateX(0px)", w.value[l.barIndex] && o.setAttribute("data-resize-px", String(t))) : l.mode === "resize-left" && (o.style.transform = `translateX(${t}px)`, w.value[l.barIndex] && o.setAttribute("data-resize-px", String(-t)));
|
|
320
|
-
if (
|
|
321
|
-
const e =
|
|
322
|
-
let a,
|
|
323
|
-
l.mode === "move" ? (a = y(l.origStart, e),
|
|
323
|
+
if (H.value && l.origStart && l.origEnd) {
|
|
324
|
+
const e = le(t), n = { month: "short", day: "numeric" };
|
|
325
|
+
let a, i;
|
|
326
|
+
l.mode === "move" ? (a = y(l.origStart, e), i = y(l.origEnd, e)) : l.mode === "resize-left" ? (a = y(l.origStart, e), i = l.origEnd) : (a = l.origStart, i = y(l.origEnd, e));
|
|
324
327
|
const f = w.value[l.barIndex];
|
|
325
328
|
if (f) {
|
|
326
329
|
const v = l.mode === "move" ? f.x + f.fullW / 2 + t : f.x + f.fullW / 2;
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
+
H.value.style.display = "";
|
|
331
|
+
const k = H.value.querySelector("rect"), S = H.value.querySelector("text");
|
|
332
|
+
k && (k.setAttribute("x", String(v - 62)), k.setAttribute("y", String(f.y - 20))), S && (S.setAttribute("x", String(v)), S.setAttribute("y", String(f.y - 10)), S.textContent = `${a.toLocaleDateString(s.locale, n)} — ${i.toLocaleDateString(s.locale, n)}`);
|
|
330
333
|
}
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
336
|
}
|
|
334
|
-
function
|
|
337
|
+
function ie() {
|
|
335
338
|
if (!l.active) return;
|
|
336
|
-
document.removeEventListener("mousemove",
|
|
337
|
-
const t =
|
|
339
|
+
document.removeEventListener("mousemove", re), document.removeEventListener("mouseup", ie), document.body.style.cursor = "", document.body.style.userSelect = "", cancelAnimationFrame(l.rafId);
|
|
340
|
+
const t = le(l.pxDelta), o = Math.round(t * 2) / 2;
|
|
338
341
|
if (Math.abs(o) > 0.1 && l.origStart && l.origEnd) {
|
|
339
342
|
const e = _.value.find((n) => n.id === l.taskId);
|
|
340
343
|
if (e) {
|
|
341
344
|
let n, a;
|
|
342
|
-
if (l.mode === "move" ? (n = y(l.origStart, o), a = y(l.origEnd, o)) : l.mode === "resize-left" ? (n = y(l.origStart, o), a = new Date(l.origEnd)) : (n = new Date(l.origStart), a = y(l.origEnd, o)),
|
|
343
|
-
for (const
|
|
344
|
-
const f = _.value.find((v) => v.id ===
|
|
345
|
-
f &&
|
|
345
|
+
if (l.mode === "move" ? (n = y(l.origStart, o), a = y(l.origEnd, o)) : l.mode === "resize-left" ? (n = y(l.origStart, o), a = new Date(l.origEnd)) : (n = new Date(l.origStart), a = y(l.origEnd, o)), A("task-update", e, { start: n, end: a }), l.mode === "move" && l.affectedIds.size > 0)
|
|
346
|
+
for (const i of l.affectedIds) {
|
|
347
|
+
const f = _.value.find((v) => v.id === i);
|
|
348
|
+
f && A("task-update", f, {
|
|
346
349
|
start: y(f._start, o),
|
|
347
350
|
end: y(f._end, o)
|
|
348
351
|
});
|
|
349
352
|
}
|
|
350
353
|
}
|
|
351
354
|
}
|
|
352
|
-
for (const e of
|
|
355
|
+
for (const e of K.value)
|
|
353
356
|
e && (e.style.transform = "", e.removeAttribute("data-resize-px"));
|
|
354
|
-
|
|
357
|
+
H.value && (H.value.style.display = "none"), l.active = !1, l.barIndex = -1, l.taskId = "", l.pxDelta = 0, l.origStart = null, l.origEnd = null, l.affectedIds.clear(), I.value = !1, q.value = "", B.value = null;
|
|
355
358
|
}
|
|
356
|
-
function
|
|
357
|
-
if (l.active || !
|
|
358
|
-
|
|
359
|
+
function $e(t, o) {
|
|
360
|
+
if (l.active || !s.draggable || o.task.milestone) {
|
|
361
|
+
U.value = l.active ? "grabbing" : "pointer";
|
|
359
362
|
return;
|
|
360
363
|
}
|
|
361
|
-
|
|
364
|
+
U.value = be(t, o) === "move" ? "grab" : "ew-resize";
|
|
362
365
|
}
|
|
363
|
-
const Q =
|
|
364
|
-
let
|
|
366
|
+
const Q = x(s.animate ? 0 : 1);
|
|
367
|
+
let ue = null;
|
|
365
368
|
function de() {
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}),
|
|
371
|
-
m.value = 1,
|
|
372
|
-
}),
|
|
373
|
-
|
|
374
|
-
}),
|
|
375
|
-
|
|
369
|
+
ue?.(), Q.value = 0, ue = dt(900, (t) => Q.value = t);
|
|
370
|
+
}
|
|
371
|
+
tt(() => {
|
|
372
|
+
Re(), s.animate && de();
|
|
373
|
+
}), ze(() => s.viewMode, () => {
|
|
374
|
+
m.value = 1, s.animate && de();
|
|
375
|
+
}), ze(() => s.tasks.length, () => {
|
|
376
|
+
s.animate && de();
|
|
377
|
+
}), ot(() => {
|
|
378
|
+
ue?.(), ee?.disconnect(), document.removeEventListener("mousemove", re), document.removeEventListener("mouseup", ie), cancelAnimationFrame(l.rafId);
|
|
376
379
|
});
|
|
377
|
-
function
|
|
378
|
-
const
|
|
379
|
-
return
|
|
380
|
+
function ce(t, o, e, n, a) {
|
|
381
|
+
const i = Math.min(a, e / 2, n / 2);
|
|
382
|
+
return i <= 0 || e <= 0 ? `M${t},${o}h${e}v${n}h${-e}Z` : `M${t + i},${o}h${e - 2 * i}q${i},0 ${i},${i}v${n - 2 * i}q0,${i} ${-i},${i}h${-(e - 2 * i)}q${-i},0 ${-i},${-i}v${-(n - 2 * i)}q0,${-i} ${i},${-i}Z`;
|
|
380
383
|
}
|
|
381
|
-
function
|
|
384
|
+
function Qe(t, o, e) {
|
|
382
385
|
return `M${t},${o - e}L${t + e},${o}L${t},${o + e}L${t - e},${o}Z`;
|
|
383
386
|
}
|
|
384
|
-
const g =
|
|
385
|
-
function
|
|
386
|
-
if (!
|
|
387
|
-
|
|
387
|
+
const g = x(null), B = x(null);
|
|
388
|
+
function Me(t, o) {
|
|
389
|
+
if (!s.showTooltip || l.active) return;
|
|
390
|
+
se.value = o, B.value = o;
|
|
388
391
|
const e = w.value[o];
|
|
389
392
|
if (!e) return;
|
|
390
|
-
|
|
393
|
+
A("task-hover", e.task);
|
|
391
394
|
const n = e.task;
|
|
392
395
|
g.value = {
|
|
393
396
|
x: t.clientX,
|
|
394
397
|
y: t.clientY,
|
|
395
398
|
task: n,
|
|
396
|
-
startStr: n._start.toLocaleDateString(
|
|
397
|
-
endStr: n._end.toLocaleDateString(
|
|
398
|
-
},
|
|
399
|
+
startStr: n._start.toLocaleDateString(s.locale, { month: "short", day: "numeric", year: "numeric" }),
|
|
400
|
+
endStr: n._end.toLocaleDateString(s.locale, { month: "short", day: "numeric", year: "numeric" })
|
|
401
|
+
}, $e(t, e);
|
|
399
402
|
}
|
|
400
403
|
function De(t, o) {
|
|
401
404
|
if (l.active) return;
|
|
402
405
|
g.value && (g.value = { ...g.value, x: t.clientX, y: t.clientY });
|
|
403
406
|
const e = w.value[o];
|
|
404
|
-
e &&
|
|
407
|
+
e && $e(t, e);
|
|
405
408
|
}
|
|
406
|
-
function
|
|
407
|
-
l.active || (g.value = null,
|
|
409
|
+
function Se() {
|
|
410
|
+
l.active || (g.value = null, B.value = null, se.value = null, U.value = "default", A("task-hover", null));
|
|
408
411
|
}
|
|
409
|
-
function
|
|
410
|
-
l.active ||
|
|
412
|
+
function ve(t) {
|
|
413
|
+
l.active || A("task-click", t);
|
|
411
414
|
}
|
|
412
|
-
const
|
|
413
|
-
function
|
|
414
|
-
|
|
415
|
+
const fe = x();
|
|
416
|
+
function Je(t) {
|
|
417
|
+
fe.value && (fe.value.scrollTop = t.target.scrollTop);
|
|
415
418
|
}
|
|
416
|
-
const
|
|
417
|
-
function
|
|
418
|
-
const e = Math.ceil(
|
|
419
|
+
const R = Math.random().toString(36).slice(2, 7);
|
|
420
|
+
function Ye(t, o) {
|
|
421
|
+
const e = Math.ceil(X(t, o));
|
|
419
422
|
if (e <= 1) return "1 day";
|
|
420
423
|
if (e < 7) return `${e} days`;
|
|
421
424
|
const n = Math.floor(e / 7), a = e % 7;
|
|
422
425
|
return a === 0 ? `${n} week${n > 1 ? "s" : ""}` : `${n}w ${a}d`;
|
|
423
426
|
}
|
|
424
|
-
return (t, o) => (
|
|
427
|
+
return (t, o) => (u(), d("div", {
|
|
425
428
|
ref_key: "containerRef",
|
|
426
|
-
ref:
|
|
429
|
+
ref: j,
|
|
427
430
|
class: "vlite-gantt-chart w-full select-none"
|
|
428
431
|
}, [
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
+
c.showTodayLine && V.value || c.zoom ? (u(), d("div", ct, [
|
|
433
|
+
c.zoom ? (u(), d("div", vt, [
|
|
434
|
+
r("button", {
|
|
432
435
|
class: "vlite-gantt-btn",
|
|
433
436
|
onClick: Ze,
|
|
434
437
|
disabled: m.value <= 0.4
|
|
435
438
|
}, [...o[0] || (o[0] = [
|
|
436
|
-
|
|
439
|
+
r("svg", {
|
|
437
440
|
width: "12",
|
|
438
441
|
height: "12",
|
|
439
442
|
viewBox: "0 0 24 24",
|
|
@@ -443,40 +446,40 @@ const ct = {
|
|
|
443
446
|
"stroke-linecap": "round",
|
|
444
447
|
"stroke-linejoin": "round"
|
|
445
448
|
}, [
|
|
446
|
-
|
|
449
|
+
r("circle", {
|
|
447
450
|
cx: "11",
|
|
448
451
|
cy: "11",
|
|
449
452
|
r: "8"
|
|
450
453
|
}),
|
|
451
|
-
|
|
454
|
+
r("line", {
|
|
452
455
|
x1: "21",
|
|
453
456
|
y1: "21",
|
|
454
457
|
x2: "16.65",
|
|
455
458
|
y2: "16.65"
|
|
456
459
|
}),
|
|
457
|
-
|
|
460
|
+
r("line", {
|
|
458
461
|
x1: "8",
|
|
459
462
|
y1: "11",
|
|
460
463
|
x2: "14",
|
|
461
464
|
y2: "11"
|
|
462
465
|
})
|
|
463
466
|
], -1),
|
|
464
|
-
|
|
465
|
-
])], 8,
|
|
466
|
-
|
|
467
|
+
r("span", null, "Zoom Out", -1)
|
|
468
|
+
])], 8, ft),
|
|
469
|
+
r("button", {
|
|
467
470
|
class: "vlite-gantt-btn",
|
|
468
|
-
onClick:
|
|
471
|
+
onClick: Fe,
|
|
469
472
|
disabled: m.value >= 3
|
|
470
473
|
}, [...o[1] || (o[1] = [
|
|
471
|
-
|
|
472
|
-
])], 8,
|
|
474
|
+
nt('<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-ebb84e3d><circle cx="11" cy="11" r="8" data-v-ebb84e3d></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-ebb84e3d></line><line x1="11" y1="8" x2="11" y2="14" data-v-ebb84e3d></line><line x1="8" y1="11" x2="14" y2="11" data-v-ebb84e3d></line></svg><span data-v-ebb84e3d>Zoom In</span>', 2)
|
|
475
|
+
])], 8, gt)
|
|
473
476
|
])) : h("", !0),
|
|
474
|
-
|
|
477
|
+
c.showTodayLine && V.value ? (u(), d("button", {
|
|
475
478
|
key: 1,
|
|
476
479
|
class: "vlite-gantt-btn",
|
|
477
|
-
onClick:
|
|
480
|
+
onClick: je
|
|
478
481
|
}, [...o[2] || (o[2] = [
|
|
479
|
-
|
|
482
|
+
r("svg", {
|
|
480
483
|
width: "12",
|
|
481
484
|
height: "12",
|
|
482
485
|
viewBox: "0 0 24 24",
|
|
@@ -486,57 +489,57 @@ const ct = {
|
|
|
486
489
|
"stroke-linecap": "round",
|
|
487
490
|
"stroke-linejoin": "round"
|
|
488
491
|
}, [
|
|
489
|
-
|
|
492
|
+
r("circle", {
|
|
490
493
|
cx: "12",
|
|
491
494
|
cy: "12",
|
|
492
495
|
r: "10"
|
|
493
496
|
}),
|
|
494
|
-
|
|
497
|
+
r("line", {
|
|
495
498
|
x1: "12",
|
|
496
499
|
y1: "8",
|
|
497
500
|
x2: "12",
|
|
498
501
|
y2: "12"
|
|
499
502
|
}),
|
|
500
|
-
|
|
503
|
+
r("line", {
|
|
501
504
|
x1: "12",
|
|
502
505
|
y1: "16",
|
|
503
506
|
x2: "12.01",
|
|
504
507
|
y2: "16"
|
|
505
508
|
})
|
|
506
509
|
], -1),
|
|
507
|
-
|
|
510
|
+
r("span", null, "Today", -1)
|
|
508
511
|
])])) : h("", !0)
|
|
509
512
|
])) : h("", !0),
|
|
510
|
-
|
|
511
|
-
|
|
513
|
+
r("div", ht, [
|
|
514
|
+
r("div", {
|
|
512
515
|
class: "vlite-gantt-sidebar",
|
|
513
|
-
style: D({ width: `${
|
|
516
|
+
style: D({ width: `${c.sidebarWidth}px`, minWidth: `${c.sidebarWidth}px` })
|
|
514
517
|
}, [
|
|
515
|
-
|
|
518
|
+
c.showHeader ? (u(), d("div", {
|
|
516
519
|
key: 0,
|
|
517
520
|
class: "vlite-gantt-sidebar-header",
|
|
518
|
-
style: D({ height: `${
|
|
521
|
+
style: D({ height: `${E.value}px` })
|
|
519
522
|
}, [...o[3] || (o[3] = [
|
|
520
|
-
|
|
523
|
+
r("span", { class: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, "Tasks", -1)
|
|
521
524
|
])], 4)) : h("", !0),
|
|
522
|
-
|
|
525
|
+
r("div", {
|
|
523
526
|
ref_key: "sidebarRef",
|
|
524
|
-
ref:
|
|
527
|
+
ref: fe,
|
|
525
528
|
class: "vlite-gantt-sidebar-body",
|
|
526
529
|
style: D({ height: `${O.value}px` })
|
|
527
530
|
}, [
|
|
528
|
-
(
|
|
531
|
+
(u(!0), d($, null, C(F.value, (e, n) => (u(), d("div", {
|
|
529
532
|
key: `s-${n}`,
|
|
530
533
|
class: "vlite-gantt-sidebar-row",
|
|
531
|
-
style: D({ height: `${
|
|
534
|
+
style: D({ height: `${c.rowHeight}px` })
|
|
532
535
|
}, [
|
|
533
|
-
e.type === "group-header" ? (
|
|
536
|
+
e.type === "group-header" ? (u(), d("button", {
|
|
534
537
|
key: 0,
|
|
535
538
|
class: "vlite-gantt-group-toggle",
|
|
536
|
-
onClick: (a) =>
|
|
539
|
+
onClick: (a) => Ae(e.group)
|
|
537
540
|
}, [
|
|
538
|
-
(
|
|
539
|
-
class:
|
|
541
|
+
(u(), d("svg", {
|
|
542
|
+
class: me(["vlite-gantt-chevron", { "vlite-gantt-chevron-collapsed": N.value.has(e.group) }]),
|
|
540
543
|
width: "14",
|
|
541
544
|
height: "14",
|
|
542
545
|
viewBox: "0 0 24 24",
|
|
@@ -546,127 +549,127 @@ const ct = {
|
|
|
546
549
|
"stroke-linecap": "round",
|
|
547
550
|
"stroke-linejoin": "round"
|
|
548
551
|
}, [...o[4] || (o[4] = [
|
|
549
|
-
|
|
552
|
+
r("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
550
553
|
])], 2)),
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
], 8,
|
|
554
|
+
r("span", mt, b(e.group), 1),
|
|
555
|
+
r("span", kt, b(te.value.grouped.get(e.group)?.length ?? 0), 1)
|
|
556
|
+
], 8, yt)) : (u(), d("div", {
|
|
554
557
|
key: 1,
|
|
555
|
-
class:
|
|
558
|
+
class: me(["vlite-gantt-task-name", {
|
|
556
559
|
"vlite-gantt-task-name-grouped": !!e.group,
|
|
557
|
-
"vlite-gantt-task-name-dragging":
|
|
560
|
+
"vlite-gantt-task-name-dragging": I.value && q.value === e.task?.id
|
|
558
561
|
}]),
|
|
559
|
-
onClick: (a) => e.task &&
|
|
562
|
+
onClick: (a) => e.task && ve(e.task)
|
|
560
563
|
}, [
|
|
561
|
-
|
|
564
|
+
r("span", {
|
|
562
565
|
class: "vlite-gantt-task-dot",
|
|
563
566
|
style: D({ backgroundColor: e.task?._color })
|
|
564
567
|
}, null, 4),
|
|
565
|
-
|
|
566
|
-
|
|
568
|
+
r("span", pt, b(e.task?.name), 1),
|
|
569
|
+
c.showProgress && e.task?.progress != null ? (u(), d("span", wt, b(e.task.progress) + "%", 1)) : h("", !0)
|
|
567
570
|
], 10, xt))
|
|
568
571
|
], 4))), 128))
|
|
569
572
|
], 4)
|
|
570
573
|
], 4),
|
|
571
|
-
|
|
574
|
+
r("div", {
|
|
572
575
|
ref_key: "timelineRef",
|
|
573
|
-
ref:
|
|
576
|
+
ref: L,
|
|
574
577
|
class: "vlite-gantt-timeline",
|
|
575
|
-
onScroll:
|
|
576
|
-
onWheel:
|
|
578
|
+
onScroll: Je,
|
|
579
|
+
onWheel: Pe
|
|
577
580
|
}, [
|
|
578
|
-
|
|
581
|
+
c.showHeader ? (u(), d("div", {
|
|
579
582
|
key: 0,
|
|
580
583
|
class: "vlite-gantt-timeline-header",
|
|
581
|
-
style: D({ height: `${
|
|
584
|
+
style: D({ height: `${E.value}px`, width: `${Z.value}px` })
|
|
582
585
|
}, [
|
|
583
|
-
(
|
|
584
|
-
width:
|
|
585
|
-
height:
|
|
586
|
+
(u(), d("svg", {
|
|
587
|
+
width: Z.value,
|
|
588
|
+
height: E.value,
|
|
586
589
|
class: "overflow-visible"
|
|
587
590
|
}, [
|
|
588
|
-
(
|
|
589
|
-
|
|
591
|
+
(u(!0), d($, null, C(pe.value, (e, n) => (u(), d("g", { key: n }, [
|
|
592
|
+
r("line", {
|
|
590
593
|
x1: e.x,
|
|
591
594
|
y1: 0,
|
|
592
595
|
x2: e.x,
|
|
593
|
-
y2:
|
|
596
|
+
y2: E.value,
|
|
594
597
|
stroke: "currentColor",
|
|
595
598
|
"stroke-opacity": "0.06"
|
|
596
|
-
}, null, 8,
|
|
597
|
-
|
|
599
|
+
}, null, 8, $t),
|
|
600
|
+
r("text", {
|
|
598
601
|
x: e.x + e.width / 2,
|
|
599
|
-
y:
|
|
602
|
+
y: E.value / 2 - 5,
|
|
600
603
|
"text-anchor": "middle",
|
|
601
604
|
"dominant-baseline": "middle",
|
|
602
605
|
"font-size": "11",
|
|
603
606
|
"font-weight": "600",
|
|
604
607
|
class: "fill-foreground"
|
|
605
|
-
}, b(e.label), 9,
|
|
606
|
-
e.sublabel ? (
|
|
608
|
+
}, b(e.label), 9, Mt),
|
|
609
|
+
e.sublabel ? (u(), d("text", {
|
|
607
610
|
key: 0,
|
|
608
611
|
x: e.x + e.width / 2,
|
|
609
|
-
y:
|
|
612
|
+
y: E.value / 2 + 11,
|
|
610
613
|
"text-anchor": "middle",
|
|
611
614
|
"dominant-baseline": "middle",
|
|
612
615
|
"font-size": "10",
|
|
613
616
|
class: "fill-muted-foreground"
|
|
614
617
|
}, b(e.sublabel), 9, Dt)) : h("", !0)
|
|
615
618
|
]))), 128))
|
|
616
|
-
], 8,
|
|
619
|
+
], 8, bt))
|
|
617
620
|
], 4)) : h("", !0),
|
|
618
|
-
|
|
621
|
+
r("div", {
|
|
619
622
|
class: "vlite-gantt-timeline-body",
|
|
620
623
|
style: D({ height: `${O.value}px` })
|
|
621
624
|
}, [
|
|
622
|
-
(
|
|
623
|
-
width:
|
|
625
|
+
(u(), d("svg", {
|
|
626
|
+
width: Z.value,
|
|
624
627
|
height: O.value,
|
|
625
628
|
role: "img",
|
|
626
629
|
"aria-label": "Gantt chart",
|
|
627
630
|
class: "overflow-visible"
|
|
628
631
|
}, [
|
|
629
|
-
|
|
630
|
-
(
|
|
632
|
+
r("defs", null, [
|
|
633
|
+
(u(!0), d($, null, C(w.value, (e, n) => (u(), d("linearGradient", {
|
|
631
634
|
key: `g${n}`,
|
|
632
|
-
id: `gg-${
|
|
635
|
+
id: `gg-${z(R)}-${n}`,
|
|
633
636
|
x1: "0",
|
|
634
637
|
y1: "0",
|
|
635
638
|
x2: "1",
|
|
636
639
|
y2: "0"
|
|
637
640
|
}, [
|
|
638
|
-
|
|
641
|
+
r("stop", {
|
|
639
642
|
offset: "0%",
|
|
640
643
|
"stop-color": e.task._color,
|
|
641
644
|
"stop-opacity": "1"
|
|
642
645
|
}, null, 8, Lt),
|
|
643
|
-
|
|
646
|
+
r("stop", {
|
|
644
647
|
offset: "100%",
|
|
645
648
|
"stop-color": e.task._color,
|
|
646
649
|
"stop-opacity": "0.75"
|
|
647
|
-
}, null, 8,
|
|
648
|
-
], 8,
|
|
649
|
-
(
|
|
650
|
+
}, null, 8, _t)
|
|
651
|
+
], 8, Ct))), 128)),
|
|
652
|
+
(u(!0), d($, null, C(w.value, (e, n) => (u(), d("linearGradient", {
|
|
650
653
|
key: `p${n}`,
|
|
651
|
-
id: `gp-${
|
|
654
|
+
id: `gp-${z(R)}-${n}`,
|
|
652
655
|
x1: "0",
|
|
653
656
|
y1: "0",
|
|
654
657
|
x2: "1",
|
|
655
658
|
y2: "0"
|
|
656
659
|
}, [
|
|
657
|
-
|
|
660
|
+
r("stop", {
|
|
658
661
|
offset: "0%",
|
|
659
662
|
"stop-color": e.task._color,
|
|
660
663
|
"stop-opacity": "0.35"
|
|
661
|
-
}, null, 8,
|
|
662
|
-
|
|
664
|
+
}, null, 8, zt),
|
|
665
|
+
r("stop", {
|
|
663
666
|
offset: "100%",
|
|
664
667
|
"stop-color": e.task._color,
|
|
665
668
|
"stop-opacity": "0.15"
|
|
666
|
-
}, null, 8,
|
|
667
|
-
], 8,
|
|
669
|
+
}, null, 8, Wt)
|
|
670
|
+
], 8, Ht))), 128))
|
|
668
671
|
]),
|
|
669
|
-
|
|
672
|
+
c.showGrid ? (u(!0), d($, { key: 0 }, C(pe.value, (e, n) => (u(), d("line", {
|
|
670
673
|
key: n,
|
|
671
674
|
x1: e.x,
|
|
672
675
|
y1: 0,
|
|
@@ -675,148 +678,148 @@ const ct = {
|
|
|
675
678
|
stroke: "currentColor",
|
|
676
679
|
"stroke-opacity": "0.06",
|
|
677
680
|
"stroke-dasharray": "4 4"
|
|
678
|
-
}, null, 8,
|
|
679
|
-
(
|
|
681
|
+
}, null, 8, Tt))), 128)) : h("", !0),
|
|
682
|
+
(u(!0), d($, null, C(F.value, (e, n) => (u(), d("line", {
|
|
680
683
|
key: n,
|
|
681
684
|
x1: 0,
|
|
682
|
-
y1: (n + 1) *
|
|
683
|
-
x2:
|
|
684
|
-
y2: (n + 1) *
|
|
685
|
+
y1: (n + 1) * c.rowHeight,
|
|
686
|
+
x2: Z.value,
|
|
687
|
+
y2: (n + 1) * c.rowHeight,
|
|
685
688
|
stroke: "currentColor",
|
|
686
689
|
"stroke-opacity": "0.04"
|
|
687
|
-
}, null, 8,
|
|
688
|
-
(
|
|
690
|
+
}, null, 8, Et))), 128)),
|
|
691
|
+
(u(!0), d($, null, C(F.value, (e, n) => lt((u(), d("rect", {
|
|
689
692
|
key: `bg${n}`,
|
|
690
693
|
x: 0,
|
|
691
|
-
y: n *
|
|
692
|
-
width:
|
|
693
|
-
height:
|
|
694
|
+
y: n * c.rowHeight,
|
|
695
|
+
width: Z.value,
|
|
696
|
+
height: c.rowHeight,
|
|
694
697
|
fill: "currentColor",
|
|
695
698
|
"fill-opacity": "0.02"
|
|
696
|
-
}, null, 8,
|
|
697
|
-
[
|
|
699
|
+
}, null, 8, It)), [
|
|
700
|
+
[at, e.type === "group-header"]
|
|
698
701
|
])), 128)),
|
|
699
|
-
(
|
|
702
|
+
(u(!0), d($, null, C(Ge.value, (e, n) => (u(), d("g", {
|
|
700
703
|
key: n,
|
|
701
704
|
class: "vlite-gantt-dep-group"
|
|
702
705
|
}, [
|
|
703
|
-
|
|
706
|
+
r("path", {
|
|
704
707
|
d: e.d,
|
|
705
708
|
stroke: "var(--color-muted-foreground)",
|
|
706
709
|
"stroke-width": "1.5",
|
|
707
710
|
"stroke-opacity": "0.35",
|
|
708
711
|
fill: "none",
|
|
709
712
|
"stroke-linejoin": "round"
|
|
710
|
-
}, null, 8,
|
|
711
|
-
|
|
713
|
+
}, null, 8, Bt),
|
|
714
|
+
r("path", {
|
|
712
715
|
d: e.ad,
|
|
713
716
|
fill: "var(--color-muted-foreground)",
|
|
714
717
|
"fill-opacity": "0.5"
|
|
715
|
-
}, null, 8,
|
|
718
|
+
}, null, 8, Rt)
|
|
716
719
|
]))), 128)),
|
|
717
|
-
(
|
|
720
|
+
(u(!0), d($, null, C(w.value, (e, n) => (u(), d("g", {
|
|
718
721
|
key: e.task.id,
|
|
719
722
|
ref_for: !0,
|
|
720
|
-
ref: (a) =>
|
|
721
|
-
class:
|
|
723
|
+
ref: (a) => Ne(a, n),
|
|
724
|
+
class: me({ "vlite-gantt-bar-dragging": I.value && (q.value === e.task.id || z(l).affectedIds.has(e.task.id)) })
|
|
722
725
|
}, [
|
|
723
|
-
e.task.milestone ? (
|
|
726
|
+
e.task.milestone ? (u(), d("path", {
|
|
724
727
|
key: 0,
|
|
725
|
-
d:
|
|
726
|
-
fill: `url(#gg-${
|
|
728
|
+
d: Qe(e.x + e.fullW / 2, e.y + c.barHeight / 2, c.barHeight * 0.4),
|
|
729
|
+
fill: `url(#gg-${z(R)}-${n})`,
|
|
727
730
|
stroke: e.task._color,
|
|
728
731
|
"stroke-width": "1.5",
|
|
729
732
|
"stroke-opacity": "0.6",
|
|
730
733
|
class: "cursor-pointer",
|
|
731
|
-
opacity:
|
|
732
|
-
onMouseenter: (a) =>
|
|
734
|
+
opacity: B.value === n ? 0.9 : 1,
|
|
735
|
+
onMouseenter: (a) => Me(a, n),
|
|
733
736
|
onMousemove: (a) => De(a, n),
|
|
734
|
-
onMouseleave:
|
|
735
|
-
onClick: (a) =>
|
|
736
|
-
}, null, 40,
|
|
737
|
-
|
|
738
|
-
d:
|
|
739
|
-
fill: `url(#gp-${
|
|
737
|
+
onMouseleave: Se,
|
|
738
|
+
onClick: (a) => ve(e.task)
|
|
739
|
+
}, null, 40, At)) : (u(), d($, { key: 1 }, [
|
|
740
|
+
r("path", {
|
|
741
|
+
d: ce(e.x, e.y, e.fullW, c.barHeight, c.barRadius),
|
|
742
|
+
fill: `url(#gp-${z(R)}-${n})`,
|
|
740
743
|
class: "pointer-events-none"
|
|
741
|
-
}, null, 8,
|
|
742
|
-
|
|
744
|
+
}, null, 8, Pt),
|
|
745
|
+
c.showProgress && e.progressW > 0 ? (u(), d("path", {
|
|
743
746
|
key: 0,
|
|
744
|
-
d:
|
|
745
|
-
fill: `url(#gg-${
|
|
747
|
+
d: ce(e.x, e.y, Math.min(e.progressW, e.fullW), c.barHeight, c.barRadius),
|
|
748
|
+
fill: `url(#gg-${z(R)}-${n})`,
|
|
746
749
|
class: "pointer-events-none"
|
|
747
|
-
}, null, 8,
|
|
748
|
-
|
|
750
|
+
}, null, 8, Ft)) : h("", !0),
|
|
751
|
+
c.showProgress ? h("", !0) : (u(), d("path", {
|
|
749
752
|
key: 1,
|
|
750
|
-
d:
|
|
751
|
-
fill: `url(#gg-${
|
|
753
|
+
d: ce(e.x, e.y, e.w, c.barHeight, c.barRadius),
|
|
754
|
+
fill: `url(#gg-${z(R)}-${n})`,
|
|
752
755
|
class: "pointer-events-none"
|
|
753
756
|
}, null, 8, Zt)),
|
|
754
|
-
|
|
757
|
+
r("rect", {
|
|
755
758
|
x: e.x,
|
|
756
759
|
y: e.y,
|
|
757
760
|
width: e.fullW,
|
|
758
|
-
height:
|
|
761
|
+
height: c.barHeight,
|
|
759
762
|
fill: "transparent",
|
|
760
|
-
style: D({ cursor:
|
|
761
|
-
onMouseenter: (a) =>
|
|
763
|
+
style: D({ cursor: U.value }),
|
|
764
|
+
onMouseenter: (a) => Me(a, n),
|
|
762
765
|
onMousemove: (a) => De(a, n),
|
|
763
|
-
onMouseleave:
|
|
764
|
-
onMousedown: (a) =>
|
|
765
|
-
onClick: (a) =>
|
|
766
|
+
onMouseleave: Se,
|
|
767
|
+
onMousedown: (a) => Ue(a, n),
|
|
768
|
+
onClick: (a) => ve(e.task)
|
|
766
769
|
}, null, 44, Ot),
|
|
767
|
-
|
|
770
|
+
B.value === n ? (u(), d("rect", {
|
|
768
771
|
key: 2,
|
|
769
772
|
x: e.x,
|
|
770
773
|
y: e.y,
|
|
771
774
|
width: e.fullW,
|
|
772
|
-
height:
|
|
773
|
-
rx:
|
|
774
|
-
ry:
|
|
775
|
+
height: c.barHeight,
|
|
776
|
+
rx: c.barRadius,
|
|
777
|
+
ry: c.barRadius,
|
|
775
778
|
fill: "currentColor",
|
|
776
779
|
"fill-opacity": "0.06",
|
|
777
780
|
class: "pointer-events-none"
|
|
778
|
-
}, null, 8,
|
|
779
|
-
|
|
780
|
-
|
|
781
|
+
}, null, 8, Gt)) : h("", !0),
|
|
782
|
+
c.draggable && !e.task.milestone && (se.value === n || I.value && q.value === e.task.id) ? (u(), d($, { key: 3 }, [
|
|
783
|
+
r("rect", {
|
|
781
784
|
x: e.x,
|
|
782
785
|
y: e.y + 4,
|
|
783
786
|
width: "4",
|
|
784
|
-
height:
|
|
787
|
+
height: c.barHeight - 8,
|
|
785
788
|
rx: "2",
|
|
786
789
|
fill: "currentColor",
|
|
787
790
|
"fill-opacity": "0.4",
|
|
788
791
|
class: "pointer-events-none"
|
|
789
|
-
}, null, 8,
|
|
790
|
-
|
|
792
|
+
}, null, 8, qt),
|
|
793
|
+
r("rect", {
|
|
791
794
|
x: e.x + e.fullW - 4,
|
|
792
795
|
y: e.y + 4,
|
|
793
796
|
width: "4",
|
|
794
|
-
height:
|
|
797
|
+
height: c.barHeight - 8,
|
|
795
798
|
rx: "2",
|
|
796
799
|
fill: "currentColor",
|
|
797
800
|
"fill-opacity": "0.4",
|
|
798
801
|
class: "pointer-events-none"
|
|
799
|
-
}, null, 8,
|
|
802
|
+
}, null, 8, Xt)
|
|
800
803
|
], 64)) : h("", !0),
|
|
801
|
-
|
|
804
|
+
c.showLabels && e.fullW > 60 ? (u(), d("text", {
|
|
802
805
|
key: 4,
|
|
803
806
|
x: e.x + 12,
|
|
804
|
-
y: e.y +
|
|
807
|
+
y: e.y + c.barHeight / 2,
|
|
805
808
|
"dominant-baseline": "middle",
|
|
806
809
|
"font-size": "11",
|
|
807
810
|
"font-weight": "600",
|
|
808
|
-
fill:
|
|
811
|
+
fill: c.showProgress ? "currentColor" : "white",
|
|
809
812
|
opacity: Q.value > 0.3 ? 0.85 : 0,
|
|
810
813
|
class: "pointer-events-none"
|
|
811
|
-
}, b(e.task.name), 9,
|
|
814
|
+
}, b(e.task.name), 9, jt)) : h("", !0)
|
|
812
815
|
], 64))
|
|
813
816
|
], 2))), 128)),
|
|
814
|
-
|
|
817
|
+
r("g", {
|
|
815
818
|
ref_key: "dragLabelRef",
|
|
816
|
-
ref:
|
|
819
|
+
ref: H,
|
|
817
820
|
style: { display: "none" }
|
|
818
821
|
}, [...o[5] || (o[5] = [
|
|
819
|
-
|
|
822
|
+
r("rect", {
|
|
820
823
|
x: "0",
|
|
821
824
|
y: "0",
|
|
822
825
|
width: "124",
|
|
@@ -825,7 +828,7 @@ const ct = {
|
|
|
825
828
|
fill: "var(--color-foreground)",
|
|
826
829
|
"fill-opacity": "0.85"
|
|
827
830
|
}, null, -1),
|
|
828
|
-
|
|
831
|
+
r("text", {
|
|
829
832
|
x: "0",
|
|
830
833
|
y: "0",
|
|
831
834
|
"text-anchor": "middle",
|
|
@@ -835,56 +838,56 @@ const ct = {
|
|
|
835
838
|
fill: "var(--color-background)"
|
|
836
839
|
}, null, -1)
|
|
837
840
|
])], 512),
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
x1:
|
|
841
|
+
c.showTodayLine && V.value ? (u(), d("g", Nt, [
|
|
842
|
+
r("line", {
|
|
843
|
+
x1: G.value,
|
|
841
844
|
y1: 0,
|
|
842
|
-
x2:
|
|
845
|
+
x2: G.value,
|
|
843
846
|
y2: O.value,
|
|
844
|
-
stroke:
|
|
847
|
+
stroke: c.todayColor,
|
|
845
848
|
"stroke-width": "2",
|
|
846
849
|
"stroke-opacity": "0.7",
|
|
847
850
|
"stroke-dasharray": "6 3"
|
|
848
|
-
}, null, 8,
|
|
849
|
-
|
|
850
|
-
cx:
|
|
851
|
+
}, null, 8, Vt),
|
|
852
|
+
r("circle", {
|
|
853
|
+
cx: G.value,
|
|
851
854
|
cy: 0,
|
|
852
855
|
r: "4",
|
|
853
|
-
fill:
|
|
856
|
+
fill: c.todayColor,
|
|
854
857
|
"fill-opacity": "0.9"
|
|
855
|
-
}, null, 8,
|
|
856
|
-
|
|
857
|
-
x:
|
|
858
|
+
}, null, 8, Ut),
|
|
859
|
+
r("text", {
|
|
860
|
+
x: G.value,
|
|
858
861
|
y: -8,
|
|
859
862
|
"text-anchor": "middle",
|
|
860
863
|
"font-size": "9",
|
|
861
864
|
"font-weight": "700",
|
|
862
|
-
fill:
|
|
865
|
+
fill: c.todayColor,
|
|
863
866
|
"fill-opacity": "0.9"
|
|
864
867
|
}, "TODAY", 8, Kt)
|
|
865
868
|
])) : h("", !0)
|
|
866
|
-
], 8,
|
|
869
|
+
], 8, St))
|
|
867
870
|
], 4)
|
|
868
871
|
], 544)
|
|
869
872
|
]),
|
|
870
|
-
(
|
|
871
|
-
g.value && !
|
|
873
|
+
(u(), st(rt, { to: "body" }, [
|
|
874
|
+
g.value && !I.value ? (u(), d("div", {
|
|
872
875
|
key: 0,
|
|
873
876
|
class: "vlite-chart-tooltip",
|
|
874
877
|
style: D({ left: `${g.value.x + 14}px`, top: `${g.value.y - 12}px` })
|
|
875
878
|
}, [
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
+
r("div", Qt, b(g.value.task.name), 1),
|
|
880
|
+
r("div", Jt, [
|
|
881
|
+
r("span", {
|
|
879
882
|
class: "w-2 h-2 rounded-sm shrink-0",
|
|
880
883
|
style: D({ backgroundColor: g.value.task._color ?? g.value.task.color })
|
|
881
884
|
}, null, 4),
|
|
882
|
-
|
|
885
|
+
r("span", null, b(g.value.startStr) + " — " + b(g.value.endStr), 1)
|
|
883
886
|
]),
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
887
|
+
r("div", Yt, b(Ye(g.value.task._start, g.value.task._end)), 1),
|
|
888
|
+
c.showProgress && g.value.task.progress != null ? (u(), d("div", eo, [
|
|
889
|
+
r("div", to, [
|
|
890
|
+
r("div", {
|
|
888
891
|
class: "vlite-gantt-tooltip-progress-fill",
|
|
889
892
|
style: D({
|
|
890
893
|
width: `${g.value.task.progress}%`,
|
|
@@ -892,13 +895,13 @@ const ct = {
|
|
|
892
895
|
})
|
|
893
896
|
}, null, 4)
|
|
894
897
|
]),
|
|
895
|
-
|
|
898
|
+
r("span", oo, b(g.value.task.progress) + "%", 1)
|
|
896
899
|
])) : h("", !0),
|
|
897
|
-
g.value.task.group ? (
|
|
898
|
-
|
|
899
|
-
o[6] || (o[6] =
|
|
900
|
-
|
|
901
|
-
|
|
900
|
+
g.value.task.group ? (u(), d("div", no, b(g.value.task.group), 1)) : h("", !0),
|
|
901
|
+
c.draggable && !g.value.task.milestone ? (u(), d("div", lo, [
|
|
902
|
+
o[6] || (o[6] = We(" Drag to move · Edges to resize ", -1)),
|
|
903
|
+
c.cascadeDependencies ? (u(), d($, { key: 0 }, [
|
|
904
|
+
We(" · Dependents follow")
|
|
902
905
|
], 64)) : h("", !0)
|
|
903
906
|
])) : h("", !0)
|
|
904
907
|
], 4)) : h("", !0)
|
|
@@ -907,5 +910,5 @@ const ct = {
|
|
|
907
910
|
}
|
|
908
911
|
});
|
|
909
912
|
export {
|
|
910
|
-
|
|
913
|
+
uo as default
|
|
911
914
|
};
|