@object-ui/plugin-gantt 16.1.0 → 17.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 +179 -0
- package/dist/index.js +656 -663
- package/dist/index.umd.cjs +1 -1
- package/dist/useGanttTranslation.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -8,71 +8,71 @@ import { resolveFieldCurrency as te, useLocalization as _ } from "@object-ui/i18
|
|
|
8
8
|
import { RecordDetailDrawer as v, deriveRecordPageHref as ne } from "@object-ui/plugin-detail";
|
|
9
9
|
import { AlertDialog as re, AlertDialogAction as ie, AlertDialogCancel as ae, AlertDialogContent as oe, AlertDialogDescription as se, AlertDialogFooter as ce, AlertDialogHeader as le, AlertDialogTitle as ue, Button as y, cn as b, useResizeObserver as de } from "@object-ui/components";
|
|
10
10
|
import { formatCurrency as fe, formatDate as pe, formatDateTime as me, formatNumber as he, formatPercent as ge, getSemanticColorName as _e, getSemanticHex as ve, humanizeLabel as x } from "@object-ui/fields";
|
|
11
|
-
import { Activity as S, ArrowRight as
|
|
12
|
-
import { Fragment as
|
|
11
|
+
import { Activity as S, ArrowRight as C, ChevronDown as ye, ChevronLeft as be, ChevronRight as xe, Download as Se, FileDown as w, Lock as Ce, Maximize2 as we, Minimize2 as Te, PanelLeft as Ee, PanelLeftClose as De, Redo2 as T, RefreshCw as E, Save as Oe, Undo2 as ke, Wand2 as D, ZoomIn as O, ZoomOut as Ae } from "lucide-react";
|
|
12
|
+
import { Fragment as je, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
13
13
|
//#region src/scheduling.ts
|
|
14
|
-
var
|
|
15
|
-
function
|
|
14
|
+
var j = 1e3 * 60 * 60 * 24, M = (e) => e.toISOString().slice(0, 10);
|
|
15
|
+
function N(e, t) {
|
|
16
16
|
if (t.skipWeekends) {
|
|
17
17
|
let t = e.getUTCDay();
|
|
18
18
|
if (t === 0 || t === 6) return !1;
|
|
19
19
|
}
|
|
20
|
-
return !(t.holidays && t.holidays.has(
|
|
20
|
+
return !(t.holidays && t.holidays.has(M(e)));
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Me(e) {
|
|
23
23
|
let t = new Date(e);
|
|
24
24
|
return t.setUTCHours(0, 0, 0, 0), t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let n =
|
|
28
|
-
for (; !
|
|
26
|
+
function P(e, t) {
|
|
27
|
+
let n = Me(e);
|
|
28
|
+
for (; !N(n, t);) n = new Date(n.getTime() + j);
|
|
29
29
|
return n.getTime();
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ne(e, t, n) {
|
|
32
32
|
if (t <= e) return 0;
|
|
33
|
-
let r = 0, i =
|
|
34
|
-
for (; i.getTime() < a;)
|
|
33
|
+
let r = 0, i = Me(e), a = Me(t).getTime();
|
|
34
|
+
for (; i.getTime() < a;) N(i, n) && r++, i = new Date(i.getTime() + j);
|
|
35
35
|
return r;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
if (t <= 0) return
|
|
39
|
-
let r =
|
|
40
|
-
for (; i > 0;)
|
|
37
|
+
function F(e, t, n) {
|
|
38
|
+
if (t <= 0) return Me(e).getTime();
|
|
39
|
+
let r = Me(e), i = t;
|
|
40
|
+
for (; i > 0;) N(r, n) && i--, r = new Date(r.getTime() + j);
|
|
41
41
|
return r.getTime();
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
if (t <= 0) return
|
|
45
|
-
let r =
|
|
46
|
-
for (; i > 0;) r = /* @__PURE__ */ new Date(r.getTime() -
|
|
43
|
+
function Pe(e, t, n) {
|
|
44
|
+
if (t <= 0) return Me(e).getTime();
|
|
45
|
+
let r = Me(e), i = t;
|
|
46
|
+
for (; i > 0;) r = /* @__PURE__ */ new Date(r.getTime() - j), N(r, n) && i--;
|
|
47
47
|
return r.getTime();
|
|
48
48
|
}
|
|
49
|
-
var
|
|
50
|
-
function
|
|
49
|
+
var I = (e) => String(e);
|
|
50
|
+
function Fe(e) {
|
|
51
51
|
return e === "ss" || e === "ff" || e === "sf" ? e : "fs";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
let t = new Set(e.map((e) =>
|
|
53
|
+
function Ie(e) {
|
|
54
|
+
let t = new Set(e.map((e) => I(e.id))), n = [];
|
|
55
55
|
for (let r of e) {
|
|
56
|
-
let e =
|
|
56
|
+
let e = I(r.id);
|
|
57
57
|
for (let i of r.dependencies ?? []) {
|
|
58
58
|
let r = typeof i == "object" && !!i, a = r ? i.id : i;
|
|
59
59
|
if (a == null || a === "") continue;
|
|
60
|
-
let o =
|
|
60
|
+
let o = I(a);
|
|
61
61
|
o === e || !t.has(o) || n.push({
|
|
62
62
|
pred: o,
|
|
63
63
|
succ: e,
|
|
64
|
-
type:
|
|
64
|
+
type: Fe(r ? i.type : void 0)
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return n;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Le(e) {
|
|
71
71
|
let t = /* @__PURE__ */ new Set();
|
|
72
|
-
for (let n of e) n.parent != null && n.parent !== "" && t.add(
|
|
72
|
+
for (let n of e) n.parent != null && n.parent !== "" && t.add(I(n.parent));
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Re(e, t) {
|
|
76
76
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
77
77
|
for (let t of e) n.set(t, 0), r.set(t, []);
|
|
78
78
|
for (let e of t) r.get(e.pred).push(e.succ), n.set(e.succ, (n.get(e.succ) ?? 0) + 1);
|
|
@@ -98,7 +98,7 @@ function ze(e, t) {
|
|
|
98
98
|
hasCycle: !1
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function ze(e, t) {
|
|
102
102
|
let n = {
|
|
103
103
|
criticalIds: /* @__PURE__ */ new Set(),
|
|
104
104
|
criticalEdges: /* @__PURE__ */ new Set()
|
|
@@ -106,10 +106,10 @@ function Be(e, t) {
|
|
|
106
106
|
if (!e.length) return n;
|
|
107
107
|
let r = /* @__PURE__ */ new Map();
|
|
108
108
|
for (let n of e) {
|
|
109
|
-
let e = t ?
|
|
110
|
-
r.set(
|
|
109
|
+
let e = t ? Ne(n.start.getTime(), n.end.getTime(), t) : (n.end.getTime() - n.start.getTime()) / j;
|
|
110
|
+
r.set(I(n.id), Number.isFinite(e) && e > 0 ? e : 0);
|
|
111
111
|
}
|
|
112
|
-
let i =
|
|
112
|
+
let i = Ie(e), a = e.map((e) => I(e.id)), { order: o, hasCycle: s } = Re(a, i);
|
|
113
113
|
if (s) return n;
|
|
114
114
|
let c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
115
115
|
for (let e of a) c.set(e, []), l.set(e, []);
|
|
@@ -140,34 +140,34 @@ function Be(e, t) {
|
|
|
140
140
|
criticalEdges: te
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Be(e, t, n) {
|
|
144
144
|
if (!e.length) return {
|
|
145
145
|
changes: [],
|
|
146
146
|
skippedLocked: []
|
|
147
147
|
};
|
|
148
|
-
let r =
|
|
148
|
+
let r = Ie(e), i = e.map((e) => I(e.id)), { order: a, hasCycle: o } = Re(i, r);
|
|
149
149
|
if (o) return {
|
|
150
150
|
changes: [],
|
|
151
151
|
skippedLocked: []
|
|
152
152
|
};
|
|
153
|
-
let s =
|
|
154
|
-
for (let t of e) c.set(
|
|
153
|
+
let s = Le(e), c = /* @__PURE__ */ new Map();
|
|
154
|
+
for (let t of e) c.set(I(t.id), t);
|
|
155
155
|
let l = /* @__PURE__ */ new Map();
|
|
156
156
|
for (let t of e) {
|
|
157
157
|
if (t.parent == null || t.parent === "") continue;
|
|
158
|
-
let e =
|
|
158
|
+
let e = I(t.parent), n = l.get(e) ?? [];
|
|
159
159
|
n.push(t), l.set(e, n);
|
|
160
160
|
}
|
|
161
161
|
let u = n?.summaryExtent === "self", d = (e) => u && e.hasOwnDates !== !1 && !e.locked, f = /* @__PURE__ */ new Map();
|
|
162
162
|
for (let e of i) f.set(e, []);
|
|
163
163
|
for (let e of r) f.get(e.succ).push(e);
|
|
164
164
|
let p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
165
|
-
for (let t of e) p.set(
|
|
165
|
+
for (let t of e) p.set(I(t.id), t.start.getTime()), m.set(I(t.id), t.end.getTime());
|
|
166
166
|
let h = [];
|
|
167
167
|
for (let e of a) {
|
|
168
168
|
let r = c.get(e);
|
|
169
169
|
if (!r) continue;
|
|
170
|
-
let i = t ?
|
|
170
|
+
let i = t ? Ne(p.get(e), m.get(e), t) : m.get(e) - p.get(e), a = r.start.getTime(), o = a;
|
|
171
171
|
for (let n of f.get(e) ?? []) {
|
|
172
172
|
let e = p.get(n.pred), r = m.get(n.pred), a;
|
|
173
173
|
switch (n.type) {
|
|
@@ -175,10 +175,10 @@ function Ve(e, t, n) {
|
|
|
175
175
|
a = e;
|
|
176
176
|
break;
|
|
177
177
|
case "ff":
|
|
178
|
-
a = t ?
|
|
178
|
+
a = t ? Pe(r, i, t) : r - i;
|
|
179
179
|
break;
|
|
180
180
|
case "sf":
|
|
181
|
-
a = t ?
|
|
181
|
+
a = t ? Pe(e, i, t) : e - i;
|
|
182
182
|
break;
|
|
183
183
|
default:
|
|
184
184
|
a = r;
|
|
@@ -193,19 +193,19 @@ function Ve(e, t, n) {
|
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
195
|
if (l && !t && n?.snapStart && (o = Math.max(o, n.snapStart(o))), t) {
|
|
196
|
-
let n =
|
|
197
|
-
p.set(e, n), m.set(e,
|
|
196
|
+
let n = P(o, t);
|
|
197
|
+
p.set(e, n), m.set(e, F(n, i, t));
|
|
198
198
|
} else p.set(e, o), m.set(e, o + i);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
if (u) for (let t of e) {
|
|
202
|
-
let e =
|
|
202
|
+
let e = I(t.id);
|
|
203
203
|
if (!s.has(e) || !d(t)) continue;
|
|
204
204
|
let n = p.get(e) - t.start.getTime();
|
|
205
205
|
if (n <= 0) continue;
|
|
206
206
|
let r = [...l.get(e) ?? []];
|
|
207
207
|
for (; r.length;) {
|
|
208
|
-
let e = r.pop(), t =
|
|
208
|
+
let e = r.pop(), t = I(e.id);
|
|
209
209
|
if (r.push(...l.get(t) ?? []), e.locked) continue;
|
|
210
210
|
let i = e.start.getTime() + n;
|
|
211
211
|
if (i > p.get(t)) {
|
|
@@ -216,7 +216,7 @@ function Ve(e, t, n) {
|
|
|
216
216
|
}
|
|
217
217
|
let g = [];
|
|
218
218
|
for (let t of e) {
|
|
219
|
-
let e =
|
|
219
|
+
let e = I(t.id), n = p.get(e), r = m.get(e);
|
|
220
220
|
(n !== t.start.getTime() || r !== t.end.getTime()) && g.push({
|
|
221
221
|
id: e,
|
|
222
222
|
start: new Date(n),
|
|
@@ -228,7 +228,7 @@ function Ve(e, t, n) {
|
|
|
228
228
|
skippedLocked: h
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Ve(e, t, n) {
|
|
232
232
|
let r = String(t), i = String(n);
|
|
233
233
|
if (r === i) return !0;
|
|
234
234
|
let a = /* @__PURE__ */ new Map();
|
|
@@ -248,28 +248,28 @@ function He(e, t, n) {
|
|
|
248
248
|
}
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/shifts.ts
|
|
251
|
-
var
|
|
252
|
-
1440 *
|
|
253
|
-
var
|
|
254
|
-
function
|
|
251
|
+
var L = 6e4;
|
|
252
|
+
1440 * L;
|
|
253
|
+
var He = 1440;
|
|
254
|
+
function Ue(e) {
|
|
255
255
|
if (typeof e != "string") return null;
|
|
256
256
|
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
257
257
|
if (!t) return null;
|
|
258
258
|
let n = Number(t[1]), r = Number(t[2]);
|
|
259
259
|
return n < 0 || n > 23 || r < 0 || r > 59 ? null : n * 60 + r;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function We(e) {
|
|
262
262
|
if (!e || !Array.isArray(e.bands) || e.bands.length === 0) return null;
|
|
263
|
-
let t =
|
|
263
|
+
let t = Ue(e.dayStart) ?? 0, n = [];
|
|
264
264
|
for (let t = 0; t < e.bands.length; t++) {
|
|
265
|
-
let r = e.bands[t], i =
|
|
265
|
+
let r = e.bands[t], i = Ue(r.start), a = Ue(r.end);
|
|
266
266
|
if (i == null || a == null || !r.label) return null;
|
|
267
|
-
let o = (a - i +
|
|
267
|
+
let o = (a - i + He) % He || He;
|
|
268
268
|
n.push({
|
|
269
269
|
key: r.key ?? `band${t}`,
|
|
270
270
|
label: r.label,
|
|
271
271
|
color: r.color,
|
|
272
|
-
durMs: o *
|
|
272
|
+
durMs: o * L
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
return {
|
|
@@ -278,19 +278,19 @@ function Ge(e) {
|
|
|
278
278
|
showMidnight: e.showMidnight !== !1
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Ge(e, t) {
|
|
282
282
|
let n = new Date(e);
|
|
283
283
|
return n.setHours(0, 0, 0, 0), n.setMinutes(t), n.getTime() > e.getTime() && n.setDate(n.getDate() - 1), n;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Ke(e, t) {
|
|
286
286
|
if (t.bands.length === 0) return null;
|
|
287
|
-
let n =
|
|
287
|
+
let n = Ge(e, t.dayStartMin).getTime(), r = e.getTime() - n, i = 0;
|
|
288
288
|
for (let e of t.bands) if (i += e.durMs, r < i) return e;
|
|
289
289
|
return t.bands[t.bands.length - 1];
|
|
290
290
|
}
|
|
291
291
|
//#endregion
|
|
292
292
|
//#region src/useGanttTranslation.ts
|
|
293
|
-
var
|
|
293
|
+
var R = {
|
|
294
294
|
"gantt.column.taskName": "Task Name",
|
|
295
295
|
"gantt.column.start": "Start",
|
|
296
296
|
"gantt.column.end": "End",
|
|
@@ -364,49 +364,42 @@ var L = {
|
|
|
364
364
|
"gantt.lockedHint": "No edit permission",
|
|
365
365
|
"gantt.writeFailed": "Save failed — the change was rolled back"
|
|
366
366
|
};
|
|
367
|
-
function
|
|
368
|
-
let n =
|
|
367
|
+
function qe(e, t) {
|
|
368
|
+
let n = R[e] || e;
|
|
369
369
|
if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
|
|
370
370
|
return n;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
t
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
};
|
|
382
|
-
} catch {
|
|
383
|
-
return {
|
|
384
|
-
t: Je,
|
|
385
|
-
language: void 0
|
|
386
|
-
};
|
|
387
|
-
}
|
|
372
|
+
function Je() {
|
|
373
|
+
let e = m();
|
|
374
|
+
return {
|
|
375
|
+
t: (t, n) => {
|
|
376
|
+
let r = e.t(t, n);
|
|
377
|
+
return typeof r == "string" && r !== t ? r : qe(t, n);
|
|
378
|
+
},
|
|
379
|
+
language: e.language
|
|
380
|
+
};
|
|
388
381
|
}
|
|
389
382
|
//#endregion
|
|
390
383
|
//#region src/GanttView.tsx
|
|
391
|
-
var
|
|
392
|
-
function
|
|
384
|
+
var Ye = 8;
|
|
385
|
+
function Xe(e, t) {
|
|
393
386
|
if (t.width <= 0) return "move";
|
|
394
|
-
let n = Math.min(
|
|
387
|
+
let n = Math.min(Ye, t.width / 3), r = e - t.left;
|
|
395
388
|
return r <= n ? "resize-left" : r >= t.width - n ? "resize-right" : "move";
|
|
396
389
|
}
|
|
397
|
-
function
|
|
390
|
+
function Ze(e) {
|
|
398
391
|
return 110;
|
|
399
392
|
}
|
|
400
|
-
function
|
|
393
|
+
function Qe(e) {
|
|
401
394
|
return e < 640 ? 140 : e < 1024 ? 220 : 320;
|
|
402
395
|
}
|
|
403
|
-
function
|
|
396
|
+
function $e(e) {
|
|
404
397
|
return e >= 280;
|
|
405
398
|
}
|
|
406
|
-
function
|
|
399
|
+
function et(e) {
|
|
407
400
|
return e < 640 ? 32 : 40;
|
|
408
401
|
}
|
|
409
|
-
var
|
|
402
|
+
var tt = [
|
|
410
403
|
"day",
|
|
411
404
|
"week",
|
|
412
405
|
"month",
|
|
@@ -522,7 +515,7 @@ function pt(e) {
|
|
|
522
515
|
try {
|
|
523
516
|
let t = window.localStorage.getItem(ft + e);
|
|
524
517
|
if (!t) return null;
|
|
525
|
-
let n = JSON.parse(t), r = n.viewMode &&
|
|
518
|
+
let n = JSON.parse(t), r = n.viewMode && tt.includes(n.viewMode) ? n.viewMode : null;
|
|
526
519
|
if (!r) return null;
|
|
527
520
|
let i = typeof n.columnWidth == "number" && isFinite(n.columnWidth) ? n.columnWidth : null, a = typeof n.taskListWidth == "number" && isFinite(n.taskListWidth) ? n.taskListWidth : null, o = Array.isArray(n.collapsedIds) ? n.collapsedIds.filter((e) => typeof e == "string") : void 0;
|
|
528
521
|
return {
|
|
@@ -542,39 +535,39 @@ function mt(e, t) {
|
|
|
542
535
|
} catch {}
|
|
543
536
|
}
|
|
544
537
|
function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTaskClick: o, onTaskUpdate: s, onTaskDelete: c, onViewChange: l, onDependencyCreate: u, onBeforeDependencyCreate: d, onDependencyDelete: f, onTaskReorder: p, className: m, inlineEdit: h = !1, autoSchedule: g = !1, rescheduleOnConflict: ee = !1, criticalPathDefault: te = !1, workingCalendar: _, shiftSegments: v, showBaselines: ne = !0, readOnly: re = !1, mobileReadOnly: ie = !1, groupBy: ae, ungroupedLabel: oe = "Ungrouped", defaultCollapsedDepth: se, summaryExtent: ce = "children", persistLayoutKey: le, onLayoutChange: ue, onRefresh: fe, refreshing: pe = !1, dependencyTypes: me = !0, timeZone: he, exportFileName: ge, interactions: _e, onBeforeTaskUpdate: ve }) {
|
|
545
|
-
let x = e.useMemo(() => it(he), [he]),
|
|
538
|
+
let x = e.useMemo(() => it(he), [he]), j = e.useMemo(() => x.delta === 0 ? t : t.map((e) => ({
|
|
546
539
|
...e,
|
|
547
540
|
start: x.to(e.start),
|
|
548
541
|
end: x.to(e.end),
|
|
549
542
|
baselineStart: e.baselineStart ? x.to(e.baselineStart) : e.baselineStart,
|
|
550
543
|
baselineEnd: e.baselineEnd ? x.to(e.baselineEnd) : e.baselineEnd
|
|
551
|
-
})), [t, x]),
|
|
544
|
+
})), [t, x]), M = e.useMemo(() => r && x.delta !== 0 ? x.to(r) : r, [r, x]), N = e.useMemo(() => i && x.delta !== 0 ? x.to(i) : i, [i, x]), Me = e.useMemo(() => !a || x.delta === 0 ? a : a.map((e) => ({
|
|
552
545
|
...e,
|
|
553
546
|
date: x.to(new Date(e.date))
|
|
554
|
-
})), [a, x]), { t:
|
|
555
|
-
if (!(
|
|
547
|
+
})), [a, x]), { t: P, language: Ne } = Je(), F = Ne || void 0, [Pe, I] = e.useState(() => x.now()), Fe = e.useRef(null), { width: Ie } = de(Fe), Le = Ie || (typeof window < "u" ? window.innerWidth : 1024), Re = Le < 640, L = re || ie && Re, He = _e?.move !== !1, Ue = _e?.resize !== !1, We = _e?.progress !== !1, Ke = _e?.link !== !1, R = e.useMemo(() => {
|
|
548
|
+
if (!(L || !s)) return x.delta === 0 ? s : (e, t) => {
|
|
556
549
|
let n = { ...t };
|
|
557
550
|
n.start instanceof Date && (n.start = x.from(n.start)), n.end instanceof Date && (n.end = x.from(n.end)), s(e, n);
|
|
558
551
|
};
|
|
559
552
|
}, [
|
|
560
|
-
|
|
553
|
+
L,
|
|
561
554
|
s,
|
|
562
555
|
x
|
|
563
|
-
]),
|
|
556
|
+
]), qe = L ? void 0 : c, z = L || !Ke ? void 0 : u, ft = L || !Ke ? void 0 : f, ht = L ? void 0 : p, gt = !L && h, _t = !L && g, vt = !L && ee, B = et(Le), yt = Ze(Le), bt = e.useRef(void 0);
|
|
564
557
|
bt.current === void 0 && (bt.current = pt(le));
|
|
565
|
-
let xt = bt.current, [St, Ct] = e.useState(xt ? xt.columnWidth : null), [wt, Tt] = e.useState(xt ? xt.taskListWidth ?? null : null), [V, Et] = e.useState(n &&
|
|
558
|
+
let xt = bt.current, [St, Ct] = e.useState(xt ? xt.columnWidth : null), [wt, Tt] = e.useState(xt ? xt.taskListWidth ?? null : null), [V, Et] = e.useState(n && tt.includes(n) ? n : xt?.viewMode ?? "day");
|
|
566
559
|
e.useEffect(() => {
|
|
567
|
-
n &&
|
|
560
|
+
n && tt.includes(n) && Et(n);
|
|
568
561
|
}, [n]);
|
|
569
562
|
let Dt = e.useRef(null), Ot = e.useRef(null), kt = e.useRef(!0), [At, jt] = e.useState(xt ? xt.taskListCollapsed : !1), Mt = e.useRef(!1);
|
|
570
563
|
e.useEffect(() => {
|
|
571
|
-
!Mt.current &&
|
|
572
|
-
}, [
|
|
573
|
-
let Nt = Math.max(160,
|
|
574
|
-
if (St != null ||
|
|
575
|
-
let e =
|
|
576
|
-
|
|
577
|
-
let n = Math.max(1, (t.getTime() - e.getTime()) / rt), r = Math.max(0,
|
|
564
|
+
!Mt.current && Re && (jt(!0), Mt.current = !0);
|
|
565
|
+
}, [Re]);
|
|
566
|
+
let Nt = Math.max(160, Le - 200), H = At ? 0 : wt == null ? Qe(Le) : Math.max(160, Math.min(wt, Nt)), Pt = e.useMemo(() => {
|
|
567
|
+
if (St != null || N || j.length === 0) return null;
|
|
568
|
+
let e = M ? new Date(M) : new Date(Math.min(...j.map((e) => e.start.getTime()))), t = new Date(Math.max(...j.map((e) => e.end.getTime())));
|
|
569
|
+
M || e.setDate(e.getDate() - 7), t.setDate(t.getDate() + 14), e = at(e, V), t.setHours(23, 59, 59, 999);
|
|
570
|
+
let n = Math.max(1, (t.getTime() - e.getTime()) / rt), r = Math.max(0, Le - H);
|
|
578
571
|
if (r <= 0) return null;
|
|
579
572
|
let i = r / n * nt[V];
|
|
580
573
|
if (i <= yt) return null;
|
|
@@ -582,22 +575,22 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
582
575
|
return a > yt ? a : null;
|
|
583
576
|
}, [
|
|
584
577
|
St,
|
|
585
|
-
A,
|
|
586
578
|
j,
|
|
587
579
|
M,
|
|
580
|
+
N,
|
|
588
581
|
V,
|
|
589
|
-
|
|
582
|
+
Le,
|
|
590
583
|
H,
|
|
591
584
|
yt
|
|
592
|
-
]), Ft = St ?? Pt ?? yt, It = Ft / nt[V], Lt =
|
|
593
|
-
if (!ae) return
|
|
585
|
+
]), Ft = St ?? Pt ?? yt, It = Ft / nt[V], Lt = $e(H), [Rt, zt] = e.useState(null), [Bt, Vt] = e.useState({}), [Ht, Ut] = e.useState(null), U = e.useMemo(() => {
|
|
586
|
+
if (!ae) return j;
|
|
594
587
|
let e = /* @__PURE__ */ new Set();
|
|
595
|
-
for (let t of
|
|
588
|
+
for (let t of j) {
|
|
596
589
|
let n = t.parent != null && t.parent !== "" ? String(t.parent) : null;
|
|
597
590
|
n && e.add(n);
|
|
598
591
|
}
|
|
599
592
|
let t = /* @__PURE__ */ new Map();
|
|
600
|
-
for (let n of
|
|
593
|
+
for (let n of j) {
|
|
601
594
|
if (e.has(String(n.id))) continue;
|
|
602
595
|
let r = ae(n), i = r ? String(r.key) : "__ungrouped__", a = r ? r.label : oe, o = t.get(i);
|
|
603
596
|
o || (o = {
|
|
@@ -627,7 +620,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
627
620
|
return n;
|
|
628
621
|
}, [
|
|
629
622
|
ae,
|
|
630
|
-
|
|
623
|
+
j,
|
|
631
624
|
oe
|
|
632
625
|
]), Wt = e.useMemo(() => {
|
|
633
626
|
let e = new Set(U.map((e) => String(e.id))), t = /* @__PURE__ */ new Map();
|
|
@@ -661,10 +654,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
661
654
|
start: r,
|
|
662
655
|
end: i
|
|
663
656
|
};
|
|
664
|
-
}, [V, v]), Zt = e.useRef(
|
|
665
|
-
Zt.current =
|
|
657
|
+
}, [V, v]), Zt = e.useRef(j);
|
|
658
|
+
Zt.current = j;
|
|
666
659
|
let Qt = e.useRef([]), $t = e.useRef([]), [en, tn] = e.useState(0), nn = e.useCallback((e) => {
|
|
667
|
-
if (!
|
|
660
|
+
if (!R) return;
|
|
668
661
|
let t = e.filter((e) => !e.task.locked);
|
|
669
662
|
(async () => {
|
|
670
663
|
let e = t;
|
|
@@ -688,7 +681,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
688
681
|
let o = r[n], s = t[n], c = o instanceof Date && s instanceof Date ? o.getTime() === s.getTime() : o === s;
|
|
689
682
|
e[n] = s, i[n] = o, c || (a = !0);
|
|
690
683
|
}
|
|
691
|
-
|
|
684
|
+
R(t, r), a && n.push({
|
|
692
685
|
taskId: String(t.id),
|
|
693
686
|
before: e,
|
|
694
687
|
after: i
|
|
@@ -696,7 +689,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
696
689
|
}
|
|
697
690
|
n.length && (Qt.current.push(n), $t.current = [], tn((e) => e + 1));
|
|
698
691
|
})();
|
|
699
|
-
}, [
|
|
692
|
+
}, [R, ve]), [rn, an] = e.useState(null), on = e.useCallback((e) => {
|
|
700
693
|
if (!v) return e;
|
|
701
694
|
let t = new Date(e);
|
|
702
695
|
t.setHours(0, 0, 0, 0);
|
|
@@ -722,7 +715,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
722
715
|
start: r.start ?? n.start,
|
|
723
716
|
end: r.end ?? n.end
|
|
724
717
|
});
|
|
725
|
-
let { changes: n } =
|
|
718
|
+
let { changes: n } = Be(Zt.current.map((e) => {
|
|
726
719
|
let n = t.get(String(e.id));
|
|
727
720
|
return n ? {
|
|
728
721
|
...e,
|
|
@@ -752,11 +745,11 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
752
745
|
}).filter(Boolean);
|
|
753
746
|
e.length && nn(e), an(null);
|
|
754
747
|
}, [rn, nn]), un = e.useCallback((e, t) => {
|
|
755
|
-
if (
|
|
748
|
+
if (R) for (let n of e) {
|
|
756
749
|
let e = Zt.current.find((e) => String(e.id) === n.taskId);
|
|
757
|
-
e &&
|
|
750
|
+
e && R(e, t === "undo" ? n.before : n.after);
|
|
758
751
|
}
|
|
759
|
-
}, [
|
|
752
|
+
}, [R]), dn = e.useCallback(() => {
|
|
760
753
|
let e = Qt.current.pop();
|
|
761
754
|
e && (un(e, "undo"), $t.current.push(e), tn((e) => e + 1));
|
|
762
755
|
}, [un]), fn = e.useCallback(() => {
|
|
@@ -780,8 +773,8 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
780
773
|
let e = Jt.current;
|
|
781
774
|
if (e) {
|
|
782
775
|
if (e.unitDelta !== 0) {
|
|
783
|
-
let t =
|
|
784
|
-
if (t &&
|
|
776
|
+
let t = j.find((t) => t.id === e.taskId);
|
|
777
|
+
if (t && R) {
|
|
785
778
|
let { start: n, end: r } = Xt(e);
|
|
786
779
|
if (e.group) {
|
|
787
780
|
let r = n.getTime() - e.originStart.getTime(), i = [t, ...Kt(t.id).filter((e) => !e.locked)].map((e) => ({
|
|
@@ -819,15 +812,15 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
819
812
|
It,
|
|
820
813
|
V,
|
|
821
814
|
v,
|
|
822
|
-
|
|
823
|
-
|
|
815
|
+
j,
|
|
816
|
+
R,
|
|
824
817
|
Xt,
|
|
825
818
|
Kt,
|
|
826
819
|
nn,
|
|
827
820
|
cn
|
|
828
821
|
]);
|
|
829
822
|
let hn = e.useCallback((e, t, n, r) => {
|
|
830
|
-
!
|
|
823
|
+
!R || e.data?.__group || e.locked || (n.stopPropagation(), n.preventDefault(), qt({
|
|
831
824
|
taskId: e.id,
|
|
832
825
|
mode: t,
|
|
833
826
|
group: r?.group ?? !1,
|
|
@@ -836,7 +829,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
836
829
|
originClientX: n.clientX,
|
|
837
830
|
unitDelta: 0
|
|
838
831
|
}));
|
|
839
|
-
}, [
|
|
832
|
+
}, [R]), [gn, _n] = e.useState(null), vn = e.useRef(null);
|
|
840
833
|
e.useEffect(() => {
|
|
841
834
|
vn.current = gn;
|
|
842
835
|
}, [gn]), e.useEffect(() => {
|
|
@@ -853,8 +846,8 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
853
846
|
let e = vn.current;
|
|
854
847
|
if (e) {
|
|
855
848
|
if (e.value !== e.originProgress) {
|
|
856
|
-
let t =
|
|
857
|
-
t &&
|
|
849
|
+
let t = j.find((t) => t.id === e.taskId);
|
|
850
|
+
t && R && nn([{
|
|
858
851
|
task: t,
|
|
859
852
|
changes: { progress: e.value }
|
|
860
853
|
}]), Yt.current = !0, window.setTimeout(() => {
|
|
@@ -869,18 +862,18 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
869
862
|
};
|
|
870
863
|
}, [
|
|
871
864
|
gn,
|
|
872
|
-
|
|
873
|
-
|
|
865
|
+
j,
|
|
866
|
+
R,
|
|
874
867
|
nn
|
|
875
868
|
]);
|
|
876
869
|
let yn = e.useMemo(() => {
|
|
877
870
|
let e = [];
|
|
878
|
-
for (let t of
|
|
871
|
+
for (let t of j) for (let n of t.dependencies ?? []) {
|
|
879
872
|
let r = typeof n == "object" && n ? n.id : n;
|
|
880
873
|
r == null || r === "" || e.push([String(r), String(t.id)]);
|
|
881
874
|
}
|
|
882
875
|
return e;
|
|
883
|
-
}, [
|
|
876
|
+
}, [j]), bn = e.useCallback((e, t) => String(t.id) !== String(e) && !t.locked && t.type !== "group" && !Ve(yn, e, t.id), [yn]), xn = e.useRef(null), [G, Sn] = e.useState(null), Cn = e.useRef(null);
|
|
884
877
|
e.useEffect(() => {
|
|
885
878
|
Cn.current = G;
|
|
886
879
|
}, [G]), e.useEffect(() => {
|
|
@@ -897,7 +890,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
897
890
|
}, t = () => {
|
|
898
891
|
let e = Cn.current;
|
|
899
892
|
if (e && e.targetId != null && z) {
|
|
900
|
-
let t =
|
|
893
|
+
let t = j.find((t) => String(t.id) === String(e.sourceId)), n = j.find((t) => String(t.id) === String(e.targetId)), r = e.targetEnd ?? "start", i = me ? `${e.sourceEnd === "end" ? "f" : "s"}${r === "end" ? "f" : "s"}` : "fs";
|
|
901
894
|
t && n && bn(e.sourceId, n) && (d?.(t, n, i) ?? !0) && z(t, n, i);
|
|
902
895
|
}
|
|
903
896
|
Yt.current = !0, window.setTimeout(() => {
|
|
@@ -909,7 +902,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
909
902
|
};
|
|
910
903
|
}, [
|
|
911
904
|
G,
|
|
912
|
-
|
|
905
|
+
j,
|
|
913
906
|
z,
|
|
914
907
|
d,
|
|
915
908
|
bn,
|
|
@@ -951,7 +944,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
951
944
|
window.removeEventListener("pointerdown", e, !0), window.removeEventListener("keydown", t);
|
|
952
945
|
};
|
|
953
946
|
}, [An]);
|
|
954
|
-
let [Fn, In] = e.useState(null), Ln = !!(o ||
|
|
947
|
+
let [Fn, In] = e.useState(null), Ln = !!(o || R || z || qe), Rn = e.useCallback((e, t) => {
|
|
955
948
|
t.preventDefault(), t.stopPropagation(), In(e.id), Ln && Tn({
|
|
956
949
|
x: t.clientX,
|
|
957
950
|
y: t.clientY,
|
|
@@ -1077,27 +1070,27 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1077
1070
|
}
|
|
1078
1071
|
if (t < 0) return;
|
|
1079
1072
|
let n = K[t];
|
|
1080
|
-
e.key === "Enter" ? (e.preventDefault(), o?.(n.task)) : e.key === "Delete" || e.key === "Backspace" ?
|
|
1073
|
+
e.key === "Enter" ? (e.preventDefault(), o?.(n.task)) : e.key === "Delete" || e.key === "Backspace" ? qe && (e.preventDefault(), qe(n.task)) : (e.key === "ArrowRight" && n.hasChildren && Bn.has(String(n.task.id)) || e.key === "ArrowLeft" && n.hasChildren && !Bn.has(String(n.task.id))) && (e.preventDefault(), Hn(n.task.id));
|
|
1081
1074
|
}, [
|
|
1082
1075
|
K,
|
|
1083
1076
|
Fn,
|
|
1084
1077
|
o,
|
|
1085
|
-
|
|
1078
|
+
qe,
|
|
1086
1079
|
Bn,
|
|
1087
1080
|
Hn,
|
|
1088
1081
|
B,
|
|
1089
1082
|
dn,
|
|
1090
1083
|
fn
|
|
1091
1084
|
]), q = e.useMemo(() => {
|
|
1092
|
-
let e =
|
|
1093
|
-
return !
|
|
1085
|
+
let e = M ? new Date(M) : x.now(), t = N ? new Date(N) : x.now();
|
|
1086
|
+
return !M && j.length > 0 && (e = new Date(Math.min(...j.map((e) => e.start.getTime()))), e.setDate(e.getDate() - 7)), !N && j.length > 0 && (t = new Date(Math.max(...j.map((e) => e.end.getTime()))), t.setDate(t.getDate() + 14)), e = V === "day" && v && v.bands.length > 0 ? Ge(e, v.dayStartMin) : at(e, V), t.setHours(23, 59, 59, 999), {
|
|
1094
1087
|
start: e,
|
|
1095
1088
|
end: t
|
|
1096
1089
|
};
|
|
1097
1090
|
}, [
|
|
1098
|
-
j,
|
|
1099
1091
|
M,
|
|
1100
|
-
|
|
1092
|
+
N,
|
|
1093
|
+
j,
|
|
1101
1094
|
V,
|
|
1102
1095
|
v,
|
|
1103
1096
|
x
|
|
@@ -1137,10 +1130,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1137
1130
|
continue;
|
|
1138
1131
|
}
|
|
1139
1132
|
let r = (n.getTime() - t.getTime()) / rt * It, i, a;
|
|
1140
|
-
V === "day" ? (i = String(t.getDate()), a = t.toLocaleDateString(
|
|
1133
|
+
V === "day" ? (i = String(t.getDate()), a = t.toLocaleDateString(F, { weekday: "narrow" })) : i = V === "week" ? t.toLocaleDateString(F, {
|
|
1141
1134
|
month: "numeric",
|
|
1142
1135
|
day: "numeric"
|
|
1143
|
-
}) : V === "month" ? t.toLocaleDateString(
|
|
1136
|
+
}) : V === "month" ? t.toLocaleDateString(F, { month: "short" }) : V === "quarter" ? `Q${Math.floor(t.getMonth() / 3) + 1}` : String(t.getFullYear()), e.push({
|
|
1144
1137
|
date: new Date(t),
|
|
1145
1138
|
label: i,
|
|
1146
1139
|
sublabel: a,
|
|
@@ -1153,7 +1146,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1153
1146
|
q,
|
|
1154
1147
|
V,
|
|
1155
1148
|
It,
|
|
1156
|
-
|
|
1149
|
+
F,
|
|
1157
1150
|
Kn,
|
|
1158
1151
|
qn,
|
|
1159
1152
|
Gn,
|
|
@@ -1225,10 +1218,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1225
1218
|
if (Gn && v) {
|
|
1226
1219
|
let t = 0;
|
|
1227
1220
|
for (let n of J) {
|
|
1228
|
-
let r = String(
|
|
1221
|
+
let r = String(Ge(n.date, v.dayStartMin).getTime()), i = e[e.length - 1];
|
|
1229
1222
|
i && i.key === r ? i.width += n.width : e.push({
|
|
1230
1223
|
key: r,
|
|
1231
|
-
label: n.date.toLocaleDateString(
|
|
1224
|
+
label: n.date.toLocaleDateString(F, {
|
|
1232
1225
|
month: "short",
|
|
1233
1226
|
day: "numeric"
|
|
1234
1227
|
}),
|
|
@@ -1243,7 +1236,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1243
1236
|
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];
|
|
1244
1237
|
s && s.key === o ? s.width += r.width : e.push({
|
|
1245
1238
|
key: o,
|
|
1246
|
-
label: t === "decade" ? `${a}s` : t === "year" ? String(i) : r.date.toLocaleDateString(
|
|
1239
|
+
label: t === "decade" ? `${a}s` : t === "year" ? String(i) : r.date.toLocaleDateString(F, {
|
|
1247
1240
|
month: "short",
|
|
1248
1241
|
year: "numeric"
|
|
1249
1242
|
}),
|
|
@@ -1255,10 +1248,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1255
1248
|
}, [
|
|
1256
1249
|
J,
|
|
1257
1250
|
V,
|
|
1258
|
-
|
|
1251
|
+
F,
|
|
1259
1252
|
Gn,
|
|
1260
1253
|
v
|
|
1261
|
-
]), nr = e.useMemo(() => (
|
|
1254
|
+
]), nr = e.useMemo(() => (Me ?? []).map((e, t) => {
|
|
1262
1255
|
let n = e.date instanceof Date ? e.date : new Date(e.date);
|
|
1263
1256
|
return {
|
|
1264
1257
|
index: t,
|
|
@@ -1268,7 +1261,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1268
1261
|
valid: !isNaN(n.getTime()) && n >= q.start && n <= q.end
|
|
1269
1262
|
};
|
|
1270
1263
|
}).filter((e) => e.valid), [
|
|
1271
|
-
|
|
1264
|
+
Me,
|
|
1272
1265
|
q,
|
|
1273
1266
|
X
|
|
1274
1267
|
]), rr = e.useRef(null), ir = e.useRef(null), ar = e.useRef(null), Z = e.useRef(null);
|
|
@@ -1342,7 +1335,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1342
1335
|
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
1343
1336
|
}, []);
|
|
1344
1337
|
let xr = e.useCallback(() => {
|
|
1345
|
-
let e =
|
|
1338
|
+
let e = Fe.current;
|
|
1346
1339
|
e && (document.fullscreenElement ? document.exitFullscreen?.() : e.requestFullscreen?.());
|
|
1347
1340
|
}, []), Sr = e.useRef(null), Cr = e.useCallback((e) => {
|
|
1348
1341
|
if (e.touches.length === 2) {
|
|
@@ -1374,20 +1367,20 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1374
1367
|
});
|
|
1375
1368
|
}, [Er]), Or = e.useRef(!1);
|
|
1376
1369
|
e.useEffect(() => {
|
|
1377
|
-
if (Or.current ||
|
|
1370
|
+
if (Or.current || j.length === 0) return;
|
|
1378
1371
|
let e = window.requestAnimationFrame(() => {
|
|
1379
1372
|
let e = Z.current;
|
|
1380
1373
|
if (!e || e.clientWidth === 0) return;
|
|
1381
1374
|
let t = Er;
|
|
1382
1375
|
if (t == null) {
|
|
1383
|
-
let e = new Date(Math.min(...
|
|
1376
|
+
let e = new Date(Math.min(...j.map((e) => e.start.getTime())));
|
|
1384
1377
|
t = Math.round(X(e));
|
|
1385
1378
|
}
|
|
1386
1379
|
e.scrollLeft = Math.max(0, t - e.clientWidth / 2), Or.current = !0;
|
|
1387
1380
|
});
|
|
1388
1381
|
return () => window.cancelAnimationFrame(e);
|
|
1389
1382
|
}, [
|
|
1390
|
-
|
|
1383
|
+
j,
|
|
1391
1384
|
Er,
|
|
1392
1385
|
X
|
|
1393
1386
|
]);
|
|
@@ -1581,9 +1574,9 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1581
1574
|
h.push(`L ${m(f)} ${m(t)}`, `L ${m(p)} ${m(t)}`, `L ${m(p)} ${m(s)}`, `L ${m(d)} ${m(s)}`);
|
|
1582
1575
|
}
|
|
1583
1576
|
return h.join(" ");
|
|
1584
|
-
}, fi = W?.taskId ?? Ht, [pi, mi] = e.useState(te), hi = e.useMemo(() => pi ?
|
|
1577
|
+
}, fi = W?.taskId ?? Ht, [pi, mi] = e.useState(te), hi = e.useMemo(() => pi ? ze(j, _) : null, [
|
|
1585
1578
|
pi,
|
|
1586
|
-
|
|
1579
|
+
j,
|
|
1587
1580
|
_
|
|
1588
1581
|
]), gi = e.useCallback((e) => hi?.criticalIds.has(String(e)) ?? !1, [hi]), $ = "#dc2626", [_i, vi] = e.useState(null), [yi, bi] = e.useState(!1);
|
|
1589
1582
|
e.useEffect(() => {
|
|
@@ -1592,8 +1585,8 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1592
1585
|
return () => clearTimeout(e);
|
|
1593
1586
|
}, [yi]);
|
|
1594
1587
|
let xi = e.useCallback(() => {
|
|
1595
|
-
if (!
|
|
1596
|
-
let { changes: e, skippedLocked: t } =
|
|
1588
|
+
if (!R) return;
|
|
1589
|
+
let { changes: e, skippedLocked: t } = Be(j, _, sn);
|
|
1597
1590
|
if (!e.length) {
|
|
1598
1591
|
bi(!0);
|
|
1599
1592
|
return;
|
|
@@ -1603,15 +1596,15 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1603
1596
|
skipped: t.length
|
|
1604
1597
|
});
|
|
1605
1598
|
}, [
|
|
1606
|
-
|
|
1607
|
-
|
|
1599
|
+
j,
|
|
1600
|
+
R,
|
|
1608
1601
|
_,
|
|
1609
1602
|
sn
|
|
1610
1603
|
]), Si = e.useCallback(() => {
|
|
1611
1604
|
if (!_i) return;
|
|
1612
1605
|
let e = [];
|
|
1613
1606
|
for (let t of _i.changes) {
|
|
1614
|
-
let n =
|
|
1607
|
+
let n = j.find((e) => String(e.id) === t.id);
|
|
1615
1608
|
n && e.push({
|
|
1616
1609
|
task: n,
|
|
1617
1610
|
changes: {
|
|
@@ -1623,10 +1616,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1623
1616
|
e.length && nn(e), vi(null);
|
|
1624
1617
|
}, [
|
|
1625
1618
|
_i,
|
|
1626
|
-
|
|
1619
|
+
j,
|
|
1627
1620
|
nn
|
|
1628
1621
|
]), Ci = e.useCallback(() => {
|
|
1629
|
-
if (typeof document > "u" || !
|
|
1622
|
+
if (typeof document > "u" || !j.length) return null;
|
|
1630
1623
|
let e = (e) => String(e).replace(/[&<>"]/g, (e) => ({
|
|
1631
1624
|
"&": "&",
|
|
1632
1625
|
"<": "<",
|
|
@@ -1699,7 +1692,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1699
1692
|
H: r
|
|
1700
1693
|
};
|
|
1701
1694
|
}, [
|
|
1702
|
-
|
|
1695
|
+
j,
|
|
1703
1696
|
K,
|
|
1704
1697
|
$r,
|
|
1705
1698
|
di,
|
|
@@ -1762,230 +1755,230 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1762
1755
|
if (!Di) return;
|
|
1763
1756
|
let e = setTimeout(() => Oi(!1), 1500);
|
|
1764
1757
|
return () => clearTimeout(e);
|
|
1765
|
-
}, [Di]), /* @__PURE__ */
|
|
1766
|
-
ref:
|
|
1758
|
+
}, [Di]), /* @__PURE__ */ A("div", {
|
|
1759
|
+
ref: Fe,
|
|
1767
1760
|
className: b("flex flex-col h-full bg-background overflow-hidden min-w-0", m),
|
|
1768
|
-
"data-readonly":
|
|
1769
|
-
"data-mobile-readonly": ie &&
|
|
1761
|
+
"data-readonly": L ? "true" : void 0,
|
|
1762
|
+
"data-mobile-readonly": ie && Re ? "true" : void 0,
|
|
1770
1763
|
children: [
|
|
1771
|
-
/* @__PURE__ */
|
|
1772
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ k("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-row-open-btn { opacity: 0; transition: opacity 0.15s ease; }\n /* :where keeps the row-hover reveal at zero specificity so the\n button's own :hover/:focus-visible full-opacity rule can win. */\n :where(.group\\/task-row:hover) .gantt-row-open-btn { opacity: 0.6; }\n .gantt-row-open-btn:hover, .gantt-row-open-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 /* The timeline's NATIVE scrollbars are fully hidden — both axes are\n replaced by the self-drawn bars (水平底部 / 垂直右侧). Styling the\n native bar is a dead end: overlay-scrollbar engines (macOS \"show\n while scrolling\", embedded Chromium) ignore ::-webkit-scrollbar\n theming yet still flash their own auto-hiding bar on scroll, which\n doubled up with the self-drawn one (双滚动条). scrollbar-width:none\n is honored by overlay engines too; the ::-webkit rule covers older\n WebKit. Wheel/trackpad/programmatic scrolling is unaffected. */\n [data-testid=\"gantt-timeline\"] { scrollbar-width: none; }\n [data-testid=\"gantt-timeline\"]::-webkit-scrollbar { display: none; width: 0; height: 0; }\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 " }),
|
|
1765
|
+
/* @__PURE__ */ A("div", {
|
|
1773
1766
|
className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card",
|
|
1774
|
-
children: [/* @__PURE__ */
|
|
1767
|
+
children: [/* @__PURE__ */ A("div", {
|
|
1775
1768
|
className: "flex items-center gap-2",
|
|
1776
1769
|
children: [
|
|
1777
|
-
/* @__PURE__ */
|
|
1770
|
+
/* @__PURE__ */ k(y, {
|
|
1778
1771
|
variant: "ghost",
|
|
1779
1772
|
size: "icon",
|
|
1780
1773
|
className: "h-8 w-8",
|
|
1781
|
-
"aria-label":
|
|
1782
|
-
children: /* @__PURE__ */
|
|
1774
|
+
"aria-label": P("gantt.toolbar.prevPeriod"),
|
|
1775
|
+
children: /* @__PURE__ */ k(be, { className: "h-4 w-4" })
|
|
1783
1776
|
}),
|
|
1784
|
-
/* @__PURE__ */
|
|
1777
|
+
/* @__PURE__ */ k(y, {
|
|
1785
1778
|
variant: "ghost",
|
|
1786
1779
|
size: "icon",
|
|
1787
1780
|
className: "h-8 w-8",
|
|
1788
|
-
"aria-label":
|
|
1789
|
-
children: /* @__PURE__ */
|
|
1781
|
+
"aria-label": P("gantt.toolbar.nextPeriod"),
|
|
1782
|
+
children: /* @__PURE__ */ k(xe, { className: "h-4 w-4" })
|
|
1790
1783
|
}),
|
|
1791
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ k("span", {
|
|
1792
1785
|
className: "font-semibold text-xs sm:text-sm",
|
|
1793
|
-
children: q.start.toLocaleDateString(
|
|
1786
|
+
children: q.start.toLocaleDateString(F, {
|
|
1794
1787
|
month: "long",
|
|
1795
1788
|
year: "numeric"
|
|
1796
1789
|
})
|
|
1797
1790
|
}),
|
|
1798
|
-
|
|
1791
|
+
L && /* @__PURE__ */ A("span", {
|
|
1799
1792
|
className: "inline-flex items-center gap-1 rounded-full border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",
|
|
1800
1793
|
"data-testid": "gantt-readonly-badge",
|
|
1801
|
-
title:
|
|
1802
|
-
children: [/* @__PURE__ */
|
|
1794
|
+
title: P("gantt.readOnlyHint"),
|
|
1795
|
+
children: [/* @__PURE__ */ k(Ce, { className: "h-3 w-3" }), P("gantt.readOnly")]
|
|
1803
1796
|
})
|
|
1804
1797
|
]
|
|
1805
|
-
}), /* @__PURE__ */
|
|
1798
|
+
}), /* @__PURE__ */ A("div", {
|
|
1806
1799
|
className: "flex items-center gap-2",
|
|
1807
1800
|
children: [
|
|
1808
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ k("div", {
|
|
1809
1802
|
className: "flex bg-muted rounded-md p-1",
|
|
1810
1803
|
role: "group",
|
|
1811
|
-
"aria-label":
|
|
1812
|
-
children:
|
|
1804
|
+
"aria-label": P("gantt.toolbar.viewMode"),
|
|
1805
|
+
children: tt.map((e) => /* @__PURE__ */ k(y, {
|
|
1813
1806
|
variant: "ghost",
|
|
1814
1807
|
size: "sm",
|
|
1815
1808
|
className: b("h-6 px-1.5 sm:px-2 text-xs", V === e && "bg-background shadow-sm hover:bg-background"),
|
|
1816
1809
|
onClick: () => Qn(e),
|
|
1817
1810
|
"aria-pressed": V === e,
|
|
1818
1811
|
"data-testid": `gantt-view-mode-${e}`,
|
|
1819
|
-
children:
|
|
1812
|
+
children: P(`gantt.viewMode.${e}`)
|
|
1820
1813
|
}, e))
|
|
1821
1814
|
}),
|
|
1822
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ A("div", {
|
|
1823
1816
|
className: "flex bg-muted rounded-md p-1",
|
|
1824
|
-
children: [/* @__PURE__ */
|
|
1817
|
+
children: [/* @__PURE__ */ k(y, {
|
|
1825
1818
|
variant: "ghost",
|
|
1826
1819
|
size: "icon",
|
|
1827
1820
|
className: "h-6 w-6",
|
|
1828
1821
|
onClick: () => {
|
|
1829
1822
|
if (Ft > 15) Ct(Math.max(15, Ft - 10));
|
|
1830
1823
|
else {
|
|
1831
|
-
let e =
|
|
1832
|
-
e <
|
|
1824
|
+
let e = tt.indexOf(V);
|
|
1825
|
+
e < tt.length - 1 && (Qn(tt[e + 1]), Ct(yt));
|
|
1833
1826
|
}
|
|
1834
1827
|
},
|
|
1835
|
-
"aria-label":
|
|
1836
|
-
children: /* @__PURE__ */
|
|
1837
|
-
}), /* @__PURE__ */
|
|
1828
|
+
"aria-label": P("gantt.toolbar.zoomOut"),
|
|
1829
|
+
children: /* @__PURE__ */ k(Ae, { className: "h-3 w-3" })
|
|
1830
|
+
}), /* @__PURE__ */ k(y, {
|
|
1838
1831
|
variant: "ghost",
|
|
1839
1832
|
size: "icon",
|
|
1840
1833
|
className: "h-6 w-6",
|
|
1841
1834
|
onClick: () => {
|
|
1842
1835
|
if (Ft < 120) Ct(Math.min(120, Ft + 10));
|
|
1843
1836
|
else {
|
|
1844
|
-
let e =
|
|
1845
|
-
e > 0 && (Qn(
|
|
1837
|
+
let e = tt.indexOf(V);
|
|
1838
|
+
e > 0 && (Qn(tt[e - 1]), Ct(yt));
|
|
1846
1839
|
}
|
|
1847
1840
|
},
|
|
1848
|
-
"aria-label":
|
|
1849
|
-
children: /* @__PURE__ */ O
|
|
1841
|
+
"aria-label": P("gantt.toolbar.zoomIn"),
|
|
1842
|
+
children: /* @__PURE__ */ k(O, { className: "h-3 w-3" })
|
|
1850
1843
|
})]
|
|
1851
1844
|
}),
|
|
1852
|
-
/* @__PURE__ */
|
|
1845
|
+
/* @__PURE__ */ k(y, {
|
|
1853
1846
|
variant: "ghost",
|
|
1854
1847
|
size: "icon",
|
|
1855
1848
|
className: "h-8 w-8",
|
|
1856
1849
|
onClick: () => jt((e) => !e),
|
|
1857
|
-
"aria-label":
|
|
1850
|
+
"aria-label": P(At ? "gantt.toolbar.showTaskList" : "gantt.toolbar.hideTaskList"),
|
|
1858
1851
|
"aria-pressed": At,
|
|
1859
1852
|
"data-testid": "gantt-toggle-task-list",
|
|
1860
|
-
children:
|
|
1853
|
+
children: k(At ? Ee : De, { className: "h-4 w-4" })
|
|
1861
1854
|
}),
|
|
1862
|
-
/* @__PURE__ */
|
|
1855
|
+
/* @__PURE__ */ k(y, {
|
|
1863
1856
|
variant: "ghost",
|
|
1864
1857
|
size: "sm",
|
|
1865
1858
|
className: "h-8 px-2 text-xs",
|
|
1866
1859
|
onClick: Dr,
|
|
1867
1860
|
disabled: Er == null,
|
|
1868
|
-
"aria-label":
|
|
1861
|
+
"aria-label": P("gantt.toolbar.jumpToToday"),
|
|
1869
1862
|
"data-testid": "gantt-jump-today",
|
|
1870
|
-
children:
|
|
1863
|
+
children: P("gantt.toolbar.today")
|
|
1871
1864
|
}),
|
|
1872
|
-
/* @__PURE__ */
|
|
1865
|
+
/* @__PURE__ */ k(y, {
|
|
1873
1866
|
variant: "ghost",
|
|
1874
1867
|
size: "sm",
|
|
1875
1868
|
className: "h-8 px-2 text-xs",
|
|
1876
1869
|
onClick: jr,
|
|
1877
|
-
"aria-label":
|
|
1870
|
+
"aria-label": P("gantt.toolbar.thisWeek"),
|
|
1878
1871
|
"data-testid": "gantt-jump-week",
|
|
1879
|
-
children:
|
|
1872
|
+
children: P("gantt.toolbar.thisWeek")
|
|
1880
1873
|
}),
|
|
1881
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ k(y, {
|
|
1882
1875
|
variant: "ghost",
|
|
1883
1876
|
size: "sm",
|
|
1884
1877
|
className: "h-8 px-2 text-xs",
|
|
1885
1878
|
onClick: Mr,
|
|
1886
|
-
"aria-label":
|
|
1879
|
+
"aria-label": P("gantt.toolbar.thisMonth"),
|
|
1887
1880
|
"data-testid": "gantt-jump-month",
|
|
1888
|
-
children:
|
|
1881
|
+
children: P("gantt.toolbar.thisMonth")
|
|
1889
1882
|
}),
|
|
1890
|
-
fe ? /* @__PURE__ */
|
|
1883
|
+
fe ? /* @__PURE__ */ k(y, {
|
|
1891
1884
|
variant: "ghost",
|
|
1892
1885
|
size: "icon",
|
|
1893
1886
|
className: "h-8 w-8",
|
|
1894
1887
|
onClick: () => void fe(),
|
|
1895
1888
|
disabled: pe,
|
|
1896
|
-
"aria-label":
|
|
1889
|
+
"aria-label": P("gantt.toolbar.refresh"),
|
|
1897
1890
|
"aria-busy": pe,
|
|
1898
1891
|
"data-testid": "gantt-refresh",
|
|
1899
|
-
children: /* @__PURE__ */
|
|
1892
|
+
children: /* @__PURE__ */ k(E, { className: "h-4 w-4" })
|
|
1900
1893
|
}) : null,
|
|
1901
|
-
|
|
1894
|
+
R ? /* @__PURE__ */ A(je, { children: [/* @__PURE__ */ k(y, {
|
|
1902
1895
|
variant: "ghost",
|
|
1903
1896
|
size: "icon",
|
|
1904
1897
|
className: "h-8 w-8",
|
|
1905
1898
|
onClick: dn,
|
|
1906
1899
|
disabled: !pn,
|
|
1907
|
-
"aria-label":
|
|
1900
|
+
"aria-label": P("gantt.toolbar.undo"),
|
|
1908
1901
|
"data-testid": "gantt-undo",
|
|
1909
|
-
children: /* @__PURE__ */
|
|
1910
|
-
}), /* @__PURE__ */
|
|
1902
|
+
children: /* @__PURE__ */ k(ke, { className: "h-4 w-4" })
|
|
1903
|
+
}), /* @__PURE__ */ k(y, {
|
|
1911
1904
|
variant: "ghost",
|
|
1912
1905
|
size: "icon",
|
|
1913
1906
|
className: "h-8 w-8",
|
|
1914
1907
|
onClick: fn,
|
|
1915
1908
|
disabled: !mn,
|
|
1916
|
-
"aria-label":
|
|
1909
|
+
"aria-label": P("gantt.toolbar.redo"),
|
|
1917
1910
|
"data-testid": "gantt-redo",
|
|
1918
|
-
children: /* @__PURE__ */
|
|
1911
|
+
children: /* @__PURE__ */ k(T, { className: "h-4 w-4" })
|
|
1919
1912
|
})] }) : null,
|
|
1920
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ k(y, {
|
|
1921
1914
|
variant: "ghost",
|
|
1922
1915
|
size: "icon",
|
|
1923
1916
|
className: "h-8 w-8",
|
|
1924
1917
|
onClick: () => mi((e) => !e),
|
|
1925
|
-
"aria-label":
|
|
1918
|
+
"aria-label": P("gantt.toolbar.criticalPath"),
|
|
1926
1919
|
"aria-pressed": pi,
|
|
1927
1920
|
"data-testid": "gantt-critical-path",
|
|
1928
1921
|
style: pi ? { color: $ } : void 0,
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1922
|
+
children: /* @__PURE__ */ k(S, { className: "h-4 w-4" })
|
|
1930
1923
|
}),
|
|
1931
|
-
_t &&
|
|
1924
|
+
_t && R ? /* @__PURE__ */ k(y, {
|
|
1932
1925
|
variant: "ghost",
|
|
1933
1926
|
size: "icon",
|
|
1934
1927
|
className: "h-8 w-8",
|
|
1935
1928
|
onClick: xi,
|
|
1936
|
-
"aria-label":
|
|
1929
|
+
"aria-label": P("gantt.toolbar.autoSchedule"),
|
|
1937
1930
|
"data-testid": "gantt-auto-schedule",
|
|
1938
|
-
children: /* @__PURE__ */
|
|
1931
|
+
children: /* @__PURE__ */ k(D, { className: "h-4 w-4" })
|
|
1939
1932
|
}) : null,
|
|
1940
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ k(y, {
|
|
1941
1934
|
variant: "ghost",
|
|
1942
1935
|
size: "icon",
|
|
1943
1936
|
className: "h-8 w-8",
|
|
1944
1937
|
onClick: Ti,
|
|
1945
|
-
"aria-label":
|
|
1938
|
+
"aria-label": P("gantt.toolbar.exportPng"),
|
|
1946
1939
|
"data-testid": "gantt-export-png",
|
|
1947
|
-
children: /* @__PURE__ */
|
|
1940
|
+
children: /* @__PURE__ */ k(Se, { className: "h-4 w-4" })
|
|
1948
1941
|
}),
|
|
1949
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ k(y, {
|
|
1950
1943
|
variant: "ghost",
|
|
1951
1944
|
size: "icon",
|
|
1952
1945
|
className: "h-8 w-8",
|
|
1953
1946
|
onClick: Ei,
|
|
1954
|
-
"aria-label":
|
|
1947
|
+
"aria-label": P("gantt.toolbar.exportPdf"),
|
|
1955
1948
|
"data-testid": "gantt-export-pdf",
|
|
1956
|
-
children: /* @__PURE__ */
|
|
1949
|
+
children: /* @__PURE__ */ k(w, { className: "h-4 w-4" })
|
|
1957
1950
|
}),
|
|
1958
|
-
ue || le ? /* @__PURE__ */
|
|
1951
|
+
ue || le ? /* @__PURE__ */ k(y, {
|
|
1959
1952
|
variant: "ghost",
|
|
1960
1953
|
size: "icon",
|
|
1961
1954
|
className: "h-8 w-8",
|
|
1962
1955
|
onClick: ki,
|
|
1963
|
-
"aria-label":
|
|
1956
|
+
"aria-label": P("gantt.toolbar.saveLayout"),
|
|
1964
1957
|
"aria-pressed": Di,
|
|
1965
1958
|
"data-testid": "gantt-save-layout",
|
|
1966
1959
|
style: Di ? { color: $ } : void 0,
|
|
1967
|
-
children: /* @__PURE__ */
|
|
1960
|
+
children: /* @__PURE__ */ k(Oe, { className: "h-4 w-4" })
|
|
1968
1961
|
}) : null,
|
|
1969
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ k(y, {
|
|
1970
1963
|
variant: "ghost",
|
|
1971
1964
|
size: "icon",
|
|
1972
1965
|
className: "h-8 w-8",
|
|
1973
1966
|
onClick: xr,
|
|
1974
|
-
"aria-label":
|
|
1967
|
+
"aria-label": P(yr ? "gantt.toolbar.exitFullscreen" : "gantt.toolbar.enterFullscreen"),
|
|
1975
1968
|
"aria-pressed": yr,
|
|
1976
1969
|
"data-testid": "gantt-fullscreen",
|
|
1977
|
-
children:
|
|
1970
|
+
children: k(yr ? Te : we, { className: "h-4 w-4" })
|
|
1978
1971
|
})
|
|
1979
1972
|
]
|
|
1980
1973
|
})]
|
|
1981
1974
|
}),
|
|
1982
|
-
/* @__PURE__ */
|
|
1975
|
+
/* @__PURE__ */ A("div", {
|
|
1983
1976
|
className: "relative flex flex-col flex-1 overflow-hidden outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1984
1977
|
tabIndex: 0,
|
|
1985
1978
|
onKeyDown: Wn,
|
|
1986
1979
|
"data-testid": "gantt-body",
|
|
1987
1980
|
children: [
|
|
1988
|
-
!At && H > 0 && /* @__PURE__ */
|
|
1981
|
+
!At && H > 0 && /* @__PURE__ */ k("div", {
|
|
1989
1982
|
className: "absolute top-0 bottom-0 z-30 group/splitter",
|
|
1990
1983
|
style: {
|
|
1991
1984
|
left: H - 3,
|
|
@@ -1998,7 +1991,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
1998
1991
|
onPointerDown: (e) => {
|
|
1999
1992
|
if (e.button !== 0) return;
|
|
2000
1993
|
e.preventDefault();
|
|
2001
|
-
let t = e.clientX, n = H, r = Math.max(160,
|
|
1994
|
+
let t = e.clientX, n = H, r = Math.max(160, Le - 200), i = (e) => {
|
|
2002
1995
|
let i = Math.max(160, Math.min(n + (e.clientX - t), r));
|
|
2003
1996
|
Tt(i);
|
|
2004
1997
|
}, a = () => {
|
|
@@ -2007,72 +2000,72 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2007
2000
|
document.body.style.cursor = "col-resize", window.addEventListener("pointermove", i), window.addEventListener("pointerup", a), window.addEventListener("pointercancel", a);
|
|
2008
2001
|
},
|
|
2009
2002
|
onDoubleClick: () => Tt(null),
|
|
2010
|
-
children: /* @__PURE__ */
|
|
2003
|
+
children: /* @__PURE__ */ k("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" })
|
|
2011
2004
|
}),
|
|
2012
|
-
/* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ A("div", {
|
|
2013
2006
|
className: "flex border-b bg-muted/30 shrink-0 h-10 gantt-sm-h50",
|
|
2014
|
-
children: [/* @__PURE__ */
|
|
2007
|
+
children: [/* @__PURE__ */ A("div", {
|
|
2015
2008
|
className: "flex items-center font-medium text-xs text-muted-foreground px-2 sm:px-4 border-r bg-card z-20 shadow-sm",
|
|
2016
2009
|
style: {
|
|
2017
2010
|
width: H,
|
|
2018
2011
|
minWidth: H
|
|
2019
2012
|
},
|
|
2020
2013
|
children: [
|
|
2021
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ k("div", {
|
|
2022
2015
|
className: "flex-1 truncate",
|
|
2023
|
-
children:
|
|
2016
|
+
children: P("gantt.column.taskName")
|
|
2024
2017
|
}),
|
|
2025
|
-
Lt && /* @__PURE__ */
|
|
2018
|
+
Lt && /* @__PURE__ */ A(je, { children: [/* @__PURE__ */ k("div", {
|
|
2026
2019
|
className: "w-16 gantt-sm-w20 text-right",
|
|
2027
|
-
children:
|
|
2028
|
-
}), /* @__PURE__ */
|
|
2020
|
+
children: P("gantt.column.start")
|
|
2021
|
+
}), /* @__PURE__ */ k("div", {
|
|
2029
2022
|
className: "w-16 gantt-sm-w20 text-right",
|
|
2030
|
-
children:
|
|
2023
|
+
children: P("gantt.column.end")
|
|
2031
2024
|
})] }),
|
|
2032
|
-
o && /* @__PURE__ */
|
|
2025
|
+
o && /* @__PURE__ */ k("div", {
|
|
2033
2026
|
className: "w-6 shrink-0 hidden sm:block",
|
|
2034
2027
|
style: { marginLeft: 4 },
|
|
2035
2028
|
"aria-hidden": "true",
|
|
2036
2029
|
"data-testid": "gantt-header-open-spacer"
|
|
2037
2030
|
})
|
|
2038
2031
|
]
|
|
2039
|
-
}), /* @__PURE__ */
|
|
2032
|
+
}), /* @__PURE__ */ k("div", {
|
|
2040
2033
|
className: "flex-1 overflow-hidden",
|
|
2041
2034
|
ref: rr,
|
|
2042
|
-
children: /* @__PURE__ */
|
|
2035
|
+
children: /* @__PURE__ */ A("div", {
|
|
2043
2036
|
className: "flex flex-col h-full",
|
|
2044
2037
|
style: { width: Jn },
|
|
2045
|
-
children: [/* @__PURE__ */
|
|
2038
|
+
children: [/* @__PURE__ */ k("div", {
|
|
2046
2039
|
className: "relative border-b",
|
|
2047
2040
|
style: { height: "45%" },
|
|
2048
2041
|
"data-testid": "gantt-header-groups",
|
|
2049
|
-
children: tr.slice(_r.start, _r.end).map((e) => /* @__PURE__ */
|
|
2042
|
+
children: tr.slice(_r.start, _r.end).map((e) => /* @__PURE__ */ k("div", {
|
|
2050
2043
|
className: "absolute top-0 bottom-0 flex items-center justify-center border-r text-[10px] font-medium text-muted-foreground overflow-hidden",
|
|
2051
2044
|
style: {
|
|
2052
2045
|
left: e.offset,
|
|
2053
2046
|
width: e.width
|
|
2054
2047
|
},
|
|
2055
|
-
children: /* @__PURE__ */
|
|
2048
|
+
children: /* @__PURE__ */ k("span", {
|
|
2056
2049
|
className: "truncate px-1",
|
|
2057
2050
|
children: e.label
|
|
2058
2051
|
})
|
|
2059
2052
|
}, e.key))
|
|
2060
|
-
}), /* @__PURE__ */
|
|
2053
|
+
}), /* @__PURE__ */ k("div", {
|
|
2061
2054
|
className: "relative flex-1",
|
|
2062
2055
|
"data-testid": "gantt-header-units",
|
|
2063
2056
|
children: J.slice(hr.start, hr.end).map((e, t) => {
|
|
2064
2057
|
let n = hr.start + t;
|
|
2065
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ A("div", {
|
|
2066
2059
|
className: b("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"),
|
|
2067
2060
|
style: {
|
|
2068
2061
|
left: Y[n],
|
|
2069
2062
|
width: e.width,
|
|
2070
2063
|
backgroundColor: e.bandColor ? `color-mix(in srgb, ${e.bandColor} 16%, transparent)` : void 0
|
|
2071
2064
|
},
|
|
2072
|
-
children: [/* @__PURE__ */
|
|
2065
|
+
children: [/* @__PURE__ */ k("span", {
|
|
2073
2066
|
className: "font-medium text-foreground truncate",
|
|
2074
2067
|
children: e.label
|
|
2075
|
-
}), e.sublabel && Ft >= 32 && /* @__PURE__ */
|
|
2068
|
+
}), e.sublabel && Ft >= 32 && /* @__PURE__ */ k("span", {
|
|
2076
2069
|
className: "text-[10px] opacity-70",
|
|
2077
2070
|
children: e.sublabel
|
|
2078
2071
|
})]
|
|
@@ -2082,10 +2075,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2082
2075
|
})
|
|
2083
2076
|
})]
|
|
2084
2077
|
}),
|
|
2085
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ A("div", {
|
|
2086
2079
|
className: "flex flex-1 overflow-hidden",
|
|
2087
2080
|
children: [
|
|
2088
|
-
/* @__PURE__ */
|
|
2081
|
+
/* @__PURE__ */ A("div", {
|
|
2089
2082
|
className: "gantt-task-list overflow-y-auto overflow-x-hidden border-r bg-card z-10 shadow-sm",
|
|
2090
2083
|
ref: ir,
|
|
2091
2084
|
onScroll: qr,
|
|
@@ -2094,15 +2087,15 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2094
2087
|
minWidth: H
|
|
2095
2088
|
},
|
|
2096
2089
|
role: "tree",
|
|
2097
|
-
"aria-label":
|
|
2090
|
+
"aria-label": P("gantt.aria.taskList"),
|
|
2098
2091
|
children: [
|
|
2099
|
-
Q.startIdx > 0 && /* @__PURE__ */
|
|
2092
|
+
Q.startIdx > 0 && /* @__PURE__ */ k("div", {
|
|
2100
2093
|
style: { height: Q.startIdx * B },
|
|
2101
2094
|
"aria-hidden": "true"
|
|
2102
2095
|
}),
|
|
2103
2096
|
K.slice(Q.startIdx, Q.endIdx).map((e) => {
|
|
2104
2097
|
let t = e.task, n = gt && Rt === t.id, r = Bn.has(String(t.id)), i = Fn != null && String(Fn) === String(t.id);
|
|
2105
|
-
return /* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ A("div", {
|
|
2106
2099
|
className: b("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"),
|
|
2107
2100
|
style: {
|
|
2108
2101
|
height: B,
|
|
@@ -2132,7 +2125,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2132
2125
|
In(t.id), n || Ar(e.start, e.end, t.id);
|
|
2133
2126
|
},
|
|
2134
2127
|
onDoubleClick: () => {
|
|
2135
|
-
n || (gt &&
|
|
2128
|
+
n || (gt && R && !e.isSummary && !t.locked ? (zt(t.id), Vt({
|
|
2136
2129
|
title: t.title,
|
|
2137
2130
|
start: t.start.toLocaleDateString("en-CA"),
|
|
2138
2131
|
end: t.end.toLocaleDateString("en-CA"),
|
|
@@ -2140,11 +2133,11 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2140
2133
|
})) : o?.(t));
|
|
2141
2134
|
},
|
|
2142
2135
|
children: [
|
|
2143
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ A("div", {
|
|
2144
2137
|
className: "flex-1 truncate font-medium text-xs sm:text-sm flex items-center gap-2",
|
|
2145
2138
|
style: e.depth > 0 ? { paddingLeft: e.depth * 14 } : void 0,
|
|
2146
2139
|
children: [
|
|
2147
|
-
e.hasChildren ? /* @__PURE__ */
|
|
2140
|
+
e.hasChildren ? /* @__PURE__ */ k("button", {
|
|
2148
2141
|
type: "button",
|
|
2149
2142
|
className: "h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground",
|
|
2150
2143
|
style: { marginLeft: -4 },
|
|
@@ -2152,19 +2145,19 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2152
2145
|
e.stopPropagation(), Hn(t.id);
|
|
2153
2146
|
},
|
|
2154
2147
|
"aria-expanded": !r,
|
|
2155
|
-
"aria-label":
|
|
2148
|
+
"aria-label": P(r ? "gantt.row.expand" : "gantt.row.collapse"),
|
|
2156
2149
|
"data-testid": `gantt-row-toggle-${t.id}`,
|
|
2157
|
-
children:
|
|
2158
|
-
}) : /* @__PURE__ */
|
|
2150
|
+
children: k(r ? xe : ye, { className: "h-3.5 w-3.5" })
|
|
2151
|
+
}) : /* @__PURE__ */ k("span", {
|
|
2159
2152
|
className: "w-3 shrink-0",
|
|
2160
2153
|
style: { marginLeft: -4 },
|
|
2161
2154
|
"aria-hidden": "true"
|
|
2162
2155
|
}),
|
|
2163
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ k("div", {
|
|
2164
2157
|
className: "w-2 h-2 rounded-full shrink-0",
|
|
2165
2158
|
style: { backgroundColor: t.color || "#3b82f6" }
|
|
2166
2159
|
}),
|
|
2167
|
-
n ? /* @__PURE__ */
|
|
2160
|
+
n ? /* @__PURE__ */ k("input", {
|
|
2168
2161
|
className: "border rounded px-1 py-0.5 text-xs w-full bg-background",
|
|
2169
2162
|
value: Bt.title || "",
|
|
2170
2163
|
onChange: (e) => Vt((t) => ({
|
|
@@ -2184,20 +2177,20 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2184
2177
|
},
|
|
2185
2178
|
onClick: (e) => e.stopPropagation(),
|
|
2186
2179
|
autoFocus: !0
|
|
2187
|
-
}) : /* @__PURE__ */
|
|
2180
|
+
}) : /* @__PURE__ */ A("span", {
|
|
2188
2181
|
className: "flex flex-col min-w-0",
|
|
2189
|
-
children: [/* @__PURE__ */
|
|
2182
|
+
children: [/* @__PURE__ */ k("span", {
|
|
2190
2183
|
className: b("truncate", e.isSummary && "font-semibold"),
|
|
2191
2184
|
children: t.title
|
|
2192
|
-
}), /* @__PURE__ */
|
|
2185
|
+
}), /* @__PURE__ */ A("span", {
|
|
2193
2186
|
className: "text-[10px] text-muted-foreground gantt-sm-hidden",
|
|
2194
2187
|
children: [
|
|
2195
|
-
e.start.toLocaleDateString(
|
|
2188
|
+
e.start.toLocaleDateString(F, {
|
|
2196
2189
|
month: "numeric",
|
|
2197
2190
|
day: "numeric"
|
|
2198
2191
|
}),
|
|
2199
2192
|
" → ",
|
|
2200
|
-
e.end.toLocaleDateString(
|
|
2193
|
+
e.end.toLocaleDateString(F, {
|
|
2201
2194
|
month: "numeric",
|
|
2202
2195
|
day: "numeric"
|
|
2203
2196
|
})
|
|
@@ -2206,11 +2199,11 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2206
2199
|
})
|
|
2207
2200
|
]
|
|
2208
2201
|
}),
|
|
2209
|
-
/* @__PURE__ */
|
|
2202
|
+
/* @__PURE__ */ k("div", {
|
|
2210
2203
|
className: "w-16 gantt-sm-w20 text-right text-xs text-muted-foreground hidden sm:block",
|
|
2211
2204
|
hidden: !Lt,
|
|
2212
2205
|
style: Lt ? void 0 : { display: "none" },
|
|
2213
|
-
children: n ? /* @__PURE__ */
|
|
2206
|
+
children: n ? /* @__PURE__ */ k("input", {
|
|
2214
2207
|
type: "date",
|
|
2215
2208
|
className: "border rounded px-1 py-0.5 text-xs w-full bg-background",
|
|
2216
2209
|
value: Bt.start || "",
|
|
@@ -2219,16 +2212,16 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2219
2212
|
start: e.target.value
|
|
2220
2213
|
})),
|
|
2221
2214
|
onClick: (e) => e.stopPropagation()
|
|
2222
|
-
}) : e.start.toLocaleDateString(
|
|
2215
|
+
}) : e.start.toLocaleDateString(F, {
|
|
2223
2216
|
month: "numeric",
|
|
2224
2217
|
day: "numeric"
|
|
2225
2218
|
})
|
|
2226
2219
|
}),
|
|
2227
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ k("div", {
|
|
2228
2221
|
className: "w-16 gantt-sm-w20 text-right text-xs text-muted-foreground hidden sm:block",
|
|
2229
2222
|
hidden: !Lt,
|
|
2230
2223
|
style: Lt ? void 0 : { display: "none" },
|
|
2231
|
-
children: n ? /* @__PURE__ */
|
|
2224
|
+
children: n ? /* @__PURE__ */ k("input", {
|
|
2232
2225
|
type: "date",
|
|
2233
2226
|
className: "border rounded px-1 py-0.5 text-xs w-full bg-background",
|
|
2234
2227
|
value: Bt.end || "",
|
|
@@ -2237,36 +2230,36 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2237
2230
|
end: e.target.value
|
|
2238
2231
|
})),
|
|
2239
2232
|
onClick: (e) => e.stopPropagation()
|
|
2240
|
-
}) : e.end.toLocaleDateString(
|
|
2233
|
+
}) : e.end.toLocaleDateString(F, {
|
|
2241
2234
|
month: "numeric",
|
|
2242
2235
|
day: "numeric"
|
|
2243
2236
|
})
|
|
2244
2237
|
}),
|
|
2245
|
-
o && /* @__PURE__ */
|
|
2238
|
+
o && /* @__PURE__ */ k("div", {
|
|
2246
2239
|
className: "w-6 shrink-0 hidden sm:block",
|
|
2247
2240
|
style: { marginLeft: 4 },
|
|
2248
|
-
children: !n && /* @__PURE__ */
|
|
2241
|
+
children: !n && /* @__PURE__ */ k("button", {
|
|
2249
2242
|
type: "button",
|
|
2250
|
-
title:
|
|
2251
|
-
"aria-label":
|
|
2243
|
+
title: P("gantt.row.open"),
|
|
2244
|
+
"aria-label": P("gantt.row.open"),
|
|
2252
2245
|
"data-testid": `gantt-row-open-${t.id}`,
|
|
2253
2246
|
className: "gantt-row-open-btn h-6 w-6 rounded-md flex items-center justify-center hover:bg-accent text-muted-foreground hover:text-foreground",
|
|
2254
2247
|
onClick: (e) => {
|
|
2255
2248
|
e.stopPropagation(), o(t);
|
|
2256
2249
|
},
|
|
2257
|
-
children: /* @__PURE__ */
|
|
2250
|
+
children: /* @__PURE__ */ k(C, { className: "h-3.5 w-3.5" })
|
|
2258
2251
|
})
|
|
2259
2252
|
})
|
|
2260
2253
|
]
|
|
2261
2254
|
}, t.id);
|
|
2262
2255
|
}),
|
|
2263
|
-
Q.endIdx < K.length && /* @__PURE__ */
|
|
2256
|
+
Q.endIdx < K.length && /* @__PURE__ */ k("div", {
|
|
2264
2257
|
style: { height: (K.length - Q.endIdx) * B },
|
|
2265
2258
|
"aria-hidden": "true"
|
|
2266
2259
|
})
|
|
2267
2260
|
]
|
|
2268
2261
|
}),
|
|
2269
|
-
/* @__PURE__ */
|
|
2262
|
+
/* @__PURE__ */ k("div", {
|
|
2270
2263
|
className: "flex-1 overflow-auto bg-background/50 relative [-webkit-overflow-scrolling:touch]",
|
|
2271
2264
|
ref: (e) => {
|
|
2272
2265
|
ar.current = e, Z.current = e;
|
|
@@ -2276,28 +2269,28 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2276
2269
|
onTouchMove: wr,
|
|
2277
2270
|
onTouchEnd: Tr,
|
|
2278
2271
|
"data-testid": "gantt-timeline",
|
|
2279
|
-
children: /* @__PURE__ */
|
|
2272
|
+
children: /* @__PURE__ */ A("div", {
|
|
2280
2273
|
className: "relative",
|
|
2281
2274
|
style: { width: Jn },
|
|
2282
2275
|
children: [
|
|
2283
|
-
Er != null && /* @__PURE__ */
|
|
2276
|
+
Er != null && /* @__PURE__ */ k("div", {
|
|
2284
2277
|
className: "absolute top-0 bottom-0 w-px z-20 pointer-events-none",
|
|
2285
2278
|
style: {
|
|
2286
2279
|
left: Er,
|
|
2287
2280
|
backgroundColor: "rgba(239, 68, 68, 0.8)"
|
|
2288
2281
|
},
|
|
2289
2282
|
"data-testid": "gantt-today-marker",
|
|
2290
|
-
"aria-label":
|
|
2291
|
-
children: /* @__PURE__ */
|
|
2283
|
+
"aria-label": P("gantt.toolbar.today"),
|
|
2284
|
+
children: /* @__PURE__ */ k("div", {
|
|
2292
2285
|
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",
|
|
2293
2286
|
style: {
|
|
2294
2287
|
top: 2,
|
|
2295
2288
|
backgroundColor: "#ef4444"
|
|
2296
2289
|
},
|
|
2297
|
-
children:
|
|
2290
|
+
children: P("gantt.toolbar.today")
|
|
2298
2291
|
})
|
|
2299
2292
|
}),
|
|
2300
|
-
nr.map((e) => /* @__PURE__ */
|
|
2293
|
+
nr.map((e) => /* @__PURE__ */ k("div", {
|
|
2301
2294
|
className: "absolute top-0 bottom-0 w-px z-20 pointer-events-none",
|
|
2302
2295
|
style: {
|
|
2303
2296
|
left: e.left,
|
|
@@ -2305,7 +2298,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2305
2298
|
},
|
|
2306
2299
|
"data-testid": `gantt-marker-${e.index}`,
|
|
2307
2300
|
"aria-label": e.label,
|
|
2308
|
-
children: e.label && /* @__PURE__ */
|
|
2301
|
+
children: e.label && /* @__PURE__ */ k("div", {
|
|
2309
2302
|
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",
|
|
2310
2303
|
style: {
|
|
2311
2304
|
top: 2,
|
|
@@ -2314,16 +2307,16 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2314
2307
|
children: e.label
|
|
2315
2308
|
})
|
|
2316
2309
|
}, e.index)),
|
|
2317
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ A("div", {
|
|
2318
2311
|
className: "relative",
|
|
2319
2312
|
ref: xn,
|
|
2320
2313
|
children: [
|
|
2321
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ k("div", {
|
|
2322
2315
|
className: "absolute inset-0 pointer-events-none",
|
|
2323
2316
|
style: { zIndex: 0 },
|
|
2324
2317
|
children: J.slice(hr.start, hr.end).map((e, t) => {
|
|
2325
2318
|
let n = hr.start + t;
|
|
2326
|
-
return /* @__PURE__ */
|
|
2319
|
+
return /* @__PURE__ */ k("div", {
|
|
2327
2320
|
className: "absolute top-0 bottom-0 border-r",
|
|
2328
2321
|
style: {
|
|
2329
2322
|
left: Y[n],
|
|
@@ -2333,14 +2326,14 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2333
2326
|
}, n);
|
|
2334
2327
|
})
|
|
2335
2328
|
}),
|
|
2336
|
-
Gn && v && v.showMidnight && /* @__PURE__ */
|
|
2329
|
+
Gn && v && v.showMidnight && /* @__PURE__ */ k("div", {
|
|
2337
2330
|
className: "absolute inset-0 pointer-events-none",
|
|
2338
2331
|
style: { zIndex: 0 },
|
|
2339
2332
|
children: J.slice(hr.start, hr.end).map((e, t) => {
|
|
2340
2333
|
let n = hr.start + t, r = e.realMs ?? 0;
|
|
2341
2334
|
if (!r) return null;
|
|
2342
2335
|
let i = e.date.getTime(), a = e.date, o = new Date(a.getFullYear(), a.getMonth(), a.getDate() + 1, 0, 0, 0, 0).getTime();
|
|
2343
|
-
return o <= i || o >= i + r ? null : /* @__PURE__ */
|
|
2336
|
+
return o <= i || o >= i + r ? null : /* @__PURE__ */ k("div", {
|
|
2344
2337
|
className: "absolute top-0 bottom-0",
|
|
2345
2338
|
style: {
|
|
2346
2339
|
left: Y[n] + (o - i) / r * e.width,
|
|
@@ -2351,12 +2344,12 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2351
2344
|
}, `midnight-${n}`);
|
|
2352
2345
|
})
|
|
2353
2346
|
}),
|
|
2354
|
-
Q.startIdx > 0 && /* @__PURE__ */
|
|
2347
|
+
Q.startIdx > 0 && /* @__PURE__ */ k("div", {
|
|
2355
2348
|
style: { height: Q.startIdx * B },
|
|
2356
2349
|
"aria-hidden": "true"
|
|
2357
2350
|
}),
|
|
2358
2351
|
K.slice(Q.startIdx, Q.endIdx).map((t, n) => {
|
|
2359
|
-
let r = t.task, i = Q.startIdx + n, a = gi(r.id), o = Jr(t.start, t.end), s = ne && r.baselineStart && r.baselineEnd ? Jr(r.baselineStart, r.baselineEnd) : null, c = s ? /* @__PURE__ */
|
|
2352
|
+
let r = t.task, i = Q.startIdx + n, a = gi(r.id), o = Jr(t.start, t.end), s = ne && r.baselineStart && r.baselineEnd ? Jr(r.baselineStart, r.baselineEnd) : null, c = s ? /* @__PURE__ */ k("div", {
|
|
2360
2353
|
className: "absolute pointer-events-none rounded-[1px]",
|
|
2361
2354
|
style: {
|
|
2362
2355
|
left: s.left,
|
|
@@ -2368,7 +2361,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2368
2361
|
},
|
|
2369
2362
|
"data-testid": `gantt-baseline-${r.id}`,
|
|
2370
2363
|
"aria-hidden": "true"
|
|
2371
|
-
}) : null, l = W?.taskId === r.id, u = Xr?.has(String(r.id)) ?? !1, d = Zr?.has(String(r.id)) ?? !1, f = l || u || d ? Qr(t) : o, p = !!r.locked, m = !!
|
|
2364
|
+
}) : null, l = W?.taskId === r.id, u = Xr?.has(String(r.id)) ?? !1, d = Zr?.has(String(r.id)) ?? !1, f = l || u || d ? Qr(t) : o, p = !!r.locked, m = !!R && !t.isSummary && !p, h = m && He, g = m && Ue, ee = m && We, te = h || g, _ = L || p, v = G != null && G.targetId != null && String(G.targetId) === String(r.id) && String(G.sourceId) !== String(r.id), re = G ? (e) => {
|
|
2372
2365
|
let t = e.currentTarget.getBoundingClientRect(), n = t.width > 0 && e.clientX - t.left > t.width / 2 ? "end" : "start";
|
|
2373
2366
|
Sn((e) => e && bn(e.sourceId, r) ? {
|
|
2374
2367
|
...e,
|
|
@@ -2381,7 +2374,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2381
2374
|
targetId: null,
|
|
2382
2375
|
targetEnd: null
|
|
2383
2376
|
});
|
|
2384
|
-
} : void 0, ae = Math.max(1, Math.round((t.end.getTime() - t.start.getTime()) / rt)), oe = (i + 1) * B + 300 > vr && i * B > 300, se = Ht === r.id && !W && !gn && !G ? /* @__PURE__ */
|
|
2377
|
+
} : void 0, ae = Math.max(1, Math.round((t.end.getTime() - t.start.getTime()) / rt)), oe = (i + 1) * B + 300 > vr && i * B > 300, se = Ht === r.id && !W && !gn && !G ? /* @__PURE__ */ A("div", {
|
|
2385
2378
|
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",
|
|
2386
2379
|
style: {
|
|
2387
2380
|
left: Math.max(f.left + 8, 4),
|
|
@@ -2390,11 +2383,11 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2390
2383
|
role: "tooltip",
|
|
2391
2384
|
"data-testid": `gantt-tooltip-${r.id}`,
|
|
2392
2385
|
children: [
|
|
2393
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ k("div", {
|
|
2394
2387
|
className: "font-semibold",
|
|
2395
2388
|
children: r.title
|
|
2396
2389
|
}),
|
|
2397
|
-
r.fields && r.fields.length > 0 ? /* @__PURE__ */
|
|
2390
|
+
r.fields && r.fields.length > 0 ? /* @__PURE__ */ k("div", {
|
|
2398
2391
|
style: {
|
|
2399
2392
|
display: "grid",
|
|
2400
2393
|
gridTemplateColumns: "auto 1fr",
|
|
@@ -2402,56 +2395,56 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2402
2395
|
rowGap: 2,
|
|
2403
2396
|
marginTop: 4
|
|
2404
2397
|
},
|
|
2405
|
-
children: r.fields.map((t, n) => /* @__PURE__ */
|
|
2398
|
+
children: r.fields.map((t, n) => /* @__PURE__ */ A(e.Fragment, { children: [/* @__PURE__ */ k("span", {
|
|
2406
2399
|
className: "text-muted-foreground",
|
|
2407
2400
|
children: t.label
|
|
2408
|
-
}), /* @__PURE__ */
|
|
2401
|
+
}), /* @__PURE__ */ k("span", {
|
|
2409
2402
|
style: { fontWeight: 500 },
|
|
2410
2403
|
children: t.value
|
|
2411
2404
|
})] }, n))
|
|
2412
|
-
}) : /* @__PURE__ */
|
|
2405
|
+
}) : /* @__PURE__ */ A("div", {
|
|
2413
2406
|
className: "text-muted-foreground",
|
|
2414
2407
|
children: [
|
|
2415
|
-
t.start.toLocaleDateString(
|
|
2408
|
+
t.start.toLocaleDateString(F, {
|
|
2416
2409
|
month: "short",
|
|
2417
2410
|
day: "numeric"
|
|
2418
2411
|
}),
|
|
2419
2412
|
" → ",
|
|
2420
|
-
t.end.toLocaleDateString(
|
|
2413
|
+
t.end.toLocaleDateString(F, {
|
|
2421
2414
|
month: "short",
|
|
2422
2415
|
day: "numeric"
|
|
2423
2416
|
}),
|
|
2424
2417
|
" · ",
|
|
2425
2418
|
ae,
|
|
2426
|
-
|
|
2419
|
+
P("gantt.tooltip.days"),
|
|
2427
2420
|
" · ",
|
|
2428
2421
|
Math.round(t.progress),
|
|
2429
2422
|
"%"
|
|
2430
2423
|
]
|
|
2431
2424
|
}),
|
|
2432
|
-
r.locked ||
|
|
2425
|
+
r.locked || L && !R ? /* @__PURE__ */ A("div", {
|
|
2433
2426
|
className: "text-muted-foreground",
|
|
2434
2427
|
style: { marginTop: 4 },
|
|
2435
2428
|
"data-testid": `gantt-tooltip-locked-${r.id}`,
|
|
2436
|
-
children: ["🚫 ",
|
|
2429
|
+
children: ["🚫 ", P("gantt.lockedHint")]
|
|
2437
2430
|
}) : null
|
|
2438
2431
|
]
|
|
2439
2432
|
}) : null;
|
|
2440
|
-
if (r.type === "group") return /* @__PURE__ */
|
|
2433
|
+
if (r.type === "group") return /* @__PURE__ */ k("div", {
|
|
2441
2434
|
className: "relative border-b hover:bg-accent/50",
|
|
2442
2435
|
style: { height: B },
|
|
2443
2436
|
onPointerMove: ie,
|
|
2444
2437
|
children: se
|
|
2445
2438
|
}, r.id);
|
|
2446
2439
|
if (t.isSummary) {
|
|
2447
|
-
let e = r.color || "#0d9488", n = ce === "self" && r.hasOwnDates !== !1, i = !!
|
|
2448
|
-
return /* @__PURE__ */
|
|
2440
|
+
let e = r.color || "#0d9488", n = ce === "self" && r.hasOwnDates !== !1, i = !!R && He && !p, o = !!R && Ue && n && !p;
|
|
2441
|
+
return /* @__PURE__ */ A("div", {
|
|
2449
2442
|
className: "relative border-b hover:bg-accent/50",
|
|
2450
2443
|
style: { height: B },
|
|
2451
2444
|
onPointerMove: ie,
|
|
2452
2445
|
children: [
|
|
2453
2446
|
c,
|
|
2454
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ A("div", {
|
|
2455
2448
|
className: b("gantt-bar-hover absolute rounded-sm border shadow-sm flex items-center px-2 select-none group", i && "cursor-grab active:cursor-grabbing", l && "ring-2 ring-primary z-10", v && "ring-2 ring-primary", or === r.id && "gantt-flash z-10"),
|
|
2456
2449
|
style: {
|
|
2457
2450
|
left: f.left,
|
|
@@ -2472,7 +2465,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2472
2465
|
onPointerDown: (e) => {
|
|
2473
2466
|
if (e.button === 0) {
|
|
2474
2467
|
if (o) {
|
|
2475
|
-
let t =
|
|
2468
|
+
let t = Xe(e.clientX, e.currentTarget.getBoundingClientRect());
|
|
2476
2469
|
if (t !== "move") {
|
|
2477
2470
|
hn(r, t, e);
|
|
2478
2471
|
return;
|
|
@@ -2490,7 +2483,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2490
2483
|
},
|
|
2491
2484
|
onContextMenu: (e) => Rn(r, e),
|
|
2492
2485
|
children: [
|
|
2493
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ k("div", {
|
|
2494
2487
|
className: "absolute left-0 top-0 bottom-0 pointer-events-none",
|
|
2495
2488
|
style: {
|
|
2496
2489
|
width: `${Math.round(t.progress)}%`,
|
|
@@ -2499,10 +2492,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2499
2492
|
borderBottomLeftRadius: "var(--radius-sm)"
|
|
2500
2493
|
}
|
|
2501
2494
|
}),
|
|
2502
|
-
o && f.width >= 14 && /* @__PURE__ */
|
|
2495
|
+
o && f.width >= 14 && /* @__PURE__ */ A(je, { children: [/* @__PURE__ */ k("div", {
|
|
2503
2496
|
className: "gantt-resize-handle absolute left-0 top-0",
|
|
2504
2497
|
style: {
|
|
2505
|
-
width:
|
|
2498
|
+
width: Ye,
|
|
2506
2499
|
height: ni,
|
|
2507
2500
|
cursor: "ew-resize"
|
|
2508
2501
|
},
|
|
@@ -2511,10 +2504,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2511
2504
|
e.button === 0 && hn(r, "resize-left", e);
|
|
2512
2505
|
},
|
|
2513
2506
|
onClick: (e) => e.stopPropagation()
|
|
2514
|
-
}), /* @__PURE__ */
|
|
2507
|
+
}), /* @__PURE__ */ k("div", {
|
|
2515
2508
|
className: "gantt-resize-handle absolute right-0 top-0",
|
|
2516
2509
|
style: {
|
|
2517
|
-
width:
|
|
2510
|
+
width: Ye,
|
|
2518
2511
|
height: ni,
|
|
2519
2512
|
cursor: "ew-resize"
|
|
2520
2513
|
},
|
|
@@ -2524,13 +2517,13 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2524
2517
|
},
|
|
2525
2518
|
onClick: (e) => e.stopPropagation()
|
|
2526
2519
|
})] }),
|
|
2527
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ k("span", {
|
|
2528
2521
|
className: "relative text-[10px] text-white font-medium truncate pointer-events-none",
|
|
2529
2522
|
children: r.title
|
|
2530
2523
|
}),
|
|
2531
2524
|
z && !p && ["start", "end"].map((e) => {
|
|
2532
2525
|
let t = G != null && String(G.sourceId) === String(r.id) && G.sourceEnd === e, n = t || Ht === r.id, i = n && G == null;
|
|
2533
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ k("div", {
|
|
2534
2527
|
className: "absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity",
|
|
2535
2528
|
style: {
|
|
2536
2529
|
[e === "start" ? "left" : "right"]: -28,
|
|
@@ -2558,7 +2551,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2558
2551
|
});
|
|
2559
2552
|
},
|
|
2560
2553
|
onClick: (e) => e.stopPropagation(),
|
|
2561
|
-
children: /* @__PURE__ */
|
|
2554
|
+
children: /* @__PURE__ */ k("div", {
|
|
2562
2555
|
className: "rounded-full",
|
|
2563
2556
|
style: {
|
|
2564
2557
|
height: 12,
|
|
@@ -2572,7 +2565,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2572
2565
|
})
|
|
2573
2566
|
]
|
|
2574
2567
|
}),
|
|
2575
|
-
l && W && /* @__PURE__ */
|
|
2568
|
+
l && W && /* @__PURE__ */ A("div", {
|
|
2576
2569
|
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",
|
|
2577
2570
|
style: {
|
|
2578
2571
|
left: Math.max(f.left, 4),
|
|
@@ -2580,12 +2573,12 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2580
2573
|
},
|
|
2581
2574
|
"data-testid": `gantt-summary-drag-chip-${r.id}`,
|
|
2582
2575
|
children: [
|
|
2583
|
-
Xt(W).start.toLocaleDateString(
|
|
2576
|
+
Xt(W).start.toLocaleDateString(F, {
|
|
2584
2577
|
month: "numeric",
|
|
2585
2578
|
day: "numeric"
|
|
2586
2579
|
}),
|
|
2587
2580
|
" → ",
|
|
2588
|
-
Xt(W).end.toLocaleDateString(
|
|
2581
|
+
Xt(W).end.toLocaleDateString(F, {
|
|
2589
2582
|
month: "numeric",
|
|
2590
2583
|
day: "numeric"
|
|
2591
2584
|
})
|
|
@@ -2597,13 +2590,13 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2597
2590
|
}
|
|
2598
2591
|
if (t.isMilestone) {
|
|
2599
2592
|
let e = ri;
|
|
2600
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ A("div", {
|
|
2601
2594
|
className: "relative border-b hover:bg-accent/50",
|
|
2602
2595
|
style: { height: B },
|
|
2603
2596
|
onPointerMove: ie,
|
|
2604
2597
|
children: [
|
|
2605
2598
|
c,
|
|
2606
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ k("div", {
|
|
2607
2600
|
className: b("gantt-bar-hover absolute rotate-45 rounded-[2px] border shadow-sm select-none", h && "cursor-grab active:cursor-grabbing", l && "ring-2 ring-primary z-10", v && "ring-2 ring-primary", or === r.id && "gantt-flash z-10"),
|
|
2608
2601
|
style: {
|
|
2609
2602
|
left: f.left - e / 2,
|
|
@@ -2633,14 +2626,14 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2633
2626
|
}, r.id);
|
|
2634
2627
|
}
|
|
2635
2628
|
let le = gn && gn.taskId === r.id ? gn.value : r.progress;
|
|
2636
|
-
return /* @__PURE__ */
|
|
2629
|
+
return /* @__PURE__ */ A("div", {
|
|
2637
2630
|
className: "relative border-b hover:bg-accent/50",
|
|
2638
2631
|
style: { height: B },
|
|
2639
2632
|
onPointerMove: ie,
|
|
2640
2633
|
onMouseEnter: () => Ut(r.id),
|
|
2641
2634
|
onMouseLeave: () => Ut((e) => e === r.id ? null : e),
|
|
2642
2635
|
children: [
|
|
2643
|
-
l && /* @__PURE__ */
|
|
2636
|
+
l && /* @__PURE__ */ k("div", {
|
|
2644
2637
|
className: "absolute rounded-sm border border-dashed pointer-events-none",
|
|
2645
2638
|
style: {
|
|
2646
2639
|
left: o.left,
|
|
@@ -2653,7 +2646,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2653
2646
|
"aria-hidden": "true"
|
|
2654
2647
|
}),
|
|
2655
2648
|
c,
|
|
2656
|
-
/* @__PURE__ */
|
|
2649
|
+
/* @__PURE__ */ A("div", {
|
|
2657
2650
|
className: b("gantt-bar-hover absolute rounded-sm bg-primary border shadow-sm flex items-center px-2 group select-none", te && "cursor-grab active:cursor-grabbing", l && "ring-2 ring-primary z-10", v && "ring-2 ring-primary", or === r.id && "gantt-flash z-10"),
|
|
2658
2651
|
style: {
|
|
2659
2652
|
left: f.left,
|
|
@@ -2674,14 +2667,14 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2674
2667
|
onPointerMove: re,
|
|
2675
2668
|
onPointerDown: te ? (e) => {
|
|
2676
2669
|
if (e.button !== 0) return;
|
|
2677
|
-
let t =
|
|
2670
|
+
let t = Xe(e.clientX, e.currentTarget.getBoundingClientRect()), n = t !== "move" && g ? t : h ? "move" : null;
|
|
2678
2671
|
n && hn(r, n, e);
|
|
2679
2672
|
} : void 0,
|
|
2680
2673
|
children: [
|
|
2681
|
-
g && f.width >= 14 && /* @__PURE__ */
|
|
2674
|
+
g && f.width >= 14 && /* @__PURE__ */ A(je, { children: [/* @__PURE__ */ k("div", {
|
|
2682
2675
|
className: "gantt-resize-handle absolute left-0 top-0",
|
|
2683
2676
|
style: {
|
|
2684
|
-
width:
|
|
2677
|
+
width: Ye,
|
|
2685
2678
|
height: ni,
|
|
2686
2679
|
cursor: "ew-resize"
|
|
2687
2680
|
},
|
|
@@ -2690,10 +2683,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2690
2683
|
e.button === 0 && hn(r, "resize-left", e);
|
|
2691
2684
|
},
|
|
2692
2685
|
onClick: (e) => e.stopPropagation()
|
|
2693
|
-
}), /* @__PURE__ */
|
|
2686
|
+
}), /* @__PURE__ */ k("div", {
|
|
2694
2687
|
className: "gantt-resize-handle absolute right-0 top-0",
|
|
2695
2688
|
style: {
|
|
2696
|
-
width:
|
|
2689
|
+
width: Ye,
|
|
2697
2690
|
height: ni,
|
|
2698
2691
|
cursor: "ew-resize"
|
|
2699
2692
|
},
|
|
@@ -2703,7 +2696,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2703
2696
|
},
|
|
2704
2697
|
onClick: (e) => e.stopPropagation()
|
|
2705
2698
|
})] }),
|
|
2706
|
-
le > 0 && /* @__PURE__ */
|
|
2699
|
+
le > 0 && /* @__PURE__ */ k("div", {
|
|
2707
2700
|
className: "absolute left-0 top-0 bottom-0 pointer-events-none",
|
|
2708
2701
|
style: {
|
|
2709
2702
|
width: `${le}%`,
|
|
@@ -2712,7 +2705,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2712
2705
|
borderBottomLeftRadius: "var(--radius-sm)"
|
|
2713
2706
|
}
|
|
2714
2707
|
}),
|
|
2715
|
-
ee && f.width >= 30 && /* @__PURE__ */
|
|
2708
|
+
ee && f.width >= 30 && /* @__PURE__ */ k("div", {
|
|
2716
2709
|
className: b("absolute bottom-0 h-1/2 w-4 -translate-x-1/2 cursor-col-resize flex items-end justify-center pb-px", gn?.taskId === r.id ? "opacity-100" : "opacity-0 group-hover:opacity-100 transition-opacity"),
|
|
2717
2710
|
style: { left: `${le}%` },
|
|
2718
2711
|
"data-testid": `gantt-progress-handle-${r.id}`,
|
|
@@ -2726,7 +2719,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2726
2719
|
}));
|
|
2727
2720
|
},
|
|
2728
2721
|
onClick: (e) => e.stopPropagation(),
|
|
2729
|
-
children: /* @__PURE__ */
|
|
2722
|
+
children: /* @__PURE__ */ k("div", { style: {
|
|
2730
2723
|
width: 0,
|
|
2731
2724
|
height: 0,
|
|
2732
2725
|
borderLeft: "5px solid transparent",
|
|
@@ -2737,7 +2730,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2737
2730
|
}),
|
|
2738
2731
|
z && !p && ["start", "end"].map((e) => {
|
|
2739
2732
|
let t = G != null && String(G.sourceId) === String(r.id) && G.sourceEnd === e, n = t || Ht === r.id, i = n && G == null;
|
|
2740
|
-
return /* @__PURE__ */
|
|
2733
|
+
return /* @__PURE__ */ k("div", {
|
|
2741
2734
|
className: "absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity",
|
|
2742
2735
|
style: {
|
|
2743
2736
|
[e === "start" ? "left" : "right"]: -28,
|
|
@@ -2765,7 +2758,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2765
2758
|
});
|
|
2766
2759
|
},
|
|
2767
2760
|
onClick: (e) => e.stopPropagation(),
|
|
2768
|
-
children: /* @__PURE__ */
|
|
2761
|
+
children: /* @__PURE__ */ k("div", {
|
|
2769
2762
|
className: "rounded-full",
|
|
2770
2763
|
style: {
|
|
2771
2764
|
height: 12,
|
|
@@ -2777,16 +2770,16 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2777
2770
|
})
|
|
2778
2771
|
}, e);
|
|
2779
2772
|
}),
|
|
2780
|
-
/* @__PURE__ */
|
|
2773
|
+
/* @__PURE__ */ k("span", {
|
|
2781
2774
|
className: "relative text-[10px] text-white font-medium truncate pointer-events-none group-hover:opacity-0 transition-opacity",
|
|
2782
2775
|
children: r.title
|
|
2783
2776
|
}),
|
|
2784
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ k("span", {
|
|
2785
2778
|
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",
|
|
2786
|
-
children: l ? `${Xt(W).start.toLocaleDateString(
|
|
2779
|
+
children: l ? `${Xt(W).start.toLocaleDateString(F, {
|
|
2787
2780
|
month: "numeric",
|
|
2788
2781
|
day: "numeric"
|
|
2789
|
-
})} → ${Xt(W).end.toLocaleDateString(
|
|
2782
|
+
})} → ${Xt(W).end.toLocaleDateString(F, {
|
|
2790
2783
|
month: "numeric",
|
|
2791
2784
|
day: "numeric"
|
|
2792
2785
|
})}` : `${Math.round(le)}%`
|
|
@@ -2797,19 +2790,19 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2797
2790
|
]
|
|
2798
2791
|
}, r.id);
|
|
2799
2792
|
}),
|
|
2800
|
-
Q.endIdx < K.length && /* @__PURE__ */
|
|
2793
|
+
Q.endIdx < K.length && /* @__PURE__ */ k("div", {
|
|
2801
2794
|
style: { height: (K.length - Q.endIdx) * B },
|
|
2802
2795
|
"aria-hidden": "true"
|
|
2803
2796
|
}),
|
|
2804
|
-
($r.length > 0 || G) && /* @__PURE__ */
|
|
2797
|
+
($r.length > 0 || G) && /* @__PURE__ */ A("svg", {
|
|
2805
2798
|
className: "absolute top-0 left-0 pointer-events-none z-10",
|
|
2806
2799
|
width: Jn,
|
|
2807
2800
|
height: vr,
|
|
2808
2801
|
"data-testid": "gantt-links",
|
|
2809
2802
|
"aria-hidden": "true",
|
|
2810
2803
|
children: [
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2804
|
+
/* @__PURE__ */ A("defs", { children: [
|
|
2805
|
+
/* @__PURE__ */ k("marker", {
|
|
2813
2806
|
id: "gantt-link-arrow",
|
|
2814
2807
|
viewBox: "0 0 8 8",
|
|
2815
2808
|
refX: "7",
|
|
@@ -2817,12 +2810,12 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2817
2810
|
markerWidth: "6",
|
|
2818
2811
|
markerHeight: "6",
|
|
2819
2812
|
orient: "auto",
|
|
2820
|
-
children: /* @__PURE__ */
|
|
2813
|
+
children: /* @__PURE__ */ k("path", {
|
|
2821
2814
|
d: "M 0 0 L 8 4 L 0 8 z",
|
|
2822
2815
|
fill: "hsl(var(--muted-foreground))"
|
|
2823
2816
|
})
|
|
2824
2817
|
}),
|
|
2825
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ k("marker", {
|
|
2826
2819
|
id: "gantt-link-arrow-active",
|
|
2827
2820
|
viewBox: "0 0 8 8",
|
|
2828
2821
|
refX: "7",
|
|
@@ -2830,12 +2823,12 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2830
2823
|
markerWidth: "6",
|
|
2831
2824
|
markerHeight: "6",
|
|
2832
2825
|
orient: "auto",
|
|
2833
|
-
children: /* @__PURE__ */
|
|
2826
|
+
children: /* @__PURE__ */ k("path", {
|
|
2834
2827
|
d: "M 0 0 L 8 4 L 0 8 z",
|
|
2835
2828
|
fill: "hsl(var(--primary))"
|
|
2836
2829
|
})
|
|
2837
2830
|
}),
|
|
2838
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ k("marker", {
|
|
2839
2832
|
id: "gantt-link-arrow-critical",
|
|
2840
2833
|
viewBox: "0 0 8 8",
|
|
2841
2834
|
refX: "7",
|
|
@@ -2843,7 +2836,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2843
2836
|
markerWidth: "6",
|
|
2844
2837
|
markerHeight: "6",
|
|
2845
2838
|
orient: "auto",
|
|
2846
|
-
children: /* @__PURE__ */
|
|
2839
|
+
children: /* @__PURE__ */ k("path", {
|
|
2847
2840
|
d: "M 0 0 L 8 4 L 0 8 z",
|
|
2848
2841
|
fill: $
|
|
2849
2842
|
})
|
|
@@ -2855,7 +2848,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2855
2848
|
let r = di(t);
|
|
2856
2849
|
if (!r) return null;
|
|
2857
2850
|
let i = fi != null && (String(t.sourceId) === String(fi) || String(t.targetId) === String(fi)), a = hi?.criticalEdges.has(`${String(t.sourceId)}->${String(t.targetId)}`) ?? !1, o = a ? "gantt-link-arrow-critical" : i ? "gantt-link-arrow-active" : "gantt-link-arrow", s = !!(ft || z);
|
|
2858
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ A(e.Fragment, { children: [/* @__PURE__ */ k("path", {
|
|
2859
2852
|
d: r,
|
|
2860
2853
|
fill: "none",
|
|
2861
2854
|
stroke: a ? $ : i ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))",
|
|
@@ -2866,7 +2859,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2866
2859
|
"data-link-type": t.type,
|
|
2867
2860
|
"data-active": i ? "true" : "false",
|
|
2868
2861
|
"data-critical": a ? "true" : void 0
|
|
2869
|
-
}), s && /* @__PURE__ */
|
|
2862
|
+
}), s && /* @__PURE__ */ k("path", {
|
|
2870
2863
|
d: r,
|
|
2871
2864
|
fill: "none",
|
|
2872
2865
|
stroke: "transparent",
|
|
@@ -2883,7 +2876,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2883
2876
|
let e = K.findIndex((e) => String(e.task.id) === String(G.sourceId));
|
|
2884
2877
|
if (e < 0) return null;
|
|
2885
2878
|
let t = Qr(K[e]), n = K[e].isMilestone ? t.left + (G.sourceEnd === "start" ? -ii : ii) : G.sourceEnd === "start" ? t.left : t.left + t.width, r = e * B + B / 2;
|
|
2886
|
-
return /* @__PURE__ */
|
|
2879
|
+
return /* @__PURE__ */ k("path", {
|
|
2887
2880
|
d: `M ${Math.round(n)} ${Math.round(r)} L ${Math.round(G.x)} ${Math.round(G.y)}`,
|
|
2888
2881
|
fill: "none",
|
|
2889
2882
|
stroke: "hsl(var(--primary))",
|
|
@@ -2895,10 +2888,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2895
2888
|
]
|
|
2896
2889
|
}),
|
|
2897
2890
|
G && (() => {
|
|
2898
|
-
let e =
|
|
2891
|
+
let e = j.find((e) => String(e.id) === String(G.sourceId));
|
|
2899
2892
|
if (!e) return null;
|
|
2900
|
-
let t = G.targetId == null ? null :
|
|
2901
|
-
return /* @__PURE__ */
|
|
2893
|
+
let t = G.targetId == null ? null : j.find((e) => String(e.id) === String(G.targetId)), n = (e) => P(`gantt.linkEnd.${e}`), r = t ? `${e.title} (${n(G.sourceEnd)}) → ${t.title} (${n(G.targetEnd ?? "start")})` : `${e.title} (${n(G.sourceEnd)})`;
|
|
2894
|
+
return /* @__PURE__ */ k("div", {
|
|
2902
2895
|
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",
|
|
2903
2896
|
style: {
|
|
2904
2897
|
left: G.x + 12,
|
|
@@ -2913,7 +2906,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2913
2906
|
]
|
|
2914
2907
|
})
|
|
2915
2908
|
}),
|
|
2916
|
-
/* @__PURE__ */
|
|
2909
|
+
/* @__PURE__ */ k("div", {
|
|
2917
2910
|
ref: Lr,
|
|
2918
2911
|
className: "shrink-0 border-l bg-card/95 select-none",
|
|
2919
2912
|
style: {
|
|
@@ -2921,14 +2914,14 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2921
2914
|
display: "none"
|
|
2922
2915
|
},
|
|
2923
2916
|
"data-testid": "gantt-vscrollbar",
|
|
2924
|
-
children: /* @__PURE__ */
|
|
2917
|
+
children: /* @__PURE__ */ k("div", {
|
|
2925
2918
|
ref: Rr,
|
|
2926
2919
|
className: "relative h-full",
|
|
2927
2920
|
onPointerDown: Gr,
|
|
2928
2921
|
role: "scrollbar",
|
|
2929
2922
|
"aria-controls": "gantt-timeline",
|
|
2930
2923
|
"aria-orientation": "vertical",
|
|
2931
|
-
children: /* @__PURE__ */
|
|
2924
|
+
children: /* @__PURE__ */ k("div", {
|
|
2932
2925
|
ref: zr,
|
|
2933
2926
|
className: "absolute rounded-full",
|
|
2934
2927
|
style: {
|
|
@@ -2946,7 +2939,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2946
2939
|
})
|
|
2947
2940
|
]
|
|
2948
2941
|
}),
|
|
2949
|
-
/* @__PURE__ */
|
|
2942
|
+
/* @__PURE__ */ k("div", {
|
|
2950
2943
|
ref: Nr,
|
|
2951
2944
|
className: "shrink-0 border-t bg-card/95 select-none",
|
|
2952
2945
|
style: {
|
|
@@ -2956,7 +2949,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2956
2949
|
display: "none"
|
|
2957
2950
|
},
|
|
2958
2951
|
"data-testid": "gantt-hscrollbar",
|
|
2959
|
-
children: /* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ k("div", {
|
|
2960
2953
|
ref: Pr,
|
|
2961
2954
|
className: "relative",
|
|
2962
2955
|
style: {
|
|
@@ -2967,7 +2960,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2967
2960
|
role: "scrollbar",
|
|
2968
2961
|
"aria-controls": "gantt-timeline",
|
|
2969
2962
|
"aria-orientation": "horizontal",
|
|
2970
|
-
children: /* @__PURE__ */
|
|
2963
|
+
children: /* @__PURE__ */ k("div", {
|
|
2971
2964
|
ref: Fr,
|
|
2972
2965
|
className: "absolute rounded-full",
|
|
2973
2966
|
style: {
|
|
@@ -2986,10 +2979,10 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2986
2979
|
]
|
|
2987
2980
|
}),
|
|
2988
2981
|
wn && (() => {
|
|
2989
|
-
let e =
|
|
2982
|
+
let e = j.find((e) => String(e.id) === String(wn.taskId));
|
|
2990
2983
|
if (!e) return null;
|
|
2991
2984
|
let t = K.find((e) => String(e.task.id) === String(wn.taskId)), n = "w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none";
|
|
2992
|
-
return /* @__PURE__ */
|
|
2985
|
+
return /* @__PURE__ */ A("div", {
|
|
2993
2986
|
ref: En,
|
|
2994
2987
|
className: "fixed z-50 min-w-[160px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm",
|
|
2995
2988
|
style: {
|
|
@@ -2999,7 +2992,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
2999
2992
|
role: "menu",
|
|
3000
2993
|
"data-testid": "gantt-context-menu",
|
|
3001
2994
|
children: [
|
|
3002
|
-
o && /* @__PURE__ */
|
|
2995
|
+
o && /* @__PURE__ */ k("button", {
|
|
3003
2996
|
type: "button",
|
|
3004
2997
|
role: "menuitem",
|
|
3005
2998
|
className: n,
|
|
@@ -3007,9 +3000,9 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3007
3000
|
onClick: () => {
|
|
3008
3001
|
Tn(null), o(e);
|
|
3009
3002
|
},
|
|
3010
|
-
children:
|
|
3003
|
+
children: P("gantt.menu.view")
|
|
3011
3004
|
}),
|
|
3012
|
-
gt &&
|
|
3005
|
+
gt && R && t && !t.isSummary && !e.locked && /* @__PURE__ */ k("button", {
|
|
3013
3006
|
type: "button",
|
|
3014
3007
|
role: "menuitem",
|
|
3015
3008
|
className: n,
|
|
@@ -3022,9 +3015,9 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3022
3015
|
progress: String(e.progress)
|
|
3023
3016
|
});
|
|
3024
3017
|
},
|
|
3025
|
-
children:
|
|
3018
|
+
children: P("gantt.menu.edit")
|
|
3026
3019
|
}),
|
|
3027
|
-
z && t && !t.isMilestone && !e.locked && /* @__PURE__ */
|
|
3020
|
+
z && t && !t.isMilestone && !e.locked && /* @__PURE__ */ A(je, { children: [/* @__PURE__ */ k("button", {
|
|
3028
3021
|
type: "button",
|
|
3029
3022
|
role: "menuitem",
|
|
3030
3023
|
className: n,
|
|
@@ -3038,8 +3031,8 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3038
3031
|
relation: "pred"
|
|
3039
3032
|
});
|
|
3040
3033
|
},
|
|
3041
|
-
children:
|
|
3042
|
-
}), /* @__PURE__ */
|
|
3034
|
+
children: P("gantt.menu.addPredecessor")
|
|
3035
|
+
}), /* @__PURE__ */ k("button", {
|
|
3043
3036
|
type: "button",
|
|
3044
3037
|
role: "menuitem",
|
|
3045
3038
|
className: n,
|
|
@@ -3053,23 +3046,23 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3053
3046
|
relation: "succ"
|
|
3054
3047
|
});
|
|
3055
3048
|
},
|
|
3056
|
-
children:
|
|
3049
|
+
children: P("gantt.menu.addSuccessor")
|
|
3057
3050
|
})] }),
|
|
3058
|
-
|
|
3051
|
+
qe && !e.locked && /* @__PURE__ */ k("button", {
|
|
3059
3052
|
type: "button",
|
|
3060
3053
|
role: "menuitem",
|
|
3061
3054
|
className: b(n, "text-destructive"),
|
|
3062
3055
|
"data-testid": "gantt-context-menu-delete",
|
|
3063
3056
|
onClick: () => {
|
|
3064
|
-
Tn(null),
|
|
3057
|
+
Tn(null), qe(e);
|
|
3065
3058
|
},
|
|
3066
|
-
children:
|
|
3059
|
+
children: P("gantt.menu.delete")
|
|
3067
3060
|
})
|
|
3068
3061
|
]
|
|
3069
3062
|
});
|
|
3070
3063
|
})(),
|
|
3071
3064
|
Dn && (() => {
|
|
3072
|
-
let e =
|
|
3065
|
+
let e = j.find((e) => String(e.id) === String(Dn.sourceId)), t = j.find((e) => String(e.id) === String(Dn.targetId));
|
|
3073
3066
|
if (!e || !t) return null;
|
|
3074
3067
|
let n = "w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none", r = [
|
|
3075
3068
|
"fs",
|
|
@@ -3077,7 +3070,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3077
3070
|
"ff",
|
|
3078
3071
|
"sf"
|
|
3079
3072
|
], i = !!t.locked;
|
|
3080
|
-
return /* @__PURE__ */
|
|
3073
|
+
return /* @__PURE__ */ A("div", {
|
|
3081
3074
|
ref: kn,
|
|
3082
3075
|
className: "fixed z-50 min-w-[180px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm",
|
|
3083
3076
|
style: {
|
|
@@ -3087,7 +3080,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3087
3080
|
role: "menu",
|
|
3088
3081
|
"data-testid": "gantt-link-context-menu",
|
|
3089
3082
|
children: [
|
|
3090
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ A("div", {
|
|
3091
3084
|
className: "px-3 py-1 text-xs text-muted-foreground truncate",
|
|
3092
3085
|
children: [
|
|
3093
3086
|
e.title,
|
|
@@ -3095,12 +3088,12 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3095
3088
|
t.title
|
|
3096
3089
|
]
|
|
3097
3090
|
}),
|
|
3098
|
-
i && /* @__PURE__ */
|
|
3091
|
+
i && /* @__PURE__ */ A("div", {
|
|
3099
3092
|
className: "px-3 py-1 text-xs text-muted-foreground",
|
|
3100
3093
|
"data-testid": "gantt-link-menu-locked",
|
|
3101
|
-
children: ["🚫 ",
|
|
3094
|
+
children: ["🚫 ", P("gantt.lockedHint")]
|
|
3102
3095
|
}),
|
|
3103
|
-
z && me && r.map((r) => /* @__PURE__ */
|
|
3096
|
+
z && me && r.map((r) => /* @__PURE__ */ A("button", {
|
|
3104
3097
|
type: "button",
|
|
3105
3098
|
role: "menuitemradio",
|
|
3106
3099
|
"aria-checked": Dn.type === r,
|
|
@@ -3110,9 +3103,9 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3110
3103
|
onClick: () => {
|
|
3111
3104
|
i || (On(null), r !== Dn.type && z(e, t, r));
|
|
3112
3105
|
},
|
|
3113
|
-
children: [Dn.type === r ? "✓ " : "\xA0\xA0",
|
|
3106
|
+
children: [Dn.type === r ? "✓ " : "\xA0\xA0", P(`gantt.linkType.${r}`)]
|
|
3114
3107
|
}, r)),
|
|
3115
|
-
ft && /* @__PURE__ */
|
|
3108
|
+
ft && /* @__PURE__ */ A(je, { children: [/* @__PURE__ */ k("div", { className: "my-1 border-t" }), /* @__PURE__ */ k("button", {
|
|
3116
3109
|
type: "button",
|
|
3117
3110
|
role: "menuitem",
|
|
3118
3111
|
disabled: i,
|
|
@@ -3121,20 +3114,20 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3121
3114
|
onClick: () => {
|
|
3122
3115
|
i || (On(null), ft(e, t));
|
|
3123
3116
|
},
|
|
3124
|
-
children:
|
|
3117
|
+
children: P("gantt.menu.removeDependency")
|
|
3125
3118
|
})] })
|
|
3126
3119
|
]
|
|
3127
3120
|
});
|
|
3128
3121
|
})(),
|
|
3129
3122
|
An && z && (() => {
|
|
3130
|
-
let e =
|
|
3123
|
+
let e = j.find((e) => String(e.id) === String(An.taskId));
|
|
3131
3124
|
if (!e) return null;
|
|
3132
|
-
let t = new Set($r.map((e) => `${String(e.sourceId)}->${String(e.targetId)}`)), n =
|
|
3125
|
+
let t = new Set($r.map((e) => `${String(e.sourceId)}->${String(e.targetId)}`)), n = j.filter((n) => {
|
|
3133
3126
|
if (String(n.id) === String(e.id) || n.type === "group" || n.locked) return !1;
|
|
3134
3127
|
let r = An.relation === "pred" ? `${String(n.id)}->${String(e.id)}` : `${String(e.id)}->${String(n.id)}`;
|
|
3135
3128
|
return !t.has(r);
|
|
3136
3129
|
}), r = Mn.trim().toLowerCase(), i = r ? n.filter((e) => String(e.title ?? "").toLowerCase().includes(r)) : n;
|
|
3137
|
-
return /* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ A("div", {
|
|
3138
3131
|
ref: Pn,
|
|
3139
3132
|
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",
|
|
3140
3133
|
style: {
|
|
@@ -3144,25 +3137,25 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3144
3137
|
role: "menu",
|
|
3145
3138
|
"data-testid": "gantt-dep-picker",
|
|
3146
3139
|
children: [
|
|
3147
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ k("div", {
|
|
3148
3141
|
className: "px-3 py-1 text-xs text-muted-foreground",
|
|
3149
|
-
children: An.relation === "pred" ?
|
|
3142
|
+
children: An.relation === "pred" ? P("gantt.menu.addPredecessor") : P("gantt.menu.addSuccessor")
|
|
3150
3143
|
}),
|
|
3151
|
-
/* @__PURE__ */
|
|
3144
|
+
/* @__PURE__ */ k("div", {
|
|
3152
3145
|
className: "px-2 pb-1",
|
|
3153
|
-
children: /* @__PURE__ */
|
|
3146
|
+
children: /* @__PURE__ */ k("input", {
|
|
3154
3147
|
className: "border rounded px-2 py-1 text-sm w-full bg-background",
|
|
3155
3148
|
value: Mn,
|
|
3156
3149
|
onChange: (e) => Nn(e.target.value),
|
|
3157
|
-
placeholder:
|
|
3150
|
+
placeholder: P("gantt.menu.searchTasks"),
|
|
3158
3151
|
"data-testid": "gantt-dep-picker-search",
|
|
3159
3152
|
autoFocus: !0
|
|
3160
3153
|
})
|
|
3161
3154
|
}),
|
|
3162
|
-
i.length === 0 ? /* @__PURE__ */
|
|
3155
|
+
i.length === 0 ? /* @__PURE__ */ k("div", {
|
|
3163
3156
|
className: "px-3 py-1.5 text-muted-foreground",
|
|
3164
|
-
children:
|
|
3165
|
-
}) : i.map((t) => /* @__PURE__ */
|
|
3157
|
+
children: P("gantt.menu.noCandidates")
|
|
3158
|
+
}) : i.map((t) => /* @__PURE__ */ k("button", {
|
|
3166
3159
|
type: "button",
|
|
3167
3160
|
role: "menuitem",
|
|
3168
3161
|
className: "w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none truncate",
|
|
@@ -3175,88 +3168,88 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
|
|
|
3175
3168
|
]
|
|
3176
3169
|
});
|
|
3177
3170
|
})(),
|
|
3178
|
-
_i && /* @__PURE__ */
|
|
3171
|
+
_i && /* @__PURE__ */ k("div", {
|
|
3179
3172
|
className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/30",
|
|
3180
3173
|
"data-testid": "gantt-autoschedule-overlay",
|
|
3181
3174
|
onClick: () => vi(null),
|
|
3182
|
-
children: /* @__PURE__ */
|
|
3175
|
+
children: /* @__PURE__ */ A("div", {
|
|
3183
3176
|
className: "min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4",
|
|
3184
3177
|
role: "alertdialog",
|
|
3185
3178
|
"aria-modal": "true",
|
|
3186
3179
|
"data-testid": "gantt-autoschedule-dialog",
|
|
3187
3180
|
onClick: (e) => e.stopPropagation(),
|
|
3188
3181
|
children: [
|
|
3189
|
-
/* @__PURE__ */
|
|
3182
|
+
/* @__PURE__ */ k("div", {
|
|
3190
3183
|
className: "text-sm font-semibold mb-1",
|
|
3191
3184
|
"data-testid": "gantt-autoschedule-title",
|
|
3192
|
-
children:
|
|
3185
|
+
children: P("gantt.autoScheduleDlg.title")
|
|
3193
3186
|
}),
|
|
3194
|
-
/* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ A("div", {
|
|
3195
3188
|
className: "text-sm text-muted-foreground mb-3",
|
|
3196
|
-
children: [
|
|
3189
|
+
children: [P("gantt.autoScheduleDlg.body").replace("{count}", String(_i.changes.length)), _i.skipped > 0 && /* @__PURE__ */ A(je, { children: [" ", /* @__PURE__ */ k("span", {
|
|
3197
3190
|
"data-testid": "gantt-autoschedule-skipped",
|
|
3198
|
-
children:
|
|
3191
|
+
children: P("gantt.autoScheduleDlg.skipped").replace("{count}", String(_i.skipped))
|
|
3199
3192
|
})] })]
|
|
3200
3193
|
}),
|
|
3201
|
-
/* @__PURE__ */
|
|
3194
|
+
/* @__PURE__ */ A("div", {
|
|
3202
3195
|
className: "flex justify-end gap-2",
|
|
3203
|
-
children: [/* @__PURE__ */
|
|
3196
|
+
children: [/* @__PURE__ */ k("button", {
|
|
3204
3197
|
type: "button",
|
|
3205
3198
|
className: "px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none",
|
|
3206
3199
|
"data-testid": "gantt-autoschedule-cancel",
|
|
3207
3200
|
onClick: () => vi(null),
|
|
3208
|
-
children:
|
|
3209
|
-
}), /* @__PURE__ */
|
|
3201
|
+
children: P("gantt.autoScheduleDlg.cancel")
|
|
3202
|
+
}), /* @__PURE__ */ k("button", {
|
|
3210
3203
|
type: "button",
|
|
3211
3204
|
className: "px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none",
|
|
3212
3205
|
"data-testid": "gantt-autoschedule-confirm",
|
|
3213
3206
|
onClick: Si,
|
|
3214
|
-
children:
|
|
3207
|
+
children: P("gantt.autoScheduleDlg.confirm")
|
|
3215
3208
|
})]
|
|
3216
3209
|
})
|
|
3217
3210
|
]
|
|
3218
3211
|
})
|
|
3219
3212
|
}),
|
|
3220
|
-
yi && /* @__PURE__ */
|
|
3213
|
+
yi && /* @__PURE__ */ k("div", {
|
|
3221
3214
|
className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-[60] rounded-md border bg-popover text-popover-foreground px-3 py-1.5 text-sm shadow-md",
|
|
3222
3215
|
role: "status",
|
|
3223
3216
|
"data-testid": "gantt-autoschedule-clean",
|
|
3224
|
-
children:
|
|
3217
|
+
children: P("gantt.autoScheduleDlg.none")
|
|
3225
3218
|
}),
|
|
3226
|
-
rn && /* @__PURE__ */
|
|
3219
|
+
rn && /* @__PURE__ */ k("div", {
|
|
3227
3220
|
className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/30",
|
|
3228
3221
|
"data-testid": "gantt-conflict-overlay",
|
|
3229
3222
|
onClick: () => an(null),
|
|
3230
|
-
children: /* @__PURE__ */
|
|
3223
|
+
children: /* @__PURE__ */ A("div", {
|
|
3231
3224
|
className: "min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4",
|
|
3232
3225
|
role: "alertdialog",
|
|
3233
3226
|
"aria-modal": "true",
|
|
3234
3227
|
"data-testid": "gantt-conflict-dialog",
|
|
3235
3228
|
onClick: (e) => e.stopPropagation(),
|
|
3236
3229
|
children: [
|
|
3237
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ k("div", {
|
|
3238
3231
|
className: "text-sm font-semibold mb-1",
|
|
3239
3232
|
"data-testid": "gantt-conflict-title",
|
|
3240
|
-
children:
|
|
3233
|
+
children: P("gantt.conflict.title")
|
|
3241
3234
|
}),
|
|
3242
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ k("div", {
|
|
3243
3236
|
className: "text-sm text-muted-foreground mb-3",
|
|
3244
|
-
children:
|
|
3237
|
+
children: P("gantt.conflict.body").replace("{count}", String(rn.length))
|
|
3245
3238
|
}),
|
|
3246
|
-
/* @__PURE__ */
|
|
3239
|
+
/* @__PURE__ */ A("div", {
|
|
3247
3240
|
className: "flex justify-end gap-2",
|
|
3248
|
-
children: [/* @__PURE__ */
|
|
3241
|
+
children: [/* @__PURE__ */ k("button", {
|
|
3249
3242
|
type: "button",
|
|
3250
3243
|
className: "px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none",
|
|
3251
3244
|
"data-testid": "gantt-conflict-cancel",
|
|
3252
3245
|
onClick: () => an(null),
|
|
3253
|
-
children:
|
|
3254
|
-
}), /* @__PURE__ */
|
|
3246
|
+
children: P("gantt.conflict.cancel")
|
|
3247
|
+
}), /* @__PURE__ */ k("button", {
|
|
3255
3248
|
type: "button",
|
|
3256
3249
|
className: "px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none",
|
|
3257
3250
|
"data-testid": "gantt-conflict-confirm",
|
|
3258
3251
|
onClick: ln,
|
|
3259
|
-
children:
|
|
3252
|
+
children: P("gantt.conflict.confirm")
|
|
3260
3253
|
})]
|
|
3261
3254
|
})
|
|
3262
3255
|
]
|
|
@@ -3323,7 +3316,7 @@ function xt(e, t, n) {
|
|
|
3323
3316
|
}) : t === "month" ? e.toLocaleDateString(n, { month: "short" }) : t === "year" ? String(e.getFullYear()) : `Q${Math.floor(e.getMonth() / 3) + 1}`;
|
|
3324
3317
|
}
|
|
3325
3318
|
function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "day", unassignedLabel: o = "Unassigned", className: s }) {
|
|
3326
|
-
let { t: c, language: l } =
|
|
3319
|
+
let { t: c, language: l } = Je(), u = l || void 0, d = vt[a], f = e.useMemo(() => {
|
|
3327
3320
|
if (!t.length) return [];
|
|
3328
3321
|
let e = new Date(Math.min(...t.map((e) => e.start.getTime()))), n = new Date(Math.max(...t.map((e) => e.end.getTime()))), r = at(e, a), i = st(at(n, a), 1, a), o = [], s = 0;
|
|
3329
3322
|
for (; r < i && s++ < 4e3;) {
|
|
@@ -3359,7 +3352,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3359
3352
|
for (let t of p) e = Math.max(e, t.peak, t.capacity);
|
|
3360
3353
|
return e || 1;
|
|
3361
3354
|
}, [p]), h = f.length * d;
|
|
3362
|
-
return t.length ? /* @__PURE__ */
|
|
3355
|
+
return t.length ? /* @__PURE__ */ k("div", {
|
|
3363
3356
|
className: s,
|
|
3364
3357
|
"data-testid": "resource-workload",
|
|
3365
3358
|
style: {
|
|
@@ -3368,17 +3361,17 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3368
3361
|
height: "100%",
|
|
3369
3362
|
overflow: "auto"
|
|
3370
3363
|
},
|
|
3371
|
-
children: /* @__PURE__ */
|
|
3364
|
+
children: /* @__PURE__ */ A("div", {
|
|
3372
3365
|
style: {
|
|
3373
3366
|
display: "flex",
|
|
3374
3367
|
minWidth: bt + h
|
|
3375
3368
|
},
|
|
3376
|
-
children: [/* @__PURE__ */
|
|
3369
|
+
children: [/* @__PURE__ */ A("div", {
|
|
3377
3370
|
style: {
|
|
3378
3371
|
width: bt,
|
|
3379
3372
|
flexShrink: 0
|
|
3380
3373
|
},
|
|
3381
|
-
children: [/* @__PURE__ */
|
|
3374
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3382
3375
|
style: {
|
|
3383
3376
|
height: 28,
|
|
3384
3377
|
display: "flex",
|
|
@@ -3389,7 +3382,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3389
3382
|
borderBottom: "1px solid hsl(var(--border))"
|
|
3390
3383
|
},
|
|
3391
3384
|
children: c("gantt.resource.header")
|
|
3392
|
-
}), p.map((e) => /* @__PURE__ */
|
|
3385
|
+
}), p.map((e) => /* @__PURE__ */ A("div", {
|
|
3393
3386
|
"data-testid": `resource-row-${e.key}`,
|
|
3394
3387
|
style: {
|
|
3395
3388
|
height: B,
|
|
@@ -3399,7 +3392,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3399
3392
|
padding: "0 12px",
|
|
3400
3393
|
borderBottom: "1px solid hsl(var(--border) / 0.5)"
|
|
3401
3394
|
},
|
|
3402
|
-
children: [/* @__PURE__ */
|
|
3395
|
+
children: [/* @__PURE__ */ k("span", {
|
|
3403
3396
|
style: {
|
|
3404
3397
|
fontSize: 13,
|
|
3405
3398
|
fontWeight: 500,
|
|
@@ -3408,7 +3401,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3408
3401
|
textOverflow: "ellipsis"
|
|
3409
3402
|
},
|
|
3410
3403
|
children: e.label
|
|
3411
|
-
}), /* @__PURE__ */
|
|
3404
|
+
}), /* @__PURE__ */ A("span", {
|
|
3412
3405
|
"data-testid": `resource-peak-${e.key}`,
|
|
3413
3406
|
"data-overloaded": e.overloadedCount > 0 ? "true" : void 0,
|
|
3414
3407
|
style: {
|
|
@@ -3425,15 +3418,15 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3425
3418
|
]
|
|
3426
3419
|
})]
|
|
3427
3420
|
}, e.key))]
|
|
3428
|
-
}), /* @__PURE__ */
|
|
3421
|
+
}), /* @__PURE__ */ A("div", {
|
|
3429
3422
|
style: { flex: 1 },
|
|
3430
|
-
children: [/* @__PURE__ */
|
|
3423
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3431
3424
|
style: {
|
|
3432
3425
|
display: "flex",
|
|
3433
3426
|
height: 28,
|
|
3434
3427
|
borderBottom: "1px solid hsl(var(--border))"
|
|
3435
3428
|
},
|
|
3436
|
-
children: f.map((e, t) => /* @__PURE__ */
|
|
3429
|
+
children: f.map((e, t) => /* @__PURE__ */ k("div", {
|
|
3437
3430
|
style: {
|
|
3438
3431
|
width: d,
|
|
3439
3432
|
flexShrink: 0,
|
|
@@ -3449,14 +3442,14 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3449
3442
|
}, t))
|
|
3450
3443
|
}), p.map((e) => {
|
|
3451
3444
|
let t = yt * (1 - Math.min(e.capacity / m, 1));
|
|
3452
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ A("div", {
|
|
3453
3446
|
style: {
|
|
3454
3447
|
position: "relative",
|
|
3455
3448
|
display: "flex",
|
|
3456
3449
|
height: B,
|
|
3457
3450
|
borderBottom: "1px solid hsl(var(--border) / 0.5)"
|
|
3458
3451
|
},
|
|
3459
|
-
children: [/* @__PURE__ */
|
|
3452
|
+
children: [/* @__PURE__ */ k("div", {
|
|
3460
3453
|
"aria-hidden": "true",
|
|
3461
3454
|
style: {
|
|
3462
3455
|
position: "absolute",
|
|
@@ -3469,7 +3462,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3469
3462
|
}
|
|
3470
3463
|
}), e.cells.map((t, n) => {
|
|
3471
3464
|
let r = Math.max(t.load > 0 ? 2 : 0, yt * Math.min(t.load / m, 1));
|
|
3472
|
-
return /* @__PURE__ */
|
|
3465
|
+
return /* @__PURE__ */ k("div", {
|
|
3473
3466
|
"data-testid": `resource-cell-${e.key}-${n}`,
|
|
3474
3467
|
"data-load": t.load,
|
|
3475
3468
|
"data-overloaded": t.overloaded ? "true" : void 0,
|
|
@@ -3484,7 +3477,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3484
3477
|
justifyContent: "center",
|
|
3485
3478
|
paddingBottom: (B - yt) / 2
|
|
3486
3479
|
},
|
|
3487
|
-
children: t.load > 0 && /* @__PURE__ */
|
|
3480
|
+
children: t.load > 0 && /* @__PURE__ */ k("div", { style: {
|
|
3488
3481
|
width: d - 6,
|
|
3489
3482
|
height: r,
|
|
3490
3483
|
borderRadius: 2,
|
|
@@ -3497,10 +3490,10 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
|
|
|
3497
3490
|
})]
|
|
3498
3491
|
})]
|
|
3499
3492
|
})
|
|
3500
|
-
}) : /* @__PURE__ */
|
|
3493
|
+
}) : /* @__PURE__ */ k("div", {
|
|
3501
3494
|
className: s,
|
|
3502
3495
|
"data-testid": "resource-workload",
|
|
3503
|
-
children: /* @__PURE__ */
|
|
3496
|
+
children: /* @__PURE__ */ k("div", {
|
|
3504
3497
|
className: "flex items-center justify-center h-40 text-sm text-muted-foreground",
|
|
3505
3498
|
children: c("gantt.resource.empty")
|
|
3506
3499
|
})
|
|
@@ -3554,7 +3547,7 @@ var Ct = {
|
|
|
3554
3547
|
userSelect: "none"
|
|
3555
3548
|
};
|
|
3556
3549
|
function Et({ checked: e }) {
|
|
3557
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ k("span", {
|
|
3558
3551
|
"aria-hidden": !0,
|
|
3559
3552
|
style: {
|
|
3560
3553
|
display: "inline-flex",
|
|
@@ -3592,11 +3585,11 @@ function Dt({ filter: e, selected: t, onChange: n, labels: i }) {
|
|
|
3592
3585
|
}, m = () => {
|
|
3593
3586
|
n(d > 0 ? [] : e.options.map((e) => e.value));
|
|
3594
3587
|
}, h = d === 0 ? e.label : d === 1 ? `${e.label}: ${e.options.find((e) => e.value === t[0])?.label ?? t[0]}` : `${e.label} · ${d}`;
|
|
3595
|
-
return /* @__PURE__ */
|
|
3588
|
+
return /* @__PURE__ */ A("div", {
|
|
3596
3589
|
ref: l,
|
|
3597
3590
|
style: { position: "relative" },
|
|
3598
3591
|
"data-testid": `quick-filter-${e.field}`,
|
|
3599
|
-
children: [/* @__PURE__ */
|
|
3592
|
+
children: [/* @__PURE__ */ A("button", {
|
|
3600
3593
|
type: "button",
|
|
3601
3594
|
style: {
|
|
3602
3595
|
...wt,
|
|
@@ -3607,7 +3600,7 @@ function Dt({ filter: e, selected: t, onChange: n, labels: i }) {
|
|
|
3607
3600
|
"aria-expanded": s,
|
|
3608
3601
|
"data-testid": `quick-filter-trigger-${e.field}`,
|
|
3609
3602
|
onClick: () => c((e) => !e),
|
|
3610
|
-
children: [/* @__PURE__ */
|
|
3603
|
+
children: [/* @__PURE__ */ k("span", { children: h }), /* @__PURE__ */ k("span", {
|
|
3611
3604
|
"aria-hidden": !0,
|
|
3612
3605
|
style: {
|
|
3613
3606
|
fontSize: 10,
|
|
@@ -3615,19 +3608,19 @@ function Dt({ filter: e, selected: t, onChange: n, labels: i }) {
|
|
|
3615
3608
|
},
|
|
3616
3609
|
children: "▾"
|
|
3617
3610
|
})]
|
|
3618
|
-
}), s && /* @__PURE__ */
|
|
3611
|
+
}), s && /* @__PURE__ */ k("div", {
|
|
3619
3612
|
role: "listbox",
|
|
3620
3613
|
style: Tt,
|
|
3621
3614
|
"data-testid": `quick-filter-panel-${e.field}`,
|
|
3622
|
-
children: e.options.length === 0 ? /* @__PURE__ */
|
|
3615
|
+
children: e.options.length === 0 ? /* @__PURE__ */ k("div", {
|
|
3623
3616
|
style: {
|
|
3624
3617
|
...V,
|
|
3625
3618
|
cursor: "default",
|
|
3626
3619
|
opacity: .6
|
|
3627
3620
|
},
|
|
3628
3621
|
children: i.empty
|
|
3629
|
-
}) : /* @__PURE__ */
|
|
3630
|
-
/* @__PURE__ */
|
|
3622
|
+
}) : /* @__PURE__ */ A(je, { children: [
|
|
3623
|
+
/* @__PURE__ */ A("div", {
|
|
3631
3624
|
role: "option",
|
|
3632
3625
|
"aria-selected": f,
|
|
3633
3626
|
style: {
|
|
@@ -3636,16 +3629,16 @@ function Dt({ filter: e, selected: t, onChange: n, labels: i }) {
|
|
|
3636
3629
|
},
|
|
3637
3630
|
"data-testid": `quick-filter-all-${e.field}`,
|
|
3638
3631
|
onClick: () => m(),
|
|
3639
|
-
children: [/* @__PURE__ */
|
|
3632
|
+
children: [/* @__PURE__ */ k(Et, { checked: f }), /* @__PURE__ */ k("span", { children: i.all })]
|
|
3640
3633
|
}),
|
|
3641
|
-
/* @__PURE__ */
|
|
3634
|
+
/* @__PURE__ */ k("div", { style: {
|
|
3642
3635
|
height: 1,
|
|
3643
3636
|
background: "hsl(var(--border))",
|
|
3644
3637
|
margin: "2px 0"
|
|
3645
3638
|
} }),
|
|
3646
3639
|
e.options.map((t) => {
|
|
3647
3640
|
let n = u.has(t.value);
|
|
3648
|
-
return /* @__PURE__ */
|
|
3641
|
+
return /* @__PURE__ */ A("div", {
|
|
3649
3642
|
role: "option",
|
|
3650
3643
|
"aria-selected": n,
|
|
3651
3644
|
style: {
|
|
@@ -3654,7 +3647,7 @@ function Dt({ filter: e, selected: t, onChange: n, labels: i }) {
|
|
|
3654
3647
|
},
|
|
3655
3648
|
"data-testid": `quick-filter-option-${e.field}-${t.value}`,
|
|
3656
3649
|
onClick: () => p(t.value),
|
|
3657
|
-
children: [/* @__PURE__ */
|
|
3650
|
+
children: [/* @__PURE__ */ k(Et, { checked: n }), /* @__PURE__ */ k("span", { children: t.label })]
|
|
3658
3651
|
}, t.value);
|
|
3659
3652
|
})
|
|
3660
3653
|
] })
|
|
@@ -3664,12 +3657,12 @@ function Dt({ filter: e, selected: t, onChange: n, labels: i }) {
|
|
|
3664
3657
|
var Ot = ({ filters: e, value: t, onChange: n, onClear: r, resultCount: i, totalCount: a, labels: o, className: s }) => {
|
|
3665
3658
|
if (!e.length) return null;
|
|
3666
3659
|
let c = o?.all ?? "All", l = o?.empty ?? "No options", u = o?.clear ?? "Clear", d = e.some((e) => (t[e.field]?.length ?? 0) > 0);
|
|
3667
|
-
return /* @__PURE__ */
|
|
3660
|
+
return /* @__PURE__ */ A("div", {
|
|
3668
3661
|
style: Ct,
|
|
3669
3662
|
className: s,
|
|
3670
3663
|
"data-testid": "quick-filter-bar",
|
|
3671
3664
|
children: [
|
|
3672
|
-
e.map((e) => /* @__PURE__ */
|
|
3665
|
+
e.map((e) => /* @__PURE__ */ k(Dt, {
|
|
3673
3666
|
filter: e,
|
|
3674
3667
|
selected: t[e.field] ?? [],
|
|
3675
3668
|
onChange: (t) => n(e.field, t),
|
|
@@ -3678,7 +3671,7 @@ var Ot = ({ filters: e, value: t, onChange: n, onClear: r, resultCount: i, total
|
|
|
3678
3671
|
empty: l
|
|
3679
3672
|
}
|
|
3680
3673
|
}, e.field)),
|
|
3681
|
-
d && /* @__PURE__ */
|
|
3674
|
+
d && /* @__PURE__ */ k("button", {
|
|
3682
3675
|
type: "button",
|
|
3683
3676
|
style: {
|
|
3684
3677
|
...wt,
|
|
@@ -3689,7 +3682,7 @@ var Ot = ({ filters: e, value: t, onChange: n, onClear: r, resultCount: i, total
|
|
|
3689
3682
|
onClick: r,
|
|
3690
3683
|
children: u
|
|
3691
3684
|
}),
|
|
3692
|
-
o?.resultSummary && i != null && a != null && /* @__PURE__ */
|
|
3685
|
+
o?.resultSummary && i != null && a != null && /* @__PURE__ */ k("span", {
|
|
3693
3686
|
"data-testid": "quick-filter-summary",
|
|
3694
3687
|
style: {
|
|
3695
3688
|
marginLeft: "auto",
|
|
@@ -3805,65 +3798,65 @@ function Pt(e) {
|
|
|
3805
3798
|
return null;
|
|
3806
3799
|
}
|
|
3807
3800
|
var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick: ee, onBeforeTaskUpdate: y, ...de }) => {
|
|
3808
|
-
let [S,
|
|
3809
|
-
g.error(
|
|
3810
|
-
}, [
|
|
3811
|
-
|
|
3801
|
+
let [S, C] = o([]), [ye, be] = o(!0), [xe, Se] = o(null), [w, Ce] = o(null), { currency: we } = _(), { t: Te } = Je(), Ee = t((e) => {
|
|
3802
|
+
g.error(Te("gantt.writeFailed"), { description: H(e) ?? void 0 });
|
|
3803
|
+
}, [Te]), De = Mt(e), T = i(() => De, [JSON.stringify(De)]), E = Pt(e), Oe = T?.provider === "value", ke = n(f)?.apiFetch, D = i(() => d(T, s ?? null, { fetch: ke }), [
|
|
3804
|
+
T,
|
|
3812
3805
|
s,
|
|
3813
|
-
|
|
3814
|
-
]),
|
|
3815
|
-
let n = ++
|
|
3806
|
+
ke
|
|
3807
|
+
]), O = T?.provider === "object" ? T.object : e.objectName ?? "", [Ae, je] = o(!1), j = a(0), M = t(async ({ silent: t = !1 } = {}) => {
|
|
3808
|
+
let n = ++j.current, r = () => j.current === n;
|
|
3816
3809
|
try {
|
|
3817
|
-
if (t ?
|
|
3818
|
-
r() &&
|
|
3810
|
+
if (t ? je(!0) : be(!0), de.data && Array.isArray(de.data)) {
|
|
3811
|
+
r() && C(de.data);
|
|
3819
3812
|
return;
|
|
3820
3813
|
}
|
|
3821
|
-
if (
|
|
3822
|
-
r() &&
|
|
3814
|
+
if (Oe && T?.provider === "value") {
|
|
3815
|
+
r() && C(T.items);
|
|
3823
3816
|
return;
|
|
3824
3817
|
}
|
|
3825
|
-
if (!
|
|
3826
|
-
let n = c(
|
|
3818
|
+
if (!D || typeof D.find != "function") throw Error("DataSource required for object/api providers");
|
|
3819
|
+
let n = c(w?.fields), i = await D.find(O, {
|
|
3827
3820
|
$filter: e.filter,
|
|
3828
3821
|
$orderby: Nt(e.sort),
|
|
3829
3822
|
...n.length > 0 ? { $expand: n } : {}
|
|
3830
3823
|
});
|
|
3831
|
-
r() &&
|
|
3824
|
+
r() && C(l(i));
|
|
3832
3825
|
} catch (e) {
|
|
3833
|
-
t ? console.error("[ObjectGantt] Failed to refresh data:", e) : r() &&
|
|
3826
|
+
t ? console.error("[ObjectGantt] Failed to refresh data:", e) : r() && Se(e);
|
|
3834
3827
|
} finally {
|
|
3835
|
-
t ?
|
|
3828
|
+
t ? je(!1) : be(!1);
|
|
3836
3829
|
}
|
|
3837
3830
|
}, [
|
|
3838
|
-
E,
|
|
3839
3831
|
D,
|
|
3840
|
-
|
|
3841
|
-
|
|
3832
|
+
O,
|
|
3833
|
+
Oe,
|
|
3834
|
+
T,
|
|
3842
3835
|
e.filter,
|
|
3843
3836
|
e.sort,
|
|
3844
|
-
|
|
3837
|
+
w
|
|
3845
3838
|
]);
|
|
3846
3839
|
r(() => {
|
|
3847
|
-
|
|
3848
|
-
}, [
|
|
3849
|
-
!
|
|
3840
|
+
M();
|
|
3841
|
+
}, [M]), r(() => {
|
|
3842
|
+
!Oe && D && (async () => {
|
|
3850
3843
|
try {
|
|
3851
|
-
if (!
|
|
3852
|
-
let e = await
|
|
3853
|
-
|
|
3844
|
+
if (!D || !O) return;
|
|
3845
|
+
let e = await D.getObjectSchema(O);
|
|
3846
|
+
Ce(e);
|
|
3854
3847
|
} catch (e) {
|
|
3855
3848
|
console.error("Failed to fetch object schema:", e);
|
|
3856
3849
|
}
|
|
3857
3850
|
})();
|
|
3858
3851
|
}, [
|
|
3852
|
+
O,
|
|
3859
3853
|
D,
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
w
|
|
3854
|
+
Oe,
|
|
3855
|
+
T
|
|
3863
3856
|
]);
|
|
3864
|
-
let
|
|
3865
|
-
if (!
|
|
3866
|
-
let { startDateField: e, endDateField: t, titleField: n, progressField: r, dependenciesField: i, colorField: a, borderColorField: o, parentField: s, typeField: c, lockField: l, tooltipFields: d, baselineStartField: f, baselineEndField: p, quickFilters: m } =
|
|
3857
|
+
let N = i(() => {
|
|
3858
|
+
if (!E || !S.length) return [];
|
|
3859
|
+
let { startDateField: e, endDateField: t, titleField: n, progressField: r, dependenciesField: i, colorField: a, borderColorField: o, parentField: s, typeField: c, lockField: l, tooltipFields: d, baselineStartField: f, baselineEndField: p, quickFilters: m } = E, h = w?.fields ?? {}, g = /* @__PURE__ */ new Map();
|
|
3867
3860
|
for (let e of m ?? []) {
|
|
3868
3861
|
if (!e?.field || !Array.isArray(e.options) || !e.options.length) continue;
|
|
3869
3862
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3886,7 +3879,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
3886
3879
|
e?.contact && [e.contact.first_name, e.contact.last_name].filter(Boolean).join(" ")
|
|
3887
3880
|
];
|
|
3888
3881
|
for (let e of t) if (e != null && String(e).trim() !== "") return String(e);
|
|
3889
|
-
return u(
|
|
3882
|
+
return u(w, e);
|
|
3890
3883
|
}, v = (e, t) => {
|
|
3891
3884
|
if (t) return t;
|
|
3892
3885
|
let n = h[e] ?? h[e.split(".")[0]];
|
|
@@ -3913,7 +3906,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
3913
3906
|
case "integer":
|
|
3914
3907
|
case "float":
|
|
3915
3908
|
case "decimal": return he(Number(e));
|
|
3916
|
-
case "currency": return fe(Number(e), te(n,
|
|
3909
|
+
case "currency": return fe(Number(e), te(n, we));
|
|
3917
3910
|
case "percent": return ge(Number(e));
|
|
3918
3911
|
case "boolean":
|
|
3919
3912
|
case "checkbox": return e ? "Yes" : "No";
|
|
@@ -3980,12 +3973,12 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
3980
3973
|
}).filter((e) => !isNaN(e.start.getTime()) && !isNaN(e.end.getTime()));
|
|
3981
3974
|
}, [
|
|
3982
3975
|
S,
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
]),
|
|
3986
|
-
let e =
|
|
3976
|
+
E,
|
|
3977
|
+
w
|
|
3978
|
+
]), Me = i(() => {
|
|
3979
|
+
let e = E?.groupByField;
|
|
3987
3980
|
if (!e) return;
|
|
3988
|
-
let t =
|
|
3981
|
+
let t = w?.fields ?? {}, n = (e, t) => {
|
|
3989
3982
|
if (!t) return;
|
|
3990
3983
|
let n = e;
|
|
3991
3984
|
for (let e of t.split(".")) {
|
|
@@ -4012,10 +4005,10 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4012
4005
|
label: r(i)
|
|
4013
4006
|
};
|
|
4014
4007
|
};
|
|
4015
|
-
}, [
|
|
4016
|
-
let e =
|
|
4008
|
+
}, [E?.groupByField, w]), P = i(() => {
|
|
4009
|
+
let e = E?.assigneeField;
|
|
4017
4010
|
if (!e) return;
|
|
4018
|
-
let t =
|
|
4011
|
+
let t = w?.fields ?? {}, n = (e, t) => {
|
|
4019
4012
|
if (!t) return;
|
|
4020
4013
|
let n = e;
|
|
4021
4014
|
for (let e of t.split(".")) {
|
|
@@ -4042,19 +4035,19 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4042
4035
|
label: r(i)
|
|
4043
4036
|
};
|
|
4044
4037
|
};
|
|
4045
|
-
}, [
|
|
4046
|
-
let e =
|
|
4038
|
+
}, [E?.assigneeField, w]), Ne = i(() => {
|
|
4039
|
+
let e = E?.effortField;
|
|
4047
4040
|
if (e) return (t) => {
|
|
4048
4041
|
let n = t.data?.[e], r = Number(n);
|
|
4049
4042
|
return Number.isFinite(r) && r > 0 ? r : 1;
|
|
4050
4043
|
};
|
|
4051
|
-
}, [
|
|
4044
|
+
}, [E?.effortField]), F = i(() => {
|
|
4052
4045
|
let t = e.skipWeekends, n = e.holidays;
|
|
4053
4046
|
if (!(!t && (!n || n.length === 0))) return {
|
|
4054
4047
|
skipWeekends: !!t,
|
|
4055
4048
|
holidays: n && n.length ? new Set(n) : void 0
|
|
4056
4049
|
};
|
|
4057
|
-
}, [e]),
|
|
4050
|
+
}, [e]), Pe = i(() => We(E?.timeSegments), [E?.timeSegments]), I = t((e, t) => {
|
|
4058
4051
|
if (!e || !t) return null;
|
|
4059
4052
|
let n = e;
|
|
4060
4053
|
for (let e of t.split(".")) {
|
|
@@ -4067,13 +4060,13 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4067
4060
|
return String(e.id ?? e._id ?? e.value ?? e.name ?? "");
|
|
4068
4061
|
}
|
|
4069
4062
|
return String(n);
|
|
4070
|
-
}, []),
|
|
4063
|
+
}, []), Fe = E?.quickFilters, [Ie, Le] = o({});
|
|
4071
4064
|
r(() => {
|
|
4072
|
-
if (!
|
|
4073
|
-
let e =
|
|
4065
|
+
if (!Fe?.length || !s || typeof s.find != "function") return;
|
|
4066
|
+
let e = w?.fields ?? {}, t = !1;
|
|
4074
4067
|
return (async () => {
|
|
4075
4068
|
let n = {};
|
|
4076
|
-
for (let t of
|
|
4069
|
+
for (let t of Fe) {
|
|
4077
4070
|
if (t.options) continue;
|
|
4078
4071
|
let r = e[t.field] ?? e[t.field.split(".")[0]], i = r?.type;
|
|
4079
4072
|
if (i !== "lookup" && i !== "master_detail") continue;
|
|
@@ -4088,7 +4081,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4088
4081
|
console.warn(`[ObjectGantt] Failed to load quick-filter options for "${t.field}":`, e);
|
|
4089
4082
|
}
|
|
4090
4083
|
}
|
|
4091
|
-
t ||
|
|
4084
|
+
t || Le((e) => ({
|
|
4092
4085
|
...e,
|
|
4093
4086
|
...n
|
|
4094
4087
|
}));
|
|
@@ -4096,14 +4089,14 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4096
4089
|
t = !0;
|
|
4097
4090
|
};
|
|
4098
4091
|
}, [
|
|
4099
|
-
JSON.stringify(
|
|
4092
|
+
JSON.stringify(Fe),
|
|
4100
4093
|
s,
|
|
4101
|
-
|
|
4094
|
+
w
|
|
4102
4095
|
]);
|
|
4103
|
-
let
|
|
4104
|
-
if (!
|
|
4105
|
-
let e =
|
|
4106
|
-
return
|
|
4096
|
+
let Re = i(() => {
|
|
4097
|
+
if (!Fe?.length) return [];
|
|
4098
|
+
let e = w?.fields ?? {};
|
|
4099
|
+
return Fe.map((t) => {
|
|
4107
4100
|
let n = e[t.field] ?? e[t.field.split(".")[0]], r = t.label ?? n?.label ?? x(t.field), i;
|
|
4108
4101
|
if (t.options?.length) i = t.options.map((e) => typeof e == "object" ? {
|
|
4109
4102
|
value: String(e.value),
|
|
@@ -4116,11 +4109,11 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4116
4109
|
value: String(e.value ?? e),
|
|
4117
4110
|
label: String(e.label ?? e.value ?? e)
|
|
4118
4111
|
}));
|
|
4119
|
-
else if (
|
|
4112
|
+
else if (Ie[t.field]?.length) i = Ie[t.field];
|
|
4120
4113
|
else {
|
|
4121
4114
|
let e = /* @__PURE__ */ new Map();
|
|
4122
4115
|
for (let n of S) {
|
|
4123
|
-
let r =
|
|
4116
|
+
let r = I(n, t.field);
|
|
4124
4117
|
if (r != null && !e.has(r)) {
|
|
4125
4118
|
let i = n;
|
|
4126
4119
|
for (let e of t.field.split(".")) i = i?.[e];
|
|
@@ -4140,15 +4133,15 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4140
4133
|
};
|
|
4141
4134
|
});
|
|
4142
4135
|
}, [
|
|
4136
|
+
Fe,
|
|
4137
|
+
w,
|
|
4143
4138
|
Ie,
|
|
4144
|
-
C,
|
|
4145
|
-
Le,
|
|
4146
4139
|
S,
|
|
4147
|
-
|
|
4148
|
-
]),
|
|
4149
|
-
if (!
|
|
4140
|
+
I
|
|
4141
|
+
]), ze = e.persistLayout === !1 ? void 0 : `${e.objectName || (T?.provider === "object" ? T.object : "") || "gantt"}:${e.viewName || "default"}`, Be = ze ? `gantt-layout:${ze}:filters` : null, [Ve, L] = o(() => {
|
|
4142
|
+
if (!Be || typeof window > "u") return {};
|
|
4150
4143
|
try {
|
|
4151
|
-
let e = JSON.parse(window.localStorage.getItem(
|
|
4144
|
+
let e = JSON.parse(window.localStorage.getItem(Be) || "null");
|
|
4152
4145
|
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
4153
4146
|
let t = {};
|
|
4154
4147
|
for (let [n, r] of Object.entries(e)) Array.isArray(r) && (t[n] = r.filter((e) => typeof e == "string"));
|
|
@@ -4156,117 +4149,117 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4156
4149
|
} catch {
|
|
4157
4150
|
return {};
|
|
4158
4151
|
}
|
|
4159
|
-
}),
|
|
4160
|
-
if (!(!
|
|
4161
|
-
window.localStorage.setItem(
|
|
4152
|
+
}), He = t(() => {
|
|
4153
|
+
if (!(!Be || typeof window > "u")) try {
|
|
4154
|
+
window.localStorage.setItem(Be, JSON.stringify(Ve));
|
|
4162
4155
|
} catch {}
|
|
4163
|
-
}, [
|
|
4164
|
-
|
|
4156
|
+
}, [Be, Ve]), Ue = t((e, t) => {
|
|
4157
|
+
L((n) => ({
|
|
4165
4158
|
...n,
|
|
4166
4159
|
[e]: t
|
|
4167
4160
|
}));
|
|
4168
|
-
}, []),
|
|
4169
|
-
let t = (
|
|
4161
|
+
}, []), Ge = t(() => L({}), []), Ke = t((e) => !!E?.objectField && !String(e?.[E.objectField] ?? "").trim(), [E?.objectField]), R = t((e) => {
|
|
4162
|
+
let t = (E?.objectField ? String(e[E.objectField] ?? "").trim() : "") || O, n = e.id ?? e._id;
|
|
4170
4163
|
if (!t || n == null) return null;
|
|
4171
|
-
let r =
|
|
4164
|
+
let r = O ? ne(O, n) : null;
|
|
4172
4165
|
return {
|
|
4173
4166
|
objectName: t,
|
|
4174
4167
|
recordId: n,
|
|
4175
|
-
href: !
|
|
4168
|
+
href: !O || t === O ? r : r?.replace(`/${O}/record/`, `/${t}/record/`) ?? null
|
|
4176
4169
|
};
|
|
4177
|
-
}, [
|
|
4178
|
-
let e = Object.entries(
|
|
4179
|
-
if (!e.length) return
|
|
4180
|
-
let t = new Map(
|
|
4181
|
-
for (let r of
|
|
4170
|
+
}, [E?.objectField, O]), qe = i(() => {
|
|
4171
|
+
let e = Object.entries(Ve).filter(([, e]) => e.length > 0);
|
|
4172
|
+
if (!e.length) return N;
|
|
4173
|
+
let t = new Map(N.map((e) => [String(e.id), e])), n = /* @__PURE__ */ new Set();
|
|
4174
|
+
for (let r of N) {
|
|
4182
4175
|
if (!e.every(([e, t]) => {
|
|
4183
|
-
let n =
|
|
4176
|
+
let n = I(r.data, e);
|
|
4184
4177
|
return n != null && t.includes(n);
|
|
4185
4178
|
})) continue;
|
|
4186
4179
|
let i = r;
|
|
4187
4180
|
for (; i && !n.has(String(i.id));) n.add(String(i.id)), i = i.parent == null ? void 0 : t.get(String(i.parent));
|
|
4188
4181
|
}
|
|
4189
|
-
return
|
|
4182
|
+
return N.filter((e) => n.has(String(e.id)));
|
|
4190
4183
|
}, [
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
]),
|
|
4195
|
-
if (
|
|
4196
|
-
let e =
|
|
4197
|
-
for (let n of
|
|
4184
|
+
N,
|
|
4185
|
+
Ve,
|
|
4186
|
+
I
|
|
4187
|
+
]), Ye = i(() => {
|
|
4188
|
+
if (E?.autoZoomToFilter !== !1 || !N.length) return null;
|
|
4189
|
+
let e = N[0].start.getTime(), t = N[0].end.getTime();
|
|
4190
|
+
for (let n of N) e = Math.min(e, n.start.getTime()), t = Math.max(t, n.end.getTime());
|
|
4198
4191
|
return {
|
|
4199
4192
|
start: new Date(e),
|
|
4200
4193
|
end: new Date(t)
|
|
4201
4194
|
};
|
|
4202
|
-
}, [
|
|
4195
|
+
}, [N, E?.autoZoomToFilter]), Xe = e.navigation ?? {
|
|
4203
4196
|
mode: "drawer",
|
|
4204
4197
|
width: "min(960px, 60vw)"
|
|
4205
|
-
},
|
|
4206
|
-
navigation:
|
|
4198
|
+
}, Ze = Xe.mode === "drawer" || Xe.mode === "modal" || Xe.mode === "split" || Xe.mode === "popover", Qe = p({
|
|
4199
|
+
navigation: Xe,
|
|
4207
4200
|
objectName: e.objectName,
|
|
4208
|
-
onRowClick:
|
|
4209
|
-
}), [
|
|
4201
|
+
onRowClick: Ze ? void 0 : ee
|
|
4202
|
+
}), [$e, et] = o(null), tt = Qe.isOverlay && Qe.isOpen ? Qe.selectedRecord : null;
|
|
4210
4203
|
r(() => {
|
|
4211
|
-
if (!
|
|
4212
|
-
|
|
4204
|
+
if (!tt) {
|
|
4205
|
+
et(null);
|
|
4213
4206
|
return;
|
|
4214
4207
|
}
|
|
4215
|
-
let e =
|
|
4208
|
+
let e = R(tt);
|
|
4216
4209
|
if (!e) {
|
|
4217
|
-
|
|
4210
|
+
et(null);
|
|
4218
4211
|
return;
|
|
4219
4212
|
}
|
|
4220
4213
|
let { objectName: t, recordId: n } = e;
|
|
4221
|
-
if (!(
|
|
4222
|
-
|
|
4214
|
+
if (!(T?.provider === "api" || t !== O) || !s || typeof s.findOne != "function") {
|
|
4215
|
+
et(null);
|
|
4223
4216
|
return;
|
|
4224
4217
|
}
|
|
4225
4218
|
let r = `${t}:${n}`, i = !1;
|
|
4226
4219
|
return (async () => {
|
|
4227
4220
|
try {
|
|
4228
4221
|
let [e, a] = await Promise.all([s.findOne(t, String(n)), typeof s.getObjectSchema == "function" ? s.getObjectSchema(t).catch(() => null) : Promise.resolve(null)]);
|
|
4229
|
-
i ||
|
|
4222
|
+
i || et(e ? {
|
|
4230
4223
|
key: r,
|
|
4231
4224
|
record: e,
|
|
4232
4225
|
schema: a
|
|
4233
4226
|
} : null);
|
|
4234
4227
|
} catch (e) {
|
|
4235
|
-
console.error("[ObjectGantt] Failed to fetch drawer record, falling back to row payload:", e), i ||
|
|
4228
|
+
console.error("[ObjectGantt] Failed to fetch drawer record, falling back to row payload:", e), i || et(null);
|
|
4236
4229
|
}
|
|
4237
4230
|
})(), () => {
|
|
4238
4231
|
i = !0;
|
|
4239
4232
|
};
|
|
4240
4233
|
}, [
|
|
4234
|
+
tt,
|
|
4241
4235
|
R,
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
D,
|
|
4236
|
+
T?.provider,
|
|
4237
|
+
O,
|
|
4245
4238
|
s
|
|
4246
4239
|
]);
|
|
4247
4240
|
let nt = t(async (e, t) => {
|
|
4248
|
-
if (!
|
|
4249
|
-
let { startDateField: n, endDateField: r, titleField: i, progressField: a } =
|
|
4241
|
+
if (!E || !D || typeof D.update != "function") return;
|
|
4242
|
+
let { startDateField: n, endDateField: r, titleField: i, progressField: a } = E, o = {};
|
|
4250
4243
|
if (t.start instanceof Date && (o[n] = t.start.toISOString()), t.end instanceof Date && (o[r] = t.end.toISOString()), typeof t.title == "string" && i && (o[i] = t.title), typeof t.progress == "number" && a && (o[a] = t.progress), Object.keys(o).length === 0) return;
|
|
4251
4244
|
let s = e.data?.id ?? e.data?._id ?? e.id;
|
|
4252
4245
|
if (s == null) return;
|
|
4253
4246
|
let c = S;
|
|
4254
|
-
|
|
4247
|
+
C((e) => e.map((e) => String(e.id ?? e._id) === String(s) ? {
|
|
4255
4248
|
...e,
|
|
4256
4249
|
...o
|
|
4257
4250
|
} : e));
|
|
4258
4251
|
try {
|
|
4259
|
-
await
|
|
4252
|
+
await D.update(O, String(s), o), M({ silent: !0 });
|
|
4260
4253
|
} catch (e) {
|
|
4261
|
-
console.error("[ObjectGantt] Failed to persist task update:", e),
|
|
4254
|
+
console.error("[ObjectGantt] Failed to persist task update:", e), C(c), Ee(e);
|
|
4262
4255
|
}
|
|
4263
4256
|
}, [
|
|
4264
|
-
T,
|
|
4265
4257
|
E,
|
|
4266
4258
|
D,
|
|
4259
|
+
O,
|
|
4267
4260
|
S,
|
|
4268
|
-
|
|
4269
|
-
|
|
4261
|
+
M,
|
|
4262
|
+
Ee
|
|
4270
4263
|
]), rt = (e, t) => {
|
|
4271
4264
|
let n = t.some((e) => typeof e == "object" && e.type && e.type !== "fs");
|
|
4272
4265
|
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" ? {
|
|
@@ -4274,29 +4267,29 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4274
4267
|
type: e.type
|
|
4275
4268
|
} : e.id : e) : t.map((e) => typeof e == "object" ? e.id : e);
|
|
4276
4269
|
}, z = t(async (e, t, n) => {
|
|
4277
|
-
let r =
|
|
4278
|
-
if (!r || !
|
|
4270
|
+
let r = E?.dependenciesField;
|
|
4271
|
+
if (!r || !D || typeof D.update != "function") return;
|
|
4279
4272
|
let i = rt(t, n), a = S;
|
|
4280
|
-
|
|
4273
|
+
C((t) => t.map((t) => String(t.id ?? t._id) === String(e) ? {
|
|
4281
4274
|
...t,
|
|
4282
4275
|
[r]: i
|
|
4283
4276
|
} : t));
|
|
4284
4277
|
try {
|
|
4285
|
-
await
|
|
4278
|
+
await D.update(O, String(e), { [r]: i }), M({ silent: !0 });
|
|
4286
4279
|
} catch (e) {
|
|
4287
|
-
console.error("[ObjectGantt] Failed to persist dependency:", e),
|
|
4280
|
+
console.error("[ObjectGantt] Failed to persist dependency:", e), C(a), Ee(e);
|
|
4288
4281
|
}
|
|
4289
4282
|
}, [
|
|
4290
|
-
T,
|
|
4291
4283
|
E,
|
|
4292
4284
|
D,
|
|
4285
|
+
O,
|
|
4293
4286
|
S,
|
|
4294
|
-
|
|
4295
|
-
|
|
4287
|
+
M,
|
|
4288
|
+
Ee
|
|
4296
4289
|
]), it = t(async (e, t, n = "fs") => {
|
|
4297
4290
|
let r = e.data?.id ?? e.data?._id ?? e.id, i = t.data?.id ?? t.data?._id ?? t.id;
|
|
4298
4291
|
if (r == null || i == null) return;
|
|
4299
|
-
let a =
|
|
4292
|
+
let a = E?.dependenciesField;
|
|
4300
4293
|
if (!a) return;
|
|
4301
4294
|
let o = S.find((e) => String(e.id ?? e._id) === String(i))?.[a], s = jt(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";
|
|
4302
4295
|
if (l && u === n) return;
|
|
@@ -4306,25 +4299,25 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4306
4299
|
}, f = l ? s.map((e) => c(e) === String(r) ? d : e) : [...s, d];
|
|
4307
4300
|
await z(i, o, f);
|
|
4308
4301
|
}, [
|
|
4309
|
-
|
|
4302
|
+
E,
|
|
4310
4303
|
S,
|
|
4311
4304
|
z
|
|
4312
4305
|
]), at = t(async (e, t) => {
|
|
4313
4306
|
let n = e.data?.id ?? e.data?._id ?? e.id, r = t.data?.id ?? t.data?._id ?? t.id;
|
|
4314
4307
|
if (n == null || r == null) return;
|
|
4315
|
-
let i =
|
|
4308
|
+
let i = E?.dependenciesField;
|
|
4316
4309
|
if (!i) return;
|
|
4317
4310
|
let a = S.find((e) => String(e.id ?? e._id) === String(r))?.[i], o = jt(a), s = (e) => String(typeof e == "object" ? e.id : e), c = o.filter((e) => s(e) !== String(n));
|
|
4318
4311
|
c.length !== o.length && await z(r, a, c);
|
|
4319
4312
|
}, [
|
|
4320
|
-
|
|
4313
|
+
E,
|
|
4321
4314
|
S,
|
|
4322
4315
|
z
|
|
4323
4316
|
]), [ot, st] = o(null), [ct, lt] = o(!1), ut = t((e) => {
|
|
4324
4317
|
st(e);
|
|
4325
4318
|
}, []), dt = t(async () => {
|
|
4326
4319
|
if (!ot) return;
|
|
4327
|
-
if (!
|
|
4320
|
+
if (!D?.delete) {
|
|
4328
4321
|
st(null);
|
|
4329
4322
|
return;
|
|
4330
4323
|
}
|
|
@@ -4335,52 +4328,52 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4335
4328
|
}
|
|
4336
4329
|
lt(!0);
|
|
4337
4330
|
let t = S;
|
|
4338
|
-
|
|
4331
|
+
C((t) => t.filter((t) => String(t.id ?? t._id) !== String(e)));
|
|
4339
4332
|
try {
|
|
4340
|
-
if (await
|
|
4341
|
-
st(null),
|
|
4333
|
+
if (await D.delete(O, String(e)) === !1) throw Error(Te("gantt.writeFailed"));
|
|
4334
|
+
st(null), M({ silent: !0 });
|
|
4342
4335
|
} catch (e) {
|
|
4343
|
-
console.error("[ObjectGantt] Failed to delete:", e),
|
|
4336
|
+
console.error("[ObjectGantt] Failed to delete:", e), C(t), st(null), Ee(e);
|
|
4344
4337
|
} finally {
|
|
4345
4338
|
lt(!1);
|
|
4346
4339
|
}
|
|
4347
4340
|
}, [
|
|
4348
4341
|
ot,
|
|
4349
|
-
E,
|
|
4350
4342
|
D,
|
|
4343
|
+
O,
|
|
4351
4344
|
S,
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4345
|
+
M,
|
|
4346
|
+
Ee,
|
|
4347
|
+
Te
|
|
4355
4348
|
]);
|
|
4356
|
-
return
|
|
4349
|
+
return ye ? /* @__PURE__ */ k("div", {
|
|
4357
4350
|
className: m,
|
|
4358
|
-
children: /* @__PURE__ */
|
|
4351
|
+
children: /* @__PURE__ */ k("div", {
|
|
4359
4352
|
className: "flex items-center justify-center h-96",
|
|
4360
|
-
children: /* @__PURE__ */
|
|
4353
|
+
children: /* @__PURE__ */ k("div", {
|
|
4361
4354
|
className: "text-muted-foreground",
|
|
4362
4355
|
children: "Loading Gantt chart..."
|
|
4363
4356
|
})
|
|
4364
4357
|
})
|
|
4365
|
-
}) :
|
|
4358
|
+
}) : xe ? /* @__PURE__ */ k("div", {
|
|
4366
4359
|
className: m,
|
|
4367
|
-
children: /* @__PURE__ */
|
|
4360
|
+
children: /* @__PURE__ */ k("div", {
|
|
4368
4361
|
className: "flex items-center justify-center h-96",
|
|
4369
|
-
children: /* @__PURE__ */
|
|
4362
|
+
children: /* @__PURE__ */ A("div", {
|
|
4370
4363
|
className: "text-destructive",
|
|
4371
|
-
children: ["Error: ",
|
|
4364
|
+
children: ["Error: ", xe.message]
|
|
4372
4365
|
})
|
|
4373
4366
|
})
|
|
4374
|
-
}) :
|
|
4367
|
+
}) : E ? /* @__PURE__ */ A("div", {
|
|
4375
4368
|
className: b("flex h-full min-h-0 flex-col", m),
|
|
4376
4369
|
children: [
|
|
4377
|
-
|
|
4378
|
-
filters:
|
|
4379
|
-
value:
|
|
4380
|
-
onChange:
|
|
4381
|
-
onClear:
|
|
4382
|
-
resultCount:
|
|
4383
|
-
totalCount:
|
|
4370
|
+
Re.length > 0 && /* @__PURE__ */ k(Ot, {
|
|
4371
|
+
filters: Re,
|
|
4372
|
+
value: Ve,
|
|
4373
|
+
onChange: Ue,
|
|
4374
|
+
onClear: Ge,
|
|
4375
|
+
resultCount: qe.length,
|
|
4376
|
+
totalCount: N.length,
|
|
4384
4377
|
labels: {
|
|
4385
4378
|
all: "全部",
|
|
4386
4379
|
clear: "清除筛选",
|
|
@@ -4388,63 +4381,63 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4388
4381
|
resultSummary: (e, t) => `显示 ${e} / ${t} 项任务`
|
|
4389
4382
|
}
|
|
4390
4383
|
}),
|
|
4391
|
-
/* @__PURE__ */
|
|
4384
|
+
/* @__PURE__ */ k("div", {
|
|
4392
4385
|
className: "flex-1 min-h-[420px]",
|
|
4393
|
-
children:
|
|
4394
|
-
tasks:
|
|
4395
|
-
assignee:
|
|
4396
|
-
effort:
|
|
4397
|
-
capacity:
|
|
4386
|
+
children: E?.resourceView && P ? /* @__PURE__ */ k(St, {
|
|
4387
|
+
tasks: qe,
|
|
4388
|
+
assignee: P,
|
|
4389
|
+
effort: Ne,
|
|
4390
|
+
capacity: E?.capacity ?? 1,
|
|
4398
4391
|
viewMode: e.viewMode || "day"
|
|
4399
|
-
}) : /* @__PURE__ */
|
|
4400
|
-
tasks:
|
|
4401
|
-
startDate:
|
|
4402
|
-
endDate:
|
|
4392
|
+
}) : /* @__PURE__ */ k(ht, {
|
|
4393
|
+
tasks: qe,
|
|
4394
|
+
startDate: Ye?.start,
|
|
4395
|
+
endDate: Ye?.end,
|
|
4403
4396
|
onTaskClick: (e) => {
|
|
4404
|
-
|
|
4397
|
+
Ke(e.data) || Qe.handleClick(e.data), h?.(e.data);
|
|
4405
4398
|
},
|
|
4406
4399
|
onTaskUpdate: nt,
|
|
4407
4400
|
onTaskDelete: ut,
|
|
4408
|
-
onDependencyCreate:
|
|
4409
|
-
onDependencyDelete:
|
|
4401
|
+
onDependencyCreate: E?.dependenciesField ? it : void 0,
|
|
4402
|
+
onDependencyDelete: E?.dependenciesField ? at : void 0,
|
|
4410
4403
|
markers: e.markers,
|
|
4411
|
-
autoSchedule: !!
|
|
4412
|
-
rescheduleOnConflict: !!
|
|
4404
|
+
autoSchedule: !!E?.dependenciesField,
|
|
4405
|
+
rescheduleOnConflict: !!E?.dependenciesField,
|
|
4413
4406
|
criticalPathDefault: !!e.criticalPath,
|
|
4414
|
-
workingCalendar:
|
|
4415
|
-
shiftSegments:
|
|
4407
|
+
workingCalendar: F,
|
|
4408
|
+
shiftSegments: Pe,
|
|
4416
4409
|
showBaselines: e.showBaselines !== !1,
|
|
4417
4410
|
readOnly: !!e.readOnly,
|
|
4418
4411
|
mobileReadOnly: e.mobileReadOnly !== !1,
|
|
4419
|
-
persistLayoutKey:
|
|
4420
|
-
onLayoutChange:
|
|
4421
|
-
groupBy:
|
|
4422
|
-
defaultCollapsedDepth:
|
|
4423
|
-
summaryExtent:
|
|
4424
|
-
interactions:
|
|
4425
|
-
dependencyTypes:
|
|
4426
|
-
timeZone:
|
|
4412
|
+
persistLayoutKey: ze,
|
|
4413
|
+
onLayoutChange: Be ? He : void 0,
|
|
4414
|
+
groupBy: Me,
|
|
4415
|
+
defaultCollapsedDepth: E?.defaultCollapsedDepth,
|
|
4416
|
+
summaryExtent: E?.summaryExtent,
|
|
4417
|
+
interactions: E?.interactions,
|
|
4418
|
+
dependencyTypes: E?.dependencyTypes,
|
|
4419
|
+
timeZone: E?.timeZone,
|
|
4427
4420
|
onBeforeTaskUpdate: y,
|
|
4428
|
-
exportFileName: String(
|
|
4421
|
+
exportFileName: String(E?.exportFileName ?? e.label ?? w?.label ?? e.objectName ?? "") || void 0,
|
|
4429
4422
|
inlineEdit: !0,
|
|
4430
|
-
onRefresh: (
|
|
4431
|
-
refreshing:
|
|
4423
|
+
onRefresh: (T?.provider === "object" || T?.provider === "api") && typeof D?.find == "function" ? () => M({ silent: !0 }) : void 0,
|
|
4424
|
+
refreshing: Ae
|
|
4432
4425
|
})
|
|
4433
4426
|
}),
|
|
4434
|
-
|
|
4435
|
-
let t =
|
|
4436
|
-
if (!n ||
|
|
4437
|
-
let { objectName: r, recordId: i } = n, a = n.href ?? void 0, o =
|
|
4438
|
-
return /* @__PURE__ */
|
|
4427
|
+
Qe.isOverlay && Qe.isOpen && Qe.selectedRecord && (() => {
|
|
4428
|
+
let t = Qe.selectedRecord, n = R(t);
|
|
4429
|
+
if (!n || Ke(t)) return null;
|
|
4430
|
+
let { objectName: r, recordId: i } = n, a = n.href ?? void 0, o = E?.titleField ? String(t[E.titleField] ?? Te("gantt.drawer.fallbackTitle")) : Te("gantt.drawer.fallbackTitle"), c = !!e.readOnly || (E?.lockField ? !!t[E.lockField] : !1), l = $e?.key === `${r}:${i}` ? $e : null, u = l?.record ?? t, d = l?.schema ?? (r === O ? w : void 0), f = l && s ? s : D;
|
|
4431
|
+
return /* @__PURE__ */ k(v, {
|
|
4439
4432
|
open: !0,
|
|
4440
|
-
onClose:
|
|
4433
|
+
onClose: Qe.close,
|
|
4441
4434
|
title: o,
|
|
4442
4435
|
record: u,
|
|
4443
4436
|
objectName: r,
|
|
4444
4437
|
recordId: i,
|
|
4445
4438
|
dataSource: f ?? void 0,
|
|
4446
4439
|
objectSchema: d,
|
|
4447
|
-
width:
|
|
4440
|
+
width: Qe.width,
|
|
4448
4441
|
fullPageHref: a,
|
|
4449
4442
|
onFieldSave: c ? void 0 : async (e, t) => {
|
|
4450
4443
|
if (f?.update) {
|
|
@@ -4454,54 +4447,54 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4454
4447
|
let t = H(e);
|
|
4455
4448
|
throw t ? Error(t) : e;
|
|
4456
4449
|
}
|
|
4457
|
-
l &&
|
|
4450
|
+
l && et((n) => n && n.key === l.key ? {
|
|
4458
4451
|
...n,
|
|
4459
4452
|
record: {
|
|
4460
4453
|
...n.record,
|
|
4461
4454
|
[e]: t
|
|
4462
4455
|
}
|
|
4463
|
-
} : n),
|
|
4456
|
+
} : n), C((n) => n.map((n) => String(n.id ?? n._id) === String(i) ? {
|
|
4464
4457
|
...n,
|
|
4465
4458
|
[e]: t
|
|
4466
|
-
} : n)),
|
|
4459
|
+
} : n)), M({ silent: !0 });
|
|
4467
4460
|
}
|
|
4468
4461
|
},
|
|
4469
4462
|
onDelete: c ? void 0 : async () => {
|
|
4470
|
-
if (
|
|
4463
|
+
if (D?.delete) {
|
|
4471
4464
|
try {
|
|
4472
|
-
if (await
|
|
4465
|
+
if (await D.delete(r, String(i)) === !1) throw Error(Te("gantt.writeFailed"));
|
|
4473
4466
|
} catch (e) {
|
|
4474
|
-
throw
|
|
4467
|
+
throw Ee(e), e;
|
|
4475
4468
|
}
|
|
4476
|
-
|
|
4469
|
+
C((e) => e.filter((e) => String(e.id ?? e._id) !== String(i)));
|
|
4477
4470
|
}
|
|
4478
4471
|
}
|
|
4479
4472
|
});
|
|
4480
4473
|
})(),
|
|
4481
|
-
/* @__PURE__ */
|
|
4474
|
+
/* @__PURE__ */ k(re, {
|
|
4482
4475
|
open: !!ot,
|
|
4483
4476
|
onOpenChange: (e) => {
|
|
4484
4477
|
!e && !ct && st(null);
|
|
4485
4478
|
},
|
|
4486
|
-
children: /* @__PURE__ */
|
|
4479
|
+
children: /* @__PURE__ */ A(oe, { children: [/* @__PURE__ */ A(le, { children: [/* @__PURE__ */ k(ue, { children: Te("gantt.delete.title") }), /* @__PURE__ */ k(se, { children: ot ? Te("gantt.delete.body", { title: ot.title }) : null })] }), /* @__PURE__ */ A(ce, { children: [/* @__PURE__ */ k(ae, {
|
|
4487
4480
|
disabled: ct,
|
|
4488
|
-
children:
|
|
4489
|
-
}), /* @__PURE__ */
|
|
4481
|
+
children: Te("gantt.delete.cancel")
|
|
4482
|
+
}), /* @__PURE__ */ k(ie, {
|
|
4490
4483
|
onClick: (e) => {
|
|
4491
4484
|
e.preventDefault(), dt();
|
|
4492
4485
|
},
|
|
4493
4486
|
disabled: ct,
|
|
4494
4487
|
"data-testid": "gantt-delete-confirm",
|
|
4495
4488
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
4496
|
-
children:
|
|
4489
|
+
children: Te(ct ? "gantt.delete.deleting" : "gantt.delete.confirm")
|
|
4497
4490
|
})] })] })
|
|
4498
4491
|
})
|
|
4499
4492
|
]
|
|
4500
|
-
}) : /* @__PURE__ */
|
|
4493
|
+
}) : /* @__PURE__ */ k("div", {
|
|
4501
4494
|
className: m,
|
|
4502
|
-
children: /* @__PURE__ */
|
|
4495
|
+
children: /* @__PURE__ */ k("div", {
|
|
4503
4496
|
className: "flex items-center justify-center h-96",
|
|
4504
|
-
children: /* @__PURE__ */
|
|
4497
|
+
children: /* @__PURE__ */ k("div", {
|
|
4505
4498
|
className: "text-muted-foreground",
|
|
4506
4499
|
children: "Gantt configuration required. Please specify startDateField, endDateField, and titleField."
|
|
4507
4500
|
})
|
|
@@ -4509,7 +4502,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
|
|
|
4509
4502
|
});
|
|
4510
4503
|
}, It = ({ schema: e }) => {
|
|
4511
4504
|
let { dataSource: t } = h() || {};
|
|
4512
|
-
return /* @__PURE__ */
|
|
4505
|
+
return /* @__PURE__ */ k(Ft, {
|
|
4513
4506
|
schema: e,
|
|
4514
4507
|
dataSource: t
|
|
4515
4508
|
});
|
|
@@ -4546,4 +4539,4 @@ s.register("object-gantt", It, {
|
|
|
4546
4539
|
}]
|
|
4547
4540
|
});
|
|
4548
4541
|
//#endregion
|
|
4549
|
-
export { ht as GanttView, Ft as ObjectGantt, It as ObjectGanttRenderer, Ot as QuickFilterBar, St as ResourceWorkload,
|
|
4542
|
+
export { ht as GanttView, Ft as ObjectGantt, It as ObjectGanttRenderer, Ot as QuickFilterBar, St as ResourceWorkload, Ke as bandAt, _t as computeWorkload, jt as normalizeDependencies, We as normalizeShiftSegments, kt as normalizeTaskType, Ue as parseHHMM, Ge as shiftDayStart };
|