iris-gantt 1.0.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/README.md +279 -0
- package/dist/iris-gantt.css +1 -0
- package/dist/iris-gantt.js +3048 -0
- package/dist/iris-gantt.umd.cjs +23 -0
- package/dist/vite.svg +1 -0
- package/package.json +59 -0
- package/src/components/Gantt/gantt.css +2167 -0
|
@@ -0,0 +1,3048 @@
|
|
|
1
|
+
import Be, { useState as B, useMemo as Bt, forwardRef as qe, useCallback as me, useRef as Ve, useEffect as tt } from "react";
|
|
2
|
+
import { Typography as ft, Select as ie, Input as ve, List as $e, Radio as Ce, Space as ge, InputNumber as ke, Button as se, Popover as zt, Tooltip as ye, Divider as Le, Form as G, Modal as ze, DatePicker as pt, ColorPicker as gt, Card as nt, Alert as Xe, Tag as be, Menu as Ht } from "antd";
|
|
3
|
+
import { FontAwesomeIcon as z } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { faChevronRight as mt, faPlus as Ne, faChevronDown as st, faGripVertical as xt, faTimesCircle as Wt, faCalendarCheck as Ut, faSearchMinus as Jt, faSearchPlus as Vt, faRotateLeft as yt, faFileCsv as Xt, faFileExcel as Gt, faFileCode as qt, faFilePdf as Zt, faExclamationTriangle as Kt, faArrowDown as Qt, faArrowUp as en, faInfoCircle as rt, faLink as wt, faTrash as jt, faEdit as tn, faCopy as nn, faFlag as sn, faTasks as rn, faFolder as an } from "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
function on(t) {
|
|
6
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
7
|
+
}
|
|
8
|
+
var _e = { exports: {} }, Ee = {};
|
|
9
|
+
var at;
|
|
10
|
+
function ln() {
|
|
11
|
+
if (at) return Ee;
|
|
12
|
+
at = 1;
|
|
13
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
14
|
+
function a(i, s, p) {
|
|
15
|
+
var l = null;
|
|
16
|
+
if (p !== void 0 && (l = "" + p), s.key !== void 0 && (l = "" + s.key), "key" in s) {
|
|
17
|
+
p = {};
|
|
18
|
+
for (var o in s)
|
|
19
|
+
o !== "key" && (p[o] = s[o]);
|
|
20
|
+
} else p = s;
|
|
21
|
+
return s = p.ref, {
|
|
22
|
+
$$typeof: t,
|
|
23
|
+
type: i,
|
|
24
|
+
key: l,
|
|
25
|
+
ref: s !== void 0 ? s : null,
|
|
26
|
+
props: p
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return Ee.Fragment = r, Ee.jsx = a, Ee.jsxs = a, Ee;
|
|
30
|
+
}
|
|
31
|
+
var Fe = {};
|
|
32
|
+
var it;
|
|
33
|
+
function cn() {
|
|
34
|
+
return it || (it = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
35
|
+
function t(n) {
|
|
36
|
+
if (n == null) return null;
|
|
37
|
+
if (typeof n == "function")
|
|
38
|
+
return n.$$typeof === P ? null : n.displayName || n.name || null;
|
|
39
|
+
if (typeof n == "string") return n;
|
|
40
|
+
switch (n) {
|
|
41
|
+
case _:
|
|
42
|
+
return "Fragment";
|
|
43
|
+
case D:
|
|
44
|
+
return "Profiler";
|
|
45
|
+
case m:
|
|
46
|
+
return "StrictMode";
|
|
47
|
+
case A:
|
|
48
|
+
return "Suspense";
|
|
49
|
+
case X:
|
|
50
|
+
return "SuspenseList";
|
|
51
|
+
case R:
|
|
52
|
+
return "Activity";
|
|
53
|
+
}
|
|
54
|
+
if (typeof n == "object")
|
|
55
|
+
switch (typeof n.tag == "number" && console.error(
|
|
56
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
57
|
+
), n.$$typeof) {
|
|
58
|
+
case T:
|
|
59
|
+
return "Portal";
|
|
60
|
+
case L:
|
|
61
|
+
return n.displayName || "Context";
|
|
62
|
+
case Y:
|
|
63
|
+
return (n._context.displayName || "Context") + ".Consumer";
|
|
64
|
+
case O:
|
|
65
|
+
var y = n.render;
|
|
66
|
+
return n = n.displayName, n || (n = y.displayName || y.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
|
|
67
|
+
case te:
|
|
68
|
+
return y = n.displayName || null, y !== null ? y : t(n.type) || "Memo";
|
|
69
|
+
case x:
|
|
70
|
+
y = n._payload, n = n._init;
|
|
71
|
+
try {
|
|
72
|
+
return t(n(y));
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
function r(n) {
|
|
79
|
+
return "" + n;
|
|
80
|
+
}
|
|
81
|
+
function a(n) {
|
|
82
|
+
try {
|
|
83
|
+
r(n);
|
|
84
|
+
var y = !1;
|
|
85
|
+
} catch {
|
|
86
|
+
y = !0;
|
|
87
|
+
}
|
|
88
|
+
if (y) {
|
|
89
|
+
y = console;
|
|
90
|
+
var C = y.error, N = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
91
|
+
return C.call(
|
|
92
|
+
y,
|
|
93
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
94
|
+
N
|
|
95
|
+
), r(n);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function i(n) {
|
|
99
|
+
if (n === _) return "<>";
|
|
100
|
+
if (typeof n == "object" && n !== null && n.$$typeof === x)
|
|
101
|
+
return "<...>";
|
|
102
|
+
try {
|
|
103
|
+
var y = t(n);
|
|
104
|
+
return y ? "<" + y + ">" : "<...>";
|
|
105
|
+
} catch {
|
|
106
|
+
return "<...>";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function s() {
|
|
110
|
+
var n = J.A;
|
|
111
|
+
return n === null ? null : n.getOwner();
|
|
112
|
+
}
|
|
113
|
+
function p() {
|
|
114
|
+
return Error("react-stack-top-frame");
|
|
115
|
+
}
|
|
116
|
+
function l(n) {
|
|
117
|
+
if (U.call(n, "key")) {
|
|
118
|
+
var y = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
119
|
+
if (y && y.isReactWarning) return !1;
|
|
120
|
+
}
|
|
121
|
+
return n.key !== void 0;
|
|
122
|
+
}
|
|
123
|
+
function o(n, y) {
|
|
124
|
+
function C() {
|
|
125
|
+
g || (g = !0, console.error(
|
|
126
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
127
|
+
y
|
|
128
|
+
));
|
|
129
|
+
}
|
|
130
|
+
C.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
131
|
+
get: C,
|
|
132
|
+
configurable: !0
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function c() {
|
|
136
|
+
var n = t(this.type);
|
|
137
|
+
return $[n] || ($[n] = !0, console.error(
|
|
138
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
139
|
+
)), n = this.props.ref, n !== void 0 ? n : null;
|
|
140
|
+
}
|
|
141
|
+
function v(n, y, C, N, H, K) {
|
|
142
|
+
var I = C.ref;
|
|
143
|
+
return n = {
|
|
144
|
+
$$typeof: u,
|
|
145
|
+
type: n,
|
|
146
|
+
key: y,
|
|
147
|
+
props: C,
|
|
148
|
+
_owner: N
|
|
149
|
+
}, (I !== void 0 ? I : null) !== null ? Object.defineProperty(n, "ref", {
|
|
150
|
+
enumerable: !1,
|
|
151
|
+
get: c
|
|
152
|
+
}) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
|
|
153
|
+
configurable: !1,
|
|
154
|
+
enumerable: !1,
|
|
155
|
+
writable: !0,
|
|
156
|
+
value: 0
|
|
157
|
+
}), Object.defineProperty(n, "_debugInfo", {
|
|
158
|
+
configurable: !1,
|
|
159
|
+
enumerable: !1,
|
|
160
|
+
writable: !0,
|
|
161
|
+
value: null
|
|
162
|
+
}), Object.defineProperty(n, "_debugStack", {
|
|
163
|
+
configurable: !1,
|
|
164
|
+
enumerable: !1,
|
|
165
|
+
writable: !0,
|
|
166
|
+
value: H
|
|
167
|
+
}), Object.defineProperty(n, "_debugTask", {
|
|
168
|
+
configurable: !1,
|
|
169
|
+
enumerable: !1,
|
|
170
|
+
writable: !0,
|
|
171
|
+
value: K
|
|
172
|
+
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
|
|
173
|
+
}
|
|
174
|
+
function b(n, y, C, N, H, K) {
|
|
175
|
+
var I = y.children;
|
|
176
|
+
if (I !== void 0)
|
|
177
|
+
if (N)
|
|
178
|
+
if (E(I)) {
|
|
179
|
+
for (N = 0; N < I.length; N++)
|
|
180
|
+
j(I[N]);
|
|
181
|
+
Object.freeze && Object.freeze(I);
|
|
182
|
+
} else
|
|
183
|
+
console.error(
|
|
184
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
185
|
+
);
|
|
186
|
+
else j(I);
|
|
187
|
+
if (U.call(y, "key")) {
|
|
188
|
+
I = t(n);
|
|
189
|
+
var ee = Object.keys(y).filter(function(q) {
|
|
190
|
+
return q !== "key";
|
|
191
|
+
});
|
|
192
|
+
N = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", f[I + N] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
193
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
194
|
+
let props = %s;
|
|
195
|
+
<%s {...props} />
|
|
196
|
+
React keys must be passed directly to JSX without using spread:
|
|
197
|
+
let props = %s;
|
|
198
|
+
<%s key={someKey} {...props} />`,
|
|
199
|
+
N,
|
|
200
|
+
I,
|
|
201
|
+
ee,
|
|
202
|
+
I
|
|
203
|
+
), f[I + N] = !0);
|
|
204
|
+
}
|
|
205
|
+
if (I = null, C !== void 0 && (a(C), I = "" + C), l(y) && (a(y.key), I = "" + y.key), "key" in y) {
|
|
206
|
+
C = {};
|
|
207
|
+
for (var ne in y)
|
|
208
|
+
ne !== "key" && (C[ne] = y[ne]);
|
|
209
|
+
} else C = y;
|
|
210
|
+
return I && o(
|
|
211
|
+
C,
|
|
212
|
+
typeof n == "function" ? n.displayName || n.name || "Unknown" : n
|
|
213
|
+
), v(
|
|
214
|
+
n,
|
|
215
|
+
I,
|
|
216
|
+
C,
|
|
217
|
+
s(),
|
|
218
|
+
H,
|
|
219
|
+
K
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
function j(n) {
|
|
223
|
+
k(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === x && (n._payload.status === "fulfilled" ? k(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
224
|
+
}
|
|
225
|
+
function k(n) {
|
|
226
|
+
return typeof n == "object" && n !== null && n.$$typeof === u;
|
|
227
|
+
}
|
|
228
|
+
var d = Be, u = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), m = /* @__PURE__ */ Symbol.for("react.strict_mode"), D = /* @__PURE__ */ Symbol.for("react.profiler"), Y = /* @__PURE__ */ Symbol.for("react.consumer"), L = /* @__PURE__ */ Symbol.for("react.context"), O = /* @__PURE__ */ Symbol.for("react.forward_ref"), A = /* @__PURE__ */ Symbol.for("react.suspense"), X = /* @__PURE__ */ Symbol.for("react.suspense_list"), te = /* @__PURE__ */ Symbol.for("react.memo"), x = /* @__PURE__ */ Symbol.for("react.lazy"), R = /* @__PURE__ */ Symbol.for("react.activity"), P = /* @__PURE__ */ Symbol.for("react.client.reference"), J = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, E = Array.isArray, S = console.createTask ? console.createTask : function() {
|
|
229
|
+
return null;
|
|
230
|
+
};
|
|
231
|
+
d = {
|
|
232
|
+
react_stack_bottom_frame: function(n) {
|
|
233
|
+
return n();
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
var g, $ = {}, w = d.react_stack_bottom_frame.bind(
|
|
237
|
+
d,
|
|
238
|
+
p
|
|
239
|
+
)(), h = S(i(p)), f = {};
|
|
240
|
+
Fe.Fragment = _, Fe.jsx = function(n, y, C) {
|
|
241
|
+
var N = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
242
|
+
return b(
|
|
243
|
+
n,
|
|
244
|
+
y,
|
|
245
|
+
C,
|
|
246
|
+
!1,
|
|
247
|
+
N ? Error("react-stack-top-frame") : w,
|
|
248
|
+
N ? S(i(n)) : h
|
|
249
|
+
);
|
|
250
|
+
}, Fe.jsxs = function(n, y, C) {
|
|
251
|
+
var N = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return b(
|
|
253
|
+
n,
|
|
254
|
+
y,
|
|
255
|
+
C,
|
|
256
|
+
!0,
|
|
257
|
+
N ? Error("react-stack-top-frame") : w,
|
|
258
|
+
N ? S(i(n)) : h
|
|
259
|
+
);
|
|
260
|
+
};
|
|
261
|
+
})()), Fe;
|
|
262
|
+
}
|
|
263
|
+
var ot;
|
|
264
|
+
function dn() {
|
|
265
|
+
return ot || (ot = 1, process.env.NODE_ENV === "production" ? _e.exports = ln() : _e.exports = cn()), _e.exports;
|
|
266
|
+
}
|
|
267
|
+
var e = dn();
|
|
268
|
+
const ae = (t, r, a) => {
|
|
269
|
+
const i = new Date(t);
|
|
270
|
+
switch (a) {
|
|
271
|
+
case "hour":
|
|
272
|
+
i.setHours(i.getHours() + r);
|
|
273
|
+
break;
|
|
274
|
+
case "day":
|
|
275
|
+
i.setDate(i.getDate() + r);
|
|
276
|
+
break;
|
|
277
|
+
case "week":
|
|
278
|
+
i.setDate(i.getDate() + r * 7);
|
|
279
|
+
break;
|
|
280
|
+
case "month":
|
|
281
|
+
i.setMonth(i.getMonth() + r);
|
|
282
|
+
break;
|
|
283
|
+
case "quarter":
|
|
284
|
+
i.setMonth(i.getMonth() + r * 3);
|
|
285
|
+
break;
|
|
286
|
+
case "year":
|
|
287
|
+
i.setFullYear(i.getFullYear() + r);
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
return i;
|
|
291
|
+
}, Ie = (t, r) => {
|
|
292
|
+
const a = r.getTime() - t.getTime();
|
|
293
|
+
return Math.ceil(a / (1e3 * 60 * 60 * 24));
|
|
294
|
+
}, un = (t, r) => {
|
|
295
|
+
const a = r.getTime() - t.getTime();
|
|
296
|
+
return Math.ceil(a / (1e3 * 60 * 60));
|
|
297
|
+
}, ce = (t, r) => {
|
|
298
|
+
const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], i = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], s = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], p = {
|
|
299
|
+
YYYY: t.getFullYear().toString(),
|
|
300
|
+
YY: t.getFullYear().toString().slice(-2),
|
|
301
|
+
MMMM: i[t.getMonth()],
|
|
302
|
+
MMM: a[t.getMonth()],
|
|
303
|
+
MM: String(t.getMonth() + 1).padStart(2, "0"),
|
|
304
|
+
M: String(t.getMonth() + 1),
|
|
305
|
+
DD: String(t.getDate()).padStart(2, "0"),
|
|
306
|
+
D: String(t.getDate()),
|
|
307
|
+
dddd: s[t.getDay()],
|
|
308
|
+
HH: String(t.getHours()).padStart(2, "0"),
|
|
309
|
+
H: String(t.getHours()),
|
|
310
|
+
mm: String(t.getMinutes()).padStart(2, "0"),
|
|
311
|
+
m: String(t.getMinutes())
|
|
312
|
+
};
|
|
313
|
+
return r.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, (l) => p[l]);
|
|
314
|
+
}, lt = (t) => {
|
|
315
|
+
const r = t.getDay();
|
|
316
|
+
return r === 0 || r === 6;
|
|
317
|
+
}, ct = (t, r) => r.some(
|
|
318
|
+
(a) => a.getFullYear() === t.getFullYear() && a.getMonth() === t.getMonth() && a.getDate() === t.getDate()
|
|
319
|
+
), Ye = (t) => {
|
|
320
|
+
const r = new Date(t);
|
|
321
|
+
return r.setHours(0, 0, 0, 0), r;
|
|
322
|
+
}, es = (t) => {
|
|
323
|
+
const r = new Date(t);
|
|
324
|
+
return r.setHours(23, 59, 59, 999), r;
|
|
325
|
+
}, ts = (t, r, a = "day") => {
|
|
326
|
+
switch (a) {
|
|
327
|
+
case "hour":
|
|
328
|
+
return un(t, r);
|
|
329
|
+
case "day":
|
|
330
|
+
return Ie(t, r);
|
|
331
|
+
case "week":
|
|
332
|
+
return Math.ceil(Ie(t, r) / 7);
|
|
333
|
+
case "month":
|
|
334
|
+
return (r.getFullYear() - t.getFullYear()) * 12 + (r.getMonth() - t.getMonth());
|
|
335
|
+
default:
|
|
336
|
+
return Ie(t, r);
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
function hn(t) {
|
|
340
|
+
if (!t || typeof t != "string") return null;
|
|
341
|
+
const r = t.trim(), a = /^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i, i = r.match(a);
|
|
342
|
+
if (!i) return null;
|
|
343
|
+
const s = parseInt(i[1], 10), p = i[2].toUpperCase();
|
|
344
|
+
let l = 0, o = "day";
|
|
345
|
+
if (i[3]) {
|
|
346
|
+
const c = i[4] === "-" ? -1 : 1;
|
|
347
|
+
switch (l = parseInt(i[5], 10) * c, i[6].toLowerCase()) {
|
|
348
|
+
case "d":
|
|
349
|
+
o = "day";
|
|
350
|
+
break;
|
|
351
|
+
case "h":
|
|
352
|
+
o = "hour";
|
|
353
|
+
break;
|
|
354
|
+
case "w":
|
|
355
|
+
o = "week";
|
|
356
|
+
break;
|
|
357
|
+
case "m":
|
|
358
|
+
o = "month";
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return { taskNumber: s, type: p, lag: l, lagUnit: o };
|
|
363
|
+
}
|
|
364
|
+
function Ge(t, r) {
|
|
365
|
+
switch (r) {
|
|
366
|
+
case "hour":
|
|
367
|
+
return t / 24;
|
|
368
|
+
case "day":
|
|
369
|
+
return t;
|
|
370
|
+
case "week":
|
|
371
|
+
return t * 7;
|
|
372
|
+
case "month":
|
|
373
|
+
return t * 30;
|
|
374
|
+
// Approximate
|
|
375
|
+
default:
|
|
376
|
+
return t;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function fn(t, r) {
|
|
380
|
+
const i = {
|
|
381
|
+
e2s: "FS",
|
|
382
|
+
s2s: "SS",
|
|
383
|
+
e2e: "FF",
|
|
384
|
+
s2e: "SF"
|
|
385
|
+
}[t.type];
|
|
386
|
+
let s = `${r}${i}`;
|
|
387
|
+
if (t.lag && t.lag !== 0) {
|
|
388
|
+
const p = t.lag > 0 ? "+" : "", o = (t.lagUnit || "day").charAt(0);
|
|
389
|
+
let c = t.lag;
|
|
390
|
+
if (t.lagUnit && t.lagUnit !== "day")
|
|
391
|
+
switch (t.lagUnit) {
|
|
392
|
+
case "hour":
|
|
393
|
+
c = t.lag * 24;
|
|
394
|
+
break;
|
|
395
|
+
case "week":
|
|
396
|
+
c = t.lag / 7;
|
|
397
|
+
break;
|
|
398
|
+
case "month":
|
|
399
|
+
c = t.lag / 30;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
s += `${p}${Math.round(c)}${o}`;
|
|
403
|
+
}
|
|
404
|
+
return s;
|
|
405
|
+
}
|
|
406
|
+
function pn(t) {
|
|
407
|
+
return {
|
|
408
|
+
FS: "e2s",
|
|
409
|
+
SS: "s2s",
|
|
410
|
+
FF: "e2e",
|
|
411
|
+
SF: "s2e"
|
|
412
|
+
}[t];
|
|
413
|
+
}
|
|
414
|
+
const { Text: we, Paragraph: gn, Link: mn } = ft, { Option: dt } = ie, xn = ({
|
|
415
|
+
task: t,
|
|
416
|
+
allTasks: r,
|
|
417
|
+
onAddDependency: a,
|
|
418
|
+
children: i
|
|
419
|
+
}) => {
|
|
420
|
+
const [s, p] = B(!1), [l, o] = B(""), [c, v] = B(null), [b, j] = B("e2s"), [k, d] = B("lag"), [u, T] = B(0), [_, m] = B(!0), D = "day", Y = Bt(() => {
|
|
421
|
+
if (!l) return r.filter((R) => R.id !== t.id);
|
|
422
|
+
const x = l.toLowerCase();
|
|
423
|
+
return r.filter(
|
|
424
|
+
(R) => R.id !== t.id && (R.text.toLowerCase().includes(x) || (r.indexOf(R) + 1).toString().includes(x))
|
|
425
|
+
);
|
|
426
|
+
}, [r, l, t.id]), L = () => {
|
|
427
|
+
if (c) {
|
|
428
|
+
const x = k === "lag" ? u : -u, R = Ge(x, D);
|
|
429
|
+
a(c, t.id, b, R), p(!1), O();
|
|
430
|
+
}
|
|
431
|
+
}, O = () => {
|
|
432
|
+
o(""), v(null), j("e2s"), d("lag"), T(0);
|
|
433
|
+
}, A = () => {
|
|
434
|
+
if (!_) return null;
|
|
435
|
+
const x = b === "e2s", R = b === "s2s", P = b === "e2e", J = b === "s2e";
|
|
436
|
+
let U = 0, E = 0, S = "", g = 0, $ = -1;
|
|
437
|
+
return x ? (U = 20, E = 160, g = 140, $ = 160, S = "M 140 40 L 150 40 C 160 40, 160 90, 150 90 L 160 90") : P ? (U = 60, E = 60, g = 180, $ = -1, S = "M 180 40 L 200 40 L 200 90 L 180 90") : R ? (U = 100, E = 100, g = 100, $ = -1, S = "M 100 40 L 80 40 L 80 90 L 100 90") : J && (U = 160, E = 20, g = 160, $ = 140, S = "M 160 40 L 150 40 C 140 40, 140 90, 150 90 L 140 90"), /* @__PURE__ */ e.jsx("div", { style: {
|
|
438
|
+
width: "100%",
|
|
439
|
+
height: 120,
|
|
440
|
+
backgroundColor: "#fff",
|
|
441
|
+
borderRadius: 4,
|
|
442
|
+
marginBottom: 10,
|
|
443
|
+
border: "1px solid #e9ecef",
|
|
444
|
+
position: "relative",
|
|
445
|
+
overflow: "hidden"
|
|
446
|
+
}, children: /* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 300 120", style: { width: "100%", height: "100%" }, children: [
|
|
447
|
+
/* @__PURE__ */ e.jsx("line", { x1: g, x2: g, y1: "0", y2: "120", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
448
|
+
$ !== -1 && /* @__PURE__ */ e.jsx("line", { x1: $, x2: $, y1: "0", y2: "120", stroke: "#f0f0f0", strokeDasharray: "3,3" }),
|
|
449
|
+
/* @__PURE__ */ e.jsx("rect", { x: U, y: "28", width: "120", height: "24", rx: "4", fill: "#bae7ff", stroke: "#69c0ff" }),
|
|
450
|
+
/* @__PURE__ */ e.jsx("text", { x: U + 60, y: "44", fontSize: "11", textAnchor: "middle", fill: "#0050b3", children: "Task 2" }),
|
|
451
|
+
/* @__PURE__ */ e.jsx("rect", { x: E, y: "78", width: "120", height: "24", rx: "4", fill: "#bae7ff", stroke: "#69c0ff" }),
|
|
452
|
+
/* @__PURE__ */ e.jsx("text", { x: E + 60, y: "94", fontSize: "11", textAnchor: "middle", fill: "#0050b3", children: "Task 3" }),
|
|
453
|
+
/* @__PURE__ */ e.jsx("path", { d: S, fill: "none", stroke: "#8c8c8c", strokeWidth: "1.5", markerEnd: "url(#arrowhead)" }),
|
|
454
|
+
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("marker", { id: "arrowhead", markerWidth: "10", markerHeight: "7", refX: "9", refY: "3.5", orient: "auto", children: /* @__PURE__ */ e.jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: "#8c8c8c" }) }) })
|
|
455
|
+
] }) });
|
|
456
|
+
}, X = () => {
|
|
457
|
+
const x = r.find((U) => U.id === c);
|
|
458
|
+
if (!x) return "Select a task from the list to see how it will relate to the current task.";
|
|
459
|
+
const R = r.indexOf(t) + 1, P = r.indexOf(x) + 1;
|
|
460
|
+
let J = "";
|
|
461
|
+
switch (b) {
|
|
462
|
+
case "e2s":
|
|
463
|
+
J = `Task ${R} starts after Task ${P} finishes`;
|
|
464
|
+
break;
|
|
465
|
+
case "s2s":
|
|
466
|
+
J = `Task ${R} starts when Task ${P} starts`;
|
|
467
|
+
break;
|
|
468
|
+
case "e2e":
|
|
469
|
+
J = `Task ${R} finishes when Task ${P} finishes`;
|
|
470
|
+
break;
|
|
471
|
+
case "s2e":
|
|
472
|
+
J = `Task ${R} finishes when Task ${P} starts`;
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
if (u > 0) {
|
|
476
|
+
const U = `${u} ${D}${u > 1 ? "s" : ""}`;
|
|
477
|
+
k === "lag" ? J += ` + ${U} delay` : J += ` - ${U} overlap`;
|
|
478
|
+
}
|
|
479
|
+
return J + ".";
|
|
480
|
+
}, te = /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", width: 620, height: 480, backgroundColor: "#fff", borderRadius: "8px", overflow: "hidden" }, children: [
|
|
481
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1, borderRight: "1px solid #f0f0f0", display: "flex", flexDirection: "column", padding: 0 }, children: [
|
|
482
|
+
/* @__PURE__ */ e.jsx("div", { style: { padding: "12px" }, children: /* @__PURE__ */ e.jsx(
|
|
483
|
+
ve,
|
|
484
|
+
{
|
|
485
|
+
placeholder: "Search task...",
|
|
486
|
+
value: l,
|
|
487
|
+
onChange: (x) => o(x.target.value),
|
|
488
|
+
style: { marginBottom: 8 },
|
|
489
|
+
autoFocus: !0,
|
|
490
|
+
size: "large"
|
|
491
|
+
}
|
|
492
|
+
) }),
|
|
493
|
+
/* @__PURE__ */ e.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: /* @__PURE__ */ e.jsx(
|
|
494
|
+
$e,
|
|
495
|
+
{
|
|
496
|
+
size: "small",
|
|
497
|
+
dataSource: Y,
|
|
498
|
+
renderItem: (x) => /* @__PURE__ */ e.jsxs(
|
|
499
|
+
$e.Item,
|
|
500
|
+
{
|
|
501
|
+
className: `task-list-item ${c === x.id ? "selected" : ""}`,
|
|
502
|
+
onClick: () => v(x.id),
|
|
503
|
+
style: {
|
|
504
|
+
cursor: "pointer",
|
|
505
|
+
padding: "8px 16px",
|
|
506
|
+
backgroundColor: c === x.id ? "#f0f7ff" : "transparent",
|
|
507
|
+
display: "flex",
|
|
508
|
+
justifyContent: "space-between"
|
|
509
|
+
},
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 12 }, children: [
|
|
512
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", style: { width: 20 }, children: r.indexOf(x) + 1 }),
|
|
513
|
+
/* @__PURE__ */ e.jsx(we, { children: x.text })
|
|
514
|
+
] }),
|
|
515
|
+
/* @__PURE__ */ e.jsx(z, { icon: mt, style: { fontSize: 10, color: "#bfbfbf" } })
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
)
|
|
519
|
+
}
|
|
520
|
+
) })
|
|
521
|
+
] }),
|
|
522
|
+
/* @__PURE__ */ e.jsxs("div", { style: { width: 340, padding: "24px", display: "flex", flexDirection: "column", borderLeft: "1px solid #f0f0f0" }, children: [
|
|
523
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 15 }, children: [
|
|
524
|
+
/* @__PURE__ */ e.jsx(we, { strong: !0, children: "Dependency type" }),
|
|
525
|
+
/* @__PURE__ */ e.jsx(
|
|
526
|
+
mn,
|
|
527
|
+
{
|
|
528
|
+
style: { fontSize: "12px" },
|
|
529
|
+
onClick: () => m(!_),
|
|
530
|
+
children: _ ? "Hide preview" : "Show preview"
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
] }),
|
|
534
|
+
A(),
|
|
535
|
+
/* @__PURE__ */ e.jsx(gn, { style: { fontSize: "13px", color: "#262626", marginBottom: 20, minHeight: 48, lineHeight: "1.6" }, children: X() }),
|
|
536
|
+
/* @__PURE__ */ e.jsx(
|
|
537
|
+
Ce.Group,
|
|
538
|
+
{
|
|
539
|
+
value: b,
|
|
540
|
+
onChange: (x) => j(x.target.value),
|
|
541
|
+
style: { width: "100%", marginBottom: 20 },
|
|
542
|
+
children: /* @__PURE__ */ e.jsxs(ge, { direction: "vertical", style: { width: "100%" }, children: [
|
|
543
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", width: "100%" }, children: [
|
|
544
|
+
/* @__PURE__ */ e.jsx(Ce, { value: "e2s", children: "Finish to Start" }),
|
|
545
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", children: "FS" })
|
|
546
|
+
] }),
|
|
547
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", width: "100%" }, children: [
|
|
548
|
+
/* @__PURE__ */ e.jsx(Ce, { value: "e2e", children: "Finish to Finish" }),
|
|
549
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", children: "FF" })
|
|
550
|
+
] }),
|
|
551
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", width: "100%" }, children: [
|
|
552
|
+
/* @__PURE__ */ e.jsx(Ce, { value: "s2s", children: "Start to Start" }),
|
|
553
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", children: "SS" })
|
|
554
|
+
] }),
|
|
555
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", justifyContent: "space-between", width: "100%" }, children: [
|
|
556
|
+
/* @__PURE__ */ e.jsx(Ce, { value: "s2e", children: "Start to Finish" }),
|
|
557
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", children: "SF" })
|
|
558
|
+
] })
|
|
559
|
+
] })
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "10px", marginBottom: 20 }, children: [
|
|
563
|
+
/* @__PURE__ */ e.jsxs("div", { style: { flex: 1 }, children: [
|
|
564
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", style: { fontSize: "11px", display: "block", marginBottom: 4 }, children: "Delay type" }),
|
|
565
|
+
/* @__PURE__ */ e.jsxs(ie, { value: k, onChange: (x) => d(x), style: { width: "100%" }, size: "large", children: [
|
|
566
|
+
/* @__PURE__ */ e.jsx(dt, { value: "lag", children: "Lag by" }),
|
|
567
|
+
/* @__PURE__ */ e.jsx(dt, { value: "lead", children: "Lead by" })
|
|
568
|
+
] })
|
|
569
|
+
] }),
|
|
570
|
+
/* @__PURE__ */ e.jsxs("div", { style: { width: 100 }, children: [
|
|
571
|
+
/* @__PURE__ */ e.jsx(we, { type: "secondary", style: { fontSize: "11px", display: "block", marginBottom: 4 }, children: "Days" }),
|
|
572
|
+
/* @__PURE__ */ e.jsx(ge.Compact, { style: { width: "100%" }, children: /* @__PURE__ */ e.jsx(
|
|
573
|
+
ke,
|
|
574
|
+
{
|
|
575
|
+
min: 0,
|
|
576
|
+
value: u,
|
|
577
|
+
onChange: (x) => T(x || 0),
|
|
578
|
+
style: { width: "100%" },
|
|
579
|
+
placeholder: "0",
|
|
580
|
+
size: "large"
|
|
581
|
+
}
|
|
582
|
+
) })
|
|
583
|
+
] })
|
|
584
|
+
] }),
|
|
585
|
+
/* @__PURE__ */ e.jsx(
|
|
586
|
+
se,
|
|
587
|
+
{
|
|
588
|
+
type: "primary",
|
|
589
|
+
block: !0,
|
|
590
|
+
onClick: L,
|
|
591
|
+
disabled: !c,
|
|
592
|
+
style: { marginTop: "auto", backgroundColor: "#5c67f2", height: 44, borderRadius: "6px" },
|
|
593
|
+
children: "Add"
|
|
594
|
+
}
|
|
595
|
+
)
|
|
596
|
+
] })
|
|
597
|
+
] });
|
|
598
|
+
return /* @__PURE__ */ e.jsx(
|
|
599
|
+
zt,
|
|
600
|
+
{
|
|
601
|
+
content: te,
|
|
602
|
+
trigger: "click",
|
|
603
|
+
open: s,
|
|
604
|
+
onOpenChange: p,
|
|
605
|
+
placement: "bottomLeft",
|
|
606
|
+
overlayClassName: "dependency-popover",
|
|
607
|
+
overlayInnerStyle: { padding: 0 },
|
|
608
|
+
children: i
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
}, vt = qe(
|
|
612
|
+
({ tasks: t, allTasks: r = [], columns: a, selectedTask: i, onTaskClick: s, onTaskContextMenu: p, onTaskUpdate: l, onTaskDragStart: o, onAddTask: c, onAddDependency: v, links: b = [], dropIndicator: j, reorderTask: k }, d) => {
|
|
613
|
+
const u = Be.useRef(null);
|
|
614
|
+
Be.useImperativeHandle(d, () => u.current);
|
|
615
|
+
const T = (m, D = 0) => {
|
|
616
|
+
if (!m.parent) return D;
|
|
617
|
+
const Y = t.find((L) => L.id === m.parent);
|
|
618
|
+
return Y ? T(Y, D + 1) : D;
|
|
619
|
+
}, _ = (m, D) => {
|
|
620
|
+
if (D.template)
|
|
621
|
+
return D.template(m);
|
|
622
|
+
switch (D.name) {
|
|
623
|
+
case "text":
|
|
624
|
+
const Y = T(m);
|
|
625
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-grid-cell-text", style: { paddingLeft: Y * 14 }, children: [
|
|
626
|
+
/* @__PURE__ */ e.jsx(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
className: "gantt-row-drag-handle",
|
|
630
|
+
onMouseDown: (O) => {
|
|
631
|
+
O.preventDefault(), o?.(m.id, O.clientX, O.clientY, "reorder");
|
|
632
|
+
},
|
|
633
|
+
children: /* @__PURE__ */ e.jsx(z, { icon: xt })
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
m.type === "project" ? /* @__PURE__ */ e.jsx("span", { className: "gantt-tree-icon", onClick: (O) => {
|
|
637
|
+
O.stopPropagation(), l?.({ ...m, open: !m.open });
|
|
638
|
+
}, children: /* @__PURE__ */ e.jsx(z, { icon: m.open ? st : mt }) }) : /* @__PURE__ */ e.jsx("span", { style: { width: 16, display: "inline-block" } }),
|
|
639
|
+
/* @__PURE__ */ e.jsx("span", { className: "gantt-task-name-text", children: m.text })
|
|
640
|
+
] });
|
|
641
|
+
case "start":
|
|
642
|
+
return ce(m.start, "DD-MM-YYYY");
|
|
643
|
+
case "end":
|
|
644
|
+
return ce(m.end, "DD-MM-YYYY");
|
|
645
|
+
case "duration":
|
|
646
|
+
return /* @__PURE__ */ e.jsxs("div", { style: {
|
|
647
|
+
backgroundColor: "#f6e7db",
|
|
648
|
+
padding: "4px 12px",
|
|
649
|
+
borderRadius: "4px",
|
|
650
|
+
fontWeight: 600,
|
|
651
|
+
color: "#434343",
|
|
652
|
+
display: "inline-block",
|
|
653
|
+
minWidth: "70px",
|
|
654
|
+
textAlign: "center"
|
|
655
|
+
}, children: [
|
|
656
|
+
m.duration,
|
|
657
|
+
" day",
|
|
658
|
+
m.duration !== 1 ? "s" : ""
|
|
659
|
+
] });
|
|
660
|
+
case "predecessors":
|
|
661
|
+
const L = b.filter((O) => O.target === m.id);
|
|
662
|
+
return /* @__PURE__ */ e.jsx(
|
|
663
|
+
xn,
|
|
664
|
+
{
|
|
665
|
+
task: m,
|
|
666
|
+
allTasks: r,
|
|
667
|
+
links: b,
|
|
668
|
+
onAddDependency: (O, A, X, te) => v?.(O, A, X, te),
|
|
669
|
+
children: /* @__PURE__ */ e.jsx("div", { style: {
|
|
670
|
+
cursor: "pointer",
|
|
671
|
+
minHeight: "24px",
|
|
672
|
+
width: "100%",
|
|
673
|
+
display: "flex",
|
|
674
|
+
alignItems: "center",
|
|
675
|
+
gap: "4px"
|
|
676
|
+
}, children: L.map((O) => {
|
|
677
|
+
const A = r.find((te) => te.id === O.source), X = A ? r.indexOf(A) + 1 : 0;
|
|
678
|
+
return /* @__PURE__ */ e.jsx(
|
|
679
|
+
"span",
|
|
680
|
+
{
|
|
681
|
+
style: {
|
|
682
|
+
fontSize: "11px",
|
|
683
|
+
backgroundColor: "#e6f7ff",
|
|
684
|
+
border: "1px solid #91d5ff",
|
|
685
|
+
color: "#0050b3",
|
|
686
|
+
padding: "1px 6px",
|
|
687
|
+
borderRadius: "4px",
|
|
688
|
+
whiteSpace: "nowrap"
|
|
689
|
+
},
|
|
690
|
+
children: fn(O, X)
|
|
691
|
+
},
|
|
692
|
+
O.id
|
|
693
|
+
);
|
|
694
|
+
}) })
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
case "add":
|
|
698
|
+
return /* @__PURE__ */ e.jsx(
|
|
699
|
+
se,
|
|
700
|
+
{
|
|
701
|
+
type: "text",
|
|
702
|
+
size: "small",
|
|
703
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Ne, style: { fontSize: 12, color: "#adb5bd" } }),
|
|
704
|
+
onClick: (O) => {
|
|
705
|
+
O.stopPropagation(), c?.(m.id);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
case "progress":
|
|
710
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-progress-cell", children: [
|
|
711
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-progress-bar-bg", children: /* @__PURE__ */ e.jsx(
|
|
712
|
+
"div",
|
|
713
|
+
{
|
|
714
|
+
className: "gantt-progress-bar-fill",
|
|
715
|
+
style: { width: `${m.progress}%` }
|
|
716
|
+
}
|
|
717
|
+
) }),
|
|
718
|
+
/* @__PURE__ */ e.jsxs("span", { className: "gantt-progress-text", children: [
|
|
719
|
+
m.progress,
|
|
720
|
+
"%"
|
|
721
|
+
] })
|
|
722
|
+
] });
|
|
723
|
+
case "index":
|
|
724
|
+
return /* @__PURE__ */ e.jsx("span", { style: { color: "#8c8c8c" }, children: r.indexOf(m) + 1 });
|
|
725
|
+
default:
|
|
726
|
+
return m[D.name] || "";
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-grid", ref: u, children: [
|
|
730
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-grid-header", children: a.map((m) => /* @__PURE__ */ e.jsx(
|
|
731
|
+
"div",
|
|
732
|
+
{
|
|
733
|
+
className: "gantt-grid-header-cell",
|
|
734
|
+
style: {
|
|
735
|
+
width: m.width,
|
|
736
|
+
justifyContent: m.align === "center" ? "center" : "flex-start"
|
|
737
|
+
},
|
|
738
|
+
children: m.name === "add" ? /* @__PURE__ */ e.jsx(
|
|
739
|
+
z,
|
|
740
|
+
{
|
|
741
|
+
icon: Ne,
|
|
742
|
+
style: { fontSize: 12, color: "#64748b", cursor: "pointer" },
|
|
743
|
+
onClick: () => c?.()
|
|
744
|
+
}
|
|
745
|
+
) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
746
|
+
m.label,
|
|
747
|
+
m.name === "start" && /* @__PURE__ */ e.jsx(z, { icon: st, style: { marginLeft: 8, fontSize: 10, color: "#64748b" } })
|
|
748
|
+
] })
|
|
749
|
+
},
|
|
750
|
+
m.name
|
|
751
|
+
)) }),
|
|
752
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-grid-body", children: t.map((m) => {
|
|
753
|
+
const D = k?.id === m.id, Y = k?.descendantIds.includes(m.id);
|
|
754
|
+
return /* @__PURE__ */ e.jsxs(
|
|
755
|
+
"div",
|
|
756
|
+
{
|
|
757
|
+
className: `gantt-grid-row ${i === m.id ? "selected" : ""} ${D ? "dragging-row" : ""} ${Y ? "descendant-dragging-row" : ""} ${j?.taskId === m.id ? `drop-target-${j.position}` : ""}`,
|
|
758
|
+
onClick: () => s(m.id),
|
|
759
|
+
onContextMenu: (L) => p?.(L, m.id),
|
|
760
|
+
children: [
|
|
761
|
+
a.map((L) => /* @__PURE__ */ e.jsx(
|
|
762
|
+
"div",
|
|
763
|
+
{
|
|
764
|
+
className: "gantt-grid-cell",
|
|
765
|
+
style: {
|
|
766
|
+
width: L.width,
|
|
767
|
+
textAlign: L.align || "left"
|
|
768
|
+
},
|
|
769
|
+
children: _(m, L)
|
|
770
|
+
},
|
|
771
|
+
`${m.id}-${L.name}`
|
|
772
|
+
)),
|
|
773
|
+
j?.taskId === m.id && /* @__PURE__ */ e.jsx("div", { className: `gantt-drop-indicator ${j.position}` })
|
|
774
|
+
]
|
|
775
|
+
},
|
|
776
|
+
m.id
|
|
777
|
+
);
|
|
778
|
+
}) })
|
|
779
|
+
] });
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
vt.displayName = "Grid";
|
|
783
|
+
const yn = ({
|
|
784
|
+
task: t,
|
|
785
|
+
position: r,
|
|
786
|
+
selected: a,
|
|
787
|
+
dragging: i,
|
|
788
|
+
onClick: s,
|
|
789
|
+
onDragStart: p,
|
|
790
|
+
dragDeltaX: l = 0,
|
|
791
|
+
dragType: o = null,
|
|
792
|
+
readonly: c = !1
|
|
793
|
+
}) => {
|
|
794
|
+
const v = (u, T) => {
|
|
795
|
+
c || (u.preventDefault(), u.stopPropagation(), p(u.clientX, u.clientY, T));
|
|
796
|
+
}, b = () => {
|
|
797
|
+
const u = ["gantt-task-bar"];
|
|
798
|
+
return t.type === "milestone" && u.push("milestone"), t.type === "project" && u.push("project"), a && u.push("selected"), i && u.push("dragging"), u.join(" ");
|
|
799
|
+
}, j = () => {
|
|
800
|
+
let u = r.left, T = r.width;
|
|
801
|
+
return i && o && (o === "move" ? u += l : o === "resize-left" ? (u += l, T -= l) : o === "resize-right" && (T += l)), {
|
|
802
|
+
left: `${u}px`,
|
|
803
|
+
width: `${Math.max(T, 0)}px`,
|
|
804
|
+
// Color handled by CSS classes (.project, .milestone) or task.color override
|
|
805
|
+
backgroundColor: t.color || void 0
|
|
806
|
+
};
|
|
807
|
+
}, k = (u = !1) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
808
|
+
!c && t.type !== "milestone" && !u && /* @__PURE__ */ e.jsx(
|
|
809
|
+
"div",
|
|
810
|
+
{
|
|
811
|
+
className: "gantt-task-resize-handle gantt-task-resize-left",
|
|
812
|
+
onMouseDown: (T) => v(T, "resize-left")
|
|
813
|
+
}
|
|
814
|
+
),
|
|
815
|
+
!u && t.type !== "milestone" && /* @__PURE__ */ e.jsx(
|
|
816
|
+
"div",
|
|
817
|
+
{
|
|
818
|
+
className: "gantt-task-progress",
|
|
819
|
+
style: { width: `${t.progress}%` }
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-task-content", children: !u && t.type !== "milestone" && /* @__PURE__ */ e.jsx("span", { className: "gantt-task-text", children: t.text }) }),
|
|
823
|
+
t.type === "milestone" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
824
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-milestone-diamond" }),
|
|
825
|
+
/* @__PURE__ */ e.jsx("span", { className: "gantt-milestone-text", children: t.text })
|
|
826
|
+
] }),
|
|
827
|
+
!c && t.type !== "milestone" && !u && /* @__PURE__ */ e.jsx(
|
|
828
|
+
"div",
|
|
829
|
+
{
|
|
830
|
+
className: "gantt-task-resize-handle gantt-task-resize-right",
|
|
831
|
+
onMouseDown: (T) => v(T, "resize-right")
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
] }), d = /* @__PURE__ */ e.jsxs("div", { className: "gantt-tooltip", children: [
|
|
835
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-tooltip-title", children: t.text }),
|
|
836
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-tooltip-dates", children: [
|
|
837
|
+
ce(t.start, "MMM D"),
|
|
838
|
+
" - ",
|
|
839
|
+
ce(t.end, "MMM D")
|
|
840
|
+
] }),
|
|
841
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-tooltip-progress", children: [
|
|
842
|
+
"Progress: ",
|
|
843
|
+
t.progress,
|
|
844
|
+
"%"
|
|
845
|
+
] }),
|
|
846
|
+
t.owner && /* @__PURE__ */ e.jsxs("div", { className: "gantt-tooltip-owner", children: [
|
|
847
|
+
"Owner: ",
|
|
848
|
+
t.owner
|
|
849
|
+
] })
|
|
850
|
+
] });
|
|
851
|
+
return t.segments && t.segments.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "gantt-task-group", children: t.segments.map((u, T) => /* @__PURE__ */ e.jsx(ye, { title: d, mouseEnterDelay: 0.5, children: /* @__PURE__ */ e.jsx(
|
|
852
|
+
"div",
|
|
853
|
+
{
|
|
854
|
+
className: b() + " segment",
|
|
855
|
+
style: {
|
|
856
|
+
left: `${r.left + (u.start.getTime() - t.start.getTime()) / (t.end.getTime() - t.start.getTime()) * r.width}px`,
|
|
857
|
+
width: `${(u.end.getTime() - u.start.getTime()) / (t.end.getTime() - t.start.getTime()) * r.width}px`,
|
|
858
|
+
backgroundColor: t.color || "#ADCFFE"
|
|
859
|
+
},
|
|
860
|
+
onClick: s,
|
|
861
|
+
onMouseDown: (_) => v(_, "move"),
|
|
862
|
+
children: k(!0)
|
|
863
|
+
}
|
|
864
|
+
) }, T)) }) : /* @__PURE__ */ e.jsx(ye, { title: d, mouseEnterDelay: 0.5, children: /* @__PURE__ */ e.jsx(
|
|
865
|
+
"div",
|
|
866
|
+
{
|
|
867
|
+
className: b(),
|
|
868
|
+
style: j(),
|
|
869
|
+
onClick: s,
|
|
870
|
+
onMouseDown: (u) => v(u, "move"),
|
|
871
|
+
children: k()
|
|
872
|
+
}
|
|
873
|
+
) });
|
|
874
|
+
}, wn = ({ links: t, tasks: r, getTaskPosition: a }) => {
|
|
875
|
+
const i = (l) => r.find((o) => o.id === l), s = (l) => {
|
|
876
|
+
const o = i(l.source), c = i(l.target);
|
|
877
|
+
if (!o || !c) return "";
|
|
878
|
+
const v = a(o), b = a(c), j = v.top + v.height / 2, k = b.top + b.height / 2;
|
|
879
|
+
let d = 0, u = 0;
|
|
880
|
+
switch (l.type) {
|
|
881
|
+
case "e2s":
|
|
882
|
+
d = v.left + v.width, u = b.left;
|
|
883
|
+
break;
|
|
884
|
+
case "s2s":
|
|
885
|
+
d = v.left, u = b.left;
|
|
886
|
+
break;
|
|
887
|
+
case "e2e":
|
|
888
|
+
d = v.left + v.width, u = b.left + b.width;
|
|
889
|
+
break;
|
|
890
|
+
case "s2e":
|
|
891
|
+
d = v.left, u = b.left + b.width;
|
|
892
|
+
break;
|
|
893
|
+
}
|
|
894
|
+
const T = u - d, _ = k - j, m = 20;
|
|
895
|
+
if (l.type === "e2s")
|
|
896
|
+
if (T >= m) {
|
|
897
|
+
const D = d + T / 2;
|
|
898
|
+
return `M ${d},${j} L ${D},${j} L ${D},${k} L ${u},${k}`;
|
|
899
|
+
} else {
|
|
900
|
+
const D = m / 2, Y = j + _ / 2;
|
|
901
|
+
return `M ${d},${j} L ${d + D},${j} L ${d + D},${Y} L ${u - D},${Y} L ${u - D},${k} L ${u},${k}`;
|
|
902
|
+
}
|
|
903
|
+
else if (l.type === "s2s") {
|
|
904
|
+
const D = Math.min(d, u) - m / 2;
|
|
905
|
+
return `M ${d},${j} L ${D},${j} L ${D},${k} L ${u},${k}`;
|
|
906
|
+
} else if (l.type === "e2e") {
|
|
907
|
+
const D = Math.max(d, u) + m / 2;
|
|
908
|
+
return `M ${d},${j} L ${D},${j} L ${D},${k} L ${u},${k}`;
|
|
909
|
+
} else if (l.type === "s2e")
|
|
910
|
+
if (T <= -m) {
|
|
911
|
+
const D = d + T / 2;
|
|
912
|
+
return `M ${d},${j} L ${D},${j} L ${D},${k} L ${u},${k}`;
|
|
913
|
+
} else {
|
|
914
|
+
const D = m / 2, Y = j + _ / 2;
|
|
915
|
+
return `M ${d},${j} L ${d - D},${j} L ${d - D},${Y} L ${u + D},${Y} L ${u + D},${k} L ${u},${k}`;
|
|
916
|
+
}
|
|
917
|
+
return "";
|
|
918
|
+
}, p = (l) => {
|
|
919
|
+
const o = i(l.target);
|
|
920
|
+
if (!o) return "";
|
|
921
|
+
const c = a(o), v = c.top + c.height / 2, b = 8, j = 6;
|
|
922
|
+
let k = 0, d = !0;
|
|
923
|
+
return l.type === "e2s" || l.type === "s2s" ? (k = c.left, d = !0) : (k = c.left + c.width, d = !1), d ? `M ${k},${v} L ${k - b},${v - j / 2} L ${k - b},${v + j / 2} Z` : `M ${k},${v} L ${k + b},${v - j / 2} L ${k + b},${v + j / 2} Z`;
|
|
924
|
+
};
|
|
925
|
+
return /* @__PURE__ */ e.jsx("svg", { className: "gantt-links-layer", style: { overflow: "visible" }, children: t.map((l) => {
|
|
926
|
+
const o = i(l.source), c = i(l.target);
|
|
927
|
+
if (!o || !c) return null;
|
|
928
|
+
const v = s(l), b = p(l);
|
|
929
|
+
return /* @__PURE__ */ e.jsxs("g", { className: "gantt-link", children: [
|
|
930
|
+
/* @__PURE__ */ e.jsx(
|
|
931
|
+
"path",
|
|
932
|
+
{
|
|
933
|
+
d: v,
|
|
934
|
+
fill: "none",
|
|
935
|
+
strokeWidth: "1.5",
|
|
936
|
+
className: "gantt-link-line"
|
|
937
|
+
}
|
|
938
|
+
),
|
|
939
|
+
/* @__PURE__ */ e.jsx(
|
|
940
|
+
"path",
|
|
941
|
+
{
|
|
942
|
+
d: b,
|
|
943
|
+
className: "gantt-link-arrow"
|
|
944
|
+
}
|
|
945
|
+
)
|
|
946
|
+
] }, l.id);
|
|
947
|
+
}) });
|
|
948
|
+
}, jn = (t, r, a = 60, i = "day", s = 1) => {
|
|
949
|
+
const [p, l] = B({
|
|
950
|
+
taskId: null,
|
|
951
|
+
initialX: 0,
|
|
952
|
+
initialY: 0,
|
|
953
|
+
initialStart: /* @__PURE__ */ new Date(),
|
|
954
|
+
initialEnd: /* @__PURE__ */ new Date(),
|
|
955
|
+
type: null,
|
|
956
|
+
dragDeltaX: 0,
|
|
957
|
+
dragDeltaY: 0
|
|
958
|
+
}), o = me((b, j, k, d) => {
|
|
959
|
+
const u = t.find((T) => T.id === b);
|
|
960
|
+
u && l({
|
|
961
|
+
taskId: b,
|
|
962
|
+
initialX: j,
|
|
963
|
+
initialY: k,
|
|
964
|
+
initialStart: new Date(u.start),
|
|
965
|
+
initialEnd: new Date(u.end),
|
|
966
|
+
type: d,
|
|
967
|
+
dragDeltaX: 0,
|
|
968
|
+
dragDeltaY: 0
|
|
969
|
+
});
|
|
970
|
+
}, [t]), c = me((b, j) => {
|
|
971
|
+
if (!p.taskId || !p.type) return null;
|
|
972
|
+
const k = b - p.initialX, d = j - p.initialY;
|
|
973
|
+
if (l((Y) => ({
|
|
974
|
+
...Y,
|
|
975
|
+
dragDeltaX: k,
|
|
976
|
+
dragDeltaY: d
|
|
977
|
+
})), p.type === "reorder") return null;
|
|
978
|
+
const u = t.find((Y) => Y.id === p.taskId);
|
|
979
|
+
if (!u) return null;
|
|
980
|
+
const T = Math.round(k / a);
|
|
981
|
+
let _ = new Date(p.initialStart), m = new Date(p.initialEnd);
|
|
982
|
+
switch (p.type) {
|
|
983
|
+
case "move":
|
|
984
|
+
_ = ae(p.initialStart, T * s, i), m = ae(p.initialEnd, T * s, i);
|
|
985
|
+
break;
|
|
986
|
+
case "resize-left":
|
|
987
|
+
_ = ae(p.initialStart, T * s, i), _ >= m && (_ = ae(m, -s, i));
|
|
988
|
+
break;
|
|
989
|
+
case "resize-right":
|
|
990
|
+
m = ae(p.initialEnd, T * s, i), m <= _ && (m = ae(_, s, i));
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
const D = Ie(_, m);
|
|
994
|
+
return {
|
|
995
|
+
...u,
|
|
996
|
+
start: _,
|
|
997
|
+
end: m,
|
|
998
|
+
duration: D
|
|
999
|
+
};
|
|
1000
|
+
}, [p, t, a]), v = me((b) => {
|
|
1001
|
+
if (b && r) {
|
|
1002
|
+
const { id: j, ...k } = b;
|
|
1003
|
+
r(j, k);
|
|
1004
|
+
}
|
|
1005
|
+
l({
|
|
1006
|
+
taskId: null,
|
|
1007
|
+
initialX: 0,
|
|
1008
|
+
initialY: 0,
|
|
1009
|
+
initialStart: /* @__PURE__ */ new Date(),
|
|
1010
|
+
initialEnd: /* @__PURE__ */ new Date(),
|
|
1011
|
+
type: null,
|
|
1012
|
+
dragDeltaX: 0,
|
|
1013
|
+
dragDeltaY: 0
|
|
1014
|
+
});
|
|
1015
|
+
}, [r]);
|
|
1016
|
+
return {
|
|
1017
|
+
dragState: p,
|
|
1018
|
+
handleDragStart: o,
|
|
1019
|
+
handleDrag: c,
|
|
1020
|
+
handleDragEnd: v
|
|
1021
|
+
};
|
|
1022
|
+
}, bt = qe(
|
|
1023
|
+
({
|
|
1024
|
+
tasks: t,
|
|
1025
|
+
links: r,
|
|
1026
|
+
range: a,
|
|
1027
|
+
scales: i,
|
|
1028
|
+
config: s,
|
|
1029
|
+
selectedTask: p,
|
|
1030
|
+
onTaskClick: l,
|
|
1031
|
+
onTaskDragStart: o,
|
|
1032
|
+
onTaskDragEnd: c,
|
|
1033
|
+
onTaskUpdate: v,
|
|
1034
|
+
zoomLevel: b,
|
|
1035
|
+
baselines: j
|
|
1036
|
+
}, k) => {
|
|
1037
|
+
const [d, u] = B(t), T = (s.columnWidth || 60) * b, _ = s.baselines && j && j.size > 0, { dragState: m, handleDragStart: D, handleDrag: Y, handleDragEnd: L } = jn(
|
|
1038
|
+
d,
|
|
1039
|
+
v,
|
|
1040
|
+
T,
|
|
1041
|
+
i[1].unit,
|
|
1042
|
+
i[1].step
|
|
1043
|
+
);
|
|
1044
|
+
Be.useEffect(() => {
|
|
1045
|
+
u(t);
|
|
1046
|
+
}, [t]);
|
|
1047
|
+
const O = (h) => {
|
|
1048
|
+
const f = [];
|
|
1049
|
+
let n = new Date(a.start);
|
|
1050
|
+
for (; n <= a.end; )
|
|
1051
|
+
f.push({
|
|
1052
|
+
date: new Date(n),
|
|
1053
|
+
label: ce(n, h.format || "D")
|
|
1054
|
+
}), n = ae(n, h.step, h.unit);
|
|
1055
|
+
return f;
|
|
1056
|
+
}, A = (h) => {
|
|
1057
|
+
const f = i[1], n = a.start.getTime(), C = h.getTime() - n, H = {
|
|
1058
|
+
hour: 36e5,
|
|
1059
|
+
day: 864e5,
|
|
1060
|
+
week: 6048e5,
|
|
1061
|
+
month: 2592e6,
|
|
1062
|
+
quarter: 7776e6,
|
|
1063
|
+
year: 31536e6
|
|
1064
|
+
}[f.unit] || 864e5;
|
|
1065
|
+
return C / (H * f.step) * T;
|
|
1066
|
+
}, X = (h) => {
|
|
1067
|
+
const f = A(h.start), n = A(h.end);
|
|
1068
|
+
return {
|
|
1069
|
+
left: f,
|
|
1070
|
+
width: Math.max(n - f, 0)
|
|
1071
|
+
};
|
|
1072
|
+
}, te = (h) => {
|
|
1073
|
+
const f = A(h.start), n = A(h.end);
|
|
1074
|
+
return {
|
|
1075
|
+
left: f,
|
|
1076
|
+
width: Math.max(n - f, 0)
|
|
1077
|
+
};
|
|
1078
|
+
}, x = (h) => {
|
|
1079
|
+
const f = X(h), n = d.findIndex((H) => H.id === h.id), y = s.rowHeight || 48, C = 32, N = (y - C) / 2;
|
|
1080
|
+
return {
|
|
1081
|
+
left: f.left,
|
|
1082
|
+
width: f.width,
|
|
1083
|
+
top: n * y + N,
|
|
1084
|
+
height: C
|
|
1085
|
+
};
|
|
1086
|
+
}, R = me((h) => {
|
|
1087
|
+
if (m.taskId && m.type) {
|
|
1088
|
+
const f = Y(h.clientX, h.clientY);
|
|
1089
|
+
f && u(
|
|
1090
|
+
(n) => n.map((y) => y.id === f.id ? f : y)
|
|
1091
|
+
);
|
|
1092
|
+
}
|
|
1093
|
+
}, [m, Y]), P = me(() => {
|
|
1094
|
+
if (m.taskId) {
|
|
1095
|
+
const h = d.find((f) => f.id === m.taskId);
|
|
1096
|
+
L(h || null), c();
|
|
1097
|
+
}
|
|
1098
|
+
}, [m, d, L, c]), J = i[1], U = O(J), E = () => {
|
|
1099
|
+
const h = [];
|
|
1100
|
+
let f = -1, n = -1, y = 0, C = "";
|
|
1101
|
+
return U.forEach((N) => {
|
|
1102
|
+
const H = N.date.getMonth(), K = N.date.getFullYear(), I = ce(N.date, "MMM YYYY");
|
|
1103
|
+
H !== f || K !== n ? (f !== -1 && h.push({ label: C, width: y }), f = H, n = K, y = T, C = I) : y += T;
|
|
1104
|
+
}), f !== -1 && h.push({ label: C, width: y }), h;
|
|
1105
|
+
}, S = () => {
|
|
1106
|
+
const h = [];
|
|
1107
|
+
let f = -1, n = 0, y = -1, C = -1, N = "";
|
|
1108
|
+
return U.forEach((H) => {
|
|
1109
|
+
const I = H.date.getDate() <= 15 ? 0 : 1, ee = H.date.getMonth(), ne = H.date.getFullYear(), q = ce(H.date, "MMM"), ue = new Date(ne, ee + 1, 0).getDate(), he = I === 0 ? `${q} 1 - 15` : `${q} 16 - ${ue}`;
|
|
1110
|
+
I !== f || ee !== y || ne !== C ? (f !== -1 && h.push({ label: N, width: n }), f = I, y = ee, C = ne, n = T, N = he) : n += T;
|
|
1111
|
+
}), f !== -1 && h.push({ label: N, width: n }), h;
|
|
1112
|
+
}, g = E(), $ = S(), w = U.length * T;
|
|
1113
|
+
return /* @__PURE__ */ e.jsxs(
|
|
1114
|
+
"div",
|
|
1115
|
+
{
|
|
1116
|
+
className: "gantt-timeline-container",
|
|
1117
|
+
ref: k,
|
|
1118
|
+
onMouseMove: R,
|
|
1119
|
+
onMouseUp: P,
|
|
1120
|
+
style: { width: w },
|
|
1121
|
+
children: [
|
|
1122
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-timeline-header", style: { width: w, minWidth: w }, children: [
|
|
1123
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width: w }, children: g.map((h, f) => /* @__PURE__ */ e.jsx(
|
|
1124
|
+
"div",
|
|
1125
|
+
{
|
|
1126
|
+
className: "gantt-timeline-cell",
|
|
1127
|
+
style: {
|
|
1128
|
+
width: h.width,
|
|
1129
|
+
minWidth: h.width,
|
|
1130
|
+
maxWidth: h.width,
|
|
1131
|
+
borderRight: f === g.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
1132
|
+
},
|
|
1133
|
+
children: h.label
|
|
1134
|
+
},
|
|
1135
|
+
`top-${f}`
|
|
1136
|
+
)) }),
|
|
1137
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width: w }, children: $.map((h, f) => /* @__PURE__ */ e.jsx(
|
|
1138
|
+
"div",
|
|
1139
|
+
{
|
|
1140
|
+
className: "gantt-timeline-cell",
|
|
1141
|
+
style: {
|
|
1142
|
+
width: h.width,
|
|
1143
|
+
minWidth: h.width,
|
|
1144
|
+
maxWidth: h.width,
|
|
1145
|
+
borderRight: f === $.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
1146
|
+
},
|
|
1147
|
+
children: h.label
|
|
1148
|
+
},
|
|
1149
|
+
`mid-${f}`
|
|
1150
|
+
)) }),
|
|
1151
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width: w }, children: U.map((h, f) => {
|
|
1152
|
+
const n = s.weekends && lt(h.date), y = s.holidays && ct(h.date, s.holidays);
|
|
1153
|
+
return /* @__PURE__ */ e.jsx(
|
|
1154
|
+
"div",
|
|
1155
|
+
{
|
|
1156
|
+
className: `gantt-timeline-cell ${n ? "weekend" : ""} ${y ? "holiday" : ""}`,
|
|
1157
|
+
style: {
|
|
1158
|
+
width: T,
|
|
1159
|
+
minWidth: T,
|
|
1160
|
+
maxWidth: T,
|
|
1161
|
+
borderRight: f === U.length - 1 ? "none" : "var(--wx-gantt-border)"
|
|
1162
|
+
},
|
|
1163
|
+
children: h.label
|
|
1164
|
+
},
|
|
1165
|
+
`day-${f}`
|
|
1166
|
+
);
|
|
1167
|
+
}) })
|
|
1168
|
+
] }),
|
|
1169
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-timeline-body", style: { width: w }, children: [
|
|
1170
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-grid", children: U.map((h, f) => {
|
|
1171
|
+
const n = s.weekends && lt(h.date), y = s.holidays && ct(h.date, s.holidays);
|
|
1172
|
+
return /* @__PURE__ */ e.jsx(
|
|
1173
|
+
"div",
|
|
1174
|
+
{
|
|
1175
|
+
className: `gantt-timeline-grid-column ${n ? "weekend" : ""} ${y ? "holiday" : ""}`,
|
|
1176
|
+
style: { width: T, minWidth: T }
|
|
1177
|
+
},
|
|
1178
|
+
f
|
|
1179
|
+
);
|
|
1180
|
+
}) }),
|
|
1181
|
+
r.length > 0 && /* @__PURE__ */ e.jsx(
|
|
1182
|
+
wn,
|
|
1183
|
+
{
|
|
1184
|
+
links: r,
|
|
1185
|
+
tasks: d,
|
|
1186
|
+
getTaskPosition: x
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-timeline-tasks", style: { width: w }, children: d.map((h) => {
|
|
1190
|
+
const f = X(h), n = _ ? j?.get(h.id) : void 0, y = n ? te(n) : void 0;
|
|
1191
|
+
return /* @__PURE__ */ e.jsxs(
|
|
1192
|
+
"div",
|
|
1193
|
+
{
|
|
1194
|
+
className: "gantt-timeline-row",
|
|
1195
|
+
children: [
|
|
1196
|
+
n && y && h.type !== "milestone" && /* @__PURE__ */ e.jsx(
|
|
1197
|
+
"div",
|
|
1198
|
+
{
|
|
1199
|
+
className: "gantt-baseline-bar",
|
|
1200
|
+
style: {
|
|
1201
|
+
left: `${y.left}px`,
|
|
1202
|
+
width: `${y.width}px`
|
|
1203
|
+
},
|
|
1204
|
+
title: `Baseline: ${n.start.toLocaleDateString()} - ${n.end.toLocaleDateString()}`
|
|
1205
|
+
}
|
|
1206
|
+
),
|
|
1207
|
+
/* @__PURE__ */ e.jsx(
|
|
1208
|
+
yn,
|
|
1209
|
+
{
|
|
1210
|
+
task: h,
|
|
1211
|
+
position: f,
|
|
1212
|
+
selected: p === h.id,
|
|
1213
|
+
dragging: m.taskId === h.id,
|
|
1214
|
+
dragDeltaX: m.dragDeltaX,
|
|
1215
|
+
dragType: m.type,
|
|
1216
|
+
onClick: () => l(h.id),
|
|
1217
|
+
onDragStart: (C, N, H) => {
|
|
1218
|
+
D(h.id, C, N, H), o(h.id, C, N);
|
|
1219
|
+
},
|
|
1220
|
+
readonly: s.readonly
|
|
1221
|
+
}
|
|
1222
|
+
)
|
|
1223
|
+
]
|
|
1224
|
+
},
|
|
1225
|
+
h.id
|
|
1226
|
+
);
|
|
1227
|
+
}) })
|
|
1228
|
+
] })
|
|
1229
|
+
]
|
|
1230
|
+
}
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
);
|
|
1234
|
+
bt.displayName = "Timeline";
|
|
1235
|
+
const St = qe((t, r) => /* @__PURE__ */ e.jsx("div", { className: "gantt-chart-wrapper", style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ e.jsx(bt, { ...t, ref: r }) }));
|
|
1236
|
+
St.displayName = "Chart";
|
|
1237
|
+
const { Search: vn } = ve, bn = ({ onFilterChange: t, owners: r }) => {
|
|
1238
|
+
const [a, i] = B({
|
|
1239
|
+
searchText: "",
|
|
1240
|
+
status: "all",
|
|
1241
|
+
priority: "all",
|
|
1242
|
+
owner: ""
|
|
1243
|
+
}), s = (o) => {
|
|
1244
|
+
const c = { ...a, ...o };
|
|
1245
|
+
i(c), t(c);
|
|
1246
|
+
}, p = () => {
|
|
1247
|
+
const o = {
|
|
1248
|
+
searchText: "",
|
|
1249
|
+
status: "all",
|
|
1250
|
+
priority: "all",
|
|
1251
|
+
owner: ""
|
|
1252
|
+
};
|
|
1253
|
+
i(o), t(o);
|
|
1254
|
+
}, l = a.searchText !== "" || a.status !== "all" || a.priority !== "all" || a.owner !== "";
|
|
1255
|
+
return /* @__PURE__ */ e.jsx("div", { className: "gantt-filter-container", children: /* @__PURE__ */ e.jsxs("div", { className: "gantt-filter-bar", children: [
|
|
1256
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-filter-left", children: /* @__PURE__ */ e.jsx(
|
|
1257
|
+
vn,
|
|
1258
|
+
{
|
|
1259
|
+
placeholder: "Search tasks...",
|
|
1260
|
+
value: a.searchText,
|
|
1261
|
+
onChange: (o) => s({ searchText: o.target.value }),
|
|
1262
|
+
allowClear: !0,
|
|
1263
|
+
className: "gantt-search-antd",
|
|
1264
|
+
style: { width: 250 }
|
|
1265
|
+
}
|
|
1266
|
+
) }),
|
|
1267
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-filter-right", children: [
|
|
1268
|
+
/* @__PURE__ */ e.jsx(
|
|
1269
|
+
ie,
|
|
1270
|
+
{
|
|
1271
|
+
value: a.status,
|
|
1272
|
+
onChange: (o) => s({ status: o }),
|
|
1273
|
+
className: "gantt-filter-select-antd",
|
|
1274
|
+
style: { width: 140 },
|
|
1275
|
+
options: [
|
|
1276
|
+
{ value: "all", label: "All Status" },
|
|
1277
|
+
{ value: "not-started", label: "Not Started" },
|
|
1278
|
+
{ value: "in-progress", label: "In Progress" },
|
|
1279
|
+
{ value: "completed", label: "Completed" }
|
|
1280
|
+
]
|
|
1281
|
+
}
|
|
1282
|
+
),
|
|
1283
|
+
/* @__PURE__ */ e.jsx(
|
|
1284
|
+
ie,
|
|
1285
|
+
{
|
|
1286
|
+
value: a.priority,
|
|
1287
|
+
onChange: (o) => s({ priority: o }),
|
|
1288
|
+
className: "gantt-filter-select-antd",
|
|
1289
|
+
style: { width: 130 },
|
|
1290
|
+
options: [
|
|
1291
|
+
{ value: "all", label: "All Priority" },
|
|
1292
|
+
{ value: "low", label: "Low" },
|
|
1293
|
+
{ value: "medium", label: "Medium" },
|
|
1294
|
+
{ value: "high", label: "High" }
|
|
1295
|
+
]
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ e.jsx(
|
|
1299
|
+
ie,
|
|
1300
|
+
{
|
|
1301
|
+
value: a.owner || void 0,
|
|
1302
|
+
onChange: (o) => s({ owner: o || "" }),
|
|
1303
|
+
className: "gantt-filter-select-antd",
|
|
1304
|
+
style: { width: 130 },
|
|
1305
|
+
placeholder: "All Owners",
|
|
1306
|
+
allowClear: !0,
|
|
1307
|
+
options: [
|
|
1308
|
+
{ value: "", label: "All Owners" },
|
|
1309
|
+
...r.map((o) => ({ value: o, label: o }))
|
|
1310
|
+
]
|
|
1311
|
+
}
|
|
1312
|
+
),
|
|
1313
|
+
l && /* @__PURE__ */ e.jsx(
|
|
1314
|
+
se,
|
|
1315
|
+
{
|
|
1316
|
+
type: "default",
|
|
1317
|
+
danger: !0,
|
|
1318
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Wt }),
|
|
1319
|
+
onClick: p,
|
|
1320
|
+
className: "gantt-filter-clear-antd",
|
|
1321
|
+
children: "Clear"
|
|
1322
|
+
}
|
|
1323
|
+
)
|
|
1324
|
+
] })
|
|
1325
|
+
] }) });
|
|
1326
|
+
}, Sn = (t, r) => t.filter((a) => {
|
|
1327
|
+
if (r.searchText) {
|
|
1328
|
+
const i = r.searchText.toLowerCase(), s = a.text.toLowerCase().includes(i), p = a.owner?.toLowerCase().includes(i), l = a.details?.toLowerCase().includes(i);
|
|
1329
|
+
if (!s && !p && !l)
|
|
1330
|
+
return !1;
|
|
1331
|
+
}
|
|
1332
|
+
if (r.status !== "all" && (a.progress === 0 ? "not-started" : a.progress === 100 ? "completed" : "in-progress") !== r.status || r.priority !== "all" && a.priority !== r.priority || r.owner && a.owner !== r.owner)
|
|
1333
|
+
return !1;
|
|
1334
|
+
if (r.dateRange) {
|
|
1335
|
+
const i = a.start.getTime(), s = r.dateRange.start.getTime(), p = r.dateRange.end.getTime();
|
|
1336
|
+
if (i < s || i > p)
|
|
1337
|
+
return !1;
|
|
1338
|
+
}
|
|
1339
|
+
return !0;
|
|
1340
|
+
}), Dn = ({
|
|
1341
|
+
zoomLevel: t,
|
|
1342
|
+
setZoomLevel: r,
|
|
1343
|
+
onBaselineToggle: a,
|
|
1344
|
+
showBaselines: i,
|
|
1345
|
+
onExport: s,
|
|
1346
|
+
onFilterChange: p,
|
|
1347
|
+
owners: l,
|
|
1348
|
+
onAddTask: o
|
|
1349
|
+
}) => /* @__PURE__ */ e.jsxs("div", { className: "gantt-toolbar-wrapper", children: [
|
|
1350
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-toolbar", children: [
|
|
1351
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ e.jsxs(ge, { size: 8, children: [
|
|
1352
|
+
/* @__PURE__ */ e.jsx(
|
|
1353
|
+
se,
|
|
1354
|
+
{
|
|
1355
|
+
type: "primary",
|
|
1356
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Ne }),
|
|
1357
|
+
onClick: o,
|
|
1358
|
+
children: "New Task"
|
|
1359
|
+
}
|
|
1360
|
+
),
|
|
1361
|
+
/* @__PURE__ */ e.jsx(ye, { title: i ? "Hide Baselines" : "Show Baselines", children: /* @__PURE__ */ e.jsx(
|
|
1362
|
+
se,
|
|
1363
|
+
{
|
|
1364
|
+
type: i ? "primary" : "default",
|
|
1365
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Ut }),
|
|
1366
|
+
onClick: a,
|
|
1367
|
+
children: i ? "Baselines" : "Set Baseline"
|
|
1368
|
+
}
|
|
1369
|
+
) })
|
|
1370
|
+
] }) }),
|
|
1371
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-toolbar-right", children: /* @__PURE__ */ e.jsxs(ge, { size: 4, children: [
|
|
1372
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Zoom Out", children: /* @__PURE__ */ e.jsx(
|
|
1373
|
+
se,
|
|
1374
|
+
{
|
|
1375
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Jt }),
|
|
1376
|
+
onClick: () => r(Math.max(0.5, t - 0.25))
|
|
1377
|
+
}
|
|
1378
|
+
) }),
|
|
1379
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Zoom In", children: /* @__PURE__ */ e.jsx(
|
|
1380
|
+
se,
|
|
1381
|
+
{
|
|
1382
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Vt }),
|
|
1383
|
+
onClick: () => r(Math.min(2, t + 0.25))
|
|
1384
|
+
}
|
|
1385
|
+
) }),
|
|
1386
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Reset Zoom", children: /* @__PURE__ */ e.jsx(
|
|
1387
|
+
se,
|
|
1388
|
+
{
|
|
1389
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: yt }),
|
|
1390
|
+
onClick: () => r(1)
|
|
1391
|
+
}
|
|
1392
|
+
) }),
|
|
1393
|
+
/* @__PURE__ */ e.jsx(Le, { type: "vertical", style: { height: 24, margin: "0 4px" } }),
|
|
1394
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Export to CSV", children: /* @__PURE__ */ e.jsx(
|
|
1395
|
+
se,
|
|
1396
|
+
{
|
|
1397
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Xt }),
|
|
1398
|
+
onClick: () => s("csv")
|
|
1399
|
+
}
|
|
1400
|
+
) }),
|
|
1401
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Export to Excel", children: /* @__PURE__ */ e.jsx(
|
|
1402
|
+
se,
|
|
1403
|
+
{
|
|
1404
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Gt }),
|
|
1405
|
+
onClick: () => s("excel")
|
|
1406
|
+
}
|
|
1407
|
+
) }),
|
|
1408
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Export to JSON", children: /* @__PURE__ */ e.jsx(
|
|
1409
|
+
se,
|
|
1410
|
+
{
|
|
1411
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: qt }),
|
|
1412
|
+
onClick: () => s("json")
|
|
1413
|
+
}
|
|
1414
|
+
) }),
|
|
1415
|
+
/* @__PURE__ */ e.jsx(ye, { title: "Export to PDF", children: /* @__PURE__ */ e.jsx(
|
|
1416
|
+
se,
|
|
1417
|
+
{
|
|
1418
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Zt }),
|
|
1419
|
+
onClick: () => s("pdf")
|
|
1420
|
+
}
|
|
1421
|
+
) })
|
|
1422
|
+
] }) })
|
|
1423
|
+
] }),
|
|
1424
|
+
/* @__PURE__ */ e.jsx(
|
|
1425
|
+
bn,
|
|
1426
|
+
{
|
|
1427
|
+
onFilterChange: p,
|
|
1428
|
+
owners: l
|
|
1429
|
+
}
|
|
1430
|
+
)
|
|
1431
|
+
] });
|
|
1432
|
+
var Ae = { exports: {} }, Mn = Ae.exports, ut;
|
|
1433
|
+
function Tn() {
|
|
1434
|
+
return ut || (ut = 1, (function(t, r) {
|
|
1435
|
+
(function(a, i) {
|
|
1436
|
+
t.exports = i();
|
|
1437
|
+
})(Mn, (function() {
|
|
1438
|
+
var a = 1e3, i = 6e4, s = 36e5, p = "millisecond", l = "second", o = "minute", c = "hour", v = "day", b = "week", j = "month", k = "quarter", d = "year", u = "date", T = "Invalid Date", _ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, m = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, D = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(E) {
|
|
1439
|
+
var S = ["th", "st", "nd", "rd"], g = E % 100;
|
|
1440
|
+
return "[" + E + (S[(g - 20) % 10] || S[g] || S[0]) + "]";
|
|
1441
|
+
} }, Y = function(E, S, g) {
|
|
1442
|
+
var $ = String(E);
|
|
1443
|
+
return !$ || $.length >= S ? E : "" + Array(S + 1 - $.length).join(g) + E;
|
|
1444
|
+
}, L = { s: Y, z: function(E) {
|
|
1445
|
+
var S = -E.utcOffset(), g = Math.abs(S), $ = Math.floor(g / 60), w = g % 60;
|
|
1446
|
+
return (S <= 0 ? "+" : "-") + Y($, 2, "0") + ":" + Y(w, 2, "0");
|
|
1447
|
+
}, m: function E(S, g) {
|
|
1448
|
+
if (S.date() < g.date()) return -E(g, S);
|
|
1449
|
+
var $ = 12 * (g.year() - S.year()) + (g.month() - S.month()), w = S.clone().add($, j), h = g - w < 0, f = S.clone().add($ + (h ? -1 : 1), j);
|
|
1450
|
+
return +(-($ + (g - w) / (h ? w - f : f - w)) || 0);
|
|
1451
|
+
}, a: function(E) {
|
|
1452
|
+
return E < 0 ? Math.ceil(E) || 0 : Math.floor(E);
|
|
1453
|
+
}, p: function(E) {
|
|
1454
|
+
return { M: j, y: d, w: b, d: v, D: u, h: c, m: o, s: l, ms: p, Q: k }[E] || String(E || "").toLowerCase().replace(/s$/, "");
|
|
1455
|
+
}, u: function(E) {
|
|
1456
|
+
return E === void 0;
|
|
1457
|
+
} }, O = "en", A = {};
|
|
1458
|
+
A[O] = D;
|
|
1459
|
+
var X = "$isDayjsObject", te = function(E) {
|
|
1460
|
+
return E instanceof J || !(!E || !E[X]);
|
|
1461
|
+
}, x = function E(S, g, $) {
|
|
1462
|
+
var w;
|
|
1463
|
+
if (!S) return O;
|
|
1464
|
+
if (typeof S == "string") {
|
|
1465
|
+
var h = S.toLowerCase();
|
|
1466
|
+
A[h] && (w = h), g && (A[h] = g, w = h);
|
|
1467
|
+
var f = S.split("-");
|
|
1468
|
+
if (!w && f.length > 1) return E(f[0]);
|
|
1469
|
+
} else {
|
|
1470
|
+
var n = S.name;
|
|
1471
|
+
A[n] = S, w = n;
|
|
1472
|
+
}
|
|
1473
|
+
return !$ && w && (O = w), w || !$ && O;
|
|
1474
|
+
}, R = function(E, S) {
|
|
1475
|
+
if (te(E)) return E.clone();
|
|
1476
|
+
var g = typeof S == "object" ? S : {};
|
|
1477
|
+
return g.date = E, g.args = arguments, new J(g);
|
|
1478
|
+
}, P = L;
|
|
1479
|
+
P.l = x, P.i = te, P.w = function(E, S) {
|
|
1480
|
+
return R(E, { locale: S.$L, utc: S.$u, x: S.$x, $offset: S.$offset });
|
|
1481
|
+
};
|
|
1482
|
+
var J = (function() {
|
|
1483
|
+
function E(g) {
|
|
1484
|
+
this.$L = x(g.locale, null, !0), this.parse(g), this.$x = this.$x || g.x || {}, this[X] = !0;
|
|
1485
|
+
}
|
|
1486
|
+
var S = E.prototype;
|
|
1487
|
+
return S.parse = function(g) {
|
|
1488
|
+
this.$d = (function($) {
|
|
1489
|
+
var w = $.date, h = $.utc;
|
|
1490
|
+
if (w === null) return /* @__PURE__ */ new Date(NaN);
|
|
1491
|
+
if (P.u(w)) return /* @__PURE__ */ new Date();
|
|
1492
|
+
if (w instanceof Date) return new Date(w);
|
|
1493
|
+
if (typeof w == "string" && !/Z$/i.test(w)) {
|
|
1494
|
+
var f = w.match(_);
|
|
1495
|
+
if (f) {
|
|
1496
|
+
var n = f[2] - 1 || 0, y = (f[7] || "0").substring(0, 3);
|
|
1497
|
+
return h ? new Date(Date.UTC(f[1], n, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, y)) : new Date(f[1], n, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, y);
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
return new Date(w);
|
|
1501
|
+
})(g), this.init();
|
|
1502
|
+
}, S.init = function() {
|
|
1503
|
+
var g = this.$d;
|
|
1504
|
+
this.$y = g.getFullYear(), this.$M = g.getMonth(), this.$D = g.getDate(), this.$W = g.getDay(), this.$H = g.getHours(), this.$m = g.getMinutes(), this.$s = g.getSeconds(), this.$ms = g.getMilliseconds();
|
|
1505
|
+
}, S.$utils = function() {
|
|
1506
|
+
return P;
|
|
1507
|
+
}, S.isValid = function() {
|
|
1508
|
+
return this.$d.toString() !== T;
|
|
1509
|
+
}, S.isSame = function(g, $) {
|
|
1510
|
+
var w = R(g);
|
|
1511
|
+
return this.startOf($) <= w && w <= this.endOf($);
|
|
1512
|
+
}, S.isAfter = function(g, $) {
|
|
1513
|
+
return R(g) < this.startOf($);
|
|
1514
|
+
}, S.isBefore = function(g, $) {
|
|
1515
|
+
return this.endOf($) < R(g);
|
|
1516
|
+
}, S.$g = function(g, $, w) {
|
|
1517
|
+
return P.u(g) ? this[$] : this.set(w, g);
|
|
1518
|
+
}, S.unix = function() {
|
|
1519
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
1520
|
+
}, S.valueOf = function() {
|
|
1521
|
+
return this.$d.getTime();
|
|
1522
|
+
}, S.startOf = function(g, $) {
|
|
1523
|
+
var w = this, h = !!P.u($) || $, f = P.p(g), n = function(ne, q) {
|
|
1524
|
+
var ue = P.w(w.$u ? Date.UTC(w.$y, q, ne) : new Date(w.$y, q, ne), w);
|
|
1525
|
+
return h ? ue : ue.endOf(v);
|
|
1526
|
+
}, y = function(ne, q) {
|
|
1527
|
+
return P.w(w.toDate()[ne].apply(w.toDate("s"), (h ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(q)), w);
|
|
1528
|
+
}, C = this.$W, N = this.$M, H = this.$D, K = "set" + (this.$u ? "UTC" : "");
|
|
1529
|
+
switch (f) {
|
|
1530
|
+
case d:
|
|
1531
|
+
return h ? n(1, 0) : n(31, 11);
|
|
1532
|
+
case j:
|
|
1533
|
+
return h ? n(1, N) : n(0, N + 1);
|
|
1534
|
+
case b:
|
|
1535
|
+
var I = this.$locale().weekStart || 0, ee = (C < I ? C + 7 : C) - I;
|
|
1536
|
+
return n(h ? H - ee : H + (6 - ee), N);
|
|
1537
|
+
case v:
|
|
1538
|
+
case u:
|
|
1539
|
+
return y(K + "Hours", 0);
|
|
1540
|
+
case c:
|
|
1541
|
+
return y(K + "Minutes", 1);
|
|
1542
|
+
case o:
|
|
1543
|
+
return y(K + "Seconds", 2);
|
|
1544
|
+
case l:
|
|
1545
|
+
return y(K + "Milliseconds", 3);
|
|
1546
|
+
default:
|
|
1547
|
+
return this.clone();
|
|
1548
|
+
}
|
|
1549
|
+
}, S.endOf = function(g) {
|
|
1550
|
+
return this.startOf(g, !1);
|
|
1551
|
+
}, S.$set = function(g, $) {
|
|
1552
|
+
var w, h = P.p(g), f = "set" + (this.$u ? "UTC" : ""), n = (w = {}, w[v] = f + "Date", w[u] = f + "Date", w[j] = f + "Month", w[d] = f + "FullYear", w[c] = f + "Hours", w[o] = f + "Minutes", w[l] = f + "Seconds", w[p] = f + "Milliseconds", w)[h], y = h === v ? this.$D + ($ - this.$W) : $;
|
|
1553
|
+
if (h === j || h === d) {
|
|
1554
|
+
var C = this.clone().set(u, 1);
|
|
1555
|
+
C.$d[n](y), C.init(), this.$d = C.set(u, Math.min(this.$D, C.daysInMonth())).$d;
|
|
1556
|
+
} else n && this.$d[n](y);
|
|
1557
|
+
return this.init(), this;
|
|
1558
|
+
}, S.set = function(g, $) {
|
|
1559
|
+
return this.clone().$set(g, $);
|
|
1560
|
+
}, S.get = function(g) {
|
|
1561
|
+
return this[P.p(g)]();
|
|
1562
|
+
}, S.add = function(g, $) {
|
|
1563
|
+
var w, h = this;
|
|
1564
|
+
g = Number(g);
|
|
1565
|
+
var f = P.p($), n = function(N) {
|
|
1566
|
+
var H = R(h);
|
|
1567
|
+
return P.w(H.date(H.date() + Math.round(N * g)), h);
|
|
1568
|
+
};
|
|
1569
|
+
if (f === j) return this.set(j, this.$M + g);
|
|
1570
|
+
if (f === d) return this.set(d, this.$y + g);
|
|
1571
|
+
if (f === v) return n(1);
|
|
1572
|
+
if (f === b) return n(7);
|
|
1573
|
+
var y = (w = {}, w[o] = i, w[c] = s, w[l] = a, w)[f] || 1, C = this.$d.getTime() + g * y;
|
|
1574
|
+
return P.w(C, this);
|
|
1575
|
+
}, S.subtract = function(g, $) {
|
|
1576
|
+
return this.add(-1 * g, $);
|
|
1577
|
+
}, S.format = function(g) {
|
|
1578
|
+
var $ = this, w = this.$locale();
|
|
1579
|
+
if (!this.isValid()) return w.invalidDate || T;
|
|
1580
|
+
var h = g || "YYYY-MM-DDTHH:mm:ssZ", f = P.z(this), n = this.$H, y = this.$m, C = this.$M, N = w.weekdays, H = w.months, K = w.meridiem, I = function(q, ue, he, Se) {
|
|
1581
|
+
return q && (q[ue] || q($, h)) || he[ue].slice(0, Se);
|
|
1582
|
+
}, ee = function(q) {
|
|
1583
|
+
return P.s(n % 12 || 12, q, "0");
|
|
1584
|
+
}, ne = K || function(q, ue, he) {
|
|
1585
|
+
var Se = q < 12 ? "AM" : "PM";
|
|
1586
|
+
return he ? Se.toLowerCase() : Se;
|
|
1587
|
+
};
|
|
1588
|
+
return h.replace(m, (function(q, ue) {
|
|
1589
|
+
return ue || (function(he) {
|
|
1590
|
+
switch (he) {
|
|
1591
|
+
case "YY":
|
|
1592
|
+
return String($.$y).slice(-2);
|
|
1593
|
+
case "YYYY":
|
|
1594
|
+
return P.s($.$y, 4, "0");
|
|
1595
|
+
case "M":
|
|
1596
|
+
return C + 1;
|
|
1597
|
+
case "MM":
|
|
1598
|
+
return P.s(C + 1, 2, "0");
|
|
1599
|
+
case "MMM":
|
|
1600
|
+
return I(w.monthsShort, C, H, 3);
|
|
1601
|
+
case "MMMM":
|
|
1602
|
+
return I(H, C);
|
|
1603
|
+
case "D":
|
|
1604
|
+
return $.$D;
|
|
1605
|
+
case "DD":
|
|
1606
|
+
return P.s($.$D, 2, "0");
|
|
1607
|
+
case "d":
|
|
1608
|
+
return String($.$W);
|
|
1609
|
+
case "dd":
|
|
1610
|
+
return I(w.weekdaysMin, $.$W, N, 2);
|
|
1611
|
+
case "ddd":
|
|
1612
|
+
return I(w.weekdaysShort, $.$W, N, 3);
|
|
1613
|
+
case "dddd":
|
|
1614
|
+
return N[$.$W];
|
|
1615
|
+
case "H":
|
|
1616
|
+
return String(n);
|
|
1617
|
+
case "HH":
|
|
1618
|
+
return P.s(n, 2, "0");
|
|
1619
|
+
case "h":
|
|
1620
|
+
return ee(1);
|
|
1621
|
+
case "hh":
|
|
1622
|
+
return ee(2);
|
|
1623
|
+
case "a":
|
|
1624
|
+
return ne(n, y, !0);
|
|
1625
|
+
case "A":
|
|
1626
|
+
return ne(n, y, !1);
|
|
1627
|
+
case "m":
|
|
1628
|
+
return String(y);
|
|
1629
|
+
case "mm":
|
|
1630
|
+
return P.s(y, 2, "0");
|
|
1631
|
+
case "s":
|
|
1632
|
+
return String($.$s);
|
|
1633
|
+
case "ss":
|
|
1634
|
+
return P.s($.$s, 2, "0");
|
|
1635
|
+
case "SSS":
|
|
1636
|
+
return P.s($.$ms, 3, "0");
|
|
1637
|
+
case "Z":
|
|
1638
|
+
return f;
|
|
1639
|
+
}
|
|
1640
|
+
return null;
|
|
1641
|
+
})(q) || f.replace(":", "");
|
|
1642
|
+
}));
|
|
1643
|
+
}, S.utcOffset = function() {
|
|
1644
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1645
|
+
}, S.diff = function(g, $, w) {
|
|
1646
|
+
var h, f = this, n = P.p($), y = R(g), C = (y.utcOffset() - this.utcOffset()) * i, N = this - y, H = function() {
|
|
1647
|
+
return P.m(f, y);
|
|
1648
|
+
};
|
|
1649
|
+
switch (n) {
|
|
1650
|
+
case d:
|
|
1651
|
+
h = H() / 12;
|
|
1652
|
+
break;
|
|
1653
|
+
case j:
|
|
1654
|
+
h = H();
|
|
1655
|
+
break;
|
|
1656
|
+
case k:
|
|
1657
|
+
h = H() / 3;
|
|
1658
|
+
break;
|
|
1659
|
+
case b:
|
|
1660
|
+
h = (N - C) / 6048e5;
|
|
1661
|
+
break;
|
|
1662
|
+
case v:
|
|
1663
|
+
h = (N - C) / 864e5;
|
|
1664
|
+
break;
|
|
1665
|
+
case c:
|
|
1666
|
+
h = N / s;
|
|
1667
|
+
break;
|
|
1668
|
+
case o:
|
|
1669
|
+
h = N / i;
|
|
1670
|
+
break;
|
|
1671
|
+
case l:
|
|
1672
|
+
h = N / a;
|
|
1673
|
+
break;
|
|
1674
|
+
default:
|
|
1675
|
+
h = N;
|
|
1676
|
+
}
|
|
1677
|
+
return w ? h : P.a(h);
|
|
1678
|
+
}, S.daysInMonth = function() {
|
|
1679
|
+
return this.endOf(j).$D;
|
|
1680
|
+
}, S.$locale = function() {
|
|
1681
|
+
return A[this.$L];
|
|
1682
|
+
}, S.locale = function(g, $) {
|
|
1683
|
+
if (!g) return this.$L;
|
|
1684
|
+
var w = this.clone(), h = x(g, $, !0);
|
|
1685
|
+
return h && (w.$L = h), w;
|
|
1686
|
+
}, S.clone = function() {
|
|
1687
|
+
return P.w(this.$d, this);
|
|
1688
|
+
}, S.toDate = function() {
|
|
1689
|
+
return new Date(this.valueOf());
|
|
1690
|
+
}, S.toJSON = function() {
|
|
1691
|
+
return this.isValid() ? this.toISOString() : null;
|
|
1692
|
+
}, S.toISOString = function() {
|
|
1693
|
+
return this.$d.toISOString();
|
|
1694
|
+
}, S.toString = function() {
|
|
1695
|
+
return this.$d.toUTCString();
|
|
1696
|
+
}, E;
|
|
1697
|
+
})(), U = J.prototype;
|
|
1698
|
+
return R.prototype = U, [["$ms", p], ["$s", l], ["$m", o], ["$H", c], ["$W", v], ["$M", j], ["$y", d], ["$D", u]].forEach((function(E) {
|
|
1699
|
+
U[E[1]] = function(S) {
|
|
1700
|
+
return this.$g(S, E[0], E[1]);
|
|
1701
|
+
};
|
|
1702
|
+
})), R.extend = function(E, S) {
|
|
1703
|
+
return E.$i || (E(S, J, R), E.$i = !0), R;
|
|
1704
|
+
}, R.locale = x, R.isDayjs = te, R.unix = function(E) {
|
|
1705
|
+
return R(1e3 * E);
|
|
1706
|
+
}, R.en = A[O], R.Ls = A, R.p = {}, R;
|
|
1707
|
+
}));
|
|
1708
|
+
})(Ae)), Ae.exports;
|
|
1709
|
+
}
|
|
1710
|
+
var $n = Tn();
|
|
1711
|
+
const Dt = /* @__PURE__ */ on($n), { Option: Me } = ie, { TextArea: kn } = ve, Cn = ({ onCreateTask: t, onClose: r }) => {
|
|
1712
|
+
const [a] = G.useForm(), i = (s) => {
|
|
1713
|
+
const p = s.start.toDate(), l = new Date(p);
|
|
1714
|
+
l.setDate(l.getDate() + (s.duration || 1)), t({
|
|
1715
|
+
text: s.text,
|
|
1716
|
+
start: p,
|
|
1717
|
+
end: l,
|
|
1718
|
+
duration: s.duration || 1,
|
|
1719
|
+
progress: s.progress || 0,
|
|
1720
|
+
type: s.type,
|
|
1721
|
+
color: typeof s.color == "string" ? s.color : s.color?.toHexString?.() || "#4A90E2",
|
|
1722
|
+
owner: s.owner || "",
|
|
1723
|
+
priority: s.priority || "medium",
|
|
1724
|
+
details: s.details || ""
|
|
1725
|
+
}), r();
|
|
1726
|
+
};
|
|
1727
|
+
return /* @__PURE__ */ e.jsx(
|
|
1728
|
+
ze,
|
|
1729
|
+
{
|
|
1730
|
+
title: "Create New Task",
|
|
1731
|
+
open: !0,
|
|
1732
|
+
onCancel: r,
|
|
1733
|
+
onOk: () => a.submit(),
|
|
1734
|
+
okText: "Create Task",
|
|
1735
|
+
cancelText: "Cancel",
|
|
1736
|
+
width: 600,
|
|
1737
|
+
className: "gantt-modal-antd",
|
|
1738
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
1739
|
+
G,
|
|
1740
|
+
{
|
|
1741
|
+
form: a,
|
|
1742
|
+
layout: "vertical",
|
|
1743
|
+
onFinish: i,
|
|
1744
|
+
initialValues: {
|
|
1745
|
+
type: "task",
|
|
1746
|
+
priority: "medium",
|
|
1747
|
+
start: Dt(),
|
|
1748
|
+
duration: 1,
|
|
1749
|
+
progress: 0,
|
|
1750
|
+
color: "#4A90E2"
|
|
1751
|
+
},
|
|
1752
|
+
children: [
|
|
1753
|
+
/* @__PURE__ */ e.jsx(
|
|
1754
|
+
G.Item,
|
|
1755
|
+
{
|
|
1756
|
+
name: "text",
|
|
1757
|
+
label: "Task Name",
|
|
1758
|
+
rules: [{ required: !0, message: "Please enter task name" }],
|
|
1759
|
+
children: /* @__PURE__ */ e.jsx(ve, { placeholder: "Enter task name", autoFocus: !0 })
|
|
1760
|
+
}
|
|
1761
|
+
),
|
|
1762
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
1763
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "type", label: "Type", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(ie, { children: [
|
|
1764
|
+
/* @__PURE__ */ e.jsx(Me, { value: "task", children: "Task" }),
|
|
1765
|
+
/* @__PURE__ */ e.jsx(Me, { value: "milestone", children: "Milestone" }),
|
|
1766
|
+
/* @__PURE__ */ e.jsx(Me, { value: "project", children: "Project" })
|
|
1767
|
+
] }) }),
|
|
1768
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "priority", label: "Priority", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(ie, { children: [
|
|
1769
|
+
/* @__PURE__ */ e.jsx(Me, { value: "low", children: "Low" }),
|
|
1770
|
+
/* @__PURE__ */ e.jsx(Me, { value: "medium", children: "Medium" }),
|
|
1771
|
+
/* @__PURE__ */ e.jsx(Me, { value: "high", children: "High" })
|
|
1772
|
+
] }) })
|
|
1773
|
+
] }),
|
|
1774
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
1775
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "start", label: "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(pt, { style: { width: "100%" } }) }),
|
|
1776
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "duration", label: "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(ke, { min: 0, style: { width: "100%" } }) })
|
|
1777
|
+
] }),
|
|
1778
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
1779
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "color", label: "Color", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(gt, { showText: !0 }) }),
|
|
1780
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "progress", label: "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(ke, { min: 0, max: 100, style: { width: "100%" } }) })
|
|
1781
|
+
] }),
|
|
1782
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "owner", label: "Owner", children: /* @__PURE__ */ e.jsx(ve, { placeholder: "Assign to..." }) }),
|
|
1783
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "details", label: "Details", children: /* @__PURE__ */ e.jsx(kn, { placeholder: "Add task description...", rows: 3 }) })
|
|
1784
|
+
]
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
}
|
|
1788
|
+
);
|
|
1789
|
+
}, { Option: Te } = ie, { TextArea: En } = ve, { confirm: Fn } = ze, Nn = ({ task: t, onUpdate: r, onDelete: a, onClose: i }) => {
|
|
1790
|
+
const [s] = G.useForm(), p = (o) => {
|
|
1791
|
+
const c = o.start.toDate(), v = new Date(c);
|
|
1792
|
+
v.setDate(v.getDate() + (o.duration || 1)), r({
|
|
1793
|
+
...t,
|
|
1794
|
+
text: o.text,
|
|
1795
|
+
start: c,
|
|
1796
|
+
end: v,
|
|
1797
|
+
duration: o.duration || 1,
|
|
1798
|
+
progress: o.progress || 0,
|
|
1799
|
+
type: o.type,
|
|
1800
|
+
color: typeof o.color == "string" ? o.color : o.color?.toHexString?.() || "#4A90E2",
|
|
1801
|
+
owner: o.owner || "",
|
|
1802
|
+
priority: o.priority || "medium",
|
|
1803
|
+
details: o.details || ""
|
|
1804
|
+
}), i();
|
|
1805
|
+
}, l = () => {
|
|
1806
|
+
Fn({
|
|
1807
|
+
title: `Are you sure you want to delete "${t.text}"?`,
|
|
1808
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Kt, style: { color: "#faad14", marginRight: 8 } }),
|
|
1809
|
+
content: "This action cannot be undone.",
|
|
1810
|
+
okText: "Yes, Delete",
|
|
1811
|
+
okType: "danger",
|
|
1812
|
+
cancelText: "No",
|
|
1813
|
+
onOk() {
|
|
1814
|
+
a(t.id), i();
|
|
1815
|
+
}
|
|
1816
|
+
});
|
|
1817
|
+
};
|
|
1818
|
+
return /* @__PURE__ */ e.jsx(
|
|
1819
|
+
ze,
|
|
1820
|
+
{
|
|
1821
|
+
title: "Edit Task",
|
|
1822
|
+
open: !0,
|
|
1823
|
+
onCancel: i,
|
|
1824
|
+
footer: [
|
|
1825
|
+
/* @__PURE__ */ e.jsx(se, { danger: !0, onClick: l, style: { float: "left" }, children: "Delete" }, "delete"),
|
|
1826
|
+
/* @__PURE__ */ e.jsx(se, { onClick: i, children: "Cancel" }, "cancel"),
|
|
1827
|
+
/* @__PURE__ */ e.jsx(se, { type: "primary", onClick: () => s.submit(), children: "Save Changes" }, "submit")
|
|
1828
|
+
],
|
|
1829
|
+
width: 600,
|
|
1830
|
+
className: "gantt-modal-antd",
|
|
1831
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
1832
|
+
G,
|
|
1833
|
+
{
|
|
1834
|
+
form: s,
|
|
1835
|
+
layout: "vertical",
|
|
1836
|
+
onFinish: p,
|
|
1837
|
+
initialValues: {
|
|
1838
|
+
text: t.text,
|
|
1839
|
+
type: t.type || "task",
|
|
1840
|
+
priority: t.priority || "medium",
|
|
1841
|
+
start: Dt(t.start),
|
|
1842
|
+
duration: t.duration,
|
|
1843
|
+
progress: t.progress,
|
|
1844
|
+
color: t.color || "#4A90E2",
|
|
1845
|
+
owner: t.owner || "",
|
|
1846
|
+
details: t.details || ""
|
|
1847
|
+
},
|
|
1848
|
+
children: [
|
|
1849
|
+
/* @__PURE__ */ e.jsx(
|
|
1850
|
+
G.Item,
|
|
1851
|
+
{
|
|
1852
|
+
name: "text",
|
|
1853
|
+
label: "Task Name",
|
|
1854
|
+
rules: [{ required: !0, message: "Please enter task name" }],
|
|
1855
|
+
children: /* @__PURE__ */ e.jsx(ve, { placeholder: "Enter task name" })
|
|
1856
|
+
}
|
|
1857
|
+
),
|
|
1858
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
1859
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "type", label: "Type", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(ie, { children: [
|
|
1860
|
+
/* @__PURE__ */ e.jsx(Te, { value: "task", children: "Task" }),
|
|
1861
|
+
/* @__PURE__ */ e.jsx(Te, { value: "milestone", children: "Milestone" }),
|
|
1862
|
+
/* @__PURE__ */ e.jsx(Te, { value: "project", children: "Project" })
|
|
1863
|
+
] }) }),
|
|
1864
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "priority", label: "Priority", style: { flex: 1 }, children: /* @__PURE__ */ e.jsxs(ie, { children: [
|
|
1865
|
+
/* @__PURE__ */ e.jsx(Te, { value: "low", children: "Low" }),
|
|
1866
|
+
/* @__PURE__ */ e.jsx(Te, { value: "medium", children: "Medium" }),
|
|
1867
|
+
/* @__PURE__ */ e.jsx(Te, { value: "high", children: "High" })
|
|
1868
|
+
] }) })
|
|
1869
|
+
] }),
|
|
1870
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
1871
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "start", label: "Start Date", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(pt, { style: { width: "100%" } }) }),
|
|
1872
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "duration", label: "Duration (days)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(ke, { min: 0, style: { width: "100%" } }) })
|
|
1873
|
+
] }),
|
|
1874
|
+
/* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
1875
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "color", label: "Color", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(gt, { showText: !0 }) }),
|
|
1876
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "progress", label: "Progress (%)", style: { flex: 1 }, children: /* @__PURE__ */ e.jsx(ke, { min: 0, max: 100, style: { width: "100%" } }) })
|
|
1877
|
+
] }),
|
|
1878
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "owner", label: "Owner", children: /* @__PURE__ */ e.jsx(ve, { placeholder: "Assign to..." }) }),
|
|
1879
|
+
/* @__PURE__ */ e.jsx(G.Item, { name: "details", label: "Details", children: /* @__PURE__ */ e.jsx(En, { placeholder: "Add task description...", rows: 3 }) })
|
|
1880
|
+
]
|
|
1881
|
+
}
|
|
1882
|
+
)
|
|
1883
|
+
}
|
|
1884
|
+
);
|
|
1885
|
+
}, { Title: Oe, Text: pe, Paragraph: ht } = ft, { Option: je } = ie, Pn = ({
|
|
1886
|
+
task: t,
|
|
1887
|
+
allTasks: r,
|
|
1888
|
+
links: a,
|
|
1889
|
+
onAddDependency: i,
|
|
1890
|
+
onRemoveDependency: s,
|
|
1891
|
+
onClose: p
|
|
1892
|
+
}) => {
|
|
1893
|
+
const [l, o] = B(""), [c, v] = B("e2s"), [b, j] = B(0), [k, d] = B("day"), [u, T] = B(""), _ = a.filter((x) => x.target === t.id), m = a.filter((x) => x.source === t.id), D = r.filter((x) => x.id !== t.id && x.id !== t.parent), Y = () => {
|
|
1894
|
+
if (l) {
|
|
1895
|
+
const x = Ge(b, k);
|
|
1896
|
+
i(l, t.id, c, x), o(""), j(0), d("day");
|
|
1897
|
+
}
|
|
1898
|
+
}, L = () => {
|
|
1899
|
+
if (!u.trim()) return;
|
|
1900
|
+
const x = hn(u.trim());
|
|
1901
|
+
if (!x) {
|
|
1902
|
+
alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
|
|
1903
|
+
Example: 3FS+10d`);
|
|
1904
|
+
return;
|
|
1905
|
+
}
|
|
1906
|
+
const R = x.taskNumber - 1, P = r[R];
|
|
1907
|
+
if (!P) {
|
|
1908
|
+
alert(`Task ${x.taskNumber} not found`);
|
|
1909
|
+
return;
|
|
1910
|
+
}
|
|
1911
|
+
const J = pn(x.type), U = Ge(x.lag, x.lagUnit);
|
|
1912
|
+
i(P.id, t.id, J, U), T("");
|
|
1913
|
+
}, O = (x) => {
|
|
1914
|
+
switch (x) {
|
|
1915
|
+
case "e2s":
|
|
1916
|
+
return "Finish-to-Start (FS)";
|
|
1917
|
+
case "s2s":
|
|
1918
|
+
return "Start-to-Start (SS)";
|
|
1919
|
+
case "e2e":
|
|
1920
|
+
return "Finish-to-Finish (FF)";
|
|
1921
|
+
case "s2e":
|
|
1922
|
+
return "Start-to-Finish (SF)";
|
|
1923
|
+
}
|
|
1924
|
+
}, A = (x) => {
|
|
1925
|
+
switch (x) {
|
|
1926
|
+
case "e2s":
|
|
1927
|
+
return "blue";
|
|
1928
|
+
case "s2s":
|
|
1929
|
+
return "green";
|
|
1930
|
+
case "e2e":
|
|
1931
|
+
return "purple";
|
|
1932
|
+
case "s2e":
|
|
1933
|
+
return "orange";
|
|
1934
|
+
}
|
|
1935
|
+
}, X = (x) => !x || x === 0 ? null : x > 0 ? /* @__PURE__ */ e.jsxs(be, { color: "warning", children: [
|
|
1936
|
+
"+",
|
|
1937
|
+
x,
|
|
1938
|
+
"d lag"
|
|
1939
|
+
] }) : /* @__PURE__ */ e.jsxs(be, { color: "processing", children: [
|
|
1940
|
+
x,
|
|
1941
|
+
"d lead"
|
|
1942
|
+
] }), te = (x, R) => {
|
|
1943
|
+
const P = r.find((J) => J.id === (R === "source" ? x.source : x.target));
|
|
1944
|
+
return /* @__PURE__ */ e.jsx(
|
|
1945
|
+
$e.Item,
|
|
1946
|
+
{
|
|
1947
|
+
actions: [
|
|
1948
|
+
/* @__PURE__ */ e.jsx(
|
|
1949
|
+
se,
|
|
1950
|
+
{
|
|
1951
|
+
type: "text",
|
|
1952
|
+
danger: !0,
|
|
1953
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: jt }),
|
|
1954
|
+
onClick: () => s(x.id),
|
|
1955
|
+
children: "Remove"
|
|
1956
|
+
}
|
|
1957
|
+
)
|
|
1958
|
+
],
|
|
1959
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1960
|
+
$e.Item.Meta,
|
|
1961
|
+
{
|
|
1962
|
+
title: /* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1963
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { fontFamily: "IBM Plex Sans, sans-serif" }, children: P?.text || (R === "source" ? x.source : x.target) }),
|
|
1964
|
+
/* @__PURE__ */ e.jsx(be, { color: A(x.type), children: O(x.type) }),
|
|
1965
|
+
X(x.lag)
|
|
1966
|
+
] }),
|
|
1967
|
+
description: /* @__PURE__ */ e.jsxs(pe, { type: "secondary", style: { fontFamily: "IBM Plex Sans, sans-serif", fontSize: "12px" }, children: [
|
|
1968
|
+
P?.owner && `Owner: ${P.owner}`,
|
|
1969
|
+
P?.priority && ` • Priority: ${P.priority}`
|
|
1970
|
+
] })
|
|
1971
|
+
}
|
|
1972
|
+
)
|
|
1973
|
+
}
|
|
1974
|
+
);
|
|
1975
|
+
};
|
|
1976
|
+
return /* @__PURE__ */ e.jsxs(
|
|
1977
|
+
ze,
|
|
1978
|
+
{
|
|
1979
|
+
title: /* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1980
|
+
/* @__PURE__ */ e.jsx(z, { icon: wt, style: { fontSize: "20px" } }),
|
|
1981
|
+
/* @__PURE__ */ e.jsx(Oe, { level: 4, style: { margin: 0, fontFamily: "IBM Plex Mono, monospace" }, children: "Task Dependencies" })
|
|
1982
|
+
] }),
|
|
1983
|
+
open: !0,
|
|
1984
|
+
onCancel: p,
|
|
1985
|
+
width: 900,
|
|
1986
|
+
footer: null,
|
|
1987
|
+
className: "gantt-dependency-modal",
|
|
1988
|
+
styles: {
|
|
1989
|
+
body: { maxHeight: "70vh", overflowY: "auto", fontFamily: "IBM Plex Sans, sans-serif" }
|
|
1990
|
+
},
|
|
1991
|
+
children: [
|
|
1992
|
+
/* @__PURE__ */ e.jsx(
|
|
1993
|
+
nt,
|
|
1994
|
+
{
|
|
1995
|
+
size: "small",
|
|
1996
|
+
style: { marginBottom: 24, backgroundColor: "#f5f5f5", borderColor: "#d9d9d9" },
|
|
1997
|
+
children: /* @__PURE__ */ e.jsxs(ge, { direction: "vertical", size: 4, children: [
|
|
1998
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { fontFamily: "IBM Plex Mono, monospace", fontSize: "16px" }, children: t.text }),
|
|
1999
|
+
/* @__PURE__ */ e.jsxs(pe, { type: "secondary", style: { fontFamily: "IBM Plex Sans, sans-serif", fontSize: "13px" }, children: [
|
|
2000
|
+
t.start.toLocaleDateString(),
|
|
2001
|
+
" → ",
|
|
2002
|
+
t.end.toLocaleDateString(),
|
|
2003
|
+
t.owner && ` • Owner: ${t.owner}`,
|
|
2004
|
+
t.priority && ` • Priority: ${t.priority}`
|
|
2005
|
+
] })
|
|
2006
|
+
] })
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: 32 }, children: [
|
|
2010
|
+
/* @__PURE__ */ e.jsxs(
|
|
2011
|
+
Oe,
|
|
2012
|
+
{
|
|
2013
|
+
level: 5,
|
|
2014
|
+
style: {
|
|
2015
|
+
fontFamily: "IBM Plex Mono, monospace",
|
|
2016
|
+
textTransform: "uppercase",
|
|
2017
|
+
letterSpacing: "0.5px",
|
|
2018
|
+
fontSize: "13px",
|
|
2019
|
+
color: "#595959"
|
|
2020
|
+
},
|
|
2021
|
+
children: [
|
|
2022
|
+
/* @__PURE__ */ e.jsx(z, { icon: Qt, style: { marginRight: "8px" } }),
|
|
2023
|
+
"Depends On (Predecessors)"
|
|
2024
|
+
]
|
|
2025
|
+
}
|
|
2026
|
+
),
|
|
2027
|
+
_.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
2028
|
+
Xe,
|
|
2029
|
+
{
|
|
2030
|
+
message: "No dependencies",
|
|
2031
|
+
description: "This task doesn't depend on any other tasks.",
|
|
2032
|
+
type: "info",
|
|
2033
|
+
showIcon: !0,
|
|
2034
|
+
style: { fontFamily: "IBM Plex Sans, sans-serif" }
|
|
2035
|
+
}
|
|
2036
|
+
) : /* @__PURE__ */ e.jsx(
|
|
2037
|
+
$e,
|
|
2038
|
+
{
|
|
2039
|
+
dataSource: _,
|
|
2040
|
+
renderItem: (x) => te(x, "source"),
|
|
2041
|
+
bordered: !0,
|
|
2042
|
+
style: { fontFamily: "IBM Plex Sans, sans-serif" }
|
|
2043
|
+
}
|
|
2044
|
+
)
|
|
2045
|
+
] }),
|
|
2046
|
+
/* @__PURE__ */ e.jsxs("div", { style: { marginBottom: 32 }, children: [
|
|
2047
|
+
/* @__PURE__ */ e.jsxs(
|
|
2048
|
+
Oe,
|
|
2049
|
+
{
|
|
2050
|
+
level: 5,
|
|
2051
|
+
style: {
|
|
2052
|
+
fontFamily: "IBM Plex Mono, monospace",
|
|
2053
|
+
textTransform: "uppercase",
|
|
2054
|
+
letterSpacing: "0.5px",
|
|
2055
|
+
fontSize: "13px",
|
|
2056
|
+
color: "#595959"
|
|
2057
|
+
},
|
|
2058
|
+
children: [
|
|
2059
|
+
/* @__PURE__ */ e.jsx(z, { icon: en, style: { marginRight: "8px" } }),
|
|
2060
|
+
"Dependents (Successors)"
|
|
2061
|
+
]
|
|
2062
|
+
}
|
|
2063
|
+
),
|
|
2064
|
+
m.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
2065
|
+
Xe,
|
|
2066
|
+
{
|
|
2067
|
+
message: "No dependent tasks",
|
|
2068
|
+
description: "No other tasks depend on this task.",
|
|
2069
|
+
type: "info",
|
|
2070
|
+
showIcon: !0,
|
|
2071
|
+
style: { fontFamily: "IBM Plex Sans, sans-serif" }
|
|
2072
|
+
}
|
|
2073
|
+
) : /* @__PURE__ */ e.jsx(
|
|
2074
|
+
$e,
|
|
2075
|
+
{
|
|
2076
|
+
dataSource: m,
|
|
2077
|
+
renderItem: (x) => te(x, "target"),
|
|
2078
|
+
bordered: !0,
|
|
2079
|
+
style: { fontFamily: "IBM Plex Sans, sans-serif" }
|
|
2080
|
+
}
|
|
2081
|
+
)
|
|
2082
|
+
] }),
|
|
2083
|
+
/* @__PURE__ */ e.jsx(Le, {}),
|
|
2084
|
+
/* @__PURE__ */ e.jsx(
|
|
2085
|
+
nt,
|
|
2086
|
+
{
|
|
2087
|
+
title: /* @__PURE__ */ e.jsxs(
|
|
2088
|
+
Oe,
|
|
2089
|
+
{
|
|
2090
|
+
level: 5,
|
|
2091
|
+
style: {
|
|
2092
|
+
margin: 0,
|
|
2093
|
+
fontFamily: "IBM Plex Mono, monospace",
|
|
2094
|
+
fontSize: "14px"
|
|
2095
|
+
},
|
|
2096
|
+
children: [
|
|
2097
|
+
/* @__PURE__ */ e.jsx(z, { icon: Ne, style: { marginRight: "8px" } }),
|
|
2098
|
+
"Add New Dependency"
|
|
2099
|
+
]
|
|
2100
|
+
}
|
|
2101
|
+
),
|
|
2102
|
+
style: { marginBottom: 24 },
|
|
2103
|
+
children: /* @__PURE__ */ e.jsxs(ge, { direction: "vertical", size: "large", style: { width: "100%" }, children: [
|
|
2104
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2105
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { fontFamily: "IBM Plex Sans, sans-serif", display: "block", marginBottom: 8 }, children: "Quick Add (Keyboard Shortcut):" }),
|
|
2106
|
+
/* @__PURE__ */ e.jsx(pe, { type: "secondary", style: { fontFamily: "IBM Plex Sans, sans-serif", fontSize: "12px", display: "block", marginBottom: 8 }, children: "Format: [TaskNumber][Type][+/-][Lag][Unit] • Example: 3FS+10d, 5SS-2w" }),
|
|
2107
|
+
/* @__PURE__ */ e.jsxs(ge.Compact, { style: { width: "100%" }, children: [
|
|
2108
|
+
/* @__PURE__ */ e.jsx(
|
|
2109
|
+
ve,
|
|
2110
|
+
{
|
|
2111
|
+
placeholder: "e.g., 3FS+10d",
|
|
2112
|
+
value: u,
|
|
2113
|
+
onChange: (x) => T(x.target.value),
|
|
2114
|
+
onPressEnter: L,
|
|
2115
|
+
size: "large",
|
|
2116
|
+
style: { fontFamily: "IBM Plex Mono, monospace" }
|
|
2117
|
+
}
|
|
2118
|
+
),
|
|
2119
|
+
/* @__PURE__ */ e.jsx(
|
|
2120
|
+
se,
|
|
2121
|
+
{
|
|
2122
|
+
type: "primary",
|
|
2123
|
+
size: "large",
|
|
2124
|
+
onClick: L,
|
|
2125
|
+
style: { fontFamily: "IBM Plex Sans, sans-serif" },
|
|
2126
|
+
children: "Add"
|
|
2127
|
+
}
|
|
2128
|
+
)
|
|
2129
|
+
] })
|
|
2130
|
+
] }),
|
|
2131
|
+
/* @__PURE__ */ e.jsx(Le, { style: { margin: "8px 0" }, children: "OR" }),
|
|
2132
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2133
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { fontFamily: "IBM Plex Sans, sans-serif", display: "block", marginBottom: 8 }, children: "Select Task:" }),
|
|
2134
|
+
/* @__PURE__ */ e.jsx(
|
|
2135
|
+
ie,
|
|
2136
|
+
{
|
|
2137
|
+
placeholder: "Choose a task...",
|
|
2138
|
+
value: l || void 0,
|
|
2139
|
+
onChange: o,
|
|
2140
|
+
style: { width: "100%", fontFamily: "IBM Plex Sans, sans-serif" },
|
|
2141
|
+
size: "large",
|
|
2142
|
+
showSearch: !0,
|
|
2143
|
+
filterOption: (x, R) => String(R?.children || "").toLowerCase().includes(x.toLowerCase()),
|
|
2144
|
+
children: D.map((x) => /* @__PURE__ */ e.jsx(je, { value: x.id, children: x.text }, x.id))
|
|
2145
|
+
}
|
|
2146
|
+
)
|
|
2147
|
+
] }),
|
|
2148
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2149
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { fontFamily: "IBM Plex Sans, sans-serif", display: "block", marginBottom: 8 }, children: "Dependency Type:" }),
|
|
2150
|
+
/* @__PURE__ */ e.jsxs(
|
|
2151
|
+
ie,
|
|
2152
|
+
{
|
|
2153
|
+
value: c,
|
|
2154
|
+
onChange: v,
|
|
2155
|
+
style: { width: "100%", fontFamily: "IBM Plex Sans, sans-serif" },
|
|
2156
|
+
size: "large",
|
|
2157
|
+
children: [
|
|
2158
|
+
/* @__PURE__ */ e.jsxs(je, { value: "e2s", children: [
|
|
2159
|
+
/* @__PURE__ */ e.jsx(be, { color: "blue", children: "FS" }),
|
|
2160
|
+
" Finish-to-Start"
|
|
2161
|
+
] }),
|
|
2162
|
+
/* @__PURE__ */ e.jsxs(je, { value: "s2s", children: [
|
|
2163
|
+
/* @__PURE__ */ e.jsx(be, { color: "green", children: "SS" }),
|
|
2164
|
+
" Start-to-Start"
|
|
2165
|
+
] }),
|
|
2166
|
+
/* @__PURE__ */ e.jsxs(je, { value: "e2e", children: [
|
|
2167
|
+
/* @__PURE__ */ e.jsx(be, { color: "purple", children: "FF" }),
|
|
2168
|
+
" Finish-to-Finish"
|
|
2169
|
+
] }),
|
|
2170
|
+
/* @__PURE__ */ e.jsxs(je, { value: "s2e", children: [
|
|
2171
|
+
/* @__PURE__ */ e.jsx(be, { color: "orange", children: "SF" }),
|
|
2172
|
+
" Start-to-Finish"
|
|
2173
|
+
] })
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
)
|
|
2177
|
+
] }),
|
|
2178
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(ge, { direction: "vertical", size: 4, style: { width: "100%" }, children: [
|
|
2179
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { fontFamily: "IBM Plex Sans, sans-serif" }, children: "Lead/Lag Time:" }),
|
|
2180
|
+
/* @__PURE__ */ e.jsx(pe, { type: "secondary", style: { fontFamily: "IBM Plex Sans, sans-serif", fontSize: "12px" }, children: "Negative = lead time (overlap), Positive = lag time (delay)" }),
|
|
2181
|
+
/* @__PURE__ */ e.jsxs(ge.Compact, { style: { width: "100%" }, children: [
|
|
2182
|
+
/* @__PURE__ */ e.jsx(
|
|
2183
|
+
ke,
|
|
2184
|
+
{
|
|
2185
|
+
value: b,
|
|
2186
|
+
onChange: (x) => j(x || 0),
|
|
2187
|
+
style: { flex: 1, fontFamily: "IBM Plex Sans, sans-serif" },
|
|
2188
|
+
size: "large",
|
|
2189
|
+
placeholder: "0",
|
|
2190
|
+
min: -365,
|
|
2191
|
+
max: 365
|
|
2192
|
+
}
|
|
2193
|
+
),
|
|
2194
|
+
/* @__PURE__ */ e.jsxs(
|
|
2195
|
+
ie,
|
|
2196
|
+
{
|
|
2197
|
+
value: k,
|
|
2198
|
+
onChange: d,
|
|
2199
|
+
style: { width: 120, fontFamily: "IBM Plex Sans, sans-serif" },
|
|
2200
|
+
size: "large",
|
|
2201
|
+
children: [
|
|
2202
|
+
/* @__PURE__ */ e.jsx(je, { value: "day", children: "Days" }),
|
|
2203
|
+
/* @__PURE__ */ e.jsx(je, { value: "hour", children: "Hours" }),
|
|
2204
|
+
/* @__PURE__ */ e.jsx(je, { value: "week", children: "Weeks" }),
|
|
2205
|
+
/* @__PURE__ */ e.jsx(je, { value: "month", children: "Months" })
|
|
2206
|
+
]
|
|
2207
|
+
}
|
|
2208
|
+
)
|
|
2209
|
+
] })
|
|
2210
|
+
] }) }),
|
|
2211
|
+
/* @__PURE__ */ e.jsx(
|
|
2212
|
+
se,
|
|
2213
|
+
{
|
|
2214
|
+
type: "primary",
|
|
2215
|
+
size: "large",
|
|
2216
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: Ne }),
|
|
2217
|
+
onClick: Y,
|
|
2218
|
+
disabled: !l,
|
|
2219
|
+
block: !0,
|
|
2220
|
+
style: { fontFamily: "IBM Plex Sans, sans-serif", fontWeight: 600 },
|
|
2221
|
+
children: "Add Dependency"
|
|
2222
|
+
}
|
|
2223
|
+
)
|
|
2224
|
+
] })
|
|
2225
|
+
}
|
|
2226
|
+
),
|
|
2227
|
+
/* @__PURE__ */ e.jsx(
|
|
2228
|
+
Xe,
|
|
2229
|
+
{
|
|
2230
|
+
message: /* @__PURE__ */ e.jsxs(pe, { strong: !0, style: { fontFamily: "IBM Plex Mono, monospace" }, children: [
|
|
2231
|
+
/* @__PURE__ */ e.jsx(z, { icon: rt, style: { marginRight: "8px" } }),
|
|
2232
|
+
"Dependency Types Explained"
|
|
2233
|
+
] }),
|
|
2234
|
+
description: /* @__PURE__ */ e.jsxs("div", { style: { fontFamily: "IBM Plex Sans, sans-serif" }, children: [
|
|
2235
|
+
/* @__PURE__ */ e.jsxs("ul", { style: { marginBottom: 12, paddingLeft: 20 }, children: [
|
|
2236
|
+
/* @__PURE__ */ e.jsxs("li", { children: [
|
|
2237
|
+
/* @__PURE__ */ e.jsx("strong", { children: "Finish-to-Start (FS):" }),
|
|
2238
|
+
" Successor starts after predecessor finishes"
|
|
2239
|
+
] }),
|
|
2240
|
+
/* @__PURE__ */ e.jsxs("li", { children: [
|
|
2241
|
+
/* @__PURE__ */ e.jsx("strong", { children: "Start-to-Start (SS):" }),
|
|
2242
|
+
" Both tasks start at the same time"
|
|
2243
|
+
] }),
|
|
2244
|
+
/* @__PURE__ */ e.jsxs("li", { children: [
|
|
2245
|
+
/* @__PURE__ */ e.jsx("strong", { children: "Finish-to-Finish (FF):" }),
|
|
2246
|
+
" Both tasks finish at the same time"
|
|
2247
|
+
] }),
|
|
2248
|
+
/* @__PURE__ */ e.jsxs("li", { children: [
|
|
2249
|
+
/* @__PURE__ */ e.jsx("strong", { children: "Start-to-Finish (SF):" }),
|
|
2250
|
+
" Successor finishes when predecessor starts"
|
|
2251
|
+
] })
|
|
2252
|
+
] }),
|
|
2253
|
+
/* @__PURE__ */ e.jsx(Le, { style: { margin: "12px 0" } }),
|
|
2254
|
+
/* @__PURE__ */ e.jsx(pe, { strong: !0, style: { display: "block", marginBottom: 4 }, children: "Keyboard Shortcuts:" }),
|
|
2255
|
+
/* @__PURE__ */ e.jsx(ht, { style: { margin: 0, fontSize: "12px" }, code: !0, children: "[TaskID][Type]+/-[Days]d" }),
|
|
2256
|
+
/* @__PURE__ */ e.jsxs(ht, { style: { margin: 0, fontSize: "12px" }, children: [
|
|
2257
|
+
"Example: ",
|
|
2258
|
+
/* @__PURE__ */ e.jsx("code", { children: "3FS+10d" }),
|
|
2259
|
+
" = Task 3, Finish-to-Start, 10 days lag"
|
|
2260
|
+
] })
|
|
2261
|
+
] }),
|
|
2262
|
+
type: "info",
|
|
2263
|
+
showIcon: !0,
|
|
2264
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: rt }),
|
|
2265
|
+
style: { marginTop: 16 }
|
|
2266
|
+
}
|
|
2267
|
+
)
|
|
2268
|
+
]
|
|
2269
|
+
}
|
|
2270
|
+
);
|
|
2271
|
+
}, Rn = ({
|
|
2272
|
+
x: t,
|
|
2273
|
+
y: r,
|
|
2274
|
+
task: a,
|
|
2275
|
+
onEdit: i,
|
|
2276
|
+
onDelete: s,
|
|
2277
|
+
onCopy: p,
|
|
2278
|
+
onDependencies: l,
|
|
2279
|
+
onConvertToMilestone: o,
|
|
2280
|
+
onConvertToTask: c,
|
|
2281
|
+
onConvertToProject: v,
|
|
2282
|
+
onAutoSchedule: b,
|
|
2283
|
+
onClose: j
|
|
2284
|
+
}) => {
|
|
2285
|
+
if (!a) return null;
|
|
2286
|
+
const k = [
|
|
2287
|
+
{
|
|
2288
|
+
key: "edit",
|
|
2289
|
+
label: "Edit",
|
|
2290
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: tn }),
|
|
2291
|
+
onClick: () => {
|
|
2292
|
+
i(), j();
|
|
2293
|
+
}
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
key: "copy",
|
|
2297
|
+
label: "Copy",
|
|
2298
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: nn }),
|
|
2299
|
+
onClick: () => {
|
|
2300
|
+
p(), j();
|
|
2301
|
+
}
|
|
2302
|
+
},
|
|
2303
|
+
{
|
|
2304
|
+
key: "dependencies",
|
|
2305
|
+
label: "Dependencies",
|
|
2306
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: wt }),
|
|
2307
|
+
onClick: () => {
|
|
2308
|
+
l(), j();
|
|
2309
|
+
}
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
type: "divider"
|
|
2313
|
+
},
|
|
2314
|
+
{
|
|
2315
|
+
key: "convert",
|
|
2316
|
+
label: "Convert to",
|
|
2317
|
+
type: "submenu",
|
|
2318
|
+
children: [
|
|
2319
|
+
{
|
|
2320
|
+
key: "milestone",
|
|
2321
|
+
label: "Milestone",
|
|
2322
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: sn }),
|
|
2323
|
+
disabled: a.type === "milestone",
|
|
2324
|
+
onClick: () => {
|
|
2325
|
+
o(), j();
|
|
2326
|
+
}
|
|
2327
|
+
},
|
|
2328
|
+
{
|
|
2329
|
+
key: "task",
|
|
2330
|
+
label: "Task",
|
|
2331
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: rn }),
|
|
2332
|
+
disabled: a.type === "task",
|
|
2333
|
+
onClick: () => {
|
|
2334
|
+
c(), j();
|
|
2335
|
+
}
|
|
2336
|
+
},
|
|
2337
|
+
{
|
|
2338
|
+
key: "project",
|
|
2339
|
+
label: "Project",
|
|
2340
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: an }),
|
|
2341
|
+
disabled: a.type === "project",
|
|
2342
|
+
onClick: () => {
|
|
2343
|
+
v(), j();
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
]
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
key: "auto-schedule",
|
|
2350
|
+
label: "Auto Schedule",
|
|
2351
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: yt }),
|
|
2352
|
+
onClick: () => {
|
|
2353
|
+
b?.(), j();
|
|
2354
|
+
}
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
type: "divider"
|
|
2358
|
+
},
|
|
2359
|
+
{
|
|
2360
|
+
key: "delete",
|
|
2361
|
+
label: "Delete",
|
|
2362
|
+
icon: /* @__PURE__ */ e.jsx(z, { icon: jt }),
|
|
2363
|
+
danger: !0,
|
|
2364
|
+
onClick: () => {
|
|
2365
|
+
s(), j();
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
];
|
|
2369
|
+
return /* @__PURE__ */ e.jsx(
|
|
2370
|
+
"div",
|
|
2371
|
+
{
|
|
2372
|
+
className: "gantt-context-menu",
|
|
2373
|
+
style: {
|
|
2374
|
+
position: "fixed",
|
|
2375
|
+
left: `${t}px`,
|
|
2376
|
+
top: `${r}px`,
|
|
2377
|
+
zIndex: 1e4
|
|
2378
|
+
},
|
|
2379
|
+
onClick: (d) => d.stopPropagation(),
|
|
2380
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2381
|
+
Ht,
|
|
2382
|
+
{
|
|
2383
|
+
items: k,
|
|
2384
|
+
style: {
|
|
2385
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
2386
|
+
borderRadius: "6px",
|
|
2387
|
+
border: "1px solid #e0e0e0"
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
)
|
|
2391
|
+
}
|
|
2392
|
+
);
|
|
2393
|
+
}, _n = (t, r = []) => {
|
|
2394
|
+
const [a, i] = B([]), [s, p] = B(-1), [l, o] = B(t), [c, v] = B(r), b = me((D, Y, L) => {
|
|
2395
|
+
const O = {
|
|
2396
|
+
type: D,
|
|
2397
|
+
before: Y,
|
|
2398
|
+
after: L,
|
|
2399
|
+
timestamp: Date.now()
|
|
2400
|
+
}, A = a.slice(0, s + 1);
|
|
2401
|
+
A.push(O), A.length > 50 ? A.shift() : p(s + 1), i(A);
|
|
2402
|
+
}, [a, s]), j = me(() => {
|
|
2403
|
+
if (s < 0) return;
|
|
2404
|
+
const D = a[s];
|
|
2405
|
+
o(D.before.tasks), v(D.before.links), p(s - 1);
|
|
2406
|
+
}, [a, s]), k = me(() => {
|
|
2407
|
+
if (s >= a.length - 1) return;
|
|
2408
|
+
const D = a[s + 1];
|
|
2409
|
+
o(D.after.tasks), v(D.after.links), p(s + 1);
|
|
2410
|
+
}, [a, s]), d = s >= 0, u = s < a.length - 1, T = me((D) => {
|
|
2411
|
+
const Y = { tasks: l, links: c }, L = l.map((A) => A.id === D.id ? D : A);
|
|
2412
|
+
b("task_update", Y, { tasks: L, links: c }), o(L);
|
|
2413
|
+
}, [l, c, b]), _ = me((D) => {
|
|
2414
|
+
const Y = { tasks: l, links: c }, L = [...l, D];
|
|
2415
|
+
b("task_create", Y, { tasks: L, links: c }), o(L);
|
|
2416
|
+
}, [l, c, b]), m = me((D) => {
|
|
2417
|
+
const Y = { tasks: l, links: c }, L = l.filter((X) => X.id !== D), O = c.filter((X) => X.source !== D && X.target !== D);
|
|
2418
|
+
b("task_delete", Y, { tasks: L, links: O }), o(L), v(O);
|
|
2419
|
+
}, [l, c, b]);
|
|
2420
|
+
return {
|
|
2421
|
+
tasks: l,
|
|
2422
|
+
links: c,
|
|
2423
|
+
setTasks: o,
|
|
2424
|
+
setLinks: v,
|
|
2425
|
+
undo: j,
|
|
2426
|
+
redo: k,
|
|
2427
|
+
canUndo: d,
|
|
2428
|
+
canRedo: u,
|
|
2429
|
+
updateTask: T,
|
|
2430
|
+
createTask: _,
|
|
2431
|
+
deleteTask: m,
|
|
2432
|
+
saveState: b,
|
|
2433
|
+
history: a
|
|
2434
|
+
};
|
|
2435
|
+
}, Mt = (t, r, a = { mode: "forward" }) => {
|
|
2436
|
+
const i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
2437
|
+
return t.forEach((p) => {
|
|
2438
|
+
i.set(p.id, []), s.set(p.id, []);
|
|
2439
|
+
}), r.forEach((p) => {
|
|
2440
|
+
p.type === "e2s" && (i.get(p.target)?.push(p.source), s.get(p.source)?.push(p.target));
|
|
2441
|
+
}), a.mode === "forward" ? Yn(t, i, a) : On(t, s, a);
|
|
2442
|
+
}, Yn = (t, r, a) => {
|
|
2443
|
+
const i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), p = a.projectStart || /* @__PURE__ */ new Date(), l = (o) => {
|
|
2444
|
+
if (s.has(o)) return;
|
|
2445
|
+
const c = t.find((u) => u.id === o);
|
|
2446
|
+
if (!c) return;
|
|
2447
|
+
const v = r.get(o) || [];
|
|
2448
|
+
v.forEach((u) => l(u));
|
|
2449
|
+
let b = p;
|
|
2450
|
+
v.forEach((u) => {
|
|
2451
|
+
const T = i.get(u);
|
|
2452
|
+
T && T.end > b && (b = new Date(T.end));
|
|
2453
|
+
});
|
|
2454
|
+
const j = new Date(b), k = ae(j, c.duration, "day"), d = {
|
|
2455
|
+
...c,
|
|
2456
|
+
start: j,
|
|
2457
|
+
end: k
|
|
2458
|
+
};
|
|
2459
|
+
i.set(o, d), s.add(o);
|
|
2460
|
+
};
|
|
2461
|
+
return t.forEach((o) => l(o.id)), t.map((o) => i.get(o.id) || o);
|
|
2462
|
+
}, On = (t, r, a) => {
|
|
2463
|
+
const i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), p = a.projectEnd || new Date(
|
|
2464
|
+
Math.max(...t.map((o) => o.end.getTime()))
|
|
2465
|
+
), l = (o) => {
|
|
2466
|
+
if (s.has(o)) return;
|
|
2467
|
+
const c = t.find((u) => u.id === o);
|
|
2468
|
+
if (!c) return;
|
|
2469
|
+
const v = r.get(o) || [];
|
|
2470
|
+
v.forEach((u) => l(u));
|
|
2471
|
+
let b = p;
|
|
2472
|
+
v.forEach((u) => {
|
|
2473
|
+
const T = i.get(u);
|
|
2474
|
+
T && T.start < b && (b = new Date(T.start));
|
|
2475
|
+
});
|
|
2476
|
+
const j = new Date(b), k = ae(j, -c.duration, "day"), d = {
|
|
2477
|
+
...c,
|
|
2478
|
+
start: k,
|
|
2479
|
+
end: j
|
|
2480
|
+
};
|
|
2481
|
+
i.set(o, d), s.add(o);
|
|
2482
|
+
};
|
|
2483
|
+
return t.forEach((o) => l(o.id)), t.map((o) => i.get(o.id) || o);
|
|
2484
|
+
}, Ln = (t) => {
|
|
2485
|
+
const r = /* @__PURE__ */ new Map();
|
|
2486
|
+
t.forEach((i) => {
|
|
2487
|
+
i.owner && (r.has(i.owner) || r.set(i.owner, []), r.get(i.owner).push(i));
|
|
2488
|
+
});
|
|
2489
|
+
const a = [...t];
|
|
2490
|
+
return r.forEach((i, s) => {
|
|
2491
|
+
const p = i.sort((l, o) => l.start.getTime() - o.start.getTime());
|
|
2492
|
+
for (let l = 1; l < p.length; l++) {
|
|
2493
|
+
const o = p[l], c = p[l - 1];
|
|
2494
|
+
if (o.start < c.end) {
|
|
2495
|
+
const v = a.findIndex((b) => b.id === o.id);
|
|
2496
|
+
if (v >= 0) {
|
|
2497
|
+
const b = new Date(c.end), j = ae(b, o.duration, "day");
|
|
2498
|
+
a[v] = {
|
|
2499
|
+
...o,
|
|
2500
|
+
start: b,
|
|
2501
|
+
end: j
|
|
2502
|
+
};
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
}), a;
|
|
2507
|
+
}, ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2508
|
+
__proto__: null,
|
|
2509
|
+
autoSchedule: Mt,
|
|
2510
|
+
levelResources: Ln
|
|
2511
|
+
}, Symbol.toStringTag, { value: "Module" })), In = (t) => {
|
|
2512
|
+
const r = /* @__PURE__ */ new Map();
|
|
2513
|
+
return t.forEach((a) => {
|
|
2514
|
+
r.set(a.id, {
|
|
2515
|
+
taskId: a.id,
|
|
2516
|
+
start: new Date(a.start),
|
|
2517
|
+
end: new Date(a.end)
|
|
2518
|
+
});
|
|
2519
|
+
}), r;
|
|
2520
|
+
}, Tt = (t) => {
|
|
2521
|
+
const r = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority"], a = t.map((s) => [
|
|
2522
|
+
s.id,
|
|
2523
|
+
s.text,
|
|
2524
|
+
ce(s.start, "YYYY-MM-DD"),
|
|
2525
|
+
ce(s.end, "YYYY-MM-DD"),
|
|
2526
|
+
s.duration.toString(),
|
|
2527
|
+
`${s.progress}%`,
|
|
2528
|
+
s.type || "task",
|
|
2529
|
+
s.owner || "",
|
|
2530
|
+
s.priority || "medium"
|
|
2531
|
+
]), i = [
|
|
2532
|
+
r.join(","),
|
|
2533
|
+
...a.map((s) => s.map((p) => `"${p}"`).join(","))
|
|
2534
|
+
].join(`
|
|
2535
|
+
`);
|
|
2536
|
+
He(i, "gantt-tasks.csv", "text/csv");
|
|
2537
|
+
}, $t = (t) => {
|
|
2538
|
+
const r = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority", "Details"], a = t.map((s) => [
|
|
2539
|
+
s.id,
|
|
2540
|
+
s.text,
|
|
2541
|
+
ce(s.start, "MM/DD/YYYY"),
|
|
2542
|
+
ce(s.end, "MM/DD/YYYY"),
|
|
2543
|
+
s.duration.toString(),
|
|
2544
|
+
s.progress.toString(),
|
|
2545
|
+
s.type || "task",
|
|
2546
|
+
s.owner || "",
|
|
2547
|
+
s.priority || "medium",
|
|
2548
|
+
s.details || ""
|
|
2549
|
+
]), i = "\uFEFF" + [
|
|
2550
|
+
// BOM for UTF-8
|
|
2551
|
+
r.join(" "),
|
|
2552
|
+
...a.map((s) => s.map((p) => p.replace(/\t/g, " ")).join(" "))
|
|
2553
|
+
].join(`
|
|
2554
|
+
`);
|
|
2555
|
+
He(i, "gantt-tasks.xls", "application/vnd.ms-excel");
|
|
2556
|
+
}, kt = (t, r) => {
|
|
2557
|
+
const a = {
|
|
2558
|
+
tasks: t,
|
|
2559
|
+
links: r,
|
|
2560
|
+
exported: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2561
|
+
version: "1.0"
|
|
2562
|
+
}, i = JSON.stringify(a, null, 2);
|
|
2563
|
+
He(i, "gantt-project.json", "application/json");
|
|
2564
|
+
}, Ct = (t) => {
|
|
2565
|
+
const r = `
|
|
2566
|
+
GANTT CHART PROJECT
|
|
2567
|
+
Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
2568
|
+
|
|
2569
|
+
Tasks:
|
|
2570
|
+
${t.map((a, i) => `
|
|
2571
|
+
${i + 1}. ${a.text}
|
|
2572
|
+
Start: ${ce(a.start, "MM/DD/YYYY")}
|
|
2573
|
+
End: ${ce(a.end, "MM/DD/YYYY")}
|
|
2574
|
+
Duration: ${a.duration} days
|
|
2575
|
+
Progress: ${a.progress}%
|
|
2576
|
+
${a.owner ? `Owner: ${a.owner}` : ""}
|
|
2577
|
+
`).join(`
|
|
2578
|
+
`)}
|
|
2579
|
+
`.trim();
|
|
2580
|
+
He(r, "gantt-report.txt", "text/plain"), alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.");
|
|
2581
|
+
}, An = (t, r, a = "png") => {
|
|
2582
|
+
if (!document.getElementById(t)) {
|
|
2583
|
+
alert("Could not find Gantt chart element to export");
|
|
2584
|
+
return;
|
|
2585
|
+
}
|
|
2586
|
+
if (a === "svg") {
|
|
2587
|
+
alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");
|
|
2588
|
+
return;
|
|
2589
|
+
}
|
|
2590
|
+
alert("Image export requires html2canvas library. Install with: npm install html2canvas");
|
|
2591
|
+
}, He = (t, r, a) => {
|
|
2592
|
+
const i = new Blob([t], { type: a }), s = URL.createObjectURL(i);
|
|
2593
|
+
Bn(s, r), URL.revokeObjectURL(s);
|
|
2594
|
+
}, Bn = (t, r) => {
|
|
2595
|
+
const a = document.createElement("a");
|
|
2596
|
+
a.href = t, a.download = r, document.body.appendChild(a), a.click(), document.body.removeChild(a);
|
|
2597
|
+
}, zn = (t) => new Promise((r, a) => {
|
|
2598
|
+
const i = new FileReader();
|
|
2599
|
+
i.onload = (s) => {
|
|
2600
|
+
try {
|
|
2601
|
+
const p = s.target?.result, l = JSON.parse(p), o = l.tasks.map((c) => ({
|
|
2602
|
+
...c,
|
|
2603
|
+
start: new Date(c.start),
|
|
2604
|
+
end: new Date(c.end)
|
|
2605
|
+
}));
|
|
2606
|
+
r({ tasks: o, links: l.links || [] });
|
|
2607
|
+
} catch {
|
|
2608
|
+
a(new Error("Invalid JSON file"));
|
|
2609
|
+
}
|
|
2610
|
+
}, i.onerror = () => a(new Error("Failed to read file")), i.readAsText(t);
|
|
2611
|
+
}), ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2612
|
+
__proto__: null,
|
|
2613
|
+
exportToCSV: Tt,
|
|
2614
|
+
exportToExcel: $t,
|
|
2615
|
+
exportToImage: An,
|
|
2616
|
+
exportToJSON: kt,
|
|
2617
|
+
exportToPDF: Ct,
|
|
2618
|
+
importFromJSON: zn
|
|
2619
|
+
}, Symbol.toStringTag, { value: "Module" })), Hn = [
|
|
2620
|
+
{ name: "index", label: "", width: 40, align: "center" },
|
|
2621
|
+
{ name: "text", label: "Name", width: 300, align: "left", resize: !0 },
|
|
2622
|
+
{ name: "predecessors", label: "Depends on", width: 120, align: "left" },
|
|
2623
|
+
{ name: "duration", label: "Duration", width: 100, align: "left" },
|
|
2624
|
+
{ name: "start", label: "Start", width: 120, align: "left" },
|
|
2625
|
+
{ name: "add", label: "", width: 40, align: "center" }
|
|
2626
|
+
], Wn = [
|
|
2627
|
+
{ unit: "month", step: 1, format: "MMM" },
|
|
2628
|
+
{ unit: "day", step: 1, format: "D" }
|
|
2629
|
+
], rs = ({
|
|
2630
|
+
tasks: t,
|
|
2631
|
+
links: r = [],
|
|
2632
|
+
config: a = {},
|
|
2633
|
+
onTaskUpdate: i,
|
|
2634
|
+
onTaskCreate: s,
|
|
2635
|
+
onTaskDelete: p,
|
|
2636
|
+
onLinkCreate: l,
|
|
2637
|
+
onLinkDelete: o
|
|
2638
|
+
}) => {
|
|
2639
|
+
const {
|
|
2640
|
+
tasks: c,
|
|
2641
|
+
links: v,
|
|
2642
|
+
setTasks: b,
|
|
2643
|
+
setLinks: j,
|
|
2644
|
+
undo: k,
|
|
2645
|
+
redo: d,
|
|
2646
|
+
updateTask: u,
|
|
2647
|
+
createTask: T,
|
|
2648
|
+
deleteTask: _,
|
|
2649
|
+
saveState: m
|
|
2650
|
+
} = _n(t, r), [D, Y] = B(c), [L, O] = B(null), [A, X] = B(null), [te, x] = B(!1), [R, P] = B(!1), [J, U] = B(null), [E, S] = B(null), [g, $] = B(null), [w, h] = B(null), [f, n] = B(null), [y, C] = B(1), [N, H] = B(/* @__PURE__ */ new Map()), [K, I] = B(!1), [ee] = B(a.theme || "light"), [ne, q] = B({
|
|
2651
|
+
searchText: "",
|
|
2652
|
+
status: "all",
|
|
2653
|
+
priority: "all",
|
|
2654
|
+
owner: ""
|
|
2655
|
+
}), ue = Ve(null), he = Ve(null), Se = Ve(null), xe = {
|
|
2656
|
+
columns: Hn,
|
|
2657
|
+
scales: Wn,
|
|
2658
|
+
readonly: !1,
|
|
2659
|
+
editable: !0,
|
|
2660
|
+
taskHeight: 28,
|
|
2661
|
+
rowHeight: 44,
|
|
2662
|
+
scaleHeight: 28,
|
|
2663
|
+
columnWidth: 80,
|
|
2664
|
+
minColumnWidth: 60,
|
|
2665
|
+
autoSchedule: !1,
|
|
2666
|
+
criticalPath: !1,
|
|
2667
|
+
baselines: K,
|
|
2668
|
+
weekends: !0,
|
|
2669
|
+
holidays: [],
|
|
2670
|
+
theme: ee,
|
|
2671
|
+
locale: "en",
|
|
2672
|
+
...a
|
|
2673
|
+
};
|
|
2674
|
+
tt(() => {
|
|
2675
|
+
const M = Sn(c, ne);
|
|
2676
|
+
Y(((W) => {
|
|
2677
|
+
const Q = [], oe = (V) => {
|
|
2678
|
+
if (!V) return !1;
|
|
2679
|
+
const de = W.find((Z) => Z.id === V);
|
|
2680
|
+
return de && !de.open && de.type === "project" ? !0 : oe(de?.parent);
|
|
2681
|
+
};
|
|
2682
|
+
return W.forEach((V) => {
|
|
2683
|
+
oe(V.parent) || Q.push(V);
|
|
2684
|
+
}), Q;
|
|
2685
|
+
})(M));
|
|
2686
|
+
}, [c, ne]);
|
|
2687
|
+
const Et = Array.from(new Set(c.map((M) => M.owner).filter(Boolean))), Ft = (() => {
|
|
2688
|
+
const M = D.length > 0 ? D : c;
|
|
2689
|
+
if (M.length === 0) {
|
|
2690
|
+
const V = /* @__PURE__ */ new Date();
|
|
2691
|
+
return {
|
|
2692
|
+
start: Ye(ae(V, -30, "day")),
|
|
2693
|
+
end: Ye(ae(V, 60, "day"))
|
|
2694
|
+
};
|
|
2695
|
+
}
|
|
2696
|
+
const F = M.map((V) => V.start.getTime()), W = M.map((V) => V.end.getTime()), Q = new Date(Math.min(...F)), oe = new Date(Math.max(...W));
|
|
2697
|
+
return {
|
|
2698
|
+
start: Ye(ae(Q, -7, "day")),
|
|
2699
|
+
end: Ye(oe)
|
|
2700
|
+
};
|
|
2701
|
+
})(), Nt = (M) => {
|
|
2702
|
+
O(M);
|
|
2703
|
+
}, Pt = (M, F) => {
|
|
2704
|
+
if (xe.readonly) return;
|
|
2705
|
+
M.preventDefault();
|
|
2706
|
+
const W = c.find((Q) => Q.id === F);
|
|
2707
|
+
W && n({ x: M.clientX, y: M.clientY, task: W });
|
|
2708
|
+
}, Rt = () => {
|
|
2709
|
+
if (!f?.task) return;
|
|
2710
|
+
const M = f.task, F = {
|
|
2711
|
+
...M,
|
|
2712
|
+
id: `task-${Date.now()}`,
|
|
2713
|
+
text: `${M.text} (Copy)`,
|
|
2714
|
+
start: ae(M.start, 7, "day"),
|
|
2715
|
+
end: ae(M.end, 7, "day")
|
|
2716
|
+
};
|
|
2717
|
+
T(F), s && s(F);
|
|
2718
|
+
}, We = (M) => {
|
|
2719
|
+
if (!f?.task) return;
|
|
2720
|
+
const F = { ...f.task, type: M };
|
|
2721
|
+
u(F), i && i(F);
|
|
2722
|
+
}, _t = (M, F, W, Q) => {
|
|
2723
|
+
if (!xe.readonly)
|
|
2724
|
+
if (Q === "reorder") {
|
|
2725
|
+
const oe = D.findIndex((Z) => Z.id === M), V = (Z, le) => {
|
|
2726
|
+
let De = [];
|
|
2727
|
+
return le.filter((fe) => fe.parent === Z).forEach((fe) => {
|
|
2728
|
+
De.push(fe.id), De = [...De, ...V(fe.id, le)];
|
|
2729
|
+
}), De;
|
|
2730
|
+
}, de = V(M, c);
|
|
2731
|
+
$({ id: M, initialIndex: oe, currentY: W, descendantIds: de }), document.body.classList.add("gantt-dragging");
|
|
2732
|
+
} else
|
|
2733
|
+
S(M);
|
|
2734
|
+
}, Yt = () => {
|
|
2735
|
+
if (g && w) {
|
|
2736
|
+
const M = c.find((W) => W.id === g.id), F = c.find((W) => W.id === w.taskId);
|
|
2737
|
+
if (M && F && M.id !== F.id) {
|
|
2738
|
+
const W = [M.id, ...g.descendantIds];
|
|
2739
|
+
if (!W.includes(F.id)) {
|
|
2740
|
+
const Q = [...c];
|
|
2741
|
+
let oe = w.position === "inside" ? F.id : F.parent;
|
|
2742
|
+
const V = Q.findIndex((re) => re.id === M.id);
|
|
2743
|
+
V !== -1 && (Q[V] = { ...Q[V], parent: oe });
|
|
2744
|
+
const de = Q.filter((re) => W.includes(re.id)), Z = Q.filter((re) => !W.includes(re.id));
|
|
2745
|
+
let le = Z.findIndex((re) => re.id === F.id);
|
|
2746
|
+
if (w.position === "inside") {
|
|
2747
|
+
const re = Z.filter((fe) => fe.parent === F.id);
|
|
2748
|
+
re.length > 0 ? le = Z.findIndex((fe) => fe.id === re[re.length - 1].id) + 1 : le++;
|
|
2749
|
+
} else if (w.position === "below") {
|
|
2750
|
+
const re = (Je, et) => {
|
|
2751
|
+
let Pe = [];
|
|
2752
|
+
return et.filter((Re) => Re.parent === Je).forEach((Re) => {
|
|
2753
|
+
Pe.push(Re.id), Pe = [...Pe, ...re(Re.id, et)];
|
|
2754
|
+
}), Pe;
|
|
2755
|
+
}, fe = re(F.id, Z);
|
|
2756
|
+
fe.length > 0 ? le = Z.findIndex((Je) => Je.id === fe[fe.length - 1]) + 1 : le++;
|
|
2757
|
+
}
|
|
2758
|
+
const De = { tasks: [...c], links: [...v] };
|
|
2759
|
+
Z.splice(le, 0, ...de), b(Z), m("task_update", De, { tasks: Z, links: v });
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
S(null), $(null), h(null), document.body.classList.remove("gantt-dragging");
|
|
2764
|
+
}, Ot = (M) => {
|
|
2765
|
+
if (g) {
|
|
2766
|
+
const F = xe.rowHeight || 44, W = he.current?.querySelector(".gantt-grid-body");
|
|
2767
|
+
if (!W) return;
|
|
2768
|
+
const Q = W.getBoundingClientRect(), oe = M.clientY - Q.top;
|
|
2769
|
+
let V = Math.floor(oe / F);
|
|
2770
|
+
V = Math.max(0, Math.min(V, D.length - 1));
|
|
2771
|
+
const de = D[V];
|
|
2772
|
+
if (de) {
|
|
2773
|
+
const Z = oe - V * F;
|
|
2774
|
+
let le = "above";
|
|
2775
|
+
de.type === "project" ? Z < F * 0.3 ? le = "above" : Z > F * 0.7 ? le = "below" : le = "inside" : le = Z < F / 2 ? "above" : "below", de.id !== g.id ? h({ taskId: de.id, position: le }) : h(null);
|
|
2776
|
+
}
|
|
2777
|
+
$((Z) => Z ? { ...Z, currentY: M.clientY } : null);
|
|
2778
|
+
}
|
|
2779
|
+
}, Ze = () => {
|
|
2780
|
+
g && Yt();
|
|
2781
|
+
}, Lt = (M) => {
|
|
2782
|
+
const F = { ...M, id: `task-${Date.now()}` };
|
|
2783
|
+
T(F), s && s(F);
|
|
2784
|
+
}, Ue = (M) => {
|
|
2785
|
+
u(M), i && i(M);
|
|
2786
|
+
}, Ke = (M) => {
|
|
2787
|
+
_(M), p && p(M);
|
|
2788
|
+
}, Qe = (M, F, W, Q) => {
|
|
2789
|
+
const oe = { id: `link-${Date.now()}`, source: M, target: F, type: W, lag: Q };
|
|
2790
|
+
j([...v, oe]), l && l(oe);
|
|
2791
|
+
}, It = (M) => {
|
|
2792
|
+
const F = v.filter((W) => W.id !== M);
|
|
2793
|
+
j(F), o && o(M);
|
|
2794
|
+
}, At = () => {
|
|
2795
|
+
if (!K && N.size === 0) {
|
|
2796
|
+
const M = In(c);
|
|
2797
|
+
H(M), I(!0);
|
|
2798
|
+
} else I(!K);
|
|
2799
|
+
};
|
|
2800
|
+
return tt(() => {
|
|
2801
|
+
const M = (F) => {
|
|
2802
|
+
(F.ctrlKey || F.metaKey) && (F.key === "z" && !F.shiftKey ? (F.preventDefault(), k()) : (F.key === "y" || F.key === "z" && F.shiftKey) && (F.preventDefault(), d()));
|
|
2803
|
+
};
|
|
2804
|
+
return window.addEventListener("keydown", M), () => window.removeEventListener("keydown", M);
|
|
2805
|
+
}, [k, d]), /* @__PURE__ */ e.jsxs("div", { className: `gantt-page-wrapper theme-${ee}`, children: [
|
|
2806
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-page-header", children: /* @__PURE__ */ e.jsx("div", { className: "gantt-page-header-left", children: /* @__PURE__ */ e.jsx("h1", { className: "gantt-page-title", children: "Iris Gantt" }) }) }),
|
|
2807
|
+
/* @__PURE__ */ e.jsxs("div", { className: `gantt-container theme-${xe.theme}`, children: [
|
|
2808
|
+
/* @__PURE__ */ e.jsx(
|
|
2809
|
+
Dn,
|
|
2810
|
+
{
|
|
2811
|
+
zoomLevel: y,
|
|
2812
|
+
setZoomLevel: C,
|
|
2813
|
+
onBaselineToggle: At,
|
|
2814
|
+
showBaselines: K,
|
|
2815
|
+
onExport: (M) => {
|
|
2816
|
+
M === "csv" && Tt(c), M === "excel" && $t(c), M === "json" && kt(c, v), M === "pdf" && Ct(c);
|
|
2817
|
+
},
|
|
2818
|
+
onFilterChange: (M) => q(M),
|
|
2819
|
+
owners: Et,
|
|
2820
|
+
onAddTask: () => x(!0)
|
|
2821
|
+
}
|
|
2822
|
+
),
|
|
2823
|
+
/* @__PURE__ */ e.jsxs("div", { className: "gantt-layout", ref: Se, onMouseMove: Ot, onMouseUp: Ze, onMouseLeave: Ze, children: [
|
|
2824
|
+
/* @__PURE__ */ e.jsx(
|
|
2825
|
+
vt,
|
|
2826
|
+
{
|
|
2827
|
+
ref: he,
|
|
2828
|
+
tasks: D,
|
|
2829
|
+
columns: xe.columns || [],
|
|
2830
|
+
selectedTask: L,
|
|
2831
|
+
onTaskClick: Nt,
|
|
2832
|
+
onTaskContextMenu: Pt,
|
|
2833
|
+
onTaskUpdate: Ue,
|
|
2834
|
+
onTaskDragStart: _t,
|
|
2835
|
+
onAddTask: () => x(!0),
|
|
2836
|
+
onAddDependency: Qe,
|
|
2837
|
+
onDependencyClick: (M) => {
|
|
2838
|
+
const F = c.find((W) => W.id === M);
|
|
2839
|
+
F && (U(F), P(!0));
|
|
2840
|
+
},
|
|
2841
|
+
links: v,
|
|
2842
|
+
allTasks: c,
|
|
2843
|
+
dropIndicator: w,
|
|
2844
|
+
reorderTask: g
|
|
2845
|
+
}
|
|
2846
|
+
),
|
|
2847
|
+
/* @__PURE__ */ e.jsx(
|
|
2848
|
+
St,
|
|
2849
|
+
{
|
|
2850
|
+
ref: ue,
|
|
2851
|
+
tasks: D,
|
|
2852
|
+
links: v,
|
|
2853
|
+
range: Ft,
|
|
2854
|
+
scales: xe.scales,
|
|
2855
|
+
config: xe,
|
|
2856
|
+
selectedTask: L,
|
|
2857
|
+
draggedTask: E,
|
|
2858
|
+
onTaskClick: () => {
|
|
2859
|
+
},
|
|
2860
|
+
onTaskDragStart: () => {
|
|
2861
|
+
},
|
|
2862
|
+
onTaskDragEnd: () => {
|
|
2863
|
+
},
|
|
2864
|
+
onTaskUpdate: (M, F) => {
|
|
2865
|
+
const W = c.find((Q) => Q.id === M);
|
|
2866
|
+
W && Ue({ ...W, ...F });
|
|
2867
|
+
},
|
|
2868
|
+
zoomLevel: y,
|
|
2869
|
+
baselines: K ? N : /* @__PURE__ */ new Map()
|
|
2870
|
+
}
|
|
2871
|
+
)
|
|
2872
|
+
] }),
|
|
2873
|
+
te && /* @__PURE__ */ e.jsx(Cn, { onCreateTask: Lt, onClose: () => x(!1) }),
|
|
2874
|
+
A && /* @__PURE__ */ e.jsx(Nn, { task: A, onUpdate: Ue, onDelete: Ke, onClose: () => X(null) }),
|
|
2875
|
+
R && J && /* @__PURE__ */ e.jsx(
|
|
2876
|
+
Pn,
|
|
2877
|
+
{
|
|
2878
|
+
task: J,
|
|
2879
|
+
allTasks: c,
|
|
2880
|
+
links: v,
|
|
2881
|
+
onAddDependency: Qe,
|
|
2882
|
+
onRemoveDependency: It,
|
|
2883
|
+
onClose: () => {
|
|
2884
|
+
P(!1), U(null);
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
),
|
|
2888
|
+
f && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2889
|
+
/* @__PURE__ */ e.jsx("div", { className: "gantt-context-menu-overlay", onClick: () => n(null), onContextMenu: (M) => {
|
|
2890
|
+
M.preventDefault(), n(null);
|
|
2891
|
+
} }),
|
|
2892
|
+
/* @__PURE__ */ e.jsx(
|
|
2893
|
+
Rn,
|
|
2894
|
+
{
|
|
2895
|
+
x: f.x,
|
|
2896
|
+
y: f.y,
|
|
2897
|
+
task: f.task,
|
|
2898
|
+
onEdit: () => {
|
|
2899
|
+
f.task && X(f.task);
|
|
2900
|
+
},
|
|
2901
|
+
onDelete: () => {
|
|
2902
|
+
f.task && Ke(f.task.id);
|
|
2903
|
+
},
|
|
2904
|
+
onCopy: Rt,
|
|
2905
|
+
onDependencies: () => {
|
|
2906
|
+
f.task && (U(f.task), P(!0));
|
|
2907
|
+
},
|
|
2908
|
+
onConvertToMilestone: () => We("milestone"),
|
|
2909
|
+
onConvertToTask: () => We("task"),
|
|
2910
|
+
onConvertToProject: () => We("project"),
|
|
2911
|
+
onClose: () => n(null),
|
|
2912
|
+
onAutoSchedule: () => {
|
|
2913
|
+
const M = Mt(c, v, { mode: "forward" });
|
|
2914
|
+
b(M), n(null);
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
)
|
|
2918
|
+
] }),
|
|
2919
|
+
g && /* @__PURE__ */ e.jsx(
|
|
2920
|
+
"div",
|
|
2921
|
+
{
|
|
2922
|
+
className: "gantt-grid-row ghost-row",
|
|
2923
|
+
style: {
|
|
2924
|
+
height: xe.rowHeight,
|
|
2925
|
+
top: g.currentY - (xe.rowHeight || 48) / 2,
|
|
2926
|
+
left: he.current?.getBoundingClientRect().left,
|
|
2927
|
+
position: "fixed",
|
|
2928
|
+
pointerEvents: "none",
|
|
2929
|
+
opacity: 0.8,
|
|
2930
|
+
zIndex: 9999,
|
|
2931
|
+
width: he.current?.offsetWidth,
|
|
2932
|
+
backgroundColor: "#ffffff",
|
|
2933
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
2934
|
+
border: "1px solid #2196F3",
|
|
2935
|
+
display: "flex"
|
|
2936
|
+
},
|
|
2937
|
+
children: xe.columns?.map((M) => /* @__PURE__ */ e.jsx("div", { className: "gantt-grid-cell", style: { width: M.width, textAlign: M.align || "left" }, children: (() => {
|
|
2938
|
+
const F = c.find((W) => W.id === g.id);
|
|
2939
|
+
if (!F) return null;
|
|
2940
|
+
if (M.template) return M.template(F);
|
|
2941
|
+
switch (M.name) {
|
|
2942
|
+
case "text":
|
|
2943
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "gantt-grid-cell-text", children: [
|
|
2944
|
+
/* @__PURE__ */ e.jsx(z, { icon: xt, style: { marginRight: 8, color: "#adb5bd" } }),
|
|
2945
|
+
/* @__PURE__ */ e.jsxs("span", { className: "gantt-task-name-text", children: [
|
|
2946
|
+
F.text,
|
|
2947
|
+
g.descendantIds.length > 0 && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2948
|
+
" +",
|
|
2949
|
+
g.descendantIds.length,
|
|
2950
|
+
" subtasks"
|
|
2951
|
+
] })
|
|
2952
|
+
] })
|
|
2953
|
+
] });
|
|
2954
|
+
case "start":
|
|
2955
|
+
return ce(F.start, "DD MMM YYYY");
|
|
2956
|
+
case "duration":
|
|
2957
|
+
return `${F.duration}`;
|
|
2958
|
+
default:
|
|
2959
|
+
return F[M.name] || "";
|
|
2960
|
+
}
|
|
2961
|
+
})() }, `ghost-${M.name}`))
|
|
2962
|
+
}
|
|
2963
|
+
)
|
|
2964
|
+
] })
|
|
2965
|
+
] });
|
|
2966
|
+
}, Un = (t, r) => {
|
|
2967
|
+
const a = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
2968
|
+
t.forEach((d) => {
|
|
2969
|
+
s.set(d.id, []), p.set(d.id, []);
|
|
2970
|
+
}), r.forEach((d) => {
|
|
2971
|
+
d.type === "e2s" && (s.get(d.source)?.push(d.target), p.get(d.target)?.push(d.source));
|
|
2972
|
+
});
|
|
2973
|
+
const l = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), c = (d, u = /* @__PURE__ */ new Set()) => {
|
|
2974
|
+
if (u.has(d)) return;
|
|
2975
|
+
u.add(d);
|
|
2976
|
+
const T = t.find((m) => m.id === d);
|
|
2977
|
+
if (!T) return;
|
|
2978
|
+
const _ = p.get(d) || [];
|
|
2979
|
+
if (_.length === 0)
|
|
2980
|
+
l.set(d, 0), o.set(d, T.duration);
|
|
2981
|
+
else {
|
|
2982
|
+
let m = 0;
|
|
2983
|
+
_.forEach((D) => {
|
|
2984
|
+
c(D, u);
|
|
2985
|
+
const Y = o.get(D) || 0;
|
|
2986
|
+
m = Math.max(m, Y);
|
|
2987
|
+
}), l.set(d, m), o.set(d, m + T.duration);
|
|
2988
|
+
}
|
|
2989
|
+
};
|
|
2990
|
+
t.forEach((d) => c(d.id));
|
|
2991
|
+
const v = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), j = Math.max(...Array.from(o.values())), k = (d, u = /* @__PURE__ */ new Set()) => {
|
|
2992
|
+
if (u.has(d)) return;
|
|
2993
|
+
u.add(d);
|
|
2994
|
+
const T = t.find((m) => m.id === d);
|
|
2995
|
+
if (!T) return;
|
|
2996
|
+
const _ = s.get(d) || [];
|
|
2997
|
+
if (_.length === 0)
|
|
2998
|
+
b.set(d, j), v.set(d, j - T.duration);
|
|
2999
|
+
else {
|
|
3000
|
+
let m = 1 / 0;
|
|
3001
|
+
_.forEach((D) => {
|
|
3002
|
+
k(D, u);
|
|
3003
|
+
const Y = v.get(D) || 0;
|
|
3004
|
+
m = Math.min(m, Y);
|
|
3005
|
+
}), b.set(d, m), v.set(d, m - T.duration);
|
|
3006
|
+
}
|
|
3007
|
+
};
|
|
3008
|
+
return t.forEach((d) => k(d.id)), t.forEach((d) => {
|
|
3009
|
+
const u = l.get(d.id) || 0, _ = (v.get(d.id) || 0) - u;
|
|
3010
|
+
i.set(d.id, _), Math.abs(_) < 0.01 && a.add(d.id);
|
|
3011
|
+
}), {
|
|
3012
|
+
criticalTasks: a,
|
|
3013
|
+
taskFloats: i,
|
|
3014
|
+
projectDuration: j
|
|
3015
|
+
};
|
|
3016
|
+
}, Jn = (t, r) => r.criticalTasks.has(t), Vn = (t, r) => r.taskFloats.get(t) || 0, as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3017
|
+
__proto__: null,
|
|
3018
|
+
calculateCriticalPath: Un,
|
|
3019
|
+
getTaskFloat: Vn,
|
|
3020
|
+
isCriticalTask: Jn
|
|
3021
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3022
|
+
export {
|
|
3023
|
+
ns as AutoScheduler,
|
|
3024
|
+
St as Chart,
|
|
3025
|
+
as as CriticalPath,
|
|
3026
|
+
Pn as DependencyEditor,
|
|
3027
|
+
ss as ExportUtils,
|
|
3028
|
+
bn as FilterSearch,
|
|
3029
|
+
rs as Gantt,
|
|
3030
|
+
vt as Grid,
|
|
3031
|
+
yn as TaskBar,
|
|
3032
|
+
Cn as TaskCreator,
|
|
3033
|
+
Nn as TaskEditor,
|
|
3034
|
+
bt as Timeline,
|
|
3035
|
+
Dn as Toolbar,
|
|
3036
|
+
ae as addToDate,
|
|
3037
|
+
Sn as applyFilters,
|
|
3038
|
+
ts as calculateDuration,
|
|
3039
|
+
In as createBaseline,
|
|
3040
|
+
ce as formatDate,
|
|
3041
|
+
Ie as getDaysBetween,
|
|
3042
|
+
es as getEndOfDay,
|
|
3043
|
+
un as getHoursBetween,
|
|
3044
|
+
Ye as getStartOfDay,
|
|
3045
|
+
ct as isHoliday,
|
|
3046
|
+
lt as isWeekend,
|
|
3047
|
+
_n as useUndoRedo
|
|
3048
|
+
};
|