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