@m3ui-vue/m3ui-vue 1.4.4 → 1.5.0
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/dist/API.md +29 -7
- package/dist/{MButton-D7M324r9.js → MButton-D_uxtJa-.js} +2 -2
- package/dist/{MButton-D7M324r9.js.map → MButton-D_uxtJa-.js.map} +1 -1
- package/dist/{MDialog-DuOnNF9s.js → MDialog-DT4KAPmn.js} +2 -2
- package/dist/{MDialog-DuOnNF9s.js.map → MDialog-DT4KAPmn.js.map} +1 -1
- package/dist/{MListItem-Bb84X6ex.js → MListItem-CwYrxpPZ.js} +2 -2
- package/dist/{MListItem-Bb84X6ex.js.map → MListItem-CwYrxpPZ.js.map} +1 -1
- package/dist/{MLoadingIndicator-BUGRo2Tu.js → MLoadingIndicator-DhzECYRI.js} +2 -2
- package/dist/{MLoadingIndicator-BUGRo2Tu.js.map → MLoadingIndicator-DhzECYRI.js.map} +1 -1
- package/dist/{MSeekBar-BQUvUqb9.js → MSeekBar-DQPF5FTp.js} +2 -2
- package/dist/{MSeekBar-BQUvUqb9.js.map → MSeekBar-DQPF5FTp.js.map} +1 -1
- package/dist/{MSlider-SFdjE1Hy.js → MSlider-BvoMZTy9.js} +2 -2
- package/dist/{MSlider-SFdjE1Hy.js.map → MSlider-BvoMZTy9.js.map} +1 -1
- package/dist/{MSpinner-DKGNN64_.js → MSpinner-CgcCQhS9.js} +2 -2
- package/dist/{MSpinner-DKGNN64_.js.map → MSpinner-CgcCQhS9.js.map} +1 -1
- package/dist/{MTextField-Utsef6Kk.js → MTextField-B72dwF6V.js} +2 -2
- package/dist/{MTextField-Utsef6Kk.js.map → MTextField-B72dwF6V.js.map} +1 -1
- package/dist/{MTooltip-BhTFQ9Z2.js → MTooltip-YyF1CO75.js} +4 -4
- package/dist/{MTooltip-BhTFQ9Z2.js.map → MTooltip-YyF1CO75.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MGantt.vue.d.ts +11 -6
- package/dist/components/MGanttControls.vue.d.ts +9 -3
- package/dist/components/MResourceTimeline.vue.d.ts +4 -4
- package/dist/components/MTreeTable.vue.d.ts +1 -1
- package/dist/components/_MTimeSplitter.vue.d.ts +10 -0
- package/dist/composables/_dragCursor.d.ts +2 -0
- package/dist/composables/_useTimeAxis.d.ts +5 -1
- package/dist/composables/useGantt.d.ts +13 -0
- package/dist/composables/useLocale.d.ts +3 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +1608 -1422
- package/dist/gantt.js.map +1 -1
- package/dist/locales/index.js +21 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10 -10
- package/dist/map.js +5 -5
- package/dist/media.js +4 -4
- package/dist/pdf.js +4 -4
- package/dist/rich-text-editor.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/{useLocale-B8YKWg-H.js → useLocale-DLcG3qPC.js} +4 -1
- package/dist/useLocale-DLcG3qPC.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MGantt.test.ts +105 -0
- package/src/__tests__/MResourceTimeline.test.ts +16 -0
- package/src/components/MGantt.vue +138 -43
- package/src/components/MGanttControls.vue +36 -8
- package/src/components/MResourceTimeline.vue +59 -24
- package/src/components/_MTimeHeader.vue +3 -2
- package/src/components/_MTimeSplitter.vue +37 -0
- package/src/composables/_dragCursor.ts +15 -0
- package/src/composables/_ganttTime.ts +2 -1
- package/src/composables/_useTimeAxis.ts +10 -3
- package/src/composables/useGantt.ts +13 -0
- package/src/composables/useLocale.ts +6 -0
- package/src/locales/de.ts +3 -0
- package/src/locales/es.ts +3 -0
- package/src/locales/fr.ts +3 -0
- package/src/locales/ja.ts +3 -0
- package/src/locales/ko.ts +3 -0
- package/src/locales/pt.ts +3 -0
- package/src/locales/zh.ts +3 -0
- package/dist/useLocale-B8YKWg-H.js.map +0 -1
package/dist/gantt.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-DLcG3qPC.js";
|
|
2
2
|
import { f as t, l as n, t as r, u as i } from "./MIconButton-DoNotQ9v.js";
|
|
3
3
|
import { t as a } from "./MSegmentedButton-DL9JtJFX.js";
|
|
4
4
|
import { t as o } from "./flowPaths-CcWOKY4Z.js";
|
|
5
|
-
import { Fragment as s, Teleport as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, inject as _, nextTick as
|
|
5
|
+
import { Fragment as s, Teleport as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, inject as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as ee, onBeforeUpdate as te, onMounted as ne, onUpdated as re, openBlock as x, provide as ie, ref as S, renderList as C, renderSlot as ae, shallowRef as oe, toDisplayString as w, toRaw as se, unref as T, useSlots as ce, vModelText as le, watch as E, withDirectives as ue, withKeys as de, withModifiers as fe } from "vue";
|
|
6
6
|
//#region src/composables/useGantt.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let e = _(
|
|
7
|
+
var pe = Symbol("m3-gantt"), me = Symbol("m3-timeline-controls");
|
|
8
|
+
function D() {
|
|
9
|
+
let e = _(pe, null);
|
|
10
10
|
if (!e) throw Error("useGantt() must be called inside <MGantt>");
|
|
11
11
|
return e;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/composables/_ganttTime.ts
|
|
15
|
-
var
|
|
15
|
+
var he = 36e5, O = 864e5, k = [
|
|
16
16
|
"hour",
|
|
17
17
|
"day",
|
|
18
18
|
"week",
|
|
19
19
|
"month",
|
|
20
20
|
"quarter",
|
|
21
21
|
"year"
|
|
22
|
-
],
|
|
23
|
-
function
|
|
24
|
-
return !!e &&
|
|
22
|
+
], ge = /^\d{4}-\d{2}-\d{2}$/;
|
|
23
|
+
function A(e) {
|
|
24
|
+
return !!e && ge.test(e);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function j(e) {
|
|
27
27
|
if (!e) return NaN;
|
|
28
|
-
if (
|
|
28
|
+
if (ge.test(e)) {
|
|
29
29
|
let [t, n, r] = e.split("-").map(Number);
|
|
30
30
|
return new Date(t, n - 1, r).getTime();
|
|
31
31
|
}
|
|
@@ -36,29 +36,29 @@ function k(e) {
|
|
|
36
36
|
}
|
|
37
37
|
return Date.parse(e);
|
|
38
38
|
}
|
|
39
|
-
var
|
|
40
|
-
function
|
|
41
|
-
let n = new Date(e), r = `${n.getFullYear()}-${
|
|
39
|
+
var _e = (e) => String(e).padStart(2, "0");
|
|
40
|
+
function M(e, t) {
|
|
41
|
+
let n = new Date(e), r = `${n.getFullYear()}-${_e(n.getMonth() + 1)}-${_e(n.getDate())}`;
|
|
42
42
|
if (t) return r;
|
|
43
43
|
let i = n.getSeconds();
|
|
44
|
-
return `${r}T${
|
|
44
|
+
return `${r}T${_e(n.getHours())}:${_e(n.getMinutes())}${i ? `:${_e(i)}` : ""}`;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function N(e) {
|
|
47
47
|
let t = new Date(e);
|
|
48
48
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function P(e, t) {
|
|
51
51
|
let n = new Date(e);
|
|
52
52
|
return n.setDate(n.getDate() + t), n.getTime();
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return Math.round((
|
|
54
|
+
function ve(e, t) {
|
|
55
|
+
return Math.round((N(t) - N(e)) / O);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function F(e, t, n = 1) {
|
|
58
58
|
let r = new Date(e);
|
|
59
59
|
switch (t) {
|
|
60
60
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours()).getTime();
|
|
61
|
-
case "day": return
|
|
61
|
+
case "day": return N(e);
|
|
62
62
|
case "week": {
|
|
63
63
|
let e = (r.getDay() - n + 7) % 7;
|
|
64
64
|
return new Date(r.getFullYear(), r.getMonth(), r.getDate() - e).getTime();
|
|
@@ -68,88 +68,88 @@ function P(e, t, n = 1) {
|
|
|
68
68
|
case "year": return new Date(r.getFullYear(), 0, 1).getTime();
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ye(e, t, n = 1) {
|
|
72
72
|
let r = new Date(e);
|
|
73
73
|
switch (t) {
|
|
74
74
|
case "hour": return new Date(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours() + n).getTime();
|
|
75
|
-
case "day": return
|
|
76
|
-
case "week": return
|
|
75
|
+
case "day": return P(e, 1);
|
|
76
|
+
case "week": return P(e, 7);
|
|
77
77
|
case "month": return new Date(r.getFullYear(), r.getMonth() + 1, 1).getTime();
|
|
78
78
|
case "quarter": return new Date(r.getFullYear(), r.getMonth() + 3, 1).getTime();
|
|
79
79
|
case "year": return new Date(r.getFullYear() + 1, 0, 1).getTime();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function be(e, t) {
|
|
83
83
|
if (t >= 1440) {
|
|
84
|
-
let n = Math.round(t / 1440), r =
|
|
85
|
-
return n <= 1 ? r :
|
|
84
|
+
let n = Math.round(t / 1440), r = N(e + 12 * he);
|
|
85
|
+
return n <= 1 ? r : P(r, -((ve(0, r) % n + n) % n));
|
|
86
86
|
}
|
|
87
|
-
let n = t * 6e4, r =
|
|
87
|
+
let n = t * 6e4, r = N(e);
|
|
88
88
|
return r + Math.round((e - r) / n) * n;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
90
|
+
var xe = {
|
|
91
91
|
hour: 1152,
|
|
92
92
|
day: 40,
|
|
93
93
|
week: 20,
|
|
94
94
|
month: 5,
|
|
95
95
|
quarter: 1.2,
|
|
96
96
|
year: .3
|
|
97
|
-
},
|
|
97
|
+
}, Se = {
|
|
98
98
|
hour: 1 / 24,
|
|
99
99
|
day: 1,
|
|
100
100
|
week: 7,
|
|
101
101
|
month: 30.44,
|
|
102
102
|
quarter: 91.3,
|
|
103
103
|
year: 365.25
|
|
104
|
-
},
|
|
104
|
+
}, Ce = {
|
|
105
105
|
hour: 36,
|
|
106
106
|
day: 26,
|
|
107
107
|
week: 52,
|
|
108
108
|
month: 44,
|
|
109
109
|
quarter: 36,
|
|
110
110
|
year: 44
|
|
111
|
-
},
|
|
111
|
+
}, I = {
|
|
112
112
|
hour: "day",
|
|
113
113
|
day: "month",
|
|
114
114
|
week: "month",
|
|
115
115
|
month: "year",
|
|
116
116
|
quarter: "year",
|
|
117
117
|
year: null
|
|
118
|
-
},
|
|
118
|
+
}, we = [
|
|
119
119
|
1,
|
|
120
120
|
2,
|
|
121
121
|
3,
|
|
122
122
|
6,
|
|
123
123
|
12
|
|
124
124
|
];
|
|
125
|
-
function
|
|
126
|
-
let t =
|
|
125
|
+
function Te(e) {
|
|
126
|
+
let t = we.find((t) => t * e / 24 >= Ce.hour);
|
|
127
127
|
if (t) return {
|
|
128
128
|
bottom: "hour",
|
|
129
129
|
top: "day",
|
|
130
130
|
step: t
|
|
131
131
|
};
|
|
132
|
-
let n =
|
|
132
|
+
let n = k.find((t) => t !== "hour" && Se[t] * e >= Ce[t]) ?? "year";
|
|
133
133
|
return {
|
|
134
134
|
bottom: n,
|
|
135
|
-
top:
|
|
135
|
+
top: I[n],
|
|
136
136
|
step: 1
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Ee(e) {
|
|
140
140
|
let t = "day", n = Infinity;
|
|
141
|
-
for (let r of
|
|
142
|
-
let i = Math.abs(Math.log(
|
|
141
|
+
for (let r of k) {
|
|
142
|
+
let i = Math.abs(Math.log(xe[r] / e));
|
|
143
143
|
i < n && (n = i, t = r);
|
|
144
144
|
}
|
|
145
145
|
return t;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
let o = [], s =
|
|
149
|
-
for (n === "hour" && i > 1 && (s -= new Date(s).getHours() % i *
|
|
147
|
+
function De(e, t, n, r = 1, i = 1, a = 2e3) {
|
|
148
|
+
let o = [], s = F(e, n, r);
|
|
149
|
+
for (n === "hour" && i > 1 && (s -= new Date(s).getHours() % i * he); s < t && o.length < a; s = ye(s, n, i)) o.push(s);
|
|
150
150
|
return o;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function L(e, t, n, r, i, a = !1) {
|
|
153
153
|
let o = new Date(e), s = (e) => new Intl.DateTimeFormat(r, e).format(o);
|
|
154
154
|
switch (t) {
|
|
155
155
|
case "hour": return s({ hour: "numeric" });
|
|
@@ -166,23 +166,23 @@ function I(e, t, n, r, i, a = !1) {
|
|
|
166
166
|
day: "numeric"
|
|
167
167
|
});
|
|
168
168
|
case "month": return s(a ? {
|
|
169
|
-
month: "long",
|
|
169
|
+
month: n >= 160 ? "long" : "short",
|
|
170
170
|
year: "numeric"
|
|
171
171
|
} : { month: n >= 90 ? "long" : "short" });
|
|
172
172
|
case "quarter": return i.replace("{n}", String(Math.floor(o.getMonth() / 3) + 1));
|
|
173
173
|
case "year": return s({ year: "numeric" });
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Oe(e) {
|
|
177
177
|
let t = e / 24;
|
|
178
178
|
return t >= 120 ? 5 : t >= 40 ? 15 : t >= 16 ? 30 : t >= 4 ? 60 : 1440;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
return t.includes(new Date(e).getDay()) && !n.has(
|
|
180
|
+
function R(e, t, n) {
|
|
181
|
+
return t.includes(new Date(e).getDay()) && !n.has(M(e, !0));
|
|
182
182
|
}
|
|
183
183
|
//#endregion
|
|
184
184
|
//#region src/composables/ganttSchedule.ts
|
|
185
|
-
function
|
|
185
|
+
function ke(e) {
|
|
186
186
|
return typeof e == "string" ? {
|
|
187
187
|
id: e,
|
|
188
188
|
type: "FS",
|
|
@@ -193,50 +193,50 @@ function Ae(e) {
|
|
|
193
193
|
lag: e.lag ?? 0
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Ae(e) {
|
|
197
197
|
let t = new Set(e.map((e) => e.id)), n = /* @__PURE__ */ new Set();
|
|
198
198
|
for (let r of e) r.parentId && t.has(r.parentId) && n.add(r.parentId);
|
|
199
199
|
for (let t of e) t.type === "summary" && n.add(t.id);
|
|
200
200
|
return n;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function z(e) {
|
|
203
203
|
return e.type === "milestone" || !e.end && e.type !== "summary";
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
let t =
|
|
205
|
+
function B(e) {
|
|
206
|
+
let t = j(e.start), n = A(e.start);
|
|
207
207
|
if (e.type === "milestone" || !e.end) return {
|
|
208
208
|
start: t,
|
|
209
209
|
end: t,
|
|
210
210
|
dateOnly: n
|
|
211
211
|
};
|
|
212
|
-
let r =
|
|
212
|
+
let r = j(e.end), i = A(e.end) ? P(N(r), 1) : r;
|
|
213
213
|
return {
|
|
214
214
|
start: t,
|
|
215
215
|
end: Math.max(t, i),
|
|
216
216
|
dateOnly: n
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
let r =
|
|
221
|
-
if (e.type === "milestone" || !e.end) return { start:
|
|
219
|
+
function je(e, t, n) {
|
|
220
|
+
let r = A(e.start);
|
|
221
|
+
if (e.type === "milestone" || !e.end) return { start: M(r ? N(t) : t, r) };
|
|
222
222
|
if (r) {
|
|
223
|
-
let e =
|
|
223
|
+
let e = N(t), r = Math.max(e, N(n - 1));
|
|
224
224
|
return {
|
|
225
|
-
start:
|
|
226
|
-
end:
|
|
225
|
+
start: M(e, !0),
|
|
226
|
+
end: M(r, !0)
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
return {
|
|
230
|
-
start:
|
|
231
|
-
end:
|
|
230
|
+
start: M(t, !1),
|
|
231
|
+
end: M(Math.max(t, n), !1)
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
let t =
|
|
236
|
-
return t.dateOnly ?
|
|
234
|
+
function V(e) {
|
|
235
|
+
let t = B(e);
|
|
236
|
+
return t.dateOnly ? ve(t.start, t.end) : (t.end - t.start) / O;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
let t =
|
|
238
|
+
function Me(e) {
|
|
239
|
+
let t = Ae(e);
|
|
240
240
|
if (!t.size) return e;
|
|
241
241
|
let n = /* @__PURE__ */ new Map();
|
|
242
242
|
for (let r of e) r.parentId && t.has(r.parentId) && (n.get(r.parentId) ?? n.set(r.parentId, []).get(r.parentId)).push(r);
|
|
@@ -247,19 +247,19 @@ function Ne(e) {
|
|
|
247
247
|
i.add(e.id);
|
|
248
248
|
let o = Infinity, s = -Infinity, c = !0, l = 0, u = 0;
|
|
249
249
|
for (let t of n.get(e.id)) {
|
|
250
|
-
let e = a(t), n =
|
|
250
|
+
let e = a(t), n = B(e);
|
|
251
251
|
if (!Number.isFinite(n.start)) continue;
|
|
252
252
|
o = Math.min(o, n.start), s = Math.max(s, n.end), n.dateOnly || (c = !1);
|
|
253
|
-
let r = Math.max(n.end - n.start, +!
|
|
253
|
+
let r = Math.max(n.end - n.start, +!z(e));
|
|
254
254
|
l += r, u += r * (e.progress ?? 0);
|
|
255
255
|
}
|
|
256
256
|
if (i.delete(e.id), !Number.isFinite(o)) return e;
|
|
257
257
|
let d = c ? {
|
|
258
|
-
start:
|
|
259
|
-
end:
|
|
258
|
+
start: M(o, !0),
|
|
259
|
+
end: M(Math.max(o, N(s - 1)), !0)
|
|
260
260
|
} : {
|
|
261
|
-
start:
|
|
262
|
-
end:
|
|
261
|
+
start: M(o, !1),
|
|
262
|
+
end: M(s, !1)
|
|
263
263
|
}, f = l ? Math.round(u / l) : e.progress ?? 0, p = d.start === e.start && d.end === e.end && f === (e.progress ?? 0) ? e : {
|
|
264
264
|
...e,
|
|
265
265
|
start: d.start,
|
|
@@ -273,7 +273,7 @@ function Ne(e) {
|
|
|
273
273
|
});
|
|
274
274
|
return o ? s : e;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function H(e) {
|
|
277
277
|
return {
|
|
278
278
|
days: e?.workingDays ?? [
|
|
279
279
|
1,
|
|
@@ -285,26 +285,26 @@ function V(e) {
|
|
|
285
285
|
holidays: new Set(e?.holidays ?? [])
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
let r =
|
|
290
|
-
for (let t =
|
|
288
|
+
function Ne(e, t, n) {
|
|
289
|
+
let r = H(n), i = 0, a = N(j(t));
|
|
290
|
+
for (let t = N(j(e)); t <= a; t = P(t, 1)) R(t, r.days, r.holidays) && i++;
|
|
291
291
|
return i;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
let r =
|
|
293
|
+
function U(e, t, n) {
|
|
294
|
+
let r = H(n);
|
|
295
295
|
if (!r.days.length) return e;
|
|
296
|
-
let i =
|
|
297
|
-
for (; !
|
|
296
|
+
let i = N(j(e));
|
|
297
|
+
for (; !R(i, r.days, r.holidays);) i = P(i, 1);
|
|
298
298
|
let a = t < 0 ? -1 : 1;
|
|
299
|
-
for (let e = Math.abs(t); e > 0;) i =
|
|
300
|
-
return
|
|
299
|
+
for (let e = Math.abs(t); e > 0;) i = P(i, a), R(i, r.days, r.holidays) && e--;
|
|
300
|
+
return M(i, !0);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
let t = new Map(e.map((e) => [e.id, e])), n =
|
|
302
|
+
function W(e) {
|
|
303
|
+
let t = new Map(e.map((e) => [e.id, e])), n = Ae(e), r = /* @__PURE__ */ new Map();
|
|
304
304
|
for (let n of e) n.parentId && t.has(n.parentId) && (r.get(n.parentId) ?? r.set(n.parentId, []).get(n.parentId)).push(n.id);
|
|
305
305
|
let i = (e, t = 0) => n.has(e) && r.has(e) && t < 100 ? r.get(e).flatMap((e) => i(e, t + 1)) : [e], a = [];
|
|
306
306
|
for (let n of e) for (let e of n.dependencies ?? []) {
|
|
307
|
-
let r =
|
|
307
|
+
let r = ke(e);
|
|
308
308
|
if (t.has(r.id) && r.id !== n.id) for (let e of i(n.id)) a.push({
|
|
309
309
|
pred: r.id,
|
|
310
310
|
succ: e,
|
|
@@ -321,7 +321,7 @@ function U(e) {
|
|
|
321
321
|
links: a
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function G(e, t) {
|
|
325
325
|
let n = [], r = /* @__PURE__ */ new Map(), i = (e) => {
|
|
326
326
|
if (!r.get(e)) {
|
|
327
327
|
r.set(e, 1);
|
|
@@ -332,9 +332,9 @@ function W(e, t) {
|
|
|
332
332
|
for (let t of e) i(t);
|
|
333
333
|
return n;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
let { sums: n, kids: r, leaves: i, links: a } =
|
|
337
|
-
for (let t of e) n.has(t.id) || s.set(t.id,
|
|
335
|
+
function Pe(e, t = {}) {
|
|
336
|
+
let { sums: n, kids: r, leaves: i, links: a } = W(e), o = t.calendar ? H(t.calendar) : null, s = /* @__PURE__ */ new Map();
|
|
337
|
+
for (let t of e) n.has(t.id) || s.set(t.id, B(t));
|
|
338
338
|
let c = /* @__PURE__ */ new Map();
|
|
339
339
|
for (let e of a) (c.get(e.succ) ?? c.set(e.succ, []).get(e.succ)).push(e.pred);
|
|
340
340
|
for (let e of n) c.set(e, [...c.get(e) ?? [], ...i(e)]);
|
|
@@ -352,12 +352,12 @@ function Fe(e, t = {}) {
|
|
|
352
352
|
end: r,
|
|
353
353
|
dateOnly: !0
|
|
354
354
|
} : void 0;
|
|
355
|
-
}, d = (e, n, r) => !o || !r ? e + n *
|
|
355
|
+
}, d = (e, n, r) => !o || !r ? e + n * O : j(U(M(e, !0), n, t.calendar)), f = (e) => {
|
|
356
356
|
let t = 0;
|
|
357
|
-
for (let n = e.start; n < e.end; n =
|
|
357
|
+
for (let n = e.start; n < e.end; n = P(n, 1)) R(n, o.days, o.holidays) && t++;
|
|
358
358
|
return t;
|
|
359
359
|
}, p = !1;
|
|
360
|
-
for (let e of
|
|
360
|
+
for (let e of G([...s.keys(), ...n], c)) {
|
|
361
361
|
if (n.has(e)) continue;
|
|
362
362
|
let r = s.get(e), i = l.get(e);
|
|
363
363
|
if (!i?.length || !Number.isFinite(r.start)) continue;
|
|
@@ -370,30 +370,30 @@ function Fe(e, t = {}) {
|
|
|
370
370
|
}
|
|
371
371
|
if (!Number.isFinite(c)) continue;
|
|
372
372
|
let m = t.mode === "asap" ? c : Math.max(r.start, c);
|
|
373
|
-
r.dateOnly && (m =
|
|
373
|
+
r.dateOnly && (m = N(m + 432e5));
|
|
374
374
|
let h = m + a;
|
|
375
375
|
if (o && r.dateOnly) {
|
|
376
376
|
let e = f(r);
|
|
377
|
-
m =
|
|
378
|
-
} else r.dateOnly && (h =
|
|
377
|
+
m = j(U(M(m, !0), 0, t.calendar)), h = e ? P(j(U(M(m, !0), Math.max(0, e - 1), t.calendar)), 1) : m;
|
|
378
|
+
} else r.dateOnly && (h = P(m, ve(r.start, r.end)));
|
|
379
379
|
(m !== r.start || h !== r.end) && (s.set(e, {
|
|
380
380
|
start: m,
|
|
381
381
|
end: h,
|
|
382
382
|
dateOnly: r.dateOnly
|
|
383
383
|
}), p = !0);
|
|
384
384
|
}
|
|
385
|
-
return
|
|
385
|
+
return Me(p ? e.map((e) => {
|
|
386
386
|
if (n.has(e.id) && r.has(e.id)) return e;
|
|
387
|
-
let t = s.get(e.id), i =
|
|
387
|
+
let t = s.get(e.id), i = B(e);
|
|
388
388
|
return !t || t.start === i.start && t.end === i.end ? e : {
|
|
389
389
|
...e,
|
|
390
|
-
...
|
|
390
|
+
...je(e, t.start, t.end)
|
|
391
391
|
};
|
|
392
392
|
}) : e);
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
let { sums: n, kids: r, leaves: i, links: a } =
|
|
396
|
-
for (let t of e) (!n.has(t.id) || !r.has(t.id)) && o.set(t.id,
|
|
394
|
+
function Fe(e, t = {}) {
|
|
395
|
+
let { sums: n, kids: r, leaves: i, links: a } = W(e), o = /* @__PURE__ */ new Map();
|
|
396
|
+
for (let t of e) (!n.has(t.id) || !r.has(t.id)) && o.set(t.id, B(t));
|
|
397
397
|
let s = [...o.keys()].filter((e) => Number.isFinite(o.get(e).start));
|
|
398
398
|
if (!s.length) return {
|
|
399
399
|
tasks: [],
|
|
@@ -401,18 +401,18 @@ function Ie(e, t = {}) {
|
|
|
401
401
|
slack: {},
|
|
402
402
|
finish: ""
|
|
403
403
|
};
|
|
404
|
-
let c = t.calendar ?
|
|
404
|
+
let c = t.calendar ? H(t.calendar) : null, l = (e) => e / O;
|
|
405
405
|
if (c) {
|
|
406
|
-
let e =
|
|
406
|
+
let e = N(Math.min(...s.map((e) => o.get(e).start))), t = /* @__PURE__ */ new Map();
|
|
407
407
|
l = (n) => {
|
|
408
|
-
let r =
|
|
408
|
+
let r = N(n), i = t.get(r);
|
|
409
409
|
if (i === void 0) {
|
|
410
410
|
i = 0;
|
|
411
411
|
let n = r >= e ? 1 : -1;
|
|
412
|
-
for (let t = e; t !== r; t =
|
|
412
|
+
for (let t = e; t !== r; t = P(t, n)) R(n > 0 ? t : P(t, -1), c.days, c.holidays) && (i += n);
|
|
413
413
|
t.set(r, i);
|
|
414
414
|
}
|
|
415
|
-
return i + (
|
|
415
|
+
return i + (R(r, c.days, c.holidays) ? (n - r) / O : 0);
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
418
|
let u = new Map(s.map((e) => [e, {
|
|
@@ -424,7 +424,7 @@ function Ie(e, t = {}) {
|
|
|
424
424
|
})) : [e]).filter((e) => u.has(e.pred) && u.has(e.succ)), f = Math.max(...s.map((e) => u.get(e).end)), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
425
425
|
for (let e of d) (p.get(e.pred) ?? p.set(e.pred, []).get(e.pred)).push(e), (m.get(e.succ) ?? m.set(e.succ, []).get(e.succ)).push(e.pred);
|
|
426
426
|
let h = /* @__PURE__ */ new Map();
|
|
427
|
-
for (let e of
|
|
427
|
+
for (let e of G(s, m).reverse()) {
|
|
428
428
|
let t = u.get(e), n = t.end - t.start, r = f;
|
|
429
429
|
for (let t of p.get(e) ?? []) {
|
|
430
430
|
let e = h.get(t.succ);
|
|
@@ -439,116 +439,120 @@ function Ie(e, t = {}) {
|
|
|
439
439
|
let t = h.get(e) - u.get(e).start;
|
|
440
440
|
g[e] = Math.round(t * 1e3) / 1e3, t < 1e-6 && _.add(e);
|
|
441
441
|
}
|
|
442
|
-
let
|
|
442
|
+
let v = /* @__PURE__ */ new Set();
|
|
443
443
|
for (let e of d) {
|
|
444
444
|
if (!_.has(e.pred) || !_.has(e.succ)) continue;
|
|
445
445
|
let t = u.get(e.pred), n = u.get(e.succ), r = (e.type === "FS" || e.type === "FF" ? t.end : t.start) + e.lag, i = e.type === "FS" || e.type === "SS" ? n.start : n.end;
|
|
446
|
-
Math.abs(i - r) < 1e-6 &&
|
|
446
|
+
Math.abs(i - r) < 1e-6 && v.add(e.key);
|
|
447
447
|
}
|
|
448
448
|
for (let e of n) r.has(e) && i(e).some((e) => _.has(e)) && _.add(e);
|
|
449
|
-
let
|
|
449
|
+
let y = Math.max(...s.map((e) => o.get(e).end)), b = e.find((e) => o.get(e.id)?.end === y);
|
|
450
450
|
return {
|
|
451
451
|
tasks: e.filter((e) => _.has(e.id)).map((e) => e.id),
|
|
452
|
-
dependencies: [...
|
|
452
|
+
dependencies: [...v],
|
|
453
453
|
slack: g,
|
|
454
|
-
finish:
|
|
454
|
+
finish: M(A(b?.start) ? P(y, -1) : y, A(b?.start))
|
|
455
455
|
};
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
458
|
//#region src/composables/_useTimeAxis.ts
|
|
459
|
-
function
|
|
460
|
-
let t = (t) => Math.min(e.maxPxPerDay(), Math.max(e.minPxPerDay(), t)), n =
|
|
461
|
-
|
|
459
|
+
function Ie(e) {
|
|
460
|
+
let t = (t) => Math.min(e.maxPxPerDay(), Math.max(e.minPxPerDay(), t)), n = S(t(e.pxPerDay() ?? xe[e.scale()])), r = l(() => Ee(n.value)), a = r.value;
|
|
461
|
+
E(r, (t) => {
|
|
462
462
|
t !== a && (a = t, e.onScale(t));
|
|
463
|
-
}),
|
|
464
|
-
e !== a && (a = e,
|
|
463
|
+
}), E(e.scale, (e) => {
|
|
464
|
+
e !== a && (a = e, re(xe[e]));
|
|
465
465
|
});
|
|
466
|
-
let o =
|
|
466
|
+
let o = S({
|
|
467
467
|
left: 0,
|
|
468
468
|
top: 0,
|
|
469
469
|
width: 0,
|
|
470
470
|
height: 0
|
|
471
|
-
}), s = l(() => Math.max(0, o.value.width - e.listWidth.value)), c =
|
|
471
|
+
}), s = l(() => Math.max(0, o.value.width - e.listWidth.value)), c = S(Date.now()), u, d = l(() => {
|
|
472
472
|
let t = e.today();
|
|
473
|
-
return t === null ? null : t ?
|
|
474
|
-
}), f = l(() => Math.max(14, (s.value || 800) / n.value)), p =
|
|
473
|
+
return t === null ? null : t ? j(t) : c.value;
|
|
474
|
+
}), f = l(() => Math.max(14, (s.value || 800) / n.value)), p = S(0), m = l(() => Math.max((e.extent.value.max - p.value) / O + f.value, s.value / n.value)), h = l(() => m.value * n.value);
|
|
475
475
|
function g() {
|
|
476
|
-
let t =
|
|
476
|
+
let t = N(P(e.extent.value.min, -Math.ceil(f.value)));
|
|
477
477
|
if (!p.value) {
|
|
478
478
|
p.value = t;
|
|
479
479
|
return;
|
|
480
480
|
}
|
|
481
|
-
let r = t - p.value > 3 * f.value *
|
|
481
|
+
let r = t - p.value > 3 * f.value * O;
|
|
482
482
|
if (t < p.value || r) {
|
|
483
|
-
let r = (p.value - t) /
|
|
483
|
+
let r = (p.value - t) / O * n.value;
|
|
484
484
|
p.value = t;
|
|
485
485
|
let i = e.scroller.value;
|
|
486
486
|
i && (i.scrollLeft += r, o.value.left = i.scrollLeft);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
|
|
490
|
-
let _ = (e) => (e - p.value) /
|
|
491
|
-
function
|
|
489
|
+
E([e.extent, f], g, { immediate: !0 });
|
|
490
|
+
let _ = (e) => (e - p.value) / O * n.value, y = (e) => p.value + e / n.value * O, b = 0, te = null;
|
|
491
|
+
function re(r, a, c = !0, l) {
|
|
492
492
|
r = t(r);
|
|
493
|
-
let
|
|
493
|
+
let u = a ?? s.value / 2, d = l ?? y(o.value.left + u);
|
|
494
494
|
if (!c || i() || !e.scroller.value) {
|
|
495
|
-
cancelAnimationFrame(
|
|
495
|
+
cancelAnimationFrame(b), b = 0, te = null, x(r, u, d);
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
|
-
if (
|
|
498
|
+
if (te = {
|
|
499
499
|
z: Math.log(n.value),
|
|
500
|
-
v:
|
|
500
|
+
v: te?.v ?? 0,
|
|
501
501
|
target: Math.log(r),
|
|
502
|
-
anchor:
|
|
503
|
-
at:
|
|
504
|
-
},
|
|
505
|
-
let
|
|
506
|
-
let t =
|
|
507
|
-
for (
|
|
502
|
+
anchor: u,
|
|
503
|
+
at: d
|
|
504
|
+
}, b) return;
|
|
505
|
+
let f = performance.now(), p = (e) => {
|
|
506
|
+
let t = te, n = Math.min((e - f) / 1e3, 1 / 30);
|
|
507
|
+
for (f = e; n > 0;) {
|
|
508
508
|
let e = Math.min(n, .004);
|
|
509
509
|
t.v += (-700 * (t.z - t.target) - 1.8 * Math.sqrt(700) * t.v) * e, t.z += t.v * e, n -= e;
|
|
510
510
|
}
|
|
511
511
|
let r = Math.abs(t.z - t.target) < .001 && Math.abs(t.v) < .01;
|
|
512
|
-
if (
|
|
513
|
-
|
|
512
|
+
if (x(Math.exp(r ? t.target : t.z), t.anchor, t.at), r) {
|
|
513
|
+
b = 0, te = null;
|
|
514
514
|
return;
|
|
515
515
|
}
|
|
516
|
-
|
|
516
|
+
b = requestAnimationFrame(p);
|
|
517
517
|
};
|
|
518
|
-
|
|
518
|
+
b = requestAnimationFrame(p);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function x(t, r, i) {
|
|
521
521
|
n.value = t, g();
|
|
522
522
|
let a = Math.max(0, _(i) - r);
|
|
523
|
-
o.value.left = a,
|
|
523
|
+
o.value.left = a, v(() => {
|
|
524
524
|
e.scroller.value && (e.scroller.value.scrollLeft = a);
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
let
|
|
528
|
-
function
|
|
529
|
-
let
|
|
527
|
+
let ie = () => te ? Math.exp(te.target) : n.value, C = () => re(ie() * 1.6), ae = () => re(ie() / 1.6), oe = (e) => re(xe[e]);
|
|
528
|
+
function w(e, t = 24) {
|
|
529
|
+
let n = Math.max((e.max - e.min) / O, 1 / 24);
|
|
530
|
+
re(Math.max(40, s.value - 2 * t) / n, s.value / 2, !1, (e.min + e.max) / 2);
|
|
531
|
+
}
|
|
532
|
+
function se(t, n = {}) {
|
|
533
|
+
let r = t ? j(t) : Date.now(), a = _(r) - (n.align === "start" ? 24 : s.value / 2);
|
|
530
534
|
e.scroller.value?.scrollTo({
|
|
531
535
|
left: Math.max(0, a),
|
|
532
536
|
behavior: n.animate === !1 || i() ? "auto" : "smooth"
|
|
533
537
|
});
|
|
534
538
|
}
|
|
535
|
-
let
|
|
539
|
+
let T = l(() => Te(n.value)), ce = l(() => y(o.value.left - 200)), le = l(() => y(o.value.left + s.value + 200));
|
|
536
540
|
function ue(t, n) {
|
|
537
|
-
let r = n ? 1 :
|
|
538
|
-
return
|
|
539
|
-
let a = _(i), o = _(
|
|
541
|
+
let r = n ? 1 : T.value.step;
|
|
542
|
+
return De(ce.value, le.value, t, e.weekStartsOn(), r).map((i) => {
|
|
543
|
+
let a = _(i), o = _(ye(i, t, r)) - a;
|
|
540
544
|
return {
|
|
541
545
|
key: i,
|
|
542
546
|
x: a,
|
|
543
547
|
w: o,
|
|
544
|
-
label:
|
|
548
|
+
label: L(i, t, o, e.lang.value, e.quarterLabel(), n)
|
|
545
549
|
};
|
|
546
550
|
});
|
|
547
551
|
}
|
|
548
|
-
let
|
|
552
|
+
let de = l(() => ue(T.value.bottom, !1)), fe = l(() => T.value.top ? ue(T.value.top, !0).map((e) => ({
|
|
549
553
|
...e,
|
|
550
554
|
labelX: Math.max(0, Math.min(o.value.left - e.x, e.w - 80))
|
|
551
|
-
})) : []),
|
|
555
|
+
})) : []), pe = l(() => ({
|
|
552
556
|
days: e.calendar()?.workingDays ?? [
|
|
553
557
|
1,
|
|
554
558
|
2,
|
|
@@ -557,13 +561,13 @@ function Le(e) {
|
|
|
557
561
|
5
|
|
558
562
|
],
|
|
559
563
|
holidays: new Set(e.calendar()?.holidays ?? [])
|
|
560
|
-
})),
|
|
564
|
+
})), me = l(() => {
|
|
561
565
|
let t = [];
|
|
562
566
|
if (n.value < 6) return t;
|
|
563
567
|
let r = e.workHours?.();
|
|
564
|
-
for (let e =
|
|
565
|
-
let i =
|
|
566
|
-
if (!
|
|
568
|
+
for (let e = N(ce.value); e < le.value; e = P(e, 1)) {
|
|
569
|
+
let i = P(e, 1);
|
|
570
|
+
if (!R(e, pe.value.days, pe.value.holidays)) t.push({
|
|
567
571
|
x: _(e),
|
|
568
572
|
w: _(i) - _(e)
|
|
569
573
|
});
|
|
@@ -580,33 +584,33 @@ function Le(e) {
|
|
|
580
584
|
}
|
|
581
585
|
return t;
|
|
582
586
|
});
|
|
583
|
-
function
|
|
587
|
+
function D(t) {
|
|
584
588
|
if (!t.ctrlKey && !t.metaKey) return;
|
|
585
589
|
t.preventDefault();
|
|
586
590
|
let r = e.scroller.value.getBoundingClientRect(), i = t.clientX - r.left - e.listWidth.value;
|
|
587
|
-
i < 0 ||
|
|
591
|
+
i < 0 || re(n.value * Math.exp(-t.deltaY * .002 * (t.deltaMode === 1 ? 16 : 1)), i, !1);
|
|
588
592
|
}
|
|
589
|
-
let
|
|
590
|
-
function
|
|
593
|
+
let he = null, k = () => !!he;
|
|
594
|
+
function ge(t) {
|
|
591
595
|
if (t.touches.length !== 2) return;
|
|
592
596
|
e.onPinch?.();
|
|
593
597
|
let [r, i] = [t.touches[0], t.touches[1]], a = e.scroller.value.getBoundingClientRect();
|
|
594
|
-
|
|
598
|
+
he = {
|
|
595
599
|
dist: Math.hypot(r.clientX - i.clientX, r.clientY - i.clientY) || 1,
|
|
596
600
|
z: n.value,
|
|
597
601
|
anchor: (r.clientX + i.clientX) / 2 - a.left - e.listWidth.value
|
|
598
602
|
};
|
|
599
603
|
}
|
|
600
|
-
function
|
|
601
|
-
if (!
|
|
604
|
+
function A(e) {
|
|
605
|
+
if (!he || e.touches.length !== 2) return !1;
|
|
602
606
|
e.cancelable && e.preventDefault();
|
|
603
607
|
let [t, n] = [e.touches[0], e.touches[1]];
|
|
604
|
-
return
|
|
608
|
+
return re(he.z * (Math.hypot(t.clientX - n.clientX, t.clientY - n.clientY) / he.dist), he.anchor, !1), !0;
|
|
605
609
|
}
|
|
606
|
-
function
|
|
607
|
-
e.touches.length < 2 && (
|
|
610
|
+
function _e(e) {
|
|
611
|
+
e.touches.length < 2 && (he = null);
|
|
608
612
|
}
|
|
609
|
-
function
|
|
613
|
+
function M() {
|
|
610
614
|
let t = e.scroller.value;
|
|
611
615
|
t && (o.value = {
|
|
612
616
|
left: t.scrollLeft,
|
|
@@ -615,14 +619,14 @@ function Le(e) {
|
|
|
615
619
|
height: t.clientHeight
|
|
616
620
|
});
|
|
617
621
|
}
|
|
618
|
-
let
|
|
619
|
-
return
|
|
622
|
+
let ve;
|
|
623
|
+
return ne(() => {
|
|
620
624
|
let t = e.scroller.value;
|
|
621
|
-
t.addEventListener("wheel",
|
|
625
|
+
t.addEventListener("wheel", D, { passive: !1 }), M(), ve = new ResizeObserver(M), ve.observe(t), e.today() !== null && (u = setInterval(() => {
|
|
622
626
|
c.value = Date.now();
|
|
623
627
|
}, 6e4));
|
|
624
|
-
}),
|
|
625
|
-
e.scroller.value?.removeEventListener("wheel",
|
|
628
|
+
}), ee(() => {
|
|
629
|
+
e.scroller.value?.removeEventListener("wheel", D), ve?.disconnect(), cancelAnimationFrame(b), clearInterval(u);
|
|
626
630
|
}), {
|
|
627
631
|
ppd: n,
|
|
628
632
|
scaleNow: r,
|
|
@@ -632,26 +636,37 @@ function Le(e) {
|
|
|
632
636
|
timelineWidth: h,
|
|
633
637
|
todayMs: d,
|
|
634
638
|
xOf: _,
|
|
635
|
-
timeAt:
|
|
636
|
-
zoomTo:
|
|
637
|
-
zoomIn:
|
|
638
|
-
zoomOut:
|
|
639
|
-
setScale:
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
639
|
+
timeAt: y,
|
|
640
|
+
zoomTo: re,
|
|
641
|
+
zoomIn: C,
|
|
642
|
+
zoomOut: ae,
|
|
643
|
+
setScale: oe,
|
|
644
|
+
fit: w,
|
|
645
|
+
scrollToDate: se,
|
|
646
|
+
units: T,
|
|
647
|
+
topCells: fe,
|
|
648
|
+
bottomCells: de,
|
|
649
|
+
offTimes: me,
|
|
650
|
+
onTouchStart: ge,
|
|
651
|
+
pinchMove: A,
|
|
652
|
+
onTouchEnd: _e,
|
|
653
|
+
pinching: k,
|
|
654
|
+
readView: M
|
|
650
655
|
};
|
|
651
656
|
}
|
|
652
657
|
//#endregion
|
|
658
|
+
//#region src/composables/_dragCursor.ts
|
|
659
|
+
function Le(e) {
|
|
660
|
+
let t = document.body;
|
|
661
|
+
t.style.cursor = e, t.style.userSelect = "none", t.classList.add("m3-drag-cursor");
|
|
662
|
+
}
|
|
663
|
+
function Re() {
|
|
664
|
+
let e = document.body;
|
|
665
|
+
e.style.cursor = "", e.style.userSelect = "", e.classList.remove("m3-drag-cursor");
|
|
666
|
+
}
|
|
667
|
+
//#endregion
|
|
653
668
|
//#region src/components/_MTimeHeader.vue?vue&type=script&setup=true&lang.ts
|
|
654
|
-
var
|
|
669
|
+
var ze = { class: "absolute inset-x-0 top-0 h-7" }, K = { class: "absolute inset-x-0 bottom-0 h-7" }, Be = /* @__PURE__ */ g({
|
|
655
670
|
__name: "_MTimeHeader",
|
|
656
671
|
props: {
|
|
657
672
|
width: {},
|
|
@@ -660,38 +675,41 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
660
675
|
todayX: {}
|
|
661
676
|
},
|
|
662
677
|
setup(e) {
|
|
663
|
-
return (t, n) => (
|
|
678
|
+
return (t, n) => (x(), f("div", {
|
|
664
679
|
class: "relative shrink-0 border-b border-outline-variant bg-surface-container-low",
|
|
665
|
-
style:
|
|
680
|
+
style: b({ width: `${e.width}px` }),
|
|
666
681
|
"aria-hidden": "true"
|
|
667
682
|
}, [
|
|
668
|
-
p("div",
|
|
683
|
+
p("div", ze, [(x(!0), f(s, null, C(e.topCells, (e) => (x(), f("div", {
|
|
669
684
|
key: e.key,
|
|
670
|
-
class: "absolute inset-y-0 border-l border-outline-variant/60",
|
|
671
|
-
style:
|
|
685
|
+
class: "absolute inset-y-0 overflow-hidden border-l border-outline-variant/60",
|
|
686
|
+
style: b({
|
|
672
687
|
left: `${e.x}px`,
|
|
673
688
|
width: `${e.w}px`
|
|
674
689
|
})
|
|
675
690
|
}, [p("span", {
|
|
676
691
|
class: "absolute top-1.5 truncate pl-2 text-label-medium whitespace-nowrap text-on-surface",
|
|
677
|
-
style:
|
|
678
|
-
|
|
679
|
-
|
|
692
|
+
style: b({
|
|
693
|
+
left: `${e.labelX}px`,
|
|
694
|
+
maxWidth: `${Math.max(0, e.w - e.labelX)}px`
|
|
695
|
+
})
|
|
696
|
+
}, w(e.label), 5)], 4))), 128))]),
|
|
697
|
+
p("div", K, [(x(!0), f(s, null, C(e.bottomCells, (e) => (x(), f("div", {
|
|
680
698
|
key: e.key,
|
|
681
699
|
class: "absolute inset-y-0 flex items-center justify-center overflow-hidden border-l border-outline-variant/60 text-label-small whitespace-nowrap text-on-surface-variant",
|
|
682
|
-
style:
|
|
700
|
+
style: b({
|
|
683
701
|
left: `${e.x}px`,
|
|
684
702
|
width: `${e.w}px`
|
|
685
703
|
})
|
|
686
|
-
},
|
|
687
|
-
e.todayX === null ? d("", !0) : (
|
|
704
|
+
}, w(e.label), 5))), 128))]),
|
|
705
|
+
e.todayX === null ? d("", !0) : (x(), f("div", {
|
|
688
706
|
key: 0,
|
|
689
707
|
class: "absolute bottom-0 size-2 -translate-x-1/2 translate-y-1/2 rounded-full bg-primary",
|
|
690
|
-
style:
|
|
708
|
+
style: b({ left: `${e.todayX}px` })
|
|
691
709
|
}, null, 4))
|
|
692
710
|
], 4));
|
|
693
711
|
}
|
|
694
|
-
}),
|
|
712
|
+
}), Ve = { class: "pointer-events-none absolute inset-0" }, He = /* @__PURE__ */ g({
|
|
695
713
|
__name: "_MTimeBackground",
|
|
696
714
|
props: {
|
|
697
715
|
offTimes: {},
|
|
@@ -699,28 +717,52 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
699
717
|
todayX: {}
|
|
700
718
|
},
|
|
701
719
|
setup(e) {
|
|
702
|
-
return (t, n) => (
|
|
703
|
-
(
|
|
720
|
+
return (t, n) => (x(), f("div", Ve, [
|
|
721
|
+
(x(!0), f(s, null, C(e.offTimes, (e) => (x(), f("div", {
|
|
704
722
|
key: `o${e.x}`,
|
|
705
723
|
class: "absolute inset-y-0 bg-on-surface/4",
|
|
706
|
-
style:
|
|
724
|
+
style: b({
|
|
707
725
|
left: `${e.x}px`,
|
|
708
726
|
width: `${e.w}px`
|
|
709
727
|
})
|
|
710
728
|
}, null, 4))), 128)),
|
|
711
|
-
(
|
|
729
|
+
(x(!0), f(s, null, C(e.cells, (e) => (x(), f("div", {
|
|
712
730
|
key: e.key,
|
|
713
731
|
class: "absolute inset-y-0 border-l border-outline-variant/40",
|
|
714
|
-
style:
|
|
732
|
+
style: b({ left: `${e.x}px` })
|
|
715
733
|
}, null, 4))), 128)),
|
|
716
|
-
e.todayX === null ? d("", !0) : (
|
|
734
|
+
e.todayX === null ? d("", !0) : (x(), f("div", {
|
|
717
735
|
key: 0,
|
|
718
736
|
class: "absolute inset-y-0 z-[1] w-0.5 -translate-x-1/2 bg-primary",
|
|
719
|
-
style:
|
|
737
|
+
style: b({ left: `${e.todayX}px` })
|
|
720
738
|
}, null, 4))
|
|
721
739
|
]));
|
|
722
740
|
}
|
|
723
|
-
}),
|
|
741
|
+
}), Ue = ["aria-label", "aria-valuenow"], We = /* @__PURE__ */ g({
|
|
742
|
+
__name: "_MTimeSplitter",
|
|
743
|
+
props: {
|
|
744
|
+
label: {},
|
|
745
|
+
value: {},
|
|
746
|
+
active: { type: Boolean },
|
|
747
|
+
gripTop: {}
|
|
748
|
+
},
|
|
749
|
+
setup(e) {
|
|
750
|
+
return (t, n) => (x(), f("div", {
|
|
751
|
+
role: "separator",
|
|
752
|
+
"aria-orientation": "vertical",
|
|
753
|
+
"aria-label": e.label,
|
|
754
|
+
"aria-valuenow": e.value,
|
|
755
|
+
tabindex: "0",
|
|
756
|
+
class: "group/split absolute inset-y-0 -right-1 z-30 w-2 cursor-col-resize touch-none outline-none pointer-coarse:-right-3 pointer-coarse:w-6"
|
|
757
|
+
}, [p("span", { class: y(["pointer-events-none absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 transition-colors duration-150 group-hover/split:bg-primary group-focus-visible/split:bg-primary", e.active ? "bg-primary" : "bg-transparent"]) }, null, 2), p("span", {
|
|
758
|
+
class: y(["pointer-events-none absolute left-1/2 flex h-8 w-3 -translate-1/2 flex-col items-center justify-center gap-[3px] rounded-full border transition-colors duration-150 pointer-coarse:h-10 pointer-coarse:w-4", e.active ? "border-primary bg-primary text-on-primary" : "border-outline-variant bg-surface-container-high text-on-surface-variant group-hover/split:border-primary group-hover/split:bg-primary group-hover/split:text-on-primary group-focus-visible/split:border-primary group-focus-visible/split:bg-primary group-focus-visible/split:text-on-primary"]),
|
|
759
|
+
style: b({ top: `${e.gripTop}px` })
|
|
760
|
+
}, [(x(), f(s, null, C(3, (e) => p("span", {
|
|
761
|
+
key: e,
|
|
762
|
+
class: "size-[3px] rounded-full bg-current"
|
|
763
|
+
})), 64))], 6)], 8, Ue));
|
|
764
|
+
}
|
|
765
|
+
}), Ge = ["aria-label", "aria-rowcount"], Ke = [
|
|
724
766
|
"data-gantt-row",
|
|
725
767
|
"data-gantt-flip",
|
|
726
768
|
"aria-level",
|
|
@@ -734,40 +776,41 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
734
776
|
"onContextmenu",
|
|
735
777
|
"onKeydown",
|
|
736
778
|
"onFocus"
|
|
737
|
-
],
|
|
779
|
+
], qe = ["aria-label", "onClick"], Je = {
|
|
738
780
|
key: 1,
|
|
739
781
|
class: "w-6 shrink-0"
|
|
740
|
-
},
|
|
782
|
+
}, Ye = {
|
|
741
783
|
key: 2,
|
|
742
784
|
class: "mr-1 size-2 shrink-0 rotate-45 rounded-[1px] bg-tertiary"
|
|
743
|
-
},
|
|
785
|
+
}, Xe = ["onDblclick"], Ze = { class: "truncate" }, Qe = ["width", "height"], $e = ["onClick"], et = ["stroke-width"], tt = ["d"], nt = ["aria-label"], rt = ["data-gantt-flip"], it = ["onPointerdown"], at = [
|
|
744
786
|
"data-gantt-task",
|
|
745
787
|
"onPointerdown",
|
|
746
788
|
"onPointerenter",
|
|
747
789
|
"onDblclick",
|
|
748
790
|
"onContextmenu"
|
|
749
|
-
],
|
|
791
|
+
], ot = [
|
|
750
792
|
"data-gantt-task",
|
|
751
793
|
"onPointerdown",
|
|
752
794
|
"onPointerenter",
|
|
753
795
|
"onDblclick",
|
|
754
796
|
"onContextmenu"
|
|
755
|
-
],
|
|
797
|
+
], st = [
|
|
756
798
|
"data-gantt-task",
|
|
757
799
|
"onPointerdown",
|
|
758
800
|
"onPointerenter",
|
|
759
801
|
"onDblclick",
|
|
760
802
|
"onContextmenu"
|
|
761
|
-
],
|
|
803
|
+
], ct = { class: "pointer-events-none relative flex h-full items-center px-2 text-label-medium whitespace-nowrap" }, lt = {
|
|
762
804
|
key: 0,
|
|
763
|
-
class: "truncate"
|
|
764
|
-
|
|
805
|
+
class: "truncate",
|
|
806
|
+
style: { transform: "translateX(var(--m3-gantt-label-x, 0px))" }
|
|
807
|
+
}, ut = ["data-gantt-resize", "onPointerdown"], q = {
|
|
765
808
|
key: 5,
|
|
766
809
|
class: "pointer-events-none absolute top-1/2 left-full ml-2 -translate-y-1/2 text-label-medium whitespace-nowrap text-on-surface-variant"
|
|
767
|
-
},
|
|
810
|
+
}, dt = ["onPointerdown"], ft = ["onPointerdown"], pt = { class: "text-body-medium text-on-surface-variant" }, mt = { class: "text-title-small" }, ht = { class: "text-body-small text-on-surface-variant" }, gt = {
|
|
768
811
|
class: "sr-only",
|
|
769
812
|
"aria-live": "polite"
|
|
770
|
-
},
|
|
813
|
+
}, _t = 56, vt = 6, yt = 10, J = /* @__PURE__ */ g({
|
|
771
814
|
__name: "MGantt",
|
|
772
815
|
props: {
|
|
773
816
|
tasks: { default: () => [] },
|
|
@@ -777,6 +820,7 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
777
820
|
collapsed: {},
|
|
778
821
|
columns: {},
|
|
779
822
|
gridWidth: {},
|
|
823
|
+
gridCollapsed: { type: Boolean },
|
|
780
824
|
rowHeight: { default: 40 },
|
|
781
825
|
readonly: {
|
|
782
826
|
type: Boolean,
|
|
@@ -807,6 +851,7 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
807
851
|
"update:selection",
|
|
808
852
|
"update:collapsed",
|
|
809
853
|
"update:gridWidth",
|
|
854
|
+
"update:gridCollapsed",
|
|
810
855
|
"task-click",
|
|
811
856
|
"task-dblclick",
|
|
812
857
|
"task-contextmenu",
|
|
@@ -816,96 +861,108 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
816
861
|
"delete"
|
|
817
862
|
],
|
|
818
863
|
setup(r, { expose: a, emit: g }) {
|
|
819
|
-
let _ = r,
|
|
820
|
-
|
|
821
|
-
|
|
864
|
+
let _ = r, D = g, he = ce(), k = e(), ge = l(() => _.locale ?? (k.lang === "en" ? void 0 : k.lang)), A = oe(_.tasks);
|
|
865
|
+
E(() => _.tasks, (e) => {
|
|
866
|
+
A.value = e;
|
|
822
867
|
});
|
|
823
|
-
let
|
|
824
|
-
function
|
|
825
|
-
|
|
868
|
+
let _e = oe(null), N = l(() => Me(se(A.value))), F = l(() => _e.value ?? N.value), ye = [], xe = [], Se = S(0);
|
|
869
|
+
function Ce(e) {
|
|
870
|
+
A.value = e, D("update:tasks", e);
|
|
826
871
|
}
|
|
827
|
-
function
|
|
828
|
-
e =
|
|
872
|
+
function I(e) {
|
|
873
|
+
e = Me(e), e !== N.value && (ye.push(se(A.value)), ye.length > 100 && ye.shift(), xe.length = 0, Se.value++, Ce(e));
|
|
829
874
|
}
|
|
830
|
-
function
|
|
831
|
-
let e =
|
|
832
|
-
e && (
|
|
875
|
+
function we() {
|
|
876
|
+
let e = ye.pop();
|
|
877
|
+
e && (xe.push(se(A.value)), Se.value++, Ce(e));
|
|
833
878
|
}
|
|
834
|
-
function
|
|
835
|
-
let e =
|
|
836
|
-
e && (
|
|
879
|
+
function Te() {
|
|
880
|
+
let e = xe.pop();
|
|
881
|
+
e && (ye.push(se(A.value)), Se.value++, Ce(e));
|
|
837
882
|
}
|
|
838
|
-
let
|
|
883
|
+
let Ee = l(() => (Se.value, ye.length > 0)), De = l(() => (Se.value, xe.length > 0)), L = l(() => new Map(F.value.map((e) => [e.id, e]))), R = l(() => Ae(F.value)), H = l(() => {
|
|
839
884
|
let e = /* @__PURE__ */ new Map();
|
|
840
|
-
for (let t of
|
|
841
|
-
let n = t.parentId &&
|
|
885
|
+
for (let t of F.value) {
|
|
886
|
+
let n = t.parentId && L.value.has(t.parentId) ? t.parentId : void 0;
|
|
842
887
|
(e.get(n) ?? e.set(n, []).get(n)).push(t);
|
|
843
888
|
}
|
|
844
889
|
return e;
|
|
845
890
|
});
|
|
846
|
-
function
|
|
891
|
+
function Ne(e, t = [], n = 0) {
|
|
847
892
|
if (n > 100) return t;
|
|
848
|
-
for (let r of
|
|
893
|
+
for (let r of H.value.get(e) ?? []) t.push(r.id), Ne(r.id, t, n + 1);
|
|
849
894
|
return t;
|
|
850
895
|
}
|
|
851
|
-
let
|
|
852
|
-
|
|
853
|
-
e && (
|
|
896
|
+
let U = S(_.selection ?? []);
|
|
897
|
+
E(() => _.selection, (e) => {
|
|
898
|
+
e && (U.value = e);
|
|
854
899
|
});
|
|
855
|
-
let
|
|
856
|
-
function
|
|
857
|
-
let t = e.filter((e) =>
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
let
|
|
861
|
-
|
|
862
|
-
e && (
|
|
900
|
+
let W = l(() => new Set(U.value));
|
|
901
|
+
function G(e) {
|
|
902
|
+
let t = e.filter((e) => L.value.get(e)?.selectable !== !1);
|
|
903
|
+
U.value = t, D("update:selection", t);
|
|
904
|
+
}
|
|
905
|
+
let ze = S(_.collapsed ?? []);
|
|
906
|
+
E(() => _.collapsed, (e) => {
|
|
907
|
+
e && (ze.value = e);
|
|
863
908
|
});
|
|
864
|
-
let
|
|
865
|
-
function
|
|
866
|
-
|
|
909
|
+
let K = l(() => new Set(ze.value));
|
|
910
|
+
function Ve(e) {
|
|
911
|
+
ze.value = e, D("update:collapsed", e);
|
|
867
912
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
913
|
+
function Ue(e, t) {
|
|
914
|
+
Ve(t ?? K.value.has(e) ? ze.value.filter((t) => t !== e) : [...ze.value, e]);
|
|
870
915
|
}
|
|
871
|
-
let
|
|
916
|
+
let J = l(() => {
|
|
872
917
|
let e = [], t = (n, r) => {
|
|
873
|
-
for (let i of
|
|
874
|
-
let n =
|
|
918
|
+
for (let i of H.value.get(n) ?? []) {
|
|
919
|
+
let n = H.value.has(i.id);
|
|
875
920
|
e.push({
|
|
876
921
|
task: i,
|
|
877
922
|
depth: r,
|
|
878
923
|
parent: n
|
|
879
|
-
}), n && !
|
|
924
|
+
}), n && !K.value.has(i.id) && r < 100 && t(i.id, r + 1);
|
|
880
925
|
}
|
|
881
926
|
};
|
|
882
927
|
return t(void 0, 0), e;
|
|
883
|
-
}),
|
|
928
|
+
}), bt = l(() => new Map(J.value.map((e, t) => [e.task.id, t]))), Y = S(), xt = l(() => [
|
|
884
929
|
{
|
|
885
930
|
key: "name",
|
|
886
|
-
label:
|
|
931
|
+
label: k.ganttTask
|
|
887
932
|
},
|
|
888
933
|
{
|
|
889
934
|
key: "start",
|
|
890
|
-
label:
|
|
891
|
-
width: 96
|
|
935
|
+
label: k.ganttStart,
|
|
936
|
+
width: 96,
|
|
937
|
+
hideBelow: 600
|
|
892
938
|
},
|
|
893
939
|
{
|
|
894
940
|
key: "duration",
|
|
895
|
-
label:
|
|
941
|
+
label: k.ganttDuration,
|
|
896
942
|
width: 80,
|
|
897
|
-
align: "end"
|
|
943
|
+
align: "end",
|
|
944
|
+
hideBelow: 600
|
|
898
945
|
}
|
|
899
|
-
]),
|
|
900
|
-
|
|
946
|
+
]), St = l(() => _.columns ?? xt.value), Ct = S(_.gridCollapsed ?? !1);
|
|
947
|
+
E(() => _.gridCollapsed, (e) => {
|
|
901
948
|
e !== void 0 && (Ct.value = e);
|
|
902
949
|
});
|
|
903
|
-
|
|
950
|
+
function wt(e) {
|
|
951
|
+
e !== Ct.value && (Ct.value = e, D("update:gridCollapsed", e));
|
|
952
|
+
}
|
|
953
|
+
let Tt = l(() => St.value.length > 0 && !Ct.value), Et = _.gridWidth ?? 320, Dt = S(Et);
|
|
954
|
+
E(() => _.gridWidth, (e) => {
|
|
955
|
+
e !== void 0 && (Dt.value = e, Et = e);
|
|
956
|
+
});
|
|
957
|
+
function Ot(e) {
|
|
958
|
+
Dt.value = e, D("update:gridWidth", e);
|
|
959
|
+
}
|
|
960
|
+
let kt = l(() => Tt.value ? Dt.value : 0), At = l(() => {
|
|
904
961
|
let e = Infinity, t = -Infinity;
|
|
905
|
-
for (let n of
|
|
906
|
-
let r =
|
|
962
|
+
for (let n of F.value) {
|
|
963
|
+
let r = B(n);
|
|
907
964
|
if (Number.isFinite(r.start) && (e = Math.min(e, r.start), t = Math.max(t, r.end), _.baselines && n.baselineStart)) {
|
|
908
|
-
let r =
|
|
965
|
+
let r = B({
|
|
909
966
|
start: n.baselineStart,
|
|
910
967
|
end: n.baselineEnd,
|
|
911
968
|
type: n.type
|
|
@@ -913,74 +970,78 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
913
970
|
Number.isFinite(r.start) && (e = Math.min(e, r.start), t = Math.max(t, r.end));
|
|
914
971
|
}
|
|
915
972
|
}
|
|
916
|
-
return Number.isFinite(e) || (e = t = _.today ?
|
|
973
|
+
return Number.isFinite(e) || (e = t = _.today ? j(_.today) : Date.now()), {
|
|
917
974
|
min: e,
|
|
918
975
|
max: t
|
|
919
976
|
};
|
|
920
|
-
}),
|
|
921
|
-
scroller:
|
|
922
|
-
listWidth:
|
|
923
|
-
headerHeight:
|
|
924
|
-
extent:
|
|
977
|
+
}), jt = Ie({
|
|
978
|
+
scroller: Y,
|
|
979
|
+
listWidth: kt,
|
|
980
|
+
headerHeight: _t,
|
|
981
|
+
extent: At,
|
|
925
982
|
scale: () => _.scale,
|
|
926
983
|
pxPerDay: () => _.pxPerDay,
|
|
927
984
|
minPxPerDay: () => _.minPxPerDay,
|
|
928
985
|
maxPxPerDay: () => _.maxPxPerDay,
|
|
929
986
|
weekStartsOn: () => _.weekStartsOn,
|
|
930
|
-
lang:
|
|
931
|
-
quarterLabel: () =>
|
|
987
|
+
lang: ge,
|
|
988
|
+
quarterLabel: () => k.ganttQuarter,
|
|
932
989
|
today: () => _.today,
|
|
933
990
|
calendar: () => _.calendar,
|
|
934
|
-
onScale: (e) =>
|
|
991
|
+
onScale: (e) => D("update:scale", e),
|
|
935
992
|
onPinch: () => {
|
|
936
|
-
|
|
993
|
+
Q && or({ pointerId: Q.id });
|
|
937
994
|
}
|
|
938
|
-
}), { ppd:
|
|
939
|
-
function
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
995
|
+
}), { ppd: Mt, view: X, timelineView: Nt, origin: Pt, timelineWidth: Z, todayMs: Ft, xOf: It, timeAt: Lt, zoomIn: Rt, zoomOut: zt, setScale: Bt, scrollToDate: Vt, topCells: Ht, bottomCells: Ut, offTimes: Wt } = jt, Gt = jt.scaleNow;
|
|
996
|
+
function Kt() {
|
|
997
|
+
F.value.length && jt.fit(At.value);
|
|
998
|
+
}
|
|
999
|
+
let qt = l(() => X.value.width > 0 && X.value.width < 600), Jt = l(() => qt.value ? 12 : 20), Yt = l(() => St.value.filter((e) => !e.hideBelow || !X.value.width || X.value.width >= e.hideBelow));
|
|
1000
|
+
function Xt(e) {
|
|
1001
|
+
let t = L.value.get(e), n = [];
|
|
1002
|
+
for (let e = t?.parentId; e && L.value.has(e); e = L.value.get(e).parentId) K.value.has(e) && n.push(e);
|
|
1003
|
+
n.length && Ve(ze.value.filter((e) => !n.includes(e))), v(() => {
|
|
1004
|
+
t = L.value.get(e);
|
|
1005
|
+
let n = bt.value.get(e);
|
|
1006
|
+
if (!t || n === void 0 || !Y.value) return;
|
|
1007
|
+
let r = B(t), a = n * _.rowHeight, o = Y.value, s = o.scrollTop, c = o.clientHeight - _t;
|
|
947
1008
|
a < s ? s = a : a + _.rowHeight > s + c && (s = a + _.rowHeight - c);
|
|
948
|
-
let l = o.scrollLeft, u =
|
|
949
|
-
(u < l || u > l +
|
|
1009
|
+
let l = o.scrollLeft, u = It(r.start);
|
|
1010
|
+
(u < l || u > l + Nt.value - 40) && (l = Math.max(0, u - 48)), o.scrollTo({
|
|
950
1011
|
left: l,
|
|
951
1012
|
top: s,
|
|
952
1013
|
behavior: i() ? "auto" : "smooth"
|
|
953
1014
|
});
|
|
954
1015
|
});
|
|
955
1016
|
}
|
|
956
|
-
let
|
|
1017
|
+
let Zt = l(() => Math.max(0, Math.floor(X.value.top / _.rowHeight) - vt)), Qt = l(() => Math.min(J.value.length, Math.ceil((X.value.top + X.value.height) / _.rowHeight) + vt)), $t = l(() => J.value.slice(Zt.value, Qt.value).map((e, t) => ({
|
|
957
1018
|
...e,
|
|
958
|
-
index:
|
|
959
|
-
}))),
|
|
1019
|
+
index: Zt.value + t
|
|
1020
|
+
}))), en = l(() => Math.max(J.value.length * _.rowHeight, X.value.height - _t)), tn = l(() => Math.round(_.rowHeight * .6)), nn = l(() => _.criticalPath ? Fe(F.value, { calendar: _.calendar }) : null), rn = l(() => nn.value ?? Fe(F.value, { calendar: _.calendar })), an = l(() => new Set(nn.value?.tasks ?? [])), on = l(() => new Set(nn.value?.dependencies ?? [])), sn = l(() => {
|
|
960
1021
|
let e = /* @__PURE__ */ new Map();
|
|
961
|
-
for (let t of
|
|
962
|
-
let n =
|
|
1022
|
+
for (let t of F.value) {
|
|
1023
|
+
let n = B(t);
|
|
963
1024
|
Number.isFinite(n.start) && e.set(t.id, {
|
|
964
|
-
x:
|
|
965
|
-
w:
|
|
1025
|
+
x: It(n.start),
|
|
1026
|
+
w: z(t) ? 0 : Math.max(2, It(n.end) - It(n.start))
|
|
966
1027
|
});
|
|
967
1028
|
}
|
|
968
1029
|
return e;
|
|
969
|
-
}),
|
|
970
|
-
ppd:
|
|
971
|
-
origin:
|
|
1030
|
+
}), cn = /* @__PURE__ */ new Map(), ln = /* @__PURE__ */ new Map(), un = /* @__PURE__ */ new Map(), dn = 0, fn = {
|
|
1031
|
+
ppd: Mt.value,
|
|
1032
|
+
origin: Pt.value
|
|
972
1033
|
};
|
|
973
|
-
|
|
974
|
-
let t =
|
|
975
|
-
|
|
976
|
-
ppd:
|
|
977
|
-
origin:
|
|
1034
|
+
E(sn, (e) => {
|
|
1035
|
+
let t = fn.ppd !== Mt.value || fn.origin !== Pt.value || i();
|
|
1036
|
+
fn = {
|
|
1037
|
+
ppd: Mt.value,
|
|
1038
|
+
origin: Pt.value
|
|
978
1039
|
};
|
|
979
1040
|
let n = !1;
|
|
980
1041
|
for (let [r, i] of e) {
|
|
981
|
-
let e =
|
|
1042
|
+
let e = cn.get(r);
|
|
982
1043
|
if (!e || t) {
|
|
983
|
-
|
|
1044
|
+
cn.set(r, {
|
|
984
1045
|
x: i.x,
|
|
985
1046
|
w: i.w,
|
|
986
1047
|
vx: 0,
|
|
@@ -992,44 +1053,50 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
992
1053
|
}
|
|
993
1054
|
(e.tx !== i.x || e.tw !== i.w) && (e.tx = i.x, e.tw = i.w, n = !0);
|
|
994
1055
|
}
|
|
995
|
-
for (let t of
|
|
996
|
-
n ?
|
|
1056
|
+
for (let t of cn.keys()) e.has(t) || cn.delete(t);
|
|
1057
|
+
n ? pn() : hn();
|
|
997
1058
|
}, {
|
|
998
1059
|
immediate: !0,
|
|
999
1060
|
flush: "post"
|
|
1000
1061
|
});
|
|
1001
|
-
function
|
|
1002
|
-
if (
|
|
1062
|
+
function pn() {
|
|
1063
|
+
if (dn) return;
|
|
1003
1064
|
let e = performance.now(), t = (n) => {
|
|
1004
1065
|
let r = Math.min((n - e) / 1e3, 1 / 30);
|
|
1005
1066
|
e = n;
|
|
1006
1067
|
let i = !1;
|
|
1007
1068
|
for (; r > 0;) {
|
|
1008
1069
|
let e = Math.min(r, .004);
|
|
1009
|
-
for (let t of
|
|
1070
|
+
for (let t of cn.values()) (t.x !== t.tx || t.w !== t.tw || t.vx || t.vw) && (t.vx += (-700 * (t.x - t.tx) - 1.8 * Math.sqrt(700) * t.vx) * e, t.x += t.vx * e, t.vw += (-700 * (t.w - t.tw) - 1.8 * Math.sqrt(700) * t.vw) * e, t.w += t.vw * e);
|
|
1010
1071
|
r -= e;
|
|
1011
1072
|
}
|
|
1012
|
-
for (let e of
|
|
1013
|
-
|
|
1073
|
+
for (let e of cn.values()) Math.abs(e.x - e.tx) < .3 && Math.abs(e.vx) < 2 && Math.abs(e.w - e.tw) < .3 && Math.abs(e.vw) < 2 ? (e.x = e.tx, e.w = e.tw, e.vx = 0, e.vw = 0) : i = !0;
|
|
1074
|
+
hn(), dn = i ? requestAnimationFrame(t) : 0;
|
|
1014
1075
|
};
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
function an(e, t) {
|
|
1018
|
-
let n = Qt.get(e);
|
|
1019
|
-
n && (t.style.transform = `translateX(${n.x}px)`, t.style.width = `${n.w}px`);
|
|
1076
|
+
dn = requestAnimationFrame(t);
|
|
1020
1077
|
}
|
|
1021
|
-
function
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
t
|
|
1078
|
+
function mn(e, t) {
|
|
1079
|
+
let n = cn.get(e);
|
|
1080
|
+
if (!n) return;
|
|
1081
|
+
t.style.transform = `translateX(${n.x}px)`, t.style.width = `${n.w}px`;
|
|
1082
|
+
let r = L.value.get(e)?.name ?? "", i = Math.max(0, Math.min(X.value.left - n.x, n.w - (r.length * 7 + 24)));
|
|
1083
|
+
t.style.setProperty("--m3-gantt-label-x", `${i}px`);
|
|
1084
|
+
}
|
|
1085
|
+
function hn() {
|
|
1086
|
+
for (let [e, t] of ln) mn(e, t);
|
|
1087
|
+
for (let [e, t] of un) Cn(e, t);
|
|
1088
|
+
}
|
|
1089
|
+
E(() => X.value.left, () => {
|
|
1090
|
+
for (let [e, t] of ln) mn(e, t);
|
|
1091
|
+
});
|
|
1092
|
+
function gn(e, t) {
|
|
1093
|
+
t instanceof HTMLElement ? (ln.set(e, t), mn(e, t)) : ln.delete(e);
|
|
1027
1094
|
}
|
|
1028
|
-
let
|
|
1095
|
+
let _n = (e) => cn.get(e) ?? sn.value.get(e), vn = l(() => {
|
|
1029
1096
|
let e = [];
|
|
1030
|
-
for (let t of
|
|
1031
|
-
let r =
|
|
1032
|
-
|
|
1097
|
+
for (let t of F.value) for (let n of t.dependencies ?? []) {
|
|
1098
|
+
let r = ke(n);
|
|
1099
|
+
L.value.has(r.id) && e.push({
|
|
1033
1100
|
key: `${r.id}>${t.id}`,
|
|
1034
1101
|
from: r.id,
|
|
1035
1102
|
to: t.id,
|
|
@@ -1039,27 +1106,27 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1039
1106
|
}
|
|
1040
1107
|
return e;
|
|
1041
1108
|
});
|
|
1042
|
-
function
|
|
1043
|
-
let t =
|
|
1109
|
+
function yn(e) {
|
|
1110
|
+
let t = L.value.get(e);
|
|
1044
1111
|
for (let e = 0; t && e < 100; e++) {
|
|
1045
|
-
let e =
|
|
1112
|
+
let e = bt.value.get(t.id);
|
|
1046
1113
|
if (e !== void 0) return e;
|
|
1047
|
-
t = t.parentId ?
|
|
1114
|
+
t = t.parentId ? L.value.get(t.parentId) : void 0;
|
|
1048
1115
|
}
|
|
1049
1116
|
}
|
|
1050
|
-
let
|
|
1051
|
-
let e =
|
|
1052
|
-
return
|
|
1053
|
-
let r =
|
|
1117
|
+
let bn = l(() => {
|
|
1118
|
+
let e = Zt.value, t = Qt.value;
|
|
1119
|
+
return vn.value.filter((n) => {
|
|
1120
|
+
let r = yn(n.from), i = yn(n.to);
|
|
1054
1121
|
return r === void 0 || i === void 0 || r === i ? !1 : Math.min(r, i) <= t && Math.max(r, i) >= e;
|
|
1055
1122
|
});
|
|
1056
1123
|
});
|
|
1057
|
-
function
|
|
1058
|
-
let t =
|
|
1124
|
+
function xn(e) {
|
|
1125
|
+
let t = yn(e.from), n = yn(e.to);
|
|
1059
1126
|
if (t === void 0 || n === void 0) return null;
|
|
1060
|
-
let r =
|
|
1127
|
+
let r = _n(J.value[t].task.id), i = _n(J.value[n].task.id);
|
|
1061
1128
|
if (!r || !i) return null;
|
|
1062
|
-
let a = _.rowHeight, o = t * a + a / 2, s = n * a + a / 2, c = e.type === "FS" || e.type === "FF", l = e.type === "FS" || e.type === "SS", u = (e) => e.w ? 0 :
|
|
1129
|
+
let a = _.rowHeight, o = t * a + a / 2, s = n * a + a / 2, c = e.type === "FS" || e.type === "FF", l = e.type === "FS" || e.type === "SS", u = (e) => e.w ? 0 : tn.value * .4, d = c ? r.x + r.w + u(r) : r.x - u(r), f = l ? i.x - u(i) : i.x + i.w + u(i), p = d + (c ? yt : -10), m = f + (l ? -10 : yt);
|
|
1063
1130
|
if (l ? p <= m : p >= m) return [
|
|
1064
1131
|
[d, o],
|
|
1065
1132
|
[p, o],
|
|
@@ -1076,7 +1143,7 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1076
1143
|
[f, s]
|
|
1077
1144
|
];
|
|
1078
1145
|
}
|
|
1079
|
-
function
|
|
1146
|
+
function Sn(e, t = 6) {
|
|
1080
1147
|
let n = `M${e[0][0]},${e[0][1]}`;
|
|
1081
1148
|
for (let r = 1; r < e.length - 1; r++) {
|
|
1082
1149
|
let [i, a] = e[r - 1], [o, s] = e[r], [c, l] = e[r + 1], u = Math.hypot(o - i, s - a), d = Math.hypot(c - o, l - s), f = Math.min(t, u / 2, d / 2);
|
|
@@ -1090,17 +1157,17 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1090
1157
|
let [r, i] = e.at(-1);
|
|
1091
1158
|
return `${n} L${r},${i}`;
|
|
1092
1159
|
}
|
|
1093
|
-
function
|
|
1094
|
-
let n =
|
|
1160
|
+
function Cn(e, t) {
|
|
1161
|
+
let n = vn.value.find((t) => t.key === e), r = n && xn(n);
|
|
1095
1162
|
if (!r) return;
|
|
1096
|
-
let i =
|
|
1163
|
+
let i = Sn(r), [a, s] = r.at(-1), c = n.type === "FS" || n.type === "SS", l = t.querySelectorAll("path");
|
|
1097
1164
|
l[0]?.setAttribute("d", i), l[1]?.setAttribute("d", i), l[2]?.setAttribute("d", o(a, s, c ? 0 : Math.PI, 7, !0));
|
|
1098
1165
|
}
|
|
1099
|
-
function
|
|
1100
|
-
t instanceof SVGGElement ? (
|
|
1166
|
+
function wn(e, t) {
|
|
1167
|
+
t instanceof SVGGElement ? (un.set(e, t), Cn(e, t)) : un.delete(e);
|
|
1101
1168
|
}
|
|
1102
|
-
let
|
|
1103
|
-
let e =
|
|
1169
|
+
let Tn = S(null), En = l(() => {
|
|
1170
|
+
let e = vn.value.find((e) => e.key === Tn.value), t = e && xn(e);
|
|
1104
1171
|
if (!t) return null;
|
|
1105
1172
|
let n = Math.floor((t.length - 1) / 2);
|
|
1106
1173
|
return {
|
|
@@ -1108,309 +1175,330 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1108
1175
|
y: (t[n][1] + t[n + 1][1]) / 2
|
|
1109
1176
|
};
|
|
1110
1177
|
});
|
|
1111
|
-
function
|
|
1112
|
-
|
|
1178
|
+
function Dn(e, t) {
|
|
1179
|
+
A.value.find((e) => e.id === t)?.dependencies?.some((t) => ke(t).id === e) && (I(A.value.map((n) => n.id === t ? {
|
|
1113
1180
|
...n,
|
|
1114
|
-
dependencies: n.dependencies.filter((t) =>
|
|
1115
|
-
} : n)),
|
|
1181
|
+
dependencies: n.dependencies.filter((t) => ke(t).id !== e)
|
|
1182
|
+
} : n)), Tn.value === `${e}>${t}` && (Tn.value = null), D("unlink", {
|
|
1116
1183
|
from: e,
|
|
1117
1184
|
to: t
|
|
1118
|
-
}),
|
|
1185
|
+
}), Pr(k.ganttUnlink));
|
|
1119
1186
|
}
|
|
1120
|
-
function
|
|
1187
|
+
function On(e, t) {
|
|
1121
1188
|
let n = /* @__PURE__ */ new Set(), r = [e];
|
|
1122
1189
|
for (; r.length;) {
|
|
1123
1190
|
let e = r.pop();
|
|
1124
1191
|
if (e === t) return !0;
|
|
1125
1192
|
if (!n.has(e)) {
|
|
1126
1193
|
n.add(e);
|
|
1127
|
-
for (let t of
|
|
1194
|
+
for (let t of L.value.get(e)?.dependencies ?? []) r.push(ke(t).id);
|
|
1128
1195
|
}
|
|
1129
1196
|
}
|
|
1130
1197
|
return !1;
|
|
1131
1198
|
}
|
|
1132
|
-
function
|
|
1199
|
+
function kn(e, t) {
|
|
1133
1200
|
if (e === t || _.readonly) return !1;
|
|
1134
|
-
let n =
|
|
1135
|
-
return !n || !r || n.linkable === !1 || r.linkable === !1 ||
|
|
1201
|
+
let n = L.value.get(e), r = L.value.get(t);
|
|
1202
|
+
return !n || !r || n.linkable === !1 || r.linkable === !1 || Ne(e).includes(t) || Ne(t).includes(e) || r.dependencies?.some((t) => ke(t).id === e) ? !1 : !On(e, t);
|
|
1136
1203
|
}
|
|
1137
|
-
function
|
|
1138
|
-
if (!
|
|
1204
|
+
function An(e, t, n = "FS", r = 0) {
|
|
1205
|
+
if (!kn(e, t)) return;
|
|
1139
1206
|
let i = n === "FS" && !r ? e : {
|
|
1140
1207
|
id: e,
|
|
1141
1208
|
type: n,
|
|
1142
1209
|
...r ? { lag: r } : {}
|
|
1143
|
-
}, a =
|
|
1210
|
+
}, a = A.value.map((e) => e.id === t ? {
|
|
1144
1211
|
...e,
|
|
1145
1212
|
dependencies: [...e.dependencies ?? [], i]
|
|
1146
1213
|
} : e);
|
|
1147
|
-
_.schedule === "auto" && (a =
|
|
1214
|
+
_.schedule === "auto" && (a = Pe(a, jn())), I(a), D("link", {
|
|
1148
1215
|
from: e,
|
|
1149
1216
|
to: t,
|
|
1150
1217
|
type: n
|
|
1151
|
-
}),
|
|
1218
|
+
}), Pr(k.ganttLinked.replace("{from}", L.value.get(e)?.name ?? e).replace("{to}", L.value.get(t)?.name ?? t));
|
|
1152
1219
|
}
|
|
1153
|
-
let
|
|
1154
|
-
function
|
|
1155
|
-
let n = Array.isArray(e) ? e : [e], r = [...
|
|
1220
|
+
let jn = () => ({ calendar: _.calendar ? _.calendar : void 0 });
|
|
1221
|
+
function Mn(e, t = {}) {
|
|
1222
|
+
let n = Array.isArray(e) ? e : [e], r = [...A.value], i = t.after ? r.findIndex((e) => e.id === t.after) : -1;
|
|
1156
1223
|
if (i >= 0) {
|
|
1157
|
-
let e = new Set(
|
|
1224
|
+
let e = new Set(Ne(t.after));
|
|
1158
1225
|
for (; i + 1 < r.length && e.has(r[i + 1].id);) i++;
|
|
1159
1226
|
r.splice(i + 1, 0, ...n);
|
|
1160
1227
|
} else r.push(...n);
|
|
1161
|
-
|
|
1228
|
+
I(r);
|
|
1162
1229
|
}
|
|
1163
|
-
function
|
|
1164
|
-
let n =
|
|
1230
|
+
function Nn(e, t) {
|
|
1231
|
+
let n = A.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
1165
1232
|
...n,
|
|
1166
1233
|
...t
|
|
1167
1234
|
} : n);
|
|
1168
|
-
_.schedule === "auto" && (n =
|
|
1235
|
+
_.schedule === "auto" && (n = Pe(n, jn())), I(n);
|
|
1169
1236
|
}
|
|
1170
|
-
async function
|
|
1237
|
+
async function Pn(e) {
|
|
1171
1238
|
let t = /* @__PURE__ */ new Set();
|
|
1172
1239
|
for (let n of e) {
|
|
1173
|
-
let e =
|
|
1240
|
+
let e = L.value.get(n);
|
|
1174
1241
|
if (e && e.deletable !== !1) {
|
|
1175
1242
|
t.add(n);
|
|
1176
|
-
for (let e of
|
|
1243
|
+
for (let e of Ne(n)) t.add(e);
|
|
1177
1244
|
}
|
|
1178
1245
|
}
|
|
1179
1246
|
if (!t.size) return;
|
|
1180
|
-
let n =
|
|
1181
|
-
(!_.beforeDelete || await _.beforeDelete(n)) && (
|
|
1247
|
+
let n = A.value.filter((e) => t.has(e.id));
|
|
1248
|
+
(!_.beforeDelete || await _.beforeDelete(n)) && (I(A.value.filter((e) => !t.has(e.id)).map((e) => e.dependencies?.some((e) => t.has(ke(e).id)) ? {
|
|
1182
1249
|
...e,
|
|
1183
|
-
dependencies: e.dependencies.filter((e) => !t.has(
|
|
1184
|
-
} : e)),
|
|
1250
|
+
dependencies: e.dependencies.filter((e) => !t.has(ke(e).id))
|
|
1251
|
+
} : e)), G(U.value.filter((e) => !t.has(e))), D("delete", { tasks: n }), Pr(k.ganttDeleted.replace("{count}", String(n.length))));
|
|
1185
1252
|
}
|
|
1186
|
-
function
|
|
1187
|
-
|
|
1188
|
-
...
|
|
1253
|
+
function Fn(e) {
|
|
1254
|
+
I(Pe(A.value, {
|
|
1255
|
+
...jn(),
|
|
1189
1256
|
...e
|
|
1190
1257
|
}));
|
|
1191
1258
|
}
|
|
1192
|
-
function
|
|
1193
|
-
let t = e - (
|
|
1194
|
-
return
|
|
1259
|
+
function In(e) {
|
|
1260
|
+
let t = e - (Y.value?.getBoundingClientRect()?.left ?? 0) - kt.value + X.value.left;
|
|
1261
|
+
return M(be(Lt(t), 1440), !0);
|
|
1195
1262
|
}
|
|
1196
|
-
let
|
|
1263
|
+
let Q = null, Ln, Rn = S(null), zn = S(!1), $ = S(null), Bn = S(null), Vn = {
|
|
1197
1264
|
x: 0,
|
|
1198
1265
|
y: 0
|
|
1199
1266
|
};
|
|
1200
|
-
function
|
|
1201
|
-
let n =
|
|
1267
|
+
function Hn(e, t) {
|
|
1268
|
+
let n = Y.value.getBoundingClientRect();
|
|
1202
1269
|
return {
|
|
1203
|
-
x: e - n.left -
|
|
1204
|
-
y: t - n.top -
|
|
1270
|
+
x: e - n.left - kt.value + Y.value.scrollLeft,
|
|
1271
|
+
y: t - n.top - _t + Y.value.scrollTop
|
|
1205
1272
|
};
|
|
1206
1273
|
}
|
|
1207
|
-
let
|
|
1208
|
-
function
|
|
1209
|
-
if (e.
|
|
1210
|
-
e.
|
|
1274
|
+
let Un = (e) => e instanceof Element && !!e.closest("input, textarea, select, button, a, [contenteditable], [data-gantt-action]");
|
|
1275
|
+
function Wn(e) {
|
|
1276
|
+
if (e.pointerType === "touch") return;
|
|
1277
|
+
e.preventDefault();
|
|
1278
|
+
let t = document.activeElement;
|
|
1279
|
+
t instanceof HTMLElement && t.matches("[data-gantt-rename]") && t.blur();
|
|
1280
|
+
}
|
|
1281
|
+
function Gn(e, t, n) {
|
|
1282
|
+
if (e.button !== 0 || Un(e.target) || _.readonly && n !== "body") return;
|
|
1283
|
+
e.stopPropagation(), Wn(e), mr.value?.id !== t.id && (mr.value = null);
|
|
1211
1284
|
let r = e.pointerType === "touch";
|
|
1212
|
-
|
|
1285
|
+
Q = {
|
|
1213
1286
|
kind: "bar",
|
|
1214
1287
|
part: n,
|
|
1215
1288
|
id: e.pointerId,
|
|
1216
1289
|
taskId: t.id,
|
|
1217
1290
|
sx: e.clientX,
|
|
1218
1291
|
sy: e.clientY,
|
|
1219
|
-
sl:
|
|
1292
|
+
sl: Y.value.scrollLeft,
|
|
1293
|
+
st: Y.value.scrollTop,
|
|
1220
1294
|
touch: r,
|
|
1221
1295
|
active: !1,
|
|
1222
1296
|
spans: /* @__PURE__ */ new Map(),
|
|
1223
1297
|
moving: []
|
|
1224
|
-
},
|
|
1298
|
+
}, Yn(), r && n === "body" ? Ln = setTimeout(() => Zn(e), 250) : r && Zn(e);
|
|
1225
1299
|
}
|
|
1226
|
-
function
|
|
1227
|
-
e.button !== 0 || e.pointerType === "touch" ||
|
|
1300
|
+
function Kn(e) {
|
|
1301
|
+
mr.value = null, !(e.button !== 0 || e.pointerType === "touch" || Un(e.target)) && (Wn(e), Q = {
|
|
1228
1302
|
kind: "pan",
|
|
1229
1303
|
id: e.pointerId,
|
|
1230
1304
|
sx: e.clientX,
|
|
1231
1305
|
sy: e.clientY,
|
|
1232
|
-
sl:
|
|
1233
|
-
st:
|
|
1306
|
+
sl: Y.value.scrollLeft,
|
|
1307
|
+
st: Y.value.scrollTop,
|
|
1234
1308
|
moved: !1
|
|
1235
|
-
},
|
|
1309
|
+
}, Yn());
|
|
1236
1310
|
}
|
|
1237
|
-
function
|
|
1238
|
-
if (e.button !== 0 ||
|
|
1311
|
+
function qn(e, t) {
|
|
1312
|
+
if (e.button !== 0 || Un(e.target) || _.readonly || Fr.value) return;
|
|
1239
1313
|
let n = e.pointerType === "touch";
|
|
1240
|
-
|
|
1314
|
+
Q = {
|
|
1241
1315
|
kind: "row",
|
|
1242
1316
|
id: e.pointerId,
|
|
1243
1317
|
taskId: t.id,
|
|
1244
1318
|
sx: e.clientX,
|
|
1245
1319
|
sy: e.clientY,
|
|
1246
|
-
st:
|
|
1320
|
+
st: Y.value.scrollTop,
|
|
1247
1321
|
touch: n,
|
|
1248
1322
|
active: !1
|
|
1249
|
-
},
|
|
1323
|
+
}, Yn(), n && (Ln = setTimeout(() => Zn(e), 350));
|
|
1250
1324
|
}
|
|
1251
|
-
function
|
|
1252
|
-
e.button === 0 && (e.preventDefault(),
|
|
1325
|
+
function Jn(e) {
|
|
1326
|
+
e.button === 0 && (e.preventDefault(), Q = {
|
|
1253
1327
|
kind: "split",
|
|
1254
1328
|
id: e.pointerId,
|
|
1255
1329
|
sx: e.clientX,
|
|
1256
|
-
w:
|
|
1257
|
-
},
|
|
1330
|
+
w: Dt.value
|
|
1331
|
+
}, zn.value = !0, Le("col-resize"), Yn());
|
|
1258
1332
|
}
|
|
1259
|
-
function
|
|
1260
|
-
window.addEventListener("pointermove",
|
|
1333
|
+
function Yn() {
|
|
1334
|
+
window.addEventListener("pointermove", Qn), window.addEventListener("pointerup", ar), window.addEventListener("pointercancel", or);
|
|
1261
1335
|
}
|
|
1262
|
-
function
|
|
1263
|
-
window.removeEventListener("pointermove",
|
|
1336
|
+
function Xn() {
|
|
1337
|
+
window.removeEventListener("pointermove", Qn), window.removeEventListener("pointerup", ar), window.removeEventListener("pointercancel", or), clearTimeout(Ln), Re(), zn.value = !1;
|
|
1264
1338
|
}
|
|
1265
|
-
function
|
|
1266
|
-
let t =
|
|
1339
|
+
function Zn(e) {
|
|
1340
|
+
let t = Q;
|
|
1267
1341
|
if (!t || t.kind !== "bar" && t.kind !== "row" || t.active) return;
|
|
1268
|
-
let n =
|
|
1269
|
-
if (n)
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
}
|
|
1342
|
+
let n = L.value.get(t.taskId);
|
|
1343
|
+
if (!n) return;
|
|
1344
|
+
if (t.kind === "bar") {
|
|
1345
|
+
if (t.part === "body" && (_.readonly || n.draggable === !1) || (t.part === "start" || t.part === "end") && n.resizable === !1 || (t.part === "link-start" || t.part === "link-end") && n.linkable === !1) return;
|
|
1346
|
+
t.active = !0;
|
|
1347
|
+
let r = t.part === "body" && W.value.has(n.id) ? U.value : [n.id], i = /* @__PURE__ */ new Set();
|
|
1348
|
+
for (let e of r) {
|
|
1349
|
+
let t = L.value.get(e);
|
|
1350
|
+
if (t && t.draggable !== !1) {
|
|
1351
|
+
i.add(e);
|
|
1352
|
+
for (let t of Ne(e)) i.add(t);
|
|
1280
1353
|
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
part: t.part
|
|
1292
|
-
}, t.part === "link-start" || t.part === "link-end") {
|
|
1293
|
-
let r = Mn(e.clientX, e.clientY);
|
|
1294
|
-
Q.value = {
|
|
1295
|
-
from: n.id,
|
|
1296
|
-
fromEnd: t.part === "link-end",
|
|
1297
|
-
x: r.x,
|
|
1298
|
-
y: r.y,
|
|
1299
|
-
target: null,
|
|
1300
|
-
targetEnd: !1,
|
|
1301
|
-
valid: !1
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
|
-
} else t.active = !0, kn.value = {
|
|
1354
|
+
}
|
|
1355
|
+
t.moving = t.part === "body" ? [...i] : [n.id];
|
|
1356
|
+
for (let e of t.moving) {
|
|
1357
|
+
let n = B(L.value.get(e));
|
|
1358
|
+
t.spans.set(e, {
|
|
1359
|
+
start: n.start,
|
|
1360
|
+
end: n.end
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
if (W.value.has(n.id) || G([n.id]), Rn.value = {
|
|
1305
1364
|
taskId: n.id,
|
|
1306
|
-
part:
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1365
|
+
part: t.part
|
|
1366
|
+
}, t.part === "link-start" || t.part === "link-end") {
|
|
1367
|
+
let r = Hn(e.clientX, e.clientY);
|
|
1368
|
+
$.value = {
|
|
1369
|
+
from: n.id,
|
|
1370
|
+
fromEnd: t.part === "link-end",
|
|
1371
|
+
x: r.x,
|
|
1372
|
+
y: r.y,
|
|
1373
|
+
target: null,
|
|
1374
|
+
targetEnd: !1,
|
|
1375
|
+
valid: !1
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
} else t.active = !0, Rn.value = {
|
|
1379
|
+
taskId: n.id,
|
|
1380
|
+
part: "body"
|
|
1381
|
+
};
|
|
1382
|
+
t.touch && navigator.vibrate?.(10);
|
|
1383
|
+
let r = Rn.value.part;
|
|
1384
|
+
Le(r === "body" ? "grabbing" : r.startsWith("link") ? "crosshair" : "ew-resize"), lr();
|
|
1310
1385
|
}
|
|
1311
|
-
function
|
|
1312
|
-
let t =
|
|
1386
|
+
function Qn(e) {
|
|
1387
|
+
let t = Q;
|
|
1313
1388
|
if (t && t.id === e.pointerId) {
|
|
1314
|
-
if (
|
|
1315
|
-
|
|
1316
|
-
Ct.value = n, T("update:gridWidth", n);
|
|
1317
|
-
return;
|
|
1318
|
-
}
|
|
1319
|
-
if (t.kind === "pan") {
|
|
1320
|
-
let n = e.clientX - t.sx, r = e.clientY - t.sy;
|
|
1321
|
-
if (!t.moved && Math.hypot(n, r) < 4) return;
|
|
1322
|
-
t.moved = !0, J.value.scrollLeft = t.sl - n, J.value.scrollTop = t.st - r;
|
|
1389
|
+
if (Vn.x = e.clientX, Vn.y = e.clientY, t.kind === "split") {
|
|
1390
|
+
Ot(Math.round(Math.min(Math.max(120, t.w + e.clientX - t.sx), Math.max(160, X.value.width - 80))));
|
|
1323
1391
|
return;
|
|
1324
1392
|
}
|
|
1393
|
+
if (t.kind === "pan") return $n(t, e);
|
|
1325
1394
|
if (!t.active) {
|
|
1326
1395
|
let n = Math.hypot(e.clientX - t.sx, e.clientY - t.sy);
|
|
1327
1396
|
if (t.touch) {
|
|
1328
|
-
n > 8 && (
|
|
1397
|
+
n > 8 && (Q = null, Xn());
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
if (n < 4) return;
|
|
1401
|
+
if (Zn(e), !t.active) {
|
|
1402
|
+
if (t.kind === "bar" && t.part === "body") {
|
|
1403
|
+
let n = {
|
|
1404
|
+
kind: "pan",
|
|
1405
|
+
id: t.id,
|
|
1406
|
+
sx: t.sx,
|
|
1407
|
+
sy: t.sy,
|
|
1408
|
+
sl: t.sl,
|
|
1409
|
+
st: t.st,
|
|
1410
|
+
moved: !1
|
|
1411
|
+
};
|
|
1412
|
+
Q = n, $n(n, e);
|
|
1413
|
+
}
|
|
1329
1414
|
return;
|
|
1330
1415
|
}
|
|
1331
|
-
if (n < 4 || (Bn(e), !t.active)) return;
|
|
1332
1416
|
}
|
|
1333
|
-
|
|
1417
|
+
tr(e.clientX, e.clientY);
|
|
1334
1418
|
}
|
|
1335
1419
|
}
|
|
1336
|
-
function
|
|
1337
|
-
|
|
1420
|
+
function $n(e, t) {
|
|
1421
|
+
let n = t.clientX - e.sx, r = t.clientY - e.sy;
|
|
1422
|
+
!e.moved && Math.hypot(n, r) < 4 || (e.moved || (e.moved = !0, pr.value = null, Le("grabbing")), Y.value.scrollLeft = e.sl - n, Y.value.scrollTop = e.st - r);
|
|
1423
|
+
}
|
|
1424
|
+
function er(e) {
|
|
1425
|
+
return B(e).dateOnly ? 1440 : _.snap ?? Oe(Mt.value);
|
|
1338
1426
|
}
|
|
1339
|
-
function
|
|
1340
|
-
let n =
|
|
1427
|
+
function tr(e, t) {
|
|
1428
|
+
let n = Q;
|
|
1341
1429
|
if (!n || n.kind !== "bar" && n.kind !== "row" || !n.active) return;
|
|
1342
|
-
if (n.kind === "row") return
|
|
1343
|
-
let r =
|
|
1430
|
+
if (n.kind === "row") return rr(t);
|
|
1431
|
+
let r = Hn(e, t), i = (e - n.sx + (Y.value.scrollLeft - n.sl)) / Mt.value * O, a = L.value.get(n.taskId), o = N.value;
|
|
1344
1432
|
if (n.part === "link-start" || n.part === "link-end") {
|
|
1345
|
-
let i =
|
|
1346
|
-
|
|
1433
|
+
let i = nr(e, t), a = i && i !== n.taskId ? i : null, o = a ? _n(a) : void 0, s = !!o && r.x > o.x + o.w / 2;
|
|
1434
|
+
$.value = {
|
|
1347
1435
|
from: n.taskId,
|
|
1348
1436
|
fromEnd: n.part === "link-end",
|
|
1349
1437
|
x: r.x,
|
|
1350
1438
|
y: r.y,
|
|
1351
1439
|
target: a,
|
|
1352
1440
|
targetEnd: s,
|
|
1353
|
-
valid: !!a &&
|
|
1441
|
+
valid: !!a && kn(n.taskId, a)
|
|
1354
1442
|
};
|
|
1355
1443
|
return;
|
|
1356
1444
|
}
|
|
1357
1445
|
let s = /* @__PURE__ */ new Map();
|
|
1358
1446
|
if (n.part === "progress") {
|
|
1359
|
-
let e = n.spans.get(n.taskId), t =
|
|
1447
|
+
let e = n.spans.get(n.taskId), t = It(e.start), i = Math.max(1, It(e.end) - t), o = Math.round(Math.min(100, Math.max(0, (r.x - t) / i * 100)));
|
|
1360
1448
|
s.set(n.taskId, {
|
|
1361
1449
|
...a,
|
|
1362
1450
|
progress: o
|
|
1363
1451
|
});
|
|
1364
1452
|
} else if (n.part === "body") {
|
|
1365
|
-
let e = n.spans.get(n.taskId), t =
|
|
1453
|
+
let e = n.spans.get(n.taskId), t = er(a), r = be(e.start + i, t), c = B(a).dateOnly ? ve(e.start, r) : 0, l = r - e.start;
|
|
1366
1454
|
for (let e of n.moving) {
|
|
1367
1455
|
let t = o.find((t) => t.id === e), r = n.spans.get(e);
|
|
1368
|
-
if (!t || !r ||
|
|
1369
|
-
let i =
|
|
1456
|
+
if (!t || !r || R.value.has(e) && H.value.has(e)) continue;
|
|
1457
|
+
let i = B(t).dateOnly, a = i ? P(r.start, c || Math.round(l / 864e5)) : r.start + l, u = i ? P(r.end, c || Math.round(l / 864e5)) : r.end + l;
|
|
1370
1458
|
s.set(e, {
|
|
1371
1459
|
...t,
|
|
1372
|
-
...
|
|
1460
|
+
...je(t, a, u)
|
|
1373
1461
|
});
|
|
1374
1462
|
}
|
|
1375
1463
|
} else {
|
|
1376
|
-
let e = n.spans.get(n.taskId), t =
|
|
1464
|
+
let e = n.spans.get(n.taskId), t = er(a), r = B(a).dateOnly ? O : t * 6e4;
|
|
1377
1465
|
if (n.part === "start") {
|
|
1378
|
-
let o = Math.min(
|
|
1466
|
+
let o = Math.min(be(e.start + i, t), e.end - r);
|
|
1379
1467
|
s.set(n.taskId, {
|
|
1380
1468
|
...a,
|
|
1381
|
-
...
|
|
1469
|
+
...je(a, o, e.end)
|
|
1382
1470
|
});
|
|
1383
1471
|
} else {
|
|
1384
|
-
let o = Math.max(
|
|
1472
|
+
let o = Math.max(be(e.end + i, t), e.start + r);
|
|
1385
1473
|
s.set(n.taskId, {
|
|
1386
1474
|
...a,
|
|
1387
|
-
...
|
|
1475
|
+
...je(a, e.start, o)
|
|
1388
1476
|
});
|
|
1389
1477
|
}
|
|
1390
1478
|
}
|
|
1391
1479
|
let c = o.map((e) => s.get(e.id) ?? e);
|
|
1392
|
-
_.schedule === "auto" && n.part !== "progress" && (c =
|
|
1480
|
+
_.schedule === "auto" && n.part !== "progress" && (c = Pe(c, jn())), _e.value = Me(c);
|
|
1393
1481
|
}
|
|
1394
|
-
function
|
|
1482
|
+
function nr(e, t) {
|
|
1395
1483
|
let n = (document.elementFromPoint?.(e, t))?.closest("[data-gantt-task]");
|
|
1396
1484
|
if (n) return n.getAttribute("data-gantt-task");
|
|
1397
|
-
let r =
|
|
1398
|
-
return
|
|
1485
|
+
let r = Hn(e, t);
|
|
1486
|
+
return J.value[Math.floor(r.y / _.rowHeight)]?.task.id ?? null;
|
|
1399
1487
|
}
|
|
1400
|
-
function
|
|
1401
|
-
let t =
|
|
1402
|
-
|
|
1488
|
+
function rr(e) {
|
|
1489
|
+
let t = Q, n = e - Y.value.getBoundingClientRect().top - _t + Y.value.scrollTop, r = Math.max(0, Math.min(J.value.length - 1, Math.floor(n / _.rowHeight))), i = J.value[r].task, a = n / _.rowHeight - r, o = i.id === t.taskId || Ne(t.taskId).includes(i.id), s = a < .3 ? "before" : a > .7 ? "after" : "inside";
|
|
1490
|
+
Bn.value = o ? null : {
|
|
1403
1491
|
taskId: t.taskId,
|
|
1404
1492
|
target: i.id,
|
|
1405
1493
|
where: s
|
|
1406
1494
|
};
|
|
1407
1495
|
}
|
|
1408
|
-
function
|
|
1409
|
-
let r =
|
|
1496
|
+
function ir(e, t, n) {
|
|
1497
|
+
let r = A.value, i = /* @__PURE__ */ new Set([e, ...Ne(e)]), a = r.filter((e) => i.has(e.id)), o = r.filter((e) => !i.has(e.id)), s = o.findIndex((e) => e.id === t);
|
|
1410
1498
|
if (s < 0) return;
|
|
1411
1499
|
let c = o[s], l = s;
|
|
1412
1500
|
if (n !== "before") {
|
|
1413
|
-
let e = new Set(
|
|
1501
|
+
let e = new Set(Ne(t));
|
|
1414
1502
|
for (l = s + 1; l < o.length && e.has(o[l].id);) l++;
|
|
1415
1503
|
}
|
|
1416
1504
|
let u = n === "inside" ? t : c.parentId, d = {
|
|
@@ -1423,164 +1511,178 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1423
1511
|
...a,
|
|
1424
1512
|
...o.slice(l)
|
|
1425
1513
|
];
|
|
1426
|
-
n === "inside" &&
|
|
1427
|
-
let p =
|
|
1428
|
-
|
|
1514
|
+
n === "inside" && K.value.has(t) && Ue(t, !0), I(f);
|
|
1515
|
+
let p = J.value.findIndex((t) => t.task.id === e) + 1;
|
|
1516
|
+
D("change", {
|
|
1429
1517
|
tasks: [d],
|
|
1430
1518
|
kind: "reorder"
|
|
1431
|
-
}),
|
|
1519
|
+
}), v(() => Pr(k.ganttReordered.replace("{name}", d.name).replace("{pos}", String(J.value.findIndex((t) => t.task.id === e) + 1 || p))));
|
|
1432
1520
|
}
|
|
1433
|
-
function
|
|
1434
|
-
let t =
|
|
1435
|
-
if (!t || t.id !== e.pointerId || (
|
|
1521
|
+
function ar(e) {
|
|
1522
|
+
let t = Q;
|
|
1523
|
+
if (!t || t.id !== e.pointerId || (Q = null, Xn(), ur(), t.kind === "pan" || t.kind === "split")) return;
|
|
1436
1524
|
if (t.kind === "row") {
|
|
1437
|
-
|
|
1438
|
-
let e =
|
|
1439
|
-
|
|
1525
|
+
Rn.value = null;
|
|
1526
|
+
let e = Bn.value;
|
|
1527
|
+
Bn.value = null, t.active && e && ir(e.taskId, e.target, e.where);
|
|
1440
1528
|
return;
|
|
1441
1529
|
}
|
|
1442
|
-
if (
|
|
1443
|
-
let n =
|
|
1530
|
+
if (Rn.value = null, !t.active) {
|
|
1531
|
+
let n = L.value.get(t.taskId);
|
|
1444
1532
|
if (!n) return;
|
|
1445
|
-
|
|
1533
|
+
sr(n, e), e.pointerType === "touch" && vr(n.id), D("task-click", n, e);
|
|
1446
1534
|
return;
|
|
1447
1535
|
}
|
|
1448
1536
|
if (t.part === "link-start" || t.part === "link-end") {
|
|
1449
|
-
let e =
|
|
1450
|
-
|
|
1537
|
+
let e = $.value;
|
|
1538
|
+
$.value = null, e?.target && e.valid && An(e.from, e.target, e.fromEnd ? e.targetEnd ? "FF" : "FS" : e.targetEnd ? "SF" : "SS");
|
|
1451
1539
|
return;
|
|
1452
1540
|
}
|
|
1453
|
-
let n =
|
|
1454
|
-
if (
|
|
1455
|
-
let r = new Map(
|
|
1541
|
+
let n = _e.value;
|
|
1542
|
+
if (_e.value = null, !n) return;
|
|
1543
|
+
let r = new Map(N.value.map((e) => [e.id, e])), i = n.filter((e) => r.get(e.id) && r.get(e.id) !== e && !(R.value.has(e.id) && H.value.has(e.id)));
|
|
1456
1544
|
if (!i.length) return;
|
|
1457
1545
|
let a = new Map(n.map((e) => [e.id, e]));
|
|
1458
|
-
|
|
1546
|
+
I(A.value.map((e) => i.some((t) => t.id === e.id) ? a.get(e.id) : e));
|
|
1459
1547
|
let o = t.part === "progress" ? "progress" : t.part === "body" ? "move" : "resize";
|
|
1460
|
-
|
|
1548
|
+
D("change", {
|
|
1461
1549
|
tasks: i,
|
|
1462
1550
|
kind: o
|
|
1463
1551
|
});
|
|
1464
1552
|
let s = a.get(t.taskId);
|
|
1465
|
-
|
|
1553
|
+
Pr(o === "progress" ? k.ganttProgressSet.replace("{name}", s.name).replace("{progress}", String(s.progress ?? 0)) : k.ganttMoved.replace("{name}", s.name).replace("{start}", Cr(s.start)).replace("{end}", Cr(s.end ?? s.start)));
|
|
1466
1554
|
}
|
|
1467
|
-
function
|
|
1468
|
-
|
|
1555
|
+
function or(e) {
|
|
1556
|
+
Q && Q.id === e.pointerId && (Q = null, Xn(), ur(), _e.value = null, Rn.value = null, $.value = null, Bn.value = null);
|
|
1469
1557
|
}
|
|
1470
|
-
function
|
|
1471
|
-
|
|
1558
|
+
function sr(e, t) {
|
|
1559
|
+
Tn.value = null, e.selectable !== !1 && (t.shiftKey || t.metaKey || t.ctrlKey ? G(W.value.has(e.id) ? U.value.filter((t) => t !== e.id) : [...U.value, e.id]) : G([e.id]), jr.value = e.id);
|
|
1472
1560
|
}
|
|
1473
|
-
let
|
|
1474
|
-
function
|
|
1475
|
-
if (
|
|
1561
|
+
let cr = 0;
|
|
1562
|
+
function lr() {
|
|
1563
|
+
if (cr) return;
|
|
1476
1564
|
let e = () => {
|
|
1477
|
-
|
|
1478
|
-
let t =
|
|
1479
|
-
if (!t || !
|
|
1480
|
-
let n = t.getBoundingClientRect(), r = n.left +
|
|
1481
|
-
|
|
1565
|
+
cr = requestAnimationFrame(e);
|
|
1566
|
+
let t = Y.value;
|
|
1567
|
+
if (!t || !Q || !("active" in Q) || !Q.active) return;
|
|
1568
|
+
let n = t.getBoundingClientRect(), r = n.left + kt.value, i = 0, a = 0;
|
|
1569
|
+
Q.kind === "bar" && (Vn.x < r + 40 ? i = -Math.ceil((r + 40 - Vn.x) / 4) : Vn.x > n.right - 40 && (i = Math.ceil((Vn.x - n.right + 40) / 4))), Vn.y < n.top + _t + 40 ? a = -Math.ceil((n.top + _t + 40 - Vn.y) / 4) : Vn.y > n.bottom - 40 && (a = Math.ceil((Vn.y - n.bottom + 40) / 4)), (i || a) && (t.scrollLeft += i, t.scrollTop += a, tr(Vn.x, Vn.y));
|
|
1482
1570
|
};
|
|
1483
|
-
|
|
1571
|
+
cr = requestAnimationFrame(e);
|
|
1484
1572
|
}
|
|
1485
|
-
function
|
|
1486
|
-
cancelAnimationFrame(
|
|
1573
|
+
function ur() {
|
|
1574
|
+
cancelAnimationFrame(cr), cr = 0;
|
|
1487
1575
|
}
|
|
1488
|
-
function
|
|
1489
|
-
|
|
1576
|
+
function dr(e) {
|
|
1577
|
+
jt.pinchMove(e) || Q && "active" in Q && Q.active && e.cancelable && e.preventDefault();
|
|
1490
1578
|
}
|
|
1491
|
-
function
|
|
1492
|
-
|
|
1579
|
+
function fr() {
|
|
1580
|
+
jt.readView(), pr.value = null, Q || (mr.value = null);
|
|
1493
1581
|
}
|
|
1494
|
-
let
|
|
1495
|
-
function
|
|
1496
|
-
if (e.pointerType === "touch") return;
|
|
1497
|
-
clearTimeout(
|
|
1582
|
+
let pr = S(null), mr = S(null), hr;
|
|
1583
|
+
function gr(e, t) {
|
|
1584
|
+
if (e.pointerType === "touch" || Q) return;
|
|
1585
|
+
clearTimeout(hr);
|
|
1498
1586
|
let n = e.currentTarget;
|
|
1499
|
-
|
|
1587
|
+
hr = setTimeout(() => {
|
|
1500
1588
|
let e = n.getBoundingClientRect();
|
|
1501
|
-
|
|
1589
|
+
pr.value = {
|
|
1502
1590
|
id: t.id,
|
|
1503
1591
|
x: e.left + e.width / 2,
|
|
1504
1592
|
y: e.top
|
|
1505
1593
|
};
|
|
1506
1594
|
}, 450);
|
|
1507
1595
|
}
|
|
1508
|
-
function
|
|
1509
|
-
clearTimeout(
|
|
1596
|
+
function _r() {
|
|
1597
|
+
clearTimeout(hr), pr.value = null;
|
|
1598
|
+
}
|
|
1599
|
+
function vr(e) {
|
|
1600
|
+
if (mr.value?.id === e) {
|
|
1601
|
+
mr.value = null;
|
|
1602
|
+
return;
|
|
1603
|
+
}
|
|
1604
|
+
let t = (ln.get(e)?.querySelector("[data-gantt-task]") ?? ln.get(e))?.getBoundingClientRect(), n = Y.value?.getBoundingClientRect();
|
|
1605
|
+
if (!t) return;
|
|
1606
|
+
let r = Math.max(t.left, (n?.left ?? 0) + kt.value), i = Math.min(t.right, n?.right ?? window.innerWidth);
|
|
1607
|
+
mr.value = {
|
|
1608
|
+
id: e,
|
|
1609
|
+
x: i > r ? (r + i) / 2 : t.left + t.width / 2,
|
|
1610
|
+
y: t.top
|
|
1611
|
+
};
|
|
1510
1612
|
}
|
|
1511
|
-
let
|
|
1512
|
-
let e =
|
|
1513
|
-
return e ?
|
|
1514
|
-
}),
|
|
1613
|
+
let yr = l(() => pr.value ?? mr.value), br = l(() => {
|
|
1614
|
+
let e = Rn.value?.taskId ?? yr.value?.id;
|
|
1615
|
+
return e ? L.value.get(e) : void 0;
|
|
1616
|
+
}), xr = S({
|
|
1515
1617
|
x: 0,
|
|
1516
1618
|
y: 0
|
|
1517
|
-
});
|
|
1518
|
-
|
|
1519
|
-
if (
|
|
1520
|
-
let e =
|
|
1521
|
-
e && (
|
|
1619
|
+
}), Sr = (e) => Math.min(Math.max(e, 120), window.innerWidth - 120);
|
|
1620
|
+
E([br, yr], () => {
|
|
1621
|
+
if (Rn.value) {
|
|
1622
|
+
let e = ln.get(Rn.value.taskId)?.getBoundingClientRect();
|
|
1623
|
+
e && (xr.value = {
|
|
1522
1624
|
x: e.left + e.width / 2,
|
|
1523
1625
|
y: e.top
|
|
1524
1626
|
});
|
|
1525
|
-
} else
|
|
1526
|
-
x:
|
|
1527
|
-
y:
|
|
1627
|
+
} else yr.value && (xr.value = {
|
|
1628
|
+
x: Sr(yr.value.x),
|
|
1629
|
+
y: yr.value.y
|
|
1528
1630
|
});
|
|
1529
|
-
}, { flush: "post" }),
|
|
1530
|
-
|
|
1531
|
-
let e =
|
|
1532
|
-
e && (
|
|
1533
|
-
x:
|
|
1631
|
+
}, { flush: "post" }), E(_e, () => {
|
|
1632
|
+
Rn.value && v(() => {
|
|
1633
|
+
let e = ln.get(Rn.value?.taskId ?? "")?.getBoundingClientRect();
|
|
1634
|
+
e && (xr.value = {
|
|
1635
|
+
x: Sr(e.left + e.width / 2),
|
|
1534
1636
|
y: e.top
|
|
1535
1637
|
});
|
|
1536
1638
|
});
|
|
1537
1639
|
});
|
|
1538
|
-
function
|
|
1539
|
-
let t =
|
|
1640
|
+
function Cr(e) {
|
|
1641
|
+
let t = j(e);
|
|
1540
1642
|
if (Number.isNaN(t)) return "";
|
|
1541
1643
|
let n = {
|
|
1542
1644
|
day: "numeric",
|
|
1543
1645
|
month: "short"
|
|
1544
1646
|
};
|
|
1545
|
-
return new Date(t).getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() && (n.year = "2-digit"), /^\d{4}-\d{2}-\d{2}$/.test(e) || (n.hour = "numeric", n.minute = "2-digit"), new Intl.DateTimeFormat(
|
|
1647
|
+
return new Date(t).getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() && (n.year = "2-digit"), /^\d{4}-\d{2}-\d{2}$/.test(e) || (n.hour = "numeric", n.minute = "2-digit"), new Intl.DateTimeFormat(ge.value, n).format(t);
|
|
1546
1648
|
}
|
|
1547
|
-
function
|
|
1548
|
-
if (
|
|
1549
|
-
let t =
|
|
1550
|
-
return
|
|
1649
|
+
function wr(e) {
|
|
1650
|
+
if (z(e)) return k.ganttMilestone;
|
|
1651
|
+
let t = V(e);
|
|
1652
|
+
return B(e).dateOnly || t >= 1 ? k.ganttDays.replace("{n}", String(Math.round(t * 10) / 10)) : k.ganttHours.replace("{n}", String(Math.round(t * 24 * 10) / 10));
|
|
1551
1653
|
}
|
|
1552
|
-
let
|
|
1553
|
-
let e =
|
|
1554
|
-
return
|
|
1654
|
+
let Tr = l(() => {
|
|
1655
|
+
let e = Yt.value.reduce((e, t) => e + (t.key === "name" && !t.width ? 0 : t.width ?? 100), 0);
|
|
1656
|
+
return Yt.value.map((t) => t.key === "name" && !t.width ? Math.max(120, Dt.value - e) : t.width ?? 100);
|
|
1555
1657
|
});
|
|
1556
|
-
function
|
|
1658
|
+
function Er(e, t) {
|
|
1557
1659
|
if (t.format) return t.format(e);
|
|
1558
1660
|
switch (t.key) {
|
|
1559
1661
|
case "name": return e.name;
|
|
1560
|
-
case "start": return
|
|
1561
|
-
case "end": return
|
|
1562
|
-
case "duration": return
|
|
1563
|
-
case "progress": return
|
|
1662
|
+
case "start": return Cr(e.start);
|
|
1663
|
+
case "end": return z(e) ? "" : Cr(e.end ?? e.start);
|
|
1664
|
+
case "duration": return wr(e);
|
|
1665
|
+
case "progress": return z(e) ? "" : `${Math.round(e.progress ?? 0)}%`;
|
|
1564
1666
|
}
|
|
1565
1667
|
let n = e.data?.[t.key] ?? e[t.key];
|
|
1566
1668
|
return n == null ? "" : String(n);
|
|
1567
1669
|
}
|
|
1568
|
-
function
|
|
1670
|
+
function Dr(e) {
|
|
1569
1671
|
if (!_.baselines || !e.baselineStart) return null;
|
|
1570
|
-
let t =
|
|
1672
|
+
let t = B({
|
|
1571
1673
|
start: e.baselineStart,
|
|
1572
1674
|
end: e.baselineEnd ?? (e.end ? e.baselineStart : void 0),
|
|
1573
1675
|
type: e.type
|
|
1574
1676
|
});
|
|
1575
1677
|
return Number.isFinite(t.start) ? {
|
|
1576
|
-
x:
|
|
1577
|
-
w: Math.max(4,
|
|
1678
|
+
x: It(t.start),
|
|
1679
|
+
w: Math.max(4, It(t.end) - It(t.start))
|
|
1578
1680
|
} : null;
|
|
1579
1681
|
}
|
|
1580
|
-
let
|
|
1581
|
-
let t =
|
|
1682
|
+
let Or = (e) => {
|
|
1683
|
+
let t = sn.value.get(e.id);
|
|
1582
1684
|
return !!t && t.w > e.name.length * 7 + 24;
|
|
1583
|
-
},
|
|
1685
|
+
}, kr = {
|
|
1584
1686
|
primary: {
|
|
1585
1687
|
bar: "bg-primary-container text-on-primary-container",
|
|
1586
1688
|
fill: "bg-primary/30",
|
|
@@ -1612,102 +1714,102 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1612
1714
|
solid: "bg-on-surface-variant text-on-surface-variant"
|
|
1613
1715
|
}
|
|
1614
1716
|
};
|
|
1615
|
-
function
|
|
1616
|
-
return
|
|
1717
|
+
function Ar(e) {
|
|
1718
|
+
return an.value.has(e.id) && !(R.value.has(e.id) && H.value.has(e.id)) ? kr.error : kr[e.color ?? (R.value.has(e.id) ? "neutral" : "primary")] ?? kr.primary;
|
|
1617
1719
|
}
|
|
1618
|
-
let
|
|
1619
|
-
function
|
|
1620
|
-
|
|
1621
|
-
|
|
1720
|
+
let jr = S(null), Mr = l(() => jr.value && bt.value.has(jr.value) ? jr.value : J.value[0]?.task.id), Nr = S("");
|
|
1721
|
+
function Pr(e) {
|
|
1722
|
+
Nr.value = "", v(() => {
|
|
1723
|
+
Nr.value = e;
|
|
1622
1724
|
});
|
|
1623
1725
|
}
|
|
1624
|
-
let
|
|
1625
|
-
function
|
|
1626
|
-
let t =
|
|
1627
|
-
t && !_.readonly && (
|
|
1628
|
-
let e =
|
|
1726
|
+
let Fr = S(null), Ir = S("");
|
|
1727
|
+
function Lr(e) {
|
|
1728
|
+
let t = L.value.get(e);
|
|
1729
|
+
t && !_.readonly && (Fr.value = e, Ir.value = t.name, v(() => {
|
|
1730
|
+
let e = Y.value?.querySelector("[data-gantt-rename]");
|
|
1629
1731
|
e?.focus(), e?.select();
|
|
1630
1732
|
}));
|
|
1631
1733
|
}
|
|
1632
|
-
function
|
|
1633
|
-
let t =
|
|
1734
|
+
function Rr(e) {
|
|
1735
|
+
let t = Fr.value;
|
|
1634
1736
|
if (!t) return;
|
|
1635
|
-
|
|
1636
|
-
let n =
|
|
1637
|
-
if (e && n &&
|
|
1737
|
+
Fr.value = null;
|
|
1738
|
+
let n = A.value.find((e) => e.id === t);
|
|
1739
|
+
if (e && n && Ir.value.trim() && Ir.value !== n.name) {
|
|
1638
1740
|
let e = {
|
|
1639
1741
|
...n,
|
|
1640
|
-
name:
|
|
1742
|
+
name: Ir.value.trim()
|
|
1641
1743
|
};
|
|
1642
|
-
|
|
1744
|
+
I(A.value.map((n) => n.id === t ? e : n)), D("change", {
|
|
1643
1745
|
tasks: [e],
|
|
1644
1746
|
kind: "rename"
|
|
1645
1747
|
});
|
|
1646
1748
|
}
|
|
1647
|
-
|
|
1749
|
+
zr(t);
|
|
1648
1750
|
}
|
|
1649
|
-
function
|
|
1650
|
-
|
|
1751
|
+
function zr(e) {
|
|
1752
|
+
jr.value = e, v(() => Y.value?.querySelector(`[data-gantt-row="${CSS.escape(e)}"]`)?.focus({ preventScroll: !0 }));
|
|
1651
1753
|
}
|
|
1652
|
-
function
|
|
1653
|
-
let r =
|
|
1654
|
-
n && s <= r.start && (s = r.dateOnly ?
|
|
1655
|
-
let c = n ? [e.id] : [e.id, ...
|
|
1656
|
-
if (!c.includes(n.id) ||
|
|
1754
|
+
function Br(e, t, n) {
|
|
1755
|
+
let r = B(e), i = er(e), a = (e) => r.dateOnly ? P(e, t) : e + t * i * 6e4, o = n ? r.start : a(r.start), s = a(r.end);
|
|
1756
|
+
n && s <= r.start && (s = r.dateOnly ? P(r.start, 1) : r.start + i * 6e4);
|
|
1757
|
+
let c = n ? [e.id] : [e.id, ...Ne(e.id)], l = A.value.map((n) => {
|
|
1758
|
+
if (!c.includes(n.id) || R.value.has(n.id) && H.value.has(n.id)) return n;
|
|
1657
1759
|
if (n.id === e.id) return {
|
|
1658
1760
|
...n,
|
|
1659
|
-
...
|
|
1761
|
+
...je(n, o, s)
|
|
1660
1762
|
};
|
|
1661
|
-
let r =
|
|
1763
|
+
let r = B(n);
|
|
1662
1764
|
return {
|
|
1663
1765
|
...n,
|
|
1664
|
-
...
|
|
1766
|
+
...je(n, r.dateOnly ? P(r.start, t) : r.start + t * i * 6e4, r.dateOnly ? P(r.end, t) : r.end + t * i * 6e4)
|
|
1665
1767
|
};
|
|
1666
|
-
}), u = _.schedule === "auto" ?
|
|
1667
|
-
|
|
1668
|
-
let d =
|
|
1669
|
-
|
|
1768
|
+
}), u = _.schedule === "auto" ? Pe(l, jn()) : l;
|
|
1769
|
+
I(u);
|
|
1770
|
+
let d = Me(u).find((t) => t.id === e.id);
|
|
1771
|
+
D("change", {
|
|
1670
1772
|
tasks: [d],
|
|
1671
1773
|
kind: n ? "resize" : "move"
|
|
1672
|
-
}),
|
|
1774
|
+
}), Pr(k.ganttMoved.replace("{name}", d.name).replace("{start}", Cr(d.start)).replace("{end}", Cr(d.end ?? d.start)));
|
|
1673
1775
|
}
|
|
1674
|
-
function
|
|
1675
|
-
if (
|
|
1676
|
-
let n =
|
|
1677
|
-
let n =
|
|
1678
|
-
n && (
|
|
1776
|
+
function Vr(e, t) {
|
|
1777
|
+
if (Fr.value) return;
|
|
1778
|
+
let n = bt.value.get(t.id) ?? 0, r = e.ctrlKey || e.metaKey, i = (t) => {
|
|
1779
|
+
let n = J.value[Math.max(0, Math.min(J.value.length - 1, t))];
|
|
1780
|
+
n && (zr(n.task.id), e.shiftKey ? G([.../* @__PURE__ */ new Set([...U.value, n.task.id])]) : G([n.task.id]), Xt(n.task.id));
|
|
1679
1781
|
}, a = !_.readonly;
|
|
1680
1782
|
if (e.altKey && a && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
1681
|
-
e.preventDefault(), t.draggable !== !1 &&
|
|
1783
|
+
e.preventDefault(), t.draggable !== !1 && Br(t, e.key === "ArrowLeft" ? -1 : 1, e.shiftKey);
|
|
1682
1784
|
return;
|
|
1683
1785
|
}
|
|
1684
1786
|
if (e.altKey && a && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1685
1787
|
e.preventDefault();
|
|
1686
|
-
let n =
|
|
1687
|
-
r &&
|
|
1788
|
+
let n = H.value.get(t.parentId && L.value.has(t.parentId) ? t.parentId : void 0) ?? [], r = n[n.findIndex((e) => e.id === t.id) + (e.key === "ArrowUp" ? -1 : 1)];
|
|
1789
|
+
r && ir(t.id, r.id, e.key === "ArrowUp" ? "before" : "after"), zr(t.id);
|
|
1688
1790
|
return;
|
|
1689
1791
|
}
|
|
1690
1792
|
if (r && a && (e.key === "]" || e.key === "[")) {
|
|
1691
1793
|
if (e.preventDefault(), e.key === "]") {
|
|
1692
|
-
let e =
|
|
1794
|
+
let e = H.value.get(t.parentId && L.value.has(t.parentId) ? t.parentId : void 0) ?? [], n = e[e.findIndex((e) => e.id === t.id) - 1];
|
|
1693
1795
|
if (n) {
|
|
1694
|
-
let e = (
|
|
1695
|
-
e ?
|
|
1796
|
+
let e = (H.value.get(n.id) ?? []).at(-1);
|
|
1797
|
+
e ? ir(t.id, e.id, "after") : ir(t.id, n.id, "inside");
|
|
1696
1798
|
}
|
|
1697
|
-
} else t.parentId &&
|
|
1698
|
-
|
|
1799
|
+
} else t.parentId && L.value.has(t.parentId) && ir(t.id, t.parentId, "after");
|
|
1800
|
+
zr(t.id);
|
|
1699
1801
|
return;
|
|
1700
1802
|
}
|
|
1701
1803
|
if (r && e.key.toLowerCase() === "z") {
|
|
1702
|
-
e.preventDefault(), e.shiftKey ?
|
|
1804
|
+
e.preventDefault(), e.shiftKey ? Te() : we();
|
|
1703
1805
|
return;
|
|
1704
1806
|
}
|
|
1705
1807
|
if (r && e.key.toLowerCase() === "y") {
|
|
1706
|
-
e.preventDefault(),
|
|
1808
|
+
e.preventDefault(), Te();
|
|
1707
1809
|
return;
|
|
1708
1810
|
}
|
|
1709
1811
|
if (r && e.key.toLowerCase() === "a") {
|
|
1710
|
-
e.preventDefault(),
|
|
1812
|
+
e.preventDefault(), G(J.value.map((e) => e.task.id));
|
|
1711
1813
|
return;
|
|
1712
1814
|
}
|
|
1713
1815
|
switch (e.key) {
|
|
@@ -1721,44 +1823,44 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1721
1823
|
e.preventDefault(), i(0);
|
|
1722
1824
|
break;
|
|
1723
1825
|
case "End":
|
|
1724
|
-
e.preventDefault(), i(
|
|
1826
|
+
e.preventDefault(), i(J.value.length - 1);
|
|
1725
1827
|
break;
|
|
1726
1828
|
case "ArrowRight":
|
|
1727
|
-
e.preventDefault(),
|
|
1829
|
+
e.preventDefault(), H.value.has(t.id) && K.value.has(t.id) ? Ue(t.id, !0) : H.value.has(t.id) && i(n + 1);
|
|
1728
1830
|
break;
|
|
1729
1831
|
case "ArrowLeft":
|
|
1730
|
-
e.preventDefault(),
|
|
1832
|
+
e.preventDefault(), H.value.has(t.id) && !K.value.has(t.id) ? Ue(t.id, !1) : t.parentId && bt.value.has(t.parentId) && i(bt.value.get(t.parentId));
|
|
1731
1833
|
break;
|
|
1732
1834
|
case " ":
|
|
1733
|
-
e.preventDefault(), W
|
|
1835
|
+
e.preventDefault(), G(W.value.has(t.id) ? U.value.filter((e) => e !== t.id) : [...U.value, t.id]);
|
|
1734
1836
|
break;
|
|
1735
1837
|
case "Enter":
|
|
1736
|
-
e.preventDefault(),
|
|
1838
|
+
e.preventDefault(), D("task-dblclick", t, e);
|
|
1737
1839
|
break;
|
|
1738
1840
|
case "F2":
|
|
1739
|
-
e.preventDefault(),
|
|
1841
|
+
e.preventDefault(), Lr(t.id);
|
|
1740
1842
|
break;
|
|
1741
1843
|
case "Delete":
|
|
1742
1844
|
case "Backspace":
|
|
1743
1845
|
if (!a) break;
|
|
1744
|
-
e.preventDefault(),
|
|
1846
|
+
e.preventDefault(), Pn(W.value.has(t.id) ? U.value : [t.id]);
|
|
1745
1847
|
}
|
|
1746
1848
|
}
|
|
1747
|
-
function
|
|
1748
|
-
if ((e.key === "Delete" || e.key === "Backspace") &&
|
|
1849
|
+
function Hr(e) {
|
|
1850
|
+
if ((e.key === "Delete" || e.key === "Backspace") && Tn.value && !_.readonly) {
|
|
1749
1851
|
e.preventDefault();
|
|
1750
|
-
let [t, n] =
|
|
1751
|
-
|
|
1852
|
+
let [t, n] = Tn.value.split(">");
|
|
1853
|
+
Dn(t, n);
|
|
1752
1854
|
}
|
|
1753
1855
|
}
|
|
1754
|
-
let
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
}),
|
|
1758
|
-
if (!
|
|
1759
|
-
let e =
|
|
1760
|
-
for (let r of
|
|
1761
|
-
let i = r.dataset.ganttFlip, a =
|
|
1856
|
+
let Ur = /* @__PURE__ */ new Map();
|
|
1857
|
+
te(() => {
|
|
1858
|
+
Q && "active" in Q && Q.active || (Ur = new Map(J.value.map((e, t) => [e.task.id, t * _.rowHeight])));
|
|
1859
|
+
}), re(() => {
|
|
1860
|
+
if (!Ur.size || i()) return;
|
|
1861
|
+
let e = bt.value;
|
|
1862
|
+
for (let r of Y.value?.querySelectorAll("[data-gantt-flip]") ?? []) {
|
|
1863
|
+
let i = r.dataset.ganttFlip, a = Ur.get(i), o = e.get(i);
|
|
1762
1864
|
if (a === void 0 || o === void 0) continue;
|
|
1763
1865
|
let s = a - o * _.rowHeight;
|
|
1764
1866
|
if (Math.abs(s) < 1 || Math.abs(s) > _.rowHeight * 40) continue;
|
|
@@ -1768,89 +1870,93 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1768
1870
|
}, .5);
|
|
1769
1871
|
n(r, c, (e) => ({ translate: `0 ${e}px` }));
|
|
1770
1872
|
}
|
|
1771
|
-
|
|
1873
|
+
Ur.clear();
|
|
1772
1874
|
});
|
|
1773
|
-
let
|
|
1774
|
-
tasks: l(() =>
|
|
1775
|
-
selection: l(() =>
|
|
1776
|
-
scale:
|
|
1777
|
-
pxPerDay:
|
|
1875
|
+
let Wr = {
|
|
1876
|
+
tasks: l(() => F.value),
|
|
1877
|
+
selection: l(() => U.value),
|
|
1878
|
+
scale: Gt,
|
|
1879
|
+
pxPerDay: Mt,
|
|
1778
1880
|
readonly: l(() => _.readonly),
|
|
1779
|
-
canUndo:
|
|
1780
|
-
canRedo:
|
|
1781
|
-
collapsed: l(() =>
|
|
1782
|
-
undo:
|
|
1783
|
-
redo:
|
|
1784
|
-
zoomIn:
|
|
1785
|
-
zoomOut:
|
|
1786
|
-
setScale:
|
|
1787
|
-
scrollToDate:
|
|
1788
|
-
scrollToTask:
|
|
1789
|
-
toggle:
|
|
1790
|
-
expandAll: () =>
|
|
1791
|
-
collapseAll: () =>
|
|
1792
|
-
setSelection:
|
|
1793
|
-
addTasks:
|
|
1794
|
-
updateTask:
|
|
1795
|
-
removeTasks:
|
|
1796
|
-
link:
|
|
1797
|
-
unlink:
|
|
1798
|
-
schedule:
|
|
1799
|
-
criticalPath:
|
|
1800
|
-
dateAt:
|
|
1881
|
+
canUndo: Ee,
|
|
1882
|
+
canRedo: De,
|
|
1883
|
+
collapsed: l(() => ze.value),
|
|
1884
|
+
undo: we,
|
|
1885
|
+
redo: Te,
|
|
1886
|
+
zoomIn: Rt,
|
|
1887
|
+
zoomOut: zt,
|
|
1888
|
+
setScale: Bt,
|
|
1889
|
+
scrollToDate: Vt,
|
|
1890
|
+
scrollToTask: Xt,
|
|
1891
|
+
toggle: Ue,
|
|
1892
|
+
expandAll: () => Ve([]),
|
|
1893
|
+
collapseAll: () => Ve([...H.value.keys()].filter((e) => !!e)),
|
|
1894
|
+
setSelection: G,
|
|
1895
|
+
addTasks: Mn,
|
|
1896
|
+
updateTask: Nn,
|
|
1897
|
+
removeTasks: Pn,
|
|
1898
|
+
link: An,
|
|
1899
|
+
unlink: Dn,
|
|
1900
|
+
schedule: Fn,
|
|
1901
|
+
criticalPath: rn,
|
|
1902
|
+
dateAt: In,
|
|
1903
|
+
gridCollapsed: l(() => Ct.value),
|
|
1904
|
+
setGridCollapsed: wt,
|
|
1905
|
+
fit: Kt
|
|
1801
1906
|
};
|
|
1802
|
-
return
|
|
1803
|
-
...
|
|
1804
|
-
foldable: l(() =>
|
|
1805
|
-
folded: l(() =>
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
e
|
|
1809
|
-
|
|
1810
|
-
|
|
1907
|
+
return ie(pe, Wr), ie(me, {
|
|
1908
|
+
...Wr,
|
|
1909
|
+
foldable: l(() => H.value.size > 1),
|
|
1910
|
+
folded: l(() => ze.value.length > 0),
|
|
1911
|
+
hasList: l(() => St.value.length > 0)
|
|
1912
|
+
}), ne(() => {
|
|
1913
|
+
let e = Y.value;
|
|
1914
|
+
e.addEventListener("touchmove", dr, { passive: !1 }), v(() => {
|
|
1915
|
+
let t = Ft.value, n = t !== null && t >= At.value.min && t <= At.value.max ? t : At.value.min;
|
|
1916
|
+
e.scrollLeft = Math.max(0, It(n) - Math.min(80, Nt.value / 4)), X.value.left = e.scrollLeft;
|
|
1811
1917
|
});
|
|
1812
|
-
}),
|
|
1813
|
-
|
|
1814
|
-
}), a(
|
|
1918
|
+
}), ee(() => {
|
|
1919
|
+
Y.value?.removeEventListener("touchmove", dr), Xn(), ur(), cancelAnimationFrame(dn), clearTimeout(hr);
|
|
1920
|
+
}), a(Wr), (e, t) => (x(), f("div", {
|
|
1815
1921
|
class: "m3-gantt flex flex-col overflow-hidden rounded-md bg-surface text-on-surface",
|
|
1816
|
-
onKeydown:
|
|
1922
|
+
onKeydown: Hr
|
|
1817
1923
|
}, [
|
|
1818
|
-
|
|
1924
|
+
ae(e.$slots, "default", { gantt: Wr }),
|
|
1819
1925
|
p("div", {
|
|
1820
1926
|
ref_key: "scroller",
|
|
1821
|
-
ref:
|
|
1927
|
+
ref: Y,
|
|
1822
1928
|
class: "relative min-h-0 flex-1 touch-pan-x touch-pan-y overflow-auto overscroll-contain",
|
|
1823
|
-
onScrollPassive:
|
|
1824
|
-
onTouchstartPassive: t[
|
|
1825
|
-
onTouchendPassive: t[
|
|
1826
|
-
onContextmenu: t[
|
|
1929
|
+
onScrollPassive: fr,
|
|
1930
|
+
onTouchstartPassive: t[13] ||= (...e) => T(jt).onTouchStart && T(jt).onTouchStart(...e),
|
|
1931
|
+
onTouchendPassive: t[14] ||= (...e) => T(jt).onTouchEnd && T(jt).onTouchEnd(...e),
|
|
1932
|
+
onContextmenu: t[15] ||= (e) => T(Q) && e.preventDefault()
|
|
1827
1933
|
}, [p("div", {
|
|
1828
1934
|
class: "relative",
|
|
1829
|
-
style:
|
|
1830
|
-
width: `${
|
|
1831
|
-
height: `${
|
|
1935
|
+
style: b({
|
|
1936
|
+
width: `${kt.value + T(Z)}px`,
|
|
1937
|
+
height: `${_t + en.value}px`
|
|
1832
1938
|
})
|
|
1833
1939
|
}, [p("div", {
|
|
1834
1940
|
class: "sticky top-0 z-20 flex",
|
|
1835
|
-
style:
|
|
1836
|
-
height: `${
|
|
1837
|
-
width: `${
|
|
1941
|
+
style: b({
|
|
1942
|
+
height: `${_t}px`,
|
|
1943
|
+
width: `${kt.value + T(Z)}px`
|
|
1838
1944
|
})
|
|
1839
|
-
}, [
|
|
1945
|
+
}, [Tt.value ? (x(), f("div", {
|
|
1840
1946
|
key: 0,
|
|
1841
1947
|
class: "sticky left-0 z-10 flex shrink-0 items-end border-r border-b border-outline-variant bg-surface-container-low text-label-medium text-on-surface-variant",
|
|
1842
|
-
style:
|
|
1948
|
+
style: b({ width: `${kt.value}px` }),
|
|
1843
1949
|
role: "row"
|
|
1844
|
-
}, [(
|
|
1950
|
+
}, [(x(!0), f(s, null, C(Yt.value, (e, t) => (x(), f("div", {
|
|
1845
1951
|
key: e.key,
|
|
1846
1952
|
role: "columnheader",
|
|
1847
|
-
class:
|
|
1848
|
-
style:
|
|
1849
|
-
},
|
|
1850
|
-
width:
|
|
1851
|
-
"top-cells":
|
|
1852
|
-
"bottom-cells":
|
|
1853
|
-
"today-x":
|
|
1953
|
+
class: y(["truncate px-3 pb-2", e.align === "end" ? "text-right" : e.align === "center" ? "text-center" : ""]),
|
|
1954
|
+
style: b({ width: `${Tr.value[t]}px` })
|
|
1955
|
+
}, w(e.label ?? e.key), 7))), 128))], 4)) : d("", !0), h(Be, {
|
|
1956
|
+
width: T(Z),
|
|
1957
|
+
"top-cells": T(Ht),
|
|
1958
|
+
"bottom-cells": T(Ut),
|
|
1959
|
+
"today-x": T(Ft) === null ? null : T(It)(T(Ft))
|
|
1854
1960
|
}, null, 8, [
|
|
1855
1961
|
"width",
|
|
1856
1962
|
"top-cells",
|
|
@@ -1858,318 +1964,319 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
1858
1964
|
"today-x"
|
|
1859
1965
|
])], 4), p("div", {
|
|
1860
1966
|
class: "flex",
|
|
1861
|
-
style:
|
|
1862
|
-
}, [
|
|
1967
|
+
style: b({ height: `${en.value}px` })
|
|
1968
|
+
}, [Tt.value ? (x(), f("div", {
|
|
1863
1969
|
key: 0,
|
|
1864
1970
|
class: "sticky left-0 z-10 shrink-0 border-r border-outline-variant bg-surface",
|
|
1865
|
-
style:
|
|
1971
|
+
style: b({ width: `${kt.value}px` }),
|
|
1866
1972
|
role: "treegrid",
|
|
1867
|
-
"aria-label": r.label ??
|
|
1868
|
-
"aria-rowcount":
|
|
1973
|
+
"aria-label": r.label ?? T(k).ganttChart,
|
|
1974
|
+
"aria-rowcount": J.value.length,
|
|
1869
1975
|
"aria-multiselectable": "true"
|
|
1870
1976
|
}, [
|
|
1871
|
-
(
|
|
1977
|
+
(x(!0), f(s, null, C($t.value, (n) => (x(), f("div", {
|
|
1872
1978
|
key: n.task.id,
|
|
1873
1979
|
"data-gantt-row": n.task.id,
|
|
1874
1980
|
"data-gantt-flip": n.task.id,
|
|
1875
1981
|
role: "row",
|
|
1876
1982
|
"aria-level": n.depth + 1,
|
|
1877
1983
|
"aria-rowindex": n.index + 1,
|
|
1878
|
-
"aria-expanded": n.parent ? !
|
|
1879
|
-
"aria-selected":
|
|
1880
|
-
tabindex:
|
|
1881
|
-
class:
|
|
1882
|
-
style:
|
|
1984
|
+
"aria-expanded": n.parent ? !K.value.has(n.task.id) : void 0,
|
|
1985
|
+
"aria-selected": W.value.has(n.task.id),
|
|
1986
|
+
tabindex: Mr.value === n.task.id ? 0 : -1,
|
|
1987
|
+
class: y(["m3-gantt-row absolute inset-x-0 flex items-center text-body-medium outline-none select-none focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-inset", [W.value.has(n.task.id) ? "bg-secondary-container text-on-secondary-container" : "hover:bg-on-surface/8", Rn.value?.taskId === n.task.id && !Rn.value?.part.startsWith("link") && Bn.value ? "opacity-50" : ""]]),
|
|
1988
|
+
style: b({
|
|
1883
1989
|
top: `${n.index * r.rowHeight}px`,
|
|
1884
1990
|
height: `${r.rowHeight}px`
|
|
1885
1991
|
}),
|
|
1886
|
-
onPointerdown: (e) =>
|
|
1887
|
-
onClick: (e) =>
|
|
1888
|
-
onDblclick: (e) =>
|
|
1889
|
-
onContextmenu: (e) =>
|
|
1890
|
-
onKeydown: (e) =>
|
|
1891
|
-
onFocus: (e) =>
|
|
1892
|
-
}, [(
|
|
1992
|
+
onPointerdown: (e) => qn(e, n.task),
|
|
1993
|
+
onClick: (e) => sr(n.task, e),
|
|
1994
|
+
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
1995
|
+
onContextmenu: (e) => D("task-contextmenu", n.task, e),
|
|
1996
|
+
onKeydown: (e) => Vr(e, n.task),
|
|
1997
|
+
onFocus: (e) => jr.value = n.task.id
|
|
1998
|
+
}, [(x(!0), f(s, null, C(Yt.value, (i, a) => (x(), f("div", {
|
|
1893
1999
|
key: i.key,
|
|
1894
2000
|
role: "gridcell",
|
|
1895
|
-
class:
|
|
1896
|
-
style:
|
|
1897
|
-
width: `${
|
|
1898
|
-
paddingLeft: i.key === "name" ? `${8 + n.depth *
|
|
2001
|
+
class: y(["flex h-full min-w-0 items-center px-3", [i.align === "end" ? "justify-end" : i.align === "center" ? "justify-center" : "", i.key === "name" ? "gap-1" : "text-on-surface-variant"]]),
|
|
2002
|
+
style: b({
|
|
2003
|
+
width: `${Tr.value[a]}px`,
|
|
2004
|
+
paddingLeft: i.key === "name" ? `${8 + n.depth * Jt.value}px` : void 0
|
|
1899
2005
|
})
|
|
1900
|
-
}, [i.key === "name" ? (
|
|
1901
|
-
n.parent ? (
|
|
2006
|
+
}, [i.key === "name" ? (x(), f(s, { key: 0 }, [
|
|
2007
|
+
n.parent ? (x(), f("button", {
|
|
1902
2008
|
key: 0,
|
|
1903
2009
|
type: "button",
|
|
1904
2010
|
tabindex: "-1",
|
|
1905
2011
|
"data-gantt-action": "",
|
|
1906
2012
|
class: "flex size-6 shrink-0 items-center justify-center rounded-full text-on-surface-variant hover:bg-on-surface/8",
|
|
1907
|
-
"aria-label":
|
|
1908
|
-
onClick:
|
|
1909
|
-
}, [p("span", { class:
|
|
1910
|
-
|
|
1911
|
-
|
|
2013
|
+
"aria-label": K.value.has(n.task.id) ? T(k).ganttExpand : T(k).ganttCollapse,
|
|
2014
|
+
onClick: fe((e) => Ue(n.task.id), ["stop"])
|
|
2015
|
+
}, [p("span", { class: y(["material-symbols-outlined text-[20px] transition-transform duration-200", K.value.has(n.task.id) ? "-rotate-90" : ""]) }, "expand_more", 2)], 8, qe)) : (x(), f("span", Je)),
|
|
2016
|
+
T(z)(n.task) ? (x(), f("span", Ye)) : d("", !0),
|
|
2017
|
+
Fr.value === n.task.id ? ue((x(), f("input", {
|
|
1912
2018
|
key: 3,
|
|
1913
|
-
"onUpdate:modelValue": t[0] ||= (e) =>
|
|
2019
|
+
"onUpdate:modelValue": t[0] ||= (e) => Ir.value = e,
|
|
1914
2020
|
"data-gantt-rename": "",
|
|
1915
2021
|
class: "h-8 min-w-0 flex-1 rounded-xs border border-primary bg-surface px-2 text-body-medium text-on-surface outline-none",
|
|
1916
|
-
onKeydown: [t[1] ||=
|
|
1917
|
-
onBlur: t[3] ||= (e) =>
|
|
1918
|
-
onClick: t[4] ||=
|
|
1919
|
-
onDblclick: t[5] ||=
|
|
1920
|
-
}, null, 544)), [[
|
|
2022
|
+
onKeydown: [t[1] ||= de(fe((e) => Rr(!0), ["stop", "prevent"]), ["enter"]), t[2] ||= de(fe((e) => Rr(!1), ["stop", "prevent"]), ["esc"])],
|
|
2023
|
+
onBlur: t[3] ||= (e) => Rr(!0),
|
|
2024
|
+
onClick: t[4] ||= fe(() => {}, ["stop"]),
|
|
2025
|
+
onDblclick: t[5] ||= fe(() => {}, ["stop"])
|
|
2026
|
+
}, null, 544)), [[le, Ir.value]]) : ae(e.$slots, `cell-${i.key}`, {
|
|
1921
2027
|
task: n.task,
|
|
1922
|
-
value:
|
|
2028
|
+
value: Er(n.task, i)
|
|
1923
2029
|
}, () => [p("span", {
|
|
1924
|
-
class:
|
|
1925
|
-
onDblclick:
|
|
1926
|
-
},
|
|
1927
|
-
], 64)) :
|
|
2030
|
+
class: y(["truncate", n.parent ? "font-medium" : ""]),
|
|
2031
|
+
onDblclick: fe((e) => r.readonly ? D("task-dblclick", n.task, e) : Lr(n.task.id), ["stop"])
|
|
2032
|
+
}, w(Er(n.task, i)), 43, Xe)], void 0, 4)
|
|
2033
|
+
], 64)) : ae(e.$slots, `cell-${i.key}`, {
|
|
1928
2034
|
task: n.task,
|
|
1929
|
-
value:
|
|
1930
|
-
}, () => [p("span",
|
|
1931
|
-
|
|
2035
|
+
value: Er(n.task, i)
|
|
2036
|
+
}, () => [p("span", Ze, w(Er(n.task, i)), 1)], void 0, 1)], 6))), 128))], 46, Ke))), 128)),
|
|
2037
|
+
Bn.value ? (x(), f("div", {
|
|
1932
2038
|
key: 0,
|
|
1933
|
-
class:
|
|
1934
|
-
style:
|
|
1935
|
-
top: `${(
|
|
2039
|
+
class: y(["pointer-events-none absolute right-2 z-20", Bn.value.where === "inside" ? "rounded-sm border-2 border-primary" : "h-0.5 rounded-full bg-primary"]),
|
|
2040
|
+
style: b(Bn.value.where === "inside" ? {
|
|
2041
|
+
top: `${(bt.value.get(Bn.value.target) ?? 0) * r.rowHeight + 2}px`,
|
|
1936
2042
|
height: `${r.rowHeight - 4}px`,
|
|
1937
2043
|
left: "8px"
|
|
1938
2044
|
} : {
|
|
1939
|
-
top: `${((
|
|
1940
|
-
left: `${8 + (
|
|
2045
|
+
top: `${((bt.value.get(Bn.value.target) ?? 0) + +(Bn.value.where === "after")) * r.rowHeight - 1}px`,
|
|
2046
|
+
left: `${8 + (J.value[bt.value.get(Bn.value.target) ?? 0]?.depth ?? 0) * Jt.value}px`
|
|
1941
2047
|
})
|
|
1942
2048
|
}, null, 6)) : d("", !0),
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
"
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
], 12,
|
|
1958
|
-
class: "relative shrink-0",
|
|
1959
|
-
style:
|
|
2049
|
+
h(We, {
|
|
2050
|
+
label: T(k).ganttResize,
|
|
2051
|
+
value: kt.value,
|
|
2052
|
+
active: zn.value,
|
|
2053
|
+
"grip-top": T(X).top + Math.max(0, T(X).height - _t) / 2,
|
|
2054
|
+
onPointerdown: Jn,
|
|
2055
|
+
onDblclick: t[6] ||= (e) => Ot(T(Et)),
|
|
2056
|
+
onKeydown: [t[7] ||= de(fe((e) => Ot(Math.max(120, Dt.value - 16)), ["prevent"]), ["left"]), t[8] ||= de(fe((e) => Ot(Dt.value + 16), ["prevent"]), ["right"])]
|
|
2057
|
+
}, null, 8, [
|
|
2058
|
+
"label",
|
|
2059
|
+
"value",
|
|
2060
|
+
"active",
|
|
2061
|
+
"grip-top"
|
|
2062
|
+
])
|
|
2063
|
+
], 12, Ge)) : d("", !0), p("div", {
|
|
2064
|
+
class: "relative shrink-0 cursor-grab select-none [-webkit-user-drag:none] active:cursor-grabbing",
|
|
2065
|
+
style: b({ width: `${T(Z)}px` }),
|
|
1960
2066
|
"aria-hidden": "true",
|
|
1961
|
-
onPointerdown:
|
|
2067
|
+
onPointerdown: Kn,
|
|
2068
|
+
onDragstart: t[12] ||= fe(() => {}, ["prevent"])
|
|
1962
2069
|
}, [
|
|
1963
|
-
h(
|
|
1964
|
-
"off-times":
|
|
1965
|
-
cells:
|
|
1966
|
-
"today-x":
|
|
2070
|
+
h(He, {
|
|
2071
|
+
"off-times": T(Wt),
|
|
2072
|
+
cells: T(Ut),
|
|
2073
|
+
"today-x": T(Ft) === null ? null : T(It)(T(Ft))
|
|
1967
2074
|
}, null, 8, [
|
|
1968
2075
|
"off-times",
|
|
1969
2076
|
"cells",
|
|
1970
2077
|
"today-x"
|
|
1971
2078
|
]),
|
|
1972
|
-
(
|
|
2079
|
+
(x(!0), f(s, null, C($t.value, (e) => (x(), f("div", {
|
|
1973
2080
|
key: `r${e.task.id}`,
|
|
1974
|
-
class:
|
|
1975
|
-
style:
|
|
2081
|
+
class: y(["absolute inset-x-0", W.value.has(e.task.id) ? "bg-secondary-container/40" : ""]),
|
|
2082
|
+
style: b({
|
|
1976
2083
|
top: `${e.index * r.rowHeight}px`,
|
|
1977
2084
|
height: `${r.rowHeight}px`
|
|
1978
2085
|
})
|
|
1979
2086
|
}, null, 6))), 128)),
|
|
1980
|
-
(
|
|
2087
|
+
(x(), f("svg", {
|
|
1981
2088
|
class: "pointer-events-none absolute inset-0 overflow-visible",
|
|
1982
|
-
width:
|
|
1983
|
-
height:
|
|
1984
|
-
}, [(
|
|
2089
|
+
width: T(Z),
|
|
2090
|
+
height: en.value
|
|
2091
|
+
}, [(x(!0), f(s, null, C(bn.value, (e) => (x(), f("g", {
|
|
1985
2092
|
key: e.key,
|
|
1986
2093
|
ref_for: !0,
|
|
1987
|
-
ref: (t) =>
|
|
1988
|
-
class:
|
|
2094
|
+
ref: (t) => wn(e.key, t),
|
|
2095
|
+
class: y(["m3-gantt-link", on.value.has(e.key) ? "text-error" : Tn.value === e.key ? "text-primary" : "text-outline"])
|
|
1989
2096
|
}, [
|
|
1990
2097
|
p("path", {
|
|
1991
2098
|
fill: "none",
|
|
1992
2099
|
stroke: "transparent",
|
|
1993
2100
|
class: "pointer-events-auto cursor-pointer [stroke-width:12px] pointer-coarse:[stroke-width:28px]",
|
|
1994
|
-
onPointerdown: t[
|
|
1995
|
-
onClick:
|
|
1996
|
-
|
|
2101
|
+
onPointerdown: t[9] ||= fe(() => {}, ["stop"]),
|
|
2102
|
+
onClick: fe((t) => {
|
|
2103
|
+
Tn.value = e.key, G([]);
|
|
1997
2104
|
}, ["stop"])
|
|
1998
|
-
}, null, 40,
|
|
2105
|
+
}, null, 40, $e),
|
|
1999
2106
|
p("path", {
|
|
2000
2107
|
fill: "none",
|
|
2001
2108
|
stroke: "currentColor",
|
|
2002
|
-
"stroke-width":
|
|
2109
|
+
"stroke-width": Tn.value === e.key || on.value.has(e.key) ? 2.5 : 1.5,
|
|
2003
2110
|
"stroke-linejoin": "round"
|
|
2004
|
-
}, null, 8,
|
|
2005
|
-
t[
|
|
2111
|
+
}, null, 8, et),
|
|
2112
|
+
t[16] ||= p("path", {
|
|
2006
2113
|
fill: "currentColor",
|
|
2007
2114
|
stroke: "currentColor",
|
|
2008
2115
|
"stroke-width": "1",
|
|
2009
2116
|
"stroke-linejoin": "round"
|
|
2010
2117
|
}, null, -1)
|
|
2011
|
-
], 2))), 128)),
|
|
2118
|
+
], 2))), 128)), $.value ? (x(), f("path", {
|
|
2012
2119
|
key: 0,
|
|
2013
2120
|
fill: "none",
|
|
2014
2121
|
"stroke-width": "2",
|
|
2015
2122
|
"stroke-dasharray": "6 4",
|
|
2016
|
-
class:
|
|
2017
|
-
d: `M${
|
|
2018
|
-
}, null, 10,
|
|
2019
|
-
|
|
2123
|
+
class: y($.value.valid ? "stroke-primary" : "stroke-outline"),
|
|
2124
|
+
d: `M${$.value.fromEnd ? _n($.value.from).x + _n($.value.from).w : _n($.value.from).x},${(bt.value.get($.value.from) ?? 0) * r.rowHeight + r.rowHeight / 2} L${$.value.x},${$.value.y}`
|
|
2125
|
+
}, null, 10, tt)) : d("", !0)], 8, Qe)),
|
|
2126
|
+
Tn.value && En.value && !r.readonly ? (x(), f("button", {
|
|
2020
2127
|
key: 0,
|
|
2021
2128
|
type: "button",
|
|
2022
2129
|
"data-gantt-action": "",
|
|
2023
2130
|
class: "absolute z-10 flex size-6 -translate-1/2 items-center justify-center rounded-full bg-error text-on-error shadow-elevation-2 pointer-coarse:size-10",
|
|
2024
|
-
style:
|
|
2025
|
-
left: `${
|
|
2026
|
-
top: `${
|
|
2131
|
+
style: b({
|
|
2132
|
+
left: `${En.value.x}px`,
|
|
2133
|
+
top: `${En.value.y}px`
|
|
2027
2134
|
}),
|
|
2028
|
-
"aria-label":
|
|
2029
|
-
onPointerdown: t[
|
|
2030
|
-
onClick: t[
|
|
2031
|
-
}, [...t[
|
|
2032
|
-
(
|
|
2135
|
+
"aria-label": T(k).ganttUnlink,
|
|
2136
|
+
onPointerdown: t[10] ||= fe(() => {}, ["stop"]),
|
|
2137
|
+
onClick: t[11] ||= fe((e) => Dn(Tn.value.split(">")[0], Tn.value.split(">")[1]), ["stop"])
|
|
2138
|
+
}, [...t[17] ||= [p("span", { class: "material-symbols-outlined text-[16px]" }, "close", -1)]], 44, nt)) : d("", !0),
|
|
2139
|
+
(x(!0), f(s, null, C($t.value, (e) => (x(), f(s, { key: `g${e.task.id}` }, [Dr(e.task) ? (x(), f("div", {
|
|
2033
2140
|
key: 0,
|
|
2034
2141
|
class: "pointer-events-none absolute h-1 rounded-full bg-outline",
|
|
2035
|
-
style:
|
|
2036
|
-
top: `${e.index * r.rowHeight + r.rowHeight / 2 +
|
|
2037
|
-
left: `${
|
|
2038
|
-
width: `${
|
|
2142
|
+
style: b({
|
|
2143
|
+
top: `${e.index * r.rowHeight + r.rowHeight / 2 + tn.value / 2 + 2}px`,
|
|
2144
|
+
left: `${Dr(e.task).x}px`,
|
|
2145
|
+
width: `${Dr(e.task).w}px`
|
|
2039
2146
|
})
|
|
2040
2147
|
}, null, 4)) : d("", !0)], 64))), 128)),
|
|
2041
|
-
(
|
|
2148
|
+
(x(!0), f(s, null, C($t.value, (n) => (x(), f("div", {
|
|
2042
2149
|
key: `b${n.task.id}`,
|
|
2043
2150
|
ref_for: !0,
|
|
2044
|
-
ref: (e) =>
|
|
2151
|
+
ref: (e) => gn(n.task.id, e),
|
|
2045
2152
|
"data-gantt-flip": n.task.id,
|
|
2046
|
-
class:
|
|
2047
|
-
style:
|
|
2048
|
-
top: `${n.index * r.rowHeight + (r.rowHeight -
|
|
2049
|
-
height: `${
|
|
2153
|
+
class: y(["m3-gantt-bar group absolute left-0", [n.task.class, Rn.value?.taskId === n.task.id ? "z-10" : ""]]),
|
|
2154
|
+
style: b({
|
|
2155
|
+
top: `${n.index * r.rowHeight + (r.rowHeight - tn.value) / 2}px`,
|
|
2156
|
+
height: `${tn.value}px`
|
|
2050
2157
|
})
|
|
2051
2158
|
}, [
|
|
2052
|
-
|
|
2159
|
+
T(z)(n.task) ? (x(), f("div", {
|
|
2053
2160
|
key: 0,
|
|
2054
2161
|
class: "absolute top-1/2 left-0 hidden size-11 -translate-1/2 pointer-coarse:block",
|
|
2055
|
-
onPointerdown: (e) =>
|
|
2056
|
-
}, null, 40,
|
|
2057
|
-
|
|
2162
|
+
onPointerdown: (e) => Gn(e, n.task, "body")
|
|
2163
|
+
}, null, 40, it)) : d("", !0),
|
|
2164
|
+
T(z)(n.task) ? (x(), f("div", {
|
|
2058
2165
|
key: 1,
|
|
2059
2166
|
"data-gantt-task": n.task.id,
|
|
2060
|
-
class:
|
|
2061
|
-
|
|
2062
|
-
|
|
2167
|
+
class: y(["absolute top-1/2 left-0 -translate-1/2 rotate-45 rounded-[3px] shadow-elevation-1", [
|
|
2168
|
+
an.value.has(n.task.id) ? "bg-error" : kr[n.task.color ?? "tertiary"].solid,
|
|
2169
|
+
W.value.has(n.task.id) ? "ring-2 ring-on-surface ring-offset-2 ring-offset-surface" : "",
|
|
2063
2170
|
r.readonly ? "" : "cursor-grab"
|
|
2064
2171
|
]]),
|
|
2065
|
-
style:
|
|
2066
|
-
width: `${
|
|
2067
|
-
height: `${
|
|
2172
|
+
style: b({
|
|
2173
|
+
width: `${tn.value * .8}px`,
|
|
2174
|
+
height: `${tn.value * .8}px`
|
|
2068
2175
|
}),
|
|
2069
|
-
onPointerdown: (e) =>
|
|
2070
|
-
onPointerenter: (e) =>
|
|
2071
|
-
onPointerleave:
|
|
2072
|
-
onDblclick: (e) =>
|
|
2073
|
-
onContextmenu: (e) =>
|
|
2074
|
-
}, null, 46,
|
|
2176
|
+
onPointerdown: (e) => Gn(e, n.task, "body"),
|
|
2177
|
+
onPointerenter: (e) => gr(e, n.task),
|
|
2178
|
+
onPointerleave: _r,
|
|
2179
|
+
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
2180
|
+
onContextmenu: (e) => D("task-contextmenu", n.task, e)
|
|
2181
|
+
}, null, 46, at)) : R.value.has(n.task.id) && H.value.has(n.task.id) ? (x(), f("div", {
|
|
2075
2182
|
key: 2,
|
|
2076
2183
|
"data-gantt-task": n.task.id,
|
|
2077
|
-
class:
|
|
2078
|
-
|
|
2079
|
-
|
|
2184
|
+
class: y(["m3-gantt-summary absolute inset-x-0 top-1/2 h-2.5 -translate-y-1/2 rounded-t-xs", [
|
|
2185
|
+
Ar(n.task).solid,
|
|
2186
|
+
W.value.has(n.task.id) ? "ring-2 ring-on-surface ring-offset-1 ring-offset-surface" : "",
|
|
2080
2187
|
r.readonly ? "" : "cursor-grab"
|
|
2081
2188
|
]]),
|
|
2082
|
-
onPointerdown: (e) =>
|
|
2083
|
-
onPointerenter: (e) =>
|
|
2084
|
-
onPointerleave:
|
|
2085
|
-
onDblclick: (e) =>
|
|
2086
|
-
onContextmenu: (e) =>
|
|
2087
|
-
}, null, 42,
|
|
2189
|
+
onPointerdown: (e) => Gn(e, n.task, "body"),
|
|
2190
|
+
onPointerenter: (e) => gr(e, n.task),
|
|
2191
|
+
onPointerleave: _r,
|
|
2192
|
+
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
2193
|
+
onContextmenu: (e) => D("task-contextmenu", n.task, e)
|
|
2194
|
+
}, null, 42, ot)) : (x(), f("div", {
|
|
2088
2195
|
key: 3,
|
|
2089
2196
|
"data-gantt-task": n.task.id,
|
|
2090
|
-
class:
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2197
|
+
class: y(["absolute inset-0 overflow-hidden rounded-sm transition-shadow duration-200", [
|
|
2198
|
+
Ar(n.task).bar,
|
|
2199
|
+
W.value.has(n.task.id) ? "ring-2 ring-on-surface ring-offset-1 ring-offset-surface" : "",
|
|
2200
|
+
Rn.value?.taskId === n.task.id ? "shadow-elevation-3" : "hover:shadow-elevation-1",
|
|
2094
2201
|
r.readonly || n.task.draggable === !1 ? "" : "cursor-grab active:cursor-grabbing"
|
|
2095
2202
|
]]),
|
|
2096
|
-
onPointerdown: (e) =>
|
|
2097
|
-
onPointerenter: (e) =>
|
|
2098
|
-
onPointerleave:
|
|
2099
|
-
onDblclick: (e) =>
|
|
2100
|
-
onContextmenu: (e) =>
|
|
2203
|
+
onPointerdown: (e) => Gn(e, n.task, "body"),
|
|
2204
|
+
onPointerenter: (e) => gr(e, n.task),
|
|
2205
|
+
onPointerleave: _r,
|
|
2206
|
+
onDblclick: (e) => D("task-dblclick", n.task, e),
|
|
2207
|
+
onContextmenu: (e) => D("task-contextmenu", n.task, e)
|
|
2101
2208
|
}, [p("div", {
|
|
2102
|
-
class:
|
|
2103
|
-
style:
|
|
2104
|
-
}, null, 6), p("div",
|
|
2209
|
+
class: y(["pointer-events-none absolute inset-y-0 left-0", Ar(n.task).fill]),
|
|
2210
|
+
style: b({ width: `${n.task.progress ?? 0}%` })
|
|
2211
|
+
}, null, 6), p("div", ct, [ae(e.$slots, "bar", {
|
|
2105
2212
|
task: n.task,
|
|
2106
|
-
selected:
|
|
2107
|
-
critical:
|
|
2108
|
-
}, () => [
|
|
2109
|
-
!r.readonly && n.task.resizable !== !1 && !
|
|
2213
|
+
selected: W.value.has(n.task.id),
|
|
2214
|
+
critical: an.value.has(n.task.id)
|
|
2215
|
+
}, () => [Or(n.task) ? (x(), f("span", lt, w(n.task.name), 1)) : d("", !0)])])], 42, st)),
|
|
2216
|
+
!r.readonly && n.task.resizable !== !1 && !T(z)(n.task) && !(R.value.has(n.task.id) && H.value.has(n.task.id)) ? (x(), f(s, { key: 4 }, C(["start", "end"], (e) => p("div", {
|
|
2110
2217
|
key: `rs${e}`,
|
|
2111
2218
|
"data-gantt-resize": e,
|
|
2112
|
-
class:
|
|
2113
|
-
onPointerdown: (t) =>
|
|
2114
|
-
}, [p("span", { class:
|
|
2115
|
-
!
|
|
2219
|
+
class: y(["absolute inset-y-0 z-[1] flex w-3 cursor-ew-resize items-center justify-center pointer-coarse:w-7", e === "start" ? "-left-1 pointer-coarse:-left-3.5" : "-right-1 pointer-coarse:-right-3.5"]),
|
|
2220
|
+
onPointerdown: (t) => Gn(t, n.task, e)
|
|
2221
|
+
}, [p("span", { class: y(["hidden h-3/5 w-1 rounded-full bg-on-surface pointer-coarse:block", W.value.has(n.task.id) ? "opacity-100" : "opacity-0"]) }, null, 2)], 42, ut)), 64)) : d("", !0),
|
|
2222
|
+
!T(z)(n.task) && !T(he).bar && !(R.value.has(n.task.id) && H.value.has(n.task.id)) && !Or(n.task) ? (x(), f("span", q, w(n.task.name), 1)) : T(z)(n.task) || R.value.has(n.task.id) && H.value.has(n.task.id) ? (x(), f("span", {
|
|
2116
2223
|
key: 6,
|
|
2117
|
-
class:
|
|
2118
|
-
},
|
|
2119
|
-
!r.readonly && !(
|
|
2224
|
+
class: y(["pointer-events-none absolute top-1/2 left-full -translate-y-1/2 text-label-medium whitespace-nowrap", [T(z)(n.task) ? "ml-4" : "ml-2", R.value.has(n.task.id) ? "font-medium text-on-surface" : "text-on-surface-variant"]])
|
|
2225
|
+
}, w(n.task.name), 3)) : d("", !0),
|
|
2226
|
+
!r.readonly && !(R.value.has(n.task.id) && H.value.has(n.task.id)) ? (x(), f(s, { key: 7 }, [T(z)(n.task) ? d("", !0) : (x(), f("div", {
|
|
2120
2227
|
key: 0,
|
|
2121
|
-
class:
|
|
2122
|
-
style:
|
|
2123
|
-
onPointerdown: (e) =>
|
|
2124
|
-
}, null, 46,
|
|
2228
|
+
class: y(["absolute -bottom-2 size-0 -translate-x-1/2 cursor-ew-resize border-x-[6px] border-b-[7px] border-x-transparent border-b-on-surface-variant opacity-0 transition-opacity group-hover:opacity-100", W.value.has(n.task.id) || Rn.value?.taskId === n.task.id ? "opacity-100" : ""]),
|
|
2229
|
+
style: b({ left: `${n.task.progress ?? 0}%` }),
|
|
2230
|
+
onPointerdown: (e) => Gn(e, n.task, "progress")
|
|
2231
|
+
}, null, 46, dt)), n.task.linkable === !1 ? d("", !0) : (x(), f(s, { key: 1 }, C(["start", "end"], (e) => p("div", {
|
|
2125
2232
|
key: e,
|
|
2126
|
-
class:
|
|
2127
|
-
onPointerdown: (t) =>
|
|
2128
|
-
}, [...t[
|
|
2129
|
-
|
|
2233
|
+
class: y(["absolute top-1/2 flex size-5 -translate-y-1/2 cursor-crosshair items-center justify-center transition-opacity pointer-coarse:size-8", [e === "start" ? T(z)(n.task) ? "-left-9 pointer-coarse:-left-14" : "-left-5 pointer-coarse:-left-9" : T(z)(n.task) ? "left-4 pointer-coarse:left-6" : "-right-5 pointer-coarse:-right-9", W.value.has(n.task.id) || $.value ? "opacity-100" : "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100"]]),
|
|
2234
|
+
onPointerdown: (t) => Gn(t, n.task, e === "start" ? "link-start" : "link-end")
|
|
2235
|
+
}, [...t[18] ||= [p("span", { class: "size-2.5 rounded-full border-2 border-primary bg-surface" }, null, -1)]], 42, ft)), 64))], 64)) : d("", !0),
|
|
2236
|
+
$.value?.target === n.task.id ? (x(), f("div", {
|
|
2130
2237
|
key: 8,
|
|
2131
|
-
class:
|
|
2238
|
+
class: y(["pointer-events-none absolute -inset-1 rounded-md border-2", $.value.valid ? "border-primary" : "border-error"])
|
|
2132
2239
|
}, null, 2)) : d("", !0)
|
|
2133
|
-
], 14,
|
|
2134
|
-
|
|
2240
|
+
], 14, rt))), 128)),
|
|
2241
|
+
J.value.length ? d("", !0) : (x(), f("div", {
|
|
2135
2242
|
key: 1,
|
|
2136
2243
|
class: "absolute inset-0 flex items-center justify-center p-6",
|
|
2137
|
-
style:
|
|
2138
|
-
left: `${
|
|
2139
|
-
width: `${
|
|
2244
|
+
style: b({
|
|
2245
|
+
left: `${T(X).left}px`,
|
|
2246
|
+
width: `${T(Nt)}px`
|
|
2140
2247
|
})
|
|
2141
|
-
}, [
|
|
2248
|
+
}, [ae(e.$slots, "empty", {}, () => [p("span", pt, w(T(k).ganttEmpty), 1)])], 4))
|
|
2142
2249
|
], 36)], 4)], 4)], 544),
|
|
2143
|
-
(
|
|
2250
|
+
(x(), u(c, { to: "body" }, [br.value && !$.value && !Bn.value ? (x(), f("div", {
|
|
2144
2251
|
key: 0,
|
|
2145
2252
|
class: "pointer-events-none fixed z-[300] -translate-x-1/2 -translate-y-full rounded-md bg-surface-container px-3 py-2 text-on-surface shadow-elevation-2",
|
|
2146
|
-
style:
|
|
2147
|
-
left: `${
|
|
2148
|
-
top: `${
|
|
2253
|
+
style: b({
|
|
2254
|
+
left: `${xr.value.x}px`,
|
|
2255
|
+
top: `${xr.value.y - 8}px`
|
|
2149
2256
|
}),
|
|
2150
2257
|
role: "tooltip"
|
|
2151
|
-
}, [
|
|
2152
|
-
task:
|
|
2153
|
-
slack:
|
|
2258
|
+
}, [ae(e.$slots, "tooltip", {
|
|
2259
|
+
task: br.value,
|
|
2260
|
+
slack: rn.value.slack[br.value.id]
|
|
2154
2261
|
}, () => [
|
|
2155
|
-
p("div",
|
|
2156
|
-
p("div",
|
|
2157
|
-
m(
|
|
2158
|
-
|
|
2159
|
-
!
|
|
2262
|
+
p("div", mt, w(br.value.name), 1),
|
|
2263
|
+
p("div", ht, [
|
|
2264
|
+
m(w(Cr(br.value.start)), 1),
|
|
2265
|
+
T(z)(br.value) ? d("", !0) : (x(), f(s, { key: 0 }, [m(" – " + w(Cr(br.value.end ?? br.value.start)) + " · " + w(wr(br.value)), 1)], 64)),
|
|
2266
|
+
!T(z)(br.value) && br.value.progress !== void 0 ? (x(), f(s, { key: 1 }, [m(" · " + w(Math.round(br.value.progress)) + "%", 1)], 64)) : d("", !0)
|
|
2160
2267
|
]),
|
|
2161
|
-
r.criticalPath &&
|
|
2268
|
+
r.criticalPath && rn.value.slack[br.value.id] !== void 0 ? (x(), f("div", {
|
|
2162
2269
|
key: 0,
|
|
2163
|
-
class:
|
|
2164
|
-
},
|
|
2270
|
+
class: y(["text-body-small", an.value.has(br.value.id) ? "text-error" : "text-on-surface-variant"])
|
|
2271
|
+
}, w(an.value.has(br.value.id) ? T(k).ganttCritical : T(k).ganttSlack.replace("{n}", String(Math.round(rn.value.slack[br.value.id] * 10) / 10))), 3)) : d("", !0)
|
|
2165
2272
|
])], 4)) : d("", !0)])),
|
|
2166
|
-
p("div",
|
|
2273
|
+
p("div", gt, w(Nr.value), 1)
|
|
2167
2274
|
], 32));
|
|
2168
2275
|
}
|
|
2169
|
-
}),
|
|
2276
|
+
}), bt = {
|
|
2170
2277
|
class: "m3-gantt-controls flex flex-wrap items-center gap-2 border-b border-outline-variant px-3 py-2",
|
|
2171
2278
|
role: "toolbar"
|
|
2172
|
-
},
|
|
2279
|
+
}, Y = { class: "flex items-center" }, xt = /* @__PURE__ */ g({
|
|
2173
2280
|
__name: "MGanttControls",
|
|
2174
2281
|
props: {
|
|
2175
2282
|
scales: { default: () => [
|
|
@@ -2182,6 +2289,14 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
2182
2289
|
type: Boolean,
|
|
2183
2290
|
default: !0
|
|
2184
2291
|
},
|
|
2292
|
+
fit: {
|
|
2293
|
+
type: Boolean,
|
|
2294
|
+
default: !0
|
|
2295
|
+
},
|
|
2296
|
+
list: {
|
|
2297
|
+
type: Boolean,
|
|
2298
|
+
default: !0
|
|
2299
|
+
},
|
|
2185
2300
|
today: {
|
|
2186
2301
|
type: Boolean,
|
|
2187
2302
|
default: !0
|
|
@@ -2196,7 +2311,7 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
2196
2311
|
}
|
|
2197
2312
|
},
|
|
2198
2313
|
setup(t) {
|
|
2199
|
-
let n = t, i = _(
|
|
2314
|
+
let n = t, i = _(me, null);
|
|
2200
2315
|
if (!i) throw Error("MGanttControls must be inside <MGantt> or <MResourceTimeline>");
|
|
2201
2316
|
let o = i, c = e(), m = {
|
|
2202
2317
|
hour: "ganttScaleHour",
|
|
@@ -2205,65 +2320,107 @@ var Re = { class: "absolute inset-x-0 top-0 h-7" }, G = { class: "absolute inset
|
|
|
2205
2320
|
month: "ganttScaleMonth",
|
|
2206
2321
|
quarter: "ganttScaleQuarter",
|
|
2207
2322
|
year: "ganttScaleYear"
|
|
2208
|
-
}, g =
|
|
2323
|
+
}, g = S(!1), v, y = () => {
|
|
2324
|
+
g.value = !!v?.matches;
|
|
2325
|
+
};
|
|
2326
|
+
ne(() => {
|
|
2327
|
+
v = window.matchMedia?.("(pointer: coarse)"), y(), v?.addEventListener?.("change", y);
|
|
2328
|
+
}), ee(() => v?.removeEventListener?.("change", y));
|
|
2329
|
+
let b = l(() => g.value ? 48 : "sm"), te = l(() => n.list && !!o.hasList?.value && !!o.setGridCollapsed), re = l(() => n.scales.map((e) => ({
|
|
2209
2330
|
value: e,
|
|
2210
2331
|
label: c[m[e]]
|
|
2211
2332
|
})));
|
|
2212
|
-
return (e, n) => (
|
|
2213
|
-
|
|
2214
|
-
g.value.length ? (b(), u(a, {
|
|
2333
|
+
return (e, n) => (x(), f("div", bt, [
|
|
2334
|
+
te.value ? (x(), u(r, {
|
|
2215
2335
|
key: 0,
|
|
2216
|
-
|
|
2217
|
-
|
|
2336
|
+
size: b.value,
|
|
2337
|
+
icon: T(o).gridCollapsed.value ? "left_panel_open" : "left_panel_close",
|
|
2338
|
+
label: T(o).gridCollapsed.value ? T(c).ganttShowList : T(c).ganttHideList,
|
|
2339
|
+
onClick: n[0] ||= (e) => T(o).setGridCollapsed(!T(o).gridCollapsed.value)
|
|
2340
|
+
}, null, 8, [
|
|
2341
|
+
"size",
|
|
2342
|
+
"icon",
|
|
2343
|
+
"label"
|
|
2344
|
+
])) : d("", !0),
|
|
2345
|
+
ae(e.$slots, "default"),
|
|
2346
|
+
re.value.length ? (x(), u(a, {
|
|
2347
|
+
key: 1,
|
|
2348
|
+
"model-value": T(o).scale.value,
|
|
2349
|
+
options: re.value,
|
|
2218
2350
|
density: "compact",
|
|
2219
|
-
"onUpdate:modelValue": n[
|
|
2351
|
+
"onUpdate:modelValue": n[1] ||= (e) => T(o).setScale(e)
|
|
2220
2352
|
}, null, 8, ["model-value", "options"])) : d("", !0),
|
|
2221
|
-
p("div",
|
|
2222
|
-
t.zoom ? (
|
|
2353
|
+
p("div", Y, [
|
|
2354
|
+
t.zoom ? (x(), f(s, { key: 0 }, [h(r, {
|
|
2355
|
+
size: b.value,
|
|
2223
2356
|
icon: "zoom_out",
|
|
2224
|
-
label:
|
|
2225
|
-
onClick: n[
|
|
2226
|
-
}, null, 8, ["label"]), h(r, {
|
|
2357
|
+
label: T(c).ganttZoomOut,
|
|
2358
|
+
onClick: n[2] ||= (e) => T(o).zoomOut()
|
|
2359
|
+
}, null, 8, ["size", "label"]), h(r, {
|
|
2360
|
+
size: b.value,
|
|
2227
2361
|
icon: "zoom_in",
|
|
2228
|
-
label:
|
|
2229
|
-
onClick: n[
|
|
2230
|
-
}, null, 8, ["label"])], 64)) : d("", !0),
|
|
2231
|
-
t.
|
|
2362
|
+
label: T(c).ganttZoomIn,
|
|
2363
|
+
onClick: n[3] ||= (e) => T(o).zoomIn()
|
|
2364
|
+
}, null, 8, ["size", "label"])], 64)) : d("", !0),
|
|
2365
|
+
t.fit ? (x(), u(r, {
|
|
2232
2366
|
key: 1,
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2367
|
+
size: b.value,
|
|
2368
|
+
icon: "fit_width",
|
|
2369
|
+
label: T(c).ganttFit,
|
|
2370
|
+
onClick: n[4] ||= (e) => T(o).fit()
|
|
2371
|
+
}, null, 8, ["size", "label"])) : d("", !0),
|
|
2372
|
+
t.today ? (x(), u(r, {
|
|
2238
2373
|
key: 2,
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2374
|
+
size: b.value,
|
|
2375
|
+
icon: "today",
|
|
2376
|
+
label: T(c).ganttToday,
|
|
2377
|
+
onClick: n[5] ||= (e) => T(o).scrollToDate()
|
|
2378
|
+
}, null, 8, ["size", "label"])) : d("", !0),
|
|
2379
|
+
t.fold && T(o).foldable.value ? (x(), u(r, {
|
|
2380
|
+
key: 3,
|
|
2381
|
+
size: b.value,
|
|
2382
|
+
icon: T(o).folded.value ? "unfold_more" : "unfold_less",
|
|
2383
|
+
label: T(o).folded.value ? T(c).ganttExpandAll : T(c).ganttCollapseAll,
|
|
2384
|
+
onClick: n[6] ||= (e) => T(o).folded.value ? T(o).expandAll() : T(o).collapseAll()
|
|
2385
|
+
}, null, 8, [
|
|
2386
|
+
"size",
|
|
2387
|
+
"icon",
|
|
2388
|
+
"label"
|
|
2389
|
+
])) : d("", !0),
|
|
2390
|
+
t.history && !T(o).readonly.value ? (x(), f(s, { key: 4 }, [h(r, {
|
|
2391
|
+
size: b.value,
|
|
2244
2392
|
icon: "undo",
|
|
2245
|
-
label:
|
|
2246
|
-
disabled: !
|
|
2247
|
-
onClick: n[
|
|
2248
|
-
}, null, 8, [
|
|
2393
|
+
label: T(c).ganttUndo,
|
|
2394
|
+
disabled: !T(o).canUndo.value,
|
|
2395
|
+
onClick: n[7] ||= (e) => T(o).undo()
|
|
2396
|
+
}, null, 8, [
|
|
2397
|
+
"size",
|
|
2398
|
+
"label",
|
|
2399
|
+
"disabled"
|
|
2400
|
+
]), h(r, {
|
|
2401
|
+
size: b.value,
|
|
2249
2402
|
icon: "redo",
|
|
2250
|
-
label:
|
|
2251
|
-
disabled: !
|
|
2252
|
-
onClick: n[
|
|
2253
|
-
}, null, 8, [
|
|
2403
|
+
label: T(c).ganttRedo,
|
|
2404
|
+
disabled: !T(o).canRedo.value,
|
|
2405
|
+
onClick: n[8] ||= (e) => T(o).redo()
|
|
2406
|
+
}, null, 8, [
|
|
2407
|
+
"size",
|
|
2408
|
+
"label",
|
|
2409
|
+
"disabled"
|
|
2410
|
+
])], 64)) : d("", !0)
|
|
2254
2411
|
]),
|
|
2255
|
-
n[
|
|
2256
|
-
|
|
2412
|
+
n[9] ||= p("div", { class: "flex-1" }, null, -1),
|
|
2413
|
+
ae(e.$slots, "end")
|
|
2257
2414
|
]));
|
|
2258
2415
|
}
|
|
2259
2416
|
});
|
|
2260
2417
|
//#endregion
|
|
2261
2418
|
//#region src/composables/ganttFormats.ts
|
|
2262
|
-
function
|
|
2263
|
-
let t =
|
|
2419
|
+
function St(e) {
|
|
2420
|
+
let t = ke(e);
|
|
2264
2421
|
return `${t.id}${t.type !== "FS" || t.lag ? ` ${t.type}` : ""}${t.lag ? t.lag > 0 ? `+${t.lag}` : String(t.lag) : ""}`;
|
|
2265
2422
|
}
|
|
2266
|
-
function
|
|
2423
|
+
function Ct(e) {
|
|
2267
2424
|
let t = [];
|
|
2268
2425
|
for (let n of e.split(/[;,]/)) {
|
|
2269
2426
|
let e = /^\s*(.+?)(?:\s+(FS|SS|FF|SF))?\s*([+-]\s*\d+(?:\.\d+)?)?\s*$/i.exec(n);
|
|
@@ -2277,7 +2434,7 @@ function xt(e) {
|
|
|
2277
2434
|
}
|
|
2278
2435
|
return t;
|
|
2279
2436
|
}
|
|
2280
|
-
var
|
|
2437
|
+
var wt = [
|
|
2281
2438
|
"id",
|
|
2282
2439
|
"name",
|
|
2283
2440
|
"start",
|
|
@@ -2290,11 +2447,11 @@ var St = [
|
|
|
2290
2447
|
"baselineStart",
|
|
2291
2448
|
"baselineEnd"
|
|
2292
2449
|
];
|
|
2293
|
-
function
|
|
2450
|
+
function Tt(e, t) {
|
|
2294
2451
|
return /["\n\r]/.test(e) || e.includes(t) ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
2295
2452
|
}
|
|
2296
|
-
function
|
|
2297
|
-
let n = t.separator ?? ",", r = [
|
|
2453
|
+
function Et(e, t = {}) {
|
|
2454
|
+
let n = t.separator ?? ",", r = [wt.join(n)];
|
|
2298
2455
|
for (let t of e) {
|
|
2299
2456
|
let e = [
|
|
2300
2457
|
t.id,
|
|
@@ -2304,16 +2461,16 @@ function wt(e, t = {}) {
|
|
|
2304
2461
|
t.progress === void 0 ? "" : String(t.progress),
|
|
2305
2462
|
t.type ?? "",
|
|
2306
2463
|
t.parentId ?? "",
|
|
2307
|
-
(t.dependencies ?? []).map(
|
|
2464
|
+
(t.dependencies ?? []).map(St).join("; "),
|
|
2308
2465
|
t.color ?? "",
|
|
2309
2466
|
t.baselineStart ?? "",
|
|
2310
2467
|
t.baselineEnd ?? ""
|
|
2311
2468
|
];
|
|
2312
|
-
r.push(e.map((e) =>
|
|
2469
|
+
r.push(e.map((e) => Tt(e, n)).join(n));
|
|
2313
2470
|
}
|
|
2314
2471
|
return r.join("\n") + "\n";
|
|
2315
2472
|
}
|
|
2316
|
-
function
|
|
2473
|
+
function Dt(e, t) {
|
|
2317
2474
|
let n = [], r = [], i = "", a = !1;
|
|
2318
2475
|
for (let o = 0; o < e.length; o++) {
|
|
2319
2476
|
let s = e[o];
|
|
@@ -2321,7 +2478,7 @@ function Tt(e, t) {
|
|
|
2321
2478
|
}
|
|
2322
2479
|
return r.push(i), r.some((e) => e.trim()) && n.push(r), n;
|
|
2323
2480
|
}
|
|
2324
|
-
var
|
|
2481
|
+
var Ot = {
|
|
2325
2482
|
id: "id",
|
|
2326
2483
|
uid: "id",
|
|
2327
2484
|
key: "id",
|
|
@@ -2360,7 +2517,7 @@ var Et = {
|
|
|
2360
2517
|
baselineend: "baselineEnd",
|
|
2361
2518
|
baselinefinish: "baselineEnd"
|
|
2362
2519
|
};
|
|
2363
|
-
function
|
|
2520
|
+
function kt(e, t) {
|
|
2364
2521
|
let n = e.trim();
|
|
2365
2522
|
if (!n) return;
|
|
2366
2523
|
let r = /^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}:\d{2}))?/.exec(n);
|
|
@@ -2371,34 +2528,34 @@ function Dt(e, t) {
|
|
|
2371
2528
|
return i[4] ? `${r}T${i[4].padStart(2, "0")}:${i[5]}` : r;
|
|
2372
2529
|
}
|
|
2373
2530
|
let a = Date.parse(n);
|
|
2374
|
-
return Number.isNaN(a) ? void 0 :
|
|
2531
|
+
return Number.isNaN(a) ? void 0 : M(a, !/\d:\d/.test(n));
|
|
2375
2532
|
}
|
|
2376
|
-
function
|
|
2533
|
+
function At(e, t = {}) {
|
|
2377
2534
|
let n = e.split(/\r?\n/, 1)[0] ?? "", r = t.separator ?? [
|
|
2378
2535
|
",",
|
|
2379
2536
|
";",
|
|
2380
2537
|
" "
|
|
2381
|
-
].map((e) => [e, n.split(e).length]).sort((e, t) => t[1] - e[1])[0][0], i =
|
|
2538
|
+
].map((e) => [e, n.split(e).length]).sort((e, t) => t[1] - e[1])[0][0], i = Dt(e.replace(/^\uFEFF/, ""), r), a = i.shift();
|
|
2382
2539
|
if (!a) return [];
|
|
2383
|
-
let o = a.map((e) =>
|
|
2540
|
+
let o = a.map((e) => Ot[e.toLowerCase().replace(/[\s_-]/g, "")]);
|
|
2384
2541
|
if (!o.includes("name") || !o.includes("start")) throw SyntaxError("The CSV needs a name and a start column");
|
|
2385
2542
|
let s = t.dayFirst ?? !0, c = [];
|
|
2386
2543
|
return i.forEach((e, t) => {
|
|
2387
2544
|
let n = (t) => {
|
|
2388
2545
|
let n = o.indexOf(t);
|
|
2389
2546
|
return n < 0 ? "" : (e[n] ?? "").trim();
|
|
2390
|
-
}, r =
|
|
2547
|
+
}, r = kt(n("start"), s);
|
|
2391
2548
|
if (!r) return;
|
|
2392
2549
|
let i = {
|
|
2393
2550
|
id: n("id") || `t${t + 1}`,
|
|
2394
2551
|
name: n("name"),
|
|
2395
2552
|
start: r
|
|
2396
|
-
}, a =
|
|
2553
|
+
}, a = kt(n("end"), s);
|
|
2397
2554
|
a && (i.end = a);
|
|
2398
2555
|
let l = parseFloat(n("progress").replace("%", ""));
|
|
2399
2556
|
Number.isFinite(l) && (i.progress = l > 0 && l <= 1 && n("progress").includes(".") && !n("progress").includes("%") ? l * 100 : l);
|
|
2400
2557
|
let u = n("type").toLowerCase();
|
|
2401
|
-
u === "task" || u === "milestone" || u === "summary" ? i.type = u : a || (i.type = "milestone"), n("parent") && (i.parentId = n("parent")), n("dependencies") && (i.dependencies =
|
|
2558
|
+
u === "task" || u === "milestone" || u === "summary" ? i.type = u : a || (i.type = "milestone"), n("parent") && (i.parentId = n("parent")), n("dependencies") && (i.dependencies = Ct(n("dependencies")));
|
|
2402
2559
|
let d = n("color");
|
|
2403
2560
|
[
|
|
2404
2561
|
"primary",
|
|
@@ -2408,24 +2565,24 @@ function Ot(e, t = {}) {
|
|
|
2408
2565
|
"success",
|
|
2409
2566
|
"neutral"
|
|
2410
2567
|
].includes(d) && (i.color = d);
|
|
2411
|
-
let f =
|
|
2568
|
+
let f = kt(n("baselineStart"), s), p = kt(n("baselineEnd"), s);
|
|
2412
2569
|
f && (i.baselineStart = f), p && (i.baselineEnd = p), c.push(i);
|
|
2413
2570
|
}), c;
|
|
2414
2571
|
}
|
|
2415
|
-
function
|
|
2572
|
+
function jt(e, t = {}) {
|
|
2416
2573
|
return JSON.stringify({
|
|
2417
2574
|
format: "m3ui-gantt",
|
|
2418
2575
|
version: 1,
|
|
2419
2576
|
tasks: e
|
|
2420
2577
|
}, null, t.space ?? 2);
|
|
2421
2578
|
}
|
|
2422
|
-
function
|
|
2579
|
+
function Mt(e) {
|
|
2423
2580
|
let t = JSON.parse(e), n = Array.isArray(t) ? t : t && typeof t == "object" && Array.isArray(t.tasks) ? t.tasks : null;
|
|
2424
2581
|
if (!n) throw SyntaxError("Expected an array of tasks or { tasks: [...] }");
|
|
2425
2582
|
return n.map((e, t) => {
|
|
2426
2583
|
if (!e || typeof e != "object") throw SyntaxError(`Task ${t + 1} isn't an object`);
|
|
2427
2584
|
let n = e;
|
|
2428
|
-
if (typeof n.start != "string" || Number.isNaN(
|
|
2585
|
+
if (typeof n.start != "string" || Number.isNaN(j(n.start))) throw SyntaxError(`Task ${t + 1} has no valid start`);
|
|
2429
2586
|
return {
|
|
2430
2587
|
...n,
|
|
2431
2588
|
id: n.id === void 0 || n.id === null ? `t${t + 1}` : String(n.id),
|
|
@@ -2434,10 +2591,10 @@ function At(e) {
|
|
|
2434
2591
|
};
|
|
2435
2592
|
});
|
|
2436
2593
|
}
|
|
2437
|
-
function
|
|
2594
|
+
function X(e) {
|
|
2438
2595
|
return e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, "$1").replace(/&#x([0-9a-f]+);/gi, (e, t) => String.fromCodePoint(parseInt(t, 16))).replace(/&#(\d+);/g, (e, t) => String.fromCodePoint(Number(t))).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'").replace(/&/g, "&");
|
|
2439
2596
|
}
|
|
2440
|
-
function
|
|
2597
|
+
function Nt(e) {
|
|
2441
2598
|
let t = {
|
|
2442
2599
|
name: "#root",
|
|
2443
2600
|
children: [],
|
|
@@ -2445,7 +2602,7 @@ function Mt(e) {
|
|
|
2445
2602
|
}, n = [t], r = /<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!\[CDATA\[[\s\S]*?\]\]>|<![^>]*>|<\/?([\w:.-]+)[^>]*?(\/?)>|[^<]+/g;
|
|
2446
2603
|
for (let t; t = r.exec(e);) {
|
|
2447
2604
|
let e = t[0], r = n.at(-1);
|
|
2448
|
-
if (e.startsWith("<![CDATA[")) r.text +=
|
|
2605
|
+
if (e.startsWith("<![CDATA[")) r.text += X(e);
|
|
2449
2606
|
else if (e.startsWith("<!") || e.startsWith("<?")) continue;
|
|
2450
2607
|
else if (e.startsWith("</")) {
|
|
2451
2608
|
let e = t[1].replace(/^.*:/, "");
|
|
@@ -2457,25 +2614,25 @@ function Mt(e) {
|
|
|
2457
2614
|
text: ""
|
|
2458
2615
|
};
|
|
2459
2616
|
r.children.push(e), t[2] || n.push(e);
|
|
2460
|
-
} else r.text +=
|
|
2617
|
+
} else r.text += X(e);
|
|
2461
2618
|
}
|
|
2462
2619
|
return t;
|
|
2463
2620
|
}
|
|
2464
|
-
var
|
|
2621
|
+
var Pt = (e, t) => e?.children.find((e) => e.name === t), Z = (e, t) => Pt(e, t)?.text.trim() ?? "", Ft = [
|
|
2465
2622
|
"FF",
|
|
2466
2623
|
"FS",
|
|
2467
2624
|
"SF",
|
|
2468
2625
|
"SS"
|
|
2469
|
-
],
|
|
2470
|
-
function
|
|
2471
|
-
return `${
|
|
2626
|
+
], It = 4800, Lt = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2627
|
+
function Rt(e) {
|
|
2628
|
+
return `${M(e, !1).slice(0, 16)}:00`;
|
|
2472
2629
|
}
|
|
2473
|
-
function
|
|
2630
|
+
function zt(e) {
|
|
2474
2631
|
let t = Math.round(e / 6e4);
|
|
2475
2632
|
return `PT${Math.floor(t / 60)}H${t % 60}M0S`;
|
|
2476
2633
|
}
|
|
2477
|
-
function
|
|
2478
|
-
let n = t.dayStart ?? 8, r = t.dayEnd ?? 17, i = new Set(e.map((e) => e.id)), a =
|
|
2634
|
+
function Bt(e, t = {}) {
|
|
2635
|
+
let n = t.dayStart ?? 8, r = t.dayEnd ?? 17, i = new Set(e.map((e) => e.id)), a = Ae(e), o = /* @__PURE__ */ new Map();
|
|
2479
2636
|
for (let t of e) {
|
|
2480
2637
|
let e = t.parentId && i.has(t.parentId) ? t.parentId : void 0;
|
|
2481
2638
|
(o.get(e) ?? o.set(e, []).get(e)).push(t);
|
|
@@ -2488,7 +2645,7 @@ function Rt(e, t = {}) {
|
|
|
2488
2645
|
};
|
|
2489
2646
|
c(void 0, 1);
|
|
2490
2647
|
let l = new Map(s.map((e, t) => [e.t.id, t + 1])), u = (e, t, i) => {
|
|
2491
|
-
let a =
|
|
2648
|
+
let a = B({
|
|
2492
2649
|
start: t ?? e.start,
|
|
2493
2650
|
end: i ?? e.end,
|
|
2494
2651
|
type: e.type
|
|
@@ -2498,22 +2655,22 @@ function Rt(e, t = {}) {
|
|
|
2498
2655
|
finish: a.end,
|
|
2499
2656
|
work: a.end - a.start
|
|
2500
2657
|
};
|
|
2501
|
-
let o = a.end > a.start ?
|
|
2658
|
+
let o = a.end > a.start ? P(a.end, -1) : a.start, s = Math.max(0, Math.round((N(a.end) - N(a.start)) / O));
|
|
2502
2659
|
return {
|
|
2503
2660
|
start: a.start + n * 36e5,
|
|
2504
2661
|
finish: a.end > a.start ? o + r * 36e5 : a.start + n * 36e5,
|
|
2505
2662
|
work: s * (r - n) * 36e5
|
|
2506
2663
|
};
|
|
2507
2664
|
}, d = ["<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>", "<Project xmlns=\"http://schemas.microsoft.com/project\">"];
|
|
2508
|
-
return t.name && d.push(` <Name>${
|
|
2665
|
+
return t.name && d.push(` <Name>${Lt(t.name)}</Name>`, ` <Title>${Lt(t.name)}</Title>`), d.push(" <ScheduleFromStart>1</ScheduleFromStart>", ` <DefaultStartTime>${String(n).padStart(2, "0")}:00:00</DefaultStartTime>`, ` <DefaultFinishTime>${String(r).padStart(2, "0")}:00:00</DefaultFinishTime>`, " <Tasks>"), s.forEach(({ t: e, level: t }, n) => {
|
|
2509
2666
|
let r = u(e), i = e.type === "milestone" || !e.end, o = [
|
|
2510
2667
|
`<UID>${n + 1}</UID>`,
|
|
2511
2668
|
`<ID>${n + 1}</ID>`,
|
|
2512
|
-
`<Name>${
|
|
2669
|
+
`<Name>${Lt(e.name)}</Name>`,
|
|
2513
2670
|
`<OutlineLevel>${t}</OutlineLevel>`,
|
|
2514
|
-
`<Start>${
|
|
2515
|
-
`<Finish>${
|
|
2516
|
-
`<Duration>${
|
|
2671
|
+
`<Start>${Rt(r.start)}</Start>`,
|
|
2672
|
+
`<Finish>${Rt(r.finish)}</Finish>`,
|
|
2673
|
+
`<Duration>${zt(i ? 0 : r.work)}</Duration>`,
|
|
2517
2674
|
"<DurationFormat>7</DurationFormat>",
|
|
2518
2675
|
`<PercentComplete>${Math.round(e.progress ?? 0)}</PercentComplete>`,
|
|
2519
2676
|
`<Milestone>${+!!i}</Milestone>`,
|
|
@@ -2521,34 +2678,34 @@ function Rt(e, t = {}) {
|
|
|
2521
2678
|
];
|
|
2522
2679
|
if (e.baselineStart) {
|
|
2523
2680
|
let t = u(e, e.baselineStart, e.baselineEnd ?? (e.end ? e.baselineStart : void 0));
|
|
2524
|
-
o.push(`<Baseline><Number>0</Number><Start>${
|
|
2681
|
+
o.push(`<Baseline><Number>0</Number><Start>${Rt(t.start)}</Start><Finish>${Rt(t.finish)}</Finish><Duration>${zt(t.work)}</Duration></Baseline>`);
|
|
2525
2682
|
}
|
|
2526
2683
|
for (let t of e.dependencies ?? []) {
|
|
2527
|
-
let e =
|
|
2528
|
-
l.has(e.id) && o.push(`<PredecessorLink><PredecessorUID>${l.get(e.id)}</PredecessorUID><Type>${
|
|
2684
|
+
let e = ke(t);
|
|
2685
|
+
l.has(e.id) && o.push(`<PredecessorLink><PredecessorUID>${l.get(e.id)}</PredecessorUID><Type>${Ft.indexOf(e.type)}</Type><LinkLag>${Math.round(e.lag * It)}</LinkLag><LagFormat>7</LagFormat></PredecessorLink>`);
|
|
2529
2686
|
}
|
|
2530
2687
|
d.push(" <Task>", ...o.map((e) => ` ${e}`), " </Task>");
|
|
2531
2688
|
}), d.push(" </Tasks>", "</Project>"), d.join("\n") + "\n";
|
|
2532
2689
|
}
|
|
2533
|
-
function
|
|
2534
|
-
let n =
|
|
2690
|
+
function Vt(e, t = {}) {
|
|
2691
|
+
let n = Pt(Nt(e), "Project");
|
|
2535
2692
|
if (!n) throw SyntaxError("Not a Microsoft Project XML file (no <Project>)");
|
|
2536
|
-
let r = (
|
|
2537
|
-
uid:
|
|
2538
|
-
name:
|
|
2539
|
-
level: Number(
|
|
2540
|
-
start:
|
|
2541
|
-
finish:
|
|
2542
|
-
progress: Number(
|
|
2543
|
-
milestone:
|
|
2544
|
-
summary:
|
|
2545
|
-
nullTask:
|
|
2546
|
-
baseline: e.children.find((e) => e.name === "Baseline" && (
|
|
2693
|
+
let r = (Pt(n, "Tasks")?.children.filter((e) => e.name === "Task") ?? []).map((e) => ({
|
|
2694
|
+
uid: Z(e, "UID"),
|
|
2695
|
+
name: Z(e, "Name"),
|
|
2696
|
+
level: Number(Z(e, "OutlineLevel") || 1),
|
|
2697
|
+
start: Z(e, "Start"),
|
|
2698
|
+
finish: Z(e, "Finish"),
|
|
2699
|
+
progress: Number(Z(e, "PercentComplete") || 0),
|
|
2700
|
+
milestone: Z(e, "Milestone") === "1",
|
|
2701
|
+
summary: Z(e, "Summary") === "1",
|
|
2702
|
+
nullTask: Z(e, "IsNull") === "1",
|
|
2703
|
+
baseline: e.children.find((e) => e.name === "Baseline" && (Z(e, "Number") || "0") === "0"),
|
|
2547
2704
|
links: e.children.filter((e) => e.name === "PredecessorLink")
|
|
2548
|
-
})).filter((e) => e.uid && e.start && !e.nullTask && !(e.uid === "0" && e.level <= 0)), i = r.every((e) => /T(0?0:00|0?8:00|0?9:00)/.test(e.start) && (e.milestone || /T(0?0:00|1[6-8]:00|23:59)/.test(e.finish))), a = t.dates === "date" || t.dates !== "datetime" && i, o = (e) => j(
|
|
2705
|
+
})).filter((e) => e.uid && e.start && !e.nullTask && !(e.uid === "0" && e.level <= 0)), i = r.every((e) => /T(0?0:00|0?8:00|0?9:00)/.test(e.start) && (e.milestone || /T(0?0:00|1[6-8]:00|23:59)/.test(e.finish))), a = t.dates === "date" || t.dates !== "datetime" && i, o = (e) => M(j(e.slice(0, 19)), a), s = (e) => {
|
|
2549
2706
|
if (!a) return o(e);
|
|
2550
|
-
let t =
|
|
2551
|
-
return
|
|
2707
|
+
let t = j(e.slice(0, 19));
|
|
2708
|
+
return M(N(t) === t ? P(t, -1) : t, !0);
|
|
2552
2709
|
}, c = [], l = r.map((e) => {
|
|
2553
2710
|
c.length = Math.max(0, e.level - 1);
|
|
2554
2711
|
let t = {
|
|
@@ -2556,14 +2713,14 @@ function zt(e, t = {}) {
|
|
|
2556
2713
|
name: e.name,
|
|
2557
2714
|
start: o(e.start)
|
|
2558
2715
|
};
|
|
2559
|
-
e.milestone ? t.type = "milestone" : t.end =
|
|
2716
|
+
e.milestone ? t.type = "milestone" : t.end = A(t.start) ? s(e.finish) : o(e.finish), t.end && j(t.end) < j(t.start) && (t.end = t.start), e.progress && (t.progress = e.progress);
|
|
2560
2717
|
let n = c[e.level - 2];
|
|
2561
|
-
n && (t.parentId = n), c[e.level - 1] = e.uid, e.summary && (t.type = "summary"), e.baseline &&
|
|
2718
|
+
n && (t.parentId = n), c[e.level - 1] = e.uid, e.summary && (t.type = "summary"), e.baseline && Z(e.baseline, "Start") && (t.baselineStart = o(Z(e.baseline, "Start")), !e.milestone && Z(e.baseline, "Finish") && (t.baselineEnd = A(t.baselineStart) ? s(Z(e.baseline, "Finish")) : o(Z(e.baseline, "Finish"))));
|
|
2562
2719
|
let r = [];
|
|
2563
2720
|
for (let t of e.links) {
|
|
2564
|
-
let e =
|
|
2721
|
+
let e = Z(t, "PredecessorUID");
|
|
2565
2722
|
if (!e) continue;
|
|
2566
|
-
let n =
|
|
2723
|
+
let n = Ft[Number(Z(t, "Type") || 1)] ?? "FS", i = Math.round(Number(Z(t, "LinkLag") || 0) / It * 100) / 100;
|
|
2567
2724
|
r.push(n === "FS" && !i ? e : {
|
|
2568
2725
|
id: e,
|
|
2569
2726
|
type: n,
|
|
@@ -2571,7 +2728,7 @@ function zt(e, t = {}) {
|
|
|
2571
2728
|
});
|
|
2572
2729
|
}
|
|
2573
2730
|
return r.length && (t.dependencies = r), t;
|
|
2574
|
-
}), u =
|
|
2731
|
+
}), u = Z(n, "Title") || Z(n, "Name") || void 0;
|
|
2575
2732
|
return {
|
|
2576
2733
|
...u ? { name: u } : {},
|
|
2577
2734
|
tasks: l
|
|
@@ -2579,34 +2736,34 @@ function zt(e, t = {}) {
|
|
|
2579
2736
|
}
|
|
2580
2737
|
//#endregion
|
|
2581
2738
|
//#region src/composables/useResourceTimeline.ts
|
|
2582
|
-
var
|
|
2583
|
-
function
|
|
2584
|
-
let e = _(
|
|
2739
|
+
var Ht = Symbol("m3-resource-timeline");
|
|
2740
|
+
function Ut() {
|
|
2741
|
+
let e = _(Ht, null);
|
|
2585
2742
|
if (!e) throw Error("useResourceTimeline() must be called inside <MResourceTimeline>");
|
|
2586
2743
|
return e;
|
|
2587
2744
|
}
|
|
2588
2745
|
//#endregion
|
|
2589
2746
|
//#region src/components/MResourceTimeline.vue?vue&type=script&setup=true&lang.ts
|
|
2590
|
-
var
|
|
2747
|
+
var Wt = ["aria-label"], Gt = ["aria-expanded", "onClick"], Kt = { class: "truncate" }, qt = { class: "ml-auto pr-2 text-label-medium text-on-surface-variant" }, Jt = ["src"], Yt = {
|
|
2591
2748
|
key: 0,
|
|
2592
2749
|
class: "material-symbols-outlined text-[20px]"
|
|
2593
|
-
},
|
|
2750
|
+
}, Xt = { class: "min-w-0" }, Zt = { class: "block truncate text-body-large text-on-surface" }, Qt = {
|
|
2594
2751
|
key: 0,
|
|
2595
2752
|
class: "block truncate text-body-small text-on-surface-variant"
|
|
2596
|
-
},
|
|
2753
|
+
}, $t = [
|
|
2597
2754
|
"aria-label",
|
|
2598
2755
|
"aria-pressed",
|
|
2599
2756
|
"onPointerdown",
|
|
2600
2757
|
"onDblclick",
|
|
2601
2758
|
"onContextmenu",
|
|
2602
2759
|
"onKeydown"
|
|
2603
|
-
],
|
|
2760
|
+
], en = { class: "flex min-w-0 flex-1 items-center gap-1 px-2" }, tn = { class: "min-w-0 flex-1 leading-tight" }, nn = { class: "block truncate text-label-large" }, rn = {
|
|
2604
2761
|
key: 0,
|
|
2605
2762
|
class: "block truncate text-label-small opacity-80"
|
|
2606
|
-
},
|
|
2763
|
+
}, an = ["title"], on = ["data-timeline-resize", "onPointerdown"], sn = { class: "text-body-medium text-on-surface-variant" }, cn = {
|
|
2607
2764
|
class: "sr-only",
|
|
2608
2765
|
"aria-live": "polite"
|
|
2609
|
-
},
|
|
2766
|
+
}, ln = 40, un = 56, dn = 400, fn = /* @__PURE__ */ g({
|
|
2610
2767
|
__name: "MResourceTimeline",
|
|
2611
2768
|
props: {
|
|
2612
2769
|
events: { default: () => [] },
|
|
@@ -2655,63 +2812,63 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2655
2812
|
"delete"
|
|
2656
2813
|
],
|
|
2657
2814
|
setup(t, { expose: n, emit: r }) {
|
|
2658
|
-
let a = t, o = r, c = e(), u = l(() => a.locale ?? (c.lang === "en" ? void 0 : c.lang)), g =
|
|
2659
|
-
|
|
2815
|
+
let a = t, o = r, c = e(), u = l(() => a.locale ?? (c.lang === "en" ? void 0 : c.lang)), g = oe(a.events);
|
|
2816
|
+
E(() => a.events, (e) => {
|
|
2660
2817
|
g.value = e;
|
|
2661
2818
|
});
|
|
2662
|
-
let _ =
|
|
2663
|
-
function
|
|
2819
|
+
let _ = oe(null), te = l(() => _.value ?? g.value), re = [], ce = [], le = S(0);
|
|
2820
|
+
function ue(e) {
|
|
2664
2821
|
g.value = e, o("update:events", e);
|
|
2665
2822
|
}
|
|
2666
|
-
function
|
|
2667
|
-
|
|
2668
|
-
}
|
|
2669
|
-
function T() {
|
|
2670
|
-
let e = ie.pop();
|
|
2671
|
-
e && (le.push(ce(g.value)), ue.value++, fe(e));
|
|
2823
|
+
function pe(e) {
|
|
2824
|
+
re.push(se(g.value)), re.length > 100 && re.shift(), ce.length = 0, le.value++, ue(e);
|
|
2672
2825
|
}
|
|
2673
2826
|
function D() {
|
|
2674
|
-
let e =
|
|
2675
|
-
e && (
|
|
2827
|
+
let e = re.pop();
|
|
2828
|
+
e && (ce.push(se(g.value)), le.value++, ue(e));
|
|
2676
2829
|
}
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
e && (
|
|
2830
|
+
function k() {
|
|
2831
|
+
let e = ce.pop();
|
|
2832
|
+
e && (re.push(se(g.value)), le.value++, ue(e));
|
|
2833
|
+
}
|
|
2834
|
+
let ge = l(() => (le.value, re.length > 0)), A = l(() => (le.value, ce.length > 0)), _e = l(() => new Map(te.value.map((e) => [e.id, e]))), N = l(() => new Map(a.resources.map((e) => [e.id, e]))), P = S(a.selection ?? []);
|
|
2835
|
+
E(() => a.selection, (e) => {
|
|
2836
|
+
e && (P.value = e);
|
|
2680
2837
|
});
|
|
2681
|
-
let
|
|
2682
|
-
function
|
|
2683
|
-
let t = e.filter((e) =>
|
|
2684
|
-
|
|
2685
|
-
}
|
|
2686
|
-
let
|
|
2687
|
-
|
|
2688
|
-
e && (
|
|
2838
|
+
let ve = l(() => new Set(P.value));
|
|
2839
|
+
function F(e) {
|
|
2840
|
+
let t = e.filter((e) => _e.value.get(e)?.selectable !== !1);
|
|
2841
|
+
P.value = t, o("update:selection", t);
|
|
2842
|
+
}
|
|
2843
|
+
let ye = S(a.collapsed ?? []);
|
|
2844
|
+
E(() => a.collapsed, (e) => {
|
|
2845
|
+
e && (ye.value = e);
|
|
2689
2846
|
});
|
|
2690
|
-
let
|
|
2691
|
-
function
|
|
2692
|
-
|
|
2847
|
+
let xe = l(() => new Set(ye.value));
|
|
2848
|
+
function Se(e) {
|
|
2849
|
+
ye.value = e, o("update:collapsed", e);
|
|
2693
2850
|
}
|
|
2694
|
-
let
|
|
2851
|
+
let Ce = (e) => Se(xe.value.has(e) ? ye.value.filter((t) => t !== e) : [...ye.value, e]), I = l(() => {
|
|
2695
2852
|
let e = /* @__PURE__ */ new Map();
|
|
2696
|
-
for (let t of
|
|
2697
|
-
let n =
|
|
2853
|
+
for (let t of te.value) {
|
|
2854
|
+
let n = B({
|
|
2698
2855
|
start: t.start,
|
|
2699
2856
|
end: t.end
|
|
2700
2857
|
});
|
|
2701
2858
|
Number.isFinite(n.start) && e.set(t.id, n);
|
|
2702
2859
|
}
|
|
2703
2860
|
return e;
|
|
2704
|
-
}),
|
|
2861
|
+
}), we = l(() => {
|
|
2705
2862
|
let e = /* @__PURE__ */ new Map();
|
|
2706
|
-
for (let t of
|
|
2707
|
-
for (let t of e.values()) t.sort((e, t) =>
|
|
2863
|
+
for (let t of te.value) I.value.has(t.id) && (e.get(t.resourceId) ?? e.set(t.resourceId, []).get(t.resourceId)).push(t);
|
|
2864
|
+
for (let t of e.values()) t.sort((e, t) => I.value.get(e.id).start - I.value.get(t.id).start);
|
|
2708
2865
|
return e;
|
|
2709
|
-
}),
|
|
2866
|
+
}), Te = l(() => {
|
|
2710
2867
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
2711
|
-
for (let [n, r] of
|
|
2868
|
+
for (let [n, r] of we.value) {
|
|
2712
2869
|
let i = [];
|
|
2713
2870
|
for (let t of r) {
|
|
2714
|
-
let n =
|
|
2871
|
+
let n = I.value.get(t.id), r = i.findIndex((e) => e <= n.start);
|
|
2715
2872
|
r < 0 && (r = i.length, i.push(0)), i[r] = n.end, e.set(t.id, r);
|
|
2716
2873
|
}
|
|
2717
2874
|
t.set(n, Math.max(1, i.length));
|
|
@@ -2721,7 +2878,7 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2721
2878
|
count: t
|
|
2722
2879
|
};
|
|
2723
2880
|
});
|
|
2724
|
-
function
|
|
2881
|
+
function Ee(e, t, n) {
|
|
2725
2882
|
let r = /* @__PURE__ */ new Map(), i = [];
|
|
2726
2883
|
for (let a of e) {
|
|
2727
2884
|
let e = n.get(a.id);
|
|
@@ -2730,11 +2887,11 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2730
2887
|
}
|
|
2731
2888
|
return r;
|
|
2732
2889
|
}
|
|
2733
|
-
let
|
|
2890
|
+
let De = l(() => {
|
|
2734
2891
|
let e = /* @__PURE__ */ new Map();
|
|
2735
|
-
for (let [t, n] of
|
|
2892
|
+
for (let [t, n] of we.value) for (let [r, i] of Ee(n, N.value.get(t)?.capacity ?? 1, I.value)) e.set(r, i);
|
|
2736
2893
|
return e;
|
|
2737
|
-
}),
|
|
2894
|
+
}), L = l(() => new Set(De.value.keys())), R = l(() => {
|
|
2738
2895
|
let e = [], t = /* @__PURE__ */ new Map(), n = [];
|
|
2739
2896
|
for (let e of a.resources) {
|
|
2740
2897
|
if (!e.group) {
|
|
@@ -2744,7 +2901,7 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2744
2901
|
t.has(e.group) || (t.set(e.group, []), n.push(e.group)), t.get(e.group).push(e);
|
|
2745
2902
|
}
|
|
2746
2903
|
let r = 0, i = (t) => {
|
|
2747
|
-
let n = Math.max(a.rowHeight, (
|
|
2904
|
+
let n = Math.max(a.rowHeight, (Te.value.count.get(t.id) ?? 1) * a.laneHeight + 8);
|
|
2748
2905
|
e.push({
|
|
2749
2906
|
kind: "resource",
|
|
2750
2907
|
key: t.id,
|
|
@@ -2764,35 +2921,35 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2764
2921
|
key: `group:${a}`,
|
|
2765
2922
|
group: a,
|
|
2766
2923
|
top: r,
|
|
2767
|
-
height:
|
|
2924
|
+
height: ln,
|
|
2768
2925
|
resources: n
|
|
2769
|
-
}), r +=
|
|
2926
|
+
}), r += ln, xe.value.has(a) || n.forEach(i);
|
|
2770
2927
|
}
|
|
2771
2928
|
return e;
|
|
2772
|
-
}),
|
|
2929
|
+
}), ke = l(() => {
|
|
2773
2930
|
let e = /* @__PURE__ */ new Map();
|
|
2774
|
-
for (let t of
|
|
2931
|
+
for (let t of R.value) t.kind === "resource" && e.set(t.resource.id, t);
|
|
2775
2932
|
return e;
|
|
2776
|
-
}),
|
|
2777
|
-
let e =
|
|
2933
|
+
}), Ae = l(() => {
|
|
2934
|
+
let e = R.value.at(-1);
|
|
2778
2935
|
return e ? e.top + e.height : 0;
|
|
2779
|
-
}),
|
|
2780
|
-
|
|
2781
|
-
e !== void 0 && (
|
|
2936
|
+
}), z = (e) => N.value.get(e)?.group, V = S(), Me = S(a.listWidth ?? 220);
|
|
2937
|
+
E(() => a.listWidth, (e) => {
|
|
2938
|
+
e !== void 0 && (Me.value = e);
|
|
2782
2939
|
});
|
|
2783
|
-
let
|
|
2940
|
+
let H = l(() => Me.value), Ne = l(() => {
|
|
2784
2941
|
let e = Infinity, t = -Infinity;
|
|
2785
|
-
for (let n of
|
|
2786
|
-
let n = a.start ?
|
|
2787
|
-
return Number.isFinite(e) || (e = n, t = n +
|
|
2942
|
+
for (let n of I.value.values()) e = Math.min(e, n.start), t = Math.max(t, n.end);
|
|
2943
|
+
let n = a.start ? j(a.start) : a.now ? j(a.now) : Date.now();
|
|
2944
|
+
return Number.isFinite(e) || (e = n, t = n + O), {
|
|
2788
2945
|
min: Math.min(e, n),
|
|
2789
|
-
max: Math.max(t, n +
|
|
2946
|
+
max: Math.max(t, n + O)
|
|
2790
2947
|
};
|
|
2791
|
-
}),
|
|
2792
|
-
scroller:
|
|
2793
|
-
listWidth:
|
|
2794
|
-
headerHeight:
|
|
2795
|
-
extent:
|
|
2948
|
+
}), U = Ie({
|
|
2949
|
+
scroller: V,
|
|
2950
|
+
listWidth: H,
|
|
2951
|
+
headerHeight: un,
|
|
2952
|
+
extent: Ne,
|
|
2796
2953
|
scale: () => a.scale,
|
|
2797
2954
|
pxPerDay: () => a.pxPerDay,
|
|
2798
2955
|
minPxPerDay: () => a.minPxPerDay,
|
|
@@ -2813,49 +2970,49 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2813
2970
|
workHours: () => a.workHours,
|
|
2814
2971
|
onScale: (e) => o("update:scale", e),
|
|
2815
2972
|
onPinch: () => {
|
|
2816
|
-
|
|
2973
|
+
q && X({ pointerId: q.id });
|
|
2817
2974
|
}
|
|
2818
|
-
}), { ppd:
|
|
2819
|
-
let e =
|
|
2820
|
-
return
|
|
2821
|
-
}),
|
|
2975
|
+
}), { ppd: W, view: G, timelineView: Pe, timelineWidth: Fe, todayMs: ze, xOf: K, timeAt: Ve, zoomIn: Ue, zoomOut: Ge, setScale: Ke, scrollToDate: qe, topCells: Je, bottomCells: Ye, offTimes: Xe } = U, Ze = l(() => {
|
|
2976
|
+
let e = G.value.top - dn, t = G.value.top + G.value.height + dn;
|
|
2977
|
+
return R.value.filter((n) => n.top + n.height >= e && n.top <= t);
|
|
2978
|
+
}), Qe = l(() => Ve(G.value.left - 400)), $e = l(() => Ve(G.value.left + Pe.value + 400)), et = l(() => {
|
|
2822
2979
|
let e = [];
|
|
2823
|
-
for (let t of
|
|
2824
|
-
let r =
|
|
2825
|
-
r.end >=
|
|
2980
|
+
for (let t of Ze.value) if (t.kind === "resource") for (let n of we.value.get(t.resource.id) ?? []) {
|
|
2981
|
+
let r = I.value.get(n.id);
|
|
2982
|
+
r.end >= Qe.value && r.start <= $e.value && e.push({
|
|
2826
2983
|
event: n,
|
|
2827
2984
|
row: t
|
|
2828
2985
|
});
|
|
2829
2986
|
}
|
|
2830
2987
|
return e;
|
|
2831
|
-
}),
|
|
2988
|
+
}), tt = l(() => a.laneHeight - 8), nt = l(() => {
|
|
2832
2989
|
let e = /* @__PURE__ */ new Map();
|
|
2833
|
-
for (let t of
|
|
2834
|
-
let n =
|
|
2990
|
+
for (let t of te.value) {
|
|
2991
|
+
let n = I.value.get(t.id), r = ke.value.get(t.resourceId);
|
|
2835
2992
|
if (!n || !r) continue;
|
|
2836
|
-
let i = (
|
|
2993
|
+
let i = (Te.value.count.get(t.resourceId) ?? 1) * a.laneHeight, o = r.top + (r.height - i) / 2 + (Te.value.lane.get(t.id) ?? 0) * a.laneHeight + 4;
|
|
2837
2994
|
e.set(t.id, {
|
|
2838
|
-
x:
|
|
2995
|
+
x: K(n.start),
|
|
2839
2996
|
y: o,
|
|
2840
|
-
w: Math.max(4,
|
|
2997
|
+
w: Math.max(4, K(n.end) - K(n.start))
|
|
2841
2998
|
});
|
|
2842
2999
|
}
|
|
2843
3000
|
return e;
|
|
2844
|
-
}),
|
|
2845
|
-
ppd:
|
|
2846
|
-
origin:
|
|
3001
|
+
}), rt = /* @__PURE__ */ new Map(), it = /* @__PURE__ */ new Map(), at = 0, ot = {
|
|
3002
|
+
ppd: W.value,
|
|
3003
|
+
origin: U.origin.value
|
|
2847
3004
|
};
|
|
2848
|
-
|
|
2849
|
-
let t =
|
|
2850
|
-
|
|
2851
|
-
ppd:
|
|
2852
|
-
origin:
|
|
3005
|
+
E(nt, (e) => {
|
|
3006
|
+
let t = ot.ppd !== W.value || ot.origin !== U.origin.value || i();
|
|
3007
|
+
ot = {
|
|
3008
|
+
ppd: W.value,
|
|
3009
|
+
origin: U.origin.value
|
|
2853
3010
|
};
|
|
2854
3011
|
let n = !1;
|
|
2855
3012
|
for (let [r, i] of e) {
|
|
2856
|
-
let e =
|
|
3013
|
+
let e = rt.get(r);
|
|
2857
3014
|
if (!e || t) {
|
|
2858
|
-
|
|
3015
|
+
rt.set(r, {
|
|
2859
3016
|
...i,
|
|
2860
3017
|
vx: 0,
|
|
2861
3018
|
vy: 0,
|
|
@@ -2866,7 +3023,7 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2866
3023
|
});
|
|
2867
3024
|
continue;
|
|
2868
3025
|
}
|
|
2869
|
-
if (
|
|
3026
|
+
if (ft.value?.id === r && ft.value.part === "body") {
|
|
2870
3027
|
Object.assign(e, {
|
|
2871
3028
|
x: i.x,
|
|
2872
3029
|
y: i.y,
|
|
@@ -2882,23 +3039,23 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2882
3039
|
}
|
|
2883
3040
|
(e.tx !== i.x || e.ty !== i.y || e.tw !== i.w) && (e.tx = i.x, e.ty = i.y, e.tw = i.w, n = !0);
|
|
2884
3041
|
}
|
|
2885
|
-
for (let t of
|
|
2886
|
-
n ?
|
|
3042
|
+
for (let t of rt.keys()) e.has(t) || rt.delete(t);
|
|
3043
|
+
n ? st() : lt();
|
|
2887
3044
|
}, {
|
|
2888
3045
|
immediate: !0,
|
|
2889
3046
|
flush: "post"
|
|
2890
3047
|
});
|
|
2891
|
-
function
|
|
2892
|
-
if (
|
|
3048
|
+
function st() {
|
|
3049
|
+
if (at) return;
|
|
2893
3050
|
let e = performance.now(), t = 1.8 * Math.sqrt(700), n = (r) => {
|
|
2894
3051
|
let i = Math.min((r - e) / 1e3, 1 / 30);
|
|
2895
3052
|
for (e = r; i > 0;) {
|
|
2896
3053
|
let e = Math.min(i, .004);
|
|
2897
|
-
for (let n of
|
|
3054
|
+
for (let n of rt.values()) n.vx += (-700 * (n.x - n.tx) - t * n.vx) * e, n.x += n.vx * e, n.vy += (-700 * (n.y - n.ty) - t * n.vy) * e, n.y += n.vy * e, n.vw += (-700 * (n.w - n.tw) - t * n.vw) * e, n.w += n.vw * e;
|
|
2898
3055
|
i -= e;
|
|
2899
3056
|
}
|
|
2900
3057
|
let a = !1;
|
|
2901
|
-
for (let e of
|
|
3058
|
+
for (let e of rt.values()) Math.abs(e.x - e.tx) + Math.abs(e.y - e.ty) + Math.abs(e.w - e.tw) < .6 && Math.abs(e.vx) + Math.abs(e.vy) + Math.abs(e.vw) < 4 ? Object.assign(e, {
|
|
2902
3059
|
x: e.tx,
|
|
2903
3060
|
y: e.ty,
|
|
2904
3061
|
w: e.tw,
|
|
@@ -2906,168 +3063,192 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
2906
3063
|
vy: 0,
|
|
2907
3064
|
vw: 0
|
|
2908
3065
|
}) : a = !0;
|
|
2909
|
-
|
|
3066
|
+
lt(), at = a ? requestAnimationFrame(n) : 0;
|
|
2910
3067
|
};
|
|
2911
|
-
|
|
3068
|
+
at = requestAnimationFrame(n);
|
|
2912
3069
|
}
|
|
2913
|
-
function
|
|
2914
|
-
let n =
|
|
3070
|
+
function ct(e, t) {
|
|
3071
|
+
let n = rt.get(e);
|
|
2915
3072
|
n && (t.style.transform = `translate(${n.x}px, ${n.y}px)`, t.style.width = `${n.w}px`);
|
|
2916
3073
|
}
|
|
2917
|
-
function
|
|
2918
|
-
for (let [e, t] of
|
|
3074
|
+
function lt() {
|
|
3075
|
+
for (let [e, t] of it) ct(e, t);
|
|
2919
3076
|
}
|
|
2920
|
-
function
|
|
2921
|
-
t instanceof HTMLElement ? (
|
|
3077
|
+
function ut(e, t) {
|
|
3078
|
+
t instanceof HTMLElement ? (it.set(e, t), ct(e, t)) : it.delete(e);
|
|
3079
|
+
}
|
|
3080
|
+
let q = null, dt, ft = S(null), pt = S(!1), mt = S(a.listWidth ?? 220);
|
|
3081
|
+
E(() => a.listWidth, (e) => {
|
|
3082
|
+
e !== void 0 && (mt.value = e);
|
|
3083
|
+
});
|
|
3084
|
+
function ht(e) {
|
|
3085
|
+
Me.value = e, o("update:listWidth", e);
|
|
2922
3086
|
}
|
|
2923
|
-
let
|
|
3087
|
+
let gt = S(null), _t = S(!1), vt = {
|
|
2924
3088
|
x: 0,
|
|
2925
3089
|
y: 0
|
|
2926
|
-
},
|
|
2927
|
-
function
|
|
2928
|
-
|
|
3090
|
+
}, yt = (e) => e instanceof Element && !!e.closest("input, textarea, select, button, a, [contenteditable], [data-timeline-action]");
|
|
3091
|
+
function J(e) {
|
|
3092
|
+
e.pointerType !== "touch" && e.preventDefault();
|
|
3093
|
+
}
|
|
3094
|
+
function bt(e, t) {
|
|
3095
|
+
let n = V.value.getBoundingClientRect();
|
|
2929
3096
|
return {
|
|
2930
|
-
x: e - n.left -
|
|
2931
|
-
y: t - n.top -
|
|
3097
|
+
x: e - n.left - H.value + V.value.scrollLeft,
|
|
3098
|
+
y: t - n.top - un + V.value.scrollTop
|
|
2932
3099
|
};
|
|
2933
3100
|
}
|
|
2934
|
-
function
|
|
2935
|
-
let t =
|
|
3101
|
+
function Y(e) {
|
|
3102
|
+
let t = R.value.find((t) => e >= t.top && e < t.top + t.height);
|
|
2936
3103
|
return t?.kind === "resource" ? t.resource : void 0;
|
|
2937
3104
|
}
|
|
2938
|
-
function
|
|
2939
|
-
return e ? 1440 : a.snap ?? (
|
|
3105
|
+
function xt(e) {
|
|
3106
|
+
return e ? 1440 : a.snap ?? (W.value >= 192 ? 15 : Oe(W.value));
|
|
2940
3107
|
}
|
|
2941
|
-
function
|
|
2942
|
-
if (e.button !== 0 ||
|
|
2943
|
-
e.stopPropagation();
|
|
2944
|
-
let r =
|
|
3108
|
+
function St(e, t, n) {
|
|
3109
|
+
if (e.button !== 0 || yt(e.target)) return;
|
|
3110
|
+
e.stopPropagation(), J(e);
|
|
3111
|
+
let r = I.value.get(t.id);
|
|
2945
3112
|
if (!r) return;
|
|
2946
3113
|
let i = e.pointerType === "touch";
|
|
2947
|
-
|
|
3114
|
+
q = {
|
|
2948
3115
|
kind: "event",
|
|
2949
3116
|
part: n,
|
|
2950
3117
|
id: e.pointerId,
|
|
2951
3118
|
eventId: t.id,
|
|
2952
3119
|
sx: e.clientX,
|
|
2953
3120
|
sy: e.clientY,
|
|
2954
|
-
sl:
|
|
2955
|
-
st:
|
|
3121
|
+
sl: V.value.scrollLeft,
|
|
3122
|
+
st: V.value.scrollTop,
|
|
2956
3123
|
touch: i,
|
|
2957
3124
|
active: !1,
|
|
2958
3125
|
span: r,
|
|
2959
3126
|
resourceId: t.resourceId
|
|
2960
|
-
},
|
|
3127
|
+
}, Tt(), i && n === "body" ? dt = setTimeout(() => Dt(), 250) : i && Dt();
|
|
2961
3128
|
}
|
|
2962
|
-
function
|
|
2963
|
-
if (e.button !== 0 ||
|
|
2964
|
-
|
|
3129
|
+
function Ct(e) {
|
|
3130
|
+
if (e.button !== 0 || yt(e.target)) return;
|
|
3131
|
+
J(e);
|
|
3132
|
+
let t = bt(e.clientX, e.clientY), n = Y(t.y), r = e.pointerType === "touch";
|
|
2965
3133
|
if (n && a.creatable && !a.readonly) {
|
|
2966
|
-
|
|
3134
|
+
q = {
|
|
2967
3135
|
kind: "empty",
|
|
2968
3136
|
id: e.pointerId,
|
|
2969
3137
|
resourceId: n.id,
|
|
2970
3138
|
sx: e.clientX,
|
|
2971
3139
|
sy: e.clientY,
|
|
2972
|
-
t0:
|
|
3140
|
+
t0: Ve(t.x),
|
|
2973
3141
|
touch: r,
|
|
2974
3142
|
active: !1
|
|
2975
|
-
},
|
|
3143
|
+
}, Tt(), r && (dt = setTimeout(() => Dt(), 350));
|
|
2976
3144
|
return;
|
|
2977
3145
|
}
|
|
2978
3146
|
if (r) {
|
|
2979
|
-
n && (
|
|
3147
|
+
n && (q = {
|
|
2980
3148
|
kind: "empty",
|
|
2981
3149
|
id: e.pointerId,
|
|
2982
3150
|
resourceId: n.id,
|
|
2983
3151
|
sx: e.clientX,
|
|
2984
3152
|
sy: e.clientY,
|
|
2985
|
-
t0:
|
|
3153
|
+
t0: Ve(t.x),
|
|
2986
3154
|
touch: r,
|
|
2987
3155
|
active: !1
|
|
2988
|
-
},
|
|
3156
|
+
}, Tt());
|
|
2989
3157
|
return;
|
|
2990
3158
|
}
|
|
2991
|
-
|
|
3159
|
+
q = {
|
|
2992
3160
|
kind: "pan",
|
|
2993
3161
|
id: e.pointerId,
|
|
2994
3162
|
sx: e.clientX,
|
|
2995
3163
|
sy: e.clientY,
|
|
2996
|
-
sl:
|
|
2997
|
-
st:
|
|
3164
|
+
sl: V.value.scrollLeft,
|
|
3165
|
+
st: V.value.scrollTop,
|
|
2998
3166
|
moved: !1,
|
|
2999
3167
|
resourceId: n?.id
|
|
3000
|
-
},
|
|
3168
|
+
}, Tt();
|
|
3001
3169
|
}
|
|
3002
|
-
function
|
|
3003
|
-
e.button === 0 && (e.preventDefault(),
|
|
3170
|
+
function wt(e) {
|
|
3171
|
+
e.button === 0 && (e.preventDefault(), q = {
|
|
3004
3172
|
kind: "split",
|
|
3005
3173
|
id: e.pointerId,
|
|
3006
3174
|
sx: e.clientX,
|
|
3007
|
-
w:
|
|
3008
|
-
},
|
|
3175
|
+
w: Me.value
|
|
3176
|
+
}, pt.value = !0, Le("col-resize"), Tt());
|
|
3009
3177
|
}
|
|
3010
|
-
function
|
|
3011
|
-
window.addEventListener("pointermove",
|
|
3178
|
+
function Tt() {
|
|
3179
|
+
window.addEventListener("pointermove", Ot), window.addEventListener("pointerup", Mt), window.addEventListener("pointercancel", X);
|
|
3012
3180
|
}
|
|
3013
|
-
function
|
|
3014
|
-
window.removeEventListener("pointermove",
|
|
3181
|
+
function Et() {
|
|
3182
|
+
window.removeEventListener("pointermove", Ot), window.removeEventListener("pointerup", Mt), window.removeEventListener("pointercancel", X), clearTimeout(dt), Re(), pt.value = !1;
|
|
3015
3183
|
}
|
|
3016
|
-
function
|
|
3017
|
-
let e =
|
|
3184
|
+
function Dt() {
|
|
3185
|
+
let e = q;
|
|
3018
3186
|
if (!(!e || e.kind !== "event" && e.kind !== "empty" || e.active)) {
|
|
3019
3187
|
if (e.kind === "event") {
|
|
3020
|
-
let t =
|
|
3188
|
+
let t = _e.value.get(e.eventId);
|
|
3021
3189
|
if (!t || a.readonly || e.part === "body" && t.draggable === !1 || e.part !== "body" && t.resizable === !1) return;
|
|
3022
|
-
e.active = !0,
|
|
3190
|
+
e.active = !0, ve.value.has(t.id) || F([t.id]), ft.value = {
|
|
3023
3191
|
id: t.id,
|
|
3024
3192
|
part: e.part
|
|
3025
3193
|
};
|
|
3026
3194
|
} else {
|
|
3027
3195
|
if (!a.creatable || a.readonly) return;
|
|
3028
3196
|
e.active = !0;
|
|
3029
|
-
let t =
|
|
3030
|
-
|
|
3197
|
+
let t = xt(!1) * 6e4, n = be(e.t0, xt(!1));
|
|
3198
|
+
gt.value = {
|
|
3031
3199
|
resourceId: e.resourceId,
|
|
3032
3200
|
start: n,
|
|
3033
|
-
end: n + Math.max(t,
|
|
3201
|
+
end: n + Math.max(t, he)
|
|
3034
3202
|
};
|
|
3035
3203
|
}
|
|
3036
|
-
e.touch && navigator.vibrate?.(10),
|
|
3204
|
+
e.touch && navigator.vibrate?.(10), Le(e.kind === "event" && e.part !== "body" ? "ew-resize" : e.kind === "event" ? "grabbing" : "crosshair"), Pt();
|
|
3037
3205
|
}
|
|
3038
3206
|
}
|
|
3039
|
-
function
|
|
3040
|
-
let t =
|
|
3207
|
+
function Ot(e) {
|
|
3208
|
+
let t = q;
|
|
3041
3209
|
if (t && t.id === e.pointerId) {
|
|
3042
|
-
if (
|
|
3043
|
-
|
|
3044
|
-
Ne.value = n, o("update:listWidth", n);
|
|
3045
|
-
return;
|
|
3046
|
-
}
|
|
3047
|
-
if (t.kind === "pan") {
|
|
3048
|
-
let n = e.clientX - t.sx, r = e.clientY - t.sy;
|
|
3049
|
-
if (!t.moved && Math.hypot(n, r) < 4) return;
|
|
3050
|
-
t.moved = !0, B.value.scrollLeft = t.sl - n, B.value.scrollTop = t.st - r;
|
|
3210
|
+
if (vt.x = e.clientX, vt.y = e.clientY, t.kind === "split") {
|
|
3211
|
+
ht(Math.round(Math.min(Math.max(0, t.w + e.clientX - t.sx), Math.max(160, G.value.width - 80))));
|
|
3051
3212
|
return;
|
|
3052
3213
|
}
|
|
3214
|
+
if (t.kind === "pan") return kt(t, e);
|
|
3053
3215
|
if (!t.active) {
|
|
3054
3216
|
let n = Math.hypot(e.clientX - t.sx, e.clientY - t.sy);
|
|
3055
3217
|
if (t.touch) {
|
|
3056
|
-
n > 8 && (
|
|
3218
|
+
n > 8 && (q = null, Et());
|
|
3219
|
+
return;
|
|
3220
|
+
}
|
|
3221
|
+
if (n < 4) return;
|
|
3222
|
+
if (Dt(), !t.active) {
|
|
3223
|
+
if (t.kind === "event" && t.part === "body") {
|
|
3224
|
+
let n = {
|
|
3225
|
+
kind: "pan",
|
|
3226
|
+
id: t.id,
|
|
3227
|
+
sx: t.sx,
|
|
3228
|
+
sy: t.sy,
|
|
3229
|
+
sl: t.sl,
|
|
3230
|
+
st: t.st,
|
|
3231
|
+
moved: !0
|
|
3232
|
+
};
|
|
3233
|
+
q = n, Le("grabbing"), kt(n, e);
|
|
3234
|
+
}
|
|
3057
3235
|
return;
|
|
3058
3236
|
}
|
|
3059
|
-
if (n < 4 || (xt(), !t.active)) return;
|
|
3060
3237
|
}
|
|
3061
|
-
|
|
3238
|
+
At(e.clientX, e.clientY);
|
|
3062
3239
|
}
|
|
3063
3240
|
}
|
|
3064
|
-
function
|
|
3065
|
-
let n =
|
|
3241
|
+
function kt(e, t) {
|
|
3242
|
+
let n = t.clientX - e.sx, r = t.clientY - e.sy;
|
|
3243
|
+
!e.moved && Math.hypot(n, r) < 4 || (e.moved || (e.moved = !0, Le("grabbing")), V.value.scrollLeft = e.sl - n, V.value.scrollTop = e.st - r);
|
|
3244
|
+
}
|
|
3245
|
+
function At(e, t) {
|
|
3246
|
+
let n = q;
|
|
3066
3247
|
if (!n || n.kind !== "event" && n.kind !== "empty" || !n.active) return;
|
|
3067
|
-
let r =
|
|
3248
|
+
let r = bt(e, t);
|
|
3068
3249
|
if (n.kind === "empty") {
|
|
3069
|
-
let e =
|
|
3070
|
-
|
|
3250
|
+
let e = xt(!1), t = be(n.t0, e), i = be(Ve(r.x), e), a = Math.max(e * 6e4, 9e5);
|
|
3251
|
+
gt.value = {
|
|
3071
3252
|
resourceId: n.resourceId,
|
|
3072
3253
|
start: Math.min(t, i),
|
|
3073
3254
|
end: Math.max(Math.max(t, i), Math.min(t, i) + a)
|
|
@@ -3076,127 +3257,127 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
3076
3257
|
}
|
|
3077
3258
|
let i = g.value.find((e) => e.id === n.eventId);
|
|
3078
3259
|
if (!i) return;
|
|
3079
|
-
let o = n.span, s = (e - n.sx + (
|
|
3260
|
+
let o = n.span, s = (e - n.sx + (V.value.scrollLeft - n.sl)) / W.value * O, c = xt(o.dateOnly), l = o.dateOnly ? O : c * 6e4, u;
|
|
3080
3261
|
if (n.part === "body") {
|
|
3081
|
-
let e =
|
|
3262
|
+
let e = be(o.start + s, c), t = Y(r.y), n = t && !a.readonly ? t.id : i.resourceId;
|
|
3082
3263
|
u = {
|
|
3083
3264
|
...i,
|
|
3084
|
-
...
|
|
3265
|
+
...je({
|
|
3085
3266
|
start: i.start,
|
|
3086
3267
|
end: i.end
|
|
3087
3268
|
}, e, e + (o.end - o.start)),
|
|
3088
3269
|
resourceId: n
|
|
3089
3270
|
};
|
|
3090
3271
|
} else if (n.part === "start") {
|
|
3091
|
-
let e = Math.min(
|
|
3272
|
+
let e = Math.min(be(o.start + s, c), o.end - l);
|
|
3092
3273
|
u = {
|
|
3093
3274
|
...i,
|
|
3094
|
-
...
|
|
3275
|
+
...je({
|
|
3095
3276
|
start: i.start,
|
|
3096
3277
|
end: i.end
|
|
3097
3278
|
}, e, o.end)
|
|
3098
3279
|
};
|
|
3099
3280
|
} else {
|
|
3100
|
-
let e = Math.max(
|
|
3281
|
+
let e = Math.max(be(o.end + s, c), o.start + l);
|
|
3101
3282
|
u = {
|
|
3102
3283
|
...i,
|
|
3103
|
-
...
|
|
3284
|
+
...je({
|
|
3104
3285
|
start: i.start,
|
|
3105
3286
|
end: i.end
|
|
3106
3287
|
}, o.start, e)
|
|
3107
3288
|
};
|
|
3108
3289
|
}
|
|
3109
3290
|
let d = g.value.map((e) => e.id === i.id ? u : e);
|
|
3110
|
-
_.value = d,
|
|
3291
|
+
_.value = d, _t.value = a.overlap === "prevent" && jt(u, d).length > 0;
|
|
3111
3292
|
}
|
|
3112
|
-
function
|
|
3293
|
+
function jt(e, t) {
|
|
3113
3294
|
let n = /* @__PURE__ */ new Map(), r = t.filter((t) => t.resourceId === e.resourceId);
|
|
3114
|
-
for (let e of r) n.set(e.id,
|
|
3295
|
+
for (let e of r) n.set(e.id, B({
|
|
3115
3296
|
start: e.start,
|
|
3116
3297
|
end: e.end
|
|
3117
3298
|
}));
|
|
3118
3299
|
r.sort((e, t) => n.get(e.id).start - n.get(t.id).start);
|
|
3119
|
-
let i =
|
|
3300
|
+
let i = Ee(r, N.value.get(e.resourceId)?.capacity ?? 1, n).get(e.id);
|
|
3120
3301
|
return i ? r.filter((e) => i.includes(e.id)) : [];
|
|
3121
3302
|
}
|
|
3122
|
-
function
|
|
3123
|
-
let t =
|
|
3124
|
-
if (!t || t.id !== e.pointerId || (
|
|
3303
|
+
function Mt(e) {
|
|
3304
|
+
let t = q;
|
|
3305
|
+
if (!t || t.id !== e.pointerId || (q = null, Et(), Z(), t.kind === "split")) return;
|
|
3125
3306
|
if (t.kind === "pan") {
|
|
3126
3307
|
!t.moved && t.resourceId && o("slot-click", {
|
|
3127
3308
|
resourceId: t.resourceId,
|
|
3128
|
-
start:
|
|
3129
|
-
}), t.moved ||
|
|
3309
|
+
start: M(be(Ve(bt(e.clientX, e.clientY).x), xt(!1)), !1)
|
|
3310
|
+
}), t.moved || F([]);
|
|
3130
3311
|
return;
|
|
3131
3312
|
}
|
|
3132
3313
|
if (t.kind === "empty") {
|
|
3133
|
-
let e =
|
|
3134
|
-
|
|
3314
|
+
let e = gt.value;
|
|
3315
|
+
gt.value = null, t.active && e ? o("create", {
|
|
3135
3316
|
resourceId: e.resourceId,
|
|
3136
|
-
start:
|
|
3137
|
-
end:
|
|
3317
|
+
start: M(e.start, !1),
|
|
3318
|
+
end: M(e.end, !1)
|
|
3138
3319
|
}) : t.active || (o("slot-click", {
|
|
3139
3320
|
resourceId: t.resourceId,
|
|
3140
|
-
start:
|
|
3141
|
-
}),
|
|
3321
|
+
start: M(be(t.t0, xt(!1)), !1)
|
|
3322
|
+
}), F([]));
|
|
3142
3323
|
return;
|
|
3143
3324
|
}
|
|
3144
|
-
|
|
3145
|
-
let n =
|
|
3325
|
+
ft.value = null;
|
|
3326
|
+
let n = _e.value.get(t.eventId);
|
|
3146
3327
|
if (!t.active) {
|
|
3147
3328
|
if (_.value = null, !n) return;
|
|
3148
|
-
n.selectable !== !1 && (e.shiftKey || e.ctrlKey || e.metaKey ?
|
|
3329
|
+
n.selectable !== !1 && (e.shiftKey || e.ctrlKey || e.metaKey ? F(ve.value.has(n.id) ? P.value.filter((e) => e !== n.id) : [...P.value, n.id]) : F([n.id])), o("event-click", n, e);
|
|
3149
3330
|
return;
|
|
3150
3331
|
}
|
|
3151
3332
|
let r = _.value;
|
|
3152
3333
|
_.value = null;
|
|
3153
3334
|
let i = r?.find((e) => e.id === t.eventId), s = g.value.find((e) => e.id === t.eventId);
|
|
3154
|
-
if (
|
|
3335
|
+
if (_t.value = !1, r && i && s && (i.start !== s.start || i.end !== s.end || i.resourceId !== s.resourceId)) {
|
|
3155
3336
|
if (a.overlap === "prevent") {
|
|
3156
|
-
let e =
|
|
3337
|
+
let e = jt(i, r);
|
|
3157
3338
|
if (e.length) {
|
|
3158
3339
|
o("conflict", {
|
|
3159
3340
|
event: i,
|
|
3160
3341
|
with: e
|
|
3161
|
-
}),
|
|
3342
|
+
}), Lt(c.timelineConflict);
|
|
3162
3343
|
return;
|
|
3163
3344
|
}
|
|
3164
3345
|
}
|
|
3165
|
-
|
|
3346
|
+
pe(r), o("change", {
|
|
3166
3347
|
events: [i],
|
|
3167
3348
|
kind: t.part === "body" ? "move" : "resize"
|
|
3168
|
-
}),
|
|
3349
|
+
}), Bt(i);
|
|
3169
3350
|
}
|
|
3170
3351
|
}
|
|
3171
|
-
function
|
|
3172
|
-
|
|
3352
|
+
function X(e) {
|
|
3353
|
+
q && q.id === e.pointerId && (q = null, Et(), Z(), _.value = null, ft.value = null, gt.value = null, _t.value = !1);
|
|
3173
3354
|
}
|
|
3174
|
-
let
|
|
3175
|
-
function
|
|
3176
|
-
if (
|
|
3355
|
+
let Nt = 0;
|
|
3356
|
+
function Pt() {
|
|
3357
|
+
if (Nt) return;
|
|
3177
3358
|
let e = () => {
|
|
3178
|
-
|
|
3179
|
-
let t =
|
|
3180
|
-
if (!t || !
|
|
3181
|
-
let n = t.getBoundingClientRect(), r = n.left +
|
|
3182
|
-
|
|
3359
|
+
Nt = requestAnimationFrame(e);
|
|
3360
|
+
let t = V.value;
|
|
3361
|
+
if (!t || !q || !("active" in q) || !q.active) return;
|
|
3362
|
+
let n = t.getBoundingClientRect(), r = n.left + H.value, i = 0, a = 0;
|
|
3363
|
+
vt.x < r + 40 ? i = -Math.ceil((r + 40 - vt.x) / 4) : vt.x > n.right - 40 && (i = Math.ceil((vt.x - n.right + 40) / 4)), vt.y < n.top + un + 40 ? a = -Math.ceil((n.top + un + 40 - vt.y) / 4) : vt.y > n.bottom - 40 && (a = Math.ceil((vt.y - n.bottom + 40) / 4)), (i || a) && (t.scrollLeft += i, t.scrollTop += a, At(vt.x, vt.y));
|
|
3183
3364
|
};
|
|
3184
|
-
|
|
3365
|
+
Nt = requestAnimationFrame(e);
|
|
3185
3366
|
}
|
|
3186
|
-
function
|
|
3187
|
-
cancelAnimationFrame(
|
|
3367
|
+
function Z() {
|
|
3368
|
+
cancelAnimationFrame(Nt), Nt = 0;
|
|
3188
3369
|
}
|
|
3189
|
-
function
|
|
3190
|
-
|
|
3370
|
+
function Ft(e) {
|
|
3371
|
+
U.pinchMove(e) || q && "active" in q && q.active && e.cancelable && e.preventDefault();
|
|
3191
3372
|
}
|
|
3192
|
-
let
|
|
3193
|
-
function
|
|
3194
|
-
|
|
3195
|
-
|
|
3373
|
+
let It = S("");
|
|
3374
|
+
function Lt(e) {
|
|
3375
|
+
It.value = "", v(() => {
|
|
3376
|
+
It.value = e;
|
|
3196
3377
|
});
|
|
3197
3378
|
}
|
|
3198
|
-
function
|
|
3199
|
-
let t =
|
|
3379
|
+
function Rt(e) {
|
|
3380
|
+
let t = j(e), n = /^\d{4}-\d{2}-\d{2}$/.test(e);
|
|
3200
3381
|
return new Intl.DateTimeFormat(u.value, n ? {
|
|
3201
3382
|
day: "numeric",
|
|
3202
3383
|
month: "short"
|
|
@@ -3206,44 +3387,44 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
3206
3387
|
minute: "2-digit"
|
|
3207
3388
|
}).format(t);
|
|
3208
3389
|
}
|
|
3209
|
-
function
|
|
3210
|
-
let t =
|
|
3211
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(e.start)) return `${
|
|
3390
|
+
function zt(e) {
|
|
3391
|
+
let t = j(e.start), n = j(e.end);
|
|
3392
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(e.start)) return `${Rt(e.start)} – ${Rt(e.end)}`;
|
|
3212
3393
|
let r = (e) => new Intl.DateTimeFormat(u.value, new Date(e).getMinutes() ? {
|
|
3213
3394
|
hour: "numeric",
|
|
3214
3395
|
minute: "2-digit"
|
|
3215
3396
|
} : { hour: "numeric" }).format(e);
|
|
3216
3397
|
return `${r(t)}–${r(n)}`;
|
|
3217
3398
|
}
|
|
3218
|
-
function
|
|
3219
|
-
|
|
3399
|
+
function Bt(e) {
|
|
3400
|
+
Lt(c.timelineMoved.replace("{title}", e.title).replace("{resource}", N.value.get(e.resourceId)?.name ?? "").replace("{start}", Rt(e.start)).replace("{end}", Rt(e.end)));
|
|
3220
3401
|
}
|
|
3221
|
-
function
|
|
3222
|
-
|
|
3402
|
+
function Vt(e) {
|
|
3403
|
+
pe([...g.value, ...Array.isArray(e) ? e : [e]]);
|
|
3223
3404
|
}
|
|
3224
|
-
function
|
|
3225
|
-
|
|
3405
|
+
function Ut(e, t) {
|
|
3406
|
+
pe(g.value.map((n) => n.id === e ? typeof t == "function" ? t(n) : {
|
|
3226
3407
|
...n,
|
|
3227
3408
|
...t
|
|
3228
3409
|
} : n));
|
|
3229
3410
|
}
|
|
3230
|
-
async function
|
|
3411
|
+
async function fn(e) {
|
|
3231
3412
|
let t = g.value.filter((t) => e.includes(t.id) && t.deletable !== !1);
|
|
3232
3413
|
if (!t.length || a.beforeDelete && !await a.beforeDelete(t)) return;
|
|
3233
3414
|
let n = new Set(t.map((e) => e.id));
|
|
3234
|
-
|
|
3415
|
+
pe(g.value.filter((e) => !n.has(e.id))), F(P.value.filter((e) => !n.has(e))), o("delete", { events: t }), Lt(c.ganttDeleted.replace("{count}", String(t.length)));
|
|
3235
3416
|
}
|
|
3236
|
-
function
|
|
3237
|
-
return
|
|
3417
|
+
function pn() {
|
|
3418
|
+
return R.value.filter((e) => e.kind === "resource");
|
|
3238
3419
|
}
|
|
3239
|
-
function
|
|
3420
|
+
function mn(e, t) {
|
|
3240
3421
|
let n = e.ctrlKey || e.metaKey;
|
|
3241
3422
|
if (n && e.key.toLowerCase() === "z") {
|
|
3242
|
-
e.preventDefault(), e.shiftKey ?
|
|
3423
|
+
e.preventDefault(), e.shiftKey ? k() : D();
|
|
3243
3424
|
return;
|
|
3244
3425
|
}
|
|
3245
3426
|
if (n && e.key.toLowerCase() === "y") {
|
|
3246
|
-
e.preventDefault(),
|
|
3427
|
+
e.preventDefault(), k();
|
|
3247
3428
|
return;
|
|
3248
3429
|
}
|
|
3249
3430
|
if (e.key === "Enter") {
|
|
@@ -3252,32 +3433,32 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
3252
3433
|
}
|
|
3253
3434
|
if (a.readonly) return;
|
|
3254
3435
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
3255
|
-
e.preventDefault(),
|
|
3436
|
+
e.preventDefault(), fn(ve.value.has(t.id) ? P.value : [t.id]);
|
|
3256
3437
|
return;
|
|
3257
3438
|
}
|
|
3258
|
-
let r =
|
|
3439
|
+
let r = I.value.get(t.id);
|
|
3259
3440
|
if (!r) return;
|
|
3260
|
-
let i = r.dateOnly ?
|
|
3441
|
+
let i = r.dateOnly ? O : xt(!1) * 6e4, s = null;
|
|
3261
3442
|
if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && t.draggable !== !1) {
|
|
3262
3443
|
let n = e.key === "ArrowLeft" ? -i : i;
|
|
3263
3444
|
if (e.shiftKey) {
|
|
3264
3445
|
if (t.resizable === !1) return;
|
|
3265
3446
|
s = {
|
|
3266
3447
|
...t,
|
|
3267
|
-
...
|
|
3448
|
+
...je({
|
|
3268
3449
|
start: t.start,
|
|
3269
3450
|
end: t.end
|
|
3270
3451
|
}, r.start, Math.max(r.start + i, r.end + n))
|
|
3271
3452
|
};
|
|
3272
3453
|
} else s = {
|
|
3273
3454
|
...t,
|
|
3274
|
-
...
|
|
3455
|
+
...je({
|
|
3275
3456
|
start: t.start,
|
|
3276
3457
|
end: t.end
|
|
3277
3458
|
}, r.start + n, r.end + n)
|
|
3278
3459
|
};
|
|
3279
3460
|
} else if ((e.key === "ArrowUp" || e.key === "ArrowDown") && t.draggable !== !1) {
|
|
3280
|
-
let n =
|
|
3461
|
+
let n = pn(), r = n[n.findIndex((e) => e.resource.id === t.resourceId) + (e.key === "ArrowUp" ? -1 : 1)];
|
|
3281
3462
|
r && (s = {
|
|
3282
3463
|
...t,
|
|
3283
3464
|
resourceId: r.resource.id
|
|
@@ -3286,24 +3467,24 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
3286
3467
|
if (!s) return;
|
|
3287
3468
|
e.preventDefault();
|
|
3288
3469
|
let l = g.value.map((e) => e.id === t.id ? s : e);
|
|
3289
|
-
if (a.overlap === "prevent" &&
|
|
3470
|
+
if (a.overlap === "prevent" && jt(s, l).length) {
|
|
3290
3471
|
o("conflict", {
|
|
3291
3472
|
event: s,
|
|
3292
|
-
with:
|
|
3293
|
-
}),
|
|
3473
|
+
with: jt(s, l)
|
|
3474
|
+
}), Lt(c.timelineConflict);
|
|
3294
3475
|
return;
|
|
3295
3476
|
}
|
|
3296
|
-
|
|
3477
|
+
pe(l), o("change", {
|
|
3297
3478
|
events: [s],
|
|
3298
3479
|
kind: e.shiftKey ? "resize" : "move"
|
|
3299
|
-
}),
|
|
3480
|
+
}), Bt(s), v(() => it.get(t.id)?.querySelector("[data-timeline-event]")?.focus({ preventScroll: !0 }));
|
|
3300
3481
|
}
|
|
3301
|
-
function
|
|
3302
|
-
let t =
|
|
3482
|
+
function hn(e) {
|
|
3483
|
+
let t = _e.value.get(e);
|
|
3303
3484
|
if (!t) return;
|
|
3304
|
-
let n =
|
|
3305
|
-
n &&
|
|
3306
|
-
let t =
|
|
3485
|
+
let n = z(t.resourceId);
|
|
3486
|
+
n && xe.value.has(n) && Ce(n), v(() => {
|
|
3487
|
+
let t = nt.value.get(e), n = V.value;
|
|
3307
3488
|
t && n && n.scrollTo({
|
|
3308
3489
|
left: Math.max(0, t.x - 48),
|
|
3309
3490
|
top: Math.max(0, t.y - 48),
|
|
@@ -3311,119 +3492,122 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
3311
3492
|
});
|
|
3312
3493
|
});
|
|
3313
3494
|
}
|
|
3314
|
-
function
|
|
3315
|
-
(e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "z" && !e.target.closest?.("[data-timeline-event]") && (e.preventDefault(), e.shiftKey ?
|
|
3495
|
+
function gn(e) {
|
|
3496
|
+
(e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "z" && !e.target.closest?.("[data-timeline-event]") && (e.preventDefault(), e.shiftKey ? k() : D());
|
|
3316
3497
|
}
|
|
3317
|
-
let
|
|
3498
|
+
let _n = {
|
|
3318
3499
|
primary: "bg-primary-container text-on-primary-container",
|
|
3319
3500
|
secondary: "bg-secondary-container text-on-secondary-container",
|
|
3320
3501
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
3321
3502
|
error: "bg-error-container text-on-error-container",
|
|
3322
3503
|
success: "bg-success-container text-on-success-container",
|
|
3323
3504
|
neutral: "bg-surface-container-highest text-on-surface"
|
|
3324
|
-
},
|
|
3505
|
+
}, vn = {
|
|
3325
3506
|
primary: "bg-primary",
|
|
3326
3507
|
secondary: "bg-secondary",
|
|
3327
3508
|
tertiary: "bg-tertiary",
|
|
3328
3509
|
error: "bg-error",
|
|
3329
3510
|
success: "bg-success",
|
|
3330
3511
|
neutral: "bg-outline"
|
|
3331
|
-
},
|
|
3332
|
-
function
|
|
3512
|
+
}, yn = (e) => e.color ?? N.value.get(e.resourceId)?.color ?? "primary";
|
|
3513
|
+
function bn(e) {
|
|
3333
3514
|
return e.split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0].toUpperCase()).join("");
|
|
3334
3515
|
}
|
|
3335
|
-
let
|
|
3516
|
+
let xn = l(() => {
|
|
3336
3517
|
let e = /* @__PURE__ */ new Map();
|
|
3337
|
-
for (let t of
|
|
3338
|
-
let n =
|
|
3339
|
-
n && e.set(t.resourceId, (e.get(t.resourceId) ?? 0) + (n.end - n.start) /
|
|
3518
|
+
for (let t of te.value) {
|
|
3519
|
+
let n = I.value.get(t.id);
|
|
3520
|
+
n && e.set(t.resourceId, (e.get(t.resourceId) ?? 0) + (n.end - n.start) / he);
|
|
3340
3521
|
}
|
|
3341
3522
|
return e;
|
|
3342
|
-
}),
|
|
3343
|
-
events: l(() =>
|
|
3344
|
-
selection: l(() =>
|
|
3345
|
-
conflicts:
|
|
3346
|
-
scale:
|
|
3347
|
-
pxPerDay:
|
|
3348
|
-
canUndo:
|
|
3349
|
-
canRedo:
|
|
3350
|
-
undo:
|
|
3351
|
-
redo:
|
|
3352
|
-
zoomIn:
|
|
3353
|
-
zoomOut:
|
|
3354
|
-
setScale:
|
|
3355
|
-
scrollToDate:
|
|
3356
|
-
scrollToEvent:
|
|
3357
|
-
setSelection:
|
|
3358
|
-
addEvents:
|
|
3359
|
-
updateEvent:
|
|
3360
|
-
removeEvents:
|
|
3523
|
+
}), Sn = {
|
|
3524
|
+
events: l(() => te.value),
|
|
3525
|
+
selection: l(() => P.value),
|
|
3526
|
+
conflicts: L,
|
|
3527
|
+
scale: U.scaleNow,
|
|
3528
|
+
pxPerDay: W,
|
|
3529
|
+
canUndo: ge,
|
|
3530
|
+
canRedo: A,
|
|
3531
|
+
undo: D,
|
|
3532
|
+
redo: k,
|
|
3533
|
+
zoomIn: Ue,
|
|
3534
|
+
zoomOut: Ge,
|
|
3535
|
+
setScale: Ke,
|
|
3536
|
+
scrollToDate: qe,
|
|
3537
|
+
scrollToEvent: hn,
|
|
3538
|
+
setSelection: F,
|
|
3539
|
+
addEvents: Vt,
|
|
3540
|
+
updateEvent: Ut,
|
|
3541
|
+
removeEvents: fn,
|
|
3361
3542
|
dateAt: (e) => {
|
|
3362
|
-
let t =
|
|
3363
|
-
return
|
|
3543
|
+
let t = V.value?.getBoundingClientRect();
|
|
3544
|
+
return M(be(Ve(e - (t?.left ?? 0) - H.value + G.value.left), xt(!1)), !1);
|
|
3364
3545
|
},
|
|
3365
3546
|
resourceAt: (e) => {
|
|
3366
|
-
let t =
|
|
3367
|
-
return
|
|
3547
|
+
let t = V.value?.getBoundingClientRect();
|
|
3548
|
+
return Y(e - (t?.top ?? 0) - un + G.value.top);
|
|
3368
3549
|
}
|
|
3369
3550
|
};
|
|
3370
|
-
return
|
|
3371
|
-
scale:
|
|
3551
|
+
return ie(Ht, Sn), ie(me, {
|
|
3552
|
+
scale: U.scaleNow,
|
|
3372
3553
|
readonly: l(() => a.readonly),
|
|
3373
|
-
canUndo:
|
|
3374
|
-
canRedo:
|
|
3554
|
+
canUndo: ge,
|
|
3555
|
+
canRedo: A,
|
|
3375
3556
|
foldable: l(() => a.resources.some((e) => e.group)),
|
|
3376
|
-
folded: l(() =>
|
|
3377
|
-
undo:
|
|
3378
|
-
redo:
|
|
3379
|
-
zoomIn:
|
|
3380
|
-
zoomOut:
|
|
3381
|
-
setScale:
|
|
3382
|
-
scrollToDate:
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3557
|
+
folded: l(() => ye.value.length > 0),
|
|
3558
|
+
undo: D,
|
|
3559
|
+
redo: k,
|
|
3560
|
+
zoomIn: Ue,
|
|
3561
|
+
zoomOut: Ge,
|
|
3562
|
+
setScale: Ke,
|
|
3563
|
+
scrollToDate: qe,
|
|
3564
|
+
fit: () => {
|
|
3565
|
+
I.value.size && U.fit(Ne.value);
|
|
3566
|
+
},
|
|
3567
|
+
expandAll: () => Se([]),
|
|
3568
|
+
collapseAll: () => Se([...new Set(a.resources.map((e) => e.group).filter((e) => !!e))])
|
|
3569
|
+
}), ne(() => {
|
|
3570
|
+
let e = V.value;
|
|
3571
|
+
e.addEventListener("touchmove", Ft, { passive: !1 }), v(() => {
|
|
3572
|
+
let t = a.start ? j(a.start) : ze.value ?? Ne.value.min;
|
|
3573
|
+
e.scrollLeft = Math.max(0, K(t) - Math.min(48, Pe.value / 4)), G.value.left = e.scrollLeft;
|
|
3390
3574
|
});
|
|
3391
|
-
}),
|
|
3392
|
-
|
|
3393
|
-
}), n(
|
|
3575
|
+
}), ee(() => {
|
|
3576
|
+
V.value?.removeEventListener("touchmove", Ft), Et(), Z(), cancelAnimationFrame(at);
|
|
3577
|
+
}), n(Sn), (e, n) => (x(), f("div", {
|
|
3394
3578
|
class: "m3-resource-timeline flex flex-col overflow-hidden rounded-md bg-surface text-on-surface",
|
|
3395
|
-
onKeydown:
|
|
3579
|
+
onKeydown: gn
|
|
3396
3580
|
}, [
|
|
3397
|
-
|
|
3581
|
+
ae(e.$slots, "default", { timeline: Sn }),
|
|
3398
3582
|
p("div", {
|
|
3399
3583
|
ref_key: "scroller",
|
|
3400
|
-
ref:
|
|
3584
|
+
ref: V,
|
|
3401
3585
|
class: "relative min-h-0 flex-1 touch-pan-x touch-pan-y overflow-auto overscroll-contain",
|
|
3402
|
-
onScrollPassive: n[
|
|
3403
|
-
onTouchstartPassive: n[
|
|
3404
|
-
onTouchendPassive: n[
|
|
3405
|
-
onContextmenu: n[
|
|
3586
|
+
onScrollPassive: n[4] ||= (...e) => T(U).readView && T(U).readView(...e),
|
|
3587
|
+
onTouchstartPassive: n[5] ||= (...e) => T(U).onTouchStart && T(U).onTouchStart(...e),
|
|
3588
|
+
onTouchendPassive: n[6] ||= (...e) => T(U).onTouchEnd && T(U).onTouchEnd(...e),
|
|
3589
|
+
onContextmenu: n[7] ||= (e) => T(q) && e.preventDefault()
|
|
3406
3590
|
}, [p("div", {
|
|
3407
3591
|
class: "relative",
|
|
3408
|
-
style:
|
|
3409
|
-
width: `${
|
|
3410
|
-
height: `${
|
|
3592
|
+
style: b({
|
|
3593
|
+
width: `${H.value + T(Fe)}px`,
|
|
3594
|
+
height: `${un + Math.max(Ae.value, T(G).height - un)}px`
|
|
3411
3595
|
})
|
|
3412
3596
|
}, [p("div", {
|
|
3413
3597
|
class: "sticky top-0 z-20 flex",
|
|
3414
|
-
style:
|
|
3415
|
-
height: `${
|
|
3416
|
-
width: `${
|
|
3598
|
+
style: b({
|
|
3599
|
+
height: `${un}px`,
|
|
3600
|
+
width: `${H.value + T(Fe)}px`
|
|
3417
3601
|
})
|
|
3418
|
-
}, [
|
|
3602
|
+
}, [H.value ? (x(), f("div", {
|
|
3419
3603
|
key: 0,
|
|
3420
3604
|
class: "sticky left-0 z-10 flex shrink-0 items-end border-r border-b border-outline-variant bg-surface-container-low px-4 pb-2 text-label-medium text-on-surface-variant",
|
|
3421
|
-
style:
|
|
3422
|
-
},
|
|
3423
|
-
width:
|
|
3424
|
-
"top-cells":
|
|
3425
|
-
"bottom-cells":
|
|
3426
|
-
"today-x":
|
|
3605
|
+
style: b({ width: `${H.value}px` })
|
|
3606
|
+
}, w(T(c).timelineResource), 5)) : d("", !0), h(Be, {
|
|
3607
|
+
width: T(Fe),
|
|
3608
|
+
"top-cells": T(Je),
|
|
3609
|
+
"bottom-cells": T(Ye),
|
|
3610
|
+
"today-x": T(ze) === null ? null : T(K)(T(ze))
|
|
3427
3611
|
}, null, 8, [
|
|
3428
3612
|
"width",
|
|
3429
3613
|
"top-cells",
|
|
@@ -3431,145 +3615,147 @@ var Ht = ["aria-label"], Ut = ["aria-expanded", "onClick"], Wt = { class: "trunc
|
|
|
3431
3615
|
"today-x"
|
|
3432
3616
|
])], 4), p("div", {
|
|
3433
3617
|
class: "flex",
|
|
3434
|
-
style:
|
|
3435
|
-
}, [
|
|
3618
|
+
style: b({ height: `${Math.max(Ae.value, T(G).height - un)}px` })
|
|
3619
|
+
}, [H.value ? (x(), f("div", {
|
|
3436
3620
|
key: 0,
|
|
3437
3621
|
class: "sticky left-0 z-10 shrink-0 border-r border-outline-variant bg-surface",
|
|
3438
|
-
style:
|
|
3622
|
+
style: b({ width: `${H.value}px` }),
|
|
3439
3623
|
role: "list",
|
|
3440
3624
|
"aria-label": t.label
|
|
3441
|
-
}, [(
|
|
3625
|
+
}, [(x(!0), f(s, null, C(Ze.value, (t) => (x(), f(s, { key: t.key }, [t.kind === "group" ? (x(), f("button", {
|
|
3442
3626
|
key: 0,
|
|
3443
3627
|
type: "button",
|
|
3444
3628
|
class: "absolute inset-x-0 flex items-center gap-1 border-b border-outline-variant/60 bg-surface-container-low px-2 text-left text-title-small text-on-surface outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-inset",
|
|
3445
|
-
style:
|
|
3629
|
+
style: b({
|
|
3446
3630
|
top: `${t.top}px`,
|
|
3447
3631
|
height: `${t.height}px`
|
|
3448
3632
|
}),
|
|
3449
|
-
"aria-expanded": !
|
|
3450
|
-
onClick: (e) =>
|
|
3451
|
-
}, [p("span", { class:
|
|
3633
|
+
"aria-expanded": !xe.value.has(t.group),
|
|
3634
|
+
onClick: (e) => Ce(t.group)
|
|
3635
|
+
}, [p("span", { class: y(["material-symbols-outlined text-[20px] text-on-surface-variant transition-transform duration-200", xe.value.has(t.group) ? "-rotate-90" : ""]) }, "expand_more", 2), ae(e.$slots, "group", {
|
|
3452
3636
|
group: t.group,
|
|
3453
3637
|
resources: t.resources,
|
|
3454
|
-
collapsed:
|
|
3455
|
-
}, () => [p("span",
|
|
3638
|
+
collapsed: xe.value.has(t.group)
|
|
3639
|
+
}, () => [p("span", Kt, w(t.group), 1), p("span", qt, w(t.resources.length), 1)])], 12, Gt)) : (x(), f("div", {
|
|
3456
3640
|
key: 1,
|
|
3457
3641
|
role: "listitem",
|
|
3458
3642
|
class: "absolute inset-x-0 flex items-center gap-3 border-b border-outline-variant/60 px-4",
|
|
3459
|
-
style:
|
|
3643
|
+
style: b({
|
|
3460
3644
|
top: `${t.top}px`,
|
|
3461
3645
|
height: `${t.height}px`
|
|
3462
3646
|
})
|
|
3463
|
-
}, [
|
|
3647
|
+
}, [ae(e.$slots, "resource", {
|
|
3464
3648
|
resource: t.resource,
|
|
3465
|
-
events:
|
|
3466
|
-
hours: Math.round((
|
|
3467
|
-
}, () => [t.resource.avatar ? (
|
|
3649
|
+
events: we.value.get(t.resource.id) ?? [],
|
|
3650
|
+
hours: Math.round((xn.value.get(t.resource.id) ?? 0) * 10) / 10
|
|
3651
|
+
}, () => [t.resource.avatar ? (x(), f("img", {
|
|
3468
3652
|
key: 0,
|
|
3469
3653
|
src: t.resource.avatar,
|
|
3470
3654
|
alt: "",
|
|
3471
3655
|
class: "size-9 shrink-0 rounded-full object-cover"
|
|
3472
|
-
}, null, 8,
|
|
3656
|
+
}, null, 8, Jt)) : (x(), f("span", {
|
|
3473
3657
|
key: 1,
|
|
3474
|
-
class:
|
|
3475
|
-
}, [t.resource.icon ? (
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
onKeydown: [n[
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3658
|
+
class: y(["flex size-9 shrink-0 items-center justify-center rounded-full text-label-large", _n[t.resource.color ?? "neutral"]])
|
|
3659
|
+
}, [t.resource.icon ? (x(), f("span", Yt, w(t.resource.icon), 1)) : (x(), f(s, { key: 1 }, [m(w(bn(t.resource.name)), 1)], 64))], 2)), p("span", Xt, [p("span", Zt, w(t.resource.name), 1), t.resource.subtitle ? (x(), f("span", Qt, w(t.resource.subtitle), 1)) : d("", !0)])])], 4))], 64))), 128)), h(We, {
|
|
3660
|
+
label: T(c).ganttResize,
|
|
3661
|
+
value: H.value,
|
|
3662
|
+
active: pt.value,
|
|
3663
|
+
"grip-top": T(G).top + Math.max(0, T(G).height - un) / 2,
|
|
3664
|
+
onPointerdown: wt,
|
|
3665
|
+
onDblclick: n[0] ||= (e) => ht(mt.value),
|
|
3666
|
+
onKeydown: [n[1] ||= de(fe((e) => ht(Math.max(120, Me.value - 16)), ["prevent"]), ["left"]), n[2] ||= de(fe((e) => ht(Me.value + 16), ["prevent"]), ["right"])]
|
|
3667
|
+
}, null, 8, [
|
|
3668
|
+
"label",
|
|
3669
|
+
"value",
|
|
3670
|
+
"active",
|
|
3671
|
+
"grip-top"
|
|
3672
|
+
])], 12, Wt)) : d("", !0), p("div", {
|
|
3673
|
+
class: y(["relative shrink-0 select-none [-webkit-user-drag:none]", t.creatable && !t.readonly ? "" : "cursor-grab active:cursor-grabbing"]),
|
|
3674
|
+
style: b({ width: `${T(Fe)}px` }),
|
|
3675
|
+
onPointerdown: Ct,
|
|
3676
|
+
onDragstart: n[3] ||= fe(() => {}, ["prevent"])
|
|
3491
3677
|
}, [
|
|
3492
|
-
h(
|
|
3493
|
-
"off-times":
|
|
3494
|
-
cells:
|
|
3495
|
-
"today-x":
|
|
3678
|
+
h(He, {
|
|
3679
|
+
"off-times": T(Xe),
|
|
3680
|
+
cells: T(Ye),
|
|
3681
|
+
"today-x": T(ze) === null ? null : T(K)(T(ze))
|
|
3496
3682
|
}, null, 8, [
|
|
3497
3683
|
"off-times",
|
|
3498
3684
|
"cells",
|
|
3499
3685
|
"today-x"
|
|
3500
3686
|
]),
|
|
3501
|
-
(
|
|
3687
|
+
(x(!0), f(s, null, C(Ze.value, (e) => (x(), f("div", {
|
|
3502
3688
|
key: `r${e.key}`,
|
|
3503
|
-
class:
|
|
3504
|
-
style:
|
|
3689
|
+
class: y(["pointer-events-none absolute inset-x-0 border-b border-outline-variant/60", e.kind === "group" ? "bg-surface-container-low/60" : ""]),
|
|
3690
|
+
style: b({
|
|
3505
3691
|
top: `${e.top}px`,
|
|
3506
3692
|
height: `${e.height}px`
|
|
3507
3693
|
})
|
|
3508
3694
|
}, null, 6))), 128)),
|
|
3509
|
-
|
|
3695
|
+
gt.value && ke.value.get(gt.value.resourceId) ? (x(), f("div", {
|
|
3510
3696
|
key: 0,
|
|
3511
3697
|
class: "pointer-events-none absolute rounded-sm border-2 border-dashed border-primary bg-primary/12",
|
|
3512
|
-
style:
|
|
3513
|
-
left: `${
|
|
3514
|
-
width: `${
|
|
3515
|
-
top: `${
|
|
3516
|
-
height: `${
|
|
3698
|
+
style: b({
|
|
3699
|
+
left: `${T(K)(gt.value.start)}px`,
|
|
3700
|
+
width: `${T(K)(gt.value.end) - T(K)(gt.value.start)}px`,
|
|
3701
|
+
top: `${ke.value.get(gt.value.resourceId).top + 4}px`,
|
|
3702
|
+
height: `${ke.value.get(gt.value.resourceId).height - 8}px`
|
|
3517
3703
|
})
|
|
3518
3704
|
}, null, 4)) : d("", !0),
|
|
3519
|
-
(
|
|
3705
|
+
(x(!0), f(s, null, C(et.value, ({ event: n }) => (x(), f("div", {
|
|
3520
3706
|
key: n.id,
|
|
3521
3707
|
ref_for: !0,
|
|
3522
|
-
ref: (e) =>
|
|
3523
|
-
class:
|
|
3524
|
-
style:
|
|
3708
|
+
ref: (e) => ut(n.id, e),
|
|
3709
|
+
class: y(["absolute top-0 left-0", [n.class, ft.value?.id === n.id ? "z-10" : ""]]),
|
|
3710
|
+
style: b({ height: `${tt.value}px` })
|
|
3525
3711
|
}, [p("div", {
|
|
3526
3712
|
"data-timeline-event": "",
|
|
3527
3713
|
role: "button",
|
|
3528
3714
|
tabindex: "0",
|
|
3529
|
-
"aria-label": `${n.title}, ${
|
|
3530
|
-
"aria-pressed":
|
|
3531
|
-
class:
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3715
|
+
"aria-label": `${n.title}, ${N.value.get(n.resourceId)?.name ?? ""}, ${zt(n)}`,
|
|
3716
|
+
"aria-pressed": ve.value.has(n.id),
|
|
3717
|
+
class: y(["group absolute inset-0 flex items-stretch overflow-hidden rounded-sm text-left outline-none select-none focus-visible:ring-2 focus-visible:ring-secondary focus-visible:ring-offset-1", [
|
|
3718
|
+
_n[yn(n)],
|
|
3719
|
+
ve.value.has(n.id) ? "ring-2 ring-on-surface ring-offset-1 ring-offset-surface" : "",
|
|
3720
|
+
L.value.has(n.id) || ft.value?.id === n.id && _t.value ? "outline-2 outline-offset-1 outline-error" : "",
|
|
3721
|
+
ft.value?.id === n.id ? "shadow-elevation-3" : "hover:shadow-elevation-1",
|
|
3536
3722
|
t.readonly || n.draggable === !1 ? "" : "cursor-grab active:cursor-grabbing"
|
|
3537
3723
|
]]),
|
|
3538
|
-
onPointerdown: (e) =>
|
|
3724
|
+
onPointerdown: (e) => St(e, n, "body"),
|
|
3539
3725
|
onDblclick: (e) => o("event-dblclick", n, e),
|
|
3540
3726
|
onContextmenu: (e) => o("event-contextmenu", n, e),
|
|
3541
|
-
onKeydown: (e) =>
|
|
3542
|
-
}, [p("span", { class:
|
|
3727
|
+
onKeydown: (e) => mn(e, n)
|
|
3728
|
+
}, [p("span", { class: y(["w-1 shrink-0", vn[yn(n)]]) }, null, 2), p("span", en, [ae(e.$slots, "event", {
|
|
3543
3729
|
event: n,
|
|
3544
|
-
resource:
|
|
3545
|
-
selected:
|
|
3546
|
-
conflict:
|
|
3547
|
-
}, () => [p("span",
|
|
3730
|
+
resource: N.value.get(n.resourceId),
|
|
3731
|
+
selected: ve.value.has(n.id),
|
|
3732
|
+
conflict: L.value.has(n.id)
|
|
3733
|
+
}, () => [p("span", tn, [p("span", nn, w(n.title), 1), tt.value >= 30 ? (x(), f("span", rn, w(n.subtitle ?? zt(n)), 1)) : d("", !0)]), L.value.has(n.id) && (nt.value.get(n.id)?.w ?? 0) > 72 ? (x(), f("span", {
|
|
3548
3734
|
key: 0,
|
|
3549
3735
|
class: "material-symbols-outlined shrink-0 text-[18px] text-error",
|
|
3550
|
-
title:
|
|
3551
|
-
}, "warning", 8,
|
|
3736
|
+
title: T(c).timelineConflict
|
|
3737
|
+
}, "warning", 8, an)) : d("", !0)])])], 42, $t), !t.readonly && n.resizable !== !1 ? (x(), f(s, { key: 0 }, C(["start", "end"], (e) => p("span", {
|
|
3552
3738
|
key: e,
|
|
3553
3739
|
"data-timeline-resize": e,
|
|
3554
|
-
class:
|
|
3555
|
-
onPointerdown: (t) =>
|
|
3556
|
-
}, [p("span", { class:
|
|
3557
|
-
t.resources.length ? d("", !0) : (
|
|
3740
|
+
class: y(["absolute inset-y-0 z-[1] flex w-3 cursor-ew-resize items-center justify-center pointer-coarse:w-7", e === "start" ? "-left-1 pointer-coarse:-left-3.5" : "-right-1 pointer-coarse:-right-3.5"]),
|
|
3741
|
+
onPointerdown: (t) => St(t, n, e)
|
|
3742
|
+
}, [p("span", { class: y(["hidden h-3/5 w-1 rounded-full bg-on-surface pointer-coarse:block", ve.value.has(n.id) ? "opacity-100" : "opacity-0"]) }, null, 2)], 42, on)), 64)) : d("", !0)], 6))), 128)),
|
|
3743
|
+
t.resources.length ? d("", !0) : (x(), f("div", {
|
|
3558
3744
|
key: 1,
|
|
3559
3745
|
class: "absolute flex items-center justify-center p-6",
|
|
3560
|
-
style:
|
|
3561
|
-
left: `${
|
|
3562
|
-
width: `${
|
|
3746
|
+
style: b({
|
|
3747
|
+
left: `${T(G).left}px`,
|
|
3748
|
+
width: `${T(Pe)}px`,
|
|
3563
3749
|
top: 0,
|
|
3564
|
-
height: `${Math.max(120,
|
|
3750
|
+
height: `${Math.max(120, T(G).height - un)}px`
|
|
3565
3751
|
})
|
|
3566
|
-
}, [
|
|
3567
|
-
],
|
|
3568
|
-
p("div",
|
|
3752
|
+
}, [ae(e.$slots, "empty", {}, () => [p("span", sn, w(T(c).timelineEmpty), 1)])], 4))
|
|
3753
|
+
], 38)], 4)], 4)], 544),
|
|
3754
|
+
p("div", cn, w(It.value), 1)
|
|
3569
3755
|
], 32));
|
|
3570
3756
|
}
|
|
3571
3757
|
});
|
|
3572
3758
|
//#endregion
|
|
3573
|
-
export {
|
|
3759
|
+
export { J as MGantt, xt as MGanttControls, fn as MResourceTimeline, U as addWorkingDays, Fe as criticalPath, At as parseGanttCsv, Mt as parseGanttJson, Vt as parseMsProjectXml, Me as rollupSummaries, Pe as scheduleTasks, B as taskSpan, Et as toGanttCsv, jt as toGanttJson, Bt as toMsProjectXml, D as useGantt, Ut as useResourceTimeline, Ne as workingDays };
|
|
3574
3760
|
|
|
3575
3761
|
//# sourceMappingURL=gantt.js.map
|