@object-ui/plugin-gantt 11.4.0 → 13.1.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/CHANGELOG.md +76 -0
- package/dist/GanttView.d.ts.map +1 -1
- package/dist/index.js +583 -579
- package/dist/index.umd.cjs +3 -3
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -4,19 +4,19 @@ import { ComponentRegistry as o, buildExpandFields as s, extractRecords as c, ge
|
|
|
4
4
|
import { useNavigationOverlay as u, useObjectTranslation as d, useSchemaContext as f } from "@object-ui/react";
|
|
5
5
|
import { GanttConfigSchema as p } from "@objectstack/spec/ui";
|
|
6
6
|
import { resolveFieldCurrency as m, useLocalization as h } from "@object-ui/i18n";
|
|
7
|
-
import { RecordDetailDrawer as g, deriveRecordPageHref as
|
|
8
|
-
import { AlertDialog as
|
|
9
|
-
import { formatCurrency as
|
|
10
|
-
import { Activity as
|
|
11
|
-
import { Fragment as
|
|
7
|
+
import { RecordDetailDrawer as g, deriveRecordPageHref as _ } from "@object-ui/plugin-detail";
|
|
8
|
+
import { AlertDialog as v, AlertDialogAction as y, AlertDialogCancel as ee, AlertDialogContent as te, AlertDialogDescription as ne, AlertDialogFooter as re, AlertDialogHeader as ie, AlertDialogTitle as ae, Button as b, cn as x, useResizeObserver as oe } from "@object-ui/components";
|
|
9
|
+
import { formatCurrency as se, formatDate as ce, formatDateTime as S, formatNumber as le, formatPercent as C, getSemanticColorName as ue, getSemanticHex as de, humanizeLabel as fe } from "@object-ui/fields";
|
|
10
|
+
import { Activity as pe, ChevronDown as me, ChevronLeft as he, ChevronRight as w, Crosshair as ge, Download as _e, FileDown as ve, Lock as T, Maximize2 as E, Minimize2 as ye, PanelLeft as be, PanelLeftClose as xe, Redo2 as Se, Save as Ce, Undo2 as we, Wand2 as Te, ZoomIn as Ee, ZoomOut as De } from "lucide-react";
|
|
11
|
+
import { Fragment as Oe, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
12
12
|
//#region src/scheduling.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
13
|
+
var ke = 1e3 * 60 * 60 * 24, Ae = (e) => e.toISOString().slice(0, 10);
|
|
14
|
+
function je(e, t) {
|
|
15
15
|
if (t.skipWeekends) {
|
|
16
16
|
let t = e.getUTCDay();
|
|
17
17
|
if (t === 0 || t === 6) return !1;
|
|
18
18
|
}
|
|
19
|
-
return !(t.holidays && t.holidays.has(
|
|
19
|
+
return !(t.holidays && t.holidays.has(Ae(e)));
|
|
20
20
|
}
|
|
21
21
|
function k(e) {
|
|
22
22
|
let t = new Date(e);
|
|
@@ -24,25 +24,25 @@ function k(e) {
|
|
|
24
24
|
}
|
|
25
25
|
function A(e, t) {
|
|
26
26
|
let n = k(e);
|
|
27
|
-
for (; !
|
|
27
|
+
for (; !je(n, t);) n = new Date(n.getTime() + ke);
|
|
28
28
|
return n.getTime();
|
|
29
29
|
}
|
|
30
30
|
function Me(e, t, n) {
|
|
31
31
|
if (t <= e) return 0;
|
|
32
32
|
let r = 0, i = k(e), a = k(t).getTime();
|
|
33
|
-
for (; i.getTime() < a;)
|
|
33
|
+
for (; i.getTime() < a;) je(i, n) && r++, i = new Date(i.getTime() + ke);
|
|
34
34
|
return r;
|
|
35
35
|
}
|
|
36
36
|
function j(e, t, n) {
|
|
37
37
|
if (t <= 0) return k(e).getTime();
|
|
38
38
|
let r = k(e), i = t;
|
|
39
|
-
for (; i > 0;)
|
|
39
|
+
for (; i > 0;) je(r, n) && i--, r = new Date(r.getTime() + ke);
|
|
40
40
|
return r.getTime();
|
|
41
41
|
}
|
|
42
42
|
function Ne(e, t, n) {
|
|
43
43
|
if (t <= 0) return k(e).getTime();
|
|
44
44
|
let r = k(e), i = t;
|
|
45
|
-
for (; i > 0;) r = /* @__PURE__ */ new Date(r.getTime() -
|
|
45
|
+
for (; i > 0;) r = /* @__PURE__ */ new Date(r.getTime() - ke), je(r, n) && i--;
|
|
46
46
|
return r.getTime();
|
|
47
47
|
}
|
|
48
48
|
var M = (e) => String(e);
|
|
@@ -105,7 +105,7 @@ function Ie(e, t) {
|
|
|
105
105
|
if (!e.length) return n;
|
|
106
106
|
let r = /* @__PURE__ */ new Map();
|
|
107
107
|
for (let n of e) {
|
|
108
|
-
let e = t ? Me(n.start.getTime(), n.end.getTime(), t) : (n.end.getTime() - n.start.getTime()) /
|
|
108
|
+
let e = t ? Me(n.start.getTime(), n.end.getTime(), t) : (n.end.getTime() - n.start.getTime()) / ke;
|
|
109
109
|
r.set(M(n.id), Number.isFinite(e) && e > 0 ? e : 0);
|
|
110
110
|
}
|
|
111
111
|
let i = Fe(e), a = e.map((e) => M(e.id)), { order: o, hasCycle: s } = P(a, i);
|
|
@@ -129,14 +129,14 @@ function Ie(e, t) {
|
|
|
129
129
|
let t = (m.get(e) ?? 0) - (u.get(e) ?? 0);
|
|
130
130
|
Math.abs(t) <= h && g.add(e);
|
|
131
131
|
}
|
|
132
|
-
let ee = /* @__PURE__ */ new Set();
|
|
133
|
-
for (let e of i) ee.add(e.pred), ee.add(e.succ);
|
|
134
|
-
for (let e of [...g]) !ee.has(e) && (r.get(e) ?? 0) === 0 && g.delete(e);
|
|
135
132
|
let _ = /* @__PURE__ */ new Set();
|
|
136
|
-
for (let e of i)
|
|
133
|
+
for (let e of i) _.add(e.pred), _.add(e.succ);
|
|
134
|
+
for (let e of [...g]) !_.has(e) && (r.get(e) ?? 0) === 0 && g.delete(e);
|
|
135
|
+
let v = /* @__PURE__ */ new Set();
|
|
136
|
+
for (let e of i) !g.has(e.pred) || !g.has(e.succ) || Math.abs((d.get(e.pred) ?? 0) - (u.get(e.succ) ?? 0)) <= h && v.add(`${e.pred}->${e.succ}`);
|
|
137
137
|
return {
|
|
138
138
|
criticalIds: g,
|
|
139
|
-
criticalEdges:
|
|
139
|
+
criticalEdges: v
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
function Le(e, t) {
|
|
@@ -222,13 +222,13 @@ function Be(e) {
|
|
|
222
222
|
showMidnight: e.showMidnight !== !1
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function I(e, t) {
|
|
226
226
|
let n = new Date(e);
|
|
227
227
|
return n.setHours(0, 0, 0, 0), n.setMinutes(t), n.getTime() > e.getTime() && n.setDate(n.getDate() - 1), n;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Ve(e, t) {
|
|
230
230
|
if (t.bands.length === 0) return null;
|
|
231
|
-
let n =
|
|
231
|
+
let n = I(e, t.dayStartMin).getTime(), r = e.getTime() - n, i = 0;
|
|
232
232
|
for (let e of t.bands) if (i += e.durMs, r < i) return e;
|
|
233
233
|
return t.bands[t.bands.length - 1];
|
|
234
234
|
}
|
|
@@ -428,22 +428,22 @@ function ot(e, t) {
|
|
|
428
428
|
window.localStorage.setItem(L + e, JSON.stringify(t));
|
|
429
429
|
} catch {}
|
|
430
430
|
}
|
|
431
|
-
function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTaskClick: o, onTaskUpdate: s, onTaskDelete: c, onViewChange: l, onDependencyCreate: u, onDependencyDelete: d, onTaskReorder: f, className: p, inlineEdit: m = !1, autoSchedule: h = !1, rescheduleOnConflict: g = !1, criticalPathDefault:
|
|
432
|
-
let { t:
|
|
433
|
-
ze.current === void 0 && (ze.current = at(
|
|
434
|
-
let F = ze.current, [Be,
|
|
431
|
+
function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTaskClick: o, onTaskUpdate: s, onTaskDelete: c, onViewChange: l, onDependencyCreate: u, onDependencyDelete: d, onTaskReorder: f, className: p, inlineEdit: m = !1, autoSchedule: h = !1, rescheduleOnConflict: g = !1, criticalPathDefault: _ = !1, workingCalendar: v, shiftSegments: y, showBaselines: ee = !0, readOnly: te = !1, mobileReadOnly: ne = !1, groupBy: re, ungroupedLabel: ie = "Ungrouped", defaultCollapsedDepth: ae, persistLayoutKey: se, onLayoutChange: ce }) {
|
|
432
|
+
let { t: S, language: le } = We(), C = le || void 0, [ue, de] = e.useState(/* @__PURE__ */ new Date()), fe = e.useRef(null), { width: ke } = oe(fe), Ae = ke || (typeof window < "u" ? window.innerWidth : 1024), je = Ae < 640, k = te || ne && je, A = k ? void 0 : s, Me = k ? void 0 : c, j = k ? void 0 : u, Ne = k ? void 0 : d, M = k ? void 0 : f, Pe = k ? !1 : m, Fe = k ? !1 : h, N = k ? !1 : g, P = Je(Ae), Re = Ge(Ae), ze = e.useRef(void 0);
|
|
433
|
+
ze.current === void 0 && (ze.current = at(se));
|
|
434
|
+
let F = ze.current, [Be, Ve] = e.useState(F ? F.columnWidth : null), [He, Ue] = e.useState(F ? F.taskListWidth ?? null : null), [L, st] = e.useState(n && Ye.includes(n) ? n : F?.viewMode ?? "day");
|
|
435
435
|
e.useEffect(() => {
|
|
436
436
|
n && Ye.includes(n) && st(n);
|
|
437
437
|
}, [n]);
|
|
438
438
|
let ct = e.useRef(null), lt = e.useRef(null), ut = e.useRef(!0), [R, dt] = e.useState(F ? F.taskListCollapsed : !1), ft = e.useRef(!1);
|
|
439
439
|
e.useEffect(() => {
|
|
440
|
-
!ft.current &&
|
|
441
|
-
}, [
|
|
442
|
-
let pt = Math.max(160,
|
|
440
|
+
!ft.current && je && (dt(!0), ft.current = !0);
|
|
441
|
+
}, [je]);
|
|
442
|
+
let pt = Math.max(160, Ae - 200), z = R ? 0 : He == null ? Ke(Ae) : Math.max(160, Math.min(He, pt)), mt = e.useMemo(() => {
|
|
443
443
|
if (Be != null || i || t.length === 0) return null;
|
|
444
444
|
let e = r ? new Date(r) : new Date(Math.min(...t.map((e) => e.start.getTime()))), n = new Date(Math.max(...t.map((e) => e.end.getTime())));
|
|
445
445
|
r || e.setDate(e.getDate() - 7), n.setDate(n.getDate() + 14), e = Qe(e, L), n.setHours(23, 59, 59, 999);
|
|
446
|
-
let a = Math.max(1, (n.getTime() - e.getTime()) / Ze), o = Math.max(0,
|
|
446
|
+
let a = Math.max(1, (n.getTime() - e.getTime()) / Ze), o = Math.max(0, Ae - z);
|
|
447
447
|
if (o <= 0) return null;
|
|
448
448
|
let s = o / a * Xe[L];
|
|
449
449
|
if (s <= Re) return null;
|
|
@@ -455,11 +455,11 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
455
455
|
r,
|
|
456
456
|
i,
|
|
457
457
|
L,
|
|
458
|
-
|
|
458
|
+
Ae,
|
|
459
459
|
z,
|
|
460
460
|
Re
|
|
461
461
|
]), B = Be ?? mt ?? Re, ht = B / Xe[L], gt = qe(z), [_t, vt] = e.useState(null), [yt, bt] = e.useState({}), [xt, St] = e.useState(null), V = e.useMemo(() => {
|
|
462
|
-
if (!
|
|
462
|
+
if (!re) return t;
|
|
463
463
|
let e = /* @__PURE__ */ new Set();
|
|
464
464
|
for (let n of t) {
|
|
465
465
|
let t = n.parent != null && n.parent !== "" ? String(n.parent) : null;
|
|
@@ -468,7 +468,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
468
468
|
let n = /* @__PURE__ */ new Map();
|
|
469
469
|
for (let r of t) {
|
|
470
470
|
if (e.has(String(r.id))) continue;
|
|
471
|
-
let t =
|
|
471
|
+
let t = re(r), i = t ? String(t.key) : "__ungrouped__", a = t ? t.label : ie, o = n.get(i);
|
|
472
472
|
o || (o = {
|
|
473
473
|
key: i,
|
|
474
474
|
label: a,
|
|
@@ -495,9 +495,9 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
495
495
|
}
|
|
496
496
|
return r;
|
|
497
497
|
}, [
|
|
498
|
-
|
|
498
|
+
re,
|
|
499
499
|
t,
|
|
500
|
-
|
|
500
|
+
ie
|
|
501
501
|
]), Ct = e.useMemo(() => {
|
|
502
502
|
let e = new Set(V.map((e) => String(e.id))), t = /* @__PURE__ */ new Map();
|
|
503
503
|
for (let n of V) {
|
|
@@ -525,12 +525,12 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
525
525
|
Dt.current = H;
|
|
526
526
|
}, [H]);
|
|
527
527
|
let Ot = e.useRef(!1), kt = e.useCallback((e) => {
|
|
528
|
-
let t = L === "day" &&
|
|
528
|
+
let t = L === "day" && y && y.bands.length > 0 && y ? Math.min(...y.bands.map((e) => e.durMs)) : Ze, n = (e, t) => En.current ? En.current(e, t) : et(e, t, L), r = new Date(e.originStart), i = new Date(e.originEnd);
|
|
529
529
|
return e.mode === "move" ? (r = n(e.originStart, e.unitDelta), i = new Date(e.originEnd.getTime() + (r.getTime() - e.originStart.getTime()))) : e.mode === "resize-left" ? (r = n(e.originStart, e.unitDelta), i.getTime() - r.getTime() < t && (r = new Date(i.getTime() - t))) : e.mode === "resize-right" && (i = n(e.originEnd, e.unitDelta), i.getTime() - r.getTime() < t && (i = new Date(r.getTime() + t))), {
|
|
530
530
|
start: r,
|
|
531
531
|
end: i
|
|
532
532
|
};
|
|
533
|
-
}, [L,
|
|
533
|
+
}, [L, y]), At = e.useRef(t);
|
|
534
534
|
At.current = t;
|
|
535
535
|
let jt = e.useRef([]), Mt = e.useRef([]), [Nt, Pt] = e.useState(0), Ft = e.useCallback((e) => {
|
|
536
536
|
if (!A) return;
|
|
@@ -562,12 +562,12 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
562
562
|
start: n.start,
|
|
563
563
|
end: n.end
|
|
564
564
|
} : e;
|
|
565
|
-
}),
|
|
565
|
+
}), v).filter((e) => {
|
|
566
566
|
let n = t.get(e.id);
|
|
567
567
|
return !n || e.start.getTime() !== n.start.getTime() || e.end.getTime() !== n.end.getTime();
|
|
568
568
|
});
|
|
569
569
|
n.length && Lt(n);
|
|
570
|
-
}, [N,
|
|
570
|
+
}, [N, v]), zt = e.useCallback(() => {
|
|
571
571
|
if (!It) return;
|
|
572
572
|
let e = It.map((e) => {
|
|
573
573
|
let t = At.current.find((t) => String(t.id) === e.id);
|
|
@@ -597,7 +597,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
597
597
|
}), [Nt]);
|
|
598
598
|
e.useEffect(() => {
|
|
599
599
|
if (!H) return;
|
|
600
|
-
let e = L === "day" &&
|
|
600
|
+
let e = L === "day" && y && y.bands.length > 0 && y ? ht * Math.min(...y.bands.map((e) => e.durMs)) / Ze : B, n = (t) => {
|
|
601
601
|
let n = Dt.current;
|
|
602
602
|
if (!n) return;
|
|
603
603
|
let r = Math.round((t.clientX - n.originClientX) / Math.max(e, 1));
|
|
@@ -647,7 +647,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
647
647
|
B,
|
|
648
648
|
ht,
|
|
649
649
|
L,
|
|
650
|
-
|
|
650
|
+
y,
|
|
651
651
|
t,
|
|
652
652
|
A,
|
|
653
653
|
kt,
|
|
@@ -791,7 +791,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
791
791
|
});
|
|
792
792
|
}, []), hn = e.useRef(!1);
|
|
793
793
|
e.useEffect(() => {
|
|
794
|
-
if (hn.current ||
|
|
794
|
+
if (hn.current || ae == null || V.length === 0) return;
|
|
795
795
|
hn.current = !0;
|
|
796
796
|
let e = new Map(V.map((e) => [String(e.id), e])), t = /* @__PURE__ */ new Set();
|
|
797
797
|
for (let n of V) {
|
|
@@ -805,10 +805,10 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
805
805
|
}, r = /* @__PURE__ */ new Set();
|
|
806
806
|
for (let e of V) {
|
|
807
807
|
let i = String(e.id);
|
|
808
|
-
t.has(i) && n(e) >=
|
|
808
|
+
t.has(i) && n(e) >= ae && r.add(i);
|
|
809
809
|
}
|
|
810
810
|
r.size && pn((e) => e.size ? e : r);
|
|
811
|
-
}, [
|
|
811
|
+
}, [ae, V]);
|
|
812
812
|
let G = e.useMemo(() => {
|
|
813
813
|
let e = new Set(V.map((e) => String(e.id))), t = /* @__PURE__ */ new Map(), n = [];
|
|
814
814
|
for (let r of V) {
|
|
@@ -905,7 +905,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
905
905
|
Ht
|
|
906
906
|
]), K = e.useMemo(() => {
|
|
907
907
|
let e = r ? new Date(r) : /* @__PURE__ */ new Date(), n = i ? new Date(i) : /* @__PURE__ */ new Date();
|
|
908
|
-
return !r && t.length > 0 && (e = new Date(Math.min(...t.map((e) => e.start.getTime()))), e.setDate(e.getDate() - 7)), !i && t.length > 0 && (n = new Date(Math.max(...t.map((e) => e.end.getTime()))), n.setDate(n.getDate() + 14)), e = L === "day" &&
|
|
908
|
+
return !r && t.length > 0 && (e = new Date(Math.min(...t.map((e) => e.start.getTime()))), e.setDate(e.getDate() - 7)), !i && t.length > 0 && (n = new Date(Math.max(...t.map((e) => e.end.getTime()))), n.setDate(n.getDate() + 14)), e = L === "day" && y && y.bands.length > 0 ? I(e, y.dayStartMin) : Qe(e, L), n.setHours(23, 59, 59, 999), {
|
|
909
909
|
start: e,
|
|
910
910
|
end: n
|
|
911
911
|
};
|
|
@@ -914,23 +914,23 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
914
914
|
i,
|
|
915
915
|
t,
|
|
916
916
|
L,
|
|
917
|
-
|
|
918
|
-
]), _n = L === "day" && !!
|
|
919
|
-
if (!
|
|
920
|
-
if (
|
|
917
|
+
y
|
|
918
|
+
]), _n = L === "day" && !!y && y.bands.length > 0, vn = !_n && L === "day" && !!v && (!!v.skipWeekends || !!(v.holidays && v.holidays.size)), yn = e.useCallback((e) => {
|
|
919
|
+
if (!v) return !0;
|
|
920
|
+
if (v.skipWeekends) {
|
|
921
921
|
let t = e.getDay();
|
|
922
922
|
if (t === 0 || t === 6) return !1;
|
|
923
923
|
}
|
|
924
|
-
if (
|
|
924
|
+
if (v.holidays && v.holidays.size) {
|
|
925
925
|
let t = `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
926
|
-
if (
|
|
926
|
+
if (v.holidays.has(t)) return !1;
|
|
927
927
|
}
|
|
928
928
|
return !0;
|
|
929
|
-
}, [
|
|
929
|
+
}, [v]), q = e.useMemo(() => {
|
|
930
930
|
let e = [];
|
|
931
|
-
if (_n &&
|
|
931
|
+
if (_n && y) {
|
|
932
932
|
let t = new Date(K.start);
|
|
933
|
-
for (; t <= K.end;) for (let n of
|
|
933
|
+
for (; t <= K.end;) for (let n of y.bands) {
|
|
934
934
|
let r = n.durMs / Ze * ht;
|
|
935
935
|
e.push({
|
|
936
936
|
date: new Date(t),
|
|
@@ -951,10 +951,10 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
951
951
|
continue;
|
|
952
952
|
}
|
|
953
953
|
let r = (n.getTime() - t.getTime()) / Ze * ht, i, a;
|
|
954
|
-
L === "day" ? (i = String(t.getDate()), a = t.toLocaleDateString(
|
|
954
|
+
L === "day" ? (i = String(t.getDate()), a = t.toLocaleDateString(C, { weekday: "narrow" })) : i = L === "week" ? t.toLocaleDateString(C, {
|
|
955
955
|
month: "numeric",
|
|
956
956
|
day: "numeric"
|
|
957
|
-
}) : L === "month" ? t.toLocaleDateString(
|
|
957
|
+
}) : L === "month" ? t.toLocaleDateString(C, { month: "short" }) : L === "quarter" ? `Q${Math.floor(t.getMonth() / 3) + 1}` : String(t.getFullYear()), e.push({
|
|
958
958
|
date: new Date(t),
|
|
959
959
|
label: i,
|
|
960
960
|
sublabel: a,
|
|
@@ -967,11 +967,11 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
967
967
|
K,
|
|
968
968
|
L,
|
|
969
969
|
ht,
|
|
970
|
-
|
|
970
|
+
C,
|
|
971
971
|
vn,
|
|
972
972
|
yn,
|
|
973
973
|
_n,
|
|
974
|
-
|
|
974
|
+
y
|
|
975
975
|
]), J = e.useMemo(() => {
|
|
976
976
|
let e = Array(q.length + 1), t = 0;
|
|
977
977
|
for (let n = 0; n < q.length; n++) e[n] = t, t += q[n].width;
|
|
@@ -1036,13 +1036,13 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1036
1036
|
En.current = vn || _n ? Tn : null;
|
|
1037
1037
|
let Dn = e.useMemo(() => {
|
|
1038
1038
|
let e = [];
|
|
1039
|
-
if (_n &&
|
|
1039
|
+
if (_n && y) {
|
|
1040
1040
|
let t = 0;
|
|
1041
1041
|
for (let n of q) {
|
|
1042
|
-
let r = String(
|
|
1042
|
+
let r = String(I(n.date, y.dayStartMin).getTime()), i = e[e.length - 1];
|
|
1043
1043
|
i && i.key === r ? i.width += n.width : e.push({
|
|
1044
1044
|
key: r,
|
|
1045
|
-
label: n.date.toLocaleDateString(
|
|
1045
|
+
label: n.date.toLocaleDateString(C, {
|
|
1046
1046
|
month: "short",
|
|
1047
1047
|
day: "numeric"
|
|
1048
1048
|
}),
|
|
@@ -1057,7 +1057,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1057
1057
|
let i = r.date.getFullYear(), a = Math.floor(i / 10) * 10, o = t === "decade" ? String(a) : t === "year" ? String(i) : `${i}-${r.date.getMonth()}`, s = e[e.length - 1];
|
|
1058
1058
|
s && s.key === o ? s.width += r.width : e.push({
|
|
1059
1059
|
key: o,
|
|
1060
|
-
label: t === "decade" ? `${a}s` : t === "year" ? String(i) : r.date.toLocaleDateString(
|
|
1060
|
+
label: t === "decade" ? `${a}s` : t === "year" ? String(i) : r.date.toLocaleDateString(C, {
|
|
1061
1061
|
month: "short",
|
|
1062
1062
|
year: "numeric"
|
|
1063
1063
|
}),
|
|
@@ -1069,9 +1069,9 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1069
1069
|
}, [
|
|
1070
1070
|
q,
|
|
1071
1071
|
L,
|
|
1072
|
-
|
|
1072
|
+
C,
|
|
1073
1073
|
_n,
|
|
1074
|
-
|
|
1074
|
+
y
|
|
1075
1075
|
]), On = e.useMemo(() => (a ?? []).map((e, t) => {
|
|
1076
1076
|
let n = e.date instanceof Date ? e.date : new Date(e.date);
|
|
1077
1077
|
return {
|
|
@@ -1156,7 +1156,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1156
1156
|
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
1157
1157
|
}, []);
|
|
1158
1158
|
let qn = e.useCallback(() => {
|
|
1159
|
-
let e =
|
|
1159
|
+
let e = fe.current;
|
|
1160
1160
|
e && (document.fullscreenElement ? document.exitFullscreen?.() : e.requestFullscreen?.());
|
|
1161
1161
|
}, []), Jn = e.useRef(null), Yn = e.useCallback((e) => {
|
|
1162
1162
|
if (e.touches.length === 2) {
|
|
@@ -1168,8 +1168,8 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1168
1168
|
}
|
|
1169
1169
|
}, [B]), Xn = e.useCallback((e) => {
|
|
1170
1170
|
if (e.touches.length !== 2 || !Jn.current) return;
|
|
1171
|
-
let t = e.touches[0].clientX - e.touches[1].clientX, n = e.touches[0].clientY - e.touches[1].clientY, r = Math.max(1, Math.sqrt(t * t + n * n)) / Jn.current.baseDistance;
|
|
1172
|
-
|
|
1171
|
+
let t = e.touches[0].clientX - e.touches[1].clientX, n = e.touches[0].clientY - e.touches[1].clientY, r = Math.max(1, Math.sqrt(t * t + n * n)) / Jn.current.baseDistance, i = Math.max(15, Math.min(120, Math.round(Jn.current.baseColumn * r)));
|
|
1172
|
+
Ve(i);
|
|
1173
1173
|
}, []), Zn = e.useCallback(() => {
|
|
1174
1174
|
Jn.current = null;
|
|
1175
1175
|
}, []), Q = e.useMemo(() => {
|
|
@@ -1249,7 +1249,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1249
1249
|
top: t.scrollTop
|
|
1250
1250
|
});
|
|
1251
1251
|
}, or = (e, t) => {
|
|
1252
|
-
let n = Y(e), r = _n &&
|
|
1252
|
+
let n = Y(e), r = _n && y ? ht * Math.min(...y.bands.map((e) => e.durMs)) / Ze : ht;
|
|
1253
1253
|
return {
|
|
1254
1254
|
left: n,
|
|
1255
1255
|
width: Math.max(Y(t) - n, r, 3)
|
|
@@ -1310,23 +1310,23 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1310
1310
|
});
|
|
1311
1311
|
}
|
|
1312
1312
|
}), t;
|
|
1313
|
-
}, [G]), fr = Math.round(P
|
|
1313
|
+
}, [G]), fr = Math.max(2, Math.round(P / 2) - 14), pr = P - fr * 2, mr = Math.round(pr / 2), hr = Math.max(Math.round(P * .4), 12), gr = hr * Math.SQRT2 / 2, _r = pr, vr = fr, yr = Math.max(3, Math.round(P * .13)), br = P - yr - 1, xr = "rgba(100, 116, 139, 0.35)", Sr = "rgba(100, 116, 139, 0.6)", Cr = (e) => {
|
|
1314
1314
|
let t = G[e.sourceIndex], n = G[e.targetIndex];
|
|
1315
1315
|
if (!t || !n) return null;
|
|
1316
|
-
let r = ur(t), i = ur(n), a = (e) => e.isSummary ?
|
|
1316
|
+
let r = ur(t), i = ur(n), a = (e) => e.isSummary ? vr + _r / 2 : P / 2, o = e.sourceIndex * P + a(t), s = e.targetIndex * P + a(n), c = e.type === "fs" || e.type === "ff", l = e.type === "ff" || e.type === "sf", u = t.isMilestone ? r.left + (c ? gr : -gr) : c ? r.left + r.width : r.left, d = n.isMilestone ? i.left + (l ? gr : -gr) : l ? i.left + i.width : i.left, f = u + (c ? 10 : -10), p = d + (l ? 10 : -10), m = Math.round, h = [`M ${m(u)} ${m(o)}`, `L ${m(f)} ${m(o)}`];
|
|
1317
1317
|
if (l ? f >= p : f <= p) h.push(`L ${m(f)} ${m(s)}`, `L ${m(d)} ${m(s)}`);
|
|
1318
1318
|
else {
|
|
1319
1319
|
let t = s >= o ? (e.sourceIndex + 1) * P : e.sourceIndex * P;
|
|
1320
1320
|
h.push(`L ${m(f)} ${m(t)}`, `L ${m(p)} ${m(t)}`, `L ${m(p)} ${m(s)}`, `L ${m(d)} ${m(s)}`);
|
|
1321
1321
|
}
|
|
1322
1322
|
return h.join(" ");
|
|
1323
|
-
},
|
|
1324
|
-
|
|
1323
|
+
}, wr = H?.taskId ?? xt, [Tr, Er] = e.useState(_), Dr = e.useMemo(() => Tr ? Ie(t, v) : null, [
|
|
1324
|
+
Tr,
|
|
1325
1325
|
t,
|
|
1326
|
-
|
|
1327
|
-
]),
|
|
1326
|
+
v
|
|
1327
|
+
]), Or = e.useCallback((e) => Dr?.criticalIds.has(String(e)) ?? !1, [Dr]), $ = "#dc2626", kr = e.useCallback(() => {
|
|
1328
1328
|
if (!A) return;
|
|
1329
|
-
let e = Le(t,
|
|
1329
|
+
let e = Le(t, v), n = [];
|
|
1330
1330
|
for (let r of e) {
|
|
1331
1331
|
let e = t.find((e) => String(e.id) === r.id);
|
|
1332
1332
|
e && n.push({
|
|
@@ -1341,16 +1341,16 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1341
1341
|
}, [
|
|
1342
1342
|
t,
|
|
1343
1343
|
A,
|
|
1344
|
-
|
|
1344
|
+
v,
|
|
1345
1345
|
Ft
|
|
1346
|
-
]),
|
|
1346
|
+
]), Ar = e.useCallback(() => {
|
|
1347
1347
|
if (typeof document > "u" || !t.length) return null;
|
|
1348
1348
|
let e = (e) => String(e).replace(/[&<>"]/g, (e) => ({
|
|
1349
1349
|
"&": "&",
|
|
1350
1350
|
"<": "<",
|
|
1351
1351
|
">": ">",
|
|
1352
1352
|
"\"": """
|
|
1353
|
-
})[e]), n = Math.max(z, 200), r = Math.ceil(n + bn), i = Math.ceil(36 + G.length * P), a =
|
|
1353
|
+
})[e]), n = Math.max(z, 200), r = Math.ceil(n + bn), i = Math.ceil(36 + G.length * P), a = Dr?.criticalEdges ?? null, o = [];
|
|
1354
1354
|
o.push(`<rect x="0" y="0" width="${r}" height="${i}" fill="#ffffff"/>`), o.push(`<rect x="0" y="0" width="${r}" height="36" fill="#f8fafc"/>`), o.push(`<g transform="translate(${n},0)" font-family="sans-serif" font-size="10" fill="#475569">`), Dn.forEach((t) => {
|
|
1355
1355
|
o.push(`<line x1="${t.offset.toFixed(1)}" y1="0" x2="${t.offset.toFixed(1)}" y2="36" stroke="#e2e8f0"/>`), o.push(`<text x="${(t.offset + t.width / 2).toFixed(1)}" y="12" text-anchor="middle" font-weight="600">${e(t.label)}</text>`);
|
|
1356
1356
|
}), q.forEach((t, n) => {
|
|
@@ -1362,19 +1362,19 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1362
1362
|
let a = 8 + t.depth * 14, s = Math.max(4, Math.floor((n - a) / 6.5)), c = t.task.title.length > s ? t.task.title.slice(0, s - 1) + "…" : t.task.title, l = t.isSummary ? " font-weight=\"600\"" : "";
|
|
1363
1363
|
o.push(`<text x="${a}" y="${(i + P / 2 + 4).toFixed(1)}"${l}>${e(c)}</text>`);
|
|
1364
1364
|
}), o.push("</g>"), o.push(`<g transform="translate(${n},36)" font-family="sans-serif" font-size="9">`), G.forEach((e, t) => {
|
|
1365
|
-
let n = t * P, { left: r, width: i } = or(e.start, e.end), a =
|
|
1366
|
-
if (
|
|
1365
|
+
let n = t * P, { left: r, width: i } = or(e.start, e.end), a = Or(e.task.id), s = a ? ` stroke="${$}" stroke-width="2"` : "";
|
|
1366
|
+
if (ee && e.task.baselineStart && e.task.baselineEnd) {
|
|
1367
1367
|
let t = or(e.task.baselineStart, e.task.baselineEnd);
|
|
1368
|
-
o.push(`<rect x="${t.left.toFixed(1)}" y="${(n +
|
|
1368
|
+
o.push(`<rect x="${t.left.toFixed(1)}" y="${(n + br).toFixed(1)}" width="${Math.max(2, t.width).toFixed(1)}" height="${yr}" rx="1" fill="${xr}" stroke="${Sr}"/>`);
|
|
1369
1369
|
}
|
|
1370
1370
|
if (e.isMilestone) {
|
|
1371
|
-
let t = r, i = n + P / 2, s =
|
|
1371
|
+
let t = r, i = n + P / 2, s = hr / 2, c = a ? $ : e.task.color || "#3b82f6";
|
|
1372
1372
|
o.push(`<polygon points="${t},${i - s} ${t + s},${i} ${t},${i + s} ${t - s},${i}" fill="${c}"/>`);
|
|
1373
1373
|
} else if (e.isSummary) {
|
|
1374
1374
|
let t = e.task.color || "#64748b";
|
|
1375
|
-
o.push(`<rect x="${r.toFixed(1)}" y="${(n +
|
|
1375
|
+
o.push(`<rect x="${r.toFixed(1)}" y="${(n + vr).toFixed(1)}" width="${i.toFixed(1)}" height="${_r}" rx="3" fill="${t}"${s}/>`);
|
|
1376
1376
|
let a = i * Math.min(100, Math.max(0, e.progress)) / 100;
|
|
1377
|
-
o.push(`<rect x="${r.toFixed(1)}" y="${(n +
|
|
1377
|
+
o.push(`<rect x="${r.toFixed(1)}" y="${(n + vr).toFixed(1)}" width="${a.toFixed(1)}" height="${_r}" rx="3" fill="rgba(0,0,0,0.2)"/>`);
|
|
1378
1378
|
} else {
|
|
1379
1379
|
let t = e.task.color || "#3b82f6";
|
|
1380
1380
|
o.push(`<rect x="${r.toFixed(1)}" y="${(n + fr).toFixed(1)}" width="${i.toFixed(1)}" height="${pr}" rx="3" fill="${t}"${s}/>`);
|
|
@@ -1382,7 +1382,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1382
1382
|
o.push(`<rect x="${r.toFixed(1)}" y="${(n + fr).toFixed(1)}" width="${a.toFixed(1)}" height="${pr}" rx="3" fill="rgba(0,0,0,0.18)"/>`), i >= 24 && o.push(`<text x="${(r + i / 2).toFixed(1)}" y="${(n + P / 2 + 3).toFixed(1)}" text-anchor="middle" fill="#ffffff">${Math.round(e.progress)}%</text>`);
|
|
1383
1383
|
}
|
|
1384
1384
|
}), dr.forEach((e) => {
|
|
1385
|
-
let t =
|
|
1385
|
+
let t = Cr(e);
|
|
1386
1386
|
if (!t) return;
|
|
1387
1387
|
let n = a?.has(`${String(e.sourceId)}->${String(e.targetId)}`) ?? !1, r = n ? $ : "#94a3b8";
|
|
1388
1388
|
o.push(`<path d="${t}" fill="none" stroke="${r}" stroke-width="${n ? 2 : 1.5}"/>`);
|
|
@@ -1403,10 +1403,10 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1403
1403
|
t,
|
|
1404
1404
|
G,
|
|
1405
1405
|
dr,
|
|
1406
|
-
|
|
1406
|
+
Cr,
|
|
1407
1407
|
or,
|
|
1408
|
+
Or,
|
|
1408
1409
|
Dr,
|
|
1409
|
-
Er,
|
|
1410
1410
|
q,
|
|
1411
1411
|
J,
|
|
1412
1412
|
bn,
|
|
@@ -1414,263 +1414,263 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1414
1414
|
P,
|
|
1415
1415
|
fr,
|
|
1416
1416
|
pr,
|
|
1417
|
+
vr,
|
|
1417
1418
|
_r,
|
|
1418
|
-
|
|
1419
|
-
mr,
|
|
1419
|
+
hr,
|
|
1420
1420
|
Q,
|
|
1421
1421
|
L,
|
|
1422
|
-
|
|
1423
|
-
yr,
|
|
1424
|
-
vr,
|
|
1422
|
+
ee,
|
|
1425
1423
|
br,
|
|
1424
|
+
yr,
|
|
1426
1425
|
xr,
|
|
1426
|
+
Sr,
|
|
1427
1427
|
On,
|
|
1428
1428
|
Dn
|
|
1429
|
-
]),
|
|
1430
|
-
let e =
|
|
1429
|
+
]), jr = e.useCallback(async () => {
|
|
1430
|
+
let e = Ar();
|
|
1431
1431
|
if (!e) return;
|
|
1432
1432
|
let t = await tt(e.svg, e.W, e.H);
|
|
1433
1433
|
t && t.toBlob((e) => {
|
|
1434
1434
|
e && nt(e, `gantt-${L}.png`);
|
|
1435
1435
|
}, "image/png");
|
|
1436
|
-
}, [
|
|
1437
|
-
let e =
|
|
1436
|
+
}, [Ar, L]), Mr = e.useCallback(async () => {
|
|
1437
|
+
let e = Ar();
|
|
1438
1438
|
if (!e) return;
|
|
1439
1439
|
let t = await tt(e.svg, e.W, e.H);
|
|
1440
1440
|
t && nt(rt(it(t.toDataURL("image/jpeg", .92)), t.width, t.height), `gantt-${L}.pdf`);
|
|
1441
|
-
}, [
|
|
1441
|
+
}, [Ar, L]), [Nr, Pr] = e.useState(!1), Fr = e.useCallback(() => {
|
|
1442
1442
|
let e = {
|
|
1443
1443
|
viewMode: L,
|
|
1444
1444
|
columnWidth: Be,
|
|
1445
1445
|
taskListCollapsed: R,
|
|
1446
1446
|
taskListWidth: He
|
|
1447
1447
|
};
|
|
1448
|
-
|
|
1448
|
+
se && ot(se, e), ce?.(e), Pr(!0);
|
|
1449
1449
|
}, [
|
|
1450
1450
|
L,
|
|
1451
1451
|
Be,
|
|
1452
1452
|
R,
|
|
1453
1453
|
He,
|
|
1454
|
-
|
|
1455
|
-
|
|
1454
|
+
se,
|
|
1455
|
+
ce
|
|
1456
1456
|
]);
|
|
1457
1457
|
return e.useEffect(() => {
|
|
1458
|
-
if (!
|
|
1459
|
-
let e = setTimeout(() =>
|
|
1458
|
+
if (!Nr) return;
|
|
1459
|
+
let e = setTimeout(() => Pr(!1), 1500);
|
|
1460
1460
|
return () => clearTimeout(e);
|
|
1461
|
-
}, [
|
|
1462
|
-
ref:
|
|
1463
|
-
className:
|
|
1461
|
+
}, [Nr]), /* @__PURE__ */ O("div", {
|
|
1462
|
+
ref: fe,
|
|
1463
|
+
className: x("flex flex-col h-full bg-background overflow-hidden min-w-0", p),
|
|
1464
1464
|
"data-readonly": k ? "true" : void 0,
|
|
1465
|
-
"data-mobile-readonly":
|
|
1465
|
+
"data-mobile-readonly": ne && je ? "true" : void 0,
|
|
1466
1466
|
children: [
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ D("style", { children: "\n .gantt-resize-handle:hover { background-color: rgba(255, 255, 255, 0.4); }\n .gantt-bar-hover:hover { filter: brightness(1.1); }\n .gantt-locate-btn { opacity: 0; transition: opacity 0.15s ease; }\n .group\\/task-row:hover .gantt-locate-btn { opacity: 0.6; }\n .gantt-locate-btn:hover, .gantt-locate-btn:focus-visible { opacity: 1; }\n /* 定位闪烁: blink the located bar 3× with a thick ring + colored glow so\n it's hard to miss. The ring is an outline (not box-shadow) and the glow\n is a drop-shadow *filter* — both stay clear of the critical-path bar's\n inline box-shadow, which they'd otherwise clobber. */\n @keyframes gantt-flash {\n 0%, 25%, 50%, 100% {\n outline-color: rgba(37, 99, 235, 0);\n filter: drop-shadow(0 0 0 rgba(37, 99, 235, 0));\n }\n 12%, 37%, 62% {\n outline-color: rgba(37, 99, 235, 1);\n filter: drop-shadow(0 0 9px rgba(37, 99, 235, 0.9));\n }\n }\n .gantt-flash {\n outline: 3px solid transparent;\n outline-offset: 3px;\n border-radius: 2px;\n animation: gantt-flash 1.5s ease-in-out;\n }\n @media (min-width: 640px) {\n .gantt-sm-h50 { height: 50px; }\n .gantt-sm-w20 { width: 80px; }\n .gantt-sm-hidden { display: none; }\n }\n /* Persistent, grabbable timeline scrollbars. macOS (and iOS) default to\n overlay scrollbars that collapse to 0px and auto-hide, so the\n timeline's vertical scrollbar was nearly impossible to find. Defining\n ::-webkit-scrollbar opts this pane into a classic, always-visible bar\n regardless of the OS overlay preference. The thumb gets a min size so\n that with thousands of virtualized rows (scrollHeight in the hundreds\n of thousands of px) it never shrinks to an un-grabbable sliver. Scoped\n to the gantt pane so the host app's own scrollbars are untouched, and\n themed with neutral rgba (not theme utilities, which don't always\n reach a consuming app) so it's visible on any background. */\n /* Firefox (and any engine without ::-webkit-scrollbar) only: the\n standard props. We must NOT set these unconditionally — modern Chrome\n now honors scrollbar-width and, when it's present, IGNORES the\n ::-webkit-scrollbar rule below, falling back to the 0px auto-hiding\n overlay bar we're trying to replace. */\n @supports not selector(::-webkit-scrollbar) {\n [data-testid=\"gantt-timeline\"] {\n scrollbar-width: thin;\n scrollbar-color: rgba(130,130,130,0.55) transparent;\n }\n }\n [data-testid=\"gantt-timeline\"]::-webkit-scrollbar {\n width: 14px;\n height: 14px;\n }\n [data-testid=\"gantt-timeline\"]::-webkit-scrollbar-track {\n background: transparent;\n }\n [data-testid=\"gantt-timeline\"]::-webkit-scrollbar-thumb {\n background-color: rgba(130,130,130,0.55);\n border-radius: 8px;\n border: 3px solid transparent;\n background-clip: padding-box;\n min-height: 40px;\n min-width: 40px;\n }\n [data-testid=\"gantt-timeline\"]::-webkit-scrollbar-thumb:hover {\n background-color: rgba(110,110,110,0.85);\n }\n [data-testid=\"gantt-timeline\"]::-webkit-scrollbar-corner {\n background: transparent;\n }\n /* The task-list pane scrolls in lockstep with the timeline, so its own\n vertical scrollbar (butted against the divider) was a confusing second\n bar. Hide it — the pane stays wheel/drag-scrollable and synced. */\n .gantt-task-list::-webkit-scrollbar { width: 0; height: 0; }\n .gantt-task-list { scrollbar-width: none; }\n " }),
|
|
1468
|
+
/* @__PURE__ */ O("div", {
|
|
1469
1469
|
className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card",
|
|
1470
|
-
children: [/* @__PURE__ */
|
|
1470
|
+
children: [/* @__PURE__ */ O("div", {
|
|
1471
1471
|
className: "flex items-center gap-2",
|
|
1472
1472
|
children: [
|
|
1473
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ D(b, {
|
|
1474
1474
|
variant: "ghost",
|
|
1475
1475
|
size: "icon",
|
|
1476
1476
|
className: "h-8 w-8",
|
|
1477
|
-
"aria-label":
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1477
|
+
"aria-label": S("gantt.toolbar.prevPeriod"),
|
|
1478
|
+
children: /* @__PURE__ */ D(he, { className: "h-4 w-4" })
|
|
1479
1479
|
}),
|
|
1480
|
-
/* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ D(b, {
|
|
1481
1481
|
variant: "ghost",
|
|
1482
1482
|
size: "icon",
|
|
1483
1483
|
className: "h-8 w-8",
|
|
1484
|
-
"aria-label":
|
|
1485
|
-
children: /* @__PURE__ */
|
|
1484
|
+
"aria-label": S("gantt.toolbar.nextPeriod"),
|
|
1485
|
+
children: /* @__PURE__ */ D(w, { className: "h-4 w-4" })
|
|
1486
1486
|
}),
|
|
1487
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ D("span", {
|
|
1488
1488
|
className: "font-semibold text-xs sm:text-sm",
|
|
1489
|
-
children: K.start.toLocaleDateString(
|
|
1489
|
+
children: K.start.toLocaleDateString(C, {
|
|
1490
1490
|
month: "long",
|
|
1491
1491
|
year: "numeric"
|
|
1492
1492
|
})
|
|
1493
1493
|
}),
|
|
1494
|
-
k && /* @__PURE__ */
|
|
1494
|
+
k && /* @__PURE__ */ O("span", {
|
|
1495
1495
|
className: "inline-flex items-center gap-1 rounded-full border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",
|
|
1496
1496
|
"data-testid": "gantt-readonly-badge",
|
|
1497
|
-
title:
|
|
1498
|
-
children: [/* @__PURE__ */
|
|
1497
|
+
title: S("gantt.readOnlyHint"),
|
|
1498
|
+
children: [/* @__PURE__ */ D(T, { className: "h-3 w-3" }), S("gantt.readOnly")]
|
|
1499
1499
|
})
|
|
1500
1500
|
]
|
|
1501
|
-
}), /* @__PURE__ */
|
|
1501
|
+
}), /* @__PURE__ */ O("div", {
|
|
1502
1502
|
className: "flex items-center gap-2",
|
|
1503
1503
|
children: [
|
|
1504
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ D("div", {
|
|
1505
1505
|
className: "flex bg-muted rounded-md p-1",
|
|
1506
1506
|
role: "group",
|
|
1507
|
-
"aria-label":
|
|
1508
|
-
children: Ye.map((e) => /* @__PURE__ */
|
|
1507
|
+
"aria-label": S("gantt.toolbar.viewMode"),
|
|
1508
|
+
children: Ye.map((e) => /* @__PURE__ */ D(b, {
|
|
1509
1509
|
variant: "ghost",
|
|
1510
1510
|
size: "sm",
|
|
1511
|
-
className:
|
|
1511
|
+
className: x("h-6 px-1.5 sm:px-2 text-xs", L === e && "bg-background shadow-sm hover:bg-background"),
|
|
1512
1512
|
onClick: () => wn(e),
|
|
1513
1513
|
"aria-pressed": L === e,
|
|
1514
1514
|
"data-testid": `gantt-view-mode-${e}`,
|
|
1515
|
-
children:
|
|
1515
|
+
children: S(`gantt.viewMode.${e}`)
|
|
1516
1516
|
}, e))
|
|
1517
1517
|
}),
|
|
1518
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ O("div", {
|
|
1519
1519
|
className: "flex bg-muted rounded-md p-1",
|
|
1520
|
-
children: [/* @__PURE__ */
|
|
1520
|
+
children: [/* @__PURE__ */ D(b, {
|
|
1521
1521
|
variant: "ghost",
|
|
1522
1522
|
size: "icon",
|
|
1523
1523
|
className: "h-6 w-6",
|
|
1524
1524
|
onClick: () => {
|
|
1525
|
-
if (B > 15)
|
|
1525
|
+
if (B > 15) Ve(Math.max(15, B - 10));
|
|
1526
1526
|
else {
|
|
1527
1527
|
let e = Ye.indexOf(L);
|
|
1528
|
-
e < Ye.length - 1 && (wn(Ye[e + 1]),
|
|
1528
|
+
e < Ye.length - 1 && (wn(Ye[e + 1]), Ve(Re));
|
|
1529
1529
|
}
|
|
1530
1530
|
},
|
|
1531
|
-
"aria-label":
|
|
1532
|
-
children: /* @__PURE__ */
|
|
1533
|
-
}), /* @__PURE__ */
|
|
1531
|
+
"aria-label": S("gantt.toolbar.zoomOut"),
|
|
1532
|
+
children: /* @__PURE__ */ D(De, { className: "h-3 w-3" })
|
|
1533
|
+
}), /* @__PURE__ */ D(b, {
|
|
1534
1534
|
variant: "ghost",
|
|
1535
1535
|
size: "icon",
|
|
1536
1536
|
className: "h-6 w-6",
|
|
1537
1537
|
onClick: () => {
|
|
1538
|
-
if (B < 120)
|
|
1538
|
+
if (B < 120) Ve(Math.min(120, B + 10));
|
|
1539
1539
|
else {
|
|
1540
1540
|
let e = Ye.indexOf(L);
|
|
1541
|
-
e > 0 && (wn(Ye[e - 1]),
|
|
1541
|
+
e > 0 && (wn(Ye[e - 1]), Ve(Re));
|
|
1542
1542
|
}
|
|
1543
1543
|
},
|
|
1544
|
-
"aria-label":
|
|
1545
|
-
children: /* @__PURE__ */
|
|
1544
|
+
"aria-label": S("gantt.toolbar.zoomIn"),
|
|
1545
|
+
children: /* @__PURE__ */ D(Ee, { className: "h-3 w-3" })
|
|
1546
1546
|
})]
|
|
1547
1547
|
}),
|
|
1548
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ D(b, {
|
|
1549
1549
|
variant: "ghost",
|
|
1550
1550
|
size: "icon",
|
|
1551
1551
|
className: "h-8 w-8",
|
|
1552
1552
|
onClick: () => dt((e) => !e),
|
|
1553
|
-
"aria-label":
|
|
1553
|
+
"aria-label": S(R ? "gantt.toolbar.showTaskList" : "gantt.toolbar.hideTaskList"),
|
|
1554
1554
|
"aria-pressed": R,
|
|
1555
1555
|
"data-testid": "gantt-toggle-task-list",
|
|
1556
|
-
children:
|
|
1556
|
+
children: D(R ? be : xe, { className: "h-4 w-4" })
|
|
1557
1557
|
}),
|
|
1558
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ D(b, {
|
|
1559
1559
|
variant: "ghost",
|
|
1560
1560
|
size: "sm",
|
|
1561
1561
|
className: "h-8 px-2 text-xs",
|
|
1562
1562
|
onClick: Qn,
|
|
1563
1563
|
disabled: Q == null,
|
|
1564
|
-
"aria-label":
|
|
1564
|
+
"aria-label": S("gantt.toolbar.jumpToToday"),
|
|
1565
1565
|
"data-testid": "gantt-jump-today",
|
|
1566
|
-
children:
|
|
1566
|
+
children: S("gantt.toolbar.today")
|
|
1567
1567
|
}),
|
|
1568
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ D(b, {
|
|
1569
1569
|
variant: "ghost",
|
|
1570
1570
|
size: "sm",
|
|
1571
1571
|
className: "h-8 px-2 text-xs",
|
|
1572
1572
|
onClick: nr,
|
|
1573
|
-
"aria-label":
|
|
1573
|
+
"aria-label": S("gantt.toolbar.thisWeek"),
|
|
1574
1574
|
"data-testid": "gantt-jump-week",
|
|
1575
|
-
children:
|
|
1575
|
+
children: S("gantt.toolbar.thisWeek")
|
|
1576
1576
|
}),
|
|
1577
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ D(b, {
|
|
1578
1578
|
variant: "ghost",
|
|
1579
1579
|
size: "sm",
|
|
1580
1580
|
className: "h-8 px-2 text-xs",
|
|
1581
1581
|
onClick: rr,
|
|
1582
|
-
"aria-label":
|
|
1582
|
+
"aria-label": S("gantt.toolbar.thisMonth"),
|
|
1583
1583
|
"data-testid": "gantt-jump-month",
|
|
1584
|
-
children:
|
|
1584
|
+
children: S("gantt.toolbar.thisMonth")
|
|
1585
1585
|
}),
|
|
1586
|
-
A ? /* @__PURE__ */
|
|
1586
|
+
A ? /* @__PURE__ */ O(Oe, { children: [/* @__PURE__ */ D(b, {
|
|
1587
1587
|
variant: "ghost",
|
|
1588
1588
|
size: "icon",
|
|
1589
1589
|
className: "h-8 w-8",
|
|
1590
1590
|
onClick: Vt,
|
|
1591
1591
|
disabled: !Ut,
|
|
1592
|
-
"aria-label":
|
|
1592
|
+
"aria-label": S("gantt.toolbar.undo"),
|
|
1593
1593
|
"data-testid": "gantt-undo",
|
|
1594
|
-
children: /* @__PURE__ */
|
|
1595
|
-
}), /* @__PURE__ */
|
|
1594
|
+
children: /* @__PURE__ */ D(we, { className: "h-4 w-4" })
|
|
1595
|
+
}), /* @__PURE__ */ D(b, {
|
|
1596
1596
|
variant: "ghost",
|
|
1597
1597
|
size: "icon",
|
|
1598
1598
|
className: "h-8 w-8",
|
|
1599
1599
|
onClick: Ht,
|
|
1600
1600
|
disabled: !Wt,
|
|
1601
|
-
"aria-label":
|
|
1601
|
+
"aria-label": S("gantt.toolbar.redo"),
|
|
1602
1602
|
"data-testid": "gantt-redo",
|
|
1603
|
-
children: /* @__PURE__ */
|
|
1603
|
+
children: /* @__PURE__ */ D(Se, { className: "h-4 w-4" })
|
|
1604
1604
|
})] }) : null,
|
|
1605
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ D(b, {
|
|
1606
1606
|
variant: "ghost",
|
|
1607
1607
|
size: "icon",
|
|
1608
1608
|
className: "h-8 w-8",
|
|
1609
|
-
onClick: () =>
|
|
1610
|
-
"aria-label":
|
|
1611
|
-
"aria-pressed":
|
|
1609
|
+
onClick: () => Er((e) => !e),
|
|
1610
|
+
"aria-label": S("gantt.toolbar.criticalPath"),
|
|
1611
|
+
"aria-pressed": Tr,
|
|
1612
1612
|
"data-testid": "gantt-critical-path",
|
|
1613
|
-
style:
|
|
1614
|
-
children: /* @__PURE__ */
|
|
1613
|
+
style: Tr ? { color: $ } : void 0,
|
|
1614
|
+
children: /* @__PURE__ */ D(pe, { className: "h-4 w-4" })
|
|
1615
1615
|
}),
|
|
1616
|
-
Fe && A ? /* @__PURE__ */
|
|
1616
|
+
Fe && A ? /* @__PURE__ */ D(b, {
|
|
1617
1617
|
variant: "ghost",
|
|
1618
1618
|
size: "icon",
|
|
1619
1619
|
className: "h-8 w-8",
|
|
1620
|
-
onClick:
|
|
1621
|
-
"aria-label":
|
|
1620
|
+
onClick: kr,
|
|
1621
|
+
"aria-label": S("gantt.toolbar.autoSchedule"),
|
|
1622
1622
|
"data-testid": "gantt-auto-schedule",
|
|
1623
|
-
children: /* @__PURE__ */
|
|
1623
|
+
children: /* @__PURE__ */ D(Te, { className: "h-4 w-4" })
|
|
1624
1624
|
}) : null,
|
|
1625
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ D(b, {
|
|
1626
1626
|
variant: "ghost",
|
|
1627
1627
|
size: "icon",
|
|
1628
1628
|
className: "h-8 w-8",
|
|
1629
|
-
onClick:
|
|
1630
|
-
"aria-label":
|
|
1629
|
+
onClick: jr,
|
|
1630
|
+
"aria-label": S("gantt.toolbar.exportPng"),
|
|
1631
1631
|
"data-testid": "gantt-export-png",
|
|
1632
|
-
children: /* @__PURE__ */
|
|
1632
|
+
children: /* @__PURE__ */ D(_e, { className: "h-4 w-4" })
|
|
1633
1633
|
}),
|
|
1634
|
-
/* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ D(b, {
|
|
1635
1635
|
variant: "ghost",
|
|
1636
1636
|
size: "icon",
|
|
1637
1637
|
className: "h-8 w-8",
|
|
1638
|
-
onClick:
|
|
1639
|
-
"aria-label":
|
|
1638
|
+
onClick: Mr,
|
|
1639
|
+
"aria-label": S("gantt.toolbar.exportPdf"),
|
|
1640
1640
|
"data-testid": "gantt-export-pdf",
|
|
1641
|
-
children: /* @__PURE__ */
|
|
1641
|
+
children: /* @__PURE__ */ D(ve, { className: "h-4 w-4" })
|
|
1642
1642
|
}),
|
|
1643
|
-
|
|
1643
|
+
ce || se ? /* @__PURE__ */ D(b, {
|
|
1644
1644
|
variant: "ghost",
|
|
1645
1645
|
size: "icon",
|
|
1646
1646
|
className: "h-8 w-8",
|
|
1647
|
-
onClick:
|
|
1648
|
-
"aria-label":
|
|
1649
|
-
"aria-pressed":
|
|
1647
|
+
onClick: Fr,
|
|
1648
|
+
"aria-label": S("gantt.toolbar.saveLayout"),
|
|
1649
|
+
"aria-pressed": Nr,
|
|
1650
1650
|
"data-testid": "gantt-save-layout",
|
|
1651
|
-
style:
|
|
1652
|
-
children: /* @__PURE__ */
|
|
1651
|
+
style: Nr ? { color: $ } : void 0,
|
|
1652
|
+
children: /* @__PURE__ */ D(Ce, { className: "h-4 w-4" })
|
|
1653
1653
|
}) : null,
|
|
1654
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ D(b, {
|
|
1655
1655
|
variant: "ghost",
|
|
1656
1656
|
size: "icon",
|
|
1657
1657
|
className: "h-8 w-8",
|
|
1658
1658
|
onClick: qn,
|
|
1659
|
-
"aria-label":
|
|
1659
|
+
"aria-label": S(Gn ? "gantt.toolbar.exitFullscreen" : "gantt.toolbar.enterFullscreen"),
|
|
1660
1660
|
"aria-pressed": Gn,
|
|
1661
1661
|
"data-testid": "gantt-fullscreen",
|
|
1662
|
-
children:
|
|
1662
|
+
children: D(Gn ? ye : E, { className: "h-4 w-4" })
|
|
1663
1663
|
})
|
|
1664
1664
|
]
|
|
1665
1665
|
})]
|
|
1666
1666
|
}),
|
|
1667
|
-
/* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ O("div", {
|
|
1668
1668
|
className: "relative flex flex-col flex-1 overflow-hidden outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1669
1669
|
tabIndex: 0,
|
|
1670
1670
|
onKeyDown: gn,
|
|
1671
1671
|
"data-testid": "gantt-body",
|
|
1672
1672
|
children: [
|
|
1673
|
-
!R && z > 0 && /* @__PURE__ */
|
|
1673
|
+
!R && z > 0 && /* @__PURE__ */ D("div", {
|
|
1674
1674
|
className: "absolute top-0 bottom-0 z-30 group/splitter",
|
|
1675
1675
|
style: {
|
|
1676
1676
|
left: z - 3,
|
|
@@ -1683,71 +1683,72 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1683
1683
|
onPointerDown: (e) => {
|
|
1684
1684
|
if (e.button !== 0) return;
|
|
1685
1685
|
e.preventDefault();
|
|
1686
|
-
let t = e.clientX, n = z, r = Math.max(160,
|
|
1687
|
-
|
|
1686
|
+
let t = e.clientX, n = z, r = Math.max(160, Ae - 200), i = (e) => {
|
|
1687
|
+
let i = Math.max(160, Math.min(n + (e.clientX - t), r));
|
|
1688
|
+
Ue(i);
|
|
1688
1689
|
}, a = () => {
|
|
1689
1690
|
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointercancel", a), document.body.style.cursor = "";
|
|
1690
1691
|
};
|
|
1691
1692
|
document.body.style.cursor = "col-resize", window.addEventListener("pointermove", i), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a);
|
|
1692
1693
|
},
|
|
1693
1694
|
onDoubleClick: () => Ue(null),
|
|
1694
|
-
children: /* @__PURE__ */
|
|
1695
|
+
children: /* @__PURE__ */ D("div", { className: "absolute inset-y-0 left-1/2 -translate-x-1/2 w-px bg-border group-hover/splitter:w-[3px] group-hover/splitter:bg-primary transition-all" })
|
|
1695
1696
|
}),
|
|
1696
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ O("div", {
|
|
1697
1698
|
className: "flex border-b bg-muted/30 shrink-0 h-10 gantt-sm-h50",
|
|
1698
|
-
children: [/* @__PURE__ */
|
|
1699
|
+
children: [/* @__PURE__ */ O("div", {
|
|
1699
1700
|
className: "flex items-center font-medium text-xs text-muted-foreground px-2 sm:px-4 border-r bg-card z-20 shadow-sm",
|
|
1700
1701
|
style: {
|
|
1701
1702
|
width: z,
|
|
1702
1703
|
minWidth: z
|
|
1703
1704
|
},
|
|
1704
|
-
children: [/* @__PURE__ */
|
|
1705
|
+
children: [/* @__PURE__ */ D("div", {
|
|
1705
1706
|
className: "flex-1 truncate",
|
|
1706
|
-
children:
|
|
1707
|
-
}), gt && /* @__PURE__ */
|
|
1707
|
+
children: S("gantt.column.taskName")
|
|
1708
|
+
}), gt && /* @__PURE__ */ O(Oe, { children: [/* @__PURE__ */ D("div", {
|
|
1708
1709
|
className: "w-16 gantt-sm-w20 text-right",
|
|
1709
|
-
children:
|
|
1710
|
-
}), /* @__PURE__ */
|
|
1710
|
+
children: S("gantt.column.start")
|
|
1711
|
+
}), /* @__PURE__ */ D("div", {
|
|
1711
1712
|
className: "w-16 gantt-sm-w20 text-right",
|
|
1712
|
-
children:
|
|
1713
|
+
children: S("gantt.column.end")
|
|
1713
1714
|
})] })]
|
|
1714
|
-
}), /* @__PURE__ */
|
|
1715
|
+
}), /* @__PURE__ */ D("div", {
|
|
1715
1716
|
className: "flex-1 overflow-hidden",
|
|
1716
1717
|
ref: kn,
|
|
1717
|
-
children: /* @__PURE__ */
|
|
1718
|
+
children: /* @__PURE__ */ O("div", {
|
|
1718
1719
|
className: "flex flex-col h-full",
|
|
1719
1720
|
style: { width: bn },
|
|
1720
|
-
children: [/* @__PURE__ */
|
|
1721
|
+
children: [/* @__PURE__ */ D("div", {
|
|
1721
1722
|
className: "relative border-b",
|
|
1722
1723
|
style: { height: "45%" },
|
|
1723
1724
|
"data-testid": "gantt-header-groups",
|
|
1724
|
-
children: Dn.slice(Un.start, Un.end).map((e) => /* @__PURE__ */
|
|
1725
|
+
children: Dn.slice(Un.start, Un.end).map((e) => /* @__PURE__ */ D("div", {
|
|
1725
1726
|
className: "absolute top-0 bottom-0 flex items-center justify-center border-r text-[10px] font-medium text-muted-foreground overflow-hidden",
|
|
1726
1727
|
style: {
|
|
1727
1728
|
left: e.offset,
|
|
1728
1729
|
width: e.width
|
|
1729
1730
|
},
|
|
1730
|
-
children: /* @__PURE__ */
|
|
1731
|
+
children: /* @__PURE__ */ D("span", {
|
|
1731
1732
|
className: "truncate px-1",
|
|
1732
1733
|
children: e.label
|
|
1733
1734
|
})
|
|
1734
1735
|
}, e.key))
|
|
1735
|
-
}), /* @__PURE__ */
|
|
1736
|
+
}), /* @__PURE__ */ D("div", {
|
|
1736
1737
|
className: "relative flex-1",
|
|
1737
1738
|
"data-testid": "gantt-header-units",
|
|
1738
1739
|
children: q.slice(Vn.start, Vn.end).map((e, t) => {
|
|
1739
1740
|
let n = Vn.start + t;
|
|
1740
|
-
return /* @__PURE__ */
|
|
1741
|
-
className:
|
|
1741
|
+
return /* @__PURE__ */ O("div", {
|
|
1742
|
+
className: x("absolute top-0 bottom-0 flex items-center justify-center gap-1 border-r text-xs text-muted-foreground overflow-hidden", e.isWeekend && "bg-muted/50"),
|
|
1742
1743
|
style: {
|
|
1743
1744
|
left: J[n],
|
|
1744
1745
|
width: e.width,
|
|
1745
1746
|
backgroundColor: e.bandColor ? `color-mix(in srgb, ${e.bandColor} 16%, transparent)` : void 0
|
|
1746
1747
|
},
|
|
1747
|
-
children: [/* @__PURE__ */
|
|
1748
|
+
children: [/* @__PURE__ */ D("span", {
|
|
1748
1749
|
className: "font-medium text-foreground truncate",
|
|
1749
1750
|
children: e.label
|
|
1750
|
-
}), e.sublabel && B >= 32 && /* @__PURE__ */
|
|
1751
|
+
}), e.sublabel && B >= 32 && /* @__PURE__ */ D("span", {
|
|
1751
1752
|
className: "text-[10px] opacity-70",
|
|
1752
1753
|
children: e.sublabel
|
|
1753
1754
|
})]
|
|
@@ -1757,9 +1758,9 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1757
1758
|
})
|
|
1758
1759
|
})]
|
|
1759
1760
|
}),
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
+
/* @__PURE__ */ O("div", {
|
|
1761
1762
|
className: "flex flex-1 overflow-hidden",
|
|
1762
|
-
children: [/* @__PURE__ */
|
|
1763
|
+
children: [/* @__PURE__ */ O("div", {
|
|
1763
1764
|
className: "gantt-task-list overflow-y-auto overflow-x-hidden border-r bg-card z-10 shadow-sm",
|
|
1764
1765
|
ref: An,
|
|
1765
1766
|
onScroll: ar,
|
|
@@ -1768,16 +1769,16 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1768
1769
|
minWidth: z
|
|
1769
1770
|
},
|
|
1770
1771
|
role: "tree",
|
|
1771
|
-
"aria-label":
|
|
1772
|
+
"aria-label": S("gantt.aria.taskList"),
|
|
1772
1773
|
children: [
|
|
1773
|
-
Z.startIdx > 0 && /* @__PURE__ */
|
|
1774
|
+
Z.startIdx > 0 && /* @__PURE__ */ D("div", {
|
|
1774
1775
|
style: { height: Z.startIdx * P },
|
|
1775
1776
|
"aria-hidden": "true"
|
|
1776
1777
|
}),
|
|
1777
1778
|
G.slice(Z.startIdx, Z.endIdx).map((e) => {
|
|
1778
1779
|
let t = e.task, n = Pe && _t === t.id, r = fn.has(String(t.id)), i = sn != null && String(sn) === String(t.id);
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
className:
|
|
1780
|
+
return /* @__PURE__ */ O("div", {
|
|
1781
|
+
className: x("group/task-row relative flex items-center border-b px-2 sm:px-4 hover:bg-accent/50 cursor-pointer transition-colors", i && "bg-accent/50"),
|
|
1781
1782
|
style: {
|
|
1782
1783
|
height: P,
|
|
1783
1784
|
touchAction: "manipulation"
|
|
@@ -1813,11 +1814,11 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1813
1814
|
}));
|
|
1814
1815
|
},
|
|
1815
1816
|
children: [
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ O("div", {
|
|
1817
1818
|
className: "flex-1 truncate font-medium text-xs sm:text-sm flex items-center gap-2",
|
|
1818
1819
|
style: e.depth > 0 ? { paddingLeft: e.depth * 14 } : void 0,
|
|
1819
1820
|
children: [
|
|
1820
|
-
e.hasChildren ? /* @__PURE__ */
|
|
1821
|
+
e.hasChildren ? /* @__PURE__ */ D("button", {
|
|
1821
1822
|
type: "button",
|
|
1822
1823
|
className: "h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground",
|
|
1823
1824
|
style: { marginLeft: -4 },
|
|
@@ -1825,19 +1826,19 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1825
1826
|
e.stopPropagation(), mn(t.id);
|
|
1826
1827
|
},
|
|
1827
1828
|
"aria-expanded": !r,
|
|
1828
|
-
"aria-label":
|
|
1829
|
+
"aria-label": S(r ? "gantt.row.expand" : "gantt.row.collapse"),
|
|
1829
1830
|
"data-testid": `gantt-row-toggle-${t.id}`,
|
|
1830
|
-
children:
|
|
1831
|
-
}) : /* @__PURE__ */
|
|
1831
|
+
children: D(r ? w : me, { className: "h-3.5 w-3.5" })
|
|
1832
|
+
}) : /* @__PURE__ */ D("span", {
|
|
1832
1833
|
className: "w-3 shrink-0",
|
|
1833
1834
|
style: { marginLeft: -4 },
|
|
1834
1835
|
"aria-hidden": "true"
|
|
1835
1836
|
}),
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
+
/* @__PURE__ */ D("div", {
|
|
1837
1838
|
className: "w-2 h-2 rounded-full shrink-0",
|
|
1838
1839
|
style: { backgroundColor: t.color || "#3b82f6" }
|
|
1839
1840
|
}),
|
|
1840
|
-
n ? /* @__PURE__ */
|
|
1841
|
+
n ? /* @__PURE__ */ D("input", {
|
|
1841
1842
|
className: "border rounded px-1 py-0.5 text-xs w-full bg-background",
|
|
1842
1843
|
value: yt.title || "",
|
|
1843
1844
|
onChange: (e) => bt((t) => ({
|
|
@@ -1857,20 +1858,20 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1857
1858
|
},
|
|
1858
1859
|
onClick: (e) => e.stopPropagation(),
|
|
1859
1860
|
autoFocus: !0
|
|
1860
|
-
}) : /* @__PURE__ */
|
|
1861
|
+
}) : /* @__PURE__ */ O("span", {
|
|
1861
1862
|
className: "flex flex-col min-w-0",
|
|
1862
|
-
children: [/* @__PURE__ */
|
|
1863
|
-
className:
|
|
1863
|
+
children: [/* @__PURE__ */ D("span", {
|
|
1864
|
+
className: x("truncate", e.isSummary && "font-semibold"),
|
|
1864
1865
|
children: t.title
|
|
1865
|
-
}), /* @__PURE__ */
|
|
1866
|
+
}), /* @__PURE__ */ O("span", {
|
|
1866
1867
|
className: "text-[10px] text-muted-foreground gantt-sm-hidden",
|
|
1867
1868
|
children: [
|
|
1868
|
-
e.start.toLocaleDateString(
|
|
1869
|
+
e.start.toLocaleDateString(C, {
|
|
1869
1870
|
month: "numeric",
|
|
1870
1871
|
day: "numeric"
|
|
1871
1872
|
}),
|
|
1872
1873
|
" → ",
|
|
1873
|
-
e.end.toLocaleDateString(
|
|
1874
|
+
e.end.toLocaleDateString(C, {
|
|
1874
1875
|
month: "numeric",
|
|
1875
1876
|
day: "numeric"
|
|
1876
1877
|
})
|
|
@@ -1879,11 +1880,11 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1879
1880
|
})
|
|
1880
1881
|
]
|
|
1881
1882
|
}),
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ D("div", {
|
|
1883
1884
|
className: "w-16 gantt-sm-w20 text-right text-xs text-muted-foreground hidden sm:block",
|
|
1884
1885
|
hidden: !gt,
|
|
1885
1886
|
style: gt ? void 0 : { display: "none" },
|
|
1886
|
-
children: n ? /* @__PURE__ */
|
|
1887
|
+
children: n ? /* @__PURE__ */ D("input", {
|
|
1887
1888
|
type: "date",
|
|
1888
1889
|
className: "border rounded px-1 py-0.5 text-xs w-full bg-background",
|
|
1889
1890
|
value: yt.start || "",
|
|
@@ -1892,16 +1893,16 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1892
1893
|
start: e.target.value
|
|
1893
1894
|
})),
|
|
1894
1895
|
onClick: (e) => e.stopPropagation()
|
|
1895
|
-
}) : e.start.toLocaleDateString(
|
|
1896
|
+
}) : e.start.toLocaleDateString(C, {
|
|
1896
1897
|
month: "numeric",
|
|
1897
1898
|
day: "numeric"
|
|
1898
1899
|
})
|
|
1899
1900
|
}),
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ D("div", {
|
|
1901
1902
|
className: "w-16 gantt-sm-w20 text-right text-xs text-muted-foreground hidden sm:block",
|
|
1902
1903
|
hidden: !gt,
|
|
1903
1904
|
style: gt ? void 0 : { display: "none" },
|
|
1904
|
-
children: n ? /* @__PURE__ */
|
|
1905
|
+
children: n ? /* @__PURE__ */ D("input", {
|
|
1905
1906
|
type: "date",
|
|
1906
1907
|
className: "border rounded px-1 py-0.5 text-xs w-full bg-background",
|
|
1907
1908
|
value: yt.end || "",
|
|
@@ -1910,31 +1911,31 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1910
1911
|
end: e.target.value
|
|
1911
1912
|
})),
|
|
1912
1913
|
onClick: (e) => e.stopPropagation()
|
|
1913
|
-
}) : e.end.toLocaleDateString(
|
|
1914
|
+
}) : e.end.toLocaleDateString(C, {
|
|
1914
1915
|
month: "numeric",
|
|
1915
1916
|
day: "numeric"
|
|
1916
1917
|
})
|
|
1917
1918
|
}),
|
|
1918
|
-
!n && /* @__PURE__ */
|
|
1919
|
+
!n && /* @__PURE__ */ D("button", {
|
|
1919
1920
|
type: "button",
|
|
1920
|
-
title:
|
|
1921
|
-
"aria-label":
|
|
1921
|
+
title: S("gantt.row.locate"),
|
|
1922
|
+
"aria-label": S("gantt.row.locate"),
|
|
1922
1923
|
className: "gantt-locate-btn hidden sm:block absolute top-1/2 -translate-y-1/2",
|
|
1923
1924
|
style: { right: 1 },
|
|
1924
1925
|
onClick: (t) => {
|
|
1925
1926
|
t.stopPropagation(), tr(e.start, e.end, e.task.id);
|
|
1926
1927
|
},
|
|
1927
|
-
children: /* @__PURE__ */
|
|
1928
|
+
children: /* @__PURE__ */ D(ge, { className: "w-3 h-3" })
|
|
1928
1929
|
})
|
|
1929
1930
|
]
|
|
1930
1931
|
}, t.id);
|
|
1931
1932
|
}),
|
|
1932
|
-
Z.endIdx < G.length && /* @__PURE__ */
|
|
1933
|
+
Z.endIdx < G.length && /* @__PURE__ */ D("div", {
|
|
1933
1934
|
style: { height: (G.length - Z.endIdx) * P },
|
|
1934
1935
|
"aria-hidden": "true"
|
|
1935
1936
|
})
|
|
1936
1937
|
]
|
|
1937
|
-
}), /* @__PURE__ */
|
|
1938
|
+
}), /* @__PURE__ */ D("div", {
|
|
1938
1939
|
className: "flex-1 overflow-auto bg-background/50 relative [-webkit-overflow-scrolling:touch]",
|
|
1939
1940
|
ref: (e) => {
|
|
1940
1941
|
jn.current = e, X.current = e;
|
|
@@ -1944,28 +1945,28 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1944
1945
|
onTouchMove: Xn,
|
|
1945
1946
|
onTouchEnd: Zn,
|
|
1946
1947
|
"data-testid": "gantt-timeline",
|
|
1947
|
-
children: /* @__PURE__ */
|
|
1948
|
+
children: /* @__PURE__ */ O("div", {
|
|
1948
1949
|
className: "relative",
|
|
1949
1950
|
style: { width: bn },
|
|
1950
1951
|
children: [
|
|
1951
|
-
Q != null && /* @__PURE__ */
|
|
1952
|
+
Q != null && /* @__PURE__ */ D("div", {
|
|
1952
1953
|
className: "absolute top-0 bottom-0 w-px z-20 pointer-events-none",
|
|
1953
1954
|
style: {
|
|
1954
1955
|
left: Q,
|
|
1955
1956
|
backgroundColor: "rgba(239, 68, 68, 0.8)"
|
|
1956
1957
|
},
|
|
1957
1958
|
"data-testid": "gantt-today-marker",
|
|
1958
|
-
"aria-label":
|
|
1959
|
-
children: /* @__PURE__ */
|
|
1959
|
+
"aria-label": S("gantt.toolbar.today"),
|
|
1960
|
+
children: /* @__PURE__ */ D("div", {
|
|
1960
1961
|
className: "absolute -translate-x-1/2 left-0 text-[10px] font-semibold text-white rounded-sm px-1 py-0.5 whitespace-nowrap z-30",
|
|
1961
1962
|
style: {
|
|
1962
1963
|
top: 2,
|
|
1963
1964
|
backgroundColor: "#ef4444"
|
|
1964
1965
|
},
|
|
1965
|
-
children:
|
|
1966
|
+
children: S("gantt.toolbar.today")
|
|
1966
1967
|
})
|
|
1967
1968
|
}),
|
|
1968
|
-
On.map((e) => /* @__PURE__ */
|
|
1969
|
+
On.map((e) => /* @__PURE__ */ D("div", {
|
|
1969
1970
|
className: "absolute top-0 bottom-0 w-px z-20 pointer-events-none",
|
|
1970
1971
|
style: {
|
|
1971
1972
|
left: e.left,
|
|
@@ -1973,7 +1974,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1973
1974
|
},
|
|
1974
1975
|
"data-testid": `gantt-marker-${e.index}`,
|
|
1975
1976
|
"aria-label": e.label,
|
|
1976
|
-
children: e.label && /* @__PURE__ */
|
|
1977
|
+
children: e.label && /* @__PURE__ */ D("div", {
|
|
1977
1978
|
className: "absolute -translate-x-1/2 left-0 text-[10px] font-semibold text-white rounded-sm px-1 py-0.5 whitespace-nowrap z-30",
|
|
1978
1979
|
style: {
|
|
1979
1980
|
top: 2,
|
|
@@ -1982,16 +1983,16 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1982
1983
|
children: e.label
|
|
1983
1984
|
})
|
|
1984
1985
|
}, e.index)),
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ O("div", {
|
|
1986
1987
|
className: "relative",
|
|
1987
1988
|
ref: Yt,
|
|
1988
1989
|
children: [
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
+
/* @__PURE__ */ D("div", {
|
|
1990
1991
|
className: "absolute inset-0 pointer-events-none",
|
|
1991
1992
|
style: { zIndex: 0 },
|
|
1992
1993
|
children: q.slice(Vn.start, Vn.end).map((e, t) => {
|
|
1993
1994
|
let n = Vn.start + t;
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
+
return /* @__PURE__ */ D("div", {
|
|
1995
1996
|
className: "absolute top-0 bottom-0 border-r",
|
|
1996
1997
|
style: {
|
|
1997
1998
|
left: J[n],
|
|
@@ -2001,14 +2002,14 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2001
2002
|
}, n);
|
|
2002
2003
|
})
|
|
2003
2004
|
}),
|
|
2004
|
-
_n &&
|
|
2005
|
+
_n && y && y.showMidnight && /* @__PURE__ */ D("div", {
|
|
2005
2006
|
className: "absolute inset-0 pointer-events-none",
|
|
2006
2007
|
style: { zIndex: 0 },
|
|
2007
2008
|
children: q.slice(Vn.start, Vn.end).map((e, t) => {
|
|
2008
2009
|
let n = Vn.start + t, r = e.realMs ?? 0;
|
|
2009
2010
|
if (!r) return null;
|
|
2010
2011
|
let i = e.date.getTime(), a = e.date, o = new Date(a.getFullYear(), a.getMonth(), a.getDate() + 1, 0, 0, 0, 0).getTime();
|
|
2011
|
-
return o <= i || o >= i + r ? null : /* @__PURE__ */
|
|
2012
|
+
return o <= i || o >= i + r ? null : /* @__PURE__ */ D("div", {
|
|
2012
2013
|
className: "absolute top-0 bottom-0",
|
|
2013
2014
|
style: {
|
|
2014
2015
|
left: J[n] + (o - i) / r * e.width,
|
|
@@ -2019,48 +2020,48 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2019
2020
|
}, `midnight-${n}`);
|
|
2020
2021
|
})
|
|
2021
2022
|
}),
|
|
2022
|
-
Z.startIdx > 0 && /* @__PURE__ */
|
|
2023
|
+
Z.startIdx > 0 && /* @__PURE__ */ D("div", {
|
|
2023
2024
|
style: { height: Z.startIdx * P },
|
|
2024
2025
|
"aria-hidden": "true"
|
|
2025
2026
|
}),
|
|
2026
2027
|
G.slice(Z.startIdx, Z.endIdx).map((t) => {
|
|
2027
|
-
let n = t.task, r =
|
|
2028
|
+
let n = t.task, r = Or(n.id), i = or(t.start, t.end), a = ee && n.baselineStart && n.baselineEnd ? or(n.baselineStart, n.baselineEnd) : null, o = a ? /* @__PURE__ */ D("div", {
|
|
2028
2029
|
className: "absolute pointer-events-none rounded-[1px]",
|
|
2029
2030
|
style: {
|
|
2030
2031
|
left: a.left,
|
|
2031
2032
|
width: Math.max(2, a.width),
|
|
2032
|
-
top:
|
|
2033
|
-
height:
|
|
2034
|
-
backgroundColor:
|
|
2035
|
-
border: `1px solid ${
|
|
2033
|
+
top: br,
|
|
2034
|
+
height: yr,
|
|
2035
|
+
backgroundColor: xr,
|
|
2036
|
+
border: `1px solid ${Sr}`
|
|
2036
2037
|
},
|
|
2037
2038
|
"data-testid": `gantt-baseline-${n.id}`,
|
|
2038
2039
|
"aria-hidden": "true"
|
|
2039
|
-
}) : null,
|
|
2040
|
+
}) : null, s = H?.taskId === n.id, c = cr?.has(String(n.id)) ?? !1, l = lr?.has(String(n.id)) ?? !1, u = s || c || l ? ur(t) : i, d = !!n.locked, f = !!A && !t.isSummary && !d, p = U != null && U.targetId != null && String(U.targetId) === String(n.id) && String(U.sourceId) !== String(n.id), m = U ? (e) => {
|
|
2040
2041
|
let t = e.currentTarget.getBoundingClientRect(), r = t.width > 0 && e.clientX - t.left > t.width / 2 ? "end" : "start";
|
|
2041
2042
|
Xt((e) => e && String(e.sourceId) !== String(n.id) ? {
|
|
2042
2043
|
...e,
|
|
2043
2044
|
targetId: n.id,
|
|
2044
2045
|
targetEnd: r
|
|
2045
2046
|
} : e);
|
|
2046
|
-
} : void 0,
|
|
2047
|
+
} : void 0, h = U ? (e) => {
|
|
2047
2048
|
e.target === e.currentTarget && Xt((e) => e && {
|
|
2048
2049
|
...e,
|
|
2049
2050
|
targetId: null,
|
|
2050
2051
|
targetEnd: null
|
|
2051
2052
|
});
|
|
2052
|
-
} : void 0,
|
|
2053
|
+
} : void 0, g = Math.max(1, Math.round((t.end.getTime() - t.start.getTime()) / Ze)), _ = xt === n.id && !H && !Kt && !U ? /* @__PURE__ */ O("div", {
|
|
2053
2054
|
className: "absolute z-30 pointer-events-none rounded-md border bg-popover text-popover-foreground px-2.5 py-1.5 text-xs shadow-md whitespace-nowrap",
|
|
2054
2055
|
style: {
|
|
2055
|
-
left: Math.max(
|
|
2056
|
+
left: Math.max(u.left + 8, 4),
|
|
2056
2057
|
top: P - 8
|
|
2057
2058
|
},
|
|
2058
2059
|
role: "tooltip",
|
|
2059
2060
|
"data-testid": `gantt-tooltip-${n.id}`,
|
|
2060
|
-
children: [/* @__PURE__ */
|
|
2061
|
+
children: [/* @__PURE__ */ D("div", {
|
|
2061
2062
|
className: "font-semibold",
|
|
2062
2063
|
children: n.title
|
|
2063
|
-
}), n.fields && n.fields.length > 0 ? /* @__PURE__ */
|
|
2064
|
+
}), n.fields && n.fields.length > 0 ? /* @__PURE__ */ D("div", {
|
|
2064
2065
|
style: {
|
|
2065
2066
|
display: "grid",
|
|
2066
2067
|
gridTemplateColumns: "auto 1fr",
|
|
@@ -2068,55 +2069,55 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2068
2069
|
rowGap: 2,
|
|
2069
2070
|
marginTop: 4
|
|
2070
2071
|
},
|
|
2071
|
-
children: n.fields.map((t, n) => /* @__PURE__ */
|
|
2072
|
+
children: n.fields.map((t, n) => /* @__PURE__ */ O(e.Fragment, { children: [/* @__PURE__ */ D("span", {
|
|
2072
2073
|
className: "text-muted-foreground",
|
|
2073
2074
|
children: t.label
|
|
2074
|
-
}), /* @__PURE__ */
|
|
2075
|
+
}), /* @__PURE__ */ D("span", {
|
|
2075
2076
|
style: { fontWeight: 500 },
|
|
2076
2077
|
children: t.value
|
|
2077
2078
|
})] }, n))
|
|
2078
|
-
}) : /* @__PURE__ */
|
|
2079
|
+
}) : /* @__PURE__ */ O("div", {
|
|
2079
2080
|
className: "text-muted-foreground",
|
|
2080
2081
|
children: [
|
|
2081
|
-
t.start.toLocaleDateString(
|
|
2082
|
+
t.start.toLocaleDateString(C, {
|
|
2082
2083
|
month: "short",
|
|
2083
2084
|
day: "numeric"
|
|
2084
2085
|
}),
|
|
2085
2086
|
" → ",
|
|
2086
|
-
t.end.toLocaleDateString(
|
|
2087
|
+
t.end.toLocaleDateString(C, {
|
|
2087
2088
|
month: "short",
|
|
2088
2089
|
day: "numeric"
|
|
2089
2090
|
}),
|
|
2090
2091
|
" · ",
|
|
2091
|
-
|
|
2092
|
-
|
|
2092
|
+
g,
|
|
2093
|
+
S("gantt.tooltip.days"),
|
|
2093
2094
|
" · ",
|
|
2094
2095
|
Math.round(t.progress),
|
|
2095
2096
|
"%"
|
|
2096
2097
|
]
|
|
2097
2098
|
})]
|
|
2098
2099
|
}) : null;
|
|
2099
|
-
if (n.type === "group") return /* @__PURE__ */
|
|
2100
|
+
if (n.type === "group") return /* @__PURE__ */ D("div", {
|
|
2100
2101
|
className: "relative border-b hover:bg-accent/50",
|
|
2101
2102
|
style: { height: P },
|
|
2102
|
-
onPointerMove:
|
|
2103
|
+
onPointerMove: h,
|
|
2103
2104
|
children: _
|
|
2104
2105
|
}, n.id);
|
|
2105
2106
|
if (t.isSummary) {
|
|
2106
2107
|
let e = n.color || "#0d9488";
|
|
2107
|
-
return /* @__PURE__ */
|
|
2108
|
+
return /* @__PURE__ */ O("div", {
|
|
2108
2109
|
className: "relative border-b hover:bg-accent/50",
|
|
2109
2110
|
style: { height: P },
|
|
2110
|
-
onPointerMove:
|
|
2111
|
+
onPointerMove: h,
|
|
2111
2112
|
children: [
|
|
2112
|
-
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
className:
|
|
2113
|
+
o,
|
|
2114
|
+
/* @__PURE__ */ O("div", {
|
|
2115
|
+
className: x("gantt-bar-hover absolute rounded-sm border shadow-sm flex items-center px-2 select-none", A ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", s && "ring-2 ring-primary z-10", Mn === n.id && "gantt-flash z-10"),
|
|
2115
2116
|
style: {
|
|
2116
|
-
left:
|
|
2117
|
-
width:
|
|
2118
|
-
top:
|
|
2119
|
-
height:
|
|
2117
|
+
left: u.left,
|
|
2118
|
+
width: u.width,
|
|
2119
|
+
top: vr,
|
|
2120
|
+
height: _r,
|
|
2120
2121
|
backgroundColor: e,
|
|
2121
2122
|
borderColor: r ? $ : "hsl(var(--primary-foreground) / 0.2)",
|
|
2122
2123
|
boxShadow: r ? `0 0 0 2px ${$}` : void 0
|
|
@@ -2134,10 +2135,10 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2134
2135
|
});
|
|
2135
2136
|
},
|
|
2136
2137
|
onClick: () => {
|
|
2137
|
-
Ot.current ||
|
|
2138
|
+
Ot.current || cn(n.id);
|
|
2138
2139
|
},
|
|
2139
2140
|
onContextMenu: (e) => un(n, e),
|
|
2140
|
-
children: [/* @__PURE__ */
|
|
2141
|
+
children: [/* @__PURE__ */ D("div", {
|
|
2141
2142
|
className: "absolute left-0 top-0 bottom-0 pointer-events-none",
|
|
2142
2143
|
style: {
|
|
2143
2144
|
width: `${Math.round(t.progress)}%`,
|
|
@@ -2145,25 +2146,25 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2145
2146
|
borderTopLeftRadius: "var(--radius-sm)",
|
|
2146
2147
|
borderBottomLeftRadius: "var(--radius-sm)"
|
|
2147
2148
|
}
|
|
2148
|
-
}), /* @__PURE__ */
|
|
2149
|
+
}), /* @__PURE__ */ D("span", {
|
|
2149
2150
|
className: "relative text-[10px] text-white font-medium truncate pointer-events-none",
|
|
2150
2151
|
children: n.title
|
|
2151
2152
|
})]
|
|
2152
2153
|
}),
|
|
2153
|
-
|
|
2154
|
+
s && H && /* @__PURE__ */ O("div", {
|
|
2154
2155
|
className: "absolute z-30 pointer-events-none rounded border bg-popover text-popover-foreground px-1.5 py-0.5 text-[10px] shadow whitespace-nowrap",
|
|
2155
2156
|
style: {
|
|
2156
|
-
left: Math.max(
|
|
2157
|
-
top:
|
|
2157
|
+
left: Math.max(u.left, 4),
|
|
2158
|
+
top: vr + _r + 2
|
|
2158
2159
|
},
|
|
2159
2160
|
"data-testid": `gantt-summary-drag-chip-${n.id}`,
|
|
2160
2161
|
children: [
|
|
2161
|
-
kt(H).start.toLocaleDateString(
|
|
2162
|
+
kt(H).start.toLocaleDateString(C, {
|
|
2162
2163
|
month: "numeric",
|
|
2163
2164
|
day: "numeric"
|
|
2164
2165
|
}),
|
|
2165
2166
|
" → ",
|
|
2166
|
-
kt(H).end.toLocaleDateString(
|
|
2167
|
+
kt(H).end.toLocaleDateString(C, {
|
|
2167
2168
|
month: "numeric",
|
|
2168
2169
|
day: "numeric"
|
|
2169
2170
|
})
|
|
@@ -2174,17 +2175,17 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2174
2175
|
}, n.id);
|
|
2175
2176
|
}
|
|
2176
2177
|
if (t.isMilestone) {
|
|
2177
|
-
let e =
|
|
2178
|
-
return /* @__PURE__ */
|
|
2178
|
+
let e = hr;
|
|
2179
|
+
return /* @__PURE__ */ O("div", {
|
|
2179
2180
|
className: "relative border-b hover:bg-accent/50",
|
|
2180
2181
|
style: { height: P },
|
|
2181
|
-
onPointerMove:
|
|
2182
|
+
onPointerMove: h,
|
|
2182
2183
|
children: [
|
|
2183
|
-
|
|
2184
|
-
/* @__PURE__ */
|
|
2185
|
-
className:
|
|
2184
|
+
o,
|
|
2185
|
+
/* @__PURE__ */ D("div", {
|
|
2186
|
+
className: x("gantt-bar-hover absolute rotate-45 rounded-[2px] border shadow-sm select-none", f ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", s && "ring-2 ring-primary z-10", p && "ring-2 ring-primary", Mn === n.id && "gantt-flash z-10"),
|
|
2186
2187
|
style: {
|
|
2187
|
-
left:
|
|
2188
|
+
left: u.left - e / 2,
|
|
2188
2189
|
top: (P - e) / 2,
|
|
2189
2190
|
width: e,
|
|
2190
2191
|
height: e,
|
|
@@ -2197,11 +2198,11 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2197
2198
|
onMouseEnter: () => St(n.id),
|
|
2198
2199
|
onMouseLeave: () => St((e) => e === n.id ? null : e),
|
|
2199
2200
|
onClick: () => {
|
|
2200
|
-
Ot.current ||
|
|
2201
|
+
Ot.current || cn(n.id);
|
|
2201
2202
|
},
|
|
2202
2203
|
onContextMenu: (e) => un(n, e),
|
|
2203
|
-
onPointerMove:
|
|
2204
|
-
onPointerDown:
|
|
2204
|
+
onPointerMove: m,
|
|
2205
|
+
onPointerDown: f ? (e) => {
|
|
2205
2206
|
e.button === 0 && Gt(n, "move", e);
|
|
2206
2207
|
} : void 0
|
|
2207
2208
|
}),
|
|
@@ -2210,14 +2211,14 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2210
2211
|
}, n.id);
|
|
2211
2212
|
}
|
|
2212
2213
|
let v = Kt && Kt.taskId === n.id ? Kt.value : n.progress;
|
|
2213
|
-
return /* @__PURE__ */
|
|
2214
|
+
return /* @__PURE__ */ O("div", {
|
|
2214
2215
|
className: "relative border-b hover:bg-accent/50",
|
|
2215
2216
|
style: { height: P },
|
|
2216
|
-
onPointerMove:
|
|
2217
|
+
onPointerMove: h,
|
|
2217
2218
|
onMouseEnter: () => St(n.id),
|
|
2218
2219
|
onMouseLeave: () => St((e) => e === n.id ? null : e),
|
|
2219
2220
|
children: [
|
|
2220
|
-
|
|
2221
|
+
s && /* @__PURE__ */ D("div", {
|
|
2221
2222
|
className: "absolute rounded-sm border border-dashed pointer-events-none",
|
|
2222
2223
|
style: {
|
|
2223
2224
|
left: i.left,
|
|
@@ -2229,12 +2230,12 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2229
2230
|
},
|
|
2230
2231
|
"aria-hidden": "true"
|
|
2231
2232
|
}),
|
|
2232
|
-
|
|
2233
|
-
/* @__PURE__ */
|
|
2234
|
-
className:
|
|
2233
|
+
o,
|
|
2234
|
+
/* @__PURE__ */ O("div", {
|
|
2235
|
+
className: x("gantt-bar-hover absolute rounded-sm bg-primary border shadow-sm flex items-center px-2 group select-none", f ? "cursor-grab active:cursor-grabbing" : "cursor-pointer", s && "ring-2 ring-primary z-10", p && "ring-2 ring-primary", Mn === n.id && "gantt-flash z-10"),
|
|
2235
2236
|
style: {
|
|
2236
|
-
left:
|
|
2237
|
-
width:
|
|
2237
|
+
left: u.left,
|
|
2238
|
+
width: u.width,
|
|
2238
2239
|
top: fr,
|
|
2239
2240
|
height: pr,
|
|
2240
2241
|
backgroundColor: n.color || "#3b82f6",
|
|
@@ -2244,18 +2245,19 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2244
2245
|
"data-critical": r ? "true" : void 0,
|
|
2245
2246
|
"data-testid": `gantt-task-bar-${n.id}`,
|
|
2246
2247
|
onClick: () => {
|
|
2247
|
-
Ot.current ||
|
|
2248
|
+
Ot.current || cn(n.id);
|
|
2248
2249
|
},
|
|
2249
2250
|
onContextMenu: (e) => un(n, e),
|
|
2250
|
-
onPointerMove:
|
|
2251
|
-
onPointerDown:
|
|
2251
|
+
onPointerMove: m,
|
|
2252
|
+
onPointerDown: f ? (e) => {
|
|
2252
2253
|
e.button === 0 && Gt(n, "move", e);
|
|
2253
2254
|
} : void 0,
|
|
2254
2255
|
children: [
|
|
2255
|
-
|
|
2256
|
-
className: "gantt-resize-handle absolute left-0 top-0
|
|
2256
|
+
f && u.width >= 14 && /* @__PURE__ */ O(Oe, { children: [/* @__PURE__ */ D("div", {
|
|
2257
|
+
className: "gantt-resize-handle absolute left-0 top-0",
|
|
2257
2258
|
style: {
|
|
2258
2259
|
width: 6,
|
|
2260
|
+
height: mr,
|
|
2259
2261
|
cursor: "ew-resize"
|
|
2260
2262
|
},
|
|
2261
2263
|
"data-testid": `gantt-task-resize-left-${n.id}`,
|
|
@@ -2263,10 +2265,11 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2263
2265
|
e.button === 0 && Gt(n, "resize-left", e);
|
|
2264
2266
|
},
|
|
2265
2267
|
onClick: (e) => e.stopPropagation()
|
|
2266
|
-
}), /* @__PURE__ */
|
|
2267
|
-
className: "gantt-resize-handle absolute right-0 top-0
|
|
2268
|
+
}), /* @__PURE__ */ D("div", {
|
|
2269
|
+
className: "gantt-resize-handle absolute right-0 top-0",
|
|
2268
2270
|
style: {
|
|
2269
2271
|
width: 6,
|
|
2272
|
+
height: mr,
|
|
2270
2273
|
cursor: "ew-resize"
|
|
2271
2274
|
},
|
|
2272
2275
|
"data-testid": `gantt-task-resize-right-${n.id}`,
|
|
@@ -2275,7 +2278,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2275
2278
|
},
|
|
2276
2279
|
onClick: (e) => e.stopPropagation()
|
|
2277
2280
|
})] }),
|
|
2278
|
-
v > 0 && /* @__PURE__ */
|
|
2281
|
+
v > 0 && /* @__PURE__ */ D("div", {
|
|
2279
2282
|
className: "absolute left-0 top-0 bottom-0 pointer-events-none",
|
|
2280
2283
|
style: {
|
|
2281
2284
|
width: `${v}%`,
|
|
@@ -2284,8 +2287,8 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2284
2287
|
borderBottomLeftRadius: "var(--radius-sm)"
|
|
2285
2288
|
}
|
|
2286
2289
|
}),
|
|
2287
|
-
|
|
2288
|
-
className:
|
|
2290
|
+
f && u.width >= 30 && /* @__PURE__ */ D("div", {
|
|
2291
|
+
className: x("absolute bottom-0 h-1/2 w-4 -translate-x-1/2 cursor-col-resize flex items-end justify-center pb-px", Kt?.taskId === n.id ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity"),
|
|
2289
2292
|
style: { left: `${v}%` },
|
|
2290
2293
|
"data-testid": `gantt-progress-handle-${n.id}`,
|
|
2291
2294
|
onPointerDown: (e) => {
|
|
@@ -2293,12 +2296,12 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2293
2296
|
taskId: n.id,
|
|
2294
2297
|
originClientX: e.clientX,
|
|
2295
2298
|
originProgress: n.progress,
|
|
2296
|
-
barWidth:
|
|
2299
|
+
barWidth: u.width,
|
|
2297
2300
|
value: n.progress
|
|
2298
2301
|
}));
|
|
2299
2302
|
},
|
|
2300
2303
|
onClick: (e) => e.stopPropagation(),
|
|
2301
|
-
children: /* @__PURE__ */
|
|
2304
|
+
children: /* @__PURE__ */ D("div", { style: {
|
|
2302
2305
|
width: 0,
|
|
2303
2306
|
height: 0,
|
|
2304
2307
|
borderLeft: "5px solid transparent",
|
|
@@ -2307,9 +2310,9 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2307
2310
|
filter: "drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35))"
|
|
2308
2311
|
} })
|
|
2309
2312
|
}),
|
|
2310
|
-
j && !
|
|
2313
|
+
j && !d && ["start", "end"].map((e) => {
|
|
2311
2314
|
let t = U != null && String(U.sourceId) === String(n.id) && U.sourceEnd === e, r = t || xt === n.id, i = r && U == null;
|
|
2312
|
-
return /* @__PURE__ */
|
|
2315
|
+
return /* @__PURE__ */ D("div", {
|
|
2313
2316
|
className: "absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity",
|
|
2314
2317
|
style: {
|
|
2315
2318
|
[e === "start" ? "left" : "right"]: -28,
|
|
@@ -2337,7 +2340,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2337
2340
|
});
|
|
2338
2341
|
},
|
|
2339
2342
|
onClick: (e) => e.stopPropagation(),
|
|
2340
|
-
children: /* @__PURE__ */
|
|
2343
|
+
children: /* @__PURE__ */ D("div", {
|
|
2341
2344
|
className: "rounded-full",
|
|
2342
2345
|
style: {
|
|
2343
2346
|
height: 12,
|
|
@@ -2349,16 +2352,16 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2349
2352
|
})
|
|
2350
2353
|
}, e);
|
|
2351
2354
|
}),
|
|
2352
|
-
/* @__PURE__ */
|
|
2355
|
+
/* @__PURE__ */ D("span", {
|
|
2353
2356
|
className: "relative text-[10px] text-white font-medium truncate pointer-events-none group-hover:opacity-0 transition-opacity",
|
|
2354
2357
|
children: n.title
|
|
2355
2358
|
}),
|
|
2356
|
-
/* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ D("span", {
|
|
2357
2360
|
className: "absolute inset-0 flex items-center px-2 text-[10px] text-white font-medium truncate opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",
|
|
2358
|
-
children:
|
|
2361
|
+
children: s ? `${kt(H).start.toLocaleDateString(C, {
|
|
2359
2362
|
month: "numeric",
|
|
2360
2363
|
day: "numeric"
|
|
2361
|
-
})} → ${kt(H).end.toLocaleDateString(
|
|
2364
|
+
})} → ${kt(H).end.toLocaleDateString(C, {
|
|
2362
2365
|
month: "numeric",
|
|
2363
2366
|
day: "numeric"
|
|
2364
2367
|
})}` : `${Math.round(v)}%`
|
|
@@ -2369,19 +2372,19 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2369
2372
|
]
|
|
2370
2373
|
}, n.id);
|
|
2371
2374
|
}),
|
|
2372
|
-
Z.endIdx < G.length && /* @__PURE__ */
|
|
2375
|
+
Z.endIdx < G.length && /* @__PURE__ */ D("div", {
|
|
2373
2376
|
style: { height: (G.length - Z.endIdx) * P },
|
|
2374
2377
|
"aria-hidden": "true"
|
|
2375
2378
|
}),
|
|
2376
|
-
(dr.length > 0 || U) && /* @__PURE__ */
|
|
2379
|
+
(dr.length > 0 || U) && /* @__PURE__ */ O("svg", {
|
|
2377
2380
|
className: "absolute top-0 left-0 pointer-events-none z-10",
|
|
2378
2381
|
width: bn,
|
|
2379
2382
|
height: Wn,
|
|
2380
2383
|
"data-testid": "gantt-links",
|
|
2381
2384
|
"aria-hidden": "true",
|
|
2382
2385
|
children: [
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ O("defs", { children: [
|
|
2387
|
+
/* @__PURE__ */ D("marker", {
|
|
2385
2388
|
id: "gantt-link-arrow",
|
|
2386
2389
|
viewBox: "0 0 8 8",
|
|
2387
2390
|
refX: "7",
|
|
@@ -2389,12 +2392,12 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2389
2392
|
markerWidth: "6",
|
|
2390
2393
|
markerHeight: "6",
|
|
2391
2394
|
orient: "auto",
|
|
2392
|
-
children: /* @__PURE__ */
|
|
2395
|
+
children: /* @__PURE__ */ D("path", {
|
|
2393
2396
|
d: "M 0 0 L 8 4 L 0 8 z",
|
|
2394
2397
|
fill: "hsl(var(--muted-foreground))"
|
|
2395
2398
|
})
|
|
2396
2399
|
}),
|
|
2397
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ D("marker", {
|
|
2398
2401
|
id: "gantt-link-arrow-active",
|
|
2399
2402
|
viewBox: "0 0 8 8",
|
|
2400
2403
|
refX: "7",
|
|
@@ -2402,12 +2405,12 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2402
2405
|
markerWidth: "6",
|
|
2403
2406
|
markerHeight: "6",
|
|
2404
2407
|
orient: "auto",
|
|
2405
|
-
children: /* @__PURE__ */
|
|
2408
|
+
children: /* @__PURE__ */ D("path", {
|
|
2406
2409
|
d: "M 0 0 L 8 4 L 0 8 z",
|
|
2407
2410
|
fill: "hsl(var(--primary))"
|
|
2408
2411
|
})
|
|
2409
2412
|
}),
|
|
2410
|
-
/* @__PURE__ */
|
|
2413
|
+
/* @__PURE__ */ D("marker", {
|
|
2411
2414
|
id: "gantt-link-arrow-critical",
|
|
2412
2415
|
viewBox: "0 0 8 8",
|
|
2413
2416
|
refX: "7",
|
|
@@ -2415,7 +2418,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2415
2418
|
markerWidth: "6",
|
|
2416
2419
|
markerHeight: "6",
|
|
2417
2420
|
orient: "auto",
|
|
2418
|
-
children: /* @__PURE__ */
|
|
2421
|
+
children: /* @__PURE__ */ D("path", {
|
|
2419
2422
|
d: "M 0 0 L 8 4 L 0 8 z",
|
|
2420
2423
|
fill: $
|
|
2421
2424
|
})
|
|
@@ -2424,10 +2427,10 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2424
2427
|
dr.map((t) => {
|
|
2425
2428
|
let n = Math.min(t.sourceIndex, t.targetIndex);
|
|
2426
2429
|
if (Math.max(t.sourceIndex, t.targetIndex) < Z.startIdx - 6 || n > Z.endIdx + 6) return null;
|
|
2427
|
-
let r =
|
|
2430
|
+
let r = Cr(t);
|
|
2428
2431
|
if (!r) return null;
|
|
2429
|
-
let i =
|
|
2430
|
-
return /* @__PURE__ */
|
|
2432
|
+
let i = wr != null && (String(t.sourceId) === String(wr) || String(t.targetId) === String(wr)), a = Dr?.criticalEdges.has(`${String(t.sourceId)}->${String(t.targetId)}`) ?? !1, o = a ? "gantt-link-arrow-critical" : i ? "gantt-link-arrow-active" : "gantt-link-arrow", s = !!(Ne || j);
|
|
2433
|
+
return /* @__PURE__ */ O(e.Fragment, { children: [/* @__PURE__ */ D("path", {
|
|
2431
2434
|
d: r,
|
|
2432
2435
|
fill: "none",
|
|
2433
2436
|
stroke: a ? $ : i ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))",
|
|
@@ -2438,7 +2441,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2438
2441
|
"data-link-type": t.type,
|
|
2439
2442
|
"data-active": i ? "true" : "false",
|
|
2440
2443
|
"data-critical": a ? "true" : void 0
|
|
2441
|
-
}), s && /* @__PURE__ */
|
|
2444
|
+
}), s && /* @__PURE__ */ D("path", {
|
|
2442
2445
|
d: r,
|
|
2443
2446
|
fill: "none",
|
|
2444
2447
|
stroke: "transparent",
|
|
@@ -2454,8 +2457,8 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2454
2457
|
U && (() => {
|
|
2455
2458
|
let e = G.findIndex((e) => String(e.task.id) === String(U.sourceId));
|
|
2456
2459
|
if (e < 0) return null;
|
|
2457
|
-
let t = ur(G[e]), n = G[e].isMilestone ? t.left + (U.sourceEnd === "start" ? -
|
|
2458
|
-
return /* @__PURE__ */
|
|
2460
|
+
let t = ur(G[e]), n = G[e].isMilestone ? t.left + (U.sourceEnd === "start" ? -gr : gr) : U.sourceEnd === "start" ? t.left : t.left + t.width, r = e * P + P / 2;
|
|
2461
|
+
return /* @__PURE__ */ D("path", {
|
|
2459
2462
|
d: `M ${Math.round(n)} ${Math.round(r)} L ${Math.round(U.x)} ${Math.round(U.y)}`,
|
|
2460
2463
|
fill: "none",
|
|
2461
2464
|
stroke: "hsl(var(--primary))",
|
|
@@ -2469,8 +2472,8 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2469
2472
|
U && (() => {
|
|
2470
2473
|
let e = t.find((e) => String(e.id) === String(U.sourceId));
|
|
2471
2474
|
if (!e) return null;
|
|
2472
|
-
let n = U.targetId == null ? null : t.find((e) => String(e.id) === String(U.targetId)), r = (e) =>
|
|
2473
|
-
return /* @__PURE__ */
|
|
2475
|
+
let n = U.targetId == null ? null : t.find((e) => String(e.id) === String(U.targetId)), r = (e) => S(`gantt.linkEnd.${e}`), i = n ? `${e.title} (${r(U.sourceEnd)}) → ${n.title} (${r(U.targetEnd ?? "start")})` : `${e.title} (${r(U.sourceEnd)})`;
|
|
2476
|
+
return /* @__PURE__ */ D("div", {
|
|
2474
2477
|
className: "absolute z-30 pointer-events-none rounded-md border bg-popover text-popover-foreground px-2 py-1 text-[11px] font-medium shadow-md whitespace-nowrap",
|
|
2475
2478
|
style: {
|
|
2476
2479
|
left: U.x + 12,
|
|
@@ -2492,7 +2495,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2492
2495
|
let e = t.find((e) => String(e.id) === String(Qt.taskId));
|
|
2493
2496
|
if (!e) return null;
|
|
2494
2497
|
let n = G.find((e) => String(e.task.id) === String(Qt.taskId)), r = "w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none";
|
|
2495
|
-
return /* @__PURE__ */
|
|
2498
|
+
return /* @__PURE__ */ O("div", {
|
|
2496
2499
|
ref: en,
|
|
2497
2500
|
className: "fixed z-50 min-w-[160px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm",
|
|
2498
2501
|
style: {
|
|
@@ -2502,7 +2505,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2502
2505
|
role: "menu",
|
|
2503
2506
|
"data-testid": "gantt-context-menu",
|
|
2504
2507
|
children: [
|
|
2505
|
-
o && /* @__PURE__ */
|
|
2508
|
+
o && /* @__PURE__ */ D("button", {
|
|
2506
2509
|
type: "button",
|
|
2507
2510
|
role: "menuitem",
|
|
2508
2511
|
className: r,
|
|
@@ -2510,9 +2513,9 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2510
2513
|
onClick: () => {
|
|
2511
2514
|
$t(null), o(e);
|
|
2512
2515
|
},
|
|
2513
|
-
children:
|
|
2516
|
+
children: S("gantt.menu.view")
|
|
2514
2517
|
}),
|
|
2515
|
-
Pe && A && n && !n.isSummary && !e.locked && /* @__PURE__ */
|
|
2518
|
+
Pe && A && n && !n.isSummary && !e.locked && /* @__PURE__ */ D("button", {
|
|
2516
2519
|
type: "button",
|
|
2517
2520
|
role: "menuitem",
|
|
2518
2521
|
className: r,
|
|
@@ -2525,9 +2528,9 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2525
2528
|
progress: String(e.progress)
|
|
2526
2529
|
});
|
|
2527
2530
|
},
|
|
2528
|
-
children:
|
|
2531
|
+
children: S("gantt.menu.edit")
|
|
2529
2532
|
}),
|
|
2530
|
-
j && n && !n.isMilestone && !e.locked && /* @__PURE__ */
|
|
2533
|
+
j && n && !n.isMilestone && !e.locked && /* @__PURE__ */ O(Oe, { children: [/* @__PURE__ */ D("button", {
|
|
2531
2534
|
type: "button",
|
|
2532
2535
|
role: "menuitem",
|
|
2533
2536
|
className: r,
|
|
@@ -2541,8 +2544,8 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2541
2544
|
relation: "pred"
|
|
2542
2545
|
});
|
|
2543
2546
|
},
|
|
2544
|
-
children:
|
|
2545
|
-
}), /* @__PURE__ */
|
|
2547
|
+
children: S("gantt.menu.addPredecessor")
|
|
2548
|
+
}), /* @__PURE__ */ D("button", {
|
|
2546
2549
|
type: "button",
|
|
2547
2550
|
role: "menuitem",
|
|
2548
2551
|
className: r,
|
|
@@ -2556,17 +2559,17 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2556
2559
|
relation: "succ"
|
|
2557
2560
|
});
|
|
2558
2561
|
},
|
|
2559
|
-
children:
|
|
2562
|
+
children: S("gantt.menu.addSuccessor")
|
|
2560
2563
|
})] }),
|
|
2561
|
-
Me && !e.locked && /* @__PURE__ */
|
|
2564
|
+
Me && !e.locked && /* @__PURE__ */ D("button", {
|
|
2562
2565
|
type: "button",
|
|
2563
2566
|
role: "menuitem",
|
|
2564
|
-
className:
|
|
2567
|
+
className: x(r, "text-destructive"),
|
|
2565
2568
|
"data-testid": "gantt-context-menu-delete",
|
|
2566
2569
|
onClick: () => {
|
|
2567
2570
|
$t(null), Me(e);
|
|
2568
2571
|
},
|
|
2569
|
-
children:
|
|
2572
|
+
children: S("gantt.menu.delete")
|
|
2570
2573
|
})
|
|
2571
2574
|
]
|
|
2572
2575
|
});
|
|
@@ -2575,7 +2578,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2575
2578
|
let e = t.find((e) => String(e.id) === String(W.sourceId)), n = t.find((e) => String(e.id) === String(W.targetId));
|
|
2576
2579
|
if (!e || !n) return null;
|
|
2577
2580
|
let r = "w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none";
|
|
2578
|
-
return /* @__PURE__ */
|
|
2581
|
+
return /* @__PURE__ */ O("div", {
|
|
2579
2582
|
ref: nn,
|
|
2580
2583
|
className: "fixed z-50 min-w-[180px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm",
|
|
2581
2584
|
style: {
|
|
@@ -2585,7 +2588,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2585
2588
|
role: "menu",
|
|
2586
2589
|
"data-testid": "gantt-link-context-menu",
|
|
2587
2590
|
children: [
|
|
2588
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ O("div", {
|
|
2589
2592
|
className: "px-3 py-1 text-xs text-muted-foreground truncate",
|
|
2590
2593
|
children: [
|
|
2591
2594
|
e.title,
|
|
@@ -2598,26 +2601,26 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2598
2601
|
"ss",
|
|
2599
2602
|
"ff",
|
|
2600
2603
|
"sf"
|
|
2601
|
-
].map((t) => /* @__PURE__ */
|
|
2604
|
+
].map((t) => /* @__PURE__ */ O("button", {
|
|
2602
2605
|
type: "button",
|
|
2603
2606
|
role: "menuitemradio",
|
|
2604
2607
|
"aria-checked": W.type === t,
|
|
2605
|
-
className:
|
|
2608
|
+
className: x(r, W.type === t && "font-semibold"),
|
|
2606
2609
|
"data-testid": `gantt-link-menu-type-${t}`,
|
|
2607
2610
|
onClick: () => {
|
|
2608
2611
|
tn(null), t !== W.type && j(e, n, t);
|
|
2609
2612
|
},
|
|
2610
|
-
children: [W.type === t ? "✓ " : "\xA0\xA0",
|
|
2613
|
+
children: [W.type === t ? "✓ " : "\xA0\xA0", S(`gantt.linkType.${t}`)]
|
|
2611
2614
|
}, t)),
|
|
2612
|
-
Ne && /* @__PURE__ */
|
|
2615
|
+
Ne && /* @__PURE__ */ O(Oe, { children: [/* @__PURE__ */ D("div", { className: "my-1 border-t" }), /* @__PURE__ */ D("button", {
|
|
2613
2616
|
type: "button",
|
|
2614
2617
|
role: "menuitem",
|
|
2615
|
-
className:
|
|
2618
|
+
className: x(r, "text-destructive"),
|
|
2616
2619
|
"data-testid": "gantt-link-menu-remove",
|
|
2617
2620
|
onClick: () => {
|
|
2618
2621
|
tn(null), Ne(e, n);
|
|
2619
2622
|
},
|
|
2620
|
-
children:
|
|
2623
|
+
children: S("gantt.menu.removeDependency")
|
|
2621
2624
|
})] })
|
|
2622
2625
|
]
|
|
2623
2626
|
});
|
|
@@ -2630,7 +2633,7 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2630
2633
|
let r = rn.relation === "pred" ? `${String(t.id)}->${String(e.id)}` : `${String(e.id)}->${String(t.id)}`;
|
|
2631
2634
|
return !n.has(r);
|
|
2632
2635
|
});
|
|
2633
|
-
return /* @__PURE__ */
|
|
2636
|
+
return /* @__PURE__ */ O("div", {
|
|
2634
2637
|
ref: on,
|
|
2635
2638
|
className: "fixed z-50 min-w-[200px] max-h-[280px] overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm",
|
|
2636
2639
|
style: {
|
|
@@ -2639,13 +2642,13 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2639
2642
|
},
|
|
2640
2643
|
role: "menu",
|
|
2641
2644
|
"data-testid": "gantt-dep-picker",
|
|
2642
|
-
children: [/* @__PURE__ */
|
|
2645
|
+
children: [/* @__PURE__ */ D("div", {
|
|
2643
2646
|
className: "px-3 py-1 text-xs text-muted-foreground",
|
|
2644
|
-
children: rn.relation === "pred" ?
|
|
2645
|
-
}), r.length === 0 ? /* @__PURE__ */
|
|
2647
|
+
children: rn.relation === "pred" ? S("gantt.menu.addPredecessor") : S("gantt.menu.addSuccessor")
|
|
2648
|
+
}), r.length === 0 ? /* @__PURE__ */ D("div", {
|
|
2646
2649
|
className: "px-3 py-1.5 text-muted-foreground",
|
|
2647
|
-
children:
|
|
2648
|
-
}) : r.map((t) => /* @__PURE__ */
|
|
2650
|
+
children: S("gantt.menu.noCandidates")
|
|
2651
|
+
}) : r.map((t) => /* @__PURE__ */ D("button", {
|
|
2649
2652
|
type: "button",
|
|
2650
2653
|
role: "menuitem",
|
|
2651
2654
|
className: "w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none truncate",
|
|
@@ -2657,40 +2660,40 @@ function st({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2657
2660
|
}, String(t.id)))]
|
|
2658
2661
|
});
|
|
2659
2662
|
})(),
|
|
2660
|
-
It && /* @__PURE__ */
|
|
2663
|
+
It && /* @__PURE__ */ D("div", {
|
|
2661
2664
|
className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/30",
|
|
2662
2665
|
"data-testid": "gantt-conflict-overlay",
|
|
2663
2666
|
onClick: () => Lt(null),
|
|
2664
|
-
children: /* @__PURE__ */
|
|
2667
|
+
children: /* @__PURE__ */ O("div", {
|
|
2665
2668
|
className: "min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4",
|
|
2666
2669
|
role: "alertdialog",
|
|
2667
2670
|
"aria-modal": "true",
|
|
2668
2671
|
"data-testid": "gantt-conflict-dialog",
|
|
2669
2672
|
onClick: (e) => e.stopPropagation(),
|
|
2670
2673
|
children: [
|
|
2671
|
-
/* @__PURE__ */
|
|
2674
|
+
/* @__PURE__ */ D("div", {
|
|
2672
2675
|
className: "text-sm font-semibold mb-1",
|
|
2673
2676
|
"data-testid": "gantt-conflict-title",
|
|
2674
|
-
children:
|
|
2677
|
+
children: S("gantt.conflict.title")
|
|
2675
2678
|
}),
|
|
2676
|
-
/* @__PURE__ */
|
|
2679
|
+
/* @__PURE__ */ D("div", {
|
|
2677
2680
|
className: "text-sm text-muted-foreground mb-3",
|
|
2678
|
-
children:
|
|
2681
|
+
children: S("gantt.conflict.body").replace("{count}", String(It.length))
|
|
2679
2682
|
}),
|
|
2680
|
-
/* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ O("div", {
|
|
2681
2684
|
className: "flex justify-end gap-2",
|
|
2682
|
-
children: [/* @__PURE__ */
|
|
2685
|
+
children: [/* @__PURE__ */ D("button", {
|
|
2683
2686
|
type: "button",
|
|
2684
2687
|
className: "px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none",
|
|
2685
2688
|
"data-testid": "gantt-conflict-cancel",
|
|
2686
2689
|
onClick: () => Lt(null),
|
|
2687
|
-
children:
|
|
2688
|
-
}), /* @__PURE__ */
|
|
2690
|
+
children: S("gantt.conflict.cancel")
|
|
2691
|
+
}), /* @__PURE__ */ D("button", {
|
|
2689
2692
|
type: "button",
|
|
2690
2693
|
className: "px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none",
|
|
2691
2694
|
"data-testid": "gantt-conflict-confirm",
|
|
2692
2695
|
onClick: zt,
|
|
2693
|
-
children:
|
|
2696
|
+
children: S("gantt.conflict.confirm")
|
|
2694
2697
|
})]
|
|
2695
2698
|
})
|
|
2696
2699
|
]
|
|
@@ -2793,7 +2796,7 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2793
2796
|
for (let t of p) e = Math.max(e, t.peak, t.capacity);
|
|
2794
2797
|
return e || 1;
|
|
2795
2798
|
}, [p]), h = f.length * d;
|
|
2796
|
-
return t.length ? /* @__PURE__ */
|
|
2799
|
+
return t.length ? /* @__PURE__ */ D("div", {
|
|
2797
2800
|
className: s,
|
|
2798
2801
|
"data-testid": "resource-workload",
|
|
2799
2802
|
style: {
|
|
@@ -2802,17 +2805,17 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2802
2805
|
height: "100%",
|
|
2803
2806
|
overflow: "auto"
|
|
2804
2807
|
},
|
|
2805
|
-
children: /* @__PURE__ */
|
|
2808
|
+
children: /* @__PURE__ */ O("div", {
|
|
2806
2809
|
style: {
|
|
2807
2810
|
display: "flex",
|
|
2808
2811
|
minWidth: ft + h
|
|
2809
2812
|
},
|
|
2810
|
-
children: [/* @__PURE__ */
|
|
2813
|
+
children: [/* @__PURE__ */ O("div", {
|
|
2811
2814
|
style: {
|
|
2812
2815
|
width: ft,
|
|
2813
2816
|
flexShrink: 0
|
|
2814
2817
|
},
|
|
2815
|
-
children: [/* @__PURE__ */
|
|
2818
|
+
children: [/* @__PURE__ */ D("div", {
|
|
2816
2819
|
style: {
|
|
2817
2820
|
height: 28,
|
|
2818
2821
|
display: "flex",
|
|
@@ -2823,7 +2826,7 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2823
2826
|
borderBottom: "1px solid hsl(var(--border))"
|
|
2824
2827
|
},
|
|
2825
2828
|
children: c("gantt.resource.header")
|
|
2826
|
-
}), p.map((e) => /* @__PURE__ */
|
|
2829
|
+
}), p.map((e) => /* @__PURE__ */ O("div", {
|
|
2827
2830
|
"data-testid": `resource-row-${e.key}`,
|
|
2828
2831
|
style: {
|
|
2829
2832
|
height: R,
|
|
@@ -2833,7 +2836,7 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2833
2836
|
padding: "0 12px",
|
|
2834
2837
|
borderBottom: "1px solid hsl(var(--border) / 0.5)"
|
|
2835
2838
|
},
|
|
2836
|
-
children: [/* @__PURE__ */
|
|
2839
|
+
children: [/* @__PURE__ */ D("span", {
|
|
2837
2840
|
style: {
|
|
2838
2841
|
fontSize: 13,
|
|
2839
2842
|
fontWeight: 500,
|
|
@@ -2842,7 +2845,7 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2842
2845
|
textOverflow: "ellipsis"
|
|
2843
2846
|
},
|
|
2844
2847
|
children: e.label
|
|
2845
|
-
}), /* @__PURE__ */
|
|
2848
|
+
}), /* @__PURE__ */ O("span", {
|
|
2846
2849
|
"data-testid": `resource-peak-${e.key}`,
|
|
2847
2850
|
"data-overloaded": e.overloadedCount > 0 ? "true" : void 0,
|
|
2848
2851
|
style: {
|
|
@@ -2859,15 +2862,15 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2859
2862
|
]
|
|
2860
2863
|
})]
|
|
2861
2864
|
}, e.key))]
|
|
2862
|
-
}), /* @__PURE__ */
|
|
2865
|
+
}), /* @__PURE__ */ O("div", {
|
|
2863
2866
|
style: { flex: 1 },
|
|
2864
|
-
children: [/* @__PURE__ */
|
|
2867
|
+
children: [/* @__PURE__ */ D("div", {
|
|
2865
2868
|
style: {
|
|
2866
2869
|
display: "flex",
|
|
2867
2870
|
height: 28,
|
|
2868
2871
|
borderBottom: "1px solid hsl(var(--border))"
|
|
2869
2872
|
},
|
|
2870
|
-
children: f.map((e, t) => /* @__PURE__ */
|
|
2873
|
+
children: f.map((e, t) => /* @__PURE__ */ D("div", {
|
|
2871
2874
|
style: {
|
|
2872
2875
|
width: d,
|
|
2873
2876
|
flexShrink: 0,
|
|
@@ -2883,14 +2886,14 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2883
2886
|
}, t))
|
|
2884
2887
|
}), p.map((e) => {
|
|
2885
2888
|
let t = dt * (1 - Math.min(e.capacity / m, 1));
|
|
2886
|
-
return /* @__PURE__ */
|
|
2889
|
+
return /* @__PURE__ */ O("div", {
|
|
2887
2890
|
style: {
|
|
2888
2891
|
position: "relative",
|
|
2889
2892
|
display: "flex",
|
|
2890
2893
|
height: R,
|
|
2891
2894
|
borderBottom: "1px solid hsl(var(--border) / 0.5)"
|
|
2892
2895
|
},
|
|
2893
|
-
children: [/* @__PURE__ */
|
|
2896
|
+
children: [/* @__PURE__ */ D("div", {
|
|
2894
2897
|
"aria-hidden": "true",
|
|
2895
2898
|
style: {
|
|
2896
2899
|
position: "absolute",
|
|
@@ -2903,7 +2906,7 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2903
2906
|
}
|
|
2904
2907
|
}), e.cells.map((t, n) => {
|
|
2905
2908
|
let r = Math.max(t.load > 0 ? 2 : 0, dt * Math.min(t.load / m, 1));
|
|
2906
|
-
return /* @__PURE__ */
|
|
2909
|
+
return /* @__PURE__ */ D("div", {
|
|
2907
2910
|
"data-testid": `resource-cell-${e.key}-${n}`,
|
|
2908
2911
|
"data-load": t.load,
|
|
2909
2912
|
"data-overloaded": t.overloaded ? "true" : void 0,
|
|
@@ -2918,7 +2921,7 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2918
2921
|
justifyContent: "center",
|
|
2919
2922
|
paddingBottom: (R - dt) / 2
|
|
2920
2923
|
},
|
|
2921
|
-
children: t.load > 0 && /* @__PURE__ */
|
|
2924
|
+
children: t.load > 0 && /* @__PURE__ */ D("div", { style: {
|
|
2922
2925
|
width: d - 6,
|
|
2923
2926
|
height: r,
|
|
2924
2927
|
borderRadius: 2,
|
|
@@ -2931,10 +2934,10 @@ function z({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "d
|
|
|
2931
2934
|
})]
|
|
2932
2935
|
})]
|
|
2933
2936
|
})
|
|
2934
|
-
}) : /* @__PURE__ */
|
|
2937
|
+
}) : /* @__PURE__ */ D("div", {
|
|
2935
2938
|
className: s,
|
|
2936
2939
|
"data-testid": "resource-workload",
|
|
2937
|
-
children: /* @__PURE__ */
|
|
2940
|
+
children: /* @__PURE__ */ D("div", {
|
|
2938
2941
|
className: "flex items-center justify-center h-40 text-sm text-muted-foreground",
|
|
2939
2942
|
children: c("gantt.resource.empty")
|
|
2940
2943
|
})
|
|
@@ -2988,7 +2991,7 @@ var mt = {
|
|
|
2988
2991
|
userSelect: "none"
|
|
2989
2992
|
};
|
|
2990
2993
|
function _t({ checked: e }) {
|
|
2991
|
-
return /* @__PURE__ */
|
|
2994
|
+
return /* @__PURE__ */ D("span", {
|
|
2992
2995
|
"aria-hidden": !0,
|
|
2993
2996
|
style: {
|
|
2994
2997
|
display: "inline-flex",
|
|
@@ -3026,11 +3029,11 @@ function vt({ filter: e, selected: t, onChange: r, labels: o }) {
|
|
|
3026
3029
|
}, m = () => {
|
|
3027
3030
|
r(d > 0 ? [] : e.options.map((e) => e.value));
|
|
3028
3031
|
}, h = d === 0 ? e.label : d === 1 ? `${e.label}: ${e.options.find((e) => e.value === t[0])?.label ?? t[0]}` : `${e.label} · ${d}`;
|
|
3029
|
-
return /* @__PURE__ */
|
|
3032
|
+
return /* @__PURE__ */ O("div", {
|
|
3030
3033
|
ref: l,
|
|
3031
3034
|
style: { position: "relative" },
|
|
3032
3035
|
"data-testid": `quick-filter-${e.field}`,
|
|
3033
|
-
children: [/* @__PURE__ */
|
|
3036
|
+
children: [/* @__PURE__ */ O("button", {
|
|
3034
3037
|
type: "button",
|
|
3035
3038
|
style: {
|
|
3036
3039
|
...B,
|
|
@@ -3041,7 +3044,7 @@ function vt({ filter: e, selected: t, onChange: r, labels: o }) {
|
|
|
3041
3044
|
"aria-expanded": s,
|
|
3042
3045
|
"data-testid": `quick-filter-trigger-${e.field}`,
|
|
3043
3046
|
onClick: () => c((e) => !e),
|
|
3044
|
-
children: [/* @__PURE__ */
|
|
3047
|
+
children: [/* @__PURE__ */ D("span", { children: h }), /* @__PURE__ */ D("span", {
|
|
3045
3048
|
"aria-hidden": !0,
|
|
3046
3049
|
style: {
|
|
3047
3050
|
fontSize: 10,
|
|
@@ -3049,19 +3052,19 @@ function vt({ filter: e, selected: t, onChange: r, labels: o }) {
|
|
|
3049
3052
|
},
|
|
3050
3053
|
children: "▾"
|
|
3051
3054
|
})]
|
|
3052
|
-
}), s && /* @__PURE__ */
|
|
3055
|
+
}), s && /* @__PURE__ */ D("div", {
|
|
3053
3056
|
role: "listbox",
|
|
3054
3057
|
style: ht,
|
|
3055
3058
|
"data-testid": `quick-filter-panel-${e.field}`,
|
|
3056
|
-
children: e.options.length === 0 ? /* @__PURE__ */
|
|
3059
|
+
children: e.options.length === 0 ? /* @__PURE__ */ D("div", {
|
|
3057
3060
|
style: {
|
|
3058
3061
|
...gt,
|
|
3059
3062
|
cursor: "default",
|
|
3060
3063
|
opacity: .6
|
|
3061
3064
|
},
|
|
3062
3065
|
children: o.empty
|
|
3063
|
-
}) : /* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3066
|
+
}) : /* @__PURE__ */ O(Oe, { children: [
|
|
3067
|
+
/* @__PURE__ */ O("div", {
|
|
3065
3068
|
role: "option",
|
|
3066
3069
|
"aria-selected": f,
|
|
3067
3070
|
style: {
|
|
@@ -3070,16 +3073,16 @@ function vt({ filter: e, selected: t, onChange: r, labels: o }) {
|
|
|
3070
3073
|
},
|
|
3071
3074
|
"data-testid": `quick-filter-all-${e.field}`,
|
|
3072
3075
|
onClick: () => m(),
|
|
3073
|
-
children: [/* @__PURE__ */
|
|
3076
|
+
children: [/* @__PURE__ */ D(_t, { checked: f }), /* @__PURE__ */ D("span", { children: o.all })]
|
|
3074
3077
|
}),
|
|
3075
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ D("div", { style: {
|
|
3076
3079
|
height: 1,
|
|
3077
3080
|
background: "hsl(var(--border))",
|
|
3078
3081
|
margin: "2px 0"
|
|
3079
3082
|
} }),
|
|
3080
3083
|
e.options.map((t) => {
|
|
3081
3084
|
let n = u.has(t.value);
|
|
3082
|
-
return /* @__PURE__ */
|
|
3085
|
+
return /* @__PURE__ */ O("div", {
|
|
3083
3086
|
role: "option",
|
|
3084
3087
|
"aria-selected": n,
|
|
3085
3088
|
style: {
|
|
@@ -3088,7 +3091,7 @@ function vt({ filter: e, selected: t, onChange: r, labels: o }) {
|
|
|
3088
3091
|
},
|
|
3089
3092
|
"data-testid": `quick-filter-option-${e.field}-${t.value}`,
|
|
3090
3093
|
onClick: () => p(t.value),
|
|
3091
|
-
children: [/* @__PURE__ */
|
|
3094
|
+
children: [/* @__PURE__ */ D(_t, { checked: n }), /* @__PURE__ */ D("span", { children: t.label })]
|
|
3092
3095
|
}, t.value);
|
|
3093
3096
|
})
|
|
3094
3097
|
] })
|
|
@@ -3098,12 +3101,12 @@ function vt({ filter: e, selected: t, onChange: r, labels: o }) {
|
|
|
3098
3101
|
var yt = ({ filters: e, value: t, onChange: n, onClear: r, resultCount: i, totalCount: a, labels: o, className: s }) => {
|
|
3099
3102
|
if (!e.length) return null;
|
|
3100
3103
|
let c = o?.all ?? "All", l = o?.empty ?? "No options", u = o?.clear ?? "Clear", d = e.some((e) => (t[e.field]?.length ?? 0) > 0);
|
|
3101
|
-
return /* @__PURE__ */
|
|
3104
|
+
return /* @__PURE__ */ O("div", {
|
|
3102
3105
|
style: mt,
|
|
3103
3106
|
className: s,
|
|
3104
3107
|
"data-testid": "quick-filter-bar",
|
|
3105
3108
|
children: [
|
|
3106
|
-
e.map((e) => /* @__PURE__ */
|
|
3109
|
+
e.map((e) => /* @__PURE__ */ D(vt, {
|
|
3107
3110
|
filter: e,
|
|
3108
3111
|
selected: t[e.field] ?? [],
|
|
3109
3112
|
onChange: (t) => n(e.field, t),
|
|
@@ -3112,7 +3115,7 @@ var yt = ({ filters: e, value: t, onChange: n, onClear: r, resultCount: i, total
|
|
|
3112
3115
|
empty: l
|
|
3113
3116
|
}
|
|
3114
3117
|
}, e.field)),
|
|
3115
|
-
d && /* @__PURE__ */
|
|
3118
|
+
d && /* @__PURE__ */ D("button", {
|
|
3116
3119
|
type: "button",
|
|
3117
3120
|
style: {
|
|
3118
3121
|
...B,
|
|
@@ -3123,7 +3126,7 @@ var yt = ({ filters: e, value: t, onChange: n, onClear: r, resultCount: i, total
|
|
|
3123
3126
|
onClick: r,
|
|
3124
3127
|
children: u
|
|
3125
3128
|
}),
|
|
3126
|
-
o?.resultSummary && i != null && a != null && /* @__PURE__ */
|
|
3129
|
+
o?.resultSummary && i != null && a != null && /* @__PURE__ */ D("span", {
|
|
3127
3130
|
"data-testid": "quick-filter-summary",
|
|
3128
3131
|
style: {
|
|
3129
3132
|
marginLeft: "auto",
|
|
@@ -3224,46 +3227,47 @@ function wt(e) {
|
|
|
3224
3227
|
return null;
|
|
3225
3228
|
}
|
|
3226
3229
|
var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick: f, ...p }) => {
|
|
3227
|
-
let [
|
|
3230
|
+
let [b, x] = a([]), [oe, pe] = a(!0), [me, he] = a(null), [w, ge] = a(null), { currency: _e } = h(), ve = V(e), T = r(() => ve, [JSON.stringify(ve)]), E = wt(e), ye = T?.provider === "value";
|
|
3228
3231
|
n(() => {
|
|
3229
3232
|
(async () => {
|
|
3230
3233
|
try {
|
|
3231
|
-
if (
|
|
3232
|
-
|
|
3234
|
+
if (pe(!0), p.data && Array.isArray(p.data)) {
|
|
3235
|
+
x(p.data), pe(!1);
|
|
3233
3236
|
return;
|
|
3234
3237
|
}
|
|
3235
|
-
if (
|
|
3236
|
-
|
|
3238
|
+
if (ye && T?.provider === "value") {
|
|
3239
|
+
x(T.items), pe(!1);
|
|
3237
3240
|
return;
|
|
3238
3241
|
}
|
|
3239
3242
|
if (!i || typeof i.find != "function") throw Error("DataSource required for object/api providers");
|
|
3240
|
-
if (
|
|
3241
|
-
let t =
|
|
3242
|
-
b(c(await i.find(t, {
|
|
3243
|
+
if (T?.provider === "object") {
|
|
3244
|
+
let t = T.object, n = s(w?.fields), r = c(await i.find(t, {
|
|
3243
3245
|
$filter: e.filter,
|
|
3244
3246
|
$orderby: Ct(e.sort),
|
|
3245
3247
|
...n.length > 0 ? { $expand: n } : {}
|
|
3246
|
-
}))
|
|
3247
|
-
|
|
3248
|
-
|
|
3248
|
+
}));
|
|
3249
|
+
x(r);
|
|
3250
|
+
} else T?.provider === "api" && (console.warn("API provider not yet implemented for ObjectGantt"), x([]));
|
|
3251
|
+
pe(!1);
|
|
3249
3252
|
} catch (e) {
|
|
3250
|
-
|
|
3253
|
+
he(e), pe(!1);
|
|
3251
3254
|
}
|
|
3252
3255
|
})();
|
|
3253
3256
|
}, [
|
|
3254
|
-
|
|
3257
|
+
T,
|
|
3255
3258
|
i,
|
|
3256
|
-
|
|
3259
|
+
ye,
|
|
3257
3260
|
e.filter,
|
|
3258
3261
|
e.sort,
|
|
3259
|
-
|
|
3262
|
+
w
|
|
3260
3263
|
]), n(() => {
|
|
3261
|
-
!
|
|
3264
|
+
!ye && i && (async () => {
|
|
3262
3265
|
try {
|
|
3263
3266
|
if (!i) return;
|
|
3264
|
-
let t =
|
|
3267
|
+
let t = T?.provider === "object" ? T.object : e.objectName;
|
|
3265
3268
|
if (!t) return;
|
|
3266
|
-
|
|
3269
|
+
let n = await i.getObjectSchema(t);
|
|
3270
|
+
ge(n);
|
|
3267
3271
|
} catch (e) {
|
|
3268
3272
|
console.error("Failed to fetch object schema:", e);
|
|
3269
3273
|
}
|
|
@@ -3271,12 +3275,12 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3271
3275
|
}, [
|
|
3272
3276
|
e.objectName,
|
|
3273
3277
|
i,
|
|
3274
|
-
|
|
3275
|
-
|
|
3278
|
+
ye,
|
|
3279
|
+
T
|
|
3276
3280
|
]);
|
|
3277
|
-
let
|
|
3278
|
-
if (!
|
|
3279
|
-
let { startDateField: e, endDateField: t, titleField: n, progressField: r, dependenciesField: i, colorField: a, parentField: o, typeField: s, lockField: c, tooltipFields: u, baselineStartField: d, baselineEndField: f } =
|
|
3281
|
+
let be = r(() => {
|
|
3282
|
+
if (!E || !b.length) return [];
|
|
3283
|
+
let { startDateField: e, endDateField: t, titleField: n, progressField: r, dependenciesField: i, colorField: a, parentField: o, typeField: s, lockField: c, tooltipFields: u, baselineStartField: d, baselineEndField: f } = E, p = w?.fields ?? {}, h = (e, t) => {
|
|
3280
3284
|
if (!t) return;
|
|
3281
3285
|
let n = t.split("."), r = e;
|
|
3282
3286
|
for (let e of n) {
|
|
@@ -3292,12 +3296,12 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3292
3296
|
e?.contact && [e.contact.first_name, e.contact.last_name].filter(Boolean).join(" ")
|
|
3293
3297
|
];
|
|
3294
3298
|
for (let e of t) if (e != null && String(e).trim() !== "") return String(e);
|
|
3295
|
-
return l(
|
|
3296
|
-
},
|
|
3299
|
+
return l(w, e);
|
|
3300
|
+
}, _ = (e, t) => {
|
|
3297
3301
|
if (t) return t;
|
|
3298
3302
|
let n = p[e] ?? p[e.split(".")[0]];
|
|
3299
|
-
return n?.label ? n.label :
|
|
3300
|
-
},
|
|
3303
|
+
return n?.label ? n.label : fe(e);
|
|
3304
|
+
}, v = (e, t) => {
|
|
3301
3305
|
if (e == null || e === "") return "—";
|
|
3302
3306
|
let n = p[t] ?? p[t.split(".")[0]], r = n?.type, i = n?.options;
|
|
3303
3307
|
if (Array.isArray(i) && i.length) {
|
|
@@ -3305,14 +3309,14 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3305
3309
|
if (t) return t.label;
|
|
3306
3310
|
}
|
|
3307
3311
|
switch (r) {
|
|
3308
|
-
case "date": return
|
|
3309
|
-
case "datetime": return
|
|
3312
|
+
case "date": return ce(e);
|
|
3313
|
+
case "datetime": return S(e);
|
|
3310
3314
|
case "number":
|
|
3311
3315
|
case "integer":
|
|
3312
3316
|
case "float":
|
|
3313
|
-
case "decimal": return
|
|
3314
|
-
case "currency": return
|
|
3315
|
-
case "percent": return
|
|
3317
|
+
case "decimal": return le(Number(e));
|
|
3318
|
+
case "currency": return se(Number(e), m(n, _e));
|
|
3319
|
+
case "percent": return C(Number(e));
|
|
3316
3320
|
case "boolean":
|
|
3317
3321
|
case "checkbox": return e ? "Yes" : "No";
|
|
3318
3322
|
default:
|
|
@@ -3333,7 +3337,7 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3333
3337
|
}
|
|
3334
3338
|
return String(e);
|
|
3335
3339
|
}
|
|
3336
|
-
},
|
|
3340
|
+
}, y = (e) => {
|
|
3337
3341
|
if (!u || !u.length) return;
|
|
3338
3342
|
let t = [];
|
|
3339
3343
|
for (let n of u) {
|
|
@@ -3341,46 +3345,46 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3341
3345
|
if (!r) continue;
|
|
3342
3346
|
let i = typeof n == "object" ? n.label : void 0;
|
|
3343
3347
|
t.push({
|
|
3344
|
-
label:
|
|
3345
|
-
value:
|
|
3348
|
+
label: _(r, i),
|
|
3349
|
+
value: v(h(e, r), r)
|
|
3346
3350
|
});
|
|
3347
3351
|
}
|
|
3348
3352
|
return t.length ? t : void 0;
|
|
3349
3353
|
};
|
|
3350
|
-
return
|
|
3351
|
-
let u = n[e], p = n[t], m = d ? n[d] : void 0, h = f ? n[f] : void 0,
|
|
3352
|
-
if (!
|
|
3354
|
+
return b.map((n, l) => {
|
|
3355
|
+
let u = n[e], p = n[t], m = d ? n[d] : void 0, h = f ? n[f] : void 0, _ = m ? new Date(m) : void 0, v = h ? new Date(h) : void 0, ee = g(n), te = r ? n[r] : 0, ne = i ? n[i] : [], re = a ? n[a] : void 0;
|
|
3356
|
+
if (!re) {
|
|
3353
3357
|
let e = n.status ?? n.state ?? n.priority ?? n.severity;
|
|
3354
3358
|
if (e != null && e !== "") {
|
|
3355
|
-
let t =
|
|
3356
|
-
t && (
|
|
3359
|
+
let t = ue(void 0, e);
|
|
3360
|
+
t && (re = de(t));
|
|
3357
3361
|
}
|
|
3358
3362
|
}
|
|
3359
3363
|
return {
|
|
3360
3364
|
id: n.id || n._id || `task-${l}`,
|
|
3361
|
-
title:
|
|
3365
|
+
title: ee,
|
|
3362
3366
|
start: u ? new Date(u) : /* @__PURE__ */ new Date(),
|
|
3363
3367
|
end: p ? new Date(p) : /* @__PURE__ */ new Date(),
|
|
3364
|
-
progress: Math.min(100, Math.max(0,
|
|
3365
|
-
dependencies: St(
|
|
3368
|
+
progress: Math.min(100, Math.max(0, te || 0)),
|
|
3369
|
+
dependencies: St(ne),
|
|
3366
3370
|
parent: o ? n[o] ?? null : void 0,
|
|
3367
3371
|
type: s ? bt(n[s]) : void 0,
|
|
3368
3372
|
locked: c ? !!n[c] : void 0,
|
|
3369
|
-
color:
|
|
3370
|
-
baselineStart:
|
|
3371
|
-
baselineEnd:
|
|
3372
|
-
fields:
|
|
3373
|
+
color: re,
|
|
3374
|
+
baselineStart: _ && !isNaN(_.getTime()) ? _ : void 0,
|
|
3375
|
+
baselineEnd: v && !isNaN(v.getTime()) ? v : void 0,
|
|
3376
|
+
fields: y(n),
|
|
3373
3377
|
data: n
|
|
3374
3378
|
};
|
|
3375
3379
|
}).filter((e) => !isNaN(e.start.getTime()) && !isNaN(e.end.getTime()));
|
|
3376
3380
|
}, [
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
]),
|
|
3381
|
-
let e =
|
|
3381
|
+
b,
|
|
3382
|
+
E,
|
|
3383
|
+
w
|
|
3384
|
+
]), xe = r(() => {
|
|
3385
|
+
let e = E?.groupByField;
|
|
3382
3386
|
if (!e) return;
|
|
3383
|
-
let t =
|
|
3387
|
+
let t = w?.fields ?? {}, n = (e, t) => {
|
|
3384
3388
|
if (!t) return;
|
|
3385
3389
|
let n = e;
|
|
3386
3390
|
for (let e of t.split(".")) {
|
|
@@ -3407,10 +3411,10 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3407
3411
|
label: r(i)
|
|
3408
3412
|
};
|
|
3409
3413
|
};
|
|
3410
|
-
}, [
|
|
3411
|
-
let e =
|
|
3414
|
+
}, [E?.groupByField, w]), Se = r(() => {
|
|
3415
|
+
let e = E?.assigneeField;
|
|
3412
3416
|
if (!e) return;
|
|
3413
|
-
let t =
|
|
3417
|
+
let t = w?.fields ?? {}, n = (e, t) => {
|
|
3414
3418
|
if (!t) return;
|
|
3415
3419
|
let n = e;
|
|
3416
3420
|
for (let e of t.split(".")) {
|
|
@@ -3437,19 +3441,19 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3437
3441
|
label: r(i)
|
|
3438
3442
|
};
|
|
3439
3443
|
};
|
|
3440
|
-
}, [
|
|
3441
|
-
let e =
|
|
3444
|
+
}, [E?.assigneeField, w]), Ce = r(() => {
|
|
3445
|
+
let e = E?.effortField;
|
|
3442
3446
|
if (e) return (t) => {
|
|
3443
3447
|
let n = t.data?.[e], r = Number(n);
|
|
3444
3448
|
return Number.isFinite(r) && r > 0 ? r : 1;
|
|
3445
3449
|
};
|
|
3446
|
-
}, [
|
|
3450
|
+
}, [E?.effortField]), we = r(() => {
|
|
3447
3451
|
let t = e.skipWeekends, n = e.holidays;
|
|
3448
3452
|
if (!(!t && (!n || n.length === 0))) return {
|
|
3449
3453
|
skipWeekends: !!t,
|
|
3450
3454
|
holidays: n && n.length ? new Set(n) : void 0
|
|
3451
3455
|
};
|
|
3452
|
-
}, [e]),
|
|
3456
|
+
}, [e]), Te = r(() => Be(E?.timeSegments), [E?.timeSegments]), Ee = t((e, t) => {
|
|
3453
3457
|
if (!e || !t) return null;
|
|
3454
3458
|
let n = e;
|
|
3455
3459
|
for (let e of t.split(".")) {
|
|
@@ -3462,13 +3466,13 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3462
3466
|
return String(e.id ?? e._id ?? e.value ?? e.name ?? "");
|
|
3463
3467
|
}
|
|
3464
3468
|
return String(n);
|
|
3465
|
-
}, []),
|
|
3469
|
+
}, []), De = E?.quickFilters, [ke, Ae] = a({});
|
|
3466
3470
|
n(() => {
|
|
3467
|
-
if (!
|
|
3468
|
-
let e =
|
|
3471
|
+
if (!De?.length || !i || typeof i.find != "function") return;
|
|
3472
|
+
let e = w?.fields ?? {}, t = !1;
|
|
3469
3473
|
return (async () => {
|
|
3470
3474
|
let n = {};
|
|
3471
|
-
for (let t of
|
|
3475
|
+
for (let t of De) {
|
|
3472
3476
|
if (t.options) continue;
|
|
3473
3477
|
let r = e[t.field] ?? e[t.field.split(".")[0]], a = r?.type;
|
|
3474
3478
|
if (a !== "lookup" && a !== "master_detail") continue;
|
|
@@ -3483,7 +3487,7 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3483
3487
|
console.warn(`[ObjectGantt] Failed to load quick-filter options for "${t.field}":`, e);
|
|
3484
3488
|
}
|
|
3485
3489
|
}
|
|
3486
|
-
t ||
|
|
3490
|
+
t || Ae((e) => ({
|
|
3487
3491
|
...e,
|
|
3488
3492
|
...n
|
|
3489
3493
|
}));
|
|
@@ -3491,15 +3495,15 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3491
3495
|
t = !0;
|
|
3492
3496
|
};
|
|
3493
3497
|
}, [
|
|
3494
|
-
JSON.stringify(
|
|
3498
|
+
JSON.stringify(De),
|
|
3495
3499
|
i,
|
|
3496
|
-
|
|
3500
|
+
w
|
|
3497
3501
|
]);
|
|
3498
|
-
let
|
|
3499
|
-
if (!
|
|
3500
|
-
let e =
|
|
3501
|
-
return
|
|
3502
|
-
let n = e[t.field] ?? e[t.field.split(".")[0]], r = t.label ?? n?.label ??
|
|
3502
|
+
let je = r(() => {
|
|
3503
|
+
if (!De?.length) return [];
|
|
3504
|
+
let e = w?.fields ?? {};
|
|
3505
|
+
return De.map((t) => {
|
|
3506
|
+
let n = e[t.field] ?? e[t.field.split(".")[0]], r = t.label ?? n?.label ?? fe(t.field), i = [];
|
|
3503
3507
|
if (t.options?.length) i = t.options.map((e) => typeof e == "object" ? {
|
|
3504
3508
|
value: String(e.value),
|
|
3505
3509
|
label: String(e.label ?? e.value)
|
|
@@ -3511,11 +3515,11 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3511
3515
|
value: String(e.value ?? e),
|
|
3512
3516
|
label: String(e.label ?? e.value ?? e)
|
|
3513
3517
|
}));
|
|
3514
|
-
else if (
|
|
3518
|
+
else if (ke[t.field]?.length) i = ke[t.field];
|
|
3515
3519
|
else {
|
|
3516
3520
|
let e = /* @__PURE__ */ new Map();
|
|
3517
|
-
for (let n of
|
|
3518
|
-
let r =
|
|
3521
|
+
for (let n of b) {
|
|
3522
|
+
let r = Ee(n, t.field);
|
|
3519
3523
|
if (r != null && !e.has(r)) {
|
|
3520
3524
|
let i = n;
|
|
3521
3525
|
for (let e of t.field.split(".")) i = i?.[e];
|
|
@@ -3535,11 +3539,11 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3535
3539
|
};
|
|
3536
3540
|
});
|
|
3537
3541
|
}, [
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3542
|
+
De,
|
|
3543
|
+
w,
|
|
3544
|
+
ke,
|
|
3545
|
+
b,
|
|
3546
|
+
Ee
|
|
3543
3547
|
]), [k, A] = a({}), Me = t((e, t) => {
|
|
3544
3548
|
A((n) => ({
|
|
3545
3549
|
...n,
|
|
@@ -3547,23 +3551,23 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3547
3551
|
}));
|
|
3548
3552
|
}, []), j = t(() => A({}), []), Ne = r(() => {
|
|
3549
3553
|
let e = Object.entries(k).filter(([, e]) => e.length > 0);
|
|
3550
|
-
return e.length ?
|
|
3551
|
-
let r =
|
|
3554
|
+
return e.length ? be.filter((t) => e.every(([e, n]) => {
|
|
3555
|
+
let r = Ee(t.data, e);
|
|
3552
3556
|
return r != null && n.includes(r);
|
|
3553
|
-
})) :
|
|
3557
|
+
})) : be;
|
|
3554
3558
|
}, [
|
|
3555
|
-
|
|
3559
|
+
be,
|
|
3556
3560
|
k,
|
|
3557
|
-
|
|
3561
|
+
Ee
|
|
3558
3562
|
]), M = r(() => {
|
|
3559
|
-
if (
|
|
3560
|
-
let e =
|
|
3561
|
-
for (let n of
|
|
3563
|
+
if (E?.autoZoomToFilter !== !1 || !be.length) return null;
|
|
3564
|
+
let e = be[0].start.getTime(), t = be[0].end.getTime();
|
|
3565
|
+
for (let n of be) e = Math.min(e, n.start.getTime()), t = Math.max(t, n.end.getTime());
|
|
3562
3566
|
return {
|
|
3563
3567
|
start: new Date(e),
|
|
3564
3568
|
end: new Date(t)
|
|
3565
3569
|
};
|
|
3566
|
-
}, [
|
|
3570
|
+
}, [be, E?.autoZoomToFilter]), Pe = e.navigation ?? {
|
|
3567
3571
|
mode: "drawer",
|
|
3568
3572
|
width: "min(960px, 60vw)"
|
|
3569
3573
|
}, Fe = Pe.mode === "drawer" || Pe.mode === "modal" || Pe.mode === "split" || Pe.mode === "popover", N = u({
|
|
@@ -3571,29 +3575,29 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3571
3575
|
objectName: e.objectName,
|
|
3572
3576
|
onRowClick: Fe ? void 0 : f
|
|
3573
3577
|
}), P = t(async (t, n) => {
|
|
3574
|
-
if (!
|
|
3575
|
-
let r =
|
|
3578
|
+
if (!E) return;
|
|
3579
|
+
let r = T?.provider === "object" ? T.object : e.objectName;
|
|
3576
3580
|
if (!r || !i || typeof i.update != "function") return;
|
|
3577
|
-
let { startDateField: a, endDateField: o, titleField: s, progressField: c } =
|
|
3581
|
+
let { startDateField: a, endDateField: o, titleField: s, progressField: c } = E, l = {};
|
|
3578
3582
|
if (n.start instanceof Date && (l[a] = n.start.toISOString()), n.end instanceof Date && (l[o] = n.end.toISOString()), typeof n.title == "string" && s && (l[s] = n.title), typeof n.progress == "number" && c && (l[c] = n.progress), Object.keys(l).length === 0) return;
|
|
3579
3583
|
let u = t.data?.id ?? t.data?._id ?? t.id;
|
|
3580
3584
|
if (u == null) return;
|
|
3581
|
-
let d =
|
|
3582
|
-
|
|
3585
|
+
let d = b;
|
|
3586
|
+
x((e) => e.map((e) => String(e.id ?? e._id) === String(u) ? {
|
|
3583
3587
|
...e,
|
|
3584
3588
|
...l
|
|
3585
3589
|
} : e));
|
|
3586
3590
|
try {
|
|
3587
3591
|
await i.update(r, String(u), l);
|
|
3588
3592
|
} catch (e) {
|
|
3589
|
-
console.error("[ObjectGantt] Failed to persist task update:", e),
|
|
3593
|
+
console.error("[ObjectGantt] Failed to persist task update:", e), x(d);
|
|
3590
3594
|
}
|
|
3591
3595
|
}, [
|
|
3596
|
+
E,
|
|
3592
3597
|
T,
|
|
3593
|
-
w,
|
|
3594
3598
|
i,
|
|
3595
3599
|
e.objectName,
|
|
3596
|
-
|
|
3600
|
+
b
|
|
3597
3601
|
]), Ie = (e, t) => {
|
|
3598
3602
|
let n = t.some((e) => typeof e == "object" && e.type && e.type !== "fs");
|
|
3599
3603
|
return !n && typeof e == "string" ? t.map((e) => String(typeof e == "object" ? e.id : e)).join(",") : n ? t.map((e) => typeof e == "object" ? e.type && e.type !== "fs" ? {
|
|
@@ -3601,112 +3605,112 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3601
3605
|
type: e.type
|
|
3602
3606
|
} : e.id : e) : t.map((e) => typeof e == "object" ? e.id : e);
|
|
3603
3607
|
}, Le = t(async (t, n, r) => {
|
|
3604
|
-
let a =
|
|
3608
|
+
let a = E?.dependenciesField;
|
|
3605
3609
|
if (!a) return;
|
|
3606
|
-
let o =
|
|
3610
|
+
let o = T?.provider === "object" ? T.object : e.objectName;
|
|
3607
3611
|
if (!o || !i || typeof i.update != "function") return;
|
|
3608
|
-
let s = Ie(n, r), c =
|
|
3609
|
-
|
|
3612
|
+
let s = Ie(n, r), c = b;
|
|
3613
|
+
x((e) => e.map((e) => String(e.id ?? e._id) === String(t) ? {
|
|
3610
3614
|
...e,
|
|
3611
3615
|
[a]: s
|
|
3612
3616
|
} : e));
|
|
3613
3617
|
try {
|
|
3614
3618
|
await i.update(o, String(t), { [a]: s });
|
|
3615
3619
|
} catch (e) {
|
|
3616
|
-
console.error("[ObjectGantt] Failed to persist dependency:", e),
|
|
3620
|
+
console.error("[ObjectGantt] Failed to persist dependency:", e), x(c);
|
|
3617
3621
|
}
|
|
3618
3622
|
}, [
|
|
3623
|
+
E,
|
|
3619
3624
|
T,
|
|
3620
|
-
w,
|
|
3621
3625
|
i,
|
|
3622
3626
|
e.objectName,
|
|
3623
|
-
|
|
3627
|
+
b
|
|
3624
3628
|
]), Re = t(async (e, t, n = "fs") => {
|
|
3625
3629
|
let r = e.data?.id ?? e.data?._id ?? e.id, i = t.data?.id ?? t.data?._id ?? t.id;
|
|
3626
3630
|
if (r == null || i == null) return;
|
|
3627
|
-
let a =
|
|
3631
|
+
let a = E?.dependenciesField;
|
|
3628
3632
|
if (!a) return;
|
|
3629
|
-
let o =
|
|
3633
|
+
let o = b.find((e) => String(e.id ?? e._id) === String(i))?.[a], s = St(o), c = (e) => String(typeof e == "object" ? e.id : e), l = s.find((e) => c(e) === String(r)), u = l && typeof l == "object" ? l.type ?? "fs" : "fs";
|
|
3630
3634
|
if (l && u === n) return;
|
|
3631
3635
|
let d = n === "fs" ? r : {
|
|
3632
3636
|
id: r,
|
|
3633
3637
|
type: n
|
|
3634
|
-
};
|
|
3635
|
-
await Le(i, o,
|
|
3638
|
+
}, f = l ? s.map((e) => c(e) === String(r) ? d : e) : [...s, d];
|
|
3639
|
+
await Le(i, o, f);
|
|
3636
3640
|
}, [
|
|
3637
|
-
|
|
3638
|
-
|
|
3641
|
+
E,
|
|
3642
|
+
b,
|
|
3639
3643
|
Le
|
|
3640
3644
|
]), ze = t(async (e, t) => {
|
|
3641
3645
|
let n = e.data?.id ?? e.data?._id ?? e.id, r = t.data?.id ?? t.data?._id ?? t.id;
|
|
3642
3646
|
if (n == null || r == null) return;
|
|
3643
|
-
let i =
|
|
3647
|
+
let i = E?.dependenciesField;
|
|
3644
3648
|
if (!i) return;
|
|
3645
|
-
let a =
|
|
3649
|
+
let a = b.find((e) => String(e.id ?? e._id) === String(r))?.[i], o = St(a), s = (e) => String(typeof e == "object" ? e.id : e), c = o.filter((e) => s(e) !== String(n));
|
|
3646
3650
|
c.length !== o.length && await Le(r, a, c);
|
|
3647
3651
|
}, [
|
|
3648
|
-
|
|
3649
|
-
|
|
3652
|
+
E,
|
|
3653
|
+
b,
|
|
3650
3654
|
Le
|
|
3651
|
-
]), [F,
|
|
3652
|
-
|
|
3655
|
+
]), [F, I] = a(null), [Ve, He] = a(!1), Ue = t((e) => {
|
|
3656
|
+
I(e);
|
|
3653
3657
|
}, []), We = t(async () => {
|
|
3654
3658
|
if (!F) return;
|
|
3655
|
-
let t =
|
|
3659
|
+
let t = T?.provider === "object" ? T.object : e.objectName;
|
|
3656
3660
|
if (!t || !i?.delete) {
|
|
3657
|
-
|
|
3661
|
+
I(null);
|
|
3658
3662
|
return;
|
|
3659
3663
|
}
|
|
3660
3664
|
let n = F.data?.id ?? F.data?._id ?? F.id;
|
|
3661
3665
|
if (n == null) {
|
|
3662
|
-
|
|
3666
|
+
I(null);
|
|
3663
3667
|
return;
|
|
3664
3668
|
}
|
|
3665
3669
|
He(!0);
|
|
3666
|
-
let r =
|
|
3667
|
-
|
|
3670
|
+
let r = b;
|
|
3671
|
+
x((e) => e.filter((e) => String(e.id ?? e._id) !== String(n)));
|
|
3668
3672
|
try {
|
|
3669
|
-
await i.delete(t, String(n)),
|
|
3673
|
+
await i.delete(t, String(n)), I(null);
|
|
3670
3674
|
} catch (e) {
|
|
3671
|
-
console.error("[ObjectGantt] Failed to delete:", e),
|
|
3675
|
+
console.error("[ObjectGantt] Failed to delete:", e), x(r), I(null);
|
|
3672
3676
|
} finally {
|
|
3673
3677
|
He(!1);
|
|
3674
3678
|
}
|
|
3675
3679
|
}, [
|
|
3676
3680
|
F,
|
|
3677
|
-
|
|
3681
|
+
T,
|
|
3678
3682
|
i,
|
|
3679
3683
|
e.objectName,
|
|
3680
|
-
|
|
3684
|
+
b
|
|
3681
3685
|
]);
|
|
3682
|
-
return
|
|
3686
|
+
return oe ? /* @__PURE__ */ D("div", {
|
|
3683
3687
|
className: o,
|
|
3684
|
-
children: /* @__PURE__ */
|
|
3688
|
+
children: /* @__PURE__ */ D("div", {
|
|
3685
3689
|
className: "flex items-center justify-center h-96",
|
|
3686
|
-
children: /* @__PURE__ */
|
|
3690
|
+
children: /* @__PURE__ */ D("div", {
|
|
3687
3691
|
className: "text-muted-foreground",
|
|
3688
3692
|
children: "Loading Gantt chart..."
|
|
3689
3693
|
})
|
|
3690
3694
|
})
|
|
3691
|
-
}) :
|
|
3695
|
+
}) : me ? /* @__PURE__ */ D("div", {
|
|
3692
3696
|
className: o,
|
|
3693
|
-
children: /* @__PURE__ */
|
|
3697
|
+
children: /* @__PURE__ */ D("div", {
|
|
3694
3698
|
className: "flex items-center justify-center h-96",
|
|
3695
|
-
children: /* @__PURE__ */
|
|
3699
|
+
children: /* @__PURE__ */ O("div", {
|
|
3696
3700
|
className: "text-destructive",
|
|
3697
|
-
children: ["Error: ",
|
|
3701
|
+
children: ["Error: ", me.message]
|
|
3698
3702
|
})
|
|
3699
3703
|
})
|
|
3700
|
-
}) :
|
|
3704
|
+
}) : E ? /* @__PURE__ */ O("div", {
|
|
3701
3705
|
className: o,
|
|
3702
3706
|
children: [
|
|
3703
|
-
|
|
3704
|
-
filters:
|
|
3707
|
+
je.length > 0 && /* @__PURE__ */ D(yt, {
|
|
3708
|
+
filters: je,
|
|
3705
3709
|
value: k,
|
|
3706
3710
|
onChange: Me,
|
|
3707
3711
|
onClear: j,
|
|
3708
3712
|
resultCount: Ne.length,
|
|
3709
|
-
totalCount:
|
|
3713
|
+
totalCount: be.length,
|
|
3710
3714
|
labels: {
|
|
3711
3715
|
all: "全部",
|
|
3712
3716
|
clear: "清除筛选",
|
|
@@ -3714,15 +3718,15 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3714
3718
|
resultSummary: (e, t) => `显示 ${e} / ${t} 项任务`
|
|
3715
3719
|
}
|
|
3716
3720
|
}),
|
|
3717
|
-
/* @__PURE__ */
|
|
3721
|
+
/* @__PURE__ */ D("div", {
|
|
3718
3722
|
className: "h-[calc(100vh-200px)] min-h-[600px]",
|
|
3719
|
-
children:
|
|
3723
|
+
children: E?.resourceView && Se ? /* @__PURE__ */ D(z, {
|
|
3720
3724
|
tasks: Ne,
|
|
3721
|
-
assignee:
|
|
3722
|
-
effort:
|
|
3723
|
-
capacity:
|
|
3725
|
+
assignee: Se,
|
|
3726
|
+
effort: Ce,
|
|
3727
|
+
capacity: E?.capacity ?? 1,
|
|
3724
3728
|
viewMode: e.viewMode || "day"
|
|
3725
|
-
}) : /* @__PURE__ */
|
|
3729
|
+
}) : /* @__PURE__ */ D(st, {
|
|
3726
3730
|
tasks: Ne,
|
|
3727
3731
|
startDate: M?.start,
|
|
3728
3732
|
endDate: M?.end,
|
|
@@ -3731,28 +3735,28 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3731
3735
|
},
|
|
3732
3736
|
onTaskUpdate: P,
|
|
3733
3737
|
onTaskDelete: Ue,
|
|
3734
|
-
onDependencyCreate:
|
|
3735
|
-
onDependencyDelete:
|
|
3738
|
+
onDependencyCreate: E?.dependenciesField ? Re : void 0,
|
|
3739
|
+
onDependencyDelete: E?.dependenciesField ? ze : void 0,
|
|
3736
3740
|
markers: e.markers,
|
|
3737
|
-
autoSchedule: !!
|
|
3738
|
-
rescheduleOnConflict: !!
|
|
3741
|
+
autoSchedule: !!E?.dependenciesField,
|
|
3742
|
+
rescheduleOnConflict: !!E?.dependenciesField,
|
|
3739
3743
|
criticalPathDefault: !!e.criticalPath,
|
|
3740
|
-
workingCalendar:
|
|
3741
|
-
shiftSegments:
|
|
3744
|
+
workingCalendar: we,
|
|
3745
|
+
shiftSegments: Te,
|
|
3742
3746
|
showBaselines: e.showBaselines !== !1,
|
|
3743
3747
|
readOnly: !!e.readOnly,
|
|
3744
3748
|
mobileReadOnly: e.mobileReadOnly !== !1,
|
|
3745
|
-
persistLayoutKey: e.persistLayout === !1 ? void 0 : `${e.objectName || (
|
|
3746
|
-
groupBy:
|
|
3747
|
-
defaultCollapsedDepth:
|
|
3749
|
+
persistLayoutKey: e.persistLayout === !1 ? void 0 : `${e.objectName || (T?.provider === "object" ? T.object : "") || "gantt"}:${e.viewName || "default"}`,
|
|
3750
|
+
groupBy: xe,
|
|
3751
|
+
defaultCollapsedDepth: E?.defaultCollapsedDepth,
|
|
3748
3752
|
inlineEdit: !0
|
|
3749
3753
|
})
|
|
3750
3754
|
}),
|
|
3751
3755
|
N.isOverlay && N.isOpen && N.selectedRecord && (() => {
|
|
3752
|
-
let t =
|
|
3756
|
+
let t = T?.provider === "object" ? T.object : e.objectName, n = N.selectedRecord, r = n.id ?? n._id;
|
|
3753
3757
|
if (!t || r == null) return null;
|
|
3754
|
-
let a =
|
|
3755
|
-
return /* @__PURE__ */
|
|
3758
|
+
let a = E?.titleField ? String(n[E.titleField] ?? "Task Details") : "Task Details";
|
|
3759
|
+
return /* @__PURE__ */ D(g, {
|
|
3756
3760
|
open: !0,
|
|
3757
3761
|
onClose: N.close,
|
|
3758
3762
|
title: a,
|
|
@@ -3760,48 +3764,48 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3760
3764
|
objectName: t,
|
|
3761
3765
|
recordId: r,
|
|
3762
3766
|
dataSource: i,
|
|
3763
|
-
objectSchema:
|
|
3767
|
+
objectSchema: w,
|
|
3764
3768
|
width: N.width,
|
|
3765
|
-
fullPageHref:
|
|
3769
|
+
fullPageHref: _(t, r) ?? void 0,
|
|
3766
3770
|
onFieldSave: async (e, n) => {
|
|
3767
|
-
i?.update && (await i.update(t, String(r), { [e]: n }),
|
|
3771
|
+
i?.update && (await i.update(t, String(r), { [e]: n }), x((t) => t.map((t) => String(t.id ?? t._id) === String(r) ? {
|
|
3768
3772
|
...t,
|
|
3769
3773
|
[e]: n
|
|
3770
3774
|
} : t)));
|
|
3771
3775
|
},
|
|
3772
3776
|
onDelete: async () => {
|
|
3773
|
-
i?.delete && (await i.delete(t, String(r)),
|
|
3777
|
+
i?.delete && (await i.delete(t, String(r)), x((e) => e.filter((e) => String(e.id ?? e._id) !== String(r))));
|
|
3774
3778
|
}
|
|
3775
3779
|
});
|
|
3776
3780
|
})(),
|
|
3777
|
-
/* @__PURE__ */
|
|
3781
|
+
/* @__PURE__ */ D(v, {
|
|
3778
3782
|
open: !!F,
|
|
3779
3783
|
onOpenChange: (e) => {
|
|
3780
|
-
!e && !
|
|
3784
|
+
!e && !Ve && I(null);
|
|
3781
3785
|
},
|
|
3782
|
-
children: /* @__PURE__ */
|
|
3786
|
+
children: /* @__PURE__ */ O(te, { children: [/* @__PURE__ */ O(ie, { children: [/* @__PURE__ */ D(ae, { children: "Delete this task?" }), /* @__PURE__ */ D(ne, { children: F ? /* @__PURE__ */ O(Oe, { children: [
|
|
3783
3787
|
"\"",
|
|
3784
3788
|
F.title,
|
|
3785
3789
|
"\" will be permanently removed. This action cannot be undone."
|
|
3786
|
-
] }) : null })] }), /* @__PURE__ */
|
|
3787
|
-
disabled:
|
|
3790
|
+
] }) : null })] }), /* @__PURE__ */ O(re, { children: [/* @__PURE__ */ D(ee, {
|
|
3791
|
+
disabled: Ve,
|
|
3788
3792
|
children: "Cancel"
|
|
3789
|
-
}), /* @__PURE__ */
|
|
3793
|
+
}), /* @__PURE__ */ D(y, {
|
|
3790
3794
|
onClick: (e) => {
|
|
3791
3795
|
e.preventDefault(), We();
|
|
3792
3796
|
},
|
|
3793
|
-
disabled:
|
|
3797
|
+
disabled: Ve,
|
|
3794
3798
|
"data-testid": "gantt-delete-confirm",
|
|
3795
3799
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
3796
|
-
children:
|
|
3800
|
+
children: Ve ? "Deleting…" : "Delete"
|
|
3797
3801
|
})] })] })
|
|
3798
3802
|
})
|
|
3799
3803
|
]
|
|
3800
|
-
}) : /* @__PURE__ */
|
|
3804
|
+
}) : /* @__PURE__ */ D("div", {
|
|
3801
3805
|
className: o,
|
|
3802
|
-
children: /* @__PURE__ */
|
|
3806
|
+
children: /* @__PURE__ */ D("div", {
|
|
3803
3807
|
className: "flex items-center justify-center h-96",
|
|
3804
|
-
children: /* @__PURE__ */
|
|
3808
|
+
children: /* @__PURE__ */ D("div", {
|
|
3805
3809
|
className: "text-muted-foreground",
|
|
3806
3810
|
children: "Gantt configuration required. Please specify startDateField, endDateField, and titleField."
|
|
3807
3811
|
})
|
|
@@ -3809,7 +3813,7 @@ var Tt = ({ schema: e, dataSource: i, className: o, onTaskClick: d, onRowClick:
|
|
|
3809
3813
|
});
|
|
3810
3814
|
}, H = ({ schema: e }) => {
|
|
3811
3815
|
let { dataSource: t } = f() || {};
|
|
3812
|
-
return /* @__PURE__ */
|
|
3816
|
+
return /* @__PURE__ */ D(Tt, {
|
|
3813
3817
|
schema: e,
|
|
3814
3818
|
dataSource: t
|
|
3815
3819
|
});
|
|
@@ -3846,4 +3850,4 @@ o.register("object-gantt", H, {
|
|
|
3846
3850
|
}]
|
|
3847
3851
|
});
|
|
3848
3852
|
//#endregion
|
|
3849
|
-
export { st as GanttView, Tt as ObjectGantt, H as ObjectGanttRenderer, yt as QuickFilterBar, z as ResourceWorkload,
|
|
3853
|
+
export { st as GanttView, Tt as ObjectGantt, H as ObjectGanttRenderer, yt as QuickFilterBar, z as ResourceWorkload, Ve as bandAt, lt as computeWorkload, St as normalizeDependencies, Be as normalizeShiftSegments, bt as normalizeTaskType, F as parseHHMM, I as shiftDayStart };
|